Community
Participate
Working Groups
Build 20020508 In the following example the start/length of the if/then/else cascade is 344/258. It should be 344/250. import java.io.IOException; import java.net.MalformedURLException; import java.nio.charset.MalformedInputException; import java.util.List; import javax.naming.MalformedLinkException; class A { private List field; public void l() throws IOException, MalformedURLException, MalformedLinkException, MalformedInputException { if (field != null) { throw new IOException(); } else if (field == null) { throw new MalformedURLException(); } else if (field == null) { throw new MalformedLinkException(); } else { throw new MalformedInputException(10); } } }
This is a result of inconsistent positions returned by the compiler's ast nodes. When I wanted to fix the compiler's ast nodes, it was the right way to fix this problem. You refused to do so, because you relied on these old positions. Is it still the case? Fixing the positions inside the AST converter is really ugly and I really would like to do it inside the parser.
Since we converted everything to the new AST we should be fine if you start changing positions in the old AST.
I changed only the positions for the ifStatement. The update in the Parser is clean whereas code in the ASTConverter looks more like a hack. Fixed and released in HEAD.