Skip to content
Permalink
Browse files

8260169: LogCompilation: Unexpected method mismatch

Reviewed-by: kvn, vlivanov
  • Loading branch information
Eric Caspole committed Jan 25, 2021
1 parent 6e03735 commit d076977d036f141f2a3d57a373ecdb6ecdc4a7a9
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1000,10 +1000,13 @@ public void startElement(String uri, String localName, String qname, Attributes
}
methods.put(id, m);
} else if (qname.equals("call")) {
if (scopes.peek() == null) {
Phase p = phaseStack.peek();
assert p != null && p.getName().equals("optimizer") : "should not be in parse here";
} else {
Phase p = phaseStack.peek();
if (scopes.peek() == null && p != null) {
// Do not process other phases when scopes is null
if (p.getName().equals("parse")) {
reportInternalError( "should not be in parse here:" + p.getName());
}
} else {
if (methodHandleSite != null) {
methodHandleSite = null;
}
@@ -1054,9 +1057,12 @@ public void startElement(String uri, String localName, String qname, Attributes
} else if (qname.equals("replace_string_concat")) {
expectStringConcatTrap = true;
} else if (qname.equals("inline_fail")) {
if (scopes.peek() == null) {
Phase p = phaseStack.peek();
assert p != null && p.getName().equals("optimizer") : "should not be in parse here";
Phase p = phaseStack.peek();
if (scopes.peek() == null && p != null) {
// Do not process other phases when scopes is null
if (p.getName().equals("parse")) {
reportInternalError( "should not be in parse here:" + p.getName());
}
} else {
if (methodHandleSite != null) {
scopes.peek().add(methodHandleSite);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@

import java.util.Arrays;
import java.util.Collection;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -125,76 +126,77 @@ public TestLogCompilation(String logFile) {
this.logFile = logFile;
}

void doItOrFail(String[] args) {
try {
LogCompilation.main(args);
} catch (Throwable e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}

@Test
public void testDashi() throws Exception {
String[] args = {"-i",
public void testDefault() throws Exception {
String[] args = {
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashiDasht() throws Exception {
public void testDashi() throws Exception {
String[] args = {"-i",
"-t",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDefault() throws Exception {
String[] args = {
public void testDashiDasht() throws Exception {
String[] args = {"-i",
"-t",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashS() throws Exception {
String[] args = {"-S",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashU() throws Exception {
String[] args = {"-U",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashe() throws Exception {
String[] args = {"-e",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashn() throws Exception {
String[] args = {"-n",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}

@Test
public void testDashz() throws Exception {
String[] args = {"-z",
logFile
};

LogCompilation.main(args);
doItOrFail(args);
}
}

1 comment on commit d076977

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on d076977 Jan 25, 2021

Please sign in to comment.