Merge branch 'bug-1530' into pmd/5.4.x
This commit is contained in:
@ -1,4 +1,11 @@
|
||||
/**
|
||||
* Fix for regression introduced in previous changeset.
|
||||
* The syntactic lookahead was not properly handled by javacc,
|
||||
* so it was converted to a semantic one
|
||||
* Bug #1530
|
||||
*
|
||||
* Juan Martin Sotuyo Dodero 10/2016
|
||||
*====================================================================
|
||||
* Fix for an expression within an additive expression that was
|
||||
* wrongly taken as a cast expression.
|
||||
* Bug #1484
|
||||
@ -1761,7 +1768,7 @@ void UnaryExpressionNotPlusMinus() #UnaryExpressionNotPlusMinus((jjtn000.getImag
|
||||
{}
|
||||
{
|
||||
( "~" {jjtThis.setImage("~");} | "!" {jjtThis.setImage("!");} ) UnaryExpression()
|
||||
| LOOKAHEAD("(" <IDENTIFIER> ")" "+") PostfixExpression()
|
||||
| LOOKAHEAD( { getToken(1).kind == LPAREN && getToken(2).kind == IDENTIFIER && getToken(3).kind == RPAREN && getToken(4).kind == PLUS } ) PostfixExpression()
|
||||
| LOOKAHEAD( CastExpression() ) CastExpression()
|
||||
| LOOKAHEAD("(" Type() ")" "(") CastExpression()
|
||||
| PostfixExpression()
|
||||
@ -1843,9 +1850,8 @@ void PrimarySuffix() :
|
||||
}
|
||||
|
||||
void Literal() :
|
||||
{}
|
||||
{
|
||||
{ Token t;}
|
||||
{
|
||||
t=<INTEGER_LITERAL> { checkForBadNumericalLiteralslUsage(t); jjtThis.setImage(t.image); jjtThis.setIntLiteral();}
|
||||
| t=<FLOATING_POINT_LITERAL> { checkForBadNumericalLiteralslUsage(t); jjtThis.setImage(t.image); jjtThis.setFloatLiteral();}
|
||||
| t=<HEX_FLOATING_POINT_LITERAL> { checkForBadHexFloatingPointLiteral(); checkForBadNumericalLiteralslUsage(t); jjtThis.setImage(t.image); jjtThis.setFloatLiteral();}
|
||||
|
@ -130,6 +130,12 @@ public class ParserCornersTest extends ParserTst {
|
||||
String c = IOUtils.toString(this.getClass().getResourceAsStream("Bug1429.java"));
|
||||
parseJava18(c);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBug1530ParseError() throws Exception {
|
||||
String c = IOUtils.toString(this.getClass().getResourceAsStream("Bug1530.java"));
|
||||
parseJava18(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* This triggered bug #1484 UnusedLocalVariable - false positive - parenthesis
|
||||
|
@ -0,0 +1,5 @@
|
||||
public class Bug1530 {
|
||||
public void incChild() {
|
||||
((PathElement) stack.getLastLeaf().getUserObject()).currentChild++;
|
||||
}
|
||||
}
|
@ -12,11 +12,13 @@
|
||||
|
||||
* [#35](https://github.com/adangel/pmd/pull/35): Javascript tokenizer now ignores comment tokens.
|
||||
* [#103](https://github.com/pmd/pmd/pull/103): \[java] \[apex] Fix for 1501: CyclomaticComplexity rule causes OOM when class reporting is disabled
|
||||
* [#110](https://github.com/pmd/pmd/pull/110): \[java] Fix parser error (issue 1530)
|
||||
|
||||
**Bugfixes:**
|
||||
|
||||
* Java
|
||||
* [#1501](https://sourceforge.net/p/pmd/bugs/1501/): \[java] \[apex] CyclomaticComplexity rule causes OOM when class reporting is disabled
|
||||
* [#1530](https://sourceforge.net/p/pmd/bugs/1530/): \[java] Parser exception on Java code
|
||||
* java-comments
|
||||
* [#1522](https://sourceforge.net/p/pmd/bugs/1522/): \[java] CommentRequired: false positive
|
||||
* java-imports/UnusedImports
|
||||
|
Reference in New Issue
Block a user