A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/wiki/Java_clean_changes below:

Java_clean_changes · pmd/pmd Wiki · GitHub

Code Old AST New AST

Method

@A
public void set(int x) { }
ClassOrInterfaceBodyDeclaration
  + Annotation
    + MarkerAnnotation
      + Name "A"
  + MethodDeclaration
    + ResultType[@Void=true]
    + ...
MethodDeclaration
  + ModifierList
    + Annotation "A"
  + VoidType
  + ...

Top-level type declaration

TypeDeclaration
  + Annotation
    + MarkerAnnotation
      + Name "A"
  + ClassOrInterfaceDeclaration
    + ClassOrInterfaceBody
TypeDeclaration
  + ClassOrInterfaceDeclaration
     + ModifierList
       + Annotation "A"
     + ClassOrInterfaceBody

Cast expression

N/A (Parse error)

CastExpression
  + ClassOrInterfaceType "S"
    + Annotation "B"
    + ClassOrInterfaceType "T"
      + Annotation "A"
  + (Expression `expr`)

Cast expression with intersection

CastExpression
  + MarkerAnnotation "A"
  + ClassOrInterfaceType "T"
  + ClassOrInterfaceType "S"
  + (Expression `expr`)
CastExpression
  + IntersectionType
    + ClassOrInterfaceType "T"
      + Annotation "A"
    + ClassOrInterfaceType "S"
  + (Expression `expr`)

Notice @A binds to T, not T & S

Constructor call

AllocationExpression
  + MarkerAnnotation "A"
  + Type
    + ReferenceType
      + ClassOrInterfaceType "T"
  + Arguments
ConstructorCall
  + ClassOrInterfaceType "T"
    + Annotation "A"
  + ArgumentsList

Array allocation

AllocationExpression
  + MarkerAnnotation "A"
  + Type
    + PrimitiveType "int"
  + ArrayDimsAndInits
    + Expression
      + PrimaryExpression
        + Literal "0"
ArrayAllocation
  + PrimitiveType "int"
    + Annotation "A"
  + ArrayAllocationDims
    + ArrayDimExpr
      + NumericLiteral "0"

Array type

N/A (parse error)

ArrayType
  + PrimitiveType "int"
    + Annotation "A"
  + ArrayTypeDims
    + ArrayTypeDim
      + Annotation "B"

Notice @A binds to int, not int[]

Type parameters

<@A T, @B S extends @C Object>
TypeParameters
  + MarkerAnnotation "A"
  + TypeParameter "T"
  + MarkerAnnotation "B"
  + TypeParameter "S"
    + MarkerAnnotation "C"
    + TypeBound
      + ReferenceType
        + ClassOrInterfaceType "Object"
TypeParameters
  + TypeParameter "T"
    + Annotation "A"
  + TypeParameter "S"
    + Annotation "B"
    + ClassOrInterfaceType "Object"
      + Annotation "C"
  

Enum constants

EnumBody
  + MarkerAnnotation "A"
  + EnumConstant "E1"
  + MarkerAnnotation "B"
  + EnumConstant "E2"
EnumBody
  + EnumConstant "E1"
    + ModifierList
      + Annotation "A"
    + VariableDeclaratorId "E1"
  + EnumConstant "E2"
    + ModifierList
      + Annotation "B"
    + VariableDeclaratorId "E1"

What: Additional nodes ArrayType, ArrayTypeDim, ArrayTypeDims, ArrayAllocation.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4