analyzeAttribute throwing NullPointException when [^name] clause is used #293
Labels
attributes
Component-SyntaxAndParsing
Related to the Umple grammar and the parser that builds the abstract syntax tree and analyses models
Priority-Medium
This problem or request is likely to be of significant benefit if dealt with
syntax
Type-Defect
Originally reported on Google Code with ID 394
Owned by
atojet
Steps to reproduce in revision 2787:
in the umple_classes.grammar file, make the following change
build with 'ant -f build.umple.xml -Dmyenv=local umpleSelf compile packageMainJar'
and observe the exception being thrown:
umpleSelf:
[java] cruise.umple/src/Master.ump
[java] Umple compiler error. Stack trace follows
[java] To locate the error in the original Umple source, set GeneratedSourcePath
to where the generated Java is located:
[java] e.g. setenv GeneratedSourcePath ~/umple/cruise.umple/src-gen-umple
[java] Exception java.lang.NullPointerException in
[java] java.lang.NullPointerException
[java] at java.util.regex.Matcher.getTextLength(Matcher.java:1234)
[java] at java.util.regex.Matcher.reset(Matcher.java:308)
[java] at java.util.regex.Matcher.(Matcher.java:228)
[java] at java.util.regex.Pattern.matcher(Pattern.java:1088)
[java] at java.util.regex.Pattern.matches(Pattern.java:1129)
[java] at cruise.umple.compiler.Token.isValidIdentifier(Parser_Code.ump:94)
[java] at cruise.umple.compiler.Token.isValidIdentifier(Parser_Code.ump:101)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeAttribute(UmpleInternalParser_CodeClass.ump:1817)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeClassToken(UmpleInternalParser_CodeClass.ump:162)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeToken(UmpleInternalParser_Code.ump:162)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeAllTokens(UmpleInternalParser_Code.ump:138)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeClass(UmpleInternalParser.java:1281)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeClassToken(UmpleInternalParser_CodeClass.ump:82)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeToken(UmpleInternalParser_Code.ump:152)
[java] at cruise.umple.compiler.UmpleInternalParser.analyzeAllTokens(UmpleInternalParser_Code.ump:114)
[java] at cruise.umple.compiler.UmpleInternalParser.analyze(UmpleInternalParser_Code.ump:80)
[java] at cruise.umple.compiler.UmpleModel.run(Umple_Code.ump:172)
[java] at cruise.umple.UmpleConsoleMain.main(Main_Code.ump:69)
This appears to be happening because the subToken "name" is being parsed as "^name"
instead, so a getValue("name") is failing and isValidIdentifier is being called with
a null value being passed as parameter.
Reported by
atojet
on 2013-06-04 18:01:11The text was updated successfully, but these errors were encountered: