You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java() does not detect anonymous inner classes when embedded in constructor argument #1658
public static void main(String[] args) {
File f = new File(
new File("a") {
public String toString() {
return "b";
}
}.toString()
) {
public String toString() {
return "c";
}
};
}
}
nijtmans said at 2007-05-23 02:07:04
Created an attachment (id=191)
proposed fix
nijtmans said at 2007-05-23 02:14:11
We were so stuck with this bug that we decided to develop a fix for this: It
was less work than introduce workarounds for it in our code.
This fix is tested on serveral thousends of real-life java files. Originally,
7 of them had anonimous internal classes which were undetected by the
parser, this implementation now detects all of them.
We did this by modifying AnonClassState allow it to handle round braces
as well, and also allowing it to call itself recursively. This handles
all situations we can think of.
stevenknight said at 2007-05-23 05:22:16
Fix integrated for next release. Many thanks for the fix, and for the
straightforward test case.
nijtmans attached fix1658.txt at 2007-05-23 02:07:04.
proposed fix
stevenknight said this issue blocks #1664 at 2007-05-23 05:22:16.
Activity