From 82e3e91b2866823031bb947bc820addc73c787c3 Mon Sep 17 00:00:00 2001 From: Alexander Weigl Date: Fri, 15 Nov 2024 23:49:26 +0100 Subject: [PATCH] fix regression bug in printer regenerate meta-/model --- .../github/javaparser/CommentsInserter.java | 5 +- .../com/github/javaparser/HasParentNode.java | 2 +- .../com/github/javaparser/JavaParser.java | 92 ++-- .../github/javaparser/JavaParserAdapter.java | 64 +-- .../java/com/github/javaparser/JavaToken.java | 80 ++-- .../LineEndingProcessingProvider.java | 12 +- .../javaparser/ParseProblemException.java | 8 +- .../com/github/javaparser/ParseResult.java | 18 +- .../com/github/javaparser/ParseStart.java | 2 +- .../javaparser/ParserConfiguration.java | 86 ++-- .../java/com/github/javaparser/Position.java | 34 +- .../java/com/github/javaparser/Problem.java | 14 +- .../java/com/github/javaparser/Processor.java | 6 +- .../java/com/github/javaparser/Range.java | 42 +- .../com/github/javaparser/TokenRange.java | 22 +- .../com/github/javaparser/TokenTypes.java | 2 +- .../UnicodeEscapeProcessingProvider.java | 56 +-- .../javaparser/ast/AbstractModifier.java | 8 +- .../javaparser/ast/AccessSpecifier.java | 4 +- .../javaparser/ast/AllFieldsConstructor.java | 2 +- .../javaparser/ast/ArrayCreationLevel.java | 34 +- .../javaparser/ast/CompilationUnit.java | 130 +++--- .../com/github/javaparser/ast/DataKey.java | 4 +- .../com/github/javaparser/ast/Generated.java | 2 +- .../javaparser/ast/ImportDeclaration.java | 40 +- .../com/github/javaparser/ast/Jmlish.java | 2 +- .../com/github/javaparser/ast/Modifier.java | 28 +- .../java/com/github/javaparser/ast/Node.java | 170 +++---- .../com/github/javaparser/ast/NodeList.java | 140 +++--- .../javaparser/ast/PackageDeclaration.java | 30 +- .../ast/body/AnnotationDeclaration.java | 30 +- .../ast/body/AnnotationMemberDeclaration.java | 50 +- .../javaparser/ast/body/BodyDeclaration.java | 208 ++++----- .../ast/body/CallableDeclaration.java | 66 +-- .../ast/body/ClassAccessibleClause.java | 2 +- .../ast/body/ClassOrInterfaceDeclaration.java | 58 +-- .../ast/body/ClassRepresentsClause.java | 2 +- .../body/CompactConstructorDeclaration.java | 58 +-- .../ast/body/ConstructorDeclaration.java | 56 +-- .../ast/body/EnumConstantDeclaration.java | 44 +- .../javaparser/ast/body/EnumDeclaration.java | 48 +- .../javaparser/ast/body/FieldDeclaration.java | 62 +-- .../ast/body/InitializerDeclaration.java | 34 +- .../ast/body/MethodDeclaration.java | 78 ++-- .../github/javaparser/ast/body/Parameter.java | 54 +-- .../ast/body/ReceiverParameter.java | 36 +- .../ast/body/RecordDeclaration.java | 60 +-- .../javaparser/ast/body/TypeDeclaration.java | 46 +- .../ast/body/VariableDeclarator.java | 46 +- .../javaparser/ast/comments/BlockComment.java | 28 +- .../javaparser/ast/comments/Comment.java | 50 +- .../ast/comments/CommentsCollection.java | 24 +- .../ast/comments/JavadocComment.java | 30 +- .../javaparser/ast/comments/LineComment.java | 28 +- .../javaparser/ast/expr/AnnotationExpr.java | 26 +- .../javaparser/ast/expr/ArrayAccessExpr.java | 34 +- .../ast/expr/ArrayCreationExpr.java | 50 +- .../ast/expr/ArrayInitializerExpr.java | 32 +- .../javaparser/ast/expr/AssignExpr.java | 44 +- .../javaparser/ast/expr/BinaryExpr.java | 44 +- .../ast/expr/BooleanLiteralExpr.java | 30 +- .../github/javaparser/ast/expr/CastExpr.java | 34 +- .../javaparser/ast/expr/CharLiteralExpr.java | 30 +- .../github/javaparser/ast/expr/ClassExpr.java | 30 +- .../javaparser/ast/expr/ConditionalExpr.java | 40 +- .../ast/expr/DoubleLiteralExpr.java | 30 +- .../javaparser/ast/expr/EnclosedExpr.java | 32 +- .../javaparser/ast/expr/Expression.java | 430 +++++++++--------- .../javaparser/ast/expr/FieldAccessExpr.java | 48 +- .../javaparser/ast/expr/InstanceOfExpr.java | 46 +- .../ast/expr/IntegerLiteralExpr.java | 32 +- .../javaparser/ast/expr/LambdaExpr.java | 58 +-- .../javaparser/ast/expr/LiteralExpr.java | 16 +- .../ast/expr/LiteralStringValueExpr.java | 20 +- .../javaparser/ast/expr/LongLiteralExpr.java | 32 +- .../ast/expr/MarkerAnnotationExpr.java | 26 +- .../javaparser/ast/expr/MemberValuePair.java | 28 +- .../javaparser/ast/expr/MethodCallExpr.java | 62 +-- .../ast/expr/MethodReferenceExpr.java | 44 +- .../com/github/javaparser/ast/expr/Name.java | 38 +- .../github/javaparser/ast/expr/NameExpr.java | 34 +- .../ast/expr/NormalAnnotationExpr.java | 36 +- .../javaparser/ast/expr/NullLiteralExpr.java | 22 +- .../ast/expr/ObjectCreationExpr.java | 58 +-- .../javaparser/ast/expr/PatternExpr.java | 24 +- .../ast/expr/RecordPatternExpr.java | 38 +- .../javaparser/ast/expr/SimpleName.java | 22 +- .../ast/expr/SingleMemberAnnotationExpr.java | 30 +- .../ast/expr/StringLiteralExpr.java | 30 +- .../github/javaparser/ast/expr/SuperExpr.java | 36 +- .../javaparser/ast/expr/SwitchExpr.java | 38 +- .../ast/expr/TextBlockLiteralExpr.java | 32 +- .../github/javaparser/ast/expr/ThisExpr.java | 38 +- .../github/javaparser/ast/expr/TypeExpr.java | 30 +- .../javaparser/ast/expr/TypePatternExpr.java | 36 +- .../github/javaparser/ast/expr/UnaryExpr.java | 46 +- .../ast/expr/VariableDeclarationExpr.java | 52 +-- .../ast/jml/ArbitraryNodeContainer.java | 14 +- .../ast/jml/DefaultJmlContainer.java | 14 +- .../github/javaparser/ast/jml/HasJmlTags.java | 2 +- .../javaparser/ast/jml/JmlContainer.java | 2 +- .../github/javaparser/ast/jml/JmlKeyword.java | 2 +- .../javaparser/ast/jml/JmlModelProgram.java | 24 +- .../javaparser/ast/jml/NodeWithContracts.java | 2 +- .../javaparser/ast/jml/NodeWithJmlTags.java | 2 +- .../body/JmlClassAccessibleDeclaration.java | 52 +-- .../ast/jml/body/JmlClassExprDeclaration.java | 64 +-- .../jml/body/JmlClassLevelDeclaration.java | 24 +- .../ast/jml/body/JmlFieldDeclaration.java | 36 +- .../ast/jml/body/JmlMethodDeclaration.java | 42 +- .../jml/body/JmlRepresentsDeclaration.java | 42 +- .../ast/jml/body/JmlSpecification.java | 2 +- .../ast/jml/clauses/BlockContractable.java | 2 +- .../ast/jml/clauses/ContractType.java | 4 +- .../ast/jml/clauses/JmlCallableClause.java | 34 +- .../javaparser/ast/jml/clauses/JmlClause.java | 94 ++-- .../ast/jml/clauses/JmlClauseIf.java | 38 +- .../ast/jml/clauses/JmlClauseKind.java | 4 +- .../ast/jml/clauses/JmlClauseLabel.java | 48 +- .../ast/jml/clauses/JmlContract.java | 62 +-- .../ast/jml/clauses/JmlForallClause.java | 32 +- .../ast/jml/clauses/JmlMethodSignature.java | 30 +- .../ast/jml/clauses/JmlMultiExprClause.java | 44 +- .../ast/jml/clauses/JmlOldClause.java | 30 +- .../ast/jml/clauses/JmlSignalsClause.java | 36 +- .../ast/jml/clauses/JmlSignalsOnlyClause.java | 38 +- .../ast/jml/clauses/JmlSimpleExprClause.java | 52 +-- .../ast/jml/clauses/LoopContractable.java | 2 +- .../ast/jml/clauses/MethodContractable.java | 2 +- .../github/javaparser/ast/jml/doc/JmlDoc.java | 18 +- .../ast/jml/doc/JmlDocContainer.java | 2 +- .../ast/jml/doc/JmlDocDeclaration.java | 36 +- .../ast/jml/doc/JmlDocModifier.java | 10 +- .../javaparser/ast/jml/doc/JmlDocStmt.java | 34 +- .../javaparser/ast/jml/doc/JmlDocType.java | 36 +- .../ast/jml/expr/JmlBinaryInfixExpr.java | 40 +- .../javaparser/ast/jml/expr/JmlLabelExpr.java | 56 +-- .../javaparser/ast/jml/expr/JmlLetExpr.java | 34 +- .../ast/jml/expr/JmlMultiCompareExpr.java | 40 +- .../ast/jml/expr/JmlQuantifiedExpr.java | 58 +-- .../ast/jml/expr/JmlSetComprehensionExpr.java | 42 +- .../javaparser/ast/jml/expr/JmlTypeExpr.java | 28 +- .../javaparser/ast/jml/stmt/JmlBeginStmt.java | 30 +- .../javaparser/ast/jml/stmt/JmlEndStmt.java | 30 +- .../ast/jml/stmt/JmlExpressionStmt.java | 62 +-- .../javaparser/ast/jml/stmt/JmlGhostStmt.java | 44 +- .../javaparser/ast/jml/stmt/JmlLabelStmt.java | 34 +- .../ast/jml/stmt/JmlRefiningStmt.java | 30 +- .../javaparser/ast/jml/stmt/JmlStatement.java | 16 +- .../ast/jml/stmt/JmlUnreachableStmt.java | 38 +- .../javaparser/ast/jml/type/JmlLogicType.java | 26 +- .../ast/modules/ModuleDeclaration.java | 42 +- .../ast/modules/ModuleDirective.java | 88 ++-- .../ast/modules/ModuleExportsDirective.java | 46 +- .../ast/modules/ModuleOpensDirective.java | 44 +- .../ast/modules/ModuleProvidesDirective.java | 44 +- .../ast/modules/ModuleRequiresDirective.java | 50 +- .../ast/modules/ModuleUsesDirective.java | 40 +- .../ast/nodeTypes/NodeWithAnnotations.java | 2 +- .../ast/nodeTypes/NodeWithArguments.java | 2 +- .../ast/nodeTypes/NodeWithBlockStmt.java | 2 +- .../ast/nodeTypes/NodeWithBody.java | 2 +- .../ast/nodeTypes/NodeWithCondition.java | 2 +- .../ast/nodeTypes/NodeWithDeclaration.java | 2 +- .../ast/nodeTypes/NodeWithExpression.java | 2 +- .../ast/nodeTypes/NodeWithExtends.java | 2 +- .../ast/nodeTypes/NodeWithIdentifier.java | 2 +- .../ast/nodeTypes/NodeWithImplements.java | 2 +- .../ast/nodeTypes/NodeWithJavadoc.java | 2 +- .../ast/nodeTypes/NodeWithMembers.java | 2 +- .../ast/nodeTypes/NodeWithModifiers.java | 2 +- .../ast/nodeTypes/NodeWithName.java | 2 +- .../nodeTypes/NodeWithOptionalBlockStmt.java | 2 +- .../ast/nodeTypes/NodeWithOptionalLabel.java | 2 +- .../ast/nodeTypes/NodeWithOptionalScope.java | 2 +- .../ast/nodeTypes/NodeWithParameters.java | 6 +- .../ast/nodeTypes/NodeWithRange.java | 2 +- .../ast/nodeTypes/NodeWithScope.java | 2 +- .../ast/nodeTypes/NodeWithSimpleName.java | 2 +- .../ast/nodeTypes/NodeWithStatements.java | 2 +- .../nodeTypes/NodeWithThrownExceptions.java | 2 +- .../ast/nodeTypes/NodeWithTokenRange.java | 2 +- .../nodeTypes/NodeWithTraversableScope.java | 2 +- .../ast/nodeTypes/NodeWithType.java | 2 +- .../ast/nodeTypes/NodeWithTypeArguments.java | 2 +- .../ast/nodeTypes/NodeWithTypeParameters.java | 2 +- .../ast/nodeTypes/NodeWithVariables.java | 2 +- .../javaparser/ast/nodeTypes/SwitchNode.java | 2 +- .../modifiers/NodeWithAbstractModifier.java | 2 +- .../modifiers/NodeWithAccessModifiers.java | 2 +- .../modifiers/NodeWithFinalModifier.java | 2 +- .../modifiers/NodeWithPrivateModifier.java | 2 +- .../modifiers/NodeWithProtectedModifier.java | 2 +- .../modifiers/NodeWithPublicModifier.java | 2 +- .../modifiers/NodeWithStaticModifier.java | 2 +- .../modifiers/NodeWithStrictfpModifier.java | 2 +- .../javaparser/ast/observer/AstObserver.java | 2 +- .../ast/observer/AstObserverAdapter.java | 8 +- .../javaparser/ast/observer/Observable.java | 2 +- .../ast/observer/ObservableProperty.java | 32 +- .../ast/observer/PropagatingAstObserver.java | 16 +- .../javaparser/ast/stmt/AssertStmt.java | 40 +- .../github/javaparser/ast/stmt/Behavior.java | 4 +- .../github/javaparser/ast/stmt/BlockStmt.java | 40 +- .../github/javaparser/ast/stmt/BreakStmt.java | 36 +- .../javaparser/ast/stmt/CatchClause.java | 28 +- .../javaparser/ast/stmt/ContinueStmt.java | 36 +- .../github/javaparser/ast/stmt/DoStmt.java | 44 +- .../github/javaparser/ast/stmt/EmptyStmt.java | 22 +- .../ExplicitConstructorInvocationStmt.java | 50 +- .../javaparser/ast/stmt/ExpressionStmt.java | 30 +- .../javaparser/ast/stmt/ForEachStmt.java | 54 +-- .../github/javaparser/ast/stmt/ForStmt.java | 54 +-- .../github/javaparser/ast/stmt/IfStmt.java | 50 +- .../javaparser/ast/stmt/LabeledStmt.java | 36 +- .../ast/stmt/LocalClassDeclarationStmt.java | 30 +- .../ast/stmt/LocalRecordDeclarationStmt.java | 30 +- .../javaparser/ast/stmt/ReturnStmt.java | 36 +- .../github/javaparser/ast/stmt/Statement.java | 306 ++++++------- .../javaparser/ast/stmt/SwitchEntry.java | 52 +-- .../javaparser/ast/stmt/SwitchStmt.java | 38 +- .../javaparser/ast/stmt/SynchronizedStmt.java | 34 +- .../github/javaparser/ast/stmt/ThrowStmt.java | 30 +- .../github/javaparser/ast/stmt/TryStmt.java | 48 +- .../javaparser/ast/stmt/UnparsableStmt.java | 24 +- .../github/javaparser/ast/stmt/WhileStmt.java | 44 +- .../github/javaparser/ast/stmt/YieldStmt.java | 30 +- .../github/javaparser/ast/type/ArrayType.java | 64 +-- .../ast/type/ClassOrInterfaceType.java | 64 +-- .../ast/type/ConvertibleToUsage.java | 2 +- .../javaparser/ast/type/IntersectionType.java | 38 +- .../javaparser/ast/type/PrimitiveType.java | 50 +- .../javaparser/ast/type/ReferenceType.java | 18 +- .../com/github/javaparser/ast/type/Type.java | 112 ++--- .../javaparser/ast/type/TypeParameter.java | 50 +- .../github/javaparser/ast/type/UnionType.java | 40 +- .../javaparser/ast/type/UnknownType.java | 32 +- .../github/javaparser/ast/type/VarType.java | 30 +- .../github/javaparser/ast/type/VoidType.java | 32 +- .../javaparser/ast/type/WildcardType.java | 52 +-- .../ast/validator/ProblemReporter.java | 10 +- .../RecordAsTypeIdentifierNotAllowed.java | 8 +- .../validator/ReservedKeywordValidator.java | 8 +- .../ast/validator/SimpleValidator.java | 4 +- .../validator/SingleNodeTypeValidator.java | 6 +- .../ast/validator/TreeVisitorValidator.java | 4 +- .../ast/validator/TypedValidator.java | 4 +- .../javaparser/ast/validator/Validator.java | 2 +- .../javaparser/ast/validator/Validators.java | 14 +- .../ast/validator/VisitorValidator.java | 2 +- .../Java10PreviewValidator.java | 4 +- .../Java10Validator.java | 4 +- .../Java11PreviewValidator.java | 4 +- .../Java11Validator.java | 4 +- .../Java12PreviewValidator.java | 4 +- .../Java12Validator.java | 4 +- .../Java13PreviewValidator.java | 4 +- .../Java13Validator.java | 4 +- .../Java14PreviewValidator.java | 4 +- .../Java14Validator.java | 4 +- .../Java15PreviewValidator.java | 4 +- .../Java15Validator.java | 4 +- .../Java16PreviewValidator.java | 4 +- .../Java16Validator.java | 4 +- .../Java17PreviewValidator.java | 4 +- .../Java17Validator.java | 4 +- .../Java18Validator.java | 4 +- .../Java19Validator.java | 4 +- .../Java1_0Validator.java | 4 +- .../Java1_1Validator.java | 4 +- .../Java1_2Validator.java | 4 +- .../Java1_3Validator.java | 4 +- .../Java1_4Validator.java | 4 +- .../Java20Validator.java | 4 +- .../Java21Validator.java | 4 +- .../Java5Validator.java | 4 +- .../Java6Validator.java | 4 +- .../Java7Validator.java | 4 +- .../Java8Validator.java | 4 +- .../Java9Validator.java | 4 +- .../UpgradeJavaMessage.java | 2 +- .../chunks/CommonValidators.java | 4 +- .../chunks/ModifierValidator.java | 26 +- .../NoBinaryIntegerLiteralsValidator.java | 6 +- ...UnderscoresInIntegerLiteralsValidator.java | 6 +- .../chunks/RecordDeclarationValidator.java | 4 +- .../chunks/UnderscoreKeywordValidator.java | 6 +- .../chunks/VarValidator.java | 6 +- .../postprocessors/Java10PostProcessor.java | 6 +- .../postprocessors/Java11PostProcessor.java | 2 +- .../postprocessors/Java12PostProcessor.java | 2 +- .../postprocessors/Java13PostProcessor.java | 2 +- .../postprocessors/Java14PostProcessor.java | 2 +- .../postprocessors/Java15PostProcessor.java | 2 +- .../postprocessors/Java16PostProcessor.java | 2 +- .../postprocessors/Java17PostProcessor.java | 2 +- .../postprocessors/Java18PostProcessor.java | 2 +- .../postprocessors/Java19PostProcessor.java | 2 +- .../postprocessors/Java20PostProcessor.java | 2 +- .../postprocessors/Java21PostProcessor.java | 2 +- .../postprocessors/PostProcessors.java | 14 +- .../javaparser/ast/visitor/CloneVisitor.java | 272 +++++------ .../javaparser/ast/visitor/EqualsVisitor.java | 272 +++++------ .../visitor/GenericListVisitorAdapter.java | 270 +++++------ .../ast/visitor/GenericVisitor.java | 2 +- .../ast/visitor/GenericVisitorAdapter.java | 270 +++++------ .../visitor/GenericVisitorWithDefaults.java | 274 +++++------ .../ast/visitor/HashCodeVisitor.java | 272 +++++------ .../ast/visitor/ModifierVisitor.java | 272 +++++------ .../ast/visitor/NoCommentEqualsVisitor.java | 272 +++++------ .../ast/visitor/NoCommentHashCodeVisitor.java | 272 +++++------ .../ast/visitor/NodeFinderVisitor.java | 206 ++++----- .../visitor/ObjectIdentityEqualsVisitor.java | 272 +++++------ .../ObjectIdentityHashCodeVisitor.java | 272 +++++------ .../javaparser/ast/visitor/TreeVisitor.java | 10 +- .../javaparser/ast/visitor/Visitable.java | 2 +- .../javaparser/ast/visitor/VoidVisitor.java | 2 +- .../ast/visitor/VoidVisitorAdapter.java | 270 +++++------ .../ast/visitor/VoidVisitorWithDefaults.java | 274 +++++------ .../github/javaparser/javadoc/Javadoc.java | 28 +- .../javaparser/javadoc/JavadocBlockTag.java | 24 +- .../description/JavadocDescription.java | 20 +- .../JavadocDescriptionElement.java | 2 +- .../javadoc/description/JavadocInlineTag.java | 20 +- .../javadoc/description/JavadocSnippet.java | 12 +- .../com/github/javaparser/jml/Example.java | 2 +- .../javaparser/jml/JmlDocHardRemover.java | 12 +- .../javaparser/jml/JmlDocSanitizer.java | 14 +- .../github/javaparser/jml/JmlProcessor.java | 12 +- .../com/github/javaparser/jml/JmlUtility.java | 18 +- .../javaparser/jml/JmlWarnRemaingJmlDoc.java | 16 +- .../javaparser/jml/StringConstructor.java | 10 +- .../jml/impl/JmlAnnotationConfiguration.java | 4 +- .../jml/impl/JmlAnnotationSupport.java | 10 +- .../AnnotationDeclarationMetaModel.java | 2 +- .../metamodel/AnnotationExprMetaModel.java | 4 +- .../AnnotationMemberDeclarationMetaModel.java | 10 +- .../metamodel/ArrayAccessExprMetaModel.java | 6 +- .../metamodel/ArrayCreationExprMetaModel.java | 8 +- .../ArrayCreationLevelMetaModel.java | 6 +- .../ArrayInitializerExprMetaModel.java | 4 +- .../metamodel/ArrayTypeMetaModel.java | 6 +- .../metamodel/AssertStmtMetaModel.java | 6 +- .../metamodel/AssignExprMetaModel.java | 8 +- .../metamodel/BaseNodeMetaModel.java | 42 +- .../metamodel/BinaryExprMetaModel.java | 8 +- .../metamodel/BlockCommentMetaModel.java | 2 +- .../metamodel/BlockStmtMetaModel.java | 6 +- .../metamodel/BodyDeclarationMetaModel.java | 4 +- .../BooleanLiteralExprMetaModel.java | 4 +- .../metamodel/BreakStmtMetaModel.java | 4 +- .../metamodel/BreaksClauseMetaModel.java | 6 +- .../metamodel/CallableClauseMetaModel.java | 2 +- .../CallableDeclarationMetaModel.java | 16 +- .../metamodel/CallableMetaModel.java | 2 +- .../metamodel/CastExprMetaModel.java | 6 +- .../metamodel/CatchClauseMetaModel.java | 6 +- .../metamodel/CharLiteralExprMetaModel.java | 2 +- .../metamodel/ClassExprMetaModel.java | 4 +- .../ClassInvariantClauseMetaModel.java | 6 +- .../ClassOrInterfaceDeclarationMetaModel.java | 12 +- .../ClassOrInterfaceTypeMetaModel.java | 10 +- .../metamodel/CommentMetaModel.java | 4 +- ...ompactConstructorDeclarationMetaModel.java | 12 +- .../metamodel/CompilationUnitMetaModel.java | 10 +- .../metamodel/ConditionalExprMetaModel.java | 8 +- .../ConstructorDeclarationMetaModel.java | 4 +- .../metamodel/ContinueStmtMetaModel.java | 4 +- .../javaparser/metamodel/DerivedProperty.java | 2 +- .../javaparser/metamodel/DoStmtMetaModel.java | 8 +- .../metamodel/DoubleLiteralExprMetaModel.java | 2 +- .../metamodel/EmptyStmtMetaModel.java | 2 +- .../metamodel/EnclosedExprMetaModel.java | 4 +- .../EnumConstantDeclarationMetaModel.java | 8 +- .../metamodel/EnumDeclarationMetaModel.java | 6 +- ...citConstructorInvocationStmtMetaModel.java | 12 +- .../metamodel/ExpressionMetaModel.java | 2 +- .../metamodel/ExpressionStmtMetaModel.java | 4 +- .../metamodel/FieldAccessExprMetaModel.java | 10 +- .../metamodel/FieldDeclarationMetaModel.java | 8 +- .../metamodel/ForEachStmtMetaModel.java | 10 +- .../metamodel/ForStmtMetaModel.java | 12 +- .../metamodel/ForallClauseMetaModel.java | 4 +- .../javaparser/metamodel/IfStmtMetaModel.java | 16 +- .../metamodel/ImportDeclarationMetaModel.java | 10 +- .../InitializerDeclarationMetaModel.java | 6 +- .../metamodel/InstanceOfExprMetaModel.java | 8 +- .../IntegerLiteralExprMetaModel.java | 2 +- .../metamodel/InternalProperty.java | 2 +- .../metamodel/IntersectionTypeMetaModel.java | 4 +- .../metamodel/JavadocCommentMetaModel.java | 2 +- .../metamodel/JmlAssertStmtMetaModel.java | 4 +- .../metamodel/JmlBeginStmtMetaModel.java | 4 +- .../JmlBinaryInfixExprMetaModel.java | 8 +- .../metamodel/JmlBindingExprMetaModel.java | 8 +- .../metamodel/JmlCallableClauseMetaModel.java | 4 +- ...mlClassAccessibleDeclarationMetaModel.java | 12 +- .../JmlClassExprDeclarationMetaModel.java | 12 +- ...JmlClassInvariantDeclarationMetaModel.java | 6 +- .../JmlClassLevelDeclarationMetaModel.java | 2 +- .../metamodel/JmlClassLevelMetaModel.java | 2 +- .../metamodel/JmlClauseIfMetaModel.java | 8 +- .../metamodel/JmlClauseLEMetaModel.java | 6 +- .../metamodel/JmlClauseLabelMetaModel.java | 8 +- .../metamodel/JmlClauseMetaModel.java | 4 +- .../metamodel/JmlContractMetaModel.java | 16 +- .../metamodel/JmlDefaultClauseMetaModel.java | 8 +- .../metamodel/JmlDocDeclarationMetaModel.java | 4 +- .../javaparser/metamodel/JmlDocMetaModel.java | 4 +- .../metamodel/JmlDocModifierMetaModel.java | 4 +- .../metamodel/JmlDocStmtMetaModel.java | 4 +- .../metamodel/JmlDocTypeMetaModel.java | 4 +- .../metamodel/JmlEndStmtMetaModel.java | 4 +- .../metamodel/JmlExpressionStmtMetaModel.java | 8 +- .../JmlFieldDeclarationMetaModel.java | 6 +- .../metamodel/JmlForallClauseMetaModel.java | 4 +- .../metamodel/JmlGhostStatementMetaModel.java | 4 +- .../JmlGhostStatementsMetaModel.java | 4 +- .../metamodel/JmlGhostStmtMetaModel.java | 6 +- .../metamodel/JmlLabelExprMetaModel.java | 8 +- .../metamodel/JmlLabelMetaModel.java | 8 +- .../metamodel/JmlLabelStmtMetaModel.java | 6 +- .../metamodel/JmlLetExprMetaModel.java | 6 +- .../JmlMethodDeclarationMetaModel.java | 8 +- .../JmlMethodSignatureMetaModel.java | 8 +- .../JmlMultiCompareExprMetaModel.java | 6 +- .../JmlMultiExprClauseMetaModel.java | 8 +- .../metamodel/JmlOldClauseMetaModel.java | 4 +- .../metamodel/JmlQuantifiedExprMetaModel.java | 8 +- .../metamodel/JmlRefiningStmtMetaModel.java | 4 +- .../JmlRepresentsDeclarationMetaModel.java | 10 +- .../JmlSetComprehensionExprMetaModel.java | 6 +- .../JmlSetComprehensionMetaModel.java | 6 +- .../metamodel/JmlSignalsClauseMetaModel.java | 6 +- .../JmlSignalsOnlyClauseMetaModel.java | 4 +- .../JmlSimpleExprClauseMetaModel.java | 8 +- .../metamodel/JmlStatementMetaModel.java | 2 +- .../JmlStmtWithExpressionMetaModel.java | 6 +- .../metamodel/JmlTypeExprMetaModel.java | 4 +- .../JmlUnreachableStmtMetaModel.java | 4 +- .../metamodel/LabeledStmtMetaModel.java | 6 +- .../metamodel/LambdaExprMetaModel.java | 12 +- .../metamodel/LineCommentMetaModel.java | 2 +- .../metamodel/LiteralExprMetaModel.java | 2 +- .../LiteralStringValueExprMetaModel.java | 4 +- .../LocalClassDeclarationStmtMetaModel.java | 4 +- .../LocalRecordDeclarationStmtMetaModel.java | 4 +- .../metamodel/LongLiteralExprMetaModel.java | 2 +- .../MarkerAnnotationExprMetaModel.java | 2 +- .../metamodel/MemberValuePairMetaModel.java | 6 +- .../metamodel/MethodCallExprMetaModel.java | 12 +- .../metamodel/MethodDeclarationMetaModel.java | 6 +- .../MethodReferenceExprMetaModel.java | 10 +- .../metamodel/ModifierMetaModel.java | 4 +- .../metamodel/ModuleDeclarationMetaModel.java | 10 +- .../metamodel/ModuleDirectiveMetaModel.java | 2 +- .../ModuleExportsDirectiveMetaModel.java | 6 +- .../ModuleOpensDirectiveMetaModel.java | 6 +- .../ModuleProvidesDirectiveMetaModel.java | 6 +- .../ModuleRequiresDirectiveMetaModel.java | 6 +- .../ModuleUsesDirectiveMetaModel.java | 4 +- .../metamodel/NameExprMetaModel.java | 4 +- .../javaparser/metamodel/NameMetaModel.java | 6 +- .../javaparser/metamodel/NodeMetaModel.java | 4 +- .../metamodel/NonEmptyProperty.java | 2 +- .../NormalAnnotationExprMetaModel.java | 4 +- .../metamodel/NullLiteralExprMetaModel.java | 2 +- .../ObjectCreationExprMetaModel.java | 14 +- .../metamodel/OptionalProperty.java | 2 +- .../PackageDeclarationMetaModel.java | 6 +- .../metamodel/ParameterMetaModel.java | 14 +- .../metamodel/PatternExprMetaModel.java | 4 +- .../metamodel/PrimitiveTypeMetaModel.java | 4 +- .../metamodel/PropertyMetaModel.java | 54 +-- .../metamodel/ReceiverParameterMetaModel.java | 8 +- .../metamodel/RecordDeclarationMetaModel.java | 10 +- .../metamodel/RecordPatternExprMetaModel.java | 6 +- .../metamodel/ReferenceTypeMetaModel.java | 2 +- .../metamodel/ReturnStmtMetaModel.java | 4 +- .../metamodel/SignalsClauseMetaModel.java | 8 +- .../metamodel/SignalsMetaModel.java | 2 +- .../metamodel/SignalsOnlyClauseMetaModel.java | 4 +- .../metamodel/SignalsOnlyMetaModel.java | 2 +- .../metamodel/SimpleNameMetaModel.java | 4 +- .../SingleMemberAnnotationExprMetaModel.java | 4 +- .../metamodel/StatementMetaModel.java | 2 +- .../metamodel/StringLiteralExprMetaModel.java | 2 +- .../metamodel/SuperExprMetaModel.java | 4 +- .../metamodel/SwitchEntryMetaModel.java | 14 +- .../metamodel/SwitchExprMetaModel.java | 6 +- .../metamodel/SwitchStmtMetaModel.java | 6 +- .../metamodel/SynchronizedStmtMetaModel.java | 6 +- .../TextBlockLiteralExprMetaModel.java | 2 +- .../metamodel/ThisExprMetaModel.java | 4 +- .../metamodel/ThrowStmtMetaModel.java | 4 +- .../metamodel/TryStmtMetaModel.java | 10 +- .../metamodel/TypeDeclarationMetaModel.java | 8 +- .../metamodel/TypeExprMetaModel.java | 4 +- .../javaparser/metamodel/TypeMetaModel.java | 4 +- .../metamodel/TypeParameterMetaModel.java | 6 +- .../metamodel/TypePatternExprMetaModel.java | 6 +- .../metamodel/UnaryExprMetaModel.java | 10 +- .../metamodel/UnionTypeMetaModel.java | 4 +- .../metamodel/UnknownTypeMetaModel.java | 2 +- .../metamodel/UnparsableStmtMetaModel.java | 2 +- .../metamodel/UnreachableStmtMetaModel.java | 2 +- .../metamodel/VarTypeMetaModel.java | 2 +- .../VariableDeclarationExprMetaModel.java | 10 +- .../VariableDeclaratorMetaModel.java | 8 +- .../metamodel/VoidTypeMetaModel.java | 2 +- .../metamodel/WhileStmtMetaModel.java | 8 +- .../metamodel/WildcardTypeMetaModel.java | 6 +- .../WorkingSpaceClauseMetaModel.java | 2 +- .../metamodel/YieldStmtMetaModel.java | 4 +- .../printer/ConcreteSyntaxModel.java | 2 +- .../printer/DefaultPrettyPrinter.java | 14 +- .../printer/DefaultPrettyPrinterVisitor.java | 283 ++++++------ .../github/javaparser/printer/DotPrinter.java | 8 +- .../printer/PrettyPrintVisitor.java | 280 ++++++------ .../javaparser/printer/PrettyPrinter.java | 14 +- .../github/javaparser/printer/Printer.java | 2 +- .../javaparser/printer/SourcePrinter.java | 28 +- .../github/javaparser/printer/Stringable.java | 2 +- .../github/javaparser/printer/XmlPrinter.java | 20 +- .../javaparser/printer/YamlPrinter.java | 8 +- .../concretesyntaxmodel/CsmAttribute.java | 12 +- .../printer/concretesyntaxmodel/CsmChar.java | 10 +- .../concretesyntaxmodel/CsmComment.java | 4 +- .../concretesyntaxmodel/CsmConditional.java | 22 +- .../concretesyntaxmodel/CsmElement.java | 2 +- .../concretesyntaxmodel/CsmIndent.java | 10 +- .../printer/concretesyntaxmodel/CsmList.java | 22 +- .../printer/concretesyntaxmodel/CsmMix.java | 14 +- .../printer/concretesyntaxmodel/CsmNone.java | 4 +- .../CsmOrphanCommentsEnding.java | 4 +- .../concretesyntaxmodel/CsmSequence.java | 10 +- .../CsmSingleReference.java | 10 +- .../concretesyntaxmodel/CsmString.java | 10 +- .../concretesyntaxmodel/CsmTextBlock.java | 10 +- .../printer/concretesyntaxmodel/CsmToken.java | 26 +- .../concretesyntaxmodel/CsmUnindent.java | 8 +- .../configuration/ConfigurationOption.java | 2 +- .../DefaultConfigurationOption.java | 22 +- .../DefaultPrinterConfiguration.java | 16 +- .../configuration/ImportOrderingStrategy.java | 2 +- .../printer/configuration/Indentation.java | 24 +- .../PrettyPrinterConfiguration.java | 70 +-- .../configuration/PrinterConfiguration.java | 2 +- .../DefaultImportOrderingStrategy.java | 8 +- .../EclipseImportOrderingStrategy.java | 8 +- .../IntelliJImportOrderingStrategy.java | 8 +- .../printer/lexicalpreservation/Added.java | 26 +- .../lexicalpreservation/ChildTextElement.java | 38 +- .../lexicalpreservation/Difference.java | 36 +- .../DifferenceElement.java | 2 +- .../DifferenceElementCalculator.java | 4 +- .../printer/lexicalpreservation/Kept.java | 32 +- .../LexicalDifferenceCalculator.java | 16 +- .../LexicalPreservingPrinter.java | 17 +- .../LexicalPreservingVisitor.java | 12 +- .../LookaheadIterator.java | 6 +- .../printer/lexicalpreservation/NodeText.java | 4 +- .../lexicalpreservation/PeekingIterator.java | 32 +- .../lexicalpreservation/PhantomNodeLogic.java | 4 +- .../PrintableTextElement.java | 2 +- .../printer/lexicalpreservation/Removed.java | 30 +- .../lexicalpreservation/RemovedGroup.java | 4 +- .../lexicalpreservation/Reshuffled.java | 22 +- .../ReshuffledDiffElementExtractor.java | 4 +- .../lexicalpreservation/TextElement.java | 10 +- .../TextElementIteratorsFactory.java | 26 +- .../TextElementMatcher.java | 2 +- .../TextElementMatchers.java | 4 +- .../lexicalpreservation/TokenTextElement.java | 38 +- .../lexicalpreservation/changes/Change.java | 2 +- .../changes/ListAdditionChange.java | 8 +- .../changes/ListRemovalChange.java | 8 +- .../changes/ListReplacementChange.java | 8 +- .../lexicalpreservation/changes/NoChange.java | 6 +- .../changes/PropertyChange.java | 12 +- .../github/javaparser/quality/NotNull.java | 2 +- .../github/javaparser/quality/Nullable.java | 2 +- .../github/javaparser/resolution/Context.java | 2 +- .../resolution/MethodAmbiguityException.java | 4 +- .../javaparser/resolution/MethodUsage.java | 48 +- .../javaparser/resolution/Resolvable.java | 2 +- .../github/javaparser/resolution/Solver.java | 2 +- .../resolution/SymbolDeclarator.java | 2 +- .../javaparser/resolution/SymbolResolver.java | 2 +- .../javaparser/resolution/TypeSolver.java | 2 +- .../resolution/UnsolvedSymbolException.java | 14 +- .../javaparser/resolution/cache/Cache.java | 2 +- .../resolution/cache/CacheStats.java | 2 +- .../declarations/AssociableToAST.java | 2 +- .../declarations/HasAccessSpecifier.java | 2 +- .../ResolvedAnnotationDeclaration.java | 2 +- .../ResolvedAnnotationMemberDeclaration.java | 2 +- .../ResolvedClassDeclaration.java | 2 +- .../ResolvedConstructorDeclaration.java | 2 +- .../declarations/ResolvedDeclaration.java | 2 +- .../ResolvedEnumConstantDeclaration.java | 2 +- .../declarations/ResolvedEnumDeclaration.java | 2 +- .../ResolvedFieldDeclaration.java | 2 +- .../ResolvedInterfaceDeclaration.java | 2 +- .../ResolvedMethodDeclaration.java | 2 +- .../ResolvedMethodLikeDeclaration.java | 2 +- .../ResolvedParameterDeclaration.java | 2 +- .../ResolvedRecordDeclaration.java | 2 +- .../ResolvedReferenceTypeDeclaration.java | 6 +- .../declarations/ResolvedTypeDeclaration.java | 2 +- .../ResolvedTypeParameterDeclaration.java | 36 +- .../ResolvedTypeParametrizable.java | 2 +- .../ResolvedTypePatternDeclaration.java | 2 +- .../ResolvedValueDeclaration.java | 2 +- .../ConflictingGenericTypesException.java | 4 +- .../logic/ConstructorResolutionLogic.java | 2 +- .../logic/FunctionalInterfaceLogic.java | 7 +- .../resolution/logic/InferenceContext.java | 10 +- .../logic/InferenceVariableType.java | 20 +- .../logic/MethodResolutionCapability.java | 2 +- .../logic/MethodResolutionLogic.java | 13 +- .../model/LambdaArgumentTypePlaceholder.java | 16 +- .../resolution/model/SymbolReference.java | 10 +- .../javaparser/resolution/model/Value.java | 10 +- .../resolution/model/typesystem/LazyType.java | 44 +- .../resolution/model/typesystem/NullType.java | 14 +- .../model/typesystem/ReferenceTypeImpl.java | 28 +- .../promotion/ConditionalExprHandler.java | 2 +- .../resolution/types/ResolvedArrayType.java | 26 +- .../types/ResolvedIntersectionType.java | 16 +- .../types/ResolvedLambdaConstraintType.java | 14 +- .../types/ResolvedPrimitiveType.java | 32 +- .../types/ResolvedReferenceType.java | 70 +-- .../resolution/types/ResolvedType.java | 2 +- .../types/ResolvedTypeTransformer.java | 2 +- .../types/ResolvedTypeVariable.java | 36 +- .../resolution/types/ResolvedUnionType.java | 20 +- .../resolution/types/ResolvedVoidType.java | 10 +- .../resolution/types/ResolvedWildcard.java | 38 +- .../ResolvedTypeParameterValueProvider.java | 2 +- .../ResolvedTypeParametersMap.java | 28 +- .../ResolvedTypeParametrized.java | 2 +- .../github/javaparser/utils/ClassUtils.java | 2 +- .../javaparser/utils/CollectionStrategy.java | 2 +- .../javaparser/utils/LineSeparator.java | 14 +- .../java/com/github/javaparser/utils/Log.java | 16 +- .../com/github/javaparser/utils/Pair.java | 10 +- .../utils/ParserCollectionStrategy.java | 16 +- .../github/javaparser/utils/ProjectRoot.java | 16 +- .../utils/SeparatedItemStringBuilder.java | 10 +- .../github/javaparser/utils/SourceRoot.java | 76 ++-- .../github/javaparser/utils/SourceZip.java | 18 +- .../github/javaparser/utils/TypeUtils.java | 2 +- .../com/github/javaparser/utils/Utils.java | 2 +- .../github/javaparser/utils/VisitorList.java | 82 ++-- .../github/javaparser/utils/VisitorMap.java | 34 +- .../github/javaparser/utils/VisitorSet.java | 44 +- 657 files changed, 7989 insertions(+), 7986 deletions(-) diff --git a/javaparser-core/src/main/java/com/github/javaparser/CommentsInserter.java b/javaparser-core/src/main/java/com/github/javaparser/CommentsInserter.java index 870150b8b9..eab7a28239 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/CommentsInserter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/CommentsInserter.java @@ -82,8 +82,9 @@ void insertComments(Node node, TreeSet commentsToAttribute) { 2) be outside all children. They could be preceding nothing, a comment or a child. If they preceed a child they are assigned to it, otherwise they remain "orphans" */ - List children = node.getChildNodes().stream().// Never attribute comments to modifiers. - filter(n -> !(n instanceof Modifier)).collect(toList()); + // Never attribute comments to modifiers. + List // Never attribute comments to modifiers. + children = node.getChildNodes().stream().filter(n -> !(n instanceof Modifier)).collect(toList()); boolean attributeToAnnotation = !(configuration.isIgnoreAnnotationsWhenAttributingComments()); for (Node child : children) { TreeSet commentsInsideChild = new TreeSet<>(NODE_BY_BEGIN_POSITION); diff --git a/javaparser-core/src/main/java/com/github/javaparser/HasParentNode.java b/javaparser-core/src/main/java/com/github/javaparser/HasParentNode.java index 7b43090d4b..554de56e8b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/HasParentNode.java +++ b/javaparser-core/src/main/java/com/github/javaparser/HasParentNode.java @@ -28,7 +28,7 @@ /** * An object that can have a parent node. */ -public interface HasParentNode extends Observable { +public interface HasParentNode extends Observable { /** * Returns true if the parent has a parent diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java b/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java index faad540fe3..1c412691dd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java +++ b/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java @@ -66,7 +66,7 @@ public final class JavaParser { * Instantiate the parser with default configuration. Note that parsing can also be done with the static methods {@link StaticJavaParser}. * Creating an instance will reduce setup time between parsing files. */ - public JavaParser() { + public JavaParser() { this(new ParserConfiguration()); } @@ -74,14 +74,14 @@ public JavaParser() { * Instantiate the parser. Note that parsing can also be done with the static methods {@link StaticJavaParser}. * Creating an instance will reduce setup time between parsing files. */ - public JavaParser(ParserConfiguration configuration) { + public JavaParser(ParserConfiguration configuration) { this.configuration = configuration; } /** * @return The configuration for this parser. */ - public ParserConfiguration getParserConfiguration() { + public ParserConfiguration getParserConfiguration() { return this.configuration; } @@ -112,7 +112,7 @@ private GeneratedJavaParser getParserForProvider(Provider provider) { * @param the subclass of Node that is the result of parsing in the start. * @return the parse result, a collection of encountered problems, and some extra data. */ - public ParseResult parse(ParseStart start, Provider provider) { + public ParseResult parse(ParseStart start, Provider provider) { assertNotNull(start); assertNotNull(provider); List processors = configuration.getProcessors().stream().map(Supplier::get).collect(toList()); @@ -150,7 +150,7 @@ public ParseResult parse(ParseStart start, Provider prov * @return CompilationUnit representing the Java source code * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parse(final InputStream in, Charset encoding) { + public ParseResult parse(final InputStream in, Charset encoding) { return parse(COMPILATION_UNIT, provider(in, encoding)); } @@ -162,7 +162,7 @@ public ParseResult parse(final InputStream in, Charset encodin * @return CompilationUnit representing the Java source code * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parse(final InputStream in) { + public ParseResult parse(final InputStream in) { return parse(in, configuration.getCharacterEncoding()); } @@ -178,7 +178,7 @@ public ParseResult parse(final InputStream in) { * @deprecated set the encoding in the {@link ParserConfiguration} */ @Deprecated - public ParseResult parse(final File file, final Charset encoding) throws FileNotFoundException { + public ParseResult parse(final File file, final Charset encoding) throws FileNotFoundException { ParseResult result = parse(COMPILATION_UNIT, provider(file, encoding)); result.getResult().ifPresent(cu -> cu.setStorage(file.toPath(), encoding)); return result; @@ -193,7 +193,7 @@ public ParseResult parse(final File file, final Charset encodi * @throws ParseProblemException if the source code has parser errors * @throws FileNotFoundException the file was not found */ - public ParseResult parse(final File file) throws FileNotFoundException { + public ParseResult parse(final File file) throws FileNotFoundException { ParseResult result = parse(COMPILATION_UNIT, provider(file, configuration.getCharacterEncoding())); result.getResult().ifPresent(cu -> cu.setStorage(file.toPath(), configuration.getCharacterEncoding())); return result; @@ -211,7 +211,7 @@ public ParseResult parse(final File file) throws FileNotFoundE * @deprecated set the encoding in the {@link ParserConfiguration} */ @Deprecated - public ParseResult parse(final Path path, final Charset encoding) throws IOException { + public ParseResult parse(final Path path, final Charset encoding) throws IOException { ParseResult result = parse(COMPILATION_UNIT, provider(path, encoding)); result.getResult().ifPresent(cu -> cu.setStorage(path, encoding)); return result; @@ -226,7 +226,7 @@ public ParseResult parse(final Path path, final Charset encodi * @throws ParseProblemException if the source code has parser errors * @throws IOException the path could not be accessed */ - public ParseResult parse(final Path path) throws IOException { + public ParseResult parse(final Path path) throws IOException { ParseResult result = parse(COMPILATION_UNIT, provider(path, configuration.getCharacterEncoding())); result.getResult().ifPresent(cu -> cu.setStorage(path, configuration.getCharacterEncoding())); return result; @@ -242,7 +242,7 @@ public ParseResult parse(final Path path) throws IOException { * @throws ParseProblemException if the source code has parser errors * @throws IOException the path could not be accessed */ - public ParseResult parseResource(final String path) throws IOException { + public ParseResult parseResource(final String path) throws IOException { return parse(COMPILATION_UNIT, resourceProvider(path, configuration.getCharacterEncoding())); } @@ -259,7 +259,7 @@ public ParseResult parseResource(final String path) throws IOE * @deprecated set the encoding in the {@link ParserConfiguration} */ @Deprecated - public ParseResult parseResource(final String path, Charset encoding) throws IOException { + public ParseResult parseResource(final String path, Charset encoding) throws IOException { return parse(COMPILATION_UNIT, resourceProvider(path, encoding)); } @@ -276,7 +276,7 @@ public ParseResult parseResource(final String path, Charset en * @deprecated set the encoding in the {@link ParserConfiguration} */ @Deprecated - public ParseResult parseResource(final ClassLoader classLoader, final String path, Charset encoding) throws IOException { + public ParseResult parseResource(final ClassLoader classLoader, final String path, Charset encoding) throws IOException { return parse(COMPILATION_UNIT, resourceProvider(classLoader, path, encoding)); } @@ -288,7 +288,7 @@ public ParseResult parseResource(final ClassLoader classLoader * @return CompilationUnit representing the Java source code * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parse(final Reader reader) { + public ParseResult parse(final Reader reader) { return parse(COMPILATION_UNIT, provider(reader)); } @@ -300,7 +300,7 @@ public ParseResult parse(final Reader reader) { * @return CompilationUnit representing the Java source code * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parse(String code) { + public ParseResult parse(String code) { return parse(COMPILATION_UNIT, provider(code)); } @@ -312,7 +312,7 @@ public ParseResult parse(String code) { * @return BlockStmt representing the Java block * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseBlock(final String blockStatement) { + public ParseResult parseBlock(final String blockStatement) { return parse(BLOCK, provider(blockStatement)); } @@ -324,7 +324,7 @@ public ParseResult parseBlock(final String blockStatement) { * @return Statement representing the Java statement * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseStatement(final String statement) { + public ParseResult parseStatement(final String statement) { return parse(STATEMENT, provider(statement)); } @@ -336,7 +336,7 @@ public ParseResult parseStatement(final String statement) { * @return ImportDeclaration representing the Java import declaration * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseImport(final String importDeclaration) { + public ParseResult parseImport(final String importDeclaration) { return parse(IMPORT_DECLARATION, provider(importDeclaration)); } @@ -349,7 +349,7 @@ public ParseResult parseImport(final String importDeclaratio * @throws ParseProblemException if the source code has parser errors */ @SuppressWarnings("unchecked") - public ParseResult parseExpression(final String expression) { + public ParseResult parseExpression(final String expression) { return (ParseResult) parse(EXPRESSION, provider(expression)); } @@ -361,7 +361,7 @@ public ParseResult parseExpression(final String expre * @return AnnotationExpr representing the Java annotation * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseAnnotation(final String annotation) { + public ParseResult parseAnnotation(final String annotation) { return parse(ANNOTATION, provider(annotation)); } @@ -373,7 +373,7 @@ public ParseResult parseAnnotation(final String annotation) { * @return BodyDeclaration representing the Java annotation * @throws ParseProblemException if the source code has parser errors */ - public ParseResult> parseAnnotationBodyDeclaration(final String body) { + public ParseResult> parseAnnotationBodyDeclaration(final String body) { return parse(ANNOTATION_BODY, provider(body)); } @@ -386,7 +386,7 @@ public ParseResult> parseAnnotationBodyDeclaration(final Str * @throws ParseProblemException if the source code has parser errors */ @SuppressWarnings("unchecked") - public > ParseResult parseBodyDeclaration(String body) { + public > ParseResult parseBodyDeclaration(String body) { return (ParseResult) parse(CLASS_BODY, provider(body)); } @@ -397,7 +397,7 @@ public > ParseResult parseBodyDeclaration(Strin * @return ClassOrInterfaceType representing the type * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseClassOrInterfaceType(String type) { + public ParseResult parseClassOrInterfaceType(String type) { return parse(CLASS_OR_INTERFACE_TYPE, provider(type)); } @@ -408,7 +408,7 @@ public ParseResult parseClassOrInterfaceType(String type) * @return ClassOrInterfaceType representing the type * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseType(String type) { + public ParseResult parseType(String type) { return parse(TYPE, provider(type)); } @@ -420,7 +420,7 @@ public ParseResult parseType(String type) { * @return VariableDeclarationExpr representing the type * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseVariableDeclarationExpr(String declaration) { + public ParseResult parseVariableDeclarationExpr(String declaration) { return parse(VARIABLE_DECLARATION_EXPR, provider(declaration)); } @@ -431,7 +431,7 @@ public ParseResult parseVariableDeclarationExpr(String * @return the AST for the statement. * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseExplicitConstructorInvocationStmt(String statement) { + public ParseResult parseExplicitConstructorInvocationStmt(String statement) { return parse(EXPLICIT_CONSTRUCTOR_INVOCATION_STMT, provider(statement)); } @@ -442,7 +442,7 @@ public ParseResult parseExplicitConstructorI * @return the AST for the name * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseName(String qualifiedName) { + public ParseResult parseName(String qualifiedName) { return parse(NAME, provider(qualifiedName)); } @@ -453,7 +453,7 @@ public ParseResult parseName(String qualifiedName) { * @return the AST for the name * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseSimpleName(String name) { + public ParseResult parseSimpleName(String name) { return parse(SIMPLE_NAME, provider(name)); } @@ -464,7 +464,7 @@ public ParseResult parseSimpleName(String name) { * @return the AST for the parameter * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseParameter(String parameter) { + public ParseResult parseParameter(String parameter) { return parse(PARAMETER, provider(parameter)); } @@ -475,7 +475,7 @@ public ParseResult parseParameter(String parameter) { * @return the AST for the parameter * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parsePackageDeclaration(String packageDeclaration) { + public ParseResult parsePackageDeclaration(String packageDeclaration) { return parse(PACKAGE_DECLARATION, provider(packageDeclaration)); } @@ -486,7 +486,7 @@ public ParseResult parsePackageDeclaration(String packageDe * @return the AST for the type declaration * @throws ParseProblemException if the source code has parser errors */ - public ParseResult> parseTypeDeclaration(String typeDeclaration) { + public ParseResult> parseTypeDeclaration(String typeDeclaration) { return parse(TYPE_DECLARATION, provider(typeDeclaration)); } @@ -498,7 +498,7 @@ public ParseResult> parseTypeDeclaration(String typeDeclarat * @throws ParseProblemException if the source code has parser errors * @see ModuleDeclaration */ - public ParseResult parseModuleDeclaration(String moduleDeclaration) { + public ParseResult parseModuleDeclaration(String moduleDeclaration) { return parse(MODULE_DECLARATION, provider(moduleDeclaration)); } @@ -510,7 +510,7 @@ public ParseResult parseModuleDeclaration(String moduleDecla * @throws ParseProblemException if the source code has parser errors * @see ModuleDirective */ - public ParseResult parseModuleDirective(String moduleDirective) { + public ParseResult parseModuleDirective(String moduleDirective) { return parse(MODULE_DIRECTIVE, provider(moduleDirective)); } @@ -521,7 +521,7 @@ public ParseResult parseModuleDirective(String moduleDirective * @return the AST for the type parameter * @throws ParseProblemException if the source code has parser errors */ - public ParseResult parseTypeParameter(String typeParameter) { + public ParseResult parseTypeParameter(String typeParameter) { return parse(TYPE_PARAMETER, provider(typeParameter)); } @@ -533,7 +533,7 @@ public ParseResult parseTypeParameter(String typeParameter) { * @throws ParseProblemException if the source code has parser errors * @see MethodDeclaration */ - public ParseResult parseMethodDeclaration(String methodDeclaration) { + public ParseResult parseMethodDeclaration(String methodDeclaration) { return parse(METHOD_DECLARATION, provider(methodDeclaration)); } @@ -545,15 +545,15 @@ public ParseResult parseMethodDeclaration(String methodDecla * @throws ParseProblemException if the source code has parser errors * @see ArrayInitializerExpr */ - public ParseResult parseArrayInitializerExpr(String arrayInitializerExpr) { + public ParseResult parseArrayInitializerExpr(String arrayInitializerExpr) { return parse(ARRAY_INITIALIZER_EXPR, provider(arrayInitializerExpr)); } - public ParseResult parseJmlMethodLevel(String content) { + public ParseResult parseJmlMethodLevel(String content) { return parseJmlMethodLevel(provider(content)); } - public ParseResult parseJmlMethodLevel(Provider provider) { + public ParseResult parseJmlMethodLevel(Provider provider) { return parse(enableJml(GeneratedJavaParser::JmlMethodLevelStart), provider); } @@ -564,36 +564,36 @@ private ParseStart enableJml(ParseStart start) { }; } - public ParseResult parseJmlClassLevel(String content) { + public ParseResult parseJmlClassLevel(String content) { return parseJmlClassLevel(provider(content)); } - public ParseResult parseJmlClassLevel(Provider content) { + public ParseResult parseJmlClassLevel(Provider content) { return parse(enableJml(GeneratedJavaParser::JmlClassLevelStart), content); } - public ParseResult parseJmlTypeLevel(String content) { + public ParseResult parseJmlTypeLevel(String content) { return parseJmlTypeLevel(provider(content)); } - public ParseResult parseJmlTypeLevel(Provider content) { + public ParseResult parseJmlTypeLevel(Provider content) { return parse(enableJml(GeneratedJavaParser::JmlTypeLevelStart), content); } - public ParseResult parseJmlModifierLevel(String content) { + public ParseResult parseJmlModifierLevel(String content) { return parseJmlModifierLevel(provider(content)); } - public ParseResult parseJmlModifierLevel(Provider content) { + public ParseResult parseJmlModifierLevel(Provider content) { return parse(enableJml(GeneratedJavaParser::JmlModifierLevelStart), content); } - public ParseResult parseJmlExpression(String content) { + public ParseResult parseJmlExpression(String content) { return parseJmlExpression(provider(content)); } @SuppressWarnings("unchecked") - public ParseResult parseJmlExpression(Provider content) { + public ParseResult parseJmlExpression(Provider content) { return (ParseResult) parse(enableJml(GeneratedJavaParser::ExpressionParseStart), content); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavaParserAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/JavaParserAdapter.java index ccb95d4f94..b391bd1c18 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/JavaParserAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/JavaParserAdapter.java @@ -41,7 +41,7 @@ import java.nio.file.Path; import java.util.Objects; -public class JavaParserAdapter { +public class JavaParserAdapter { /** * Wraps the {@link JavaParser}. @@ -56,11 +56,11 @@ public static JavaParserAdapter of(JavaParser parser) { private final JavaParser parser; - public JavaParserAdapter(JavaParser parser) { + public JavaParserAdapter(JavaParser parser) { this.parser = Objects.requireNonNull(parser, "A non-null parser should be provided."); } - public JavaParser getParser() { + public JavaParser getParser() { return parser; } @@ -80,119 +80,119 @@ private T handleResult(ParseResult result) { throw new ParseProblemException(result.getProblems()); } - public ParserConfiguration getParserConfiguration() { + public ParserConfiguration getParserConfiguration() { return parser.getParserConfiguration(); } - public CompilationUnit parse(InputStream in) { + public CompilationUnit parse(InputStream in) { return handleResult(getParser().parse(in)); } - public CompilationUnit parse(File file) throws FileNotFoundException { + public CompilationUnit parse(File file) throws FileNotFoundException { return handleResult(getParser().parse(file)); } - public CompilationUnit parse(Path path) throws IOException { + public CompilationUnit parse(Path path) throws IOException { return handleResult(getParser().parse(path)); } - public CompilationUnit parse(Reader reader) { + public CompilationUnit parse(Reader reader) { return handleResult(getParser().parse(reader)); } - public CompilationUnit parse(String code) { + public CompilationUnit parse(String code) { return handleResult(getParser().parse(code)); } - public CompilationUnit parseResource(String path) throws IOException { + public CompilationUnit parseResource(String path) throws IOException { return handleResult(getParser().parseResource(path)); } - public BlockStmt parseBlock(String blockStatement) { + public BlockStmt parseBlock(String blockStatement) { return handleResult(getParser().parseBlock(blockStatement)); } - public Statement parseStatement(String statement) { + public Statement parseStatement(String statement) { return handleResult(getParser().parseStatement(statement)); } - public ImportDeclaration parseImport(String importDeclaration) { + public ImportDeclaration parseImport(String importDeclaration) { return handleResult(getParser().parseImport(importDeclaration)); } - public T parseExpression(String expression) { + public T parseExpression(String expression) { return handleResult(getParser().parseExpression(expression)); } - public AnnotationExpr parseAnnotation(String annotation) { + public AnnotationExpr parseAnnotation(String annotation) { return handleResult(getParser().parseAnnotation(annotation)); } - public BodyDeclaration parseAnnotationBodyDeclaration(String body) { + public BodyDeclaration parseAnnotationBodyDeclaration(String body) { return handleResult(getParser().parseAnnotationBodyDeclaration(body)); } - public BodyDeclaration parseBodyDeclaration(String body) { + public BodyDeclaration parseBodyDeclaration(String body) { return handleResult(getParser().parseBodyDeclaration(body)); } - public ClassOrInterfaceType parseClassOrInterfaceType(String type) { + public ClassOrInterfaceType parseClassOrInterfaceType(String type) { return handleResult(getParser().parseClassOrInterfaceType(type)); } - public Type parseType(String type) { + public Type parseType(String type) { return handleResult(getParser().parseType(type)); } - public VariableDeclarationExpr parseVariableDeclarationExpr(String declaration) { + public VariableDeclarationExpr parseVariableDeclarationExpr(String declaration) { return handleResult(getParser().parseVariableDeclarationExpr(declaration)); } - public Javadoc parseJavadoc(String content) { + public Javadoc parseJavadoc(String content) { return JavadocParser.parse(content); } - public ExplicitConstructorInvocationStmt parseExplicitConstructorInvocationStmt(String statement) { + public ExplicitConstructorInvocationStmt parseExplicitConstructorInvocationStmt(String statement) { return handleResult(getParser().parseExplicitConstructorInvocationStmt(statement)); } - public Name parseName(String qualifiedName) { + public Name parseName(String qualifiedName) { return handleResult(getParser().parseName(qualifiedName)); } - public SimpleName parseSimpleName(String name) { + public SimpleName parseSimpleName(String name) { return handleResult(getParser().parseSimpleName(name)); } - public Parameter parseParameter(String parameter) { + public Parameter parseParameter(String parameter) { return handleResult(getParser().parseParameter(parameter)); } - public PackageDeclaration parsePackageDeclaration(String packageDeclaration) { + public PackageDeclaration parsePackageDeclaration(String packageDeclaration) { return handleResult(getParser().parsePackageDeclaration(packageDeclaration)); } - public TypeDeclaration parseTypeDeclaration(String typeDeclaration) { + public TypeDeclaration parseTypeDeclaration(String typeDeclaration) { return handleResult(getParser().parseTypeDeclaration(typeDeclaration)); } - public ModuleDeclaration parseModuleDeclaration(String moduleDeclaration) { + public ModuleDeclaration parseModuleDeclaration(String moduleDeclaration) { return handleResult(getParser().parseModuleDeclaration(moduleDeclaration)); } - public ModuleDirective parseModuleDirective(String moduleDirective) { + public ModuleDirective parseModuleDirective(String moduleDirective) { return handleResult(getParser().parseModuleDirective(moduleDirective)); } - public TypeParameter parseTypeParameter(String typeParameter) { + public TypeParameter parseTypeParameter(String typeParameter) { return handleResult(getParser().parseTypeParameter(typeParameter)); } - public MethodDeclaration parseMethodDeclaration(String methodDeclaration) { + public MethodDeclaration parseMethodDeclaration(String methodDeclaration) { return handleResult(getParser().parseMethodDeclaration(methodDeclaration)); } - public ArrayInitializerExpr parseArrayInitializerExpr(String arrayInitializerExpr) { + public ArrayInitializerExpr parseArrayInitializerExpr(String arrayInitializerExpr) { return handleResult(getParser().parseArrayInitializerExpr(arrayInitializerExpr)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java b/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java index 3d0c6ea9db..9b1967ef07 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java +++ b/javaparser-core/src/main/java/com/github/javaparser/JavaToken.java @@ -32,7 +32,7 @@ * (Awkwardly named "Java"Token since JavaCC already generates an internal class Token.) * It is a node in a double linked list called token list. */ -public class JavaToken { +public class JavaToken { public static final JavaToken INVALID = new JavaToken(); @@ -50,7 +50,7 @@ private JavaToken() { this(null, 0, "INVALID", null, null); } - public JavaToken(int kind, String text) { + public JavaToken(int kind, String text) { this(null, kind, text, null, null); } @@ -110,7 +110,7 @@ public JavaToken(int kind, String text) { /** * Create a token of a certain kind. */ - public JavaToken(int kind) { + public JavaToken(int kind) { String content = GeneratedJavaParserConstants.tokenImage[kind]; if (content.startsWith("\"")) { content = content.substring(1, content.length() - 1); @@ -124,7 +124,7 @@ public JavaToken(int kind) { this.text = content; } - public JavaToken(Range range, int kind, String text, JavaToken previousToken, JavaToken nextToken) { + public JavaToken(Range range, int kind, String text, JavaToken previousToken, JavaToken nextToken) { assertNotNull(text); this.range = range; this.kind = kind; @@ -133,18 +133,18 @@ public JavaToken(Range range, int kind, String text, JavaToken previousToken, J this.nextToken = nextToken; } - public Optional getRange() { + public Optional getRange() { return Optional.ofNullable(range); } /* * Returns true if the token has a range */ - public boolean hasRange() { + public boolean hasRange() { return getRange().isPresent(); } - public int getKind() { + public int getKind() { return kind; } @@ -152,39 +152,39 @@ void setKind(int kind) { this.kind = kind; } - public String getText() { + public String getText() { return text; } - public Optional getNextToken() { + public Optional getNextToken() { return Optional.ofNullable(nextToken); } - public Optional getPreviousToken() { + public Optional getPreviousToken() { return Optional.ofNullable(previousToken); } - public void setRange(Range range) { + public void setRange(Range range) { this.range = range; } - public void setText(String text) { + public void setText(String text) { this.text = text; } - public String asString() { + public String asString() { return text; } /** * @return the token range that goes from the beginning to the end of the token list this token is a part of. */ - public TokenRange toTokenRange() { + public TokenRange toTokenRange() { return new TokenRange(findFirstToken(), findLastToken()); } @Override - public String toString() { + public String toString() { String text = getText().replace("\n", "\\n").replace("\r", "\\r").replace("\r\n", "\\r\\n").replace("\t", "\\t"); return f("\"%s\" <%s> %s", text, getKind(), getRange().map(Range::toString).orElse("(?)-(?)")); } @@ -192,18 +192,18 @@ public String toString() { /** * Used by the parser while constructing nodes. No tokens should be invalid when the parser is done. */ - public boolean valid() { + public boolean valid() { return !invalid(); } /** * Used by the parser while constructing nodes. No tokens should be invalid when the parser is done. */ - public boolean invalid() { + public boolean invalid() { return this == INVALID; } - public enum Category { + public enum Category { WHITESPACE_NO_EOL, EOL, @@ -214,49 +214,49 @@ public enum Category { SEPARATOR, OPERATOR; - public boolean isWhitespaceOrComment() { + public boolean isWhitespaceOrComment() { return isWhitespace() || this == COMMENT; } - public boolean isWhitespace() { + public boolean isWhitespace() { return this == WHITESPACE_NO_EOL || this == EOL; } - public boolean isEndOfLine() { + public boolean isEndOfLine() { return this == EOL; } - public boolean isComment() { + public boolean isComment() { return this == COMMENT; } - public boolean isWhitespaceButNotEndOfLine() { + public boolean isWhitespaceButNotEndOfLine() { return this == WHITESPACE_NO_EOL; } - public boolean isIdentifier() { + public boolean isIdentifier() { return this == IDENTIFIER; } - public boolean isKeyword() { + public boolean isKeyword() { return this == KEYWORD; } - public boolean isLiteral() { + public boolean isLiteral() { return this == LITERAL; } - public boolean isSeparator() { + public boolean isSeparator() { return this == SEPARATOR; } - public boolean isOperator() { + public boolean isOperator() { return this == OPERATOR; } } @Generated("com.github.javaparser.generator.core.other.TokenKindGenerator") - public enum Kind { + public enum Kind { EOF(0), SPACE(1), @@ -1301,23 +1301,23 @@ public static Kind valueOf(int kind) { } } - public boolean isPrimitive() { + public boolean isPrimitive() { return this == BYTE || this == CHAR || this == SHORT || this == INT || this == LONG || this == FLOAT || this == DOUBLE; } - public int getKind() { + public int getKind() { return kind; } } - public JavaToken.Category getCategory() { + public JavaToken.Category getCategory() { return TokenTypes.getCategory(kind); } /** * Inserts newToken into the token list just before this token. */ - public void insert(JavaToken newToken) { + public void insert(JavaToken newToken) { assertNotNull(newToken); getPreviousToken().ifPresent(p -> { p.nextToken = newToken; @@ -1330,7 +1330,7 @@ public void insert(JavaToken newToken) { /** * Inserts newToken into the token list just after this token. */ - public void insertAfter(JavaToken newToken) { + public void insertAfter(JavaToken newToken) { assertNotNull(newToken); getNextToken().ifPresent(n -> { n.previousToken = newToken; @@ -1343,7 +1343,7 @@ public void insertAfter(JavaToken newToken) { /** * Links the tokens around the current token together, making the current token disappear from the list. */ - public void deleteToken() { + public void deleteToken() { final Optional nextToken = getNextToken(); final Optional previousToken = getPreviousToken(); previousToken.ifPresent(p -> p.nextToken = nextToken.orElse(null)); @@ -1353,7 +1353,7 @@ public void deleteToken() { /** * Replaces the current token with newToken. */ - public void replaceToken(JavaToken newToken) { + public void replaceToken(JavaToken newToken) { assertNotNull(newToken); getPreviousToken().ifPresent(p -> { p.nextToken = newToken; @@ -1368,7 +1368,7 @@ public void replaceToken(JavaToken newToken) { /** * @return the last token in the token list. */ - public JavaToken findLastToken() { + public JavaToken findLastToken() { JavaToken current = this; while (current.getNextToken().isPresent()) { current = current.getNextToken().get(); @@ -1379,7 +1379,7 @@ public JavaToken findLastToken() { /** * @return the first token in the token list. */ - public JavaToken findFirstToken() { + public JavaToken findFirstToken() { JavaToken current = this; while (current.getPreviousToken().isPresent()) { current = current.getPreviousToken().get(); @@ -1388,14 +1388,14 @@ public JavaToken findFirstToken() { } @Override - public int hashCode() { + public int hashCode() { int result = kind; result = 31 * result + text.hashCode(); return result; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) diff --git a/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java b/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java index 95716c4e5f..d3ccf19849 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java +++ b/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java @@ -29,7 +29,7 @@ /** * {@link Provider} un-escaping unicode escape sequences in the input sequence. */ -public class LineEndingProcessingProvider implements Provider { +public class LineEndingProcessingProvider implements Provider { private static final int EOF = -1; @@ -57,17 +57,17 @@ public class LineEndingProcessingProvider implements Provider { private final Map eolCounts = new HashMap<>(); - public LineEndingProcessingProvider(Provider input) { + public LineEndingProcessingProvider(Provider input) { this(DEFAULT_BUFFER_SIZE, input); } - public LineEndingProcessingProvider(int bufferSize, Provider input) { + public LineEndingProcessingProvider(int bufferSize, Provider input) { _input = input; _data = new char[bufferSize]; } @Override - public void close() throws IOException { + public void close() throws IOException { _input.close(); } @@ -80,7 +80,7 @@ private int fillBuffer() throws IOException { return direct; } - public LineSeparator getDetectedLineEnding() { + public LineSeparator getDetectedLineEnding() { return LineSeparator.getLineEnding(eolCounts.getOrDefault(LineSeparator.CR, 0), eolCounts.getOrDefault(LineSeparator.LF, 0), eolCounts.getOrDefault(LineSeparator.CRLF, 0)); } @@ -104,7 +104,7 @@ private int nextBufferedChar() throws IOException { } @Override - public int read(char[] buffer, final int offset, int len) throws IOException { + public int read(char[] buffer, final int offset, int len) throws IOException { int pos = offset; int stop = offset + len; LineSeparator previousLineSeparator = null; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ParseProblemException.java b/javaparser-core/src/main/java/com/github/javaparser/ParseProblemException.java index b6450ae64e..7461c3be65 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ParseProblemException.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ParseProblemException.java @@ -28,19 +28,19 @@ /** * Thrown when parsing problems occur during parsing with the static methods on JavaParser. */ -public class ParseProblemException extends RuntimeException { +public class ParseProblemException extends RuntimeException { /** * The problems that were encountered during parsing */ private final List problems; - public ParseProblemException(List problems) { + public ParseProblemException(List problems) { super(createMessage(assertNotNull(problems))); this.problems = problems; } - public ParseProblemException(Throwable throwable) { + public ParseProblemException(Throwable throwable) { this(singletonList(new Problem(throwable.getMessage(), null, throwable))); } @@ -52,7 +52,7 @@ private static String createMessage(List problems) { return message.toString(); } - public List getProblems() { + public List getProblems() { return problems; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ParseResult.java b/javaparser-core/src/main/java/com/github/javaparser/ParseResult.java index dc9da54a45..1b09290667 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ParseResult.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ParseResult.java @@ -29,7 +29,7 @@ /** * The results given when parsing with an instance of JavaParser. */ -public class ParseResult { +public class ParseResult { private final T result; @@ -43,7 +43,7 @@ public class ParseResult { * @param result the AST, or empty if it wasn't created. * @param problems a list of encountered parsing problems. */ - public ParseResult(T result, List problems, CommentsCollection commentsCollection) { + public ParseResult(T result, List problems, CommentsCollection commentsCollection) { this.commentsCollection = commentsCollection; this.result = result; this.problems = problems; @@ -52,14 +52,14 @@ public ParseResult(T result, List problems, CommentsCollection comment /** * @return if parsing was successful, meaning no errors of any kind were encountered. */ - public boolean isSuccessful() { + public boolean isSuccessful() { return problems.isEmpty() && result != null; } /** * Calls the consumer with the result if parsing was succesful. */ - public void ifSuccessful(Consumer consumer) { + public void ifSuccessful(Consumer consumer) { if (isSuccessful()) { consumer.accept(result); } @@ -68,33 +68,33 @@ public void ifSuccessful(Consumer consumer) { /** * @return the list of encountered parsing problems. Empty when no problems were encountered. */ - public List getProblems() { + public List getProblems() { return problems; } /** * @return the {@code i}'th encountered parsing problem. May throw IndexOutOfBoundsException. */ - public Problem getProblem(int i) { + public Problem getProblem(int i) { return getProblems().get(i); } /** * @return the complete collection of comments encountered while parsing. */ - public Optional getCommentsCollection() { + public Optional getCommentsCollection() { return Optional.ofNullable(commentsCollection); } /** * @return the AST of the parsed source code, or empty if parsing failed completely. */ - public Optional getResult() { + public Optional getResult() { return Optional.ofNullable(result); } @Override - public String toString() { + public String toString() { if (isSuccessful()) { return "Parsing successful"; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ParseStart.java b/javaparser-core/src/main/java/com/github/javaparser/ParseStart.java index 1bc06aff7a..5dc48275f3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ParseStart.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ParseStart.java @@ -47,7 +47,7 @@ * @see JavaParser#parse(ParseStart, Provider) */ @FunctionalInterface -public interface ParseStart { +public interface ParseStart { ParseStart COMPILATION_UNIT = GeneratedJavaParser::CompilationUnit; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ParserConfiguration.java b/javaparser-core/src/main/java/com/github/javaparser/ParserConfiguration.java index 74eb7426af..83203d61d2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ParserConfiguration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ParserConfiguration.java @@ -44,7 +44,7 @@ * Note that this can be changed even when reusing the same JavaParser instance. * It will pick up the changes. */ -public class ParserConfiguration { +public class ParserConfiguration { //region jmlparser private List> jmlKeys = new ArrayList<>(); @@ -53,38 +53,38 @@ public class ParserConfiguration { jmlKeys.add(new ArrayList<>()); } - public List> getJmlKeys() { + public List> getJmlKeys() { return jmlKeys; } - public void setJmlKeys(List> jmlKeys) { + public void setJmlKeys(List> jmlKeys) { this.jmlKeys = jmlKeys; } private boolean keepJmlDocs = false; - public ParserConfiguration setKeepJmlDocs(boolean flag) { + public ParserConfiguration setKeepJmlDocs(boolean flag) { this.keepJmlDocs = flag; return this; } - public boolean isKeepJmlDocs() { + public boolean isKeepJmlDocs() { return this.keepJmlDocs; } private boolean preprocessJml = false; - public ParserConfiguration setProcessJml(boolean jml) { + public ParserConfiguration setProcessJml(boolean jml) { this.preprocessJml = jml; return this; } - public boolean isProcessJml() { + public boolean isProcessJml() { return this.preprocessJml; } //endregion - public enum LanguageLevel { + public enum LanguageLevel { /** * Java 1.0 @@ -252,7 +252,7 @@ public enum LanguageLevel { this.postProcessor = postProcessor; } - public boolean isYieldSupported() { + public boolean isYieldSupported() { return Arrays.stream(yieldSupport).anyMatch(level -> level == this); } } @@ -287,7 +287,7 @@ private class UnicodeEscapeProcessor extends Processor { private UnicodeEscapeProcessingProvider _unicodeDecoder; @Override - public Provider preProcess(Provider innerProvider) { + public Provider preProcess(Provider innerProvider) { if (isPreprocessUnicodeEscapes()) { _unicodeDecoder = new UnicodeEscapeProcessingProvider(innerProvider); return _unicodeDecoder; @@ -296,7 +296,7 @@ public Provider preProcess(Provider innerProvider) { } @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (isPreprocessUnicodeEscapes()) { result.getResult().ifPresent(root -> { PositionMapping mapping = _unicodeDecoder.getPositionMapping(); @@ -313,7 +313,7 @@ private class LineEndingProcessor extends Processor { private LineEndingProcessingProvider _lineEndingProcessingProvider; @Override - public Provider preProcess(Provider innerProvider) { + public Provider preProcess(Provider innerProvider) { if (isDetectOriginalLineSeparator()) { _lineEndingProcessingProvider = new LineEndingProcessingProvider(innerProvider); return _lineEndingProcessingProvider; @@ -322,7 +322,7 @@ public Provider preProcess(Provider innerProvider) { } @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (isDetectOriginalLineSeparator()) { result.getResult().ifPresent(rootNode -> { LineSeparator detectedLineSeparator = _lineEndingProcessingProvider.getDetectedLineEnding(); @@ -336,13 +336,13 @@ public void postProcess(ParseResult result, ParserConfiguration } } - public ParserConfiguration() { + public ParserConfiguration() { processors.add(() -> ParserConfiguration.this.new UnicodeEscapeProcessor()); processors.add(() -> ParserConfiguration.this.new LineEndingProcessor()); processors.add(() -> new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (configuration.isAttributeComments()) { result.ifSuccessful(resultNode -> result.getCommentsCollection().ifPresent(comments -> new CommentsInserter(configuration).insertComments(resultNode, comments.copy().getComments()))); } @@ -353,7 +353,7 @@ public void postProcess(ParseResult result, ParserConfiguration processors.add(() -> new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { LanguageLevel languageLevel = getLanguageLevel(); if (languageLevel != null) { if (languageLevel.postProcessor != null) { @@ -368,7 +368,7 @@ public void postProcess(ParseResult result, ParserConfiguration processors.add(() -> new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { configuration.getSymbolResolver().ifPresent(symbolResolver -> result.ifSuccessful(resultNode -> { if (resultNode instanceof CompilationUnit) { resultNode.setData(Node.SYMBOL_RESOLVER_KEY, symbolResolver); @@ -379,7 +379,7 @@ public void postProcess(ParseResult result, ParserConfiguration processors.add(() -> new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (configuration.isLexicalPreservationEnabled()) { result.ifSuccessful(LexicalPreservingPrinter::setup); } @@ -387,7 +387,7 @@ public void postProcess(ParseResult result, ParserConfiguration }); } - public boolean isAttributeComments() { + public boolean isAttributeComments() { return attributeComments; } @@ -395,30 +395,30 @@ public boolean isAttributeComments() { * Whether to run CommentsInserter, which will put the comments that were found in the source code into the comment * and javadoc fields of the nodes it thinks they refer to. */ - public ParserConfiguration setAttributeComments(boolean attributeComments) { + public ParserConfiguration setAttributeComments(boolean attributeComments) { this.attributeComments = attributeComments; return this; } - public boolean isDoNotAssignCommentsPrecedingEmptyLines() { + public boolean isDoNotAssignCommentsPrecedingEmptyLines() { return doNotAssignCommentsPrecedingEmptyLines; } - public ParserConfiguration setDoNotAssignCommentsPrecedingEmptyLines(boolean doNotAssignCommentsPrecedingEmptyLines) { + public ParserConfiguration setDoNotAssignCommentsPrecedingEmptyLines(boolean doNotAssignCommentsPrecedingEmptyLines) { this.doNotAssignCommentsPrecedingEmptyLines = doNotAssignCommentsPrecedingEmptyLines; return this; } - public boolean isIgnoreAnnotationsWhenAttributingComments() { + public boolean isIgnoreAnnotationsWhenAttributingComments() { return ignoreAnnotationsWhenAttributingComments; } - public ParserConfiguration setIgnoreAnnotationsWhenAttributingComments(boolean ignoreAnnotationsWhenAttributingComments) { + public ParserConfiguration setIgnoreAnnotationsWhenAttributingComments(boolean ignoreAnnotationsWhenAttributingComments) { this.ignoreAnnotationsWhenAttributingComments = ignoreAnnotationsWhenAttributingComments; return this; } - public ParserConfiguration setStoreTokens(boolean storeTokens) { + public ParserConfiguration setStoreTokens(boolean storeTokens) { this.storeTokens = storeTokens; if (!storeTokens) { setAttributeComments(false); @@ -426,11 +426,11 @@ public ParserConfiguration setStoreTokens(boolean storeTokens) { return this; } - public boolean isStoreTokens() { + public boolean isStoreTokens() { return storeTokens; } - public int getTabSize() { + public int getTabSize() { return tabSize; } @@ -438,7 +438,7 @@ public int getTabSize() { * When a TAB character is encountered during parsing, the column position will be increased by this value. * By default it is 1. */ - public ParserConfiguration setTabSize(int tabSize) { + public ParserConfiguration setTabSize(int tabSize) { this.tabSize = tabSize; return this; } @@ -448,40 +448,40 @@ public ParserConfiguration setTabSize(int tabSize) { * When this is enabled, LexicalPreservingPrinter.print can be used to reproduce * the original formatting of the file. */ - public ParserConfiguration setLexicalPreservationEnabled(boolean lexicalPreservationEnabled) { + public ParserConfiguration setLexicalPreservationEnabled(boolean lexicalPreservationEnabled) { this.lexicalPreservationEnabled = lexicalPreservationEnabled; return this; } - public boolean isLexicalPreservationEnabled() { + public boolean isLexicalPreservationEnabled() { return lexicalPreservationEnabled; } /** * Retrieve the SymbolResolver to be used while parsing, if any. */ - public Optional getSymbolResolver() { + public Optional getSymbolResolver() { return Optional.ofNullable(symbolResolver); } /** * Set the SymbolResolver to be injected while parsing. */ - public ParserConfiguration setSymbolResolver(SymbolResolver symbolResolver) { + public ParserConfiguration setSymbolResolver(SymbolResolver symbolResolver) { this.symbolResolver = symbolResolver; return this; } - public List> getProcessors() { + public List> getProcessors() { return processors; } - public ParserConfiguration setLanguageLevel(LanguageLevel languageLevel) { + public ParserConfiguration setLanguageLevel(LanguageLevel languageLevel) { this.languageLevel = languageLevel; return this; } - public LanguageLevel getLanguageLevel() { + public LanguageLevel getLanguageLevel() { return languageLevel; } @@ -492,43 +492,43 @@ public LanguageLevel getLanguageLevel() { * positions in the AST will point to the original input, which is exactly the same as without this option. * Without this option enabled, the unicode escapes will not be processed and are transfered intact to the AST. */ - public ParserConfiguration setPreprocessUnicodeEscapes(boolean preprocessUnicodeEscapes) { + public ParserConfiguration setPreprocessUnicodeEscapes(boolean preprocessUnicodeEscapes) { this.preprocessUnicodeEscapes = preprocessUnicodeEscapes; return this; } - public boolean isPreprocessUnicodeEscapes() { + public boolean isPreprocessUnicodeEscapes() { return preprocessUnicodeEscapes; } - public ParserConfiguration setDetectOriginalLineSeparator(boolean detectOriginalLineSeparator) { + public ParserConfiguration setDetectOriginalLineSeparator(boolean detectOriginalLineSeparator) { this.detectOriginalLineSeparator = detectOriginalLineSeparator; return this; } - public boolean isDetectOriginalLineSeparator() { + public boolean isDetectOriginalLineSeparator() { return detectOriginalLineSeparator; } - public Charset getCharacterEncoding() { + public Charset getCharacterEncoding() { return characterEncoding; } /** * The character encoding used for reading input from files and streams. By default UTF8 is used. */ - public ParserConfiguration setCharacterEncoding(Charset characterEncoding) { + public ParserConfiguration setCharacterEncoding(Charset characterEncoding) { this.characterEncoding = characterEncoding; return this; } //region weigl - public ParserConfiguration addProcessor(Processor processor) { + public ParserConfiguration addProcessor(Processor processor) { processors.add(() -> processor); return this; } - public ParserConfiguration addProcessor(int pos, Processor processor) { + public ParserConfiguration addProcessor(int pos, Processor processor) { processors.add(pos, () -> processor); return this; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/Position.java b/javaparser-core/src/main/java/com/github/javaparser/Position.java index 972773ecaa..c0a7ac9059 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/Position.java +++ b/javaparser-core/src/main/java/com/github/javaparser/Position.java @@ -26,7 +26,7 @@ /** * A position in a source file. Lines and columns start counting at 1. */ -public class Position implements Comparable { +public class Position implements Comparable { public final int line; @@ -58,7 +58,7 @@ public class Position implements Comparable { * TODO: Do we refer to the characters as columns, * ...or the spaces between (thus also before/after) characters as columns? */ - public Position(int line, int column) { + public Position(int line, int column) { if (line < Position.ABSOLUTE_END_LINE) { throw new IllegalArgumentException("Can't position at line " + line); } @@ -86,28 +86,28 @@ public static Position pos(int line, int column) { /** * @return Jump to the given column number, while retaining the current line number. */ - public Position withColumn(int column) { + public Position withColumn(int column) { return new Position(this.line, column); } /** * @return Jump to the given line number, while retaining the current column number. */ - public Position withLine(int line) { + public Position withLine(int line) { return new Position(line, this.column); } /** * @return a position that is "characters" characters more to the right than this position. */ - public Position right(int characters) { + public Position right(int characters) { return new Position(line, this.column + characters); } /** * @return a position that is on the start of the next line from this position. */ - public Position nextLine() { + public Position nextLine() { return new Position(line + 1, FIRST_COLUMN); } @@ -118,7 +118,7 @@ public Position nextLine() { * * @return true if the position is usable or a special position. */ - public boolean valid() { + public boolean valid() { return ABSOLUTE_END_LINE == line || ABSOLUTE_BEGIN_LINE == line || line >= FIRST_LINE && column >= FIRST_COLUMN; } @@ -126,7 +126,7 @@ public boolean valid() { * @return The inverse of {@link #valid()} * @see #valid() */ - public boolean invalid() { + public boolean invalid() { return !valid(); } @@ -135,7 +135,7 @@ public boolean invalid() { * Otherwise, if the alternativePosition is valid, return that. * Otherwise, just return this. */ - public Position orIfInvalid(Position alternativePosition) { + public Position orIfInvalid(Position alternativePosition) { assertNotNull(alternativePosition); if (this.valid()) { return this; @@ -147,7 +147,7 @@ public Position orIfInvalid(Position alternativePosition) { * @param otherPosition the other position to compare to * @return true if this position is after the given position */ - public boolean isAfter(Position otherPosition) { + public boolean isAfter(Position otherPosition) { assertNotNull(otherPosition); if (line == otherPosition.line) { return column > otherPosition.column; @@ -155,7 +155,7 @@ public boolean isAfter(Position otherPosition) { return line > otherPosition.line || otherPosition.line == Position.ABSOLUTE_BEGIN_LINE; } - public boolean isAfterOrEqual(Position otherPosition) { + public boolean isAfterOrEqual(Position otherPosition) { return isAfter(otherPosition) || equals(otherPosition); } @@ -163,7 +163,7 @@ public boolean isAfterOrEqual(Position otherPosition) { * @param otherPosition the other position to compare to * @return true if this position is before the given position */ - public boolean isBefore(Position otherPosition) { + public boolean isBefore(Position otherPosition) { assertNotNull(otherPosition); if (line == otherPosition.line) { return column < otherPosition.column; @@ -171,12 +171,12 @@ public boolean isBefore(Position otherPosition) { return line < otherPosition.line || otherPosition.line == Position.ABSOLUTE_END_LINE; } - public boolean isBeforeOrEqual(Position otherPosition) { + public boolean isBeforeOrEqual(Position otherPosition) { return isBefore(otherPosition) || equals(otherPosition); } @Override - public int compareTo(Position otherPosition) { + public int compareTo(Position otherPosition) { assertNotNull(otherPosition); if (isBefore(otherPosition)) { return -1; @@ -188,7 +188,7 @@ public int compareTo(Position otherPosition) { } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -198,12 +198,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return Objects.hash(line, column); } @Override - public String toString() { + public String toString() { return "(line " + line + ",col " + column + ")"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/Problem.java b/javaparser-core/src/main/java/com/github/javaparser/Problem.java index 3d73770484..e7e7d8faf1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/Problem.java +++ b/javaparser-core/src/main/java/com/github/javaparser/Problem.java @@ -28,7 +28,7 @@ /** * A problem that was encountered during parsing. */ -public class Problem { +public class Problem { private final String message; @@ -36,7 +36,7 @@ public class Problem { private final Throwable cause; - public Problem(String message, TokenRange location, Throwable cause) { + public Problem(String message, TokenRange location, Throwable cause) { assertNotNull(message); this.message = message; this.location = location; @@ -44,7 +44,7 @@ public Problem(String message, TokenRange location, Throwable cause) { } @Override - public String toString() { + public String toString() { final StringBuilder str = new StringBuilder(getVerboseMessage()); if (cause != null) { str.append(LineSeparator.SYSTEM).append("Problem stacktrace : ").append(LineSeparator.SYSTEM); @@ -61,28 +61,28 @@ public String toString() { /** * @return the message that was passed into the constructor. */ - public String getMessage() { + public String getMessage() { return message; } /** * @return the message plus location information. */ - public String getVerboseMessage() { + public String getVerboseMessage() { return getLocation().map(l -> l.getBegin().getRange().map(r -> r.begin.toString()).orElse("(line ?,col ?)") + " " + message).orElse(message); } /** * @return the location that was passed into the constructor. */ - public Optional getLocation() { + public Optional getLocation() { return Optional.ofNullable(location); } /** * @return the cause that was passed into the constructor. */ - public Optional getCause() { + public Optional getCause() { return Optional.ofNullable(cause); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/Processor.java b/javaparser-core/src/main/java/com/github/javaparser/Processor.java index c7c3d5022c..14e038e895 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/Processor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/Processor.java @@ -21,18 +21,18 @@ import com.github.javaparser.ast.Node; -public class Processor { +public class Processor { /** * Makes the parser do a post-parsing step before the result is returned to the user. */ - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { } /** * Adds a pre-parsing step, which has access to the sourcecode through the innerProvider. */ - public Provider preProcess(Provider innerProvider) { + public Provider preProcess(Provider innerProvider) { return innerProvider; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/Range.java b/javaparser-core/src/main/java/com/github/javaparser/Range.java index aa1ac8a011..8d1793bf76 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/Range.java +++ b/javaparser-core/src/main/java/com/github/javaparser/Range.java @@ -23,7 +23,7 @@ /** * A range of characters in a source file, from "begin" to "end", including the characters at "begin" and "end". */ -public class Range { +public class Range { public final Position begin; @@ -38,7 +38,7 @@ public class Range { * @param begin The starting position of the range. * @param end The end position of the range. */ - public Range(Position begin, Position end) { + public Range(Position begin, Position end) { if (begin == null) { throw new IllegalArgumentException("begin can't be null"); } @@ -85,7 +85,7 @@ public static Range range(int beginLine, int beginColumn, int endLine, int endCo * Valid values are per the constructor of{@link Position}. * @return A copy of this `Range` object, but with the begin column number replaced with the given column number. */ - public Range withBeginColumn(int beginColumn) { + public Range withBeginColumn(int beginColumn) { return range(begin.withColumn(beginColumn), end); } @@ -94,7 +94,7 @@ public Range withBeginColumn(int beginColumn) { * Valid values are per the constructor of{@link Position}. * @return A copy of this `Range` object, but with the begin line number replaced with the given line number. */ - public Range withBeginLine(int beginLine) { + public Range withBeginLine(int beginLine) { return range(begin.withLine(beginLine), end); } @@ -103,7 +103,7 @@ public Range withBeginLine(int beginLine) { * Valid values are per the constructor of{@link Position}. * @return A copy of this `Range` object, but with the end column number replaced with the given line column. */ - public Range withEndColumn(int endColumn) { + public Range withEndColumn(int endColumn) { return range(begin, end.withColumn(endColumn)); } @@ -112,7 +112,7 @@ public Range withEndColumn(int endColumn) { * Valid values are per the constructor of{@link Position}. * @return A copy of this `Range` object, but with the end line number replaced with the given line number. */ - public Range withEndLine(int endLine) { + public Range withEndLine(int endLine) { return range(begin, end.withLine(endLine)); } @@ -120,7 +120,7 @@ public Range withEndLine(int endLine) { * @param begin The value used to replace the current begin position. * @return A copy of this `Range` object, but with the begin position replaced with the given position. */ - public Range withBegin(Position begin) { + public Range withBegin(Position begin) { return range(begin, this.end); } @@ -128,7 +128,7 @@ public Range withBegin(Position begin) { * @param end The value used to replace the current end position. * @return A copy of this `Range` object, but with the end position replaced with the given position. */ - public Range withEnd(Position end) { + public Range withEnd(Position end) { return range(this.begin, end); } @@ -138,7 +138,7 @@ public Range withEnd(Position end) { * As {@link #strictlyContains(Range)}, but also allow ranges which have an equal start and/or end position. * In these cases, the `other` range is not strictly "inside" of this range. */ - public boolean contains(Range other) { + public boolean contains(Range other) { boolean beginResult = (begin.isBeforeOrEqual(other.begin)); if (!beginResult) return false; @@ -153,7 +153,7 @@ public boolean contains(Range other) { * For example, if the given position is equal to the start or end position of this range. * In these cases, the `other` range is not strictly "inside" of this range. */ - public boolean contains(Position position) { + public boolean contains(Position position) { return strictlyContains(position) || begin.equals(position) || end.equals(position); } @@ -162,7 +162,7 @@ public boolean contains(Position position) { *

* It means that this has to be larger than other and it has to start before other and end after other. */ - public boolean strictlyContains(Range other) { + public boolean strictlyContains(Range other) { boolean beginResult = (begin.isBefore(other.begin)); boolean endResult = (end.isAfter(other.end)); return beginResult && endResult; @@ -173,7 +173,7 @@ public boolean strictlyContains(Range other) { *

* It means that the position is after the begin of this range and before the end of this range. */ - public boolean strictlyContains(Position position) { + public boolean strictlyContains(Position position) { return position.isAfter(begin) && position.isBefore(end); } @@ -190,7 +190,7 @@ public boolean strictlyContains(Position position) { * Range 1: ABC * Range 2: CDE */ - public boolean overlapsWith(Range other) { + public boolean overlapsWith(Range other) { return (contains(other.begin) || contains(other.end)) || (other.contains(begin) || other.contains(end)); } @@ -198,7 +198,7 @@ public boolean overlapsWith(Range other) { * @param position The position to compare against. * @return True if the end of this range is before (but not equal to) the given position to compare against. */ - public boolean isBefore(Position position) { + public boolean isBefore(Position position) { return end.isBefore(position); } @@ -206,7 +206,7 @@ public boolean isBefore(Position position) { * @param other The range to compare against. * @return True if the end of this range is before (but not equal to) the given position to compare against. */ - public boolean isBefore(Range other) { + public boolean isBefore(Range other) { return end.isBefore(other.begin); } @@ -214,7 +214,7 @@ public boolean isBefore(Range other) { * @param position The position to compare against. * @return True if the start of this range is after (but not equal to) the given position to compare against. */ - public boolean isAfter(Position position) { + public boolean isAfter(Position position) { return begin.isAfter(position); } @@ -222,12 +222,12 @@ public boolean isAfter(Position position) { * @param other The range to compare against. * @return True if the start of this range is after (but not equal to) the given position to compare against. */ - public boolean isAfter(Range other) { + public boolean isAfter(Range other) { return begin.isAfter(other.end); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -237,12 +237,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return 31 * begin.hashCode() + end.hashCode(); } @Override - public String toString() { + public String toString() { return begin + "-" + end; } @@ -251,7 +251,7 @@ public String toString() { *

* If the start line and end line are the same, this range is limited to just one line. */ - public int getLineCount() { + public int getLineCount() { return end.line - begin.line + 1; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/TokenRange.java b/javaparser-core/src/main/java/com/github/javaparser/TokenRange.java index cc764547b0..19895de55f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/TokenRange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/TokenRange.java @@ -27,7 +27,7 @@ /** * The range of tokens covered by this node. */ -public class TokenRange implements Iterable { +public class TokenRange implements Iterable { public static final TokenRange INVALID = new TokenRange(JavaToken.INVALID, JavaToken.INVALID); @@ -35,36 +35,36 @@ public class TokenRange implements Iterable { private final JavaToken end; - public TokenRange(JavaToken begin, JavaToken end) { + public TokenRange(JavaToken begin, JavaToken end) { this.begin = assertNotNull(begin); this.end = assertNotNull(end); } - public JavaToken getBegin() { + public JavaToken getBegin() { return begin; } - public JavaToken getEnd() { + public JavaToken getEnd() { return end; } - public Optional toRange() { + public Optional toRange() { if (begin.hasRange() && end.hasRange()) { return Optional.of(new Range(begin.getRange().get().begin, end.getRange().get().end)); } return Optional.empty(); } - public TokenRange withBegin(JavaToken begin) { + public TokenRange withBegin(JavaToken begin) { return new TokenRange(assertNotNull(begin), end); } - public TokenRange withEnd(JavaToken end) { + public TokenRange withEnd(JavaToken end) { return new TokenRange(begin, assertNotNull(end)); } @Override - public String toString() { + public String toString() { StringBuilder result = new StringBuilder(); for (JavaToken t : this) { result.append(t.getText()); @@ -73,7 +73,7 @@ public String toString() { } @Override - public Iterator iterator() { + public Iterator iterator() { return new Iterator() { private boolean hasNext = true; @@ -81,12 +81,12 @@ public Iterator iterator() { private JavaToken current = begin; @Override - public boolean hasNext() { + public boolean hasNext() { return hasNext; } @Override - public JavaToken next() { + public JavaToken next() { JavaToken retval = current; if (current == null) { throw new IllegalStateException("Attempting to move past end of range."); diff --git a/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java b/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java index 30cbe1e2d5..bda7cd2887 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java +++ b/javaparser-core/src/main/java/com/github/javaparser/TokenTypes.java @@ -26,7 +26,7 @@ /** * Complements GeneratedJavaParserConstants */ -public class TokenTypes { +public class TokenTypes { public static boolean isWhitespace(int kind) { return getCategory(kind).isWhitespace(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java b/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java index df9ccc1a7b..0254069586 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java +++ b/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java @@ -28,7 +28,7 @@ /** * {@link Provider} un-escaping unicode escape sequences in the input sequence. */ -public class UnicodeEscapeProcessingProvider implements Provider { +public class UnicodeEscapeProcessingProvider implements Provider { private static final char LF = '\n'; @@ -63,14 +63,14 @@ public class UnicodeEscapeProcessingProvider implements Provider { /** * Creates a {@link UnicodeEscapeProcessingProvider}. */ - public UnicodeEscapeProcessingProvider(Provider input) { + public UnicodeEscapeProcessingProvider(Provider input) { this(2048, input); } /** * Creates a {@link UnicodeEscapeProcessingProvider}. */ - public UnicodeEscapeProcessingProvider(int bufferSize, Provider input) { + public UnicodeEscapeProcessingProvider(int bufferSize, Provider input) { _input = input; _data = new char[bufferSize]; } @@ -78,19 +78,19 @@ public UnicodeEscapeProcessingProvider(int bufferSize, Provider input) { /** * The {@link LineCounter} of the input file. */ - public LineCounter getInputCounter() { + public LineCounter getInputCounter() { return _inputLine; } /** * The {@link LineCounter} of the output file. */ - public LineCounter getOutputCounter() { + public LineCounter getOutputCounter() { return _outputLine; } @Override - public int read(char[] buffer, final int offset, int len) throws IOException { + public int read(char[] buffer, final int offset, int len) throws IOException { int pos = offset; int stop = offset + len; while (pos < stop) { @@ -109,7 +109,7 @@ public int read(char[] buffer, final int offset, int len) throws IOException { } @Override - public void close() throws IOException { + public void close() throws IOException { _input.close(); } @@ -309,7 +309,7 @@ private void pushBack(int ch) { /** * The {@link PositionMapping} being built during processing the file. */ - public PositionMapping getPositionMapping() { + public PositionMapping getPositionMapping() { return _mappingBuilder.getMapping(); } @@ -323,14 +323,14 @@ public static final class PositionMapping { /** * Creates a {@link UnicodeEscapeProcessingProvider.PositionMapping}. */ - public PositionMapping() { + public PositionMapping() { super(); } /** * Whether this is the identity transformation. */ - public boolean isEmpty() { + public boolean isEmpty() { return _deltas.isEmpty(); } @@ -341,7 +341,7 @@ void add(int line, int column, int lineDelta, int columnDelta) { /** * Looks up the {@link PositionUpdate} for the given Position. */ - public PositionUpdate lookup(Position position) { + public PositionUpdate lookup(Position position) { int result = Collections.binarySearch(_deltas, position); if (result >= 0) { return _deltas.get(result); @@ -366,17 +366,17 @@ public static interface PositionUpdate { PositionUpdate NONE = new PositionUpdate() { @Override - public int transformLine(int line) { + public int transformLine(int line) { return line; } @Override - public int transformColumn(int column) { + public int transformColumn(int column) { return column; } @Override - public Position transform(Position pos) { + public Position transform(Position pos) { return pos; } }; @@ -420,24 +420,24 @@ private static final class DeltaInfo extends Position implements PositionUpdate /** * Creates a {@link PositionUpdate}. */ - public DeltaInfo(int line, int column, int lineDelta, int columnDelta) { + public DeltaInfo(int line, int column, int lineDelta, int columnDelta) { super(line, column); _lineDelta = lineDelta; _columnDelta = columnDelta; } @Override - public int transformLine(int sourceLine) { + public int transformLine(int sourceLine) { return sourceLine + _lineDelta; } @Override - public int transformColumn(int sourceColumn) { + public int transformColumn(int sourceColumn) { return sourceColumn + _columnDelta; } @Override - public String toString() { + public String toString() { return "(" + line + ", " + column + ": " + _lineDelta + ", " + _columnDelta + ")"; } } @@ -445,14 +445,14 @@ public String toString() { /** * Transforms the given {@link Position}. */ - public Position transform(Position pos) { + public Position transform(Position pos) { return lookup(pos).transform(pos); } /** * Transforms the given {@link Range}. */ - public Range transform(Range range) { + public Range transform(Range range) { Position begin = transform(range.begin); Position end = transform(range.end); if (begin == range.begin && end == range.end) { @@ -481,7 +481,7 @@ private static final class PositionMappingBuilder { * @param left The source {@link LineCounter}. * @param right The target {@link LineCounter}. */ - public PositionMappingBuilder(LineCounter left, LineCounter right) { + public PositionMappingBuilder(LineCounter left, LineCounter right) { _left = left; _right = right; update(); @@ -490,11 +490,11 @@ public PositionMappingBuilder(LineCounter left, LineCounter right) { /** * The built {@link PositionMapping}. */ - public PositionMapping getMapping() { + public PositionMapping getMapping() { return _mapping; } - public void update() { + public void update() { int lineDelta = _right.getLine() - _left.getLine(); int columnDelta = _right.getColumn() - _left.getColumn(); if (lineDelta != _lineDelta || columnDelta != _columnDelta) { @@ -525,35 +525,35 @@ public static final class LineCounter { /** * Creates a {@link UnicodeEscapeProcessingProvider.LineCounter}. */ - public LineCounter() { + public LineCounter() { super(); } /** * The line of the currently processed input character. */ - public int getLine() { + public int getLine() { return _line; } /** * The column of the currently processed input character. */ - public int getColumn() { + public int getColumn() { return _column; } /** * The current position. */ - public Position getPosition() { + public Position getPosition() { return new Position(getLine(), getColumn()); } /** * Analyzes the given character for line feed. */ - public int process(int ch) { + public int process(int ch) { switch(ch) { case EOF: { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/AbstractModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/AbstractModifier.java index 3874d3d13a..6d2f9bd473 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/AbstractModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/AbstractModifier.java @@ -8,9 +8,9 @@ * @author Alexander Weigl * @version 1 (12/12/21) */ -public class AbstractModifier extends Node { +public class AbstractModifier extends Node { - public AbstractModifier() { + public AbstractModifier() { this(null); } @@ -19,11 +19,11 @@ protected AbstractModifier(TokenRange tokenRange) { } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { return null; } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/AccessSpecifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/AccessSpecifier.java index 27356d322e..f1a8521be0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/AccessSpecifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/AccessSpecifier.java @@ -27,7 +27,7 @@ * @author Federico Tomassetti * @since July 2014 */ -public enum AccessSpecifier { +public enum AccessSpecifier { PUBLIC("public"), PRIVATE("private"), PROTECTED("protected"), NONE(""); @@ -37,7 +37,7 @@ public enum AccessSpecifier { this.codeRepresenation = codeRepresentation; } - public String asString() { + public String asString() { return this.codeRepresenation; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/AllFieldsConstructor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/AllFieldsConstructor.java index 2684f3d6dd..16da0a72b4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/AllFieldsConstructor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/AllFieldsConstructor.java @@ -30,5 +30,5 @@ */ @Target(ElementType.CONSTRUCTOR) @Retention(RetentionPolicy.RUNTIME) -public @interface AllFieldsConstructor { +public @interface AllFieldsConstructor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/ArrayCreationLevel.java b/javaparser-core/src/main/java/com/github/javaparser/ast/ArrayCreationLevel.java index 1c6358f7ee..b091eccd35 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/ArrayCreationLevel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/ArrayCreationLevel.java @@ -40,27 +40,27 @@ * the first one contains the expression "1", * the second the expression "2". */ -public class ArrayCreationLevel extends Node implements NodeWithAnnotations { +public class ArrayCreationLevel extends Node implements NodeWithAnnotations { @OptionalProperty private Expression dimension; private NodeList annotations = new NodeList<>(); - public ArrayCreationLevel() { + public ArrayCreationLevel() { this(null, null, new NodeList<>()); } - public ArrayCreationLevel(int dimension) { + public ArrayCreationLevel(int dimension) { this(null, new IntegerLiteralExpr("" + dimension), new NodeList<>()); } - public ArrayCreationLevel(Expression dimension) { + public ArrayCreationLevel(Expression dimension) { this(null, dimension, new NodeList<>()); } @AllFieldsConstructor - public ArrayCreationLevel(Expression dimension, NodeList annotations) { + public ArrayCreationLevel(Expression dimension, NodeList annotations) { this(null, dimension, annotations); } @@ -68,7 +68,7 @@ public ArrayCreationLevel(Expression dimension, NodeList annota * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ArrayCreationLevel(TokenRange tokenRange, Expression dimension, NodeList annotations) { + public ArrayCreationLevel(TokenRange tokenRange, Expression dimension, NodeList annotations) { super(tokenRange); setDimension(dimension); setAnnotations(annotations); @@ -77,13 +77,13 @@ public ArrayCreationLevel(TokenRange tokenRange, Expression dimension, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -94,7 +94,7 @@ public void accept(final VoidVisitor v, final A arg) { * @return this, the ArrayCreationLevel */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayCreationLevel setDimension(final Expression dimension) { + public ArrayCreationLevel setDimension(final Expression dimension) { if (dimension == this.dimension) { return this; } @@ -107,17 +107,17 @@ public ArrayCreationLevel setDimension(final Expression dimension) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getDimension() { + public Optional getDimension() { return Optional.ofNullable(dimension); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayCreationLevel setAnnotations(final NodeList annotations) { + public ArrayCreationLevel setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -131,13 +131,13 @@ public ArrayCreationLevel setAnnotations(final NodeList annotat } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ArrayCreationLevel removeDimension() { + public ArrayCreationLevel removeDimension() { return setDimension((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -158,19 +158,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ArrayCreationLevel clone() { + public ArrayCreationLevel clone() { return (ArrayCreationLevel) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ArrayCreationLevelMetaModel getMetaModel() { + public ArrayCreationLevelMetaModel getMetaModel() { return JavaParserMetaModel.arrayCreationLevelMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java b/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java index 007999d9ad..fd22061acd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java @@ -75,7 +75,7 @@ * @see TypeDeclaration * @see Storage */ -public class CompilationUnit extends Node { +public class CompilationUnit extends Node { private static final String JAVA_LANG = "java.lang"; @@ -92,16 +92,16 @@ public class CompilationUnit extends Node { @InternalProperty private Storage storage; - public CompilationUnit() { + public CompilationUnit() { this(null, null, new NodeList<>(), new NodeList<>(), null); } - public CompilationUnit(String packageDeclaration) { + public CompilationUnit(String packageDeclaration) { this(null, new PackageDeclaration(new Name(packageDeclaration)), new NodeList<>(), new NodeList<>(), null); } @AllFieldsConstructor - public CompilationUnit(PackageDeclaration packageDeclaration, NodeList imports, NodeList> types, ModuleDeclaration module) { + public CompilationUnit(PackageDeclaration packageDeclaration, NodeList imports, NodeList> types, ModuleDeclaration module) { this(null, packageDeclaration, imports, types, module); } @@ -109,7 +109,7 @@ public CompilationUnit(PackageDeclaration packageDeclaration, NodeList imports, NodeList> types, ModuleDeclaration module) { + public CompilationUnit(TokenRange tokenRange, PackageDeclaration packageDeclaration, NodeList imports, NodeList> types, ModuleDeclaration module) { super(tokenRange); setPackageDeclaration(packageDeclaration); setImports(imports); @@ -120,20 +120,20 @@ public CompilationUnit(TokenRange tokenRange, PackageDeclaration packageDeclara @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } /** * Declare a specific printer */ - public CompilationUnit printer(Printer printer) { + public CompilationUnit printer(Printer printer) { setData(PRINTER_KEY, printer); return this; } @@ -167,7 +167,7 @@ protected Printer getPrinter(PrinterConfiguration config) { * Use {@link #getAllComments()} instead */ @Deprecated - public List getComments() { + public List getComments() { List comments = this.getAllContainedComments(); this.getComment().ifPresent(comments::add); return comments; @@ -184,7 +184,7 @@ public List getComments() { * @see com.github.javaparser.ast.comments.LineComment * @see com.github.javaparser.ast.comments.BlockComment */ - public List getAllComments() { + public List getAllComments() { List comments = this.getAllContainedComments(); this.getComment().ifPresent(comments::add); return comments; @@ -197,11 +197,11 @@ public List getAllComments() { * @return the list of imports or {@code none} if there is no import */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getImports() { + public NodeList getImports() { return imports; } - public ImportDeclaration getImport(int i) { + public ImportDeclaration getImport(int i) { return getImports().get(i); } @@ -213,7 +213,7 @@ public ImportDeclaration getImport(int i) { * @return the package declaration or {@code none} */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getPackageDeclaration() { + public Optional getPackageDeclaration() { return Optional.ofNullable(packageDeclaration); } @@ -227,7 +227,7 @@ public Optional getPackageDeclaration() { * @see EnumDeclaration */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList> getTypes() { + public NodeList> getTypes() { return types; } @@ -237,7 +237,7 @@ public NodeList> getTypes() { * * @param i the index of the type declaration to retrieve */ - public TypeDeclaration getType(int i) { + public TypeDeclaration getType(int i) { return getTypes().get(i); } @@ -248,7 +248,7 @@ public TypeDeclaration getType(int i) { * @param imports the list of imports */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompilationUnit setImports(final NodeList imports) { + public CompilationUnit setImports(final NodeList imports) { assertNotNull(imports); if (imports == this.imports) { return this; @@ -261,7 +261,7 @@ public CompilationUnit setImports(final NodeList imports) { return this; } - public CompilationUnit setImport(int i, ImportDeclaration imports) { + public CompilationUnit setImport(int i, ImportDeclaration imports) { getImports().set(i, imports); return this; } @@ -273,7 +273,7 @@ public CompilationUnit setImport(int i, ImportDeclaration imports) { * @param importDeclaration * @return {@code this} */ - public CompilationUnit addImport(ImportDeclaration importDeclaration) { + public CompilationUnit addImport(ImportDeclaration importDeclaration) { if (importDeclaration.isAsterisk()) { getImports().removeIf(im -> Objects.equals(getImportPackageName(im).get(), getImportPackageName(importDeclaration).orElse(null))); } @@ -314,7 +314,7 @@ private static Optional getImportPackageName(ImportDeclaration importDecla * @param packageDeclaration the packageDeclaration declaration to set or {@code null} to default package */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompilationUnit setPackageDeclaration(final PackageDeclaration packageDeclaration) { + public CompilationUnit setPackageDeclaration(final PackageDeclaration packageDeclaration) { if (packageDeclaration == this.packageDeclaration) { return this; } @@ -330,7 +330,7 @@ public CompilationUnit setPackageDeclaration(final PackageDeclaration packageDe * Sets the list of types declared in this compilation unit. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompilationUnit setTypes(final NodeList> types) { + public CompilationUnit setTypes(final NodeList> types) { assertNotNull(types); if (types == this.types) { return this; @@ -343,7 +343,7 @@ public CompilationUnit setTypes(final NodeList> types) { return this; } - public CompilationUnit setType(int i, TypeDeclaration type) { + public CompilationUnit setType(int i, TypeDeclaration type) { NodeList> copy = new NodeList<>(); copy.addAll(getTypes()); getTypes().set(i, type); @@ -351,7 +351,7 @@ public CompilationUnit setType(int i, TypeDeclaration type) { return this; } - public CompilationUnit addType(TypeDeclaration type) { + public CompilationUnit addType(TypeDeclaration type) { NodeList> copy = new NodeList<>(); copy.addAll(getTypes()); getTypes().add(type); @@ -365,7 +365,7 @@ public CompilationUnit addType(TypeDeclaration type) { * @param name the name of the package * @return this, the {@link CompilationUnit} */ - public CompilationUnit setPackageDeclaration(String name) { + public CompilationUnit setPackageDeclaration(String name) { setPackageDeclaration(new PackageDeclaration(parseName(name))); return this; } @@ -377,7 +377,7 @@ public CompilationUnit setPackageDeclaration(String name) { * @param name the import name * @return this, the {@link CompilationUnit} */ - public CompilationUnit addImport(String name) { + public CompilationUnit addImport(String name) { return addImport(name, false, false); } @@ -389,7 +389,7 @@ public CompilationUnit addImport(String name) { * @return this, the {@link CompilationUnit} * @throws IllegalArgumentException if clazz is an anonymous or local class */ - public CompilationUnit addImport(Class clazz) { + public CompilationUnit addImport(Class clazz) { if (clazz.isArray()) { return addImport(clazz.getComponentType()); } @@ -409,7 +409,7 @@ public CompilationUnit addImport(Class clazz) { * @param isAsterisk does the import end with ".*" * @return this, the {@link CompilationUnit} */ - public CompilationUnit addImport(String name, boolean isStatic, boolean isAsterisk) { + public CompilationUnit addImport(String name, boolean isStatic, boolean isAsterisk) { if (name == null) { return this; } @@ -431,7 +431,7 @@ public CompilationUnit addImport(String name, boolean isStatic, boolean isAster * @param name the class name * @return the newly created class */ - public ClassOrInterfaceDeclaration addClass(String name) { + public ClassOrInterfaceDeclaration addClass(String name) { return addClass(name, Modifier.DefaultKeyword.PUBLIC); } @@ -442,7 +442,7 @@ public ClassOrInterfaceDeclaration addClass(String name) { * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ - public ClassOrInterfaceDeclaration addClass(String name, Modifier.DefaultKeyword... modifiers) { + public ClassOrInterfaceDeclaration addClass(String name, Modifier.DefaultKeyword... modifiers) { ClassOrInterfaceDeclaration classOrInterfaceDeclaration = new ClassOrInterfaceDeclaration(createModifierList(modifiers), false, name); getTypes().add(classOrInterfaceDeclaration); return classOrInterfaceDeclaration; @@ -454,7 +454,7 @@ public ClassOrInterfaceDeclaration addClass(String name, Modifier.DefaultKeywor * @param name the interface name * @return the newly created class */ - public ClassOrInterfaceDeclaration addInterface(String name) { + public ClassOrInterfaceDeclaration addInterface(String name) { return addInterface(name, Modifier.DefaultKeyword.PUBLIC); } @@ -465,7 +465,7 @@ public ClassOrInterfaceDeclaration addInterface(String name) { * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ - public ClassOrInterfaceDeclaration addInterface(String name, Modifier.DefaultKeyword... modifiers) { + public ClassOrInterfaceDeclaration addInterface(String name, Modifier.DefaultKeyword... modifiers) { ClassOrInterfaceDeclaration classOrInterfaceDeclaration = new ClassOrInterfaceDeclaration(createModifierList(modifiers), true, name); getTypes().add(classOrInterfaceDeclaration); return classOrInterfaceDeclaration; @@ -477,7 +477,7 @@ public ClassOrInterfaceDeclaration addInterface(String name, Modifier.DefaultKe * @param name the enum name * @return the newly created class */ - public EnumDeclaration addEnum(String name) { + public EnumDeclaration addEnum(String name) { return addEnum(name, Modifier.DefaultKeyword.PUBLIC); } @@ -488,7 +488,7 @@ public EnumDeclaration addEnum(String name) { * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ - public EnumDeclaration addEnum(String name, Modifier.DefaultKeyword... modifiers) { + public EnumDeclaration addEnum(String name, Modifier.DefaultKeyword... modifiers) { EnumDeclaration enumDeclaration = new EnumDeclaration(createModifierList(modifiers), name); getTypes().add(enumDeclaration); return enumDeclaration; @@ -500,7 +500,7 @@ public EnumDeclaration addEnum(String name, Modifier.DefaultKeyword... modifier * @param name the annotation name * @return the newly created class */ - public AnnotationDeclaration addAnnotationDeclaration(String name) { + public AnnotationDeclaration addAnnotationDeclaration(String name) { return addAnnotationDeclaration(name, Modifier.DefaultKeyword.PUBLIC); } @@ -511,7 +511,7 @@ public AnnotationDeclaration addAnnotationDeclaration(String name) { * @param modifiers the modifiers (like Modifier.PUBLIC) * @return the newly created class */ - public AnnotationDeclaration addAnnotationDeclaration(String name, Modifier.DefaultKeyword... modifiers) { + public AnnotationDeclaration addAnnotationDeclaration(String name, Modifier.DefaultKeyword... modifiers) { AnnotationDeclaration annotationDeclaration = new AnnotationDeclaration(createModifierList(modifiers), name); getTypes().add(annotationDeclaration); return annotationDeclaration; @@ -522,7 +522,7 @@ public AnnotationDeclaration addAnnotationDeclaration(String name, Modifier.Def * * @param className the class name (case-sensitive) */ - public Optional getClassByName(String className) { + public Optional getClassByName(String className) { return getTypes().stream().filter(type -> type.getNameAsString().equals(className) && type instanceof ClassOrInterfaceDeclaration && !((ClassOrInterfaceDeclaration) type).isInterface()).findFirst().map(t -> (ClassOrInterfaceDeclaration) t); } @@ -531,7 +531,7 @@ public Optional getClassByName(String className) { * * @param className the class name (case-sensitive) */ - public List getLocalDeclarationFromClassname(String className) { + public List getLocalDeclarationFromClassname(String className) { return findAll(ClassOrInterfaceDeclaration.class).stream().filter(cid -> cid.getFullyQualifiedName().get().endsWith(className)).collect(Collectors.toList()); } @@ -540,7 +540,7 @@ public List getLocalDeclarationFromClassname(Strin * * @param interfaceName the interface name (case-sensitive) */ - public Optional getInterfaceByName(String interfaceName) { + public Optional getInterfaceByName(String interfaceName) { return getTypes().stream().filter(type -> type.getNameAsString().equals(interfaceName) && type instanceof ClassOrInterfaceDeclaration && ((ClassOrInterfaceDeclaration) type).isInterface()).findFirst().map(t -> (ClassOrInterfaceDeclaration) t); } @@ -549,7 +549,7 @@ public Optional getInterfaceByName(String interfac * * @param enumName the enum name (case-sensitive) */ - public Optional getEnumByName(String enumName) { + public Optional getEnumByName(String enumName) { return getTypes().stream().filter(type -> type.getNameAsString().equals(enumName) && type instanceof EnumDeclaration).findFirst().map(t -> (EnumDeclaration) t); } @@ -557,7 +557,7 @@ public Optional getEnumByName(String enumName) { * @return the name that the primary type in this file should have, according to the filename in {@link Storage#getFileName()}. * Empty if no file information is present (when this compilation unit wasn't parsed from a file.) */ - public Optional getPrimaryTypeName() { + public Optional getPrimaryTypeName() { return getStorage().map(Storage::getFileName).map(Utils::removeFileExtension); } @@ -566,7 +566,7 @@ public Optional getPrimaryTypeName() { * Empty if no file information is present (when this compilation unit wasn't parsed from a file.) * If for some strange reason there are multiple types of this name, the first one is returned. */ - public Optional> getPrimaryType() { + public Optional> getPrimaryType() { return getPrimaryTypeName().flatMap(name -> getTypes().stream().filter(t -> t.getNameAsString().equals(name)).findFirst()); } @@ -575,7 +575,7 @@ public Optional> getPrimaryType() { * * @param annotationName the annotation name (case-sensitive) */ - public Optional getAnnotationDeclarationByName(String annotationName) { + public Optional getAnnotationDeclarationByName(String annotationName) { return getTypes().stream().filter(type -> type.getNameAsString().equals(annotationName) && type instanceof AnnotationDeclaration).findFirst().map(t -> (AnnotationDeclaration) t); } @@ -584,13 +584,13 @@ public Optional getAnnotationDeclarationByName(String an * * @param recordName the enum name (case-sensitive) */ - public Optional getRecordByName(String recordName) { + public Optional getRecordByName(String recordName) { return getTypes().stream().filter(type -> type.getNameAsString().equals(recordName) && type instanceof RecordDeclaration).findFirst().map(t -> (RecordDeclaration) t); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -622,7 +622,7 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public CompilationUnit removePackageDeclaration() { + public CompilationUnit removePackageDeclaration() { return setPackageDeclaration((PackageDeclaration) null); } @@ -630,12 +630,12 @@ public CompilationUnit removePackageDeclaration() { * @return the module declared in this compilation unit. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getModule() { + public Optional getModule() { return Optional.ofNullable(module); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompilationUnit setModule(final ModuleDeclaration module) { + public CompilationUnit setModule(final ModuleDeclaration module) { if (module == this.module) { return this; } @@ -648,23 +648,23 @@ public CompilationUnit setModule(final ModuleDeclaration module) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public CompilationUnit removeModule() { + public CompilationUnit removeModule() { return setModule((ModuleDeclaration) null); } /** * @return information about where this compilation unit was loaded from, or empty if it wasn't loaded from a file. */ - public Optional getStorage() { + public Optional getStorage() { return Optional.ofNullable(storage); } - public CompilationUnit setStorage(Path path) { + public CompilationUnit setStorage(Path path) { this.storage = new Storage(this, path); return this; } - public CompilationUnit setStorage(Path path, Charset charset) { + public CompilationUnit setStorage(Path path, Charset charset) { this.storage = new Storage(this, path, charset); return this; } @@ -674,7 +674,7 @@ public CompilationUnit setStorage(Path path, Charset charset) { * * @return the module */ - public ModuleDeclaration setModule(String name) { + public ModuleDeclaration setModule(String name) { final ModuleDeclaration module = new ModuleDeclaration(parseName(name), false); setModule(module); return module; @@ -684,7 +684,7 @@ public ModuleDeclaration setModule(String name) { * Recalculates the ranges of all nodes by looking at the sizes of the tokens. * This is useful when you have manually inserted or deleted tokens and still want to use the ranges. */ - public void recalculatePositions() { + public void recalculatePositions() { if (!getTokenRange().isPresent()) { throw new IllegalStateException("Can't recalculate positions without tokens."); } @@ -726,21 +726,21 @@ private Storage(CompilationUnit compilationUnit, Path path, Charset encoding) { /** * @return the path to the source for this CompilationUnit */ - public Path getPath() { + public Path getPath() { return path; } /** * @return the CompilationUnit this Storage is about. */ - public CompilationUnit getCompilationUnit() { + public CompilationUnit getCompilationUnit() { return compilationUnit; } /** * @return the encoding used to read the file. */ - public Charset getEncoding() { + public Charset getEncoding() { return encoding; } @@ -749,23 +749,23 @@ public Charset getEncoding() { * declaration of this compilation unit. If the package declaration is invalid (when it does not match the end * of the path) a RuntimeException is thrown. */ - public Path getSourceRoot() { + public Path getSourceRoot() { final Optional pkgAsString = compilationUnit.getPackageDeclaration().map(NodeWithName::getNameAsString); return pkgAsString.map(p -> Paths.get(CodeGenerationUtils.packageToPath(p))).map(pkg -> subtractPaths(getDirectory(), pkg)).orElseGet(() -> getDirectory()); } - public String getFileName() { + public String getFileName() { return path.getFileName().toString(); } - public Path getDirectory() { + public Path getDirectory() { return path.getParent(); } /** * Saves the compilation unit to its original location */ - public void save() { + public void save() { save(cu -> compilationUnit.getPrinter().print(cu)); } @@ -775,7 +775,7 @@ public void save() { * * @param makeOutput a function that formats the compilation unit */ - public void save(Function makeOutput) { + public void save(Function makeOutput) { save(makeOutput, encoding); } @@ -786,7 +786,7 @@ public void save(Function makeOutput) { * @param makeOutput a function that formats the compilation unit * @param encoding the encoding to use for the saved file */ - public void save(Function makeOutput, Charset encoding) { + public void save(Function makeOutput, Charset encoding) { try { Files.createDirectories(path.getParent()); final String code = makeOutput.apply(getCompilationUnit()); @@ -796,7 +796,7 @@ public void save(Function makeOutput, Charset encoding } } - public ParseResult reparse(JavaParser javaParser) { + public ParseResult reparse(JavaParser javaParser) { try { return javaParser.parse(ParseStart.COMPILATION_UNIT, provider(getPath())); } catch (IOException e) { @@ -807,19 +807,19 @@ public ParseResult reparse(JavaParser javaParser) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CompilationUnit clone() { + public CompilationUnit clone() { return (CompilationUnit) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CompilationUnitMetaModel getMetaModel() { + public CompilationUnitMetaModel getMetaModel() { return JavaParserMetaModel.compilationUnitMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/DataKey.java b/javaparser-core/src/main/java/com/github/javaparser/ast/DataKey.java index 048ca1cff9..9815b26e37 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/DataKey.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/DataKey.java @@ -42,7 +42,7 @@ public abstract class DataKey { @Override - public int hashCode() { + public int hashCode() { return getClass().hashCode(); } @@ -50,7 +50,7 @@ public int hashCode() { * @see java.lang.Object#equals(java.lang.Object) */ @Override - public boolean equals(Object obj) { + public boolean equals(Object obj) { return obj != null && getClass().equals(obj.getClass()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Generated.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Generated.java index e8c7ec256b..274376f5c0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/Generated.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Generated.java @@ -33,7 +33,7 @@ */ @Retention(SOURCE) @Target({ PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER }) -public @interface Generated { +public @interface Generated { /** * The value element must have the name of the code generator. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java index 873a5b369e..c6eaa231a6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java @@ -44,7 +44,7 @@ * * @author Julio Vilmar Gesser */ -public class ImportDeclaration extends Node implements NodeWithName { +public class ImportDeclaration extends Node implements NodeWithName { private Name name; @@ -58,16 +58,16 @@ private ImportDeclaration() { this(new Name(), false, false); } - public ImportDeclaration(String name, boolean isStatic, boolean isAsterisk) { + public ImportDeclaration(String name, boolean isStatic, boolean isAsterisk) { this(parseName(name), isStatic, isAsterisk); } - public ImportDeclaration(Name name, boolean isStatic, boolean isAsterisk) { + public ImportDeclaration(Name name, boolean isStatic, boolean isAsterisk) { this(name, isStatic, isAsterisk, false); } @AllFieldsConstructor - public ImportDeclaration(Name name, boolean isStatic, boolean isAsterisk, boolean isJmlModel) { + public ImportDeclaration(Name name, boolean isStatic, boolean isAsterisk, boolean isJmlModel) { this(null, name, isStatic, isAsterisk, isJmlModel); } @@ -75,7 +75,7 @@ public ImportDeclaration(Name name, boolean isStatic, boolean isAsterisk, boole * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ImportDeclaration(TokenRange tokenRange, Name name, boolean isStatic, boolean isAsterisk, boolean isJmlModel) { + public ImportDeclaration(TokenRange tokenRange, Name name, boolean isStatic, boolean isAsterisk, boolean isJmlModel) { super(tokenRange); setName(name); setStatic(isStatic); @@ -84,19 +84,19 @@ public ImportDeclaration(TokenRange tokenRange, Name name, boolean isStatic, bo customInitialization(); } - public ImportDeclaration(TokenRange range, Name name, boolean isStatic, boolean isAsterisk) { + public ImportDeclaration(TokenRange range, Name name, boolean isStatic, boolean isAsterisk) { this(range, name, isStatic, isAsterisk, false); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -104,7 +104,7 @@ public void accept(final VoidVisitor v, final A arg) { * Retrieves the name of the import (.* is not included.) */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @@ -112,17 +112,17 @@ public Name getName() { * Return if the import ends with "*". */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isAsterisk() { + public boolean isAsterisk() { return isAsterisk; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isStatic() { + public boolean isStatic() { return isStatic; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ImportDeclaration setAsterisk(final boolean isAsterisk) { + public ImportDeclaration setAsterisk(final boolean isAsterisk) { if (isAsterisk == this.isAsterisk) { return this; } @@ -132,7 +132,7 @@ public ImportDeclaration setAsterisk(final boolean isAsterisk) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ImportDeclaration setName(final Name name) { + public ImportDeclaration setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -146,7 +146,7 @@ public ImportDeclaration setName(final Name name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ImportDeclaration setStatic(final boolean isStatic) { + public ImportDeclaration setStatic(final boolean isStatic) { if (isStatic == this.isStatic) { return this; } @@ -157,19 +157,19 @@ public ImportDeclaration setStatic(final boolean isStatic) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ImportDeclaration clone() { + public ImportDeclaration clone() { return (ImportDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ImportDeclarationMetaModel getMetaModel() { + public ImportDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.importDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -181,16 +181,16 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isJmlModel() { + public boolean isJmlModel() { return isJmlModel; } - public void setIsJmlModel(boolean b) { + public void setIsJmlModel(boolean b) { this.isJmlModel = b; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ImportDeclaration setJmlModel(final boolean isJmlModel) { + public ImportDeclaration setJmlModel(final boolean isJmlModel) { if (isJmlModel == this.isJmlModel) { return this; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Jmlish.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Jmlish.java index d9861bf699..d3abc888ca 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/Jmlish.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Jmlish.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public interface Jmlish { +public interface Jmlish { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java index a20ba59275..c381426018 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Modifier.java @@ -34,7 +34,7 @@ /** * A modifier, like private, public, or volatile. */ -public class Modifier extends Node { +public class Modifier extends Node { public static Modifier publicModifier() { return new Modifier(DefaultKeyword.PUBLIC); @@ -120,7 +120,7 @@ public static Modifier jmlSpecPrivateModifier() { return new Modifier(DefaultKeyword.JML_SPEC_PRIVATE); } - public interface Keyword { + public interface Keyword { String asString(); @@ -138,7 +138,7 @@ public static Modifier nonSealedModifier() { /** * The Java modifier keywords. */ - public enum DefaultKeyword implements Keyword { + public enum DefaultKeyword implements Keyword { DEFAULT("default"), PUBLIC("public"), @@ -193,19 +193,19 @@ public enum DefaultKeyword implements Keyword { * @return the Java keyword represented by this enum constant. */ @Override - public String asString() { + public String asString() { return codeRepresentation; } } private Keyword keyword; - public Modifier() { + public Modifier() { this(DefaultKeyword.PUBLIC); } @AllFieldsConstructor - public Modifier(Keyword keyword) { + public Modifier(Keyword keyword) { this(null, keyword); } @@ -213,7 +213,7 @@ public Modifier(Keyword keyword) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Modifier(TokenRange tokenRange, Keyword keyword) { + public Modifier(TokenRange tokenRange, Keyword keyword) { super(tokenRange); setKeyword(keyword); customInitialization(); @@ -221,23 +221,23 @@ public Modifier(TokenRange tokenRange, Keyword keyword) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Keyword getKeyword() { + public Keyword getKeyword() { return keyword; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Modifier setKeyword(final Keyword keyword) { + public Modifier setKeyword(final Keyword keyword) { assertNotNull(keyword); if (keyword == this.keyword) { return this; @@ -257,13 +257,13 @@ public static NodeList createModifierList(Modifier.Keyword... modifier @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Modifier clone() { + public Modifier clone() { return (Modifier) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModifierMetaModel getMetaModel() { + public ModifierMetaModel getMetaModel() { return JavaParserMetaModel.modifierMetaModel; } @@ -271,7 +271,7 @@ public ModifierMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Modifier(TokenRange tokenRange) { + public Modifier(TokenRange tokenRange) { super(tokenRange); customInitialization(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java index 69e840c766..d9c9876755 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java @@ -108,7 +108,7 @@ public abstract class Node implements Cloneable, HasParentNode, Visitable, /** * Different registration mode for observers on nodes. */ - public enum ObserverRegistrationMode { + public enum ObserverRegistrationMode { /** * Notify exclusively for changes happening on this node alone. @@ -127,7 +127,7 @@ public enum ObserverRegistrationMode { SELF_PROPAGATING } - public enum Parsedness { + public enum Parsedness { PARSED, UNPARSABLE } @@ -228,7 +228,7 @@ protected PrinterConfiguration getDefaultPrinterConfiguration() { * @return comment property */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getComment() { + public Optional getComment() { return Optional.ofNullable(comment); } @@ -236,7 +236,7 @@ public Optional getComment() { * @return the range of characters in the source code that this node covers. */ @Override - public Optional getRange() { + public Optional getRange() { return Optional.ofNullable(range); } @@ -244,12 +244,12 @@ public Optional getRange() { * @return the range of tokens that this node covers. */ @Override - public Optional getTokenRange() { + public Optional getTokenRange() { return Optional.ofNullable(tokenRange); } @Override - public Node setTokenRange(TokenRange tokenRange) { + public Node setTokenRange(TokenRange tokenRange) { this.tokenRange = tokenRange; if (tokenRange == null || !(tokenRange.getBegin().hasRange() && tokenRange.getEnd().hasRange())) { range = null; @@ -264,7 +264,7 @@ public Node setTokenRange(TokenRange tokenRange) { * no range information is known, or that it is not of interest. */ @Override - public Node setRange(Range range) { + public Node setRange(Range range) { if (this.range == range) { return this; } @@ -278,7 +278,7 @@ public Node setRange(Range range) { * * @param comment to be set */ - public Node setComment(final Comment comment) { + public Node setComment(final Comment comment) { if (this.comment == comment) { return this; } @@ -347,7 +347,7 @@ public final int hashCode() { } @Override - public boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (!(obj instanceof Node)) { return false; } @@ -355,7 +355,7 @@ public boolean equals(final Object obj) { } @Override - public Optional getParentNode() { + public Optional getParentNode() { return Optional.ofNullable(parentNode); } @@ -365,17 +365,17 @@ public Optional getParentNode() { * * @return all nodes that have this node as their parent. */ - public List getChildNodes() { + public List getChildNodes() { return unmodifiableList(childNodes); } - public void addOrphanComment(Comment comment) { + public void addOrphanComment(Comment comment) { notifyPropertyChange(ObservableProperty.COMMENT, null, comment); orphanComments.add(comment); comment.setParentNode(this); } - public boolean removeOrphanComment(Comment comment) { + public boolean removeOrphanComment(Comment comment) { boolean removed = orphanComments.remove(comment); if (removed) { notifyPropertyChange(ObservableProperty.COMMENT, comment, null); @@ -399,7 +399,7 @@ public boolean removeOrphanComment(Comment comment) { * * @return all comments that cannot be attributed to a concept */ - public List getOrphanComments() { + public List getOrphanComments() { return unmodifiableList(orphanComments); } @@ -410,7 +410,7 @@ public List getOrphanComments() { * * @return all Comments within the node as a list */ - public List getAllContainedComments() { + public List getAllContainedComments() { List comments = new LinkedList<>(orphanComments); for (Node child : getChildNodes()) { child.getComment().ifPresent(comments::add); @@ -426,7 +426,7 @@ public List getAllContainedComments() { * @param newParentNode node to be set as parent */ @Override - public Node setParentNode(Node newParentNode) { + public Node setParentNode(Node newParentNode) { if (newParentNode == parentNode) { return this; } @@ -464,7 +464,7 @@ protected void setAsParentNodeOf(Node childNode) { * @return * @author weigl */ - public Optional getParentNodeOfType(Class clazz) { + public Optional getParentNodeOfType(Class clazz) { Node cur = this; while (cur.hasParentNode()) { cur = cur.getParentNode().get(); @@ -487,7 +487,7 @@ public Optional getParentNodeOfType(Class clazz) { @Deprecated public static final int ABSOLUTE_END_LINE = Position.ABSOLUTE_END_LINE; - public void tryAddImportToParentCompilationUnit(Class clazz) { + public void tryAddImportToParentCompilationUnit(Class clazz) { findAncestor(CompilationUnit.class).ifPresent(p -> p.addImport(clazz)); } @@ -498,7 +498,7 @@ public void tryAddImportToParentCompilationUnit(Class clazz) { * @deprecated use {@link Node#findAll(Class)} but be aware that findAll also considers the initial node. */ @Deprecated - public List getChildNodesByType(Class clazz) { + public List getChildNodesByType(Class clazz) { List nodes = new ArrayList<>(); for (Node child : getChildNodes()) { if (clazz.isInstance(child)) { @@ -513,7 +513,7 @@ public List getChildNodesByType(Class clazz) { * @deprecated use {@link Node#findAll(Class)} but be aware that findAll also considers the initial node. */ @Deprecated - public List getNodesByType(Class clazz) { + public List getNodesByType(Class clazz) { return getChildNodesByType(clazz); } @@ -528,7 +528,7 @@ public List getNodesByType(Class clazz) { * @see DataKey */ @SuppressWarnings("unchecked") - public M getData(final DataKey key) { + public M getData(final DataKey key) { if (data == null) { throw new IllegalStateException("No data of this type found. Use containsData to check for this first."); } @@ -548,7 +548,7 @@ public M getData(final DataKey key) { * @see DataKey */ @SuppressWarnings("unchecked") - public Optional findData(final DataKey key) { + public Optional findData(final DataKey key) { if (containsData(key)) { return Optional.of(getData(key)); } @@ -560,7 +560,7 @@ public Optional findData(final DataKey key) { * * @return all known data keys. */ - public Set> getDataKeys() { + public Set> getDataKeys() { if (data == null) { return emptySet(); } @@ -576,7 +576,7 @@ public Set> getDataKeys() { * @param object The data object * @see DataKey */ - public void setData(DataKey key, M object) { + public void setData(DataKey key, M object) { if (data == null) { data = new IdentityHashMap<>(); } @@ -587,7 +587,7 @@ public void setData(DataKey key, M object) { * @return does this node have data for this key? * @see DataKey */ - public boolean containsData(DataKey key) { + public boolean containsData(DataKey key) { if (data == null) { return false; } @@ -599,7 +599,7 @@ public boolean containsData(DataKey key) { * * @see DataKey */ - public void removeData(DataKey key) { + public void removeData(DataKey key) { if (data != null) { data.remove(key); } @@ -611,7 +611,7 @@ public void removeData(DataKey key) { * @return true if removed, false if it is a required property of the parent, or if the parent isn't set. * @throws RuntimeException if it fails in an unexpected way */ - public boolean remove() { + public boolean remove() { if (parentNode == null) { return false; } @@ -624,7 +624,7 @@ public boolean remove() { * @return true if removed, or if the parent isn't set. * @throws RuntimeException if it fails in an unexpected way */ - public boolean replace(Node node) { + public boolean replace(Node node) { if (parentNode == null) { return false; } @@ -641,14 +641,14 @@ public boolean replace(Node node) { * Since everything at CompilationUnit level is removable, * this method will only (silently) fail when the node is in a detached AST fragment. */ - public void removeForced() { + public void removeForced() { if (!remove()) { getParentNode().ifPresent(Node::remove); } } @Override - public Node getParentNodeForChildren() { + public Node getParentNodeForChildren() { return this; } @@ -658,18 +658,18 @@ protected void setAsParentNodeOf(NodeList list) { } } - public

void notifyPropertyChange(ObservableProperty property, P oldValue, P newValue) { + public

void notifyPropertyChange(ObservableProperty property, P oldValue, P newValue) { this.observers.forEach(o -> o.propertyChange(this, property, oldValue, newValue)); } @Override - public void unregister(AstObserver observer) { + public void unregister(AstObserver observer) { this.observers.remove(observer); this.observers.trimToSize(); } @Override - public void register(AstObserver observer) { + public void register(AstObserver observer) { // Check if the observer is not registered yet. // In this case we use a List instead of Set to save on memory space. if (!this.observers.contains(observer)) { @@ -681,7 +681,7 @@ public void register(AstObserver observer) { * Register a new observer for the given node. Depending on the mode specified also descendants, existing * and new, could be observed. For more details see ObserverRegistrationMode. */ - public void register(AstObserver observer, ObserverRegistrationMode mode) { + public void register(AstObserver observer, ObserverRegistrationMode mode) { if (mode == null) { throw new IllegalArgumentException("Mode should be not null"); } @@ -703,7 +703,7 @@ public void register(AstObserver observer, ObserverRegistrationMode mode) { /** * Register the observer for the current node and all the contained node and nodelists, recursively. */ - public void registerForSubtree(AstObserver observer) { + public void registerForSubtree(AstObserver observer) { register(observer); this.getChildNodes().forEach(c -> c.registerForSubtree(observer)); for (PropertyMetaModel property : getMetaModel().getAllPropertyMetaModels()) { @@ -716,12 +716,12 @@ public void registerForSubtree(AstObserver observer) { } @Override - public boolean isRegistered(AstObserver observer) { + public boolean isRegistered(AstObserver observer) { return this.observers.contains(observer); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -735,13 +735,13 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public Node removeComment() { + public Node removeComment() { return setComment((Comment) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Node clone() { + public Node clone() { return (Node) accept(new CloneVisitor(), null); } @@ -749,7 +749,7 @@ public Node clone() { * @return get JavaParser specific node introspection information. */ @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public NodeMetaModel getMetaModel() { + public NodeMetaModel getMetaModel() { return JavaParserMetaModel.nodeMetaModel; } @@ -757,20 +757,20 @@ public NodeMetaModel getMetaModel() { * @return whether this node was successfully parsed or not. * If it was not, only the range and tokenRange fields will be valid. */ - public Parsedness getParsed() { + public Parsedness getParsed() { return parsed; } /** * Used by the parser to flag unparsable nodes. */ - public Node setParsed(Parsedness parsed) { + public Node setParsed(Parsedness parsed) { this.parsed = parsed; return this; } @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -786,7 +786,7 @@ public boolean replace(Node node, Node replacementNode) { /** * Finds the root node of this AST by finding the topmost parent. */ - public Node findRootNode() { + public Node findRootNode() { Node n = this; while (n.getParentNode().isPresent()) { n = n.getParentNode().get(); @@ -797,7 +797,7 @@ public Node findRootNode() { /** * @return the containing CompilationUnit, or empty if this node is not inside a compilation unit. */ - public Optional findCompilationUnit() { + public Optional findCompilationUnit() { Node rootNode = findRootNode(); if (rootNode instanceof CompilationUnit) { return Optional.of((CompilationUnit) rootNode); @@ -805,14 +805,14 @@ public Optional findCompilationUnit() { return Optional.empty(); } - public LineSeparator getLineEndingStyleOrDefault(LineSeparator defaultLineSeparator) { + public LineSeparator getLineEndingStyleOrDefault(LineSeparator defaultLineSeparator) { if (getLineEndingStyle().isStandardEol()) { return getLineEndingStyle(); } return defaultLineSeparator; } - public LineSeparator getLineEndingStyle() { + public LineSeparator getLineEndingStyle() { Node current = this; // First check this node if (current.containsData(Node.LINE_SEPARATOR_KEY)) { @@ -830,7 +830,7 @@ public LineSeparator getLineEndingStyle() { return LineSeparator.SYSTEM; } - public SymbolResolver getSymbolResolver() { + public SymbolResolver getSymbolResolver() { return findCompilationUnit().map(cu -> { if (cu.containsData(SYMBOL_RESOLVER_KEY)) { return cu.getData(SYMBOL_RESOLVER_KEY); @@ -852,7 +852,7 @@ public SymbolResolver getSymbolResolver() { protected static final DataKey PHANTOM_KEY = new DataKey() { }; - public enum TreeTraversal { + public enum TreeTraversal { PREORDER, BREADTHFIRST, POSTORDER, PARENTS, DIRECT_CHILDREN } @@ -881,14 +881,14 @@ private Iterable treeIterable(TreeTraversal traversal) { /** * Make a stream of nodes using traversal algorithm "traversal". */ - public Stream stream(TreeTraversal traversal) { + public Stream stream(TreeTraversal traversal) { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(treeIterator(traversal), NONNULL | DISTINCT), false); } /** * Make a stream of nodes using pre-order traversal. */ - public Stream stream() { + public Stream stream() { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(treeIterator(PREORDER), NONNULL | DISTINCT), false); } @@ -896,7 +896,7 @@ public Stream stream() { * Walks the AST, calling the consumer for every node, with traversal algorithm "traversal". *
This is the most general walk method. All other walk and findAll methods are based on this. */ - public void walk(TreeTraversal traversal, Consumer consumer) { + public void walk(TreeTraversal traversal, Consumer consumer) { // Could be implemented as a call to the above walk method, but this is a little more efficient. for (Node node : treeIterable(traversal)) { consumer.accept(node); @@ -906,14 +906,14 @@ public void walk(TreeTraversal traversal, Consumer consumer) { /** * Walks the AST, calling the consumer for every node with pre-order traversal. */ - public void walk(Consumer consumer) { + public void walk(Consumer consumer) { walk(PREORDER, consumer); } /** * Walks the AST with pre-order traversal, calling the consumer for every node of type "nodeType". */ - public void walk(Class nodeType, Consumer consumer) { + public void walk(Class nodeType, Consumer consumer) { walk(TreeTraversal.PREORDER, node -> { if (nodeType.isAssignableFrom(node.getClass())) { consumer.accept(nodeType.cast(node)); @@ -924,7 +924,7 @@ public void walk(Class nodeType, Consumer consumer) { /** * Walks the AST with pre-order traversal, returning all nodes of type "nodeType". */ - public List findAll(Class nodeType) { + public List findAll(Class nodeType) { final List found = new ArrayList<>(); walk(nodeType, found::add); return found; @@ -933,7 +933,7 @@ public List findAll(Class nodeType) { /** * Walks the AST with specified traversal order, returning all nodes of type "nodeType". */ - public List findAll(Class nodeType, TreeTraversal traversal) { + public List findAll(Class nodeType, TreeTraversal traversal) { final List found = new ArrayList<>(); walk(traversal, node -> { if (nodeType.isAssignableFrom(node.getClass())) { @@ -946,7 +946,7 @@ public List findAll(Class nodeType, TreeTraversal traver /** * Walks the AST with pre-order traversal, returning all nodes of type "nodeType" that match the predicate. */ - public List findAll(Class nodeType, Predicate predicate) { + public List findAll(Class nodeType, Predicate predicate) { final List found = new ArrayList<>(); walk(nodeType, n -> { if (predicate.test(n)) @@ -960,7 +960,7 @@ public List findAll(Class nodeType, Predicate predica * returns something else than null, the traversal is stopped and the function result is returned.
This is the * most general findFirst method. All other findFirst methods are based on this. */ - public Optional findFirst(TreeTraversal traversal, Function> consumer) { + public Optional findFirst(TreeTraversal traversal, Function> consumer) { for (Node node : treeIterable(traversal)) { final Optional result = consumer.apply(node); if (result.isPresent()) { @@ -973,7 +973,7 @@ public Optional findFirst(TreeTraversal traversal, Function Optional findFirst(Class nodeType) { + public Optional findFirst(Class nodeType) { return findFirst(TreeTraversal.PREORDER, node -> { if (nodeType.isAssignableFrom(node.getClass())) { return Optional.of(nodeType.cast(node)); @@ -986,7 +986,7 @@ public Optional findFirst(Class nodeType) { * Walks the AST with pre-order traversal, returning the first node of type "nodeType" that matches "predicate" or empty() if none is * found. */ - public Optional findFirst(Class nodeType, Predicate predicate) { + public Optional findFirst(Class nodeType, Predicate predicate) { return findFirst(TreeTraversal.PREORDER, node -> { if (nodeType.isAssignableFrom(node.getClass())) { final N castNode = nodeType.cast(node); @@ -1001,7 +1001,7 @@ public Optional findFirst(Class nodeType, Predicate p /* * Find a node by a range. The search is performed on the current node and its children. */ - public Optional findByRange(Range range) { + public Optional findByRange(Range range) { if (isPhantom()) { return Optional.empty(); } @@ -1027,7 +1027,7 @@ public Optional findByRange(Range range) { * @return {@code true} if this node is an ancestor of the given node, and {@code false} otherwise. * @see HasParentNode#isDescendantOf(Node) */ - public boolean isAncestorOf(Node descendant) { + public boolean isAncestorOf(Node descendant) { return this != descendant && findFirst(Node.class, n -> n == descendant).isPresent(); } @@ -1040,17 +1040,17 @@ public static class BreadthFirstIterator implements Iterator { private final Queue queue = new LinkedList<>(); - public BreadthFirstIterator(Node node) { + public BreadthFirstIterator(Node node) { queue.add(node); } @Override - public boolean hasNext() { + public boolean hasNext() { return !queue.isEmpty(); } @Override - public Node next() { + public Node next() { Node next = queue.remove(); queue.addAll(next.getChildNodes()); return next; @@ -1064,17 +1064,17 @@ public static class DirectChildrenIterator implements Iterator { private final Iterator childrenIterator; - public DirectChildrenIterator(Node node) { + public DirectChildrenIterator(Node node) { childrenIterator = node.getChildNodes().iterator(); } @Override - public boolean hasNext() { + public boolean hasNext() { return childrenIterator.hasNext(); } @Override - public Node next() { + public Node next() { return childrenIterator.next(); } } @@ -1087,17 +1087,17 @@ public static class ParentsVisitor implements Iterator { private Node node; - public ParentsVisitor(Node node) { + public ParentsVisitor(Node node) { this.node = node; } @Override - public boolean hasNext() { + public boolean hasNext() { return node.getParentNode().isPresent(); } @Override - public Node next() { + public Node next() { node = node.getParentNode().orElse(null); return node; } @@ -1112,17 +1112,17 @@ public static class PreOrderIterator implements Iterator { private final Stack stack = new Stack<>(); - public PreOrderIterator(Node node) { + public PreOrderIterator(Node node) { stack.add(node); } @Override - public boolean hasNext() { + public boolean hasNext() { return !stack.isEmpty(); } @Override - public Node next() { + public Node next() { Node next = stack.pop(); List children = next.getChildNodes(); for (int i = children.size() - 1; i >= 0; i--) { @@ -1141,17 +1141,17 @@ public static class PostOrderIterator implements Iterator { private final Stack stack = new Stack<>(); - public PostOrderIterator(Node root) { + public PostOrderIterator(Node root) { stack.push(new Level(Collections.singletonList(root))); } @Override - public boolean hasNext() { + public boolean hasNext() { return !stack.empty(); } @Override - public Node next() { + public Node next() { while (true) { Level state = stack.peek(); if (state.isCurrentExpanded()) { @@ -1195,7 +1195,7 @@ private static class Level { private boolean expanded = false; - public Level(List nodes) { + public Level(List nodes) { this.nodes = nodes; } @@ -1204,7 +1204,7 @@ public Level(List nodes) { * * @return {@code true} if the last node was reached */ - public boolean done() { + public boolean done() { return index < nodes.size(); } @@ -1213,14 +1213,14 @@ public boolean done() { * * @return the current node */ - public Node getCurrent() { + public Node getCurrent() { return nodes.get(index); } /** * Sets the next node as the current node. */ - public void goToNext() { + public void goToNext() { index++; expanded = false; } @@ -1228,7 +1228,7 @@ public void goToNext() { /** * Marks the current node as expanded. */ - public void setCurrentExpanded() { + public void setCurrentExpanded() { expanded = true; } @@ -1237,7 +1237,7 @@ public void setCurrentExpanded() { * * @return {@code true} if the current node was expanded */ - public boolean isCurrentExpanded() { + public boolean isCurrentExpanded() { return expanded; } } @@ -1246,14 +1246,14 @@ public boolean isCurrentExpanded() { /* * Returns true if the node has an (optional) scope expression eg. method calls (object.method()) */ - public boolean hasScope() { + public boolean hasScope() { return (NodeWithOptionalScope.class.isAssignableFrom(this.getClass()) && ((NodeWithOptionalScope) this).getScope().isPresent()) || (NodeWithScope.class.isAssignableFrom(this.getClass()) && ((NodeWithScope) this).getScope() != null); } /* * A "phantom" node, is a node that is not really an AST node (like the fake type of variable in FieldDeclaration or an UnknownType) */ - public boolean isPhantom() { + public boolean isPhantom() { return isPhantom(this); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java b/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java index 67c7f61607..01f5b4fe36 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java @@ -44,7 +44,7 @@ * * @param the type of nodes contained. */ -public class NodeList implements List, Iterable, HasParentNode>, Visitable, Observable { +public class NodeList implements List, Iterable, HasParentNode>, Visitable, Observable { @InternalProperty private final List innerList = new ArrayList<>(0); @@ -53,21 +53,21 @@ public class NodeList implements List, Iterable, HasParen private final List observers = new ArrayList<>(); - public NodeList() { + public NodeList() { parentNode = null; } - public NodeList(Collection n) { + public NodeList(Collection n) { this.addAll(n); } @SafeVarargs - public NodeList(N... n) { + public NodeList(N... n) { this.addAll(Arrays.asList(n)); } @Override - public boolean add(N node) { + public boolean add(N node) { notifyElementAdded(innerList.size(), node); own(node); return innerList.add(node); @@ -80,7 +80,7 @@ private void own(N node) { setAsParentNodeOf(node); } - public boolean remove(Node node) { + public boolean remove(Node node) { int index = innerList.indexOf(node); if (index != -1) { notifyElementRemoved(index, node); @@ -89,11 +89,11 @@ public boolean remove(Node node) { return innerList.remove(node); } - public N removeFirst() { + public N removeFirst() { return remove(0); } - public N removeLast() { + public N removeLast() { return remove(innerList.size() - 1); } @@ -116,28 +116,28 @@ public static NodeList nodeList(NodeList nodes) { return nodeList; } - public boolean contains(N node) { + public boolean contains(N node) { return innerList.contains(node); } @Override - public int size() { + public int size() { return innerList.size(); } @Override - public N get(int i) { + public N get(int i) { return innerList.get(i); } @Override - public Iterator iterator() { + public Iterator iterator() { // Custom iterator required, to ensure that the relevant `notifyElement...` methods are called. return new NodeListIterator(innerList); } @Override - public N set(int index, N element) { + public N set(int index, N element) { if (index < 0 || index >= innerList.size()) { throw new IllegalArgumentException("Illegal index. The index should be between 0 and " + innerList.size() + " excluded. It is instead " + index); } @@ -151,7 +151,7 @@ public N set(int index, N element) { } @Override - public N remove(int index) { + public N remove(int index) { notifyElementRemoved(index, innerList.get(index)); N remove = innerList.remove(index); if (remove != null) @@ -160,23 +160,23 @@ public N remove(int index) { } @Override - public boolean isEmpty() { + public boolean isEmpty() { return innerList.isEmpty(); } @Override - public void sort(Comparator comparator) { + public void sort(Comparator comparator) { innerList.sort(comparator); } - public void addAll(NodeList otherList) { + public void addAll(NodeList otherList) { for (N node : otherList) { add(node); } } @Override - public void add(int index, N node) { + public void add(int index, N node) { notifyElementAdded(index, node); own(node); innerList.add(index, node); @@ -185,7 +185,7 @@ public void add(int index, N node) { /** * Inserts the node before all other nodes. */ - public NodeList addFirst(N node) { + public NodeList addFirst(N node) { add(0, node); return this; } @@ -193,7 +193,7 @@ public NodeList addFirst(N node) { /** * Inserts the node after all other nodes. (This is simply an alias for add.) */ - public NodeList addLast(N node) { + public NodeList addLast(N node) { add(node); return this; } @@ -203,7 +203,7 @@ public NodeList addLast(N node) { * * @throws IllegalArgumentException when afterThisNode is not in this list. */ - public NodeList addAfter(N node, N afterThisNode) { + public NodeList addAfter(N node, N afterThisNode) { int i = indexOf(afterThisNode); if (i == -1) { throw new IllegalArgumentException("Can't find node to insert after."); @@ -217,7 +217,7 @@ public NodeList addAfter(N node, N afterThisNode) { * * @throws IllegalArgumentException when beforeThisNode is not in this list. */ - public NodeList addBefore(N node, N beforeThisNode) { + public NodeList addBefore(N node, N beforeThisNode) { int i = indexOf(beforeThisNode); if (i == -1) { throw new IllegalArgumentException("Can't find node to insert before."); @@ -229,7 +229,7 @@ public NodeList addBefore(N node, N beforeThisNode) { /** * @return the first node, or empty if the list is empty. */ - public Optional getFirst() { + public Optional getFirst() { if (isEmpty()) { return Optional.empty(); } @@ -239,7 +239,7 @@ public Optional getFirst() { /** * @return the last node, or empty if the list is empty. */ - public Optional getLast() { + public Optional getLast() { if (isEmpty()) { return Optional.empty(); } @@ -247,7 +247,7 @@ public Optional getLast() { } @Override - public Optional getParentNode() { + public Optional getParentNode() { return Optional.ofNullable(parentNode); } @@ -258,24 +258,24 @@ public Optional getParentNode() { * @return this, the NodeList */ @Override - public NodeList setParentNode(Node parentNode) { + public NodeList setParentNode(Node parentNode) { this.parentNode = parentNode; setAsParentNodeOf(innerList); return this; } @Override - public Node getParentNodeForChildren() { + public Node getParentNodeForChildren() { return parentNode; } @Override - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override - public
void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -283,7 +283,7 @@ public void accept(final VoidVisitor v, final A arg) { * @see java.lang.Iterable#forEach(java.util.function.Consumer) */ @Override - public void forEach(Consumer action) { + public void forEach(Consumer action) { innerList.forEach(action); } @@ -291,7 +291,7 @@ public void forEach(Consumer action) { * @see java.util.List#contains(java.lang.Object) */ @Override - public boolean contains(Object o) { + public boolean contains(Object o) { return innerList.contains(o); } @@ -299,7 +299,7 @@ public boolean contains(Object o) { * @see java.util.List#toArray() */ @Override - public Object[] toArray() { + public Object[] toArray() { return innerList.toArray(); } @@ -307,7 +307,7 @@ public Object[] toArray() { * @see java.util.List#toArray(java.lang.Object[]) */ @Override - public T[] toArray(T[] a) { + public T[] toArray(T[] a) { return innerList.toArray(a); } @@ -315,7 +315,7 @@ public T[] toArray(T[] a) { * @see java.util.List#remove(java.lang.Object) */ @Override - public boolean remove(Object o) { + public boolean remove(Object o) { if (o instanceof Node) { return remove((Node) o); } @@ -326,7 +326,7 @@ public boolean remove(Object o) { * @see java.util.List#containsAll(java.util.Collection) */ @Override - public boolean containsAll(Collection c) { + public boolean containsAll(Collection c) { return innerList.containsAll(c); } @@ -334,7 +334,7 @@ public boolean containsAll(Collection c) { * @see java.util.List#addAll(java.util.Collection) */ @Override - public boolean addAll(Collection c) { + public boolean addAll(Collection c) { c.forEach(this::add); return !c.isEmpty(); } @@ -343,7 +343,7 @@ public boolean addAll(Collection c) { * @see java.util.List#addAll(int, java.util.Collection) */ @Override - public boolean addAll(int index, Collection c) { + public boolean addAll(int index, Collection c) { for (N e : c) { add(index++, e); } @@ -354,7 +354,7 @@ public boolean addAll(int index, Collection c) { * @see java.util.List#removeAll(java.util.Collection) */ @Override - public boolean removeAll(Collection c) { + public boolean removeAll(Collection c) { boolean changed = false; for (Object e : c) { changed = remove(e) || changed; @@ -366,7 +366,7 @@ public boolean removeAll(Collection c) { * @see java.util.List#retainAll(java.util.Collection) */ @Override - public boolean retainAll(Collection c) { + public boolean retainAll(Collection c) { boolean changed = false; for (Object e : this.stream().filter(it -> !c.contains(it)).toArray()) { if (!c.contains(e)) { @@ -380,7 +380,7 @@ public boolean retainAll(Collection c) { * @see java.util.List#replaceAll(java.util.function.UnaryOperator) */ @Override - public void replaceAll(UnaryOperator operator) { + public void replaceAll(UnaryOperator operator) { for (int i = 0; i < this.size(); i++) { set(i, operator.apply(this.get(i))); } @@ -390,7 +390,7 @@ public void replaceAll(UnaryOperator operator) { * @see java.util.Collection#removeIf(java.util.function.Predicate) */ @Override - public boolean removeIf(Predicate filter) { + public boolean removeIf(Predicate filter) { boolean changed = false; for (Object e : this.stream().filter(filter).toArray()) { changed = remove(e) || changed; @@ -402,7 +402,7 @@ public boolean removeIf(Predicate filter) { * @see java.util.List#clear() */ @Override - public void clear() { + public void clear() { while (!isEmpty()) { remove(0); } @@ -412,7 +412,7 @@ public void clear() { * @see java.util.List#equals(java.lang.Object) */ @Override - public boolean equals(Object o) { + public boolean equals(Object o) { return innerList.equals(o); } @@ -420,7 +420,7 @@ public boolean equals(Object o) { * @see java.util.List#hashCode() */ @Override - public int hashCode() { + public int hashCode() { return innerList.hashCode(); } @@ -428,7 +428,7 @@ public int hashCode() { * @see java.util.List#indexOf(java.lang.Object) */ @Override - public int indexOf(Object o) { + public int indexOf(Object o) { return innerList.indexOf(o); } @@ -436,7 +436,7 @@ public int indexOf(Object o) { * @see java.util.List#lastIndexOf(java.lang.Object) */ @Override - public int lastIndexOf(Object o) { + public int lastIndexOf(Object o) { return innerList.lastIndexOf(o); } @@ -444,7 +444,7 @@ public int lastIndexOf(Object o) { * @see java.util.List#listIterator() */ @Override - public ListIterator listIterator() { + public ListIterator listIterator() { // Custom iterator required, to ensure that the relevant `notifyElement...` methods are called. return new NodeListIterator(innerList); } @@ -453,7 +453,7 @@ public ListIterator listIterator() { * @see java.util.List#listIterator(int) */ @Override - public ListIterator listIterator(int index) { + public ListIterator listIterator(int index) { // Custom iterator required, to ensure that the relevant `notifyElement...` methods are called. return new NodeListIterator(innerList, index); } @@ -462,7 +462,7 @@ public ListIterator listIterator(int index) { * @see java.util.Collection#parallelStream() */ @Override - public Stream parallelStream() { + public Stream parallelStream() { return innerList.parallelStream(); } @@ -470,7 +470,7 @@ public Stream parallelStream() { * @see java.util.List#subList(int, int) */ @Override - public List subList(int fromIndex, int toIndex) { + public List subList(int fromIndex, int toIndex) { return innerList.subList(fromIndex, toIndex); } @@ -478,7 +478,7 @@ public List subList(int fromIndex, int toIndex) { * @see java.util.List#spliterator() */ @Override - public Spliterator spliterator() { + public Spliterator spliterator() { return innerList.spliterator(); } @@ -495,19 +495,19 @@ private void notifyElementReplaced(int index, Node nodeAddedOrRemoved) { } @Override - public void unregister(AstObserver observer) { + public void unregister(AstObserver observer) { this.observers.remove(observer); } @Override - public void register(AstObserver observer) { + public void register(AstObserver observer) { if (!this.observers.contains(observer)) { this.observers.add(observer); } } @Override - public boolean isRegistered(AstObserver observer) { + public boolean isRegistered(AstObserver observer) { return this.observers.contains(observer); } @@ -516,7 +516,7 @@ public boolean isRegistered(AstObserver observer) { * * @return true if a replacement has happened. */ - public boolean replace(N old, N replacement) { + public boolean replace(N old, N replacement) { int i = indexOf(old); if (i == -1) { return false; @@ -528,11 +528,11 @@ public boolean replace(N old, N replacement) { /** * @return the opposite of isEmpty() */ - public boolean isNonEmpty() { + public boolean isNonEmpty() { return !isEmpty(); } - public void ifNonEmpty(Consumer> consumer) { + public void ifNonEmpty(Consumer> consumer) { if (isNonEmpty()) consumer.accept(this); } @@ -559,7 +559,7 @@ private void setAsParentNodeOf(Node childNode) { } @Override - public String toString() { + public String toString() { return innerList.stream().map(Node::toString).collect(Collectors.joining(", ", "[", "]")); } @@ -570,48 +570,48 @@ protected class NodeListIterator implements ListIterator { N current = null; // initialize pointer to head of the list for iteration - public NodeListIterator(List list) { + public NodeListIterator(List list) { iterator = list.listIterator(); } - public NodeListIterator(List list, int index) { + public NodeListIterator(List list, int index) { iterator = list.listIterator(index); } @Override - public boolean hasNext() { + public boolean hasNext() { return iterator.hasNext(); } @Override - public N next() { + public N next() { current = iterator.next(); return current; } @Override - public boolean hasPrevious() { + public boolean hasPrevious() { return iterator.hasPrevious(); } @Override - public N previous() { + public N previous() { current = iterator.previous(); return current; } @Override - public int nextIndex() { + public int nextIndex() { return iterator.nextIndex(); } @Override - public int previousIndex() { + public int previousIndex() { return iterator.previousIndex(); } @Override - public void remove() { + public void remove() { int index = innerList.indexOf(current); if (index != -1) { notifyElementRemoved(index, current); @@ -621,7 +621,7 @@ public void remove() { } @Override - public void set(N n) { + public void set(N n) { int index = innerList.indexOf(current); if (index < 0 || index >= innerList.size()) { throw new IllegalArgumentException("Illegal index. The index should be between 0 and " + innerList.size() + " excluded. It is instead " + index); @@ -635,14 +635,14 @@ public void set(N n) { } @Override - public void add(N n) { + public void add(N n) { notifyElementAdded(innerList.size(), n); own(n); iterator.add(n); } @Override - public void forEachRemaining(Consumer action) { + public void forEachRemaining(Consumer action) { iterator.forEachRemaining(action); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java index ed0bcb799e..4c257cfc0d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java @@ -40,22 +40,22 @@ * * @author Julio Vilmar Gesser */ -public class PackageDeclaration extends Node implements NodeWithAnnotations, NodeWithName { +public class PackageDeclaration extends Node implements NodeWithAnnotations, NodeWithName { private NodeList annotations = new NodeList<>(); private Name name; - public PackageDeclaration() { + public PackageDeclaration() { this(null, new NodeList<>(), new Name()); } - public PackageDeclaration(Name name) { + public PackageDeclaration(Name name) { this(null, new NodeList<>(), name); } @AllFieldsConstructor - public PackageDeclaration(NodeList annotations, Name name) { + public PackageDeclaration(NodeList annotations, Name name) { this(null, annotations, name); } @@ -63,7 +63,7 @@ public PackageDeclaration(NodeList annotations, Name name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public PackageDeclaration(TokenRange tokenRange, NodeList annotations, Name name) { + public PackageDeclaration(TokenRange tokenRange, NodeList annotations, Name name) { super(tokenRange); setAnnotations(annotations); setName(name); @@ -72,13 +72,13 @@ public PackageDeclaration(TokenRange tokenRange, NodeList annot @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -89,7 +89,7 @@ public void accept(final VoidVisitor v, final A arg) { * @return list of annotations or {@code null} */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @@ -99,7 +99,7 @@ public NodeList getAnnotations() { * @return the name of the package */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @@ -107,7 +107,7 @@ public Name getName() { * @param annotations the annotations to set */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public PackageDeclaration setAnnotations(final NodeList annotations) { + public PackageDeclaration setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -126,7 +126,7 @@ public PackageDeclaration setAnnotations(final NodeList annotat * @param name the name to set */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public PackageDeclaration setName(final Name name) { + public PackageDeclaration setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -141,7 +141,7 @@ public PackageDeclaration setName(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -156,19 +156,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public PackageDeclaration clone() { + public PackageDeclaration clone() { return (PackageDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public PackageDeclarationMetaModel getMetaModel() { + public PackageDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.packageDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java index 4e42541f9e..c8bc45b19b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java @@ -45,18 +45,18 @@ * * @author Julio Vilmar Gesser */ -public class AnnotationDeclaration extends TypeDeclaration implements NodeWithAbstractModifier, Resolvable { +public class AnnotationDeclaration extends TypeDeclaration implements NodeWithAbstractModifier, Resolvable { - public AnnotationDeclaration() { + public AnnotationDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>()); } - public AnnotationDeclaration(NodeList modifiers, String name) { + public AnnotationDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new SimpleName(name), new NodeList<>()); } @AllFieldsConstructor - public AnnotationDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { + public AnnotationDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { this(null, modifiers, annotations, name, members); } @@ -64,66 +64,66 @@ public AnnotationDeclaration(NodeList modifiers, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { + public AnnotationDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { super(tokenRange, modifiers, annotations, name, members); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public AnnotationDeclaration clone() { + public AnnotationDeclaration clone() { return (AnnotationDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public AnnotationDeclarationMetaModel getMetaModel() { + public AnnotationDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.annotationDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationDeclaration() { + public boolean isAnnotationDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationDeclaration asAnnotationDeclaration() { + public AnnotationDeclaration asAnnotationDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationDeclaration(Consumer action) { + public void ifAnnotationDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedAnnotationDeclaration resolve() { + public ResolvedAnnotationDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedAnnotationDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationDeclaration() { + public Optional toAnnotationDeclaration() { return Optional.of(this); } @Override - public FieldDeclaration addField(Type type, String name, Modifier.DefaultKeyword... modifiers) { + public FieldDeclaration addField(Type type, String name, Modifier.DefaultKeyword... modifiers) { throw new IllegalStateException("Cannot add a field to an annotation declaration."); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java index e100328a21..b8f76a3979 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java @@ -53,7 +53,7 @@ * * @author Julio Vilmar Gesser */ -public class AnnotationMemberDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithSimpleName, NodeWithType, NodeWithPublicModifier, NodeWithAbstractModifier, Resolvable { +public class AnnotationMemberDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithSimpleName, NodeWithType, NodeWithPublicModifier, NodeWithAbstractModifier, Resolvable { private NodeList modifiers; @@ -64,16 +64,16 @@ public class AnnotationMemberDeclaration extends BodyDeclaration(), new NodeList<>(), new ClassOrInterfaceType(), new SimpleName(), null); } - public AnnotationMemberDeclaration(NodeList modifiers, Type type, String name, Expression defaultValue) { + public AnnotationMemberDeclaration(NodeList modifiers, Type type, String name, Expression defaultValue) { this(null, modifiers, new NodeList<>(), type, new SimpleName(name), defaultValue); } @AllFieldsConstructor - public AnnotationMemberDeclaration(NodeList modifiers, NodeList annotations, Type type, SimpleName name, Expression defaultValue) { + public AnnotationMemberDeclaration(NodeList modifiers, NodeList annotations, Type type, SimpleName name, Expression defaultValue) { this(null, modifiers, annotations, type, name, defaultValue); } @@ -81,7 +81,7 @@ public AnnotationMemberDeclaration(NodeList modifiers, NodeList modifiers, NodeList annotations, Type type, SimpleName name, Expression defaultValue) { + public AnnotationMemberDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, Type type, SimpleName name, Expression defaultValue) { super(tokenRange, annotations); setModifiers(modifiers); setType(type); @@ -92,18 +92,18 @@ public AnnotationMemberDeclaration(TokenRange tokenRange, NodeList mo @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getDefaultValue() { + public Optional getDefaultValue() { return Optional.ofNullable(defaultValue); } @@ -114,22 +114,22 @@ public Optional getDefaultValue() { * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public AnnotationMemberDeclaration removeDefaultValue() { + public AnnotationMemberDeclaration removeDefaultValue() { return setDefaultValue((Expression) null); } @@ -140,7 +140,7 @@ public AnnotationMemberDeclaration removeDefaultValue() { * @return this, the AnnotationMemberDeclaration */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AnnotationMemberDeclaration setDefaultValue(final Expression defaultValue) { + public AnnotationMemberDeclaration setDefaultValue(final Expression defaultValue) { if (defaultValue == this.defaultValue) { return this; } @@ -153,7 +153,7 @@ public AnnotationMemberDeclaration setDefaultValue(final Expression defaultValu } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AnnotationMemberDeclaration setModifiers(final NodeList modifiers) { + public AnnotationMemberDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -167,7 +167,7 @@ public AnnotationMemberDeclaration setModifiers(final NodeList modifi } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AnnotationMemberDeclaration setName(final SimpleName name) { + public AnnotationMemberDeclaration setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -181,7 +181,7 @@ public AnnotationMemberDeclaration setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AnnotationMemberDeclaration setType(final Type type) { + public AnnotationMemberDeclaration setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -196,7 +196,7 @@ public AnnotationMemberDeclaration setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -217,19 +217,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public AnnotationMemberDeclaration clone() { + public AnnotationMemberDeclaration clone() { return (AnnotationMemberDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public AnnotationMemberDeclarationMetaModel getMetaModel() { + public AnnotationMemberDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.annotationMemberDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -258,30 +258,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationMemberDeclaration() { + public boolean isAnnotationMemberDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { + public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationMemberDeclaration(Consumer action) { + public void ifAnnotationMemberDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedAnnotationMemberDeclaration resolve() { + public ResolvedAnnotationMemberDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedAnnotationMemberDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationMemberDeclaration() { + public Optional toAnnotationMemberDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java index 3179809a03..d36d52babd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java @@ -48,12 +48,12 @@ public abstract class BodyDeclaration> extends Node private NodeList annotations; - public BodyDeclaration() { + public BodyDeclaration() { this(null, new NodeList<>()); } @AllFieldsConstructor - public BodyDeclaration(NodeList annotations) { + public BodyDeclaration(NodeList annotations) { this(null, annotations); } @@ -61,7 +61,7 @@ public BodyDeclaration(NodeList annotations) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BodyDeclaration(TokenRange tokenRange, NodeList annotations) { + public BodyDeclaration(TokenRange tokenRange, NodeList annotations) { super(tokenRange); setAnnotations(annotations); customInitialization(); @@ -72,13 +72,13 @@ protected BodyDeclaration(TokenRange range) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setAnnotations(final NodeList annotations) { + public T setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return (T) this; @@ -93,7 +93,7 @@ public T setAnnotations(final NodeList annotations) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -108,19 +108,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BodyDeclaration clone() { + public BodyDeclaration clone() { return (BodyDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BodyDeclarationMetaModel getMetaModel() { + public BodyDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.bodyDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -134,453 +134,453 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationDeclaration() { + public boolean isAnnotationDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationDeclaration asAnnotationDeclaration() { + public AnnotationDeclaration asAnnotationDeclaration() { throw new IllegalStateException(f("%s is not AnnotationDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationMemberDeclaration() { + public boolean isAnnotationMemberDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { + public AnnotationMemberDeclaration asAnnotationMemberDeclaration() { throw new IllegalStateException(f("%s is not AnnotationMemberDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCallableDeclaration() { + public boolean isCallableDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CallableDeclaration asCallableDeclaration() { + public CallableDeclaration asCallableDeclaration() { throw new IllegalStateException(f("%s is not CallableDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassOrInterfaceDeclaration() { + public boolean isClassOrInterfaceDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassOrInterfaceDeclaration asClassOrInterfaceDeclaration() { + public ClassOrInterfaceDeclaration asClassOrInterfaceDeclaration() { throw new IllegalStateException(f("%s is not ClassOrInterfaceDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isConstructorDeclaration() { + public boolean isConstructorDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ConstructorDeclaration asConstructorDeclaration() { + public ConstructorDeclaration asConstructorDeclaration() { throw new IllegalStateException(f("%s is not ConstructorDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCompactConstructorDeclaration() { + public boolean isCompactConstructorDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CompactConstructorDeclaration asCompactConstructorDeclaration() { + public CompactConstructorDeclaration asCompactConstructorDeclaration() { throw new IllegalStateException(f("%s is not CompactConstructorDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnumConstantDeclaration() { + public boolean isEnumConstantDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnumConstantDeclaration asEnumConstantDeclaration() { + public EnumConstantDeclaration asEnumConstantDeclaration() { throw new IllegalStateException(f("%s is not EnumConstantDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnumDeclaration() { + public boolean isEnumDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnumDeclaration asEnumDeclaration() { + public EnumDeclaration asEnumDeclaration() { throw new IllegalStateException(f("%s is not EnumDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isFieldDeclaration() { + public boolean isFieldDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public FieldDeclaration asFieldDeclaration() { + public FieldDeclaration asFieldDeclaration() { throw new IllegalStateException(f("%s is not FieldDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isInitializerDeclaration() { + public boolean isInitializerDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public InitializerDeclaration asInitializerDeclaration() { + public InitializerDeclaration asInitializerDeclaration() { throw new IllegalStateException(f("%s is not InitializerDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodDeclaration() { + public boolean isMethodDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodDeclaration asMethodDeclaration() { + public MethodDeclaration asMethodDeclaration() { throw new IllegalStateException(f("%s is not MethodDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeDeclaration() { + public boolean isTypeDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeDeclaration asTypeDeclaration() { + public TypeDeclaration asTypeDeclaration() { throw new IllegalStateException(f("%s is not TypeDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationDeclaration(Consumer action) { + public void ifAnnotationDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationMemberDeclaration(Consumer action) { + public void ifAnnotationMemberDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCallableDeclaration(Consumer action) { + public void ifCallableDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassOrInterfaceDeclaration(Consumer action) { + public void ifClassOrInterfaceDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifConstructorDeclaration(Consumer action) { + public void ifConstructorDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnumConstantDeclaration(Consumer action) { + public void ifEnumConstantDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnumDeclaration(Consumer action) { + public void ifEnumDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifFieldDeclaration(Consumer action) { + public void ifFieldDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifInitializerDeclaration(Consumer action) { + public void ifInitializerDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodDeclaration(Consumer action) { + public void ifMethodDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeDeclaration(Consumer action) { + public void ifTypeDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifRecordDeclaration(Consumer action) { + public void ifRecordDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCompactConstructorDeclaration(Consumer action) { + public void ifCompactConstructorDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationDeclaration() { + public Optional toAnnotationDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationMemberDeclaration() { + public Optional toAnnotationMemberDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCallableDeclaration() { + public Optional toCallableDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassOrInterfaceDeclaration() { + public Optional toClassOrInterfaceDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toConstructorDeclaration() { + public Optional toConstructorDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnumConstantDeclaration() { + public Optional toEnumConstantDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnumDeclaration() { + public Optional toEnumDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toFieldDeclaration() { + public Optional toFieldDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toInitializerDeclaration() { + public Optional toInitializerDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodDeclaration() { + public Optional toMethodDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeDeclaration() { + public Optional toTypeDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isRecordDeclaration() { + public boolean isRecordDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public RecordDeclaration asRecordDeclaration() { + public RecordDeclaration asRecordDeclaration() { throw new IllegalStateException(f("%s is not RecordDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toRecordDeclaration() { + public Optional toRecordDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassInvariantClause(Consumer action) { + public void ifClassInvariantClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBodyDeclaration() { + public boolean isJmlBodyDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassAccessibleDeclaration() { + public boolean isJmlClassAccessibleDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassAccessibleDeclaration asJmlClassAccessibleDeclaration() { + public JmlClassAccessibleDeclaration asJmlClassAccessibleDeclaration() { throw new IllegalStateException(f("%s is not JmlClassAccessibleDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCompactConstructorDeclaration() { + public Optional toCompactConstructorDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassAccessibleDeclaration(Consumer action) { + public void ifJmlClassAccessibleDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlRepresentsDeclaration() { + public boolean isJmlRepresentsDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlRepresentsDeclaration asJmlRepresentsDeclaration() { + public JmlRepresentsDeclaration asJmlRepresentsDeclaration() { throw new IllegalStateException(f("%s is not JmlRepresentsDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlRepresentsDeclaration() { + public Optional toJmlRepresentsDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlRepresentsDeclaration(Consumer action) { + public void ifJmlRepresentsDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocDeclaration() { + public boolean isJmlDocDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocDeclaration asJmlDocDeclaration() { + public JmlDocDeclaration asJmlDocDeclaration() { throw new IllegalStateException(f("%s is not JmlDocDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocDeclaration() { + public Optional toJmlDocDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocDeclaration(Consumer action) { + public void ifJmlDocDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassAccessibleDeclaration() { + public Optional toJmlClassAccessibleDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassInvariantDeclaration() { + public boolean isJmlClassInvariantDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassExprDeclaration asJmlClassInvariantDeclaration() { + public JmlClassExprDeclaration asJmlClassInvariantDeclaration() { throw new IllegalStateException(f("%s is not JmlClassInvariantDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassInvariantDeclaration() { + public Optional toJmlClassInvariantDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassInvariantDeclaration(Consumer action) { + public void ifJmlClassInvariantDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassLevel() { + public boolean isJmlClassLevel() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassLevelDeclaration asJmlClassLevel() { + public JmlClassLevelDeclaration asJmlClassLevel() { throw new IllegalStateException(f("%s is not JmlClassLevelDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassLevel() { + public Optional toJmlClassLevel() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassLevel(Consumer action) { + public void ifJmlClassLevel(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocType() { + public boolean isJmlDocType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocType asJmlDocType() { + public JmlDocType asJmlDocType() { throw new IllegalStateException(f("%s is not JmlDocType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocType() { + public Optional toJmlDocType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocType(Consumer action) { + public void ifJmlDocType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlFieldDeclaration() { + public boolean isJmlFieldDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlFieldDeclaration asJmlFieldDeclaration() { + public JmlFieldDeclaration asJmlFieldDeclaration() { throw new IllegalStateException(f("%s is not JmlFieldDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlFieldDeclaration() { + public Optional toJmlFieldDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlFieldDeclaration(Consumer action) { + public void ifJmlFieldDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMethodDeclaration() { + public boolean isJmlMethodDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMethodDeclaration asJmlMethodDeclaration() { + public JmlMethodDeclaration asJmlMethodDeclaration() { throw new IllegalStateException(f("%s is not JmlMethodDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMethodDeclaration() { + public Optional toJmlMethodDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMethodDeclaration(Consumer action) { + public void ifJmlMethodDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassAxiomDeclaration() { + public boolean isJmlClassAxiomDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassExprDeclaration() { + public boolean isJmlClassExprDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassExprDeclaration asJmlClassExprDeclaration() { + public JmlClassExprDeclaration asJmlClassExprDeclaration() { throw new IllegalStateException(f("%s is not JmlClassExprDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassExprDeclaration() { + public Optional toJmlClassExprDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassExprDeclaration(Consumer action) { + public void ifJmlClassExprDeclaration(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassLevelDeclaration() { + public boolean isJmlClassLevelDeclaration() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassLevelDeclaration asJmlClassLevelDeclaration() { + public JmlClassLevelDeclaration asJmlClassLevelDeclaration() { throw new IllegalStateException(f("%s is not JmlClassLevelDeclaration, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassLevelDeclaration() { + public Optional toJmlClassLevelDeclaration() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassLevelDeclaration(Consumer action) { + public void ifJmlClassLevelDeclaration(Consumer action) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/CallableDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/CallableDeclaration.java index 34d915a506..6a4447e363 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/CallableDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/CallableDeclaration.java @@ -73,7 +73,7 @@ public abstract class CallableDeclaration> exte * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public CallableDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, ReceiverParameter receiverParameter, NodeList contracts) { + public CallableDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, ReceiverParameter receiverParameter, NodeList contracts) { super(tokenRange, annotations); setModifiers(modifiers); setTypeParameters(typeParameters); @@ -92,13 +92,13 @@ public CallableDeclaration(TokenRange tokenRange, NodeList modifiers, * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setModifiers(final NodeList modifiers) { + public T setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return (T) this; @@ -112,13 +112,13 @@ public T setModifiers(final NodeList modifiers) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setName(final SimpleName name) { + public T setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return (T) this; @@ -132,13 +132,13 @@ public T setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getParameters() { + public NodeList getParameters() { return parameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setParameters(final NodeList parameters) { + public T setParameters(final NodeList parameters) { assertNotNull(parameters); if (parameters == this.parameters) { return (T) this; @@ -152,13 +152,13 @@ public T setParameters(final NodeList parameters) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getThrownExceptions() { + public NodeList getThrownExceptions() { return thrownExceptions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setThrownExceptions(final NodeList thrownExceptions) { + public T setThrownExceptions(final NodeList thrownExceptions) { assertNotNull(thrownExceptions); if (thrownExceptions == this.thrownExceptions) { return (T) this; @@ -172,13 +172,13 @@ public T setThrownExceptions(final NodeList thrownExceptions) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getTypeParameters() { + public NodeList getTypeParameters() { return typeParameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setTypeParameters(final NodeList typeParameters) { + public T setTypeParameters(final NodeList typeParameters) { assertNotNull(typeParameters); if (typeParameters == this.typeParameters) { return (T) this; @@ -210,7 +210,7 @@ protected String appendThrowsIfRequested(boolean includingThrows) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -269,16 +269,16 @@ private Signature(String name, List parameterTypes) { this.parameterTypes = parameterTypes; } - public String getName() { + public String getName() { return name; } - public List getParameterTypes() { + public List getParameterTypes() { return parameterTypes; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -290,23 +290,23 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = name.hashCode(); result = 31 * result + parameterTypes.hashCode(); return result; } - public String asString() { + public String asString() { return parameterTypes.stream().map(Type::asString).collect(joining(", ", name + "(", ")")); } @Override - public String toString() { + public String toString() { return asString(); } } - public Signature getSignature() { + public Signature getSignature() { return new Signature(getName().getIdentifier(), getParameters().stream().map(this::getTypeWithVarargsAsArray).map(this::stripGenerics).map(this::stripAnnotations).collect(toList())); } @@ -337,19 +337,19 @@ private Type getTypeWithVarargsAsArray(Parameter p) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CallableDeclaration clone() { + public CallableDeclaration clone() { return (CallableDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CallableDeclarationMetaModel getMetaModel() { + public CallableDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.callableDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -398,30 +398,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCallableDeclaration() { + public boolean isCallableDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CallableDeclaration asCallableDeclaration() { + public CallableDeclaration asCallableDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCallableDeclaration(Consumer action) { + public void ifCallableDeclaration(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getReceiverParameter() { + public Optional getReceiverParameter() { return Optional.ofNullable(receiverParameter); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setReceiverParameter(final ReceiverParameter receiverParameter) { + public T setReceiverParameter(final ReceiverParameter receiverParameter) { if (receiverParameter == this.receiverParameter) { return (T) this; } @@ -434,24 +434,24 @@ public T setReceiverParameter(final ReceiverParameter receiverParameter) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public CallableDeclaration removeReceiverParameter() { + public CallableDeclaration removeReceiverParameter() { return setReceiverParameter((ReceiverParameter) null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCallableDeclaration() { + public Optional toCallableDeclaration() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setContracts(final NodeList contracts) { + public T setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return (T) this; @@ -467,14 +467,14 @@ public T setContracts(final NodeList contracts) { /* * Returns true if the method has a variable number of arguments */ - public boolean isVariableArityMethod() { + public boolean isVariableArityMethod() { return getParameters().size() > 0 && getParameters().getLast().get().isVarArgs(); } /* * Returns true if the method has a fixed number of arguments */ - public boolean isFixedArityMethod() { + public boolean isFixedArityMethod() { return !isVariableArityMethod(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassAccessibleClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassAccessibleClause.java index 67c0cadf10..63c4601a93 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassAccessibleClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassAccessibleClause.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class ClassAccessibleClause { +public class ClassAccessibleClause { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java index 97dadb0dcd..82c648136c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java @@ -49,7 +49,7 @@ * * @author Julio Vilmar Gesser */ -public class ClassOrInterfaceDeclaration extends TypeDeclaration implements NodeWithImplements, NodeWithExtends, NodeWithTypeParameters, NodeWithAbstractModifier, NodeWithFinalModifier, Resolvable { +public class ClassOrInterfaceDeclaration extends TypeDeclaration implements NodeWithImplements, NodeWithExtends, NodeWithTypeParameters, NodeWithAbstractModifier, NodeWithFinalModifier, Resolvable { private boolean isInterface; @@ -62,16 +62,16 @@ public class ClassOrInterfaceDeclaration extends TypeDeclaration permittedTypes; - public ClassOrInterfaceDeclaration() { + public ClassOrInterfaceDeclaration() { this(null, new NodeList<>(), new NodeList<>(), false, new SimpleName(), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>()); } - public ClassOrInterfaceDeclaration(final NodeList modifiers, final boolean isInterface, final String name) { + public ClassOrInterfaceDeclaration(final NodeList modifiers, final boolean isInterface, final String name) { this(null, modifiers, new NodeList<>(), isInterface, new SimpleName(name), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>()); } @AllFieldsConstructor - public ClassOrInterfaceDeclaration(final NodeList modifiers, final NodeList annotations, final boolean isInterface, final SimpleName name, final NodeList typeParameters, final NodeList extendedTypes, final NodeList implementedTypes, final NodeList permittedTypes, final NodeList> members) { + public ClassOrInterfaceDeclaration(final NodeList modifiers, final NodeList annotations, final boolean isInterface, final SimpleName name, final NodeList typeParameters, final NodeList extendedTypes, final NodeList implementedTypes, final NodeList permittedTypes, final NodeList> members) { this(null, modifiers, annotations, isInterface, name, typeParameters, extendedTypes, implementedTypes, permittedTypes, members); } @@ -79,7 +79,7 @@ public ClassOrInterfaceDeclaration(final NodeList modifiers, final No * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ClassOrInterfaceDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, boolean isInterface, SimpleName name, NodeList typeParameters, NodeList extendedTypes, NodeList implementedTypes, NodeList permittedTypes, NodeList> members) { + public ClassOrInterfaceDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, boolean isInterface, SimpleName name, NodeList typeParameters, NodeList extendedTypes, NodeList implementedTypes, NodeList permittedTypes, NodeList> members) { super(tokenRange, modifiers, annotations, name, members); setInterface(isInterface); setTypeParameters(typeParameters); @@ -91,43 +91,43 @@ public ClassOrInterfaceDeclaration(TokenRange tokenRange, NodeList mo @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getExtendedTypes() { + public NodeList getExtendedTypes() { return extendedTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getImplementedTypes() { + public NodeList getImplementedTypes() { return implementedTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getPermittedTypes() { + public NodeList getPermittedTypes() { return permittedTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getTypeParameters() { + public NodeList getTypeParameters() { return typeParameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isInterface() { + public boolean isInterface() { return isInterface; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceDeclaration setExtendedTypes(final NodeList extendedTypes) { + public ClassOrInterfaceDeclaration setExtendedTypes(final NodeList extendedTypes) { assertNotNull(extendedTypes); if (extendedTypes == this.extendedTypes) { return this; @@ -141,7 +141,7 @@ public ClassOrInterfaceDeclaration setExtendedTypes(final NodeList implementedTypes) { + public ClassOrInterfaceDeclaration setImplementedTypes(final NodeList implementedTypes) { assertNotNull(implementedTypes); if (implementedTypes == this.implementedTypes) { return this; @@ -155,7 +155,7 @@ public ClassOrInterfaceDeclaration setImplementedTypes(final NodeList permittedTypes) { + public ClassOrInterfaceDeclaration setPermittedTypes(final NodeList permittedTypes) { assertNotNull(permittedTypes); if (permittedTypes == this.permittedTypes) { return this; @@ -169,7 +169,7 @@ public ClassOrInterfaceDeclaration setPermittedTypes(final NodeList typeParameters) { + public ClassOrInterfaceDeclaration setTypeParameters(final NodeList typeParameters) { assertNotNull(typeParameters); if (typeParameters == this.typeParameters) { return this; @@ -194,7 +194,7 @@ public ClassOrInterfaceDeclaration setTypeParameters(final NodeList p instanceof LocalClassDeclarationStmt).orElse(false); } @Override - public Optional getFullyQualifiedName() { + public Optional getFullyQualifiedName() { if (isLocalClassDeclaration()) { return Optional.empty(); } @@ -244,25 +244,25 @@ public Optional getFullyQualifiedName() { * @return is this an inner class? * NOTE: many people are confused over terminology. Refer to https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html . */ - public boolean isInnerClass() { + public boolean isInnerClass() { return isNestedType() && !isInterface && !isStatic(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ClassOrInterfaceDeclaration clone() { + public ClassOrInterfaceDeclaration clone() { return (ClassOrInterfaceDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ClassOrInterfaceDeclarationMetaModel getMetaModel() { + public ClassOrInterfaceDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.classOrInterfaceDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -295,30 +295,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassOrInterfaceDeclaration() { + public boolean isClassOrInterfaceDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassOrInterfaceDeclaration asClassOrInterfaceDeclaration() { + public ClassOrInterfaceDeclaration asClassOrInterfaceDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassOrInterfaceDeclaration(Consumer action) { + public void ifClassOrInterfaceDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedReferenceTypeDeclaration resolve() { + public ResolvedReferenceTypeDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedReferenceTypeDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassOrInterfaceDeclaration() { + public Optional toClassOrInterfaceDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java index 4966cf02b8..957b366186 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ClassRepresentsClause.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class ClassRepresentsClause { +public class ClassRepresentsClause { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/CompactConstructorDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/CompactConstructorDeclaration.java index 5503d1af8f..b86f7579bf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/CompactConstructorDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/CompactConstructorDeclaration.java @@ -64,7 +64,7 @@ * @see JLS 8.10.3 - Record Constructor Declarations * @since 3.22.0 */ -public class CompactConstructorDeclaration extends BodyDeclaration implements NodeWithBlockStmt, NodeWithAccessModifiers, NodeWithJavadoc, NodeWithSimpleName, NodeWithThrownExceptions, NodeWithTypeParameters, Resolvable { +public class CompactConstructorDeclaration extends BodyDeclaration implements NodeWithBlockStmt, NodeWithAccessModifiers, NodeWithJavadoc, NodeWithSimpleName, NodeWithThrownExceptions, NodeWithTypeParameters, Resolvable { private NodeList modifiers; @@ -76,20 +76,20 @@ public class CompactConstructorDeclaration extends BodyDeclaration thrownExceptions; - public CompactConstructorDeclaration() { + public CompactConstructorDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>(), new BlockStmt()); } - public CompactConstructorDeclaration(String name) { + public CompactConstructorDeclaration(String name) { this(null, new NodeList<>(new Modifier()), new NodeList<>(), new NodeList<>(), new SimpleName(name), new NodeList<>(), new BlockStmt()); } - public CompactConstructorDeclaration(NodeList modifiers, String name) { + public CompactConstructorDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new NodeList<>(), new SimpleName(name), new NodeList<>(), new BlockStmt()); } @AllFieldsConstructor - public CompactConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList thrownExceptions, BlockStmt body) { + public CompactConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList thrownExceptions, BlockStmt body) { this(null, modifiers, annotations, typeParameters, name, thrownExceptions, body); } @@ -97,7 +97,7 @@ public CompactConstructorDeclaration(NodeList modifiers, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList thrownExceptions, BlockStmt body) { + public CompactConstructorDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList thrownExceptions, BlockStmt body) { super(tokenRange, annotations); setModifiers(modifiers); setTypeParameters(typeParameters); @@ -109,18 +109,18 @@ public CompactConstructorDeclaration(TokenRange tokenRange, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getBody() { + public BlockStmt getBody() { return body; } @@ -131,7 +131,7 @@ public BlockStmt getBody() { * @return this, the ConstructorDeclaration */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompactConstructorDeclaration setBody(final BlockStmt body) { + public CompactConstructorDeclaration setBody(final BlockStmt body) { assertNotNull(body); if (body == this.body) { return this; @@ -145,12 +145,12 @@ public CompactConstructorDeclaration setBody(final BlockStmt body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompactConstructorDeclaration setModifiers(final NodeList modifiers) { + public CompactConstructorDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -164,12 +164,12 @@ public CompactConstructorDeclaration setModifiers(final NodeList modi } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompactConstructorDeclaration setName(final SimpleName name) { + public CompactConstructorDeclaration setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -183,12 +183,12 @@ public CompactConstructorDeclaration setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getThrownExceptions() { + public NodeList getThrownExceptions() { return thrownExceptions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompactConstructorDeclaration setThrownExceptions(final NodeList thrownExceptions) { + public CompactConstructorDeclaration setThrownExceptions(final NodeList thrownExceptions) { assertNotNull(thrownExceptions); if (thrownExceptions == this.thrownExceptions) { return this; @@ -202,12 +202,12 @@ public CompactConstructorDeclaration setThrownExceptions(final NodeList getTypeParameters() { + public NodeList getTypeParameters() { return typeParameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CompactConstructorDeclaration setTypeParameters(final NodeList typeParameters) { + public CompactConstructorDeclaration setTypeParameters(final NodeList typeParameters) { assertNotNull(typeParameters); if (typeParameters == this.typeParameters) { return this; @@ -225,7 +225,7 @@ public CompactConstructorDeclaration setTypeParameters(final NodeList * [accessSpecifier] className [throws exceptionsList] */ - public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { + public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { StringBuilder sb = new StringBuilder(); if (includingModifiers) { AccessSpecifier accessSpecifier = getAccessSpecifier(); @@ -258,7 +258,7 @@ protected String appendThrowsIfRequested(boolean includingThrows) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -285,19 +285,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CompactConstructorDeclaration clone() { + public CompactConstructorDeclaration clone() { return (CompactConstructorDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CompactConstructorDeclarationMetaModel getMetaModel() { + public CompactConstructorDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.compactConstructorDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -332,37 +332,37 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCompactConstructorDeclaration() { + public boolean isCompactConstructorDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CompactConstructorDeclaration asCompactConstructorDeclaration() { + public CompactConstructorDeclaration asCompactConstructorDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCompactConstructorDeclaration(Consumer action) { + public void ifCompactConstructorDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedConstructorDeclaration resolve() { + public ResolvedConstructorDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedConstructorDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCompactConstructorDeclaration() { + public Optional toCompactConstructorDeclaration() { return Optional.of(this); } /** * This constructor is used by the parser and is considered private. */ - public CompactConstructorDeclaration(TokenRange tokenRange, NodeList annotations, BlockStmt body) { + public CompactConstructorDeclaration(TokenRange tokenRange, NodeList annotations, BlockStmt body) { super(tokenRange, annotations); setBody(body); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java index 07529d0375..8c813ace88 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java @@ -50,36 +50,36 @@ * * @author Julio Vilmar Gesser */ -public class ConstructorDeclaration extends CallableDeclaration implements NodeWithBlockStmt, NodeWithAccessModifiers, NodeWithJavadoc, NodeWithSimpleName, NodeWithParameters, NodeWithThrownExceptions, NodeWithTypeParameters, Resolvable { +public class ConstructorDeclaration extends CallableDeclaration implements NodeWithBlockStmt, NodeWithAccessModifiers, NodeWithJavadoc, NodeWithSimpleName, NodeWithParameters, NodeWithThrownExceptions, NodeWithTypeParameters, Resolvable { private BlockStmt body; - public ConstructorDeclaration() { + public ConstructorDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>(), new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public ConstructorDeclaration(String name) { + public ConstructorDeclaration(String name) { this(null, new NodeList<>(new Modifier()), new NodeList<>(), new NodeList<>(), new SimpleName(name), new NodeList<>(), new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public ConstructorDeclaration(NodeList modifiers, String name) { + public ConstructorDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new NodeList<>(), new SimpleName(name), new NodeList<>(), new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, NodeList contracts) { + public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, NodeList contracts) { this(null, modifiers, annotations, typeParameters, name, parameters, thrownExceptions, body, null, contracts); } - public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { + public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { this(modifiers, annotations, typeParameters, name, parameters, thrownExceptions, body, receiverParameter, new NodeList<>()); } @AllFieldsConstructor - public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { + public ConstructorDeclaration(NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { this(null, modifiers, annotations, typeParameters, name, parameters, thrownExceptions, body, receiverParameter, contracts); } - public ConstructorDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { + public ConstructorDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { this(tokenRange, modifiers, annotations, typeParameters, name, parameters, thrownExceptions, body, receiverParameter, new NodeList<>()); } @@ -87,7 +87,7 @@ public ConstructorDeclaration(TokenRange tokenRange, NodeList modifie * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ConstructorDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { + public ConstructorDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { super(tokenRange, modifiers, annotations, typeParameters, name, parameters, thrownExceptions, receiverParameter, contracts); setBody(body); customInitialization(); @@ -95,18 +95,18 @@ public ConstructorDeclaration(TokenRange tokenRange, NodeList modifie @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getBody() { + public BlockStmt getBody() { return body; } @@ -117,7 +117,7 @@ public BlockStmt getBody() { * @return this, the ConstructorDeclaration */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ConstructorDeclaration setBody(final BlockStmt body) { + public ConstructorDeclaration setBody(final BlockStmt body) { assertNotNull(body); if (body == this.body) { return this; @@ -131,27 +131,27 @@ public ConstructorDeclaration setBody(final BlockStmt body) { } @Override - public ConstructorDeclaration setModifiers(final NodeList modifiers) { + public ConstructorDeclaration setModifiers(final NodeList modifiers) { return super.setModifiers(modifiers); } @Override - public ConstructorDeclaration setName(final SimpleName name) { + public ConstructorDeclaration setName(final SimpleName name) { return super.setName(name); } @Override - public ConstructorDeclaration setParameters(final NodeList parameters) { + public ConstructorDeclaration setParameters(final NodeList parameters) { return super.setParameters(parameters); } @Override - public ConstructorDeclaration setThrownExceptions(final NodeList thrownExceptions) { + public ConstructorDeclaration setThrownExceptions(final NodeList thrownExceptions) { return super.setThrownExceptions(thrownExceptions); } @Override - public ConstructorDeclaration setTypeParameters(final NodeList typeParameters) { + public ConstructorDeclaration setTypeParameters(final NodeList typeParameters) { return super.setTypeParameters(typeParameters); } @@ -162,7 +162,7 @@ public ConstructorDeclaration setTypeParameters(final NodeList t * [throws exceptionsList] */ @Override - public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { + public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { StringBuilder sb = new StringBuilder(); if (includingModifiers) { AccessSpecifier accessSpecifier = getAccessSpecifier(); @@ -191,7 +191,7 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includ /* * Returns the constructor descriptor */ - public String toDescriptor() { + public String toDescriptor() { StringBuilder sb = new StringBuilder(); sb.append('('); for (int i = 0; i < getParameters().size(); i++) { @@ -202,19 +202,19 @@ public String toDescriptor() { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ConstructorDeclaration clone() { + public ConstructorDeclaration clone() { return (ConstructorDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ConstructorDeclarationMetaModel getMetaModel() { + public ConstructorDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.constructorDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -227,30 +227,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isConstructorDeclaration() { + public boolean isConstructorDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ConstructorDeclaration asConstructorDeclaration() { + public ConstructorDeclaration asConstructorDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifConstructorDeclaration(Consumer action) { + public void ifConstructorDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedConstructorDeclaration resolve() { + public ResolvedConstructorDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedConstructorDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toConstructorDeclaration() { + public Optional toConstructorDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java index ff4434192c..fb9cca9896 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java @@ -48,7 +48,7 @@ * * @author Julio Vilmar Gesser */ -public class EnumConstantDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithSimpleName, NodeWithArguments, Resolvable { +public class EnumConstantDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithSimpleName, NodeWithArguments, Resolvable { private SimpleName name; @@ -56,16 +56,16 @@ public class EnumConstantDeclaration extends BodyDeclaration> classBody; - public EnumConstantDeclaration() { + public EnumConstantDeclaration() { this(null, new NodeList<>(), new SimpleName(), new NodeList<>(), new NodeList<>()); } - public EnumConstantDeclaration(String name) { + public EnumConstantDeclaration(String name) { this(null, new NodeList<>(), new SimpleName(name), new NodeList<>(), new NodeList<>()); } @AllFieldsConstructor - public EnumConstantDeclaration(NodeList annotations, SimpleName name, NodeList arguments, NodeList> classBody) { + public EnumConstantDeclaration(NodeList annotations, SimpleName name, NodeList arguments, NodeList> classBody) { this(null, annotations, name, arguments, classBody); } @@ -73,7 +73,7 @@ public EnumConstantDeclaration(NodeList annotations, SimpleName * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public EnumConstantDeclaration(TokenRange tokenRange, NodeList annotations, SimpleName name, NodeList arguments, NodeList> classBody) { + public EnumConstantDeclaration(TokenRange tokenRange, NodeList annotations, SimpleName name, NodeList arguments, NodeList> classBody) { super(tokenRange, annotations); setName(name); setArguments(arguments); @@ -83,33 +83,33 @@ public EnumConstantDeclaration(TokenRange tokenRange, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getArguments() { + public NodeList getArguments() { return arguments; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList> getClassBody() { + public NodeList> getClassBody() { return classBody; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnumConstantDeclaration setArguments(final NodeList arguments) { + public EnumConstantDeclaration setArguments(final NodeList arguments) { assertNotNull(arguments); if (arguments == this.arguments) { return this; @@ -123,7 +123,7 @@ public EnumConstantDeclaration setArguments(final NodeList argument } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnumConstantDeclaration setClassBody(final NodeList> classBody) { + public EnumConstantDeclaration setClassBody(final NodeList> classBody) { assertNotNull(classBody); if (classBody == this.classBody) { return this; @@ -137,7 +137,7 @@ public EnumConstantDeclaration setClassBody(final NodeList> } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnumConstantDeclaration setName(final SimpleName name) { + public EnumConstantDeclaration setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -152,7 +152,7 @@ public EnumConstantDeclaration setName(final SimpleName name) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -173,19 +173,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public EnumConstantDeclaration clone() { + public EnumConstantDeclaration clone() { return (EnumConstantDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public EnumConstantDeclarationMetaModel getMetaModel() { + public EnumConstantDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.enumConstantDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -210,30 +210,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnumConstantDeclaration() { + public boolean isEnumConstantDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnumConstantDeclaration asEnumConstantDeclaration() { + public EnumConstantDeclaration asEnumConstantDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnumConstantDeclaration(Consumer action) { + public void ifEnumConstantDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedEnumConstantDeclaration resolve() { + public ResolvedEnumConstantDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedEnumConstantDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnumConstantDeclaration() { + public Optional toEnumConstantDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java index a173275af4..0afa97eca0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java @@ -44,22 +44,22 @@ * * @author Julio Vilmar Gesser */ -public class EnumDeclaration extends TypeDeclaration implements NodeWithImplements, Resolvable { +public class EnumDeclaration extends TypeDeclaration implements NodeWithImplements, Resolvable { private NodeList implementedTypes; private NodeList entries; - public EnumDeclaration() { + public EnumDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>(), new NodeList<>(), new NodeList<>()); } - public EnumDeclaration(NodeList modifiers, String name) { + public EnumDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new SimpleName(name), new NodeList<>(), new NodeList<>(), new NodeList<>()); } @AllFieldsConstructor - public EnumDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList implementedTypes, NodeList entries, NodeList> members) { + public EnumDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList implementedTypes, NodeList entries, NodeList> members) { this(null, modifiers, annotations, name, implementedTypes, entries, members); } @@ -67,7 +67,7 @@ public EnumDeclaration(NodeList modifiers, NodeList a * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public EnumDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList implementedTypes, NodeList entries, NodeList> members) { + public EnumDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList implementedTypes, NodeList entries, NodeList> members) { super(tokenRange, modifiers, annotations, name, members); setImplementedTypes(implementedTypes); setEntries(entries); @@ -76,42 +76,42 @@ public EnumDeclaration(TokenRange tokenRange, NodeList modifiers, Nod @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getEntries() { + public NodeList getEntries() { return entries; } - public EnumConstantDeclaration getEntry(int i) { + public EnumConstantDeclaration getEntry(int i) { return getEntries().get(i); } - public EnumDeclaration setEntry(int i, EnumConstantDeclaration element) { + public EnumDeclaration setEntry(int i, EnumConstantDeclaration element) { getEntries().set(i, element); return this; } - public EnumDeclaration addEntry(EnumConstantDeclaration element) { + public EnumDeclaration addEntry(EnumConstantDeclaration element) { getEntries().add(element); return this; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getImplementedTypes() { + public NodeList getImplementedTypes() { return implementedTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnumDeclaration setEntries(final NodeList entries) { + public EnumDeclaration setEntries(final NodeList entries) { assertNotNull(entries); if (entries == this.entries) { return this; @@ -125,7 +125,7 @@ public EnumDeclaration setEntries(final NodeList entri } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnumDeclaration setImplementedTypes(final NodeList implementedTypes) { + public EnumDeclaration setImplementedTypes(final NodeList implementedTypes) { assertNotNull(implementedTypes); if (implementedTypes == this.implementedTypes) { return this; @@ -138,7 +138,7 @@ public EnumDeclaration setImplementedTypes(final NodeList return this; } - public EnumConstantDeclaration addEnumConstant(String name) { + public EnumConstantDeclaration addEnumConstant(String name) { assertNonEmpty(name); EnumConstantDeclaration enumConstant = new EnumConstantDeclaration(name); getEntries().add(enumConstant); @@ -147,7 +147,7 @@ public EnumConstantDeclaration addEnumConstant(String name) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -168,19 +168,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public EnumDeclaration clone() { + public EnumDeclaration clone() { return (EnumDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public EnumDeclarationMetaModel getMetaModel() { + public EnumDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.enumDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -201,30 +201,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnumDeclaration() { + public boolean isEnumDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnumDeclaration asEnumDeclaration() { + public EnumDeclaration asEnumDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnumDeclaration(Consumer action) { + public void ifEnumDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedEnumDeclaration resolve() { + public ResolvedEnumDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedEnumDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnumDeclaration() { + public Optional toEnumDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java index 1a03f26988..63b9140610 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java @@ -60,27 +60,27 @@ * * @author Julio Vilmar Gesser */ -public class FieldDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithVariables, NodeWithAccessModifiers, NodeWithStaticModifier, NodeWithFinalModifier, Resolvable { +public class FieldDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithVariables, NodeWithAccessModifiers, NodeWithStaticModifier, NodeWithFinalModifier, Resolvable { private NodeList modifiers; @NonEmptyProperty private NodeList variables; - public FieldDeclaration() { + public FieldDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new NodeList<>()); } - public FieldDeclaration(NodeList modifiers, VariableDeclarator variable) { + public FieldDeclaration(NodeList modifiers, VariableDeclarator variable) { this(null, modifiers, new NodeList<>(), nodeList(variable)); } - public FieldDeclaration(NodeList modifiers, NodeList variables) { + public FieldDeclaration(NodeList modifiers, NodeList variables) { this(null, modifiers, new NodeList<>(), variables); } @AllFieldsConstructor - public FieldDeclaration(NodeList modifiers, NodeList annotations, NodeList variables) { + public FieldDeclaration(NodeList modifiers, NodeList annotations, NodeList variables) { this(null, modifiers, annotations, variables); } @@ -88,7 +88,7 @@ public FieldDeclaration(NodeList modifiers, NodeList * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public FieldDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList variables) { + public FieldDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList variables) { super(tokenRange, annotations); setModifiers(modifiers); setVariables(variables); @@ -102,19 +102,19 @@ public FieldDeclaration(TokenRange tokenRange, NodeList modifiers, No * @param type type * @param name field name */ - public FieldDeclaration(NodeList modifiers, Type type, String name) { + public FieldDeclaration(NodeList modifiers, Type type, String name) { this(assertNotNull(modifiers), new VariableDeclarator(type, assertNotNull(name))); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -125,17 +125,17 @@ public void accept(final VoidVisitor v, final A arg) { * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getVariables() { + public NodeList getVariables() { return variables; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldDeclaration setModifiers(final NodeList modifiers) { + public FieldDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -149,7 +149,7 @@ public FieldDeclaration setModifiers(final NodeList modifiers) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldDeclaration setVariables(final NodeList variables) { + public FieldDeclaration setVariables(final NodeList variables) { assertNotNull(variables); if (variables == this.variables) { return this; @@ -170,7 +170,7 @@ public FieldDeclaration setVariables(final NodeList variabl * @throws IllegalStateException if there is more than 1 variable identifier or if this field isn't attached to a * class or enum */ - public MethodDeclaration createGetter() { + public MethodDeclaration createGetter() { if (getVariables().size() != 1) throw new IllegalStateException("You can use this only when the field declares only 1 variable name"); Optional parentClass = findAncestor(ClassOrInterfaceDeclaration.class); @@ -197,7 +197,7 @@ public MethodDeclaration createGetter() { * @throws IllegalStateException if there is more than 1 variable identifier or if this field isn't attached to a * class or enum */ - public MethodDeclaration createSetter() { + public MethodDeclaration createSetter() { if (getVariables().size() != 1) throw new IllegalStateException("You can use this only when the field declares only 1 variable name"); Optional parentClass = findAncestor(ClassOrInterfaceDeclaration.class); @@ -217,19 +217,19 @@ public MethodDeclaration createSetter() { return setter; } - public boolean isTransient() { + public boolean isTransient() { return hasModifier(Modifier.DefaultKeyword.TRANSIENT); } - public boolean isVolatile() { + public boolean isVolatile() { return hasModifier(Modifier.DefaultKeyword.VOLATILE); } - public FieldDeclaration setTransient(boolean set) { + public FieldDeclaration setTransient(boolean set) { return setModifier(Modifier.DefaultKeyword.TRANSIENT, set); } - public FieldDeclaration setVolatile(boolean set) { + public FieldDeclaration setVolatile(boolean set) { return setModifier(Modifier.DefaultKeyword.VOLATILE, set); } @@ -237,7 +237,7 @@ public FieldDeclaration setVolatile(boolean set) { * Every field declaration in the body of an interface is implicitly public, static, and final. */ @Override - public boolean isStatic() { + public boolean isStatic() { return hasModifier(STATIC) || isDeclaredInInterface(); } @@ -245,7 +245,7 @@ public boolean isStatic() { * Every field declaration in the body of an interface is implicitly public, static, and final. */ @Override - public boolean isFinal() { + public boolean isFinal() { return hasModifier(FINAL) || isDeclaredInInterface(); } @@ -253,7 +253,7 @@ public boolean isFinal() { * Every field declaration in the body of an interface is implicitly public, static, and final. */ @Override - public boolean isPublic() { + public boolean isPublic() { return hasModifier(PUBLIC) || isDeclaredInInterface(); } @@ -267,7 +267,7 @@ private boolean isDeclaredInInterface() { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -288,19 +288,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public FieldDeclaration clone() { + public FieldDeclaration clone() { return (FieldDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public FieldDeclarationMetaModel getMetaModel() { + public FieldDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.fieldDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -321,30 +321,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isFieldDeclaration() { + public boolean isFieldDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public FieldDeclaration asFieldDeclaration() { + public FieldDeclaration asFieldDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifFieldDeclaration(Consumer action) { + public void ifFieldDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedFieldDeclaration resolve() { + public ResolvedFieldDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedFieldDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toFieldDeclaration() { + public Optional toFieldDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/InitializerDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/InitializerDeclaration.java index f57d9fc733..d5cf2a2469 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/InitializerDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/InitializerDeclaration.java @@ -42,18 +42,18 @@ * * @author Julio Vilmar Gesser */ -public class InitializerDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithBlockStmt { +public class InitializerDeclaration extends BodyDeclaration implements NodeWithJavadoc, NodeWithBlockStmt { private boolean isStatic; private BlockStmt body; - public InitializerDeclaration() { + public InitializerDeclaration() { this(null, false, new BlockStmt()); } @AllFieldsConstructor - public InitializerDeclaration(boolean isStatic, BlockStmt body) { + public InitializerDeclaration(boolean isStatic, BlockStmt body) { this(null, isStatic, body); } @@ -61,7 +61,7 @@ public InitializerDeclaration(boolean isStatic, BlockStmt body) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public InitializerDeclaration(TokenRange tokenRange, boolean isStatic, BlockStmt body) { + public InitializerDeclaration(TokenRange tokenRange, boolean isStatic, BlockStmt body) { super(tokenRange); setStatic(isStatic); setBody(body); @@ -70,28 +70,28 @@ public InitializerDeclaration(TokenRange tokenRange, boolean isStatic, BlockStm @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getBody() { + public BlockStmt getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isStatic() { + public boolean isStatic() { return isStatic; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public InitializerDeclaration setBody(final BlockStmt body) { + public InitializerDeclaration setBody(final BlockStmt body) { assertNotNull(body); if (body == this.body) { return this; @@ -105,7 +105,7 @@ public InitializerDeclaration setBody(final BlockStmt body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public InitializerDeclaration setStatic(final boolean isStatic) { + public InitializerDeclaration setStatic(final boolean isStatic) { if (isStatic == this.isStatic) { return this; } @@ -116,19 +116,19 @@ public InitializerDeclaration setStatic(final boolean isStatic) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public InitializerDeclaration clone() { + public InitializerDeclaration clone() { return (InitializerDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public InitializerDeclarationMetaModel getMetaModel() { + public InitializerDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.initializerDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -141,25 +141,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isInitializerDeclaration() { + public boolean isInitializerDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public InitializerDeclaration asInitializerDeclaration() { + public InitializerDeclaration asInitializerDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifInitializerDeclaration(Consumer action) { + public void ifInitializerDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toInitializerDeclaration() { + public Optional toInitializerDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java index 627dd9b7af..5bc5f67bec 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java @@ -57,35 +57,35 @@ * * @author Julio Vilmar Gesser */ -public class MethodDeclaration extends CallableDeclaration implements NodeWithType, NodeWithOptionalBlockStmt, NodeWithJavadoc, NodeWithDeclaration, NodeWithSimpleName, NodeWithParameters, NodeWithThrownExceptions, NodeWithTypeParameters, NodeWithAccessModifiers, NodeWithAbstractModifier, NodeWithStaticModifier, NodeWithFinalModifier, NodeWithStrictfpModifier, Resolvable { +public class MethodDeclaration extends CallableDeclaration implements NodeWithType, NodeWithOptionalBlockStmt, NodeWithJavadoc, NodeWithDeclaration, NodeWithSimpleName, NodeWithParameters, NodeWithThrownExceptions, NodeWithTypeParameters, NodeWithAccessModifiers, NodeWithAbstractModifier, NodeWithStaticModifier, NodeWithFinalModifier, NodeWithStrictfpModifier, Resolvable { private Type type; @OptionalProperty private BlockStmt body; - public MethodDeclaration() { + public MethodDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new NodeList<>(), new ClassOrInterfaceType(), new SimpleName(), new NodeList<>(), new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public MethodDeclaration(final NodeList modifiers, final Type type, final String name) { + public MethodDeclaration(final NodeList modifiers, final Type type, final String name) { this(null, modifiers, new NodeList<>(), new NodeList<>(), type, new SimpleName(name), new NodeList<>(), new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public MethodDeclaration(final NodeList modifiers, final String name, final Type type, final NodeList parameters) { + public MethodDeclaration(final NodeList modifiers, final String name, final Type type, final NodeList parameters) { this(null, modifiers, new NodeList<>(), new NodeList<>(), type, new SimpleName(name), parameters, new NodeList<>(), new BlockStmt(), null, new NodeList<>()); } - public MethodDeclaration(final NodeList modifiers, final NodeList annotations, final NodeList typeParameters, final Type type, final SimpleName name, final NodeList parameters, final NodeList thrownExceptions, final BlockStmt body) { + public MethodDeclaration(final NodeList modifiers, final NodeList annotations, final NodeList typeParameters, final Type type, final SimpleName name, final NodeList parameters, final NodeList thrownExceptions, final BlockStmt body) { this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, null, new NodeList<>()); } @AllFieldsConstructor - public MethodDeclaration(final NodeList modifiers, final NodeList annotations, final NodeList typeParameters, final Type type, final SimpleName name, final NodeList parameters, final NodeList thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter, final NodeList contracts) { + public MethodDeclaration(final NodeList modifiers, final NodeList annotations, final NodeList typeParameters, final Type type, final SimpleName name, final NodeList parameters, final NodeList thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter, final NodeList contracts) { this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, receiverParameter, contracts); } - public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, Type type, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { + public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, Type type, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) { this(tokenRange, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, receiverParameter, new NodeList<>()); } @@ -93,7 +93,7 @@ public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, N * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, Type type, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { + public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList typeParameters, Type type, SimpleName name, NodeList parameters, NodeList thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter, NodeList contracts) { super(tokenRange, modifiers, annotations, typeParameters, name, parameters, thrownExceptions, receiverParameter, contracts); setType(type); setBody(body); @@ -102,18 +102,18 @@ public MethodDeclaration(TokenRange tokenRange, NodeList modifiers, N @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getBody() { + public Optional getBody() { return Optional.ofNullable(body); } @@ -124,7 +124,7 @@ public Optional getBody() { * @return this, the MethodDeclaration */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodDeclaration setBody(final BlockStmt body) { + public MethodDeclaration setBody(final BlockStmt body) { if (body == this.body) { return this; } @@ -137,12 +137,12 @@ public MethodDeclaration setBody(final BlockStmt body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodDeclaration setType(final Type type) { + public MethodDeclaration setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -156,27 +156,27 @@ public MethodDeclaration setType(final Type type) { } @Override - public MethodDeclaration setModifiers(final NodeList modifiers) { + public MethodDeclaration setModifiers(final NodeList modifiers) { return super.setModifiers(modifiers); } @Override - public MethodDeclaration setName(final SimpleName name) { + public MethodDeclaration setName(final SimpleName name) { return super.setName(name); } @Override - public MethodDeclaration setParameters(final NodeList parameters) { + public MethodDeclaration setParameters(final NodeList parameters) { return super.setParameters(parameters); } @Override - public MethodDeclaration setThrownExceptions(final NodeList thrownExceptions) { + public MethodDeclaration setThrownExceptions(final NodeList thrownExceptions) { return super.setThrownExceptions(thrownExceptions); } @Override - public MethodDeclaration setTypeParameters(final NodeList typeParameters) { + public MethodDeclaration setTypeParameters(final NodeList typeParameters) { return super.setTypeParameters(typeParameters); } @@ -190,7 +190,7 @@ public MethodDeclaration setTypeParameters(final NodeList typePa * @return method declaration as String */ @Override - public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { + public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) { StringBuilder sb = new StringBuilder(); if (includingModifiers) { AccessSpecifier accessSpecifier = getAccessSpecifier(); @@ -242,7 +242,7 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includ * is {@code (IDLjava/lang/Thread;)Ljava/lang/Object;} * Note that the internal forms of the binary names of Thread and Object are used. */ - public String toDescriptor() { + public String toDescriptor() { StringBuilder sb = new StringBuilder(); sb.append("("); for (int i = 0; i < getParameters().size(); i++) { @@ -259,7 +259,7 @@ public String toDescriptor() { * https://docs.oracle.com/javase/specs/jls/se9/html/jls-9.html#jls-9.4 */ @Override - public boolean isPublic() { + public boolean isPublic() { return hasModifier(PUBLIC) || isImplicitlyPublic(); } @@ -272,7 +272,7 @@ private boolean isImplicitlyPublic() { * https://docs.oracle.com/javase/specs/jls/se9/html/jls-9.html#jls-9.4 */ @Override - public boolean isAbstract() { + public boolean isAbstract() { return super.isAbstract() || isImplicitlyAbstract(); } @@ -280,33 +280,33 @@ private boolean isImplicitlyAbstract() { return hasParentNode() && getParentNode().get() instanceof ClassOrInterfaceDeclaration && ((ClassOrInterfaceDeclaration) getParentNode().get()).isInterface() && Arrays.asList(STATIC, DEFAULT, PRIVATE).stream().noneMatch(modifier -> hasModifier(modifier)); } - public boolean isNative() { + public boolean isNative() { return hasModifier(Modifier.DefaultKeyword.NATIVE); } - public boolean isSynchronized() { + public boolean isSynchronized() { return hasModifier(Modifier.DefaultKeyword.SYNCHRONIZED); } - public boolean isDefault() { + public boolean isDefault() { return hasModifier(DEFAULT); } - public MethodDeclaration setNative(boolean set) { + public MethodDeclaration setNative(boolean set) { return setModifier(Modifier.DefaultKeyword.NATIVE, set); } - public MethodDeclaration setSynchronized(boolean set) { + public MethodDeclaration setSynchronized(boolean set) { return setModifier(Modifier.DefaultKeyword.SYNCHRONIZED, set); } - public MethodDeclaration setDefault(boolean set) { + public MethodDeclaration setDefault(boolean set) { return setModifier(DEFAULT, set); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -320,25 +320,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public MethodDeclaration removeBody() { + public MethodDeclaration removeBody() { return setBody((BlockStmt) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public MethodDeclaration clone() { + public MethodDeclaration clone() { return (MethodDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public MethodDeclarationMetaModel getMetaModel() { + public MethodDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.methodDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -357,30 +357,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodDeclaration() { + public boolean isMethodDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodDeclaration asMethodDeclaration() { + public MethodDeclaration asMethodDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodDeclaration(Consumer action) { + public void ifMethodDeclaration(Consumer action) { action.accept(this); } @Override - public ResolvedMethodDeclaration resolve() { + public ResolvedMethodDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedMethodDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodDeclaration() { + public Optional toMethodDeclaration() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/Parameter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/Parameter.java index 1271f23ef8..3d05a4afaa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/Parameter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/Parameter.java @@ -51,7 +51,7 @@ * * @author Julio Vilmar Gesser */ -public class Parameter extends Node implements NodeWithType, NodeWithAnnotations, NodeWithSimpleName, NodeWithFinalModifier, Resolvable { +public class Parameter extends Node implements NodeWithType, NodeWithAnnotations, NodeWithSimpleName, NodeWithFinalModifier, Resolvable { private Type type; @@ -65,11 +65,11 @@ public class Parameter extends Node implements NodeWithType, N private SimpleName name; - public Parameter() { + public Parameter() { this(null, new NodeList<>(), new NodeList<>(), new ClassOrInterfaceType(), false, new NodeList<>(), new SimpleName()); } - public Parameter(Type type, SimpleName name) { + public Parameter(Type type, SimpleName name) { this(null, new NodeList<>(), new NodeList<>(), type, false, new NodeList<>(), name); } @@ -79,16 +79,16 @@ public Parameter(Type type, SimpleName name) { * @param type type of the parameter * @param name name of the parameter */ - public Parameter(Type type, String name) { + public Parameter(Type type, String name) { this(null, new NodeList<>(), new NodeList<>(), type, false, new NodeList<>(), new SimpleName(name)); } - public Parameter(NodeList modifiers, Type type, SimpleName name) { + public Parameter(NodeList modifiers, Type type, SimpleName name) { this(null, modifiers, new NodeList<>(), type, false, new NodeList<>(), name); } @AllFieldsConstructor - public Parameter(NodeList modifiers, NodeList annotations, Type type, boolean isVarArgs, NodeList varArgsAnnotations, SimpleName name) { + public Parameter(NodeList modifiers, NodeList annotations, Type type, boolean isVarArgs, NodeList varArgsAnnotations, SimpleName name) { this(null, modifiers, annotations, type, isVarArgs, varArgsAnnotations, name); } @@ -96,7 +96,7 @@ public Parameter(NodeList modifiers, NodeList annotat * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Parameter(TokenRange tokenRange, NodeList modifiers, NodeList annotations, Type type, boolean isVarArgs, NodeList varArgsAnnotations, SimpleName name) { + public Parameter(TokenRange tokenRange, NodeList modifiers, NodeList annotations, Type type, boolean isVarArgs, NodeList varArgsAnnotations, SimpleName name) { super(tokenRange); setModifiers(modifiers); setAnnotations(annotations); @@ -109,28 +109,28 @@ public Parameter(TokenRange tokenRange, NodeList modifiers, NodeList< @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isVarArgs() { + public boolean isVarArgs() { return isVarArgs; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setType(final Type type) { + public Parameter setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -144,7 +144,7 @@ public Parameter setType(final Type type) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setVarArgs(final boolean isVarArgs) { + public Parameter setVarArgs(final boolean isVarArgs) { if (isVarArgs == this.isVarArgs) { return this; } @@ -157,12 +157,12 @@ public Parameter setVarArgs(final boolean isVarArgs) { * @return the list returned could be immutable (in that case it will be empty) */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @@ -173,7 +173,7 @@ public SimpleName getName() { * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @@ -182,7 +182,7 @@ public NodeList getModifiers() { * so please avoid passing null */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setAnnotations(final NodeList annotations) { + public Parameter setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -196,7 +196,7 @@ public Parameter setAnnotations(final NodeList annotations) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setName(final SimpleName name) { + public Parameter setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -210,7 +210,7 @@ public Parameter setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setModifiers(final NodeList modifiers) { + public Parameter setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -225,7 +225,7 @@ public Parameter setModifiers(final NodeList modifiers) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -251,12 +251,12 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getVarArgsAnnotations() { + public NodeList getVarArgsAnnotations() { return varArgsAnnotations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter setVarArgsAnnotations(final NodeList varArgsAnnotations) { + public Parameter setVarArgsAnnotations(final NodeList varArgsAnnotations) { assertNotNull(varArgsAnnotations); if (varArgsAnnotations == this.varArgsAnnotations) { return this; @@ -271,19 +271,19 @@ public Parameter setVarArgsAnnotations(final NodeList varArgsAn @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Parameter clone() { + public Parameter clone() { return (Parameter) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ParameterMetaModel getMetaModel() { + public ParameterMetaModel getMetaModel() { return JavaParserMetaModel.parameterMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -317,7 +317,7 @@ public boolean replace(Node node, Node replacementNode) { } @Override - public ResolvedParameterDeclaration resolve() { + public ResolvedParameterDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedParameterDeclaration.class); } @@ -331,7 +331,7 @@ public ResolvedParameterDeclaration resolve() { * @return true if the node parameter is explicitly final (keyword attached) or implicitly final (e.g. parameters to a record) */ @Override - public boolean isFinal() { + public boolean isFinal() { // RecordDeclaration-specific code if (getParentNode().isPresent()) { Node parentNode = getParentNode().get(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ReceiverParameter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ReceiverParameter.java index 8ad5ff85ed..b770ab60da 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ReceiverParameter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ReceiverParameter.java @@ -48,7 +48,7 @@ * * @author Julio Vilmar Gesser */ -public class ReceiverParameter extends Node implements NodeWithType, NodeWithAnnotations, NodeWithName { +public class ReceiverParameter extends Node implements NodeWithType, NodeWithAnnotations, NodeWithName { private Type type; @@ -56,11 +56,11 @@ public class ReceiverParameter extends Node implements NodeWithType(), new ClassOrInterfaceType(), new Name()); } - public ReceiverParameter(Type type, Name name) { + public ReceiverParameter(Type type, Name name) { this(null, new NodeList<>(), type, name); } @@ -70,12 +70,12 @@ public ReceiverParameter(Type type, Name name) { * @param type type of the parameter * @param name name of the parameter */ - public ReceiverParameter(Type type, String name) { + public ReceiverParameter(Type type, String name) { this(null, new NodeList<>(), type, new Name(name)); } @AllFieldsConstructor - public ReceiverParameter(NodeList annotations, Type type, Name name) { + public ReceiverParameter(NodeList annotations, Type type, Name name) { this(null, annotations, type, name); } @@ -83,7 +83,7 @@ public ReceiverParameter(NodeList annotations, Type type, Name * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ReceiverParameter(TokenRange tokenRange, NodeList annotations, Type type, Name name) { + public ReceiverParameter(TokenRange tokenRange, NodeList annotations, Type type, Name name) { super(tokenRange); setAnnotations(annotations); setType(type); @@ -93,23 +93,23 @@ public ReceiverParameter(TokenRange tokenRange, NodeList annota @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ReceiverParameter setType(final Type type) { + public ReceiverParameter setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -126,7 +126,7 @@ public ReceiverParameter setType(final Type type) { * @return the list returned could be immutable (in that case it will be empty) */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @@ -135,7 +135,7 @@ public NodeList getAnnotations() { * so please avoid passing null */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ReceiverParameter setAnnotations(final NodeList annotations) { + public ReceiverParameter setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -150,23 +150,23 @@ public ReceiverParameter setAnnotations(final NodeList annotati @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ReceiverParameter clone() { + public ReceiverParameter clone() { return (ReceiverParameter) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ReceiverParameterMetaModel getMetaModel() { + public ReceiverParameterMetaModel getMetaModel() { return JavaParserMetaModel.receiverParameterMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ReceiverParameter setName(final Name name) { + public ReceiverParameter setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -181,7 +181,7 @@ public ReceiverParameter setName(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -196,7 +196,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/RecordDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/RecordDeclaration.java index 9942e2c8af..e3ae161686 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/RecordDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/RecordDeclaration.java @@ -88,7 +88,7 @@ * @see JLS 8.10 - Record Classes * @since 3.22.0 */ -public class RecordDeclaration extends TypeDeclaration implements NodeWithParameters, NodeWithImplements, NodeWithTypeParameters, NodeWithFinalModifier, Resolvable { +public class RecordDeclaration extends TypeDeclaration implements NodeWithParameters, NodeWithImplements, NodeWithTypeParameters, NodeWithFinalModifier, Resolvable { private NodeList typeParameters; @@ -99,16 +99,16 @@ public class RecordDeclaration extends TypeDeclaration imple private NodeList parameters; - public RecordDeclaration() { + public RecordDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>(), null); } - public RecordDeclaration(final NodeList modifiers, final String name) { + public RecordDeclaration(final NodeList modifiers, final String name) { this(null, modifiers, new NodeList<>(), new SimpleName(name), new NodeList<>(), new NodeList<>(), new NodeList<>(), new NodeList<>(), null); } @AllFieldsConstructor - public RecordDeclaration(final NodeList modifiers, final NodeList annotations, final SimpleName name, final NodeList parameters, final NodeList typeParameters, final NodeList implementedTypes, final NodeList> members, final ReceiverParameter receiverParameter) { + public RecordDeclaration(final NodeList modifiers, final NodeList annotations, final SimpleName name, final NodeList parameters, final NodeList typeParameters, final NodeList implementedTypes, final NodeList> members, final ReceiverParameter receiverParameter) { this(null, modifiers, annotations, name, parameters, typeParameters, implementedTypes, members, receiverParameter); } @@ -116,7 +116,7 @@ public RecordDeclaration(final NodeList modifiers, final NodeList modifiers, NodeList annotations, SimpleName name, NodeList parameters, NodeList typeParameters, NodeList implementedTypes, NodeList> members, ReceiverParameter receiverParameter) { + public RecordDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList parameters, NodeList typeParameters, NodeList implementedTypes, NodeList> members, ReceiverParameter receiverParameter) { super(tokenRange, modifiers, annotations, name, members); setParameters(parameters); setTypeParameters(typeParameters); @@ -127,28 +127,28 @@ public RecordDeclaration(TokenRange tokenRange, NodeList modifiers, N @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getImplementedTypes() { + public NodeList getImplementedTypes() { return implementedTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getTypeParameters() { + public NodeList getTypeParameters() { return typeParameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordDeclaration setImplementedTypes(final NodeList implementedTypes) { + public RecordDeclaration setImplementedTypes(final NodeList implementedTypes) { assertNotNull(implementedTypes); if (implementedTypes == this.implementedTypes) { return this; @@ -162,7 +162,7 @@ public RecordDeclaration setImplementedTypes(final NodeList typeParameters) { + public RecordDeclaration setTypeParameters(final NodeList typeParameters) { assertNotNull(typeParameters); if (typeParameters == this.typeParameters) { return this; @@ -179,13 +179,13 @@ public RecordDeclaration setTypeParameters(final NodeList typePa /** * @return is this class's parent a LocalRecordDeclarationStmt ? */ - public boolean isLocalRecordDeclaration() { + public boolean isLocalRecordDeclaration() { return getParentNode().map(p -> p instanceof LocalRecordDeclarationStmt).orElse(false); } // TODO document and remove duplication between here and com.github.javaparser.ast.body.ClassOrInterfaceDeclaration @Override - public Optional getFullyQualifiedName() { + public Optional getFullyQualifiedName() { if (isLocalRecordDeclaration()) { return Optional.empty(); } @@ -193,37 +193,37 @@ public Optional getFullyQualifiedName() { } @Override - public ResolvedReferenceTypeDeclaration resolve() { + public ResolvedReferenceTypeDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedReferenceTypeDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isRecordDeclaration() { + public boolean isRecordDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public RecordDeclaration asRecordDeclaration() { + public RecordDeclaration asRecordDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toRecordDeclaration() { + public Optional toRecordDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifRecordDeclaration(Consumer action) { + public void ifRecordDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -256,7 +256,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -289,13 +289,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public RecordDeclaration clone() { + public RecordDeclaration clone() { return (RecordDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public RecordDeclarationMetaModel getMetaModel() { + public RecordDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.recordDeclarationMetaModel; } @@ -308,12 +308,12 @@ public RecordDeclarationMetaModel getMetaModel() { * @see https://openjdk.java.net/jeps/359 */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getParameters() { + public NodeList getParameters() { return parameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordDeclaration setParameters(final NodeList parameters) { + public RecordDeclaration setParameters(final NodeList parameters) { assertNotNull(parameters); if (parameters == this.parameters) { return this; @@ -327,12 +327,12 @@ public RecordDeclaration setParameters(final NodeList parameters) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getReceiverParameter() { + public Optional getReceiverParameter() { return Optional.ofNullable(receiverParameter); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordDeclaration setReceiverParameter(final ReceiverParameter receiverParameter) { + public RecordDeclaration setReceiverParameter(final ReceiverParameter receiverParameter) { if (receiverParameter == this.receiverParameter) { return this; } @@ -345,7 +345,7 @@ public RecordDeclaration setReceiverParameter(final ReceiverParameter receiverP } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public RecordDeclaration removeReceiverParameter() { + public RecordDeclaration removeReceiverParameter() { return setReceiverParameter((ReceiverParameter) null); } @@ -359,7 +359,7 @@ public RecordDeclaration removeReceiverParameter() { * @return always true -- Records are always implicitly final, therefore can never not be final. */ @Override - public boolean isFinal() { + public boolean isFinal() { return true; } @@ -370,7 +370,7 @@ public boolean isFinal() { * @return True if the record declaration is nested, otherwise use the default method implementation. */ @Override - public boolean isStatic() { + public boolean isStatic() { if (getParentNode().isPresent()) { Node parentNode = getParentNode().get(); if (!(parentNode instanceof CompilationUnit)) { @@ -385,7 +385,7 @@ public boolean isStatic() { * @return Only the "compact" constructors within this record, * not "normal" constructors (which are obtainable via {@link #getConstructors()}). */ - public List getCompactConstructors() { + public List getCompactConstructors() { return unmodifiableList(getMembers().stream().filter(m -> m instanceof CompactConstructorDeclaration).map(m -> (CompactConstructorDeclaration) m).collect(toList())); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java index e950abf3ee..96d64e0d4f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/TypeDeclaration.java @@ -54,16 +54,16 @@ public abstract class TypeDeclaration> extends Body private NodeList> members; - public TypeDeclaration() { + public TypeDeclaration() { this(null, new NodeList<>(), new NodeList<>(), new SimpleName(), new NodeList<>()); } - public TypeDeclaration(NodeList modifiers, String name) { + public TypeDeclaration(NodeList modifiers, String name) { this(null, modifiers, new NodeList<>(), new SimpleName(name), new NodeList<>()); } @AllFieldsConstructor - public TypeDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { + public TypeDeclaration(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { this(null, modifiers, annotations, name, members); } @@ -71,7 +71,7 @@ public TypeDeclaration(NodeList modifiers, NodeList a * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TypeDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { + public TypeDeclaration(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members) { super(tokenRange, annotations); setModifiers(modifiers); setName(name); @@ -84,14 +84,14 @@ public TypeDeclaration(TokenRange tokenRange, NodeList modifiers, Nod * * @param decl member declaration */ - public T addMember(BodyDeclaration decl) { + public T addMember(BodyDeclaration decl) { NodeList> members = getMembers(); members.add(decl); return (T) this; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList> getMembers() { + public NodeList> getMembers() { return members; } @@ -102,13 +102,13 @@ public NodeList> getMembers() { * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setMembers(final NodeList> members) { + public T setMembers(final NodeList> members) { assertNotNull(members); if (members == this.members) { return (T) this; @@ -123,7 +123,7 @@ public T setMembers(final NodeList> members) { @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setModifiers(final NodeList modifiers) { + public T setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return (T) this; @@ -138,7 +138,7 @@ public T setModifiers(final NodeList modifiers) { @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") - public T setName(final SimpleName name) { + public T setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return (T) this; @@ -152,13 +152,13 @@ public T setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -180,14 +180,14 @@ public boolean remove(Node node) { /** * @return is this type's parent a CompilationUnit? */ - public boolean isTopLevelType() { + public boolean isTopLevelType() { return getParentNode().map(p -> p instanceof CompilationUnit).orElse(false); } /** * @return methods or constructors whose signatures match the passed signature. */ - public List> getCallablesWithSignature(CallableDeclaration.Signature signature) { + public List> getCallablesWithSignature(CallableDeclaration.Signature signature) { return getMembers().stream().filter(m -> m instanceof CallableDeclaration).map(m -> ((CallableDeclaration) m)).filter(m -> m.getSignature().equals(signature)).collect(toList()); } @@ -200,7 +200,7 @@ public List> getCallablesWithSignature(CallableDeclarati * @see com.github.javaparser.ast.stmt.LocalClassDeclarationStmt * @see com.github.javaparser.ast.stmt.LocalRecordDeclarationStmt */ - public Optional getFullyQualifiedName() { + public Optional getFullyQualifiedName() { if (isTopLevelType()) { return findCompilationUnit().map(cu -> cu.getPackageDeclaration().map(pd -> pd.getNameAsString()).map(pkg -> pkg + "." + getNameAsString()).orElseGet(() -> getNameAsString())); } @@ -211,25 +211,25 @@ public Optional getFullyQualifiedName() { * @return is this type's parent a TypeDeclaration? * NOTE: many people are confused over terminology. Refer to https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html . */ - public boolean isNestedType() { + public boolean isNestedType() { return getParentNode().map(p -> p instanceof TypeDeclaration).orElse(false); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TypeDeclaration clone() { + public TypeDeclaration clone() { return (TypeDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TypeDeclarationMetaModel getMetaModel() { + public TypeDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.typeDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -254,25 +254,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeDeclaration() { + public boolean isTypeDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeDeclaration asTypeDeclaration() { + public TypeDeclaration asTypeDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeDeclaration(Consumer action) { + public void ifTypeDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeDeclaration() { + public Optional toTypeDeclaration() { return Optional.of(this); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/VariableDeclarator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/VariableDeclarator.java index e3e1073c02..67471b7b54 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/VariableDeclarator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/VariableDeclarator.java @@ -56,7 +56,7 @@ * * @author Julio Vilmar Gesser */ -public class VariableDeclarator extends Node implements NodeWithType, NodeWithSimpleName, Resolvable { +public class VariableDeclarator extends Node implements NodeWithType, NodeWithSimpleName, Resolvable { private SimpleName name; @@ -66,19 +66,19 @@ public class VariableDeclarator extends Node implements NodeWithType R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getInitializer() { + public Optional getInitializer() { return Optional.ofNullable(initializer); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarator setName(final SimpleName name) { + public VariableDeclarator setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -180,7 +180,7 @@ public VariableDeclarator setName(final SimpleName name) { * @return this, the VariableDeclarator */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarator setInitializer(final Expression initializer) { + public VariableDeclarator setInitializer(final Expression initializer) { if (initializer == this.initializer) { return this; } @@ -198,17 +198,17 @@ public VariableDeclarator setInitializer(final Expression initializer) { * @param init the initializer expression, can be null * @return this, the VariableDeclarator */ - public VariableDeclarator setInitializer(String init) { + public VariableDeclarator setInitializer(String init) { return setInitializer(new NameExpr(assertNonEmpty(init))); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarator setType(final Type type) { + public VariableDeclarator setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -223,7 +223,7 @@ public VariableDeclarator setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -237,25 +237,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public VariableDeclarator removeInitializer() { + public VariableDeclarator removeInitializer() { return setInitializer((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public VariableDeclarator clone() { + public VariableDeclarator clone() { return (VariableDeclarator) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public VariableDeclaratorMetaModel getMetaModel() { + public VariableDeclaratorMetaModel getMetaModel() { return JavaParserMetaModel.variableDeclaratorMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -277,7 +277,7 @@ public boolean replace(Node node, Node replacementNode) { } @Override - public ResolvedValueDeclaration resolve() { + public ResolvedValueDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedValueDeclaration.class); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/BlockComment.java b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/BlockComment.java index 5e7ad18fdc..b8eafb19d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/BlockComment.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/BlockComment.java @@ -41,14 +41,14 @@ * * @author Julio Vilmar Gesser */ -public class BlockComment extends Comment { +public class BlockComment extends Comment { - public BlockComment() { + public BlockComment() { this(null, "empty"); } @AllFieldsConstructor - public BlockComment(String content) { + public BlockComment(String content) { this(null, content); } @@ -56,66 +56,66 @@ public BlockComment(String content) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BlockComment(TokenRange tokenRange, String content) { + public BlockComment(TokenRange tokenRange, String content) { super(tokenRange, content); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BlockComment clone() { + public BlockComment clone() { return (BlockComment) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BlockCommentMetaModel getMetaModel() { + public BlockCommentMetaModel getMetaModel() { return JavaParserMetaModel.blockCommentMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBlockComment() { + public boolean isBlockComment() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BlockComment asBlockComment() { + public BlockComment asBlockComment() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBlockComment(Consumer action) { + public void ifBlockComment(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBlockComment() { + public Optional toBlockComment() { return Optional.of(this); } @Override - public String getHeader() { + public String getHeader() { return "/*"; } @Override - public String getFooter() { + public String getFooter() { return "*/"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/Comment.java b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/Comment.java index 549929c1f1..d30fab4d97 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/Comment.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/Comment.java @@ -50,7 +50,7 @@ public abstract class Comment extends Node { private Node commentedNode; @AllFieldsConstructor - public Comment(String content) { + public Comment(String content) { this(null, content); } @@ -58,7 +58,7 @@ public Comment(String content) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Comment(TokenRange tokenRange, String content) { + public Comment(TokenRange tokenRange, String content) { super(tokenRange); setContent(content); customInitialization(); @@ -70,7 +70,7 @@ public Comment(TokenRange tokenRange, String content) { * @return text of the comment */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public String getContent() { + public String getContent() { return content; } @@ -80,7 +80,7 @@ public String getContent() { * @param content the text of the comment to set */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Comment setContent(final String content) { + public Comment setContent(final String content) { assertNotNull(content); if (content == this.content) { return this; @@ -91,16 +91,16 @@ public Comment setContent(final String content) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLineComment() { + public boolean isLineComment() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LineComment asLineComment() { + public LineComment asLineComment() { throw new IllegalStateException(f("%s is not LineComment, it is %s", this, this.getClass().getSimpleName())); } - public Optional getCommentedNode() { + public Optional getCommentedNode() { return Optional.ofNullable(this.commentedNode); } @@ -110,7 +110,7 @@ public Optional getCommentedNode() { * @param commentedNode the commentedNode, can be null * @return this, the Comment */ - public Comment setCommentedNode(Node commentedNode) { + public Comment setCommentedNode(Node commentedNode) { notifyPropertyChange(ObservableProperty.COMMENTED_NODE, this.commentedNode, commentedNode); if (commentedNode == null) { this.commentedNode = null; @@ -126,12 +126,12 @@ public Comment setCommentedNode(Node commentedNode) { return this; } - public boolean isOrphan() { + public boolean isOrphan() { return this.commentedNode == null; } @Override - public Node setComment(final Comment comment) { + public Node setComment(final Comment comment) { // comments on comments are not allowed, so we override setComment(Comment) here if (comment != null) { throw new IllegalArgumentException("A comment cannot be commented."); @@ -140,7 +140,7 @@ public Node setComment(final Comment comment) { } @Override - public boolean remove() { + public boolean remove() { if (this.commentedNode != null) { this.commentedNode.setComment(null); return true; @@ -152,7 +152,7 @@ public boolean remove() { } @Override - public Node findRootNode() { + public Node findRootNode() { // (Non-orphan) comments are not integrated into the normal AST; we need to get the commented node first. Node n = getCommentedNode().orElse(this); while (n.getParentNode().isPresent()) { @@ -163,60 +163,60 @@ public Node findRootNode() { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Comment clone() { + public Comment clone() { return (Comment) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CommentMetaModel getMetaModel() { + public CommentMetaModel getMetaModel() { return JavaParserMetaModel.commentMetaModel; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBlockComment() { + public boolean isBlockComment() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BlockComment asBlockComment() { + public BlockComment asBlockComment() { throw new IllegalStateException(f("%s is not BlockComment, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJavadocComment() { + public boolean isJavadocComment() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JavadocComment asJavadocComment() { + public JavadocComment asJavadocComment() { throw new IllegalStateException(f("%s is not JavadocComment, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBlockComment(Consumer action) { + public void ifBlockComment(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJavadocComment(Consumer action) { + public void ifJavadocComment(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLineComment(Consumer action) { + public void ifLineComment(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBlockComment() { + public Optional toBlockComment() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJavadocComment() { + public Optional toJavadocComment() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLineComment() { + public Optional toLineComment() { return Optional.empty(); } @@ -233,7 +233,7 @@ public Optional toLineComment() { /* * Returns the content of the comment with header and footer */ - public String asString() { + public String asString() { return getHeader() + getContent() + getFooter(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/CommentsCollection.java b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/CommentsCollection.java index 1bfe81841d..6911a1dce7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/CommentsCollection.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/CommentsCollection.java @@ -30,34 +30,34 @@ /** * The comments contained in a certain parsed piece of source code. */ -public class CommentsCollection { +public class CommentsCollection { private final TreeSet comments = new TreeSet<>(NODE_BY_BEGIN_POSITION); - public CommentsCollection() { + public CommentsCollection() { } - public CommentsCollection(Collection commentsToCopy) { + public CommentsCollection(Collection commentsToCopy) { comments.addAll(commentsToCopy); } - public Set getLineComments() { + public Set getLineComments() { return comments.stream().filter(comment -> comment instanceof LineComment).map(comment -> (LineComment) comment).collect(Collectors.toCollection(() -> new TreeSet<>(NODE_BY_BEGIN_POSITION))); } - public Set getBlockComments() { + public Set getBlockComments() { return comments.stream().filter(comment -> comment instanceof BlockComment).map(comment -> (BlockComment) comment).collect(Collectors.toCollection(() -> new TreeSet<>(NODE_BY_BEGIN_POSITION))); } - public Set getJavadocComments() { + public Set getJavadocComments() { return comments.stream().filter(comment -> comment instanceof JavadocComment).map(comment -> (JavadocComment) comment).collect(Collectors.toCollection(() -> new TreeSet<>(NODE_BY_BEGIN_POSITION))); } - public void addComment(Comment comment) { + public void addComment(Comment comment) { comments.add(comment); } - public boolean contains(Comment comment) { + public boolean contains(Comment comment) { if (!comment.hasRange()) { return false; } @@ -76,21 +76,21 @@ public boolean contains(Comment comment) { return false; } - public TreeSet getComments() { + public TreeSet getComments() { return comments; } - public int size() { + public int size() { return comments.size(); } - public CommentsCollection minus(CommentsCollection other) { + public CommentsCollection minus(CommentsCollection other) { CommentsCollection result = new CommentsCollection(); result.comments.addAll(comments.stream().filter(comment -> !other.contains(comment)).collect(Collectors.toList())); return result; } - public CommentsCollection copy() { + public CommentsCollection copy() { return new CommentsCollection(comments); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/JavadocComment.java b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/JavadocComment.java index f55ebfe3fd..392778cff6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/JavadocComment.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/JavadocComment.java @@ -39,14 +39,14 @@ * * @author Julio Vilmar Gesser */ -public class JavadocComment extends Comment { +public class JavadocComment extends Comment { - public JavadocComment() { + public JavadocComment() { this(null, "empty"); } @AllFieldsConstructor - public JavadocComment(String content) { + public JavadocComment(String content) { this(null, content); } @@ -54,70 +54,70 @@ public JavadocComment(String content) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JavadocComment(TokenRange tokenRange, String content) { + public JavadocComment(TokenRange tokenRange, String content) { super(tokenRange, content); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } - public Javadoc parse() { + public Javadoc parse() { return parseJavadoc(getContent()); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JavadocComment clone() { + public JavadocComment clone() { return (JavadocComment) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JavadocCommentMetaModel getMetaModel() { + public JavadocCommentMetaModel getMetaModel() { return JavaParserMetaModel.javadocCommentMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJavadocComment() { + public boolean isJavadocComment() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JavadocComment asJavadocComment() { + public JavadocComment asJavadocComment() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJavadocComment(Consumer action) { + public void ifJavadocComment(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJavadocComment() { + public Optional toJavadocComment() { return Optional.of(this); } @Override - public String getHeader() { + public String getHeader() { return "/**"; } @Override - public String getFooter() { + public String getFooter() { return "*/"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/LineComment.java b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/LineComment.java index da55befd8c..fd039dfb1e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/comments/LineComment.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/comments/LineComment.java @@ -40,14 +40,14 @@ * * @author Julio Vilmar Gesser */ -public class LineComment extends Comment { +public class LineComment extends Comment { - public LineComment() { + public LineComment() { this(null, "empty"); } @AllFieldsConstructor - public LineComment(String content) { + public LineComment(String content) { this(null, content); } @@ -55,66 +55,66 @@ public LineComment(String content) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LineComment(TokenRange tokenRange, String content) { + public LineComment(TokenRange tokenRange, String content) { super(tokenRange, content); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLineComment() { + public boolean isLineComment() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LineComment clone() { + public LineComment clone() { return (LineComment) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LineCommentMetaModel getMetaModel() { + public LineCommentMetaModel getMetaModel() { return JavaParserMetaModel.lineCommentMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LineComment asLineComment() { + public LineComment asLineComment() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLineComment(Consumer action) { + public void ifLineComment(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLineComment() { + public Optional toLineComment() { return Optional.of(this); } @Override - public String getHeader() { + public String getHeader() { return "//"; } @Override - public String getFooter() { + public String getFooter() { return ""; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AnnotationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AnnotationExpr.java index 1b09bec18a..369541a22b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AnnotationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AnnotationExpr.java @@ -45,12 +45,12 @@ public abstract class AnnotationExpr extends Expression implements NodeWithName< protected Name name; - public AnnotationExpr() { + public AnnotationExpr() { this(null, new Name()); } @AllFieldsConstructor - public AnnotationExpr(Name name) { + public AnnotationExpr(Name name) { this(null, name); } @@ -58,19 +58,19 @@ public AnnotationExpr(Name name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public AnnotationExpr(TokenRange tokenRange, Name name) { + public AnnotationExpr(TokenRange tokenRange, Name name) { super(tokenRange); setName(name); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AnnotationExpr setName(final Name name) { + public AnnotationExpr setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -85,19 +85,19 @@ public AnnotationExpr setName(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public AnnotationExpr clone() { + public AnnotationExpr clone() { return (AnnotationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public AnnotationExprMetaModel getMetaModel() { + public AnnotationExprMetaModel getMetaModel() { return JavaParserMetaModel.annotationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -110,19 +110,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationExpr() { + public boolean isAnnotationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationExpr asAnnotationExpr() { + public AnnotationExpr asAnnotationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationExpr(Consumer action) { + public void ifAnnotationExpr(Consumer action) { action.accept(this); } @@ -136,13 +136,13 @@ public void ifAnnotationExpr(Consumer action) { * resolved. */ @Override - public ResolvedAnnotationDeclaration resolve() { + public ResolvedAnnotationDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedAnnotationDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationExpr() { + public Optional toAnnotationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayAccessExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayAccessExpr.java index 9a57bae8db..b37b728eb4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayAccessExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayAccessExpr.java @@ -40,18 +40,18 @@ * * @author Julio Vilmar Gesser */ -public class ArrayAccessExpr extends Expression { +public class ArrayAccessExpr extends Expression { private Expression name; private Expression index; - public ArrayAccessExpr() { + public ArrayAccessExpr() { this(null, new NameExpr(), new IntegerLiteralExpr()); } @AllFieldsConstructor - public ArrayAccessExpr(Expression name, Expression index) { + public ArrayAccessExpr(Expression name, Expression index) { this(null, name, index); } @@ -59,7 +59,7 @@ public ArrayAccessExpr(Expression name, Expression index) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ArrayAccessExpr(TokenRange tokenRange, Expression name, Expression index) { + public ArrayAccessExpr(TokenRange tokenRange, Expression name, Expression index) { super(tokenRange); setName(name); setIndex(index); @@ -73,28 +73,28 @@ public static Expression allElementsAccess(TokenRange range, Expression scope) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getIndex() { + public Expression getIndex() { return index; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getName() { + public Expression getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayAccessExpr setIndex(final Expression index) { + public ArrayAccessExpr setIndex(final Expression index) { assertNotNull(index); if (index == this.index) { return this; @@ -108,7 +108,7 @@ public ArrayAccessExpr setIndex(final Expression index) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayAccessExpr setName(final Expression name) { + public ArrayAccessExpr setName(final Expression name) { assertNotNull(name); if (name == this.name) { return this; @@ -123,19 +123,19 @@ public ArrayAccessExpr setName(final Expression name) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ArrayAccessExpr clone() { + public ArrayAccessExpr clone() { return (ArrayAccessExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ArrayAccessExprMetaModel getMetaModel() { + public ArrayAccessExprMetaModel getMetaModel() { return JavaParserMetaModel.arrayAccessExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -152,25 +152,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayAccessExpr() { + public boolean isArrayAccessExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayAccessExpr asArrayAccessExpr() { + public ArrayAccessExpr asArrayAccessExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayAccessExpr(Consumer action) { + public void ifArrayAccessExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayAccessExpr() { + public Optional toArrayAccessExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayCreationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayCreationExpr.java index 0d3b1c5f41..0efdbcd51b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayCreationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayCreationExpr.java @@ -46,7 +46,7 @@ * * @author Julio Vilmar Gesser */ -public class ArrayCreationExpr extends Expression { +public class ArrayCreationExpr extends Expression { @NonEmptyProperty private NodeList levels; @@ -56,16 +56,16 @@ public class ArrayCreationExpr extends Expression { @OptionalProperty private ArrayInitializerExpr initializer; - public ArrayCreationExpr() { + public ArrayCreationExpr() { this(null, new ClassOrInterfaceType(), new NodeList<>(new ArrayCreationLevel()), new ArrayInitializerExpr()); } @AllFieldsConstructor - public ArrayCreationExpr(Type elementType, NodeList levels, ArrayInitializerExpr initializer) { + public ArrayCreationExpr(Type elementType, NodeList levels, ArrayInitializerExpr initializer) { this(null, elementType, levels, initializer); } - public ArrayCreationExpr(Type elementType) { + public ArrayCreationExpr(Type elementType) { this(null, elementType, new NodeList<>(new ArrayCreationLevel()), new ArrayInitializerExpr()); } @@ -73,7 +73,7 @@ public ArrayCreationExpr(Type elementType) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ArrayCreationExpr(TokenRange tokenRange, Type elementType, NodeList levels, ArrayInitializerExpr initializer) { + public ArrayCreationExpr(TokenRange tokenRange, Type elementType, NodeList levels, ArrayInitializerExpr initializer) { super(tokenRange); setElementType(elementType); setLevels(levels); @@ -83,23 +83,23 @@ public ArrayCreationExpr(TokenRange tokenRange, Type elementType, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getInitializer() { + public Optional getInitializer() { return Optional.ofNullable(initializer); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getElementType() { + public Type getElementType() { return elementType; } @@ -110,7 +110,7 @@ public Type getElementType() { * @return this, the ArrayCreationExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayCreationExpr setInitializer(final ArrayInitializerExpr initializer) { + public ArrayCreationExpr setInitializer(final ArrayInitializerExpr initializer) { if (initializer == this.initializer) { return this; } @@ -123,7 +123,7 @@ public ArrayCreationExpr setInitializer(final ArrayInitializerExpr initializer) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayCreationExpr setElementType(final Type elementType) { + public ArrayCreationExpr setElementType(final Type elementType) { assertNotNull(elementType); if (elementType == this.elementType) { return this; @@ -137,12 +137,12 @@ public ArrayCreationExpr setElementType(final Type elementType) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getLevels() { + public NodeList getLevels() { return levels; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayCreationExpr setLevels(final NodeList levels) { + public ArrayCreationExpr setLevels(final NodeList levels) { assertNotNull(levels); if (levels == this.levels) { return this; @@ -158,7 +158,7 @@ public ArrayCreationExpr setLevels(final NodeList levels) { /** * Takes the element type and wraps it in an ArrayType for every array creation level. */ - public Type createdType() { + public Type createdType() { Type result = elementType; for (int i = 0; i < levels.size(); i++) { result = new ArrayType(result, ArrayType.Origin.TYPE, new NodeList<>()); @@ -172,18 +172,18 @@ public Type createdType() { * @param typeClass the type * @return this */ - public ArrayCreationExpr setElementType(Class typeClass) { + public ArrayCreationExpr setElementType(Class typeClass) { tryAddImportToParentCompilationUnit(typeClass); return setElementType(parseType(typeClass.getSimpleName())); } - public ArrayCreationExpr setElementType(final String type) { + public ArrayCreationExpr setElementType(final String type) { return setElementType(parseType(type)); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -203,25 +203,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ArrayCreationExpr removeInitializer() { + public ArrayCreationExpr removeInitializer() { return setInitializer((ArrayInitializerExpr) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ArrayCreationExpr clone() { + public ArrayCreationExpr clone() { return (ArrayCreationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ArrayCreationExprMetaModel getMetaModel() { + public ArrayCreationExprMetaModel getMetaModel() { return JavaParserMetaModel.arrayCreationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -246,25 +246,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayCreationExpr() { + public boolean isArrayCreationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayCreationExpr asArrayCreationExpr() { + public ArrayCreationExpr asArrayCreationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayCreationExpr(Consumer action) { + public void ifArrayCreationExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayCreationExpr() { + public Optional toArrayCreationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayInitializerExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayInitializerExpr.java index e44bafe5fc..acec89e66d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayInitializerExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ArrayInitializerExpr.java @@ -43,16 +43,16 @@ * * @author Julio Vilmar Gesser */ -public class ArrayInitializerExpr extends Expression { +public class ArrayInitializerExpr extends Expression { private NodeList values; - public ArrayInitializerExpr() { + public ArrayInitializerExpr() { this(null, new NodeList<>()); } @AllFieldsConstructor - public ArrayInitializerExpr(NodeList values) { + public ArrayInitializerExpr(NodeList values) { this(null, values); } @@ -60,7 +60,7 @@ public ArrayInitializerExpr(NodeList values) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ArrayInitializerExpr(TokenRange tokenRange, NodeList values) { + public ArrayInitializerExpr(TokenRange tokenRange, NodeList values) { super(tokenRange); setValues(values); customInitialization(); @@ -68,23 +68,23 @@ public ArrayInitializerExpr(TokenRange tokenRange, NodeList values) @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getValues() { + public NodeList getValues() { return values; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayInitializerExpr setValues(final NodeList values) { + public ArrayInitializerExpr setValues(final NodeList values) { assertNotNull(values); if (values == this.values) { return this; @@ -99,7 +99,7 @@ public ArrayInitializerExpr setValues(final NodeList values) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -114,19 +114,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ArrayInitializerExpr clone() { + public ArrayInitializerExpr clone() { return (ArrayInitializerExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ArrayInitializerExprMetaModel getMetaModel() { + public ArrayInitializerExprMetaModel getMetaModel() { return JavaParserMetaModel.arrayInitializerExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -141,25 +141,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayInitializerExpr() { + public boolean isArrayInitializerExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayInitializerExpr asArrayInitializerExpr() { + public ArrayInitializerExpr asArrayInitializerExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayInitializerExpr(Consumer action) { + public void ifArrayInitializerExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayInitializerExpr() { + public Optional toArrayInitializerExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AssignExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AssignExpr.java index 4d7cf5cc70..f511aa6d48 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AssignExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/AssignExpr.java @@ -45,9 +45,9 @@ * * @author Julio Vilmar Gesser */ -public class AssignExpr extends Expression { +public class AssignExpr extends Expression { - public enum Operator implements Stringable { + public enum Operator implements Stringable { ASSIGN("="), PLUS("+="), @@ -68,11 +68,11 @@ public enum Operator implements Stringable { this.codeRepresentation = codeRepresentation; } - public String asString() { + public String asString() { return codeRepresentation; } - public Optional toBinaryOperator() { + public Optional toBinaryOperator() { switch(this) { case PLUS: return Optional.of(BinaryExpr.Operator.PLUS); @@ -108,12 +108,12 @@ public Optional toBinaryOperator() { private Operator operator; - public AssignExpr() { + public AssignExpr() { this(null, new NameExpr(), new StringLiteralExpr(), Operator.ASSIGN); } @AllFieldsConstructor - public AssignExpr(Expression target, Expression value, Operator operator) { + public AssignExpr(Expression target, Expression value, Operator operator) { this(null, target, value, operator); } @@ -121,7 +121,7 @@ public AssignExpr(Expression target, Expression value, Operator operator) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public AssignExpr(TokenRange tokenRange, Expression target, Expression value, Operator operator) { + public AssignExpr(TokenRange tokenRange, Expression target, Expression value, Operator operator) { super(tokenRange); setTarget(target); setValue(value); @@ -131,33 +131,33 @@ public AssignExpr(TokenRange tokenRange, Expression target, Expression value, O @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Operator getOperator() { + public Operator getOperator() { return operator; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getTarget() { + public Expression getTarget() { return target; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getValue() { + public Expression getValue() { return value; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AssignExpr setOperator(final Operator operator) { + public AssignExpr setOperator(final Operator operator) { assertNotNull(operator); if (operator == this.operator) { return this; @@ -168,7 +168,7 @@ public AssignExpr setOperator(final Operator operator) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AssignExpr setTarget(final Expression target) { + public AssignExpr setTarget(final Expression target) { assertNotNull(target); if (target == this.target) { return this; @@ -182,7 +182,7 @@ public AssignExpr setTarget(final Expression target) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AssignExpr setValue(final Expression value) { + public AssignExpr setValue(final Expression value) { assertNotNull(value); if (value == this.value) { return this; @@ -197,19 +197,19 @@ public AssignExpr setValue(final Expression value) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public AssignExpr clone() { + public AssignExpr clone() { return (AssignExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public AssignExprMetaModel getMetaModel() { + public AssignExprMetaModel getMetaModel() { return JavaParserMetaModel.assignExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -226,25 +226,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAssignExpr() { + public boolean isAssignExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AssignExpr asAssignExpr() { + public AssignExpr asAssignExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAssignExpr(Consumer action) { + public void ifAssignExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAssignExpr() { + public Optional toAssignExpr() { return Optional.of(this); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BinaryExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BinaryExpr.java index 6a2990e403..7dcef64d28 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BinaryExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BinaryExpr.java @@ -43,9 +43,9 @@ * * @author Julio Vilmar Gesser */ -public class BinaryExpr extends Expression { +public class BinaryExpr extends Expression { - public enum Operator implements Stringable { + public enum Operator implements Stringable { // JML IMPLICATION("==>"), @@ -83,11 +83,11 @@ public enum Operator implements Stringable { this.codeRepresentation = codeRepresentation; } - public String asString() { + public String asString() { return codeRepresentation; } - public Optional toAssignOperator() { + public Optional toAssignOperator() { switch(this) { case BINARY_OR: return Optional.of(AssignExpr.Operator.BINARY_OR); @@ -123,12 +123,12 @@ public Optional toAssignOperator() { private Operator operator; - public BinaryExpr() { + public BinaryExpr() { this(null, new BooleanLiteralExpr(), new BooleanLiteralExpr(), Operator.EQUALS); } @AllFieldsConstructor - public BinaryExpr(Expression left, Expression right, Operator operator) { + public BinaryExpr(Expression left, Expression right, Operator operator) { this(null, left, right, operator); } @@ -136,7 +136,7 @@ public BinaryExpr(Expression left, Expression right, Operator operator) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BinaryExpr(TokenRange tokenRange, Expression left, Expression right, Operator operator) { + public BinaryExpr(TokenRange tokenRange, Expression left, Expression right, Operator operator) { super(tokenRange); setLeft(left); setRight(right); @@ -146,33 +146,33 @@ public BinaryExpr(TokenRange tokenRange, Expression left, Expression right, Ope @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getLeft() { + public Expression getLeft() { return left; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Operator getOperator() { + public Operator getOperator() { return operator; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getRight() { + public Expression getRight() { return right; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BinaryExpr setLeft(final Expression left) { + public BinaryExpr setLeft(final Expression left) { assertNotNull(left); if (left == this.left) { return this; @@ -186,7 +186,7 @@ public BinaryExpr setLeft(final Expression left) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BinaryExpr setOperator(final Operator operator) { + public BinaryExpr setOperator(final Operator operator) { assertNotNull(operator); if (operator == this.operator) { return this; @@ -197,7 +197,7 @@ public BinaryExpr setOperator(final Operator operator) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BinaryExpr setRight(final Expression right) { + public BinaryExpr setRight(final Expression right) { assertNotNull(right); if (right == this.right) { return this; @@ -212,19 +212,19 @@ public BinaryExpr setRight(final Expression right) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BinaryExpr clone() { + public BinaryExpr clone() { return (BinaryExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BinaryExprMetaModel getMetaModel() { + public BinaryExprMetaModel getMetaModel() { return JavaParserMetaModel.binaryExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -241,25 +241,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBinaryExpr() { + public boolean isBinaryExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BinaryExpr asBinaryExpr() { + public BinaryExpr asBinaryExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBinaryExpr(Consumer action) { + public void ifBinaryExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBinaryExpr() { + public Optional toBinaryExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BooleanLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BooleanLiteralExpr.java index 76821644f1..eb7282d056 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BooleanLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/BooleanLiteralExpr.java @@ -40,16 +40,16 @@ * * @author Julio Vilmar Gesser */ -public class BooleanLiteralExpr extends LiteralExpr { +public class BooleanLiteralExpr extends LiteralExpr { private boolean value; - public BooleanLiteralExpr() { + public BooleanLiteralExpr() { this(null, false); } @AllFieldsConstructor - public BooleanLiteralExpr(boolean value) { + public BooleanLiteralExpr(boolean value) { this(null, value); } @@ -57,7 +57,7 @@ public BooleanLiteralExpr(boolean value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BooleanLiteralExpr(TokenRange tokenRange, boolean value) { + public BooleanLiteralExpr(TokenRange tokenRange, boolean value) { super(tokenRange); setValue(value); customInitialization(); @@ -65,13 +65,13 @@ public BooleanLiteralExpr(TokenRange tokenRange, boolean value) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -80,16 +80,16 @@ public void accept(final VoidVisitor v, final A arg) { * but "getValue" does the same and makes more sense. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isValue() { + public boolean isValue() { return value; } - public boolean getValue() { + public boolean getValue() { return isValue(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BooleanLiteralExpr setValue(final boolean value) { + public BooleanLiteralExpr setValue(final boolean value) { if (value == this.value) { return this; } @@ -100,37 +100,37 @@ public BooleanLiteralExpr setValue(final boolean value) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BooleanLiteralExpr clone() { + public BooleanLiteralExpr clone() { return (BooleanLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BooleanLiteralExprMetaModel getMetaModel() { + public BooleanLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.booleanLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBooleanLiteralExpr() { + public boolean isBooleanLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BooleanLiteralExpr asBooleanLiteralExpr() { + public BooleanLiteralExpr asBooleanLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBooleanLiteralExpr(Consumer action) { + public void ifBooleanLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBooleanLiteralExpr() { + public Optional toBooleanLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CastExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CastExpr.java index ebacadabe5..2c43f391ae 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CastExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CastExpr.java @@ -43,18 +43,18 @@ * * @author Julio Vilmar Gesser */ -public class CastExpr extends Expression implements NodeWithType, NodeWithExpression { +public class CastExpr extends Expression implements NodeWithType, NodeWithExpression { private Type type; private Expression expression; - public CastExpr() { + public CastExpr() { this(null, new ClassOrInterfaceType(), new NameExpr()); } @AllFieldsConstructor - public CastExpr(Type type, Expression expression) { + public CastExpr(Type type, Expression expression) { this(null, type, expression); } @@ -62,7 +62,7 @@ public CastExpr(Type type, Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public CastExpr(TokenRange tokenRange, Type type, Expression expression) { + public CastExpr(TokenRange tokenRange, Type type, Expression expression) { super(tokenRange); setType(type); setExpression(expression); @@ -71,28 +71,28 @@ public CastExpr(TokenRange tokenRange, Type type, Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CastExpr setExpression(final Expression expression) { + public CastExpr setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -106,7 +106,7 @@ public CastExpr setExpression(final Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CastExpr setType(final Type type) { + public CastExpr setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -121,19 +121,19 @@ public CastExpr setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CastExpr clone() { + public CastExpr clone() { return (CastExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CastExprMetaModel getMetaModel() { + public CastExprMetaModel getMetaModel() { return JavaParserMetaModel.castExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -150,25 +150,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCastExpr() { + public boolean isCastExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CastExpr asCastExpr() { + public CastExpr asCastExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCastExpr(Consumer action) { + public void ifCastExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCastExpr() { + public Optional toCastExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CharLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CharLiteralExpr.java index 63c5da12db..72044a2ca4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CharLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/CharLiteralExpr.java @@ -44,14 +44,14 @@ * * @author Julio Vilmar Gesser */ -public class CharLiteralExpr extends LiteralStringValueExpr { +public class CharLiteralExpr extends LiteralStringValueExpr { - public CharLiteralExpr() { + public CharLiteralExpr() { this(null, "?"); } @AllFieldsConstructor - public CharLiteralExpr(String value) { + public CharLiteralExpr(String value) { this(null, value); } @@ -60,7 +60,7 @@ public CharLiteralExpr(String value) { * * @param value a char */ - public CharLiteralExpr(char value) { + public CharLiteralExpr(char value) { this(null, StringEscapeUtils.escapeJava(String.valueOf(value))); } @@ -68,7 +68,7 @@ public CharLiteralExpr(char value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public CharLiteralExpr(TokenRange tokenRange, String value) { + public CharLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } @@ -82,20 +82,20 @@ public static CharLiteralExpr escape(String string) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } /** * @return the unescaped value character of this literal */ - public char asChar() { + public char asChar() { return StringEscapeUtils.unescapeJava(value).charAt(0); } @@ -105,44 +105,44 @@ public char asChar() { * @param value a char * @return this expression */ - public CharLiteralExpr setChar(char value) { + public CharLiteralExpr setChar(char value) { this.value = String.valueOf(value); return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CharLiteralExpr clone() { + public CharLiteralExpr clone() { return (CharLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CharLiteralExprMetaModel getMetaModel() { + public CharLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.charLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCharLiteralExpr() { + public boolean isCharLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CharLiteralExpr asCharLiteralExpr() { + public CharLiteralExpr asCharLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCharLiteralExpr(Consumer action) { + public void ifCharLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCharLiteralExpr() { + public Optional toCharLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ClassExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ClassExpr.java index c1d10729f5..7ea798a381 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ClassExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ClassExpr.java @@ -43,16 +43,16 @@ * * @author Julio Vilmar Gesser */ -public class ClassExpr extends Expression implements NodeWithType { +public class ClassExpr extends Expression implements NodeWithType { private Type type; - public ClassExpr() { + public ClassExpr() { this(null, new ClassOrInterfaceType()); } @AllFieldsConstructor - public ClassExpr(Type type) { + public ClassExpr(Type type) { this(null, type); } @@ -60,7 +60,7 @@ public ClassExpr(Type type) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ClassExpr(TokenRange tokenRange, Type type) { + public ClassExpr(TokenRange tokenRange, Type type) { super(tokenRange); setType(type); customInitialization(); @@ -68,23 +68,23 @@ public ClassExpr(TokenRange tokenRange, Type type) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassExpr setType(final Type type) { + public ClassExpr setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -99,19 +99,19 @@ public ClassExpr setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ClassExpr clone() { + public ClassExpr clone() { return (ClassExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ClassExprMetaModel getMetaModel() { + public ClassExprMetaModel getMetaModel() { return JavaParserMetaModel.classExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -124,25 +124,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassExpr() { + public boolean isClassExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassExpr asClassExpr() { + public ClassExpr asClassExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassExpr(Consumer action) { + public void ifClassExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassExpr() { + public Optional toClassExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ConditionalExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ConditionalExpr.java index 0b8bf9292b..427480d477 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ConditionalExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ConditionalExpr.java @@ -41,7 +41,7 @@ * * @author Julio Vilmar Gesser */ -public class ConditionalExpr extends Expression implements NodeWithCondition { +public class ConditionalExpr extends Expression implements NodeWithCondition { private Expression condition; @@ -49,12 +49,12 @@ public class ConditionalExpr extends Expression implements NodeWithCondition R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCondition() { + public Expression getCondition() { return condition; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getElseExpr() { + public Expression getElseExpr() { return elseExpr; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getThenExpr() { + public Expression getThenExpr() { return thenExpr; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ConditionalExpr setCondition(final Expression condition) { + public ConditionalExpr setCondition(final Expression condition) { assertNotNull(condition); if (condition == this.condition) { return this; @@ -112,7 +112,7 @@ public ConditionalExpr setCondition(final Expression condition) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ConditionalExpr setElseExpr(final Expression elseExpr) { + public ConditionalExpr setElseExpr(final Expression elseExpr) { assertNotNull(elseExpr); if (elseExpr == this.elseExpr) { return this; @@ -126,7 +126,7 @@ public ConditionalExpr setElseExpr(final Expression elseExpr) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ConditionalExpr setThenExpr(final Expression thenExpr) { + public ConditionalExpr setThenExpr(final Expression thenExpr) { assertNotNull(thenExpr); if (thenExpr == this.thenExpr) { return this; @@ -141,19 +141,19 @@ public ConditionalExpr setThenExpr(final Expression thenExpr) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ConditionalExpr clone() { + public ConditionalExpr clone() { return (ConditionalExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ConditionalExprMetaModel getMetaModel() { + public ConditionalExprMetaModel getMetaModel() { return JavaParserMetaModel.conditionalExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -174,25 +174,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isConditionalExpr() { + public boolean isConditionalExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ConditionalExpr asConditionalExpr() { + public ConditionalExpr asConditionalExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifConditionalExpr(Consumer action) { + public void ifConditionalExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toConditionalExpr() { + public Optional toConditionalExpr() { return Optional.of(this); } @@ -201,7 +201,7 @@ public Optional toConditionalExpr() { * Otherwise, it is a standalone expression. */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { return appearsInAssignmentContext() || appearsInInvocationContext(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/DoubleLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/DoubleLiteralExpr.java index c9b49f6439..69f9312afb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/DoubleLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/DoubleLiteralExpr.java @@ -40,14 +40,14 @@ * * @author Julio Vilmar Gesser */ -public class DoubleLiteralExpr extends LiteralStringValueExpr { +public class DoubleLiteralExpr extends LiteralStringValueExpr { - public DoubleLiteralExpr() { + public DoubleLiteralExpr() { this(null, "0"); } @AllFieldsConstructor - public DoubleLiteralExpr(final String value) { + public DoubleLiteralExpr(final String value) { this(null, value); } @@ -55,31 +55,31 @@ public DoubleLiteralExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public DoubleLiteralExpr(TokenRange tokenRange, String value) { + public DoubleLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } - public DoubleLiteralExpr(final double value) { + public DoubleLiteralExpr(final double value) { this(null, String.valueOf(value)); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } /** * @return the literal value as a double */ - public double asDouble() { + public double asDouble() { // Underscores are allowed in number literals for readability reasons but cause a NumberFormatException if // passed along to Double#parseDouble. Hence, we apply a simple filter to remove all underscores. // See https://github.com/javaparser/javaparser/issues/1980 for more information. @@ -87,44 +87,44 @@ public double asDouble() { return Double.parseDouble(noUnderscoreValue); } - public DoubleLiteralExpr setDouble(double value) { + public DoubleLiteralExpr setDouble(double value) { this.value = String.valueOf(value); return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public DoubleLiteralExpr clone() { + public DoubleLiteralExpr clone() { return (DoubleLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public DoubleLiteralExprMetaModel getMetaModel() { + public DoubleLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.doubleLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isDoubleLiteralExpr() { + public boolean isDoubleLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public DoubleLiteralExpr asDoubleLiteralExpr() { + public DoubleLiteralExpr asDoubleLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifDoubleLiteralExpr(Consumer action) { + public void ifDoubleLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toDoubleLiteralExpr() { + public Optional toDoubleLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/EnclosedExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/EnclosedExpr.java index d15c1ac2ae..4d32859526 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/EnclosedExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/EnclosedExpr.java @@ -40,16 +40,16 @@ * * @author Julio Vilmar Gesser */ -public class EnclosedExpr extends Expression { +public class EnclosedExpr extends Expression { private Expression inner; - public EnclosedExpr() { + public EnclosedExpr() { this(null, new StringLiteralExpr()); } @AllFieldsConstructor - public EnclosedExpr(final Expression inner) { + public EnclosedExpr(final Expression inner) { this(null, inner); } @@ -57,7 +57,7 @@ public EnclosedExpr(final Expression inner) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public EnclosedExpr(TokenRange tokenRange, Expression inner) { + public EnclosedExpr(TokenRange tokenRange, Expression inner) { super(tokenRange); setInner(inner); customInitialization(); @@ -65,18 +65,18 @@ public EnclosedExpr(TokenRange tokenRange, Expression inner) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getInner() { + public Expression getInner() { return inner; } @@ -87,7 +87,7 @@ public Expression getInner() { * @return this, the EnclosedExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public EnclosedExpr setInner(final Expression inner) { + public EnclosedExpr setInner(final Expression inner) { assertNotNull(inner); if (inner == this.inner) { return this; @@ -102,19 +102,19 @@ public EnclosedExpr setInner(final Expression inner) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public EnclosedExpr clone() { + public EnclosedExpr clone() { return (EnclosedExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public EnclosedExprMetaModel getMetaModel() { + public EnclosedExprMetaModel getMetaModel() { return JavaParserMetaModel.enclosedExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -127,25 +127,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnclosedExpr() { + public boolean isEnclosedExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnclosedExpr asEnclosedExpr() { + public EnclosedExpr asEnclosedExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnclosedExpr(Consumer action) { + public void ifEnclosedExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnclosedExpr() { + public Optional toEnclosedExpr() { return Optional.of(this); } @@ -154,7 +154,7 @@ public Optional toEnclosedExpr() { * (https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.8.5) */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { return getInner().isPolyExpression(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java index 763325e56d..2edd88bb48 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Expression.java @@ -64,7 +64,7 @@ public abstract class Expression extends Node { }; @AllFieldsConstructor - public Expression() { + public Expression() { this(null); } @@ -72,712 +72,712 @@ public Expression() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Expression(TokenRange tokenRange) { + public Expression(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Expression clone() { + public Expression clone() { return (Expression) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ExpressionMetaModel getMetaModel() { + public ExpressionMetaModel getMetaModel() { return JavaParserMetaModel.expressionMetaModel; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAnnotationExpr() { + public boolean isAnnotationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AnnotationExpr asAnnotationExpr() { + public AnnotationExpr asAnnotationExpr() { throw new IllegalStateException(f("%s is not AnnotationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayAccessExpr() { + public boolean isArrayAccessExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayAccessExpr asArrayAccessExpr() { + public ArrayAccessExpr asArrayAccessExpr() { throw new IllegalStateException(f("%s is not ArrayAccessExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayCreationExpr() { + public boolean isArrayCreationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayCreationExpr asArrayCreationExpr() { + public ArrayCreationExpr asArrayCreationExpr() { throw new IllegalStateException(f("%s is not ArrayCreationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayInitializerExpr() { + public boolean isArrayInitializerExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayInitializerExpr asArrayInitializerExpr() { + public ArrayInitializerExpr asArrayInitializerExpr() { throw new IllegalStateException(f("%s is not ArrayInitializerExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAssignExpr() { + public boolean isAssignExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AssignExpr asAssignExpr() { + public AssignExpr asAssignExpr() { throw new IllegalStateException(f("%s is not AssignExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBinaryExpr() { + public boolean isBinaryExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BinaryExpr asBinaryExpr() { + public BinaryExpr asBinaryExpr() { throw new IllegalStateException(f("%s is not BinaryExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBooleanLiteralExpr() { + public boolean isBooleanLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BooleanLiteralExpr asBooleanLiteralExpr() { + public BooleanLiteralExpr asBooleanLiteralExpr() { throw new IllegalStateException(f("%s is not BooleanLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCastExpr() { + public boolean isCastExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CastExpr asCastExpr() { + public CastExpr asCastExpr() { throw new IllegalStateException(f("%s is not CastExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isCharLiteralExpr() { + public boolean isCharLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public CharLiteralExpr asCharLiteralExpr() { + public CharLiteralExpr asCharLiteralExpr() { throw new IllegalStateException(f("%s is not CharLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassExpr() { + public boolean isClassExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassExpr asClassExpr() { + public ClassExpr asClassExpr() { throw new IllegalStateException(f("%s is not ClassExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isConditionalExpr() { + public boolean isConditionalExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ConditionalExpr asConditionalExpr() { + public ConditionalExpr asConditionalExpr() { throw new IllegalStateException(f("%s is not ConditionalExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isDoubleLiteralExpr() { + public boolean isDoubleLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public DoubleLiteralExpr asDoubleLiteralExpr() { + public DoubleLiteralExpr asDoubleLiteralExpr() { throw new IllegalStateException(f("%s is not DoubleLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEnclosedExpr() { + public boolean isEnclosedExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EnclosedExpr asEnclosedExpr() { + public EnclosedExpr asEnclosedExpr() { throw new IllegalStateException(f("%s is not EnclosedExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isFieldAccessExpr() { + public boolean isFieldAccessExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public FieldAccessExpr asFieldAccessExpr() { + public FieldAccessExpr asFieldAccessExpr() { throw new IllegalStateException(f("%s is not FieldAccessExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isInstanceOfExpr() { + public boolean isInstanceOfExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public InstanceOfExpr asInstanceOfExpr() { + public InstanceOfExpr asInstanceOfExpr() { throw new IllegalStateException(f("%s is not InstanceOfExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIntegerLiteralExpr() { + public boolean isIntegerLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IntegerLiteralExpr asIntegerLiteralExpr() { + public IntegerLiteralExpr asIntegerLiteralExpr() { throw new IllegalStateException(f("%s is not IntegerLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLambdaExpr() { + public boolean isLambdaExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LambdaExpr asLambdaExpr() { + public LambdaExpr asLambdaExpr() { throw new IllegalStateException(f("%s is not LambdaExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLiteralExpr() { + public boolean isLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LiteralExpr asLiteralExpr() { + public LiteralExpr asLiteralExpr() { throw new IllegalStateException(f("%s is not LiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLiteralStringValueExpr() { + public boolean isLiteralStringValueExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LiteralStringValueExpr asLiteralStringValueExpr() { + public LiteralStringValueExpr asLiteralStringValueExpr() { throw new IllegalStateException(f("%s is not LiteralStringValueExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLongLiteralExpr() { + public boolean isLongLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LongLiteralExpr asLongLiteralExpr() { + public LongLiteralExpr asLongLiteralExpr() { throw new IllegalStateException(f("%s is not LongLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMarkerAnnotationExpr() { + public boolean isMarkerAnnotationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MarkerAnnotationExpr asMarkerAnnotationExpr() { + public MarkerAnnotationExpr asMarkerAnnotationExpr() { throw new IllegalStateException(f("%s is not MarkerAnnotationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodCallExpr() { + public boolean isMethodCallExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodCallExpr asMethodCallExpr() { + public MethodCallExpr asMethodCallExpr() { throw new IllegalStateException(f("%s is not MethodCallExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodReferenceExpr() { + public boolean isMethodReferenceExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodReferenceExpr asMethodReferenceExpr() { + public MethodReferenceExpr asMethodReferenceExpr() { throw new IllegalStateException(f("%s is not MethodReferenceExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNameExpr() { + public boolean isNameExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NameExpr asNameExpr() { + public NameExpr asNameExpr() { throw new IllegalStateException(f("%s is not NameExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNormalAnnotationExpr() { + public boolean isNormalAnnotationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NormalAnnotationExpr asNormalAnnotationExpr() { + public NormalAnnotationExpr asNormalAnnotationExpr() { throw new IllegalStateException(f("%s is not NormalAnnotationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNullLiteralExpr() { + public boolean isNullLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NullLiteralExpr asNullLiteralExpr() { + public NullLiteralExpr asNullLiteralExpr() { throw new IllegalStateException(f("%s is not NullLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isObjectCreationExpr() { + public boolean isObjectCreationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ObjectCreationExpr asObjectCreationExpr() { + public ObjectCreationExpr asObjectCreationExpr() { throw new IllegalStateException(f("%s is not ObjectCreationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSingleMemberAnnotationExpr() { + public boolean isSingleMemberAnnotationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SingleMemberAnnotationExpr asSingleMemberAnnotationExpr() { + public SingleMemberAnnotationExpr asSingleMemberAnnotationExpr() { throw new IllegalStateException(f("%s is not SingleMemberAnnotationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isStringLiteralExpr() { + public boolean isStringLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public StringLiteralExpr asStringLiteralExpr() { + public StringLiteralExpr asStringLiteralExpr() { throw new IllegalStateException(f("%s is not StringLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSuperExpr() { + public boolean isSuperExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SuperExpr asSuperExpr() { + public SuperExpr asSuperExpr() { throw new IllegalStateException(f("%s is not SuperExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isThisExpr() { + public boolean isThisExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ThisExpr asThisExpr() { + public ThisExpr asThisExpr() { throw new IllegalStateException(f("%s is not ThisExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeExpr() { + public boolean isTypeExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeExpr asTypeExpr() { + public TypeExpr asTypeExpr() { throw new IllegalStateException(f("%s is not TypeExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnaryExpr() { + public boolean isUnaryExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnaryExpr asUnaryExpr() { + public UnaryExpr asUnaryExpr() { throw new IllegalStateException(f("%s is not UnaryExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVariableDeclarationExpr() { + public boolean isVariableDeclarationExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VariableDeclarationExpr asVariableDeclarationExpr() { + public VariableDeclarationExpr asVariableDeclarationExpr() { throw new IllegalStateException(f("%s is not VariableDeclarationExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAnnotationExpr(Consumer action) { + public void ifAnnotationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayAccessExpr(Consumer action) { + public void ifArrayAccessExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayCreationExpr(Consumer action) { + public void ifArrayCreationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayInitializerExpr(Consumer action) { + public void ifArrayInitializerExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAssignExpr(Consumer action) { + public void ifAssignExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBinaryExpr(Consumer action) { + public void ifBinaryExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBooleanLiteralExpr(Consumer action) { + public void ifBooleanLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCastExpr(Consumer action) { + public void ifCastExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifCharLiteralExpr(Consumer action) { + public void ifCharLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassExpr(Consumer action) { + public void ifClassExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifConditionalExpr(Consumer action) { + public void ifConditionalExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifDoubleLiteralExpr(Consumer action) { + public void ifDoubleLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEnclosedExpr(Consumer action) { + public void ifEnclosedExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifFieldAccessExpr(Consumer action) { + public void ifFieldAccessExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifInstanceOfExpr(Consumer action) { + public void ifInstanceOfExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIntegerLiteralExpr(Consumer action) { + public void ifIntegerLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLambdaExpr(Consumer action) { + public void ifLambdaExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLiteralExpr(Consumer action) { + public void ifLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLiteralStringValueExpr(Consumer action) { + public void ifLiteralStringValueExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLongLiteralExpr(Consumer action) { + public void ifLongLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMarkerAnnotationExpr(Consumer action) { + public void ifMarkerAnnotationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodCallExpr(Consumer action) { + public void ifMethodCallExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodReferenceExpr(Consumer action) { + public void ifMethodReferenceExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNameExpr(Consumer action) { + public void ifNameExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNormalAnnotationExpr(Consumer action) { + public void ifNormalAnnotationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNullLiteralExpr(Consumer action) { + public void ifNullLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifObjectCreationExpr(Consumer action) { + public void ifObjectCreationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSingleMemberAnnotationExpr(Consumer action) { + public void ifSingleMemberAnnotationExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifStringLiteralExpr(Consumer action) { + public void ifStringLiteralExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSuperExpr(Consumer action) { + public void ifSuperExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifThisExpr(Consumer action) { + public void ifThisExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeExpr(Consumer action) { + public void ifTypeExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnaryExpr(Consumer action) { + public void ifUnaryExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVariableDeclarationExpr(Consumer action) { + public void ifVariableDeclarationExpr(Consumer action) { } /** * returns the type associated with the node. */ - public ResolvedType calculateResolvedType() { + public ResolvedType calculateResolvedType() { return getSymbolResolver().calculateType(this); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAnnotationExpr() { + public Optional toAnnotationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayAccessExpr() { + public Optional toArrayAccessExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayCreationExpr() { + public Optional toArrayCreationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayInitializerExpr() { + public Optional toArrayInitializerExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAssignExpr() { + public Optional toAssignExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBinaryExpr() { + public Optional toBinaryExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBooleanLiteralExpr() { + public Optional toBooleanLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCastExpr() { + public Optional toCastExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toCharLiteralExpr() { + public Optional toCharLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassExpr() { + public Optional toClassExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toConditionalExpr() { + public Optional toConditionalExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toDoubleLiteralExpr() { + public Optional toDoubleLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEnclosedExpr() { + public Optional toEnclosedExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toFieldAccessExpr() { + public Optional toFieldAccessExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toInstanceOfExpr() { + public Optional toInstanceOfExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIntegerLiteralExpr() { + public Optional toIntegerLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLambdaExpr() { + public Optional toLambdaExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLiteralExpr() { + public Optional toLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLiteralStringValueExpr() { + public Optional toLiteralStringValueExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLongLiteralExpr() { + public Optional toLongLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMarkerAnnotationExpr() { + public Optional toMarkerAnnotationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodCallExpr() { + public Optional toMethodCallExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodReferenceExpr() { + public Optional toMethodReferenceExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNameExpr() { + public Optional toNameExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNormalAnnotationExpr() { + public Optional toNormalAnnotationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNullLiteralExpr() { + public Optional toNullLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toObjectCreationExpr() { + public Optional toObjectCreationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSingleMemberAnnotationExpr() { + public Optional toSingleMemberAnnotationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toStringLiteralExpr() { + public Optional toStringLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSuperExpr() { + public Optional toSuperExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toThisExpr() { + public Optional toThisExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeExpr() { + public Optional toTypeExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnaryExpr() { + public Optional toUnaryExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVariableDeclarationExpr() { + public Optional toVariableDeclarationExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSwitchExpr() { + public boolean isSwitchExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SwitchExpr asSwitchExpr() { + public SwitchExpr asSwitchExpr() { throw new IllegalStateException(f("%s is not SwitchExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSwitchExpr() { + public Optional toSwitchExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSwitchExpr(Consumer action) { + public void ifSwitchExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTextBlockLiteralExpr() { + public boolean isTextBlockLiteralExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TextBlockLiteralExpr asTextBlockLiteralExpr() { + public TextBlockLiteralExpr asTextBlockLiteralExpr() { throw new IllegalStateException(f("%s is not TextBlockLiteralExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTextBlockLiteralExpr() { + public Optional toTextBlockLiteralExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTextBlockLiteralExpr(Consumer action) { + public void ifTextBlockLiteralExpr(Consumer action) { } /** @@ -785,7 +785,7 @@ public void ifTextBlockLiteralExpr(Consumer action) { * * @return true if the expression is a standalone expression */ - public boolean isStandaloneExpression() { + public boolean isStandaloneExpression() { return !isPolyExpression(); } @@ -794,7 +794,7 @@ public boolean isStandaloneExpression() { * * @return true if the expression is a poly expression */ - public boolean isPolyExpression() { + public boolean isPolyExpression() { return false; } @@ -802,7 +802,7 @@ public boolean isPolyExpression() { * 6.5.6.2. Qualified Expression Names * https://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.5.6.2 */ - public boolean isQualified() { + public boolean isQualified() { return hasScope(); } @@ -863,304 +863,304 @@ public final boolean elidesTypeArguments() { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypePatternExpr() { + public boolean isTypePatternExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypePatternExpr asTypePatternExpr() { + public TypePatternExpr asTypePatternExpr() { throw new IllegalStateException(f("%s is not TypePatternExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypePatternExpr() { + public Optional toTypePatternExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypePatternExpr(Consumer action) { + public void ifTypePatternExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isPatternExpr() { + public boolean isPatternExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public PatternExpr asPatternExpr() { + public PatternExpr asPatternExpr() { throw new IllegalStateException(f("%s is not PatternExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toPatternExpr() { + public Optional toPatternExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifPatternExpr(Consumer action) { + public void ifPatternExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isRecordPatternExpr() { + public boolean isRecordPatternExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public RecordPatternExpr asRecordPatternExpr() { + public RecordPatternExpr asRecordPatternExpr() { throw new IllegalStateException(f("%s is not RecordPatternExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toRecordPatternExpr() { + public Optional toRecordPatternExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifRecordPatternExpr(Consumer action) { + public void ifRecordPatternExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBindingExpr() { + public boolean isJmlBindingExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlQuantifiedExpr asJmlBindingExpr() { + public JmlQuantifiedExpr asJmlBindingExpr() { throw new IllegalStateException(f("%s is not JmlBindingExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBindingExpr() { + public Optional toJmlBindingExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBindingExpr(Consumer action) { + public void ifJmlBindingExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlFunction() { + public boolean isJmlFunction() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabel() { + public boolean isJmlLabel() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelExpr asJmlLabel() { + public JmlLabelExpr asJmlLabel() { throw new IllegalStateException(f("%s is not JmlLabel, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabel() { + public Optional toJmlLabel() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabel(Consumer action) { + public void ifJmlLabel(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLetExpr() { + public boolean isJmlLetExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLetExpr asJmlLetExpr() { + public JmlLetExpr asJmlLetExpr() { throw new IllegalStateException(f("%s is not JmlLetExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLetExpr() { + public Optional toJmlLetExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLetExpr(Consumer action) { + public void ifJmlLetExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMultiCompareExpr() { + public boolean isJmlMultiCompareExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMultiCompareExpr asJmlMultiCompareExpr() { + public JmlMultiCompareExpr asJmlMultiCompareExpr() { throw new IllegalStateException(f("%s is not JmlMultiCompareExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMultiCompareExpr() { + public Optional toJmlMultiCompareExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMultiCompareExpr(Consumer action) { + public void ifJmlMultiCompareExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlQuantifiedExpr() { + public boolean isJmlQuantifiedExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlQuantifiedExpr asJmlQuantifiedExpr() { + public JmlQuantifiedExpr asJmlQuantifiedExpr() { throw new IllegalStateException(f("%s is not JmlQuantifiedExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlQuantifiedExpr() { + public Optional toJmlQuantifiedExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlQuantifiedExpr(Consumer action) { + public void ifJmlQuantifiedExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSetComprehension() { + public boolean isJmlSetComprehension() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSetComprehensionExpr asJmlSetComprehension() { + public JmlSetComprehensionExpr asJmlSetComprehension() { throw new IllegalStateException(f("%s is not JmlSetComprehensionExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSetComprehension() { + public Optional toJmlSetComprehension() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSetComprehension(Consumer action) { + public void ifJmlSetComprehension(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetArrayAccess() { + public boolean isLocationSetArrayAccess() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetBindingExpr() { + public boolean isLocationSetBindingExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetExpression() { + public boolean isLocationSetExpression() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetFieldAccess() { + public boolean isLocationSetFieldAccess() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetFunction() { + public boolean isLocationSetFunction() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetLiftExpression() { + public boolean isLocationSetLiftExpression() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetPrimary() { + public boolean isLocationSetPrimary() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetWrapperExpression() { + public boolean isLocationSetWrapperExpression() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetConstructorExpression() { + public boolean isLocationSetConstructorExpression() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocationSetStoreRef() { + public boolean isLocationSetStoreRef() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBinaryInfixExpr() { + public boolean isJmlBinaryInfixExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlBinaryInfixExpr asJmlBinaryInfixExpr() { + public JmlBinaryInfixExpr asJmlBinaryInfixExpr() { throw new IllegalStateException(f("%s is not JmlBinaryInfixExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBinaryInfixExpr() { + public Optional toJmlBinaryInfixExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBinaryInfixExpr(Consumer action) { + public void ifJmlBinaryInfixExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabelExpr() { + public boolean isJmlLabelExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelExpr asJmlLabelExpr() { + public JmlLabelExpr asJmlLabelExpr() { throw new IllegalStateException(f("%s is not JmlLabelExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabelExpr() { + public Optional toJmlLabelExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabelExpr(Consumer action) { + public void ifJmlLabelExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlTypeExpr() { + public boolean isJmlTypeExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlTypeExpr asJmlTypeExpr() { + public JmlTypeExpr asJmlTypeExpr() { throw new IllegalStateException(f("%s is not JmlTypeExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlTypeExpr() { + public Optional toJmlTypeExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlTypeExpr(Consumer action) { + public void ifJmlTypeExpr(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSetComprehensionExpr() { + public boolean isJmlSetComprehensionExpr() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSetComprehensionExpr asJmlSetComprehensionExpr() { + public JmlSetComprehensionExpr asJmlSetComprehensionExpr() { throw new IllegalStateException(f("%s is not JmlSetComprehensionExpr, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSetComprehensionExpr() { + public Optional toJmlSetComprehensionExpr() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSetComprehensionExpr(Consumer action) { + public void ifJmlSetComprehensionExpr(Consumer action) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/FieldAccessExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/FieldAccessExpr.java index f28ae8af29..4a77a5a47e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/FieldAccessExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/FieldAccessExpr.java @@ -50,7 +50,7 @@ * * @author Julio Vilmar Gesser */ -public class FieldAccessExpr extends Expression implements NodeWithSimpleName, NodeWithTypeArguments, NodeWithScope, Resolvable { +public class FieldAccessExpr extends Expression implements NodeWithSimpleName, NodeWithTypeArguments, NodeWithScope, Resolvable { private Expression scope; @@ -59,16 +59,16 @@ public class FieldAccessExpr extends Expression implements NodeWithSimpleName typeArguments, final SimpleName name) { + public FieldAccessExpr(final Expression scope, final NodeList typeArguments, final SimpleName name) { this(null, scope, typeArguments, name); } @@ -76,7 +76,7 @@ public FieldAccessExpr(final Expression scope, final NodeList typeArgumen * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public FieldAccessExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, SimpleName name) { + public FieldAccessExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, SimpleName name) { super(tokenRange); setScope(scope); setTypeArguments(typeArguments); @@ -91,23 +91,23 @@ public static Expression allMemberAccess(TokenRange range, Expression scope) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldAccessExpr setName(final SimpleName name) { + public FieldAccessExpr setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -121,7 +121,7 @@ public FieldAccessExpr setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getScope() { + public Expression getScope() { return scope; } @@ -132,7 +132,7 @@ public Expression getScope() { * @return this, the FieldAccessExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldAccessExpr setScope(final Expression scope) { + public FieldAccessExpr setScope(final Expression scope) { assertNotNull(scope); if (scope == this.scope) { return this; @@ -146,7 +146,7 @@ public FieldAccessExpr setScope(final Expression scope) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -157,7 +157,7 @@ public Optional> getTypeArguments() { * @return this, the FieldAccessExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldAccessExpr setTypeArguments(final NodeList typeArguments) { + public FieldAccessExpr setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -171,19 +171,19 @@ public FieldAccessExpr setTypeArguments(final NodeList typeArguments) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public FieldAccessExpr clone() { + public FieldAccessExpr clone() { return (FieldAccessExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public FieldAccessExprMetaModel getMetaModel() { + public FieldAccessExprMetaModel getMetaModel() { return JavaParserMetaModel.fieldAccessExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -200,7 +200,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -225,19 +225,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isFieldAccessExpr() { + public boolean isFieldAccessExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public FieldAccessExpr asFieldAccessExpr() { + public FieldAccessExpr asFieldAccessExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifFieldAccessExpr(Consumer action) { + public void ifFieldAccessExpr(Consumer action) { action.accept(this); } @@ -255,27 +255,27 @@ public void ifFieldAccessExpr(Consumer action) { * @see ExplicitConstructorInvocationStmt#resolve() */ @Override - public ResolvedValueDeclaration resolve() { + public ResolvedValueDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedValueDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toFieldAccessExpr() { + public Optional toFieldAccessExpr() { return Optional.of(this); } /** * Indicate if this FieldAccessExpr is an element directly contained in a larger FieldAccessExpr. */ - public boolean isInternal() { + public boolean isInternal() { return this.getParentNode().isPresent() && this.getParentNode().get() instanceof FieldAccessExpr; } /** * Indicate if this FieldAccessExpr is top level, i.e., it is not directly contained in a larger FieldAccessExpr. */ - public boolean isTopLevel() { + public boolean isTopLevel() { return !isInternal(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/InstanceOfExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/InstanceOfExpr.java index 49362dccb6..a17b122c7b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/InstanceOfExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/InstanceOfExpr.java @@ -94,7 +94,7 @@ * @see JEP305: https://bugs.openjdk.java.net/browse/JDK-8181287 * @see https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.20 */ -public class InstanceOfExpr extends Expression implements NodeWithType, NodeWithExpression { +public class InstanceOfExpr extends Expression implements NodeWithType, NodeWithExpression { private Expression expression; @@ -103,16 +103,16 @@ public class InstanceOfExpr extends Expression implements NodeWithType *
In this example, {@code getName()} returns {@code stringName} */ - public Optional getName() { + public Optional getName() { if (pattern == null) { return Optional.empty(); } @@ -148,64 +148,64 @@ public Optional getName() { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public InstanceOfExpr asInstanceOfExpr() { + public InstanceOfExpr asInstanceOfExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public InstanceOfExpr clone() { + public InstanceOfExpr clone() { return (InstanceOfExpr) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public InstanceOfExprMetaModel getMetaModel() { + public InstanceOfExprMetaModel getMetaModel() { return JavaParserMetaModel.instanceOfExprMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getPattern() { + public Optional getPattern() { return Optional.ofNullable(pattern); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ReferenceType getType() { + public ReferenceType getType() { return type; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifInstanceOfExpr(Consumer action) { + public void ifInstanceOfExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isInstanceOfExpr() { + public boolean isInstanceOfExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -219,13 +219,13 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public InstanceOfExpr removePattern() { + public InstanceOfExpr removePattern() { return setPattern((PatternExpr) null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -247,7 +247,7 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public InstanceOfExpr setExpression(final Expression expression) { + public InstanceOfExpr setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -261,7 +261,7 @@ public InstanceOfExpr setExpression(final Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public InstanceOfExpr setPattern(final PatternExpr pattern) { + public InstanceOfExpr setPattern(final PatternExpr pattern) { if (pattern == this.pattern) { return this; } @@ -274,7 +274,7 @@ public InstanceOfExpr setPattern(final PatternExpr pattern) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public InstanceOfExpr setType(final ReferenceType type) { + public InstanceOfExpr setType(final ReferenceType type) { assertNotNull(type); if (type == this.type) { return this; @@ -289,7 +289,7 @@ public InstanceOfExpr setType(final ReferenceType type) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toInstanceOfExpr() { + public Optional toInstanceOfExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/IntegerLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/IntegerLiteralExpr.java index 590c5a7408..8ed8156d76 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/IntegerLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/IntegerLiteralExpr.java @@ -46,18 +46,18 @@ * * @author Julio Vilmar Gesser */ -public class IntegerLiteralExpr extends LiteralStringValueExpr { +public class IntegerLiteralExpr extends LiteralStringValueExpr { public static final String MAX_31_BIT_UNSIGNED_VALUE_AS_STRING = "2147483648"; public static final long MAX_31_BIT_UNSIGNED_VALUE_AS_LONG = 2147483648L; - public IntegerLiteralExpr() { + public IntegerLiteralExpr() { this(null, "0"); } @AllFieldsConstructor - public IntegerLiteralExpr(final String value) { + public IntegerLiteralExpr(final String value) { this(null, value); } @@ -65,7 +65,7 @@ public IntegerLiteralExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public IntegerLiteralExpr(TokenRange tokenRange, String value) { + public IntegerLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } @@ -75,19 +75,19 @@ public IntegerLiteralExpr(TokenRange tokenRange, String value) { * {@link #asNumber()} function for valid formats and how to construct literals holding negative values. */ @Deprecated - public IntegerLiteralExpr(final int value) { + public IntegerLiteralExpr(final int value) { this(null, String.valueOf(value)); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -98,7 +98,7 @@ public void accept(final VoidVisitor v, final A arg) { * future releases */ @Deprecated - public int asInt() { + public int asInt() { String result = value.replaceAll("_", ""); if (result.startsWith("0x") || result.startsWith("0X")) { return Integer.parseUnsignedInt(result.substring(2), 16); @@ -126,7 +126,7 @@ public int asInt() { * * @return the literal value as a number while respecting different number representations */ - public Number asNumber() { + public Number asNumber() { if (Objects.equals(value, MAX_31_BIT_UNSIGNED_VALUE_AS_STRING) && hasUnaryMinusAsParent(this)) { return MAX_31_BIT_UNSIGNED_VALUE_AS_LONG; } @@ -138,44 +138,44 @@ public Number asNumber() { * #asNumber()} function for valid formats and how to construct literals holding negative values. */ @Deprecated - public IntegerLiteralExpr setInt(int value) { + public IntegerLiteralExpr setInt(int value) { this.value = String.valueOf(value); return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public IntegerLiteralExpr clone() { + public IntegerLiteralExpr clone() { return (IntegerLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public IntegerLiteralExprMetaModel getMetaModel() { + public IntegerLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.integerLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIntegerLiteralExpr() { + public boolean isIntegerLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IntegerLiteralExpr asIntegerLiteralExpr() { + public IntegerLiteralExpr asIntegerLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIntegerLiteralExpr(Consumer action) { + public void ifIntegerLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIntegerLiteralExpr() { + public Optional toIntegerLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LambdaExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LambdaExpr.java index 9b673b8753..865964afca 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LambdaExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LambdaExpr.java @@ -60,7 +60,7 @@ * * @author Raquel Pau */ -public class LambdaExpr extends Expression implements NodeWithParameters, NodeWithContracts { +public class LambdaExpr extends Expression implements NodeWithParameters, NodeWithContracts { private NodeList parameters; @@ -70,40 +70,40 @@ public class LambdaExpr extends Expression implements NodeWithParameters contracts = new NodeList<>(); - public LambdaExpr() { + public LambdaExpr() { this(null, new NodeList<>(), new ReturnStmt(), false); } /** * Creates a single parameter lambda expression. */ - public LambdaExpr(Parameter parameter, BlockStmt body) { + public LambdaExpr(Parameter parameter, BlockStmt body) { this(null, new NodeList<>(parameter), body, false); } /** * Creates a zero or multi-parameter lambda expression with its parameters wrapped in ( ). */ - public LambdaExpr(NodeList parameters, BlockStmt body) { + public LambdaExpr(NodeList parameters, BlockStmt body) { this(null, parameters, body, true); } /** * Creates a single parameter lambda expression. */ - public LambdaExpr(Parameter parameter, Expression body) { + public LambdaExpr(Parameter parameter, Expression body) { this(null, new NodeList<>(parameter), new ExpressionStmt(body), false); } /** * Creates a zero or multi-parameter lambda expression with its parameters wrapped in ( ). */ - public LambdaExpr(NodeList parameters, Expression body) { + public LambdaExpr(NodeList parameters, Expression body) { this(null, parameters, new ExpressionStmt(body), true); } @AllFieldsConstructor - public LambdaExpr(NodeList parameters, Statement body, boolean isEnclosingParameters) { + public LambdaExpr(NodeList parameters, Statement body, boolean isEnclosingParameters) { this(null, parameters, body, isEnclosingParameters); } @@ -111,7 +111,7 @@ public LambdaExpr(NodeList parameters, Statement body, boolean isEnc * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LambdaExpr(TokenRange tokenRange, NodeList parameters, Statement body, boolean isEnclosingParameters) { + public LambdaExpr(TokenRange tokenRange, NodeList parameters, Statement body, boolean isEnclosingParameters) { super(tokenRange); setParameters(parameters); setBody(body); @@ -120,12 +120,12 @@ public LambdaExpr(TokenRange tokenRange, NodeList parameters, Statem } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getParameters() { + public NodeList getParameters() { return parameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LambdaExpr setParameters(final NodeList parameters) { + public LambdaExpr setParameters(final NodeList parameters) { assertNotNull(parameters); if (parameters == this.parameters) { return this; @@ -142,12 +142,12 @@ public LambdaExpr setParameters(final NodeList parameters) { * @return a BlockStatement or an ExpressionStatement. See class Javadoc. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getBody() { + public Statement getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LambdaExpr setBody(final Statement body) { + public LambdaExpr setBody(final Statement body) { assertNotNull(body); if (body == this.body) { return this; @@ -162,23 +162,23 @@ public LambdaExpr setBody(final Statement body) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isEnclosingParameters() { + public boolean isEnclosingParameters() { return isEnclosingParameters; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LambdaExpr setEnclosingParameters(final boolean isEnclosingParameters) { + public LambdaExpr setEnclosingParameters(final boolean isEnclosingParameters) { if (isEnclosingParameters == this.isEnclosingParameters) { return this; } @@ -189,7 +189,7 @@ public LambdaExpr setEnclosingParameters(final boolean isEnclosingParameters) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -213,7 +213,7 @@ public boolean remove(Node node) { * Otherwise (when the body is a block) return Optional.empty(). */ @DerivedProperty - public Optional getExpressionBody() { + public Optional getExpressionBody() { if (body.isExpressionStmt()) { return Optional.of(body.asExpressionStmt().getExpression()); } @@ -222,19 +222,19 @@ public Optional getExpressionBody() { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LambdaExpr clone() { + public LambdaExpr clone() { return (LambdaExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LambdaExprMetaModel getMetaModel() { + public LambdaExprMetaModel getMetaModel() { return JavaParserMetaModel.lambdaExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -259,25 +259,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLambdaExpr() { + public boolean isLambdaExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LambdaExpr asLambdaExpr() { + public LambdaExpr asLambdaExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLambdaExpr(Consumer action) { + public void ifLambdaExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLambdaExpr() { + public Optional toLambdaExpr() { return Optional.of(this); } @@ -285,24 +285,24 @@ public Optional toLambdaExpr() { * Lambda expressions are always poly expressions */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { return true; } /* * Returns true if no type parameter has been defined */ - public boolean isExplicitlyTyped() { + public boolean isExplicitlyTyped() { return getParameters().stream().allMatch(p -> !(p.getType().isUnknownType())); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LambdaExpr setContracts(final NodeList contracts) { + public LambdaExpr setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralExpr.java index b5bfe7ce4e..322367069c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralExpr.java @@ -38,7 +38,7 @@ public abstract class LiteralExpr extends Expression { @AllFieldsConstructor - public LiteralExpr() { + public LiteralExpr() { this(null); } @@ -46,44 +46,44 @@ public LiteralExpr() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LiteralExpr(TokenRange tokenRange) { + public LiteralExpr(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LiteralExpr clone() { + public LiteralExpr clone() { return (LiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LiteralExprMetaModel getMetaModel() { + public LiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.literalExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLiteralExpr() { + public boolean isLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LiteralExpr asLiteralExpr() { + public LiteralExpr asLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLiteralExpr(Consumer action) { + public void ifLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLiteralExpr() { + public Optional toLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralStringValueExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralStringValueExpr.java index 59b021fd62..5eee17ee53 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralStringValueExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LiteralStringValueExpr.java @@ -40,7 +40,7 @@ public abstract class LiteralStringValueExpr extends LiteralExpr { protected String value; @AllFieldsConstructor - public LiteralStringValueExpr(final String value) { + public LiteralStringValueExpr(final String value) { this(null, value); } @@ -48,19 +48,19 @@ public LiteralStringValueExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LiteralStringValueExpr(TokenRange tokenRange, String value) { + public LiteralStringValueExpr(TokenRange tokenRange, String value) { super(tokenRange); setValue(value); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public String getValue() { + public String getValue() { return value; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LiteralStringValueExpr setValue(final String value) { + public LiteralStringValueExpr setValue(final String value) { assertNotNull(value); if (value == this.value) { return this; @@ -72,37 +72,37 @@ public LiteralStringValueExpr setValue(final String value) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LiteralStringValueExpr clone() { + public LiteralStringValueExpr clone() { return (LiteralStringValueExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LiteralStringValueExprMetaModel getMetaModel() { + public LiteralStringValueExprMetaModel getMetaModel() { return JavaParserMetaModel.literalStringValueExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLiteralStringValueExpr() { + public boolean isLiteralStringValueExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LiteralStringValueExpr asLiteralStringValueExpr() { + public LiteralStringValueExpr asLiteralStringValueExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLiteralStringValueExpr(Consumer action) { + public void ifLiteralStringValueExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLiteralStringValueExpr() { + public Optional toLiteralStringValueExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LongLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LongLiteralExpr.java index aa0399981d..2f75141337 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LongLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/LongLiteralExpr.java @@ -48,18 +48,18 @@ * * @author Julio Vilmar Gesser */ -public class LongLiteralExpr extends LiteralStringValueExpr { +public class LongLiteralExpr extends LiteralStringValueExpr { public static final String MAX_63_BIT_UNSIGNED_VALUE_AS_STRING = "9223372036854775808L"; public static final BigInteger MAX_63_BIT_UNSIGNED_VALUE_AS_BIG_INTEGER = new BigInteger("9223372036854775808"); - public LongLiteralExpr() { + public LongLiteralExpr() { this(null, "0"); } @AllFieldsConstructor - public LongLiteralExpr(final String value) { + public LongLiteralExpr(final String value) { this(null, value); } @@ -67,7 +67,7 @@ public LongLiteralExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LongLiteralExpr(TokenRange tokenRange, String value) { + public LongLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } @@ -77,19 +77,19 @@ public LongLiteralExpr(TokenRange tokenRange, String value) { * #asNumber()} function for valid formats and how to construct literals holding negative values. */ @Deprecated - public LongLiteralExpr(final long value) { + public LongLiteralExpr(final long value) { this(null, String.valueOf(value)); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -100,7 +100,7 @@ public void accept(final VoidVisitor v, final A arg) { * releases */ @Deprecated - public long asLong() { + public long asLong() { String result = value.replaceAll("_", ""); char lastChar = result.charAt(result.length() - 1); if (lastChar == 'l' || lastChar == 'L') { @@ -133,7 +133,7 @@ public long asLong() { * * @return the literal value as a number while respecting different number representations */ - public Number asNumber() { + public Number asNumber() { if (Objects.equals(value, MAX_63_BIT_UNSIGNED_VALUE_AS_STRING) && hasUnaryMinusAsParent(this)) { return MAX_63_BIT_UNSIGNED_VALUE_AS_BIG_INTEGER; } @@ -145,44 +145,44 @@ public Number asNumber() { * #asNumber()} function for valid formats and how to construct literals holding negative values. */ @Deprecated - public LongLiteralExpr setLong(long value) { + public LongLiteralExpr setLong(long value) { this.value = String.valueOf(value); return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LongLiteralExpr clone() { + public LongLiteralExpr clone() { return (LongLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LongLiteralExprMetaModel getMetaModel() { + public LongLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.longLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLongLiteralExpr() { + public boolean isLongLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LongLiteralExpr asLongLiteralExpr() { + public LongLiteralExpr asLongLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLongLiteralExpr(Consumer action) { + public void ifLongLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLongLiteralExpr() { + public Optional toLongLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java index faa72c7eef..7b5f7d09b9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MarkerAnnotationExpr.java @@ -39,18 +39,18 @@ * * @author Julio Vilmar Gesser */ -public class MarkerAnnotationExpr extends AnnotationExpr { +public class MarkerAnnotationExpr extends AnnotationExpr { - public MarkerAnnotationExpr() { + public MarkerAnnotationExpr() { this(null, new Name()); } - public MarkerAnnotationExpr(final String name) { + public MarkerAnnotationExpr(final String name) { this(null, parseName(name)); } @AllFieldsConstructor - public MarkerAnnotationExpr(final Name name) { + public MarkerAnnotationExpr(final Name name) { this(null, name); } @@ -58,56 +58,56 @@ public MarkerAnnotationExpr(final Name name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public MarkerAnnotationExpr(TokenRange tokenRange, Name name) { + public MarkerAnnotationExpr(TokenRange tokenRange, Name name) { super(tokenRange, name); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public MarkerAnnotationExpr clone() { + public MarkerAnnotationExpr clone() { return (MarkerAnnotationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public MarkerAnnotationExprMetaModel getMetaModel() { + public MarkerAnnotationExprMetaModel getMetaModel() { return JavaParserMetaModel.markerAnnotationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMarkerAnnotationExpr() { + public boolean isMarkerAnnotationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MarkerAnnotationExpr asMarkerAnnotationExpr() { + public MarkerAnnotationExpr asMarkerAnnotationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMarkerAnnotationExpr(Consumer action) { + public void ifMarkerAnnotationExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMarkerAnnotationExpr() { + public Optional toMarkerAnnotationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MemberValuePair.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MemberValuePair.java index aa17aa4ad0..3c1a89a236 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MemberValuePair.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MemberValuePair.java @@ -39,22 +39,22 @@ * * @author Julio Vilmar Gesser */ -public class MemberValuePair extends Node implements NodeWithSimpleName { +public class MemberValuePair extends Node implements NodeWithSimpleName { private SimpleName name; private Expression value; - public MemberValuePair() { + public MemberValuePair() { this(null, new SimpleName(), new StringLiteralExpr()); } - public MemberValuePair(final String name, final Expression value) { + public MemberValuePair(final String name, final Expression value) { this(null, new SimpleName(name), value); } @AllFieldsConstructor - public MemberValuePair(final SimpleName name, final Expression value) { + public MemberValuePair(final SimpleName name, final Expression value) { this(null, name, value); } @@ -62,7 +62,7 @@ public MemberValuePair(final SimpleName name, final Expression value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public MemberValuePair(TokenRange tokenRange, SimpleName name, Expression value) { + public MemberValuePair(TokenRange tokenRange, SimpleName name, Expression value) { super(tokenRange); setName(name); setValue(value); @@ -71,28 +71,28 @@ public MemberValuePair(TokenRange tokenRange, SimpleName name, Expression value @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getValue() { + public Expression getValue() { return value; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MemberValuePair setName(final SimpleName name) { + public MemberValuePair setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -106,7 +106,7 @@ public MemberValuePair setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MemberValuePair setValue(final Expression value) { + public MemberValuePair setValue(final Expression value) { assertNotNull(value); if (value == this.value) { return this; @@ -121,19 +121,19 @@ public MemberValuePair setValue(final Expression value) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public MemberValuePair clone() { + public MemberValuePair clone() { return (MemberValuePair) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public MemberValuePairMetaModel getMetaModel() { + public MemberValuePairMetaModel getMetaModel() { return JavaParserMetaModel.memberValuePairMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodCallExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodCallExpr.java index ea5be04c5d..bd5693d00d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodCallExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodCallExpr.java @@ -52,7 +52,7 @@ * * @author Julio Vilmar Gesser */ -public class MethodCallExpr extends Expression implements NodeWithTypeArguments, NodeWithArguments, NodeWithSimpleName, NodeWithOptionalScope, Resolvable { +public class MethodCallExpr extends Expression implements NodeWithTypeArguments, NodeWithArguments, NodeWithSimpleName, NodeWithOptionalScope, Resolvable { @OptionalProperty private Expression scope; @@ -64,36 +64,36 @@ public class MethodCallExpr extends Expression implements NodeWithTypeArguments private NodeList arguments; - public MethodCallExpr() { + public MethodCallExpr() { this(null, null, null, new SimpleName(), new NodeList<>()); } - public MethodCallExpr(String name, Expression... arguments) { + public MethodCallExpr(String name, Expression... arguments) { this(null, null, null, new SimpleName(name), new NodeList<>(arguments)); } - public MethodCallExpr(final Expression scope, final String name) { + public MethodCallExpr(final Expression scope, final String name) { this(null, scope, null, new SimpleName(name), new NodeList<>()); } - public MethodCallExpr(final Expression scope, final SimpleName name) { + public MethodCallExpr(final Expression scope, final SimpleName name) { this(null, scope, null, name, new NodeList<>()); } - public MethodCallExpr(final Expression scope, final String name, final NodeList arguments) { + public MethodCallExpr(final Expression scope, final String name, final NodeList arguments) { this(null, scope, null, new SimpleName(name), arguments); } - public MethodCallExpr(final Expression scope, final NodeList typeArguments, final String name, final NodeList arguments) { + public MethodCallExpr(final Expression scope, final NodeList typeArguments, final String name, final NodeList arguments) { this(null, scope, typeArguments, new SimpleName(name), arguments); } - public MethodCallExpr(final Expression scope, final SimpleName name, final NodeList arguments) { + public MethodCallExpr(final Expression scope, final SimpleName name, final NodeList arguments) { this(null, scope, null, name, arguments); } @AllFieldsConstructor - public MethodCallExpr(final Expression scope, final NodeList typeArguments, final SimpleName name, final NodeList arguments) { + public MethodCallExpr(final Expression scope, final NodeList typeArguments, final SimpleName name, final NodeList arguments) { this(null, scope, typeArguments, name, arguments); } @@ -101,7 +101,7 @@ public MethodCallExpr(final Expression scope, final NodeList typeArgument * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public MethodCallExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, SimpleName name, NodeList arguments) { + public MethodCallExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, SimpleName name, NodeList arguments) { super(tokenRange); setScope(scope); setTypeArguments(typeArguments); @@ -112,33 +112,33 @@ public MethodCallExpr(TokenRange tokenRange, Expression scope, NodeList t @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getArguments() { + public NodeList getArguments() { return arguments; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getScope() { + public Optional getScope() { return Optional.ofNullable(scope); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodCallExpr setArguments(final NodeList arguments) { + public MethodCallExpr setArguments(final NodeList arguments) { assertNotNull(arguments); if (arguments == this.arguments) { return this; @@ -152,7 +152,7 @@ public MethodCallExpr setArguments(final NodeList arguments) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodCallExpr setName(final SimpleName name) { + public MethodCallExpr setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -166,7 +166,7 @@ public MethodCallExpr setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodCallExpr setScope(final Expression scope) { + public MethodCallExpr setScope(final Expression scope) { if (scope == this.scope) { return this; } @@ -179,7 +179,7 @@ public MethodCallExpr setScope(final Expression scope) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -190,7 +190,7 @@ public Optional> getTypeArguments() { * @return this, the MethodCallExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodCallExpr setTypeArguments(final NodeList typeArguments) { + public MethodCallExpr setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -204,7 +204,7 @@ public MethodCallExpr setTypeArguments(final NodeList typeArguments) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -232,25 +232,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public MethodCallExpr removeScope() { + public MethodCallExpr removeScope() { return setScope((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public MethodCallExpr clone() { + public MethodCallExpr clone() { return (MethodCallExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public MethodCallExprMetaModel getMetaModel() { + public MethodCallExprMetaModel getMetaModel() { return JavaParserMetaModel.methodCallExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -283,19 +283,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodCallExpr() { + public boolean isMethodCallExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodCallExpr asMethodCallExpr() { + public MethodCallExpr asMethodCallExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodCallExpr(Consumer action) { + public void ifMethodCallExpr(Consumer action) { action.accept(this); } @@ -313,13 +313,13 @@ public void ifMethodCallExpr(Consumer action) { * @see ExplicitConstructorInvocationStmt#resolve() */ @Override - public ResolvedMethodDeclaration resolve() { + public ResolvedMethodDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedMethodDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodCallExpr() { + public Optional toMethodCallExpr() { return Optional.of(this); } @@ -333,7 +333,7 @@ public Optional toMethodCallExpr() { * Otherwise, the method invocation expression is a standalone expression. */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { // A method invocation expression is a poly expression if all of the following are true: // // 1. The invocation appears in an assignment context or an invocation context (§5.2, §5.3). diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodReferenceExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodReferenceExpr.java index a3dc4553a7..44ee7b1d0d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodReferenceExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/MethodReferenceExpr.java @@ -54,7 +54,7 @@ * * @author Raquel Pau */ -public class MethodReferenceExpr extends Expression implements NodeWithTypeArguments, NodeWithIdentifier, Resolvable { +public class MethodReferenceExpr extends Expression implements NodeWithTypeArguments, NodeWithIdentifier, Resolvable { private Expression scope; @@ -64,12 +64,12 @@ public class MethodReferenceExpr extends Expression implements NodeWithTypeArgu @NonEmptyProperty private String identifier; - public MethodReferenceExpr() { + public MethodReferenceExpr() { this(null, new ClassExpr(), null, "empty"); } @AllFieldsConstructor - public MethodReferenceExpr(Expression scope, NodeList typeArguments, String identifier) { + public MethodReferenceExpr(Expression scope, NodeList typeArguments, String identifier) { this(null, scope, typeArguments, identifier); } @@ -77,7 +77,7 @@ public MethodReferenceExpr(Expression scope, NodeList typeArguments, Stri * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public MethodReferenceExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, String identifier) { + public MethodReferenceExpr(TokenRange tokenRange, Expression scope, NodeList typeArguments, String identifier) { super(tokenRange); setScope(scope); setTypeArguments(typeArguments); @@ -87,23 +87,23 @@ public MethodReferenceExpr(TokenRange tokenRange, Expression scope, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getScope() { + public Expression getScope() { return scope; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodReferenceExpr setScope(final Expression scope) { + public MethodReferenceExpr setScope(final Expression scope) { assertNotNull(scope); if (scope == this.scope) { return this; @@ -117,7 +117,7 @@ public MethodReferenceExpr setScope(final Expression scope) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -128,7 +128,7 @@ public Optional> getTypeArguments() { * @return this, the MethodReferenceExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodReferenceExpr setTypeArguments(final NodeList typeArguments) { + public MethodReferenceExpr setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -141,12 +141,12 @@ public MethodReferenceExpr setTypeArguments(final NodeList typeArguments) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public String getIdentifier() { + public String getIdentifier() { return identifier; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodReferenceExpr setIdentifier(final String identifier) { + public MethodReferenceExpr setIdentifier(final String identifier) { assertNonEmpty(identifier); if (identifier == this.identifier) { return this; @@ -158,7 +158,7 @@ public MethodReferenceExpr setIdentifier(final String identifier) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -175,19 +175,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public MethodReferenceExpr clone() { + public MethodReferenceExpr clone() { return (MethodReferenceExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public MethodReferenceExprMetaModel getMetaModel() { + public MethodReferenceExprMetaModel getMetaModel() { return JavaParserMetaModel.methodReferenceExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -208,25 +208,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isMethodReferenceExpr() { + public boolean isMethodReferenceExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public MethodReferenceExpr asMethodReferenceExpr() { + public MethodReferenceExpr asMethodReferenceExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifMethodReferenceExpr(Consumer action) { + public void ifMethodReferenceExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toMethodReferenceExpr() { + public Optional toMethodReferenceExpr() { return Optional.of(this); } @@ -234,7 +234,7 @@ public Optional toMethodReferenceExpr() { * @return the method declaration this method reference is referencing. */ @Override - public ResolvedMethodDeclaration resolve() { + public ResolvedMethodDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedMethodDeclaration.class); } @@ -243,7 +243,7 @@ public ResolvedMethodDeclaration resolve() { * (https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html 15.13. Method Reference Expressions) */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { return true; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Name.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Name.java index 2ab78f988f..8e8bbd58eb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Name.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/Name.java @@ -48,7 +48,7 @@ * @author Julio Vilmar Gesser * @see SimpleName */ -public class Name extends Node implements NodeWithIdentifier { +public class Name extends Node implements NodeWithIdentifier { @NonEmptyProperty private String identifier; @@ -56,16 +56,16 @@ public class Name extends Node implements NodeWithIdentifier { @OptionalProperty private Name qualifier; - public Name() { + public Name() { this(null, null, "empty"); } - public Name(final String identifier) { + public Name(final String identifier) { this(null, null, identifier); } @AllFieldsConstructor - public Name(Name qualifier, final String identifier) { + public Name(Name qualifier, final String identifier) { this(null, qualifier, identifier); } @@ -73,7 +73,7 @@ public Name(Name qualifier, final String identifier) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Name(TokenRange tokenRange, Name qualifier, String identifier) { + public Name(TokenRange tokenRange, Name qualifier, String identifier) { super(tokenRange); setQualifier(qualifier); setIdentifier(identifier); @@ -82,23 +82,23 @@ public Name(TokenRange tokenRange, Name qualifier, String identifier) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public String getIdentifier() { + public String getIdentifier() { return identifier; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name setIdentifier(final String identifier) { + public Name setIdentifier(final String identifier) { assertNonEmpty(identifier); if (identifier == this.identifier) { return this; @@ -111,7 +111,7 @@ public Name setIdentifier(final String identifier) { /** * @return the complete qualified name. Only the identifiers and the dots, so no comments or whitespace. */ - public String asString() { + public String asString() { if (qualifier != null) { return qualifier.asString() + "." + identifier; } @@ -119,12 +119,12 @@ public String asString() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getQualifier() { + public Optional getQualifier() { return Optional.ofNullable(qualifier); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name setQualifier(final Name qualifier) { + public Name setQualifier(final Name qualifier) { if (qualifier == this.qualifier) { return this; } @@ -138,7 +138,7 @@ public Name setQualifier(final Name qualifier) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -152,25 +152,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public Name removeQualifier() { + public Name removeQualifier() { return setQualifier((Name) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Name clone() { + public Name clone() { return (Name) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public NameMetaModel getMetaModel() { + public NameMetaModel getMetaModel() { return JavaParserMetaModel.nameMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -186,14 +186,14 @@ public boolean replace(Node node, Node replacementNode) { /** * A top level name is a name that is not contained in a larger Name instance. */ - public boolean isTopLevel() { + public boolean isTopLevel() { return !isInternal(); } /** * An internal name is a name that constitutes a part of a larger Name instance. */ - public boolean isInternal() { + public boolean isInternal() { return getParentNode().filter(parent -> parent instanceof Name).isPresent(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NameExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NameExpr.java index 1872b2cabf..45da04afb7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NameExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NameExpr.java @@ -45,20 +45,20 @@ * * @author Julio Vilmar Gesser */ -public class NameExpr extends Expression implements NodeWithSimpleName, Resolvable { +public class NameExpr extends Expression implements NodeWithSimpleName, Resolvable { private SimpleName name; - public NameExpr() { + public NameExpr() { this(null, new SimpleName()); } - public NameExpr(final String name) { + public NameExpr(final String name) { this(null, new SimpleName(name)); } @AllFieldsConstructor - public NameExpr(final SimpleName name) { + public NameExpr(final SimpleName name) { this(name.getTokenRange().orElse(null), name); setRange(name.getRange().orElse(null)); } @@ -67,7 +67,7 @@ public NameExpr(final SimpleName name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public NameExpr(TokenRange tokenRange, SimpleName name) { + public NameExpr(TokenRange tokenRange, SimpleName name) { super(tokenRange); setName(name); customInitialization(); @@ -75,23 +75,23 @@ public NameExpr(TokenRange tokenRange, SimpleName name) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NameExpr setName(final SimpleName name) { + public NameExpr setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -106,19 +106,19 @@ public NameExpr setName(final SimpleName name) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public NameExpr clone() { + public NameExpr clone() { return (NameExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public NameExprMetaModel getMetaModel() { + public NameExprMetaModel getMetaModel() { return JavaParserMetaModel.nameExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -131,19 +131,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNameExpr() { + public boolean isNameExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NameExpr asNameExpr() { + public NameExpr asNameExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNameExpr(Consumer action) { + public void ifNameExpr(Consumer action) { action.accept(this); } @@ -160,13 +160,13 @@ public void ifNameExpr(Consumer action) { * @see ExplicitConstructorInvocationStmt#resolve() */ @Override - public ResolvedValueDeclaration resolve() { + public ResolvedValueDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedValueDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNameExpr() { + public Optional toNameExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NormalAnnotationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NormalAnnotationExpr.java index 9f29ed3004..9efeb610bb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NormalAnnotationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NormalAnnotationExpr.java @@ -40,16 +40,16 @@ * * @author Julio Vilmar Gesser */ -public class NormalAnnotationExpr extends AnnotationExpr { +public class NormalAnnotationExpr extends AnnotationExpr { private NodeList pairs; - public NormalAnnotationExpr() { + public NormalAnnotationExpr() { this(null, new Name(), new NodeList<>()); } @AllFieldsConstructor - public NormalAnnotationExpr(final Name name, final NodeList pairs) { + public NormalAnnotationExpr(final Name name, final NodeList pairs) { this(null, name, pairs); } @@ -57,7 +57,7 @@ public NormalAnnotationExpr(final Name name, final NodeList pa * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public NormalAnnotationExpr(TokenRange tokenRange, Name name, NodeList pairs) { + public NormalAnnotationExpr(TokenRange tokenRange, Name name, NodeList pairs) { super(tokenRange, name); setPairs(pairs); customInitialization(); @@ -65,23 +65,23 @@ public NormalAnnotationExpr(TokenRange tokenRange, Name name, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getPairs() { + public NodeList getPairs() { return pairs; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NormalAnnotationExpr setPairs(final NodeList pairs) { + public NormalAnnotationExpr setPairs(final NodeList pairs) { assertNotNull(pairs); if (pairs == this.pairs) { return this; @@ -99,7 +99,7 @@ public NormalAnnotationExpr setPairs(final NodeList pairs) { * * @return this, the {@link NormalAnnotationExpr} */ - public NormalAnnotationExpr addPair(String key, String value) { + public NormalAnnotationExpr addPair(String key, String value) { return addPair(key, new NameExpr(value)); } @@ -108,7 +108,7 @@ public NormalAnnotationExpr addPair(String key, String value) { * * @return this, the {@link NormalAnnotationExpr} */ - public NormalAnnotationExpr addPair(String key, Expression value) { + public NormalAnnotationExpr addPair(String key, Expression value) { MemberValuePair memberValuePair = new MemberValuePair(key, value); getPairs().add(memberValuePair); return this; @@ -116,7 +116,7 @@ public NormalAnnotationExpr addPair(String key, Expression value) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -131,19 +131,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public NormalAnnotationExpr clone() { + public NormalAnnotationExpr clone() { return (NormalAnnotationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public NormalAnnotationExprMetaModel getMetaModel() { + public NormalAnnotationExprMetaModel getMetaModel() { return JavaParserMetaModel.normalAnnotationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -158,25 +158,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNormalAnnotationExpr() { + public boolean isNormalAnnotationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NormalAnnotationExpr asNormalAnnotationExpr() { + public NormalAnnotationExpr asNormalAnnotationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNormalAnnotationExpr(Consumer action) { + public void ifNormalAnnotationExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNormalAnnotationExpr() { + public Optional toNormalAnnotationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NullLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NullLiteralExpr.java index 38da09c3a9..734c1bf963 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NullLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/NullLiteralExpr.java @@ -38,10 +38,10 @@ * * @author Julio Vilmar Gesser */ -public class NullLiteralExpr extends LiteralExpr { +public class NullLiteralExpr extends LiteralExpr { @AllFieldsConstructor - public NullLiteralExpr() { + public NullLiteralExpr() { this(null); } @@ -49,56 +49,56 @@ public NullLiteralExpr() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public NullLiteralExpr(TokenRange tokenRange) { + public NullLiteralExpr(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public NullLiteralExpr clone() { + public NullLiteralExpr clone() { return (NullLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public NullLiteralExprMetaModel getMetaModel() { + public NullLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.nullLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isNullLiteralExpr() { + public boolean isNullLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public NullLiteralExpr asNullLiteralExpr() { + public NullLiteralExpr asNullLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifNullLiteralExpr(Consumer action) { + public void ifNullLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toNullLiteralExpr() { + public Optional toNullLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ObjectCreationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ObjectCreationExpr.java index 421765a6fd..b604d8e3c7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ObjectCreationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ObjectCreationExpr.java @@ -57,7 +57,7 @@ * * @author Julio Vilmar Gesser */ -public class ObjectCreationExpr extends Expression implements NodeWithTypeArguments, NodeWithType, NodeWithArguments, NodeWithOptionalScope, Resolvable { +public class ObjectCreationExpr extends Expression implements NodeWithTypeArguments, NodeWithType, NodeWithArguments, NodeWithOptionalScope, Resolvable { @OptionalProperty private Expression scope; @@ -72,7 +72,7 @@ public class ObjectCreationExpr extends Expression implements NodeWithTypeArgum @OptionalProperty private NodeList> anonymousClassBody; - public ObjectCreationExpr() { + public ObjectCreationExpr() { this(null, null, new ClassOrInterfaceType(), new NodeList<>(), new NodeList<>(), null); } @@ -83,12 +83,12 @@ public ObjectCreationExpr() { * @param type this is the class that the constructor is being called for. * @param arguments Any arguments to pass to the constructor */ - public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList arguments) { + public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList arguments) { this(null, scope, type, null, arguments, null); } @AllFieldsConstructor - public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList typeArguments, final NodeList arguments, final NodeList> anonymousClassBody) { + public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType type, final NodeList typeArguments, final NodeList arguments, final NodeList> anonymousClassBody) { this(null, scope, type, typeArguments, arguments, anonymousClassBody); } @@ -96,7 +96,7 @@ public ObjectCreationExpr(final Expression scope, final ClassOrInterfaceType ty * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInterfaceType type, NodeList typeArguments, NodeList arguments, NodeList> anonymousClassBody) { + public ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInterfaceType type, NodeList typeArguments, NodeList arguments, NodeList> anonymousClassBody) { super(tokenRange); setScope(scope); setType(type); @@ -108,39 +108,39 @@ public ObjectCreationExpr(TokenRange tokenRange, Expression scope, ClassOrInter @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional>> getAnonymousClassBody() { + public Optional>> getAnonymousClassBody() { return Optional.ofNullable(anonymousClassBody); } - public void addAnonymousClassBody(BodyDeclaration body) { + public void addAnonymousClassBody(BodyDeclaration body) { if (anonymousClassBody == null) anonymousClassBody = new NodeList<>(); anonymousClassBody.add(body); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getArguments() { + public NodeList getArguments() { return arguments; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getScope() { + public Optional getScope() { return Optional.ofNullable(scope); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceType getType() { + public ClassOrInterfaceType getType() { return type; } @@ -153,7 +153,7 @@ public ClassOrInterfaceType getType() { * @return this, the ObjectCreationExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ObjectCreationExpr setAnonymousClassBody(final NodeList> anonymousClassBody) { + public ObjectCreationExpr setAnonymousClassBody(final NodeList> anonymousClassBody) { if (anonymousClassBody == this.anonymousClassBody) { return this; } @@ -166,7 +166,7 @@ public ObjectCreationExpr setAnonymousClassBody(final NodeList arguments) { + public ObjectCreationExpr setArguments(final NodeList arguments) { assertNotNull(arguments); if (arguments == this.arguments) { return this; @@ -186,7 +186,7 @@ public ObjectCreationExpr setArguments(final NodeList arguments) { * @return this, the ObjectCreationExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ObjectCreationExpr setScope(final Expression scope) { + public ObjectCreationExpr setScope(final Expression scope) { if (scope == this.scope) { return this; } @@ -199,7 +199,7 @@ public ObjectCreationExpr setScope(final Expression scope) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ObjectCreationExpr setType(final ClassOrInterfaceType type) { + public ObjectCreationExpr setType(final ClassOrInterfaceType type) { assertNotNull(type); if (type == this.type) { return this; @@ -213,7 +213,7 @@ public ObjectCreationExpr setType(final ClassOrInterfaceType type) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -224,7 +224,7 @@ public Optional> getTypeArguments() { * @return this, the ObjectCreationExpr */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ObjectCreationExpr setTypeArguments(final NodeList typeArguments) { + public ObjectCreationExpr setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -238,7 +238,7 @@ public ObjectCreationExpr setTypeArguments(final NodeList typeArguments) @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -274,25 +274,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ObjectCreationExpr removeScope() { + public ObjectCreationExpr removeScope() { return setScope((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ObjectCreationExpr clone() { + public ObjectCreationExpr clone() { return (ObjectCreationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ObjectCreationExprMetaModel getMetaModel() { + public ObjectCreationExprMetaModel getMetaModel() { return JavaParserMetaModel.objectCreationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -333,19 +333,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isObjectCreationExpr() { + public boolean isObjectCreationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ObjectCreationExpr asObjectCreationExpr() { + public ObjectCreationExpr asObjectCreationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifObjectCreationExpr(Consumer action) { + public void ifObjectCreationExpr(Consumer action) { action.accept(this); } @@ -363,13 +363,13 @@ public void ifObjectCreationExpr(Consumer action) { * @see ExplicitConstructorInvocationStmt#resolve() */ @Override - public ResolvedConstructorDeclaration resolve() { + public ResolvedConstructorDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedConstructorDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toObjectCreationExpr() { + public Optional toObjectCreationExpr() { return Optional.of(this); } @@ -379,7 +379,7 @@ public Optional toObjectCreationExpr() { * Otherwise, it is a standalone expression. */ @Override - public boolean isPolyExpression() { + public boolean isPolyExpression() { return isUsingDiamondOperator() && (appearsInInvocationContext() || appearsInAssignmentContext()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/PatternExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/PatternExpr.java index 41985711c9..a86503f535 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/PatternExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/PatternExpr.java @@ -74,42 +74,42 @@ public abstract class PatternExpr extends Expression implements NodeWithType toPatternExpr() { + public Optional toPatternExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifPatternExpr(Consumer action) { + public void ifPatternExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public PatternExpr clone() { + public PatternExpr clone() { return (PatternExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public PatternExprMetaModel getMetaModel() { + public PatternExprMetaModel getMetaModel() { return JavaParserMetaModel.patternExprMetaModel; } @@ -117,13 +117,13 @@ public PatternExprMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public PatternExpr(TokenRange tokenRange) { + public PatternExpr(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public PatternExpr setType(final Type type) { + public PatternExpr setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -141,13 +141,13 @@ public PatternExpr setType(final Type type) { * can also have primitive types. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -162,7 +162,7 @@ public boolean replace(Node node, Node replacementNode) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public PatternExpr(TokenRange tokenRange, Type type) { + public PatternExpr(TokenRange tokenRange, Type type) { super(tokenRange); setType(type); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/RecordPatternExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/RecordPatternExpr.java index 5f5423a09d..5b48ba7f87 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/RecordPatternExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/RecordPatternExpr.java @@ -75,18 +75,18 @@ * @see com.github.javaparser.ast.expr.TypePatternExpr * @see JEP 440: Record Patterns */ -public class RecordPatternExpr extends PatternExpr implements NodeWithFinalModifier { +public class RecordPatternExpr extends PatternExpr implements NodeWithFinalModifier { private NodeList modifiers; private NodeList patternList; - public RecordPatternExpr() { + public RecordPatternExpr() { this(new NodeList<>(), new ClassOrInterfaceType(), new NodeList<>()); } @AllFieldsConstructor - public RecordPatternExpr(final NodeList modifiers, final Type type, final NodeList patternList) { + public RecordPatternExpr(final NodeList modifiers, final Type type, final NodeList patternList) { this(null, modifiers, type, patternList); } @@ -95,29 +95,29 @@ public RecordPatternExpr(final NodeList modifiers, final Type type, f * types. */ @Override - public ReferenceType getType() { + public ReferenceType getType() { return super.getType().asReferenceType(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordPatternExpr setModifiers(final NodeList modifiers) { + public RecordPatternExpr setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -132,35 +132,35 @@ public RecordPatternExpr setModifiers(final NodeList modifiers) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isRecordPatternExpr() { + public boolean isRecordPatternExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public RecordPatternExpr asRecordPatternExpr() { + public RecordPatternExpr asRecordPatternExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toRecordPatternExpr() { + public Optional toRecordPatternExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifRecordPatternExpr(Consumer action) { + public void ifRecordPatternExpr(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getPatternList() { + public NodeList getPatternList() { return patternList; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordPatternExpr setPatternList(final NodeList patternList) { + public RecordPatternExpr setPatternList(final NodeList patternList) { assertNotNull(patternList); if (patternList == this.patternList) { return this; @@ -175,7 +175,7 @@ public RecordPatternExpr setPatternList(final NodeList patternList @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -196,7 +196,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -217,13 +217,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public RecordPatternExpr clone() { + public RecordPatternExpr clone() { return (RecordPatternExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public RecordPatternExprMetaModel getMetaModel() { + public RecordPatternExprMetaModel getMetaModel() { return JavaParserMetaModel.recordPatternExprMetaModel; } @@ -231,7 +231,7 @@ public RecordPatternExprMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public RecordPatternExpr(TokenRange tokenRange, NodeList modifiers, Type type, NodeList patternList) { + public RecordPatternExpr(TokenRange tokenRange, NodeList modifiers, Type type, NodeList patternList) { super(tokenRange, type); setModifiers(modifiers); setPatternList(patternList); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SimpleName.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SimpleName.java index 23e66580cf..3cfda1cd9b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SimpleName.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SimpleName.java @@ -40,17 +40,17 @@ * * @see Name */ -public class SimpleName extends Node implements NodeWithIdentifier { +public class SimpleName extends Node implements NodeWithIdentifier { @NonEmptyProperty private String identifier; - public SimpleName() { + public SimpleName() { this(null, "empty"); } @AllFieldsConstructor - public SimpleName(final String identifier) { + public SimpleName(final String identifier) { this(null, identifier); } @@ -58,7 +58,7 @@ public SimpleName(final String identifier) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SimpleName(TokenRange tokenRange, String identifier) { + public SimpleName(TokenRange tokenRange, String identifier) { super(tokenRange); setIdentifier(identifier); customInitialization(); @@ -66,23 +66,23 @@ public SimpleName(TokenRange tokenRange, String identifier) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public String getIdentifier() { + public String getIdentifier() { return identifier; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName setIdentifier(final String identifier) { + public SimpleName setIdentifier(final String identifier) { assertNonEmpty(identifier); if (identifier == this.identifier) { return this; @@ -92,19 +92,19 @@ public SimpleName setIdentifier(final String identifier) { return this; } - public String asString() { + public String asString() { return identifier; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SimpleName clone() { + public SimpleName clone() { return (SimpleName) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SimpleNameMetaModel getMetaModel() { + public SimpleNameMetaModel getMetaModel() { return JavaParserMetaModel.simpleNameMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java index 99fdbef8ff..aadcae9efc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SingleMemberAnnotationExpr.java @@ -39,16 +39,16 @@ * * @author Julio Vilmar Gesser */ -public class SingleMemberAnnotationExpr extends AnnotationExpr { +public class SingleMemberAnnotationExpr extends AnnotationExpr { private Expression memberValue; - public SingleMemberAnnotationExpr() { + public SingleMemberAnnotationExpr() { this(null, new Name(), new StringLiteralExpr()); } @AllFieldsConstructor - public SingleMemberAnnotationExpr(final Name name, final Expression memberValue) { + public SingleMemberAnnotationExpr(final Name name, final Expression memberValue) { this(null, name, memberValue); } @@ -56,7 +56,7 @@ public SingleMemberAnnotationExpr(final Name name, final Expression memberValue * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SingleMemberAnnotationExpr(TokenRange tokenRange, Name name, Expression memberValue) { + public SingleMemberAnnotationExpr(TokenRange tokenRange, Name name, Expression memberValue) { super(tokenRange, name); setMemberValue(memberValue); customInitialization(); @@ -64,23 +64,23 @@ public SingleMemberAnnotationExpr(TokenRange tokenRange, Name name, Expression @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getMemberValue() { + public Expression getMemberValue() { return memberValue; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SingleMemberAnnotationExpr setMemberValue(final Expression memberValue) { + public SingleMemberAnnotationExpr setMemberValue(final Expression memberValue) { assertNotNull(memberValue); if (memberValue == this.memberValue) { return this; @@ -95,19 +95,19 @@ public SingleMemberAnnotationExpr setMemberValue(final Expression memberValue) @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SingleMemberAnnotationExpr clone() { + public SingleMemberAnnotationExpr clone() { return (SingleMemberAnnotationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SingleMemberAnnotationExprMetaModel getMetaModel() { + public SingleMemberAnnotationExprMetaModel getMetaModel() { return JavaParserMetaModel.singleMemberAnnotationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -120,25 +120,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSingleMemberAnnotationExpr() { + public boolean isSingleMemberAnnotationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SingleMemberAnnotationExpr asSingleMemberAnnotationExpr() { + public SingleMemberAnnotationExpr asSingleMemberAnnotationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSingleMemberAnnotationExpr(Consumer action) { + public void ifSingleMemberAnnotationExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSingleMemberAnnotationExpr() { + public Optional toSingleMemberAnnotationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/StringLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/StringLiteralExpr.java index 9f02f7dac0..6ed57c29fb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/StringLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/StringLiteralExpr.java @@ -45,9 +45,9 @@ * * @author Julio Vilmar Gesser */ -public class StringLiteralExpr extends LiteralStringValueExpr { +public class StringLiteralExpr extends LiteralStringValueExpr { - public StringLiteralExpr() { + public StringLiteralExpr() { this(null, "empty"); } @@ -57,7 +57,7 @@ public StringLiteralExpr() { * @param value the value of the literal */ @AllFieldsConstructor - public StringLiteralExpr(final String value) { + public StringLiteralExpr(final String value) { this(null, Utils.escapeEndOfLines(value)); } @@ -65,20 +65,20 @@ public StringLiteralExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public StringLiteralExpr(TokenRange tokenRange, String value) { + public StringLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -88,7 +88,7 @@ public void accept(final VoidVisitor v, final A arg) { * @param value the new literal value * @return self */ - public StringLiteralExpr setEscapedValue(String value) { + public StringLiteralExpr setEscapedValue(String value) { this.value = Utils.escapeEndOfLines(value); return this; } @@ -96,7 +96,7 @@ public StringLiteralExpr setEscapedValue(String value) { /** * @return the unescaped literal value */ - public String asString() { + public String asString() { return unescapeJava(value); } @@ -106,44 +106,44 @@ public String asString() { * @param value unescaped string * @return this literal expression */ - public StringLiteralExpr setString(String value) { + public StringLiteralExpr setString(String value) { this.value = escapeJava(value); return this; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public StringLiteralExpr clone() { + public StringLiteralExpr clone() { return (StringLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public StringLiteralExprMetaModel getMetaModel() { + public StringLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.stringLiteralExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isStringLiteralExpr() { + public boolean isStringLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public StringLiteralExpr asStringLiteralExpr() { + public StringLiteralExpr asStringLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifStringLiteralExpr(Consumer action) { + public void ifStringLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toStringLiteralExpr() { + public Optional toStringLiteralExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SuperExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SuperExpr.java index 270a8140d1..865811ba14 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SuperExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SuperExpr.java @@ -45,17 +45,17 @@ * @see com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt * @see ThisExpr */ -public class SuperExpr extends Expression { +public class SuperExpr extends Expression { @OptionalProperty private Name typeName; - public SuperExpr() { + public SuperExpr() { this(null, null); } @AllFieldsConstructor - public SuperExpr(final Name typeName) { + public SuperExpr(final Name typeName) { this(null, typeName); } @@ -63,7 +63,7 @@ public SuperExpr(final Name typeName) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SuperExpr(TokenRange tokenRange, Name typeName) { + public SuperExpr(TokenRange tokenRange, Name typeName) { super(tokenRange); setTypeName(typeName); customInitialization(); @@ -71,23 +71,23 @@ public SuperExpr(TokenRange tokenRange, Name typeName) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getTypeName() { + public Optional getTypeName() { return Optional.ofNullable(typeName); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SuperExpr setTypeName(final Name typeName) { + public SuperExpr setTypeName(final Name typeName) { if (typeName == this.typeName) { return this; } @@ -101,7 +101,7 @@ public SuperExpr setTypeName(final Name typeName) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -116,48 +116,48 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SuperExpr clone() { + public SuperExpr clone() { return (SuperExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SuperExprMetaModel getMetaModel() { + public SuperExprMetaModel getMetaModel() { return JavaParserMetaModel.superExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSuperExpr() { + public boolean isSuperExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SuperExpr asSuperExpr() { + public SuperExpr asSuperExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSuperExpr(Consumer action) { + public void ifSuperExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSuperExpr() { + public Optional toSuperExpr() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public SuperExpr removeClassName() { + public SuperExpr removeClassName() { return setTypeName(null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -171,7 +171,7 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public SuperExpr removeTypeName() { + public SuperExpr removeTypeName() { return setTypeName((Name) null); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SwitchExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SwitchExpr.java index 7cfbde3fcd..bf659c6cfc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SwitchExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/SwitchExpr.java @@ -57,18 +57,18 @@ * @see com.github.javaparser.ast.stmt.BreakStmt * @see com.github.javaparser.ast.stmt.YieldStmt */ -public class SwitchExpr extends Expression implements SwitchNode { +public class SwitchExpr extends Expression implements SwitchNode { private Expression selector; private NodeList entries; - public SwitchExpr() { + public SwitchExpr() { this(null, new NameExpr(), new NodeList<>()); } @AllFieldsConstructor - public SwitchExpr(final Expression selector, final NodeList entries) { + public SwitchExpr(final Expression selector, final NodeList entries) { this(null, selector, entries); } @@ -76,7 +76,7 @@ public SwitchExpr(final Expression selector, final NodeList entrie * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SwitchExpr(TokenRange tokenRange, Expression selector, NodeList entries) { + public SwitchExpr(TokenRange tokenRange, Expression selector, NodeList entries) { super(tokenRange); setSelector(selector); setEntries(entries); @@ -85,32 +85,32 @@ public SwitchExpr(TokenRange tokenRange, Expression selector, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getEntries() { + public NodeList getEntries() { return entries; } - public SwitchEntry getEntry(int i) { + public SwitchEntry getEntry(int i) { return getEntries().get(i); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getSelector() { + public Expression getSelector() { return selector; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchExpr setEntries(final NodeList entries) { + public SwitchExpr setEntries(final NodeList entries) { assertNotNull(entries); if (entries == this.entries) { return this; @@ -124,7 +124,7 @@ public SwitchExpr setEntries(final NodeList entries) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchExpr setSelector(final Expression selector) { + public SwitchExpr setSelector(final Expression selector) { assertNotNull(selector); if (selector == this.selector) { return this; @@ -139,7 +139,7 @@ public SwitchExpr setSelector(final Expression selector) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -154,13 +154,13 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SwitchExpr clone() { + public SwitchExpr clone() { return (SwitchExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -179,31 +179,31 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSwitchExpr() { + public boolean isSwitchExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SwitchExpr asSwitchExpr() { + public SwitchExpr asSwitchExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSwitchExpr() { + public Optional toSwitchExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSwitchExpr(Consumer action) { + public void ifSwitchExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SwitchExprMetaModel getMetaModel() { + public SwitchExprMetaModel getMetaModel() { return JavaParserMetaModel.switchExprMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TextBlockLiteralExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TextBlockLiteralExpr.java index 70a863662c..0a130d88d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TextBlockLiteralExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TextBlockLiteralExpr.java @@ -44,9 +44,9 @@ * A text block is a multi-line string. It was introduced in JEP 355. * The content of "value" is byte-for-byte exactly what is in the source code. */ -public class TextBlockLiteralExpr extends LiteralStringValueExpr { +public class TextBlockLiteralExpr extends LiteralStringValueExpr { - public TextBlockLiteralExpr() { + public TextBlockLiteralExpr() { this(null, "empty"); } @@ -56,7 +56,7 @@ public TextBlockLiteralExpr() { * @param value the value of the literal */ @AllFieldsConstructor - public TextBlockLiteralExpr(final String value) { + public TextBlockLiteralExpr(final String value) { this(null, value); } @@ -64,56 +64,56 @@ public TextBlockLiteralExpr(final String value) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TextBlockLiteralExpr(TokenRange tokenRange, String value) { + public TextBlockLiteralExpr(TokenRange tokenRange, String value) { super(tokenRange, value); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTextBlockLiteralExpr() { + public boolean isTextBlockLiteralExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TextBlockLiteralExpr asTextBlockLiteralExpr() { + public TextBlockLiteralExpr asTextBlockLiteralExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTextBlockLiteralExpr() { + public Optional toTextBlockLiteralExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTextBlockLiteralExpr(Consumer action) { + public void ifTextBlockLiteralExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TextBlockLiteralExpr clone() { + public TextBlockLiteralExpr clone() { return (TextBlockLiteralExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TextBlockLiteralExprMetaModel getMetaModel() { + public TextBlockLiteralExprMetaModel getMetaModel() { return JavaParserMetaModel.textBlockLiteralExprMetaModel; } @@ -121,7 +121,7 @@ public TextBlockLiteralExprMetaModel getMetaModel() { * Most of the algorithm for stripIndent, stopping just before concatenating all the lines into a single string. * Useful for tools. */ - public Stream stripIndentOfLines() { + public Stream stripIndentOfLines() { /* Split the content of the text block at every LF, producing a list of individual lines. Note that any line in the content which was just an LF will become an empty line in the list of individual lines. */ String[] rawLines = getValue().split("\\R", -1); @@ -141,7 +141,7 @@ public Stream stripIndentOfLines() { /** * @return The algorithm from String::stripIndent in JDK 13. */ - public String stripIndent() { + public String stripIndent() { /* Construct the result string by joining all the lines in the modified list of individual lines from step 6, using LF as the separator between lines. If the final line in the list from step 6 is empty, then the joining LF from the previous line will be the last character in the result string. */ return stripIndentOfLines().collect(joining("\n")); @@ -150,14 +150,14 @@ public String stripIndent() { /** * @return The algorithm from String::translateEscapes in JDK 13. */ - public String translateEscapes() { + public String translateEscapes() { return unescapeJavaTextBlock(stripIndent()); } /** * @return the final string value of this text block after all processing. */ - public String asString() { + public String asString() { return translateEscapes(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ThisExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ThisExpr.java index c4720a3c24..91194b6cae 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ThisExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/ThisExpr.java @@ -47,17 +47,17 @@ * @see com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt * @see SuperExpr */ -public class ThisExpr extends Expression implements Resolvable { +public class ThisExpr extends Expression implements Resolvable { @OptionalProperty private Name typeName; - public ThisExpr() { + public ThisExpr() { this(null, null); } @AllFieldsConstructor - public ThisExpr(final Name typeName) { + public ThisExpr(final Name typeName) { this(null, typeName); } @@ -65,7 +65,7 @@ public ThisExpr(final Name typeName) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ThisExpr(TokenRange tokenRange, Name typeName) { + public ThisExpr(TokenRange tokenRange, Name typeName) { super(tokenRange); setTypeName(typeName); customInitialization(); @@ -73,23 +73,23 @@ public ThisExpr(TokenRange tokenRange, Name typeName) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getTypeName() { + public Optional getTypeName() { return Optional.ofNullable(typeName); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ThisExpr setTypeName(final Name typeName) { + public ThisExpr setTypeName(final Name typeName) { if (typeName == this.typeName) { return this; } @@ -103,7 +103,7 @@ public ThisExpr setTypeName(final Name typeName) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -117,25 +117,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ThisExpr removeClassName() { + public ThisExpr removeClassName() { return setTypeName(null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ThisExpr clone() { + public ThisExpr clone() { return (ThisExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ThisExprMetaModel getMetaModel() { + public ThisExprMetaModel getMetaModel() { return JavaParserMetaModel.thisExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -150,35 +150,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isThisExpr() { + public boolean isThisExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ThisExpr asThisExpr() { + public ThisExpr asThisExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifThisExpr(Consumer action) { + public void ifThisExpr(Consumer action) { action.accept(this); } @Override - public ResolvedTypeDeclaration resolve() { + public ResolvedTypeDeclaration resolve() { return getSymbolResolver().resolveDeclaration(this, ResolvedTypeDeclaration.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toThisExpr() { + public Optional toThisExpr() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ThisExpr removeTypeName() { + public ThisExpr removeTypeName() { return setTypeName((Name) null); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypeExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypeExpr.java index cfd2d11604..a5fdcecd65 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypeExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypeExpr.java @@ -44,16 +44,16 @@ * * @author Raquel Pau */ -public class TypeExpr extends Expression implements NodeWithType { +public class TypeExpr extends Expression implements NodeWithType { private Type type; - public TypeExpr() { + public TypeExpr() { this(null, new ClassOrInterfaceType()); } @AllFieldsConstructor - public TypeExpr(Type type) { + public TypeExpr(Type type) { this(null, type); } @@ -61,7 +61,7 @@ public TypeExpr(Type type) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TypeExpr(TokenRange tokenRange, Type type) { + public TypeExpr(TokenRange tokenRange, Type type) { super(tokenRange); setType(type); customInitialization(); @@ -69,23 +69,23 @@ public TypeExpr(TokenRange tokenRange, Type type) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TypeExpr setType(final Type type) { + public TypeExpr setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -100,19 +100,19 @@ public TypeExpr setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TypeExpr clone() { + public TypeExpr clone() { return (TypeExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TypeExprMetaModel getMetaModel() { + public TypeExprMetaModel getMetaModel() { return JavaParserMetaModel.typeExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -125,25 +125,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeExpr() { + public boolean isTypeExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeExpr asTypeExpr() { + public TypeExpr asTypeExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeExpr(Consumer action) { + public void ifTypeExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeExpr() { + public Optional toTypeExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypePatternExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypePatternExpr.java index ca93d23c7f..a6e4ad8467 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypePatternExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/TypePatternExpr.java @@ -70,18 +70,18 @@ * @see JEP305: https://bugs.openjdk.java.net/browse/JDK-8181287 * @see https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.20 */ -public class TypePatternExpr extends PatternExpr implements NodeWithSimpleName, NodeWithFinalModifier { +public class TypePatternExpr extends PatternExpr implements NodeWithSimpleName, NodeWithFinalModifier { private NodeList modifiers; private SimpleName name; - public TypePatternExpr() { + public TypePatternExpr() { this(null, new NodeList<>(), new ClassOrInterfaceType(), new SimpleName()); } @AllFieldsConstructor - public TypePatternExpr(final NodeList modifiers, final Type type, SimpleName name) { + public TypePatternExpr(final NodeList modifiers, final Type type, SimpleName name) { this(null, modifiers, type, name); } @@ -89,7 +89,7 @@ public TypePatternExpr(final NodeList modifiers, final Type type, Sim * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TypePatternExpr(TokenRange tokenRange, NodeList modifiers, Type type, SimpleName name) { + public TypePatternExpr(TokenRange tokenRange, NodeList modifiers, Type type, SimpleName name) { super(tokenRange, type); setModifiers(modifiers); setName(name); @@ -98,23 +98,23 @@ public TypePatternExpr(TokenRange tokenRange, NodeList modifiers, Typ @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TypePatternExpr setName(final SimpleName name) { + public TypePatternExpr setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -129,7 +129,7 @@ public TypePatternExpr setName(final SimpleName name) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -148,23 +148,23 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TypePatternExpr clone() { + public TypePatternExpr clone() { return (TypePatternExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TypePatternExprMetaModel getMetaModel() { + public TypePatternExprMetaModel getMetaModel() { return JavaParserMetaModel.typePatternExprMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TypePatternExpr setModifiers(final NodeList modifiers) { + public TypePatternExpr setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -179,7 +179,7 @@ public TypePatternExpr setModifiers(final NodeList modifiers) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -194,25 +194,25 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypePatternExpr() { + public boolean isTypePatternExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypePatternExpr asTypePatternExpr() { + public TypePatternExpr asTypePatternExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypePatternExpr() { + public Optional toTypePatternExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypePatternExpr(Consumer action) { + public void ifTypePatternExpr(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/UnaryExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/UnaryExpr.java index cd17e4abf2..d0560d0460 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/UnaryExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/UnaryExpr.java @@ -47,9 +47,9 @@ * * @author Julio Vilmar Gesser */ -public class UnaryExpr extends Expression implements NodeWithExpression { +public class UnaryExpr extends Expression implements NodeWithExpression { - public enum Operator implements Stringable { + public enum Operator implements Stringable { PLUS("+", false), MINUS("-", false), @@ -69,15 +69,15 @@ public enum Operator implements Stringable { this.isPostfix = isPostfix; } - public String asString() { + public String asString() { return codeRepresentation; } - public boolean isPostfix() { + public boolean isPostfix() { return isPostfix; } - public boolean isPrefix() { + public boolean isPrefix() { return !isPostfix(); } } @@ -86,12 +86,12 @@ public boolean isPrefix() { private Operator operator; - public UnaryExpr() { + public UnaryExpr() { this(null, new IntegerLiteralExpr(), Operator.POSTFIX_INCREMENT); } @AllFieldsConstructor - public UnaryExpr(final Expression expression, final Operator operator) { + public UnaryExpr(final Expression expression, final Operator operator) { this(null, expression, operator); } @@ -99,7 +99,7 @@ public UnaryExpr(final Expression expression, final Operator operator) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public UnaryExpr(TokenRange tokenRange, Expression expression, Operator operator) { + public UnaryExpr(TokenRange tokenRange, Expression expression, Operator operator) { super(tokenRange); setExpression(expression); setOperator(operator); @@ -108,28 +108,28 @@ public UnaryExpr(TokenRange tokenRange, Expression expression, Operator operato @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Operator getOperator() { + public Operator getOperator() { return operator; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public UnaryExpr setExpression(final Expression expression) { + public UnaryExpr setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -143,7 +143,7 @@ public UnaryExpr setExpression(final Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public UnaryExpr setOperator(final Operator operator) { + public UnaryExpr setOperator(final Operator operator) { assertNotNull(operator); if (operator == this.operator) { return this; @@ -154,30 +154,30 @@ public UnaryExpr setOperator(final Operator operator) { } @DerivedProperty - public boolean isPostfix() { + public boolean isPostfix() { return operator.isPostfix(); } @DerivedProperty - public boolean isPrefix() { + public boolean isPrefix() { return !isPostfix(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public UnaryExpr clone() { + public UnaryExpr clone() { return (UnaryExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public UnaryExprMetaModel getMetaModel() { + public UnaryExprMetaModel getMetaModel() { return JavaParserMetaModel.unaryExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -190,25 +190,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnaryExpr() { + public boolean isUnaryExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnaryExpr asUnaryExpr() { + public UnaryExpr asUnaryExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnaryExpr(Consumer action) { + public void ifUnaryExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnaryExpr() { + public Optional toUnaryExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/VariableDeclarationExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/VariableDeclarationExpr.java index 5d811645aa..e64967cf7f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/expr/VariableDeclarationExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/expr/VariableDeclarationExpr.java @@ -52,7 +52,7 @@ * * @author Julio Vilmar Gesser */ -public class VariableDeclarationExpr extends Expression implements NodeWithFinalModifier, NodeWithAnnotations, NodeWithVariables { +public class VariableDeclarationExpr extends Expression implements NodeWithFinalModifier, NodeWithAnnotations, NodeWithVariables { private NodeList modifiers; @@ -61,36 +61,36 @@ public class VariableDeclarationExpr extends Expression implements NodeWithFina @NonEmptyProperty private NodeList variables; - public VariableDeclarationExpr() { + public VariableDeclarationExpr() { this(null, new NodeList<>(), new NodeList<>(), new NodeList<>()); } - public VariableDeclarationExpr(final Type type, String variableName) { + public VariableDeclarationExpr(final Type type, String variableName) { this(null, new NodeList<>(), new NodeList<>(), nodeList(new VariableDeclarator(type, variableName))); } - public VariableDeclarationExpr(VariableDeclarator var) { + public VariableDeclarationExpr(VariableDeclarator var) { this(null, new NodeList<>(), new NodeList<>(), nodeList(var)); } - public VariableDeclarationExpr(final Type type, String variableName, Modifier... modifiers) { + public VariableDeclarationExpr(final Type type, String variableName, Modifier... modifiers) { this(null, Arrays.stream(modifiers).collect(Collectors.toCollection(() -> new NodeList<>())), new NodeList<>(), nodeList(new VariableDeclarator(type, variableName))); } - public VariableDeclarationExpr(VariableDeclarator var, Modifier... modifiers) { + public VariableDeclarationExpr(VariableDeclarator var, Modifier... modifiers) { this(null, Arrays.stream(modifiers).collect(Collectors.toCollection(() -> new NodeList<>())), new NodeList<>(), nodeList(var)); } - public VariableDeclarationExpr(final NodeList variables) { + public VariableDeclarationExpr(final NodeList variables) { this(null, new NodeList<>(), new NodeList<>(), variables); } - public VariableDeclarationExpr(final NodeList modifiers, final NodeList variables) { + public VariableDeclarationExpr(final NodeList modifiers, final NodeList variables) { this(null, modifiers, new NodeList<>(), variables); } @AllFieldsConstructor - public VariableDeclarationExpr(final NodeList modifiers, final NodeList annotations, final NodeList variables) { + public VariableDeclarationExpr(final NodeList modifiers, final NodeList annotations, final NodeList variables) { this(null, modifiers, annotations, variables); } @@ -98,7 +98,7 @@ public VariableDeclarationExpr(final NodeList modifiers, final NodeLi * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public VariableDeclarationExpr(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList variables) { + public VariableDeclarationExpr(TokenRange tokenRange, NodeList modifiers, NodeList annotations, NodeList variables) { super(tokenRange); setModifiers(modifiers); setAnnotations(annotations); @@ -108,18 +108,18 @@ public VariableDeclarationExpr(TokenRange tokenRange, NodeList modifi @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @@ -130,17 +130,17 @@ public NodeList getAnnotations() { * @see Modifier */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getVariables() { + public NodeList getVariables() { return variables; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr setAnnotations(final NodeList annotations) { + public VariableDeclarationExpr setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -154,7 +154,7 @@ public VariableDeclarationExpr setAnnotations(final NodeList an } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr setModifiers(final NodeList modifiers) { + public VariableDeclarationExpr setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -168,7 +168,7 @@ public VariableDeclarationExpr setModifiers(final NodeList modifiers) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr setVariables(final NodeList variables) { + public VariableDeclarationExpr setVariables(final NodeList variables) { assertNotNull(variables); if (variables == this.variables) { return this; @@ -183,7 +183,7 @@ public VariableDeclarationExpr setVariables(final NodeList @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -210,19 +210,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public VariableDeclarationExpr clone() { + public VariableDeclarationExpr clone() { return (VariableDeclarationExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public VariableDeclarationExprMetaModel getMetaModel() { + public VariableDeclarationExprMetaModel getMetaModel() { return JavaParserMetaModel.variableDeclarationExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -249,25 +249,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVariableDeclarationExpr() { + public boolean isVariableDeclarationExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VariableDeclarationExpr asVariableDeclarationExpr() { + public VariableDeclarationExpr asVariableDeclarationExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVariableDeclarationExpr(Consumer action) { + public void ifVariableDeclarationExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVariableDeclarationExpr() { + public Optional toVariableDeclarationExpr() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/ArbitraryNodeContainer.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/ArbitraryNodeContainer.java index 62362b0640..9451af007e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/ArbitraryNodeContainer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/ArbitraryNodeContainer.java @@ -11,33 +11,33 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class ArbitraryNodeContainer extends Node { +public class ArbitraryNodeContainer extends Node { private NodeList children; - public ArbitraryNodeContainer() { + public ArbitraryNodeContainer() { this(new NodeList<>()); } - public ArbitraryNodeContainer(NodeList children) { + public ArbitraryNodeContainer(NodeList children) { super(null); this.children = children; } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { return null; } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { } - public NodeList getChildren() { + public NodeList getChildren() { return children; } - public void setChildren(NodeList children) { + public void setChildren(NodeList children) { this.children = children; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/DefaultJmlContainer.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/DefaultJmlContainer.java index bb16bc31d1..a0b0ae2bb6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/DefaultJmlContainer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/DefaultJmlContainer.java @@ -8,35 +8,35 @@ * @author Alexander Weigl * @version 1 (3/21/21) */ -public class DefaultJmlContainer implements JmlContainer { +public class DefaultJmlContainer implements JmlContainer { @Override - public NodeList getElements() { + public NodeList getElements() { return null; } @Override - public Node setElements(NodeList elements) { + public Node setElements(NodeList elements) { return null; } @Override - public NodeList getJmlTags() { + public NodeList getJmlTags() { return null; } @Override - public boolean isSingleLine() { + public boolean isSingleLine() { return false; } @Override - public Node setSingleLine(boolean singleLine) { + public Node setSingleLine(boolean singleLine) { return null; } @Override - public Node setJmlTags(NodeList jmlTags) { + public Node setJmlTags(NodeList jmlTags) { return null; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/HasJmlTags.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/HasJmlTags.java index 1da674e16a..6a498bdac7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/HasJmlTags.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/HasJmlTags.java @@ -8,7 +8,7 @@ * @author Alexander Weigl * @version 1 (9/8/21) */ -public interface HasJmlTags { +public interface HasJmlTags { N setJmlTags(NodeList jmlTags); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlContainer.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlContainer.java index fd600bcd77..28b9e8a48e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlContainer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlContainer.java @@ -14,7 +14,7 @@ * @version 1 (3/21/21) */ @Deprecated -public interface JmlContainer extends Jmlish { +public interface JmlContainer extends Jmlish { NodeList getElements(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlKeyword.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlKeyword.java index 9faebb6eb9..db9b1559dc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlKeyword.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlKeyword.java @@ -6,7 +6,7 @@ * @author Alexander Weigl * @version 1 (3/20/21) */ -public interface JmlKeyword extends Stringable { +public interface JmlKeyword extends Stringable { String jmlSymbol(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlModelProgram.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlModelProgram.java index ccbe8ee9d2..ec371a545c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlModelProgram.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/JmlModelProgram.java @@ -18,7 +18,7 @@ * @author Alexander Weigl * @version 1 (12/14/21) */ -public class JmlModelProgram extends Node implements NodeWithModifiers, NodeWithAnnotations, NodeWithContracts { +public class JmlModelProgram extends Node implements NodeWithModifiers, NodeWithAnnotations, NodeWithContracts { private Modifier modifiers; @@ -29,55 +29,55 @@ public class JmlModelProgram extends Node implements NodeWithModifiers statements; - public JmlModelProgram(TokenRange tokenRange) { + public JmlModelProgram(TokenRange tokenRange) { this(null, new NodeList<>(), new NodeList<>(), null, new NodeList<>()); } @AllFieldsConstructor - public JmlModelProgram(NodeList modifiers, NodeList annotations, JmlContract contracts, NodeList statements) { + public JmlModelProgram(NodeList modifiers, NodeList annotations, JmlContract contracts, NodeList statements) { this(null, modifiers, annotations, contracts, statements); } - public JmlModelProgram(TokenRange range, NodeList modifiers, NodeList annotations, JmlContract contracts, NodeList statements) { + public JmlModelProgram(TokenRange range, NodeList modifiers, NodeList annotations, JmlContract contracts, NodeList statements) { super(range); } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { return null; } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { } @Override - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Override - public JmlModelProgram setContracts(NodeList contracts) { + public JmlModelProgram setContracts(NodeList contracts) { return null; } @Override - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @Override - public JmlModelProgram setAnnotations(NodeList annotations) { + public JmlModelProgram setAnnotations(NodeList annotations) { return null; } @Override - public NodeList getModifiers() { + public NodeList getModifiers() { return null; } @Override - public JmlModelProgram setModifiers(NodeList modifiers) { + public JmlModelProgram setModifiers(NodeList modifiers) { return null; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java index 503dcf6a6c..9f7af7ffd7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithContracts.java @@ -9,7 +9,7 @@ * @author Alexander Weigl * @version 1 (12/9/21) */ -public interface NodeWithContracts { +public interface NodeWithContracts { NodeList getContracts(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithJmlTags.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithJmlTags.java index 26ca577098..30af9376a7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithJmlTags.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/NodeWithJmlTags.java @@ -8,7 +8,7 @@ * @author Alexander Weigl * @version 1 (30.05.22) */ -public interface NodeWithJmlTags { +public interface NodeWithJmlTags { NodeList getJmlTags(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java index 5fe798b52a..0c7cf61db9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassAccessibleDeclaration.java @@ -20,7 +20,7 @@ * @author Alexander Weigl * @version 1 (3/11/21) */ -public class JmlClassAccessibleDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers { +public class JmlClassAccessibleDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers { private NodeList modifiers; @@ -33,12 +33,12 @@ public class JmlClassAccessibleDeclaration extends JmlClassLevelDeclaration jmlTags; - public JmlClassAccessibleDeclaration() { + public JmlClassAccessibleDeclaration() { this(null, new NodeList<>(), new NodeList<>(), null, new NodeList<>(), null); } @AllFieldsConstructor - public JmlClassAccessibleDeclaration(NodeList jmlTags, NodeList modifiers, Expression variable, NodeList expressions, Expression measuredBy) { + public JmlClassAccessibleDeclaration(NodeList jmlTags, NodeList modifiers, Expression variable, NodeList expressions, Expression measuredBy) { this(null, jmlTags, modifiers, variable, expressions, measuredBy); } @@ -46,7 +46,7 @@ public JmlClassAccessibleDeclaration(NodeList jmlTags, NodeList jmlTags, NodeList modifiers, Expression variable, NodeList expressions, Expression measuredBy) { + public JmlClassAccessibleDeclaration(TokenRange tokenRange, NodeList jmlTags, NodeList modifiers, Expression variable, NodeList expressions, Expression measuredBy) { super(tokenRange); setJmlTags(jmlTags); setModifiers(modifiers); @@ -57,12 +57,12 @@ public JmlClassAccessibleDeclaration(TokenRange tokenRange, NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassAccessibleDeclaration setModifiers(final NodeList modifiers) { + public JmlClassAccessibleDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -77,13 +77,13 @@ public JmlClassAccessibleDeclaration setModifiers(final NodeList modi @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -91,14 +91,14 @@ public void accept(final VoidVisitor v, final A arg) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClassAccessibleDeclaration(TokenRange tokenRange) { + public JmlClassAccessibleDeclaration(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -131,7 +131,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -168,17 +168,17 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClassAccessibleDeclaration clone() { + public JmlClassAccessibleDeclaration clone() { return (JmlClassAccessibleDeclaration) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getExpressions() { + public NodeList getExpressions() { return expressions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassAccessibleDeclaration setExpressions(final NodeList expressions) { + public JmlClassAccessibleDeclaration setExpressions(final NodeList expressions) { assertNotNull(expressions); if (expressions == this.expressions) { return this; @@ -192,12 +192,12 @@ public JmlClassAccessibleDeclaration setExpressions(final NodeList } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getVariable() { + public Expression getVariable() { return variable; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassAccessibleDeclaration setVariable(final Expression variable) { + public JmlClassAccessibleDeclaration setVariable(final Expression variable) { assertNotNull(variable); if (variable == this.variable) { return this; @@ -211,12 +211,12 @@ public JmlClassAccessibleDeclaration setVariable(final Expression variable) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getMeasuredBy() { + public Optional getMeasuredBy() { return Optional.ofNullable(measuredBy); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassAccessibleDeclaration setMeasuredBy(final Expression measuredBy) { + public JmlClassAccessibleDeclaration setMeasuredBy(final Expression measuredBy) { if (measuredBy == this.measuredBy) { return this; } @@ -229,48 +229,48 @@ public JmlClassAccessibleDeclaration setMeasuredBy(final Expression measuredBy) } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlClassAccessibleDeclaration removeMeasuredBy() { + public JmlClassAccessibleDeclaration removeMeasuredBy() { return setMeasuredBy((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassAccessibleDeclaration() { + public boolean isJmlClassAccessibleDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassAccessibleDeclaration asJmlClassAccessibleDeclaration() { + public JmlClassAccessibleDeclaration asJmlClassAccessibleDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassAccessibleDeclaration() { + public Optional toJmlClassAccessibleDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassAccessibleDeclaration(Consumer action) { + public void ifJmlClassAccessibleDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClassAccessibleDeclarationMetaModel getMetaModel() { + public JmlClassAccessibleDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlClassAccessibleDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassAccessibleDeclaration setJmlTags(final NodeList jmlTags) { + public JmlClassAccessibleDeclaration setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java index 8fa812b882..ad386656ed 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassExprDeclaration.java @@ -21,7 +21,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlClassExprDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers { +public class JmlClassExprDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers { private SimpleName kind; @@ -34,38 +34,38 @@ public class JmlClassExprDeclaration extends JmlClassLevelDeclaration jmlTags; - public JmlClassExprDeclaration() { + public JmlClassExprDeclaration() { super(null); } @AllFieldsConstructor - public JmlClassExprDeclaration(NodeList jmlTags, NodeList modifiers, SimpleName kind, SimpleName name, Expression invariant) { + public JmlClassExprDeclaration(NodeList jmlTags, NodeList modifiers, SimpleName kind, SimpleName name, Expression invariant) { this(null, jmlTags, modifiers, kind, name, invariant); } - public JmlClassExprDeclaration(TokenRange range, JavaToken begin, NodeList modifiers, Expression expr) { + public JmlClassExprDeclaration(TokenRange range, JavaToken begin, NodeList modifiers, Expression expr) { this(range, modifiers, new SimpleName(new TokenRange(begin, begin), begin.getText()), expr); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getInvariant() { + public Expression getInvariant() { return invariant; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassExprDeclaration setInvariant(final Expression invariant) { + public JmlClassExprDeclaration setInvariant(final Expression invariant) { assertNotNull(invariant); if (invariant == this.invariant) { return this; @@ -80,7 +80,7 @@ public JmlClassExprDeclaration setInvariant(final Expression invariant) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -107,7 +107,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -142,7 +142,7 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClassExprDeclaration clone() { + public JmlClassExprDeclaration clone() { return (JmlClassExprDeclaration) accept(new CloneVisitor(), null); } @@ -150,7 +150,7 @@ public JmlClassExprDeclaration clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClassExprDeclaration(TokenRange tokenRange, NodeList modifiers, SimpleName kind, Expression invariant) { + public JmlClassExprDeclaration(TokenRange tokenRange, NodeList modifiers, SimpleName kind, Expression invariant) { super(tokenRange); setModifiers(modifiers); setKind(kind); @@ -159,12 +159,12 @@ public JmlClassExprDeclaration(TokenRange tokenRange, NodeList modifi } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassExprDeclaration setModifiers(final NodeList modifiers) { + public JmlClassExprDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -179,59 +179,59 @@ public JmlClassExprDeclaration setModifiers(final NodeList modifiers) @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassInvariantDeclaration() { + public boolean isJmlClassInvariantDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassExprDeclaration asJmlClassInvariantDeclaration() { + public JmlClassExprDeclaration asJmlClassInvariantDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassInvariantDeclaration() { + public Optional toJmlClassInvariantDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassInvariantDeclaration(Consumer action) { + public void ifJmlClassInvariantDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassExprDeclaration() { + public boolean isJmlClassExprDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassExprDeclaration asJmlClassExprDeclaration() { + public JmlClassExprDeclaration asJmlClassExprDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassExprDeclaration() { + public Optional toJmlClassExprDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassExprDeclaration(Consumer action) { + public void ifJmlClassExprDeclaration(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getKind() { + public SimpleName getKind() { return kind; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassExprDeclaration setKind(final SimpleName kind) { + public JmlClassExprDeclaration setKind(final SimpleName kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -245,23 +245,23 @@ public JmlClassExprDeclaration setKind(final SimpleName kind) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlClassExprDeclaration removeKind() { + public JmlClassExprDeclaration removeKind() { return setKind(null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClassExprDeclarationMetaModel getMetaModel() { + public JmlClassExprDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlClassExprDeclarationMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getName() { + public Optional getName() { return Optional.ofNullable(name); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassExprDeclaration setName(final SimpleName name) { + public JmlClassExprDeclaration setName(final SimpleName name) { if (name == this.name) { return this; } @@ -274,7 +274,7 @@ public JmlClassExprDeclaration setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlClassExprDeclaration removeName() { + public JmlClassExprDeclaration removeName() { return setName((SimpleName) null); } @@ -282,7 +282,7 @@ public JmlClassExprDeclaration removeName() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClassExprDeclaration(TokenRange tokenRange, NodeList jmlTags, NodeList modifiers, SimpleName kind, SimpleName name, Expression invariant) { + public JmlClassExprDeclaration(TokenRange tokenRange, NodeList jmlTags, NodeList modifiers, SimpleName kind, SimpleName name, Expression invariant) { super(tokenRange); setJmlTags(jmlTags); setModifiers(modifiers); @@ -294,12 +294,12 @@ public JmlClassExprDeclaration(TokenRange tokenRange, NodeList jmlT @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClassExprDeclaration setJmlTags(final NodeList jmlTags) { + public JmlClassExprDeclaration setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevelDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevelDeclaration.java index 47f89e1b3c..d8bcdc56fa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevelDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevelDeclaration.java @@ -20,75 +20,75 @@ public abstract class JmlClassLevelDeclaration> extends BodyDeclaration implements Jmlish, NodeWithJmlTags { @AllFieldsConstructor - public JmlClassLevelDeclaration() { + public JmlClassLevelDeclaration() { } /** * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClassLevelDeclaration(TokenRange tokenRange) { + public JmlClassLevelDeclaration(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClassLevelDeclaration clone() { + public JmlClassLevelDeclaration clone() { return (JmlClassLevelDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassLevel() { + public boolean isJmlClassLevel() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassLevelDeclaration asJmlClassLevel() { + public JmlClassLevelDeclaration asJmlClassLevel() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassLevel() { + public Optional toJmlClassLevel() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassLevel(Consumer action) { + public void ifJmlClassLevel(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClassLevelDeclarationMetaModel getMetaModel() { + public JmlClassLevelDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlClassLevelDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClassLevelDeclaration() { + public boolean isJmlClassLevelDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClassLevelDeclaration asJmlClassLevelDeclaration() { + public JmlClassLevelDeclaration asJmlClassLevelDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClassLevelDeclaration() { + public Optional toJmlClassLevelDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClassLevelDeclaration(Consumer action) { + public void ifJmlClassLevelDeclaration(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlFieldDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlFieldDeclaration.java index 1e1da53ece..a14aeee90e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlFieldDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlFieldDeclaration.java @@ -21,18 +21,18 @@ * @author Alexander Weigl * @version 1 (3/11/21) */ -public class JmlFieldDeclaration extends JmlClassLevelDeclaration { +public class JmlFieldDeclaration extends JmlClassLevelDeclaration { private FieldDeclaration decl; private NodeList jmlTags; - public JmlFieldDeclaration() { + public JmlFieldDeclaration() { this(null, null); } @AllFieldsConstructor - public JmlFieldDeclaration(NodeList jmlTags, FieldDeclaration decl) { + public JmlFieldDeclaration(NodeList jmlTags, FieldDeclaration decl) { this(null, jmlTags, decl); } @@ -40,7 +40,7 @@ public JmlFieldDeclaration(NodeList jmlTags, FieldDeclaration decl) * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlFieldDeclaration(TokenRange tokenRange, NodeList jmlTags, FieldDeclaration decl) { + public JmlFieldDeclaration(TokenRange tokenRange, NodeList jmlTags, FieldDeclaration decl) { super(tokenRange); setJmlTags(jmlTags); setDecl(decl); @@ -49,47 +49,47 @@ public JmlFieldDeclaration(TokenRange tokenRange, NodeList jmlTags, @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlFieldDeclaration() { + public boolean isJmlFieldDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlFieldDeclaration asJmlFieldDeclaration() { + public JmlFieldDeclaration asJmlFieldDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlFieldDeclaration() { + public Optional toJmlFieldDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlFieldDeclaration(Consumer action) { + public void ifJmlFieldDeclaration(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public FieldDeclaration getDecl() { + public FieldDeclaration getDecl() { return decl; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlFieldDeclaration setDecl(final FieldDeclaration decl) { + public JmlFieldDeclaration setDecl(final FieldDeclaration decl) { assertNotNull(decl); if (decl == this.decl) { return this; @@ -104,7 +104,7 @@ public JmlFieldDeclaration setDecl(final FieldDeclaration decl) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -123,24 +123,24 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlFieldDeclaration clone() { + public JmlFieldDeclaration clone() { return (JmlFieldDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlFieldDeclarationMetaModel getMetaModel() { + public JmlFieldDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlFieldDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlFieldDeclaration setJmlTags(final NodeList jmlTags) { + public JmlFieldDeclaration setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -155,7 +155,7 @@ public JmlFieldDeclaration setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlMethodDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlMethodDeclaration.java index 0c071bf16c..0ae2f4a26e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlMethodDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlMethodDeclaration.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (4/5/21) */ -public class JmlMethodDeclaration extends JmlClassLevelDeclaration { +public class JmlMethodDeclaration extends JmlClassLevelDeclaration { private MethodDeclaration methodDeclaration; @@ -32,12 +32,12 @@ public class JmlMethodDeclaration extends JmlClassLevelDeclaration jmlTags; - public JmlMethodDeclaration() { + public JmlMethodDeclaration() { this(null, new NodeList<>(), new MethodDeclaration(), null); } @AllFieldsConstructor - public JmlMethodDeclaration(NodeList jmlTags, MethodDeclaration methodDeclaration, JmlContract contract) { + public JmlMethodDeclaration(NodeList jmlTags, MethodDeclaration methodDeclaration, JmlContract contract) { this(null, jmlTags, methodDeclaration, contract); } @@ -45,7 +45,7 @@ public JmlMethodDeclaration(NodeList jmlTags, MethodDeclaration met * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlMethodDeclaration(TokenRange tokenRange, NodeList jmlTags, MethodDeclaration methodDeclaration, JmlContract contract) { + public JmlMethodDeclaration(TokenRange tokenRange, NodeList jmlTags, MethodDeclaration methodDeclaration, JmlContract contract) { super(tokenRange); setJmlTags(jmlTags); setMethodDeclaration(methodDeclaration); @@ -55,23 +55,23 @@ public JmlMethodDeclaration(TokenRange tokenRange, NodeList jmlTags @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public MethodDeclaration getMethodDeclaration() { + public MethodDeclaration getMethodDeclaration() { return methodDeclaration; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodDeclaration setMethodDeclaration(final MethodDeclaration methodDeclaration) { + public JmlMethodDeclaration setMethodDeclaration(final MethodDeclaration methodDeclaration) { assertNotNull(methodDeclaration); if (methodDeclaration == this.methodDeclaration) { return this; @@ -86,7 +86,7 @@ public JmlMethodDeclaration setMethodDeclaration(final MethodDeclaration method @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -107,7 +107,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -132,17 +132,17 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlMethodDeclaration clone() { + public JmlMethodDeclaration clone() { return (JmlMethodDeclaration) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getContract() { + public Optional getContract() { return Optional.ofNullable(contract); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodDeclaration setContract(final JmlContract contract) { + public JmlMethodDeclaration setContract(final JmlContract contract) { if (contract == this.contract) { return this; } @@ -155,48 +155,48 @@ public JmlMethodDeclaration setContract(final JmlContract contract) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlMethodDeclaration removeContract() { + public JmlMethodDeclaration removeContract() { return setContract((JmlContract) null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMethodDeclaration() { + public boolean isJmlMethodDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMethodDeclaration asJmlMethodDeclaration() { + public JmlMethodDeclaration asJmlMethodDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMethodDeclaration() { + public Optional toJmlMethodDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMethodDeclaration(Consumer action) { + public void ifJmlMethodDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlMethodDeclarationMetaModel getMetaModel() { + public JmlMethodDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlMethodDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodDeclaration setJmlTags(final NodeList jmlTags) { + public JmlMethodDeclaration setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java index 4da531c260..8729e8fbe7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlRepresentsDeclaration.java @@ -26,7 +26,7 @@ * @author Alexander Weigl * @version 1 (3/11/21) */ -public class JmlRepresentsDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers, NodeWithName { +public class JmlRepresentsDeclaration extends JmlClassLevelDeclaration implements NodeWithModifiers, NodeWithName { private NodeList modifiers; @@ -37,7 +37,7 @@ public class JmlRepresentsDeclaration extends JmlClassLevelDeclaration jmlTags; @AllFieldsConstructor - public JmlRepresentsDeclaration(NodeList jmlTags, NodeList modifiers, Name name, Expression expr) { + public JmlRepresentsDeclaration(NodeList jmlTags, NodeList modifiers, Name name, Expression expr) { this(null, jmlTags, modifiers, name, expr); } @@ -45,7 +45,7 @@ public JmlRepresentsDeclaration(NodeList jmlTags, NodeList jmlTags, NodeList modifiers, Name name, Expression expr) { + public JmlRepresentsDeclaration(TokenRange tokenRange, NodeList jmlTags, NodeList modifiers, Name name, Expression expr) { super(tokenRange); setJmlTags(jmlTags); setModifiers(modifiers); @@ -55,12 +55,12 @@ public JmlRepresentsDeclaration(TokenRange tokenRange, NodeList jml } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlRepresentsDeclaration setModifiers(final NodeList modifiers) { + public JmlRepresentsDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -75,23 +75,23 @@ public JmlRepresentsDeclaration setModifiers(final NodeList modifiers @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpr() { + public Expression getExpr() { return expr; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlRepresentsDeclaration setExpr(final Expression expr) { + public JmlRepresentsDeclaration setExpr(final Expression expr) { assertNotNull(expr); if (expr == this.expr) { return this; @@ -105,12 +105,12 @@ public JmlRepresentsDeclaration setExpr(final Expression expr) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlRepresentsDeclaration setName(final Name name) { + public JmlRepresentsDeclaration setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -125,7 +125,7 @@ public JmlRepresentsDeclaration setName(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -146,7 +146,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -175,48 +175,48 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlRepresentsDeclaration clone() { + public JmlRepresentsDeclaration clone() { return (JmlRepresentsDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlRepresentsDeclaration() { + public boolean isJmlRepresentsDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlRepresentsDeclaration asJmlRepresentsDeclaration() { + public JmlRepresentsDeclaration asJmlRepresentsDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlRepresentsDeclaration() { + public Optional toJmlRepresentsDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlRepresentsDeclaration(Consumer action) { + public void ifJmlRepresentsDeclaration(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlRepresentsDeclarationMetaModel getMetaModel() { + public JmlRepresentsDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlRepresentsDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlRepresentsDeclaration setJmlTags(final NodeList jmlTags) { + public JmlRepresentsDeclaration setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java index d9526674f9..1aeb947618 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlSpecification.java @@ -8,7 +8,7 @@ * @author Alexander Weigl * @version 1 (3/17/21) */ -public class JmlSpecification { +public class JmlSpecification { /**/ private boolean singleLine; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java index 66575a2a78..0d444a17eb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/BlockContractable.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (3/16/21) */ -public interface BlockContractable { +public interface BlockContractable { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/ContractType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/ContractType.java index 3e453da911..e7281ec122 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/ContractType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/ContractType.java @@ -7,7 +7,7 @@ * @author Alexander Weigl * @version 1 (04.05.24) */ -public enum ContractType { +public enum ContractType { METHOD(ENSURES, ENSURES_FREE, ENSURES_REDUNDANTLY, REQUIRES, REQUIRES_FREE, REQUIRES_REDUNDANTLY, DECREASES, MODIFIES, MODIFIABLE, ASSIGNABLE, ACCESSIBLE, PRE, POST, OLD, FORALL, SIGNALS, SIGNALS_ONLY, WHEN, WORKING_SPACE, CAPTURES, ASSIGNABLE_REDUNDANTLY, MODIFIABLE_REDUNDANTLY, MODIFIES_REDUNDANTLY, CAPTURES_REDUNDANTLY, CALLABLE, DIVERGES, DURATION), LOOP(ENSURES, ENSURES_FREE, ENSURES_REDUNDANTLY, REQUIRES, REQUIRES_FREE, REQUIRES_REDUNDANTLY, DECREASES, MODIFIES, MODIFIABLE, ASSIGNABLE, ACCESSIBLE, PRE, POST, RETURNS, BREAKS, CONTINUES, OLD, FORALL, SIGNALS, SIGNALS_ONLY, WHEN, WORKING_SPACE, CAPTURES, ASSIGNABLE_REDUNDANTLY, MODIFIABLE_REDUNDANTLY, MODIFIES_REDUNDANTLY, CAPTURES_REDUNDANTLY, CALLABLE, DIVERGES, DURATION), @@ -22,7 +22,7 @@ public enum ContractType { validKinds = EnumSet.of(first, kinds); } - public boolean isValidClauseKind(JmlClauseKind clauseKind) { + public boolean isValidClauseKind(JmlClauseKind clauseKind) { return validKinds.contains(clauseKind); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlCallableClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlCallableClause.java index 7b1412d6c6..581b6e641d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlCallableClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlCallableClause.java @@ -20,12 +20,12 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public class JmlCallableClause extends JmlClause { +public class JmlCallableClause extends JmlClause { private NodeList methodSignatures = new NodeList(); @AllFieldsConstructor - public JmlCallableClause(SimpleName name, NodeList methodSignatures) { + public JmlCallableClause(SimpleName name, NodeList methodSignatures) { super(name); } @@ -33,71 +33,71 @@ public JmlCallableClause(SimpleName name, NodeList methodSi * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlCallableClause(TokenRange tokenRange) { + public JmlCallableClause(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlCallableClause clone() { + public JmlCallableClause clone() { return (JmlCallableClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlCallableClauseMetaModel getMetaModel() { + public JmlCallableClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlCallableClauseMetaModel; } @Override - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return JmlClauseKind.CALLABLE; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlCallableClause() { + public boolean isJmlCallableClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlCallableClause asJmlCallableClause() { + public JmlCallableClause asJmlCallableClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlCallableClause() { + public Optional toJmlCallableClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlCallableClause(Consumer action) { + public void ifJmlCallableClause(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getMethodSignatures() { + public NodeList getMethodSignatures() { return methodSignatures; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlCallableClause setMethodSignatures(final NodeList methodSignatures) { + public JmlCallableClause setMethodSignatures(final NodeList methodSignatures) { assertNotNull(methodSignatures); if (methodSignatures == this.methodSignatures) { return this; @@ -112,7 +112,7 @@ public JmlCallableClause setMethodSignatures(final NodeList @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -127,7 +127,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -144,7 +144,7 @@ public boolean replace(Node node, Node replacementNode) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlCallableClause(TokenRange tokenRange, SimpleName name, NodeList methodSignatures) { + public JmlCallableClause(TokenRange tokenRange, SimpleName name, NodeList methodSignatures) { super(tokenRange, name); setMethodSignatures(methodSignatures); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java index 005541e6f9..49a29d7010 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClause.java @@ -24,12 +24,12 @@ public abstract class JmlClause extends Node implements Jmlish { @OptionalProperty private SimpleName name; - public JmlClause() { + public JmlClause() { this((SimpleName) null); } @AllFieldsConstructor - public JmlClause(final SimpleName name) { + public JmlClause(final SimpleName name) { this(null, name); } @@ -37,7 +37,7 @@ public JmlClause(final SimpleName name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClause(TokenRange tokenRange, SimpleName name) { + public JmlClause(TokenRange tokenRange, SimpleName name) { super(tokenRange); setName(name); customInitialization(); @@ -47,32 +47,32 @@ public JmlClause(TokenRange tokenRange, SimpleName name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClause(TokenRange tokenRange) { + public JmlClause(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClause clone() { + public JmlClause clone() { return (JmlClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClauseMetaModel getMetaModel() { + public JmlClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlClauseMetaModel; } public abstract JmlClauseKind getKind(); @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getName() { + public Optional getName() { return Optional.ofNullable(name); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClause setName(final SimpleName name) { + public JmlClause setName(final SimpleName name) { if (name == this.name) { return this; } @@ -85,13 +85,13 @@ public JmlClause setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlClause removeName() { + public JmlClause removeName() { return setName((SimpleName) null); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -106,7 +106,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -120,173 +120,173 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlCallableClause() { + public boolean isJmlCallableClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlCallableClause asJmlCallableClause() { + public JmlCallableClause asJmlCallableClause() { throw new IllegalStateException(f("%s is not JmlCallableClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlCallableClause() { + public Optional toJmlCallableClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlCallableClause(Consumer action) { + public void ifJmlCallableClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClauseLabel() { + public boolean isJmlClauseLabel() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClauseLabel asJmlClauseLabel() { + public JmlClauseLabel asJmlClauseLabel() { throw new IllegalStateException(f("%s is not JmlClauseLabel, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClauseLabel() { + public Optional toJmlClauseLabel() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClauseLabel(Consumer action) { + public void ifJmlClauseLabel(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlForallClause() { + public boolean isJmlForallClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlForallClause asJmlForallClause() { + public JmlForallClause asJmlForallClause() { throw new IllegalStateException(f("%s is not JmlForallClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlForallClause() { + public Optional toJmlForallClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlForallClause(Consumer action) { + public void ifJmlForallClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMultiExprClause() { + public boolean isJmlMultiExprClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMultiExprClause asJmlMultiExprClause() { + public JmlMultiExprClause asJmlMultiExprClause() { throw new IllegalStateException(f("%s is not JmlMultiExprClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMultiExprClause() { + public Optional toJmlMultiExprClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMultiExprClause(Consumer action) { + public void ifJmlMultiExprClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlOldClause() { + public boolean isJmlOldClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlOldClause asJmlOldClause() { + public JmlOldClause asJmlOldClause() { throw new IllegalStateException(f("%s is not JmlOldClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlOldClause() { + public Optional toJmlOldClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlOldClause(Consumer action) { + public void ifJmlOldClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSignalsClause() { + public boolean isJmlSignalsClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSignalsClause asJmlSignalsClause() { + public JmlSignalsClause asJmlSignalsClause() { throw new IllegalStateException(f("%s is not JmlSignalsClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSignalsClause() { + public Optional toJmlSignalsClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSignalsClause(Consumer action) { + public void ifJmlSignalsClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSignalsOnlyClause() { + public boolean isJmlSignalsOnlyClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSignalsOnlyClause asJmlSignalsOnlyClause() { + public JmlSignalsOnlyClause asJmlSignalsOnlyClause() { throw new IllegalStateException(f("%s is not JmlSignalsOnlyClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSignalsOnlyClause() { + public Optional toJmlSignalsOnlyClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSignalsOnlyClause(Consumer action) { + public void ifJmlSignalsOnlyClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSimpleExprClause() { + public boolean isJmlSimpleExprClause() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSimpleExprClause asJmlSimpleExprClause() { + public JmlSimpleExprClause asJmlSimpleExprClause() { throw new IllegalStateException(f("%s is not JmlSimpleExprClause, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSimpleExprClause() { + public Optional toJmlSimpleExprClause() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSimpleExprClause(Consumer action) { + public void ifJmlSimpleExprClause(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClauseIf() { + public boolean isJmlClauseIf() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClauseIf asJmlClauseIf() { + public JmlClauseIf asJmlClauseIf() { throw new IllegalStateException(f("%s is not JmlClauseIf, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClauseIf() { + public Optional toJmlClauseIf() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClauseIf(Consumer action) { + public void ifJmlClauseIf(Consumer action) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java index 6d32523012..94d5b8052f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseIf.java @@ -20,7 +20,7 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public class JmlClauseIf extends JmlClause implements MethodContractable { +public class JmlClauseIf extends JmlClause implements MethodContractable { private JmlClauseKind kind; @@ -29,7 +29,7 @@ public class JmlClauseIf extends JmlClause implements MethodContractable { private Expression condition; @AllFieldsConstructor - public JmlClauseIf(SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { + public JmlClauseIf(SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { this(null, name, condition, kind, then); } @@ -37,14 +37,14 @@ public JmlClauseIf(SimpleName name, Expression condition, JmlClauseKind kind, E * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClauseIf(TokenRange tokenRange) { + public JmlClauseIf(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -61,35 +61,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClauseIf clone() { + public JmlClauseIf clone() { return (JmlClauseIf) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return kind; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCondition() { + public Expression getCondition() { return condition; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseIf setCondition(final Expression condition) { + public JmlClauseIf setCondition(final Expression condition) { assertNotNull(condition); if (condition == this.condition) { return this; @@ -103,7 +103,7 @@ public JmlClauseIf setCondition(final Expression condition) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseIf setKind(final JmlClauseKind kind) { + public JmlClauseIf setKind(final JmlClauseKind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -114,12 +114,12 @@ public JmlClauseIf setKind(final JmlClauseKind kind) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getThen() { + public Expression getThen() { return then; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseIf setThen(final Expression then) { + public JmlClauseIf setThen(final Expression then) { assertNotNull(then); if (then == this.then) { return this; @@ -134,31 +134,31 @@ public JmlClauseIf setThen(final Expression then) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClauseIf() { + public boolean isJmlClauseIf() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClauseIf asJmlClauseIf() { + public JmlClauseIf asJmlClauseIf() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClauseIf() { + public Optional toJmlClauseIf() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClauseIf(Consumer action) { + public void ifJmlClauseIf(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClauseIfMetaModel getMetaModel() { + public JmlClauseIfMetaModel getMetaModel() { return JavaParserMetaModel.jmlClauseIfMetaModel; } @@ -166,7 +166,7 @@ public JmlClauseIfMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClauseIf(TokenRange tokenRange, SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { + public JmlClauseIf(TokenRange tokenRange, SimpleName name, Expression condition, JmlClauseKind kind, Expression then) { super(tokenRange, name); setCondition(condition); setKind(kind); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseKind.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseKind.java index 7a4e088d21..e2d6022992 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseKind.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseKind.java @@ -7,7 +7,7 @@ import java.util.EnumSet; import java.util.Optional; -public enum JmlClauseKind implements JmlKeyword { +public enum JmlClauseKind implements JmlKeyword { ENSURES(GeneratedJavaParserConstants.ENSURES), ENSURES_FREE(GeneratedJavaParserConstants.ENSURES_FREE), @@ -77,7 +77,7 @@ public enum JmlClauseKind implements JmlKeyword { } @Override - public String jmlSymbol() { + public String jmlSymbol() { return jmlSymbol; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java index a409a77590..9034ab1aa4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlClauseLabel.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlClauseLabel extends JmlClause { +public class JmlClauseLabel extends JmlClause { private JmlClauseKind kind; @@ -32,16 +32,16 @@ public class JmlClauseLabel extends JmlClause { private Expression expr; - public JmlClauseLabel() { + public JmlClauseLabel() { this(JmlClauseKind.NONE, null, new BooleanLiteralExpr(true)); } - public JmlClauseLabel(SimpleName label, Expression expr) { + public JmlClauseLabel(SimpleName label, Expression expr) { this(JmlClauseKind.NONE, label, expr); } @AllFieldsConstructor - public JmlClauseLabel(JmlClauseKind kind, SimpleName label, Expression expr) { + public JmlClauseLabel(JmlClauseKind kind, SimpleName label, Expression expr) { this(null, kind, label, expr); } @@ -49,7 +49,7 @@ public JmlClauseLabel(JmlClauseKind kind, SimpleName label, Expression expr) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClauseLabel(TokenRange tokenRange, JmlClauseKind kind, SimpleName label, Expression expr) { + public JmlClauseLabel(TokenRange tokenRange, JmlClauseKind kind, SimpleName label, Expression expr) { super(tokenRange); setKind(kind); setLabel(label); @@ -57,25 +57,25 @@ public JmlClauseLabel(TokenRange tokenRange, JmlClauseKind kind, SimpleName lab customInitialization(); } - public JmlClauseLabel(TokenRange range, JavaToken kind, SimpleName label, Expression expr) { + public JmlClauseLabel(TokenRange range, JavaToken kind, SimpleName label, Expression expr) { this(range, JmlClauseKind.getKindByToken(kind), label, expr); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -90,7 +90,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -109,7 +109,7 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlClauseLabel clone() { + public JmlClauseLabel clone() { return (JmlClauseLabel) accept(new CloneVisitor(), null); } @@ -117,18 +117,18 @@ public JmlClauseLabel clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlClauseLabel(TokenRange tokenRange) { + public JmlClauseLabel(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpr() { + public Expression getExpr() { return expr; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseLabel setExpr(final Expression expr) { + public JmlClauseLabel setExpr(final Expression expr) { assertNotNull(expr); if (expr == this.expr) { return this; @@ -142,12 +142,12 @@ public JmlClauseLabel setExpr(final Expression expr) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getLabel() { + public Optional getLabel() { return Optional.ofNullable(label); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseLabel setLabel(final SimpleName label) { + public JmlClauseLabel setLabel(final SimpleName label) { if (label == this.label) { return this; } @@ -161,23 +161,23 @@ public JmlClauseLabel setLabel(final SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlClauseLabelMetaModel getMetaModel() { + public JmlClauseLabelMetaModel getMetaModel() { return JavaParserMetaModel.jmlClauseLabelMetaModel; } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlClauseLabel removeLabel() { + public JmlClauseLabel removeLabel() { return setLabel((SimpleName) null); } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return kind; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseLabel setKind(final JmlClauseKind kind) { + public JmlClauseLabel setKind(final JmlClauseKind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -189,25 +189,25 @@ public JmlClauseLabel setKind(final JmlClauseKind kind) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlClauseLabel() { + public boolean isJmlClauseLabel() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlClauseLabel asJmlClauseLabel() { + public JmlClauseLabel asJmlClauseLabel() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlClauseLabel() { + public Optional toJmlClauseLabel() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlClauseLabel(Consumer action) { + public void ifJmlClauseLabel(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java index 712f10867d..0512ba9acb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlContract.java @@ -20,7 +20,7 @@ * @author Alexander Weigl * @version 1 (3/14/21) */ -public class JmlContract extends Node implements Jmlish, NodeWithModifiers, NodeWithJmlTags { +public class JmlContract extends Node implements Jmlish, NodeWithModifiers, NodeWithJmlTags { private NodeList jmlTags = new NodeList<>(); @@ -37,42 +37,42 @@ public class JmlContract extends Node implements Jmlish, NodeWithModifiers subContracts = new NodeList<>(); - public JmlContract() { + public JmlContract() { this((TokenRange) null, new NodeList<>(), ContractType.METHOD, Behavior.NONE, null, new NodeList<>(), new NodeList<>(), new NodeList<>()); } @AllFieldsConstructor - public JmlContract(NodeList jmlTags, ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(NodeList jmlTags, ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { this(null, jmlTags, type, behavior, name, modifiers, clauses, subContracts); } - public JmlContract(ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { this((TokenRange) null, new NodeList<>(), type, behavior, name, modifiers, clauses, subContracts); } - public JmlContract(TokenRange range, Behavior behavior, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(TokenRange range, Behavior behavior, NodeList modifiers, NodeList clauses, NodeList subContracts) { this(range, new NodeList<>(), ContractType.METHOD, behavior, null, modifiers, clauses, subContracts); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Behavior getBehavior() { + public Behavior getBehavior() { return behavior; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setBehavior(final Behavior behavior) { + public JmlContract setBehavior(final Behavior behavior) { assertNotNull(behavior); if (behavior == this.behavior) { return this; @@ -83,12 +83,12 @@ public JmlContract setBehavior(final Behavior behavior) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getClauses() { + public NodeList getClauses() { return clauses; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setClauses(final NodeList clauses) { + public JmlContract setClauses(final NodeList clauses) { assertNotNull(clauses); if (clauses == this.clauses) { return this; @@ -102,12 +102,12 @@ public JmlContract setClauses(final NodeList clauses) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setModifiers(final NodeList modifiers) { + public JmlContract setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -121,12 +121,12 @@ public JmlContract setModifiers(final NodeList modifiers) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getSubContracts() { + public NodeList getSubContracts() { return subContracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setSubContracts(final NodeList subContracts) { + public JmlContract setSubContracts(final NodeList subContracts) { assertNotNull(subContracts); if (subContracts == this.subContracts) { return this; @@ -141,7 +141,7 @@ public JmlContract setSubContracts(final NodeList subContracts) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -180,7 +180,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -219,7 +219,7 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlContract clone() { + public JmlContract clone() { return (JmlContract) accept(new CloneVisitor(), null); } @@ -227,7 +227,7 @@ public JmlContract clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlContract(TokenRange tokenRange, boolean isLoopContract, Behavior behavior, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(TokenRange tokenRange, boolean isLoopContract, Behavior behavior, NodeList modifiers, NodeList clauses, NodeList subContracts) { super(tokenRange); setLoopContract(isLoopContract); setBehavior(behavior); @@ -239,27 +239,27 @@ public JmlContract(TokenRange tokenRange, boolean isLoopContract, Behavior beha @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlContractMetaModel getMetaModel() { + public JmlContractMetaModel getMetaModel() { return JavaParserMetaModel.jmlContractMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isLoopContract() { + public boolean isLoopContract() { return false; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setLoopContract(final boolean isLoopContract) { + public JmlContract setLoopContract(final boolean isLoopContract) { return this; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setJmlTags(final NodeList jmlTags) { + public JmlContract setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -273,12 +273,12 @@ public JmlContract setJmlTags(final NodeList jmlTags) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getName() { + public Optional getName() { return Optional.ofNullable(name); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setName(final SimpleName name) { + public JmlContract setName(final SimpleName name) { if (name == this.name) { return this; } @@ -291,12 +291,12 @@ public JmlContract setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ContractType getType() { + public ContractType getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlContract setType(final ContractType type) { + public JmlContract setType(final ContractType type) { assertNotNull(type); if (type == this.type) { return this; @@ -307,7 +307,7 @@ public JmlContract setType(final ContractType type) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlContract removeName() { + public JmlContract removeName() { return setName((SimpleName) null); } @@ -315,7 +315,7 @@ public JmlContract removeName() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlContract(TokenRange tokenRange, ContractType type, boolean isLoopContract, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(TokenRange tokenRange, ContractType type, boolean isLoopContract, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { super(tokenRange); setType(type); setLoopContract(isLoopContract); @@ -331,7 +331,7 @@ public JmlContract(TokenRange tokenRange, ContractType type, boolean isLoopCont * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlContract(TokenRange tokenRange, NodeList jmlTags, ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { + public JmlContract(TokenRange tokenRange, NodeList jmlTags, ContractType type, Behavior behavior, SimpleName name, NodeList modifiers, NodeList clauses, NodeList subContracts) { super(tokenRange); setJmlTags(jmlTags); setType(type); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java index 58bba7a50a..987d18217b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlForallClause.java @@ -20,12 +20,12 @@ * @author Alexander Weigl * @version 1 (2/22/21) */ -public class JmlForallClause extends JmlClause implements MethodContractable { +public class JmlForallClause extends JmlClause implements MethodContractable { private NodeList boundedVariables; @AllFieldsConstructor - public JmlForallClause(NodeList boundedVariables) { + public JmlForallClause(NodeList boundedVariables) { this(null, boundedVariables); } @@ -33,7 +33,7 @@ public JmlForallClause(NodeList boundedVariables) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlForallClause(TokenRange tokenRange, NodeList boundedVariables) { + public JmlForallClause(TokenRange tokenRange, NodeList boundedVariables) { super(tokenRange); setBoundedVariables(boundedVariables); customInitialization(); @@ -41,23 +41,23 @@ public JmlForallClause(TokenRange tokenRange, NodeList boundedVariab @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getBoundedVariables() { + public NodeList getBoundedVariables() { return boundedVariables; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlForallClause setBoundedVariables(final NodeList boundedVariables) { + public JmlForallClause setBoundedVariables(final NodeList boundedVariables) { assertNotNull(boundedVariables); if (boundedVariables == this.boundedVariables) { return this; @@ -72,7 +72,7 @@ public JmlForallClause setBoundedVariables(final NodeList boundedVar @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -87,7 +87,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -102,42 +102,42 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlForallClause clone() { + public JmlForallClause clone() { return (JmlForallClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlForallClauseMetaModel getMetaModel() { + public JmlForallClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlForallClauseMetaModel; } @Override - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return JmlClauseKind.FORALL; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlForallClause() { + public boolean isJmlForallClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlForallClause asJmlForallClause() { + public JmlForallClause asJmlForallClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlForallClause() { + public Optional toJmlForallClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlForallClause(Consumer action) { + public void ifJmlForallClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMethodSignature.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMethodSignature.java index a362c3592c..e70d791e4d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMethodSignature.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMethodSignature.java @@ -22,7 +22,7 @@ * @author Alexander Weigl * @version 1 (02.05.24) */ -public class JmlMethodSignature extends Node { +public class JmlMethodSignature extends Node { @OptionalProperty private Type receiver; @@ -38,23 +38,23 @@ private JmlMethodSignature(@Nullable Type receiver, SimpleName name, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getArgumentTypes() { + public NodeList getArgumentTypes() { return argumentTypes; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodSignature setArgumentTypes(final NodeList argumentTypes) { + public JmlMethodSignature setArgumentTypes(final NodeList argumentTypes) { assertNotNull(argumentTypes); if (argumentTypes == this.argumentTypes) { return this; @@ -68,12 +68,12 @@ public JmlMethodSignature setArgumentTypes(final NodeList argumentTypes) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodSignature setName(final SimpleName name) { + public JmlMethodSignature setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -87,12 +87,12 @@ public JmlMethodSignature setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getReceiver() { + public Optional getReceiver() { return Optional.ofNullable(receiver); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMethodSignature setReceiver(final Type receiver) { + public JmlMethodSignature setReceiver(final Type receiver) { if (receiver == this.receiver) { return this; } @@ -105,13 +105,13 @@ public JmlMethodSignature setReceiver(final Type receiver) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public JmlMethodSignature removeReceiver() { + public JmlMethodSignature removeReceiver() { return setReceiver((Type) null); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -132,7 +132,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -157,13 +157,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlMethodSignature clone() { + public JmlMethodSignature clone() { return (JmlMethodSignature) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlMethodSignatureMetaModel getMetaModel() { + public JmlMethodSignatureMetaModel getMetaModel() { return JavaParserMetaModel.jmlMethodSignatureMetaModel; } @@ -171,7 +171,7 @@ public JmlMethodSignatureMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlMethodSignature(TokenRange tokenRange, Type receiver, SimpleName name, NodeList argumentTypes) { + public JmlMethodSignature(TokenRange tokenRange, Type receiver, SimpleName name, NodeList argumentTypes) { super(tokenRange); setReceiver(receiver); setName(name); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMultiExprClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMultiExprClause.java index b79b78549d..7d13050e81 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMultiExprClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlMultiExprClause.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (25.02.22) */ -public class JmlMultiExprClause extends JmlClause { +public class JmlMultiExprClause extends JmlClause { private JmlClauseKind kind; @@ -33,39 +33,39 @@ public class JmlMultiExprClause extends JmlClause { private NodeList expressions; @AllFieldsConstructor - public JmlMultiExprClause(JmlClauseKind kind, SimpleName name, NodeList heaps, NodeList expressions) { + public JmlMultiExprClause(JmlClauseKind kind, SimpleName name, NodeList heaps, NodeList expressions) { this(null, kind, name, heaps, expressions); } - public JmlMultiExprClause(TokenRange range, JavaToken begin, SimpleName label, NodeList heaps, NodeList exprs) { + public JmlMultiExprClause(TokenRange range, JavaToken begin, SimpleName label, NodeList heaps, NodeList exprs) { this(range, JmlClauseKind.getKindByToken(begin), label, heaps, exprs); } @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return kind; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getExpressions() { + public NodeList getExpressions() { return expressions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMultiExprClause setExpressions(final NodeList expressions) { + public JmlMultiExprClause setExpressions(final NodeList expressions) { assertNotNull(expressions); if (expressions == this.expressions) { return this; @@ -79,12 +79,12 @@ public JmlMultiExprClause setExpressions(final NodeList expressions } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getHeaps() { + public Optional> getHeaps() { return Optional.ofNullable(heaps); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMultiExprClause setHeaps(final NodeList heaps) { + public JmlMultiExprClause setHeaps(final NodeList heaps) { if (heaps == this.heaps) { return this; } @@ -97,7 +97,7 @@ public JmlMultiExprClause setHeaps(final NodeList heaps) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMultiExprClause setKind(final JmlClauseKind kind) { + public JmlMultiExprClause setKind(final JmlClauseKind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -109,7 +109,7 @@ public JmlMultiExprClause setKind(final JmlClauseKind kind) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -132,7 +132,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -155,13 +155,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlMultiExprClause clone() { + public JmlMultiExprClause clone() { return (JmlMultiExprClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlMultiExprClauseMetaModel getMetaModel() { + public JmlMultiExprClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlMultiExprClauseMetaModel; } @@ -169,7 +169,7 @@ public JmlMultiExprClauseMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlMultiExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleName name, NodeList heaps, NodeList expressions) { + public JmlMultiExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleName name, NodeList heaps, NodeList expressions) { super(tokenRange, name); setKind(kind); setHeaps(heaps); @@ -177,11 +177,11 @@ public JmlMultiExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleName customInitialization(); } - public NodeList getExpression() { + public NodeList getExpression() { return expressions; } - public JmlMultiExprClause setExpression(final NodeList expressions) { + public JmlMultiExprClause setExpression(final NodeList expressions) { assertNotNull(expressions); if (expressions == this.expressions) { return this; @@ -196,25 +196,25 @@ public JmlMultiExprClause setExpression(final NodeList expressions) @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMultiExprClause() { + public boolean isJmlMultiExprClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMultiExprClause asJmlMultiExprClause() { + public JmlMultiExprClause asJmlMultiExprClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMultiExprClause() { + public Optional toJmlMultiExprClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMultiExprClause(Consumer action) { + public void ifJmlMultiExprClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlOldClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlOldClause.java index 1ee369deb8..2c631aad53 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlOldClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlOldClause.java @@ -19,7 +19,7 @@ * @author Alexander Weigl * @version 1 (12/12/21) */ -public class JmlOldClause extends JmlClause { +public class JmlOldClause extends JmlClause { /* private SimpleName name; @OptionalProperty @@ -29,7 +29,7 @@ public class JmlOldClause extends JmlClause { private VariableDeclarationExpr declarations; @AllFieldsConstructor - public JmlOldClause(VariableDeclarationExpr declarations) { + public JmlOldClause(VariableDeclarationExpr declarations) { this(null, declarations); } @@ -37,7 +37,7 @@ public JmlOldClause(VariableDeclarationExpr declarations) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlOldClause(TokenRange tokenRange, VariableDeclarationExpr declarations) { + public JmlOldClause(TokenRange tokenRange, VariableDeclarationExpr declarations) { super(tokenRange); setDeclarations(declarations); customInitialization(); @@ -45,23 +45,23 @@ public JmlOldClause(TokenRange tokenRange, VariableDeclarationExpr declarations @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr getDeclarations() { + public VariableDeclarationExpr getDeclarations() { return declarations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlOldClause setDeclarations(final VariableDeclarationExpr declarations) { + public JmlOldClause setDeclarations(final VariableDeclarationExpr declarations) { assertNotNull(declarations); if (declarations == this.declarations) { return this; @@ -76,7 +76,7 @@ public JmlOldClause setDeclarations(final VariableDeclarationExpr declarations) @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -89,42 +89,42 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlOldClause clone() { + public JmlOldClause clone() { return (JmlOldClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlOldClauseMetaModel getMetaModel() { + public JmlOldClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlOldClauseMetaModel; } @Override - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return JmlClauseKind.OLD; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlOldClause() { + public boolean isJmlOldClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlOldClause asJmlOldClause() { + public JmlOldClause asJmlOldClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlOldClause() { + public Optional toJmlOldClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlOldClause(Consumer action) { + public void ifJmlOldClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java index 8d13fa7479..ebd2c9bb92 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsClause.java @@ -21,14 +21,14 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSignalsClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSignalsClause extends JmlClause implements MethodContractable, BlockContractable { private Parameter parameter; private Expression expression; @AllFieldsConstructor - public JmlSignalsClause(SimpleName name, Parameter parameter, Expression expression) { + public JmlSignalsClause(SimpleName name, Parameter parameter, Expression expression) { this(null, name, parameter, expression); } @@ -36,7 +36,7 @@ public JmlSignalsClause(SimpleName name, Parameter parameter, Expression expres * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSignalsClause(TokenRange tokenRange, SimpleName name, Parameter parameter, Expression expression) { + public JmlSignalsClause(TokenRange tokenRange, SimpleName name, Parameter parameter, Expression expression) { super(tokenRange, name); setParameter(parameter); setExpression(expression); @@ -45,13 +45,13 @@ public JmlSignalsClause(TokenRange tokenRange, SimpleName name, Parameter param @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -59,18 +59,18 @@ public void accept(final VoidVisitor v, final A arg) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSignalsClause(TokenRange tokenRange) { + public JmlSignalsClause(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSignalsClause setExpression(final Expression expression) { + public JmlSignalsClause setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -85,22 +85,22 @@ public JmlSignalsClause setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlSignalsClauseMetaModel getMetaModel() { + public JmlSignalsClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlSignalsClauseMetaModel; } @Override - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return JmlClauseKind.SIGNALS; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter getParameter() { + public Parameter getParameter() { return parameter; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSignalsClause setParameter(final Parameter parameter) { + public JmlSignalsClause setParameter(final Parameter parameter) { assertNotNull(parameter); if (parameter == this.parameter) { return this; @@ -115,7 +115,7 @@ public JmlSignalsClause setParameter(final Parameter parameter) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -132,31 +132,31 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlSignalsClause clone() { + public JmlSignalsClause clone() { return (JmlSignalsClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSignalsClause() { + public boolean isJmlSignalsClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSignalsClause asJmlSignalsClause() { + public JmlSignalsClause asJmlSignalsClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSignalsClause() { + public Optional toJmlSignalsClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSignalsClause(Consumer action) { + public void ifJmlSignalsClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java index 366d49eeb5..db883885dd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSignalsOnlyClause.java @@ -20,12 +20,12 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSignalsOnlyClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSignalsOnlyClause extends JmlClause implements MethodContractable, BlockContractable { private NodeList types; @AllFieldsConstructor - public JmlSignalsOnlyClause(NodeList types) { + public JmlSignalsOnlyClause(NodeList types) { this(null, types); } @@ -33,35 +33,35 @@ public JmlSignalsOnlyClause(NodeList types) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSignalsOnlyClause(TokenRange tokenRange, NodeList types) { + public JmlSignalsOnlyClause(TokenRange tokenRange, NodeList types) { super(tokenRange); setTypes(types); customInitialization(); } - public JmlSignalsOnlyClause() { + public JmlSignalsOnlyClause() { } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public boolean hasParentNode() { + public boolean hasParentNode() { return false; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -76,7 +76,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -91,7 +91,7 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlSignalsOnlyClause clone() { + public JmlSignalsOnlyClause clone() { return (JmlSignalsOnlyClause) accept(new CloneVisitor(), null); } @@ -99,18 +99,18 @@ public JmlSignalsOnlyClause clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSignalsOnlyClause(TokenRange tokenRange) { + public JmlSignalsOnlyClause(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getTypes() { + public NodeList getTypes() { return types; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSignalsOnlyClause setTypes(final NodeList types) { + public JmlSignalsOnlyClause setTypes(final NodeList types) { assertNotNull(types); if (types == this.types) { return this; @@ -125,36 +125,36 @@ public JmlSignalsOnlyClause setTypes(final NodeList types) { @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlSignalsOnlyClauseMetaModel getMetaModel() { + public JmlSignalsOnlyClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlSignalsOnlyClauseMetaModel; } @Override - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return JmlClauseKind.SIGNALS_ONLY; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSignalsOnlyClause() { + public boolean isJmlSignalsOnlyClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSignalsOnlyClause asJmlSignalsOnlyClause() { + public JmlSignalsOnlyClause asJmlSignalsOnlyClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSignalsOnlyClause() { + public Optional toJmlSignalsOnlyClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSignalsOnlyClause(Consumer action) { + public void ifJmlSignalsOnlyClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java index 6875d92891..ba1e7f32c9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/JmlSimpleExprClause.java @@ -23,7 +23,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlSimpleExprClause extends JmlClause implements MethodContractable, BlockContractable { +public class JmlSimpleExprClause extends JmlClause implements MethodContractable, BlockContractable { private JmlClauseKind kind; @@ -32,33 +32,33 @@ public class JmlSimpleExprClause extends JmlClause implements MethodContractabl private Expression expression; - public JmlSimpleExprClause() { + public JmlSimpleExprClause() { } @AllFieldsConstructor - public JmlSimpleExprClause(JmlClauseKind kind, SimpleName name, NodeList heaps, Expression expression) { + public JmlSimpleExprClause(JmlClauseKind kind, SimpleName name, NodeList heaps, Expression expression) { this(null, kind, name, heaps, expression); } - public JmlSimpleExprClause(TokenRange range, JavaToken kind, NodeList heaps, Expression expression) { + public JmlSimpleExprClause(TokenRange range, JavaToken kind, NodeList heaps, Expression expression) { this(range, JmlClauseKind.getKindByToken(kind), null, heaps, expression); } - public JmlSimpleExprClause(TokenRange range, JavaToken kind, Expression expr) { + public JmlSimpleExprClause(TokenRange range, JavaToken kind, Expression expr) { this(range, kind, (SimpleName) null, expr); } - public JmlSimpleExprClause(TokenRange range, JavaToken kind, SimpleName name, Expression expr) { + public JmlSimpleExprClause(TokenRange range, JavaToken kind, SimpleName name, Expression expr) { this(range, JmlClauseKind.getKindByToken(kind), name, null, expr); } - public JmlSimpleExprClause(TokenRange range, JavaToken kind, SimpleName name, NodeList heaps, Expression expr) { + public JmlSimpleExprClause(TokenRange range, JavaToken kind, SimpleName name, NodeList heaps, Expression expr) { this(range, JmlClauseKind.getKindByToken(kind), name, heaps, expr); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -75,7 +75,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -96,19 +96,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlSimpleExprClause clone() { + public JmlSimpleExprClause clone() { return (JmlSimpleExprClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -116,18 +116,18 @@ public void accept(final VoidVisitor v, final A arg) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSimpleExprClause(TokenRange tokenRange) { + public JmlSimpleExprClause(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSimpleExprClause setExpression(final NodeList expression) { + public JmlSimpleExprClause setExpression(final NodeList expression) { assertNotNull(expression); notifyPropertyChange(ObservableProperty.EXPRESSION, this.expression, expression); if (this.expression != null) @@ -137,12 +137,12 @@ public JmlSimpleExprClause setExpression(final NodeList expression) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getHeaps() { + public Optional> getHeaps() { return Optional.ofNullable(heaps); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSimpleExprClause setHeaps(final NodeList heaps) { + public JmlSimpleExprClause setHeaps(final NodeList heaps) { if (heaps == this.heaps) { return this; } @@ -156,7 +156,7 @@ public JmlSimpleExprClause setHeaps(final NodeList heaps) { @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlClauseKind getKind() { + public JmlClauseKind getKind() { return kind; } @@ -164,7 +164,7 @@ public JmlClauseKind getKind() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSimpleExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleName name, NodeList heaps, Expression expression) { + public JmlSimpleExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleName name, NodeList heaps, Expression expression) { super(tokenRange, name); setKind(kind); setHeaps(heaps); @@ -173,7 +173,7 @@ public JmlSimpleExprClause(TokenRange tokenRange, JmlClauseKind kind, SimpleNam } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSimpleExprClause setKind(final JmlClauseKind kind) { + public JmlSimpleExprClause setKind(final JmlClauseKind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -184,7 +184,7 @@ public JmlSimpleExprClause setKind(final JmlClauseKind kind) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSimpleExprClause setExpression(final Expression expression) { + public JmlSimpleExprClause setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -199,31 +199,31 @@ public JmlSimpleExprClause setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlSimpleExprClauseMetaModel getMetaModel() { + public JmlSimpleExprClauseMetaModel getMetaModel() { return JavaParserMetaModel.jmlSimpleExprClauseMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSimpleExprClause() { + public boolean isJmlSimpleExprClause() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSimpleExprClause asJmlSimpleExprClause() { + public JmlSimpleExprClause asJmlSimpleExprClause() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSimpleExprClause() { + public Optional toJmlSimpleExprClause() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSimpleExprClause(Consumer action) { + public void ifJmlSimpleExprClause(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/LoopContractable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/LoopContractable.java index cf834953bd..bdf65b2f93 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/LoopContractable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/LoopContractable.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (3/16/21) */ -public interface LoopContractable { +public interface LoopContractable { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java index 3a8182efe8..2706fce13e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/clauses/MethodContractable.java @@ -4,5 +4,5 @@ * @author Alexander Weigl * @version 1 (3/16/21) */ -public interface MethodContractable { +public interface MethodContractable { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java index ccfc36f067..63dfa7c270 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDoc.java @@ -17,34 +17,34 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class JmlDoc extends Node { +public class JmlDoc extends Node { private JavaToken content; @AllFieldsConstructor - public JmlDoc(JavaToken content) { + public JmlDoc(JavaToken content) { this(new TokenRange(content, content), content); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JavaToken getContent() { + public JavaToken getContent() { return content; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlDoc setContent(final JavaToken content) { + public JmlDoc setContent(final JavaToken content) { assertNotNull(content); if (content == this.content) { return this; @@ -56,13 +56,13 @@ public JmlDoc setContent(final JavaToken content) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlDoc clone() { + public JmlDoc clone() { return (JmlDoc) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlDocMetaModel getMetaModel() { + public JmlDocMetaModel getMetaModel() { return JavaParserMetaModel.jmlDocMetaModel; } @@ -70,7 +70,7 @@ public JmlDocMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDoc(TokenRange tokenRange, JavaToken content) { + public JmlDoc(TokenRange tokenRange, JavaToken content) { super(tokenRange); setContent(content); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocContainer.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocContainer.java index 3d4536a4e6..4ae5f81ce8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocContainer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocContainer.java @@ -7,7 +7,7 @@ * @author Alexander Weigl * @version 1 (26.05.22) */ -public interface JmlDocContainer { +public interface JmlDocContainer { @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") NodeList getJmlComments(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocDeclaration.java index b23b912b2b..ae0033cc6a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocDeclaration.java @@ -22,69 +22,69 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class JmlDocDeclaration extends BodyDeclaration implements JmlDocContainer { +public class JmlDocDeclaration extends BodyDeclaration implements JmlDocContainer { private NodeList jmlComments; @AllFieldsConstructor - public JmlDocDeclaration(NodeList jmlComments) { + public JmlDocDeclaration(NodeList jmlComments) { super((TokenRange) null); this.jmlComments = jmlComments; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlComments() { + public NodeList getJmlComments() { return jmlComments; } - public void setJmlComments(List jmlComments) { + public void setJmlComments(List jmlComments) { // this.jmlComments = jmlComments; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocDeclaration() { + public boolean isJmlDocDeclaration() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocDeclaration asJmlDocDeclaration() { + public JmlDocDeclaration asJmlDocDeclaration() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocDeclaration() { + public Optional toJmlDocDeclaration() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocDeclaration(Consumer action) { + public void ifJmlDocDeclaration(Consumer action) { action.accept(this); } - public JmlDocDeclaration setJmlComments(final JavaToken jmlComments) { + public JmlDocDeclaration setJmlComments(final JavaToken jmlComments) { assertNotNull(jmlComments); return this; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -99,7 +99,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -114,27 +114,27 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlDocDeclaration clone() { + public JmlDocDeclaration clone() { return (JmlDocDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlDocDeclarationMetaModel getMetaModel() { + public JmlDocDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.jmlDocDeclarationMetaModel; } /** * This constructor is used by the parser and is considered private. */ - public JmlDocDeclaration(TokenRange tokenRange, JavaToken jmlComments) { + public JmlDocDeclaration(TokenRange tokenRange, JavaToken jmlComments) { super(tokenRange); setJmlComments(jmlComments); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlDocDeclaration setJmlComments(final NodeList jmlComments) { + public JmlDocDeclaration setJmlComments(final NodeList jmlComments) { assertNotNull(jmlComments); if (jmlComments == this.jmlComments) { return this; @@ -151,7 +151,7 @@ public JmlDocDeclaration setJmlComments(final NodeList jmlComments) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDocDeclaration(TokenRange tokenRange, NodeList jmlComments) { + public JmlDocDeclaration(TokenRange tokenRange, NodeList jmlComments) { super(tokenRange); setJmlComments(jmlComments); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocModifier.java index 199c87b4e7..543798c231 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocModifier.java @@ -8,26 +8,26 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class JmlDocModifier implements Modifier.Keyword, JmlDocContainer { +public class JmlDocModifier implements Modifier.Keyword, JmlDocContainer { private final NodeList jmlComments; @AllFieldsConstructor - public JmlDocModifier(NodeList jmlComments) { + public JmlDocModifier(NodeList jmlComments) { this.jmlComments = jmlComments; } @Override - public String asString() { + public String asString() { return "[[JML modifiers]]"; } @Override - public String name() { + public String name() { return asString(); } - public NodeList getJmlComments() { + public NodeList getJmlComments() { return jmlComments; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocStmt.java index 47ffa1c4c2..6f02690a84 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocStmt.java @@ -21,64 +21,64 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class JmlDocStmt extends Statement implements JmlDocContainer { +public class JmlDocStmt extends Statement implements JmlDocContainer { private NodeList jmlComments; @AllFieldsConstructor - public JmlDocStmt(NodeList jmlComments) { + public JmlDocStmt(NodeList jmlComments) { this(null, jmlComments); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocStmt() { + public boolean isJmlDocStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocStmt asJmlDocStmt() { + public JmlDocStmt asJmlDocStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocStmt() { + public Optional toJmlDocStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocStmt(Consumer action) { + public void ifJmlDocStmt(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlComments() { + public NodeList getJmlComments() { return jmlComments; } - public JmlDocStmt setJmlComments(final JavaToken jmlComments) { + public JmlDocStmt setJmlComments(final JavaToken jmlComments) { assertNotNull(jmlComments); return this; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -93,7 +93,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -108,27 +108,27 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlDocStmt clone() { + public JmlDocStmt clone() { return (JmlDocStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlDocStmtMetaModel getMetaModel() { + public JmlDocStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlDocStmtMetaModel; } /** * This constructor is used by the parser and is considered private. */ - public JmlDocStmt(TokenRange tokenRange, JavaToken jmlComments) { + public JmlDocStmt(TokenRange tokenRange, JavaToken jmlComments) { super(tokenRange); setJmlComments(jmlComments); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlDocStmt setJmlComments(final NodeList jmlComments) { + public JmlDocStmt setJmlComments(final NodeList jmlComments) { assertNotNull(jmlComments); if (jmlComments == this.jmlComments) { return this; @@ -145,7 +145,7 @@ public JmlDocStmt setJmlComments(final NodeList jmlComments) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDocStmt(TokenRange tokenRange, NodeList jmlComments) { + public JmlDocStmt(TokenRange tokenRange, NodeList jmlComments) { super(tokenRange); setJmlComments(jmlComments); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocType.java index e0510f93e9..2cf49cd5d6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/doc/JmlDocType.java @@ -21,16 +21,16 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public class JmlDocType extends TypeDeclaration implements JmlDocContainer { +public class JmlDocType extends TypeDeclaration implements JmlDocContainer { private NodeList jmlComments; - public JmlDocType(NodeList jmlComments) { + public JmlDocType(NodeList jmlComments) { this.jmlComments = jmlComments; } @AllFieldsConstructor - public JmlDocType(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members, NodeList jmlComments) { + public JmlDocType(NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members, NodeList jmlComments) { super(modifiers, annotations, name, members); this.jmlComments = jmlComments; } @@ -39,59 +39,59 @@ public JmlDocType(NodeList modifiers, NodeList annota * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDocType(TokenRange tokenRange, NodeList jmlComments) { + public JmlDocType(TokenRange tokenRange, NodeList jmlComments) { setJmlComments(jmlComments); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public ResolvedReferenceTypeDeclaration resolve() { + public ResolvedReferenceTypeDeclaration resolve() { return null; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocType() { + public boolean isJmlDocType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocType asJmlDocType() { + public JmlDocType asJmlDocType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocType() { + public Optional toJmlDocType() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocType(Consumer action) { + public void ifJmlDocType(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlComments() { + public NodeList getJmlComments() { return jmlComments; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlDocType setJmlComments(final NodeList jmlComments) { + public JmlDocType setJmlComments(final NodeList jmlComments) { assertNotNull(jmlComments); if (jmlComments == this.jmlComments) { return this; @@ -106,7 +106,7 @@ public JmlDocType setJmlComments(final NodeList jmlComments) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -121,7 +121,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -136,13 +136,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlDocType clone() { + public JmlDocType clone() { return (JmlDocType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlDocTypeMetaModel getMetaModel() { + public JmlDocTypeMetaModel getMetaModel() { return JavaParserMetaModel.jmlDocTypeMetaModel; } @@ -150,7 +150,7 @@ public JmlDocTypeMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlDocType(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members, NodeList jmlComments) { + public JmlDocType(TokenRange tokenRange, NodeList modifiers, NodeList annotations, SimpleName name, NodeList> members, NodeList jmlComments) { super(tokenRange, modifiers, annotations, name, members); setJmlComments(jmlComments); customInitialization(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlBinaryInfixExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlBinaryInfixExpr.java index f646651462..72d655919a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlBinaryInfixExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlBinaryInfixExpr.java @@ -21,7 +21,7 @@ * @author Alexander Weigl * @version 1 (7/3/21) */ -public class JmlBinaryInfixExpr extends Expression { +public class JmlBinaryInfixExpr extends Expression { private Expression left; @@ -29,12 +29,12 @@ public class JmlBinaryInfixExpr extends Expression { private SimpleName operator; - public JmlBinaryInfixExpr(Expression left, Expression right, JavaToken operator) { + public JmlBinaryInfixExpr(Expression left, Expression right, JavaToken operator) { this(null, left, right, nameFromToken(operator)); } @AllFieldsConstructor - public JmlBinaryInfixExpr(Expression left, Expression right, SimpleName operator) { + public JmlBinaryInfixExpr(Expression left, Expression right, SimpleName operator) { this(null, left, right, operator); } @@ -42,7 +42,7 @@ public JmlBinaryInfixExpr(Expression left, Expression right, SimpleName operato * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlBinaryInfixExpr(TokenRange tokenRange, Expression left, Expression right, SimpleName operator) { + public JmlBinaryInfixExpr(TokenRange tokenRange, Expression left, Expression right, SimpleName operator) { super(tokenRange); setLeft(left); setRight(right); @@ -50,7 +50,7 @@ public JmlBinaryInfixExpr(TokenRange tokenRange, Expression left, Expression ri customInitialization(); } - public JmlBinaryInfixExpr(TokenRange range, Expression left, Expression right, JavaToken op) { + public JmlBinaryInfixExpr(TokenRange range, Expression left, Expression right, JavaToken op) { this(range, left, right, nameFromToken(op)); } @@ -60,47 +60,47 @@ private static SimpleName nameFromToken(JavaToken op) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBinaryInfixExpr() { + public boolean isJmlBinaryInfixExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlBinaryInfixExpr asJmlBinaryInfixExpr() { + public JmlBinaryInfixExpr asJmlBinaryInfixExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBinaryInfixExpr() { + public Optional toJmlBinaryInfixExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBinaryInfixExpr(Consumer action) { + public void ifJmlBinaryInfixExpr(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getLeft() { + public Expression getLeft() { return left; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlBinaryInfixExpr setLeft(final Expression left) { + public JmlBinaryInfixExpr setLeft(final Expression left) { assertNotNull(left); if (left == this.left) { return this; @@ -114,12 +114,12 @@ public JmlBinaryInfixExpr setLeft(final Expression left) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getOperator() { + public SimpleName getOperator() { return operator; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlBinaryInfixExpr setOperator(final SimpleName operator) { + public JmlBinaryInfixExpr setOperator(final SimpleName operator) { assertNotNull(operator); if (operator == this.operator) { return this; @@ -133,12 +133,12 @@ public JmlBinaryInfixExpr setOperator(final SimpleName operator) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getRight() { + public Expression getRight() { return right; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlBinaryInfixExpr setRight(final Expression right) { + public JmlBinaryInfixExpr setRight(final Expression right) { assertNotNull(right); if (right == this.right) { return this; @@ -153,7 +153,7 @@ public JmlBinaryInfixExpr setRight(final Expression right) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -174,13 +174,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlBinaryInfixExpr clone() { + public JmlBinaryInfixExpr clone() { return (JmlBinaryInfixExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlBinaryInfixExprMetaModel getMetaModel() { + public JmlBinaryInfixExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlBinaryInfixExprMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLabelExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLabelExpr.java index eb82749a81..b9bd8a2320 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLabelExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLabelExpr.java @@ -24,7 +24,7 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlLabelExpr extends Expression implements Jmlish { +public class JmlLabelExpr extends Expression implements Jmlish { private Kind kind; @@ -33,11 +33,11 @@ public class JmlLabelExpr extends Expression implements Jmlish { private Expression expression; @AllFieldsConstructor - public JmlLabelExpr(final Kind kind, SimpleName label, final Expression expression) { + public JmlLabelExpr(final Kind kind, SimpleName label, final Expression expression) { this(null, kind, label, expression); } - public JmlLabelExpr(TokenRange range, JavaToken quant, SimpleName name, Expression expr) { + public JmlLabelExpr(TokenRange range, JavaToken quant, SimpleName name, Expression expr) { this(range, token2Kind(quant), name, expr); } @@ -45,7 +45,7 @@ private static Kind token2Kind(JavaToken token) { return Arrays.stream(Kind.values()).filter(it -> it.jmlSymbol().equals(token.getText())).findFirst().get(); } - public enum Kind implements JmlKeyword { + public enum Kind implements JmlKeyword { NEUTRAL("\\lbl"), POSITIVE("\\lblpos"), NEGATIVE("\\lblneg"); @@ -56,55 +56,55 @@ public enum Kind implements JmlKeyword { } @Override - public String jmlSymbol() { + public String jmlSymbol() { return symbol; } } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public boolean hasParentNode() { + public boolean hasParentNode() { return false; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabel() { + public boolean isJmlLabel() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelExpr asJmlLabel() { + public JmlLabelExpr asJmlLabel() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabel() { + public Optional toJmlLabel() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabel(Consumer action) { + public void ifJmlLabel(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -121,7 +121,7 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlLabelExpr clone() { + public JmlLabelExpr clone() { return (JmlLabelExpr) accept(new CloneVisitor(), null); } @@ -129,18 +129,18 @@ public JmlLabelExpr clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlLabelExpr(TokenRange tokenRange) { + public JmlLabelExpr(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLabelExpr setExpression(final Expression expression) { + public JmlLabelExpr setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -154,12 +154,12 @@ public JmlLabelExpr setExpression(final Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Kind getKind() { + public Kind getKind() { return kind; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLabelExpr setKind(final Kind kind) { + public JmlLabelExpr setKind(final Kind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -172,7 +172,7 @@ public JmlLabelExpr setKind(final Kind kind) { /** * This constructor is used by the parser and is considered private. */ - public JmlLabelExpr(TokenRange tokenRange, Kind kind, Expression expression) { + public JmlLabelExpr(TokenRange tokenRange, Kind kind, Expression expression) { super(tokenRange); setKind(kind); setExpression(expression); @@ -180,12 +180,12 @@ public JmlLabelExpr(TokenRange tokenRange, Kind kind, Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getLabel() { + public SimpleName getLabel() { return label; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLabelExpr setLabel(final SimpleName label) { + public JmlLabelExpr setLabel(final SimpleName label) { assertNotNull(label); if (label == this.label) { return this; @@ -202,7 +202,7 @@ public JmlLabelExpr setLabel(final SimpleName label) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlLabelExpr(TokenRange tokenRange, Kind kind, SimpleName label, Expression expression) { + public JmlLabelExpr(TokenRange tokenRange, Kind kind, SimpleName label, Expression expression) { super(tokenRange); setKind(kind); setLabel(label); @@ -212,31 +212,31 @@ public JmlLabelExpr(TokenRange tokenRange, Kind kind, SimpleName label, Express @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabelExpr() { + public boolean isJmlLabelExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelExpr asJmlLabelExpr() { + public JmlLabelExpr asJmlLabelExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabelExpr() { + public Optional toJmlLabelExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabelExpr(Consumer action) { + public void ifJmlLabelExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlLabelExprMetaModel getMetaModel() { + public JmlLabelExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlLabelExprMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLetExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLetExpr.java index 67a554e11b..3c6efb7493 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLetExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlLetExpr.java @@ -21,66 +21,66 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlLetExpr extends Expression implements Jmlish { +public class JmlLetExpr extends Expression implements Jmlish { private VariableDeclarationExpr variables; private Expression body; @AllFieldsConstructor - public JmlLetExpr(VariableDeclarationExpr variables, Expression body) { + public JmlLetExpr(VariableDeclarationExpr variables, Expression body) { this.variables = variables; this.body = body; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public boolean hasParentNode() { + public boolean hasParentNode() { return false; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLetExpr() { + public boolean isJmlLetExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLetExpr asJmlLetExpr() { + public JmlLetExpr asJmlLetExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLetExpr() { + public Optional toJmlLetExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLetExpr(Consumer action) { + public void ifJmlLetExpr(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getBody() { + public Expression getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLetExpr setBody(final Expression body) { + public JmlLetExpr setBody(final Expression body) { assertNotNull(body); if (body == this.body) { return this; @@ -94,12 +94,12 @@ public JmlLetExpr setBody(final Expression body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr getVariables() { + public VariableDeclarationExpr getVariables() { return variables; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLetExpr setVariables(final VariableDeclarationExpr variables) { + public JmlLetExpr setVariables(final VariableDeclarationExpr variables) { assertNotNull(variables); if (variables == this.variables) { return this; @@ -114,7 +114,7 @@ public JmlLetExpr setVariables(final VariableDeclarationExpr variables) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -131,13 +131,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlLetExpr clone() { + public JmlLetExpr clone() { return (JmlLetExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlLetExprMetaModel getMetaModel() { + public JmlLetExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlLetExprMetaModel; } @@ -145,7 +145,7 @@ public JmlLetExprMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlLetExpr(TokenRange tokenRange, VariableDeclarationExpr variables, Expression body) { + public JmlLetExpr(TokenRange tokenRange, VariableDeclarationExpr variables, Expression body) { super(tokenRange); setVariables(variables); setBody(body); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlMultiCompareExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlMultiCompareExpr.java index 30c12aad35..647e27c851 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlMultiCompareExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlMultiCompareExpr.java @@ -21,15 +21,15 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlMultiCompareExpr extends Expression implements Jmlish { +public class JmlMultiCompareExpr extends Expression implements Jmlish { - public JmlMultiCompareExpr(TokenRange range, NodeList expressions, List ops) { + public JmlMultiCompareExpr(TokenRange range, NodeList expressions, List ops) { this(range, expressions, new Operators(ops)); } public static class Operators extends ArrayList { - public Operators(List ops) { + public Operators(List ops) { super(ops); } } @@ -40,7 +40,7 @@ public Operators(List ops) { private Operators operators; @AllFieldsConstructor - public JmlMultiCompareExpr(NodeList expressions, Operators operators) { + public JmlMultiCompareExpr(NodeList expressions, Operators operators) { this(null, expressions, operators); } @@ -48,7 +48,7 @@ public JmlMultiCompareExpr(NodeList expressions, Operators operator * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlMultiCompareExpr(TokenRange tokenRange, NodeList expressions, Operators operators) { + public JmlMultiCompareExpr(TokenRange tokenRange, NodeList expressions, Operators operators) { super(tokenRange); setExpressions(expressions); setOperators(operators); @@ -57,49 +57,49 @@ public JmlMultiCompareExpr(TokenRange tokenRange, NodeList expressi @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlMultiCompareExpr() { + public boolean isJmlMultiCompareExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlMultiCompareExpr asJmlMultiCompareExpr() { + public JmlMultiCompareExpr asJmlMultiCompareExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlMultiCompareExpr() { + public Optional toJmlMultiCompareExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlMultiCompareExpr(Consumer action) { + public void ifJmlMultiCompareExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlMultiCompareExpr clone() { + public JmlMultiCompareExpr clone() { return (JmlMultiCompareExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlMultiCompareExprMetaModel getMetaModel() { + public JmlMultiCompareExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlMultiCompareExprMetaModel; } @@ -107,18 +107,18 @@ public JmlMultiCompareExprMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlMultiCompareExpr(TokenRange tokenRange) { + public JmlMultiCompareExpr(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getExpressions() { + public NodeList getExpressions() { return expressions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMultiCompareExpr setExpressions(final NodeList expressions) { + public JmlMultiCompareExpr setExpressions(final NodeList expressions) { assertNotNull(expressions); if (expressions == this.expressions) { return this; @@ -132,12 +132,12 @@ public JmlMultiCompareExpr setExpressions(final NodeList expression } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Operators getOperators() { + public Operators getOperators() { return operators; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlMultiCompareExpr setOperators(final Operators operators) { + public JmlMultiCompareExpr setOperators(final Operators operators) { assertNotNull(operators); if (operators == this.operators) { return this; @@ -149,7 +149,7 @@ public JmlMultiCompareExpr setOperators(final Operators operators) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -164,7 +164,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlQuantifiedExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlQuantifiedExpr.java index 3664671fc8..e3a4151c54 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlQuantifiedExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlQuantifiedExpr.java @@ -44,15 +44,15 @@ * * @author Alexander Weigl */ -public class JmlQuantifiedExpr extends Expression implements Jmlish { +public class JmlQuantifiedExpr extends Expression implements Jmlish { - public interface JmlBinder extends JmlKeyword { + public interface JmlBinder extends JmlKeyword { } /** * 12.4.24.2 Generalized Quantifiers */ - public enum JmlDefaultBinder implements JmlBinder { + public enum JmlDefaultBinder implements JmlBinder { FORALL("\\forall"), EXISTS("\\exists"), @@ -83,7 +83,7 @@ public static JmlBinder valueOf(JavaToken binder) { } @Override - public String jmlSymbol() { + public String jmlSymbol() { return symbol; } } @@ -96,20 +96,20 @@ public String jmlSymbol() { @NonEmptyProperty private NodeList expressions; - public JmlQuantifiedExpr() { + public JmlQuantifiedExpr() { this(null, JmlDefaultBinder.EXISTS, new NodeList<>(), new NodeList<>()); } - public JmlQuantifiedExpr(final NodeList variables, final Expression expressions) { + public JmlQuantifiedExpr(final NodeList variables, final Expression expressions) { this(null, JmlDefaultBinder.EXISTS, variables, new NodeList<>(expressions)); } @AllFieldsConstructor - public JmlQuantifiedExpr(final JmlBinder binder, final NodeList variables, final Expression expressions) { + public JmlQuantifiedExpr(final JmlBinder binder, final NodeList variables, final Expression expressions) { this(null, binder, variables, new NodeList<>(expressions)); } - public JmlQuantifiedExpr(TokenRange tokenRange, JavaToken binder, NodeList variables, NodeList expressions) { + public JmlQuantifiedExpr(TokenRange tokenRange, JavaToken binder, NodeList variables, NodeList expressions) { this(tokenRange, JmlDefaultBinder.valueOf(binder), variables, new NodeList<>(expressions)); } @@ -117,7 +117,7 @@ public JmlQuantifiedExpr(TokenRange tokenRange, JavaToken binder, NodeList variables, NodeList expressions) { + public JmlQuantifiedExpr(TokenRange tokenRange, JmlBinder binder, NodeList variables, NodeList expressions) { super(tokenRange); setBinder(binder); setVariables(variables); @@ -127,47 +127,47 @@ public JmlQuantifiedExpr(TokenRange tokenRange, JmlBinder binder, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBindingExpr() { + public boolean isJmlBindingExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlQuantifiedExpr asJmlBindingExpr() { + public JmlQuantifiedExpr asJmlBindingExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBindingExpr() { + public Optional toJmlBindingExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBindingExpr(Consumer action) { + public void ifJmlBindingExpr(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getExpressions() { + public NodeList getExpressions() { return expressions; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlQuantifiedExpr setExpressions(final NodeList expressions) { + public JmlQuantifiedExpr setExpressions(final NodeList expressions) { assertNotNull(expressions); if (expressions == this.expressions) { return this; @@ -181,12 +181,12 @@ public JmlQuantifiedExpr setExpressions(final NodeList expressions) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getVariables() { + public NodeList getVariables() { return variables; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlQuantifiedExpr setVariables(final NodeList variables) { + public JmlQuantifiedExpr setVariables(final NodeList variables) { assertNotNull(variables); if (variables == this.variables) { return this; @@ -201,7 +201,7 @@ public JmlQuantifiedExpr setVariables(final NodeList variables) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -222,7 +222,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -243,17 +243,17 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlQuantifiedExpr clone() { + public JmlQuantifiedExpr clone() { return (JmlQuantifiedExpr) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlBinder getBinder() { + public JmlBinder getBinder() { return binder; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlQuantifiedExpr setBinder(final JmlBinder binder) { + public JmlQuantifiedExpr setBinder(final JmlBinder binder) { assertNotNull(binder); if (binder == this.binder) { return this; @@ -265,31 +265,31 @@ public JmlQuantifiedExpr setBinder(final JmlBinder binder) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlQuantifiedExpr() { + public boolean isJmlQuantifiedExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlQuantifiedExpr asJmlQuantifiedExpr() { + public JmlQuantifiedExpr asJmlQuantifiedExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlQuantifiedExpr() { + public Optional toJmlQuantifiedExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlQuantifiedExpr(Consumer action) { + public void ifJmlQuantifiedExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlQuantifiedExprMetaModel getMetaModel() { + public JmlQuantifiedExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlQuantifiedExprMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java index 52a59ff4aa..6d1e595678 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlSetComprehensionExpr.java @@ -27,17 +27,17 @@ * @author Alexander Weigl * @version 1 (3/20/21) */ -public class JmlSetComprehensionExpr extends Expression implements Jmlish { +public class JmlSetComprehensionExpr extends Expression implements Jmlish { private VariableDeclarator binding; private Expression predicate; - public JmlSetComprehensionExpr() { + public JmlSetComprehensionExpr() { } @AllFieldsConstructor - public JmlSetComprehensionExpr(VariableDeclarator binding, Expression predicate) { + public JmlSetComprehensionExpr(VariableDeclarator binding, Expression predicate) { this.binding = binding; this.predicate = predicate; } @@ -46,7 +46,7 @@ public JmlSetComprehensionExpr(VariableDeclarator binding, Expression predicate * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlSetComprehensionExpr(TokenRange tokenRange, VariableDeclarator binding, Expression predicate) { + public JmlSetComprehensionExpr(TokenRange tokenRange, VariableDeclarator binding, Expression predicate) { super(tokenRange); setBinding(binding); setPredicate(predicate); @@ -55,47 +55,47 @@ public JmlSetComprehensionExpr(TokenRange tokenRange, VariableDeclarator bindin @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSetComprehension() { + public boolean isJmlSetComprehension() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSetComprehensionExpr asJmlSetComprehension() { + public JmlSetComprehensionExpr asJmlSetComprehension() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSetComprehension() { + public Optional toJmlSetComprehension() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSetComprehension(Consumer action) { + public void ifJmlSetComprehension(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarator getBinding() { + public VariableDeclarator getBinding() { return binding; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSetComprehensionExpr setBinding(final VariableDeclarator binding) { + public JmlSetComprehensionExpr setBinding(final VariableDeclarator binding) { assertNotNull(binding); if (binding == this.binding) { return this; @@ -109,12 +109,12 @@ public JmlSetComprehensionExpr setBinding(final VariableDeclarator binding) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getPredicate() { + public Expression getPredicate() { return predicate; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlSetComprehensionExpr setPredicate(final Expression predicate) { + public JmlSetComprehensionExpr setPredicate(final Expression predicate) { assertNotNull(predicate); if (predicate == this.predicate) { return this; @@ -129,7 +129,7 @@ public JmlSetComprehensionExpr setPredicate(final Expression predicate) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -146,37 +146,37 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlSetComprehensionExpr clone() { + public JmlSetComprehensionExpr clone() { return (JmlSetComprehensionExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlSetComprehensionExprMetaModel getMetaModel() { + public JmlSetComprehensionExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlSetComprehensionExprMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSetComprehensionExpr() { + public boolean isJmlSetComprehensionExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlSetComprehensionExpr asJmlSetComprehensionExpr() { + public JmlSetComprehensionExpr asJmlSetComprehensionExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlSetComprehensionExpr() { + public Optional toJmlSetComprehensionExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlSetComprehensionExpr(Consumer action) { + public void ifJmlSetComprehensionExpr(Consumer action) { action.accept(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlTypeExpr.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlTypeExpr.java index 84a4245d6e..50c94f3f89 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlTypeExpr.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/expr/JmlTypeExpr.java @@ -20,12 +20,12 @@ * @author Alexander Weigl * @version 1 (12/29/21) */ -public class JmlTypeExpr extends Expression { +public class JmlTypeExpr extends Expression { private Type type; @AllFieldsConstructor - public JmlTypeExpr(Type type) { + public JmlTypeExpr(Type type) { this(type.getTokenRange().orElseGet(null), type); } @@ -33,7 +33,7 @@ public JmlTypeExpr(Type type) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlTypeExpr(TokenRange tokenRange, Type type) { + public JmlTypeExpr(TokenRange tokenRange, Type type) { super(tokenRange); setType(type); customInitialization(); @@ -41,23 +41,23 @@ public JmlTypeExpr(TokenRange tokenRange, Type type) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlTypeExpr setType(final Type type) { + public JmlTypeExpr setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -72,31 +72,31 @@ public JmlTypeExpr setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlTypeExpr() { + public boolean isJmlTypeExpr() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlTypeExpr asJmlTypeExpr() { + public JmlTypeExpr asJmlTypeExpr() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlTypeExpr() { + public Optional toJmlTypeExpr() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlTypeExpr(Consumer action) { + public void ifJmlTypeExpr(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -109,13 +109,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlTypeExpr clone() { + public JmlTypeExpr clone() { return (JmlTypeExpr) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlTypeExprMetaModel getMetaModel() { + public JmlTypeExprMetaModel getMetaModel() { return JavaParserMetaModel.jmlTypeExprMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlBeginStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlBeginStmt.java index 0766fdca7f..9ea0ebb261 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlBeginStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlBeginStmt.java @@ -21,60 +21,60 @@ * @author Alexander Weigl * @version 1 (06.03.22) */ -public class JmlBeginStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlBeginStmt extends JmlStatement implements NodeWithJmlTags { private NodeList jmlTags; @AllFieldsConstructor - public JmlBeginStmt(NodeList jmlTags) { + public JmlBeginStmt(NodeList jmlTags) { this(null, jmlTags); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBeginStmt() { + public boolean isJmlBeginStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlBeginStmt asJmlBeginStmt() { + public JmlBeginStmt asJmlBeginStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBeginStmt() { + public Optional toJmlBeginStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBeginStmt(Consumer action) { + public void ifJmlBeginStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlBeginStmt clone() { + public JmlBeginStmt clone() { return (JmlBeginStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlBeginStmtMetaModel getMetaModel() { + public JmlBeginStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlBeginStmtMetaModel; } @@ -82,19 +82,19 @@ public JmlBeginStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlBeginStmt(TokenRange tokenRange, NodeList jmlTags) { + public JmlBeginStmt(TokenRange tokenRange, NodeList jmlTags) { super(tokenRange); setJmlTags(jmlTags); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlBeginStmt setJmlTags(final NodeList jmlTags) { + public JmlBeginStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -109,7 +109,7 @@ public JmlBeginStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -124,7 +124,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlEndStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlEndStmt.java index 12b6537ce8..52b958144b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlEndStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlEndStmt.java @@ -21,60 +21,60 @@ * @author Alexander Weigl * @version 1 (06.03.22) */ -public class JmlEndStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlEndStmt extends JmlStatement implements NodeWithJmlTags { private NodeList jmlTags; @AllFieldsConstructor - public JmlEndStmt(NodeList jmlTags) { + public JmlEndStmt(NodeList jmlTags) { this(null, jmlTags); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlEndStmt() { + public boolean isJmlEndStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlEndStmt asJmlEndStmt() { + public JmlEndStmt asJmlEndStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlEndStmt() { + public Optional toJmlEndStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlEndStmt(Consumer action) { + public void ifJmlEndStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlEndStmt clone() { + public JmlEndStmt clone() { return (JmlEndStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlEndStmtMetaModel getMetaModel() { + public JmlEndStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlEndStmtMetaModel; } @@ -82,19 +82,19 @@ public JmlEndStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlEndStmt(TokenRange tokenRange, NodeList jmlTags) { + public JmlEndStmt(TokenRange tokenRange, NodeList jmlTags) { super(tokenRange); setJmlTags(jmlTags); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlEndStmt setJmlTags(final NodeList jmlTags) { + public JmlEndStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -109,7 +109,7 @@ public JmlEndStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -124,7 +124,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java index c86b18bde7..bd61ec67b0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlExpressionStmt.java @@ -25,9 +25,9 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlExpressionStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlExpressionStmt extends JmlStatement implements NodeWithJmlTags { - public enum JmlStmtKind implements JmlKeyword { + public enum JmlStmtKind implements JmlKeyword { ASSERT(GeneratedJavaParserConstants.ASSERT), ASSERT_REDUNDANTLY(GeneratedJavaParserConstants.ASSERT_REDUNDANTLY), @@ -44,7 +44,7 @@ public enum JmlStmtKind implements JmlKeyword { } @Override - public String jmlSymbol() { + public String jmlSymbol() { return name().toLowerCase(); } } @@ -56,11 +56,11 @@ public String jmlSymbol() { private NodeList jmlTags; @AllFieldsConstructor - public JmlExpressionStmt(NodeList jmlTags, final JmlStmtKind kind, final Expression expression) { + public JmlExpressionStmt(NodeList jmlTags, final JmlStmtKind kind, final Expression expression) { this(null, jmlTags, kind, expression); } - public JmlExpressionStmt(TokenRange range, NodeList jmlTags, final Expression expression) { + public JmlExpressionStmt(TokenRange range, NodeList jmlTags, final Expression expression) { this(range, jmlTags, JmlStmtKind.ASSERT, expression); int tt = range.getBegin().getKind(); Optional k = Arrays.stream(JmlStmtKind.values()).filter(i -> i.tokenType == tt).findFirst(); @@ -72,43 +72,43 @@ public JmlExpressionStmt(TokenRange range, NodeList jmlTags, final @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlAssertStmt() { + public boolean isJmlAssertStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlAssertStmt() { + public JmlExpressionStmt asJmlAssertStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlAssertStmt() { + public Optional toJmlAssertStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlAssertStmt(Consumer action) { + public void ifJmlAssertStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -127,13 +127,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlExpressionStmt clone() { + public JmlExpressionStmt clone() { return (JmlExpressionStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlExpressionStmtMetaModel getMetaModel() { + public JmlExpressionStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlExpressionStmtMetaModel; } @@ -141,18 +141,18 @@ public JmlExpressionStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlExpressionStmt(TokenRange tokenRange) { + public JmlExpressionStmt(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlExpressionStmt setExpression(final Expression expression) { + public JmlExpressionStmt setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -169,7 +169,7 @@ public JmlExpressionStmt setExpression(final Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlExpressionStmt(TokenRange tokenRange, NodeList jmlTags, JmlStmtKind kind, Expression expression) { + public JmlExpressionStmt(TokenRange tokenRange, NodeList jmlTags, JmlStmtKind kind, Expression expression) { super(tokenRange); setJmlTags(jmlTags); setKind(kind); @@ -179,35 +179,35 @@ public JmlExpressionStmt(TokenRange tokenRange, NodeList jmlTags, J @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlStmtWithExpression() { + public boolean isJmlStmtWithExpression() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlStmtWithExpression() { + public JmlExpressionStmt asJmlStmtWithExpression() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlStmtWithExpression() { + public Optional toJmlStmtWithExpression() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlStmtWithExpression(Consumer action) { + public void ifJmlStmtWithExpression(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlStmtKind getKind() { + public JmlStmtKind getKind() { return kind; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlExpressionStmt setKind(final JmlStmtKind kind) { + public JmlExpressionStmt setKind(final JmlStmtKind kind) { assertNotNull(kind); if (kind == this.kind) { return this; @@ -219,35 +219,35 @@ public JmlExpressionStmt setKind(final JmlStmtKind kind) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlExpressionStmt() { + public boolean isJmlExpressionStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlExpressionStmt() { + public JmlExpressionStmt asJmlExpressionStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlExpressionStmt() { + public Optional toJmlExpressionStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlExpressionStmt(Consumer action) { + public void ifJmlExpressionStmt(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlExpressionStmt setJmlTags(final NodeList jmlTags) { + public JmlExpressionStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -262,7 +262,7 @@ public JmlExpressionStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlGhostStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlGhostStmt.java index fc21d3ee6a..9284595558 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlGhostStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlGhostStmt.java @@ -22,14 +22,14 @@ * @author Alexander Weigl * @version 1 (3/26/21) */ -public class JmlGhostStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlGhostStmt extends JmlStatement implements NodeWithJmlTags { private Statement statement; private NodeList jmlTags; @AllFieldsConstructor - public JmlGhostStmt(NodeList jmlTags, Statement statement) { + public JmlGhostStmt(NodeList jmlTags, Statement statement) { this(null, jmlTags, statement); } @@ -37,7 +37,7 @@ public JmlGhostStmt(NodeList jmlTags, Statement statement) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlGhostStmt(TokenRange tokenRange, NodeList jmlTags, Statement statement) { + public JmlGhostStmt(TokenRange tokenRange, NodeList jmlTags, Statement statement) { super(tokenRange); setJmlTags(jmlTags); setStatement(statement); @@ -46,23 +46,23 @@ public JmlGhostStmt(TokenRange tokenRange, NodeList jmlTags, Statem @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getStatement() { + public Statement getStatement() { return statement; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlGhostStmt setstatement(final Statement statement) { + public JmlGhostStmt setstatement(final Statement statement) { assertNotNull(statement); if (statement == this.statement) { return this; @@ -77,7 +77,7 @@ public JmlGhostStmt setstatement(final Statement statement) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -96,36 +96,36 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlGhostStmt clone() { + public JmlGhostStmt clone() { return (JmlGhostStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlGhostStatement() { + public boolean isJmlGhostStatement() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlGhostStmt asJmlGhostStatement() { + public JmlGhostStmt asJmlGhostStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlGhostStatement() { + public Optional toJmlGhostStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlGhostStatement(Consumer action) { + public void ifJmlGhostStatement(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlGhostStmt setStatement(final Statement statement) { + public JmlGhostStmt setStatement(final Statement statement) { assertNotNull(statement); if (statement == this.statement) { return this; @@ -140,41 +140,41 @@ public JmlGhostStmt setStatement(final Statement statement) { @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlGhostStmtMetaModel getMetaModel() { + public JmlGhostStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlGhostStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlGhostStmt() { + public boolean isJmlGhostStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlGhostStmt asJmlGhostStmt() { + public JmlGhostStmt asJmlGhostStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlGhostStmt() { + public Optional toJmlGhostStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlGhostStmt(Consumer action) { + public void ifJmlGhostStmt(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlGhostStmt setJmlTags(final NodeList jmlTags) { + public JmlGhostStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -189,7 +189,7 @@ public JmlGhostStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlLabelStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlLabelStmt.java index 18da1051b4..df1538e18c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlLabelStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlLabelStmt.java @@ -21,60 +21,60 @@ * @author Alexander Weigl * @version 1 (06.03.22) */ -public class JmlLabelStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlLabelStmt extends JmlStatement implements NodeWithJmlTags { private SimpleName label; private NodeList jmlTags; @AllFieldsConstructor - public JmlLabelStmt(NodeList jmlTags, SimpleName label) { + public JmlLabelStmt(NodeList jmlTags, SimpleName label) { this(null, jmlTags, label); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabelStmt() { + public boolean isJmlLabelStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelStmt asJmlLabelStmt() { + public JmlLabelStmt asJmlLabelStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabelStmt() { + public Optional toJmlLabelStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabelStmt(Consumer action) { + public void ifJmlLabelStmt(Consumer action) { action.accept(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getLabel() { + public SimpleName getLabel() { return label; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLabelStmt setLabel(final SimpleName label) { + public JmlLabelStmt setLabel(final SimpleName label) { assertNotNull(label); if (label == this.label) { return this; @@ -89,7 +89,7 @@ public JmlLabelStmt setLabel(final SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -108,13 +108,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlLabelStmt clone() { + public JmlLabelStmt clone() { return (JmlLabelStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlLabelStmtMetaModel getMetaModel() { + public JmlLabelStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlLabelStmtMetaModel; } @@ -122,7 +122,7 @@ public JmlLabelStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlLabelStmt(TokenRange tokenRange, NodeList jmlTags, SimpleName label) { + public JmlLabelStmt(TokenRange tokenRange, NodeList jmlTags, SimpleName label) { super(tokenRange); setJmlTags(jmlTags); setLabel(label); @@ -130,12 +130,12 @@ public JmlLabelStmt(TokenRange tokenRange, NodeList jmlTags, Simple } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlLabelStmt setJmlTags(final NodeList jmlTags) { + public JmlLabelStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -150,7 +150,7 @@ public JmlLabelStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlRefiningStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlRefiningStmt.java index 9cb825c500..c24eed4be2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlRefiningStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlRefiningStmt.java @@ -21,60 +21,60 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlRefiningStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlRefiningStmt extends JmlStatement implements NodeWithJmlTags { private NodeList jmlTags; @AllFieldsConstructor - public JmlRefiningStmt(NodeList jmlTags) { + public JmlRefiningStmt(NodeList jmlTags) { this(null, jmlTags); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlRefiningStmt() { + public boolean isJmlRefiningStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlRefiningStmt asJmlRefiningStmt() { + public JmlRefiningStmt asJmlRefiningStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlRefiningStmt() { + public Optional toJmlRefiningStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlRefiningStmt(Consumer action) { + public void ifJmlRefiningStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlRefiningStmt clone() { + public JmlRefiningStmt clone() { return (JmlRefiningStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlRefiningStmtMetaModel getMetaModel() { + public JmlRefiningStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlRefiningStmtMetaModel; } @@ -82,19 +82,19 @@ public JmlRefiningStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlRefiningStmt(TokenRange tokenRange, NodeList jmlTags) { + public JmlRefiningStmt(TokenRange tokenRange, NodeList jmlTags) { super(tokenRange); setJmlTags(jmlTags); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlRefiningStmt setJmlTags(final NodeList jmlTags) { + public JmlRefiningStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -109,7 +109,7 @@ public JmlRefiningStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -124,7 +124,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlStatement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlStatement.java index 6ee095182f..88ded9d08f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlStatement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlStatement.java @@ -19,51 +19,51 @@ public abstract class JmlStatement extends Statement implements Jmlish { @AllFieldsConstructor - public JmlStatement() { + public JmlStatement() { } /** * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlStatement(TokenRange tokenRange) { + public JmlStatement(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlStatement() { + public boolean isJmlStatement() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlStatement asJmlStatement() { + public JmlStatement asJmlStatement() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlStatement() { + public Optional toJmlStatement() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlStatement(Consumer action) { + public void ifJmlStatement(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlStatement clone() { + public JmlStatement clone() { return (JmlStatement) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlStatementMetaModel getMetaModel() { + public JmlStatementMetaModel getMetaModel() { return JavaParserMetaModel.jmlStatementMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlUnreachableStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlUnreachableStmt.java index 61839763f3..b931cddbde 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlUnreachableStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/stmt/JmlUnreachableStmt.java @@ -21,54 +21,54 @@ * @author Alexander Weigl * @version 1 (2/21/21) */ -public class JmlUnreachableStmt extends JmlStatement implements NodeWithJmlTags { +public class JmlUnreachableStmt extends JmlStatement implements NodeWithJmlTags { private NodeList jmlTags; @AllFieldsConstructor - public JmlUnreachableStmt(NodeList jmlTags) { + public JmlUnreachableStmt(NodeList jmlTags) { this(null, jmlTags); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnreachableStmt() { + public boolean isUnreachableStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlUnreachableStmt asUnreachableStmt() { + public JmlUnreachableStmt asUnreachableStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnreachableStmt() { + public Optional toUnreachableStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnreachableStmt(Consumer action) { + public void ifUnreachableStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public JmlUnreachableStmt clone() { + public JmlUnreachableStmt clone() { return (JmlUnreachableStmt) accept(new CloneVisitor(), null); } @@ -76,7 +76,7 @@ public JmlUnreachableStmt clone() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public JmlUnreachableStmt(TokenRange tokenRange, NodeList jmlTags) { + public JmlUnreachableStmt(TokenRange tokenRange, NodeList jmlTags) { super(tokenRange); setJmlTags(jmlTags); customInitialization(); @@ -84,41 +84,41 @@ public JmlUnreachableStmt(TokenRange tokenRange, NodeList jmlTags) @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlUnreachableStmt() { + public boolean isJmlUnreachableStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlUnreachableStmt asJmlUnreachableStmt() { + public JmlUnreachableStmt asJmlUnreachableStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlUnreachableStmt() { + public Optional toJmlUnreachableStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlUnreachableStmt(Consumer action) { + public void ifJmlUnreachableStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public JmlUnreachableStmtMetaModel getMetaModel() { + public JmlUnreachableStmtMetaModel getMetaModel() { return JavaParserMetaModel.jmlUnreachableStmtMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getJmlTags() { + public NodeList getJmlTags() { return jmlTags; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public JmlUnreachableStmt setJmlTags(final NodeList jmlTags) { + public JmlUnreachableStmt setJmlTags(final NodeList jmlTags) { assertNotNull(jmlTags); if (jmlTags == this.jmlTags) { return this; @@ -133,7 +133,7 @@ public JmlUnreachableStmt setJmlTags(final NodeList jmlTags) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -148,7 +148,7 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/type/JmlLogicType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/type/JmlLogicType.java index dbf1155336..967f20e6b4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/type/JmlLogicType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/type/JmlLogicType.java @@ -35,15 +35,15 @@ /** * A primitive type in JML. */ -public class JmlLogicType extends Type implements Jmlish { +public class JmlLogicType extends Type implements Jmlish { - public enum Primitive implements JmlKeyword { + public enum Primitive implements JmlKeyword { SET("\\set"), SEQ("\\seq"), MAP("\\map"), BIGINT("\\bigint"), BIGFLOAT("\\bigfloat"); final String symbol; - public String jmlSymbol() { + public String jmlSymbol() { return symbol; } @@ -54,53 +54,53 @@ public String jmlSymbol() { private final Primitive type; - public JmlLogicType() { + public JmlLogicType() { this(null, Primitive.BIGINT); } @AllFieldsConstructor - public JmlLogicType(Primitive type) { + public JmlLogicType(Primitive type) { this(null, type); } - public JmlLogicType(TokenRange range, final Primitive type) { + public JmlLogicType(TokenRange range, final Primitive type) { super(range); this.type = type; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return null; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Primitive getType() { + public Primitive getType() { return type; } @Override - public String toDescriptor() { + public String toDescriptor() { return type.symbol; } @Override - public String asString() { + public String asString() { return toDescriptor(); } @Override - public ResolvedPrimitiveType resolve() { + public ResolvedPrimitiveType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedPrimitiveType.class); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { return resolve(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDeclaration.java index 8d95fe9c88..7e3d6a2c14 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDeclaration.java @@ -41,7 +41,7 @@ /** * A Java 9 Jigsaw module declaration. {@code @Foo module com.github.abc { requires a.B; }} */ -public class ModuleDeclaration extends Node implements NodeWithName, NodeWithAnnotations { +public class ModuleDeclaration extends Node implements NodeWithName, NodeWithAnnotations { private Name name; @@ -51,16 +51,16 @@ public class ModuleDeclaration extends Node implements NodeWithName directives; - public ModuleDeclaration() { + public ModuleDeclaration() { this(null, new NodeList<>(), new Name(), false, new NodeList<>()); } - public ModuleDeclaration(Name name, boolean isOpen) { + public ModuleDeclaration(Name name, boolean isOpen) { this(null, new NodeList<>(), name, isOpen, new NodeList<>()); } @AllFieldsConstructor - public ModuleDeclaration(NodeList annotations, Name name, boolean isOpen, NodeList directives) { + public ModuleDeclaration(NodeList annotations, Name name, boolean isOpen, NodeList directives) { this(null, annotations, name, isOpen, directives); } @@ -68,7 +68,7 @@ public ModuleDeclaration(NodeList annotations, Name name, boole * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleDeclaration(TokenRange tokenRange, NodeList annotations, Name name, boolean isOpen, NodeList directives) { + public ModuleDeclaration(TokenRange tokenRange, NodeList annotations, Name name, boolean isOpen, NodeList directives) { super(tokenRange); setAnnotations(annotations); setName(name); @@ -79,23 +79,23 @@ public ModuleDeclaration(TokenRange tokenRange, NodeList annota @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleDeclaration setName(final Name name) { + public ModuleDeclaration setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -109,12 +109,12 @@ public ModuleDeclaration setName(final Name name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleDeclaration setAnnotations(final NodeList annotations) { + public ModuleDeclaration setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -129,7 +129,7 @@ public ModuleDeclaration setAnnotations(final NodeList annotati @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -149,12 +149,12 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isOpen() { + public boolean isOpen() { return isOpen; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleDeclaration setOpen(final boolean isOpen) { + public ModuleDeclaration setOpen(final boolean isOpen) { if (isOpen == this.isOpen) { return this; } @@ -164,12 +164,12 @@ public ModuleDeclaration setOpen(final boolean isOpen) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getDirectives() { + public NodeList getDirectives() { return directives; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleDeclaration setDirectives(final NodeList directives) { + public ModuleDeclaration setDirectives(final NodeList directives) { assertNotNull(directives); if (directives == this.directives) { return this; @@ -184,19 +184,19 @@ public ModuleDeclaration setDirectives(final NodeList directiv @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleDeclaration clone() { + public ModuleDeclaration clone() { return (ModuleDeclaration) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleDeclarationMetaModel getMetaModel() { + public ModuleDeclarationMetaModel getMetaModel() { return JavaParserMetaModel.moduleDeclarationMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -222,11 +222,11 @@ public boolean replace(Node node, Node replacementNode) { /** * Add a directive to the module, like "exports R.S to T1.U1, T2.U2;" */ - public ModuleDeclaration addDirective(String directive) { + public ModuleDeclaration addDirective(String directive) { return addDirective(parseModuleDirective(directive)); } - public ModuleDeclaration addDirective(ModuleDirective directive) { + public ModuleDeclaration addDirective(ModuleDirective directive) { getDirectives().add(directive); return this; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDirective.java index f09a697a75..579480c7d9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleDirective.java @@ -37,7 +37,7 @@ public abstract class ModuleDirective extends Node { @AllFieldsConstructor - public ModuleDirective() { + public ModuleDirective() { this(null); } @@ -45,210 +45,210 @@ public ModuleDirective() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleDirective(TokenRange tokenRange) { + public ModuleDirective(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleDirective clone() { + public ModuleDirective clone() { return (ModuleDirective) accept(new CloneVisitor(), null); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleExportsStmt() { + public boolean isModuleExportsStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleExportsDirective asModuleExportsStmt() { + public ModuleExportsDirective asModuleExportsStmt() { throw new IllegalStateException(f("%s is not an ModuleExportsDirective", this)); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleOpensStmt() { + public boolean isModuleOpensStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleOpensDirective asModuleOpensStmt() { + public ModuleOpensDirective asModuleOpensStmt() { throw new IllegalStateException(f("%s is not an ModuleOpensDirective", this)); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleProvidesStmt() { + public boolean isModuleProvidesStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleProvidesDirective asModuleProvidesStmt() { + public ModuleProvidesDirective asModuleProvidesStmt() { throw new IllegalStateException(f("%s is not an ModuleProvidesDirective", this)); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleRequiresStmt() { + public boolean isModuleRequiresStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleRequiresDirective asModuleRequiresStmt() { + public ModuleRequiresDirective asModuleRequiresStmt() { throw new IllegalStateException(f("%s is not an ModuleRequiresDirective", this)); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleUsesStmt() { + public boolean isModuleUsesStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleUsesDirective asModuleUsesStmt() { + public ModuleUsesDirective asModuleUsesStmt() { throw new IllegalStateException(f("%s is not an ModuleUsesDirective", this)); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleExportsStmt(Consumer action) { + public void ifModuleExportsStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleOpensStmt(Consumer action) { + public void ifModuleOpensStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleProvidesStmt(Consumer action) { + public void ifModuleProvidesStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleRequiresStmt(Consumer action) { + public void ifModuleRequiresStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleUsesStmt(Consumer action) { + public void ifModuleUsesStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleExportsStmt() { + public Optional toModuleExportsStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleOpensStmt() { + public Optional toModuleOpensStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleProvidesStmt() { + public Optional toModuleProvidesStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleRequiresStmt() { + public Optional toModuleRequiresStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleUsesStmt() { + public Optional toModuleUsesStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleExportsDirective() { + public boolean isModuleExportsDirective() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleExportsDirective asModuleExportsDirective() { + public ModuleExportsDirective asModuleExportsDirective() { throw new IllegalStateException(f("%s is not ModuleExportsDirective, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleExportsDirective() { + public Optional toModuleExportsDirective() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleExportsDirective(Consumer action) { + public void ifModuleExportsDirective(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleOpensDirective() { + public boolean isModuleOpensDirective() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleOpensDirective asModuleOpensDirective() { + public ModuleOpensDirective asModuleOpensDirective() { throw new IllegalStateException(f("%s is not ModuleOpensDirective, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleOpensDirective() { + public Optional toModuleOpensDirective() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleOpensDirective(Consumer action) { + public void ifModuleOpensDirective(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleProvidesDirective() { + public boolean isModuleProvidesDirective() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleProvidesDirective asModuleProvidesDirective() { + public ModuleProvidesDirective asModuleProvidesDirective() { throw new IllegalStateException(f("%s is not ModuleProvidesDirective, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleProvidesDirective() { + public Optional toModuleProvidesDirective() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleProvidesDirective(Consumer action) { + public void ifModuleProvidesDirective(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleRequiresDirective() { + public boolean isModuleRequiresDirective() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleRequiresDirective asModuleRequiresDirective() { + public ModuleRequiresDirective asModuleRequiresDirective() { throw new IllegalStateException(f("%s is not ModuleRequiresDirective, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleRequiresDirective() { + public Optional toModuleRequiresDirective() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleRequiresDirective(Consumer action) { + public void ifModuleRequiresDirective(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleUsesDirective() { + public boolean isModuleUsesDirective() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleUsesDirective asModuleUsesDirective() { + public ModuleUsesDirective asModuleUsesDirective() { throw new IllegalStateException(f("%s is not ModuleUsesDirective, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleUsesDirective() { + public Optional toModuleUsesDirective() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleUsesDirective(Consumer action) { + public void ifModuleUsesDirective(Consumer action) { } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleDirectiveMetaModel getMetaModel() { + public ModuleDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleExportsDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleExportsDirective.java index 12278732f9..946bcddbc5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleExportsDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleExportsDirective.java @@ -41,18 +41,18 @@ /** * An exports directive in module-info.java. {@code exports R.S to T1.U1, T2.U2;} */ -public class ModuleExportsDirective extends ModuleDirective implements NodeWithName { +public class ModuleExportsDirective extends ModuleDirective implements NodeWithName { private Name name; private NodeList moduleNames; - public ModuleExportsDirective() { + public ModuleExportsDirective() { this(null, new Name(), new NodeList<>()); } @AllFieldsConstructor - public ModuleExportsDirective(Name name, NodeList moduleNames) { + public ModuleExportsDirective(Name name, NodeList moduleNames) { this(null, name, moduleNames); } @@ -60,7 +60,7 @@ public ModuleExportsDirective(Name name, NodeList moduleNames) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleExportsDirective(TokenRange tokenRange, Name name, NodeList moduleNames) { + public ModuleExportsDirective(TokenRange tokenRange, Name name, NodeList moduleNames) { super(tokenRange); setName(name); setModuleNames(moduleNames); @@ -69,19 +69,19 @@ public ModuleExportsDirective(TokenRange tokenRange, Name name, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -95,12 +95,12 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleExportsDirective setName(final Name name) { + public ModuleExportsDirective setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -114,12 +114,12 @@ public ModuleExportsDirective setName(final Name name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModuleNames() { + public NodeList getModuleNames() { return moduleNames; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleExportsDirective setModuleNames(final NodeList moduleNames) { + public ModuleExportsDirective setModuleNames(final NodeList moduleNames) { assertNotNull(moduleNames); if (moduleNames == this.moduleNames) { return this; @@ -134,13 +134,13 @@ public ModuleExportsDirective setModuleNames(final NodeList moduleNames) @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleExportsDirective clone() { + public ModuleExportsDirective clone() { return (ModuleExportsDirective) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -159,59 +159,59 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleExportsStmt() { + public boolean isModuleExportsStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleExportsDirective asModuleExportsStmt() { + public ModuleExportsDirective asModuleExportsStmt() { return this; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleExportsStmt(Consumer action) { + public void ifModuleExportsStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleExportsStmt() { + public Optional toModuleExportsStmt() { return Optional.of(this); } - public ModuleExportsDirective addModuleName(String name) { + public ModuleExportsDirective addModuleName(String name) { moduleNames.add(parseName(name)); return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleExportsDirective() { + public boolean isModuleExportsDirective() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleExportsDirective asModuleExportsDirective() { + public ModuleExportsDirective asModuleExportsDirective() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleExportsDirective() { + public Optional toModuleExportsDirective() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleExportsDirective(Consumer action) { + public void ifModuleExportsDirective(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleExportsDirectiveMetaModel getMetaModel() { + public ModuleExportsDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleExportsDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleOpensDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleOpensDirective.java index 55cd784fb7..fa573908b9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleOpensDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleOpensDirective.java @@ -40,18 +40,18 @@ /** * An opens directive in module-info.java. {@code opens R.S to T1.U1, T2.U2;} */ -public class ModuleOpensDirective extends ModuleDirective implements NodeWithName { +public class ModuleOpensDirective extends ModuleDirective implements NodeWithName { private Name name; private NodeList moduleNames; - public ModuleOpensDirective() { + public ModuleOpensDirective() { this(null, new Name(), new NodeList<>()); } @AllFieldsConstructor - public ModuleOpensDirective(Name name, NodeList moduleNames) { + public ModuleOpensDirective(Name name, NodeList moduleNames) { this(null, name, moduleNames); } @@ -59,7 +59,7 @@ public ModuleOpensDirective(Name name, NodeList moduleNames) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleOpensDirective(TokenRange tokenRange, Name name, NodeList moduleNames) { + public ModuleOpensDirective(TokenRange tokenRange, Name name, NodeList moduleNames) { super(tokenRange); setName(name); setModuleNames(moduleNames); @@ -68,19 +68,19 @@ public ModuleOpensDirective(TokenRange tokenRange, Name name, NodeList mo @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -94,12 +94,12 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleOpensDirective setName(final Name name) { + public ModuleOpensDirective setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -113,12 +113,12 @@ public ModuleOpensDirective setName(final Name name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModuleNames() { + public NodeList getModuleNames() { return moduleNames; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleOpensDirective setModuleNames(final NodeList moduleNames) { + public ModuleOpensDirective setModuleNames(final NodeList moduleNames) { assertNotNull(moduleNames); if (moduleNames == this.moduleNames) { return this; @@ -133,13 +133,13 @@ public ModuleOpensDirective setModuleNames(final NodeList moduleNames) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleOpensDirective clone() { + public ModuleOpensDirective clone() { return (ModuleOpensDirective) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -158,54 +158,54 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleOpensStmt() { + public boolean isModuleOpensStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleOpensDirective asModuleOpensStmt() { + public ModuleOpensDirective asModuleOpensStmt() { return this; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleOpensStmt(Consumer action) { + public void ifModuleOpensStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleOpensStmt() { + public Optional toModuleOpensStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleOpensDirective() { + public boolean isModuleOpensDirective() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleOpensDirective asModuleOpensDirective() { + public ModuleOpensDirective asModuleOpensDirective() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleOpensDirective() { + public Optional toModuleOpensDirective() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleOpensDirective(Consumer action) { + public void ifModuleOpensDirective(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleOpensDirectiveMetaModel getMetaModel() { + public ModuleOpensDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleOpensDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleProvidesDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleProvidesDirective.java index a5f6a744db..4601e5d8ca 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleProvidesDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleProvidesDirective.java @@ -40,18 +40,18 @@ /** * A provides directive in module-info.java. {@code provides X.Y with Z1.Z2, Z3.Z4;} */ -public class ModuleProvidesDirective extends ModuleDirective implements NodeWithName { +public class ModuleProvidesDirective extends ModuleDirective implements NodeWithName { private Name name; private NodeList with; - public ModuleProvidesDirective() { + public ModuleProvidesDirective() { this(null, new Name(), new NodeList<>()); } @AllFieldsConstructor - public ModuleProvidesDirective(Name name, NodeList with) { + public ModuleProvidesDirective(Name name, NodeList with) { this(null, name, with); } @@ -59,7 +59,7 @@ public ModuleProvidesDirective(Name name, NodeList with) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleProvidesDirective(TokenRange tokenRange, Name name, NodeList with) { + public ModuleProvidesDirective(TokenRange tokenRange, Name name, NodeList with) { super(tokenRange); setName(name); setWith(with); @@ -68,19 +68,19 @@ public ModuleProvidesDirective(TokenRange tokenRange, Name name, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -95,40 +95,40 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleProvidesDirective clone() { + public ModuleProvidesDirective clone() { return (ModuleProvidesDirective) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleProvidesStmt() { + public boolean isModuleProvidesStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleProvidesDirective asModuleProvidesStmt() { + public ModuleProvidesDirective asModuleProvidesStmt() { return this; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleProvidesStmt(Consumer action) { + public void ifModuleProvidesStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleProvidesStmt() { + public Optional toModuleProvidesStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleProvidesDirective setName(final Name name) { + public ModuleProvidesDirective setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -142,7 +142,7 @@ public ModuleProvidesDirective setName(final Name name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleProvidesDirective setWith(final NodeList with) { + public ModuleProvidesDirective setWith(final NodeList with) { assertNotNull(with); if (with == this.with) { return this; @@ -156,13 +156,13 @@ public ModuleProvidesDirective setWith(final NodeList with) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getWith() { + public NodeList getWith() { return with; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -181,31 +181,31 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleProvidesDirective() { + public boolean isModuleProvidesDirective() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleProvidesDirective asModuleProvidesDirective() { + public ModuleProvidesDirective asModuleProvidesDirective() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleProvidesDirective() { + public Optional toModuleProvidesDirective() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleProvidesDirective(Consumer action) { + public void ifModuleProvidesDirective(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleProvidesDirectiveMetaModel getMetaModel() { + public ModuleProvidesDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleProvidesDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleRequiresDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleRequiresDirective.java index a871f760a5..7144cbcdd3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleRequiresDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleRequiresDirective.java @@ -40,18 +40,18 @@ /** * A require directive in module-info.java. {@code require a.b.C;} */ -public class ModuleRequiresDirective extends ModuleDirective implements NodeWithStaticModifier, NodeWithName { +public class ModuleRequiresDirective extends ModuleDirective implements NodeWithStaticModifier, NodeWithName { private NodeList modifiers; private Name name; - public ModuleRequiresDirective() { + public ModuleRequiresDirective() { this(null, new NodeList<>(), new Name()); } @AllFieldsConstructor - public ModuleRequiresDirective(NodeList modifiers, Name name) { + public ModuleRequiresDirective(NodeList modifiers, Name name) { this(null, modifiers, name); } @@ -59,7 +59,7 @@ public ModuleRequiresDirective(NodeList modifiers, Name name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleRequiresDirective(TokenRange tokenRange, NodeList modifiers, Name name) { + public ModuleRequiresDirective(TokenRange tokenRange, NodeList modifiers, Name name) { super(tokenRange); setModifiers(modifiers); setName(name); @@ -68,23 +68,23 @@ public ModuleRequiresDirective(TokenRange tokenRange, NodeList modifi @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getModifiers() { + public NodeList getModifiers() { return modifiers; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleRequiresDirective setModifiers(final NodeList modifiers) { + public ModuleRequiresDirective setModifiers(final NodeList modifiers) { assertNotNull(modifiers); if (modifiers == this.modifiers) { return this; @@ -98,12 +98,12 @@ public ModuleRequiresDirective setModifiers(final NodeList modifiers) } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleRequiresDirective setName(final Name name) { + public ModuleRequiresDirective setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -119,7 +119,7 @@ public ModuleRequiresDirective setName(final Name name) { /* * A requires static directive indicates that a module is required at compile time, but is optional at runtime. */ - public boolean isStatic() { + public boolean isStatic() { return hasModifier(STATIC); } @@ -127,17 +127,17 @@ public boolean isStatic() { * Requires transitive—implied readability. * To specify a dependency on another module and to ensure that other modules reading your module also read that dependency */ - public boolean isTransitive() { + public boolean isTransitive() { return hasModifier(TRANSITIVE); } - public ModuleRequiresDirective setTransitive(boolean set) { + public ModuleRequiresDirective setTransitive(boolean set) { return setModifier(TRANSITIVE, set); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -152,13 +152,13 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleRequiresDirective clone() { + public ModuleRequiresDirective clone() { return (ModuleRequiresDirective) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -177,54 +177,54 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleRequiresStmt() { + public boolean isModuleRequiresStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleRequiresDirective asModuleRequiresStmt() { + public ModuleRequiresDirective asModuleRequiresStmt() { return this; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleRequiresStmt(Consumer action) { + public void ifModuleRequiresStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleRequiresStmt() { + public Optional toModuleRequiresStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleRequiresDirective() { + public boolean isModuleRequiresDirective() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleRequiresDirective asModuleRequiresDirective() { + public ModuleRequiresDirective asModuleRequiresDirective() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleRequiresDirective() { + public Optional toModuleRequiresDirective() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleRequiresDirective(Consumer action) { + public void ifModuleRequiresDirective(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleRequiresDirectiveMetaModel getMetaModel() { + public ModuleRequiresDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleRequiresDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleUsesDirective.java b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleUsesDirective.java index 22280a17ad..648b8d56c2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleUsesDirective.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleUsesDirective.java @@ -39,16 +39,16 @@ /** * A uses directive in module-info.java. {@code uses V.W;} */ -public class ModuleUsesDirective extends ModuleDirective implements NodeWithName { +public class ModuleUsesDirective extends ModuleDirective implements NodeWithName { private Name name; - public ModuleUsesDirective() { + public ModuleUsesDirective() { this(null, new Name()); } @AllFieldsConstructor - public ModuleUsesDirective(Name name) { + public ModuleUsesDirective(Name name) { this(null, name); } @@ -56,7 +56,7 @@ public ModuleUsesDirective(Name name) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ModuleUsesDirective(TokenRange tokenRange, Name name) { + public ModuleUsesDirective(TokenRange tokenRange, Name name) { super(tokenRange); setName(name); customInitialization(); @@ -64,18 +64,18 @@ public ModuleUsesDirective(TokenRange tokenRange, Name name) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleUsesDirective setType(final Name name) { + public ModuleUsesDirective setType(final Name name) { assertNotNull(name); if (name == this.name) { return (ModuleUsesDirective) this; @@ -90,40 +90,40 @@ public ModuleUsesDirective setType(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ModuleUsesDirective clone() { + public ModuleUsesDirective clone() { return (ModuleUsesDirective) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleUsesStmt() { + public boolean isModuleUsesStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleUsesDirective asModuleUsesStmt() { + public ModuleUsesDirective asModuleUsesStmt() { return this; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleUsesStmt(Consumer action) { + public void ifModuleUsesStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleUsesStmt() { + public Optional toModuleUsesStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Name getName() { + public Name getName() { return name; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ModuleUsesDirective setName(final Name name) { + public ModuleUsesDirective setName(final Name name) { assertNotNull(name); if (name == this.name) { return this; @@ -138,7 +138,7 @@ public ModuleUsesDirective setName(final Name name) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -151,31 +151,31 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isModuleUsesDirective() { + public boolean isModuleUsesDirective() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ModuleUsesDirective asModuleUsesDirective() { + public ModuleUsesDirective asModuleUsesDirective() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toModuleUsesDirective() { + public Optional toModuleUsesDirective() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifModuleUsesDirective(Consumer action) { + public void ifModuleUsesDirective(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ModuleUsesDirectiveMetaModel getMetaModel() { + public ModuleUsesDirectiveMetaModel getMetaModel() { return JavaParserMetaModel.moduleUsesDirectiveMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java index b1299f78bf..22720c43c0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithAnnotations.java @@ -34,7 +34,7 @@ * @author Federico Tomassetti * @since July 2014 */ -public interface NodeWithAnnotations { +public interface NodeWithAnnotations { NodeList getAnnotations(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithArguments.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithArguments.java index d9556e8974..4c9edbe92d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithArguments.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithArguments.java @@ -29,7 +29,7 @@ /** * A node with arguments. */ -public interface NodeWithArguments { +public interface NodeWithArguments { N setArguments(NodeList arguments); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBlockStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBlockStmt.java index 082855fd0c..09e38420f5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBlockStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBlockStmt.java @@ -26,7 +26,7 @@ /** * A node with a body that is a BlockStmt. */ -public interface NodeWithBlockStmt { +public interface NodeWithBlockStmt { BlockStmt getBody(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBody.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBody.java index 5f5767de9e..35e0674e84 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBody.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithBody.java @@ -25,7 +25,7 @@ import com.github.javaparser.ast.stmt.EmptyStmt; import com.github.javaparser.ast.stmt.Statement; -public interface NodeWithBody { +public interface NodeWithBody { Statement getBody(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithCondition.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithCondition.java index 6b476b300b..0eca375e85 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithCondition.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithCondition.java @@ -23,7 +23,7 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.ast.expr.Expression; -public interface NodeWithCondition { +public interface NodeWithCondition { Expression getCondition(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java index c05b380c60..c6371f01d0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithDeclaration.java @@ -26,7 +26,7 @@ * @author Federico Tomassetti * @since July 2014 */ -public interface NodeWithDeclaration { +public interface NodeWithDeclaration { /** * As {@link NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean)} including diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExpression.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExpression.java index fdd73c1dfe..3a9d3dc6ba 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExpression.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExpression.java @@ -27,7 +27,7 @@ /** * A node that has an expression in it. */ -public interface NodeWithExpression { +public interface NodeWithExpression { Expression getExpression(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java index b0cd2bf750..f6503455ea 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithExtends.java @@ -28,7 +28,7 @@ /** * A node that explicitly extends other types, using the {@code extends} keyword. */ -public interface NodeWithExtends { +public interface NodeWithExtends { /** * @return All extended types that have been explicitly added (thus exist within the AST). diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithIdentifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithIdentifier.java index fd186ddc82..d7c99ce775 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithIdentifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithIdentifier.java @@ -23,7 +23,7 @@ import static com.github.javaparser.utils.Utils.assertNonEmpty; import com.github.javaparser.ast.Node; -public interface NodeWithIdentifier { +public interface NodeWithIdentifier { String getIdentifier(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java index d631e62765..0c6bde1673 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithImplements.java @@ -28,7 +28,7 @@ /** * A node that implements other types. */ -public interface NodeWithImplements { +public interface NodeWithImplements { NodeList getImplementedTypes(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithJavadoc.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithJavadoc.java index 83aceef166..97ae18ea6b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithJavadoc.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithJavadoc.java @@ -29,7 +29,7 @@ /** * A node that can be documented with a Javadoc comment. */ -public interface NodeWithJavadoc { +public interface NodeWithJavadoc { Optional getComment(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java index ce157e8eca..494cf1b9fd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithMembers.java @@ -43,7 +43,7 @@ * The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getMembers * method. */ -public interface NodeWithMembers extends NodeWithSimpleName { +public interface NodeWithMembers extends NodeWithSimpleName { /** * @return all members inside the braces of this node, diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java index b36e657b12..fa4f0b3848 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithModifiers.java @@ -33,7 +33,7 @@ * A Node with Modifiers. * Note that not all modifiers may be valid for this node. */ -public interface NodeWithModifiers { +public interface NodeWithModifiers { /** * Return the modifiers of this variable declaration. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithName.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithName.java index ff87fc4cd1..0206672fef 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithName.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithName.java @@ -32,7 +32,7 @@ * * @since 2.0.1 */ -public interface NodeWithName { +public interface NodeWithName { Name getName(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalBlockStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalBlockStmt.java index 5dac4152e2..dfc475534c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalBlockStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalBlockStmt.java @@ -27,7 +27,7 @@ /** * A node with a body that is a BlockStmt, which is optional. */ -public interface NodeWithOptionalBlockStmt { +public interface NodeWithOptionalBlockStmt { Optional getBody(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalLabel.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalLabel.java index a8f41679f6..bb6adf88eb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalLabel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalLabel.java @@ -28,7 +28,7 @@ /** * A node that has an optional label. */ -public interface NodeWithOptionalLabel { +public interface NodeWithOptionalLabel { Optional getLabel(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalScope.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalScope.java index fdc118c5bd..9fdbe27ab9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalScope.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithOptionalScope.java @@ -27,7 +27,7 @@ /** * Represents a node which has an optional scope expression eg. method calls (object.method()). */ -public interface NodeWithOptionalScope extends NodeWithTraversableScope { +public interface NodeWithOptionalScope extends NodeWithTraversableScope { Optional getScope(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java index 9c594ca4e3..cd517eafbc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithParameters.java @@ -30,7 +30,7 @@ import java.util.Optional; import java.util.stream.Stream; -public interface NodeWithParameters { +public interface NodeWithParameters { NodeList getParameters(); @@ -160,9 +160,9 @@ default boolean hasParametersOfType(String... paramTypes) { * @return {@code true} if all parameters match one by one, in the given order. */ default boolean hasParametersOfType(Class... paramTypes) { - return getParameters().stream().// if p.getType() is a class or interface type, we want to consider its erasure, i.e., if the + return // if p.getType() is a class or interface type, we want to consider its erasure, i.e., if the // parameter - // is "List", we want to consider it as "List", so we need to call getName() + getParameters().stream().// is "List", we want to consider it as "List", so we need to call getName() map(p -> p.getType().toClassOrInterfaceType().map(NodeWithSimpleName::getNameAsString).orElseGet(() -> p.getType().asString())).collect(toList()).equals(Stream.of(paramTypes).map(Class::getSimpleName).collect(toList())); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithRange.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithRange.java index 62100b0701..54cc1f6efd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithRange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithRange.java @@ -28,7 +28,7 @@ /** * A node that has a Range, which is every Node. */ -public interface NodeWithRange { +public interface NodeWithRange { Optional getRange(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithScope.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithScope.java index 5522eae75d..539fca62a1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithScope.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithScope.java @@ -27,7 +27,7 @@ /** * Represents a node which has a required scope expression eg. field access (object.method). */ -public interface NodeWithScope extends NodeWithTraversableScope { +public interface NodeWithScope extends NodeWithTraversableScope { Expression getScope(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithSimpleName.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithSimpleName.java index 4f73bbb5a6..c4aa22fa2b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithSimpleName.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithSimpleName.java @@ -30,7 +30,7 @@ *

* The main reason for this interface is to permit users to manipulate homogeneously all nodes with a getName method. */ -public interface NodeWithSimpleName { +public interface NodeWithSimpleName { SimpleName getName(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithStatements.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithStatements.java index 56e5f8b8a5..298587e2a6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithStatements.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithStatements.java @@ -32,7 +32,7 @@ /** * A node that contains a list of statements. */ -public interface NodeWithStatements { +public interface NodeWithStatements { NodeList getStatements(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithThrownExceptions.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithThrownExceptions.java index f5b8acf854..514739fe96 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithThrownExceptions.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithThrownExceptions.java @@ -28,7 +28,7 @@ /** * A node that declares the types of exception it throws. */ -public interface NodeWithThrownExceptions { +public interface NodeWithThrownExceptions { N setThrownExceptions(NodeList thrownExceptions); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTokenRange.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTokenRange.java index 1aa5140c3e..55c8308e32 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTokenRange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTokenRange.java @@ -26,7 +26,7 @@ /** * A node that has a Range, which is every Node. */ -public interface NodeWithTokenRange { +public interface NodeWithTokenRange { Optional getTokenRange(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTraversableScope.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTraversableScope.java index f281a7414e..341d16060a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTraversableScope.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTraversableScope.java @@ -27,7 +27,7 @@ * Represents a node which has a scope expression that can be traversed/walked. * This unifies scope access for NodeWithScope and NodeWithOptionalScope. */ -public interface NodeWithTraversableScope { +public interface NodeWithTraversableScope { /** * @return the scope of this node, regardless of optionality. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithType.java index 0e392aa633..99142ba977 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithType.java @@ -34,7 +34,7 @@ * * @since 2.3.1 */ -public interface NodeWithType { +public interface NodeWithType { /** * Gets the type diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java index 90b310db1a..a5462e7e87 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeArguments.java @@ -38,7 +38,7 @@ * Only ObjectCreationExpr uses the diamond operator. * On other nodes it is treated the same as the first case. */ -public interface NodeWithTypeArguments { +public interface NodeWithTypeArguments { /** * @return the types that can be found in the type arguments: {@code }. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeParameters.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeParameters.java index 7a58685eec..a2eef5cc6a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeParameters.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithTypeParameters.java @@ -33,7 +33,7 @@ * class X<C,D> {} --> typeParameters = [C,D] * */ -public interface NodeWithTypeParameters { +public interface NodeWithTypeParameters { NodeList getTypeParameters(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java index d7ee622d53..63f5c22ebd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/NodeWithVariables.java @@ -33,7 +33,7 @@ /** * A node which has a list of variables. */ -public interface NodeWithVariables { +public interface NodeWithVariables { NodeList getVariables(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/SwitchNode.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/SwitchNode.java index d98e77eded..9c0010f7ee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/SwitchNode.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/SwitchNode.java @@ -30,7 +30,7 @@ /** * The common interface of {@link com.github.javaparser.ast.expr.SwitchExpr} and {@link com.github.javaparser.ast.stmt.SwitchStmt} */ -public interface SwitchNode { +public interface SwitchNode { NodeList getEntries(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAbstractModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAbstractModifier.java index c4acf5d8f8..f977b7df4f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAbstractModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAbstractModifier.java @@ -27,7 +27,7 @@ /** * A node that can be abstract. */ -public interface NodeWithAbstractModifier extends NodeWithModifiers { +public interface NodeWithAbstractModifier extends NodeWithModifiers { default boolean isAbstract() { return hasModifier(ABSTRACT); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAccessModifiers.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAccessModifiers.java index 410ea05634..53e7c0abb9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAccessModifiers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithAccessModifiers.java @@ -25,5 +25,5 @@ /** * A node that can be public, protected, and/or private. */ -public interface NodeWithAccessModifiers extends NodeWithPublicModifier, NodeWithPrivateModifier, NodeWithProtectedModifier { +public interface NodeWithAccessModifiers extends NodeWithPublicModifier, NodeWithPrivateModifier, NodeWithProtectedModifier { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithFinalModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithFinalModifier.java index ea813cf55b..1bf387f26c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithFinalModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithFinalModifier.java @@ -27,7 +27,7 @@ /** * A node that can be final. */ -public interface NodeWithFinalModifier extends NodeWithModifiers { +public interface NodeWithFinalModifier extends NodeWithModifiers { /** * @return true, if the modifier {@code final} is explicitly added to this node. If the node is implicitly final diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPrivateModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPrivateModifier.java index 475ddd09ae..109b438fcf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPrivateModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPrivateModifier.java @@ -27,7 +27,7 @@ /** * A node that can be private. */ -public interface NodeWithPrivateModifier extends NodeWithModifiers { +public interface NodeWithPrivateModifier extends NodeWithModifiers { default boolean isPrivate() { return hasModifier(PRIVATE); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithProtectedModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithProtectedModifier.java index 423a29ea52..7236653ed2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithProtectedModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithProtectedModifier.java @@ -27,7 +27,7 @@ /** * A node that can be protected. */ -public interface NodeWithProtectedModifier extends NodeWithModifiers { +public interface NodeWithProtectedModifier extends NodeWithModifiers { default boolean isProtected() { return hasModifier(PROTECTED); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPublicModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPublicModifier.java index 4c74ef8cae..515d44252d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPublicModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithPublicModifier.java @@ -27,7 +27,7 @@ /** * A node that can be public. */ -public interface NodeWithPublicModifier extends NodeWithModifiers { +public interface NodeWithPublicModifier extends NodeWithModifiers { default boolean isPublic() { return hasModifier(PUBLIC); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStaticModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStaticModifier.java index e3719b9af5..466315425e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStaticModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStaticModifier.java @@ -27,7 +27,7 @@ /** * A node that can be static. */ -public interface NodeWithStaticModifier extends NodeWithModifiers { +public interface NodeWithStaticModifier extends NodeWithModifiers { /** * @return true, if the modifier {@code static} is explicitly added to this node. If the node is implicitly static diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStrictfpModifier.java b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStrictfpModifier.java index 384de05b20..3ed2aeade0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStrictfpModifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/modifiers/NodeWithStrictfpModifier.java @@ -27,7 +27,7 @@ /** * A node that can be strictfp. */ -public interface NodeWithStrictfpModifier extends NodeWithModifiers { +public interface NodeWithStrictfpModifier extends NodeWithModifiers { default boolean isStrictfp() { return hasModifier(STRICTFP); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserver.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserver.java index 06b3d98ea6..04854dc5a6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserver.java @@ -26,7 +26,7 @@ /** * An Observer for an AST element (either a Node or a NodeList). */ -public interface AstObserver { +public interface AstObserver { /** * Type of change occurring on a List diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserverAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserverAdapter.java index 3dda3739f5..b2911fe5af 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserverAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/AstObserverAdapter.java @@ -26,22 +26,22 @@ public abstract class AstObserverAdapter implements AstObserver { @Override - public void propertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { + public void propertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { // do nothing } @Override - public void parentChange(Node observedNode, Node previousParent, Node newParent) { + public void parentChange(Node observedNode, Node previousParent, Node newParent) { // do nothing } @Override - public void listChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { + public void listChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { // do nothing } @Override - public void listReplacement(NodeList observedNode, int index, Node oldNode, Node newNode) { + public void listReplacement(NodeList observedNode, int index, Node oldNode, Node newNode) { // do nothing } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/Observable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/Observable.java index 100ffbd3b2..a1829fa31c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/Observable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/Observable.java @@ -23,7 +23,7 @@ /** * Observable element. */ -public interface Observable { +public interface Observable { /** * Register an observer. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java index 2eedc19149..083147837b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/ObservableProperty.java @@ -33,7 +33,7 @@ * Properties considered by the AstObserver */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") -public enum ObservableProperty { +public enum ObservableProperty { ANNOTATIONS(Type.MULTIPLE_REFERENCE), ANONYMOUS_CLASS_BODY(Type.MULTIPLE_REFERENCE), @@ -205,31 +205,31 @@ public static ObservableProperty fromCamelCaseName(String camelCaseName) { this(Type.SINGLE_REFERENCE, false); } - public boolean isDerived() { + public boolean isDerived() { return derived; } - public boolean isAboutNodes() { + public boolean isAboutNodes() { return type.node; } - public boolean isAboutValues() { + public boolean isAboutValues() { return !isAboutNodes(); } - public boolean isMultiple() { + public boolean isMultiple() { return type.multiple; } - public boolean isSingle() { + public boolean isSingle() { return !isMultiple(); } - public String camelCaseName() { + public String camelCaseName() { return Utils.screamingToCamelCase(name()); } - public Node getValueAsSingleReference(Node node) { + public Node getValueAsSingleReference(Node node) { Object rawValue = getRawValue(node); try { if (rawValue instanceof Node) { @@ -257,7 +257,7 @@ private boolean hasMethod(Node node, String name) { } } - public NodeList getValueAsMultipleReference(Node node) { + public NodeList getValueAsMultipleReference(Node node) { Object rawValue = getRawValue(node); try { if (rawValue == null) { @@ -276,7 +276,7 @@ public NodeList getValueAsMultipleReference(Node node) { } } - public Collection getValueAsCollection(Node node) { + public Collection getValueAsCollection(Node node) { Object rawValue = getRawValue(node); try { return (Collection) rawValue; @@ -285,15 +285,15 @@ public Collection getValueAsCollection(Node node) { } } - public String getValueAsStringAttribute(Node node) { + public String getValueAsStringAttribute(Node node) { return (String) getRawValue(node); } - public Boolean getValueAsBooleanAttribute(Node node) { + public Boolean getValueAsBooleanAttribute(Node node) { return (Boolean) getRawValue(node); } - public Object getRawValue(Node node) { + public Object getRawValue(Node node) { String getterName = "get" + Utils.capitalize(camelCaseName()); if (!hasMethod(node, getterName)) { getterName = "is" + Utils.capitalize(camelCaseName()); @@ -308,15 +308,15 @@ public Object getRawValue(Node node) { } } - public boolean isNull(Node node) { + public boolean isNull(Node node) { return null == getRawValue(node); } - public boolean isNullOrNotPresent(Node node) { + public boolean isNullOrNotPresent(Node node) { return Utils.valueIsNullOrEmptyStringOrOptional(getRawValue(node)); } - public boolean isNullOrEmpty(Node node) { + public boolean isNullOrEmpty(Node node) { return Utils.valueIsNullOrEmpty(getRawValue(node)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/PropagatingAstObserver.java b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/PropagatingAstObserver.java index 7ab74ce256..19e68ce990 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/observer/PropagatingAstObserver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/observer/PropagatingAstObserver.java @@ -39,17 +39,17 @@ public static PropagatingAstObserver transformInPropagatingObserver(final AstObs return new PropagatingAstObserver() { @Override - public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { + public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { observer.propertyChange(observedNode, property, oldValue, newValue); } @Override - public void concreteListChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { + public void concreteListChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { observer.listChange(observedNode, type, index, nodeAddedOrRemoved); } @Override - public void parentChange(Node observedNode, Node previousParent, Node newParent) { + public void parentChange(Node observedNode, Node previousParent, Node newParent) { observer.parentChange(observedNode, previousParent, newParent); } }; @@ -73,7 +73,7 @@ public final void listChange(NodeList observedNode, ListChangeType type, int } @Override - public void listReplacement(NodeList observedNode, int index, Node oldNode, Node newNode) { + public void listReplacement(NodeList observedNode, int index, Node oldNode, Node newNode) { if (oldNode == newNode) { return; } @@ -82,20 +82,20 @@ public void listReplacement(NodeList observedNode, int index, Node oldNode, concreteListReplacement(observedNode, index, oldNode, newNode); } - public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { + public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { // do nothing } - public void concreteListChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { + public void concreteListChange(NodeList observedNode, ListChangeType type, int index, Node nodeAddedOrRemoved) { // do nothing } - public void concreteListReplacement(NodeList observedNode, int index, Node oldValue, Node newValue) { + public void concreteListReplacement(NodeList observedNode, int index, Node oldValue, Node newValue) { // do nothing } @Override - public void parentChange(Node observedNode, Node previousParent, Node newParent) { + public void parentChange(Node observedNode, Node previousParent, Node newParent) { // do nothing } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/AssertStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/AssertStmt.java index e0a25f08dd..40697838b3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/AssertStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/AssertStmt.java @@ -43,23 +43,23 @@ * * @author Julio Vilmar Gesser */ -public class AssertStmt extends Statement { +public class AssertStmt extends Statement { private Expression check; @OptionalProperty private Expression message; - public AssertStmt() { + public AssertStmt() { this(null, new BooleanLiteralExpr(), null); } - public AssertStmt(final Expression check) { + public AssertStmt(final Expression check) { this(null, check, null); } @AllFieldsConstructor - public AssertStmt(final Expression check, final Expression message) { + public AssertStmt(final Expression check, final Expression message) { this(null, check, message); } @@ -67,7 +67,7 @@ public AssertStmt(final Expression check, final Expression message) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public AssertStmt(TokenRange tokenRange, Expression check, Expression message) { + public AssertStmt(TokenRange tokenRange, Expression check, Expression message) { super(tokenRange); setCheck(check); setMessage(message); @@ -76,28 +76,28 @@ public AssertStmt(TokenRange tokenRange, Expression check, Expression message) @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCheck() { + public Expression getCheck() { return check; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getMessage() { + public Optional getMessage() { return Optional.ofNullable(message); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AssertStmt setCheck(final Expression check) { + public AssertStmt setCheck(final Expression check) { assertNotNull(check); if (check == this.check) { return this; @@ -117,7 +117,7 @@ public AssertStmt setCheck(final Expression check) { * @return this, the AssertStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public AssertStmt setMessage(final Expression message) { + public AssertStmt setMessage(final Expression message) { if (message == this.message) { return this; } @@ -131,7 +131,7 @@ public AssertStmt setMessage(final Expression message) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -145,25 +145,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public AssertStmt removeMessage() { + public AssertStmt removeMessage() { return setMessage((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public AssertStmt clone() { + public AssertStmt clone() { return (AssertStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public AssertStmtMetaModel getMetaModel() { + public AssertStmtMetaModel getMetaModel() { return JavaParserMetaModel.assertStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -182,25 +182,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAssertStmt() { + public boolean isAssertStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AssertStmt asAssertStmt() { + public AssertStmt asAssertStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAssertStmt(Consumer action) { + public void ifAssertStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAssertStmt() { + public Optional toAssertStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Behavior.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Behavior.java index fff90450aa..6d12e3cbe1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Behavior.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Behavior.java @@ -7,7 +7,7 @@ * @author Alexander Weigl * @version 1 (3/14/21) */ -public enum Behavior implements Jmlish, JmlKeyword { +public enum Behavior implements Jmlish, JmlKeyword { NONE(""), BEHAVIOR("behavior"), @@ -26,7 +26,7 @@ public enum Behavior implements Jmlish, JmlKeyword { } @Override - public String jmlSymbol() { + public String jmlSymbol() { return symbol; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BlockStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BlockStmt.java index d30a34cbbd..1f4d33756b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BlockStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BlockStmt.java @@ -43,26 +43,26 @@ * * @author Julio Vilmar Gesser */ -public class BlockStmt extends Statement implements NodeWithStatements, NodeWithContracts { +public class BlockStmt extends Statement implements NodeWithStatements, NodeWithContracts { private NodeList statements; private NodeList contracts = new NodeList<>(); - public BlockStmt() { + public BlockStmt() { this(null, new NodeList<>(), new NodeList<>()); } - public BlockStmt(NodeList statements) { + public BlockStmt(NodeList statements) { this(null, statements, new NodeList<>()); } @AllFieldsConstructor - public BlockStmt(final NodeList statements, final NodeList contracts) { + public BlockStmt(final NodeList statements, final NodeList contracts) { this(null, statements, contracts); } - public BlockStmt(TokenRange tokenRange, NodeList statements) { + public BlockStmt(TokenRange tokenRange, NodeList statements) { this(tokenRange, statements, new NodeList<>()); } @@ -70,7 +70,7 @@ public BlockStmt(TokenRange tokenRange, NodeList statements) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BlockStmt(TokenRange tokenRange, NodeList statements, NodeList contracts) { + public BlockStmt(TokenRange tokenRange, NodeList statements, NodeList contracts) { super(tokenRange); setStatements(statements); setContracts(contracts); @@ -79,23 +79,23 @@ public BlockStmt(TokenRange tokenRange, NodeList statements, NodeLis @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getStatements() { + public NodeList getStatements() { return statements; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt setStatements(final NodeList statements) { + public BlockStmt setStatements(final NodeList statements) { assertNotNull(statements); if (statements == this.statements) { return this; @@ -110,7 +110,7 @@ public BlockStmt setStatements(final NodeList statements) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -131,19 +131,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BlockStmt clone() { + public BlockStmt clone() { return (BlockStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BlockStmtMetaModel getMetaModel() { + public BlockStmtMetaModel getMetaModel() { return JavaParserMetaModel.blockStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -164,35 +164,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBlockStmt() { + public boolean isBlockStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BlockStmt asBlockStmt() { + public BlockStmt asBlockStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBlockStmt(Consumer action) { + public void ifBlockStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBlockStmt() { + public Optional toBlockStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt setContracts(final NodeList contracts) { + public BlockStmt setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BreakStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BreakStmt.java index 3eb12ddf0e..f566dbdbe8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BreakStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/BreakStmt.java @@ -55,21 +55,21 @@ * @see com.github.javaparser.ast.expr.SwitchExpr * @see YieldStmt */ -public class BreakStmt extends Statement { +public class BreakStmt extends Statement { @OptionalProperty private SimpleName label; - public BreakStmt() { + public BreakStmt() { this(null, null); } - public BreakStmt(final String label) { + public BreakStmt(final String label) { this(null, new SimpleName(label)); } @AllFieldsConstructor - public BreakStmt(final SimpleName label) { + public BreakStmt(final SimpleName label) { this(null, label); } @@ -77,7 +77,7 @@ public BreakStmt(final SimpleName label) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public BreakStmt(TokenRange tokenRange, SimpleName label) { + public BreakStmt(TokenRange tokenRange, SimpleName label) { super(tokenRange); setLabel(label); customInitialization(); @@ -85,18 +85,18 @@ public BreakStmt(TokenRange tokenRange, SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getLabel() { + public Optional getLabel() { return Optional.ofNullable(label); } @@ -107,7 +107,7 @@ public Optional getLabel() { * @return this, the BreakStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BreakStmt setLabel(final SimpleName label) { + public BreakStmt setLabel(final SimpleName label) { if (label == this.label) { return this; } @@ -121,7 +121,7 @@ public BreakStmt setLabel(final SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -135,25 +135,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public BreakStmt removeLabel() { + public BreakStmt removeLabel() { return setLabel((SimpleName) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public BreakStmt clone() { + public BreakStmt clone() { return (BreakStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public BreakStmtMetaModel getMetaModel() { + public BreakStmtMetaModel getMetaModel() { return JavaParserMetaModel.breakStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -168,25 +168,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBreakStmt() { + public boolean isBreakStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BreakStmt asBreakStmt() { + public BreakStmt asBreakStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBreakStmt(Consumer action) { + public void ifBreakStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBreakStmt() { + public Optional toBreakStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/CatchClause.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/CatchClause.java index 1a583c7934..008dba23f7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/CatchClause.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/CatchClause.java @@ -41,22 +41,22 @@ * * @author Julio Vilmar Gesser */ -public class CatchClause extends Node implements NodeWithBlockStmt { +public class CatchClause extends Node implements NodeWithBlockStmt { private Parameter parameter; private BlockStmt body; - public CatchClause() { + public CatchClause() { this(null, new Parameter(), new BlockStmt()); } - public CatchClause(final NodeList exceptModifier, final NodeList exceptAnnotations, final ClassOrInterfaceType exceptType, final SimpleName exceptName, final BlockStmt body) { + public CatchClause(final NodeList exceptModifier, final NodeList exceptAnnotations, final ClassOrInterfaceType exceptType, final SimpleName exceptName, final BlockStmt body) { this(null, new Parameter(null, exceptModifier, exceptAnnotations, exceptType, false, new NodeList<>(), exceptName), body); } @AllFieldsConstructor - public CatchClause(final Parameter parameter, final BlockStmt body) { + public CatchClause(final Parameter parameter, final BlockStmt body) { this(null, parameter, body); } @@ -64,7 +64,7 @@ public CatchClause(final Parameter parameter, final BlockStmt body) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public CatchClause(TokenRange tokenRange, Parameter parameter, BlockStmt body) { + public CatchClause(TokenRange tokenRange, Parameter parameter, BlockStmt body) { super(tokenRange); setParameter(parameter); setBody(body); @@ -73,13 +73,13 @@ public CatchClause(TokenRange tokenRange, Parameter parameter, BlockStmt body) @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -89,12 +89,12 @@ public void accept(final VoidVisitor v, final A arg) { * catch(A a | @X B b ...) are found on those types. */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Parameter getParameter() { + public Parameter getParameter() { return parameter; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CatchClause setParameter(final Parameter parameter) { + public CatchClause setParameter(final Parameter parameter) { assertNotNull(parameter); if (parameter == this.parameter) { return this; @@ -108,12 +108,12 @@ public CatchClause setParameter(final Parameter parameter) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getBody() { + public BlockStmt getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public CatchClause setBody(final BlockStmt body) { + public CatchClause setBody(final BlockStmt body) { assertNotNull(body); if (body == this.body) { return this; @@ -128,19 +128,19 @@ public CatchClause setBody(final BlockStmt body) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public CatchClause clone() { + public CatchClause clone() { return (CatchClause) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public CatchClauseMetaModel getMetaModel() { + public CatchClauseMetaModel getMetaModel() { return JavaParserMetaModel.catchClauseMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ContinueStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ContinueStmt.java index a3301b8742..6fa7469a82 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ContinueStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ContinueStmt.java @@ -43,21 +43,21 @@ * * @author Julio Vilmar Gesser */ -public class ContinueStmt extends Statement implements NodeWithOptionalLabel { +public class ContinueStmt extends Statement implements NodeWithOptionalLabel { @OptionalProperty private SimpleName label; - public ContinueStmt() { + public ContinueStmt() { this(null, null); } - public ContinueStmt(final String label) { + public ContinueStmt(final String label) { this(null, new SimpleName(label)); } @AllFieldsConstructor - public ContinueStmt(final SimpleName label) { + public ContinueStmt(final SimpleName label) { this(null, label); } @@ -65,7 +65,7 @@ public ContinueStmt(final SimpleName label) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ContinueStmt(TokenRange tokenRange, SimpleName label) { + public ContinueStmt(TokenRange tokenRange, SimpleName label) { super(tokenRange); setLabel(label); customInitialization(); @@ -73,18 +73,18 @@ public ContinueStmt(TokenRange tokenRange, SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getLabel() { + public Optional getLabel() { return Optional.ofNullable(label); } @@ -95,7 +95,7 @@ public Optional getLabel() { * @return this, the ContinueStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ContinueStmt setLabel(final SimpleName label) { + public ContinueStmt setLabel(final SimpleName label) { if (label == this.label) { return this; } @@ -109,7 +109,7 @@ public ContinueStmt setLabel(final SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -123,25 +123,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ContinueStmt removeLabel() { + public ContinueStmt removeLabel() { return setLabel((SimpleName) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ContinueStmt clone() { + public ContinueStmt clone() { return (ContinueStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ContinueStmtMetaModel getMetaModel() { + public ContinueStmtMetaModel getMetaModel() { return JavaParserMetaModel.continueStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -156,25 +156,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isContinueStmt() { + public boolean isContinueStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ContinueStmt asContinueStmt() { + public ContinueStmt asContinueStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifContinueStmt(Consumer action) { + public void ifContinueStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toContinueStmt() { + public Optional toContinueStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/DoStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/DoStmt.java index 2475c23d21..38f999c85c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/DoStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/DoStmt.java @@ -47,7 +47,7 @@ * * @author Julio Vilmar Gesser */ -public class DoStmt extends Statement implements NodeWithBody, NodeWithCondition, NodeWithContracts { +public class DoStmt extends Statement implements NodeWithBody, NodeWithCondition, NodeWithContracts { private NodeList contracts; @@ -55,20 +55,20 @@ public class DoStmt extends Statement implements NodeWithBody, NodeWith private Expression condition; - public DoStmt() { + public DoStmt() { this(new ReturnStmt(), new BooleanLiteralExpr()); } @AllFieldsConstructor - public DoStmt(final Statement body, final Expression condition, final NodeList contracts) { + public DoStmt(final Statement body, final Expression condition, final NodeList contracts) { this(null, body, condition, contracts); } - public DoStmt(final Statement body, final Expression condition) { + public DoStmt(final Statement body, final Expression condition) { this(body, condition, new NodeList<>()); } - public DoStmt(TokenRange tokenRange, Statement body, Expression condition) { + public DoStmt(TokenRange tokenRange, Statement body, Expression condition) { this(tokenRange, body, condition, new NodeList<>()); } @@ -76,7 +76,7 @@ public DoStmt(TokenRange tokenRange, Statement body, Expression condition) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public DoStmt(TokenRange tokenRange, Statement body, Expression condition, NodeList contracts) { + public DoStmt(TokenRange tokenRange, Statement body, Expression condition, NodeList contracts) { super(tokenRange); setBody(body); setCondition(condition); @@ -86,28 +86,28 @@ public DoStmt(TokenRange tokenRange, Statement body, Expression condition, Node @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getBody() { + public Statement getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCondition() { + public Expression getCondition() { return condition; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public DoStmt setBody(final Statement body) { + public DoStmt setBody(final Statement body) { assertNotNull(body); if (body == this.body) { return this; @@ -121,7 +121,7 @@ public DoStmt setBody(final Statement body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public DoStmt setCondition(final Expression condition) { + public DoStmt setCondition(final Expression condition) { assertNotNull(condition); if (condition == this.condition) { return this; @@ -136,7 +136,7 @@ public DoStmt setCondition(final Expression condition) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -151,19 +151,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public DoStmt clone() { + public DoStmt clone() { return (DoStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public DoStmtMetaModel getMetaModel() { + public DoStmtMetaModel getMetaModel() { return JavaParserMetaModel.doStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -186,35 +186,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isDoStmt() { + public boolean isDoStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public DoStmt asDoStmt() { + public DoStmt asDoStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifDoStmt(Consumer action) { + public void ifDoStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toDoStmt() { + public Optional toDoStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public DoStmt setContracts(final NodeList contracts) { + public DoStmt setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/EmptyStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/EmptyStmt.java index 07382d2aba..69dcaf706e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/EmptyStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/EmptyStmt.java @@ -37,10 +37,10 @@ * * @author Julio Vilmar Gesser */ -public class EmptyStmt extends Statement { +public class EmptyStmt extends Statement { @AllFieldsConstructor - public EmptyStmt() { + public EmptyStmt() { this(null); } @@ -48,56 +48,56 @@ public EmptyStmt() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public EmptyStmt(TokenRange tokenRange) { + public EmptyStmt(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public EmptyStmt clone() { + public EmptyStmt clone() { return (EmptyStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public EmptyStmtMetaModel getMetaModel() { + public EmptyStmtMetaModel getMetaModel() { return JavaParserMetaModel.emptyStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEmptyStmt() { + public boolean isEmptyStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EmptyStmt asEmptyStmt() { + public EmptyStmt asEmptyStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEmptyStmt(Consumer action) { + public void ifEmptyStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEmptyStmt() { + public Optional toEmptyStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java index 257c174643..9d8d3d9415 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExplicitConstructorInvocationStmt.java @@ -52,7 +52,7 @@ * @see com.github.javaparser.ast.expr.SuperExpr * @see com.github.javaparser.ast.expr.ThisExpr */ -public class ExplicitConstructorInvocationStmt extends Statement implements NodeWithTypeArguments, NodeWithArguments, Resolvable { +public class ExplicitConstructorInvocationStmt extends Statement implements NodeWithTypeArguments, NodeWithArguments, Resolvable { @OptionalProperty private NodeList typeArguments; @@ -64,16 +64,16 @@ public class ExplicitConstructorInvocationStmt extends Statement implements Nod private NodeList arguments; - public ExplicitConstructorInvocationStmt() { + public ExplicitConstructorInvocationStmt() { this(null, null, true, null, new NodeList<>()); } - public ExplicitConstructorInvocationStmt(final boolean isThis, final Expression expression, final NodeList arguments) { + public ExplicitConstructorInvocationStmt(final boolean isThis, final Expression expression, final NodeList arguments) { this(null, null, isThis, expression, arguments); } @AllFieldsConstructor - public ExplicitConstructorInvocationStmt(final NodeList typeArguments, final boolean isThis, final Expression expression, final NodeList arguments) { + public ExplicitConstructorInvocationStmt(final NodeList typeArguments, final boolean isThis, final Expression expression, final NodeList arguments) { this(null, typeArguments, isThis, expression, arguments); } @@ -81,7 +81,7 @@ public ExplicitConstructorInvocationStmt(final NodeList typeArguments, fi * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ExplicitConstructorInvocationStmt(TokenRange tokenRange, NodeList typeArguments, boolean isThis, Expression expression, NodeList arguments) { + public ExplicitConstructorInvocationStmt(TokenRange tokenRange, NodeList typeArguments, boolean isThis, Expression expression, NodeList arguments) { super(tokenRange); setTypeArguments(typeArguments); setThis(isThis); @@ -92,33 +92,33 @@ public ExplicitConstructorInvocationStmt(TokenRange tokenRange, NodeList @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getArguments() { + public NodeList getArguments() { return arguments; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getExpression() { + public Optional getExpression() { return Optional.ofNullable(expression); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isThis() { + public boolean isThis() { return isThis; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ExplicitConstructorInvocationStmt setArguments(final NodeList arguments) { + public ExplicitConstructorInvocationStmt setArguments(final NodeList arguments) { assertNotNull(arguments); if (arguments == this.arguments) { return this; @@ -138,7 +138,7 @@ public ExplicitConstructorInvocationStmt setArguments(final NodeList> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -172,7 +172,7 @@ public Optional> getTypeArguments() { * @return this, the ExplicitConstructorInvocationStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ExplicitConstructorInvocationStmt setTypeArguments(final NodeList typeArguments) { + public ExplicitConstructorInvocationStmt setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -186,7 +186,7 @@ public ExplicitConstructorInvocationStmt setTypeArguments(final NodeList @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -214,25 +214,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ExplicitConstructorInvocationStmt removeExpression() { + public ExplicitConstructorInvocationStmt removeExpression() { return setExpression((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ExplicitConstructorInvocationStmt clone() { + public ExplicitConstructorInvocationStmt clone() { return (ExplicitConstructorInvocationStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ExplicitConstructorInvocationStmtMetaModel getMetaModel() { + public ExplicitConstructorInvocationStmtMetaModel getMetaModel() { return JavaParserMetaModel.explicitConstructorInvocationStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -261,19 +261,19 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isExplicitConstructorInvocationStmt() { + public boolean isExplicitConstructorInvocationStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt() { + public ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifExplicitConstructorInvocationStmt(Consumer action) { + public void ifExplicitConstructorInvocationStmt(Consumer action) { action.accept(this); } @@ -290,13 +290,13 @@ public void ifExplicitConstructorInvocationStmt(Consumer toExplicitConstructorInvocationStmt() { + public Optional toExplicitConstructorInvocationStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExpressionStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExpressionStmt.java index 0960b7491d..fd2d360154 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExpressionStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ExpressionStmt.java @@ -42,16 +42,16 @@ * * @author Julio Vilmar Gesser */ -public class ExpressionStmt extends Statement implements NodeWithExpression { +public class ExpressionStmt extends Statement implements NodeWithExpression { private Expression expression; - public ExpressionStmt() { + public ExpressionStmt() { this(null, new BooleanLiteralExpr()); } @AllFieldsConstructor - public ExpressionStmt(final Expression expression) { + public ExpressionStmt(final Expression expression) { this(null, expression); } @@ -59,7 +59,7 @@ public ExpressionStmt(final Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ExpressionStmt(TokenRange tokenRange, Expression expression) { + public ExpressionStmt(TokenRange tokenRange, Expression expression) { super(tokenRange); setExpression(expression); customInitialization(); @@ -67,23 +67,23 @@ public ExpressionStmt(TokenRange tokenRange, Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ExpressionStmt setExpression(final Expression expression) { + public ExpressionStmt setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -98,19 +98,19 @@ public ExpressionStmt setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ExpressionStmt clone() { + public ExpressionStmt clone() { return (ExpressionStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ExpressionStmtMetaModel getMetaModel() { + public ExpressionStmtMetaModel getMetaModel() { return JavaParserMetaModel.expressionStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -123,25 +123,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isExpressionStmt() { + public boolean isExpressionStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ExpressionStmt asExpressionStmt() { + public ExpressionStmt asExpressionStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifExpressionStmt(Consumer action) { + public void ifExpressionStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toExpressionStmt() { + public Optional toExpressionStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForEachStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForEachStmt.java index 72b21088b3..67085b3e44 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForEachStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForEachStmt.java @@ -46,7 +46,7 @@ * * @author Julio Vilmar Gesser */ -public class ForEachStmt extends Statement implements NodeWithBody, NodeWithContracts { +public class ForEachStmt extends Statement implements NodeWithBody, NodeWithContracts { private NodeList contracts = new NodeList<>(); @@ -56,16 +56,16 @@ public class ForEachStmt extends Statement implements NodeWithBody private Statement body; - public ForEachStmt() { + public ForEachStmt() { this(new VariableDeclarationExpr(), new NameExpr(), new ReturnStmt()); } - public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body) { + public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body) { this(variable, iterable, body, new NodeList<>()); } @AllFieldsConstructor - public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body, final NodeList contracts) { + public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body, final NodeList contracts) { this(null, variable, iterable, body, contracts); } @@ -73,7 +73,7 @@ public ForEachStmt(final VariableDeclarationExpr variable, final Expression ite * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body, NodeList contracts) { + public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body, NodeList contracts) { super(tokenRange); setVariable(variable); setIterable(iterable); @@ -82,39 +82,39 @@ public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Exp customInitialization(); } - public ForEachStmt(VariableDeclarationExpr variable, String iterable, BlockStmt body) { + public ForEachStmt(VariableDeclarationExpr variable, String iterable, BlockStmt body) { this(variable, new NameExpr(iterable), body); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getBody() { + public Statement getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getIterable() { + public Expression getIterable() { return iterable; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public VariableDeclarationExpr getVariable() { + public VariableDeclarationExpr getVariable() { return variable; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForEachStmt setBody(final Statement body) { + public ForEachStmt setBody(final Statement body) { assertNotNull(body); if (body == this.body) { return this; @@ -128,7 +128,7 @@ public ForEachStmt setBody(final Statement body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForEachStmt setIterable(final Expression iterable) { + public ForEachStmt setIterable(final Expression iterable) { assertNotNull(iterable); if (iterable == this.iterable) { return this; @@ -142,7 +142,7 @@ public ForEachStmt setIterable(final Expression iterable) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForEachStmt setVariable(final VariableDeclarationExpr variable) { + public ForEachStmt setVariable(final VariableDeclarationExpr variable) { assertNotNull(variable); if (variable == this.variable) { return this; @@ -165,7 +165,7 @@ public ForEachStmt setVariable(final VariableDeclarationExpr variable) { * * @return this foreach statement's single variable declarator. */ - public VariableDeclarator getVariableDeclarator() { + public VariableDeclarator getVariableDeclarator() { return getVariable().getVariable(0); } @@ -180,13 +180,13 @@ public VariableDeclarator getVariableDeclarator() { * * @return {@code true} if this foreach statement's variable is {@code final}, and {@code false} otherwise. */ - public boolean hasFinalVariable() { + public boolean hasFinalVariable() { return getVariable().getModifiers().isNonEmpty() && getVariable().getModifiers().get(0).getKeyword() == Modifier.DefaultKeyword.FINAL; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -201,13 +201,13 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ForEachStmt clone() { + public ForEachStmt clone() { return (ForEachStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -234,31 +234,31 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isForEachStmt() { + public boolean isForEachStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ForEachStmt asForEachStmt() { + public ForEachStmt asForEachStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toForEachStmt() { + public Optional toForEachStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifForEachStmt(Consumer action) { + public void ifForEachStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ForEachStmtMetaModel getMetaModel() { + public ForEachStmtMetaModel getMetaModel() { return JavaParserMetaModel.forEachStmtMetaModel; } @@ -266,7 +266,7 @@ public ForEachStmtMetaModel getMetaModel() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body) { + public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body) { super(tokenRange); setVariable(variable); setIterable(iterable); @@ -275,12 +275,12 @@ public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Exp } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForEachStmt setContracts(final NodeList contracts) { + public ForEachStmt setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForStmt.java index c89b6c3b63..97bfd8e9bb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ForStmt.java @@ -68,7 +68,7 @@ * @author Julio Vilmar Gesser * @see com.github.javaparser.ast.expr.VariableDeclarationExpr */ -public class ForStmt extends Statement implements NodeWithBody, NodeWithContracts { +public class ForStmt extends Statement implements NodeWithBody, NodeWithContracts { private NodeList contracts; @@ -81,20 +81,20 @@ public class ForStmt extends Statement implements NodeWithBody, NodeWi private Statement body; - public ForStmt() { + public ForStmt() { this(new NodeList<>(), new BooleanLiteralExpr(), new NodeList<>(), new ReturnStmt()); } - public ForStmt(final NodeList initialization, final Expression compare, final NodeList update, final Statement body) { + public ForStmt(final NodeList initialization, final Expression compare, final NodeList update, final Statement body) { this(initialization, compare, update, body, new NodeList<>()); } @AllFieldsConstructor - public ForStmt(final NodeList initialization, final Expression compare, final NodeList update, final Statement body, final NodeList contracts) { + public ForStmt(final NodeList initialization, final Expression compare, final NodeList update, final Statement body, final NodeList contracts) { this(null, initialization, compare, update, body, contracts); } - public ForStmt(TokenRange tokenRange, NodeList initialization, Expression compare, NodeList update, Statement body) { + public ForStmt(TokenRange tokenRange, NodeList initialization, Expression compare, NodeList update, Statement body) { this(tokenRange, initialization, compare, update, body, new NodeList<>()); } @@ -102,7 +102,7 @@ public ForStmt(TokenRange tokenRange, NodeList initialization, Expr * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ForStmt(TokenRange tokenRange, NodeList initialization, Expression compare, NodeList update, Statement body, NodeList contracts) { + public ForStmt(TokenRange tokenRange, NodeList initialization, Expression compare, NodeList update, Statement body, NodeList contracts) { super(tokenRange); setInitialization(initialization); setCompare(compare); @@ -114,38 +114,38 @@ public ForStmt(TokenRange tokenRange, NodeList initialization, Expr @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getBody() { + public Statement getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getCompare() { + public Optional getCompare() { return Optional.ofNullable(compare); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getInitialization() { + public NodeList getInitialization() { return initialization; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getUpdate() { + public NodeList getUpdate() { return update; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForStmt setBody(final Statement body) { + public ForStmt setBody(final Statement body) { assertNotNull(body); if (body == this.body) { return this; @@ -165,7 +165,7 @@ public ForStmt setBody(final Statement body) { * @return this, the ForStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForStmt setCompare(final Expression compare) { + public ForStmt setCompare(final Expression compare) { if (compare == this.compare) { return this; } @@ -178,7 +178,7 @@ public ForStmt setCompare(final Expression compare) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForStmt setInitialization(final NodeList initialization) { + public ForStmt setInitialization(final NodeList initialization) { assertNotNull(initialization); if (initialization == this.initialization) { return this; @@ -192,7 +192,7 @@ public ForStmt setInitialization(final NodeList initialization) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForStmt setUpdate(final NodeList update) { + public ForStmt setUpdate(final NodeList update) { assertNotNull(update); if (update == this.update) { return this; @@ -207,7 +207,7 @@ public ForStmt setUpdate(final NodeList update) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -239,25 +239,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ForStmt removeCompare() { + public ForStmt removeCompare() { return setCompare((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ForStmt clone() { + public ForStmt clone() { return (ForStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ForStmtMetaModel getMetaModel() { + public ForStmtMetaModel getMetaModel() { return JavaParserMetaModel.forStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -294,35 +294,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isForStmt() { + public boolean isForStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ForStmt asForStmt() { + public ForStmt asForStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifForStmt(Consumer action) { + public void ifForStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toForStmt() { + public Optional toForStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ForStmt setContracts(final NodeList contracts) { + public ForStmt setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/IfStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/IfStmt.java index eef2115301..bd18c903dc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/IfStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/IfStmt.java @@ -46,7 +46,7 @@ * * @author Julio Vilmar Gesser */ -public class IfStmt extends Statement implements NodeWithCondition { +public class IfStmt extends Statement implements NodeWithCondition { private Expression condition; @@ -55,12 +55,12 @@ public class IfStmt extends Statement implements NodeWithCondition { @OptionalProperty private Statement elseStmt; - public IfStmt() { + public IfStmt() { this(null, new BooleanLiteralExpr(), new ReturnStmt(), null); } @AllFieldsConstructor - public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { + public IfStmt(final Expression condition, final Statement thenStmt, final Statement elseStmt) { this(null, condition, thenStmt, elseStmt); } @@ -68,7 +68,7 @@ public IfStmt(final Expression condition, final Statement thenStmt, final State * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public IfStmt(TokenRange tokenRange, Expression condition, Statement thenStmt, Statement elseStmt) { + public IfStmt(TokenRange tokenRange, Expression condition, Statement thenStmt, Statement elseStmt) { super(tokenRange); setCondition(condition); setThenStmt(thenStmt); @@ -78,33 +78,33 @@ public IfStmt(TokenRange tokenRange, Expression condition, Statement thenStmt, @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCondition() { + public Expression getCondition() { return condition; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getElseStmt() { + public Optional getElseStmt() { return Optional.ofNullable(elseStmt); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getThenStmt() { + public Statement getThenStmt() { return thenStmt; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public IfStmt setCondition(final Expression condition) { + public IfStmt setCondition(final Expression condition) { assertNotNull(condition); if (condition == this.condition) { return this; @@ -124,7 +124,7 @@ public IfStmt setCondition(final Expression condition) { * @return this, the IfStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public IfStmt setElseStmt(final Statement elseStmt) { + public IfStmt setElseStmt(final Statement elseStmt) { if (elseStmt == this.elseStmt) { return this; } @@ -137,7 +137,7 @@ public IfStmt setElseStmt(final Statement elseStmt) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public IfStmt setThenStmt(final Statement thenStmt) { + public IfStmt setThenStmt(final Statement thenStmt) { assertNotNull(thenStmt); if (thenStmt == this.thenStmt) { return this; @@ -152,7 +152,7 @@ public IfStmt setThenStmt(final Statement thenStmt) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -166,7 +166,7 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public IfStmt removeElseStmt() { + public IfStmt removeElseStmt() { return setElseStmt((Statement) null); } @@ -174,7 +174,7 @@ public IfStmt removeElseStmt() { * This method returns true if the then branch (which should be always present) is a block statement. */ @DerivedProperty - public boolean hasThenBlock() { + public boolean hasThenBlock() { return thenStmt instanceof BlockStmt; } @@ -182,7 +182,7 @@ public boolean hasThenBlock() { * This method returns true if the If Statement has an else branch and that branch is a block statement. */ @DerivedProperty - public boolean hasElseBlock() { + public boolean hasElseBlock() { return elseStmt instanceof BlockStmt; } @@ -190,7 +190,7 @@ public boolean hasElseBlock() { * This method returns true if the If Statement has an else branch and that branch is another If Statement. */ @DerivedProperty - public boolean hasCascadingIfStmt() { + public boolean hasCascadingIfStmt() { return elseStmt instanceof IfStmt; } @@ -198,25 +198,25 @@ public boolean hasCascadingIfStmt() { * This method returns true if the If Statement has an else branch. */ @DerivedProperty - public boolean hasElseBranch() { + public boolean hasElseBranch() { return elseStmt != null; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public IfStmt clone() { + public IfStmt clone() { return (IfStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public IfStmtMetaModel getMetaModel() { + public IfStmtMetaModel getMetaModel() { return JavaParserMetaModel.ifStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -239,25 +239,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIfStmt() { + public boolean isIfStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IfStmt asIfStmt() { + public IfStmt asIfStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIfStmt(Consumer action) { + public void ifIfStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIfStmt() { + public Optional toIfStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LabeledStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LabeledStmt.java index ac363c6068..8d01c23f46 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LabeledStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LabeledStmt.java @@ -40,22 +40,22 @@ * * @author Julio Vilmar Gesser */ -public class LabeledStmt extends Statement { +public class LabeledStmt extends Statement { private SimpleName label; private Statement statement; - public LabeledStmt() { + public LabeledStmt() { this(null, new SimpleName(), new ReturnStmt()); } - public LabeledStmt(final String label, final Statement statement) { + public LabeledStmt(final String label, final Statement statement) { this(null, new SimpleName(label), statement); } @AllFieldsConstructor - public LabeledStmt(final SimpleName label, final Statement statement) { + public LabeledStmt(final SimpleName label, final Statement statement) { this(null, label, statement); } @@ -63,7 +63,7 @@ public LabeledStmt(final SimpleName label, final Statement statement) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LabeledStmt(TokenRange tokenRange, SimpleName label, Statement statement) { + public LabeledStmt(TokenRange tokenRange, SimpleName label, Statement statement) { super(tokenRange); setLabel(label); setStatement(statement); @@ -72,23 +72,23 @@ public LabeledStmt(TokenRange tokenRange, SimpleName label, Statement statement @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getStatement() { + public Statement getStatement() { return statement; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LabeledStmt setStatement(final Statement statement) { + public LabeledStmt setStatement(final Statement statement) { assertNotNull(statement); if (statement == this.statement) { return this; @@ -102,12 +102,12 @@ public LabeledStmt setStatement(final Statement statement) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getLabel() { + public SimpleName getLabel() { return label; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LabeledStmt setLabel(final SimpleName label) { + public LabeledStmt setLabel(final SimpleName label) { assertNotNull(label); if (label == this.label) { return this; @@ -122,19 +122,19 @@ public LabeledStmt setLabel(final SimpleName label) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LabeledStmt clone() { + public LabeledStmt clone() { return (LabeledStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LabeledStmtMetaModel getMetaModel() { + public LabeledStmtMetaModel getMetaModel() { return JavaParserMetaModel.labeledStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -151,25 +151,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLabeledStmt() { + public boolean isLabeledStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LabeledStmt asLabeledStmt() { + public LabeledStmt asLabeledStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLabeledStmt(Consumer action) { + public void ifLabeledStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLabeledStmt() { + public Optional toLabeledStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalClassDeclarationStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalClassDeclarationStmt.java index 2d6eebf6af..b0663878e5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalClassDeclarationStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalClassDeclarationStmt.java @@ -46,16 +46,16 @@ * @author Julio Vilmar Gesser * @see ClassOrInterfaceDeclaration */ -public class LocalClassDeclarationStmt extends Statement { +public class LocalClassDeclarationStmt extends Statement { private ClassOrInterfaceDeclaration classDeclaration; - public LocalClassDeclarationStmt() { + public LocalClassDeclarationStmt() { this(null, new ClassOrInterfaceDeclaration()); } @AllFieldsConstructor - public LocalClassDeclarationStmt(final ClassOrInterfaceDeclaration classDeclaration) { + public LocalClassDeclarationStmt(final ClassOrInterfaceDeclaration classDeclaration) { this(null, classDeclaration); } @@ -63,7 +63,7 @@ public LocalClassDeclarationStmt(final ClassOrInterfaceDeclaration classDeclara * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LocalClassDeclarationStmt(TokenRange tokenRange, ClassOrInterfaceDeclaration classDeclaration) { + public LocalClassDeclarationStmt(TokenRange tokenRange, ClassOrInterfaceDeclaration classDeclaration) { super(tokenRange); setClassDeclaration(classDeclaration); customInitialization(); @@ -71,23 +71,23 @@ public LocalClassDeclarationStmt(TokenRange tokenRange, ClassOrInterfaceDeclara @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceDeclaration getClassDeclaration() { + public ClassOrInterfaceDeclaration getClassDeclaration() { return classDeclaration; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LocalClassDeclarationStmt setClassDeclaration(final ClassOrInterfaceDeclaration classDeclaration) { + public LocalClassDeclarationStmt setClassDeclaration(final ClassOrInterfaceDeclaration classDeclaration) { assertNotNull(classDeclaration); if (classDeclaration == this.classDeclaration) { return this; @@ -102,19 +102,19 @@ public LocalClassDeclarationStmt setClassDeclaration(final ClassOrInterfaceDecl @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LocalClassDeclarationStmt clone() { + public LocalClassDeclarationStmt clone() { return (LocalClassDeclarationStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LocalClassDeclarationStmtMetaModel getMetaModel() { + public LocalClassDeclarationStmtMetaModel getMetaModel() { return JavaParserMetaModel.localClassDeclarationStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -127,25 +127,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocalClassDeclarationStmt() { + public boolean isLocalClassDeclarationStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LocalClassDeclarationStmt asLocalClassDeclarationStmt() { + public LocalClassDeclarationStmt asLocalClassDeclarationStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLocalClassDeclarationStmt(Consumer action) { + public void ifLocalClassDeclarationStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLocalClassDeclarationStmt() { + public Optional toLocalClassDeclarationStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalRecordDeclarationStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalRecordDeclarationStmt.java index df7a89a210..c135c0c58d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalRecordDeclarationStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/LocalRecordDeclarationStmt.java @@ -41,16 +41,16 @@ * @author Roger Howell * @see RecordDeclaration */ -public class LocalRecordDeclarationStmt extends Statement { +public class LocalRecordDeclarationStmt extends Statement { private RecordDeclaration recordDeclaration; - public LocalRecordDeclarationStmt() { + public LocalRecordDeclarationStmt() { this(null, new RecordDeclaration()); } @AllFieldsConstructor - public LocalRecordDeclarationStmt(final RecordDeclaration recordDeclaration) { + public LocalRecordDeclarationStmt(final RecordDeclaration recordDeclaration) { this(null, recordDeclaration); } @@ -58,7 +58,7 @@ public LocalRecordDeclarationStmt(final RecordDeclaration recordDeclaration) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public LocalRecordDeclarationStmt(TokenRange tokenRange, RecordDeclaration recordDeclaration) { + public LocalRecordDeclarationStmt(TokenRange tokenRange, RecordDeclaration recordDeclaration) { super(tokenRange); setRecordDeclaration(recordDeclaration); customInitialization(); @@ -66,23 +66,23 @@ public LocalRecordDeclarationStmt(TokenRange tokenRange, RecordDeclaration reco @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public RecordDeclaration getRecordDeclaration() { + public RecordDeclaration getRecordDeclaration() { return recordDeclaration; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public LocalRecordDeclarationStmt setRecordDeclaration(final RecordDeclaration recordDeclaration) { + public LocalRecordDeclarationStmt setRecordDeclaration(final RecordDeclaration recordDeclaration) { assertNotNull(recordDeclaration); if (recordDeclaration == this.recordDeclaration) { return this; @@ -97,19 +97,19 @@ public LocalRecordDeclarationStmt setRecordDeclaration(final RecordDeclaration @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public LocalRecordDeclarationStmt clone() { + public LocalRecordDeclarationStmt clone() { return (LocalRecordDeclarationStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public LocalRecordDeclarationStmtMetaModel getMetaModel() { + public LocalRecordDeclarationStmtMetaModel getMetaModel() { return JavaParserMetaModel.localRecordDeclarationStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -122,25 +122,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocalRecordDeclarationStmt() { + public boolean isLocalRecordDeclarationStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LocalRecordDeclarationStmt asLocalRecordDeclarationStmt() { + public LocalRecordDeclarationStmt asLocalRecordDeclarationStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLocalRecordDeclarationStmt(Consumer action) { + public void ifLocalRecordDeclarationStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLocalRecordDeclarationStmt() { + public Optional toLocalRecordDeclarationStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ReturnStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ReturnStmt.java index 50038f5753..29a3cbb7a9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ReturnStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ReturnStmt.java @@ -42,17 +42,17 @@ * * @author Julio Vilmar Gesser */ -public class ReturnStmt extends Statement { +public class ReturnStmt extends Statement { @OptionalProperty private Expression expression; - public ReturnStmt() { + public ReturnStmt() { this(null, null); } @AllFieldsConstructor - public ReturnStmt(final Expression expression) { + public ReturnStmt(final Expression expression) { this(null, expression); } @@ -60,7 +60,7 @@ public ReturnStmt(final Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ReturnStmt(TokenRange tokenRange, Expression expression) { + public ReturnStmt(TokenRange tokenRange, Expression expression) { super(tokenRange); setExpression(expression); customInitialization(); @@ -69,24 +69,24 @@ public ReturnStmt(TokenRange tokenRange, Expression expression) { /** * Will create a NameExpr with the string param */ - public ReturnStmt(String expression) { + public ReturnStmt(String expression) { this(null, new NameExpr(expression)); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getExpression() { + public Optional getExpression() { return Optional.ofNullable(expression); } @@ -97,7 +97,7 @@ public Optional getExpression() { * @return this, the ReturnStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ReturnStmt setExpression(final Expression expression) { + public ReturnStmt setExpression(final Expression expression) { if (expression == this.expression) { return this; } @@ -111,7 +111,7 @@ public ReturnStmt setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -125,25 +125,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ReturnStmt removeExpression() { + public ReturnStmt removeExpression() { return setExpression((Expression) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ReturnStmt clone() { + public ReturnStmt clone() { return (ReturnStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ReturnStmtMetaModel getMetaModel() { + public ReturnStmtMetaModel getMetaModel() { return JavaParserMetaModel.returnStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -158,25 +158,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isReturnStmt() { + public boolean isReturnStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ReturnStmt asReturnStmt() { + public ReturnStmt asReturnStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifReturnStmt(Consumer action) { + public void ifReturnStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toReturnStmt() { + public Optional toReturnStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java index 5952c34a1b..ebabcd97f6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/Statement.java @@ -41,7 +41,7 @@ public abstract class Statement extends Node { @AllFieldsConstructor - public Statement() { + public Statement() { this(null); } @@ -49,729 +49,729 @@ public Statement() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Statement(TokenRange tokenRange) { + public Statement(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Statement clone() { + public Statement clone() { return (Statement) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public StatementMetaModel getMetaModel() { + public StatementMetaModel getMetaModel() { return JavaParserMetaModel.statementMetaModel; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isAssertStmt() { + public boolean isAssertStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public AssertStmt asAssertStmt() { + public AssertStmt asAssertStmt() { throw new IllegalStateException(f("%s is not AssertStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBlockStmt() { + public boolean isBlockStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BlockStmt asBlockStmt() { + public BlockStmt asBlockStmt() { throw new IllegalStateException(f("%s is not BlockStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isBreakStmt() { + public boolean isBreakStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public BreakStmt asBreakStmt() { + public BreakStmt asBreakStmt() { throw new IllegalStateException(f("%s is not BreakStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isContinueStmt() { + public boolean isContinueStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ContinueStmt asContinueStmt() { + public ContinueStmt asContinueStmt() { throw new IllegalStateException(f("%s is not ContinueStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isDoStmt() { + public boolean isDoStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public DoStmt asDoStmt() { + public DoStmt asDoStmt() { throw new IllegalStateException(f("%s is not DoStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isEmptyStmt() { + public boolean isEmptyStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public EmptyStmt asEmptyStmt() { + public EmptyStmt asEmptyStmt() { throw new IllegalStateException(f("%s is not EmptyStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isExplicitConstructorInvocationStmt() { + public boolean isExplicitConstructorInvocationStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt() { + public ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt() { throw new IllegalStateException(f("%s is not ExplicitConstructorInvocationStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isExpressionStmt() { + public boolean isExpressionStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ExpressionStmt asExpressionStmt() { + public ExpressionStmt asExpressionStmt() { throw new IllegalStateException(f("%s is not ExpressionStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isForStmt() { + public boolean isForStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ForStmt asForStmt() { + public ForStmt asForStmt() { throw new IllegalStateException(f("%s is not ForStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIfStmt() { + public boolean isIfStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IfStmt asIfStmt() { + public IfStmt asIfStmt() { throw new IllegalStateException(f("%s is not IfStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLabeledStmt() { + public boolean isLabeledStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LabeledStmt asLabeledStmt() { + public LabeledStmt asLabeledStmt() { throw new IllegalStateException(f("%s is not LabeledStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocalClassDeclarationStmt() { + public boolean isLocalClassDeclarationStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isLocalRecordDeclarationStmt() { + public boolean isLocalRecordDeclarationStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LocalClassDeclarationStmt asLocalClassDeclarationStmt() { + public LocalClassDeclarationStmt asLocalClassDeclarationStmt() { throw new IllegalStateException(f("%s is not LocalClassDeclarationStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public LocalRecordDeclarationStmt asLocalRecordDeclarationStmt() { + public LocalRecordDeclarationStmt asLocalRecordDeclarationStmt() { throw new IllegalStateException(f("%s is not LocalRecordDeclarationStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isReturnStmt() { + public boolean isReturnStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ReturnStmt asReturnStmt() { + public ReturnStmt asReturnStmt() { throw new IllegalStateException(f("%s is not ReturnStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSwitchStmt() { + public boolean isSwitchStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SwitchStmt asSwitchStmt() { + public SwitchStmt asSwitchStmt() { throw new IllegalStateException(f("%s is not SwitchStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSynchronizedStmt() { + public boolean isSynchronizedStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SynchronizedStmt asSynchronizedStmt() { + public SynchronizedStmt asSynchronizedStmt() { throw new IllegalStateException(f("%s is not SynchronizedStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isThrowStmt() { + public boolean isThrowStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ThrowStmt asThrowStmt() { + public ThrowStmt asThrowStmt() { throw new IllegalStateException(f("%s is not ThrowStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTryStmt() { + public boolean isTryStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TryStmt asTryStmt() { + public TryStmt asTryStmt() { throw new IllegalStateException(f("%s is not TryStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnparsableStmt() { + public boolean isUnparsableStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnparsableStmt asUnparsableStmt() { + public UnparsableStmt asUnparsableStmt() { throw new IllegalStateException(f("%s is not UnparsableStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isWhileStmt() { + public boolean isWhileStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public WhileStmt asWhileStmt() { + public WhileStmt asWhileStmt() { throw new IllegalStateException(f("%s is not WhileStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifAssertStmt(Consumer action) { + public void ifAssertStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBlockStmt(Consumer action) { + public void ifBlockStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifBreakStmt(Consumer action) { + public void ifBreakStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifContinueStmt(Consumer action) { + public void ifContinueStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifDoStmt(Consumer action) { + public void ifDoStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifEmptyStmt(Consumer action) { + public void ifEmptyStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifExplicitConstructorInvocationStmt(Consumer action) { + public void ifExplicitConstructorInvocationStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifExpressionStmt(Consumer action) { + public void ifExpressionStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifForStmt(Consumer action) { + public void ifForStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIfStmt(Consumer action) { + public void ifIfStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLabeledStmt(Consumer action) { + public void ifLabeledStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLocalClassDeclarationStmt(Consumer action) { + public void ifLocalClassDeclarationStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifLocalRecordDeclarationStmt(Consumer action) { + public void ifLocalRecordDeclarationStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifReturnStmt(Consumer action) { + public void ifReturnStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSwitchStmt(Consumer action) { + public void ifSwitchStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSynchronizedStmt(Consumer action) { + public void ifSynchronizedStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifThrowStmt(Consumer action) { + public void ifThrowStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTryStmt(Consumer action) { + public void ifTryStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnparsableStmt(Consumer action) { + public void ifUnparsableStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifWhileStmt(Consumer action) { + public void ifWhileStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toAssertStmt() { + public Optional toAssertStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBlockStmt() { + public Optional toBlockStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toBreakStmt() { + public Optional toBreakStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toContinueStmt() { + public Optional toContinueStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toDoStmt() { + public Optional toDoStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toEmptyStmt() { + public Optional toEmptyStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toExplicitConstructorInvocationStmt() { + public Optional toExplicitConstructorInvocationStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toExpressionStmt() { + public Optional toExpressionStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toForStmt() { + public Optional toForStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIfStmt() { + public Optional toIfStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLabeledStmt() { + public Optional toLabeledStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLocalClassDeclarationStmt() { + public Optional toLocalClassDeclarationStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toLocalRecordDeclarationStmt() { + public Optional toLocalRecordDeclarationStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toReturnStmt() { + public Optional toReturnStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSwitchStmt() { + public Optional toSwitchStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSynchronizedStmt() { + public Optional toSynchronizedStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toThrowStmt() { + public Optional toThrowStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTryStmt() { + public Optional toTryStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnparsableStmt() { + public Optional toUnparsableStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toWhileStmt() { + public Optional toWhileStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isForEachStmt() { + public boolean isForEachStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ForEachStmt asForEachStmt() { + public ForEachStmt asForEachStmt() { throw new IllegalStateException(f("%s is not ForEachStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toForEachStmt() { + public Optional toForEachStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifForEachStmt(Consumer action) { + public void ifForEachStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isYieldStmt() { + public boolean isYieldStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public YieldStmt asYieldStmt() { + public YieldStmt asYieldStmt() { throw new IllegalStateException(f("%s is not YieldStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toYieldStmt() { + public Optional toYieldStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifYieldStmt(Consumer action) { + public void ifYieldStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlAssertStmt() { + public boolean isJmlAssertStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlAssertStmt() { + public JmlExpressionStmt asJmlAssertStmt() { throw new IllegalStateException(f("%s is not JmlAssertStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlAssertStmt() { + public Optional toJmlAssertStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlAssertStmt(Consumer action) { + public void ifJmlAssertStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlAssumeStmt() { + public boolean isJmlAssumeStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlSetStmt() { + public boolean isJmlSetStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnreachableStmt() { + public boolean isUnreachableStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlUnreachableStmt asUnreachableStmt() { + public JmlUnreachableStmt asUnreachableStmt() { throw new IllegalStateException(f("%s is not UnreachableStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnreachableStmt() { + public Optional toUnreachableStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnreachableStmt(Consumer action) { + public void ifUnreachableStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDebugStmt() { + public boolean isJmlDebugStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlHenceByStmt() { + public boolean isJmlHenceByStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlRefiningStmt() { + public boolean isJmlRefiningStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlRefiningStmt asJmlRefiningStmt() { + public JmlRefiningStmt asJmlRefiningStmt() { throw new IllegalStateException(f("%s is not JmlRefiningStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlRefiningStmt() { + public Optional toJmlRefiningStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlRefiningStmt(Consumer action) { + public void ifJmlRefiningStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlStatement() { + public boolean isJmlStatement() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlStatement asJmlStatement() { + public JmlStatement asJmlStatement() { throw new IllegalStateException(f("%s is not JmlStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlStatement() { + public Optional toJmlStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlStatement(Consumer action) { + public void ifJmlStatement(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlStatements() { + public boolean isJmlStatements() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlUnreachableStmt() { + public boolean isJmlUnreachableStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlUnreachableStmt asJmlUnreachableStmt() { + public JmlUnreachableStmt asJmlUnreachableStmt() { throw new IllegalStateException(f("%s is not JmlUnreachableStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlUnreachableStmt() { + public Optional toJmlUnreachableStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlUnreachableStmt(Consumer action) { + public void ifJmlUnreachableStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlStmtWithExpression() { + public boolean isJmlStmtWithExpression() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlStmtWithExpression() { + public JmlExpressionStmt asJmlStmtWithExpression() { throw new IllegalStateException(f("%s is not JmlStmtWithExpression, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlStmtWithExpression() { + public Optional toJmlStmtWithExpression() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlStmtWithExpression(Consumer action) { + public void ifJmlStmtWithExpression(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlGhostStatements() { + public boolean isJmlGhostStatements() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlGhostStmt asJmlGhostStatements() { + public JmlGhostStmt asJmlGhostStatements() { throw new IllegalStateException(f("%s is not JmlGhostStatements, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlGhostStatements() { + public Optional toJmlGhostStatements() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlGhostStatements(Consumer action) { + public void ifJmlGhostStatements(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlDocStmt() { + public boolean isJmlDocStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlDocStmt asJmlDocStmt() { + public JmlDocStmt asJmlDocStmt() { throw new IllegalStateException(f("%s is not JmlDocStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlDocStmt() { + public Optional toJmlDocStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlDocStmt(Consumer action) { + public void ifJmlDocStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlGhostStatement() { + public boolean isJmlGhostStatement() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlGhostStmt asJmlGhostStatement() { + public JmlGhostStmt asJmlGhostStatement() { throw new IllegalStateException(f("%s is not JmlGhostStatement, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlGhostStatement() { + public Optional toJmlGhostStatement() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlGhostStatement(Consumer action) { + public void ifJmlGhostStatement(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlBeginStmt() { + public boolean isJmlBeginStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlBeginStmt asJmlBeginStmt() { + public JmlBeginStmt asJmlBeginStmt() { throw new IllegalStateException(f("%s is not JmlBeginStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlBeginStmt() { + public Optional toJmlBeginStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlBeginStmt(Consumer action) { + public void ifJmlBeginStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlEndStmt() { + public boolean isJmlEndStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlEndStmt asJmlEndStmt() { + public JmlEndStmt asJmlEndStmt() { throw new IllegalStateException(f("%s is not JmlEndStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlEndStmt() { + public Optional toJmlEndStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlEndStmt(Consumer action) { + public void ifJmlEndStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlExpressionStmt() { + public boolean isJmlExpressionStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlExpressionStmt asJmlExpressionStmt() { + public JmlExpressionStmt asJmlExpressionStmt() { throw new IllegalStateException(f("%s is not JmlExpressionStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlExpressionStmt() { + public Optional toJmlExpressionStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlExpressionStmt(Consumer action) { + public void ifJmlExpressionStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlGhostStmt() { + public boolean isJmlGhostStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlGhostStmt asJmlGhostStmt() { + public JmlGhostStmt asJmlGhostStmt() { throw new IllegalStateException(f("%s is not JmlGhostStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlGhostStmt() { + public Optional toJmlGhostStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlGhostStmt(Consumer action) { + public void ifJmlGhostStmt(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isJmlLabelStmt() { + public boolean isJmlLabelStmt() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public JmlLabelStmt asJmlLabelStmt() { + public JmlLabelStmt asJmlLabelStmt() { throw new IllegalStateException(f("%s is not JmlLabelStmt, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toJmlLabelStmt() { + public Optional toJmlLabelStmt() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifJmlLabelStmt(Consumer action) { + public void ifJmlLabelStmt(Consumer action) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java index 72f90539ae..f353c0e209 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchEntry.java @@ -84,9 +84,9 @@ * @see SwitchStmt * @see com.github.javaparser.ast.expr.SwitchExpr */ -public class SwitchEntry extends Node implements NodeWithStatements { +public class SwitchEntry extends Node implements NodeWithStatements { - public enum Type { + public enum Type { STATEMENT_GROUP, EXPRESSION, BLOCK, THROWS_STATEMENT } @@ -102,7 +102,7 @@ public enum Type { @OptionalProperty private Expression guard; - public SwitchEntry() { + public SwitchEntry() { this(null, new NodeList(), Type.STATEMENT_GROUP, new NodeList<>(), false, null); } @@ -110,7 +110,7 @@ public SwitchEntry() { * This constructor exists for backwards compatibility for code that instantiated `SwitchEntries` before * the `isDefault` and guard fields were added. */ - public SwitchEntry(final TokenRange tokenRange, final NodeList labels, final Type type, final NodeList statements) { + public SwitchEntry(final TokenRange tokenRange, final NodeList labels, final Type type, final NodeList statements) { this(tokenRange, labels, type, statements, false, null); } @@ -118,12 +118,12 @@ public SwitchEntry(final TokenRange tokenRange, final NodeList labe * This constructor exists for backwards compatibility for code that instantiated `SwitchEntries` before * the `isDefault` and guard fields were added. */ - public SwitchEntry(final NodeList labels, final Type type, final NodeList statements) { + public SwitchEntry(final NodeList labels, final Type type, final NodeList statements) { this(null, labels, type, statements, false, null); } @AllFieldsConstructor - public SwitchEntry(final NodeList labels, final Type type, final NodeList statements, final boolean isDefault) { + public SwitchEntry(final NodeList labels, final Type type, final NodeList statements, final boolean isDefault) { this(null, labels, type, statements, isDefault, null); } @@ -131,7 +131,7 @@ public SwitchEntry(final NodeList labels, final Type type, final No * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SwitchEntry(TokenRange tokenRange, NodeList labels, Type type, NodeList statements, boolean isDefault, Expression guard) { + public SwitchEntry(TokenRange tokenRange, NodeList labels, Type type, NodeList statements, boolean isDefault, Expression guard) { super(tokenRange); setLabels(labels); setType(type); @@ -150,29 +150,29 @@ public SwitchEntry(TokenRange tokenRange, NodeList labels, Type typ * are for the various switch expressions. */ @DerivedProperty - public boolean isSwitchStatementEntry() { + public boolean isSwitchStatementEntry() { return type == Type.STATEMENT_GROUP; } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getLabels() { + public NodeList getLabels() { return labels; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getStatements() { + public NodeList getStatements() { return statements; } @@ -183,7 +183,7 @@ public NodeList getStatements() { * @return this, the SwitchEntry */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchEntry setLabels(final NodeList labels) { + public SwitchEntry setLabels(final NodeList labels) { assertNotNull(labels); if (labels == this.labels) { return this; @@ -197,7 +197,7 @@ public SwitchEntry setLabels(final NodeList labels) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchEntry setStatements(final NodeList statements) { + public SwitchEntry setStatements(final NodeList statements) { assertNotNull(statements); if (statements == this.statements) { return this; @@ -212,7 +212,7 @@ public SwitchEntry setStatements(final NodeList statements) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -239,23 +239,23 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SwitchEntry clone() { + public SwitchEntry clone() { return (SwitchEntry) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SwitchEntryMetaModel getMetaModel() { + public SwitchEntryMetaModel getMetaModel() { return JavaParserMetaModel.switchEntryMetaModel; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getType() { + public Type getType() { return type; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchEntry setType(final Type type) { + public SwitchEntry setType(final Type type) { assertNotNull(type); if (type == this.type) { return this; @@ -267,7 +267,7 @@ public SwitchEntry setType(final Type type) { @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -293,12 +293,12 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public boolean isDefault() { + public boolean isDefault() { return isDefault; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchEntry setDefault(final boolean isDefault) { + public SwitchEntry setDefault(final boolean isDefault) { if (isDefault == this.isDefault) { return this; } @@ -308,12 +308,12 @@ public SwitchEntry setDefault(final boolean isDefault) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getGuard() { + public Optional getGuard() { return Optional.ofNullable(guard); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchEntry setGuard(final Expression guard) { + public SwitchEntry setGuard(final Expression guard) { if (guard == this.guard) { return this; } @@ -326,7 +326,7 @@ public SwitchEntry setGuard(final Expression guard) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public SwitchEntry removeGuard() { + public SwitchEntry removeGuard() { return setGuard((Expression) null); } @@ -334,7 +334,7 @@ public SwitchEntry removeGuard() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SwitchEntry(TokenRange tokenRange, NodeList labels, Type type, NodeList statements, boolean isDefault) { + public SwitchEntry(TokenRange tokenRange, NodeList labels, Type type, NodeList statements, boolean isDefault) { super(tokenRange); setLabels(labels); setType(type); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchStmt.java index f9e2b63da6..e98d7b32d0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SwitchStmt.java @@ -75,18 +75,18 @@ * @see BreakStmt * @see YieldStmt */ -public class SwitchStmt extends Statement implements SwitchNode { +public class SwitchStmt extends Statement implements SwitchNode { private Expression selector; private NodeList entries; - public SwitchStmt() { + public SwitchStmt() { this(null, new NameExpr(), new NodeList<>()); } @AllFieldsConstructor - public SwitchStmt(final Expression selector, final NodeList entries) { + public SwitchStmt(final Expression selector, final NodeList entries) { this(null, selector, entries); } @@ -94,7 +94,7 @@ public SwitchStmt(final Expression selector, final NodeList entrie * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SwitchStmt(TokenRange tokenRange, Expression selector, NodeList entries) { + public SwitchStmt(TokenRange tokenRange, Expression selector, NodeList entries) { super(tokenRange); setSelector(selector); setEntries(entries); @@ -103,32 +103,32 @@ public SwitchStmt(TokenRange tokenRange, Expression selector, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getEntries() { + public NodeList getEntries() { return entries; } - public SwitchEntry getEntry(int i) { + public SwitchEntry getEntry(int i) { return getEntries().get(i); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getSelector() { + public Expression getSelector() { return selector; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchStmt setEntries(final NodeList entries) { + public SwitchStmt setEntries(final NodeList entries) { assertNotNull(entries); if (entries == this.entries) { return this; @@ -142,7 +142,7 @@ public SwitchStmt setEntries(final NodeList entries) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SwitchStmt setSelector(final Expression selector) { + public SwitchStmt setSelector(final Expression selector) { assertNotNull(selector); if (selector == this.selector) { return this; @@ -157,7 +157,7 @@ public SwitchStmt setSelector(final Expression selector) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -172,19 +172,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SwitchStmt clone() { + public SwitchStmt clone() { return (SwitchStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SwitchStmtMetaModel getMetaModel() { + public SwitchStmtMetaModel getMetaModel() { return JavaParserMetaModel.switchStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -203,25 +203,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSwitchStmt() { + public boolean isSwitchStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SwitchStmt asSwitchStmt() { + public SwitchStmt asSwitchStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSwitchStmt(Consumer action) { + public void ifSwitchStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSwitchStmt() { + public Optional toSwitchStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SynchronizedStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SynchronizedStmt.java index 154c6ce4cb..6c4d7a560c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SynchronizedStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/SynchronizedStmt.java @@ -44,18 +44,18 @@ * * @author Julio Vilmar Gesser */ -public class SynchronizedStmt extends Statement implements NodeWithBlockStmt, NodeWithExpression { +public class SynchronizedStmt extends Statement implements NodeWithBlockStmt, NodeWithExpression { private Expression expression; private BlockStmt body; - public SynchronizedStmt() { + public SynchronizedStmt() { this(null, new NameExpr(), new BlockStmt()); } @AllFieldsConstructor - public SynchronizedStmt(final Expression expression, final BlockStmt body) { + public SynchronizedStmt(final Expression expression, final BlockStmt body) { this(null, expression, body); } @@ -63,7 +63,7 @@ public SynchronizedStmt(final Expression expression, final BlockStmt body) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public SynchronizedStmt(TokenRange tokenRange, Expression expression, BlockStmt body) { + public SynchronizedStmt(TokenRange tokenRange, Expression expression, BlockStmt body) { super(tokenRange); setExpression(expression); setBody(body); @@ -72,23 +72,23 @@ public SynchronizedStmt(TokenRange tokenRange, Expression expression, BlockStmt @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SynchronizedStmt setExpression(final Expression expression) { + public SynchronizedStmt setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -102,12 +102,12 @@ public SynchronizedStmt setExpression(final Expression expression) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getBody() { + public BlockStmt getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SynchronizedStmt setBody(final BlockStmt body) { + public SynchronizedStmt setBody(final BlockStmt body) { assertNotNull(body); if (body == this.body) { return this; @@ -122,19 +122,19 @@ public SynchronizedStmt setBody(final BlockStmt body) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public SynchronizedStmt clone() { + public SynchronizedStmt clone() { return (SynchronizedStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public SynchronizedStmtMetaModel getMetaModel() { + public SynchronizedStmtMetaModel getMetaModel() { return JavaParserMetaModel.synchronizedStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -151,25 +151,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isSynchronizedStmt() { + public boolean isSynchronizedStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public SynchronizedStmt asSynchronizedStmt() { + public SynchronizedStmt asSynchronizedStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifSynchronizedStmt(Consumer action) { + public void ifSynchronizedStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toSynchronizedStmt() { + public Optional toSynchronizedStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ThrowStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ThrowStmt.java index 292e7d7430..42e702617f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ThrowStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/ThrowStmt.java @@ -43,16 +43,16 @@ * * @author Julio Vilmar Gesser */ -public class ThrowStmt extends Statement implements NodeWithExpression { +public class ThrowStmt extends Statement implements NodeWithExpression { private Expression expression; - public ThrowStmt() { + public ThrowStmt() { this(null, new NameExpr()); } @AllFieldsConstructor - public ThrowStmt(final Expression expression) { + public ThrowStmt(final Expression expression) { this(null, expression); } @@ -60,7 +60,7 @@ public ThrowStmt(final Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ThrowStmt(TokenRange tokenRange, Expression expression) { + public ThrowStmt(TokenRange tokenRange, Expression expression) { super(tokenRange); setExpression(expression); customInitialization(); @@ -68,23 +68,23 @@ public ThrowStmt(TokenRange tokenRange, Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ThrowStmt setExpression(final Expression expression) { + public ThrowStmt setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -99,19 +99,19 @@ public ThrowStmt setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ThrowStmt clone() { + public ThrowStmt clone() { return (ThrowStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ThrowStmtMetaModel getMetaModel() { + public ThrowStmtMetaModel getMetaModel() { return JavaParserMetaModel.throwStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -124,25 +124,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isThrowStmt() { + public boolean isThrowStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ThrowStmt asThrowStmt() { + public ThrowStmt asThrowStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifThrowStmt(Consumer action) { + public void ifThrowStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toThrowStmt() { + public Optional toThrowStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/TryStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/TryStmt.java index 806ee9c82b..e5e0454ab4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/TryStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/TryStmt.java @@ -92,7 +92,7 @@ * @see com.github.javaparser.ast.expr.FieldAccessExpr * @see com.github.javaparser.ast.expr.NameExpr */ -public class TryStmt extends Statement { +public class TryStmt extends Statement { private NodeList resources; @@ -103,16 +103,16 @@ public class TryStmt extends Statement { @OptionalProperty private BlockStmt finallyBlock; - public TryStmt() { + public TryStmt() { this(null, new NodeList<>(), new BlockStmt(), new NodeList<>(), null); } - public TryStmt(final BlockStmt tryBlock, final NodeList catchClauses, final BlockStmt finallyBlock) { + public TryStmt(final BlockStmt tryBlock, final NodeList catchClauses, final BlockStmt finallyBlock) { this(null, new NodeList<>(), tryBlock, catchClauses, finallyBlock); } @AllFieldsConstructor - public TryStmt(NodeList resources, final BlockStmt tryBlock, final NodeList catchClauses, final BlockStmt finallyBlock) { + public TryStmt(NodeList resources, final BlockStmt tryBlock, final NodeList catchClauses, final BlockStmt finallyBlock) { this(null, resources, tryBlock, catchClauses, finallyBlock); } @@ -120,7 +120,7 @@ public TryStmt(NodeList resources, final BlockStmt tryBlock, final * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TryStmt(TokenRange tokenRange, NodeList resources, BlockStmt tryBlock, NodeList catchClauses, BlockStmt finallyBlock) { + public TryStmt(TokenRange tokenRange, NodeList resources, BlockStmt tryBlock, NodeList catchClauses, BlockStmt finallyBlock) { super(tokenRange); setResources(resources); setTryBlock(tryBlock); @@ -131,38 +131,38 @@ public TryStmt(TokenRange tokenRange, NodeList resources, BlockStmt @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getCatchClauses() { + public NodeList getCatchClauses() { return catchClauses; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getFinallyBlock() { + public Optional getFinallyBlock() { return Optional.ofNullable(finallyBlock); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public BlockStmt getTryBlock() { + public BlockStmt getTryBlock() { return tryBlock; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getResources() { + public NodeList getResources() { return resources; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TryStmt setCatchClauses(final NodeList catchClauses) { + public TryStmt setCatchClauses(final NodeList catchClauses) { assertNotNull(catchClauses); if (catchClauses == this.catchClauses) { return this; @@ -176,7 +176,7 @@ public TryStmt setCatchClauses(final NodeList catchClauses) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TryStmt setFinallyBlock(final BlockStmt finallyBlock) { + public TryStmt setFinallyBlock(final BlockStmt finallyBlock) { if (finallyBlock == this.finallyBlock) { return this; } @@ -189,7 +189,7 @@ public TryStmt setFinallyBlock(final BlockStmt finallyBlock) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TryStmt setTryBlock(final BlockStmt tryBlock) { + public TryStmt setTryBlock(final BlockStmt tryBlock) { assertNotNull(tryBlock); if (tryBlock == this.tryBlock) { return this; @@ -203,7 +203,7 @@ public TryStmt setTryBlock(final BlockStmt tryBlock) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TryStmt setResources(final NodeList resources) { + public TryStmt setResources(final NodeList resources) { assertNotNull(resources); if (resources == this.resources) { return this; @@ -218,7 +218,7 @@ public TryStmt setResources(final NodeList resources) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -244,25 +244,25 @@ public boolean remove(Node node) { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public TryStmt removeFinallyBlock() { + public TryStmt removeFinallyBlock() { return setFinallyBlock((BlockStmt) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TryStmt clone() { + public TryStmt clone() { return (TryStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TryStmtMetaModel getMetaModel() { + public TryStmtMetaModel getMetaModel() { return JavaParserMetaModel.tryStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -293,25 +293,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTryStmt() { + public boolean isTryStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TryStmt asTryStmt() { + public TryStmt asTryStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTryStmt(Consumer action) { + public void ifTryStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTryStmt() { + public Optional toTryStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/UnparsableStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/UnparsableStmt.java index a68c0af396..7b217072d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/UnparsableStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/UnparsableStmt.java @@ -37,10 +37,10 @@ * A statement that had parse errors. * Nothing is known about it except the tokens it covers. */ -public class UnparsableStmt extends Statement { +public class UnparsableStmt extends Statement { @AllFieldsConstructor - public UnparsableStmt() { + public UnparsableStmt() { this(null); } @@ -48,61 +48,61 @@ public UnparsableStmt() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public UnparsableStmt(TokenRange tokenRange) { + public UnparsableStmt(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public UnparsableStmt clone() { + public UnparsableStmt clone() { return (UnparsableStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public UnparsableStmtMetaModel getMetaModel() { + public UnparsableStmtMetaModel getMetaModel() { return JavaParserMetaModel.unparsableStmtMetaModel; } @Override - public Parsedness getParsed() { + public Parsedness getParsed() { return UNPARSABLE; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnparsableStmt() { + public boolean isUnparsableStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnparsableStmt asUnparsableStmt() { + public UnparsableStmt asUnparsableStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnparsableStmt(Consumer action) { + public void ifUnparsableStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnparsableStmt() { + public Optional toUnparsableStmt() { return Optional.of(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/WhileStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/WhileStmt.java index 8ccca9c086..3e291e06a8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/WhileStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/WhileStmt.java @@ -47,7 +47,7 @@ * * @author Julio Vilmar Gesser */ -public class WhileStmt extends Statement implements NodeWithBody, NodeWithCondition, NodeWithContracts { +public class WhileStmt extends Statement implements NodeWithBody, NodeWithCondition, NodeWithContracts { private NodeList contracts; @@ -55,20 +55,20 @@ public class WhileStmt extends Statement implements NodeWithBody, No private Statement body; - public WhileStmt() { + public WhileStmt() { this(new BooleanLiteralExpr(), new ReturnStmt()); } - public WhileStmt(final Expression condition, final Statement body) { + public WhileStmt(final Expression condition, final Statement body) { this(condition, body, new NodeList<>()); } @AllFieldsConstructor - public WhileStmt(final Expression condition, final Statement body, final NodeList contracts) { + public WhileStmt(final Expression condition, final Statement body, final NodeList contracts) { this(null, condition, body, contracts); } - public WhileStmt(TokenRange tokenRange, Expression condition, Statement body) { + public WhileStmt(TokenRange tokenRange, Expression condition, Statement body) { this(tokenRange, condition, body, new NodeList<>()); } @@ -76,7 +76,7 @@ public WhileStmt(TokenRange tokenRange, Expression condition, Statement body) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public WhileStmt(TokenRange tokenRange, Expression condition, Statement body, NodeList contracts) { + public WhileStmt(TokenRange tokenRange, Expression condition, Statement body, NodeList contracts) { super(tokenRange); setCondition(condition); setBody(body); @@ -86,28 +86,28 @@ public WhileStmt(TokenRange tokenRange, Expression condition, Statement body, N @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Statement getBody() { + public Statement getBody() { return body; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getCondition() { + public Expression getCondition() { return condition; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public WhileStmt setBody(final Statement body) { + public WhileStmt setBody(final Statement body) { assertNotNull(body); if (body == this.body) { return this; @@ -121,7 +121,7 @@ public WhileStmt setBody(final Statement body) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public WhileStmt setCondition(final Expression condition) { + public WhileStmt setCondition(final Expression condition) { assertNotNull(condition); if (condition == this.condition) { return this; @@ -136,7 +136,7 @@ public WhileStmt setCondition(final Expression condition) { @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -151,19 +151,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public WhileStmt clone() { + public WhileStmt clone() { return (WhileStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public WhileStmtMetaModel getMetaModel() { + public WhileStmtMetaModel getMetaModel() { return JavaParserMetaModel.whileStmtMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -186,35 +186,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isWhileStmt() { + public boolean isWhileStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public WhileStmt asWhileStmt() { + public WhileStmt asWhileStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifWhileStmt(Consumer action) { + public void ifWhileStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toWhileStmt() { + public Optional toWhileStmt() { return Optional.of(this); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getContracts() { + public NodeList getContracts() { return contracts; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public WhileStmt setContracts(final NodeList contracts) { + public WhileStmt setContracts(final NodeList contracts) { assertNotNull(contracts); if (contracts == this.contracts) { return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/YieldStmt.java b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/YieldStmt.java index 852b0e0f16..8c28a85c4d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/YieldStmt.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/stmt/YieldStmt.java @@ -46,16 +46,16 @@ *
{@code yield 123+456;} *
{@code yield "more or less";} */ -public class YieldStmt extends Statement implements NodeWithExpression { +public class YieldStmt extends Statement implements NodeWithExpression { private Expression expression; - public YieldStmt() { + public YieldStmt() { this(null, new NameExpr()); } @AllFieldsConstructor - public YieldStmt(final Expression expression) { + public YieldStmt(final Expression expression) { this(null, expression); } @@ -63,14 +63,14 @@ public YieldStmt(final Expression expression) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public YieldStmt(TokenRange tokenRange, Expression expression) { + public YieldStmt(TokenRange tokenRange, Expression expression) { super(tokenRange); setExpression(expression); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Expression getExpression() { + public Expression getExpression() { return expression; } @@ -81,7 +81,7 @@ public Expression getExpression() { * @return this, the YieldStmt */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public YieldStmt setExpression(final Expression expression) { + public YieldStmt setExpression(final Expression expression) { assertNotNull(expression); if (expression == this.expression) { return this; @@ -96,43 +96,43 @@ public YieldStmt setExpression(final Expression expression) { @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public
void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isYieldStmt() { + public boolean isYieldStmt() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public YieldStmt asYieldStmt() { + public YieldStmt asYieldStmt() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toYieldStmt() { + public Optional toYieldStmt() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifYieldStmt(Consumer action) { + public void ifYieldStmt(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -145,13 +145,13 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public YieldStmt clone() { + public YieldStmt clone() { return (YieldStmt) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public YieldStmtMetaModel getMetaModel() { + public YieldStmtMetaModel getMetaModel() { return JavaParserMetaModel.yieldStmtMetaModel; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ArrayType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ArrayType.java index 12192796b9..3be57fd2ce 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ArrayType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ArrayType.java @@ -48,17 +48,17 @@ * To indicate that a type is an array, it gets wrapped in an ArrayType for every array level it has. * So, int[][] becomes ArrayType(ArrayType(int)). */ -public class ArrayType extends ReferenceType implements NodeWithAnnotations { +public class ArrayType extends ReferenceType implements NodeWithAnnotations { @Override - public ResolvedArrayType resolve() { + public ResolvedArrayType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedArrayType.class); } /** * The origin of a pair of array brackets []. */ - public enum Origin { + public enum Origin { /** * The [] were found on the name, like "int a[]" or "String abc()[][]" @@ -75,11 +75,11 @@ public enum Origin { private Origin origin; @AllFieldsConstructor - public ArrayType(Type componentType, Origin origin, NodeList annotations) { + public ArrayType(Type componentType, Origin origin, NodeList annotations) { this(null, componentType, origin, annotations); } - public ArrayType(Type type, AnnotationExpr... annotations) { + public ArrayType(Type type, AnnotationExpr... annotations) { this(type, Origin.TYPE, nodeList(annotations)); } @@ -87,7 +87,7 @@ public ArrayType(Type type, AnnotationExpr... annotations) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ArrayType(TokenRange tokenRange, Type componentType, Origin origin, NodeList annotations) { + public ArrayType(TokenRange tokenRange, Type componentType, Origin origin, NodeList annotations) { super(tokenRange, annotations); setComponentType(componentType); setOrigin(origin); @@ -96,23 +96,23 @@ public ArrayType(TokenRange tokenRange, Type componentType, Origin origin, Node @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type getComponentType() { + public Type getComponentType() { return componentType; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayType setComponentType(final Type componentType) { + public ArrayType setComponentType(final Type componentType) { assertNotNull(componentType); if (componentType == this.componentType) { return this; @@ -194,52 +194,52 @@ public static class ArrayBracketPair { private Origin origin; - public ArrayBracketPair(TokenRange tokenRange, Origin origin, NodeList annotations) { + public ArrayBracketPair(TokenRange tokenRange, Origin origin, NodeList annotations) { setTokenRange(tokenRange); setAnnotations(annotations); setOrigin(origin); } - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } - public ArrayBracketPair setAnnotations(NodeList annotations) { + public ArrayBracketPair setAnnotations(NodeList annotations) { this.annotations = assertNotNull(annotations); return this; } - public ArrayBracketPair setTokenRange(TokenRange range) { + public ArrayBracketPair setTokenRange(TokenRange range) { this.tokenRange = range; return this; } - public Optional getTokenRange() { + public Optional getTokenRange() { return Optional.ofNullable(tokenRange); } - public Origin getOrigin() { + public Origin getOrigin() { return origin; } - public ArrayBracketPair setOrigin(Origin origin) { + public ArrayBracketPair setOrigin(Origin origin) { this.origin = assertNotNull(origin); return this; } } @Override - public ArrayType setAnnotations(NodeList annotations) { + public ArrayType setAnnotations(NodeList annotations) { return (ArrayType) super.setAnnotations(annotations); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Origin getOrigin() { + public Origin getOrigin() { return origin; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ArrayType setOrigin(final Origin origin) { + public ArrayType setOrigin(final Origin origin) { assertNotNull(origin); if (origin == this.origin) { return this; @@ -250,12 +250,12 @@ public ArrayType setOrigin(final Origin origin) { } @Override - public String asString() { + public String asString() { return componentType.asString() + "[]"; } @Override - public String toDescriptor() { + public String toDescriptor() { StringBuffer sb = new StringBuffer(); sb.append("["); sb.append(componentType.toDescriptor()); @@ -264,19 +264,19 @@ public String toDescriptor() { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ArrayType clone() { + public ArrayType clone() { return (ArrayType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ArrayTypeMetaModel getMetaModel() { + public ArrayTypeMetaModel getMetaModel() { return JavaParserMetaModel.arrayTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -289,25 +289,25 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayType() { + public boolean isArrayType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayType asArrayType() { + public ArrayType asArrayType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayType(Consumer action) { + public void ifArrayType(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayType() { + public Optional toArrayType() { return Optional.of(this); } @@ -317,7 +317,7 @@ public Optional toArrayType() { * In "{@code int[] a[];}", the element type is int. */ @Override - public Type getElementType() { + public Type getElementType() { return this.getComponentType().getElementType(); } @@ -325,12 +325,12 @@ public Type getElementType() { * returns the array level that is 0 for non array type. */ @Override - public int getArrayLevel() { + public int getArrayLevel() { return 1 + this.getComponentType().getArrayLevel(); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { return new ResolvedArrayType(getComponentType().convertToUsage(context)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ClassOrInterfaceType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ClassOrInterfaceType.java index 41c3a5c2be..d59b36c34f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ClassOrInterfaceType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ClassOrInterfaceType.java @@ -67,7 +67,7 @@ * * @author Julio Vilmar Gesser */ -public class ClassOrInterfaceType extends ReferenceType implements NodeWithSimpleName, NodeWithAnnotations, NodeWithTypeArguments { +public class ClassOrInterfaceType extends ReferenceType implements NodeWithSimpleName, NodeWithAnnotations, NodeWithTypeArguments { @OptionalProperty private ClassOrInterfaceType scope; @@ -77,27 +77,27 @@ public class ClassOrInterfaceType extends ReferenceType implements NodeWithSimp @OptionalProperty private NodeList typeArguments; - public ClassOrInterfaceType() { + public ClassOrInterfaceType() { this(null, null, new SimpleName(), null, new NodeList<>()); } /** * @deprecated use JavaParser.parseClassOrInterfaceType instead. This constructor does not understand generics. */ - public ClassOrInterfaceType(final String name) { + public ClassOrInterfaceType(final String name) { this(null, null, new SimpleName(name), null, new NodeList<>()); } - public ClassOrInterfaceType(final ClassOrInterfaceType scope, final String name) { + public ClassOrInterfaceType(final ClassOrInterfaceType scope, final String name) { this(null, scope, new SimpleName(name), null, new NodeList<>()); } - public ClassOrInterfaceType(final ClassOrInterfaceType scope, final SimpleName name, final NodeList typeArguments) { + public ClassOrInterfaceType(final ClassOrInterfaceType scope, final SimpleName name, final NodeList typeArguments) { this(null, scope, name, typeArguments, new NodeList<>()); } @AllFieldsConstructor - public ClassOrInterfaceType(final ClassOrInterfaceType scope, final SimpleName name, final NodeList typeArguments, final NodeList annotations) { + public ClassOrInterfaceType(final ClassOrInterfaceType scope, final SimpleName name, final NodeList typeArguments, final NodeList annotations) { this(null, scope, name, typeArguments, annotations); } @@ -105,7 +105,7 @@ public ClassOrInterfaceType(final ClassOrInterfaceType scope, final SimpleName * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ClassOrInterfaceType(TokenRange tokenRange, ClassOrInterfaceType scope, SimpleName name, NodeList typeArguments, NodeList annotations) { + public ClassOrInterfaceType(TokenRange tokenRange, ClassOrInterfaceType scope, SimpleName name, NodeList typeArguments, NodeList annotations) { super(tokenRange, annotations); setScope(scope); setName(name); @@ -115,22 +115,22 @@ public ClassOrInterfaceType(TokenRange tokenRange, ClassOrInterfaceType scope, @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } - public String getNameWithScope() { + public String getNameWithScope() { StringBuilder str = new StringBuilder(); getScope().ifPresent(s -> str.append(s.getNameWithScope()).append(".")); str.append(name.asString()); @@ -138,15 +138,15 @@ public String getNameWithScope() { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getScope() { + public Optional getScope() { return Optional.ofNullable(scope); } - public boolean isBoxedType() { + public boolean isBoxedType() { return PrimitiveType.unboxMap.containsKey(name.getIdentifier()); } - public PrimitiveType toUnboxedType() throws UnsupportedOperationException { + public PrimitiveType toUnboxedType() throws UnsupportedOperationException { if (!isBoxedType()) { throw new UnsupportedOperationException(name + " isn't a boxed type."); } @@ -154,7 +154,7 @@ public PrimitiveType toUnboxedType() throws UnsupportedOperationException { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceType setName(final SimpleName name) { + public ClassOrInterfaceType setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -174,7 +174,7 @@ public ClassOrInterfaceType setName(final SimpleName name) { * @return this, the ClassOrInterfaceType */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceType setScope(final ClassOrInterfaceType scope) { + public ClassOrInterfaceType setScope(final ClassOrInterfaceType scope) { if (scope == this.scope) { return this; } @@ -187,7 +187,7 @@ public ClassOrInterfaceType setScope(final ClassOrInterfaceType scope) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional> getTypeArguments() { + public Optional> getTypeArguments() { return Optional.ofNullable(typeArguments); } @@ -198,7 +198,7 @@ public Optional> getTypeArguments() { * @return this, the ClassOrInterfaceType */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public ClassOrInterfaceType setTypeArguments(final NodeList typeArguments) { + public ClassOrInterfaceType setTypeArguments(final NodeList typeArguments) { if (typeArguments == this.typeArguments) { return this; } @@ -211,13 +211,13 @@ public ClassOrInterfaceType setTypeArguments(final NodeList typeArguments } @Override - public ClassOrInterfaceType setAnnotations(NodeList annotations) { + public ClassOrInterfaceType setAnnotations(NodeList annotations) { return (ClassOrInterfaceType) super.setAnnotations(annotations); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -239,7 +239,7 @@ public boolean remove(Node node) { } @Override - public String asString() { + public String asString() { StringBuilder str = new StringBuilder(); getScope().ifPresent(s -> str.append(s.asString()).append(".")); str.append(name.asString()); @@ -252,30 +252,30 @@ public String asString() { * for example java/lang/Object */ @Override - public String toDescriptor() { + public String toDescriptor() { return String.format("L%s;", resolve().erasure().asReferenceType().getQualifiedName().replace(".", "/")); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public ClassOrInterfaceType removeScope() { + public ClassOrInterfaceType removeScope() { return setScope((ClassOrInterfaceType) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ClassOrInterfaceType clone() { + public ClassOrInterfaceType clone() { return (ClassOrInterfaceType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ClassOrInterfaceTypeMetaModel getMetaModel() { + public ClassOrInterfaceTypeMetaModel getMetaModel() { return JavaParserMetaModel.classOrInterfaceTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -302,30 +302,30 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassOrInterfaceType() { + public boolean isClassOrInterfaceType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassOrInterfaceType asClassOrInterfaceType() { + public ClassOrInterfaceType asClassOrInterfaceType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassOrInterfaceType(Consumer action) { + public void ifClassOrInterfaceType(Consumer action) { action.accept(this); } @Override - public ResolvedType resolve() { + public ResolvedType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassOrInterfaceType() { + public Optional toClassOrInterfaceType() { return Optional.of(this); } @@ -337,7 +337,7 @@ public Optional toClassOrInterfaceType() { * @return The type resolved. */ @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { String name = getNameWithScope(); SymbolReference ref = context.solveType(name); if (!ref.isSolved()) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ConvertibleToUsage.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ConvertibleToUsage.java index e32a01896c..c2ae8e173f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ConvertibleToUsage.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ConvertibleToUsage.java @@ -25,7 +25,7 @@ /** * Convert a {@link Type} into a {@link ResolvedType}. */ -public interface ConvertibleToUsage { +public interface ConvertibleToUsage { ResolvedType convertToUsage(Context context); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/IntersectionType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/IntersectionType.java index 1232f07592..abe72e9f26 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/IntersectionType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/IntersectionType.java @@ -54,13 +54,13 @@ * * @since 3.0.0 */ -public class IntersectionType extends Type implements NodeWithAnnotations { +public class IntersectionType extends Type implements NodeWithAnnotations { @NonEmptyProperty private NodeList elements; @AllFieldsConstructor - public IntersectionType(NodeList elements) { + public IntersectionType(NodeList elements) { this(null, elements); } @@ -68,7 +68,7 @@ public IntersectionType(NodeList elements) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public IntersectionType(TokenRange tokenRange, NodeList elements) { + public IntersectionType(TokenRange tokenRange, NodeList elements) { super(tokenRange); setElements(elements); customInitialization(); @@ -76,23 +76,23 @@ public IntersectionType(TokenRange tokenRange, NodeList elements @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getElements() { + public NodeList getElements() { return elements; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public IntersectionType setElements(final NodeList elements) { + public IntersectionType setElements(final NodeList elements) { assertNotNull(elements); if (elements == this.elements) { return this; @@ -106,13 +106,13 @@ public IntersectionType setElements(final NodeList elements) { } @Override - public IntersectionType setAnnotations(NodeList annotations) { + public IntersectionType setAnnotations(NodeList annotations) { return (IntersectionType) super.setAnnotations(annotations); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -126,25 +126,25 @@ public boolean remove(Node node) { } @Override - public String asString() { + public String asString() { return elements.stream().map(Type::asString).collect(joining("&")); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public IntersectionType clone() { + public IntersectionType clone() { return (IntersectionType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public IntersectionTypeMetaModel getMetaModel() { + public IntersectionTypeMetaModel getMetaModel() { return JavaParserMetaModel.intersectionTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -159,35 +159,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIntersectionType() { + public boolean isIntersectionType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IntersectionType asIntersectionType() { + public IntersectionType asIntersectionType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIntersectionType(Consumer action) { + public void ifIntersectionType(Consumer action) { action.accept(this); } @Override - public ResolvedIntersectionType resolve() { + public ResolvedIntersectionType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedIntersectionType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIntersectionType() { + public Optional toIntersectionType() { return Optional.of(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { throw new UnsupportedOperationException(getClass().getCanonicalName()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/PrimitiveType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/PrimitiveType.java index 996277ef02..f7b0505187 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/PrimitiveType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/PrimitiveType.java @@ -50,7 +50,7 @@ * * @author Julio Vilmar Gesser */ -public class PrimitiveType extends Type implements NodeWithAnnotations { +public class PrimitiveType extends Type implements NodeWithAnnotations { public static PrimitiveType booleanType() { return new PrimitiveType(Primitive.BOOLEAN); @@ -84,7 +84,7 @@ public static PrimitiveType doubleType() { return new PrimitiveType(Primitive.DOUBLE); } - public enum Primitive { + public enum Primitive { BOOLEAN("Boolean", "Z"), CHAR("Character", "C"), @@ -122,15 +122,15 @@ public static Optional byBoxedTypeName(String simpleName) { return Optional.ofNullable(unboxMap.getOrDefault(simpleName, null)); } - public ClassOrInterfaceType toBoxedType() { + public ClassOrInterfaceType toBoxedType() { return parseClassOrInterfaceType(nameOfBoxedType); } - public String asString() { + public String asString() { return codeRepresentation; } - public String toDescriptor() { + public String toDescriptor() { return descriptor; } @@ -151,16 +151,16 @@ public String toDescriptor() { private Primitive type; - public PrimitiveType() { + public PrimitiveType() { this(null, Primitive.INT, new NodeList<>()); } - public PrimitiveType(final Primitive type) { + public PrimitiveType(final Primitive type) { this(null, type, new NodeList<>()); } @AllFieldsConstructor - public PrimitiveType(final Primitive type, NodeList annotations) { + public PrimitiveType(final Primitive type, NodeList annotations) { this(null, type, annotations); } @@ -168,7 +168,7 @@ public PrimitiveType(final Primitive type, NodeList annotations * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public PrimitiveType(TokenRange tokenRange, Primitive type, NodeList annotations) { + public PrimitiveType(TokenRange tokenRange, Primitive type, NodeList annotations) { super(tokenRange, annotations); setType(type); customInitialization(); @@ -176,32 +176,32 @@ public PrimitiveType(TokenRange tokenRange, Primitive type, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Primitive getType() { + public Primitive getType() { return type; } - public ClassOrInterfaceType toBoxedType() { + public ClassOrInterfaceType toBoxedType() { return type.toBoxedType(); } @Override - public String toDescriptor() { + public String toDescriptor() { return type.toDescriptor(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public PrimitiveType setType(final Primitive type) { + public PrimitiveType setType(final Primitive type) { assertNotNull(type); if (type == this.type) { return this; @@ -212,58 +212,58 @@ public PrimitiveType setType(final Primitive type) { } @Override - public String asString() { + public String asString() { return type.asString(); } @Override - public PrimitiveType setAnnotations(NodeList annotations) { + public PrimitiveType setAnnotations(NodeList annotations) { return (PrimitiveType) super.setAnnotations(annotations); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public PrimitiveType clone() { + public PrimitiveType clone() { return (PrimitiveType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public PrimitiveTypeMetaModel getMetaModel() { + public PrimitiveTypeMetaModel getMetaModel() { return JavaParserMetaModel.primitiveTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isPrimitiveType() { + public boolean isPrimitiveType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public PrimitiveType asPrimitiveType() { + public PrimitiveType asPrimitiveType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifPrimitiveType(Consumer action) { + public void ifPrimitiveType(Consumer action) { action.accept(this); } @Override - public ResolvedPrimitiveType resolve() { + public ResolvedPrimitiveType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedPrimitiveType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toPrimitiveType() { + public Optional toPrimitiveType() { return Optional.of(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { return ResolvedPrimitiveType.byName(getType().name()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ReferenceType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ReferenceType.java index ac113e64da..b3626937a1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/ReferenceType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/ReferenceType.java @@ -39,12 +39,12 @@ */ public abstract class ReferenceType extends Type { - public ReferenceType() { + public ReferenceType() { this(null, new NodeList<>()); } @AllFieldsConstructor - public ReferenceType(NodeList annotations) { + public ReferenceType(NodeList annotations) { this(null, annotations); } @@ -52,44 +52,44 @@ public ReferenceType(NodeList annotations) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public ReferenceType(TokenRange tokenRange, NodeList annotations) { + public ReferenceType(TokenRange tokenRange, NodeList annotations) { super(tokenRange, annotations); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public ReferenceType clone() { + public ReferenceType clone() { return (ReferenceType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public ReferenceTypeMetaModel getMetaModel() { + public ReferenceTypeMetaModel getMetaModel() { return JavaParserMetaModel.referenceTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isReferenceType() { + public boolean isReferenceType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ReferenceType asReferenceType() { + public ReferenceType asReferenceType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifReferenceType(Consumer action) { + public void ifReferenceType(Consumer action) { action.accept(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toReferenceType() { + public Optional toReferenceType() { return Optional.of(this); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/Type.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/Type.java index 26b0533ac6..5e59121540 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/Type.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/Type.java @@ -55,7 +55,7 @@ protected Type(TokenRange range) { } @AllFieldsConstructor - public Type(NodeList annotations) { + public Type(NodeList annotations) { this(null, annotations); } @@ -63,23 +63,23 @@ public Type(NodeList annotations) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public Type(TokenRange tokenRange, NodeList annotations) { + public Type(TokenRange tokenRange, NodeList annotations) { super(tokenRange); setAnnotations(annotations); customInitialization(); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getAnnotations() { + public NodeList getAnnotations() { return annotations; } - public AnnotationExpr getAnnotation(int i) { + public AnnotationExpr getAnnotation(int i) { return getAnnotations().get(i); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Type setAnnotations(final NodeList annotations) { + public Type setAnnotations(final NodeList annotations) { assertNotNull(annotations); if (annotations == this.annotations) { return this; @@ -97,24 +97,24 @@ public Type setAnnotations(final NodeList annotations) { *

* In "{@code int[] a[];}", the element type is int. */ - public Type getElementType() { + public Type getElementType() { return this; } /* * returns the array level that is 0 for non array type. */ - public int getArrayLevel() { + public int getArrayLevel() { return 0; } - public String toDescriptor() { + public String toDescriptor() { return ""; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -131,19 +131,19 @@ public boolean remove(Node node) { @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public Type clone() { + public Type clone() { return (Type) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TypeMetaModel getMetaModel() { + public TypeMetaModel getMetaModel() { return JavaParserMetaModel.typeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -157,214 +157,214 @@ public boolean replace(Node node, Node replacementNode) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isArrayType() { + public boolean isArrayType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ArrayType asArrayType() { + public ArrayType asArrayType() { throw new IllegalStateException(f("%s is not ArrayType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isClassOrInterfaceType() { + public boolean isClassOrInterfaceType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ClassOrInterfaceType asClassOrInterfaceType() { + public ClassOrInterfaceType asClassOrInterfaceType() { throw new IllegalStateException(f("%s is not ClassOrInterfaceType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isIntersectionType() { + public boolean isIntersectionType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public IntersectionType asIntersectionType() { + public IntersectionType asIntersectionType() { throw new IllegalStateException(f("%s is not IntersectionType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isPrimitiveType() { + public boolean isPrimitiveType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public PrimitiveType asPrimitiveType() { + public PrimitiveType asPrimitiveType() { throw new IllegalStateException(f("%s is not PrimitiveType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isReferenceType() { + public boolean isReferenceType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public ReferenceType asReferenceType() { + public ReferenceType asReferenceType() { throw new IllegalStateException(f("%s is not ReferenceType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeParameter() { + public boolean isTypeParameter() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeParameter asTypeParameter() { + public TypeParameter asTypeParameter() { throw new IllegalStateException(f("%s is not TypeParameter, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnionType() { + public boolean isUnionType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnionType asUnionType() { + public UnionType asUnionType() { throw new IllegalStateException(f("%s is not UnionType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnknownType() { + public boolean isUnknownType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnknownType asUnknownType() { + public UnknownType asUnknownType() { throw new IllegalStateException(f("%s is not UnknownType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVoidType() { + public boolean isVoidType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VoidType asVoidType() { + public VoidType asVoidType() { throw new IllegalStateException(f("%s is not VoidType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isWildcardType() { + public boolean isWildcardType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public WildcardType asWildcardType() { + public WildcardType asWildcardType() { throw new IllegalStateException(f("%s is not WildcardType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifArrayType(Consumer action) { + public void ifArrayType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifClassOrInterfaceType(Consumer action) { + public void ifClassOrInterfaceType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifIntersectionType(Consumer action) { + public void ifIntersectionType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifPrimitiveType(Consumer action) { + public void ifPrimitiveType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifReferenceType(Consumer action) { + public void ifReferenceType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeParameter(Consumer action) { + public void ifTypeParameter(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnionType(Consumer action) { + public void ifUnionType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnknownType(Consumer action) { + public void ifUnknownType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVoidType(Consumer action) { + public void ifVoidType(Consumer action) { } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifWildcardType(Consumer action) { + public void ifWildcardType(Consumer action) { } @Override public abstract ResolvedType resolve(); @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toArrayType() { + public Optional toArrayType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toClassOrInterfaceType() { + public Optional toClassOrInterfaceType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toIntersectionType() { + public Optional toIntersectionType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toPrimitiveType() { + public Optional toPrimitiveType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toReferenceType() { + public Optional toReferenceType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeParameter() { + public Optional toTypeParameter() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnionType() { + public Optional toUnionType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnknownType() { + public Optional toUnknownType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVoidType() { + public Optional toVoidType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toWildcardType() { + public Optional toWildcardType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVarType() { + public boolean isVarType() { return false; } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VarType asVarType() { + public VarType asVarType() { throw new IllegalStateException(f("%s is not VarType, it is %s", this, this.getClass().getSimpleName())); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVarType() { + public Optional toVarType() { return Optional.empty(); } @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVarType(Consumer action) { + public void ifVarType(Consumer action) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/TypeParameter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/TypeParameter.java index f35461fc4c..ddf1c9ff9b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/TypeParameter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/TypeParameter.java @@ -55,26 +55,26 @@ * @author Julio Vilmar Gesser * @see com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters */ -public class TypeParameter extends ReferenceType implements NodeWithSimpleName, NodeWithAnnotations { +public class TypeParameter extends ReferenceType implements NodeWithSimpleName, NodeWithAnnotations { private SimpleName name; private NodeList typeBound; - public TypeParameter() { + public TypeParameter() { this(null, new SimpleName(), new NodeList<>(), new NodeList<>()); } - public TypeParameter(final String name) { + public TypeParameter(final String name) { this(null, new SimpleName(name), new NodeList<>(), new NodeList<>()); } - public TypeParameter(final String name, final NodeList typeBound) { + public TypeParameter(final String name, final NodeList typeBound) { this(null, new SimpleName(name), typeBound, new NodeList<>()); } @AllFieldsConstructor - public TypeParameter(SimpleName name, NodeList typeBound, NodeList annotations) { + public TypeParameter(SimpleName name, NodeList typeBound, NodeList annotations) { this(null, name, typeBound, annotations); } @@ -82,7 +82,7 @@ public TypeParameter(SimpleName name, NodeList typeBound, * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public TypeParameter(TokenRange tokenRange, SimpleName name, NodeList typeBound, NodeList annotations) { + public TypeParameter(TokenRange tokenRange, SimpleName name, NodeList typeBound, NodeList annotations) { super(tokenRange, annotations); setName(name); setTypeBound(typeBound); @@ -91,13 +91,13 @@ public TypeParameter(TokenRange tokenRange, SimpleName name, NodeList R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @@ -107,7 +107,7 @@ public void accept(final VoidVisitor v, final A arg) { * @return the name of the paramenter */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public SimpleName getName() { + public SimpleName getName() { return name; } @@ -118,12 +118,12 @@ public SimpleName getName() { * @return list of types that this paramente extends or {@code null} */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getTypeBound() { + public NodeList getTypeBound() { return typeBound; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TypeParameter setName(final SimpleName name) { + public TypeParameter setName(final SimpleName name) { assertNotNull(name); if (name == this.name) { return this; @@ -137,7 +137,7 @@ public TypeParameter setName(final SimpleName name) { } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public TypeParameter setTypeBound(final NodeList typeBound) { + public TypeParameter setTypeBound(final NodeList typeBound) { assertNotNull(typeBound); if (typeBound == this.typeBound) { return this; @@ -151,14 +151,14 @@ public TypeParameter setTypeBound(final NodeList typeBoun } @Override - public TypeParameter setAnnotations(NodeList annotations) { + public TypeParameter setAnnotations(NodeList annotations) { super.setAnnotations(annotations); return this; } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -172,32 +172,32 @@ public boolean remove(Node node) { } @Override - public String asString() { + public String asString() { StringBuilder str = new StringBuilder(getNameAsString()); getTypeBound().ifNonEmpty(l -> str.append(l.stream().map(ClassOrInterfaceType::asString).collect(joining("&", " extends ", "")))); return str.toString(); } @Override - public String toDescriptor() { + public String toDescriptor() { return String.format("L%s;", resolve().qualifiedName()); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public TypeParameter clone() { + public TypeParameter clone() { return (TypeParameter) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public TypeParameterMetaModel getMetaModel() { + public TypeParameterMetaModel getMetaModel() { return JavaParserMetaModel.typeParameterMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -216,35 +216,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isTypeParameter() { + public boolean isTypeParameter() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public TypeParameter asTypeParameter() { + public TypeParameter asTypeParameter() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifTypeParameter(Consumer action) { + public void ifTypeParameter(Consumer action) { action.accept(this); } @Override - public ResolvedTypeVariable resolve() { + public ResolvedTypeVariable resolve() { return getSymbolResolver().toResolvedType(this, ResolvedTypeVariable.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toTypeParameter() { + public Optional toTypeParameter() { return Optional.of(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { throw new UnsupportedOperationException(getClass().getCanonicalName()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnionType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnionType.java index a72e3ce41d..271c5f7330 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnionType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnionType.java @@ -61,12 +61,12 @@ *

* The types that make up the union type are its "elements" */ -public class UnionType extends Type implements NodeWithAnnotations { +public class UnionType extends Type implements NodeWithAnnotations { @NonEmptyProperty private NodeList elements; - public UnionType() { + public UnionType() { this(null, new NodeList<>()); } @@ -74,24 +74,24 @@ public UnionType() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public UnionType(TokenRange tokenRange, NodeList elements) { + public UnionType(TokenRange tokenRange, NodeList elements) { super(tokenRange); setElements(elements); customInitialization(); } @AllFieldsConstructor - public UnionType(NodeList elements) { + public UnionType(NodeList elements) { this(null, elements); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public NodeList getElements() { + public NodeList getElements() { return elements; } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public UnionType setElements(final NodeList elements) { + public UnionType setElements(final NodeList elements) { assertNotNull(elements); if (elements == this.elements) { return this; @@ -105,25 +105,25 @@ public UnionType setElements(final NodeList elements) { } @Override - public UnionType setAnnotations(NodeList annotations) { + public UnionType setAnnotations(NodeList annotations) { return (UnionType) super.setAnnotations(annotations); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -137,25 +137,25 @@ public boolean remove(Node node) { } @Override - public String asString() { + public String asString() { return elements.stream().map(Type::asString).collect(joining("|")); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public UnionType clone() { + public UnionType clone() { return (UnionType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public UnionTypeMetaModel getMetaModel() { + public UnionTypeMetaModel getMetaModel() { return JavaParserMetaModel.unionTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -170,35 +170,35 @@ public boolean replace(Node node, Node replacementNode) { @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnionType() { + public boolean isUnionType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnionType asUnionType() { + public UnionType asUnionType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnionType(Consumer action) { + public void ifUnionType(Consumer action) { action.accept(this); } @Override - public ResolvedUnionType resolve() { + public ResolvedUnionType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedUnionType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnionType() { + public Optional toUnionType() { return Optional.of(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { List resolvedElements = getElements().stream().map(el -> el.convertToUsage(context)).collect(Collectors.toList()); return new ResolvedUnionType(resolvedElements); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnknownType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnknownType.java index 9e68c250e3..6206be0b88 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnknownType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/UnknownType.java @@ -46,10 +46,10 @@ * * @author Didier Villevalois */ -public class UnknownType extends Type { +public class UnknownType extends Type { @AllFieldsConstructor - public UnknownType() { + public UnknownType() { this(null); } @@ -57,25 +57,25 @@ public UnknownType() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public UnknownType(TokenRange tokenRange) { + public UnknownType(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public UnknownType setAnnotations(NodeList annotations) { + public UnknownType setAnnotations(NodeList annotations) { if (annotations.size() > 0) { throw new IllegalStateException("Inferred lambda types cannot be annotated."); } @@ -83,48 +83,48 @@ public UnknownType setAnnotations(NodeList annotations) { } @Override - public String asString() { + public String asString() { return ""; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public UnknownType clone() { + public UnknownType clone() { return (UnknownType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public UnknownTypeMetaModel getMetaModel() { + public UnknownTypeMetaModel getMetaModel() { return JavaParserMetaModel.unknownTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isUnknownType() { + public boolean isUnknownType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public UnknownType asUnknownType() { + public UnknownType asUnknownType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifUnknownType(Consumer action) { + public void ifUnknownType(Consumer action) { action.accept(this); } @Override - public ResolvedType resolve() { + public ResolvedType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedReferenceType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toUnknownType() { + public Optional toUnknownType() { return Optional.of(this); } @@ -132,7 +132,7 @@ public Optional toUnknownType() { * A "phantom" node, is a node that is not really an AST node (like the fake type of variable in FieldDeclaration) */ @Override - public boolean isPhantom() { + public boolean isPhantom() { return true; } @@ -144,7 +144,7 @@ public boolean isPhantom() { * @return The type resolved. */ @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { throw new IllegalArgumentException("Inferred lambda parameter type"); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/VarType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/VarType.java index f7b8d79784..a0c7ce7aff 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/VarType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/VarType.java @@ -52,12 +52,12 @@ *

  • var a = new ArrayList<String>();
  • * */ -public class VarType extends Type { +public class VarType extends Type { private static final String JAVA_LANG_OBJECT = Object.class.getCanonicalName(); @AllFieldsConstructor - public VarType() { + public VarType() { this(null); } @@ -65,76 +65,76 @@ public VarType() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public VarType(TokenRange tokenRange) { + public VarType(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override - public VarType setAnnotations(NodeList annotations) { + public VarType setAnnotations(NodeList annotations) { return (VarType) super.setAnnotations(annotations); } @Override - public String asString() { + public String asString() { return "var"; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public VarType clone() { + public VarType clone() { return (VarType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public VarTypeMetaModel getMetaModel() { + public VarTypeMetaModel getMetaModel() { return JavaParserMetaModel.varTypeMetaModel; } @Override - public ResolvedType resolve() { + public ResolvedType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedType.class); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVarType() { + public boolean isVarType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VarType asVarType() { + public VarType asVarType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVarType() { + public Optional toVarType() { return Optional.of(this); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVarType(Consumer action) { + public void ifVarType(Consumer action) { action.accept(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { Node parent = getParentNode().get(); if (!(parent instanceof VariableDeclarator)) { throw new IllegalStateException("Trying to resolve a `var` which is not in a variable declaration."); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/VoidType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/VoidType.java index 8e6f6c751a..f2697225c1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/VoidType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/VoidType.java @@ -45,10 +45,10 @@ * * @author Julio Vilmar Gesser */ -public class VoidType extends Type implements NodeWithAnnotations { +public class VoidType extends Type implements NodeWithAnnotations { @AllFieldsConstructor - public VoidType() { + public VoidType() { this(null); } @@ -56,81 +56,81 @@ public VoidType() { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public VoidType(TokenRange tokenRange) { + public VoidType(TokenRange tokenRange) { super(tokenRange); customInitialization(); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Override - public VoidType setAnnotations(NodeList annotations) { + public VoidType setAnnotations(NodeList annotations) { return (VoidType) super.setAnnotations(annotations); } @Override - public String asString() { + public String asString() { return "void"; } @Override - public String toDescriptor() { + public String toDescriptor() { return "V"; } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public VoidType clone() { + public VoidType clone() { return (VoidType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public VoidTypeMetaModel getMetaModel() { + public VoidTypeMetaModel getMetaModel() { return JavaParserMetaModel.voidTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isVoidType() { + public boolean isVoidType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public VoidType asVoidType() { + public VoidType asVoidType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifVoidType(Consumer action) { + public void ifVoidType(Consumer action) { action.accept(this); } @Override - public ResolvedVoidType resolve() { + public ResolvedVoidType resolve() { return getSymbolResolver().toResolvedType(this, ResolvedVoidType.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toVoidType() { + public Optional toVoidType() { return Optional.of(this); } @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { return ResolvedVoidType.INSTANCE; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/type/WildcardType.java b/javaparser-core/src/main/java/com/github/javaparser/ast/type/WildcardType.java index 692d216a4c..19eefbbf71 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/type/WildcardType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/type/WildcardType.java @@ -48,7 +48,7 @@ * * @author Julio Vilmar Gesser */ -public class WildcardType extends Type implements NodeWithAnnotations { +public class WildcardType extends Type implements NodeWithAnnotations { @OptionalProperty private ReferenceType extendedType; @@ -56,16 +56,16 @@ public class WildcardType extends Type implements NodeWithAnnotations()); } - public WildcardType(final ReferenceType extendedType) { + public WildcardType(final ReferenceType extendedType) { this(null, extendedType, null, new NodeList<>()); } @AllFieldsConstructor - public WildcardType(final ReferenceType extendedType, final ReferenceType superType, final NodeList annotations) { + public WildcardType(final ReferenceType extendedType, final ReferenceType superType, final NodeList annotations) { this(null, extendedType, superType, annotations); } @@ -73,7 +73,7 @@ public WildcardType(final ReferenceType extendedType, final ReferenceType super * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public WildcardType(TokenRange tokenRange, ReferenceType extendedType, ReferenceType superType, NodeList annotations) { + public WildcardType(TokenRange tokenRange, ReferenceType extendedType, ReferenceType superType, NodeList annotations) { super(tokenRange, annotations); setExtendedType(extendedType); setSuperType(superType); @@ -82,23 +82,23 @@ public WildcardType(TokenRange tokenRange, ReferenceType extendedType, Referenc @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public R accept(final GenericVisitor v, final A arg) { + public R accept(final GenericVisitor v, final A arg) { return v.visit(this, arg); } @Override @Generated("com.github.javaparser.generator.core.node.AcceptGenerator") - public void accept(final VoidVisitor v, final A arg) { + public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getExtendedType() { + public Optional getExtendedType() { return Optional.ofNullable(extendedType); } @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public Optional getSuperType() { + public Optional getSuperType() { return Optional.ofNullable(superType); } @@ -109,7 +109,7 @@ public Optional getSuperType() { * @return this, the WildcardType */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public WildcardType setExtendedType(final ReferenceType extendedType) { + public WildcardType setExtendedType(final ReferenceType extendedType) { if (extendedType == this.extendedType) { return this; } @@ -128,7 +128,7 @@ public WildcardType setExtendedType(final ReferenceType extendedType) { * @return this, the WildcardType */ @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") - public WildcardType setSuperType(final ReferenceType superType) { + public WildcardType setSuperType(final ReferenceType superType) { if (superType == this.superType) { return this; } @@ -141,13 +141,13 @@ public WildcardType setSuperType(final ReferenceType superType) { } @Override - public WildcardType setAnnotations(NodeList annotations) { + public WildcardType setAnnotations(NodeList annotations) { return (WildcardType) super.setAnnotations(annotations); } @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public boolean remove(Node node) { + public boolean remove(Node node) { if (node == null) { return false; } @@ -167,7 +167,7 @@ public boolean remove(Node node) { } @Override - public String asString() { + public String asString() { StringBuilder str = new StringBuilder("?"); getExtendedType().ifPresent(t -> str.append(" extends ").append(t.asString())); getSuperType().ifPresent(t -> str.append(" super ").append(t.asString())); @@ -175,30 +175,30 @@ public String asString() { } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public WildcardType removeExtendedType() { + public WildcardType removeExtendedType() { return setExtendedType((ReferenceType) null); } @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") - public WildcardType removeSuperType() { + public WildcardType removeSuperType() { return setSuperType((ReferenceType) null); } @Override @Generated("com.github.javaparser.generator.core.node.CloneGenerator") - public WildcardType clone() { + public WildcardType clone() { return (WildcardType) accept(new CloneVisitor(), null); } @Override @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") - public WildcardTypeMetaModel getMetaModel() { + public WildcardTypeMetaModel getMetaModel() { return JavaParserMetaModel.wildcardTypeMetaModel; } @Override @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") - public boolean replace(Node node, Node replacementNode) { + public boolean replace(Node node, Node replacementNode) { if (node == null) { return false; } @@ -221,7 +221,7 @@ public boolean replace(Node node, Node replacementNode) { * This constructor is used by the parser and is considered private. */ @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") - public WildcardType(TokenRange tokenRange, ReferenceType extendedType, ReferenceType superType) { + public WildcardType(TokenRange tokenRange, ReferenceType extendedType, ReferenceType superType) { super(tokenRange); setExtendedType(extendedType); setSuperType(superType); @@ -230,30 +230,30 @@ public WildcardType(TokenRange tokenRange, ReferenceType extendedType, Referenc @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public boolean isWildcardType() { + public boolean isWildcardType() { return true; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public WildcardType asWildcardType() { + public WildcardType asWildcardType() { return this; } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public void ifWildcardType(Consumer action) { + public void ifWildcardType(Consumer action) { action.accept(this); } @Override - public ResolvedWildcard resolve() { + public ResolvedWildcard resolve() { return getSymbolResolver().toResolvedType(this, ResolvedWildcard.class); } @Override @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator") - public Optional toWildcardType() { + public Optional toWildcardType() { return Optional.of(this); } @@ -265,7 +265,7 @@ public Optional toWildcardType() { * @return The type resolved. */ @Override - public ResolvedType convertToUsage(Context context) { + public ResolvedType convertToUsage(Context context) { if (getExtendedType().isPresent() && !getSuperType().isPresent()) { // removed (ReferenceTypeImpl) return ResolvedWildcard.extendsBound(getExtendedType().get().convertToUsage(context)); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ProblemReporter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ProblemReporter.java index f579b9aeff..6aeeea9fc3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ProblemReporter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ProblemReporter.java @@ -30,11 +30,11 @@ /** * A simple interface where validators can report found problems. */ -public class ProblemReporter { +public class ProblemReporter { private final Consumer problemConsumer; - public ProblemReporter(Consumer problemConsumer) { + public ProblemReporter(Consumer problemConsumer) { this.problemConsumer = problemConsumer; } @@ -44,7 +44,7 @@ public ProblemReporter(Consumer problemConsumer) { * @param message description of the problem * @param node the node in which the problem occurred, used to find the Range of the problem. */ - public void report(final NodeWithTokenRange node, final UpgradeJavaMessage message, final Object... args) { + public void report(final NodeWithTokenRange node, final UpgradeJavaMessage message, final Object... args) { this.report(node.getTokenRange().orElse(null), message.toString(), args); } @@ -54,11 +54,11 @@ public void report(final NodeWithTokenRange node, final UpgradeJavaMessage m * @param message description of the problem * @param node the node in which the problem occurred, used to find the Range of the problem. */ - public void report(NodeWithTokenRange node, String message, Object... args) { + public void report(NodeWithTokenRange node, String message, Object... args) { this.report(node.getTokenRange().orElse(null), message, args); } - public void report(TokenRange range, String message, Object... args) { + public void report(TokenRange range, String message, Object... args) { problemConsumer.accept(new Problem(f(message, args), range, null)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/RecordAsTypeIdentifierNotAllowed.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/RecordAsTypeIdentifierNotAllowed.java index f246e32c3e..4fe7bd7736 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/RecordAsTypeIdentifierNotAllowed.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/RecordAsTypeIdentifierNotAllowed.java @@ -29,16 +29,16 @@ * Validates that "record" cannot be used as identifier for type declarations (e.g., classes, enums, and records). * For details, see JEP 395 */ -public class RecordAsTypeIdentifierNotAllowed extends VisitorValidator { +public class RecordAsTypeIdentifierNotAllowed extends VisitorValidator { private final String error; - public RecordAsTypeIdentifierNotAllowed() { + public RecordAsTypeIdentifierNotAllowed() { error = "'record' is a restricted identifier and cannot be used for type declarations"; } @Override - public void visit(Name n, ProblemReporter arg) { + public void visit(Name n, ProblemReporter arg) { if ("record".equals(n.getIdentifier()) && !validUsage(n)) { arg.report(n, error); } @@ -46,7 +46,7 @@ public void visit(Name n, ProblemReporter arg) { } @Override - public void visit(SimpleName n, ProblemReporter arg) { + public void visit(SimpleName n, ProblemReporter arg) { if ("record".equals(n.getIdentifier()) && !validUsage(n)) { arg.report(n, error); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ReservedKeywordValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ReservedKeywordValidator.java index 6782431582..fc19b73f25 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ReservedKeywordValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/ReservedKeywordValidator.java @@ -28,19 +28,19 @@ * Validates that identifiers are not keywords - this for the few keywords that the parser * accepts because they were added after Java 1.0. */ -public class ReservedKeywordValidator extends VisitorValidator { +public class ReservedKeywordValidator extends VisitorValidator { private final String keyword; private final String error; - public ReservedKeywordValidator(String keyword) { + public ReservedKeywordValidator(String keyword) { this.keyword = keyword; error = f("'%s' cannot be used as an identifier as it is a keyword.", keyword); } @Override - public void visit(Name n, ProblemReporter arg) { + public void visit(Name n, ProblemReporter arg) { if (n.getIdentifier().equals(keyword)) { arg.report(n, error); } @@ -48,7 +48,7 @@ public void visit(Name n, ProblemReporter arg) { } @Override - public void visit(SimpleName n, ProblemReporter arg) { + public void visit(SimpleName n, ProblemReporter arg) { if (n.getIdentifier().equals(keyword)) { arg.report(n, error); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SimpleValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SimpleValidator.java index 844f1ad47b..e1e1cdc050 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SimpleValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SimpleValidator.java @@ -28,9 +28,9 @@ * Runs a validator on all nodes of a certain type, * and adds a problem for all nodes that pass a condition. */ -public class SimpleValidator extends SingleNodeTypeValidator { +public class SimpleValidator extends SingleNodeTypeValidator { - public SimpleValidator(Class type, Predicate condition, BiConsumer problemSupplier) { + public SimpleValidator(Class type, Predicate condition, BiConsumer problemSupplier) { super(type, (node, problemReporter) -> { if (condition.test(node)) { problemSupplier.accept(node, problemReporter); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SingleNodeTypeValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SingleNodeTypeValidator.java index 4eb5d5c3a3..0899405fc9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SingleNodeTypeValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/SingleNodeTypeValidator.java @@ -25,19 +25,19 @@ /** * Runs a validator on all nodes of a certain type. */ -public class SingleNodeTypeValidator implements Validator { +public class SingleNodeTypeValidator implements Validator { private final Class type; private final TypedValidator validator; - public SingleNodeTypeValidator(Class type, TypedValidator validator) { + public SingleNodeTypeValidator(Class type, TypedValidator validator) { this.type = type; this.validator = validator; } @Override - public void accept(Node node, ProblemReporter problemReporter) { + public void accept(Node node, ProblemReporter problemReporter) { if (type.isInstance(node)) { validator.accept(type.cast(node), problemReporter); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TreeVisitorValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TreeVisitorValidator.java index 3b840243c5..de0ccb23e1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TreeVisitorValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TreeVisitorValidator.java @@ -25,11 +25,11 @@ /** * A validator that walks the whole tree, visiting every node. */ -public class TreeVisitorValidator implements Validator { +public class TreeVisitorValidator implements Validator { private final Validator validator; - public TreeVisitorValidator(Validator validator) { + public TreeVisitorValidator(Validator validator) { this.validator = validator; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TypedValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TypedValidator.java index bf8fa3186e..14277bd1ff 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TypedValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/TypedValidator.java @@ -29,7 +29,7 @@ /** * A validator that validates a known node type. */ -public interface TypedValidator extends BiConsumer { +public interface TypedValidator extends BiConsumer { /** * @param node the node that wants to be validated @@ -42,7 +42,7 @@ default Processor processor() { return new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { result.getResult().ifPresent(node -> accept((N) node, new ProblemReporter(problem -> result.getProblems().add(problem)))); } }; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validator.java index 98059aac60..c89f0cc5a2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validator.java @@ -26,7 +26,7 @@ * A validator that can be run on a node to check for semantic errors. * It is fully up to the implementor how to do this. */ -public interface Validator extends TypedValidator { +public interface Validator extends TypedValidator { /** * @param node the node that wants to be validated diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validators.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validators.java index 7dc9708e28..eb549deff3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validators.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/Validators.java @@ -28,38 +28,38 @@ /** * A validator that will call a collection of validators. */ -public class Validators implements Validator { +public class Validators implements Validator { private final List validators = new ArrayList<>(); - public Validators(Validator... validators) { + public Validators(Validator... validators) { this.validators.addAll(Arrays.asList(validators)); } - public List getValidators() { + public List getValidators() { return validators; } - public Validators remove(Validator validator) { + public Validators remove(Validator validator) { if (!validators.remove(validator)) { throw new AssertionError("Trying to remove a validator that isn't there."); } return this; } - public Validators replace(Validator oldValidator, Validator newValidator) { + public Validators replace(Validator oldValidator, Validator newValidator) { remove(oldValidator); add(newValidator); return this; } - public Validators add(Validator newValidator) { + public Validators add(Validator newValidator) { validators.add(newValidator); return this; } @Override - public void accept(Node node, ProblemReporter problemReporter) { + public void accept(Node node, ProblemReporter problemReporter) { validators.forEach(v -> v.accept(node, problemReporter)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/VisitorValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/VisitorValidator.java index bff0c9eb7f..8fda18730b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/VisitorValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/VisitorValidator.java @@ -31,7 +31,7 @@ public abstract class VisitorValidator extends VoidVisitorAdapter implements Validator { @Override - public void accept(Node node, ProblemReporter problemReporter) { + public void accept(Node node, ProblemReporter problemReporter) { node.accept(this, problemReporter); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10PreviewValidator.java index 1588077a2c..994f52afa9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/10/ */ -public class Java10PreviewValidator extends Java10Validator { +public class Java10PreviewValidator extends Java10Validator { - public Java10PreviewValidator() { + public Java10PreviewValidator() { super(); // Incubator // No incubator language features added within Java 10 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10Validator.java index e53fdd96aa..ae3172cc09 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java10Validator.java @@ -30,11 +30,11 @@ * * @see https://openjdk.java.net/projects/jdk/10/ */ -public class Java10Validator extends Java9Validator { +public class Java10Validator extends Java9Validator { final Validator varOnlyOnLocalVariableDefinitionAndForAndTry = new SingleNodeTypeValidator<>(VarType.class, new VarValidator(false)); - public Java10Validator() { + public Java10Validator() { super(); // Released Language Features { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11PreviewValidator.java index dad7a88f29..f90db8f23e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/11/ */ -public class Java11PreviewValidator extends Java11Validator { +public class Java11PreviewValidator extends Java11Validator { - public Java11PreviewValidator() { + public Java11PreviewValidator() { super(); // Incubator // No incubator language features added within Java 11 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11Validator.java index c756c31d99..6b3a28ff8c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java11Validator.java @@ -30,11 +30,11 @@ * * @see https://openjdk.java.net/projects/jdk/11/ */ -public class Java11Validator extends Java10Validator { +public class Java11Validator extends Java10Validator { final Validator varAlsoInLambdaParameters = new SingleNodeTypeValidator<>(VarType.class, new VarValidator(true)); - public Java11Validator() { + public Java11Validator() { super(); { /* diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12PreviewValidator.java index 88e0b8feac..7aafcc21ad 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/12/ */ -public class Java12PreviewValidator extends Java12Validator { +public class Java12PreviewValidator extends Java12Validator { - public Java12PreviewValidator() { + public Java12PreviewValidator() { super(); // Incubator // No new incubator language features added within Java 12 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12Validator.java index f3b93c901f..9977a1a29b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java12Validator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/12/ */ -public class Java12Validator extends Java11Validator { +public class Java12Validator extends Java11Validator { - public Java12Validator() { + public Java12Validator() { super(); // Released Language Features // No new released language features added within Java 12 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13PreviewValidator.java index 5a53d410ce..0ac210cc78 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/13/ */ -public class Java13PreviewValidator extends Java13Validator { +public class Java13PreviewValidator extends Java13Validator { - public Java13PreviewValidator() { + public Java13PreviewValidator() { super(); // Incubator // No new incubator language features added within Java 13 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13Validator.java index b76807e68e..a8794963b4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java13Validator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/13/ */ -public class Java13Validator extends Java12Validator { +public class Java13Validator extends Java12Validator { - public Java13Validator() { + public Java13Validator() { super(); // Released Language Features // No new released language features added in Java 13 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14PreviewValidator.java index d407d6e311..3d0fe7bf08 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/14/ */ -public class Java14PreviewValidator extends Java14Validator { +public class Java14PreviewValidator extends Java14Validator { - public Java14PreviewValidator() { + public Java14PreviewValidator() { super(); // Incubator // No new incubator language features added within Java 14 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14Validator.java index ba5c276c22..7b712b4669 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java14Validator.java @@ -31,7 +31,7 @@ * * @see https://openjdk.java.net/projects/jdk/14/ */ -public class Java14Validator extends Java13Validator { +public class Java14Validator extends Java13Validator { /** * With the introduction of record classes, {@code record} is no longer permitted as an identifier. @@ -48,7 +48,7 @@ public class Java14Validator extends Java13Validator { final Validator recordDeclarationValidator = new SingleNodeTypeValidator<>(RecordDeclaration.class, new RecordDeclarationValidator()); - public Java14Validator() { + public Java14Validator() { super(); // Released Language Features { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15PreviewValidator.java index 7e854b8500..802ab379c3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/15/ */ -public class Java15PreviewValidator extends Java15Validator { +public class Java15PreviewValidator extends Java15Validator { - public Java15PreviewValidator() { + public Java15PreviewValidator() { super(); // Incubator // No new incubator language features added within Java 15 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15Validator.java index 17f8b05ac1..b2b608b5f3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java15Validator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/15/ */ -public class Java15Validator extends Java14Validator { +public class Java15Validator extends Java14Validator { - public Java15Validator() { + public Java15Validator() { super(); // Released Language Features // Text Block Literals - released within Java 15 - https://openjdk.java.net/jeps/378 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16PreviewValidator.java index 07575e20fd..e660e4440c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/16/ */ -public class Java16PreviewValidator extends Java16Validator { +public class Java16PreviewValidator extends Java16Validator { - public Java16PreviewValidator() { + public Java16PreviewValidator() { super(); // Incubator // No new incubator language features added in Java 16 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16Validator.java index fa5f3b9ef0..4a7d854a37 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java16Validator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/16/ */ -public class Java16Validator extends Java15Validator { +public class Java16Validator extends Java15Validator { - public Java16Validator() { + public Java16Validator() { super(); // Released Language Features // Pattern Matching for instanceof released within Java 16 - https://openjdk.java.net/jeps/305 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17PreviewValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17PreviewValidator.java index d61d3519c2..898271ab6d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17PreviewValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17PreviewValidator.java @@ -25,9 +25,9 @@ * * @see https://openjdk.java.net/projects/jdk/17/ */ -public class Java17PreviewValidator extends Java17Validator { +public class Java17PreviewValidator extends Java17Validator { - public Java17PreviewValidator() { + public Java17PreviewValidator() { super(); // Incubator // No new incubator language features added in Java 17 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17Validator.java index 63aaad7df8..c1a4552d75 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java17Validator.java @@ -30,13 +30,13 @@ * * @see https://openjdk.java.net/projects/jdk/17/ */ -public class Java17Validator extends Java16Validator { +public class Java17Validator extends Java16Validator { final Validator sealedNotAllowedAsIdentifier = new SimpleValidator<>(ClassOrInterfaceDeclaration.class, n -> n.getName().getIdentifier().equals("sealed"), (n, reporter) -> reporter.report(n, new UpgradeJavaMessage("'sealed' identifier is not authorised in this context.", ParserConfiguration.LanguageLevel.JAVA_17))); final Validator permitsNotAllowedAsIdentifier = new SimpleValidator<>(ClassOrInterfaceDeclaration.class, n -> n.getName().getIdentifier().equals("permits"), (n, reporter) -> reporter.report(n, new UpgradeJavaMessage("'permits' identifier is not authorised in this context.", ParserConfiguration.LanguageLevel.JAVA_17))); - public Java17Validator() { + public Java17Validator() { super(); // Released Language Features // Sealed Classes - https://openjdk.java.net/jeps/409 diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java18Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java18Validator.java index d86c059512..cbde069938 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java18Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java18Validator.java @@ -24,9 +24,9 @@ * * @see https://openjdk.java.net/projects/jdk/18/ */ -public class Java18Validator extends Java17Validator { +public class Java18Validator extends Java17Validator { - public Java18Validator() { + public Java18Validator() { super(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java19Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java19Validator.java index e23c9e1a00..bc3ba50db3 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java19Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java19Validator.java @@ -24,9 +24,9 @@ * * @see https://openjdk.java.net/projects/jdk/19/ */ -public class Java19Validator extends Java18Validator { +public class Java19Validator extends Java18Validator { - public Java19Validator() { + public Java19Validator() { super(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_0Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_0Validator.java index 8ad7d6add2..50967be464 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_0Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_0Validator.java @@ -40,7 +40,7 @@ /** * This validator validates according to Java 1.0 syntax rules. */ -public class Java1_0Validator extends Validators { +public class Java1_0Validator extends Validators { final Validator modifiersWithoutStrictfpAndDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods = new ModifierValidator(false, false, false); @@ -130,7 +130,7 @@ public class Java1_0Validator extends Validators { } }); - public Java1_0Validator() { + public Java1_0Validator() { super(new CommonValidators()); add(modifiersWithoutStrictfpAndDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods); add(noAssertKeyword); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_1Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_1Validator.java index aa172aafc0..3e2cff1526 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_1Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_1Validator.java @@ -29,14 +29,14 @@ /** * This validator validates according to Java 1.1 syntax rules. */ -public class Java1_1Validator extends Java1_0Validator { +public class Java1_1Validator extends Java1_0Validator { final Validator innerClasses = new SingleNodeTypeValidator<>(ClassOrInterfaceDeclaration.class, (n, reporter) -> n.getParentNode().ifPresent(p -> { if (p instanceof LocalClassDeclarationStmt && n.isInterface()) reporter.report(n, new UpgradeJavaMessage("There is no such thing as a local interface.", ParserConfiguration.LanguageLevel.JAVA_16)); })); - public Java1_1Validator() { + public Java1_1Validator() { super(); replace(noInnerClasses, innerClasses); remove(noReflection); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_2Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_2Validator.java index 33d443717f..f2c7881d9b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_2Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_2Validator.java @@ -27,13 +27,13 @@ /** * This validator validates according to Java 1.2 syntax rules. */ -public class Java1_2Validator extends Java1_1Validator { +public class Java1_2Validator extends Java1_1Validator { final Validator modifiersWithoutDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods = new ModifierValidator(true, false, false); final Validator strictfpNotAllowed = new ReservedKeywordValidator("strictfp"); - public Java1_2Validator() { + public Java1_2Validator() { super(); replace(modifiersWithoutStrictfpAndDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods, modifiersWithoutDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods); add(strictfpNotAllowed); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_3Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_3Validator.java index a0d322f95e..7cf146cc7a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_3Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_3Validator.java @@ -23,9 +23,9 @@ /** * This validator validates according to Java 1.3 syntax rules. */ -public class Java1_3Validator extends Java1_2Validator { +public class Java1_3Validator extends Java1_2Validator { - public Java1_3Validator() { + public Java1_3Validator() { super(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_4Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_4Validator.java index 1609d6cd4d..c95e33b4d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_4Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java1_4Validator.java @@ -23,9 +23,9 @@ /** * This validator validates according to Java 1.4 syntax rules. */ -public class Java1_4Validator extends Java1_3Validator { +public class Java1_4Validator extends Java1_3Validator { - public Java1_4Validator() { + public Java1_4Validator() { super(); remove(noAssertKeyword); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java20Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java20Validator.java index 4c5204101c..a963cda08a 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java20Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java20Validator.java @@ -24,9 +24,9 @@ * * @see https://openjdk.java.net/projects/jdk/20/ */ -public class Java20Validator extends Java19Validator { +public class Java20Validator extends Java19Validator { - public Java20Validator() { + public Java20Validator() { super(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java21Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java21Validator.java index b6e91df9e8..a894414bac 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java21Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java21Validator.java @@ -24,9 +24,9 @@ * * @see https://openjdk.java.net/projects/jdk/21/ */ -public class Java21Validator extends Java20Validator { +public class Java21Validator extends Java20Validator { - public Java21Validator() { + public Java21Validator() { super(); remove(noSwitchNullDefault); remove(noSwitchPatterns); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java5Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java5Validator.java index b7acdd3f3d..a67ddebfcc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java5Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java5Validator.java @@ -37,7 +37,7 @@ /** * This validator validates according to Java 5 syntax rules. */ -public class Java5Validator extends Java1_4Validator { +public class Java5Validator extends Java1_4Validator { final Validator genericsWithoutDiamondOperator = new TreeVisitorValidator((node, reporter) -> { if (node instanceof NodeWithTypeArguments) { @@ -71,7 +71,7 @@ public class Java5Validator extends Java1_4Validator { final Validator enumNotAllowed = new ReservedKeywordValidator("enum"); - public Java5Validator() { + public Java5Validator() { super(); replace(noGenerics, genericsWithoutDiamondOperator); add(noPrimitiveGenericArguments); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java6Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java6Validator.java index 16a3733f79..9061338c58 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java6Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java6Validator.java @@ -23,9 +23,9 @@ /** * This validator validates according to Java 6 syntax rules. */ -public class Java6Validator extends Java5Validator { +public class Java6Validator extends Java5Validator { - public Java6Validator() { + public Java6Validator() { super(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java7Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java7Validator.java index 7353629195..a49c40110e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java7Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java7Validator.java @@ -28,7 +28,7 @@ /** * This validator validates according to Java 7 syntax rules. */ -public class Java7Validator extends Java6Validator { +public class Java7Validator extends Java6Validator { final SingleNodeTypeValidator tryWithLimitedResources = new SingleNodeTypeValidator<>(TryStmt.class, (n, reporter) -> { if (n.getCatchClauses().isEmpty() && n.getResources().isEmpty() && !n.getFinallyBlock().isPresent()) { @@ -48,7 +48,7 @@ public class Java7Validator extends Java6Validator { } }); - public Java7Validator() { + public Java7Validator() { super(); remove(genericsWithoutDiamondOperator); replace(tryWithoutResources, tryWithLimitedResources); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java8Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java8Validator.java index 631de9fd78..0d72fffbe2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java8Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java8Validator.java @@ -31,7 +31,7 @@ * @see https://openjdk.java.net/projects/jdk8/ * @see https://openjdk.java.net/projects/jdk8/features */ -public class Java8Validator extends Java7Validator { +public class Java8Validator extends Java7Validator { final Validator modifiersWithoutPrivateInterfaceMethods = new ModifierValidator(true, true, false); @@ -45,7 +45,7 @@ public class Java8Validator extends Java7Validator { } }); - public Java8Validator() { + public Java8Validator() { super(); replace(modifiersWithoutDefaultAndStaticInterfaceMethodsAndPrivateInterfaceMethods, modifiersWithoutPrivateInterfaceMethods); add(defaultMethodsInInterface); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java9Validator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java9Validator.java index 6c91606d52..cd97b9249b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java9Validator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/Java9Validator.java @@ -31,7 +31,7 @@ * * @see https://openjdk.java.net/projects/jdk9/ */ -public class Java9Validator extends Java8Validator { +public class Java9Validator extends Java8Validator { final Validator underscoreKeywordValidator = new UnderscoreKeywordValidator(); @@ -43,7 +43,7 @@ public class Java9Validator extends Java8Validator { } }); - public Java9Validator() { + public Java9Validator() { super(); // Released Language Features /* diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/UpgradeJavaMessage.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/UpgradeJavaMessage.java index 2a4513479f..2fbbd4bf24 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/UpgradeJavaMessage.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/UpgradeJavaMessage.java @@ -52,7 +52,7 @@ public final class UpgradeJavaMessage { } @Override - public String toString() { + public String toString() { return String.format("%s Pay attention that this feature is supported starting from '%s' language level. If you need that feature the language level must be configured in the configuration before parsing the source files.", this.reason, this.level.toString()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/CommonValidators.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/CommonValidators.java index 7dce940765..b3989f0cbd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/CommonValidators.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/CommonValidators.java @@ -34,9 +34,9 @@ /** * Contains validations that are valid for every Java version. */ -public class CommonValidators extends Validators { +public class CommonValidators extends Validators { - public CommonValidators() { + public CommonValidators() { super(new SimpleValidator<>(ClassOrInterfaceDeclaration.class, n -> !n.isInterface() && n.getExtendedTypes().size() > 1, (n, reporter) -> reporter.report(n.getExtendedTypes(1), "A class cannot extend more than one other class.")), new SimpleValidator<>(ClassOrInterfaceDeclaration.class, n -> n.isInterface() && !n.getImplementedTypes().isEmpty(), (n, reporter) -> reporter.report(n.getImplementedTypes(0), "An interface cannot implement other interfaces.")), new SingleNodeTypeValidator<>(ClassOrInterfaceDeclaration.class, (n, reporter) -> { if (n.isInterface()) { n.getMembers().forEach(mem -> { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java index 1a22087ee9..69219db2ee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/ModifierValidator.java @@ -39,7 +39,7 @@ /** * Verifies that only allowed modifiers are used where modifiers are expected. */ -public class ModifierValidator extends VisitorValidator { +public class ModifierValidator extends VisitorValidator { private final Modifier.Keyword[] interfaceWithNothingSpecial = new Modifier.Keyword[] { PUBLIC, PROTECTED, ABSTRACT, FINAL, SYNCHRONIZED, NATIVE, STRICTFP }; @@ -53,14 +53,14 @@ public class ModifierValidator extends VisitorValidator { private final boolean hasPrivateInterfaceMethods; - public ModifierValidator(boolean hasStrictfp, boolean hasDefaultAndStaticInterfaceMethods, boolean hasPrivateInterfaceMethods) { + public ModifierValidator(boolean hasStrictfp, boolean hasDefaultAndStaticInterfaceMethods, boolean hasPrivateInterfaceMethods) { this.hasStrictfp = hasStrictfp; this.hasDefaultAndStaticInterfaceMethods = hasDefaultAndStaticInterfaceMethods; this.hasPrivateInterfaceMethods = hasPrivateInterfaceMethods; } @Override - public void visit(ClassOrInterfaceDeclaration n, ProblemReporter reporter) { + public void visit(ClassOrInterfaceDeclaration n, ProblemReporter reporter) { if (n.isInterface()) { validateInterfaceModifiers(n, reporter); } else { @@ -88,7 +88,7 @@ private void validateInterfaceModifiers(TypeDeclaration n, ProblemReporter re } @Override - public void visit(EnumDeclaration n, ProblemReporter reporter) { + public void visit(EnumDeclaration n, ProblemReporter reporter) { if (n.isTopLevelType()) { validateModifiers(n, reporter, PUBLIC, STRICTFP); } else if (n.isNestedType()) { @@ -98,32 +98,32 @@ public void visit(EnumDeclaration n, ProblemReporter reporter) { } @Override - public void visit(AnnotationDeclaration n, ProblemReporter reporter) { + public void visit(AnnotationDeclaration n, ProblemReporter reporter) { validateInterfaceModifiers(n, reporter); super.visit(n, reporter); } @Override - public void visit(AnnotationMemberDeclaration n, ProblemReporter reporter) { + public void visit(AnnotationMemberDeclaration n, ProblemReporter reporter) { validateModifiers(n, reporter, PUBLIC, ABSTRACT); super.visit(n, reporter); } @Override - public void visit(ConstructorDeclaration n, ProblemReporter reporter) { + public void visit(ConstructorDeclaration n, ProblemReporter reporter) { validateModifiers(n, reporter, PUBLIC, PROTECTED, PRIVATE); n.getParameters().forEach(p -> validateModifiers(p, reporter, FINAL)); super.visit(n, reporter); } @Override - public void visit(FieldDeclaration n, ProblemReporter reporter) { + public void visit(FieldDeclaration n, ProblemReporter reporter) { validateModifiers(n, reporter, PUBLIC, PROTECTED, PRIVATE, STATIC, FINAL, TRANSIENT, VOLATILE); super.visit(n, reporter); } @Override - public void visit(MethodDeclaration n, ProblemReporter reporter) { + public void visit(MethodDeclaration n, ProblemReporter reporter) { if (n.isAbstract()) { final SeparatedItemStringBuilder builder = new SeparatedItemStringBuilder("Cannot be 'abstract' and also '", "', '", "'."); for (Modifier.Keyword m : asList(PRIVATE, STATIC, FINAL, NATIVE, STRICTFP, SYNCHRONIZED)) { @@ -157,7 +157,7 @@ public void visit(MethodDeclaration n, ProblemReporter reporter) { } @Override - public void visit(LambdaExpr n, ProblemReporter reporter) { + public void visit(LambdaExpr n, ProblemReporter reporter) { n.getParameters().forEach(p -> { // Final is not allowed on inferred parameters, but those get caught by the parser. validateModifiers(p, reporter, FINAL); @@ -166,19 +166,19 @@ public void visit(LambdaExpr n, ProblemReporter reporter) { } @Override - public void visit(CatchClause n, ProblemReporter reporter) { + public void visit(CatchClause n, ProblemReporter reporter) { validateModifiers(n.getParameter(), reporter, FINAL); super.visit(n, reporter); } @Override - public void visit(VariableDeclarationExpr n, ProblemReporter reporter) { + public void visit(VariableDeclarationExpr n, ProblemReporter reporter) { validateModifiers(n, reporter, FINAL); super.visit(n, reporter); } @Override - public void visit(ModuleRequiresDirective n, ProblemReporter reporter) { + public void visit(ModuleRequiresDirective n, ProblemReporter reporter) { validateModifiers(n, reporter, TRANSITIVE, STATIC); super.visit(n, reporter); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoBinaryIntegerLiteralsValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoBinaryIntegerLiteralsValidator.java index b83c62dd44..f185385eb6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoBinaryIntegerLiteralsValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoBinaryIntegerLiteralsValidator.java @@ -26,16 +26,16 @@ import com.github.javaparser.ast.validator.ProblemReporter; import com.github.javaparser.ast.validator.VisitorValidator; -public class NoBinaryIntegerLiteralsValidator extends VisitorValidator { +public class NoBinaryIntegerLiteralsValidator extends VisitorValidator { @Override - public void visit(IntegerLiteralExpr n, ProblemReporter arg) { + public void visit(IntegerLiteralExpr n, ProblemReporter arg) { validate(n, arg); super.visit(n, arg); } @Override - public void visit(LongLiteralExpr n, ProblemReporter arg) { + public void visit(LongLiteralExpr n, ProblemReporter arg) { validate(n, arg); super.visit(n, arg); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoUnderscoresInIntegerLiteralsValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoUnderscoresInIntegerLiteralsValidator.java index 7c8ecae4a1..9479391c69 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoUnderscoresInIntegerLiteralsValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/NoUnderscoresInIntegerLiteralsValidator.java @@ -26,16 +26,16 @@ import com.github.javaparser.ast.validator.ProblemReporter; import com.github.javaparser.ast.validator.VisitorValidator; -public class NoUnderscoresInIntegerLiteralsValidator extends VisitorValidator { +public class NoUnderscoresInIntegerLiteralsValidator extends VisitorValidator { @Override - public void visit(IntegerLiteralExpr n, ProblemReporter arg) { + public void visit(IntegerLiteralExpr n, ProblemReporter arg) { validate(n, arg); super.visit(n, arg); } @Override - public void visit(LongLiteralExpr n, ProblemReporter arg) { + public void visit(LongLiteralExpr n, ProblemReporter arg) { validate(n, arg); super.visit(n, arg); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/RecordDeclarationValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/RecordDeclarationValidator.java index f34c861632..19d6f755ab 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/RecordDeclarationValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/RecordDeclarationValidator.java @@ -24,10 +24,10 @@ import com.github.javaparser.ast.validator.ProblemReporter; import com.github.javaparser.ast.validator.TypedValidator; -public class RecordDeclarationValidator implements TypedValidator { +public class RecordDeclarationValidator implements TypedValidator { @Override - public void accept(RecordDeclaration node, ProblemReporter reporter) { + public void accept(RecordDeclaration node, ProblemReporter reporter) { forbidAbstractModifier(node, reporter); forbidNonStaticFieldsInRecords(node, reporter); validateRecordComponentAccessorMethods(node, reporter); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/UnderscoreKeywordValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/UnderscoreKeywordValidator.java index 54066b7c7f..6613ef83aa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/UnderscoreKeywordValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/UnderscoreKeywordValidator.java @@ -26,16 +26,16 @@ import com.github.javaparser.ast.validator.ProblemReporter; import com.github.javaparser.ast.validator.VisitorValidator; -public class UnderscoreKeywordValidator extends VisitorValidator { +public class UnderscoreKeywordValidator extends VisitorValidator { @Override - public void visit(Name n, ProblemReporter arg) { + public void visit(Name n, ProblemReporter arg) { validateIdentifier(n, n.getIdentifier(), arg); super.visit(n, arg); } @Override - public void visit(SimpleName n, ProblemReporter arg) { + public void visit(SimpleName n, ProblemReporter arg) { validateIdentifier(n, n.getIdentifier(), arg); super.visit(n, arg); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/VarValidator.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/VarValidator.java index b3311e0406..12466bd6cd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/VarValidator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/language_level_validations/chunks/VarValidator.java @@ -36,16 +36,16 @@ import com.github.javaparser.ast.validator.TypedValidator; import java.util.Optional; -public class VarValidator implements TypedValidator { +public class VarValidator implements TypedValidator { private boolean varAllowedInLambdaParameters; - public VarValidator(boolean varAllowedInLambdaParameters) { + public VarValidator(boolean varAllowedInLambdaParameters) { this.varAllowedInLambdaParameters = varAllowedInLambdaParameters; } @Override - public void accept(VarType node, ProblemReporter reporter) { + public void accept(VarType node, ProblemReporter reporter) { // All allowed locations are within a VariableDeclaration inside a VariableDeclarationExpr inside something // else. Optional variableDeclarator = node.findAncestor(VariableDeclarator.class); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java10PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java10PostProcessor.java index 4dfda84954..8edbc4b843 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java10PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java10PostProcessor.java @@ -34,7 +34,7 @@ /** * Processes the generic AST into a Java 10 AST and validates it. */ -public class Java10PostProcessor extends PostProcessors { +public class Java10PostProcessor extends PostProcessors { // List of parent contexts in which a var type must not be detected. // for example: in this statement var.class.getCanonicalName(), var must not be considered as a VarType @@ -47,7 +47,7 @@ public class Java10PostProcessor extends PostProcessors { protected final Processor varNodeCreator = new Processor() { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { result.getResult().ifPresent(node -> { node.findAll(ClassOrInterfaceType.class).forEach(n -> { if ("var".equals(n.getNameAsString()) && !matchForbiddenContext(n)) { @@ -62,7 +62,7 @@ private boolean matchForbiddenContext(ClassOrInterfaceType cit) { } }; - public Java10PostProcessor() { + public Java10PostProcessor() { add(varNodeCreator); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java11PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java11PostProcessor.java index b7c141d1b2..15c5c6f76e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java11PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java11PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 11 AST and validates it. */ -public class Java11PostProcessor extends Java10PostProcessor { +public class Java11PostProcessor extends Java10PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java12PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java12PostProcessor.java index ed318341ec..7f3e8bd521 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java12PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java12PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 12 AST and validates it. */ -public class Java12PostProcessor extends Java11PostProcessor { +public class Java12PostProcessor extends Java11PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java13PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java13PostProcessor.java index e7f107f291..09db3a2ba2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java13PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java13PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 13 AST and validates it. */ -public class Java13PostProcessor extends Java12PostProcessor { +public class Java13PostProcessor extends Java12PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java14PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java14PostProcessor.java index 067069bb89..b997103e29 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java14PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java14PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 14 AST and validates it. */ -public class Java14PostProcessor extends Java13PostProcessor { +public class Java14PostProcessor extends Java13PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java15PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java15PostProcessor.java index 96a4b2960c..ee4efb1eab 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java15PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java15PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 15 AST and validates it. */ -public class Java15PostProcessor extends Java14PostProcessor { +public class Java15PostProcessor extends Java14PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java16PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java16PostProcessor.java index 44739dd43e..3e3cab8290 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java16PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java16PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 16 AST and validates it. */ -public class Java16PostProcessor extends Java15PostProcessor { +public class Java16PostProcessor extends Java15PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java17PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java17PostProcessor.java index 793988291c..0b22335701 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java17PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java17PostProcessor.java @@ -23,5 +23,5 @@ /** * Processes the generic AST into a Java 17 AST and validates it. */ -public class Java17PostProcessor extends Java16PostProcessor { +public class Java17PostProcessor extends Java16PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java18PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java18PostProcessor.java index 4ee7fff32e..282d8e43df 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java18PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java18PostProcessor.java @@ -22,5 +22,5 @@ /** * Processes the generic AST into a Java 18 AST and validates it. */ -public class Java18PostProcessor extends Java17PostProcessor { +public class Java18PostProcessor extends Java17PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java19PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java19PostProcessor.java index 4121856bb2..b4a5c937c2 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java19PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java19PostProcessor.java @@ -22,5 +22,5 @@ /** * Processes the generic AST into a Java 19 AST and validates it. */ -public class Java19PostProcessor extends Java18PostProcessor { +public class Java19PostProcessor extends Java18PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java20PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java20PostProcessor.java index 76a0568cc2..739530784b 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java20PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java20PostProcessor.java @@ -22,5 +22,5 @@ /** * Processes the generic AST into a Java 20 AST and validates it. */ -public class Java20PostProcessor extends Java19PostProcessor { +public class Java20PostProcessor extends Java19PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java21PostProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java21PostProcessor.java index 6b1227546a..c1e2d82aab 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java21PostProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/Java21PostProcessor.java @@ -22,5 +22,5 @@ /** * Processes the generic AST into a Java 21 AST and validates it. */ -public class Java21PostProcessor extends Java20PostProcessor { +public class Java21PostProcessor extends Java20PostProcessor { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/PostProcessors.java b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/PostProcessors.java index a0e00d9ffb..d2662de779 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/PostProcessors.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/validator/postprocessors/PostProcessors.java @@ -31,37 +31,37 @@ /** * A post processor that will call a collection of post processors. */ -public class PostProcessors { +public class PostProcessors { private final List postProcessors = new ArrayList<>(); - public PostProcessors(Processor... postProcessors) { + public PostProcessors(Processor... postProcessors) { this.postProcessors.addAll(Arrays.asList(postProcessors)); } - public List getPostProcessors() { + public List getPostProcessors() { return postProcessors; } - public PostProcessors remove(Processor postProcessor) { + public PostProcessors remove(Processor postProcessor) { if (!postProcessors.remove(postProcessor)) { throw new AssertionError("Trying to remove a post processor that isn't there."); } return this; } - public PostProcessors replace(Processor oldProcessor, Processor newProcessor) { + public PostProcessors replace(Processor oldProcessor, Processor newProcessor) { remove(oldProcessor); add(newProcessor); return this; } - public PostProcessors add(Processor newProcessor) { + public PostProcessors add(Processor newProcessor) { postProcessors.add(newProcessor); return this; } - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { postProcessors.forEach(pp -> pp.postProcess(result, configuration)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java index 217876da0a..70d4dd069c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java @@ -48,11 +48,11 @@ /** * A visitor that clones (copies) a node and all its children. */ -public class CloneVisitor implements GenericVisitor { +public class CloneVisitor implements GenericVisitor { @Override @Generated("com.github.javaparser.generator.core.visitor.CloneVisitorGenerator") - public Visitable visit(final CompilationUnit n, final Object arg) { + public Visitable visit(final CompilationUnit n, final Object arg) { NodeList imports = cloneList(n.getImports(), arg); ModuleDeclaration module = cloneNode(n.getModule(), arg); PackageDeclaration packageDeclaration = cloneNode(n.getPackageDeclaration(), arg); @@ -68,7 +68,7 @@ public Visitable visit(final CompilationUnit n, final Object arg) { @Override @Generated("com.github.javaparser.generator.core.visitor.CloneVisitorGenerator") - public Visitable visit(final PackageDeclaration n, final Object arg) { + public Visitable visit(final PackageDeclaration n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -80,7 +80,7 @@ public Visitable visit(final PackageDeclaration n, final Object arg) { } @Override - public Visitable visit(final TypeParameter n, final Object arg) { + public Visitable visit(final TypeParameter n, final Object arg) { SimpleName name = cloneNode(n.getName(), arg); NodeList typeBound = cloneList(n.getTypeBound(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); @@ -93,7 +93,7 @@ public Visitable visit(final TypeParameter n, final Object arg) { } @Override - public Visitable visit(final LineComment n, final Object arg) { + public Visitable visit(final LineComment n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); LineComment r = new LineComment(n.getTokenRange().orElse(null), n.getContent()); r.setComment(comment); @@ -103,7 +103,7 @@ public Visitable visit(final LineComment n, final Object arg) { } @Override - public Visitable visit(final BlockComment n, final Object arg) { + public Visitable visit(final BlockComment n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); BlockComment r = new BlockComment(n.getTokenRange().orElse(null), n.getContent()); r.setComment(comment); @@ -113,7 +113,7 @@ public Visitable visit(final BlockComment n, final Object arg) { } @Override - public Visitable visit(final ClassOrInterfaceDeclaration n, final Object arg) { + public Visitable visit(final ClassOrInterfaceDeclaration n, final Object arg) { NodeList extendedTypes = cloneList(n.getExtendedTypes(), arg); NodeList implementedTypes = cloneList(n.getImplementedTypes(), arg); NodeList permittedTypes = cloneList(n.getPermittedTypes(), arg); @@ -131,7 +131,7 @@ public Visitable visit(final ClassOrInterfaceDeclaration n, final Object arg) { } @Override - public Visitable visit(final EnumDeclaration n, final Object arg) { + public Visitable visit(final EnumDeclaration n, final Object arg) { NodeList entries = cloneList(n.getEntries(), arg); NodeList implementedTypes = cloneList(n.getImplementedTypes(), arg); NodeList> members = cloneList(n.getMembers(), arg); @@ -147,7 +147,7 @@ public Visitable visit(final EnumDeclaration n, final Object arg) { } @Override - public Visitable visit(final EnumConstantDeclaration n, final Object arg) { + public Visitable visit(final EnumConstantDeclaration n, final Object arg) { NodeList arguments = cloneList(n.getArguments(), arg); NodeList> classBody = cloneList(n.getClassBody(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -161,7 +161,7 @@ public Visitable visit(final EnumConstantDeclaration n, final Object arg) { } @Override - public Visitable visit(final AnnotationDeclaration n, final Object arg) { + public Visitable visit(final AnnotationDeclaration n, final Object arg) { NodeList> members = cloneList(n.getMembers(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -175,7 +175,7 @@ public Visitable visit(final AnnotationDeclaration n, final Object arg) { } @Override - public Visitable visit(final AnnotationMemberDeclaration n, final Object arg) { + public Visitable visit(final AnnotationMemberDeclaration n, final Object arg) { Expression defaultValue = cloneNode(n.getDefaultValue(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -190,7 +190,7 @@ public Visitable visit(final AnnotationMemberDeclaration n, final Object arg) { } @Override - public Visitable visit(final FieldDeclaration n, final Object arg) { + public Visitable visit(final FieldDeclaration n, final Object arg) { NodeList modifiers = cloneList(n.getModifiers(), arg); NodeList variables = cloneList(n.getVariables(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); @@ -203,7 +203,7 @@ public Visitable visit(final FieldDeclaration n, final Object arg) { } @Override - public Visitable visit(final VariableDeclarator n, final Object arg) { + public Visitable visit(final VariableDeclarator n, final Object arg) { Expression initializer = cloneNode(n.getInitializer(), arg); SimpleName name = cloneNode(n.getName(), arg); Type type = cloneNode(n.getType(), arg); @@ -216,7 +216,7 @@ public Visitable visit(final VariableDeclarator n, final Object arg) { } @Override - public Visitable visit(final ConstructorDeclaration n, final Object arg) { + public Visitable visit(final ConstructorDeclaration n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); NodeList contracts = cloneList(n.getContracts(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); @@ -235,7 +235,7 @@ public Visitable visit(final ConstructorDeclaration n, final Object arg) { } @Override - public Visitable visit(final MethodDeclaration n, final Object arg) { + public Visitable visit(final MethodDeclaration n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); Type type = cloneNode(n.getType(), arg); NodeList contracts = cloneList(n.getContracts(), arg); @@ -255,7 +255,7 @@ public Visitable visit(final MethodDeclaration n, final Object arg) { } @Override - public Visitable visit(final Parameter n, final Object arg) { + public Visitable visit(final Parameter n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -270,7 +270,7 @@ public Visitable visit(final Parameter n, final Object arg) { } @Override - public Visitable visit(final InitializerDeclaration n, final Object arg) { + public Visitable visit(final InitializerDeclaration n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -282,7 +282,7 @@ public Visitable visit(final InitializerDeclaration n, final Object arg) { } @Override - public Visitable visit(final JavadocComment n, final Object arg) { + public Visitable visit(final JavadocComment n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); JavadocComment r = new JavadocComment(n.getTokenRange().orElse(null), n.getContent()); r.setComment(comment); @@ -292,7 +292,7 @@ public Visitable visit(final JavadocComment n, final Object arg) { } @Override - public Visitable visit(final ClassOrInterfaceType n, final Object arg) { + public Visitable visit(final ClassOrInterfaceType n, final Object arg) { SimpleName name = cloneNode(n.getName(), arg); ClassOrInterfaceType scope = cloneNode(n.getScope(), arg); NodeList typeArguments = cloneList(n.getTypeArguments().orElse(null), arg); @@ -306,7 +306,7 @@ public Visitable visit(final ClassOrInterfaceType n, final Object arg) { } @Override - public Visitable visit(final PrimitiveType n, final Object arg) { + public Visitable visit(final PrimitiveType n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); PrimitiveType r = new PrimitiveType(n.getTokenRange().orElse(null), n.getType(), annotations); @@ -317,7 +317,7 @@ public Visitable visit(final PrimitiveType n, final Object arg) { } @Override - public Visitable visit(final ArrayType n, final Object arg) { + public Visitable visit(final ArrayType n, final Object arg) { Type componentType = cloneNode(n.getComponentType(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -329,7 +329,7 @@ public Visitable visit(final ArrayType n, final Object arg) { } @Override - public Visitable visit(final ArrayCreationLevel n, final Object arg) { + public Visitable visit(final ArrayCreationLevel n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Expression dimension = cloneNode(n.getDimension(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -341,7 +341,7 @@ public Visitable visit(final ArrayCreationLevel n, final Object arg) { } @Override - public Visitable visit(final IntersectionType n, final Object arg) { + public Visitable visit(final IntersectionType n, final Object arg) { NodeList elements = cloneList(n.getElements(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -353,7 +353,7 @@ public Visitable visit(final IntersectionType n, final Object arg) { } @Override - public Visitable visit(final UnionType n, final Object arg) { + public Visitable visit(final UnionType n, final Object arg) { NodeList elements = cloneList(n.getElements(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -365,7 +365,7 @@ public Visitable visit(final UnionType n, final Object arg) { } @Override - public Visitable visit(final VoidType n, final Object arg) { + public Visitable visit(final VoidType n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); VoidType r = new VoidType(n.getTokenRange().orElse(null)); @@ -376,7 +376,7 @@ public Visitable visit(final VoidType n, final Object arg) { } @Override - public Visitable visit(final WildcardType n, final Object arg) { + public Visitable visit(final WildcardType n, final Object arg) { ReferenceType extendedType = cloneNode(n.getExtendedType(), arg); ReferenceType superType = cloneNode(n.getSuperType(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); @@ -389,7 +389,7 @@ public Visitable visit(final WildcardType n, final Object arg) { } @Override - public Visitable visit(final UnknownType n, final Object arg) { + public Visitable visit(final UnknownType n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); UnknownType r = new UnknownType(n.getTokenRange().orElse(null)); @@ -400,7 +400,7 @@ public Visitable visit(final UnknownType n, final Object arg) { } @Override - public Visitable visit(final ArrayAccessExpr n, final Object arg) { + public Visitable visit(final ArrayAccessExpr n, final Object arg) { Expression index = cloneNode(n.getIndex(), arg); Expression name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -412,7 +412,7 @@ public Visitable visit(final ArrayAccessExpr n, final Object arg) { } @Override - public Visitable visit(final ArrayCreationExpr n, final Object arg) { + public Visitable visit(final ArrayCreationExpr n, final Object arg) { Type elementType = cloneNode(n.getElementType(), arg); ArrayInitializerExpr initializer = cloneNode(n.getInitializer(), arg); NodeList levels = cloneList(n.getLevels(), arg); @@ -425,7 +425,7 @@ public Visitable visit(final ArrayCreationExpr n, final Object arg) { } @Override - public Visitable visit(final ArrayInitializerExpr n, final Object arg) { + public Visitable visit(final ArrayInitializerExpr n, final Object arg) { NodeList values = cloneList(n.getValues(), arg); Comment comment = cloneNode(n.getComment(), arg); ArrayInitializerExpr r = new ArrayInitializerExpr(n.getTokenRange().orElse(null), values); @@ -436,7 +436,7 @@ public Visitable visit(final ArrayInitializerExpr n, final Object arg) { } @Override - public Visitable visit(final AssignExpr n, final Object arg) { + public Visitable visit(final AssignExpr n, final Object arg) { Expression target = cloneNode(n.getTarget(), arg); Expression value = cloneNode(n.getValue(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -448,7 +448,7 @@ public Visitable visit(final AssignExpr n, final Object arg) { } @Override - public Visitable visit(final BinaryExpr n, final Object arg) { + public Visitable visit(final BinaryExpr n, final Object arg) { Expression left = cloneNode(n.getLeft(), arg); Expression right = cloneNode(n.getRight(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -460,7 +460,7 @@ public Visitable visit(final BinaryExpr n, final Object arg) { } @Override - public Visitable visit(final CastExpr n, final Object arg) { + public Visitable visit(final CastExpr n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Type type = cloneNode(n.getType(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -472,7 +472,7 @@ public Visitable visit(final CastExpr n, final Object arg) { } @Override - public Visitable visit(final ClassExpr n, final Object arg) { + public Visitable visit(final ClassExpr n, final Object arg) { Type type = cloneNode(n.getType(), arg); Comment comment = cloneNode(n.getComment(), arg); ClassExpr r = new ClassExpr(n.getTokenRange().orElse(null), type); @@ -483,7 +483,7 @@ public Visitable visit(final ClassExpr n, final Object arg) { } @Override - public Visitable visit(final ConditionalExpr n, final Object arg) { + public Visitable visit(final ConditionalExpr n, final Object arg) { Expression condition = cloneNode(n.getCondition(), arg); Expression elseExpr = cloneNode(n.getElseExpr(), arg); Expression thenExpr = cloneNode(n.getThenExpr(), arg); @@ -496,7 +496,7 @@ public Visitable visit(final ConditionalExpr n, final Object arg) { } @Override - public Visitable visit(final EnclosedExpr n, final Object arg) { + public Visitable visit(final EnclosedExpr n, final Object arg) { Expression inner = cloneNode(n.getInner(), arg); Comment comment = cloneNode(n.getComment(), arg); EnclosedExpr r = new EnclosedExpr(n.getTokenRange().orElse(null), inner); @@ -507,7 +507,7 @@ public Visitable visit(final EnclosedExpr n, final Object arg) { } @Override - public Visitable visit(final FieldAccessExpr n, final Object arg) { + public Visitable visit(final FieldAccessExpr n, final Object arg) { SimpleName name = cloneNode(n.getName(), arg); Expression scope = cloneNode(n.getScope(), arg); NodeList typeArguments = cloneList(n.getTypeArguments().orElse(null), arg); @@ -520,7 +520,7 @@ public Visitable visit(final FieldAccessExpr n, final Object arg) { } @Override - public Visitable visit(final InstanceOfExpr n, final Object arg) { + public Visitable visit(final InstanceOfExpr n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); PatternExpr pattern = cloneNode(n.getPattern(), arg); ReferenceType type = cloneNode(n.getType(), arg); @@ -533,7 +533,7 @@ public Visitable visit(final InstanceOfExpr n, final Object arg) { } @Override - public Visitable visit(final StringLiteralExpr n, final Object arg) { + public Visitable visit(final StringLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); StringLiteralExpr r = new StringLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -543,7 +543,7 @@ public Visitable visit(final StringLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final IntegerLiteralExpr n, final Object arg) { + public Visitable visit(final IntegerLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); IntegerLiteralExpr r = new IntegerLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -553,7 +553,7 @@ public Visitable visit(final IntegerLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final LongLiteralExpr n, final Object arg) { + public Visitable visit(final LongLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); LongLiteralExpr r = new LongLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -563,7 +563,7 @@ public Visitable visit(final LongLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final CharLiteralExpr n, final Object arg) { + public Visitable visit(final CharLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); CharLiteralExpr r = new CharLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -573,7 +573,7 @@ public Visitable visit(final CharLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final DoubleLiteralExpr n, final Object arg) { + public Visitable visit(final DoubleLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); DoubleLiteralExpr r = new DoubleLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -583,7 +583,7 @@ public Visitable visit(final DoubleLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final BooleanLiteralExpr n, final Object arg) { + public Visitable visit(final BooleanLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); BooleanLiteralExpr r = new BooleanLiteralExpr(n.getTokenRange().orElse(null), n.isValue()); r.setComment(comment); @@ -593,7 +593,7 @@ public Visitable visit(final BooleanLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final NullLiteralExpr n, final Object arg) { + public Visitable visit(final NullLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); NullLiteralExpr r = new NullLiteralExpr(n.getTokenRange().orElse(null)); r.setComment(comment); @@ -603,7 +603,7 @@ public Visitable visit(final NullLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final MethodCallExpr n, final Object arg) { + public Visitable visit(final MethodCallExpr n, final Object arg) { NodeList arguments = cloneList(n.getArguments(), arg); SimpleName name = cloneNode(n.getName(), arg); Expression scope = cloneNode(n.getScope(), arg); @@ -617,7 +617,7 @@ public Visitable visit(final MethodCallExpr n, final Object arg) { } @Override - public Visitable visit(final NameExpr n, final Object arg) { + public Visitable visit(final NameExpr n, final Object arg) { SimpleName name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); NameExpr r = new NameExpr(n.getTokenRange().orElse(null), name); @@ -628,7 +628,7 @@ public Visitable visit(final NameExpr n, final Object arg) { } @Override - public Visitable visit(final ObjectCreationExpr n, final Object arg) { + public Visitable visit(final ObjectCreationExpr n, final Object arg) { NodeList> anonymousClassBody = cloneList(n.getAnonymousClassBody().orElse(null), arg); NodeList arguments = cloneList(n.getArguments(), arg); Expression scope = cloneNode(n.getScope(), arg); @@ -643,7 +643,7 @@ public Visitable visit(final ObjectCreationExpr n, final Object arg) { } @Override - public Visitable visit(final Name n, final Object arg) { + public Visitable visit(final Name n, final Object arg) { Name qualifier = cloneNode(n.getQualifier(), arg); Comment comment = cloneNode(n.getComment(), arg); Name r = new Name(n.getTokenRange().orElse(null), qualifier, n.getIdentifier()); @@ -654,7 +654,7 @@ public Visitable visit(final Name n, final Object arg) { } @Override - public Visitable visit(final SimpleName n, final Object arg) { + public Visitable visit(final SimpleName n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); SimpleName r = new SimpleName(n.getTokenRange().orElse(null), n.getIdentifier()); r.setComment(comment); @@ -664,7 +664,7 @@ public Visitable visit(final SimpleName n, final Object arg) { } @Override - public Visitable visit(final ThisExpr n, final Object arg) { + public Visitable visit(final ThisExpr n, final Object arg) { Name typeName = cloneNode(n.getTypeName(), arg); Comment comment = cloneNode(n.getComment(), arg); ThisExpr r = new ThisExpr(n.getTokenRange().orElse(null), typeName); @@ -675,7 +675,7 @@ public Visitable visit(final ThisExpr n, final Object arg) { } @Override - public Visitable visit(final SuperExpr n, final Object arg) { + public Visitable visit(final SuperExpr n, final Object arg) { Name typeName = cloneNode(n.getTypeName(), arg); Comment comment = cloneNode(n.getComment(), arg); SuperExpr r = new SuperExpr(n.getTokenRange().orElse(null), typeName); @@ -686,7 +686,7 @@ public Visitable visit(final SuperExpr n, final Object arg) { } @Override - public Visitable visit(final UnaryExpr n, final Object arg) { + public Visitable visit(final UnaryExpr n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); UnaryExpr r = new UnaryExpr(n.getTokenRange().orElse(null), expression, n.getOperator()); @@ -697,7 +697,7 @@ public Visitable visit(final UnaryExpr n, final Object arg) { } @Override - public Visitable visit(final VariableDeclarationExpr n, final Object arg) { + public Visitable visit(final VariableDeclarationExpr n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); NodeList variables = cloneList(n.getVariables(), arg); @@ -710,7 +710,7 @@ public Visitable visit(final VariableDeclarationExpr n, final Object arg) { } @Override - public Visitable visit(final MarkerAnnotationExpr n, final Object arg) { + public Visitable visit(final MarkerAnnotationExpr n, final Object arg) { Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); MarkerAnnotationExpr r = new MarkerAnnotationExpr(n.getTokenRange().orElse(null), name); @@ -721,7 +721,7 @@ public Visitable visit(final MarkerAnnotationExpr n, final Object arg) { } @Override - public Visitable visit(final SingleMemberAnnotationExpr n, final Object arg) { + public Visitable visit(final SingleMemberAnnotationExpr n, final Object arg) { Expression memberValue = cloneNode(n.getMemberValue(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -733,7 +733,7 @@ public Visitable visit(final SingleMemberAnnotationExpr n, final Object arg) { } @Override - public Visitable visit(final NormalAnnotationExpr n, final Object arg) { + public Visitable visit(final NormalAnnotationExpr n, final Object arg) { NodeList pairs = cloneList(n.getPairs(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -745,7 +745,7 @@ public Visitable visit(final NormalAnnotationExpr n, final Object arg) { } @Override - public Visitable visit(final MemberValuePair n, final Object arg) { + public Visitable visit(final MemberValuePair n, final Object arg) { SimpleName name = cloneNode(n.getName(), arg); Expression value = cloneNode(n.getValue(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -757,7 +757,7 @@ public Visitable visit(final MemberValuePair n, final Object arg) { } @Override - public Visitable visit(final ExplicitConstructorInvocationStmt n, final Object arg) { + public Visitable visit(final ExplicitConstructorInvocationStmt n, final Object arg) { NodeList arguments = cloneList(n.getArguments(), arg); Expression expression = cloneNode(n.getExpression(), arg); NodeList typeArguments = cloneList(n.getTypeArguments().orElse(null), arg); @@ -770,7 +770,7 @@ public Visitable visit(final ExplicitConstructorInvocationStmt n, final Object } @Override - public Visitable visit(final LocalClassDeclarationStmt n, final Object arg) { + public Visitable visit(final LocalClassDeclarationStmt n, final Object arg) { ClassOrInterfaceDeclaration classDeclaration = cloneNode(n.getClassDeclaration(), arg); Comment comment = cloneNode(n.getComment(), arg); LocalClassDeclarationStmt r = new LocalClassDeclarationStmt(n.getTokenRange().orElse(null), classDeclaration); @@ -781,7 +781,7 @@ public Visitable visit(final LocalClassDeclarationStmt n, final Object arg) { } @Override - public Visitable visit(final LocalRecordDeclarationStmt n, final Object arg) { + public Visitable visit(final LocalRecordDeclarationStmt n, final Object arg) { RecordDeclaration recordDeclaration = cloneNode(n.getRecordDeclaration(), arg); Comment comment = cloneNode(n.getComment(), arg); LocalRecordDeclarationStmt r = new LocalRecordDeclarationStmt(n.getTokenRange().orElse(null), recordDeclaration); @@ -792,7 +792,7 @@ public Visitable visit(final LocalRecordDeclarationStmt n, final Object arg) { } @Override - public Visitable visit(final AssertStmt n, final Object arg) { + public Visitable visit(final AssertStmt n, final Object arg) { Expression check = cloneNode(n.getCheck(), arg); Expression message = cloneNode(n.getMessage(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -804,7 +804,7 @@ public Visitable visit(final AssertStmt n, final Object arg) { } @Override - public Visitable visit(final BlockStmt n, final Object arg) { + public Visitable visit(final BlockStmt n, final Object arg) { NodeList contracts = cloneList(n.getContracts(), arg); NodeList statements = cloneList(n.getStatements(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -816,7 +816,7 @@ public Visitable visit(final BlockStmt n, final Object arg) { } @Override - public Visitable visit(final LabeledStmt n, final Object arg) { + public Visitable visit(final LabeledStmt n, final Object arg) { SimpleName label = cloneNode(n.getLabel(), arg); Statement statement = cloneNode(n.getStatement(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -828,7 +828,7 @@ public Visitable visit(final LabeledStmt n, final Object arg) { } @Override - public Visitable visit(final EmptyStmt n, final Object arg) { + public Visitable visit(final EmptyStmt n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); EmptyStmt r = new EmptyStmt(n.getTokenRange().orElse(null)); r.setComment(comment); @@ -838,7 +838,7 @@ public Visitable visit(final EmptyStmt n, final Object arg) { } @Override - public Visitable visit(final ExpressionStmt n, final Object arg) { + public Visitable visit(final ExpressionStmt n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); ExpressionStmt r = new ExpressionStmt(n.getTokenRange().orElse(null), expression); @@ -849,7 +849,7 @@ public Visitable visit(final ExpressionStmt n, final Object arg) { } @Override - public Visitable visit(final SwitchStmt n, final Object arg) { + public Visitable visit(final SwitchStmt n, final Object arg) { NodeList entries = cloneList(n.getEntries(), arg); Expression selector = cloneNode(n.getSelector(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -861,7 +861,7 @@ public Visitable visit(final SwitchStmt n, final Object arg) { } @Override - public Visitable visit(final SwitchEntry n, final Object arg) { + public Visitable visit(final SwitchEntry n, final Object arg) { Expression guard = cloneNode(n.getGuard(), arg); NodeList labels = cloneList(n.getLabels(), arg); NodeList statements = cloneList(n.getStatements(), arg); @@ -874,7 +874,7 @@ public Visitable visit(final SwitchEntry n, final Object arg) { } @Override - public Visitable visit(final BreakStmt n, final Object arg) { + public Visitable visit(final BreakStmt n, final Object arg) { SimpleName label = cloneNode(n.getLabel(), arg); Comment comment = cloneNode(n.getComment(), arg); BreakStmt r = new BreakStmt(n.getTokenRange().orElse(null), label); @@ -885,7 +885,7 @@ public Visitable visit(final BreakStmt n, final Object arg) { } @Override - public Visitable visit(final ReturnStmt n, final Object arg) { + public Visitable visit(final ReturnStmt n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); ReturnStmt r = new ReturnStmt(n.getTokenRange().orElse(null), expression); @@ -896,7 +896,7 @@ public Visitable visit(final ReturnStmt n, final Object arg) { } @Override - public Visitable visit(final IfStmt n, final Object arg) { + public Visitable visit(final IfStmt n, final Object arg) { Expression condition = cloneNode(n.getCondition(), arg); Statement elseStmt = cloneNode(n.getElseStmt(), arg); Statement thenStmt = cloneNode(n.getThenStmt(), arg); @@ -909,7 +909,7 @@ public Visitable visit(final IfStmt n, final Object arg) { } @Override - public Visitable visit(final WhileStmt n, final Object arg) { + public Visitable visit(final WhileStmt n, final Object arg) { Statement body = cloneNode(n.getBody(), arg); Expression condition = cloneNode(n.getCondition(), arg); NodeList contracts = cloneList(n.getContracts(), arg); @@ -922,7 +922,7 @@ public Visitable visit(final WhileStmt n, final Object arg) { } @Override - public Visitable visit(final ContinueStmt n, final Object arg) { + public Visitable visit(final ContinueStmt n, final Object arg) { SimpleName label = cloneNode(n.getLabel(), arg); Comment comment = cloneNode(n.getComment(), arg); ContinueStmt r = new ContinueStmt(n.getTokenRange().orElse(null), label); @@ -933,7 +933,7 @@ public Visitable visit(final ContinueStmt n, final Object arg) { } @Override - public Visitable visit(final DoStmt n, final Object arg) { + public Visitable visit(final DoStmt n, final Object arg) { Statement body = cloneNode(n.getBody(), arg); Expression condition = cloneNode(n.getCondition(), arg); NodeList contracts = cloneList(n.getContracts(), arg); @@ -946,7 +946,7 @@ public Visitable visit(final DoStmt n, final Object arg) { } @Override - public Visitable visit(final ForEachStmt n, final Object arg) { + public Visitable visit(final ForEachStmt n, final Object arg) { Statement body = cloneNode(n.getBody(), arg); NodeList contracts = cloneList(n.getContracts(), arg); Expression iterable = cloneNode(n.getIterable(), arg); @@ -960,7 +960,7 @@ public Visitable visit(final ForEachStmt n, final Object arg) { } @Override - public Visitable visit(final ForStmt n, final Object arg) { + public Visitable visit(final ForStmt n, final Object arg) { Statement body = cloneNode(n.getBody(), arg); Expression compare = cloneNode(n.getCompare(), arg); NodeList contracts = cloneList(n.getContracts(), arg); @@ -975,7 +975,7 @@ public Visitable visit(final ForStmt n, final Object arg) { } @Override - public Visitable visit(final ThrowStmt n, final Object arg) { + public Visitable visit(final ThrowStmt n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); ThrowStmt r = new ThrowStmt(n.getTokenRange().orElse(null), expression); @@ -986,7 +986,7 @@ public Visitable visit(final ThrowStmt n, final Object arg) { } @Override - public Visitable visit(final SynchronizedStmt n, final Object arg) { + public Visitable visit(final SynchronizedStmt n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -998,7 +998,7 @@ public Visitable visit(final SynchronizedStmt n, final Object arg) { } @Override - public Visitable visit(final TryStmt n, final Object arg) { + public Visitable visit(final TryStmt n, final Object arg) { NodeList catchClauses = cloneList(n.getCatchClauses(), arg); BlockStmt finallyBlock = cloneNode(n.getFinallyBlock(), arg); NodeList resources = cloneList(n.getResources(), arg); @@ -1012,7 +1012,7 @@ public Visitable visit(final TryStmt n, final Object arg) { } @Override - public Visitable visit(final CatchClause n, final Object arg) { + public Visitable visit(final CatchClause n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); Parameter parameter = cloneNode(n.getParameter(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1024,7 +1024,7 @@ public Visitable visit(final CatchClause n, final Object arg) { } @Override - public Visitable visit(final LambdaExpr n, final Object arg) { + public Visitable visit(final LambdaExpr n, final Object arg) { Statement body = cloneNode(n.getBody(), arg); NodeList contracts = cloneList(n.getContracts(), arg); NodeList parameters = cloneList(n.getParameters(), arg); @@ -1037,7 +1037,7 @@ public Visitable visit(final LambdaExpr n, final Object arg) { } @Override - public Visitable visit(final MethodReferenceExpr n, final Object arg) { + public Visitable visit(final MethodReferenceExpr n, final Object arg) { Expression scope = cloneNode(n.getScope(), arg); NodeList typeArguments = cloneList(n.getTypeArguments().orElse(null), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1049,7 +1049,7 @@ public Visitable visit(final MethodReferenceExpr n, final Object arg) { } @Override - public Visitable visit(final TypeExpr n, final Object arg) { + public Visitable visit(final TypeExpr n, final Object arg) { Type type = cloneNode(n.getType(), arg); Comment comment = cloneNode(n.getComment(), arg); TypeExpr r = new TypeExpr(n.getTokenRange().orElse(null), type); @@ -1060,7 +1060,7 @@ public Visitable visit(final TypeExpr n, final Object arg) { } @Override - public Visitable visit(NodeList n, Object arg) { + public Visitable visit(NodeList n, Object arg) { NodeList newNodes = new NodeList<>(); for (Object node : n) { Node resultNode = (Node) ((Node) node).accept(this, arg); @@ -1072,7 +1072,7 @@ public Visitable visit(NodeList n, Object arg) { } @Override - public Node visit(final ImportDeclaration n, final Object arg) { + public Node visit(final ImportDeclaration n, final Object arg) { Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); ImportDeclaration r = new ImportDeclaration(n.getTokenRange().orElse(null), name, n.isStatic(), n.isAsterisk(), n.isJmlModel()); @@ -1083,7 +1083,7 @@ public Node visit(final ImportDeclaration n, final Object arg) { } @Override - public Visitable visit(final ModuleDeclaration n, final Object arg) { + public Visitable visit(final ModuleDeclaration n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); NodeList directives = cloneList(n.getDirectives(), arg); Name name = cloneNode(n.getName(), arg); @@ -1096,7 +1096,7 @@ public Visitable visit(final ModuleDeclaration n, final Object arg) { } @Override - public Visitable visit(final ModuleRequiresDirective n, final Object arg) { + public Visitable visit(final ModuleRequiresDirective n, final Object arg) { NodeList modifiers = cloneList(n.getModifiers(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1139,7 +1139,7 @@ private NodeList cloneList(NodeList list, Object arg) { } @Override - public Visitable visit(final ModuleExportsDirective n, final Object arg) { + public Visitable visit(final ModuleExportsDirective n, final Object arg) { NodeList moduleNames = cloneList(n.getModuleNames(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1151,7 +1151,7 @@ public Visitable visit(final ModuleExportsDirective n, final Object arg) { } @Override - public Visitable visit(final ModuleProvidesDirective n, final Object arg) { + public Visitable visit(final ModuleProvidesDirective n, final Object arg) { Name name = cloneNode(n.getName(), arg); NodeList with = cloneList(n.getWith(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1163,7 +1163,7 @@ public Visitable visit(final ModuleProvidesDirective n, final Object arg) { } @Override - public Visitable visit(final ModuleUsesDirective n, final Object arg) { + public Visitable visit(final ModuleUsesDirective n, final Object arg) { Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); ModuleUsesDirective r = new ModuleUsesDirective(n.getTokenRange().orElse(null), name); @@ -1174,7 +1174,7 @@ public Visitable visit(final ModuleUsesDirective n, final Object arg) { } @Override - public Visitable visit(final ModuleOpensDirective n, final Object arg) { + public Visitable visit(final ModuleOpensDirective n, final Object arg) { NodeList moduleNames = cloneList(n.getModuleNames(), arg); Name name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1186,7 +1186,7 @@ public Visitable visit(final ModuleOpensDirective n, final Object arg) { } @Override - public Visitable visit(final UnparsableStmt n, final Object arg) { + public Visitable visit(final UnparsableStmt n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); UnparsableStmt r = new UnparsableStmt(n.getTokenRange().orElse(null)); r.setComment(comment); @@ -1196,7 +1196,7 @@ public Visitable visit(final UnparsableStmt n, final Object arg) { } @Override - public Visitable visit(final ReceiverParameter n, final Object arg) { + public Visitable visit(final ReceiverParameter n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Name name = cloneNode(n.getName(), arg); Type type = cloneNode(n.getType(), arg); @@ -1209,7 +1209,7 @@ public Visitable visit(final ReceiverParameter n, final Object arg) { } @Override - public Visitable visit(final VarType n, final Object arg) { + public Visitable visit(final VarType n, final Object arg) { NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); VarType r = new VarType(n.getTokenRange().orElse(null)); @@ -1220,7 +1220,7 @@ public Visitable visit(final VarType n, final Object arg) { } @Override - public Visitable visit(final Modifier n, final Object arg) { + public Visitable visit(final Modifier n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); Modifier r = new Modifier(n.getTokenRange().orElse(null), n.getKeyword()); r.setComment(comment); @@ -1230,7 +1230,7 @@ public Visitable visit(final Modifier n, final Object arg) { } @Override - public Visitable visit(final SwitchExpr n, final Object arg) { + public Visitable visit(final SwitchExpr n, final Object arg) { NodeList entries = cloneList(n.getEntries(), arg); Expression selector = cloneNode(n.getSelector(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1248,7 +1248,7 @@ private void copyData(Node source, Node destination) { } @Override - public Visitable visit(final YieldStmt n, final Object arg) { + public Visitable visit(final YieldStmt n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Comment comment = cloneNode(n.getComment(), arg); YieldStmt r = new YieldStmt(n.getTokenRange().orElse(null), expression); @@ -1259,7 +1259,7 @@ public Visitable visit(final YieldStmt n, final Object arg) { } @Override - public Visitable visit(final TextBlockLiteralExpr n, final Object arg) { + public Visitable visit(final TextBlockLiteralExpr n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); TextBlockLiteralExpr r = new TextBlockLiteralExpr(n.getTokenRange().orElse(null), n.getValue()); r.setComment(comment); @@ -1269,7 +1269,7 @@ public Visitable visit(final TextBlockLiteralExpr n, final Object arg) { } @Override - public Visitable visit(final TypePatternExpr n, final Object arg) { + public Visitable visit(final TypePatternExpr n, final Object arg) { NodeList modifiers = cloneList(n.getModifiers(), arg); SimpleName name = cloneNode(n.getName(), arg); Type type = cloneNode(n.getType(), arg); @@ -1282,7 +1282,7 @@ public Visitable visit(final TypePatternExpr n, final Object arg) { } @Override - public Visitable visit(final JmlQuantifiedExpr n, final Object arg) { + public Visitable visit(final JmlQuantifiedExpr n, final Object arg) { NodeList expressions = cloneList(n.getExpressions(), arg); NodeList variables = cloneList(n.getVariables(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1294,7 +1294,7 @@ public Visitable visit(final JmlQuantifiedExpr n, final Object arg) { } @Override - public Visitable visit(final JmlClauseLabel n, final Object arg) { + public Visitable visit(final JmlClauseLabel n, final Object arg) { Expression expr = cloneNode(n.getExpr(), arg); SimpleName label = cloneNode(n.getLabel(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1307,7 +1307,7 @@ public Visitable visit(final JmlClauseLabel n, final Object arg) { } @Override - public Visitable visit(final JmlExpressionStmt n, final Object arg) { + public Visitable visit(final JmlExpressionStmt n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1319,7 +1319,7 @@ public Visitable visit(final JmlExpressionStmt n, final Object arg) { } @Override - public Visitable visit(final JmlLabelExpr n, final Object arg) { + public Visitable visit(final JmlLabelExpr n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); SimpleName label = cloneNode(n.getLabel(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1331,7 +1331,7 @@ public Visitable visit(final JmlLabelExpr n, final Object arg) { } @Override - public Visitable visit(final JmlLetExpr n, final Object arg) { + public Visitable visit(final JmlLetExpr n, final Object arg) { Expression body = cloneNode(n.getBody(), arg); VariableDeclarationExpr variables = cloneNode(n.getVariables(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1343,7 +1343,7 @@ public Visitable visit(final JmlLetExpr n, final Object arg) { } @Override - public Visitable visit(final JmlMultiCompareExpr n, final Object arg) { + public Visitable visit(final JmlMultiCompareExpr n, final Object arg) { NodeList expressions = cloneList(n.getExpressions(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlMultiCompareExpr r = new JmlMultiCompareExpr(n.getTokenRange().orElse(null), expressions, n.getOperators()); @@ -1354,7 +1354,7 @@ public Visitable visit(final JmlMultiCompareExpr n, final Object arg) { } @Override - public Visitable visit(final JmlSimpleExprClause n, final Object arg) { + public Visitable visit(final JmlSimpleExprClause n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); NodeList heaps = cloneList(n.getHeaps().orElse(null), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1367,7 +1367,7 @@ public Visitable visit(final JmlSimpleExprClause n, final Object arg) { } @Override - public Visitable visit(final JmlSignalsClause n, final Object arg) { + public Visitable visit(final JmlSignalsClause n, final Object arg) { Expression expression = cloneNode(n.getExpression(), arg); Parameter parameter = cloneNode(n.getParameter(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1380,7 +1380,7 @@ public Visitable visit(final JmlSignalsClause n, final Object arg) { } @Override - public Visitable visit(final JmlSignalsOnlyClause n, final Object arg) { + public Visitable visit(final JmlSignalsOnlyClause n, final Object arg) { NodeList types = cloneList(n.getTypes(), arg); SimpleName name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1392,7 +1392,7 @@ public Visitable visit(final JmlSignalsOnlyClause n, final Object arg) { } @Override - public Visitable visit(final JmlUnreachableStmt n, final Object arg) { + public Visitable visit(final JmlUnreachableStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlUnreachableStmt r = new JmlUnreachableStmt(n.getTokenRange().orElse(null), jmlTags); @@ -1403,7 +1403,7 @@ public Visitable visit(final JmlUnreachableStmt n, final Object arg) { } @Override - public Visitable visit(final JmlCallableClause n, final Object arg) { + public Visitable visit(final JmlCallableClause n, final Object arg) { NodeList methodSignatures = cloneList(n.getMethodSignatures(), arg); SimpleName name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1415,7 +1415,7 @@ public Visitable visit(final JmlCallableClause n, final Object arg) { } @Override - public Visitable visit(final JmlForallClause n, final Object arg) { + public Visitable visit(final JmlForallClause n, final Object arg) { NodeList boundedVariables = cloneList(n.getBoundedVariables(), arg); SimpleName name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1427,7 +1427,7 @@ public Visitable visit(final JmlForallClause n, final Object arg) { } @Override - public Visitable visit(final JmlRefiningStmt n, final Object arg) { + public Visitable visit(final JmlRefiningStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlRefiningStmt r = new JmlRefiningStmt(n.getTokenRange().orElse(null), jmlTags); @@ -1438,7 +1438,7 @@ public Visitable visit(final JmlRefiningStmt n, final Object arg) { } @Override - public Visitable visit(final JmlClauseIf n, final Object arg) { + public Visitable visit(final JmlClauseIf n, final Object arg) { Expression condition = cloneNode(n.getCondition(), arg); Expression then = cloneNode(n.getThen(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1451,7 +1451,7 @@ public Visitable visit(final JmlClauseIf n, final Object arg) { } @Override - public Visitable visit(final JmlClassExprDeclaration n, final Object arg) { + public Visitable visit(final JmlClassExprDeclaration n, final Object arg) { Expression invariant = cloneNode(n.getInvariant(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); SimpleName kind = cloneNode(n.getKind(), arg); @@ -1467,7 +1467,7 @@ public Visitable visit(final JmlClassExprDeclaration n, final Object arg) { } @Override - public Visitable visit(final JmlClassAccessibleDeclaration n, final Object arg) { + public Visitable visit(final JmlClassAccessibleDeclaration n, final Object arg) { NodeList expressions = cloneList(n.getExpressions(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); Expression measuredBy = cloneNode(n.getMeasuredBy(), arg); @@ -1483,7 +1483,7 @@ public Visitable visit(final JmlClassAccessibleDeclaration n, final Object arg) } @Override - public Visitable visit(final JmlRepresentsDeclaration n, final Object arg) { + public Visitable visit(final JmlRepresentsDeclaration n, final Object arg) { Expression expr = cloneNode(n.getExpr(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); @@ -1498,7 +1498,7 @@ public Visitable visit(final JmlRepresentsDeclaration n, final Object arg) { } @Override - public Visitable visit(final JmlContract n, final Object arg) { + public Visitable visit(final JmlContract n, final Object arg) { NodeList clauses = cloneList(n.getClauses(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); @@ -1513,7 +1513,7 @@ public Visitable visit(final JmlContract n, final Object arg) { } @Override - public Visitable visit(final JmlSetComprehensionExpr n, final Object arg) { + public Visitable visit(final JmlSetComprehensionExpr n, final Object arg) { VariableDeclarator binding = cloneNode(n.getBinding(), arg); Expression predicate = cloneNode(n.getPredicate(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1525,7 +1525,7 @@ public Visitable visit(final JmlSetComprehensionExpr n, final Object arg) { } @Override - public Visitable visit(final JmlGhostStmt n, final Object arg) { + public Visitable visit(final JmlGhostStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); Statement statement = cloneNode(n.getStatement(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1537,7 +1537,7 @@ public Visitable visit(final JmlGhostStmt n, final Object arg) { } @Override - public Visitable visit(final RecordDeclaration n, final Object arg) { + public Visitable visit(final RecordDeclaration n, final Object arg) { NodeList implementedTypes = cloneList(n.getImplementedTypes(), arg); NodeList parameters = cloneList(n.getParameters(), arg); ReceiverParameter receiverParameter = cloneNode(n.getReceiverParameter(), arg); @@ -1555,7 +1555,7 @@ public Visitable visit(final RecordDeclaration n, final Object arg) { } @Override - public Visitable visit(final CompactConstructorDeclaration n, final Object arg) { + public Visitable visit(final CompactConstructorDeclaration n, final Object arg) { BlockStmt body = cloneNode(n.getBody(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1571,7 +1571,7 @@ public Visitable visit(final CompactConstructorDeclaration n, final Object arg) } @Override - public Visitable visit(final RecordPatternExpr n, final Object arg) { + public Visitable visit(final RecordPatternExpr n, final Object arg) { NodeList modifiers = cloneList(n.getModifiers(), arg); NodeList patternList = cloneList(n.getPatternList(), arg); Type type = cloneNode(n.getType(), arg); @@ -1584,7 +1584,7 @@ public Visitable visit(final RecordPatternExpr n, final Object arg) { } @Override - public Visitable visit(final JmlMethodDeclaration n, final Object arg) { + public Visitable visit(final JmlMethodDeclaration n, final Object arg) { JmlContract contract = cloneNode(n.getContract(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); MethodDeclaration methodDeclaration = cloneNode(n.getMethodDeclaration(), arg); @@ -1598,7 +1598,7 @@ public Visitable visit(final JmlMethodDeclaration n, final Object arg) { } @Override - public Visitable visit(final JmlBinaryInfixExpr n, final Object arg) { + public Visitable visit(final JmlBinaryInfixExpr n, final Object arg) { Expression left = cloneNode(n.getLeft(), arg); SimpleName operator = cloneNode(n.getOperator(), arg); Expression right = cloneNode(n.getRight(), arg); @@ -1611,7 +1611,7 @@ public Visitable visit(final JmlBinaryInfixExpr n, final Object arg) { } @Override - public Visitable visit(final JmlDocDeclaration n, final Object arg) { + public Visitable visit(final JmlDocDeclaration n, final Object arg) { NodeList jmlComments = cloneList(n.getJmlComments(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1623,7 +1623,7 @@ public Visitable visit(final JmlDocDeclaration n, final Object arg) { } @Override - public Visitable visit(final JmlDocStmt n, final Object arg) { + public Visitable visit(final JmlDocStmt n, final Object arg) { NodeList jmlComments = cloneList(n.getJmlComments(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlDocStmt r = new JmlDocStmt(n.getTokenRange().orElse(null), jmlComments); @@ -1634,7 +1634,7 @@ public Visitable visit(final JmlDocStmt n, final Object arg) { } @Override - public Visitable visit(final JmlDoc n, final Object arg) { + public Visitable visit(final JmlDoc n, final Object arg) { Comment comment = cloneNode(n.getComment(), arg); JmlDoc r = new JmlDoc(n.getTokenRange().orElse(null), n.getContent()); r.setComment(comment); @@ -1644,7 +1644,7 @@ public Visitable visit(final JmlDoc n, final Object arg) { } @Override - public Visitable visit(final JmlDocType n, final Object arg) { + public Visitable visit(final JmlDocType n, final Object arg) { NodeList jmlComments = cloneList(n.getJmlComments(), arg); NodeList> members = cloneList(n.getMembers(), arg); NodeList modifiers = cloneList(n.getModifiers(), arg); @@ -1659,7 +1659,7 @@ public Visitable visit(final JmlDocType n, final Object arg) { } @Override - public Visitable visit(final JmlFieldDeclaration n, final Object arg) { + public Visitable visit(final JmlFieldDeclaration n, final Object arg) { FieldDeclaration decl = cloneNode(n.getDecl(), arg); NodeList jmlTags = cloneList(n.getJmlTags(), arg); NodeList annotations = cloneList(n.getAnnotations(), arg); @@ -1672,7 +1672,7 @@ public Visitable visit(final JmlFieldDeclaration n, final Object arg) { } @Override - public Visitable visit(final JmlOldClause n, final Object arg) { + public Visitable visit(final JmlOldClause n, final Object arg) { VariableDeclarationExpr declarations = cloneNode(n.getDeclarations(), arg); SimpleName name = cloneNode(n.getName(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1684,7 +1684,7 @@ public Visitable visit(final JmlOldClause n, final Object arg) { } @Override - public Visitable visit(final JmlTypeExpr n, final Object arg) { + public Visitable visit(final JmlTypeExpr n, final Object arg) { Type type = cloneNode(n.getType(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlTypeExpr r = new JmlTypeExpr(n.getTokenRange().orElse(null), type); @@ -1695,7 +1695,7 @@ public Visitable visit(final JmlTypeExpr n, final Object arg) { } @Override - public Visitable visit(final JmlMultiExprClause n, final Object arg) { + public Visitable visit(final JmlMultiExprClause n, final Object arg) { NodeList expressions = cloneList(n.getExpressions(), arg); NodeList heaps = cloneList(n.getHeaps().orElse(null), arg); SimpleName name = cloneNode(n.getName(), arg); @@ -1708,7 +1708,7 @@ public Visitable visit(final JmlMultiExprClause n, final Object arg) { } @Override - public Visitable visit(final JmlBeginStmt n, final Object arg) { + public Visitable visit(final JmlBeginStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlBeginStmt r = new JmlBeginStmt(n.getTokenRange().orElse(null), jmlTags); @@ -1719,7 +1719,7 @@ public Visitable visit(final JmlBeginStmt n, final Object arg) { } @Override - public Visitable visit(final JmlEndStmt n, final Object arg) { + public Visitable visit(final JmlEndStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); Comment comment = cloneNode(n.getComment(), arg); JmlEndStmt r = new JmlEndStmt(n.getTokenRange().orElse(null), jmlTags); @@ -1730,7 +1730,7 @@ public Visitable visit(final JmlEndStmt n, final Object arg) { } @Override - public Visitable visit(final JmlLabelStmt n, final Object arg) { + public Visitable visit(final JmlLabelStmt n, final Object arg) { NodeList jmlTags = cloneList(n.getJmlTags(), arg); SimpleName label = cloneNode(n.getLabel(), arg); Comment comment = cloneNode(n.getComment(), arg); @@ -1742,7 +1742,7 @@ public Visitable visit(final JmlLabelStmt n, final Object arg) { } @Override - public Visitable visit(final JmlMethodSignature n, final Object arg) { + public Visitable visit(final JmlMethodSignature n, final Object arg) { NodeList argumentTypes = cloneList(n.getArgumentTypes(), arg); SimpleName name = cloneNode(n.getName(), arg); Type receiver = cloneNode(n.getReceiver(), arg); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java index 54b63d5119..6347403629 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/EqualsVisitor.java @@ -42,7 +42,7 @@ * * @author Julio Vilmar Gesser */ -public class EqualsVisitor implements GenericVisitor { +public class EqualsVisitor implements GenericVisitor { private static final EqualsVisitor SINGLETON = new EqualsVisitor(); @@ -136,7 +136,7 @@ private boolean objEquals(final Object n, final Object n2) { } @Override - public Boolean visit(final CompilationUnit n, final Visitable arg) { + public Boolean visit(final CompilationUnit n, final Visitable arg) { final CompilationUnit n2 = (CompilationUnit) arg; if (!nodesEquals(n.getImports(), n2.getImports())) return false; @@ -152,7 +152,7 @@ public Boolean visit(final CompilationUnit n, final Visitable arg) { } @Override - public Boolean visit(final PackageDeclaration n, final Visitable arg) { + public Boolean visit(final PackageDeclaration n, final Visitable arg) { final PackageDeclaration n2 = (PackageDeclaration) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -164,7 +164,7 @@ public Boolean visit(final PackageDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final TypeParameter n, final Visitable arg) { + public Boolean visit(final TypeParameter n, final Visitable arg) { final TypeParameter n2 = (TypeParameter) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -178,7 +178,7 @@ public Boolean visit(final TypeParameter n, final Visitable arg) { } @Override - public Boolean visit(final LineComment n, final Visitable arg) { + public Boolean visit(final LineComment n, final Visitable arg) { final LineComment n2 = (LineComment) arg; if (!objEquals(n.getContent(), n2.getContent())) return false; @@ -188,7 +188,7 @@ public Boolean visit(final LineComment n, final Visitable arg) { } @Override - public Boolean visit(final BlockComment n, final Visitable arg) { + public Boolean visit(final BlockComment n, final Visitable arg) { final BlockComment n2 = (BlockComment) arg; if (!objEquals(n.getContent(), n2.getContent())) return false; @@ -198,7 +198,7 @@ public Boolean visit(final BlockComment n, final Visitable arg) { } @Override - public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; if (!nodesEquals(n.getExtendedTypes(), n2.getExtendedTypes())) return false; @@ -224,7 +224,7 @@ public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) } @Override - public Boolean visit(final EnumDeclaration n, final Visitable arg) { + public Boolean visit(final EnumDeclaration n, final Visitable arg) { final EnumDeclaration n2 = (EnumDeclaration) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -244,7 +244,7 @@ public Boolean visit(final EnumDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { + public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -260,7 +260,7 @@ public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; if (!nodesEquals(n.getMembers(), n2.getMembers())) return false; @@ -276,7 +276,7 @@ public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; if (!nodeEquals(n.getDefaultValue(), n2.getDefaultValue())) return false; @@ -294,7 +294,7 @@ public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) } @Override - public Boolean visit(final FieldDeclaration n, final Visitable arg) { + public Boolean visit(final FieldDeclaration n, final Visitable arg) { final FieldDeclaration n2 = (FieldDeclaration) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -308,7 +308,7 @@ public Boolean visit(final FieldDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final VariableDeclarator n, final Visitable arg) { + public Boolean visit(final VariableDeclarator n, final Visitable arg) { final VariableDeclarator n2 = (VariableDeclarator) arg; if (!nodeEquals(n.getInitializer(), n2.getInitializer())) return false; @@ -322,7 +322,7 @@ public Boolean visit(final VariableDeclarator n, final Visitable arg) { } @Override - public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -348,7 +348,7 @@ public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final MethodDeclaration n, final Visitable arg) { + public Boolean visit(final MethodDeclaration n, final Visitable arg) { final MethodDeclaration n2 = (MethodDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -376,7 +376,7 @@ public Boolean visit(final MethodDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final Parameter n, final Visitable arg) { + public Boolean visit(final Parameter n, final Visitable arg) { final Parameter n2 = (Parameter) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -396,7 +396,7 @@ public Boolean visit(final Parameter n, final Visitable arg) { } @Override - public Boolean visit(final InitializerDeclaration n, final Visitable arg) { + public Boolean visit(final InitializerDeclaration n, final Visitable arg) { final InitializerDeclaration n2 = (InitializerDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -410,7 +410,7 @@ public Boolean visit(final InitializerDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JavadocComment n, final Visitable arg) { + public Boolean visit(final JavadocComment n, final Visitable arg) { final JavadocComment n2 = (JavadocComment) arg; if (!objEquals(n.getContent(), n2.getContent())) return false; @@ -420,7 +420,7 @@ public Boolean visit(final JavadocComment n, final Visitable arg) { } @Override - public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -436,7 +436,7 @@ public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { } @Override - public Boolean visit(final PrimitiveType n, final Visitable arg) { + public Boolean visit(final PrimitiveType n, final Visitable arg) { final PrimitiveType n2 = (PrimitiveType) arg; if (!objEquals(n.getType(), n2.getType())) return false; @@ -448,7 +448,7 @@ public Boolean visit(final PrimitiveType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayType n, final Visitable arg) { + public Boolean visit(final ArrayType n, final Visitable arg) { final ArrayType n2 = (ArrayType) arg; if (!nodeEquals(n.getComponentType(), n2.getComponentType())) return false; @@ -462,7 +462,7 @@ public Boolean visit(final ArrayType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { + public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { final ArrayCreationLevel n2 = (ArrayCreationLevel) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -474,7 +474,7 @@ public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { } @Override - public Boolean visit(final IntersectionType n, final Visitable arg) { + public Boolean visit(final IntersectionType n, final Visitable arg) { final IntersectionType n2 = (IntersectionType) arg; if (!nodesEquals(n.getElements(), n2.getElements())) return false; @@ -486,7 +486,7 @@ public Boolean visit(final IntersectionType n, final Visitable arg) { } @Override - public Boolean visit(final UnionType n, final Visitable arg) { + public Boolean visit(final UnionType n, final Visitable arg) { final UnionType n2 = (UnionType) arg; if (!nodesEquals(n.getElements(), n2.getElements())) return false; @@ -498,7 +498,7 @@ public Boolean visit(final UnionType n, final Visitable arg) { } @Override - public Boolean visit(final VoidType n, final Visitable arg) { + public Boolean visit(final VoidType n, final Visitable arg) { final VoidType n2 = (VoidType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -508,7 +508,7 @@ public Boolean visit(final VoidType n, final Visitable arg) { } @Override - public Boolean visit(final WildcardType n, final Visitable arg) { + public Boolean visit(final WildcardType n, final Visitable arg) { final WildcardType n2 = (WildcardType) arg; if (!nodeEquals(n.getExtendedType(), n2.getExtendedType())) return false; @@ -522,7 +522,7 @@ public Boolean visit(final WildcardType n, final Visitable arg) { } @Override - public Boolean visit(final UnknownType n, final Visitable arg) { + public Boolean visit(final UnknownType n, final Visitable arg) { final UnknownType n2 = (UnknownType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -532,7 +532,7 @@ public Boolean visit(final UnknownType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { + public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; if (!nodeEquals(n.getIndex(), n2.getIndex())) return false; @@ -544,7 +544,7 @@ public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { } @Override - public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { + public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; if (!nodeEquals(n.getElementType(), n2.getElementType())) return false; @@ -558,7 +558,7 @@ public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { } @Override - public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { + public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; if (!nodesEquals(n.getValues(), n2.getValues())) return false; @@ -568,7 +568,7 @@ public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { } @Override - public Boolean visit(final AssignExpr n, final Visitable arg) { + public Boolean visit(final AssignExpr n, final Visitable arg) { final AssignExpr n2 = (AssignExpr) arg; if (!objEquals(n.getOperator(), n2.getOperator())) return false; @@ -582,7 +582,7 @@ public Boolean visit(final AssignExpr n, final Visitable arg) { } @Override - public Boolean visit(final BinaryExpr n, final Visitable arg) { + public Boolean visit(final BinaryExpr n, final Visitable arg) { final BinaryExpr n2 = (BinaryExpr) arg; if (!nodeEquals(n.getLeft(), n2.getLeft())) return false; @@ -596,7 +596,7 @@ public Boolean visit(final BinaryExpr n, final Visitable arg) { } @Override - public Boolean visit(final CastExpr n, final Visitable arg) { + public Boolean visit(final CastExpr n, final Visitable arg) { final CastExpr n2 = (CastExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -608,7 +608,7 @@ public Boolean visit(final CastExpr n, final Visitable arg) { } @Override - public Boolean visit(final ClassExpr n, final Visitable arg) { + public Boolean visit(final ClassExpr n, final Visitable arg) { final ClassExpr n2 = (ClassExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -618,7 +618,7 @@ public Boolean visit(final ClassExpr n, final Visitable arg) { } @Override - public Boolean visit(final ConditionalExpr n, final Visitable arg) { + public Boolean visit(final ConditionalExpr n, final Visitable arg) { final ConditionalExpr n2 = (ConditionalExpr) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -632,7 +632,7 @@ public Boolean visit(final ConditionalExpr n, final Visitable arg) { } @Override - public Boolean visit(final EnclosedExpr n, final Visitable arg) { + public Boolean visit(final EnclosedExpr n, final Visitable arg) { final EnclosedExpr n2 = (EnclosedExpr) arg; if (!nodeEquals(n.getInner(), n2.getInner())) return false; @@ -642,7 +642,7 @@ public Boolean visit(final EnclosedExpr n, final Visitable arg) { } @Override - public Boolean visit(final FieldAccessExpr n, final Visitable arg) { + public Boolean visit(final FieldAccessExpr n, final Visitable arg) { final FieldAccessExpr n2 = (FieldAccessExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -656,7 +656,7 @@ public Boolean visit(final FieldAccessExpr n, final Visitable arg) { } @Override - public Boolean visit(final InstanceOfExpr n, final Visitable arg) { + public Boolean visit(final InstanceOfExpr n, final Visitable arg) { final InstanceOfExpr n2 = (InstanceOfExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -670,7 +670,7 @@ public Boolean visit(final InstanceOfExpr n, final Visitable arg) { } @Override - public Boolean visit(final StringLiteralExpr n, final Visitable arg) { + public Boolean visit(final StringLiteralExpr n, final Visitable arg) { final StringLiteralExpr n2 = (StringLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -680,7 +680,7 @@ public Boolean visit(final StringLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { + public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -690,7 +690,7 @@ public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final LongLiteralExpr n, final Visitable arg) { + public Boolean visit(final LongLiteralExpr n, final Visitable arg) { final LongLiteralExpr n2 = (LongLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -700,7 +700,7 @@ public Boolean visit(final LongLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final CharLiteralExpr n, final Visitable arg) { + public Boolean visit(final CharLiteralExpr n, final Visitable arg) { final CharLiteralExpr n2 = (CharLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -710,7 +710,7 @@ public Boolean visit(final CharLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { + public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -720,7 +720,7 @@ public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { + public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; if (!objEquals(n.isValue(), n2.isValue())) return false; @@ -730,7 +730,7 @@ public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final NullLiteralExpr n, final Visitable arg) { + public Boolean visit(final NullLiteralExpr n, final Visitable arg) { final NullLiteralExpr n2 = (NullLiteralExpr) arg; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -738,7 +738,7 @@ public Boolean visit(final NullLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final MethodCallExpr n, final Visitable arg) { + public Boolean visit(final MethodCallExpr n, final Visitable arg) { final MethodCallExpr n2 = (MethodCallExpr) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -754,7 +754,7 @@ public Boolean visit(final MethodCallExpr n, final Visitable arg) { } @Override - public Boolean visit(final NameExpr n, final Visitable arg) { + public Boolean visit(final NameExpr n, final Visitable arg) { final NameExpr n2 = (NameExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -764,7 +764,7 @@ public Boolean visit(final NameExpr n, final Visitable arg) { } @Override - public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { + public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; if (!nodesEquals(n.getAnonymousClassBody(), n2.getAnonymousClassBody())) return false; @@ -782,7 +782,7 @@ public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { } @Override - public Boolean visit(final Name n, final Visitable arg) { + public Boolean visit(final Name n, final Visitable arg) { final Name n2 = (Name) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -794,7 +794,7 @@ public Boolean visit(final Name n, final Visitable arg) { } @Override - public Boolean visit(final SimpleName n, final Visitable arg) { + public Boolean visit(final SimpleName n, final Visitable arg) { final SimpleName n2 = (SimpleName) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -804,7 +804,7 @@ public Boolean visit(final SimpleName n, final Visitable arg) { } @Override - public Boolean visit(final ThisExpr n, final Visitable arg) { + public Boolean visit(final ThisExpr n, final Visitable arg) { final ThisExpr n2 = (ThisExpr) arg; if (!nodeEquals(n.getTypeName(), n2.getTypeName())) return false; @@ -814,7 +814,7 @@ public Boolean visit(final ThisExpr n, final Visitable arg) { } @Override - public Boolean visit(final SuperExpr n, final Visitable arg) { + public Boolean visit(final SuperExpr n, final Visitable arg) { final SuperExpr n2 = (SuperExpr) arg; if (!nodeEquals(n.getTypeName(), n2.getTypeName())) return false; @@ -824,7 +824,7 @@ public Boolean visit(final SuperExpr n, final Visitable arg) { } @Override - public Boolean visit(final UnaryExpr n, final Visitable arg) { + public Boolean visit(final UnaryExpr n, final Visitable arg) { final UnaryExpr n2 = (UnaryExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -836,7 +836,7 @@ public Boolean visit(final UnaryExpr n, final Visitable arg) { } @Override - public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { + public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -850,7 +850,7 @@ public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { } @Override - public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { + public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -860,7 +860,7 @@ public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { + public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; if (!nodeEquals(n.getMemberValue(), n2.getMemberValue())) return false; @@ -872,7 +872,7 @@ public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { + public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; if (!nodesEquals(n.getPairs(), n2.getPairs())) return false; @@ -884,7 +884,7 @@ public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final MemberValuePair n, final Visitable arg) { + public Boolean visit(final MemberValuePair n, final Visitable arg) { final MemberValuePair n2 = (MemberValuePair) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -896,7 +896,7 @@ public Boolean visit(final MemberValuePair n, final Visitable arg) { } @Override - public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { + public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -912,7 +912,7 @@ public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable } @Override - public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { final LocalClassDeclarationStmt n2 = (LocalClassDeclarationStmt) arg; if (!nodeEquals(n.getClassDeclaration(), n2.getClassDeclaration())) return false; @@ -922,7 +922,7 @@ public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { } @Override - public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { final LocalRecordDeclarationStmt n2 = (LocalRecordDeclarationStmt) arg; if (!nodeEquals(n.getRecordDeclaration(), n2.getRecordDeclaration())) return false; @@ -932,7 +932,7 @@ public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { } @Override - public Boolean visit(final AssertStmt n, final Visitable arg) { + public Boolean visit(final AssertStmt n, final Visitable arg) { final AssertStmt n2 = (AssertStmt) arg; if (!nodeEquals(n.getCheck(), n2.getCheck())) return false; @@ -944,7 +944,7 @@ public Boolean visit(final AssertStmt n, final Visitable arg) { } @Override - public Boolean visit(final BlockStmt n, final Visitable arg) { + public Boolean visit(final BlockStmt n, final Visitable arg) { final BlockStmt n2 = (BlockStmt) arg; if (!nodesEquals(n.getContracts(), n2.getContracts())) return false; @@ -956,7 +956,7 @@ public Boolean visit(final BlockStmt n, final Visitable arg) { } @Override - public Boolean visit(final LabeledStmt n, final Visitable arg) { + public Boolean visit(final LabeledStmt n, final Visitable arg) { final LabeledStmt n2 = (LabeledStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -968,7 +968,7 @@ public Boolean visit(final LabeledStmt n, final Visitable arg) { } @Override - public Boolean visit(final EmptyStmt n, final Visitable arg) { + public Boolean visit(final EmptyStmt n, final Visitable arg) { final EmptyStmt n2 = (EmptyStmt) arg; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -976,7 +976,7 @@ public Boolean visit(final EmptyStmt n, final Visitable arg) { } @Override - public Boolean visit(final ExpressionStmt n, final Visitable arg) { + public Boolean visit(final ExpressionStmt n, final Visitable arg) { final ExpressionStmt n2 = (ExpressionStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -986,7 +986,7 @@ public Boolean visit(final ExpressionStmt n, final Visitable arg) { } @Override - public Boolean visit(final SwitchStmt n, final Visitable arg) { + public Boolean visit(final SwitchStmt n, final Visitable arg) { final SwitchStmt n2 = (SwitchStmt) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -998,7 +998,7 @@ public Boolean visit(final SwitchStmt n, final Visitable arg) { } @Override - public Boolean visit(final SwitchEntry n, final Visitable arg) { + public Boolean visit(final SwitchEntry n, final Visitable arg) { final SwitchEntry n2 = (SwitchEntry) arg; if (!nodeEquals(n.getGuard(), n2.getGuard())) return false; @@ -1016,7 +1016,7 @@ public Boolean visit(final SwitchEntry n, final Visitable arg) { } @Override - public Boolean visit(final BreakStmt n, final Visitable arg) { + public Boolean visit(final BreakStmt n, final Visitable arg) { final BreakStmt n2 = (BreakStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -1026,7 +1026,7 @@ public Boolean visit(final BreakStmt n, final Visitable arg) { } @Override - public Boolean visit(final ReturnStmt n, final Visitable arg) { + public Boolean visit(final ReturnStmt n, final Visitable arg) { final ReturnStmt n2 = (ReturnStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1036,7 +1036,7 @@ public Boolean visit(final ReturnStmt n, final Visitable arg) { } @Override - public Boolean visit(final IfStmt n, final Visitable arg) { + public Boolean visit(final IfStmt n, final Visitable arg) { final IfStmt n2 = (IfStmt) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -1050,7 +1050,7 @@ public Boolean visit(final IfStmt n, final Visitable arg) { } @Override - public Boolean visit(final WhileStmt n, final Visitable arg) { + public Boolean visit(final WhileStmt n, final Visitable arg) { final WhileStmt n2 = (WhileStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1064,7 +1064,7 @@ public Boolean visit(final WhileStmt n, final Visitable arg) { } @Override - public Boolean visit(final ContinueStmt n, final Visitable arg) { + public Boolean visit(final ContinueStmt n, final Visitable arg) { final ContinueStmt n2 = (ContinueStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -1074,7 +1074,7 @@ public Boolean visit(final ContinueStmt n, final Visitable arg) { } @Override - public Boolean visit(final DoStmt n, final Visitable arg) { + public Boolean visit(final DoStmt n, final Visitable arg) { final DoStmt n2 = (DoStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1088,7 +1088,7 @@ public Boolean visit(final DoStmt n, final Visitable arg) { } @Override - public Boolean visit(final ForEachStmt n, final Visitable arg) { + public Boolean visit(final ForEachStmt n, final Visitable arg) { final ForEachStmt n2 = (ForEachStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1104,7 +1104,7 @@ public Boolean visit(final ForEachStmt n, final Visitable arg) { } @Override - public Boolean visit(final ForStmt n, final Visitable arg) { + public Boolean visit(final ForStmt n, final Visitable arg) { final ForStmt n2 = (ForStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1122,7 +1122,7 @@ public Boolean visit(final ForStmt n, final Visitable arg) { } @Override - public Boolean visit(final ThrowStmt n, final Visitable arg) { + public Boolean visit(final ThrowStmt n, final Visitable arg) { final ThrowStmt n2 = (ThrowStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1132,7 +1132,7 @@ public Boolean visit(final ThrowStmt n, final Visitable arg) { } @Override - public Boolean visit(final SynchronizedStmt n, final Visitable arg) { + public Boolean visit(final SynchronizedStmt n, final Visitable arg) { final SynchronizedStmt n2 = (SynchronizedStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1144,7 +1144,7 @@ public Boolean visit(final SynchronizedStmt n, final Visitable arg) { } @Override - public Boolean visit(final TryStmt n, final Visitable arg) { + public Boolean visit(final TryStmt n, final Visitable arg) { final TryStmt n2 = (TryStmt) arg; if (!nodesEquals(n.getCatchClauses(), n2.getCatchClauses())) return false; @@ -1160,7 +1160,7 @@ public Boolean visit(final TryStmt n, final Visitable arg) { } @Override - public Boolean visit(final CatchClause n, final Visitable arg) { + public Boolean visit(final CatchClause n, final Visitable arg) { final CatchClause n2 = (CatchClause) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1172,7 +1172,7 @@ public Boolean visit(final CatchClause n, final Visitable arg) { } @Override - public Boolean visit(final LambdaExpr n, final Visitable arg) { + public Boolean visit(final LambdaExpr n, final Visitable arg) { final LambdaExpr n2 = (LambdaExpr) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1188,7 +1188,7 @@ public Boolean visit(final LambdaExpr n, final Visitable arg) { } @Override - public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { + public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { final MethodReferenceExpr n2 = (MethodReferenceExpr) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -1202,7 +1202,7 @@ public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { } @Override - public Boolean visit(final TypeExpr n, final Visitable arg) { + public Boolean visit(final TypeExpr n, final Visitable arg) { final TypeExpr n2 = (TypeExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -1212,7 +1212,7 @@ public Boolean visit(final TypeExpr n, final Visitable arg) { } @Override - public Boolean visit(final ImportDeclaration n, final Visitable arg) { + public Boolean visit(final ImportDeclaration n, final Visitable arg) { final ImportDeclaration n2 = (ImportDeclaration) arg; if (!objEquals(n.isAsterisk(), n2.isAsterisk())) return false; @@ -1228,12 +1228,12 @@ public Boolean visit(final ImportDeclaration n, final Visitable arg) { } @Override - public Boolean visit(NodeList n, Visitable arg) { + public Boolean visit(NodeList n, Visitable arg) { return nodesEquals((NodeList) n, (NodeList) arg); } @Override - public Boolean visit(final ModuleDeclaration n, final Visitable arg) { + public Boolean visit(final ModuleDeclaration n, final Visitable arg) { final ModuleDeclaration n2 = (ModuleDeclaration) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1249,7 +1249,7 @@ public Boolean visit(final ModuleDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { + public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { final ModuleRequiresDirective n2 = (ModuleRequiresDirective) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1261,7 +1261,7 @@ public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { + public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { final ModuleExportsDirective n2 = (ModuleExportsDirective) arg; if (!nodesEquals(n.getModuleNames(), n2.getModuleNames())) return false; @@ -1273,7 +1273,7 @@ public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { + public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { final ModuleProvidesDirective n2 = (ModuleProvidesDirective) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1285,7 +1285,7 @@ public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { + public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { final ModuleUsesDirective n2 = (ModuleUsesDirective) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1295,7 +1295,7 @@ public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { } @Override - public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { + public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { final ModuleOpensDirective n2 = (ModuleOpensDirective) arg; if (!nodesEquals(n.getModuleNames(), n2.getModuleNames())) return false; @@ -1307,7 +1307,7 @@ public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { } @Override - public Boolean visit(final UnparsableStmt n, final Visitable arg) { + public Boolean visit(final UnparsableStmt n, final Visitable arg) { final UnparsableStmt n2 = (UnparsableStmt) arg; if (!nodeEquals(n.getComment(), n2.getComment())) return false; @@ -1315,7 +1315,7 @@ public Boolean visit(final UnparsableStmt n, final Visitable arg) { } @Override - public Boolean visit(final ReceiverParameter n, final Visitable arg) { + public Boolean visit(final ReceiverParameter n, final Visitable arg) { final ReceiverParameter n2 = (ReceiverParameter) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1329,7 +1329,7 @@ public Boolean visit(final ReceiverParameter n, final Visitable arg) { } @Override - public Boolean visit(final VarType n, final Visitable arg) { + public Boolean visit(final VarType n, final Visitable arg) { final VarType n2 = (VarType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1339,7 +1339,7 @@ public Boolean visit(final VarType n, final Visitable arg) { } @Override - public Boolean visit(final Modifier n, final Visitable arg) { + public Boolean visit(final Modifier n, final Visitable arg) { final Modifier n2 = (Modifier) arg; if (!objEquals(n.getKeyword(), n2.getKeyword())) return false; @@ -1349,7 +1349,7 @@ public Boolean visit(final Modifier n, final Visitable arg) { } @Override - public Boolean visit(final SwitchExpr n, final Visitable arg) { + public Boolean visit(final SwitchExpr n, final Visitable arg) { final SwitchExpr n2 = (SwitchExpr) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -1361,7 +1361,7 @@ public Boolean visit(final SwitchExpr n, final Visitable arg) { } @Override - public Boolean visit(final YieldStmt n, final Visitable arg) { + public Boolean visit(final YieldStmt n, final Visitable arg) { final YieldStmt n2 = (YieldStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1371,7 +1371,7 @@ public Boolean visit(final YieldStmt n, final Visitable arg) { } @Override - public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { + public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { final TextBlockLiteralExpr n2 = (TextBlockLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -1381,7 +1381,7 @@ public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final TypePatternExpr n, final Visitable arg) { + public Boolean visit(final TypePatternExpr n, final Visitable arg) { final TypePatternExpr n2 = (TypePatternExpr) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1395,7 +1395,7 @@ public Boolean visit(final TypePatternExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlClauseLabel n, final Visitable arg) { + public Boolean visit(final JmlClauseLabel n, final Visitable arg) { final JmlClauseLabel n2 = (JmlClauseLabel) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; @@ -1411,7 +1411,7 @@ public Boolean visit(final JmlClauseLabel n, final Visitable arg) { } @Override - public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { + public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { final JmlExpressionStmt n2 = (JmlExpressionStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1425,7 +1425,7 @@ public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { + public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { final JmlQuantifiedExpr n2 = (JmlQuantifiedExpr) arg; if (!objEquals(n.getBinder(), n2.getBinder())) return false; @@ -1439,7 +1439,7 @@ public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlLabelExpr n, final Visitable arg) { + public Boolean visit(final JmlLabelExpr n, final Visitable arg) { final JmlLabelExpr n2 = (JmlLabelExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1453,7 +1453,7 @@ public Boolean visit(final JmlLabelExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlLetExpr n, final Visitable arg) { + public Boolean visit(final JmlLetExpr n, final Visitable arg) { final JmlLetExpr n2 = (JmlLetExpr) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1465,7 +1465,7 @@ public Boolean visit(final JmlLetExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { + public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { final JmlMultiCompareExpr n2 = (JmlMultiCompareExpr) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1477,7 +1477,7 @@ public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { + public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { final JmlSimpleExprClause n2 = (JmlSimpleExprClause) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1493,7 +1493,7 @@ public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlSignalsClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsClause n, final Visitable arg) { final JmlSignalsClause n2 = (JmlSignalsClause) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1507,7 +1507,7 @@ public Boolean visit(final JmlSignalsClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { final JmlSignalsOnlyClause n2 = (JmlSignalsOnlyClause) arg; if (!nodesEquals(n.getTypes(), n2.getTypes())) return false; @@ -1519,7 +1519,7 @@ public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { + public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { final JmlUnreachableStmt n2 = (JmlUnreachableStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1529,7 +1529,7 @@ public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlCallableClause n, final Visitable arg) { + public Boolean visit(final JmlCallableClause n, final Visitable arg) { final JmlCallableClause n2 = (JmlCallableClause) arg; if (!nodesEquals(n.getMethodSignatures(), n2.getMethodSignatures())) return false; @@ -1541,7 +1541,7 @@ public Boolean visit(final JmlCallableClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlForallClause n, final Visitable arg) { + public Boolean visit(final JmlForallClause n, final Visitable arg) { final JmlForallClause n2 = (JmlForallClause) arg; if (!nodesEquals(n.getBoundedVariables(), n2.getBoundedVariables())) return false; @@ -1553,7 +1553,7 @@ public Boolean visit(final JmlForallClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { + public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { final JmlRefiningStmt n2 = (JmlRefiningStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1563,7 +1563,7 @@ public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlClauseIf n, final Visitable arg) { + public Boolean visit(final JmlClauseIf n, final Visitable arg) { final JmlClauseIf n2 = (JmlClauseIf) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -1579,7 +1579,7 @@ public Boolean visit(final JmlClauseIf n, final Visitable arg) { } @Override - public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { final JmlClassExprDeclaration n2 = (JmlClassExprDeclaration) arg; if (!nodeEquals(n.getInvariant(), n2.getInvariant())) return false; @@ -1599,7 +1599,7 @@ public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { final JmlClassAccessibleDeclaration n2 = (JmlClassAccessibleDeclaration) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1619,7 +1619,7 @@ public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg } @Override - public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { + public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { final JmlRepresentsDeclaration n2 = (JmlRepresentsDeclaration) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; @@ -1637,7 +1637,7 @@ public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlContract n, final Visitable arg) { + public Boolean visit(final JmlContract n, final Visitable arg) { final JmlContract n2 = (JmlContract) arg; if (!objEquals(n.getBehavior(), n2.getBehavior())) return false; @@ -1659,7 +1659,7 @@ public Boolean visit(final JmlContract n, final Visitable arg) { } @Override - public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { + public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { final JmlSetComprehensionExpr n2 = (JmlSetComprehensionExpr) arg; if (!nodeEquals(n.getBinding(), n2.getBinding())) return false; @@ -1671,7 +1671,7 @@ public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlGhostStmt n, final Visitable arg) { + public Boolean visit(final JmlGhostStmt n, final Visitable arg) { final JmlGhostStmt n2 = (JmlGhostStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1683,7 +1683,7 @@ public Boolean visit(final JmlGhostStmt n, final Visitable arg) { } @Override - public Boolean visit(final RecordDeclaration n, final Visitable arg) { + public Boolean visit(final RecordDeclaration n, final Visitable arg) { final RecordDeclaration n2 = (RecordDeclaration) arg; if (!nodesEquals(n.getImplementedTypes(), n2.getImplementedTypes())) return false; @@ -1707,7 +1707,7 @@ public Boolean visit(final RecordDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { final CompactConstructorDeclaration n2 = (CompactConstructorDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1727,7 +1727,7 @@ public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg } @Override - public Boolean visit(final RecordPatternExpr n, final Visitable arg) { + public Boolean visit(final RecordPatternExpr n, final Visitable arg) { final RecordPatternExpr n2 = (RecordPatternExpr) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1741,7 +1741,7 @@ public Boolean visit(final RecordPatternExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { + public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { final JmlMethodDeclaration n2 = (JmlMethodDeclaration) arg; if (!nodeEquals(n.getContract(), n2.getContract())) return false; @@ -1757,7 +1757,7 @@ public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { + public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { final JmlBinaryInfixExpr n2 = (JmlBinaryInfixExpr) arg; if (!nodeEquals(n.getLeft(), n2.getLeft())) return false; @@ -1771,7 +1771,7 @@ public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { + public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { final JmlDocDeclaration n2 = (JmlDocDeclaration) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1783,7 +1783,7 @@ public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocStmt n, final Visitable arg) { + public Boolean visit(final JmlDocStmt n, final Visitable arg) { final JmlDocStmt n2 = (JmlDocStmt) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1793,7 +1793,7 @@ public Boolean visit(final JmlDocStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlDoc n, final Visitable arg) { + public Boolean visit(final JmlDoc n, final Visitable arg) { final JmlDoc n2 = (JmlDoc) arg; if (!objEquals(n.getContent(), n2.getContent())) return false; @@ -1803,7 +1803,7 @@ public Boolean visit(final JmlDoc n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocType n, final Visitable arg) { + public Boolean visit(final JmlDocType n, final Visitable arg) { final JmlDocType n2 = (JmlDocType) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1821,7 +1821,7 @@ public Boolean visit(final JmlDocType n, final Visitable arg) { } @Override - public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { + public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { final JmlFieldDeclaration n2 = (JmlFieldDeclaration) arg; if (!nodeEquals(n.getDecl(), n2.getDecl())) return false; @@ -1835,7 +1835,7 @@ public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlOldClause n, final Visitable arg) { + public Boolean visit(final JmlOldClause n, final Visitable arg) { final JmlOldClause n2 = (JmlOldClause) arg; if (!nodeEquals(n.getDeclarations(), n2.getDeclarations())) return false; @@ -1847,7 +1847,7 @@ public Boolean visit(final JmlOldClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlTypeExpr n, final Visitable arg) { + public Boolean visit(final JmlTypeExpr n, final Visitable arg) { final JmlTypeExpr n2 = (JmlTypeExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -1857,7 +1857,7 @@ public Boolean visit(final JmlTypeExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { + public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { final JmlMultiExprClause n2 = (JmlMultiExprClause) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1873,7 +1873,7 @@ public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlBeginStmt n, final Visitable arg) { + public Boolean visit(final JmlBeginStmt n, final Visitable arg) { final JmlBeginStmt n2 = (JmlBeginStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1883,7 +1883,7 @@ public Boolean visit(final JmlBeginStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlEndStmt n, final Visitable arg) { + public Boolean visit(final JmlEndStmt n, final Visitable arg) { final JmlEndStmt n2 = (JmlEndStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1893,7 +1893,7 @@ public Boolean visit(final JmlEndStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlLabelStmt n, final Visitable arg) { + public Boolean visit(final JmlLabelStmt n, final Visitable arg) { final JmlLabelStmt n2 = (JmlLabelStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1905,7 +1905,7 @@ public Boolean visit(final JmlLabelStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlMethodSignature n, final Visitable arg) { + public Boolean visit(final JmlMethodSignature n, final Visitable arg) { final JmlMethodSignature n2 = (JmlMethodSignature) arg; if (!nodesEquals(n.getArgumentTypes(), n2.getArgumentTypes())) return false; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java index c4543f13d4..c9e01e1072 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapter.java @@ -52,7 +52,7 @@ public abstract class GenericListVisitorAdapter implements GenericVisitor, A> { @Override - public List visit(final AnnotationDeclaration n, final A arg) { + public List visit(final AnnotationDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -84,7 +84,7 @@ public List visit(final AnnotationDeclaration n, final A arg) { } @Override - public List visit(final AnnotationMemberDeclaration n, final A arg) { + public List visit(final AnnotationMemberDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getDefaultValue().isPresent()) { @@ -121,7 +121,7 @@ public List visit(final AnnotationMemberDeclaration n, final A arg) { } @Override - public List visit(final ArrayAccessExpr n, final A arg) { + public List visit(final ArrayAccessExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -143,7 +143,7 @@ public List visit(final ArrayAccessExpr n, final A arg) { } @Override - public List visit(final ArrayCreationExpr n, final A arg) { + public List visit(final ArrayCreationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -170,7 +170,7 @@ public List visit(final ArrayCreationExpr n, final A arg) { } @Override - public List visit(final ArrayCreationLevel n, final A arg) { + public List visit(final ArrayCreationLevel n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -192,7 +192,7 @@ public List visit(final ArrayCreationLevel n, final A arg) { } @Override - public List visit(final ArrayInitializerExpr n, final A arg) { + public List visit(final ArrayInitializerExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -209,7 +209,7 @@ public List visit(final ArrayInitializerExpr n, final A arg) { } @Override - public List visit(final ArrayType n, final A arg) { + public List visit(final ArrayType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -231,7 +231,7 @@ public List visit(final ArrayType n, final A arg) { } @Override - public List visit(final AssertStmt n, final A arg) { + public List visit(final AssertStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -253,7 +253,7 @@ public List visit(final AssertStmt n, final A arg) { } @Override - public List visit(final AssignExpr n, final A arg) { + public List visit(final AssignExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -275,7 +275,7 @@ public List visit(final AssignExpr n, final A arg) { } @Override - public List visit(final BinaryExpr n, final A arg) { + public List visit(final BinaryExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -297,7 +297,7 @@ public List visit(final BinaryExpr n, final A arg) { } @Override - public List visit(final BlockComment n, final A arg) { + public List visit(final BlockComment n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -309,7 +309,7 @@ public List visit(final BlockComment n, final A arg) { } @Override - public List visit(final BlockStmt n, final A arg) { + public List visit(final BlockStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -331,7 +331,7 @@ public List visit(final BlockStmt n, final A arg) { } @Override - public List visit(final BooleanLiteralExpr n, final A arg) { + public List visit(final BooleanLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -343,7 +343,7 @@ public List visit(final BooleanLiteralExpr n, final A arg) { } @Override - public List visit(final BreakStmt n, final A arg) { + public List visit(final BreakStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getLabel().isPresent()) { @@ -360,7 +360,7 @@ public List visit(final BreakStmt n, final A arg) { } @Override - public List visit(final CastExpr n, final A arg) { + public List visit(final CastExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -382,7 +382,7 @@ public List visit(final CastExpr n, final A arg) { } @Override - public List visit(final CatchClause n, final A arg) { + public List visit(final CatchClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -404,7 +404,7 @@ public List visit(final CatchClause n, final A arg) { } @Override - public List visit(final CharLiteralExpr n, final A arg) { + public List visit(final CharLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -416,7 +416,7 @@ public List visit(final CharLiteralExpr n, final A arg) { } @Override - public List visit(final ClassExpr n, final A arg) { + public List visit(final ClassExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -433,7 +433,7 @@ public List visit(final ClassExpr n, final A arg) { } @Override - public List visit(final ClassOrInterfaceDeclaration n, final A arg) { + public List visit(final ClassOrInterfaceDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -485,7 +485,7 @@ public List visit(final ClassOrInterfaceDeclaration n, final A arg) { } @Override - public List visit(final ClassOrInterfaceType n, final A arg) { + public List visit(final ClassOrInterfaceType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -517,7 +517,7 @@ public List visit(final ClassOrInterfaceType n, final A arg) { } @Override - public List visit(final CompilationUnit n, final A arg) { + public List visit(final CompilationUnit n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -549,7 +549,7 @@ public List visit(final CompilationUnit n, final A arg) { } @Override - public List visit(final ConditionalExpr n, final A arg) { + public List visit(final ConditionalExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -576,7 +576,7 @@ public List visit(final ConditionalExpr n, final A arg) { } @Override - public List visit(final ConstructorDeclaration n, final A arg) { + public List visit(final ConstructorDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -633,7 +633,7 @@ public List visit(final ConstructorDeclaration n, final A arg) { } @Override - public List visit(final ContinueStmt n, final A arg) { + public List visit(final ContinueStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getLabel().isPresent()) { @@ -650,7 +650,7 @@ public List visit(final ContinueStmt n, final A arg) { } @Override - public List visit(final DoStmt n, final A arg) { + public List visit(final DoStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -677,7 +677,7 @@ public List visit(final DoStmt n, final A arg) { } @Override - public List visit(final DoubleLiteralExpr n, final A arg) { + public List visit(final DoubleLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -689,7 +689,7 @@ public List visit(final DoubleLiteralExpr n, final A arg) { } @Override - public List visit(final EmptyStmt n, final A arg) { + public List visit(final EmptyStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -701,7 +701,7 @@ public List visit(final EmptyStmt n, final A arg) { } @Override - public List visit(final EnclosedExpr n, final A arg) { + public List visit(final EnclosedExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -718,7 +718,7 @@ public List visit(final EnclosedExpr n, final A arg) { } @Override - public List visit(final EnumConstantDeclaration n, final A arg) { + public List visit(final EnumConstantDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -750,7 +750,7 @@ public List visit(final EnumConstantDeclaration n, final A arg) { } @Override - public List visit(final EnumDeclaration n, final A arg) { + public List visit(final EnumDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -792,7 +792,7 @@ public List visit(final EnumDeclaration n, final A arg) { } @Override - public List visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public List visit(final ExplicitConstructorInvocationStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -819,7 +819,7 @@ public List visit(final ExplicitConstructorInvocationStmt n, final A arg) { } @Override - public List visit(final ExpressionStmt n, final A arg) { + public List visit(final ExpressionStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -836,7 +836,7 @@ public List visit(final ExpressionStmt n, final A arg) { } @Override - public List visit(final FieldAccessExpr n, final A arg) { + public List visit(final FieldAccessExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -863,7 +863,7 @@ public List visit(final FieldAccessExpr n, final A arg) { } @Override - public List visit(final FieldDeclaration n, final A arg) { + public List visit(final FieldDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -890,7 +890,7 @@ public List visit(final FieldDeclaration n, final A arg) { } @Override - public List visit(final ForStmt n, final A arg) { + public List visit(final ForStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -927,7 +927,7 @@ public List visit(final ForStmt n, final A arg) { } @Override - public List visit(final ForEachStmt n, final A arg) { + public List visit(final ForEachStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -959,7 +959,7 @@ public List visit(final ForEachStmt n, final A arg) { } @Override - public List visit(final IfStmt n, final A arg) { + public List visit(final IfStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -986,7 +986,7 @@ public List visit(final IfStmt n, final A arg) { } @Override - public List visit(final ImportDeclaration n, final A arg) { + public List visit(final ImportDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1003,7 +1003,7 @@ public List visit(final ImportDeclaration n, final A arg) { } @Override - public List visit(final InitializerDeclaration n, final A arg) { + public List visit(final InitializerDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1025,7 +1025,7 @@ public List visit(final InitializerDeclaration n, final A arg) { } @Override - public List visit(final InstanceOfExpr n, final A arg) { + public List visit(final InstanceOfExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1052,7 +1052,7 @@ public List visit(final InstanceOfExpr n, final A arg) { } @Override - public List visit(final IntegerLiteralExpr n, final A arg) { + public List visit(final IntegerLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1064,7 +1064,7 @@ public List visit(final IntegerLiteralExpr n, final A arg) { } @Override - public List visit(final IntersectionType n, final A arg) { + public List visit(final IntersectionType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1086,7 +1086,7 @@ public List visit(final IntersectionType n, final A arg) { } @Override - public List visit(final JavadocComment n, final A arg) { + public List visit(final JavadocComment n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1098,7 +1098,7 @@ public List visit(final JavadocComment n, final A arg) { } @Override - public List visit(final LabeledStmt n, final A arg) { + public List visit(final LabeledStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1120,7 +1120,7 @@ public List visit(final LabeledStmt n, final A arg) { } @Override - public List visit(final LambdaExpr n, final A arg) { + public List visit(final LambdaExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1147,7 +1147,7 @@ public List visit(final LambdaExpr n, final A arg) { } @Override - public List visit(final LineComment n, final A arg) { + public List visit(final LineComment n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1159,7 +1159,7 @@ public List visit(final LineComment n, final A arg) { } @Override - public List visit(final LocalClassDeclarationStmt n, final A arg) { + public List visit(final LocalClassDeclarationStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1176,7 +1176,7 @@ public List visit(final LocalClassDeclarationStmt n, final A arg) { } @Override - public List visit(final LocalRecordDeclarationStmt n, final A arg) { + public List visit(final LocalRecordDeclarationStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1193,7 +1193,7 @@ public List visit(final LocalRecordDeclarationStmt n, final A arg) { } @Override - public List visit(final LongLiteralExpr n, final A arg) { + public List visit(final LongLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1205,7 +1205,7 @@ public List visit(final LongLiteralExpr n, final A arg) { } @Override - public List visit(final MarkerAnnotationExpr n, final A arg) { + public List visit(final MarkerAnnotationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1222,7 +1222,7 @@ public List visit(final MarkerAnnotationExpr n, final A arg) { } @Override - public List visit(final MemberValuePair n, final A arg) { + public List visit(final MemberValuePair n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1244,7 +1244,7 @@ public List visit(final MemberValuePair n, final A arg) { } @Override - public List visit(final MethodCallExpr n, final A arg) { + public List visit(final MethodCallExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1276,7 +1276,7 @@ public List visit(final MethodCallExpr n, final A arg) { } @Override - public List visit(final MethodDeclaration n, final A arg) { + public List visit(final MethodDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getBody().isPresent()) { @@ -1338,7 +1338,7 @@ public List visit(final MethodDeclaration n, final A arg) { } @Override - public List visit(final MethodReferenceExpr n, final A arg) { + public List visit(final MethodReferenceExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1360,7 +1360,7 @@ public List visit(final MethodReferenceExpr n, final A arg) { } @Override - public List visit(final NameExpr n, final A arg) { + public List visit(final NameExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1377,7 +1377,7 @@ public List visit(final NameExpr n, final A arg) { } @Override - public List visit(final Name n, final A arg) { + public List visit(final Name n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getQualifier().isPresent()) { @@ -1394,7 +1394,7 @@ public List visit(final Name n, final A arg) { } @Override - public List visit(final NormalAnnotationExpr n, final A arg) { + public List visit(final NormalAnnotationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1416,7 +1416,7 @@ public List visit(final NormalAnnotationExpr n, final A arg) { } @Override - public List visit(final NullLiteralExpr n, final A arg) { + public List visit(final NullLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1428,7 +1428,7 @@ public List visit(final NullLiteralExpr n, final A arg) { } @Override - public List visit(final ObjectCreationExpr n, final A arg) { + public List visit(final ObjectCreationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getAnonymousClassBody().isPresent()) { @@ -1465,7 +1465,7 @@ public List visit(final ObjectCreationExpr n, final A arg) { } @Override - public List visit(final PackageDeclaration n, final A arg) { + public List visit(final PackageDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1487,7 +1487,7 @@ public List visit(final PackageDeclaration n, final A arg) { } @Override - public List visit(final Parameter n, final A arg) { + public List visit(final Parameter n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1524,7 +1524,7 @@ public List visit(final Parameter n, final A arg) { } @Override - public List visit(final PrimitiveType n, final A arg) { + public List visit(final PrimitiveType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1541,7 +1541,7 @@ public List visit(final PrimitiveType n, final A arg) { } @Override - public List visit(final ReturnStmt n, final A arg) { + public List visit(final ReturnStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getExpression().isPresent()) { @@ -1558,7 +1558,7 @@ public List visit(final ReturnStmt n, final A arg) { } @Override - public List visit(final SimpleName n, final A arg) { + public List visit(final SimpleName n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1570,7 +1570,7 @@ public List visit(final SimpleName n, final A arg) { } @Override - public List visit(final SingleMemberAnnotationExpr n, final A arg) { + public List visit(final SingleMemberAnnotationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1592,7 +1592,7 @@ public List visit(final SingleMemberAnnotationExpr n, final A arg) { } @Override - public List visit(final StringLiteralExpr n, final A arg) { + public List visit(final StringLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -1604,7 +1604,7 @@ public List visit(final StringLiteralExpr n, final A arg) { } @Override - public List visit(final SuperExpr n, final A arg) { + public List visit(final SuperExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getTypeName().isPresent()) { @@ -1621,7 +1621,7 @@ public List visit(final SuperExpr n, final A arg) { } @Override - public List visit(final SwitchEntry n, final A arg) { + public List visit(final SwitchEntry n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getGuard().isPresent()) { @@ -1648,7 +1648,7 @@ public List visit(final SwitchEntry n, final A arg) { } @Override - public List visit(final SwitchStmt n, final A arg) { + public List visit(final SwitchStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1670,7 +1670,7 @@ public List visit(final SwitchStmt n, final A arg) { } @Override - public List visit(final SynchronizedStmt n, final A arg) { + public List visit(final SynchronizedStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1692,7 +1692,7 @@ public List visit(final SynchronizedStmt n, final A arg) { } @Override - public List visit(final ThisExpr n, final A arg) { + public List visit(final ThisExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getTypeName().isPresent()) { @@ -1709,7 +1709,7 @@ public List visit(final ThisExpr n, final A arg) { } @Override - public List visit(final ThrowStmt n, final A arg) { + public List visit(final ThrowStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1726,7 +1726,7 @@ public List visit(final ThrowStmt n, final A arg) { } @Override - public List visit(final TryStmt n, final A arg) { + public List visit(final TryStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1758,7 +1758,7 @@ public List visit(final TryStmt n, final A arg) { } @Override - public List visit(final TypeExpr n, final A arg) { + public List visit(final TypeExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1775,7 +1775,7 @@ public List visit(final TypeExpr n, final A arg) { } @Override - public List visit(final TypeParameter n, final A arg) { + public List visit(final TypeParameter n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1802,7 +1802,7 @@ public List visit(final TypeParameter n, final A arg) { } @Override - public List visit(final UnaryExpr n, final A arg) { + public List visit(final UnaryExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1819,7 +1819,7 @@ public List visit(final UnaryExpr n, final A arg) { } @Override - public List visit(final UnionType n, final A arg) { + public List visit(final UnionType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1841,7 +1841,7 @@ public List visit(final UnionType n, final A arg) { } @Override - public List visit(final UnknownType n, final A arg) { + public List visit(final UnknownType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1858,7 +1858,7 @@ public List visit(final UnknownType n, final A arg) { } @Override - public List visit(final VariableDeclarationExpr n, final A arg) { + public List visit(final VariableDeclarationExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1885,7 +1885,7 @@ public List visit(final VariableDeclarationExpr n, final A arg) { } @Override - public List visit(final VariableDeclarator n, final A arg) { + public List visit(final VariableDeclarator n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getInitializer().isPresent()) { @@ -1912,7 +1912,7 @@ public List visit(final VariableDeclarator n, final A arg) { } @Override - public List visit(final VoidType n, final A arg) { + public List visit(final VoidType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1929,7 +1929,7 @@ public List visit(final VoidType n, final A arg) { } @Override - public List visit(final WhileStmt n, final A arg) { + public List visit(final WhileStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -1956,7 +1956,7 @@ public List visit(final WhileStmt n, final A arg) { } @Override - public List visit(final WildcardType n, final A arg) { + public List visit(final WildcardType n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getExtendedType().isPresent()) { @@ -1983,12 +1983,12 @@ public List visit(final WildcardType n, final A arg) { } @Override - public List visit(NodeList n, A arg) { + public List visit(NodeList n, A arg) { return ((NodeList) n).stream().filter(Objects::nonNull).flatMap(v -> v.accept(this, arg).stream()).collect(Collectors.toList()); } @Override - public List visit(final ModuleDeclaration n, final A arg) { + public List visit(final ModuleDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2015,7 +2015,7 @@ public List visit(final ModuleDeclaration n, final A arg) { } @Override - public List visit(final ModuleExportsDirective n, final A arg) { + public List visit(final ModuleExportsDirective n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2037,7 +2037,7 @@ public List visit(final ModuleExportsDirective n, final A arg) { } @Override - public List visit(final ModuleOpensDirective n, final A arg) { + public List visit(final ModuleOpensDirective n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2059,7 +2059,7 @@ public List visit(final ModuleOpensDirective n, final A arg) { } @Override - public List visit(final ModuleProvidesDirective n, final A arg) { + public List visit(final ModuleProvidesDirective n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2081,7 +2081,7 @@ public List visit(final ModuleProvidesDirective n, final A arg) { } @Override - public List visit(final ModuleRequiresDirective n, final A arg) { + public List visit(final ModuleRequiresDirective n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2103,7 +2103,7 @@ public List visit(final ModuleRequiresDirective n, final A arg) { } @Override - public List visit(final ModuleUsesDirective n, final A arg) { + public List visit(final ModuleUsesDirective n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2120,7 +2120,7 @@ public List visit(final ModuleUsesDirective n, final A arg) { } @Override - public List visit(final UnparsableStmt n, final A arg) { + public List visit(final UnparsableStmt n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -2132,7 +2132,7 @@ public List visit(final UnparsableStmt n, final A arg) { } @Override - public List visit(final ReceiverParameter n, final A arg) { + public List visit(final ReceiverParameter n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2159,7 +2159,7 @@ public List visit(final ReceiverParameter n, final A arg) { } @Override - public List visit(final VarType n, final A arg) { + public List visit(final VarType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2176,7 +2176,7 @@ public List visit(final VarType n, final A arg) { } @Override - public List visit(final Modifier n, final A arg) { + public List visit(final Modifier n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -2188,7 +2188,7 @@ public List visit(final Modifier n, final A arg) { } @Override - public List visit(final SwitchExpr n, final A arg) { + public List visit(final SwitchExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2210,7 +2210,7 @@ public List visit(final SwitchExpr n, final A arg) { } @Override - public List visit(final YieldStmt n, final A arg) { + public List visit(final YieldStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2227,7 +2227,7 @@ public List visit(final YieldStmt n, final A arg) { } @Override - public List visit(final TextBlockLiteralExpr n, final A arg) { + public List visit(final TextBlockLiteralExpr n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -2239,7 +2239,7 @@ public List visit(final TextBlockLiteralExpr n, final A arg) { } @Override - public List visit(final TypePatternExpr n, final A arg) { + public List visit(final TypePatternExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2266,7 +2266,7 @@ public List visit(final TypePatternExpr n, final A arg) { } @Override - public List visit(final JmlQuantifiedExpr n, final A arg) { + public List visit(final JmlQuantifiedExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2288,7 +2288,7 @@ public List visit(final JmlQuantifiedExpr n, final A arg) { } @Override - public List visit(final JmlClauseLabel n, final A arg) { + public List visit(final JmlClauseLabel n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2315,7 +2315,7 @@ public List visit(final JmlClauseLabel n, final A arg) { } @Override - public List visit(final JmlExpressionStmt n, final A arg) { + public List visit(final JmlExpressionStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2337,7 +2337,7 @@ public List visit(final JmlExpressionStmt n, final A arg) { } @Override - public List visit(final JmlLabelExpr n, final A arg) { + public List visit(final JmlLabelExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2359,7 +2359,7 @@ public List visit(final JmlLabelExpr n, final A arg) { } @Override - public List visit(final JmlLetExpr n, final A arg) { + public List visit(final JmlLetExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2381,7 +2381,7 @@ public List visit(final JmlLetExpr n, final A arg) { } @Override - public List visit(final JmlMultiCompareExpr n, final A arg) { + public List visit(final JmlMultiCompareExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2398,7 +2398,7 @@ public List visit(final JmlMultiCompareExpr n, final A arg) { } @Override - public List visit(final JmlSimpleExprClause n, final A arg) { + public List visit(final JmlSimpleExprClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2425,7 +2425,7 @@ public List visit(final JmlSimpleExprClause n, final A arg) { } @Override - public List visit(final JmlSignalsClause n, final A arg) { + public List visit(final JmlSignalsClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2452,7 +2452,7 @@ public List visit(final JmlSignalsClause n, final A arg) { } @Override - public List visit(final JmlSignalsOnlyClause n, final A arg) { + public List visit(final JmlSignalsOnlyClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2474,7 +2474,7 @@ public List visit(final JmlSignalsOnlyClause n, final A arg) { } @Override - public List visit(final JmlUnreachableStmt n, final A arg) { + public List visit(final JmlUnreachableStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2491,7 +2491,7 @@ public List visit(final JmlUnreachableStmt n, final A arg) { } @Override - public List visit(final JmlCallableClause n, final A arg) { + public List visit(final JmlCallableClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2513,7 +2513,7 @@ public List visit(final JmlCallableClause n, final A arg) { } @Override - public List visit(final JmlForallClause n, final A arg) { + public List visit(final JmlForallClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2535,7 +2535,7 @@ public List visit(final JmlForallClause n, final A arg) { } @Override - public List visit(final JmlRefiningStmt n, final A arg) { + public List visit(final JmlRefiningStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2552,7 +2552,7 @@ public List visit(final JmlRefiningStmt n, final A arg) { } @Override - public List visit(final JmlClauseIf n, final A arg) { + public List visit(final JmlClauseIf n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2579,7 +2579,7 @@ public List visit(final JmlClauseIf n, final A arg) { } @Override - public List visit(final JmlClassExprDeclaration n, final A arg) { + public List visit(final JmlClassExprDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2621,7 +2621,7 @@ public List visit(final JmlClassExprDeclaration n, final A arg) { } @Override - public List visit(final JmlClassAccessibleDeclaration n, final A arg) { + public List visit(final JmlClassAccessibleDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2663,7 +2663,7 @@ public List visit(final JmlClassAccessibleDeclaration n, final A arg) { } @Override - public List visit(final JmlRepresentsDeclaration n, final A arg) { + public List visit(final JmlRepresentsDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2700,7 +2700,7 @@ public List visit(final JmlRepresentsDeclaration n, final A arg) { } @Override - public List visit(final JmlContract n, final A arg) { + public List visit(final JmlContract n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2737,7 +2737,7 @@ public List visit(final JmlContract n, final A arg) { } @Override - public List visit(final JmlSetComprehensionExpr n, final A arg) { + public List visit(final JmlSetComprehensionExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2759,7 +2759,7 @@ public List visit(final JmlSetComprehensionExpr n, final A arg) { } @Override - public List visit(final JmlGhostStmt n, final A arg) { + public List visit(final JmlGhostStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2781,7 +2781,7 @@ public List visit(final JmlGhostStmt n, final A arg) { } @Override - public List visit(final RecordDeclaration n, final A arg) { + public List visit(final RecordDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2833,7 +2833,7 @@ public List visit(final RecordDeclaration n, final A arg) { } @Override - public List visit(final CompactConstructorDeclaration n, final A arg) { + public List visit(final CompactConstructorDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2875,7 +2875,7 @@ public List visit(final CompactConstructorDeclaration n, final A arg) { } @Override - public List visit(final RecordPatternExpr n, final A arg) { + public List visit(final RecordPatternExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2902,7 +2902,7 @@ public List visit(final RecordPatternExpr n, final A arg) { } @Override - public List visit(final JmlMethodDeclaration n, final A arg) { + public List visit(final JmlMethodDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getContract().isPresent()) { @@ -2934,7 +2934,7 @@ public List visit(final JmlMethodDeclaration n, final A arg) { } @Override - public List visit(final JmlBinaryInfixExpr n, final A arg) { + public List visit(final JmlBinaryInfixExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2961,7 +2961,7 @@ public List visit(final JmlBinaryInfixExpr n, final A arg) { } @Override - public List visit(final JmlDocDeclaration n, final A arg) { + public List visit(final JmlDocDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -2983,7 +2983,7 @@ public List visit(final JmlDocDeclaration n, final A arg) { } @Override - public List visit(final JmlDocStmt n, final A arg) { + public List visit(final JmlDocStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3000,7 +3000,7 @@ public List visit(final JmlDocStmt n, final A arg) { } @Override - public List visit(final JmlDoc n, final A arg) { + public List visit(final JmlDoc n, final A arg) { List result = new ArrayList<>(); List tmp; if (n.getComment().isPresent()) { @@ -3012,7 +3012,7 @@ public List visit(final JmlDoc n, final A arg) { } @Override - public List visit(final JmlDocType n, final A arg) { + public List visit(final JmlDocType n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3049,7 +3049,7 @@ public List visit(final JmlDocType n, final A arg) { } @Override - public List visit(final JmlFieldDeclaration n, final A arg) { + public List visit(final JmlFieldDeclaration n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3076,7 +3076,7 @@ public List visit(final JmlFieldDeclaration n, final A arg) { } @Override - public List visit(final JmlOldClause n, final A arg) { + public List visit(final JmlOldClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3098,7 +3098,7 @@ public List visit(final JmlOldClause n, final A arg) { } @Override - public List visit(final JmlTypeExpr n, final A arg) { + public List visit(final JmlTypeExpr n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3115,7 +3115,7 @@ public List visit(final JmlTypeExpr n, final A arg) { } @Override - public List visit(final JmlMultiExprClause n, final A arg) { + public List visit(final JmlMultiExprClause n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3142,7 +3142,7 @@ public List visit(final JmlMultiExprClause n, final A arg) { } @Override - public List visit(final JmlBeginStmt n, final A arg) { + public List visit(final JmlBeginStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3159,7 +3159,7 @@ public List visit(final JmlBeginStmt n, final A arg) { } @Override - public List visit(final JmlEndStmt n, final A arg) { + public List visit(final JmlEndStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3176,7 +3176,7 @@ public List visit(final JmlEndStmt n, final A arg) { } @Override - public List visit(final JmlLabelStmt n, final A arg) { + public List visit(final JmlLabelStmt n, final A arg) { List result = new ArrayList<>(); List tmp; { @@ -3198,7 +3198,7 @@ public List visit(final JmlLabelStmt n, final A arg) { } @Override - public List visit(final JmlMethodSignature n, final A arg) { + public List visit(final JmlMethodSignature n, final A arg) { List result = new ArrayList<>(); List tmp; { diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java index 7dff5112ab..36928eec3d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitor.java @@ -43,7 +43,7 @@ * * @author Julio Vilmar Gesser */ -public interface GenericVisitor { +public interface GenericVisitor { // - Compilation Unit ---------------------------------- R visit(CompilationUnit n, A arg); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java index 3edbfcc858..01875dede2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorAdapter.java @@ -48,7 +48,7 @@ public abstract class GenericVisitorAdapter implements GenericVisitor { @Override - public R visit(final AnnotationDeclaration n, final A arg) { + public R visit(final AnnotationDeclaration n, final A arg) { R result; { result = n.getMembers().accept(this, arg); @@ -79,7 +79,7 @@ public R visit(final AnnotationDeclaration n, final A arg) { } @Override - public R visit(final AnnotationMemberDeclaration n, final A arg) { + public R visit(final AnnotationMemberDeclaration n, final A arg) { R result; if (n.getDefaultValue().isPresent()) { result = n.getDefaultValue().get().accept(this, arg); @@ -115,7 +115,7 @@ public R visit(final AnnotationMemberDeclaration n, final A arg) { } @Override - public R visit(final ArrayAccessExpr n, final A arg) { + public R visit(final ArrayAccessExpr n, final A arg) { R result; { result = n.getIndex().accept(this, arg); @@ -136,7 +136,7 @@ public R visit(final ArrayAccessExpr n, final A arg) { } @Override - public R visit(final ArrayCreationExpr n, final A arg) { + public R visit(final ArrayCreationExpr n, final A arg) { R result; { result = n.getElementType().accept(this, arg); @@ -162,7 +162,7 @@ public R visit(final ArrayCreationExpr n, final A arg) { } @Override - public R visit(final ArrayInitializerExpr n, final A arg) { + public R visit(final ArrayInitializerExpr n, final A arg) { R result; { result = n.getValues().accept(this, arg); @@ -178,7 +178,7 @@ public R visit(final ArrayInitializerExpr n, final A arg) { } @Override - public R visit(final AssertStmt n, final A arg) { + public R visit(final AssertStmt n, final A arg) { R result; { result = n.getCheck().accept(this, arg); @@ -199,7 +199,7 @@ public R visit(final AssertStmt n, final A arg) { } @Override - public R visit(final AssignExpr n, final A arg) { + public R visit(final AssignExpr n, final A arg) { R result; { result = n.getTarget().accept(this, arg); @@ -220,7 +220,7 @@ public R visit(final AssignExpr n, final A arg) { } @Override - public R visit(final BinaryExpr n, final A arg) { + public R visit(final BinaryExpr n, final A arg) { R result; { result = n.getLeft().accept(this, arg); @@ -241,7 +241,7 @@ public R visit(final BinaryExpr n, final A arg) { } @Override - public R visit(final BlockStmt n, final A arg) { + public R visit(final BlockStmt n, final A arg) { R result; { result = n.getContracts().accept(this, arg); @@ -262,7 +262,7 @@ public R visit(final BlockStmt n, final A arg) { } @Override - public R visit(final BooleanLiteralExpr n, final A arg) { + public R visit(final BooleanLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -273,7 +273,7 @@ public R visit(final BooleanLiteralExpr n, final A arg) { } @Override - public R visit(final BreakStmt n, final A arg) { + public R visit(final BreakStmt n, final A arg) { R result; if (n.getLabel().isPresent()) { result = n.getLabel().get().accept(this, arg); @@ -289,7 +289,7 @@ public R visit(final BreakStmt n, final A arg) { } @Override - public R visit(final CastExpr n, final A arg) { + public R visit(final CastExpr n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -310,7 +310,7 @@ public R visit(final CastExpr n, final A arg) { } @Override - public R visit(final CatchClause n, final A arg) { + public R visit(final CatchClause n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -331,7 +331,7 @@ public R visit(final CatchClause n, final A arg) { } @Override - public R visit(final CharLiteralExpr n, final A arg) { + public R visit(final CharLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -342,7 +342,7 @@ public R visit(final CharLiteralExpr n, final A arg) { } @Override - public R visit(final ClassExpr n, final A arg) { + public R visit(final ClassExpr n, final A arg) { R result; { result = n.getType().accept(this, arg); @@ -358,7 +358,7 @@ public R visit(final ClassExpr n, final A arg) { } @Override - public R visit(final ClassOrInterfaceDeclaration n, final A arg) { + public R visit(final ClassOrInterfaceDeclaration n, final A arg) { R result; { result = n.getExtendedTypes().accept(this, arg); @@ -409,7 +409,7 @@ public R visit(final ClassOrInterfaceDeclaration n, final A arg) { } @Override - public R visit(final ClassOrInterfaceType n, final A arg) { + public R visit(final ClassOrInterfaceType n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -440,7 +440,7 @@ public R visit(final ClassOrInterfaceType n, final A arg) { } @Override - public R visit(final CompilationUnit n, final A arg) { + public R visit(final CompilationUnit n, final A arg) { R result; { result = n.getImports().accept(this, arg); @@ -471,7 +471,7 @@ public R visit(final CompilationUnit n, final A arg) { } @Override - public R visit(final ConditionalExpr n, final A arg) { + public R visit(final ConditionalExpr n, final A arg) { R result; { result = n.getCondition().accept(this, arg); @@ -497,7 +497,7 @@ public R visit(final ConditionalExpr n, final A arg) { } @Override - public R visit(final ConstructorDeclaration n, final A arg) { + public R visit(final ConstructorDeclaration n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -553,7 +553,7 @@ public R visit(final ConstructorDeclaration n, final A arg) { } @Override - public R visit(final ContinueStmt n, final A arg) { + public R visit(final ContinueStmt n, final A arg) { R result; if (n.getLabel().isPresent()) { result = n.getLabel().get().accept(this, arg); @@ -569,7 +569,7 @@ public R visit(final ContinueStmt n, final A arg) { } @Override - public R visit(final DoStmt n, final A arg) { + public R visit(final DoStmt n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -595,7 +595,7 @@ public R visit(final DoStmt n, final A arg) { } @Override - public R visit(final DoubleLiteralExpr n, final A arg) { + public R visit(final DoubleLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -606,7 +606,7 @@ public R visit(final DoubleLiteralExpr n, final A arg) { } @Override - public R visit(final EmptyStmt n, final A arg) { + public R visit(final EmptyStmt n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -617,7 +617,7 @@ public R visit(final EmptyStmt n, final A arg) { } @Override - public R visit(final EnclosedExpr n, final A arg) { + public R visit(final EnclosedExpr n, final A arg) { R result; { result = n.getInner().accept(this, arg); @@ -633,7 +633,7 @@ public R visit(final EnclosedExpr n, final A arg) { } @Override - public R visit(final EnumConstantDeclaration n, final A arg) { + public R visit(final EnumConstantDeclaration n, final A arg) { R result; { result = n.getArguments().accept(this, arg); @@ -664,7 +664,7 @@ public R visit(final EnumConstantDeclaration n, final A arg) { } @Override - public R visit(final EnumDeclaration n, final A arg) { + public R visit(final EnumDeclaration n, final A arg) { R result; { result = n.getEntries().accept(this, arg); @@ -705,7 +705,7 @@ public R visit(final EnumDeclaration n, final A arg) { } @Override - public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { R result; { result = n.getArguments().accept(this, arg); @@ -731,7 +731,7 @@ public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { } @Override - public R visit(final ExpressionStmt n, final A arg) { + public R visit(final ExpressionStmt n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -747,7 +747,7 @@ public R visit(final ExpressionStmt n, final A arg) { } @Override - public R visit(final FieldAccessExpr n, final A arg) { + public R visit(final FieldAccessExpr n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -773,7 +773,7 @@ public R visit(final FieldAccessExpr n, final A arg) { } @Override - public R visit(final FieldDeclaration n, final A arg) { + public R visit(final FieldDeclaration n, final A arg) { R result; { result = n.getModifiers().accept(this, arg); @@ -799,7 +799,7 @@ public R visit(final FieldDeclaration n, final A arg) { } @Override - public R visit(final ForEachStmt n, final A arg) { + public R visit(final ForEachStmt n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -830,7 +830,7 @@ public R visit(final ForEachStmt n, final A arg) { } @Override - public R visit(final ForStmt n, final A arg) { + public R visit(final ForStmt n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -866,7 +866,7 @@ public R visit(final ForStmt n, final A arg) { } @Override - public R visit(final IfStmt n, final A arg) { + public R visit(final IfStmt n, final A arg) { R result; { result = n.getCondition().accept(this, arg); @@ -892,7 +892,7 @@ public R visit(final IfStmt n, final A arg) { } @Override - public R visit(final InitializerDeclaration n, final A arg) { + public R visit(final InitializerDeclaration n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -913,7 +913,7 @@ public R visit(final InitializerDeclaration n, final A arg) { } @Override - public R visit(final InstanceOfExpr n, final A arg) { + public R visit(final InstanceOfExpr n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -939,7 +939,7 @@ public R visit(final InstanceOfExpr n, final A arg) { } @Override - public R visit(final IntegerLiteralExpr n, final A arg) { + public R visit(final IntegerLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -950,7 +950,7 @@ public R visit(final IntegerLiteralExpr n, final A arg) { } @Override - public R visit(final JavadocComment n, final A arg) { + public R visit(final JavadocComment n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -961,7 +961,7 @@ public R visit(final JavadocComment n, final A arg) { } @Override - public R visit(final LabeledStmt n, final A arg) { + public R visit(final LabeledStmt n, final A arg) { R result; { result = n.getLabel().accept(this, arg); @@ -982,7 +982,7 @@ public R visit(final LabeledStmt n, final A arg) { } @Override - public R visit(final LongLiteralExpr n, final A arg) { + public R visit(final LongLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -993,7 +993,7 @@ public R visit(final LongLiteralExpr n, final A arg) { } @Override - public R visit(final MarkerAnnotationExpr n, final A arg) { + public R visit(final MarkerAnnotationExpr n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1009,7 +1009,7 @@ public R visit(final MarkerAnnotationExpr n, final A arg) { } @Override - public R visit(final MemberValuePair n, final A arg) { + public R visit(final MemberValuePair n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1030,7 +1030,7 @@ public R visit(final MemberValuePair n, final A arg) { } @Override - public R visit(final MethodCallExpr n, final A arg) { + public R visit(final MethodCallExpr n, final A arg) { R result; { result = n.getArguments().accept(this, arg); @@ -1061,7 +1061,7 @@ public R visit(final MethodCallExpr n, final A arg) { } @Override - public R visit(final MethodDeclaration n, final A arg) { + public R visit(final MethodDeclaration n, final A arg) { R result; if (n.getBody().isPresent()) { result = n.getBody().get().accept(this, arg); @@ -1122,7 +1122,7 @@ public R visit(final MethodDeclaration n, final A arg) { } @Override - public R visit(final NameExpr n, final A arg) { + public R visit(final NameExpr n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1138,7 +1138,7 @@ public R visit(final NameExpr n, final A arg) { } @Override - public R visit(final NormalAnnotationExpr n, final A arg) { + public R visit(final NormalAnnotationExpr n, final A arg) { R result; { result = n.getPairs().accept(this, arg); @@ -1159,7 +1159,7 @@ public R visit(final NormalAnnotationExpr n, final A arg) { } @Override - public R visit(final NullLiteralExpr n, final A arg) { + public R visit(final NullLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -1170,7 +1170,7 @@ public R visit(final NullLiteralExpr n, final A arg) { } @Override - public R visit(final ObjectCreationExpr n, final A arg) { + public R visit(final ObjectCreationExpr n, final A arg) { R result; if (n.getAnonymousClassBody().isPresent()) { result = n.getAnonymousClassBody().get().accept(this, arg); @@ -1206,7 +1206,7 @@ public R visit(final ObjectCreationExpr n, final A arg) { } @Override - public R visit(final PackageDeclaration n, final A arg) { + public R visit(final PackageDeclaration n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1227,7 +1227,7 @@ public R visit(final PackageDeclaration n, final A arg) { } @Override - public R visit(final Parameter n, final A arg) { + public R visit(final Parameter n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1263,7 +1263,7 @@ public R visit(final Parameter n, final A arg) { } @Override - public R visit(final PrimitiveType n, final A arg) { + public R visit(final PrimitiveType n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1279,7 +1279,7 @@ public R visit(final PrimitiveType n, final A arg) { } @Override - public R visit(final Name n, final A arg) { + public R visit(final Name n, final A arg) { R result; if (n.getQualifier().isPresent()) { result = n.getQualifier().get().accept(this, arg); @@ -1295,7 +1295,7 @@ public R visit(final Name n, final A arg) { } @Override - public R visit(final SimpleName n, final A arg) { + public R visit(final SimpleName n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -1306,7 +1306,7 @@ public R visit(final SimpleName n, final A arg) { } @Override - public R visit(final ArrayType n, final A arg) { + public R visit(final ArrayType n, final A arg) { R result; { result = n.getComponentType().accept(this, arg); @@ -1327,7 +1327,7 @@ public R visit(final ArrayType n, final A arg) { } @Override - public R visit(final ArrayCreationLevel n, final A arg) { + public R visit(final ArrayCreationLevel n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1348,7 +1348,7 @@ public R visit(final ArrayCreationLevel n, final A arg) { } @Override - public R visit(final IntersectionType n, final A arg) { + public R visit(final IntersectionType n, final A arg) { R result; { result = n.getElements().accept(this, arg); @@ -1369,7 +1369,7 @@ public R visit(final IntersectionType n, final A arg) { } @Override - public R visit(final UnionType n, final A arg) { + public R visit(final UnionType n, final A arg) { R result; { result = n.getElements().accept(this, arg); @@ -1390,7 +1390,7 @@ public R visit(final UnionType n, final A arg) { } @Override - public R visit(final ReturnStmt n, final A arg) { + public R visit(final ReturnStmt n, final A arg) { R result; if (n.getExpression().isPresent()) { result = n.getExpression().get().accept(this, arg); @@ -1406,7 +1406,7 @@ public R visit(final ReturnStmt n, final A arg) { } @Override - public R visit(final SingleMemberAnnotationExpr n, final A arg) { + public R visit(final SingleMemberAnnotationExpr n, final A arg) { R result; { result = n.getMemberValue().accept(this, arg); @@ -1427,7 +1427,7 @@ public R visit(final SingleMemberAnnotationExpr n, final A arg) { } @Override - public R visit(final StringLiteralExpr n, final A arg) { + public R visit(final StringLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -1438,7 +1438,7 @@ public R visit(final StringLiteralExpr n, final A arg) { } @Override - public R visit(final SuperExpr n, final A arg) { + public R visit(final SuperExpr n, final A arg) { R result; if (n.getTypeName().isPresent()) { result = n.getTypeName().get().accept(this, arg); @@ -1454,7 +1454,7 @@ public R visit(final SuperExpr n, final A arg) { } @Override - public R visit(final SwitchEntry n, final A arg) { + public R visit(final SwitchEntry n, final A arg) { R result; if (n.getGuard().isPresent()) { result = n.getGuard().get().accept(this, arg); @@ -1480,7 +1480,7 @@ public R visit(final SwitchEntry n, final A arg) { } @Override - public R visit(final SwitchStmt n, final A arg) { + public R visit(final SwitchStmt n, final A arg) { R result; { result = n.getEntries().accept(this, arg); @@ -1501,7 +1501,7 @@ public R visit(final SwitchStmt n, final A arg) { } @Override - public R visit(final SynchronizedStmt n, final A arg) { + public R visit(final SynchronizedStmt n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -1522,7 +1522,7 @@ public R visit(final SynchronizedStmt n, final A arg) { } @Override - public R visit(final ThisExpr n, final A arg) { + public R visit(final ThisExpr n, final A arg) { R result; if (n.getTypeName().isPresent()) { result = n.getTypeName().get().accept(this, arg); @@ -1538,7 +1538,7 @@ public R visit(final ThisExpr n, final A arg) { } @Override - public R visit(final ThrowStmt n, final A arg) { + public R visit(final ThrowStmt n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -1554,7 +1554,7 @@ public R visit(final ThrowStmt n, final A arg) { } @Override - public R visit(final TryStmt n, final A arg) { + public R visit(final TryStmt n, final A arg) { R result; { result = n.getCatchClauses().accept(this, arg); @@ -1585,7 +1585,7 @@ public R visit(final TryStmt n, final A arg) { } @Override - public R visit(final LocalClassDeclarationStmt n, final A arg) { + public R visit(final LocalClassDeclarationStmt n, final A arg) { R result; { result = n.getClassDeclaration().accept(this, arg); @@ -1601,7 +1601,7 @@ public R visit(final LocalClassDeclarationStmt n, final A arg) { } @Override - public R visit(final LocalRecordDeclarationStmt n, final A arg) { + public R visit(final LocalRecordDeclarationStmt n, final A arg) { R result; { result = n.getRecordDeclaration().accept(this, arg); @@ -1617,7 +1617,7 @@ public R visit(final LocalRecordDeclarationStmt n, final A arg) { } @Override - public R visit(final TypeParameter n, final A arg) { + public R visit(final TypeParameter n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1643,7 +1643,7 @@ public R visit(final TypeParameter n, final A arg) { } @Override - public R visit(final UnaryExpr n, final A arg) { + public R visit(final UnaryExpr n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -1659,7 +1659,7 @@ public R visit(final UnaryExpr n, final A arg) { } @Override - public R visit(final UnknownType n, final A arg) { + public R visit(final UnknownType n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1675,7 +1675,7 @@ public R visit(final UnknownType n, final A arg) { } @Override - public R visit(final VariableDeclarationExpr n, final A arg) { + public R visit(final VariableDeclarationExpr n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1701,7 +1701,7 @@ public R visit(final VariableDeclarationExpr n, final A arg) { } @Override - public R visit(final VariableDeclarator n, final A arg) { + public R visit(final VariableDeclarator n, final A arg) { R result; if (n.getInitializer().isPresent()) { result = n.getInitializer().get().accept(this, arg); @@ -1727,7 +1727,7 @@ public R visit(final VariableDeclarator n, final A arg) { } @Override - public R visit(final VoidType n, final A arg) { + public R visit(final VoidType n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1743,7 +1743,7 @@ public R visit(final VoidType n, final A arg) { } @Override - public R visit(final WhileStmt n, final A arg) { + public R visit(final WhileStmt n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -1769,7 +1769,7 @@ public R visit(final WhileStmt n, final A arg) { } @Override - public R visit(final WildcardType n, final A arg) { + public R visit(final WildcardType n, final A arg) { R result; if (n.getExtendedType().isPresent()) { result = n.getExtendedType().get().accept(this, arg); @@ -1795,7 +1795,7 @@ public R visit(final WildcardType n, final A arg) { } @Override - public R visit(final LambdaExpr n, final A arg) { + public R visit(final LambdaExpr n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -1821,7 +1821,7 @@ public R visit(final LambdaExpr n, final A arg) { } @Override - public R visit(final MethodReferenceExpr n, final A arg) { + public R visit(final MethodReferenceExpr n, final A arg) { R result; { result = n.getScope().accept(this, arg); @@ -1842,7 +1842,7 @@ public R visit(final MethodReferenceExpr n, final A arg) { } @Override - public R visit(final TypeExpr n, final A arg) { + public R visit(final TypeExpr n, final A arg) { R result; { result = n.getType().accept(this, arg); @@ -1858,7 +1858,7 @@ public R visit(final TypeExpr n, final A arg) { } @Override - public R visit(final ImportDeclaration n, final A arg) { + public R visit(final ImportDeclaration n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1874,7 +1874,7 @@ public R visit(final ImportDeclaration n, final A arg) { } @Override - public R visit(final BlockComment n, final A arg) { + public R visit(final BlockComment n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -1885,7 +1885,7 @@ public R visit(final BlockComment n, final A arg) { } @Override - public R visit(final LineComment n, final A arg) { + public R visit(final LineComment n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -1896,7 +1896,7 @@ public R visit(final LineComment n, final A arg) { } @Override - public R visit(NodeList n, A arg) { + public R visit(NodeList n, A arg) { for (final Object v : n) { R result = ((Node) v).accept(this, arg); if (result != null) { @@ -1907,7 +1907,7 @@ public R visit(NodeList n, A arg) { } @Override - public R visit(final ModuleDeclaration n, final A arg) { + public R visit(final ModuleDeclaration n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -1933,7 +1933,7 @@ public R visit(final ModuleDeclaration n, final A arg) { } @Override - public R visit(final ModuleRequiresDirective n, final A arg) { + public R visit(final ModuleRequiresDirective n, final A arg) { R result; { result = n.getModifiers().accept(this, arg); @@ -1954,7 +1954,7 @@ public R visit(final ModuleRequiresDirective n, final A arg) { } @Override() - public R visit(final ModuleExportsDirective n, final A arg) { + public R visit(final ModuleExportsDirective n, final A arg) { R result; { result = n.getModuleNames().accept(this, arg); @@ -1975,7 +1975,7 @@ public R visit(final ModuleExportsDirective n, final A arg) { } @Override() - public R visit(final ModuleProvidesDirective n, final A arg) { + public R visit(final ModuleProvidesDirective n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -1996,7 +1996,7 @@ public R visit(final ModuleProvidesDirective n, final A arg) { } @Override() - public R visit(final ModuleUsesDirective n, final A arg) { + public R visit(final ModuleUsesDirective n, final A arg) { R result; { result = n.getName().accept(this, arg); @@ -2012,7 +2012,7 @@ public R visit(final ModuleUsesDirective n, final A arg) { } @Override - public R visit(final ModuleOpensDirective n, final A arg) { + public R visit(final ModuleOpensDirective n, final A arg) { R result; { result = n.getModuleNames().accept(this, arg); @@ -2033,7 +2033,7 @@ public R visit(final ModuleOpensDirective n, final A arg) { } @Override - public R visit(final UnparsableStmt n, final A arg) { + public R visit(final UnparsableStmt n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -2044,7 +2044,7 @@ public R visit(final UnparsableStmt n, final A arg) { } @Override - public R visit(final ReceiverParameter n, final A arg) { + public R visit(final ReceiverParameter n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -2070,7 +2070,7 @@ public R visit(final ReceiverParameter n, final A arg) { } @Override - public R visit(final VarType n, final A arg) { + public R visit(final VarType n, final A arg) { R result; { result = n.getAnnotations().accept(this, arg); @@ -2086,7 +2086,7 @@ public R visit(final VarType n, final A arg) { } @Override - public R visit(final Modifier n, final A arg) { + public R visit(final Modifier n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -2097,7 +2097,7 @@ public R visit(final Modifier n, final A arg) { } @Override - public R visit(final SwitchExpr n, final A arg) { + public R visit(final SwitchExpr n, final A arg) { R result; { result = n.getEntries().accept(this, arg); @@ -2118,7 +2118,7 @@ public R visit(final SwitchExpr n, final A arg) { } @Override - public R visit(final YieldStmt n, final A arg) { + public R visit(final YieldStmt n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -2134,7 +2134,7 @@ public R visit(final YieldStmt n, final A arg) { } @Override - public R visit(final TextBlockLiteralExpr n, final A arg) { + public R visit(final TextBlockLiteralExpr n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -2145,7 +2145,7 @@ public R visit(final TextBlockLiteralExpr n, final A arg) { } @Override - public R visit(final TypePatternExpr n, final A arg) { + public R visit(final TypePatternExpr n, final A arg) { R result; { result = n.getModifiers().accept(this, arg); @@ -2171,7 +2171,7 @@ public R visit(final TypePatternExpr n, final A arg) { } @Override - public R visit(final JmlQuantifiedExpr n, final A arg) { + public R visit(final JmlQuantifiedExpr n, final A arg) { R result; { result = n.getExpressions().accept(this, arg); @@ -2192,7 +2192,7 @@ public R visit(final JmlQuantifiedExpr n, final A arg) { } @Override - public R visit(final JmlClauseLabel n, final A arg) { + public R visit(final JmlClauseLabel n, final A arg) { R result; { result = n.getExpr().accept(this, arg); @@ -2218,7 +2218,7 @@ public R visit(final JmlClauseLabel n, final A arg) { } @Override - public R visit(final JmlExpressionStmt n, final A arg) { + public R visit(final JmlExpressionStmt n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -2239,7 +2239,7 @@ public R visit(final JmlExpressionStmt n, final A arg) { } @Override - public R visit(final JmlLabelExpr n, final A arg) { + public R visit(final JmlLabelExpr n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -2260,7 +2260,7 @@ public R visit(final JmlLabelExpr n, final A arg) { } @Override - public R visit(final JmlLetExpr n, final A arg) { + public R visit(final JmlLetExpr n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -2281,7 +2281,7 @@ public R visit(final JmlLetExpr n, final A arg) { } @Override - public R visit(final JmlMultiCompareExpr n, final A arg) { + public R visit(final JmlMultiCompareExpr n, final A arg) { R result; { result = n.getExpressions().accept(this, arg); @@ -2297,7 +2297,7 @@ public R visit(final JmlMultiCompareExpr n, final A arg) { } @Override - public R visit(final JmlSimpleExprClause n, final A arg) { + public R visit(final JmlSimpleExprClause n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -2323,7 +2323,7 @@ public R visit(final JmlSimpleExprClause n, final A arg) { } @Override - public R visit(final JmlSignalsClause n, final A arg) { + public R visit(final JmlSignalsClause n, final A arg) { R result; { result = n.getExpression().accept(this, arg); @@ -2349,7 +2349,7 @@ public R visit(final JmlSignalsClause n, final A arg) { } @Override - public R visit(final JmlSignalsOnlyClause n, final A arg) { + public R visit(final JmlSignalsOnlyClause n, final A arg) { R result; { result = n.getTypes().accept(this, arg); @@ -2370,7 +2370,7 @@ public R visit(final JmlSignalsOnlyClause n, final A arg) { } @Override - public R visit(final JmlUnreachableStmt n, final A arg) { + public R visit(final JmlUnreachableStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -2386,7 +2386,7 @@ public R visit(final JmlUnreachableStmt n, final A arg) { } @Override - public R visit(final JmlCallableClause n, final A arg) { + public R visit(final JmlCallableClause n, final A arg) { R result; { result = n.getMethodSignatures().accept(this, arg); @@ -2407,7 +2407,7 @@ public R visit(final JmlCallableClause n, final A arg) { } @Override - public R visit(final JmlForallClause n, final A arg) { + public R visit(final JmlForallClause n, final A arg) { R result; { result = n.getBoundedVariables().accept(this, arg); @@ -2428,7 +2428,7 @@ public R visit(final JmlForallClause n, final A arg) { } @Override - public R visit(final JmlRefiningStmt n, final A arg) { + public R visit(final JmlRefiningStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -2444,7 +2444,7 @@ public R visit(final JmlRefiningStmt n, final A arg) { } @Override - public R visit(final JmlClauseIf n, final A arg) { + public R visit(final JmlClauseIf n, final A arg) { R result; { result = n.getCondition().accept(this, arg); @@ -2470,7 +2470,7 @@ public R visit(final JmlClauseIf n, final A arg) { } @Override - public R visit(final JmlClassExprDeclaration n, final A arg) { + public R visit(final JmlClassExprDeclaration n, final A arg) { R result; { result = n.getInvariant().accept(this, arg); @@ -2511,7 +2511,7 @@ public R visit(final JmlClassExprDeclaration n, final A arg) { } @Override - public R visit(final JmlClassAccessibleDeclaration n, final A arg) { + public R visit(final JmlClassAccessibleDeclaration n, final A arg) { R result; { result = n.getExpressions().accept(this, arg); @@ -2552,7 +2552,7 @@ public R visit(final JmlClassAccessibleDeclaration n, final A arg) { } @Override - public R visit(final JmlRepresentsDeclaration n, final A arg) { + public R visit(final JmlRepresentsDeclaration n, final A arg) { R result; { result = n.getExpr().accept(this, arg); @@ -2588,7 +2588,7 @@ public R visit(final JmlRepresentsDeclaration n, final A arg) { } @Override - public R visit(final JmlContract n, final A arg) { + public R visit(final JmlContract n, final A arg) { R result; { result = n.getClauses().accept(this, arg); @@ -2624,7 +2624,7 @@ public R visit(final JmlContract n, final A arg) { } @Override - public R visit(final JmlSetComprehensionExpr n, final A arg) { + public R visit(final JmlSetComprehensionExpr n, final A arg) { R result; { result = n.getBinding().accept(this, arg); @@ -2645,7 +2645,7 @@ public R visit(final JmlSetComprehensionExpr n, final A arg) { } @Override - public R visit(final JmlGhostStmt n, final A arg) { + public R visit(final JmlGhostStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -2666,7 +2666,7 @@ public R visit(final JmlGhostStmt n, final A arg) { } @Override - public R visit(final RecordDeclaration n, final A arg) { + public R visit(final RecordDeclaration n, final A arg) { R result; { result = n.getImplementedTypes().accept(this, arg); @@ -2717,7 +2717,7 @@ public R visit(final RecordDeclaration n, final A arg) { } @Override - public R visit(final CompactConstructorDeclaration n, final A arg) { + public R visit(final CompactConstructorDeclaration n, final A arg) { R result; { result = n.getBody().accept(this, arg); @@ -2758,7 +2758,7 @@ public R visit(final CompactConstructorDeclaration n, final A arg) { } @Override - public R visit(final RecordPatternExpr n, final A arg) { + public R visit(final RecordPatternExpr n, final A arg) { R result; { result = n.getModifiers().accept(this, arg); @@ -2784,7 +2784,7 @@ public R visit(final RecordPatternExpr n, final A arg) { } @Override - public R visit(final JmlMethodDeclaration n, final A arg) { + public R visit(final JmlMethodDeclaration n, final A arg) { R result; if (n.getContract().isPresent()) { result = n.getContract().get().accept(this, arg); @@ -2815,7 +2815,7 @@ public R visit(final JmlMethodDeclaration n, final A arg) { } @Override - public R visit(final JmlBinaryInfixExpr n, final A arg) { + public R visit(final JmlBinaryInfixExpr n, final A arg) { R result; { result = n.getLeft().accept(this, arg); @@ -2841,7 +2841,7 @@ public R visit(final JmlBinaryInfixExpr n, final A arg) { } @Override - public R visit(final JmlDocDeclaration n, final A arg) { + public R visit(final JmlDocDeclaration n, final A arg) { R result; { result = n.getJmlComments().accept(this, arg); @@ -2862,7 +2862,7 @@ public R visit(final JmlDocDeclaration n, final A arg) { } @Override - public R visit(final JmlDocStmt n, final A arg) { + public R visit(final JmlDocStmt n, final A arg) { R result; { result = n.getJmlComments().accept(this, arg); @@ -2878,7 +2878,7 @@ public R visit(final JmlDocStmt n, final A arg) { } @Override - public R visit(final JmlDoc n, final A arg) { + public R visit(final JmlDoc n, final A arg) { R result; if (n.getComment().isPresent()) { result = n.getComment().get().accept(this, arg); @@ -2889,7 +2889,7 @@ public R visit(final JmlDoc n, final A arg) { } @Override - public R visit(final JmlDocType n, final A arg) { + public R visit(final JmlDocType n, final A arg) { R result; { result = n.getJmlComments().accept(this, arg); @@ -2925,7 +2925,7 @@ public R visit(final JmlDocType n, final A arg) { } @Override - public R visit(final JmlFieldDeclaration n, final A arg) { + public R visit(final JmlFieldDeclaration n, final A arg) { R result; { result = n.getDecl().accept(this, arg); @@ -2951,7 +2951,7 @@ public R visit(final JmlFieldDeclaration n, final A arg) { } @Override - public R visit(final JmlOldClause n, final A arg) { + public R visit(final JmlOldClause n, final A arg) { R result; { result = n.getDeclarations().accept(this, arg); @@ -2972,7 +2972,7 @@ public R visit(final JmlOldClause n, final A arg) { } @Override - public R visit(final JmlTypeExpr n, final A arg) { + public R visit(final JmlTypeExpr n, final A arg) { R result; { result = n.getType().accept(this, arg); @@ -2988,7 +2988,7 @@ public R visit(final JmlTypeExpr n, final A arg) { } @Override - public R visit(final JmlMultiExprClause n, final A arg) { + public R visit(final JmlMultiExprClause n, final A arg) { R result; { result = n.getExpressions().accept(this, arg); @@ -3014,7 +3014,7 @@ public R visit(final JmlMultiExprClause n, final A arg) { } @Override - public R visit(final JmlBeginStmt n, final A arg) { + public R visit(final JmlBeginStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -3030,7 +3030,7 @@ public R visit(final JmlBeginStmt n, final A arg) { } @Override - public R visit(final JmlEndStmt n, final A arg) { + public R visit(final JmlEndStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -3046,7 +3046,7 @@ public R visit(final JmlEndStmt n, final A arg) { } @Override - public R visit(final JmlLabelStmt n, final A arg) { + public R visit(final JmlLabelStmt n, final A arg) { R result; { result = n.getJmlTags().accept(this, arg); @@ -3067,7 +3067,7 @@ public R visit(final JmlLabelStmt n, final A arg) { } @Override - public R visit(final JmlMethodSignature n, final A arg) { + public R visit(final JmlMethodSignature n, final A arg) { R result; { result = n.getArgumentTypes().accept(this, arg); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java index 2cd68b9ed4..85c1675f71 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/GenericVisitorWithDefaults.java @@ -44,689 +44,689 @@ public abstract class GenericVisitorWithDefaults implements GenericVisitor /** * This will be called by every node visit method that is not overridden. */ - public R defaultAction(Node n, A arg) { + public R defaultAction(Node n, A arg) { return null; } /** * This will be called by the NodeList visit method when it is not overridden. */ - public R defaultAction(NodeList n, A arg) { + public R defaultAction(NodeList n, A arg) { return null; } @Override - public R visit(final AnnotationDeclaration n, final A arg) { + public R visit(final AnnotationDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final AnnotationMemberDeclaration n, final A arg) { + public R visit(final AnnotationMemberDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ArrayAccessExpr n, final A arg) { + public R visit(final ArrayAccessExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ArrayCreationExpr n, final A arg) { + public R visit(final ArrayCreationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ArrayInitializerExpr n, final A arg) { + public R visit(final ArrayInitializerExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final AssertStmt n, final A arg) { + public R visit(final AssertStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final AssignExpr n, final A arg) { + public R visit(final AssignExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final BinaryExpr n, final A arg) { + public R visit(final BinaryExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final BlockStmt n, final A arg) { + public R visit(final BlockStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final BooleanLiteralExpr n, final A arg) { + public R visit(final BooleanLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final BreakStmt n, final A arg) { + public R visit(final BreakStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final CastExpr n, final A arg) { + public R visit(final CastExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final CatchClause n, final A arg) { + public R visit(final CatchClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final CharLiteralExpr n, final A arg) { + public R visit(final CharLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ClassExpr n, final A arg) { + public R visit(final ClassExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ClassOrInterfaceDeclaration n, final A arg) { + public R visit(final ClassOrInterfaceDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ClassOrInterfaceType n, final A arg) { + public R visit(final ClassOrInterfaceType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final CompilationUnit n, final A arg) { + public R visit(final CompilationUnit n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ConditionalExpr n, final A arg) { + public R visit(final ConditionalExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ConstructorDeclaration n, final A arg) { + public R visit(final ConstructorDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ContinueStmt n, final A arg) { + public R visit(final ContinueStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final DoStmt n, final A arg) { + public R visit(final DoStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final DoubleLiteralExpr n, final A arg) { + public R visit(final DoubleLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final EmptyStmt n, final A arg) { + public R visit(final EmptyStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final EnclosedExpr n, final A arg) { + public R visit(final EnclosedExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final EnumConstantDeclaration n, final A arg) { + public R visit(final EnumConstantDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final EnumDeclaration n, final A arg) { + public R visit(final EnumDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public R visit(final ExplicitConstructorInvocationStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ExpressionStmt n, final A arg) { + public R visit(final ExpressionStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final FieldAccessExpr n, final A arg) { + public R visit(final FieldAccessExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final FieldDeclaration n, final A arg) { + public R visit(final FieldDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ForEachStmt n, final A arg) { + public R visit(final ForEachStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ForStmt n, final A arg) { + public R visit(final ForStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final IfStmt n, final A arg) { + public R visit(final IfStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final InitializerDeclaration n, final A arg) { + public R visit(final InitializerDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final InstanceOfExpr n, final A arg) { + public R visit(final InstanceOfExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final IntegerLiteralExpr n, final A arg) { + public R visit(final IntegerLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JavadocComment n, final A arg) { + public R visit(final JavadocComment n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LabeledStmt n, final A arg) { + public R visit(final LabeledStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LongLiteralExpr n, final A arg) { + public R visit(final LongLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final MarkerAnnotationExpr n, final A arg) { + public R visit(final MarkerAnnotationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final MemberValuePair n, final A arg) { + public R visit(final MemberValuePair n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final MethodCallExpr n, final A arg) { + public R visit(final MethodCallExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final MethodDeclaration n, final A arg) { + public R visit(final MethodDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final NameExpr n, final A arg) { + public R visit(final NameExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final NormalAnnotationExpr n, final A arg) { + public R visit(final NormalAnnotationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final NullLiteralExpr n, final A arg) { + public R visit(final NullLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ObjectCreationExpr n, final A arg) { + public R visit(final ObjectCreationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final PackageDeclaration n, final A arg) { + public R visit(final PackageDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final Parameter n, final A arg) { + public R visit(final Parameter n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final PrimitiveType n, final A arg) { + public R visit(final PrimitiveType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final Name n, final A arg) { + public R visit(final Name n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SimpleName n, final A arg) { + public R visit(final SimpleName n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ArrayType n, final A arg) { + public R visit(final ArrayType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ArrayCreationLevel n, final A arg) { + public R visit(final ArrayCreationLevel n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final IntersectionType n, final A arg) { + public R visit(final IntersectionType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final UnionType n, final A arg) { + public R visit(final UnionType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ReturnStmt n, final A arg) { + public R visit(final ReturnStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SingleMemberAnnotationExpr n, final A arg) { + public R visit(final SingleMemberAnnotationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final StringLiteralExpr n, final A arg) { + public R visit(final StringLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SuperExpr n, final A arg) { + public R visit(final SuperExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SwitchEntry n, final A arg) { + public R visit(final SwitchEntry n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SwitchStmt n, final A arg) { + public R visit(final SwitchStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SynchronizedStmt n, final A arg) { + public R visit(final SynchronizedStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ThisExpr n, final A arg) { + public R visit(final ThisExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ThrowStmt n, final A arg) { + public R visit(final ThrowStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final TryStmt n, final A arg) { + public R visit(final TryStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LocalClassDeclarationStmt n, final A arg) { + public R visit(final LocalClassDeclarationStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LocalRecordDeclarationStmt n, final A arg) { + public R visit(final LocalRecordDeclarationStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final TypeParameter n, final A arg) { + public R visit(final TypeParameter n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final UnaryExpr n, final A arg) { + public R visit(final UnaryExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final UnknownType n, final A arg) { + public R visit(final UnknownType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final VariableDeclarationExpr n, final A arg) { + public R visit(final VariableDeclarationExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final VariableDeclarator n, final A arg) { + public R visit(final VariableDeclarator n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final VoidType n, final A arg) { + public R visit(final VoidType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final WhileStmt n, final A arg) { + public R visit(final WhileStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final WildcardType n, final A arg) { + public R visit(final WildcardType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LambdaExpr n, final A arg) { + public R visit(final LambdaExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final MethodReferenceExpr n, final A arg) { + public R visit(final MethodReferenceExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final TypeExpr n, final A arg) { + public R visit(final TypeExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ImportDeclaration n, final A arg) { + public R visit(final ImportDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final BlockComment n, final A arg) { + public R visit(final BlockComment n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final LineComment n, final A arg) { + public R visit(final LineComment n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(NodeList n, A arg) { + public R visit(NodeList n, A arg) { return defaultAction(n, arg); } @Override - public R visit(final ModuleDeclaration n, final A arg) { + public R visit(final ModuleDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ModuleRequiresDirective n, final A arg) { + public R visit(final ModuleRequiresDirective n, final A arg) { return defaultAction(n, arg); } @Override() - public R visit(final ModuleExportsDirective n, final A arg) { + public R visit(final ModuleExportsDirective n, final A arg) { return defaultAction(n, arg); } @Override() - public R visit(final ModuleProvidesDirective n, final A arg) { + public R visit(final ModuleProvidesDirective n, final A arg) { return defaultAction(n, arg); } @Override() - public R visit(final ModuleUsesDirective n, final A arg) { + public R visit(final ModuleUsesDirective n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ModuleOpensDirective n, final A arg) { + public R visit(final ModuleOpensDirective n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final UnparsableStmt n, final A arg) { + public R visit(final UnparsableStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final ReceiverParameter n, final A arg) { + public R visit(final ReceiverParameter n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final VarType n, final A arg) { + public R visit(final VarType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final Modifier n, final A arg) { + public R visit(final Modifier n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final SwitchExpr n, final A arg) { + public R visit(final SwitchExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final YieldStmt n, final A arg) { + public R visit(final YieldStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final TextBlockLiteralExpr n, final A arg) { + public R visit(final TextBlockLiteralExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final TypePatternExpr n, final A arg) { + public R visit(final TypePatternExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlQuantifiedExpr n, final A arg) { + public R visit(final JmlQuantifiedExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlClauseLabel n, final A arg) { + public R visit(final JmlClauseLabel n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlExpressionStmt n, final A arg) { + public R visit(final JmlExpressionStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlLabelExpr n, final A arg) { + public R visit(final JmlLabelExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlLetExpr n, final A arg) { + public R visit(final JmlLetExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlMultiCompareExpr n, final A arg) { + public R visit(final JmlMultiCompareExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlSimpleExprClause n, final A arg) { + public R visit(final JmlSimpleExprClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlSignalsClause n, final A arg) { + public R visit(final JmlSignalsClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlSignalsOnlyClause n, final A arg) { + public R visit(final JmlSignalsOnlyClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlUnreachableStmt n, final A arg) { + public R visit(final JmlUnreachableStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlCallableClause n, final A arg) { + public R visit(final JmlCallableClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlForallClause n, final A arg) { + public R visit(final JmlForallClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlRefiningStmt n, final A arg) { + public R visit(final JmlRefiningStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlClauseIf n, final A arg) { + public R visit(final JmlClauseIf n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlClassExprDeclaration n, final A arg) { + public R visit(final JmlClassExprDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlClassAccessibleDeclaration n, final A arg) { + public R visit(final JmlClassAccessibleDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlRepresentsDeclaration n, final A arg) { + public R visit(final JmlRepresentsDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlContract n, final A arg) { + public R visit(final JmlContract n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlSetComprehensionExpr n, final A arg) { + public R visit(final JmlSetComprehensionExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlGhostStmt n, final A arg) { + public R visit(final JmlGhostStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final RecordDeclaration n, final A arg) { + public R visit(final RecordDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final CompactConstructorDeclaration n, final A arg) { + public R visit(final CompactConstructorDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final RecordPatternExpr n, final A arg) { + public R visit(final RecordPatternExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlMethodDeclaration n, final A arg) { + public R visit(final JmlMethodDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlBinaryInfixExpr n, final A arg) { + public R visit(final JmlBinaryInfixExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlDocDeclaration n, final A arg) { + public R visit(final JmlDocDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlDocStmt n, final A arg) { + public R visit(final JmlDocStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlDoc n, final A arg) { + public R visit(final JmlDoc n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlDocType n, final A arg) { + public R visit(final JmlDocType n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlFieldDeclaration n, final A arg) { + public R visit(final JmlFieldDeclaration n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlOldClause n, final A arg) { + public R visit(final JmlOldClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlTypeExpr n, final A arg) { + public R visit(final JmlTypeExpr n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlMultiExprClause n, final A arg) { + public R visit(final JmlMultiExprClause n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlBeginStmt n, final A arg) { + public R visit(final JmlBeginStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlEndStmt n, final A arg) { + public R visit(final JmlEndStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlLabelStmt n, final A arg) { + public R visit(final JmlLabelStmt n, final A arg) { return defaultAction(n, arg); } @Override - public R visit(final JmlMethodSignature n, final A arg) { + public R visit(final JmlMethodSignature n, final A arg) { return defaultAction(n, arg); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java index b97e9ecba5..3faf11f9b9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/HashCodeVisitor.java @@ -43,7 +43,7 @@ * A visitor that calculates a deep hash code for a node by using the hash codes of all its properties, * and the hash codes of all its child nodes (by visiting those too.) */ -public class HashCodeVisitor implements GenericVisitor { +public class HashCodeVisitor implements GenericVisitor { private static final HashCodeVisitor SINGLETON = new HashCodeVisitor(); @@ -55,231 +55,231 @@ public static int hashCode(final Node node) { return node.accept(SINGLETON, null); } - public Integer visit(final AnnotationDeclaration n, final Void arg) { + public Integer visit(final AnnotationDeclaration n, final Void arg) { return (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { + public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { return (n.getDefaultValue().isPresent() ? n.getDefaultValue().get().accept(this, arg) : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ArrayAccessExpr n, final Void arg) { + public Integer visit(final ArrayAccessExpr n, final Void arg) { return (n.getIndex().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ArrayCreationExpr n, final Void arg) { + public Integer visit(final ArrayCreationExpr n, final Void arg) { return (n.getElementType().accept(this, arg)) * 31 + (n.getInitializer().isPresent() ? n.getInitializer().get().accept(this, arg) : 0) * 31 + (n.getLevels().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ArrayCreationLevel n, final Void arg) { + public Integer visit(final ArrayCreationLevel n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getDimension().isPresent() ? n.getDimension().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ArrayInitializerExpr n, final Void arg) { + public Integer visit(final ArrayInitializerExpr n, final Void arg) { return (n.getValues().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ArrayType n, final Void arg) { + public Integer visit(final ArrayType n, final Void arg) { return (n.getComponentType().accept(this, arg)) * 31 + (n.getOrigin().hashCode()) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final AssertStmt n, final Void arg) { + public Integer visit(final AssertStmt n, final Void arg) { return (n.getCheck().accept(this, arg)) * 31 + (n.getMessage().isPresent() ? n.getMessage().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final AssignExpr n, final Void arg) { + public Integer visit(final AssignExpr n, final Void arg) { return (n.getOperator().hashCode()) * 31 + (n.getTarget().accept(this, arg)) * 31 + (n.getValue().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final BinaryExpr n, final Void arg) { + public Integer visit(final BinaryExpr n, final Void arg) { return (n.getLeft().accept(this, arg)) * 31 + (n.getOperator().hashCode()) * 31 + (n.getRight().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final BlockComment n, final Void arg) { + public Integer visit(final BlockComment n, final Void arg) { return (n.getContent().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final BlockStmt n, final Void arg) { + public Integer visit(final BlockStmt n, final Void arg) { return (n.getContracts().accept(this, arg)) * 31 + (n.getStatements().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final BooleanLiteralExpr n, final Void arg) { + public Integer visit(final BooleanLiteralExpr n, final Void arg) { return (n.isValue() ? 1 : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final BreakStmt n, final Void arg) { + public Integer visit(final BreakStmt n, final Void arg) { return (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final CastExpr n, final Void arg) { + public Integer visit(final CastExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final CatchClause n, final Void arg) { + public Integer visit(final CatchClause n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getParameter().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final CharLiteralExpr n, final Void arg) { + public Integer visit(final CharLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ClassExpr n, final Void arg) { + public Integer visit(final ClassExpr n, final Void arg) { return (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { + public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { return (n.getExtendedTypes().accept(this, arg)) * 31 + (n.getImplementedTypes().accept(this, arg)) * 31 + (n.isInterface() ? 1 : 0) * 31 + (n.getPermittedTypes().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ClassOrInterfaceType n, final Void arg) { + public Integer visit(final ClassOrInterfaceType n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final CompilationUnit n, final Void arg) { + public Integer visit(final CompilationUnit n, final Void arg) { return (n.getImports().accept(this, arg)) * 31 + (n.getModule().isPresent() ? n.getModule().get().accept(this, arg) : 0) * 31 + (n.getPackageDeclaration().isPresent() ? n.getPackageDeclaration().get().accept(this, arg) : 0) * 31 + (n.getTypes().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ConditionalExpr n, final Void arg) { + public Integer visit(final ConditionalExpr n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getElseExpr().accept(this, arg)) * 31 + (n.getThenExpr().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ConstructorDeclaration n, final Void arg) { + public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ContinueStmt n, final Void arg) { + public Integer visit(final ContinueStmt n, final Void arg) { return (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final DoStmt n, final Void arg) { + public Integer visit(final DoStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCondition().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final DoubleLiteralExpr n, final Void arg) { + public Integer visit(final DoubleLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final EmptyStmt n, final Void arg) { + public Integer visit(final EmptyStmt n, final Void arg) { return (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final EnclosedExpr n, final Void arg) { + public Integer visit(final EnclosedExpr n, final Void arg) { return (n.getInner().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final EnumConstantDeclaration n, final Void arg) { + public Integer visit(final EnumConstantDeclaration n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getClassBody().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final EnumDeclaration n, final Void arg) { + public Integer visit(final EnumDeclaration n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getImplementedTypes().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { + public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getExpression().isPresent() ? n.getExpression().get().accept(this, arg) : 0) * 31 + (n.isThis() ? 1 : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ExpressionStmt n, final Void arg) { + public Integer visit(final ExpressionStmt n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final FieldAccessExpr n, final Void arg) { + public Integer visit(final FieldAccessExpr n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getScope().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final FieldDeclaration n, final Void arg) { + public Integer visit(final FieldDeclaration n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ForStmt n, final Void arg) { + public Integer visit(final ForStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCompare().isPresent() ? n.getCompare().get().accept(this, arg) : 0) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getInitialization().accept(this, arg)) * 31 + (n.getUpdate().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ForEachStmt n, final Void arg) { + public Integer visit(final ForEachStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getIterable().accept(this, arg)) * 31 + (n.getVariable().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final IfStmt n, final Void arg) { + public Integer visit(final IfStmt n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getElseStmt().isPresent() ? n.getElseStmt().get().accept(this, arg) : 0) * 31 + (n.getThenStmt().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ImportDeclaration n, final Void arg) { + public Integer visit(final ImportDeclaration n, final Void arg) { return (n.isAsterisk() ? 1 : 0) * 31 + (n.isJmlModel() ? 1 : 0) * 31 + (n.isStatic() ? 1 : 0) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final InitializerDeclaration n, final Void arg) { + public Integer visit(final InitializerDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.isStatic() ? 1 : 0) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final InstanceOfExpr n, final Void arg) { + public Integer visit(final InstanceOfExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getPattern().isPresent() ? n.getPattern().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final IntegerLiteralExpr n, final Void arg) { + public Integer visit(final IntegerLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final IntersectionType n, final Void arg) { + public Integer visit(final IntersectionType n, final Void arg) { return (n.getElements().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final JavadocComment n, final Void arg) { + public Integer visit(final JavadocComment n, final Void arg) { return (n.getContent().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LabeledStmt n, final Void arg) { + public Integer visit(final LabeledStmt n, final Void arg) { return (n.getLabel().accept(this, arg)) * 31 + (n.getStatement().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LambdaExpr n, final Void arg) { + public Integer visit(final LambdaExpr n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.isEnclosingParameters() ? 1 : 0) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LineComment n, final Void arg) { + public Integer visit(final LineComment n, final Void arg) { return (n.getContent().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { + public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { return (n.getClassDeclaration().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { + public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { return (n.getRecordDeclaration().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final LongLiteralExpr n, final Void arg) { + public Integer visit(final LongLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final MarkerAnnotationExpr n, final Void arg) { + public Integer visit(final MarkerAnnotationExpr n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final MemberValuePair n, final Void arg) { + public Integer visit(final MemberValuePair n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getValue().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final MethodCallExpr n, final Void arg) { + public Integer visit(final MethodCallExpr n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final MethodDeclaration n, final Void arg) { + public Integer visit(final MethodDeclaration n, final Void arg) { return (n.getBody().isPresent() ? n.getBody().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final MethodReferenceExpr n, final Void arg) { + public Integer visit(final MethodReferenceExpr n, final Void arg) { return (n.getIdentifier().hashCode()) * 31 + (n.getScope().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final NameExpr n, final Void arg) { + public Integer visit(final NameExpr n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final Name n, final Void arg) { + public Integer visit(final Name n, final Void arg) { return (n.getIdentifier().hashCode()) * 31 + (n.getQualifier().isPresent() ? n.getQualifier().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { int result = 0; for (Object node : n) { result += 31 * ((Visitable) node).accept(this, arg); @@ -287,363 +287,363 @@ public Integer visit(NodeList n, Void arg) { return result; } - public Integer visit(final NormalAnnotationExpr n, final Void arg) { + public Integer visit(final NormalAnnotationExpr n, final Void arg) { return (n.getPairs().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final NullLiteralExpr n, final Void arg) { + public Integer visit(final NullLiteralExpr n, final Void arg) { return (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ObjectCreationExpr n, final Void arg) { + public Integer visit(final ObjectCreationExpr n, final Void arg) { return (n.getAnonymousClassBody().isPresent() ? n.getAnonymousClassBody().get().accept(this, arg) : 0) * 31 + (n.getArguments().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final PackageDeclaration n, final Void arg) { + public Integer visit(final PackageDeclaration n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final Parameter n, final Void arg) { + public Integer visit(final Parameter n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.isVarArgs() ? 1 : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getVarArgsAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final PrimitiveType n, final Void arg) { + public Integer visit(final PrimitiveType n, final Void arg) { return (n.getType().hashCode()) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ReturnStmt n, final Void arg) { + public Integer visit(final ReturnStmt n, final Void arg) { return (n.getExpression().isPresent() ? n.getExpression().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SimpleName n, final Void arg) { + public Integer visit(final SimpleName n, final Void arg) { return (n.getIdentifier().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { + public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { return (n.getMemberValue().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final StringLiteralExpr n, final Void arg) { + public Integer visit(final StringLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SuperExpr n, final Void arg) { + public Integer visit(final SuperExpr n, final Void arg) { return (n.getTypeName().isPresent() ? n.getTypeName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SwitchEntry n, final Void arg) { + public Integer visit(final SwitchEntry n, final Void arg) { return (n.getGuard().isPresent() ? n.getGuard().get().accept(this, arg) : 0) * 31 + (n.isDefault() ? 1 : 0) * 31 + (n.getLabels().accept(this, arg)) * 31 + (n.getStatements().accept(this, arg)) * 31 + (n.getType().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SwitchStmt n, final Void arg) { + public Integer visit(final SwitchStmt n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getSelector().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final SynchronizedStmt n, final Void arg) { + public Integer visit(final SynchronizedStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getExpression().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ThisExpr n, final Void arg) { + public Integer visit(final ThisExpr n, final Void arg) { return (n.getTypeName().isPresent() ? n.getTypeName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ThrowStmt n, final Void arg) { + public Integer visit(final ThrowStmt n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final TryStmt n, final Void arg) { + public Integer visit(final TryStmt n, final Void arg) { return (n.getCatchClauses().accept(this, arg)) * 31 + (n.getFinallyBlock().isPresent() ? n.getFinallyBlock().get().accept(this, arg) : 0) * 31 + (n.getResources().accept(this, arg)) * 31 + (n.getTryBlock().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final TypeExpr n, final Void arg) { + public Integer visit(final TypeExpr n, final Void arg) { return (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final TypeParameter n, final Void arg) { + public Integer visit(final TypeParameter n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getTypeBound().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final UnaryExpr n, final Void arg) { + public Integer visit(final UnaryExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getOperator().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final UnionType n, final Void arg) { + public Integer visit(final UnionType n, final Void arg) { return (n.getElements().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final UnknownType n, final Void arg) { + public Integer visit(final UnknownType n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final VariableDeclarationExpr n, final Void arg) { + public Integer visit(final VariableDeclarationExpr n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final VariableDeclarator n, final Void arg) { + public Integer visit(final VariableDeclarator n, final Void arg) { return (n.getInitializer().isPresent() ? n.getInitializer().get().accept(this, arg) : 0) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final VoidType n, final Void arg) { + public Integer visit(final VoidType n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final WhileStmt n, final Void arg) { + public Integer visit(final WhileStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCondition().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final WildcardType n, final Void arg) { + public Integer visit(final WildcardType n, final Void arg) { return (n.getExtendedType().isPresent() ? n.getExtendedType().get().accept(this, arg) : 0) * 31 + (n.getSuperType().isPresent() ? n.getSuperType().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ModuleDeclaration n, final Void arg) { + public Integer visit(final ModuleDeclaration n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getDirectives().accept(this, arg)) * 31 + (n.isOpen() ? 1 : 0) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final ModuleRequiresDirective n, final Void arg) { + public Integer visit(final ModuleRequiresDirective n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override() - public Integer visit(final ModuleExportsDirective n, final Void arg) { + public Integer visit(final ModuleExportsDirective n, final Void arg) { return (n.getModuleNames().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override() - public Integer visit(final ModuleProvidesDirective n, final Void arg) { + public Integer visit(final ModuleProvidesDirective n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getWith().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override() - public Integer visit(final ModuleUsesDirective n, final Void arg) { + public Integer visit(final ModuleUsesDirective n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final ModuleOpensDirective n, final Void arg) { + public Integer visit(final ModuleOpensDirective n, final Void arg) { return (n.getModuleNames().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final UnparsableStmt n, final Void arg) { + public Integer visit(final UnparsableStmt n, final Void arg) { return (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final ReceiverParameter n, final Void arg) { + public Integer visit(final ReceiverParameter n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final VarType n, final Void arg) { + public Integer visit(final VarType n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final Modifier n, final Void arg) { + public Integer visit(final Modifier n, final Void arg) { return (n.getKeyword().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final SwitchExpr n, final Void arg) { + public Integer visit(final SwitchExpr n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getSelector().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final YieldStmt n, final Void arg) { + public Integer visit(final YieldStmt n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final TextBlockLiteralExpr n, final Void arg) { + public Integer visit(final TextBlockLiteralExpr n, final Void arg) { return (n.getValue().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final TypePatternExpr n, final Void arg) { + public Integer visit(final TypePatternExpr n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlQuantifiedExpr n, final Void arg) { + public Integer visit(final JmlQuantifiedExpr n, final Void arg) { return (n.getBinder().hashCode()) * 31 + (n.getExpressions().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlClauseLabel n, final Void arg) { + public Integer visit(final JmlClauseLabel n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlExpressionStmt n, final Void arg) { + public Integer visit(final JmlExpressionStmt n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlLabelExpr n, final Void arg) { + public Integer visit(final JmlLabelExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlLetExpr n, final Void arg) { + public Integer visit(final JmlLetExpr n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlMultiCompareExpr n, final Void arg) { + public Integer visit(final JmlMultiCompareExpr n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getOperators().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSimpleExprClause n, final Void arg) { + public Integer visit(final JmlSimpleExprClause n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getHeaps().isPresent() ? n.getHeaps().get().accept(this, arg) : 0) * 31 + (n.getKind().hashCode()) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSignalsClause n, final Void arg) { + public Integer visit(final JmlSignalsClause n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getParameter().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { + public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { return (n.getTypes().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlUnreachableStmt n, final Void arg) { + public Integer visit(final JmlUnreachableStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlCallableClause n, final Void arg) { + public Integer visit(final JmlCallableClause n, final Void arg) { return (n.getMethodSignatures().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlForallClause n, final Void arg) { + public Integer visit(final JmlForallClause n, final Void arg) { return (n.getBoundedVariables().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlRefiningStmt n, final Void arg) { + public Integer visit(final JmlRefiningStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlClauseIf n, final Void arg) { + public Integer visit(final JmlClauseIf n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getThen().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlClassExprDeclaration n, final Void arg) { + public Integer visit(final JmlClassExprDeclaration n, final Void arg) { return (n.getInvariant().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getKind().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { + public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getMeasuredBy().isPresent() ? n.getMeasuredBy().get().accept(this, arg) : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getVariable().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { + public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlContract n, final Void arg) { + public Integer visit(final JmlContract n, final Void arg) { return (n.getBehavior().hashCode()) * 31 + (n.getClauses().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getSubContracts().accept(this, arg)) * 31 + (n.getType().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { + public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { return (n.getBinding().accept(this, arg)) * 31 + (n.getPredicate().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlGhostStmt n, final Void arg) { + public Integer visit(final JmlGhostStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getStatement().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final RecordDeclaration n, final Void arg) { + public Integer visit(final RecordDeclaration n, final Void arg) { return (n.getImplementedTypes().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } - public Integer visit(final CompactConstructorDeclaration n, final Void arg) { + public Integer visit(final CompactConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final RecordPatternExpr n, final Void arg) { + public Integer visit(final RecordPatternExpr n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getPatternList().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlMethodDeclaration n, final Void arg) { + public Integer visit(final JmlMethodDeclaration n, final Void arg) { return (n.getContract().isPresent() ? n.getContract().get().accept(this, arg) : 0) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getMethodDeclaration().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { + public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { return (n.getLeft().accept(this, arg)) * 31 + (n.getOperator().accept(this, arg)) * 31 + (n.getRight().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlDocDeclaration n, final Void arg) { + public Integer visit(final JmlDocDeclaration n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlDocStmt n, final Void arg) { + public Integer visit(final JmlDocStmt n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlDoc n, final Void arg) { + public Integer visit(final JmlDoc n, final Void arg) { return (n.getContent().hashCode()) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlDocType n, final Void arg) { + public Integer visit(final JmlDocType n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlFieldDeclaration n, final Void arg) { + public Integer visit(final JmlFieldDeclaration n, final Void arg) { return (n.getDecl().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlOldClause n, final Void arg) { + public Integer visit(final JmlOldClause n, final Void arg) { return (n.getDeclarations().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlTypeExpr n, final Void arg) { + public Integer visit(final JmlTypeExpr n, final Void arg) { return (n.getType().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlMultiExprClause n, final Void arg) { + public Integer visit(final JmlMultiExprClause n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getHeaps().isPresent() ? n.getHeaps().get().accept(this, arg) : 0) * 31 + (n.getKind().hashCode()) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlBeginStmt n, final Void arg) { + public Integer visit(final JmlBeginStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlEndStmt n, final Void arg) { + public Integer visit(final JmlEndStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlLabelStmt n, final Void arg) { + public Integer visit(final JmlLabelStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getLabel().accept(this, arg)) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlMethodSignature n, final Void arg) { + public Integer visit(final JmlMethodSignature n, final Void arg) { return (n.getArgumentTypes().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getReceiver().isPresent() ? n.getReceiver().get().accept(this, arg) : 0) * 31 + (n.getComment().isPresent() ? n.getComment().get().accept(this, arg) : 0); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java index eb5158f17d..503a3b8c7a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitor.java @@ -57,10 +57,10 @@ * * @author Julio Vilmar Gesser */ -public class ModifierVisitor implements GenericVisitor { +public class ModifierVisitor implements GenericVisitor { @Override - public Visitable visit(final AnnotationDeclaration n, final A arg) { + public Visitable visit(final AnnotationDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList> members = modifyList(n.getMembers(), arg); @@ -77,7 +77,7 @@ public Visitable visit(final AnnotationDeclaration n, final A arg) { } @Override - public Visitable visit(final AnnotationMemberDeclaration n, final A arg) { + public Visitable visit(final AnnotationMemberDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); Expression defaultValue = n.getDefaultValue().map(s -> (Expression) s.accept(this, arg)).orElse(null); @@ -96,7 +96,7 @@ public Visitable visit(final AnnotationMemberDeclaration n, final A arg) { } @Override - public Visitable visit(final ArrayAccessExpr n, final A arg) { + public Visitable visit(final ArrayAccessExpr n, final A arg) { Expression index = (Expression) n.getIndex().accept(this, arg); Expression name = (Expression) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -109,7 +109,7 @@ public Visitable visit(final ArrayAccessExpr n, final A arg) { } @Override - public Visitable visit(final ArrayCreationExpr n, final A arg) { + public Visitable visit(final ArrayCreationExpr n, final A arg) { Type elementType = (Type) n.getElementType().accept(this, arg); ArrayInitializerExpr initializer = n.getInitializer().map(s -> (ArrayInitializerExpr) s.accept(this, arg)).orElse(null); NodeList levels = modifyList(n.getLevels(), arg); @@ -124,7 +124,7 @@ public Visitable visit(final ArrayCreationExpr n, final A arg) { } @Override - public Visitable visit(final ArrayInitializerExpr n, final A arg) { + public Visitable visit(final ArrayInitializerExpr n, final A arg) { NodeList values = modifyList(n.getValues(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setValues(values); @@ -133,7 +133,7 @@ public Visitable visit(final ArrayInitializerExpr n, final A arg) { } @Override - public Visitable visit(final AssertStmt n, final A arg) { + public Visitable visit(final AssertStmt n, final A arg) { Expression check = (Expression) n.getCheck().accept(this, arg); Expression message = n.getMessage().map(s -> (Expression) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -146,7 +146,7 @@ public Visitable visit(final AssertStmt n, final A arg) { } @Override - public Visitable visit(final AssignExpr n, final A arg) { + public Visitable visit(final AssignExpr n, final A arg) { Expression target = (Expression) n.getTarget().accept(this, arg); Expression value = (Expression) n.getValue().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -159,7 +159,7 @@ public Visitable visit(final AssignExpr n, final A arg) { } @Override - public Visitable visit(final BinaryExpr n, final A arg) { + public Visitable visit(final BinaryExpr n, final A arg) { Expression left = (Expression) n.getLeft().accept(this, arg); Expression right = (Expression) n.getRight().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -174,7 +174,7 @@ public Visitable visit(final BinaryExpr n, final A arg) { } @Override - public Visitable visit(final BlockStmt n, final A arg) { + public Visitable visit(final BlockStmt n, final A arg) { NodeList contracts = modifyList(n.getContracts(), arg); NodeList statements = modifyList(n.getStatements(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -185,14 +185,14 @@ public Visitable visit(final BlockStmt n, final A arg) { } @Override - public Visitable visit(final BooleanLiteralExpr n, final A arg) { + public Visitable visit(final BooleanLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final BreakStmt n, final A arg) { + public Visitable visit(final BreakStmt n, final A arg) { SimpleName label = n.getLabel().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setLabel(label); @@ -201,7 +201,7 @@ public Visitable visit(final BreakStmt n, final A arg) { } @Override - public Visitable visit(final CastExpr n, final A arg) { + public Visitable visit(final CastExpr n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Type type = (Type) n.getType().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -214,7 +214,7 @@ public Visitable visit(final CastExpr n, final A arg) { } @Override - public Visitable visit(final CatchClause n, final A arg) { + public Visitable visit(final CatchClause n, final A arg) { BlockStmt body = (BlockStmt) n.getBody().accept(this, arg); Parameter parameter = (Parameter) n.getParameter().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -227,14 +227,14 @@ public Visitable visit(final CatchClause n, final A arg) { } @Override - public Visitable visit(final CharLiteralExpr n, final A arg) { + public Visitable visit(final CharLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final ClassExpr n, final A arg) { + public Visitable visit(final ClassExpr n, final A arg) { Type type = (Type) n.getType().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (type == null) @@ -245,7 +245,7 @@ public Visitable visit(final ClassExpr n, final A arg) { } @Override - public Visitable visit(final ClassOrInterfaceDeclaration n, final A arg) { + public Visitable visit(final ClassOrInterfaceDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList extendedTypes = modifyList(n.getExtendedTypes(), arg); @@ -270,7 +270,7 @@ public Visitable visit(final ClassOrInterfaceDeclaration n, final A arg) { } @Override - public Visitable visit(final RecordDeclaration n, final A arg) { + public Visitable visit(final RecordDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList implementedTypes = modifyList(n.getImplementedTypes(), arg); @@ -295,7 +295,7 @@ public Visitable visit(final RecordDeclaration n, final A arg) { } @Override - public Visitable visit(final ClassOrInterfaceType n, final A arg) { + public Visitable visit(final ClassOrInterfaceType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); ClassOrInterfaceType scope = n.getScope().map(s -> (ClassOrInterfaceType) s.accept(this, arg)).orElse(null); @@ -312,7 +312,7 @@ public Visitable visit(final ClassOrInterfaceType n, final A arg) { } @Override - public Visitable visit(final CompilationUnit n, final A arg) { + public Visitable visit(final CompilationUnit n, final A arg) { NodeList imports = modifyList(n.getImports(), arg); ModuleDeclaration module = n.getModule().map(s -> (ModuleDeclaration) s.accept(this, arg)).orElse(null); PackageDeclaration packageDeclaration = n.getPackageDeclaration().map(s -> (PackageDeclaration) s.accept(this, arg)).orElse(null); @@ -327,7 +327,7 @@ public Visitable visit(final CompilationUnit n, final A arg) { } @Override - public Visitable visit(final ConditionalExpr n, final A arg) { + public Visitable visit(final ConditionalExpr n, final A arg) { Expression condition = (Expression) n.getCondition().accept(this, arg); Expression elseExpr = (Expression) n.getElseExpr().accept(this, arg); Expression thenExpr = (Expression) n.getThenExpr().accept(this, arg); @@ -342,7 +342,7 @@ public Visitable visit(final ConditionalExpr n, final A arg) { } @Override - public Visitable visit(final ConstructorDeclaration n, final A arg) { + public Visitable visit(final ConstructorDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); BlockStmt body = (BlockStmt) n.getBody().accept(this, arg); @@ -369,7 +369,7 @@ public Visitable visit(final ConstructorDeclaration n, final A arg) { } @Override - public Visitable visit(final CompactConstructorDeclaration n, final A arg) { + public Visitable visit(final CompactConstructorDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); BlockStmt body = (BlockStmt) n.getBody().accept(this, arg); @@ -390,7 +390,7 @@ public Visitable visit(final CompactConstructorDeclaration n, final A arg) { } @Override - public Visitable visit(final ContinueStmt n, final A arg) { + public Visitable visit(final ContinueStmt n, final A arg) { SimpleName label = n.getLabel().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setLabel(label); @@ -399,7 +399,7 @@ public Visitable visit(final ContinueStmt n, final A arg) { } @Override - public Visitable visit(final DoStmt n, final A arg) { + public Visitable visit(final DoStmt n, final A arg) { Statement body = (Statement) n.getBody().accept(this, arg); Expression condition = (Expression) n.getCondition().accept(this, arg); NodeList contracts = modifyList(n.getContracts(), arg); @@ -414,21 +414,21 @@ public Visitable visit(final DoStmt n, final A arg) { } @Override - public Visitable visit(final DoubleLiteralExpr n, final A arg) { + public Visitable visit(final DoubleLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final EmptyStmt n, final A arg) { + public Visitable visit(final EmptyStmt n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final EnclosedExpr n, final A arg) { + public Visitable visit(final EnclosedExpr n, final A arg) { Expression inner = (Expression) n.getInner().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (inner == null) @@ -439,7 +439,7 @@ public Visitable visit(final EnclosedExpr n, final A arg) { } @Override - public Visitable visit(final EnumConstantDeclaration n, final A arg) { + public Visitable visit(final EnumConstantDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList arguments = modifyList(n.getArguments(), arg); NodeList> classBody = modifyList(n.getClassBody(), arg); @@ -456,7 +456,7 @@ public Visitable visit(final EnumConstantDeclaration n, final A arg) { } @Override - public Visitable visit(final EnumDeclaration n, final A arg) { + public Visitable visit(final EnumDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList entries = modifyList(n.getEntries(), arg); @@ -477,7 +477,7 @@ public Visitable visit(final EnumDeclaration n, final A arg) { } @Override - public Visitable visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public Visitable visit(final ExplicitConstructorInvocationStmt n, final A arg) { NodeList arguments = modifyList(n.getArguments(), arg); Expression expression = n.getExpression().map(s -> (Expression) s.accept(this, arg)).orElse(null); NodeList typeArguments = modifyList(n.getTypeArguments(), arg); @@ -490,7 +490,7 @@ public Visitable visit(final ExplicitConstructorInvocationStmt n, final A arg) } @Override - public Visitable visit(final ExpressionStmt n, final A arg) { + public Visitable visit(final ExpressionStmt n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (expression == null) @@ -501,7 +501,7 @@ public Visitable visit(final ExpressionStmt n, final A arg) { } @Override - public Visitable visit(final FieldAccessExpr n, final A arg) { + public Visitable visit(final FieldAccessExpr n, final A arg) { SimpleName name = (SimpleName) n.getName().accept(this, arg); Expression scope = (Expression) n.getScope().accept(this, arg); NodeList typeArguments = modifyList(n.getTypeArguments(), arg); @@ -516,7 +516,7 @@ public Visitable visit(final FieldAccessExpr n, final A arg) { } @Override - public Visitable visit(final FieldDeclaration n, final A arg) { + public Visitable visit(final FieldDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList variables = modifyList(n.getVariables(), arg); @@ -531,7 +531,7 @@ public Visitable visit(final FieldDeclaration n, final A arg) { } @Override - public Visitable visit(final ForEachStmt n, final A arg) { + public Visitable visit(final ForEachStmt n, final A arg) { Statement body = (Statement) n.getBody().accept(this, arg); NodeList contracts = modifyList(n.getContracts(), arg); Expression iterable = (Expression) n.getIterable().accept(this, arg); @@ -548,7 +548,7 @@ public Visitable visit(final ForEachStmt n, final A arg) { } @Override - public Visitable visit(final ForStmt n, final A arg) { + public Visitable visit(final ForStmt n, final A arg) { Statement body = (Statement) n.getBody().accept(this, arg); Expression compare = n.getCompare().map(s -> (Expression) s.accept(this, arg)).orElse(null); NodeList contracts = modifyList(n.getContracts(), arg); @@ -567,7 +567,7 @@ public Visitable visit(final ForStmt n, final A arg) { } @Override - public Visitable visit(final IfStmt n, final A arg) { + public Visitable visit(final IfStmt n, final A arg) { Expression condition = (Expression) n.getCondition().accept(this, arg); Statement elseStmt = n.getElseStmt().map(s -> (Statement) s.accept(this, arg)).orElse(null); Statement thenStmt = (Statement) n.getThenStmt().accept(this, arg); @@ -582,7 +582,7 @@ public Visitable visit(final IfStmt n, final A arg) { } @Override - public Visitable visit(final InitializerDeclaration n, final A arg) { + public Visitable visit(final InitializerDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); BlockStmt body = (BlockStmt) n.getBody().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -595,7 +595,7 @@ public Visitable visit(final InitializerDeclaration n, final A arg) { } @Override - public Visitable visit(final InstanceOfExpr n, final A arg) { + public Visitable visit(final InstanceOfExpr n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); PatternExpr pattern = n.getPattern().map(s -> (PatternExpr) s.accept(this, arg)).orElse(null); ReferenceType type = (ReferenceType) n.getType().accept(this, arg); @@ -610,21 +610,21 @@ public Visitable visit(final InstanceOfExpr n, final A arg) { } @Override - public Visitable visit(final IntegerLiteralExpr n, final A arg) { + public Visitable visit(final IntegerLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final JavadocComment n, final A arg) { + public Visitable visit(final JavadocComment n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final LabeledStmt n, final A arg) { + public Visitable visit(final LabeledStmt n, final A arg) { SimpleName label = (SimpleName) n.getLabel().accept(this, arg); Statement statement = (Statement) n.getStatement().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -637,14 +637,14 @@ public Visitable visit(final LabeledStmt n, final A arg) { } @Override - public Visitable visit(final LongLiteralExpr n, final A arg) { + public Visitable visit(final LongLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final MarkerAnnotationExpr n, final A arg) { + public Visitable visit(final MarkerAnnotationExpr n, final A arg) { Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (name == null) @@ -655,7 +655,7 @@ public Visitable visit(final MarkerAnnotationExpr n, final A arg) { } @Override - public Visitable visit(final MemberValuePair n, final A arg) { + public Visitable visit(final MemberValuePair n, final A arg) { SimpleName name = (SimpleName) n.getName().accept(this, arg); Expression value = (Expression) n.getValue().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -668,7 +668,7 @@ public Visitable visit(final MemberValuePair n, final A arg) { } @Override - public Visitable visit(final MethodCallExpr n, final A arg) { + public Visitable visit(final MethodCallExpr n, final A arg) { NodeList arguments = modifyList(n.getArguments(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); Expression scope = n.getScope().map(s -> (Expression) s.accept(this, arg)).orElse(null); @@ -685,7 +685,7 @@ public Visitable visit(final MethodCallExpr n, final A arg) { } @Override - public Visitable visit(final MethodDeclaration n, final A arg) { + public Visitable visit(final MethodDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); BlockStmt body = n.getBody().map(s -> (BlockStmt) s.accept(this, arg)).orElse(null); @@ -714,7 +714,7 @@ public Visitable visit(final MethodDeclaration n, final A arg) { } @Override - public Visitable visit(final NameExpr n, final A arg) { + public Visitable visit(final NameExpr n, final A arg) { SimpleName name = (SimpleName) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (name == null) @@ -725,7 +725,7 @@ public Visitable visit(final NameExpr n, final A arg) { } @Override - public Visitable visit(final NormalAnnotationExpr n, final A arg) { + public Visitable visit(final NormalAnnotationExpr n, final A arg) { NodeList pairs = modifyList(n.getPairs(), arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -738,14 +738,14 @@ public Visitable visit(final NormalAnnotationExpr n, final A arg) { } @Override - public Visitable visit(final NullLiteralExpr n, final A arg) { + public Visitable visit(final NullLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final ObjectCreationExpr n, final A arg) { + public Visitable visit(final ObjectCreationExpr n, final A arg) { NodeList> anonymousClassBody = modifyList(n.getAnonymousClassBody(), arg); NodeList arguments = modifyList(n.getArguments(), arg); Expression scope = n.getScope().map(s -> (Expression) s.accept(this, arg)).orElse(null); @@ -764,7 +764,7 @@ public Visitable visit(final ObjectCreationExpr n, final A arg) { } @Override - public Visitable visit(final PackageDeclaration n, final A arg) { + public Visitable visit(final PackageDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -777,7 +777,7 @@ public Visitable visit(final PackageDeclaration n, final A arg) { } @Override - public Visitable visit(final Parameter n, final A arg) { + public Visitable visit(final Parameter n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); @@ -796,7 +796,7 @@ public Visitable visit(final Parameter n, final A arg) { } @Override - public Visitable visit(final Name n, final A arg) { + public Visitable visit(final Name n, final A arg) { Name qualifier = n.getQualifier().map(s -> (Name) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setQualifier(qualifier); @@ -805,7 +805,7 @@ public Visitable visit(final Name n, final A arg) { } @Override - public Visitable visit(final PrimitiveType n, final A arg) { + public Visitable visit(final PrimitiveType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setAnnotations(annotations); @@ -814,14 +814,14 @@ public Visitable visit(final PrimitiveType n, final A arg) { } @Override - public Visitable visit(final SimpleName n, final A arg) { + public Visitable visit(final SimpleName n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final ArrayType n, final A arg) { + public Visitable visit(final ArrayType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Type componentType = (Type) n.getComponentType().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -834,7 +834,7 @@ public Visitable visit(final ArrayType n, final A arg) { } @Override - public Visitable visit(final ArrayCreationLevel n, final A arg) { + public Visitable visit(final ArrayCreationLevel n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Expression dimension = n.getDimension().map(s -> (Expression) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -845,7 +845,7 @@ public Visitable visit(final ArrayCreationLevel n, final A arg) { } @Override - public Visitable visit(final IntersectionType n, final A arg) { + public Visitable visit(final IntersectionType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList elements = modifyList(n.getElements(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -858,7 +858,7 @@ public Visitable visit(final IntersectionType n, final A arg) { } @Override - public Visitable visit(final UnionType n, final A arg) { + public Visitable visit(final UnionType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList elements = modifyList(n.getElements(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -871,7 +871,7 @@ public Visitable visit(final UnionType n, final A arg) { } @Override - public Visitable visit(final ReturnStmt n, final A arg) { + public Visitable visit(final ReturnStmt n, final A arg) { Expression expression = n.getExpression().map(s -> (Expression) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setExpression(expression); @@ -880,7 +880,7 @@ public Visitable visit(final ReturnStmt n, final A arg) { } @Override - public Visitable visit(final SingleMemberAnnotationExpr n, final A arg) { + public Visitable visit(final SingleMemberAnnotationExpr n, final A arg) { Expression memberValue = (Expression) n.getMemberValue().accept(this, arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -893,14 +893,14 @@ public Visitable visit(final SingleMemberAnnotationExpr n, final A arg) { } @Override - public Visitable visit(final StringLiteralExpr n, final A arg) { + public Visitable visit(final StringLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final SuperExpr n, final A arg) { + public Visitable visit(final SuperExpr n, final A arg) { Name typeName = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setTypeName(typeName); @@ -909,7 +909,7 @@ public Visitable visit(final SuperExpr n, final A arg) { } @Override - public Visitable visit(final SwitchEntry n, final A arg) { + public Visitable visit(final SwitchEntry n, final A arg) { Expression guard = n.getGuard().map(s -> (Expression) s.accept(this, arg)).orElse(null); NodeList labels = modifyList(n.getLabels(), arg); NodeList statements = modifyList(n.getStatements(), arg); @@ -922,7 +922,7 @@ public Visitable visit(final SwitchEntry n, final A arg) { } @Override - public Visitable visit(final SwitchStmt n, final A arg) { + public Visitable visit(final SwitchStmt n, final A arg) { NodeList entries = modifyList(n.getEntries(), arg); Expression selector = (Expression) n.getSelector().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -935,7 +935,7 @@ public Visitable visit(final SwitchStmt n, final A arg) { } @Override - public Visitable visit(final SynchronizedStmt n, final A arg) { + public Visitable visit(final SynchronizedStmt n, final A arg) { BlockStmt body = (BlockStmt) n.getBody().accept(this, arg); Expression expression = (Expression) n.getExpression().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -948,7 +948,7 @@ public Visitable visit(final SynchronizedStmt n, final A arg) { } @Override - public Visitable visit(final ThisExpr n, final A arg) { + public Visitable visit(final ThisExpr n, final A arg) { Name typeName = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setTypeName(typeName); @@ -957,7 +957,7 @@ public Visitable visit(final ThisExpr n, final A arg) { } @Override - public Visitable visit(final ThrowStmt n, final A arg) { + public Visitable visit(final ThrowStmt n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (expression == null) @@ -968,7 +968,7 @@ public Visitable visit(final ThrowStmt n, final A arg) { } @Override - public Visitable visit(final TryStmt n, final A arg) { + public Visitable visit(final TryStmt n, final A arg) { NodeList catchClauses = modifyList(n.getCatchClauses(), arg); BlockStmt finallyBlock = n.getFinallyBlock().map(s -> (BlockStmt) s.accept(this, arg)).orElse(null); NodeList resources = modifyList(n.getResources(), arg); @@ -985,7 +985,7 @@ public Visitable visit(final TryStmt n, final A arg) { } @Override - public Visitable visit(final LocalClassDeclarationStmt n, final A arg) { + public Visitable visit(final LocalClassDeclarationStmt n, final A arg) { ClassOrInterfaceDeclaration classDeclaration = (ClassOrInterfaceDeclaration) n.getClassDeclaration().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (classDeclaration == null) @@ -996,7 +996,7 @@ public Visitable visit(final LocalClassDeclarationStmt n, final A arg) { } @Override - public Visitable visit(final LocalRecordDeclarationStmt n, final A arg) { + public Visitable visit(final LocalRecordDeclarationStmt n, final A arg) { RecordDeclaration recordDeclaration = (RecordDeclaration) n.getRecordDeclaration().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (recordDeclaration == null) @@ -1007,7 +1007,7 @@ public Visitable visit(final LocalRecordDeclarationStmt n, final A arg) { } @Override - public Visitable visit(final TypeParameter n, final A arg) { + public Visitable visit(final TypeParameter n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); NodeList typeBound = modifyList(n.getTypeBound(), arg); @@ -1022,7 +1022,7 @@ public Visitable visit(final TypeParameter n, final A arg) { } @Override - public Visitable visit(final UnaryExpr n, final A arg) { + public Visitable visit(final UnaryExpr n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (expression == null) @@ -1033,7 +1033,7 @@ public Visitable visit(final UnaryExpr n, final A arg) { } @Override - public Visitable visit(final UnknownType n, final A arg) { + public Visitable visit(final UnknownType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setAnnotations(annotations); @@ -1042,7 +1042,7 @@ public Visitable visit(final UnknownType n, final A arg) { } @Override - public Visitable visit(final VariableDeclarationExpr n, final A arg) { + public Visitable visit(final VariableDeclarationExpr n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList variables = modifyList(n.getVariables(), arg); @@ -1057,7 +1057,7 @@ public Visitable visit(final VariableDeclarationExpr n, final A arg) { } @Override - public Visitable visit(final VariableDeclarator n, final A arg) { + public Visitable visit(final VariableDeclarator n, final A arg) { Expression initializer = n.getInitializer().map(s -> (Expression) s.accept(this, arg)).orElse(null); SimpleName name = (SimpleName) n.getName().accept(this, arg); Type type = (Type) n.getType().accept(this, arg); @@ -1072,7 +1072,7 @@ public Visitable visit(final VariableDeclarator n, final A arg) { } @Override - public Visitable visit(final VoidType n, final A arg) { + public Visitable visit(final VoidType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setAnnotations(annotations); @@ -1081,7 +1081,7 @@ public Visitable visit(final VoidType n, final A arg) { } @Override - public Visitable visit(final WhileStmt n, final A arg) { + public Visitable visit(final WhileStmt n, final A arg) { Statement body = (Statement) n.getBody().accept(this, arg); Expression condition = (Expression) n.getCondition().accept(this, arg); NodeList contracts = modifyList(n.getContracts(), arg); @@ -1096,7 +1096,7 @@ public Visitable visit(final WhileStmt n, final A arg) { } @Override - public Visitable visit(final WildcardType n, final A arg) { + public Visitable visit(final WildcardType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); ReferenceType extendedType = n.getExtendedType().map(s -> (ReferenceType) s.accept(this, arg)).orElse(null); ReferenceType superType = n.getSuperType().map(s -> (ReferenceType) s.accept(this, arg)).orElse(null); @@ -1109,7 +1109,7 @@ public Visitable visit(final WildcardType n, final A arg) { } @Override - public Visitable visit(final LambdaExpr n, final A arg) { + public Visitable visit(final LambdaExpr n, final A arg) { Statement body = (Statement) n.getBody().accept(this, arg); NodeList contracts = modifyList(n.getContracts(), arg); NodeList parameters = modifyList(n.getParameters(), arg); @@ -1124,7 +1124,7 @@ public Visitable visit(final LambdaExpr n, final A arg) { } @Override - public Visitable visit(final MethodReferenceExpr n, final A arg) { + public Visitable visit(final MethodReferenceExpr n, final A arg) { Expression scope = (Expression) n.getScope().accept(this, arg); NodeList typeArguments = modifyList(n.getTypeArguments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1137,7 +1137,7 @@ public Visitable visit(final MethodReferenceExpr n, final A arg) { } @Override - public Visitable visit(final TypeExpr n, final A arg) { + public Visitable visit(final TypeExpr n, final A arg) { Type type = (Type) n.getType().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (type == null) @@ -1148,7 +1148,7 @@ public Visitable visit(final TypeExpr n, final A arg) { } @Override - public Visitable visit(NodeList n, A arg) { + public Visitable visit(NodeList n, A arg) { if (n.isEmpty()) { return n; } @@ -1169,7 +1169,7 @@ public Visitable visit(NodeList n, A arg) { } @Override - public Node visit(final ImportDeclaration n, final A arg) { + public Node visit(final ImportDeclaration n, final A arg) { Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (name == null) @@ -1180,14 +1180,14 @@ public Node visit(final ImportDeclaration n, final A arg) { } @Override - public Visitable visit(final BlockComment n, final A arg) { + public Visitable visit(final BlockComment n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final LineComment n, final A arg) { + public Visitable visit(final LineComment n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; @@ -1201,7 +1201,7 @@ private NodeList modifyList(Optional> list, A ar return list.map(ns -> modifyList(ns, arg)).orElse(null); } - public Visitable visit(final ModuleDeclaration n, final A arg) { + public Visitable visit(final ModuleDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList directives = modifyList(n.getDirectives(), arg); Name name = (Name) n.getName().accept(this, arg); @@ -1215,7 +1215,7 @@ public Visitable visit(final ModuleDeclaration n, final A arg) { return n; } - public Visitable visit(final ModuleRequiresDirective n, final A arg) { + public Visitable visit(final ModuleRequiresDirective n, final A arg) { NodeList modifiers = modifyList(n.getModifiers(), arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1228,7 +1228,7 @@ public Visitable visit(final ModuleRequiresDirective n, final A arg) { } @Override() - public Visitable visit(final ModuleExportsDirective n, final A arg) { + public Visitable visit(final ModuleExportsDirective n, final A arg) { NodeList moduleNames = modifyList(n.getModuleNames(), arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1241,7 +1241,7 @@ public Visitable visit(final ModuleExportsDirective n, final A arg) { } @Override() - public Visitable visit(final ModuleProvidesDirective n, final A arg) { + public Visitable visit(final ModuleProvidesDirective n, final A arg) { Name name = (Name) n.getName().accept(this, arg); NodeList with = modifyList(n.getWith(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1254,7 +1254,7 @@ public Visitable visit(final ModuleProvidesDirective n, final A arg) { } @Override() - public Visitable visit(final ModuleUsesDirective n, final A arg) { + public Visitable visit(final ModuleUsesDirective n, final A arg) { Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (name == null) @@ -1265,7 +1265,7 @@ public Visitable visit(final ModuleUsesDirective n, final A arg) { } @Override - public Visitable visit(final ModuleOpensDirective n, final A arg) { + public Visitable visit(final ModuleOpensDirective n, final A arg) { NodeList moduleNames = modifyList(n.getModuleNames(), arg); Name name = (Name) n.getName().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1278,14 +1278,14 @@ public Visitable visit(final ModuleOpensDirective n, final A arg) { } @Override - public Visitable visit(final UnparsableStmt n, final A arg) { + public Visitable visit(final UnparsableStmt n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final ReceiverParameter n, final A arg) { + public Visitable visit(final ReceiverParameter n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Name name = (Name) n.getName().accept(this, arg); Type type = (Type) n.getType().accept(this, arg); @@ -1300,7 +1300,7 @@ public Visitable visit(final ReceiverParameter n, final A arg) { } @Override - public Visitable visit(final VarType n, final A arg) { + public Visitable visit(final VarType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setAnnotations(annotations); @@ -1309,14 +1309,14 @@ public Visitable visit(final VarType n, final A arg) { } @Override - public Visitable visit(final Modifier n, final A arg) { + public Visitable visit(final Modifier n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final SwitchExpr n, final A arg) { + public Visitable visit(final SwitchExpr n, final A arg) { NodeList entries = modifyList(n.getEntries(), arg); Expression selector = (Expression) n.getSelector().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1329,7 +1329,7 @@ public Visitable visit(final SwitchExpr n, final A arg) { } @Override - public Visitable visit(final YieldStmt n, final A arg) { + public Visitable visit(final YieldStmt n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (expression == null) @@ -1340,14 +1340,14 @@ public Visitable visit(final YieldStmt n, final A arg) { } @Override - public Visitable visit(final TextBlockLiteralExpr n, final A arg) { + public Visitable visit(final TextBlockLiteralExpr n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final TypePatternExpr n, final A arg) { + public Visitable visit(final TypePatternExpr n, final A arg) { NodeList modifiers = modifyList(n.getModifiers(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); Type type = (Type) n.getType().accept(this, arg); @@ -1362,7 +1362,7 @@ public Visitable visit(final TypePatternExpr n, final A arg) { } @Override - public Visitable visit(final RecordPatternExpr n, final A arg) { + public Visitable visit(final RecordPatternExpr n, final A arg) { NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList patternList = modifyList(n.getPatternList(), arg); Type type = (Type) n.getType().accept(this, arg); @@ -1377,7 +1377,7 @@ public Visitable visit(final RecordPatternExpr n, final A arg) { } @Override - public Visitable visit(final JmlClauseLabel n, final A arg) { + public Visitable visit(final JmlClauseLabel n, final A arg) { Expression expr = (Expression) n.getExpr().accept(this, arg); SimpleName label = n.getLabel().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); @@ -1392,7 +1392,7 @@ public Visitable visit(final JmlClauseLabel n, final A arg) { } @Override - public Visitable visit(final JmlExpressionStmt n, final A arg) { + public Visitable visit(final JmlExpressionStmt n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); NodeList jmlTags = modifyList(n.getJmlTags(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1405,7 +1405,7 @@ public Visitable visit(final JmlExpressionStmt n, final A arg) { } @Override - public Visitable visit(final JmlQuantifiedExpr n, final A arg) { + public Visitable visit(final JmlQuantifiedExpr n, final A arg) { NodeList expressions = modifyList(n.getExpressions(), arg); NodeList variables = modifyList(n.getVariables(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1418,7 +1418,7 @@ public Visitable visit(final JmlQuantifiedExpr n, final A arg) { } @Override - public Visitable visit(final JmlLabelExpr n, final A arg) { + public Visitable visit(final JmlLabelExpr n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); SimpleName label = (SimpleName) n.getLabel().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1431,7 +1431,7 @@ public Visitable visit(final JmlLabelExpr n, final A arg) { } @Override - public Visitable visit(final JmlLetExpr n, final A arg) { + public Visitable visit(final JmlLetExpr n, final A arg) { Expression body = (Expression) n.getBody().accept(this, arg); VariableDeclarationExpr variables = (VariableDeclarationExpr) n.getVariables().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1444,7 +1444,7 @@ public Visitable visit(final JmlLetExpr n, final A arg) { } @Override - public Visitable visit(final JmlMultiCompareExpr n, final A arg) { + public Visitable visit(final JmlMultiCompareExpr n, final A arg) { NodeList expressions = modifyList(n.getExpressions(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (expressions.isEmpty()) @@ -1455,7 +1455,7 @@ public Visitable visit(final JmlMultiCompareExpr n, final A arg) { } @Override - public Visitable visit(final JmlSimpleExprClause n, final A arg) { + public Visitable visit(final JmlSimpleExprClause n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); NodeList heaps = modifyList(n.getHeaps(), arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); @@ -1470,7 +1470,7 @@ public Visitable visit(final JmlSimpleExprClause n, final A arg) { } @Override - public Visitable visit(final JmlSignalsClause n, final A arg) { + public Visitable visit(final JmlSignalsClause n, final A arg) { Expression expression = (Expression) n.getExpression().accept(this, arg); Parameter parameter = (Parameter) n.getParameter().accept(this, arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); @@ -1485,7 +1485,7 @@ public Visitable visit(final JmlSignalsClause n, final A arg) { } @Override - public Visitable visit(final JmlSignalsOnlyClause n, final A arg) { + public Visitable visit(final JmlSignalsOnlyClause n, final A arg) { NodeList types = modifyList(n.getTypes(), arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1496,7 +1496,7 @@ public Visitable visit(final JmlSignalsOnlyClause n, final A arg) { } @Override - public Visitable visit(final JmlUnreachableStmt n, final A arg) { + public Visitable visit(final JmlUnreachableStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setJmlTags(jmlTags); @@ -1505,7 +1505,7 @@ public Visitable visit(final JmlUnreachableStmt n, final A arg) { } @Override - public Visitable visit(final JmlCallableClause n, final A arg) { + public Visitable visit(final JmlCallableClause n, final A arg) { NodeList methodSignatures = modifyList(n.getMethodSignatures(), arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1516,7 +1516,7 @@ public Visitable visit(final JmlCallableClause n, final A arg) { } @Override - public Visitable visit(final JmlForallClause n, final A arg) { + public Visitable visit(final JmlForallClause n, final A arg) { NodeList boundedVariables = modifyList(n.getBoundedVariables(), arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1527,7 +1527,7 @@ public Visitable visit(final JmlForallClause n, final A arg) { } @Override - public Visitable visit(final JmlRefiningStmt n, final A arg) { + public Visitable visit(final JmlRefiningStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setJmlTags(jmlTags); @@ -1536,7 +1536,7 @@ public Visitable visit(final JmlRefiningStmt n, final A arg) { } @Override - public Visitable visit(final JmlClauseIf n, final A arg) { + public Visitable visit(final JmlClauseIf n, final A arg) { Expression condition = (Expression) n.getCondition().accept(this, arg); Expression then = (Expression) n.getThen().accept(this, arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); @@ -1551,7 +1551,7 @@ public Visitable visit(final JmlClauseIf n, final A arg) { } @Override - public Visitable visit(final JmlClassExprDeclaration n, final A arg) { + public Visitable visit(final JmlClassExprDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); Expression invariant = (Expression) n.getInvariant().accept(this, arg); @@ -1572,7 +1572,7 @@ public Visitable visit(final JmlClassExprDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlClassAccessibleDeclaration n, final A arg) { + public Visitable visit(final JmlClassAccessibleDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList expressions = modifyList(n.getExpressions(), arg); @@ -1593,7 +1593,7 @@ public Visitable visit(final JmlClassAccessibleDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlRepresentsDeclaration n, final A arg) { + public Visitable visit(final JmlRepresentsDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); Expression expr = (Expression) n.getExpr().accept(this, arg); @@ -1612,7 +1612,7 @@ public Visitable visit(final JmlRepresentsDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlContract n, final A arg) { + public Visitable visit(final JmlContract n, final A arg) { NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList clauses = modifyList(n.getClauses(), arg); NodeList jmlTags = modifyList(n.getJmlTags(), arg); @@ -1629,7 +1629,7 @@ public Visitable visit(final JmlContract n, final A arg) { } @Override - public Visitable visit(final JmlSetComprehensionExpr n, final A arg) { + public Visitable visit(final JmlSetComprehensionExpr n, final A arg) { VariableDeclarator binding = (VariableDeclarator) n.getBinding().accept(this, arg); Expression predicate = (Expression) n.getPredicate().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1642,7 +1642,7 @@ public Visitable visit(final JmlSetComprehensionExpr n, final A arg) { } @Override - public Visitable visit(final JmlGhostStmt n, final A arg) { + public Visitable visit(final JmlGhostStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); Statement statement = (Statement) n.getStatement().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1655,7 +1655,7 @@ public Visitable visit(final JmlGhostStmt n, final A arg) { } @Override - public Visitable visit(final JmlMethodDeclaration n, final A arg) { + public Visitable visit(final JmlMethodDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); JmlContract contract = n.getContract().map(s -> (JmlContract) s.accept(this, arg)).orElse(null); NodeList jmlTags = modifyList(n.getJmlTags(), arg); @@ -1672,7 +1672,7 @@ public Visitable visit(final JmlMethodDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlBinaryInfixExpr n, final A arg) { + public Visitable visit(final JmlBinaryInfixExpr n, final A arg) { Expression left = (Expression) n.getLeft().accept(this, arg); SimpleName operator = (SimpleName) n.getOperator().accept(this, arg); Expression right = (Expression) n.getRight().accept(this, arg); @@ -1687,7 +1687,7 @@ public Visitable visit(final JmlBinaryInfixExpr n, final A arg) { } @Override - public Visitable visit(final JmlDocDeclaration n, final A arg) { + public Visitable visit(final JmlDocDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList jmlComments = modifyList(n.getJmlComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1698,7 +1698,7 @@ public Visitable visit(final JmlDocDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlDocStmt n, final A arg) { + public Visitable visit(final JmlDocStmt n, final A arg) { NodeList jmlComments = modifyList(n.getJmlComments(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setJmlComments(jmlComments); @@ -1707,14 +1707,14 @@ public Visitable visit(final JmlDocStmt n, final A arg) { } @Override - public Visitable visit(final JmlDoc n, final A arg) { + public Visitable visit(final JmlDoc n, final A arg) { Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setComment(comment); return n; } @Override - public Visitable visit(final JmlDocType n, final A arg) { + public Visitable visit(final JmlDocType n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); NodeList modifiers = modifyList(n.getModifiers(), arg); NodeList jmlComments = modifyList(n.getJmlComments(), arg); @@ -1733,7 +1733,7 @@ public Visitable visit(final JmlDocType n, final A arg) { } @Override - public Visitable visit(final JmlFieldDeclaration n, final A arg) { + public Visitable visit(final JmlFieldDeclaration n, final A arg) { NodeList annotations = modifyList(n.getAnnotations(), arg); FieldDeclaration decl = (FieldDeclaration) n.getDecl().accept(this, arg); NodeList jmlTags = modifyList(n.getJmlTags(), arg); @@ -1748,7 +1748,7 @@ public Visitable visit(final JmlFieldDeclaration n, final A arg) { } @Override - public Visitable visit(final JmlOldClause n, final A arg) { + public Visitable visit(final JmlOldClause n, final A arg) { VariableDeclarationExpr declarations = (VariableDeclarationExpr) n.getDeclarations().accept(this, arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1761,7 +1761,7 @@ public Visitable visit(final JmlOldClause n, final A arg) { } @Override - public Visitable visit(final JmlTypeExpr n, final A arg) { + public Visitable visit(final JmlTypeExpr n, final A arg) { Type type = (Type) n.getType().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); if (type == null) @@ -1772,7 +1772,7 @@ public Visitable visit(final JmlTypeExpr n, final A arg) { } @Override - public Visitable visit(final JmlMultiExprClause n, final A arg) { + public Visitable visit(final JmlMultiExprClause n, final A arg) { NodeList expressions = modifyList(n.getExpressions(), arg); NodeList heaps = modifyList(n.getHeaps(), arg); SimpleName name = n.getName().map(s -> (SimpleName) s.accept(this, arg)).orElse(null); @@ -1785,7 +1785,7 @@ public Visitable visit(final JmlMultiExprClause n, final A arg) { } @Override - public Visitable visit(final JmlBeginStmt n, final A arg) { + public Visitable visit(final JmlBeginStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setJmlTags(jmlTags); @@ -1794,7 +1794,7 @@ public Visitable visit(final JmlBeginStmt n, final A arg) { } @Override - public Visitable visit(final JmlEndStmt n, final A arg) { + public Visitable visit(final JmlEndStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); n.setJmlTags(jmlTags); @@ -1803,7 +1803,7 @@ public Visitable visit(final JmlEndStmt n, final A arg) { } @Override - public Visitable visit(final JmlLabelStmt n, final A arg) { + public Visitable visit(final JmlLabelStmt n, final A arg) { NodeList jmlTags = modifyList(n.getJmlTags(), arg); SimpleName label = (SimpleName) n.getLabel().accept(this, arg); Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null); @@ -1816,7 +1816,7 @@ public Visitable visit(final JmlLabelStmt n, final A arg) { } @Override - public Visitable visit(final JmlMethodSignature n, final A arg) { + public Visitable visit(final JmlMethodSignature n, final A arg) { NodeList argumentTypes = modifyList(n.getArgumentTypes(), arg); SimpleName name = (SimpleName) n.getName().accept(this, arg); Type receiver = n.getReceiver().map(s -> (Type) s.accept(this, arg)).orElse(null); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java index ac20c69b14..e8208694cf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentEqualsVisitor.java @@ -36,7 +36,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.expr.*; -public class NoCommentEqualsVisitor implements GenericVisitor { +public class NoCommentEqualsVisitor implements GenericVisitor { private static final NoCommentEqualsVisitor SINGLETON = new NoCommentEqualsVisitor(); @@ -94,7 +94,7 @@ private boolean objEquals(final Object n, final Object n2) { } @Override - public Boolean visit(final CompilationUnit n, final Visitable arg) { + public Boolean visit(final CompilationUnit n, final Visitable arg) { final CompilationUnit n2 = (CompilationUnit) arg; if (!nodesEquals(n.getImports(), n2.getImports())) return false; @@ -108,7 +108,7 @@ public Boolean visit(final CompilationUnit n, final Visitable arg) { } @Override - public Boolean visit(final PackageDeclaration n, final Visitable arg) { + public Boolean visit(final PackageDeclaration n, final Visitable arg) { final PackageDeclaration n2 = (PackageDeclaration) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -118,7 +118,7 @@ public Boolean visit(final PackageDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final TypeParameter n, final Visitable arg) { + public Boolean visit(final TypeParameter n, final Visitable arg) { final TypeParameter n2 = (TypeParameter) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -130,17 +130,17 @@ public Boolean visit(final TypeParameter n, final Visitable arg) { } @Override - public Boolean visit(final LineComment n, final Visitable arg) { + public Boolean visit(final LineComment n, final Visitable arg) { return true; } @Override - public Boolean visit(final BlockComment n, final Visitable arg) { + public Boolean visit(final BlockComment n, final Visitable arg) { return true; } @Override - public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { final ClassOrInterfaceDeclaration n2 = (ClassOrInterfaceDeclaration) arg; if (!nodesEquals(n.getExtendedTypes(), n2.getExtendedTypes())) return false; @@ -164,7 +164,7 @@ public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) } @Override - public Boolean visit(final EnumDeclaration n, final Visitable arg) { + public Boolean visit(final EnumDeclaration n, final Visitable arg) { final EnumDeclaration n2 = (EnumDeclaration) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -182,7 +182,7 @@ public Boolean visit(final EnumDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { + public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -196,7 +196,7 @@ public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { final AnnotationDeclaration n2 = (AnnotationDeclaration) arg; if (!nodesEquals(n.getMembers(), n2.getMembers())) return false; @@ -210,7 +210,7 @@ public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { final AnnotationMemberDeclaration n2 = (AnnotationMemberDeclaration) arg; if (!nodeEquals(n.getDefaultValue(), n2.getDefaultValue())) return false; @@ -226,7 +226,7 @@ public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) } @Override - public Boolean visit(final FieldDeclaration n, final Visitable arg) { + public Boolean visit(final FieldDeclaration n, final Visitable arg) { final FieldDeclaration n2 = (FieldDeclaration) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -238,7 +238,7 @@ public Boolean visit(final FieldDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final VariableDeclarator n, final Visitable arg) { + public Boolean visit(final VariableDeclarator n, final Visitable arg) { final VariableDeclarator n2 = (VariableDeclarator) arg; if (!nodeEquals(n.getInitializer(), n2.getInitializer())) return false; @@ -250,7 +250,7 @@ public Boolean visit(final VariableDeclarator n, final Visitable arg) { } @Override - public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { final ConstructorDeclaration n2 = (ConstructorDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -274,7 +274,7 @@ public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final MethodDeclaration n, final Visitable arg) { + public Boolean visit(final MethodDeclaration n, final Visitable arg) { final MethodDeclaration n2 = (MethodDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -300,7 +300,7 @@ public Boolean visit(final MethodDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final Parameter n, final Visitable arg) { + public Boolean visit(final Parameter n, final Visitable arg) { final Parameter n2 = (Parameter) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -318,7 +318,7 @@ public Boolean visit(final Parameter n, final Visitable arg) { } @Override - public Boolean visit(final InitializerDeclaration n, final Visitable arg) { + public Boolean visit(final InitializerDeclaration n, final Visitable arg) { final InitializerDeclaration n2 = (InitializerDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -330,12 +330,12 @@ public Boolean visit(final InitializerDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JavadocComment n, final Visitable arg) { + public Boolean visit(final JavadocComment n, final Visitable arg) { return true; } @Override - public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { final ClassOrInterfaceType n2 = (ClassOrInterfaceType) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -349,7 +349,7 @@ public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { } @Override - public Boolean visit(final PrimitiveType n, final Visitable arg) { + public Boolean visit(final PrimitiveType n, final Visitable arg) { final PrimitiveType n2 = (PrimitiveType) arg; if (!objEquals(n.getType(), n2.getType())) return false; @@ -359,7 +359,7 @@ public Boolean visit(final PrimitiveType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayType n, final Visitable arg) { + public Boolean visit(final ArrayType n, final Visitable arg) { final ArrayType n2 = (ArrayType) arg; if (!nodeEquals(n.getComponentType(), n2.getComponentType())) return false; @@ -371,7 +371,7 @@ public Boolean visit(final ArrayType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { + public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { final ArrayCreationLevel n2 = (ArrayCreationLevel) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -381,7 +381,7 @@ public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { } @Override - public Boolean visit(final IntersectionType n, final Visitable arg) { + public Boolean visit(final IntersectionType n, final Visitable arg) { final IntersectionType n2 = (IntersectionType) arg; if (!nodesEquals(n.getElements(), n2.getElements())) return false; @@ -391,7 +391,7 @@ public Boolean visit(final IntersectionType n, final Visitable arg) { } @Override - public Boolean visit(final UnionType n, final Visitable arg) { + public Boolean visit(final UnionType n, final Visitable arg) { final UnionType n2 = (UnionType) arg; if (!nodesEquals(n.getElements(), n2.getElements())) return false; @@ -401,7 +401,7 @@ public Boolean visit(final UnionType n, final Visitable arg) { } @Override - public Boolean visit(final VoidType n, final Visitable arg) { + public Boolean visit(final VoidType n, final Visitable arg) { final VoidType n2 = (VoidType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -409,7 +409,7 @@ public Boolean visit(final VoidType n, final Visitable arg) { } @Override - public Boolean visit(final WildcardType n, final Visitable arg) { + public Boolean visit(final WildcardType n, final Visitable arg) { final WildcardType n2 = (WildcardType) arg; if (!nodeEquals(n.getExtendedType(), n2.getExtendedType())) return false; @@ -421,7 +421,7 @@ public Boolean visit(final WildcardType n, final Visitable arg) { } @Override - public Boolean visit(final UnknownType n, final Visitable arg) { + public Boolean visit(final UnknownType n, final Visitable arg) { final UnknownType n2 = (UnknownType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -429,7 +429,7 @@ public Boolean visit(final UnknownType n, final Visitable arg) { } @Override - public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { + public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { final ArrayAccessExpr n2 = (ArrayAccessExpr) arg; if (!nodeEquals(n.getIndex(), n2.getIndex())) return false; @@ -439,7 +439,7 @@ public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { } @Override - public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { + public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { final ArrayCreationExpr n2 = (ArrayCreationExpr) arg; if (!nodeEquals(n.getElementType(), n2.getElementType())) return false; @@ -451,7 +451,7 @@ public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { } @Override - public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { + public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { final ArrayInitializerExpr n2 = (ArrayInitializerExpr) arg; if (!nodesEquals(n.getValues(), n2.getValues())) return false; @@ -459,7 +459,7 @@ public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { } @Override - public Boolean visit(final AssignExpr n, final Visitable arg) { + public Boolean visit(final AssignExpr n, final Visitable arg) { final AssignExpr n2 = (AssignExpr) arg; if (!objEquals(n.getOperator(), n2.getOperator())) return false; @@ -471,7 +471,7 @@ public Boolean visit(final AssignExpr n, final Visitable arg) { } @Override - public Boolean visit(final BinaryExpr n, final Visitable arg) { + public Boolean visit(final BinaryExpr n, final Visitable arg) { final BinaryExpr n2 = (BinaryExpr) arg; if (!nodeEquals(n.getLeft(), n2.getLeft())) return false; @@ -483,7 +483,7 @@ public Boolean visit(final BinaryExpr n, final Visitable arg) { } @Override - public Boolean visit(final CastExpr n, final Visitable arg) { + public Boolean visit(final CastExpr n, final Visitable arg) { final CastExpr n2 = (CastExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -493,7 +493,7 @@ public Boolean visit(final CastExpr n, final Visitable arg) { } @Override - public Boolean visit(final ClassExpr n, final Visitable arg) { + public Boolean visit(final ClassExpr n, final Visitable arg) { final ClassExpr n2 = (ClassExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -501,7 +501,7 @@ public Boolean visit(final ClassExpr n, final Visitable arg) { } @Override - public Boolean visit(final ConditionalExpr n, final Visitable arg) { + public Boolean visit(final ConditionalExpr n, final Visitable arg) { final ConditionalExpr n2 = (ConditionalExpr) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -513,7 +513,7 @@ public Boolean visit(final ConditionalExpr n, final Visitable arg) { } @Override - public Boolean visit(final EnclosedExpr n, final Visitable arg) { + public Boolean visit(final EnclosedExpr n, final Visitable arg) { final EnclosedExpr n2 = (EnclosedExpr) arg; if (!nodeEquals(n.getInner(), n2.getInner())) return false; @@ -521,7 +521,7 @@ public Boolean visit(final EnclosedExpr n, final Visitable arg) { } @Override - public Boolean visit(final FieldAccessExpr n, final Visitable arg) { + public Boolean visit(final FieldAccessExpr n, final Visitable arg) { final FieldAccessExpr n2 = (FieldAccessExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -533,7 +533,7 @@ public Boolean visit(final FieldAccessExpr n, final Visitable arg) { } @Override - public Boolean visit(final InstanceOfExpr n, final Visitable arg) { + public Boolean visit(final InstanceOfExpr n, final Visitable arg) { final InstanceOfExpr n2 = (InstanceOfExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -545,7 +545,7 @@ public Boolean visit(final InstanceOfExpr n, final Visitable arg) { } @Override - public Boolean visit(final StringLiteralExpr n, final Visitable arg) { + public Boolean visit(final StringLiteralExpr n, final Visitable arg) { final StringLiteralExpr n2 = (StringLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -553,7 +553,7 @@ public Boolean visit(final StringLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { + public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { final IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -561,7 +561,7 @@ public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final LongLiteralExpr n, final Visitable arg) { + public Boolean visit(final LongLiteralExpr n, final Visitable arg) { final LongLiteralExpr n2 = (LongLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -569,7 +569,7 @@ public Boolean visit(final LongLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final CharLiteralExpr n, final Visitable arg) { + public Boolean visit(final CharLiteralExpr n, final Visitable arg) { final CharLiteralExpr n2 = (CharLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -577,7 +577,7 @@ public Boolean visit(final CharLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { + public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -585,7 +585,7 @@ public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { + public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { final BooleanLiteralExpr n2 = (BooleanLiteralExpr) arg; if (!objEquals(n.isValue(), n2.isValue())) return false; @@ -593,12 +593,12 @@ public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final NullLiteralExpr n, final Visitable arg) { + public Boolean visit(final NullLiteralExpr n, final Visitable arg) { return true; } @Override - public Boolean visit(final MethodCallExpr n, final Visitable arg) { + public Boolean visit(final MethodCallExpr n, final Visitable arg) { final MethodCallExpr n2 = (MethodCallExpr) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -612,7 +612,7 @@ public Boolean visit(final MethodCallExpr n, final Visitable arg) { } @Override - public Boolean visit(final NameExpr n, final Visitable arg) { + public Boolean visit(final NameExpr n, final Visitable arg) { final NameExpr n2 = (NameExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -620,7 +620,7 @@ public Boolean visit(final NameExpr n, final Visitable arg) { } @Override - public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { + public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { final ObjectCreationExpr n2 = (ObjectCreationExpr) arg; if (!nodesEquals(n.getAnonymousClassBody(), n2.getAnonymousClassBody())) return false; @@ -636,7 +636,7 @@ public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { } @Override - public Boolean visit(final Name n, final Visitable arg) { + public Boolean visit(final Name n, final Visitable arg) { final Name n2 = (Name) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -646,7 +646,7 @@ public Boolean visit(final Name n, final Visitable arg) { } @Override - public Boolean visit(final SimpleName n, final Visitable arg) { + public Boolean visit(final SimpleName n, final Visitable arg) { final SimpleName n2 = (SimpleName) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -654,7 +654,7 @@ public Boolean visit(final SimpleName n, final Visitable arg) { } @Override - public Boolean visit(final ThisExpr n, final Visitable arg) { + public Boolean visit(final ThisExpr n, final Visitable arg) { final ThisExpr n2 = (ThisExpr) arg; if (!nodeEquals(n.getTypeName(), n2.getTypeName())) return false; @@ -662,7 +662,7 @@ public Boolean visit(final ThisExpr n, final Visitable arg) { } @Override - public Boolean visit(final SuperExpr n, final Visitable arg) { + public Boolean visit(final SuperExpr n, final Visitable arg) { final SuperExpr n2 = (SuperExpr) arg; if (!nodeEquals(n.getTypeName(), n2.getTypeName())) return false; @@ -670,7 +670,7 @@ public Boolean visit(final SuperExpr n, final Visitable arg) { } @Override - public Boolean visit(final UnaryExpr n, final Visitable arg) { + public Boolean visit(final UnaryExpr n, final Visitable arg) { final UnaryExpr n2 = (UnaryExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -680,7 +680,7 @@ public Boolean visit(final UnaryExpr n, final Visitable arg) { } @Override - public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { + public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { final VariableDeclarationExpr n2 = (VariableDeclarationExpr) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -692,7 +692,7 @@ public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { } @Override - public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { + public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { final MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -700,7 +700,7 @@ public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { + public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { final SingleMemberAnnotationExpr n2 = (SingleMemberAnnotationExpr) arg; if (!nodeEquals(n.getMemberValue(), n2.getMemberValue())) return false; @@ -710,7 +710,7 @@ public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { + public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { final NormalAnnotationExpr n2 = (NormalAnnotationExpr) arg; if (!nodesEquals(n.getPairs(), n2.getPairs())) return false; @@ -720,7 +720,7 @@ public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { } @Override - public Boolean visit(final MemberValuePair n, final Visitable arg) { + public Boolean visit(final MemberValuePair n, final Visitable arg) { final MemberValuePair n2 = (MemberValuePair) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -730,7 +730,7 @@ public Boolean visit(final MemberValuePair n, final Visitable arg) { } @Override - public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { + public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { final ExplicitConstructorInvocationStmt n2 = (ExplicitConstructorInvocationStmt) arg; if (!nodesEquals(n.getArguments(), n2.getArguments())) return false; @@ -744,7 +744,7 @@ public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable } @Override - public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { final LocalClassDeclarationStmt n2 = (LocalClassDeclarationStmt) arg; if (!nodeEquals(n.getClassDeclaration(), n2.getClassDeclaration())) return false; @@ -752,7 +752,7 @@ public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { } @Override - public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { final LocalRecordDeclarationStmt n2 = (LocalRecordDeclarationStmt) arg; if (!nodeEquals(n.getRecordDeclaration(), n2.getRecordDeclaration())) return false; @@ -760,7 +760,7 @@ public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { } @Override - public Boolean visit(final AssertStmt n, final Visitable arg) { + public Boolean visit(final AssertStmt n, final Visitable arg) { final AssertStmt n2 = (AssertStmt) arg; if (!nodeEquals(n.getCheck(), n2.getCheck())) return false; @@ -770,7 +770,7 @@ public Boolean visit(final AssertStmt n, final Visitable arg) { } @Override - public Boolean visit(final BlockStmt n, final Visitable arg) { + public Boolean visit(final BlockStmt n, final Visitable arg) { final BlockStmt n2 = (BlockStmt) arg; if (!nodesEquals(n.getContracts(), n2.getContracts())) return false; @@ -780,7 +780,7 @@ public Boolean visit(final BlockStmt n, final Visitable arg) { } @Override - public Boolean visit(final LabeledStmt n, final Visitable arg) { + public Boolean visit(final LabeledStmt n, final Visitable arg) { final LabeledStmt n2 = (LabeledStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -790,12 +790,12 @@ public Boolean visit(final LabeledStmt n, final Visitable arg) { } @Override - public Boolean visit(final EmptyStmt n, final Visitable arg) { + public Boolean visit(final EmptyStmt n, final Visitable arg) { return true; } @Override - public Boolean visit(final ExpressionStmt n, final Visitable arg) { + public Boolean visit(final ExpressionStmt n, final Visitable arg) { final ExpressionStmt n2 = (ExpressionStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -803,7 +803,7 @@ public Boolean visit(final ExpressionStmt n, final Visitable arg) { } @Override - public Boolean visit(final SwitchStmt n, final Visitable arg) { + public Boolean visit(final SwitchStmt n, final Visitable arg) { final SwitchStmt n2 = (SwitchStmt) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -813,7 +813,7 @@ public Boolean visit(final SwitchStmt n, final Visitable arg) { } @Override - public Boolean visit(final SwitchEntry n, final Visitable arg) { + public Boolean visit(final SwitchEntry n, final Visitable arg) { final SwitchEntry n2 = (SwitchEntry) arg; if (!nodeEquals(n.getGuard(), n2.getGuard())) return false; @@ -829,7 +829,7 @@ public Boolean visit(final SwitchEntry n, final Visitable arg) { } @Override - public Boolean visit(final BreakStmt n, final Visitable arg) { + public Boolean visit(final BreakStmt n, final Visitable arg) { final BreakStmt n2 = (BreakStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -837,7 +837,7 @@ public Boolean visit(final BreakStmt n, final Visitable arg) { } @Override - public Boolean visit(final ReturnStmt n, final Visitable arg) { + public Boolean visit(final ReturnStmt n, final Visitable arg) { final ReturnStmt n2 = (ReturnStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -845,7 +845,7 @@ public Boolean visit(final ReturnStmt n, final Visitable arg) { } @Override - public Boolean visit(final IfStmt n, final Visitable arg) { + public Boolean visit(final IfStmt n, final Visitable arg) { final IfStmt n2 = (IfStmt) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -857,7 +857,7 @@ public Boolean visit(final IfStmt n, final Visitable arg) { } @Override - public Boolean visit(final WhileStmt n, final Visitable arg) { + public Boolean visit(final WhileStmt n, final Visitable arg) { final WhileStmt n2 = (WhileStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -869,7 +869,7 @@ public Boolean visit(final WhileStmt n, final Visitable arg) { } @Override - public Boolean visit(final ContinueStmt n, final Visitable arg) { + public Boolean visit(final ContinueStmt n, final Visitable arg) { final ContinueStmt n2 = (ContinueStmt) arg; if (!nodeEquals(n.getLabel(), n2.getLabel())) return false; @@ -877,7 +877,7 @@ public Boolean visit(final ContinueStmt n, final Visitable arg) { } @Override - public Boolean visit(final DoStmt n, final Visitable arg) { + public Boolean visit(final DoStmt n, final Visitable arg) { final DoStmt n2 = (DoStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -889,7 +889,7 @@ public Boolean visit(final DoStmt n, final Visitable arg) { } @Override - public Boolean visit(final ForEachStmt n, final Visitable arg) { + public Boolean visit(final ForEachStmt n, final Visitable arg) { final ForEachStmt n2 = (ForEachStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -903,7 +903,7 @@ public Boolean visit(final ForEachStmt n, final Visitable arg) { } @Override - public Boolean visit(final ForStmt n, final Visitable arg) { + public Boolean visit(final ForStmt n, final Visitable arg) { final ForStmt n2 = (ForStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -919,7 +919,7 @@ public Boolean visit(final ForStmt n, final Visitable arg) { } @Override - public Boolean visit(final ThrowStmt n, final Visitable arg) { + public Boolean visit(final ThrowStmt n, final Visitable arg) { final ThrowStmt n2 = (ThrowStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -927,7 +927,7 @@ public Boolean visit(final ThrowStmt n, final Visitable arg) { } @Override - public Boolean visit(final SynchronizedStmt n, final Visitable arg) { + public Boolean visit(final SynchronizedStmt n, final Visitable arg) { final SynchronizedStmt n2 = (SynchronizedStmt) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -937,7 +937,7 @@ public Boolean visit(final SynchronizedStmt n, final Visitable arg) { } @Override - public Boolean visit(final TryStmt n, final Visitable arg) { + public Boolean visit(final TryStmt n, final Visitable arg) { final TryStmt n2 = (TryStmt) arg; if (!nodesEquals(n.getCatchClauses(), n2.getCatchClauses())) return false; @@ -951,7 +951,7 @@ public Boolean visit(final TryStmt n, final Visitable arg) { } @Override - public Boolean visit(final CatchClause n, final Visitable arg) { + public Boolean visit(final CatchClause n, final Visitable arg) { final CatchClause n2 = (CatchClause) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -961,7 +961,7 @@ public Boolean visit(final CatchClause n, final Visitable arg) { } @Override - public Boolean visit(final LambdaExpr n, final Visitable arg) { + public Boolean visit(final LambdaExpr n, final Visitable arg) { final LambdaExpr n2 = (LambdaExpr) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -975,7 +975,7 @@ public Boolean visit(final LambdaExpr n, final Visitable arg) { } @Override - public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { + public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { final MethodReferenceExpr n2 = (MethodReferenceExpr) arg; if (!objEquals(n.getIdentifier(), n2.getIdentifier())) return false; @@ -987,7 +987,7 @@ public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { } @Override - public Boolean visit(final TypeExpr n, final Visitable arg) { + public Boolean visit(final TypeExpr n, final Visitable arg) { final TypeExpr n2 = (TypeExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -995,7 +995,7 @@ public Boolean visit(final TypeExpr n, final Visitable arg) { } @Override - public Boolean visit(final ImportDeclaration n, final Visitable arg) { + public Boolean visit(final ImportDeclaration n, final Visitable arg) { final ImportDeclaration n2 = (ImportDeclaration) arg; if (!objEquals(n.isAsterisk(), n2.isAsterisk())) return false; @@ -1009,12 +1009,12 @@ public Boolean visit(final ImportDeclaration n, final Visitable arg) { } @Override - public Boolean visit(NodeList n, Visitable arg) { + public Boolean visit(NodeList n, Visitable arg) { return nodesEquals((NodeList) n, (NodeList) arg); } @Override - public Boolean visit(final ModuleDeclaration n, final Visitable arg) { + public Boolean visit(final ModuleDeclaration n, final Visitable arg) { final ModuleDeclaration n2 = (ModuleDeclaration) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1028,7 +1028,7 @@ public Boolean visit(final ModuleDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { + public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { final ModuleRequiresDirective n2 = (ModuleRequiresDirective) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1038,7 +1038,7 @@ public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { + public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { final ModuleExportsDirective n2 = (ModuleExportsDirective) arg; if (!nodesEquals(n.getModuleNames(), n2.getModuleNames())) return false; @@ -1048,7 +1048,7 @@ public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { + public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { final ModuleProvidesDirective n2 = (ModuleProvidesDirective) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1058,7 +1058,7 @@ public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { } @Override() - public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { + public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { final ModuleUsesDirective n2 = (ModuleUsesDirective) arg; if (!nodeEquals(n.getName(), n2.getName())) return false; @@ -1066,7 +1066,7 @@ public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { } @Override - public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { + public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { final ModuleOpensDirective n2 = (ModuleOpensDirective) arg; if (!nodesEquals(n.getModuleNames(), n2.getModuleNames())) return false; @@ -1076,12 +1076,12 @@ public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { } @Override - public Boolean visit(final UnparsableStmt n, final Visitable arg) { + public Boolean visit(final UnparsableStmt n, final Visitable arg) { return true; } @Override - public Boolean visit(final ReceiverParameter n, final Visitable arg) { + public Boolean visit(final ReceiverParameter n, final Visitable arg) { final ReceiverParameter n2 = (ReceiverParameter) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1093,7 +1093,7 @@ public Boolean visit(final ReceiverParameter n, final Visitable arg) { } @Override - public Boolean visit(final VarType n, final Visitable arg) { + public Boolean visit(final VarType n, final Visitable arg) { final VarType n2 = (VarType) arg; if (!nodesEquals(n.getAnnotations(), n2.getAnnotations())) return false; @@ -1101,7 +1101,7 @@ public Boolean visit(final VarType n, final Visitable arg) { } @Override - public Boolean visit(final Modifier n, final Visitable arg) { + public Boolean visit(final Modifier n, final Visitable arg) { final Modifier n2 = (Modifier) arg; if (!objEquals(n.getKeyword(), n2.getKeyword())) return false; @@ -1109,7 +1109,7 @@ public Boolean visit(final Modifier n, final Visitable arg) { } @Override - public Boolean visit(final SwitchExpr n, final Visitable arg) { + public Boolean visit(final SwitchExpr n, final Visitable arg) { final SwitchExpr n2 = (SwitchExpr) arg; if (!nodesEquals(n.getEntries(), n2.getEntries())) return false; @@ -1119,7 +1119,7 @@ public Boolean visit(final SwitchExpr n, final Visitable arg) { } @Override - public Boolean visit(final YieldStmt n, final Visitable arg) { + public Boolean visit(final YieldStmt n, final Visitable arg) { final YieldStmt n2 = (YieldStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1127,7 +1127,7 @@ public Boolean visit(final YieldStmt n, final Visitable arg) { } @Override - public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { + public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { final TextBlockLiteralExpr n2 = (TextBlockLiteralExpr) arg; if (!objEquals(n.getValue(), n2.getValue())) return false; @@ -1135,7 +1135,7 @@ public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { } @Override - public Boolean visit(final TypePatternExpr n, final Visitable arg) { + public Boolean visit(final TypePatternExpr n, final Visitable arg) { final TypePatternExpr n2 = (TypePatternExpr) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1147,7 +1147,7 @@ public Boolean visit(final TypePatternExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlClauseLabel n, final Visitable arg) { + public Boolean visit(final JmlClauseLabel n, final Visitable arg) { final JmlClauseLabel n2 = (JmlClauseLabel) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; @@ -1161,7 +1161,7 @@ public Boolean visit(final JmlClauseLabel n, final Visitable arg) { } @Override - public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { + public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { final JmlExpressionStmt n2 = (JmlExpressionStmt) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1173,7 +1173,7 @@ public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { + public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { final JmlQuantifiedExpr n2 = (JmlQuantifiedExpr) arg; if (!objEquals(n.getBinder(), n2.getBinder())) return false; @@ -1185,7 +1185,7 @@ public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlLabelExpr n, final Visitable arg) { + public Boolean visit(final JmlLabelExpr n, final Visitable arg) { final JmlLabelExpr n2 = (JmlLabelExpr) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1197,7 +1197,7 @@ public Boolean visit(final JmlLabelExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlLetExpr n, final Visitable arg) { + public Boolean visit(final JmlLetExpr n, final Visitable arg) { final JmlLetExpr n2 = (JmlLetExpr) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1207,7 +1207,7 @@ public Boolean visit(final JmlLetExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { + public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { final JmlMultiCompareExpr n2 = (JmlMultiCompareExpr) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1217,7 +1217,7 @@ public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { + public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { final JmlSimpleExprClause n2 = (JmlSimpleExprClause) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1231,7 +1231,7 @@ public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlSignalsClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsClause n, final Visitable arg) { final JmlSignalsClause n2 = (JmlSignalsClause) arg; if (!nodeEquals(n.getExpression(), n2.getExpression())) return false; @@ -1243,7 +1243,7 @@ public Boolean visit(final JmlSignalsClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { final JmlSignalsOnlyClause n2 = (JmlSignalsOnlyClause) arg; if (!nodesEquals(n.getTypes(), n2.getTypes())) return false; @@ -1253,7 +1253,7 @@ public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { + public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { final JmlUnreachableStmt n2 = (JmlUnreachableStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1261,7 +1261,7 @@ public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlCallableClause n, final Visitable arg) { + public Boolean visit(final JmlCallableClause n, final Visitable arg) { final JmlCallableClause n2 = (JmlCallableClause) arg; if (!nodesEquals(n.getMethodSignatures(), n2.getMethodSignatures())) return false; @@ -1271,7 +1271,7 @@ public Boolean visit(final JmlCallableClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlForallClause n, final Visitable arg) { + public Boolean visit(final JmlForallClause n, final Visitable arg) { final JmlForallClause n2 = (JmlForallClause) arg; if (!nodesEquals(n.getBoundedVariables(), n2.getBoundedVariables())) return false; @@ -1281,7 +1281,7 @@ public Boolean visit(final JmlForallClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { + public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { final JmlRefiningStmt n2 = (JmlRefiningStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1289,7 +1289,7 @@ public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlClauseIf n, final Visitable arg) { + public Boolean visit(final JmlClauseIf n, final Visitable arg) { final JmlClauseIf n2 = (JmlClauseIf) arg; if (!nodeEquals(n.getCondition(), n2.getCondition())) return false; @@ -1303,7 +1303,7 @@ public Boolean visit(final JmlClauseIf n, final Visitable arg) { } @Override - public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { final JmlClassExprDeclaration n2 = (JmlClassExprDeclaration) arg; if (!nodeEquals(n.getInvariant(), n2.getInvariant())) return false; @@ -1321,7 +1321,7 @@ public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { final JmlClassAccessibleDeclaration n2 = (JmlClassAccessibleDeclaration) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1339,7 +1339,7 @@ public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg } @Override - public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { + public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { final JmlRepresentsDeclaration n2 = (JmlRepresentsDeclaration) arg; if (!nodeEquals(n.getExpr(), n2.getExpr())) return false; @@ -1355,7 +1355,7 @@ public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlContract n, final Visitable arg) { + public Boolean visit(final JmlContract n, final Visitable arg) { final JmlContract n2 = (JmlContract) arg; if (!objEquals(n.getBehavior(), n2.getBehavior())) return false; @@ -1375,7 +1375,7 @@ public Boolean visit(final JmlContract n, final Visitable arg) { } @Override - public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { + public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { final JmlSetComprehensionExpr n2 = (JmlSetComprehensionExpr) arg; if (!nodeEquals(n.getBinding(), n2.getBinding())) return false; @@ -1385,7 +1385,7 @@ public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlGhostStmt n, final Visitable arg) { + public Boolean visit(final JmlGhostStmt n, final Visitable arg) { final JmlGhostStmt n2 = (JmlGhostStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1395,7 +1395,7 @@ public Boolean visit(final JmlGhostStmt n, final Visitable arg) { } @Override - public Boolean visit(final RecordDeclaration n, final Visitable arg) { + public Boolean visit(final RecordDeclaration n, final Visitable arg) { final RecordDeclaration n2 = (RecordDeclaration) arg; if (!nodesEquals(n.getImplementedTypes(), n2.getImplementedTypes())) return false; @@ -1417,7 +1417,7 @@ public Boolean visit(final RecordDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { final CompactConstructorDeclaration n2 = (CompactConstructorDeclaration) arg; if (!nodeEquals(n.getBody(), n2.getBody())) return false; @@ -1435,7 +1435,7 @@ public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg } @Override - public Boolean visit(final RecordPatternExpr n, final Visitable arg) { + public Boolean visit(final RecordPatternExpr n, final Visitable arg) { final RecordPatternExpr n2 = (RecordPatternExpr) arg; if (!nodesEquals(n.getModifiers(), n2.getModifiers())) return false; @@ -1447,7 +1447,7 @@ public Boolean visit(final RecordPatternExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { + public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { final JmlMethodDeclaration n2 = (JmlMethodDeclaration) arg; if (!nodeEquals(n.getContract(), n2.getContract())) return false; @@ -1461,7 +1461,7 @@ public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { + public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { final JmlBinaryInfixExpr n2 = (JmlBinaryInfixExpr) arg; if (!nodeEquals(n.getLeft(), n2.getLeft())) return false; @@ -1473,7 +1473,7 @@ public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { + public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { final JmlDocDeclaration n2 = (JmlDocDeclaration) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1483,7 +1483,7 @@ public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocStmt n, final Visitable arg) { + public Boolean visit(final JmlDocStmt n, final Visitable arg) { final JmlDocStmt n2 = (JmlDocStmt) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1491,7 +1491,7 @@ public Boolean visit(final JmlDocStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlDoc n, final Visitable arg) { + public Boolean visit(final JmlDoc n, final Visitable arg) { final JmlDoc n2 = (JmlDoc) arg; if (!objEquals(n.getContent(), n2.getContent())) return false; @@ -1499,7 +1499,7 @@ public Boolean visit(final JmlDoc n, final Visitable arg) { } @Override - public Boolean visit(final JmlDocType n, final Visitable arg) { + public Boolean visit(final JmlDocType n, final Visitable arg) { final JmlDocType n2 = (JmlDocType) arg; if (!nodesEquals(n.getJmlComments(), n2.getJmlComments())) return false; @@ -1515,7 +1515,7 @@ public Boolean visit(final JmlDocType n, final Visitable arg) { } @Override - public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { + public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { final JmlFieldDeclaration n2 = (JmlFieldDeclaration) arg; if (!nodeEquals(n.getDecl(), n2.getDecl())) return false; @@ -1527,7 +1527,7 @@ public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { } @Override - public Boolean visit(final JmlOldClause n, final Visitable arg) { + public Boolean visit(final JmlOldClause n, final Visitable arg) { final JmlOldClause n2 = (JmlOldClause) arg; if (!nodeEquals(n.getDeclarations(), n2.getDeclarations())) return false; @@ -1537,7 +1537,7 @@ public Boolean visit(final JmlOldClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlTypeExpr n, final Visitable arg) { + public Boolean visit(final JmlTypeExpr n, final Visitable arg) { final JmlTypeExpr n2 = (JmlTypeExpr) arg; if (!nodeEquals(n.getType(), n2.getType())) return false; @@ -1545,7 +1545,7 @@ public Boolean visit(final JmlTypeExpr n, final Visitable arg) { } @Override - public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { + public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { final JmlMultiExprClause n2 = (JmlMultiExprClause) arg; if (!nodesEquals(n.getExpressions(), n2.getExpressions())) return false; @@ -1559,7 +1559,7 @@ public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { } @Override - public Boolean visit(final JmlBeginStmt n, final Visitable arg) { + public Boolean visit(final JmlBeginStmt n, final Visitable arg) { final JmlBeginStmt n2 = (JmlBeginStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1567,7 +1567,7 @@ public Boolean visit(final JmlBeginStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlEndStmt n, final Visitable arg) { + public Boolean visit(final JmlEndStmt n, final Visitable arg) { final JmlEndStmt n2 = (JmlEndStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1575,7 +1575,7 @@ public Boolean visit(final JmlEndStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlLabelStmt n, final Visitable arg) { + public Boolean visit(final JmlLabelStmt n, final Visitable arg) { final JmlLabelStmt n2 = (JmlLabelStmt) arg; if (!nodesEquals(n.getJmlTags(), n2.getJmlTags())) return false; @@ -1585,7 +1585,7 @@ public Boolean visit(final JmlLabelStmt n, final Visitable arg) { } @Override - public Boolean visit(final JmlMethodSignature n, final Visitable arg) { + public Boolean visit(final JmlMethodSignature n, final Visitable arg) { final JmlMethodSignature n2 = (JmlMethodSignature) arg; if (!nodesEquals(n.getArgumentTypes(), n2.getArgumentTypes())) return false; diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java index c48f311857..2c8f4f233d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NoCommentHashCodeVisitor.java @@ -35,7 +35,7 @@ import com.github.javaparser.ast.jml.body.*; import com.github.javaparser.ast.jml.expr.*; -public class NoCommentHashCodeVisitor implements GenericVisitor { +public class NoCommentHashCodeVisitor implements GenericVisitor { private static final NoCommentHashCodeVisitor SINGLETON = new NoCommentHashCodeVisitor(); @@ -43,232 +43,232 @@ public static int hashCode(final Node node) { return node.accept(SINGLETON, null); } - public Integer visit(final AnnotationDeclaration n, final Void arg) { + public Integer visit(final AnnotationDeclaration n, final Void arg) { return (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { + public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { return (n.getDefaultValue().isPresent() ? n.getDefaultValue().get().accept(this, arg) : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ArrayAccessExpr n, final Void arg) { + public Integer visit(final ArrayAccessExpr n, final Void arg) { return (n.getIndex().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final ArrayCreationExpr n, final Void arg) { + public Integer visit(final ArrayCreationExpr n, final Void arg) { return (n.getElementType().accept(this, arg)) * 31 + (n.getInitializer().isPresent() ? n.getInitializer().get().accept(this, arg) : 0) * 31 + (n.getLevels().accept(this, arg)); } - public Integer visit(final ArrayCreationLevel n, final Void arg) { + public Integer visit(final ArrayCreationLevel n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getDimension().isPresent() ? n.getDimension().get().accept(this, arg) : 0); } - public Integer visit(final ArrayInitializerExpr n, final Void arg) { + public Integer visit(final ArrayInitializerExpr n, final Void arg) { return (n.getValues().accept(this, arg)); } - public Integer visit(final ArrayType n, final Void arg) { + public Integer visit(final ArrayType n, final Void arg) { return (n.getComponentType().accept(this, arg)) * 31 + (n.getOrigin().hashCode()) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final AssertStmt n, final Void arg) { + public Integer visit(final AssertStmt n, final Void arg) { return (n.getCheck().accept(this, arg)) * 31 + (n.getMessage().isPresent() ? n.getMessage().get().accept(this, arg) : 0); } - public Integer visit(final AssignExpr n, final Void arg) { + public Integer visit(final AssignExpr n, final Void arg) { return (n.getOperator().hashCode()) * 31 + (n.getTarget().accept(this, arg)) * 31 + (n.getValue().accept(this, arg)); } - public Integer visit(final BinaryExpr n, final Void arg) { + public Integer visit(final BinaryExpr n, final Void arg) { return (n.getLeft().accept(this, arg)) * 31 + (n.getOperator().hashCode()) * 31 + (n.getRight().accept(this, arg)); } - public Integer visit(final BlockComment n, final Void arg) { + public Integer visit(final BlockComment n, final Void arg) { return 0; } - public Integer visit(final BlockStmt n, final Void arg) { + public Integer visit(final BlockStmt n, final Void arg) { return (n.getContracts().accept(this, arg)) * 31 + (n.getStatements().accept(this, arg)); } - public Integer visit(final BooleanLiteralExpr n, final Void arg) { + public Integer visit(final BooleanLiteralExpr n, final Void arg) { return (n.isValue() ? 1 : 0); } - public Integer visit(final BreakStmt n, final Void arg) { + public Integer visit(final BreakStmt n, final Void arg) { return (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0); } - public Integer visit(final CastExpr n, final Void arg) { + public Integer visit(final CastExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getType().accept(this, arg)); } - public Integer visit(final CatchClause n, final Void arg) { + public Integer visit(final CatchClause n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getParameter().accept(this, arg)); } - public Integer visit(final CharLiteralExpr n, final Void arg) { + public Integer visit(final CharLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } - public Integer visit(final ClassExpr n, final Void arg) { + public Integer visit(final ClassExpr n, final Void arg) { return (n.getType().accept(this, arg)); } - public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { + public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { return (n.getExtendedTypes().accept(this, arg)) * 31 + (n.getImplementedTypes().accept(this, arg)) * 31 + (n.isInterface() ? 1 : 0) * 31 + (n.getPermittedTypes().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ClassOrInterfaceType n, final Void arg) { + public Integer visit(final ClassOrInterfaceType n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final CompilationUnit n, final Void arg) { + public Integer visit(final CompilationUnit n, final Void arg) { return (n.getImports().accept(this, arg)) * 31 + (n.getModule().isPresent() ? n.getModule().get().accept(this, arg) : 0) * 31 + (n.getPackageDeclaration().isPresent() ? n.getPackageDeclaration().get().accept(this, arg) : 0) * 31 + (n.getTypes().accept(this, arg)); } - public Integer visit(final ConditionalExpr n, final Void arg) { + public Integer visit(final ConditionalExpr n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getElseExpr().accept(this, arg)) * 31 + (n.getThenExpr().accept(this, arg)); } - public Integer visit(final ConstructorDeclaration n, final Void arg) { + public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ContinueStmt n, final Void arg) { + public Integer visit(final ContinueStmt n, final Void arg) { return (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0); } - public Integer visit(final DoStmt n, final Void arg) { + public Integer visit(final DoStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCondition().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)); } - public Integer visit(final DoubleLiteralExpr n, final Void arg) { + public Integer visit(final DoubleLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } - public Integer visit(final EmptyStmt n, final Void arg) { + public Integer visit(final EmptyStmt n, final Void arg) { return 0; } - public Integer visit(final EnclosedExpr n, final Void arg) { + public Integer visit(final EnclosedExpr n, final Void arg) { return (n.getInner().accept(this, arg)); } - public Integer visit(final EnumConstantDeclaration n, final Void arg) { + public Integer visit(final EnumConstantDeclaration n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getClassBody().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final EnumDeclaration n, final Void arg) { + public Integer visit(final EnumDeclaration n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getImplementedTypes().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { + public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getExpression().isPresent() ? n.getExpression().get().accept(this, arg) : 0) * 31 + (n.isThis() ? 1 : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0); } - public Integer visit(final ExpressionStmt n, final Void arg) { + public Integer visit(final ExpressionStmt n, final Void arg) { return (n.getExpression().accept(this, arg)); } - public Integer visit(final FieldAccessExpr n, final Void arg) { + public Integer visit(final FieldAccessExpr n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getScope().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0); } - public Integer visit(final FieldDeclaration n, final Void arg) { + public Integer visit(final FieldDeclaration n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ForStmt n, final Void arg) { + public Integer visit(final ForStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCompare().isPresent() ? n.getCompare().get().accept(this, arg) : 0) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getInitialization().accept(this, arg)) * 31 + (n.getUpdate().accept(this, arg)); } - public Integer visit(final ForEachStmt n, final Void arg) { + public Integer visit(final ForEachStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getIterable().accept(this, arg)) * 31 + (n.getVariable().accept(this, arg)); } - public Integer visit(final IfStmt n, final Void arg) { + public Integer visit(final IfStmt n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getElseStmt().isPresent() ? n.getElseStmt().get().accept(this, arg) : 0) * 31 + (n.getThenStmt().accept(this, arg)); } - public Integer visit(final ImportDeclaration n, final Void arg) { + public Integer visit(final ImportDeclaration n, final Void arg) { return (n.isAsterisk() ? 1 : 0) * 31 + (n.isJmlModel() ? 1 : 0) * 31 + (n.isStatic() ? 1 : 0) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final InitializerDeclaration n, final Void arg) { + public Integer visit(final InitializerDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.isStatic() ? 1 : 0) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final InstanceOfExpr n, final Void arg) { + public Integer visit(final InstanceOfExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getPattern().isPresent() ? n.getPattern().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)); } - public Integer visit(final IntegerLiteralExpr n, final Void arg) { + public Integer visit(final IntegerLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } - public Integer visit(final IntersectionType n, final Void arg) { + public Integer visit(final IntersectionType n, final Void arg) { return (n.getElements().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final JavadocComment n, final Void arg) { + public Integer visit(final JavadocComment n, final Void arg) { return 0; } - public Integer visit(final LabeledStmt n, final Void arg) { + public Integer visit(final LabeledStmt n, final Void arg) { return (n.getLabel().accept(this, arg)) * 31 + (n.getStatement().accept(this, arg)); } - public Integer visit(final LambdaExpr n, final Void arg) { + public Integer visit(final LambdaExpr n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.isEnclosingParameters() ? 1 : 0) * 31 + (n.getParameters().accept(this, arg)); } - public Integer visit(final LineComment n, final Void arg) { + public Integer visit(final LineComment n, final Void arg) { return 0; } - public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { + public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { return (n.getClassDeclaration().accept(this, arg)); } @Override - public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { + public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { return (n.getRecordDeclaration().accept(this, arg)); } - public Integer visit(final LongLiteralExpr n, final Void arg) { + public Integer visit(final LongLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } - public Integer visit(final MarkerAnnotationExpr n, final Void arg) { + public Integer visit(final MarkerAnnotationExpr n, final Void arg) { return (n.getName().accept(this, arg)); } - public Integer visit(final MemberValuePair n, final Void arg) { + public Integer visit(final MemberValuePair n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getValue().accept(this, arg)); } - public Integer visit(final MethodCallExpr n, final Void arg) { + public Integer visit(final MethodCallExpr n, final Void arg) { return (n.getArguments().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0); } - public Integer visit(final MethodDeclaration n, final Void arg) { + public Integer visit(final MethodDeclaration n, final Void arg) { return (n.getBody().isPresent() ? n.getBody().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final MethodReferenceExpr n, final Void arg) { + public Integer visit(final MethodReferenceExpr n, final Void arg) { return (n.getIdentifier().hashCode()) * 31 + (n.getScope().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0); } - public Integer visit(final NameExpr n, final Void arg) { + public Integer visit(final NameExpr n, final Void arg) { return (n.getName().accept(this, arg)); } - public Integer visit(final Name n, final Void arg) { + public Integer visit(final Name n, final Void arg) { return (n.getIdentifier().hashCode()) * 31 + (n.getQualifier().isPresent() ? n.getQualifier().get().accept(this, arg) : 0); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { int result = 0; for (Object node : n) { result += 31 * ((Visitable) node).accept(this, arg); @@ -276,363 +276,363 @@ public Integer visit(NodeList n, Void arg) { return result; } - public Integer visit(final NormalAnnotationExpr n, final Void arg) { + public Integer visit(final NormalAnnotationExpr n, final Void arg) { return (n.getPairs().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final NullLiteralExpr n, final Void arg) { + public Integer visit(final NullLiteralExpr n, final Void arg) { return 0; } - public Integer visit(final ObjectCreationExpr n, final Void arg) { + public Integer visit(final ObjectCreationExpr n, final Void arg) { return (n.getAnonymousClassBody().isPresent() ? n.getAnonymousClassBody().get().accept(this, arg) : 0) * 31 + (n.getArguments().accept(this, arg)) * 31 + (n.getScope().isPresent() ? n.getScope().get().accept(this, arg) : 0) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getTypeArguments().isPresent() ? n.getTypeArguments().get().accept(this, arg) : 0); } - public Integer visit(final PackageDeclaration n, final Void arg) { + public Integer visit(final PackageDeclaration n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final Parameter n, final Void arg) { + public Integer visit(final Parameter n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.isVarArgs() ? 1 : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)) * 31 + (n.getVarArgsAnnotations().accept(this, arg)); } - public Integer visit(final PrimitiveType n, final Void arg) { + public Integer visit(final PrimitiveType n, final Void arg) { return (n.getType().hashCode()) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ReturnStmt n, final Void arg) { + public Integer visit(final ReturnStmt n, final Void arg) { return (n.getExpression().isPresent() ? n.getExpression().get().accept(this, arg) : 0); } - public Integer visit(final SimpleName n, final Void arg) { + public Integer visit(final SimpleName n, final Void arg) { return (n.getIdentifier().hashCode()); } - public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { + public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { return (n.getMemberValue().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final StringLiteralExpr n, final Void arg) { + public Integer visit(final StringLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } - public Integer visit(final SuperExpr n, final Void arg) { + public Integer visit(final SuperExpr n, final Void arg) { return (n.getTypeName().isPresent() ? n.getTypeName().get().accept(this, arg) : 0); } - public Integer visit(final SwitchEntry n, final Void arg) { + public Integer visit(final SwitchEntry n, final Void arg) { return (n.getGuard().isPresent() ? n.getGuard().get().accept(this, arg) : 0) * 31 + (n.isDefault() ? 1 : 0) * 31 + (n.getLabels().accept(this, arg)) * 31 + (n.getStatements().accept(this, arg)) * 31 + (n.getType().hashCode()); } - public Integer visit(final SwitchStmt n, final Void arg) { + public Integer visit(final SwitchStmt n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getSelector().accept(this, arg)); } - public Integer visit(final SynchronizedStmt n, final Void arg) { + public Integer visit(final SynchronizedStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getExpression().accept(this, arg)); } - public Integer visit(final ThisExpr n, final Void arg) { + public Integer visit(final ThisExpr n, final Void arg) { return (n.getTypeName().isPresent() ? n.getTypeName().get().accept(this, arg) : 0); } - public Integer visit(final ThrowStmt n, final Void arg) { + public Integer visit(final ThrowStmt n, final Void arg) { return (n.getExpression().accept(this, arg)); } - public Integer visit(final TryStmt n, final Void arg) { + public Integer visit(final TryStmt n, final Void arg) { return (n.getCatchClauses().accept(this, arg)) * 31 + (n.getFinallyBlock().isPresent() ? n.getFinallyBlock().get().accept(this, arg) : 0) * 31 + (n.getResources().accept(this, arg)) * 31 + (n.getTryBlock().accept(this, arg)); } - public Integer visit(final TypeExpr n, final Void arg) { + public Integer visit(final TypeExpr n, final Void arg) { return (n.getType().accept(this, arg)); } - public Integer visit(final TypeParameter n, final Void arg) { + public Integer visit(final TypeParameter n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getTypeBound().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final UnaryExpr n, final Void arg) { + public Integer visit(final UnaryExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getOperator().hashCode()); } - public Integer visit(final UnionType n, final Void arg) { + public Integer visit(final UnionType n, final Void arg) { return (n.getElements().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final UnknownType n, final Void arg) { + public Integer visit(final UnknownType n, final Void arg) { return (n.getAnnotations().accept(this, arg)); } - public Integer visit(final VariableDeclarationExpr n, final Void arg) { + public Integer visit(final VariableDeclarationExpr n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)); } - public Integer visit(final VariableDeclarator n, final Void arg) { + public Integer visit(final VariableDeclarator n, final Void arg) { return (n.getInitializer().isPresent() ? n.getInitializer().get().accept(this, arg) : 0) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)); } - public Integer visit(final VoidType n, final Void arg) { + public Integer visit(final VoidType n, final Void arg) { return (n.getAnnotations().accept(this, arg)); } - public Integer visit(final WhileStmt n, final Void arg) { + public Integer visit(final WhileStmt n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getCondition().accept(this, arg)) * 31 + (n.getContracts().accept(this, arg)); } - public Integer visit(final WildcardType n, final Void arg) { + public Integer visit(final WildcardType n, final Void arg) { return (n.getExtendedType().isPresent() ? n.getExtendedType().get().accept(this, arg) : 0) * 31 + (n.getSuperType().isPresent() ? n.getSuperType().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final ModuleDeclaration n, final Void arg) { + public Integer visit(final ModuleDeclaration n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getDirectives().accept(this, arg)) * 31 + (n.isOpen() ? 1 : 0) * 31 + (n.getName().accept(this, arg)); } - public Integer visit(final ModuleRequiresDirective n, final Void arg) { + public Integer visit(final ModuleRequiresDirective n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } @Override() - public Integer visit(final ModuleExportsDirective n, final Void arg) { + public Integer visit(final ModuleExportsDirective n, final Void arg) { return (n.getModuleNames().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } @Override() - public Integer visit(final ModuleProvidesDirective n, final Void arg) { + public Integer visit(final ModuleProvidesDirective n, final Void arg) { return (n.getName().accept(this, arg)) * 31 + (n.getWith().accept(this, arg)); } @Override() - public Integer visit(final ModuleUsesDirective n, final Void arg) { + public Integer visit(final ModuleUsesDirective n, final Void arg) { return (n.getName().accept(this, arg)); } @Override - public Integer visit(final ModuleOpensDirective n, final Void arg) { + public Integer visit(final ModuleOpensDirective n, final Void arg) { return (n.getModuleNames().accept(this, arg)) * 31 + (n.getName().accept(this, arg)); } @Override - public Integer visit(final UnparsableStmt n, final Void arg) { + public Integer visit(final UnparsableStmt n, final Void arg) { return 0; } @Override - public Integer visit(final ReceiverParameter n, final Void arg) { + public Integer visit(final ReceiverParameter n, final Void arg) { return (n.getAnnotations().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)); } @Override - public Integer visit(final VarType n, final Void arg) { + public Integer visit(final VarType n, final Void arg) { return (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final Modifier n, final Void arg) { + public Integer visit(final Modifier n, final Void arg) { return (n.getKeyword().hashCode()); } @Override - public Integer visit(final SwitchExpr n, final Void arg) { + public Integer visit(final SwitchExpr n, final Void arg) { return (n.getEntries().accept(this, arg)) * 31 + (n.getSelector().accept(this, arg)); } @Override - public Integer visit(final YieldStmt n, final Void arg) { + public Integer visit(final YieldStmt n, final Void arg) { return (n.getExpression().accept(this, arg)); } @Override - public Integer visit(final TextBlockLiteralExpr n, final Void arg) { + public Integer visit(final TextBlockLiteralExpr n, final Void arg) { return (n.getValue().hashCode()); } @Override - public Integer visit(final TypePatternExpr n, final Void arg) { + public Integer visit(final TypePatternExpr n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getType().accept(this, arg)); } @Override - public Integer visit(final JmlQuantifiedExpr n, final Void arg) { + public Integer visit(final JmlQuantifiedExpr n, final Void arg) { return (n.getBinder().hashCode()) * 31 + (n.getExpressions().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)); } @Override - public Integer visit(final JmlClauseLabel n, final Void arg) { + public Integer visit(final JmlClauseLabel n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().isPresent() ? n.getLabel().get().accept(this, arg) : 0) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlExpressionStmt n, final Void arg) { + public Integer visit(final JmlExpressionStmt n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getKind().hashCode()); } @Override - public Integer visit(final JmlLabelExpr n, final Void arg) { + public Integer visit(final JmlLabelExpr n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getLabel().accept(this, arg)); } @Override - public Integer visit(final JmlLetExpr n, final Void arg) { + public Integer visit(final JmlLetExpr n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getVariables().accept(this, arg)); } @Override - public Integer visit(final JmlMultiCompareExpr n, final Void arg) { + public Integer visit(final JmlMultiCompareExpr n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getOperators().hashCode()); } @Override - public Integer visit(final JmlSimpleExprClause n, final Void arg) { + public Integer visit(final JmlSimpleExprClause n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getHeaps().isPresent() ? n.getHeaps().get().accept(this, arg) : 0) * 31 + (n.getKind().hashCode()) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSignalsClause n, final Void arg) { + public Integer visit(final JmlSignalsClause n, final Void arg) { return (n.getExpression().accept(this, arg)) * 31 + (n.getParameter().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { + public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { return (n.getTypes().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlUnreachableStmt n, final Void arg) { + public Integer visit(final JmlUnreachableStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)); } @Override - public Integer visit(final JmlCallableClause n, final Void arg) { + public Integer visit(final JmlCallableClause n, final Void arg) { return (n.getMethodSignatures().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlForallClause n, final Void arg) { + public Integer visit(final JmlForallClause n, final Void arg) { return (n.getBoundedVariables().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlRefiningStmt n, final Void arg) { + public Integer visit(final JmlRefiningStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)); } @Override - public Integer visit(final JmlClauseIf n, final Void arg) { + public Integer visit(final JmlClauseIf n, final Void arg) { return (n.getCondition().accept(this, arg)) * 31 + (n.getKind().hashCode()) * 31 + (n.getThen().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlClassExprDeclaration n, final Void arg) { + public Integer visit(final JmlClassExprDeclaration n, final Void arg) { return (n.getInvariant().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getKind().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { + public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getMeasuredBy().isPresent() ? n.getMeasuredBy().get().accept(this, arg) : 0) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getVariable().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { + public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { return (n.getExpr().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlContract n, final Void arg) { + public Integer visit(final JmlContract n, final Void arg) { return (n.getBehavior().hashCode()) * 31 + (n.getClauses().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0) * 31 + (n.getSubContracts().accept(this, arg)) * 31 + (n.getType().hashCode()); } @Override - public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { + public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { return (n.getBinding().accept(this, arg)) * 31 + (n.getPredicate().accept(this, arg)); } @Override - public Integer visit(final JmlGhostStmt n, final Void arg) { + public Integer visit(final JmlGhostStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getStatement().accept(this, arg)); } @Override - public Integer visit(final RecordDeclaration n, final Void arg) { + public Integer visit(final RecordDeclaration n, final Void arg) { return (n.getImplementedTypes().accept(this, arg)) * 31 + (n.getParameters().accept(this, arg)) * 31 + (n.getReceiverParameter().isPresent() ? n.getReceiverParameter().get().accept(this, arg) : 0) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } - public Integer visit(final CompactConstructorDeclaration n, final Void arg) { + public Integer visit(final CompactConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getThrownExceptions().accept(this, arg)) * 31 + (n.getTypeParameters().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final RecordPatternExpr n, final Void arg) { + public Integer visit(final RecordPatternExpr n, final Void arg) { return (n.getModifiers().accept(this, arg)) * 31 + (n.getPatternList().accept(this, arg)) * 31 + (n.getType().accept(this, arg)); } @Override - public Integer visit(final JmlMethodDeclaration n, final Void arg) { + public Integer visit(final JmlMethodDeclaration n, final Void arg) { return (n.getContract().isPresent() ? n.getContract().get().accept(this, arg) : 0) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getMethodDeclaration().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { + public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { return (n.getLeft().accept(this, arg)) * 31 + (n.getOperator().accept(this, arg)) * 31 + (n.getRight().accept(this, arg)); } @Override - public Integer visit(final JmlDocDeclaration n, final Void arg) { + public Integer visit(final JmlDocDeclaration n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlDocStmt n, final Void arg) { + public Integer visit(final JmlDocStmt n, final Void arg) { return (n.getJmlComments().accept(this, arg)); } @Override - public Integer visit(final JmlDoc n, final Void arg) { + public Integer visit(final JmlDoc n, final Void arg) { return (n.getContent().hashCode()); } @Override - public Integer visit(final JmlDocType n, final Void arg) { + public Integer visit(final JmlDocType n, final Void arg) { return (n.getJmlComments().accept(this, arg)) * 31 + (n.getMembers().accept(this, arg)) * 31 + (n.getModifiers().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlFieldDeclaration n, final Void arg) { + public Integer visit(final JmlFieldDeclaration n, final Void arg) { return (n.getDecl().accept(this, arg)) * 31 + (n.getJmlTags().accept(this, arg)) * 31 + (n.getAnnotations().accept(this, arg)); } @Override - public Integer visit(final JmlOldClause n, final Void arg) { + public Integer visit(final JmlOldClause n, final Void arg) { return (n.getDeclarations().accept(this, arg)) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlTypeExpr n, final Void arg) { + public Integer visit(final JmlTypeExpr n, final Void arg) { return (n.getType().accept(this, arg)); } @Override - public Integer visit(final JmlMultiExprClause n, final Void arg) { + public Integer visit(final JmlMultiExprClause n, final Void arg) { return (n.getExpressions().accept(this, arg)) * 31 + (n.getHeaps().isPresent() ? n.getHeaps().get().accept(this, arg) : 0) * 31 + (n.getKind().hashCode()) * 31 + (n.getName().isPresent() ? n.getName().get().accept(this, arg) : 0); } @Override - public Integer visit(final JmlBeginStmt n, final Void arg) { + public Integer visit(final JmlBeginStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)); } @Override - public Integer visit(final JmlEndStmt n, final Void arg) { + public Integer visit(final JmlEndStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)); } @Override - public Integer visit(final JmlLabelStmt n, final Void arg) { + public Integer visit(final JmlLabelStmt n, final Void arg) { return (n.getJmlTags().accept(this, arg)) * 31 + (n.getLabel().accept(this, arg)); } @Override - public Integer visit(final JmlMethodSignature n, final Void arg) { + public Integer visit(final JmlMethodSignature n, final Void arg) { return (n.getArgumentTypes().accept(this, arg)) * 31 + (n.getName().accept(this, arg)) * 31 + (n.getReceiver().isPresent() ? n.getReceiver().get().accept(this, arg) : 0); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NodeFinderVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NodeFinderVisitor.java index 750720f67e..6d56dbfa56 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NodeFinderVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/NodeFinderVisitor.java @@ -101,7 +101,7 @@ * A visitor who applies a function (based on a range) on each node of the AST and retains the node selected by the function. * An example usage might be to find the node that encompasses a range (the covering node). */ -public class NodeFinderVisitor extends VoidVisitorAdapter { +public class NodeFinderVisitor extends VoidVisitorAdapter { public static BiFunction fConveringNode = (Node n, Range range) -> { return n.hasRange() && n.getRange().get().contains(range); @@ -115,7 +115,7 @@ public class NodeFinderVisitor extends VoidVisitorAdapter { */ private static BiFunction fn; - public NodeFinderVisitor(BiFunction fn) { + public NodeFinderVisitor(BiFunction fn) { this.fn = fn; } @@ -126,12 +126,12 @@ public NodeFinderVisitor(BiFunction fn) { * * @return Node */ - public Node getSelectedNode() { + public Node getSelectedNode() { return selectedNode; } @Override - public void visit(final AnnotationDeclaration n, final Range arg) { + public void visit(final AnnotationDeclaration n, final Range arg) { { n.getMembers().accept(this, arg); if (selectedNode != null) @@ -164,7 +164,7 @@ public void visit(final AnnotationDeclaration n, final Range arg) { } @Override - public void visit(final AnnotationMemberDeclaration n, final Range arg) { + public void visit(final AnnotationMemberDeclaration n, final Range arg) { if (n.getDefaultValue().isPresent()) { n.getDefaultValue().get().accept(this, arg); if (selectedNode != null) @@ -202,7 +202,7 @@ public void visit(final AnnotationMemberDeclaration n, final Range arg) { } @Override - public void visit(final ArrayAccessExpr n, final Range arg) { + public void visit(final ArrayAccessExpr n, final Range arg) { { n.getIndex().accept(this, arg); if (selectedNode != null) @@ -225,7 +225,7 @@ public void visit(final ArrayAccessExpr n, final Range arg) { } @Override - public void visit(final ArrayCreationExpr n, final Range arg) { + public void visit(final ArrayCreationExpr n, final Range arg) { { n.getElementType().accept(this, arg); if (selectedNode != null) @@ -253,7 +253,7 @@ public void visit(final ArrayCreationExpr n, final Range arg) { } @Override - public void visit(final ArrayInitializerExpr n, final Range arg) { + public void visit(final ArrayInitializerExpr n, final Range arg) { { n.getValues().accept(this, arg); if (selectedNode != null) @@ -271,7 +271,7 @@ public void visit(final ArrayInitializerExpr n, final Range arg) { } @Override - public void visit(final AssertStmt n, final Range arg) { + public void visit(final AssertStmt n, final Range arg) { { n.getCheck().accept(this, arg); if (selectedNode != null) @@ -294,7 +294,7 @@ public void visit(final AssertStmt n, final Range arg) { } @Override - public void visit(final AssignExpr n, final Range arg) { + public void visit(final AssignExpr n, final Range arg) { { n.getTarget().accept(this, arg); if (selectedNode != null) @@ -317,7 +317,7 @@ public void visit(final AssignExpr n, final Range arg) { } @Override - public void visit(final BinaryExpr n, final Range arg) { + public void visit(final BinaryExpr n, final Range arg) { { n.getLeft().accept(this, arg); if (selectedNode != null) @@ -340,7 +340,7 @@ public void visit(final BinaryExpr n, final Range arg) { } @Override - public void visit(final BlockStmt n, final Range arg) { + public void visit(final BlockStmt n, final Range arg) { { n.getStatements().accept(this, arg); if (selectedNode != null) @@ -358,7 +358,7 @@ public void visit(final BlockStmt n, final Range arg) { } @Override - public void visit(final BooleanLiteralExpr n, final Range arg) { + public void visit(final BooleanLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -371,7 +371,7 @@ public void visit(final BooleanLiteralExpr n, final Range arg) { } @Override - public void visit(final BreakStmt n, final Range arg) { + public void visit(final BreakStmt n, final Range arg) { if (n.getLabel().isPresent()) { n.getLabel().get().accept(this, arg); if (selectedNode != null) @@ -389,7 +389,7 @@ public void visit(final BreakStmt n, final Range arg) { } @Override - public void visit(final CastExpr n, final Range arg) { + public void visit(final CastExpr n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -412,7 +412,7 @@ public void visit(final CastExpr n, final Range arg) { } @Override - public void visit(final CatchClause n, final Range arg) { + public void visit(final CatchClause n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -435,7 +435,7 @@ public void visit(final CatchClause n, final Range arg) { } @Override - public void visit(final CharLiteralExpr n, final Range arg) { + public void visit(final CharLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -445,7 +445,7 @@ public void visit(final CharLiteralExpr n, final Range arg) { } @Override - public void visit(final ClassExpr n, final Range arg) { + public void visit(final ClassExpr n, final Range arg) { { n.getType().accept(this, arg); if (selectedNode != null) @@ -463,7 +463,7 @@ public void visit(final ClassExpr n, final Range arg) { } @Override - public void visit(final ClassOrInterfaceDeclaration n, final Range arg) { + public void visit(final ClassOrInterfaceDeclaration n, final Range arg) { { n.getExtendedTypes().accept(this, arg); if (selectedNode != null) @@ -516,7 +516,7 @@ public void visit(final ClassOrInterfaceDeclaration n, final Range arg) { } @Override - public void visit(final ClassOrInterfaceType n, final Range arg) { + public void visit(final ClassOrInterfaceType n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -549,7 +549,7 @@ public void visit(final ClassOrInterfaceType n, final Range arg) { } @Override - public void visit(final CompilationUnit n, final Range arg) { + public void visit(final CompilationUnit n, final Range arg) { { n.getImports().accept(this, arg); if (selectedNode != null) @@ -582,7 +582,7 @@ public void visit(final CompilationUnit n, final Range arg) { } @Override - public void visit(final ConditionalExpr n, final Range arg) { + public void visit(final ConditionalExpr n, final Range arg) { { n.getCondition().accept(this, arg); if (selectedNode != null) @@ -610,7 +610,7 @@ public void visit(final ConditionalExpr n, final Range arg) { } @Override - public void visit(final ConstructorDeclaration n, final Range arg) { + public void visit(final ConstructorDeclaration n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -663,7 +663,7 @@ public void visit(final ConstructorDeclaration n, final Range arg) { } @Override - public void visit(final ContinueStmt n, final Range arg) { + public void visit(final ContinueStmt n, final Range arg) { if (n.getLabel().isPresent()) { n.getLabel().get().accept(this, arg); if (selectedNode != null) @@ -681,7 +681,7 @@ public void visit(final ContinueStmt n, final Range arg) { } @Override - public void visit(final DoStmt n, final Range arg) { + public void visit(final DoStmt n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -704,7 +704,7 @@ public void visit(final DoStmt n, final Range arg) { } @Override - public void visit(final DoubleLiteralExpr n, final Range arg) { + public void visit(final DoubleLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -717,7 +717,7 @@ public void visit(final DoubleLiteralExpr n, final Range arg) { } @Override - public void visit(final EmptyStmt n, final Range arg) { + public void visit(final EmptyStmt n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -730,7 +730,7 @@ public void visit(final EmptyStmt n, final Range arg) { } @Override - public void visit(final EnclosedExpr n, final Range arg) { + public void visit(final EnclosedExpr n, final Range arg) { { n.getInner().accept(this, arg); if (selectedNode != null) @@ -748,7 +748,7 @@ public void visit(final EnclosedExpr n, final Range arg) { } @Override - public void visit(final EnumConstantDeclaration n, final Range arg) { + public void visit(final EnumConstantDeclaration n, final Range arg) { { n.getArguments().accept(this, arg); if (selectedNode != null) @@ -781,7 +781,7 @@ public void visit(final EnumConstantDeclaration n, final Range arg) { } @Override - public void visit(final EnumDeclaration n, final Range arg) { + public void visit(final EnumDeclaration n, final Range arg) { { n.getEntries().accept(this, arg); if (selectedNode != null) @@ -824,7 +824,7 @@ public void visit(final EnumDeclaration n, final Range arg) { } @Override - public void visit(final ExplicitConstructorInvocationStmt n, final Range arg) { + public void visit(final ExplicitConstructorInvocationStmt n, final Range arg) { { n.getArguments().accept(this, arg); if (selectedNode != null) @@ -852,7 +852,7 @@ public void visit(final ExplicitConstructorInvocationStmt n, final Range arg) { } @Override - public void visit(final ExpressionStmt n, final Range arg) { + public void visit(final ExpressionStmt n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -870,7 +870,7 @@ public void visit(final ExpressionStmt n, final Range arg) { } @Override - public void visit(final FieldAccessExpr n, final Range arg) { + public void visit(final FieldAccessExpr n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -898,7 +898,7 @@ public void visit(final FieldAccessExpr n, final Range arg) { } @Override - public void visit(final FieldDeclaration n, final Range arg) { + public void visit(final FieldDeclaration n, final Range arg) { { n.getModifiers().accept(this, arg); if (selectedNode != null) @@ -926,7 +926,7 @@ public void visit(final FieldDeclaration n, final Range arg) { } @Override - public void visit(final ForEachStmt n, final Range arg) { + public void visit(final ForEachStmt n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -954,7 +954,7 @@ public void visit(final ForEachStmt n, final Range arg) { } @Override - public void visit(final ForStmt n, final Range arg) { + public void visit(final ForStmt n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -987,7 +987,7 @@ public void visit(final ForStmt n, final Range arg) { } @Override - public void visit(final IfStmt n, final Range arg) { + public void visit(final IfStmt n, final Range arg) { { n.getCondition().accept(this, arg); if (selectedNode != null) @@ -1015,7 +1015,7 @@ public void visit(final IfStmt n, final Range arg) { } @Override - public void visit(final InitializerDeclaration n, final Range arg) { + public void visit(final InitializerDeclaration n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -1038,7 +1038,7 @@ public void visit(final InitializerDeclaration n, final Range arg) { } @Override - public void visit(final InstanceOfExpr n, final Range arg) { + public void visit(final InstanceOfExpr n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -1066,7 +1066,7 @@ public void visit(final InstanceOfExpr n, final Range arg) { } @Override - public void visit(final IntegerLiteralExpr n, final Range arg) { + public void visit(final IntegerLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1076,7 +1076,7 @@ public void visit(final IntegerLiteralExpr n, final Range arg) { } @Override - public void visit(final JavadocComment n, final Range arg) { + public void visit(final JavadocComment n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1089,7 +1089,7 @@ public void visit(final JavadocComment n, final Range arg) { } @Override - public void visit(final LabeledStmt n, final Range arg) { + public void visit(final LabeledStmt n, final Range arg) { { n.getLabel().accept(this, arg); if (selectedNode != null) @@ -1112,7 +1112,7 @@ public void visit(final LabeledStmt n, final Range arg) { } @Override - public void visit(final LongLiteralExpr n, final Range arg) { + public void visit(final LongLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1125,7 +1125,7 @@ public void visit(final LongLiteralExpr n, final Range arg) { } @Override - public void visit(final MarkerAnnotationExpr n, final Range arg) { + public void visit(final MarkerAnnotationExpr n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -1143,7 +1143,7 @@ public void visit(final MarkerAnnotationExpr n, final Range arg) { } @Override - public void visit(final MemberValuePair n, final Range arg) { + public void visit(final MemberValuePair n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -1166,7 +1166,7 @@ public void visit(final MemberValuePair n, final Range arg) { } @Override - public void visit(final MethodCallExpr n, final Range arg) { + public void visit(final MethodCallExpr n, final Range arg) { { n.getArguments().accept(this, arg); if (selectedNode != null) @@ -1199,7 +1199,7 @@ public void visit(final MethodCallExpr n, final Range arg) { } @Override - public void visit(final MethodDeclaration n, final Range arg) { + public void visit(final MethodDeclaration n, final Range arg) { if (n.getBody().isPresent()) { n.getBody().get().accept(this, arg); if (selectedNode != null) @@ -1257,7 +1257,7 @@ public void visit(final MethodDeclaration n, final Range arg) { } @Override - public void visit(final NameExpr n, final Range arg) { + public void visit(final NameExpr n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -1275,7 +1275,7 @@ public void visit(final NameExpr n, final Range arg) { } @Override - public void visit(final NormalAnnotationExpr n, final Range arg) { + public void visit(final NormalAnnotationExpr n, final Range arg) { { n.getPairs().accept(this, arg); if (selectedNode != null) @@ -1298,7 +1298,7 @@ public void visit(final NormalAnnotationExpr n, final Range arg) { } @Override - public void visit(final NullLiteralExpr n, final Range arg) { + public void visit(final NullLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1311,7 +1311,7 @@ public void visit(final NullLiteralExpr n, final Range arg) { } @Override - public void visit(final ObjectCreationExpr n, final Range arg) { + public void visit(final ObjectCreationExpr n, final Range arg) { if (n.getAnonymousClassBody().isPresent()) { n.getAnonymousClassBody().get().accept(this, arg); if (selectedNode != null) @@ -1349,7 +1349,7 @@ public void visit(final ObjectCreationExpr n, final Range arg) { } @Override - public void visit(final PackageDeclaration n, final Range arg) { + public void visit(final PackageDeclaration n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1372,7 +1372,7 @@ public void visit(final PackageDeclaration n, final Range arg) { } @Override - public void visit(final Parameter n, final Range arg) { + public void visit(final Parameter n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1410,7 +1410,7 @@ public void visit(final Parameter n, final Range arg) { } @Override - public void visit(final PrimitiveType n, final Range arg) { + public void visit(final PrimitiveType n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1428,7 +1428,7 @@ public void visit(final PrimitiveType n, final Range arg) { } @Override - public void visit(final Name n, final Range arg) { + public void visit(final Name n, final Range arg) { if (n.getQualifier().isPresent()) { n.getQualifier().get().accept(this, arg); if (selectedNode != null) @@ -1446,7 +1446,7 @@ public void visit(final Name n, final Range arg) { } @Override - public void visit(final SimpleName n, final Range arg) { + public void visit(final SimpleName n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1459,7 +1459,7 @@ public void visit(final SimpleName n, final Range arg) { } @Override - public void visit(final ArrayType n, final Range arg) { + public void visit(final ArrayType n, final Range arg) { { n.getComponentType().accept(this, arg); if (selectedNode != null) @@ -1482,7 +1482,7 @@ public void visit(final ArrayType n, final Range arg) { } @Override - public void visit(final ArrayCreationLevel n, final Range arg) { + public void visit(final ArrayCreationLevel n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1505,7 +1505,7 @@ public void visit(final ArrayCreationLevel n, final Range arg) { } @Override - public void visit(final IntersectionType n, final Range arg) { + public void visit(final IntersectionType n, final Range arg) { { n.getElements().accept(this, arg); if (selectedNode != null) @@ -1528,7 +1528,7 @@ public void visit(final IntersectionType n, final Range arg) { } @Override - public void visit(final UnionType n, final Range arg) { + public void visit(final UnionType n, final Range arg) { { n.getElements().accept(this, arg); if (selectedNode != null) @@ -1551,7 +1551,7 @@ public void visit(final UnionType n, final Range arg) { } @Override - public void visit(final ReturnStmt n, final Range arg) { + public void visit(final ReturnStmt n, final Range arg) { if (n.getExpression().isPresent()) { n.getExpression().get().accept(this, arg); if (selectedNode != null) @@ -1569,7 +1569,7 @@ public void visit(final ReturnStmt n, final Range arg) { } @Override - public void visit(final SingleMemberAnnotationExpr n, final Range arg) { + public void visit(final SingleMemberAnnotationExpr n, final Range arg) { { n.getMemberValue().accept(this, arg); if (selectedNode != null) @@ -1592,7 +1592,7 @@ public void visit(final SingleMemberAnnotationExpr n, final Range arg) { } @Override - public void visit(final StringLiteralExpr n, final Range arg) { + public void visit(final StringLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -1605,7 +1605,7 @@ public void visit(final StringLiteralExpr n, final Range arg) { } @Override - public void visit(final SuperExpr n, final Range arg) { + public void visit(final SuperExpr n, final Range arg) { if (n.getTypeName().isPresent()) { n.getTypeName().get().accept(this, arg); if (selectedNode != null) @@ -1623,7 +1623,7 @@ public void visit(final SuperExpr n, final Range arg) { } @Override - public void visit(final SwitchEntry n, final Range arg) { + public void visit(final SwitchEntry n, final Range arg) { { n.getLabels().accept(this, arg); if (selectedNode != null) @@ -1651,7 +1651,7 @@ public void visit(final SwitchEntry n, final Range arg) { } @Override - public void visit(final SwitchStmt n, final Range arg) { + public void visit(final SwitchStmt n, final Range arg) { { n.getEntries().accept(this, arg); if (selectedNode != null) @@ -1674,7 +1674,7 @@ public void visit(final SwitchStmt n, final Range arg) { } @Override - public void visit(final SynchronizedStmt n, final Range arg) { + public void visit(final SynchronizedStmt n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -1697,7 +1697,7 @@ public void visit(final SynchronizedStmt n, final Range arg) { } @Override - public void visit(final ThisExpr n, final Range arg) { + public void visit(final ThisExpr n, final Range arg) { if (n.getTypeName().isPresent()) { n.getTypeName().get().accept(this, arg); if (selectedNode != null) @@ -1715,7 +1715,7 @@ public void visit(final ThisExpr n, final Range arg) { } @Override - public void visit(final ThrowStmt n, final Range arg) { + public void visit(final ThrowStmt n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -1733,7 +1733,7 @@ public void visit(final ThrowStmt n, final Range arg) { } @Override - public void visit(final TryStmt n, final Range arg) { + public void visit(final TryStmt n, final Range arg) { { n.getCatchClauses().accept(this, arg); if (selectedNode != null) @@ -1766,7 +1766,7 @@ public void visit(final TryStmt n, final Range arg) { } @Override - public void visit(final LocalClassDeclarationStmt n, final Range arg) { + public void visit(final LocalClassDeclarationStmt n, final Range arg) { { n.getClassDeclaration().accept(this, arg); if (selectedNode != null) @@ -1784,7 +1784,7 @@ public void visit(final LocalClassDeclarationStmt n, final Range arg) { } @Override - public void visit(final LocalRecordDeclarationStmt n, final Range arg) { + public void visit(final LocalRecordDeclarationStmt n, final Range arg) { { n.getRecordDeclaration().accept(this, arg); if (selectedNode != null) @@ -1802,7 +1802,7 @@ public void visit(final LocalRecordDeclarationStmt n, final Range arg) { } @Override - public void visit(final TypeParameter n, final Range arg) { + public void visit(final TypeParameter n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -1830,7 +1830,7 @@ public void visit(final TypeParameter n, final Range arg) { } @Override - public void visit(final UnaryExpr n, final Range arg) { + public void visit(final UnaryExpr n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -1848,7 +1848,7 @@ public void visit(final UnaryExpr n, final Range arg) { } @Override - public void visit(final UnknownType n, final Range arg) { + public void visit(final UnknownType n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1866,7 +1866,7 @@ public void visit(final UnknownType n, final Range arg) { } @Override - public void visit(final VariableDeclarationExpr n, final Range arg) { + public void visit(final VariableDeclarationExpr n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1894,7 +1894,7 @@ public void visit(final VariableDeclarationExpr n, final Range arg) { } @Override - public void visit(final VariableDeclarator n, final Range arg) { + public void visit(final VariableDeclarator n, final Range arg) { if (n.getInitializer().isPresent()) { n.getInitializer().get().accept(this, arg); if (selectedNode != null) @@ -1922,7 +1922,7 @@ public void visit(final VariableDeclarator n, final Range arg) { } @Override - public void visit(final VoidType n, final Range arg) { + public void visit(final VoidType n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -1940,7 +1940,7 @@ public void visit(final VoidType n, final Range arg) { } @Override - public void visit(final WhileStmt n, final Range arg) { + public void visit(final WhileStmt n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -1963,7 +1963,7 @@ public void visit(final WhileStmt n, final Range arg) { } @Override - public void visit(final WildcardType n, final Range arg) { + public void visit(final WildcardType n, final Range arg) { if (n.getExtendedType().isPresent()) { n.getExtendedType().get().accept(this, arg); if (selectedNode != null) @@ -1991,7 +1991,7 @@ public void visit(final WildcardType n, final Range arg) { } @Override - public void visit(final LambdaExpr n, final Range arg) { + public void visit(final LambdaExpr n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) @@ -2014,7 +2014,7 @@ public void visit(final LambdaExpr n, final Range arg) { } @Override - public void visit(final MethodReferenceExpr n, final Range arg) { + public void visit(final MethodReferenceExpr n, final Range arg) { { n.getScope().accept(this, arg); if (selectedNode != null) @@ -2037,7 +2037,7 @@ public void visit(final MethodReferenceExpr n, final Range arg) { } @Override - public void visit(final TypeExpr n, final Range arg) { + public void visit(final TypeExpr n, final Range arg) { { n.getType().accept(this, arg); if (selectedNode != null) @@ -2055,7 +2055,7 @@ public void visit(final TypeExpr n, final Range arg) { } @Override - public void visit(final ImportDeclaration n, final Range arg) { + public void visit(final ImportDeclaration n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -2073,7 +2073,7 @@ public void visit(final ImportDeclaration n, final Range arg) { } @Override - public void visit(final BlockComment n, final Range arg) { + public void visit(final BlockComment n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -2086,7 +2086,7 @@ public void visit(final BlockComment n, final Range arg) { } @Override - public void visit(final LineComment n, final Range arg) { + public void visit(final LineComment n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -2099,7 +2099,7 @@ public void visit(final LineComment n, final Range arg) { } @Override - public void visit(NodeList n, final Range arg) { + public void visit(NodeList n, final Range arg) { for (final Object v : n) { ((Node) v).accept(this, arg); } @@ -2107,7 +2107,7 @@ public void visit(NodeList n, final Range arg) { } @Override - public void visit(final ModuleDeclaration n, final Range arg) { + public void visit(final ModuleDeclaration n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -2135,7 +2135,7 @@ public void visit(final ModuleDeclaration n, final Range arg) { } @Override - public void visit(final ModuleRequiresDirective n, final Range arg) { + public void visit(final ModuleRequiresDirective n, final Range arg) { { n.getModifiers().accept(this, arg); if (selectedNode != null) @@ -2158,7 +2158,7 @@ public void visit(final ModuleRequiresDirective n, final Range arg) { } @Override() - public void visit(final ModuleExportsDirective n, final Range arg) { + public void visit(final ModuleExportsDirective n, final Range arg) { { n.getModuleNames().accept(this, arg); if (selectedNode != null) @@ -2181,7 +2181,7 @@ public void visit(final ModuleExportsDirective n, final Range arg) { } @Override() - public void visit(final ModuleProvidesDirective n, final Range arg) { + public void visit(final ModuleProvidesDirective n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -2204,7 +2204,7 @@ public void visit(final ModuleProvidesDirective n, final Range arg) { } @Override() - public void visit(final ModuleUsesDirective n, final Range arg) { + public void visit(final ModuleUsesDirective n, final Range arg) { { n.getName().accept(this, arg); if (selectedNode != null) @@ -2222,7 +2222,7 @@ public void visit(final ModuleUsesDirective n, final Range arg) { } @Override - public void visit(final ModuleOpensDirective n, final Range arg) { + public void visit(final ModuleOpensDirective n, final Range arg) { { n.getModuleNames().accept(this, arg); if (selectedNode != null) @@ -2245,7 +2245,7 @@ public void visit(final ModuleOpensDirective n, final Range arg) { } @Override - public void visit(final UnparsableStmt n, final Range arg) { + public void visit(final UnparsableStmt n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -2258,7 +2258,7 @@ public void visit(final UnparsableStmt n, final Range arg) { } @Override - public void visit(final ReceiverParameter n, final Range arg) { + public void visit(final ReceiverParameter n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -2286,7 +2286,7 @@ public void visit(final ReceiverParameter n, final Range arg) { } @Override - public void visit(final VarType n, final Range arg) { + public void visit(final VarType n, final Range arg) { { n.getAnnotations().accept(this, arg); if (selectedNode != null) @@ -2304,7 +2304,7 @@ public void visit(final VarType n, final Range arg) { } @Override - public void visit(final Modifier n, final Range arg) { + public void visit(final Modifier n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -2317,7 +2317,7 @@ public void visit(final Modifier n, final Range arg) { } @Override - public void visit(final SwitchExpr n, final Range arg) { + public void visit(final SwitchExpr n, final Range arg) { { n.getEntries().accept(this, arg); if (selectedNode != null) @@ -2340,7 +2340,7 @@ public void visit(final SwitchExpr n, final Range arg) { } @Override - public void visit(final YieldStmt n, final Range arg) { + public void visit(final YieldStmt n, final Range arg) { { n.getExpression().accept(this, arg); if (selectedNode != null) @@ -2358,7 +2358,7 @@ public void visit(final YieldStmt n, final Range arg) { } @Override - public void visit(final TextBlockLiteralExpr n, final Range arg) { + public void visit(final TextBlockLiteralExpr n, final Range arg) { if (n.getComment().isPresent()) { n.getComment().get().accept(this, arg); if (selectedNode != null) @@ -2371,7 +2371,7 @@ public void visit(final TextBlockLiteralExpr n, final Range arg) { } @Override - public void visit(final TypePatternExpr n, final Range arg) { + public void visit(final TypePatternExpr n, final Range arg) { { n.getModifiers().accept(this, arg); if (selectedNode != null) @@ -2399,7 +2399,7 @@ public void visit(final TypePatternExpr n, final Range arg) { } @Override - public void visit(final RecordDeclaration n, final Range arg) { + public void visit(final RecordDeclaration n, final Range arg) { { n.getImplementedTypes().accept(this, arg); if (selectedNode != null) @@ -2452,7 +2452,7 @@ public void visit(final RecordDeclaration n, final Range arg) { } @Override - public void visit(final CompactConstructorDeclaration n, final Range arg) { + public void visit(final CompactConstructorDeclaration n, final Range arg) { { n.getBody().accept(this, arg); if (selectedNode != null) diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java index 58dfef72a7..cde8dbf7e3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityEqualsVisitor.java @@ -40,7 +40,7 @@ * * @author Julio Vilmar Gesser */ -public class ObjectIdentityEqualsVisitor implements GenericVisitor { +public class ObjectIdentityEqualsVisitor implements GenericVisitor { private static final ObjectIdentityEqualsVisitor SINGLETON = new ObjectIdentityEqualsVisitor(); @@ -49,677 +49,677 @@ public static boolean equals(final Node n, final Node n2) { } @Override - public Boolean visit(final CompilationUnit n, final Visitable arg) { + public Boolean visit(final CompilationUnit n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final PackageDeclaration n, final Visitable arg) { + public Boolean visit(final PackageDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final TypeParameter n, final Visitable arg) { + public Boolean visit(final TypeParameter n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LineComment n, final Visitable arg) { + public Boolean visit(final LineComment n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final BlockComment n, final Visitable arg) { + public Boolean visit(final BlockComment n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final EnumDeclaration n, final Visitable arg) { + public Boolean visit(final EnumDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { + public Boolean visit(final EnumConstantDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { + public Boolean visit(final AnnotationMemberDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final FieldDeclaration n, final Visitable arg) { + public Boolean visit(final FieldDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final VariableDeclarator n, final Visitable arg) { + public Boolean visit(final VariableDeclarator n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final ConstructorDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final MethodDeclaration n, final Visitable arg) { + public Boolean visit(final MethodDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final Parameter n, final Visitable arg) { + public Boolean visit(final Parameter n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final InitializerDeclaration n, final Visitable arg) { + public Boolean visit(final InitializerDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JavadocComment n, final Visitable arg) { + public Boolean visit(final JavadocComment n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { + public Boolean visit(final ClassOrInterfaceType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final PrimitiveType n, final Visitable arg) { + public Boolean visit(final PrimitiveType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ArrayType n, final Visitable arg) { + public Boolean visit(final ArrayType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { + public Boolean visit(final ArrayCreationLevel n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final IntersectionType n, final Visitable arg) { + public Boolean visit(final IntersectionType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final UnionType n, final Visitable arg) { + public Boolean visit(final UnionType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final VoidType n, final Visitable arg) { + public Boolean visit(final VoidType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final WildcardType n, final Visitable arg) { + public Boolean visit(final WildcardType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final UnknownType n, final Visitable arg) { + public Boolean visit(final UnknownType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { + public Boolean visit(final ArrayAccessExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { + public Boolean visit(final ArrayCreationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { + public Boolean visit(final ArrayInitializerExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final AssignExpr n, final Visitable arg) { + public Boolean visit(final AssignExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final BinaryExpr n, final Visitable arg) { + public Boolean visit(final BinaryExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final CastExpr n, final Visitable arg) { + public Boolean visit(final CastExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ClassExpr n, final Visitable arg) { + public Boolean visit(final ClassExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ConditionalExpr n, final Visitable arg) { + public Boolean visit(final ConditionalExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final EnclosedExpr n, final Visitable arg) { + public Boolean visit(final EnclosedExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final FieldAccessExpr n, final Visitable arg) { + public Boolean visit(final FieldAccessExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final InstanceOfExpr n, final Visitable arg) { + public Boolean visit(final InstanceOfExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final StringLiteralExpr n, final Visitable arg) { + public Boolean visit(final StringLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { + public Boolean visit(final IntegerLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LongLiteralExpr n, final Visitable arg) { + public Boolean visit(final LongLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final CharLiteralExpr n, final Visitable arg) { + public Boolean visit(final CharLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { + public Boolean visit(final DoubleLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { + public Boolean visit(final BooleanLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final NullLiteralExpr n, final Visitable arg) { + public Boolean visit(final NullLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final MethodCallExpr n, final Visitable arg) { + public Boolean visit(final MethodCallExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final NameExpr n, final Visitable arg) { + public Boolean visit(final NameExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { + public Boolean visit(final ObjectCreationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final Name n, final Visitable arg) { + public Boolean visit(final Name n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SimpleName n, final Visitable arg) { + public Boolean visit(final SimpleName n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ThisExpr n, final Visitable arg) { + public Boolean visit(final ThisExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SuperExpr n, final Visitable arg) { + public Boolean visit(final SuperExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final UnaryExpr n, final Visitable arg) { + public Boolean visit(final UnaryExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { + public Boolean visit(final VariableDeclarationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { + public Boolean visit(final MarkerAnnotationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { + public Boolean visit(final SingleMemberAnnotationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { + public Boolean visit(final NormalAnnotationExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final MemberValuePair n, final Visitable arg) { + public Boolean visit(final MemberValuePair n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { + public Boolean visit(final ExplicitConstructorInvocationStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalClassDeclarationStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { + public Boolean visit(final LocalRecordDeclarationStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final AssertStmt n, final Visitable arg) { + public Boolean visit(final AssertStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final BlockStmt n, final Visitable arg) { + public Boolean visit(final BlockStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LabeledStmt n, final Visitable arg) { + public Boolean visit(final LabeledStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final EmptyStmt n, final Visitable arg) { + public Boolean visit(final EmptyStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ExpressionStmt n, final Visitable arg) { + public Boolean visit(final ExpressionStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SwitchStmt n, final Visitable arg) { + public Boolean visit(final SwitchStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SwitchEntry n, final Visitable arg) { + public Boolean visit(final SwitchEntry n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final BreakStmt n, final Visitable arg) { + public Boolean visit(final BreakStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ReturnStmt n, final Visitable arg) { + public Boolean visit(final ReturnStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final IfStmt n, final Visitable arg) { + public Boolean visit(final IfStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final WhileStmt n, final Visitable arg) { + public Boolean visit(final WhileStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ContinueStmt n, final Visitable arg) { + public Boolean visit(final ContinueStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final DoStmt n, final Visitable arg) { + public Boolean visit(final DoStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ForEachStmt n, final Visitable arg) { + public Boolean visit(final ForEachStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ForStmt n, final Visitable arg) { + public Boolean visit(final ForStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ThrowStmt n, final Visitable arg) { + public Boolean visit(final ThrowStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SynchronizedStmt n, final Visitable arg) { + public Boolean visit(final SynchronizedStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final TryStmt n, final Visitable arg) { + public Boolean visit(final TryStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final CatchClause n, final Visitable arg) { + public Boolean visit(final CatchClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final LambdaExpr n, final Visitable arg) { + public Boolean visit(final LambdaExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { + public Boolean visit(final MethodReferenceExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final TypeExpr n, final Visitable arg) { + public Boolean visit(final TypeExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ImportDeclaration n, final Visitable arg) { + public Boolean visit(final ImportDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(NodeList n, Visitable arg) { + public Boolean visit(NodeList n, Visitable arg) { return n == arg; } @Override - public Boolean visit(final ModuleDeclaration n, final Visitable arg) { + public Boolean visit(final ModuleDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { + public Boolean visit(final ModuleRequiresDirective n, final Visitable arg) { return n == arg; } @Override() - public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { + public Boolean visit(final ModuleExportsDirective n, final Visitable arg) { return n == arg; } @Override() - public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { + public Boolean visit(final ModuleProvidesDirective n, final Visitable arg) { return n == arg; } @Override() - public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { + public Boolean visit(final ModuleUsesDirective n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { + public Boolean visit(final ModuleOpensDirective n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final UnparsableStmt n, final Visitable arg) { + public Boolean visit(final UnparsableStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final ReceiverParameter n, final Visitable arg) { + public Boolean visit(final ReceiverParameter n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final VarType n, final Visitable arg) { + public Boolean visit(final VarType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final Modifier n, final Visitable arg) { + public Boolean visit(final Modifier n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final SwitchExpr n, final Visitable arg) { + public Boolean visit(final SwitchExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final YieldStmt n, final Visitable arg) { + public Boolean visit(final YieldStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { + public Boolean visit(final TextBlockLiteralExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final TypePatternExpr n, final Visitable arg) { + public Boolean visit(final TypePatternExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { + public Boolean visit(final JmlQuantifiedExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlClauseLabel n, final Visitable arg) { + public Boolean visit(final JmlClauseLabel n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { + public Boolean visit(final JmlExpressionStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlLabelExpr n, final Visitable arg) { + public Boolean visit(final JmlLabelExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlLetExpr n, final Visitable arg) { + public Boolean visit(final JmlLetExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { + public Boolean visit(final JmlMultiCompareExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { + public Boolean visit(final JmlSimpleExprClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlSignalsClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { + public Boolean visit(final JmlSignalsOnlyClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { + public Boolean visit(final JmlUnreachableStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlCallableClause n, final Visitable arg) { + public Boolean visit(final JmlCallableClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlForallClause n, final Visitable arg) { + public Boolean visit(final JmlForallClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { + public Boolean visit(final JmlRefiningStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlClauseIf n, final Visitable arg) { + public Boolean visit(final JmlClauseIf n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassExprDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { + public Boolean visit(final JmlClassAccessibleDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { + public Boolean visit(final JmlRepresentsDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlContract n, final Visitable arg) { + public Boolean visit(final JmlContract n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { + public Boolean visit(final JmlSetComprehensionExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlGhostStmt n, final Visitable arg) { + public Boolean visit(final JmlGhostStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final RecordDeclaration n, final Visitable arg) { + public Boolean visit(final RecordDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { + public Boolean visit(final CompactConstructorDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final RecordPatternExpr n, final Visitable arg) { + public Boolean visit(final RecordPatternExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { + public Boolean visit(final JmlMethodDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { + public Boolean visit(final JmlBinaryInfixExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { + public Boolean visit(final JmlDocDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlDocStmt n, final Visitable arg) { + public Boolean visit(final JmlDocStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlDoc n, final Visitable arg) { + public Boolean visit(final JmlDoc n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlDocType n, final Visitable arg) { + public Boolean visit(final JmlDocType n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { + public Boolean visit(final JmlFieldDeclaration n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlOldClause n, final Visitable arg) { + public Boolean visit(final JmlOldClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlTypeExpr n, final Visitable arg) { + public Boolean visit(final JmlTypeExpr n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { + public Boolean visit(final JmlMultiExprClause n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlBeginStmt n, final Visitable arg) { + public Boolean visit(final JmlBeginStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlEndStmt n, final Visitable arg) { + public Boolean visit(final JmlEndStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlLabelStmt n, final Visitable arg) { + public Boolean visit(final JmlLabelStmt n, final Visitable arg) { return n == arg; } @Override - public Boolean visit(final JmlMethodSignature n, final Visitable arg) { + public Boolean visit(final JmlMethodSignature n, final Visitable arg) { return n == arg; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java index aa35904303..eab25e66b2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ObjectIdentityHashCodeVisitor.java @@ -40,7 +40,7 @@ * A visitor that calculates a deep hash code for a node by using the hash codes of all its properties, * and the hash codes of all its child nodes (by visiting those too.) */ -public class ObjectIdentityHashCodeVisitor implements GenericVisitor { +public class ObjectIdentityHashCodeVisitor implements GenericVisitor { private static final ObjectIdentityHashCodeVisitor SINGLETON = new ObjectIdentityHashCodeVisitor(); @@ -48,592 +48,592 @@ public static int hashCode(final Node node) { return node.accept(SINGLETON, null); } - public Integer visit(final AnnotationDeclaration n, final Void arg) { + public Integer visit(final AnnotationDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { + public Integer visit(final AnnotationMemberDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ArrayAccessExpr n, final Void arg) { + public Integer visit(final ArrayAccessExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ArrayCreationExpr n, final Void arg) { + public Integer visit(final ArrayCreationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ArrayCreationLevel n, final Void arg) { + public Integer visit(final ArrayCreationLevel n, final Void arg) { return n.hashCode(); } - public Integer visit(final ArrayInitializerExpr n, final Void arg) { + public Integer visit(final ArrayInitializerExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ArrayType n, final Void arg) { + public Integer visit(final ArrayType n, final Void arg) { return n.hashCode(); } - public Integer visit(final AssertStmt n, final Void arg) { + public Integer visit(final AssertStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final AssignExpr n, final Void arg) { + public Integer visit(final AssignExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final BinaryExpr n, final Void arg) { + public Integer visit(final BinaryExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final BlockComment n, final Void arg) { + public Integer visit(final BlockComment n, final Void arg) { return n.hashCode(); } - public Integer visit(final BlockStmt n, final Void arg) { + public Integer visit(final BlockStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final BooleanLiteralExpr n, final Void arg) { + public Integer visit(final BooleanLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final BreakStmt n, final Void arg) { + public Integer visit(final BreakStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final CastExpr n, final Void arg) { + public Integer visit(final CastExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final CatchClause n, final Void arg) { + public Integer visit(final CatchClause n, final Void arg) { return n.hashCode(); } - public Integer visit(final CharLiteralExpr n, final Void arg) { + public Integer visit(final CharLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ClassExpr n, final Void arg) { + public Integer visit(final ClassExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { + public Integer visit(final ClassOrInterfaceDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ClassOrInterfaceType n, final Void arg) { + public Integer visit(final ClassOrInterfaceType n, final Void arg) { return n.hashCode(); } - public Integer visit(final CompilationUnit n, final Void arg) { + public Integer visit(final CompilationUnit n, final Void arg) { return n.hashCode(); } - public Integer visit(final ConditionalExpr n, final Void arg) { + public Integer visit(final ConditionalExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ConstructorDeclaration n, final Void arg) { + public Integer visit(final ConstructorDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ContinueStmt n, final Void arg) { + public Integer visit(final ContinueStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final DoStmt n, final Void arg) { + public Integer visit(final DoStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final DoubleLiteralExpr n, final Void arg) { + public Integer visit(final DoubleLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final EmptyStmt n, final Void arg) { + public Integer visit(final EmptyStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final EnclosedExpr n, final Void arg) { + public Integer visit(final EnclosedExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final EnumConstantDeclaration n, final Void arg) { + public Integer visit(final EnumConstantDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final EnumDeclaration n, final Void arg) { + public Integer visit(final EnumDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { + public Integer visit(final ExplicitConstructorInvocationStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final ExpressionStmt n, final Void arg) { + public Integer visit(final ExpressionStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final FieldAccessExpr n, final Void arg) { + public Integer visit(final FieldAccessExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final FieldDeclaration n, final Void arg) { + public Integer visit(final FieldDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ForStmt n, final Void arg) { + public Integer visit(final ForStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final ForEachStmt n, final Void arg) { + public Integer visit(final ForEachStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final IfStmt n, final Void arg) { + public Integer visit(final IfStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final ImportDeclaration n, final Void arg) { + public Integer visit(final ImportDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final InitializerDeclaration n, final Void arg) { + public Integer visit(final InitializerDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final InstanceOfExpr n, final Void arg) { + public Integer visit(final InstanceOfExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final IntegerLiteralExpr n, final Void arg) { + public Integer visit(final IntegerLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final IntersectionType n, final Void arg) { + public Integer visit(final IntersectionType n, final Void arg) { return n.hashCode(); } - public Integer visit(final JavadocComment n, final Void arg) { + public Integer visit(final JavadocComment n, final Void arg) { return n.hashCode(); } - public Integer visit(final LabeledStmt n, final Void arg) { + public Integer visit(final LabeledStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final LambdaExpr n, final Void arg) { + public Integer visit(final LambdaExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final LineComment n, final Void arg) { + public Integer visit(final LineComment n, final Void arg) { return n.hashCode(); } - public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { + public Integer visit(final LocalClassDeclarationStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { + public Integer visit(final LocalRecordDeclarationStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final LongLiteralExpr n, final Void arg) { + public Integer visit(final LongLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final MarkerAnnotationExpr n, final Void arg) { + public Integer visit(final MarkerAnnotationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final MemberValuePair n, final Void arg) { + public Integer visit(final MemberValuePair n, final Void arg) { return n.hashCode(); } - public Integer visit(final MethodCallExpr n, final Void arg) { + public Integer visit(final MethodCallExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final MethodDeclaration n, final Void arg) { + public Integer visit(final MethodDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final MethodReferenceExpr n, final Void arg) { + public Integer visit(final MethodReferenceExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final NameExpr n, final Void arg) { + public Integer visit(final NameExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final Name n, final Void arg) { + public Integer visit(final Name n, final Void arg) { return n.hashCode(); } - public Integer visit(NodeList n, Void arg) { + public Integer visit(NodeList n, Void arg) { return n.hashCode(); } - public Integer visit(final NormalAnnotationExpr n, final Void arg) { + public Integer visit(final NormalAnnotationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final NullLiteralExpr n, final Void arg) { + public Integer visit(final NullLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ObjectCreationExpr n, final Void arg) { + public Integer visit(final ObjectCreationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final PackageDeclaration n, final Void arg) { + public Integer visit(final PackageDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final Parameter n, final Void arg) { + public Integer visit(final Parameter n, final Void arg) { return n.hashCode(); } - public Integer visit(final PrimitiveType n, final Void arg) { + public Integer visit(final PrimitiveType n, final Void arg) { return n.hashCode(); } - public Integer visit(final ReturnStmt n, final Void arg) { + public Integer visit(final ReturnStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final SimpleName n, final Void arg) { + public Integer visit(final SimpleName n, final Void arg) { return n.hashCode(); } - public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { + public Integer visit(final SingleMemberAnnotationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final StringLiteralExpr n, final Void arg) { + public Integer visit(final StringLiteralExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final SuperExpr n, final Void arg) { + public Integer visit(final SuperExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final SwitchEntry n, final Void arg) { + public Integer visit(final SwitchEntry n, final Void arg) { return n.hashCode(); } - public Integer visit(final SwitchStmt n, final Void arg) { + public Integer visit(final SwitchStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final SynchronizedStmt n, final Void arg) { + public Integer visit(final SynchronizedStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final ThisExpr n, final Void arg) { + public Integer visit(final ThisExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final ThrowStmt n, final Void arg) { + public Integer visit(final ThrowStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final TryStmt n, final Void arg) { + public Integer visit(final TryStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final TypeExpr n, final Void arg) { + public Integer visit(final TypeExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final TypeParameter n, final Void arg) { + public Integer visit(final TypeParameter n, final Void arg) { return n.hashCode(); } - public Integer visit(final UnaryExpr n, final Void arg) { + public Integer visit(final UnaryExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final UnionType n, final Void arg) { + public Integer visit(final UnionType n, final Void arg) { return n.hashCode(); } - public Integer visit(final UnknownType n, final Void arg) { + public Integer visit(final UnknownType n, final Void arg) { return n.hashCode(); } - public Integer visit(final VariableDeclarationExpr n, final Void arg) { + public Integer visit(final VariableDeclarationExpr n, final Void arg) { return n.hashCode(); } - public Integer visit(final VariableDeclarator n, final Void arg) { + public Integer visit(final VariableDeclarator n, final Void arg) { return n.hashCode(); } - public Integer visit(final VoidType n, final Void arg) { + public Integer visit(final VoidType n, final Void arg) { return n.hashCode(); } - public Integer visit(final WhileStmt n, final Void arg) { + public Integer visit(final WhileStmt n, final Void arg) { return n.hashCode(); } - public Integer visit(final WildcardType n, final Void arg) { + public Integer visit(final WildcardType n, final Void arg) { return n.hashCode(); } - public Integer visit(final ModuleDeclaration n, final Void arg) { + public Integer visit(final ModuleDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final ModuleRequiresDirective n, final Void arg) { + public Integer visit(final ModuleRequiresDirective n, final Void arg) { return n.hashCode(); } @Override() - public Integer visit(final ModuleExportsDirective n, final Void arg) { + public Integer visit(final ModuleExportsDirective n, final Void arg) { return n.hashCode(); } @Override() - public Integer visit(final ModuleProvidesDirective n, final Void arg) { + public Integer visit(final ModuleProvidesDirective n, final Void arg) { return n.hashCode(); } @Override() - public Integer visit(final ModuleUsesDirective n, final Void arg) { + public Integer visit(final ModuleUsesDirective n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final ModuleOpensDirective n, final Void arg) { + public Integer visit(final ModuleOpensDirective n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final UnparsableStmt n, final Void arg) { + public Integer visit(final UnparsableStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final ReceiverParameter n, final Void arg) { + public Integer visit(final ReceiverParameter n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final VarType n, final Void arg) { + public Integer visit(final VarType n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final Modifier n, final Void arg) { + public Integer visit(final Modifier n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final SwitchExpr n, final Void arg) { + public Integer visit(final SwitchExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final YieldStmt n, final Void arg) { + public Integer visit(final YieldStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final TextBlockLiteralExpr n, final Void arg) { + public Integer visit(final TextBlockLiteralExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final TypePatternExpr n, final Void arg) { + public Integer visit(final TypePatternExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlQuantifiedExpr n, final Void arg) { + public Integer visit(final JmlQuantifiedExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlClauseLabel n, final Void arg) { + public Integer visit(final JmlClauseLabel n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlExpressionStmt n, final Void arg) { + public Integer visit(final JmlExpressionStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlLabelExpr n, final Void arg) { + public Integer visit(final JmlLabelExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlLetExpr n, final Void arg) { + public Integer visit(final JmlLetExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlMultiCompareExpr n, final Void arg) { + public Integer visit(final JmlMultiCompareExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlSimpleExprClause n, final Void arg) { + public Integer visit(final JmlSimpleExprClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlSignalsClause n, final Void arg) { + public Integer visit(final JmlSignalsClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { + public Integer visit(final JmlSignalsOnlyClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlUnreachableStmt n, final Void arg) { + public Integer visit(final JmlUnreachableStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlCallableClause n, final Void arg) { + public Integer visit(final JmlCallableClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlForallClause n, final Void arg) { + public Integer visit(final JmlForallClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlRefiningStmt n, final Void arg) { + public Integer visit(final JmlRefiningStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlClauseIf n, final Void arg) { + public Integer visit(final JmlClauseIf n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlClassExprDeclaration n, final Void arg) { + public Integer visit(final JmlClassExprDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { + public Integer visit(final JmlClassAccessibleDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { + public Integer visit(final JmlRepresentsDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlContract n, final Void arg) { + public Integer visit(final JmlContract n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { + public Integer visit(final JmlSetComprehensionExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlGhostStmt n, final Void arg) { + public Integer visit(final JmlGhostStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final RecordDeclaration n, final Void arg) { + public Integer visit(final RecordDeclaration n, final Void arg) { return n.hashCode(); } - public Integer visit(final CompactConstructorDeclaration n, final Void arg) { + public Integer visit(final CompactConstructorDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final RecordPatternExpr n, final Void arg) { + public Integer visit(final RecordPatternExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlMethodDeclaration n, final Void arg) { + public Integer visit(final JmlMethodDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { + public Integer visit(final JmlBinaryInfixExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlDocDeclaration n, final Void arg) { + public Integer visit(final JmlDocDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlDocStmt n, final Void arg) { + public Integer visit(final JmlDocStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlDoc n, final Void arg) { + public Integer visit(final JmlDoc n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlDocType n, final Void arg) { + public Integer visit(final JmlDocType n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlFieldDeclaration n, final Void arg) { + public Integer visit(final JmlFieldDeclaration n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlOldClause n, final Void arg) { + public Integer visit(final JmlOldClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlTypeExpr n, final Void arg) { + public Integer visit(final JmlTypeExpr n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlMultiExprClause n, final Void arg) { + public Integer visit(final JmlMultiExprClause n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlBeginStmt n, final Void arg) { + public Integer visit(final JmlBeginStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlEndStmt n, final Void arg) { + public Integer visit(final JmlEndStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlLabelStmt n, final Void arg) { + public Integer visit(final JmlLabelStmt n, final Void arg) { return n.hashCode(); } @Override - public Integer visit(final JmlMethodSignature n, final Void arg) { + public Integer visit(final JmlMethodSignature n, final Void arg) { return n.hashCode(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/TreeVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/TreeVisitor.java index 59828eb877..13cbc6cf2f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/TreeVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/TreeVisitor.java @@ -32,7 +32,7 @@ */ public abstract class TreeVisitor { - public void visitLeavesFirst(Node node) { + public void visitLeavesFirst(Node node) { for (Node child : node.getChildNodes()) { visitLeavesFirst(child); } @@ -46,7 +46,7 @@ public void visitLeavesFirst(Node node) { * @param node The node at which the traversal begins. * @see Pre-order traversal */ - public void visitPreOrder(Node node) { + public void visitPreOrder(Node node) { process(node); new ArrayList<>(node.getChildNodes()).forEach(this::visitPreOrder); } @@ -58,7 +58,7 @@ public void visitPreOrder(Node node) { * @param node The node at which the traversal begins. * @see Post-order traversal */ - public void visitPostOrder(Node node) { + public void visitPostOrder(Node node) { new ArrayList<>(node.getChildNodes()).forEach(this::visitPostOrder); process(node); } @@ -68,7 +68,7 @@ public void visitPostOrder(Node node) { * * @param node the start node, and the first one that is passed to process(node). */ - public void visitBreadthFirst(Node node) { + public void visitBreadthFirst(Node node) { final Queue queue = new LinkedList<>(); queue.offer(node); while (queue.size() > 0) { @@ -90,7 +90,7 @@ public void visitBreadthFirst(Node node) { /** * Performs a simple traversal over all nodes that have the passed node as their parent. */ - public void visitDirectChildren(Node node) { + public void visitDirectChildren(Node node) { new ArrayList<>(node.getChildNodes()).forEach(this::process); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/Visitable.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/Visitable.java index c52383ce1f..3baf8655d2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/Visitable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/Visitable.java @@ -20,7 +20,7 @@ */ package com.github.javaparser.ast.visitor; -public interface Visitable { +public interface Visitable { /** * Accept method for visitor support. diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java index be9f72d321..23e5c4934d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitor.java @@ -43,7 +43,7 @@ * * @author Julio Vilmar Gesser */ -public interface VoidVisitor { +public interface VoidVisitor { void visit(NodeList n, A arg); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java index e9aa2604d1..c8daf48dc3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorAdapter.java @@ -44,13 +44,13 @@ public abstract class VoidVisitorAdapter implements VoidVisitor { @Override - public void visit(final LocalRecordDeclarationStmt n, final A arg) { + public void visit(final LocalRecordDeclarationStmt n, final A arg) { n.getRecordDeclaration().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final AnnotationDeclaration n, final A arg) { + public void visit(final AnnotationDeclaration n, final A arg) { n.getMembers().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); @@ -59,7 +59,7 @@ public void visit(final AnnotationDeclaration n, final A arg) { } @Override - public void visit(final AnnotationMemberDeclaration n, final A arg) { + public void visit(final AnnotationMemberDeclaration n, final A arg) { n.getDefaultValue().ifPresent(l -> l.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); @@ -69,14 +69,14 @@ public void visit(final AnnotationMemberDeclaration n, final A arg) { } @Override - public void visit(final ArrayAccessExpr n, final A arg) { + public void visit(final ArrayAccessExpr n, final A arg) { n.getIndex().accept(this, arg); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ArrayCreationExpr n, final A arg) { + public void visit(final ArrayCreationExpr n, final A arg) { n.getElementType().accept(this, arg); n.getInitializer().ifPresent(l -> l.accept(this, arg)); n.getLevels().forEach(p -> p.accept(this, arg)); @@ -84,82 +84,82 @@ public void visit(final ArrayCreationExpr n, final A arg) { } @Override - public void visit(final ArrayInitializerExpr n, final A arg) { + public void visit(final ArrayInitializerExpr n, final A arg) { n.getValues().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final AssertStmt n, final A arg) { + public void visit(final AssertStmt n, final A arg) { n.getCheck().accept(this, arg); n.getMessage().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final AssignExpr n, final A arg) { + public void visit(final AssignExpr n, final A arg) { n.getTarget().accept(this, arg); n.getValue().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final BinaryExpr n, final A arg) { + public void visit(final BinaryExpr n, final A arg) { n.getLeft().accept(this, arg); n.getRight().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final BlockComment n, final A arg) { + public void visit(final BlockComment n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final BlockStmt n, final A arg) { + public void visit(final BlockStmt n, final A arg) { n.getContracts().forEach(p -> p.accept(this, arg)); n.getStatements().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final BooleanLiteralExpr n, final A arg) { + public void visit(final BooleanLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final BreakStmt n, final A arg) { + public void visit(final BreakStmt n, final A arg) { n.getLabel().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final CastExpr n, final A arg) { + public void visit(final CastExpr n, final A arg) { n.getExpression().accept(this, arg); n.getType().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final CatchClause n, final A arg) { + public void visit(final CatchClause n, final A arg) { n.getBody().accept(this, arg); n.getParameter().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final CharLiteralExpr n, final A arg) { + public void visit(final CharLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ClassExpr n, final A arg) { + public void visit(final ClassExpr n, final A arg) { n.getType().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ClassOrInterfaceDeclaration n, final A arg) { + public void visit(final ClassOrInterfaceDeclaration n, final A arg) { n.getExtendedTypes().forEach(p -> p.accept(this, arg)); n.getImplementedTypes().forEach(p -> p.accept(this, arg)); n.getPermittedTypes().forEach(p -> p.accept(this, arg)); @@ -172,7 +172,7 @@ public void visit(final ClassOrInterfaceDeclaration n, final A arg) { } @Override - public void visit(final ClassOrInterfaceType n, final A arg) { + public void visit(final ClassOrInterfaceType n, final A arg) { n.getName().accept(this, arg); n.getScope().ifPresent(l -> l.accept(this, arg)); n.getTypeArguments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -181,7 +181,7 @@ public void visit(final ClassOrInterfaceType n, final A arg) { } @Override - public void visit(final CompilationUnit n, final A arg) { + public void visit(final CompilationUnit n, final A arg) { n.getImports().forEach(p -> p.accept(this, arg)); n.getModule().ifPresent(l -> l.accept(this, arg)); n.getPackageDeclaration().ifPresent(l -> l.accept(this, arg)); @@ -190,7 +190,7 @@ public void visit(final CompilationUnit n, final A arg) { } @Override - public void visit(final ConditionalExpr n, final A arg) { + public void visit(final ConditionalExpr n, final A arg) { n.getCondition().accept(this, arg); n.getElseExpr().accept(this, arg); n.getThenExpr().accept(this, arg); @@ -198,7 +198,7 @@ public void visit(final ConditionalExpr n, final A arg) { } @Override - public void visit(final ConstructorDeclaration n, final A arg) { + public void visit(final ConstructorDeclaration n, final A arg) { n.getBody().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); @@ -212,13 +212,13 @@ public void visit(final ConstructorDeclaration n, final A arg) { } @Override - public void visit(final ContinueStmt n, final A arg) { + public void visit(final ContinueStmt n, final A arg) { n.getLabel().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final DoStmt n, final A arg) { + public void visit(final DoStmt n, final A arg) { n.getBody().accept(this, arg); n.getCondition().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); @@ -226,23 +226,23 @@ public void visit(final DoStmt n, final A arg) { } @Override - public void visit(final DoubleLiteralExpr n, final A arg) { + public void visit(final DoubleLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final EmptyStmt n, final A arg) { + public void visit(final EmptyStmt n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final EnclosedExpr n, final A arg) { + public void visit(final EnclosedExpr n, final A arg) { n.getInner().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final EnumConstantDeclaration n, final A arg) { + public void visit(final EnumConstantDeclaration n, final A arg) { n.getArguments().forEach(p -> p.accept(this, arg)); n.getClassBody().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); @@ -251,7 +251,7 @@ public void visit(final EnumConstantDeclaration n, final A arg) { } @Override - public void visit(final EnumDeclaration n, final A arg) { + public void visit(final EnumDeclaration n, final A arg) { n.getEntries().forEach(p -> p.accept(this, arg)); n.getImplementedTypes().forEach(p -> p.accept(this, arg)); n.getMembers().forEach(p -> p.accept(this, arg)); @@ -262,7 +262,7 @@ public void visit(final EnumDeclaration n, final A arg) { } @Override - public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { n.getArguments().forEach(p -> p.accept(this, arg)); n.getExpression().ifPresent(l -> l.accept(this, arg)); n.getTypeArguments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -270,13 +270,13 @@ public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { } @Override - public void visit(final ExpressionStmt n, final A arg) { + public void visit(final ExpressionStmt n, final A arg) { n.getExpression().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final FieldAccessExpr n, final A arg) { + public void visit(final FieldAccessExpr n, final A arg) { n.getName().accept(this, arg); n.getScope().accept(this, arg); n.getTypeArguments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); @@ -284,7 +284,7 @@ public void visit(final FieldAccessExpr n, final A arg) { } @Override - public void visit(final FieldDeclaration n, final A arg) { + public void visit(final FieldDeclaration n, final A arg) { n.getModifiers().forEach(p -> p.accept(this, arg)); n.getVariables().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); @@ -292,7 +292,7 @@ public void visit(final FieldDeclaration n, final A arg) { } @Override - public void visit(final ForEachStmt n, final A arg) { + public void visit(final ForEachStmt n, final A arg) { n.getBody().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); n.getIterable().accept(this, arg); @@ -301,7 +301,7 @@ public void visit(final ForEachStmt n, final A arg) { } @Override - public void visit(final ForStmt n, final A arg) { + public void visit(final ForStmt n, final A arg) { n.getBody().accept(this, arg); n.getCompare().ifPresent(l -> l.accept(this, arg)); n.getContracts().forEach(p -> p.accept(this, arg)); @@ -311,7 +311,7 @@ public void visit(final ForStmt n, final A arg) { } @Override - public void visit(final IfStmt n, final A arg) { + public void visit(final IfStmt n, final A arg) { n.getCondition().accept(this, arg); n.getElseStmt().ifPresent(l -> l.accept(this, arg)); n.getThenStmt().accept(this, arg); @@ -319,14 +319,14 @@ public void visit(final IfStmt n, final A arg) { } @Override - public void visit(final InitializerDeclaration n, final A arg) { + public void visit(final InitializerDeclaration n, final A arg) { n.getBody().accept(this, arg); n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final InstanceOfExpr n, final A arg) { + public void visit(final InstanceOfExpr n, final A arg) { n.getExpression().accept(this, arg); n.getPattern().ifPresent(l -> l.accept(this, arg)); n.getType().accept(this, arg); @@ -334,47 +334,47 @@ public void visit(final InstanceOfExpr n, final A arg) { } @Override - public void visit(final IntegerLiteralExpr n, final A arg) { + public void visit(final IntegerLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JavadocComment n, final A arg) { + public void visit(final JavadocComment n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final LabeledStmt n, final A arg) { + public void visit(final LabeledStmt n, final A arg) { n.getLabel().accept(this, arg); n.getStatement().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final LineComment n, final A arg) { + public void visit(final LineComment n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final LongLiteralExpr n, final A arg) { + public void visit(final LongLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final MarkerAnnotationExpr n, final A arg) { + public void visit(final MarkerAnnotationExpr n, final A arg) { n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final MemberValuePair n, final A arg) { + public void visit(final MemberValuePair n, final A arg) { n.getName().accept(this, arg); n.getValue().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final MethodCallExpr n, final A arg) { + public void visit(final MethodCallExpr n, final A arg) { n.getArguments().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getScope().ifPresent(l -> l.accept(this, arg)); @@ -383,7 +383,7 @@ public void visit(final MethodCallExpr n, final A arg) { } @Override - public void visit(final MethodDeclaration n, final A arg) { + public void visit(final MethodDeclaration n, final A arg) { n.getBody().ifPresent(l -> l.accept(this, arg)); n.getType().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); @@ -398,25 +398,25 @@ public void visit(final MethodDeclaration n, final A arg) { } @Override - public void visit(final NameExpr n, final A arg) { + public void visit(final NameExpr n, final A arg) { n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final NormalAnnotationExpr n, final A arg) { + public void visit(final NormalAnnotationExpr n, final A arg) { n.getPairs().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final NullLiteralExpr n, final A arg) { + public void visit(final NullLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ObjectCreationExpr n, final A arg) { + public void visit(final ObjectCreationExpr n, final A arg) { n.getAnonymousClassBody().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getArguments().forEach(p -> p.accept(this, arg)); n.getScope().ifPresent(l -> l.accept(this, arg)); @@ -426,14 +426,14 @@ public void visit(final ObjectCreationExpr n, final A arg) { } @Override - public void visit(final PackageDeclaration n, final A arg) { + public void visit(final PackageDeclaration n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final Parameter n, final A arg) { + public void visit(final Parameter n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); @@ -443,76 +443,76 @@ public void visit(final Parameter n, final A arg) { } @Override - public void visit(final PrimitiveType n, final A arg) { + public void visit(final PrimitiveType n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final Name n, final A arg) { + public void visit(final Name n, final A arg) { n.getQualifier().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SimpleName n, final A arg) { + public void visit(final SimpleName n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ArrayType n, final A arg) { + public void visit(final ArrayType n, final A arg) { n.getComponentType().accept(this, arg); n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ArrayCreationLevel n, final A arg) { + public void visit(final ArrayCreationLevel n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getDimension().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final IntersectionType n, final A arg) { + public void visit(final IntersectionType n, final A arg) { n.getElements().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final UnionType n, final A arg) { + public void visit(final UnionType n, final A arg) { n.getElements().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ReturnStmt n, final A arg) { + public void visit(final ReturnStmt n, final A arg) { n.getExpression().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SingleMemberAnnotationExpr n, final A arg) { + public void visit(final SingleMemberAnnotationExpr n, final A arg) { n.getMemberValue().accept(this, arg); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final StringLiteralExpr n, final A arg) { + public void visit(final StringLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SuperExpr n, final A arg) { + public void visit(final SuperExpr n, final A arg) { n.getTypeName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SwitchEntry n, final A arg) { + public void visit(final SwitchEntry n, final A arg) { n.getGuard().ifPresent(l -> l.accept(this, arg)); n.getLabels().forEach(p -> p.accept(this, arg)); n.getStatements().forEach(p -> p.accept(this, arg)); @@ -520,33 +520,33 @@ public void visit(final SwitchEntry n, final A arg) { } @Override - public void visit(final SwitchStmt n, final A arg) { + public void visit(final SwitchStmt n, final A arg) { n.getEntries().forEach(p -> p.accept(this, arg)); n.getSelector().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SynchronizedStmt n, final A arg) { + public void visit(final SynchronizedStmt n, final A arg) { n.getBody().accept(this, arg); n.getExpression().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ThisExpr n, final A arg) { + public void visit(final ThisExpr n, final A arg) { n.getTypeName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ThrowStmt n, final A arg) { + public void visit(final ThrowStmt n, final A arg) { n.getExpression().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final TryStmt n, final A arg) { + public void visit(final TryStmt n, final A arg) { n.getCatchClauses().forEach(p -> p.accept(this, arg)); n.getFinallyBlock().ifPresent(l -> l.accept(this, arg)); n.getResources().forEach(p -> p.accept(this, arg)); @@ -555,13 +555,13 @@ public void visit(final TryStmt n, final A arg) { } @Override - public void visit(final LocalClassDeclarationStmt n, final A arg) { + public void visit(final LocalClassDeclarationStmt n, final A arg) { n.getClassDeclaration().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final TypeParameter n, final A arg) { + public void visit(final TypeParameter n, final A arg) { n.getName().accept(this, arg); n.getTypeBound().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); @@ -569,19 +569,19 @@ public void visit(final TypeParameter n, final A arg) { } @Override - public void visit(final UnaryExpr n, final A arg) { + public void visit(final UnaryExpr n, final A arg) { n.getExpression().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final UnknownType n, final A arg) { + public void visit(final UnknownType n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final VariableDeclarationExpr n, final A arg) { + public void visit(final VariableDeclarationExpr n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); n.getVariables().forEach(p -> p.accept(this, arg)); @@ -589,7 +589,7 @@ public void visit(final VariableDeclarationExpr n, final A arg) { } @Override - public void visit(final VariableDeclarator n, final A arg) { + public void visit(final VariableDeclarator n, final A arg) { n.getInitializer().ifPresent(l -> l.accept(this, arg)); n.getName().accept(this, arg); n.getType().accept(this, arg); @@ -597,13 +597,13 @@ public void visit(final VariableDeclarator n, final A arg) { } @Override - public void visit(final VoidType n, final A arg) { + public void visit(final VoidType n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final WhileStmt n, final A arg) { + public void visit(final WhileStmt n, final A arg) { n.getBody().accept(this, arg); n.getCondition().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); @@ -611,7 +611,7 @@ public void visit(final WhileStmt n, final A arg) { } @Override - public void visit(final WildcardType n, final A arg) { + public void visit(final WildcardType n, final A arg) { n.getExtendedType().ifPresent(l -> l.accept(this, arg)); n.getSuperType().ifPresent(l -> l.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); @@ -619,7 +619,7 @@ public void visit(final WildcardType n, final A arg) { } @Override - public void visit(final LambdaExpr n, final A arg) { + public void visit(final LambdaExpr n, final A arg) { n.getBody().accept(this, arg); n.getContracts().forEach(p -> p.accept(this, arg)); n.getParameters().forEach(p -> p.accept(this, arg)); @@ -627,78 +627,78 @@ public void visit(final LambdaExpr n, final A arg) { } @Override - public void visit(final MethodReferenceExpr n, final A arg) { + public void visit(final MethodReferenceExpr n, final A arg) { n.getScope().accept(this, arg); n.getTypeArguments().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final TypeExpr n, final A arg) { + public void visit(final TypeExpr n, final A arg) { n.getType().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(NodeList n, A arg) { + public void visit(NodeList n, A arg) { for (Object node : n) { ((Node) node).accept(this, arg); } } @Override - public void visit(final ImportDeclaration n, final A arg) { + public void visit(final ImportDeclaration n, final A arg) { n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } - public void visit(final ModuleDeclaration n, final A arg) { + public void visit(final ModuleDeclaration n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getDirectives().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } - public void visit(final ModuleRequiresDirective n, final A arg) { + public void visit(final ModuleRequiresDirective n, final A arg) { n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ModuleExportsDirective n, final A arg) { + public void visit(final ModuleExportsDirective n, final A arg) { n.getModuleNames().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ModuleProvidesDirective n, final A arg) { + public void visit(final ModuleProvidesDirective n, final A arg) { n.getName().accept(this, arg); n.getWith().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ModuleUsesDirective n, final A arg) { + public void visit(final ModuleUsesDirective n, final A arg) { n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ModuleOpensDirective n, final A arg) { + public void visit(final ModuleOpensDirective n, final A arg) { n.getModuleNames().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final UnparsableStmt n, final A arg) { + public void visit(final UnparsableStmt n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final ReceiverParameter n, final A arg) { + public void visit(final ReceiverParameter n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getType().accept(this, arg); @@ -706,36 +706,36 @@ public void visit(final ReceiverParameter n, final A arg) { } @Override - public void visit(final VarType n, final A arg) { + public void visit(final VarType n, final A arg) { n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final Modifier n, final A arg) { + public void visit(final Modifier n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final SwitchExpr n, final A arg) { + public void visit(final SwitchExpr n, final A arg) { n.getEntries().forEach(p -> p.accept(this, arg)); n.getSelector().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final TextBlockLiteralExpr n, final A arg) { + public void visit(final TextBlockLiteralExpr n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final YieldStmt n, final A arg) { + public void visit(final YieldStmt n, final A arg) { n.getExpression().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final TypePatternExpr n, final A arg) { + public void visit(final TypePatternExpr n, final A arg) { n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getType().accept(this, arg); @@ -743,7 +743,7 @@ public void visit(final TypePatternExpr n, final A arg) { } @Override - public void visit(final JmlClauseLabel n, final A arg) { + public void visit(final JmlClauseLabel n, final A arg) { n.getExpr().accept(this, arg); n.getLabel().ifPresent(l -> l.accept(this, arg)); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -751,41 +751,41 @@ public void visit(final JmlClauseLabel n, final A arg) { } @Override - public void visit(final JmlExpressionStmt n, final A arg) { + public void visit(final JmlExpressionStmt n, final A arg) { n.getExpression().accept(this, arg); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlQuantifiedExpr n, final A arg) { + public void visit(final JmlQuantifiedExpr n, final A arg) { n.getExpressions().forEach(p -> p.accept(this, arg)); n.getVariables().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlLabelExpr n, final A arg) { + public void visit(final JmlLabelExpr n, final A arg) { n.getExpression().accept(this, arg); n.getLabel().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlLetExpr n, final A arg) { + public void visit(final JmlLetExpr n, final A arg) { n.getBody().accept(this, arg); n.getVariables().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlMultiCompareExpr n, final A arg) { + public void visit(final JmlMultiCompareExpr n, final A arg) { n.getExpressions().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlSimpleExprClause n, final A arg) { + public void visit(final JmlSimpleExprClause n, final A arg) { n.getExpression().accept(this, arg); n.getHeaps().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -793,7 +793,7 @@ public void visit(final JmlSimpleExprClause n, final A arg) { } @Override - public void visit(final JmlSignalsClause n, final A arg) { + public void visit(final JmlSignalsClause n, final A arg) { n.getExpression().accept(this, arg); n.getParameter().accept(this, arg); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -801,40 +801,40 @@ public void visit(final JmlSignalsClause n, final A arg) { } @Override - public void visit(final JmlSignalsOnlyClause n, final A arg) { + public void visit(final JmlSignalsOnlyClause n, final A arg) { n.getTypes().forEach(p -> p.accept(this, arg)); n.getName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlUnreachableStmt n, final A arg) { + public void visit(final JmlUnreachableStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlCallableClause n, final A arg) { + public void visit(final JmlCallableClause n, final A arg) { n.getMethodSignatures().forEach(p -> p.accept(this, arg)); n.getName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlForallClause n, final A arg) { + public void visit(final JmlForallClause n, final A arg) { n.getBoundedVariables().forEach(p -> p.accept(this, arg)); n.getName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlRefiningStmt n, final A arg) { + public void visit(final JmlRefiningStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlClauseIf n, final A arg) { + public void visit(final JmlClauseIf n, final A arg) { n.getCondition().accept(this, arg); n.getThen().accept(this, arg); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -842,7 +842,7 @@ public void visit(final JmlClauseIf n, final A arg) { } @Override - public void visit(final JmlClassExprDeclaration n, final A arg) { + public void visit(final JmlClassExprDeclaration n, final A arg) { n.getInvariant().accept(this, arg); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getKind().accept(this, arg); @@ -853,7 +853,7 @@ public void visit(final JmlClassExprDeclaration n, final A arg) { } @Override - public void visit(final JmlClassAccessibleDeclaration n, final A arg) { + public void visit(final JmlClassAccessibleDeclaration n, final A arg) { n.getExpressions().forEach(p -> p.accept(this, arg)); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getMeasuredBy().ifPresent(l -> l.accept(this, arg)); @@ -864,7 +864,7 @@ public void visit(final JmlClassAccessibleDeclaration n, final A arg) { } @Override - public void visit(final JmlRepresentsDeclaration n, final A arg) { + public void visit(final JmlRepresentsDeclaration n, final A arg) { n.getExpr().accept(this, arg); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); @@ -874,7 +874,7 @@ public void visit(final JmlRepresentsDeclaration n, final A arg) { } @Override - public void visit(final JmlContract n, final A arg) { + public void visit(final JmlContract n, final A arg) { n.getClauses().forEach(p -> p.accept(this, arg)); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); @@ -884,21 +884,21 @@ public void visit(final JmlContract n, final A arg) { } @Override - public void visit(final JmlSetComprehensionExpr n, final A arg) { + public void visit(final JmlSetComprehensionExpr n, final A arg) { n.getBinding().accept(this, arg); n.getPredicate().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlGhostStmt n, final A arg) { + public void visit(final JmlGhostStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getStatement().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final RecordDeclaration n, final A arg) { + public void visit(final RecordDeclaration n, final A arg) { n.getImplementedTypes().forEach(p -> p.accept(this, arg)); n.getParameters().forEach(p -> p.accept(this, arg)); n.getReceiverParameter().ifPresent(l -> l.accept(this, arg)); @@ -911,7 +911,7 @@ public void visit(final RecordDeclaration n, final A arg) { } @Override - public void visit(final CompactConstructorDeclaration n, final A arg) { + public void visit(final CompactConstructorDeclaration n, final A arg) { n.getBody().accept(this, arg); n.getModifiers().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); @@ -922,7 +922,7 @@ public void visit(final CompactConstructorDeclaration n, final A arg) { } @Override - public void visit(final RecordPatternExpr n, final A arg) { + public void visit(final RecordPatternExpr n, final A arg) { n.getModifiers().forEach(p -> p.accept(this, arg)); n.getPatternList().forEach(p -> p.accept(this, arg)); n.getType().accept(this, arg); @@ -930,7 +930,7 @@ public void visit(final RecordPatternExpr n, final A arg) { } @Override - public void visit(final JmlMethodDeclaration n, final A arg) { + public void visit(final JmlMethodDeclaration n, final A arg) { n.getContract().ifPresent(l -> l.accept(this, arg)); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getMethodDeclaration().accept(this, arg); @@ -939,7 +939,7 @@ public void visit(final JmlMethodDeclaration n, final A arg) { } @Override - public void visit(final JmlBinaryInfixExpr n, final A arg) { + public void visit(final JmlBinaryInfixExpr n, final A arg) { n.getLeft().accept(this, arg); n.getOperator().accept(this, arg); n.getRight().accept(this, arg); @@ -947,25 +947,25 @@ public void visit(final JmlBinaryInfixExpr n, final A arg) { } @Override - public void visit(final JmlDocDeclaration n, final A arg) { + public void visit(final JmlDocDeclaration n, final A arg) { n.getJmlComments().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlDocStmt n, final A arg) { + public void visit(final JmlDocStmt n, final A arg) { n.getJmlComments().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlDoc n, final A arg) { + public void visit(final JmlDoc n, final A arg) { n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlDocType n, final A arg) { + public void visit(final JmlDocType n, final A arg) { n.getJmlComments().forEach(p -> p.accept(this, arg)); n.getMembers().forEach(p -> p.accept(this, arg)); n.getModifiers().forEach(p -> p.accept(this, arg)); @@ -975,7 +975,7 @@ public void visit(final JmlDocType n, final A arg) { } @Override - public void visit(final JmlFieldDeclaration n, final A arg) { + public void visit(final JmlFieldDeclaration n, final A arg) { n.getDecl().accept(this, arg); n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getAnnotations().forEach(p -> p.accept(this, arg)); @@ -983,20 +983,20 @@ public void visit(final JmlFieldDeclaration n, final A arg) { } @Override - public void visit(final JmlOldClause n, final A arg) { + public void visit(final JmlOldClause n, final A arg) { n.getDeclarations().accept(this, arg); n.getName().ifPresent(l -> l.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlTypeExpr n, final A arg) { + public void visit(final JmlTypeExpr n, final A arg) { n.getType().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlMultiExprClause n, final A arg) { + public void visit(final JmlMultiExprClause n, final A arg) { n.getExpressions().forEach(p -> p.accept(this, arg)); n.getHeaps().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); n.getName().ifPresent(l -> l.accept(this, arg)); @@ -1004,26 +1004,26 @@ public void visit(final JmlMultiExprClause n, final A arg) { } @Override - public void visit(final JmlBeginStmt n, final A arg) { + public void visit(final JmlBeginStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlEndStmt n, final A arg) { + public void visit(final JmlEndStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlLabelStmt n, final A arg) { + public void visit(final JmlLabelStmt n, final A arg) { n.getJmlTags().forEach(p -> p.accept(this, arg)); n.getLabel().accept(this, arg); n.getComment().ifPresent(l -> l.accept(this, arg)); } @Override - public void visit(final JmlMethodSignature n, final A arg) { + public void visit(final JmlMethodSignature n, final A arg) { n.getArgumentTypes().forEach(p -> p.accept(this, arg)); n.getName().accept(this, arg); n.getReceiver().ifPresent(l -> l.accept(this, arg)); diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java index 599f8df0ee..d6b08f0f81 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/VoidVisitorWithDefaults.java @@ -45,685 +45,685 @@ public abstract class VoidVisitorWithDefaults implements VoidVisitor { /** * This will be called by every node visit method that is not overridden. */ - public void defaultAction(Node n, A arg) { + public void defaultAction(Node n, A arg) { } /** * This will be called by the NodeList visit method when it is not overridden. */ - public void defaultAction(NodeList n, A arg) { + public void defaultAction(NodeList n, A arg) { } @Override - public void visit(final LocalRecordDeclarationStmt n, final A arg) { + public void visit(final LocalRecordDeclarationStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final AnnotationDeclaration n, final A arg) { + public void visit(final AnnotationDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final AnnotationMemberDeclaration n, final A arg) { + public void visit(final AnnotationMemberDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ArrayAccessExpr n, final A arg) { + public void visit(final ArrayAccessExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ArrayCreationExpr n, final A arg) { + public void visit(final ArrayCreationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ArrayInitializerExpr n, final A arg) { + public void visit(final ArrayInitializerExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final AssertStmt n, final A arg) { + public void visit(final AssertStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final AssignExpr n, final A arg) { + public void visit(final AssignExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final BinaryExpr n, final A arg) { + public void visit(final BinaryExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final BlockComment n, final A arg) { + public void visit(final BlockComment n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final BlockStmt n, final A arg) { + public void visit(final BlockStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final BooleanLiteralExpr n, final A arg) { + public void visit(final BooleanLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final BreakStmt n, final A arg) { + public void visit(final BreakStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final CastExpr n, final A arg) { + public void visit(final CastExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final CatchClause n, final A arg) { + public void visit(final CatchClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final CharLiteralExpr n, final A arg) { + public void visit(final CharLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ClassExpr n, final A arg) { + public void visit(final ClassExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ClassOrInterfaceDeclaration n, final A arg) { + public void visit(final ClassOrInterfaceDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ClassOrInterfaceType n, final A arg) { + public void visit(final ClassOrInterfaceType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final CompilationUnit n, final A arg) { + public void visit(final CompilationUnit n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ConditionalExpr n, final A arg) { + public void visit(final ConditionalExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ConstructorDeclaration n, final A arg) { + public void visit(final ConstructorDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ContinueStmt n, final A arg) { + public void visit(final ContinueStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final DoStmt n, final A arg) { + public void visit(final DoStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final DoubleLiteralExpr n, final A arg) { + public void visit(final DoubleLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final EmptyStmt n, final A arg) { + public void visit(final EmptyStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final EnclosedExpr n, final A arg) { + public void visit(final EnclosedExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final EnumConstantDeclaration n, final A arg) { + public void visit(final EnumConstantDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final EnumDeclaration n, final A arg) { + public void visit(final EnumDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { + public void visit(final ExplicitConstructorInvocationStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ExpressionStmt n, final A arg) { + public void visit(final ExpressionStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final FieldAccessExpr n, final A arg) { + public void visit(final FieldAccessExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final FieldDeclaration n, final A arg) { + public void visit(final FieldDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ForEachStmt n, final A arg) { + public void visit(final ForEachStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ForStmt n, final A arg) { + public void visit(final ForStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final IfStmt n, final A arg) { + public void visit(final IfStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final InitializerDeclaration n, final A arg) { + public void visit(final InitializerDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final InstanceOfExpr n, final A arg) { + public void visit(final InstanceOfExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final IntegerLiteralExpr n, final A arg) { + public void visit(final IntegerLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JavadocComment n, final A arg) { + public void visit(final JavadocComment n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final LabeledStmt n, final A arg) { + public void visit(final LabeledStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final LineComment n, final A arg) { + public void visit(final LineComment n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final LongLiteralExpr n, final A arg) { + public void visit(final LongLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final MarkerAnnotationExpr n, final A arg) { + public void visit(final MarkerAnnotationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final MemberValuePair n, final A arg) { + public void visit(final MemberValuePair n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final MethodCallExpr n, final A arg) { + public void visit(final MethodCallExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final MethodDeclaration n, final A arg) { + public void visit(final MethodDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final NameExpr n, final A arg) { + public void visit(final NameExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final NormalAnnotationExpr n, final A arg) { + public void visit(final NormalAnnotationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final NullLiteralExpr n, final A arg) { + public void visit(final NullLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ObjectCreationExpr n, final A arg) { + public void visit(final ObjectCreationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final PackageDeclaration n, final A arg) { + public void visit(final PackageDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final Parameter n, final A arg) { + public void visit(final Parameter n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final PrimitiveType n, final A arg) { + public void visit(final PrimitiveType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final Name n, final A arg) { + public void visit(final Name n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SimpleName n, final A arg) { + public void visit(final SimpleName n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ArrayType n, final A arg) { + public void visit(final ArrayType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ArrayCreationLevel n, final A arg) { + public void visit(final ArrayCreationLevel n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final IntersectionType n, final A arg) { + public void visit(final IntersectionType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final UnionType n, final A arg) { + public void visit(final UnionType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ReturnStmt n, final A arg) { + public void visit(final ReturnStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SingleMemberAnnotationExpr n, final A arg) { + public void visit(final SingleMemberAnnotationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final StringLiteralExpr n, final A arg) { + public void visit(final StringLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SuperExpr n, final A arg) { + public void visit(final SuperExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SwitchEntry n, final A arg) { + public void visit(final SwitchEntry n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SwitchStmt n, final A arg) { + public void visit(final SwitchStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SynchronizedStmt n, final A arg) { + public void visit(final SynchronizedStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ThisExpr n, final A arg) { + public void visit(final ThisExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ThrowStmt n, final A arg) { + public void visit(final ThrowStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final TryStmt n, final A arg) { + public void visit(final TryStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final LocalClassDeclarationStmt n, final A arg) { + public void visit(final LocalClassDeclarationStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final TypeParameter n, final A arg) { + public void visit(final TypeParameter n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final UnaryExpr n, final A arg) { + public void visit(final UnaryExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final UnknownType n, final A arg) { + public void visit(final UnknownType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final VariableDeclarationExpr n, final A arg) { + public void visit(final VariableDeclarationExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final VariableDeclarator n, final A arg) { + public void visit(final VariableDeclarator n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final VoidType n, final A arg) { + public void visit(final VoidType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final WhileStmt n, final A arg) { + public void visit(final WhileStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final WildcardType n, final A arg) { + public void visit(final WildcardType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final LambdaExpr n, final A arg) { + public void visit(final LambdaExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final MethodReferenceExpr n, final A arg) { + public void visit(final MethodReferenceExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final TypeExpr n, final A arg) { + public void visit(final TypeExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(NodeList n, A arg) { + public void visit(NodeList n, A arg) { defaultAction(n, arg); } @Override - public void visit(final ImportDeclaration n, final A arg) { + public void visit(final ImportDeclaration n, final A arg) { defaultAction(n, arg); } - public void visit(final ModuleDeclaration n, final A arg) { + public void visit(final ModuleDeclaration n, final A arg) { defaultAction(n, arg); } - public void visit(final ModuleRequiresDirective n, final A arg) { + public void visit(final ModuleRequiresDirective n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ModuleExportsDirective n, final A arg) { + public void visit(final ModuleExportsDirective n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ModuleProvidesDirective n, final A arg) { + public void visit(final ModuleProvidesDirective n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ModuleUsesDirective n, final A arg) { + public void visit(final ModuleUsesDirective n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ModuleOpensDirective n, final A arg) { + public void visit(final ModuleOpensDirective n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final UnparsableStmt n, final A arg) { + public void visit(final UnparsableStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final ReceiverParameter n, final A arg) { + public void visit(final ReceiverParameter n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final Modifier n, final A arg) { + public void visit(final Modifier n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final VarType n, final A arg) { + public void visit(final VarType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final SwitchExpr n, final A arg) { + public void visit(final SwitchExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final TextBlockLiteralExpr n, final A arg) { + public void visit(final TextBlockLiteralExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final YieldStmt n, final A arg) { + public void visit(final YieldStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final TypePatternExpr n, final A arg) { + public void visit(final TypePatternExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlQuantifiedExpr n, final A arg) { + public void visit(final JmlQuantifiedExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlClauseLabel n, final A arg) { + public void visit(final JmlClauseLabel n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlExpressionStmt n, final A arg) { + public void visit(final JmlExpressionStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlLabelExpr n, final A arg) { + public void visit(final JmlLabelExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlLetExpr n, final A arg) { + public void visit(final JmlLetExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlMultiCompareExpr n, final A arg) { + public void visit(final JmlMultiCompareExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlSimpleExprClause n, final A arg) { + public void visit(final JmlSimpleExprClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlSignalsClause n, final A arg) { + public void visit(final JmlSignalsClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlSignalsOnlyClause n, final A arg) { + public void visit(final JmlSignalsOnlyClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlUnreachableStmt n, final A arg) { + public void visit(final JmlUnreachableStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlCallableClause n, final A arg) { + public void visit(final JmlCallableClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlForallClause n, final A arg) { + public void visit(final JmlForallClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlRefiningStmt n, final A arg) { + public void visit(final JmlRefiningStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlClauseIf n, final A arg) { + public void visit(final JmlClauseIf n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlClassExprDeclaration n, final A arg) { + public void visit(final JmlClassExprDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlClassAccessibleDeclaration n, final A arg) { + public void visit(final JmlClassAccessibleDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlRepresentsDeclaration n, final A arg) { + public void visit(final JmlRepresentsDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlContract n, final A arg) { + public void visit(final JmlContract n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlSetComprehensionExpr n, final A arg) { + public void visit(final JmlSetComprehensionExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlGhostStmt n, final A arg) { + public void visit(final JmlGhostStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final RecordDeclaration n, final A arg) { + public void visit(final RecordDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final CompactConstructorDeclaration n, final A arg) { + public void visit(final CompactConstructorDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final RecordPatternExpr n, final A arg) { + public void visit(final RecordPatternExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlMethodDeclaration n, final A arg) { + public void visit(final JmlMethodDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlBinaryInfixExpr n, final A arg) { + public void visit(final JmlBinaryInfixExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlDocDeclaration n, final A arg) { + public void visit(final JmlDocDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlDocStmt n, final A arg) { + public void visit(final JmlDocStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlDoc n, final A arg) { + public void visit(final JmlDoc n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlDocType n, final A arg) { + public void visit(final JmlDocType n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlFieldDeclaration n, final A arg) { + public void visit(final JmlFieldDeclaration n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlOldClause n, final A arg) { + public void visit(final JmlOldClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlTypeExpr n, final A arg) { + public void visit(final JmlTypeExpr n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlMultiExprClause n, final A arg) { + public void visit(final JmlMultiExprClause n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlBeginStmt n, final A arg) { + public void visit(final JmlBeginStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlEndStmt n, final A arg) { + public void visit(final JmlEndStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlLabelStmt n, final A arg) { + public void visit(final JmlLabelStmt n, final A arg) { defaultAction(n, arg); } @Override - public void visit(final JmlMethodSignature n, final A arg) { + public void visit(final JmlMethodSignature n, final A arg) { defaultAction(n, arg); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/Javadoc.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/Javadoc.java index ef2e2c5499..23118997ef 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/Javadoc.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/Javadoc.java @@ -34,18 +34,18 @@ * An example would be the text contained in this very Javadoc comment. At the moment * of this writing this comment does not contain any block tags (such as {@code @see AnotherClass}) */ -public class Javadoc { +public class Javadoc { private JavadocDescription description; private List blockTags; - public Javadoc(JavadocDescription description) { + public Javadoc(JavadocDescription description) { this.description = description; this.blockTags = new LinkedList<>(); } - public Javadoc addBlockTag(JavadocBlockTag blockTag) { + public Javadoc addBlockTag(JavadocBlockTag blockTag) { this.blockTags.add(blockTag); return this; } @@ -55,7 +55,7 @@ public Javadoc addBlockTag(JavadocBlockTag blockTag) { * tagName is "return", * and the rest is content. */ - public Javadoc addBlockTag(String tagName, String content) { + public Javadoc addBlockTag(String tagName, String content) { return addBlockTag(new JavadocBlockTag(tagName, content)); } @@ -65,11 +65,11 @@ public Javadoc addBlockTag(String tagName, String content) { * parameter is "abc" * and the rest is content. */ - public Javadoc addBlockTag(String tagName, String parameter, String content) { + public Javadoc addBlockTag(String tagName, String parameter, String content) { return addBlockTag(tagName, parameter + " " + content); } - public Javadoc addBlockTag(String tagName) { + public Javadoc addBlockTag(String tagName) { return addBlockTag(tagName, ""); } @@ -77,7 +77,7 @@ public Javadoc addBlockTag(String tagName) { * Return the text content of the document. It does not containing trailing spaces and asterisks * at the start of the line. */ - public String toText() { + public String toText() { StringBuilder sb = new StringBuilder(); if (!description.isEmpty()) { sb.append(description.toText()); @@ -96,14 +96,14 @@ public String toText() { /** * Create a JavadocComment, by formatting the text of the Javadoc using no indentation (expecting the pretty printer to do the formatting.) */ - public JavadocComment toComment() { + public JavadocComment toComment() { return toComment(""); } /** * Create a JavadocComment, by formatting the text of the Javadoc using the given indentation. */ - public JavadocComment toComment(String indentation) { + public JavadocComment toComment(String indentation) { for (char c : indentation.toCharArray()) { if (!Character.isWhitespace(c)) { throw new IllegalArgumentException("The indentation string should be composed only by whitespace characters"); @@ -125,19 +125,19 @@ public JavadocComment toComment(String indentation) { return new JavadocComment(sb.toString()); } - public JavadocDescription getDescription() { + public JavadocDescription getDescription() { return description; } /** * @return the current List of associated JavadocBlockTags */ - public List getBlockTags() { + public List getBlockTags() { return this.blockTags; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -147,14 +147,14 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = description.hashCode(); result = 31 * result + blockTags.hashCode(); return result; } @Override - public String toString() { + public String toString() { return "Javadoc{" + "description=" + description + ", blockTags=" + blockTags + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/JavadocBlockTag.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/JavadocBlockTag.java index 515556d966..1f1f97541c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/JavadocBlockTag.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/JavadocBlockTag.java @@ -35,13 +35,13 @@ * {@code @since v0.0.1} * {@code @author Jim O'Java} */ -public class JavadocBlockTag { +public class JavadocBlockTag { /** * The type of tag: it could either correspond to a known tag (param, return, etc.) or represent * an unknown tag. */ - public enum Type { + public enum Type { AUTHOR, DEPRECATED, @@ -85,7 +85,7 @@ static Type fromName(String tagName) { private String tagName; - public JavadocBlockTag(Type type, String content) { + public JavadocBlockTag(Type type, String content) { this.type = type; this.tagName = type.keyword; if (type.hasName()) { @@ -95,7 +95,7 @@ public JavadocBlockTag(Type type, String content) { this.content = JavadocDescription.parseText(content); } - public JavadocBlockTag(String tagName, String content) { + public JavadocBlockTag(String tagName, String content) { this(Type.fromName(tagName), content); this.tagName = tagName; } @@ -104,23 +104,23 @@ public static JavadocBlockTag createParamBlockTag(String paramName, String conte return new JavadocBlockTag(Type.PARAM, paramName + " " + content); } - public Type getType() { + public Type getType() { return type; } - public JavadocDescription getContent() { + public JavadocDescription getContent() { return content; } - public Optional getName() { + public Optional getName() { return name; } - public String getTagName() { + public String getTagName() { return tagName; } - public String toText() { + public String toText() { StringBuilder sb = new StringBuilder(); sb.append("@"); sb.append(tagName); @@ -133,7 +133,7 @@ public String toText() { } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -147,7 +147,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = type.hashCode(); result = 31 * result + content.hashCode(); result = 31 * result + name.hashCode(); @@ -155,7 +155,7 @@ public int hashCode() { } @Override - public String toString() { + public String toString() { return "JavadocBlockTag{" + "type=" + type + ", content='" + content + '\'' + ", name=" + name + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescription.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescription.java index f49d1cec87..012fb90860 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescription.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescription.java @@ -29,7 +29,7 @@ *

    * For example This class is totally unrelated to {@link com.github.javaparser.Range} */ -public class JavadocDescription { +public class JavadocDescription { private List elements; @@ -63,35 +63,35 @@ private static Pair indexOfNextInlineTag(String text, int star return new Pair<>(index, closeIndex); } - public JavadocDescription() { + public JavadocDescription() { elements = new LinkedList<>(); } - public JavadocDescription(List elements) { + public JavadocDescription(List elements) { this(); this.elements.addAll(elements); } - public boolean addElement(JavadocDescriptionElement element) { + public boolean addElement(JavadocDescriptionElement element) { return this.elements.add(element); } - public List getElements() { + public List getElements() { return this.elements; } - public String toText() { + public String toText() { StringBuilder sb = new StringBuilder(); elements.forEach(e -> sb.append(e.toText())); return sb.toString(); } - public boolean isEmpty() { + public boolean isEmpty() { return toText().isEmpty(); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -101,12 +101,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return elements.hashCode(); } @Override - public String toString() { + public String toString() { return "JavadocDescription{" + "elements=" + elements + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescriptionElement.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescriptionElement.java index f746c556ee..fed7e85917 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescriptionElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocDescriptionElement.java @@ -25,7 +25,7 @@ *

    * So for example {@code a text} or {@link String} could be valid description elements. */ -public interface JavadocDescriptionElement { +public interface JavadocDescriptionElement { String toText(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocInlineTag.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocInlineTag.java index fcd1a9d293..1d7e3040b2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocInlineTag.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocInlineTag.java @@ -28,7 +28,7 @@ *

    * For example {@link String} */ -public class JavadocInlineTag implements JavadocDescriptionElement { +public class JavadocInlineTag implements JavadocDescriptionElement { public static JavadocDescriptionElement fromText(String text) { if (!text.startsWith("{@")) { @@ -48,7 +48,7 @@ public static JavadocDescriptionElement fromText(String text) { * The type of tag: it could either correspond to a known tag (code, docRoot, etc.) or represent * an unknown tag. */ - public enum Type { + public enum Type { CODE, DOC_ROOT, @@ -82,31 +82,31 @@ static JavadocInlineTag.Type fromName(String tagName) { private String content; - public JavadocInlineTag(String tagName, Type type, String content) { + public JavadocInlineTag(String tagName, Type type, String content) { this.tagName = tagName; this.type = type; this.content = content; } - public Type getType() { + public Type getType() { return type; } - public String getContent() { + public String getContent() { return content; } - public String getName() { + public String getName() { return tagName; } @Override - public String toText() { + public String toText() { return "{@" + tagName + this.content + "}"; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -120,7 +120,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = tagName != null ? tagName.hashCode() : 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (content != null ? content.hashCode() : 0); @@ -128,7 +128,7 @@ public int hashCode() { } @Override - public String toString() { + public String toString() { return "JavadocInlineTag{" + "tagName='" + tagName + '\'' + ", type=" + type + ", content='" + content + '\'' + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocSnippet.java b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocSnippet.java index 5511bc4593..1d10a1a698 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocSnippet.java +++ b/javaparser-core/src/main/java/com/github/javaparser/javadoc/description/JavadocSnippet.java @@ -26,11 +26,11 @@ * For example in A class totally unrelated to {@link String}, I swear! we would have two snippets: one * before and one after the inline tag ({@link String}). */ -public class JavadocSnippet implements JavadocDescriptionElement { +public class JavadocSnippet implements JavadocDescriptionElement { private String text; - public JavadocSnippet(String text) { + public JavadocSnippet(String text) { if (text == null) { throw new NullPointerException(); } @@ -38,12 +38,12 @@ public JavadocSnippet(String text) { } @Override - public String toText() { + public String toText() { return this.text; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -53,12 +53,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return text.hashCode(); } @Override - public String toString() { + public String toString() { return "JavadocSnippet{" + "text='" + text + '\'' + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/Example.java b/javaparser-core/src/main/java/com/github/javaparser/jml/Example.java index d8b3658818..2a71a69903 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/Example.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/Example.java @@ -15,7 +15,7 @@ * @author Alexander Weigl * @version 1 (2/26/21) */ -public class Example { +public class Example { public static void main(String[] args) throws FileNotFoundException { /*GeneratedJavaParserTokenManager manager = new GeneratedJavaParserTokenManager( diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocHardRemover.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocHardRemover.java index 5fe6aea60c..ddf9251094 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocHardRemover.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocHardRemover.java @@ -22,10 +22,10 @@ * @author Alexander Weigl * @version 1 (2/1/22) */ -public class JmlDocHardRemover extends Processor { +public class JmlDocHardRemover extends Processor { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (configuration.isProcessJml()) { final Optional r = result.getResult(); final Optional comments = result.getCommentsCollection(); @@ -44,19 +44,19 @@ public static class JmlDocCollectorVisitor extends ModifierVisitor { private final List docs = new LinkedList<>(); @Override - public JmlDocDeclaration visit(JmlDocDeclaration n, Void arg) { + public JmlDocDeclaration visit(JmlDocDeclaration n, Void arg) { docs.add(n); return n; } @Override - public Visitable visit(JmlDocStmt n, Void arg) { + public Visitable visit(JmlDocStmt n, Void arg) { docs.add(n); return n; } @Override - public Visitable visit(Modifier n, Void arg) { + public Visitable visit(Modifier n, Void arg) { if (n.getKeyword() instanceof JmlDocModifier) { docs.add(n); } @@ -64,7 +64,7 @@ public Visitable visit(Modifier n, Void arg) { } @Override - public JmlDocType visit(JmlDocType n, Void arg) { + public JmlDocType visit(JmlDocType n, Void arg) { docs.add(n); return n; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java index da7dbaca0d..108d95920a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlDocSanitizer.java @@ -15,13 +15,13 @@ * @author Alexander Weigl * @version 1 (11/23/21) */ -public record JmlDocSanitizer(Set enabledKeys) { +public record JmlDocSanitizer(Set enabledKeys) { - public String asString(NodeList jmlDocs) { + public String asString(NodeList jmlDocs) { return asString(jmlDocs, true); } - public String asStringJT(Collection jmlDocs, boolean emulateGlobalPosition) { + public String asStringJT(Collection jmlDocs, boolean emulateGlobalPosition) { if (jmlDocs.isEmpty()) return ""; StringConstructor s = new StringConstructor(); @@ -40,7 +40,7 @@ public String asStringJT(Collection jmlDocs, boolean emulateGlobalPo return toSanitizedString(s.getBuffer()); } - public String asString(Collection jmlDocs, boolean emulateGlobalPosition) { + public String asString(Collection jmlDocs, boolean emulateGlobalPosition) { if (jmlDocs.isEmpty()) return ""; StringConstructor s = new StringConstructor(); @@ -55,11 +55,11 @@ public String asString(Collection jmlDocs, boolean emulateGlobalPosition return toSanitizedString(s.getBuffer()); } - public String asString(NodeList jmlDocs, boolean emulateGlobalPosition) { + public String asString(NodeList jmlDocs, boolean emulateGlobalPosition) { return asStringJT(jmlDocs.stream().map(JmlDoc::getContent).toList(), emulateGlobalPosition); } - public String toSanitizedString(StringBuilder s) { + public String toSanitizedString(StringBuilder s) { cleanComments(s); cleanAtSigns(s); return s.toString(); @@ -184,7 +184,7 @@ public static boolean isActiveJmlSpec(Collection activeKeys, String[] ke return (!plusKeyFound || enabledPlusKeyFound) && !enabledNegativeKeyFound; } - public boolean isActiveJmlSpec(String[] keys) { + public boolean isActiveJmlSpec(String[] keys) { return isActiveJmlSpec(enabledKeys, keys); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlProcessor.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlProcessor.java index c9dd872f33..128417842b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlProcessor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlProcessor.java @@ -42,10 +42,10 @@ * @see ParserConfiguration#isProcessJml() * @see ParserConfiguration#getJmlKeys() */ -public class JmlProcessor extends Processor { +public class JmlProcessor extends Processor { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (configuration.isProcessJml()) { final Optional r = result.getResult(); final Optional comments = result.getCommentsCollection(); @@ -137,7 +137,7 @@ private ArbitraryNodeContainer parseJmlModifierLevel(NodeList jmlDocs) { } @Override - public JmlDocDeclaration visit(JmlDocDeclaration n, Void arg) { + public JmlDocDeclaration visit(JmlDocDeclaration n, Void arg) { processedJmlDoc.add(n); ArbitraryNodeContainer t = parseJmlClasslevel(n.getJmlComments()); if (t != null) { @@ -178,7 +178,7 @@ public JmlDocDeclaration visit(JmlDocDeclaration n, Void arg) { } @Override - public Visitable visit(JmlDocType n, Void arg) { + public Visitable visit(JmlDocType n, Void arg) { processedJmlDoc.add(n); ArbitraryNodeContainer t = parseJmlTypeLevel(n.getJmlComments()); if (t != null) { @@ -201,7 +201,7 @@ public Visitable visit(JmlDocType n, Void arg) { } @Override - public BlockStmt visit(BlockStmt n, Void arg) { + public BlockStmt visit(BlockStmt n, Void arg) { n.getContracts().accept(this, arg); for (int pos = 0; pos < n.getStatements().size(); pos++) { Statement s = n.getStatement(pos); @@ -266,7 +266,7 @@ private int handleJmlStatementLevel(BlockStmt p, JmlDocStmt n, int pos) { } @Override - public Visitable visit(Modifier n, Void arg) { + public Visitable visit(Modifier n, Void arg) { if (n.getKeyword() instanceof JmlDocModifier) { handleModifier(n); return null; diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlUtility.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlUtility.java index 7ecd98de17..fb4cc07b89 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlUtility.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlUtility.java @@ -17,7 +17,7 @@ * @author Alexander Weigl * @version 1 (13.10.22) */ -public class JmlUtility { +public class JmlUtility { public static void fixRangeContracts(@NotNull NodeWithContracts n) { Preconditions.checkNotNull(n, "Parameter n can't be null."); @@ -46,7 +46,7 @@ class NodeSpliterator implements Spliterator { private final Queue toSupply = new LinkedList<>(); - public NodeSpliterator(Node node) { + public NodeSpliterator(Node node) { toExplore.add(node); } @@ -59,7 +59,7 @@ private void explore() { } @Override - public boolean tryAdvance(Consumer action) { + public boolean tryAdvance(Consumer action) { if (toSupply.isEmpty()) { explore(); } @@ -71,7 +71,7 @@ public boolean tryAdvance(Consumer action) { } @Override - public Spliterator trySplit() { + public Spliterator trySplit() { if (!toExplore.isEmpty()) { return new NodeSpliterator(toExplore.poll()); } @@ -79,12 +79,12 @@ public Spliterator trySplit() { } @Override - public long estimateSize() { + public long estimateSize() { return 64; } @Override - public int characteristics() { + public int characteristics() { return Spliterator.NONNULL | Spliterator.IMMUTABLE; } } @@ -95,12 +95,12 @@ class NodeIterator implements Iterator { private final Queue toSupply = new LinkedList<>(); - public NodeIterator(Node node) { + public NodeIterator(Node node) { toExplore.add(node); } @Override - public Node next() { + public Node next() { if (toSupply.isEmpty()) { explore(); } @@ -110,7 +110,7 @@ public Node next() { } @Override - public boolean hasNext() { + public boolean hasNext() { return !toSupply.isEmpty() || !toExplore.isEmpty(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlWarnRemaingJmlDoc.java b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlWarnRemaingJmlDoc.java index f8693c0535..c4d3441d5d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/JmlWarnRemaingJmlDoc.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/JmlWarnRemaingJmlDoc.java @@ -17,10 +17,10 @@ * @author Alexander Weigl * @version 1 (2/1/22) */ -public class JmlWarnRemaingJmlDoc extends Processor { +public class JmlWarnRemaingJmlDoc extends Processor { @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (configuration.isProcessJml()) { final Optional r = result.getResult(); final Optional comments = result.getCommentsCollection(); @@ -36,30 +36,30 @@ public static class JmlWarnRemainingJmlDocVisitor extends GenericVisitorAdapter< private final ProblemReporter problems; - public JmlWarnRemainingJmlDocVisitor(List problems) { + public JmlWarnRemainingJmlDocVisitor(List problems) { this.problems = new ProblemReporter(problems::add); } @Override - public Void visit(JmlDocDeclaration n, Void arg) { + public Void visit(JmlDocDeclaration n, Void arg) { problems.report(n, FOUND_JML_DOCUMENTATION_COMMENT + n.getMetaModel().getTypeName()); return null; } @Override - public Void visit(JmlDocStmt n, Void arg) { + public Void visit(JmlDocStmt n, Void arg) { problems.report(n, FOUND_JML_DOCUMENTATION_COMMENT + n.getMetaModel().getTypeName()); return null; } @Override - public Void visit(JmlDoc n, Void arg) { + public Void visit(JmlDoc n, Void arg) { problems.report(n, FOUND_JML_DOCUMENTATION_COMMENT + n.getMetaModel().getTypeName()); return null; } @Override - public Void visit(Modifier n, Void arg) { + public Void visit(Modifier n, Void arg) { if (n.getKeyword() instanceof JmlDocModifier) { problems.report(n, FOUND_JML_DOCUMENTATION_COMMENT + n.getMetaModel().getTypeName()); } @@ -67,7 +67,7 @@ public Void visit(Modifier n, Void arg) { } @Override - public Void visit(JmlDocType n, Void arg) { + public Void visit(JmlDocType n, Void arg) { problems.report(n, FOUND_JML_DOCUMENTATION_COMMENT + n.getMetaModel().getTypeName()); return null; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/StringConstructor.java b/javaparser-core/src/main/java/com/github/javaparser/jml/StringConstructor.java index 46841b4224..c91898678e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/StringConstructor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/StringConstructor.java @@ -1,6 +1,6 @@ package com.github.javaparser.jml; -public class StringConstructor { +public class StringConstructor { private final StringBuilder sb = new StringBuilder(1024); @@ -9,7 +9,7 @@ public class StringConstructor { private int curColumn = 1; - public StringConstructor append(String value) { + public StringConstructor append(String value) { sb.ensureCapacity(sb.length() + value.length() + 1); for (char c : value.toCharArray()) { sb.append(c); @@ -23,7 +23,7 @@ public StringConstructor append(String value) { return this; } - public StringConstructor expandTo(int line, int column) { + public StringConstructor expandTo(int line, int column) { if (curLine > line || (curLine == line && curColumn > column)) { throw new IllegalArgumentException(); } @@ -38,11 +38,11 @@ public StringConstructor expandTo(int line, int column) { } @Override - public String toString() { + public String toString() { return sb.toString(); } - public StringBuilder getBuffer() { + public StringBuilder getBuffer() { return sb; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationConfiguration.java b/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationConfiguration.java index fae233a33b..705b3677be 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationConfiguration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationConfiguration.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Map; -public class JmlAnnotationConfiguration { +public class JmlAnnotationConfiguration { public static final String NOT_NULL = "org.jetbrains.annotations.NotNull"; @@ -14,7 +14,7 @@ public class JmlAnnotationConfiguration { private final Map annotationToModifier = new HashMap<>(); - public Map getAnnotationToModifier() { + public Map getAnnotationToModifier() { return annotationToModifier; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationSupport.java b/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationSupport.java index f16a662cc1..94222fc2e4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationSupport.java +++ b/javaparser-core/src/main/java/com/github/javaparser/jml/impl/JmlAnnotationSupport.java @@ -19,16 +19,16 @@ * @author Alexander Weigl * @version 1 (4/10/20) */ -public class JmlAnnotationSupport extends Processor { +public class JmlAnnotationSupport extends Processor { public final JmlAnnotationConfiguration configuration; - public JmlAnnotationSupport(JmlAnnotationConfiguration configuration) { + public JmlAnnotationSupport(JmlAnnotationConfiguration configuration) { this.configuration = configuration; } @Override - public void postProcess(ParseResult result, ParserConfiguration configuration) { + public void postProcess(ParseResult result, ParserConfiguration configuration) { if (result.isSuccessful()) { Map a2m = JmlAnnotationSupport.this.configuration.getAnnotationToModifier(); TreeVisitor visitor = new JmlAnnotationTranslator(a2m, result.getProblems()); @@ -43,13 +43,13 @@ class JmlAnnotationTranslator extends TreeVisitor { private final ProblemReporter problemReport; - public JmlAnnotationTranslator(Map a2m, List problems) { + public JmlAnnotationTranslator(Map a2m, List problems) { this.a2m = a2m; problemReport = new ProblemReporter(problems::add); } @Override - public void process(Node node) { + public void process(Node node) { if (node instanceof NodeWithAnnotations) { NodeWithAnnotations n = (NodeWithAnnotations) node; for (AnnotationExpr annotation : n.getAnnotations()) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java index 14c8e47ac7..3fa96e54fe 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class AnnotationDeclarationMetaModel extends TypeDeclarationMetaModel { +public class AnnotationDeclarationMetaModel extends TypeDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") AnnotationDeclarationMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationExprMetaModel.java index dd29a20cb5..32f407e51a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationExprMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class AnnotationExprMetaModel extends ExpressionMetaModel { +public class AnnotationExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") AnnotationExprMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected AnnotationExprMetaModel(Optional superNodeMetaModel super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationMemberDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationMemberDeclarationMetaModel.java index 4a244c7ab5..6dfe02e684 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationMemberDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationMemberDeclarationMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class AnnotationMemberDeclarationMetaModel extends BodyDeclarationMetaModel { +public class AnnotationMemberDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") AnnotationMemberDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, AnnotationMemberDeclaration.class, "AnnotationMemberDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel defaultValuePropertyMetaModel; + public PropertyMetaModel defaultValuePropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayAccessExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayAccessExprMetaModel.java index 2870c91a4b..ac466e9ee2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayAccessExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayAccessExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ArrayAccessExprMetaModel extends ExpressionMetaModel { +public class ArrayAccessExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ArrayAccessExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ArrayAccessExpr.class, "ArrayAccessExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel indexPropertyMetaModel; + public PropertyMetaModel indexPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationExprMetaModel.java index fda84c5643..44f0eb14b2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ArrayCreationExprMetaModel extends ExpressionMetaModel { +public class ArrayCreationExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ArrayCreationExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ArrayCreationExpr.class, "ArrayCreationExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel elementTypePropertyMetaModel; + public PropertyMetaModel elementTypePropertyMetaModel; - public PropertyMetaModel initializerPropertyMetaModel; + public PropertyMetaModel initializerPropertyMetaModel; - public PropertyMetaModel levelsPropertyMetaModel; + public PropertyMetaModel levelsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationLevelMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationLevelMetaModel.java index 5d22a09576..b42a8a5817 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationLevelMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayCreationLevelMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ArrayCreationLevelMetaModel extends NodeMetaModel { +public class ArrayCreationLevelMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ArrayCreationLevelMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ArrayCreationLevel.class, "ArrayCreationLevel", "com.github.javaparser.ast", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel dimensionPropertyMetaModel; + public PropertyMetaModel dimensionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayInitializerExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayInitializerExprMetaModel.java index 5b86923e45..bf62e4d067 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayInitializerExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayInitializerExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ArrayInitializerExprMetaModel extends ExpressionMetaModel { +public class ArrayInitializerExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ArrayInitializerExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ArrayInitializerExpr.class, "ArrayInitializerExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel valuesPropertyMetaModel; + public PropertyMetaModel valuesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayTypeMetaModel.java index 1a8c9bb5ff..95ee2670d7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ArrayTypeMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ArrayTypeMetaModel extends ReferenceTypeMetaModel { +public class ArrayTypeMetaModel extends ReferenceTypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ArrayTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ArrayType.class, "ArrayType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel componentTypePropertyMetaModel; + public PropertyMetaModel componentTypePropertyMetaModel; - public PropertyMetaModel originPropertyMetaModel; + public PropertyMetaModel originPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssertStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssertStmtMetaModel.java index ad939ceacb..22e643b9c8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssertStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssertStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class AssertStmtMetaModel extends StatementMetaModel { +public class AssertStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") AssertStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, AssertStmt.class, "AssertStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel checkPropertyMetaModel; + public PropertyMetaModel checkPropertyMetaModel; - public PropertyMetaModel messagePropertyMetaModel; + public PropertyMetaModel messagePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssignExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssignExprMetaModel.java index 291cb96fd0..d37c7e31cf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssignExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AssignExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class AssignExprMetaModel extends ExpressionMetaModel { +public class AssignExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") AssignExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, AssignExpr.class, "AssignExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel operatorPropertyMetaModel; + public PropertyMetaModel operatorPropertyMetaModel; - public PropertyMetaModel targetPropertyMetaModel; + public PropertyMetaModel targetPropertyMetaModel; - public PropertyMetaModel valuePropertyMetaModel; + public PropertyMetaModel valuePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BaseNodeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BaseNodeMetaModel.java index f77d9d151a..5af1b9f6d5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BaseNodeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BaseNodeMetaModel.java @@ -54,7 +54,7 @@ public abstract class BaseNodeMetaModel { private final boolean hasWildcard; - public BaseNodeMetaModel(Optional superNodeMetaModel, Class type, String name, String packageName, boolean isAbstract, boolean hasWildcard) { + public BaseNodeMetaModel(Optional superNodeMetaModel, Class type, String name, String packageName, boolean isAbstract, boolean hasWildcard) { this.superNodeMetaModel = superNodeMetaModel; this.type = type; this.name = name; @@ -66,14 +66,14 @@ public BaseNodeMetaModel(Optional superNodeMetaModel, Class< /** * @return is this the meta model for this node class? */ - public boolean is(Class c) { + public boolean is(Class c) { return type.equals(c); } /** * @return package name + class name */ - public String getQualifiedClassName() { + public String getQualifiedClassName() { return packageName + "." + name; } @@ -81,7 +81,7 @@ public String getQualifiedClassName() { * @return the meta model for the node that this node extends. Note that this is to be used to find properties * defined in superclasses of a Node. */ - public Optional getSuperNodeMetaModel() { + public Optional getSuperNodeMetaModel() { return superNodeMetaModel; } @@ -89,11 +89,11 @@ public Optional getSuperNodeMetaModel() { * @return a list of all properties declared directly in this node (not its parent nodes.) These are also available * as fields. */ - public List getDeclaredPropertyMetaModels() { + public List getDeclaredPropertyMetaModels() { return declaredPropertyMetaModels; } - public List getDerivedPropertyMetaModels() { + public List getDerivedPropertyMetaModels() { return derivedPropertyMetaModels; } @@ -101,7 +101,7 @@ public List getDerivedPropertyMetaModels() { * @return a list of all properties that describe the parameters to the all-fields (but not "range" and "comment") * constructor, in the order of appearance in the constructor parameter list. */ - public List getConstructorParameters() { + public List getConstructorParameters() { return constructorParameters; } @@ -109,7 +109,7 @@ public List getConstructorParameters() { * @return a list of all properties in this node and its parents. Note that a new list is created every time this * method is called. */ - public List getAllPropertyMetaModels() { + public List getAllPropertyMetaModels() { List allPropertyMetaModels = new ArrayList<>(getDeclaredPropertyMetaModels()); BaseNodeMetaModel walkNode = this; while (walkNode.getSuperNodeMetaModel().isPresent()) { @@ -119,7 +119,7 @@ public List getAllPropertyMetaModels() { return allPropertyMetaModels; } - public boolean isInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel) { + public boolean isInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel) { if (this == baseMetaModel) { return true; } @@ -132,40 +132,40 @@ public boolean isInstanceOfMetaModel(BaseNodeMetaModel baseMetaModel) { /** * @return the class for this AST node type. */ - public Class getType() { + public Class getType() { return type; } /** * @return the package containing this AST node class. */ - public String getPackageName() { + public String getPackageName() { return packageName; } /** * @return whether this AST node is abstract. */ - public boolean isAbstract() { + public boolean isAbstract() { return isAbstract; } /** * @return whether this AST node has a <?> at the end of its type. */ - public boolean hasWildcard() { + public boolean hasWildcard() { return hasWildcard; } /** * @return whether this AST node is the root node, meaning that it is the meta model for "Node": "NodeMetaModel". */ - public boolean isRootNode() { + public boolean isRootNode() { return !superNodeMetaModel.isPresent(); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -177,19 +177,19 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return type.hashCode(); } @Override - public String toString() { + public String toString() { return name; } /** * @return the type name, with generics. */ - public String getTypeNameGenerified() { + public String getTypeNameGenerified() { if (hasWildcard) { return getTypeName() + ""; } @@ -199,14 +199,14 @@ public String getTypeNameGenerified() { /** * @return the raw type name, so nothing but the name. */ - public String getTypeName() { + public String getTypeName() { return type.getSimpleName(); } /** * The name of the field in JavaParserMetaModel for this node meta model. */ - public String getMetaModelFieldName() { + public String getMetaModelFieldName() { return decapitalize(getClass().getSimpleName()); } @@ -216,7 +216,7 @@ public String getMetaModelFieldName() { * @param parameters a map of propertyName -> value. * This should at least contain a pair for every required property for this node. */ - public Node construct(Map parameters) { + public Node construct(Map parameters) { for (Constructor constructor : getType().getConstructors()) { if (constructor.getAnnotation(AllFieldsConstructor.class) != null) { try { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BinaryExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BinaryExprMetaModel.java index 04562febd7..443744f832 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BinaryExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BinaryExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BinaryExprMetaModel extends ExpressionMetaModel { +public class BinaryExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BinaryExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, BinaryExpr.class, "BinaryExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel leftPropertyMetaModel; + public PropertyMetaModel leftPropertyMetaModel; - public PropertyMetaModel operatorPropertyMetaModel; + public PropertyMetaModel operatorPropertyMetaModel; - public PropertyMetaModel rightPropertyMetaModel; + public PropertyMetaModel rightPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockCommentMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockCommentMetaModel.java index e0b18a7c15..154006338b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockCommentMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockCommentMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BlockCommentMetaModel extends CommentMetaModel { +public class BlockCommentMetaModel extends CommentMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BlockCommentMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockStmtMetaModel.java index 8f6df1263e..5b0886f0ae 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BlockStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BlockStmtMetaModel extends StatementMetaModel { +public class BlockStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BlockStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, BlockStmt.class, "BlockStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; - public PropertyMetaModel statementsPropertyMetaModel; + public PropertyMetaModel statementsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BodyDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BodyDeclarationMetaModel.java index bc3a5ee6c1..ec0f5a4dcd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BodyDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BodyDeclarationMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BodyDeclarationMetaModel extends NodeMetaModel { +public class BodyDeclarationMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BodyDeclarationMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected BodyDeclarationMetaModel(Optional superNodeMetaMode super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BooleanLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BooleanLiteralExprMetaModel.java index 5e977b298d..53b03b57d1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BooleanLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BooleanLiteralExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BooleanLiteralExprMetaModel extends LiteralExprMetaModel { +public class BooleanLiteralExprMetaModel extends LiteralExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BooleanLiteralExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, BooleanLiteralExpr.class, "BooleanLiteralExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel valuePropertyMetaModel; + public PropertyMetaModel valuePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreakStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreakStmtMetaModel.java index 900dc3818d..1ce94f158b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreakStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreakStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BreakStmtMetaModel extends StatementMetaModel { +public class BreakStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BreakStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, BreakStmt.class, "BreakStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreaksClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreaksClauseMetaModel.java index ff6b096ed7..65babea470 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreaksClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/BreaksClauseMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class BreaksClauseMetaModel extends JmlClauseMetaModel { +public class BreaksClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") BreaksClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClauseLabel.class, "BreaksClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel exprPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableClauseMetaModel.java index 697d33b9c7..58cb67abb5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableClauseMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CallableClauseMetaModel extends JmlClauseMetaModel { +public class CallableClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CallableClauseMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableDeclarationMetaModel.java index a07416e01a..9bd72dc904 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableDeclarationMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CallableDeclarationMetaModel extends BodyDeclarationMetaModel { +public class CallableDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CallableDeclarationMetaModel(Optional superBaseNodeMetaModel) { @@ -47,17 +47,17 @@ protected CallableDeclarationMetaModel(Optional superNodeMeta super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel parametersPropertyMetaModel; + public PropertyMetaModel parametersPropertyMetaModel; - public PropertyMetaModel receiverParameterPropertyMetaModel; + public PropertyMetaModel receiverParameterPropertyMetaModel; - public PropertyMetaModel thrownExceptionsPropertyMetaModel; + public PropertyMetaModel thrownExceptionsPropertyMetaModel; - public PropertyMetaModel typeParametersPropertyMetaModel; + public PropertyMetaModel typeParametersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableMetaModel.java index ec5b220ff0..b113ffee4c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CallableMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CallableMetaModel extends JmlClauseMetaModel { +public class CallableMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CallableMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CastExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CastExprMetaModel.java index b180eae32c..8966f4598f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CastExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CastExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CastExprMetaModel extends ExpressionMetaModel { +public class CastExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CastExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, CastExpr.class, "CastExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CatchClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CatchClauseMetaModel.java index b83fa11c4f..6d469c0eac 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CatchClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CatchClauseMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CatchClauseMetaModel extends NodeMetaModel { +public class CatchClauseMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CatchClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, CatchClause.class, "CatchClause", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel parameterPropertyMetaModel; + public PropertyMetaModel parameterPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CharLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CharLiteralExprMetaModel.java index bdb14ac7ee..03c38da9b0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CharLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CharLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CharLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class CharLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CharLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassExprMetaModel.java index b0925aeb31..698eb3d53c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ClassExprMetaModel extends ExpressionMetaModel { +public class ClassExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ClassExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ClassExpr.class, "ClassExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java index 11f9288751..0a9691b68b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassInvariantClauseMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ClassInvariantClauseMetaModel extends JmlClassLevelMetaModel { +public class ClassInvariantClauseMetaModel extends JmlClassLevelMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ClassInvariantClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClassExprDeclaration.class, "ClassInvariantClause", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel invariantPropertyMetaModel; + public PropertyMetaModel invariantPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceDeclarationMetaModel.java index fba654515a..1bf3ebb598 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceDeclarationMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ClassOrInterfaceDeclarationMetaModel extends TypeDeclarationMetaModel { +public class ClassOrInterfaceDeclarationMetaModel extends TypeDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ClassOrInterfaceDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ClassOrInterfaceDeclaration.class, "ClassOrInterfaceDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel extendedTypesPropertyMetaModel; + public PropertyMetaModel extendedTypesPropertyMetaModel; - public PropertyMetaModel implementedTypesPropertyMetaModel; + public PropertyMetaModel implementedTypesPropertyMetaModel; - public PropertyMetaModel isInterfacePropertyMetaModel; + public PropertyMetaModel isInterfacePropertyMetaModel; - public PropertyMetaModel permittedTypesPropertyMetaModel; + public PropertyMetaModel permittedTypesPropertyMetaModel; - public PropertyMetaModel typeParametersPropertyMetaModel; + public PropertyMetaModel typeParametersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceTypeMetaModel.java index 5949cb00f2..75e200564c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ClassOrInterfaceTypeMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ClassOrInterfaceTypeMetaModel extends ReferenceTypeMetaModel { +public class ClassOrInterfaceTypeMetaModel extends ReferenceTypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ClassOrInterfaceTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ClassOrInterfaceType.class, "ClassOrInterfaceType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel scopePropertyMetaModel; + public PropertyMetaModel scopePropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CommentMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CommentMetaModel.java index 1f0a51f83f..db8227dc91 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CommentMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CommentMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CommentMetaModel extends NodeMetaModel { +public class CommentMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CommentMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected CommentMetaModel(Optional superNodeMetaModel, Class super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel contentPropertyMetaModel; + public PropertyMetaModel contentPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompactConstructorDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompactConstructorDeclarationMetaModel.java index e9bab7579c..eaa8252794 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompactConstructorDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompactConstructorDeclarationMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CompactConstructorDeclarationMetaModel extends BodyDeclarationMetaModel { +public class CompactConstructorDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CompactConstructorDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, CompactConstructorDeclaration.class, "CompactConstructorDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel thrownExceptionsPropertyMetaModel; + public PropertyMetaModel thrownExceptionsPropertyMetaModel; - public PropertyMetaModel typeParametersPropertyMetaModel; + public PropertyMetaModel typeParametersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompilationUnitMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompilationUnitMetaModel.java index 8a761e7535..2c5740114b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompilationUnitMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/CompilationUnitMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class CompilationUnitMetaModel extends NodeMetaModel { +public class CompilationUnitMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") CompilationUnitMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, CompilationUnit.class, "CompilationUnit", "com.github.javaparser.ast", false, false); } - public PropertyMetaModel importsPropertyMetaModel; + public PropertyMetaModel importsPropertyMetaModel; - public PropertyMetaModel modulePropertyMetaModel; + public PropertyMetaModel modulePropertyMetaModel; - public PropertyMetaModel packageDeclarationPropertyMetaModel; + public PropertyMetaModel packageDeclarationPropertyMetaModel; - public PropertyMetaModel typesPropertyMetaModel; + public PropertyMetaModel typesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConditionalExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConditionalExprMetaModel.java index d5dbab4c7e..39538f37a7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConditionalExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConditionalExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ConditionalExprMetaModel extends ExpressionMetaModel { +public class ConditionalExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ConditionalExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ConditionalExpr.class, "ConditionalExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel conditionPropertyMetaModel; + public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel elseExprPropertyMetaModel; + public PropertyMetaModel elseExprPropertyMetaModel; - public PropertyMetaModel thenExprPropertyMetaModel; + public PropertyMetaModel thenExprPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConstructorDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConstructorDeclarationMetaModel.java index f1b92dba10..157dccf48f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConstructorDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ConstructorDeclarationMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ConstructorDeclarationMetaModel extends CallableDeclarationMetaModel { +public class ConstructorDeclarationMetaModel extends CallableDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ConstructorDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ConstructorDeclaration.class, "ConstructorDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ContinueStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ContinueStmtMetaModel.java index e10d0d371f..585d7c571a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ContinueStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ContinueStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ContinueStmtMetaModel extends StatementMetaModel { +public class ContinueStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ContinueStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ContinueStmt.class, "ContinueStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DerivedProperty.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DerivedProperty.java index 9e2a28b2e2..5e3effb9a7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DerivedProperty.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DerivedProperty.java @@ -33,5 +33,5 @@ */ @Retention(RUNTIME) @Target(METHOD) -public @interface DerivedProperty { +public @interface DerivedProperty { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoStmtMetaModel.java index 48b947671d..abd408fcaf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoStmtMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class DoStmtMetaModel extends StatementMetaModel { +public class DoStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") DoStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, DoStmt.class, "DoStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel conditionPropertyMetaModel; + public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoubleLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoubleLiteralExprMetaModel.java index c551df633e..e6a51f516a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoubleLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/DoubleLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class DoubleLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class DoubleLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") DoubleLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EmptyStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EmptyStmtMetaModel.java index 0b35676222..d0376c4ef1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EmptyStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EmptyStmtMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class EmptyStmtMetaModel extends StatementMetaModel { +public class EmptyStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") EmptyStmtMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnclosedExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnclosedExprMetaModel.java index 888af08012..56f63a8c69 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnclosedExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnclosedExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class EnclosedExprMetaModel extends ExpressionMetaModel { +public class EnclosedExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") EnclosedExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, EnclosedExpr.class, "EnclosedExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel innerPropertyMetaModel; + public PropertyMetaModel innerPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumConstantDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumConstantDeclarationMetaModel.java index 254f90900e..955f4a88b0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumConstantDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumConstantDeclarationMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class EnumConstantDeclarationMetaModel extends BodyDeclarationMetaModel { +public class EnumConstantDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") EnumConstantDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, EnumConstantDeclaration.class, "EnumConstantDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel argumentsPropertyMetaModel; + public PropertyMetaModel argumentsPropertyMetaModel; - public PropertyMetaModel classBodyPropertyMetaModel; + public PropertyMetaModel classBodyPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumDeclarationMetaModel.java index 1a3650abd0..58fb98e7f2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/EnumDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class EnumDeclarationMetaModel extends TypeDeclarationMetaModel { +public class EnumDeclarationMetaModel extends TypeDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") EnumDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, EnumDeclaration.class, "EnumDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel entriesPropertyMetaModel; + public PropertyMetaModel entriesPropertyMetaModel; - public PropertyMetaModel implementedTypesPropertyMetaModel; + public PropertyMetaModel implementedTypesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExplicitConstructorInvocationStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExplicitConstructorInvocationStmtMetaModel.java index 6a0971527b..5dc734232b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExplicitConstructorInvocationStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExplicitConstructorInvocationStmtMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ExplicitConstructorInvocationStmtMetaModel extends StatementMetaModel { +public class ExplicitConstructorInvocationStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ExplicitConstructorInvocationStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ExplicitConstructorInvocationStmt.class, "ExplicitConstructorInvocationStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel argumentsPropertyMetaModel; + public PropertyMetaModel argumentsPropertyMetaModel; - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel isThisPropertyMetaModel; + public PropertyMetaModel isThisPropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionMetaModel.java index 5962c9aaab..0480e393a4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ExpressionMetaModel extends NodeMetaModel { +public class ExpressionMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ExpressionMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionStmtMetaModel.java index 45d0a03494..e96f5fa609 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ExpressionStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ExpressionStmtMetaModel extends StatementMetaModel { +public class ExpressionStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ExpressionStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ExpressionStmt.class, "ExpressionStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldAccessExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldAccessExprMetaModel.java index 7625ddec10..a6d80a3e05 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldAccessExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldAccessExprMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class FieldAccessExprMetaModel extends ExpressionMetaModel { +public class FieldAccessExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") FieldAccessExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, FieldAccessExpr.class, "FieldAccessExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel scopePropertyMetaModel; + public PropertyMetaModel scopePropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldDeclarationMetaModel.java index 7d23053514..c2008b88c8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/FieldDeclarationMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class FieldDeclarationMetaModel extends BodyDeclarationMetaModel { +public class FieldDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") FieldDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, FieldDeclaration.class, "FieldDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; - public PropertyMetaModel maximumCommonTypePropertyMetaModel; + public PropertyMetaModel maximumCommonTypePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForEachStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForEachStmtMetaModel.java index c91a7afa9f..f8efe987b8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForEachStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForEachStmtMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ForEachStmtMetaModel extends StatementMetaModel { +public class ForEachStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ForEachStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ForEachStmt.class, "ForEachStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; - public PropertyMetaModel iterablePropertyMetaModel; + public PropertyMetaModel iterablePropertyMetaModel; - public PropertyMetaModel variablePropertyMetaModel; + public PropertyMetaModel variablePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForStmtMetaModel.java index 58581c5a6a..5e3697e53a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForStmtMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ForStmtMetaModel extends StatementMetaModel { +public class ForStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ForStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ForStmt.class, "ForStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel comparePropertyMetaModel; + public PropertyMetaModel comparePropertyMetaModel; - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; - public PropertyMetaModel initializationPropertyMetaModel; + public PropertyMetaModel initializationPropertyMetaModel; - public PropertyMetaModel updatePropertyMetaModel; + public PropertyMetaModel updatePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForallClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForallClauseMetaModel.java index c9f9be6bba..bd0d47e4a0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForallClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ForallClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ForallClauseMetaModel extends JmlClauseMetaModel { +public class ForallClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ForallClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlForallClause.class, "ForallClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IfStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IfStmtMetaModel.java index eb254c92ba..5386197e18 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IfStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IfStmtMetaModel.java @@ -34,24 +34,24 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class IfStmtMetaModel extends StatementMetaModel { +public class IfStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") IfStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, IfStmt.class, "IfStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel conditionPropertyMetaModel; + public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel elseStmtPropertyMetaModel; + public PropertyMetaModel elseStmtPropertyMetaModel; - public PropertyMetaModel thenStmtPropertyMetaModel; + public PropertyMetaModel thenStmtPropertyMetaModel; - public PropertyMetaModel cascadingIfStmtPropertyMetaModel; + public PropertyMetaModel cascadingIfStmtPropertyMetaModel; - public PropertyMetaModel elseBlockPropertyMetaModel; + public PropertyMetaModel elseBlockPropertyMetaModel; - public PropertyMetaModel elseBranchPropertyMetaModel; + public PropertyMetaModel elseBranchPropertyMetaModel; - public PropertyMetaModel thenBlockPropertyMetaModel; + public PropertyMetaModel thenBlockPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ImportDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ImportDeclarationMetaModel.java index 04080b033d..0c991e35e5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ImportDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ImportDeclarationMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ImportDeclarationMetaModel extends NodeMetaModel { +public class ImportDeclarationMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ImportDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ImportDeclaration.class, "ImportDeclaration", "com.github.javaparser.ast", false, false); } - public PropertyMetaModel isAsteriskPropertyMetaModel; + public PropertyMetaModel isAsteriskPropertyMetaModel; - public PropertyMetaModel isJmlModelPropertyMetaModel; + public PropertyMetaModel isJmlModelPropertyMetaModel; - public PropertyMetaModel isStaticPropertyMetaModel; + public PropertyMetaModel isStaticPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InitializerDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InitializerDeclarationMetaModel.java index 56b3fefa4b..7055226817 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InitializerDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InitializerDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class InitializerDeclarationMetaModel extends BodyDeclarationMetaModel { +public class InitializerDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") InitializerDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, InitializerDeclaration.class, "InitializerDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel isStaticPropertyMetaModel; + public PropertyMetaModel isStaticPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InstanceOfExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InstanceOfExprMetaModel.java index a6b9f11259..72eebbaf8f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InstanceOfExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InstanceOfExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class InstanceOfExprMetaModel extends ExpressionMetaModel { +public class InstanceOfExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") InstanceOfExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, InstanceOfExpr.class, "InstanceOfExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel patternPropertyMetaModel; + public PropertyMetaModel patternPropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntegerLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntegerLiteralExprMetaModel.java index 7ab32b0218..181f45e641 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntegerLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntegerLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class IntegerLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class IntegerLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") IntegerLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InternalProperty.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InternalProperty.java index 24d69a6748..d5252b6181 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/InternalProperty.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/InternalProperty.java @@ -32,5 +32,5 @@ */ @Retention(RUNTIME) @Target(FIELD) -public @interface InternalProperty { +public @interface InternalProperty { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntersectionTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntersectionTypeMetaModel.java index 3c14ed72a1..d6566f9379 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntersectionTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/IntersectionTypeMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class IntersectionTypeMetaModel extends TypeMetaModel { +public class IntersectionTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") IntersectionTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, IntersectionType.class, "IntersectionType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel elementsPropertyMetaModel; + public PropertyMetaModel elementsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavadocCommentMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavadocCommentMetaModel.java index da5560bcc0..35a68513a0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavadocCommentMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JavadocCommentMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JavadocCommentMetaModel extends CommentMetaModel { +public class JavadocCommentMetaModel extends CommentMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JavadocCommentMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlAssertStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlAssertStmtMetaModel.java index fc3d033c8c..63103b6936 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlAssertStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlAssertStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlAssertStmtMetaModel extends JmlStatementMetaModel { +public class JmlAssertStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlAssertStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlExpressionStmt.class, "JmlAssertStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBeginStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBeginStmtMetaModel.java index 7c4e9fdb4f..9f69caf338 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBeginStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBeginStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlBeginStmtMetaModel extends JmlStatementMetaModel { +public class JmlBeginStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlBeginStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlBeginStmt.class, "JmlBeginStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBinaryInfixExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBinaryInfixExprMetaModel.java index 06d9a75346..c6940fa0a4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBinaryInfixExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBinaryInfixExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlBinaryInfixExprMetaModel extends ExpressionMetaModel { +public class JmlBinaryInfixExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlBinaryInfixExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlBinaryInfixExpr.class, "JmlBinaryInfixExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel leftPropertyMetaModel; + public PropertyMetaModel leftPropertyMetaModel; - public PropertyMetaModel operatorPropertyMetaModel; + public PropertyMetaModel operatorPropertyMetaModel; - public PropertyMetaModel rightPropertyMetaModel; + public PropertyMetaModel rightPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBindingExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBindingExprMetaModel.java index 0ad2fd1551..afb24d1a91 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBindingExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBindingExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlBindingExprMetaModel extends ExpressionMetaModel { +public class JmlBindingExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlBindingExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlQuantifiedExpr.class, "JmlBindingExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel binderPropertyMetaModel; + public PropertyMetaModel binderPropertyMetaModel; - public PropertyMetaModel expressionsPropertyMetaModel; + public PropertyMetaModel expressionsPropertyMetaModel; - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlCallableClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlCallableClauseMetaModel.java index 0fe3b0647e..ac43883409 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlCallableClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlCallableClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlCallableClauseMetaModel extends JmlClauseMetaModel { +public class JmlCallableClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlCallableClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlCallableClause.class, "JmlCallableClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel methodSignaturesPropertyMetaModel; + public PropertyMetaModel methodSignaturesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassAccessibleDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassAccessibleDeclarationMetaModel.java index 3bce6d5d0c..a12f80b7b5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassAccessibleDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassAccessibleDeclarationMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClassAccessibleDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { +public class JmlClassAccessibleDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClassAccessibleDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClassAccessibleDeclaration.class, "JmlClassAccessibleDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel expressionsPropertyMetaModel; + public PropertyMetaModel expressionsPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel measuredByPropertyMetaModel; + public PropertyMetaModel measuredByPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel variablePropertyMetaModel; + public PropertyMetaModel variablePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassExprDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassExprDeclarationMetaModel.java index 9500382a7e..5eb5fe089a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassExprDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassExprDeclarationMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClassExprDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { +public class JmlClassExprDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClassExprDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClassExprDeclaration.class, "JmlClassExprDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel invariantPropertyMetaModel; + public PropertyMetaModel invariantPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassInvariantDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassInvariantDeclarationMetaModel.java index 2dbd72fa6d..6dce997976 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassInvariantDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassInvariantDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClassInvariantDeclarationMetaModel extends JmlClassLevelMetaModel { +public class JmlClassInvariantDeclarationMetaModel extends JmlClassLevelMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClassInvariantDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClassExprDeclaration.class, "JmlClassInvariantDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel invariantPropertyMetaModel; + public PropertyMetaModel invariantPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelDeclarationMetaModel.java index 9e606f767b..841047d88e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelDeclarationMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClassLevelDeclarationMetaModel extends BodyDeclarationMetaModel { +public class JmlClassLevelDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClassLevelDeclarationMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelMetaModel.java index 7846ef227a..06a13c22a7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClassLevelMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClassLevelMetaModel extends BodyDeclarationMetaModel { +public class JmlClassLevelMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClassLevelMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java index 4d929b889a..1ba0bf89f2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseIfMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClauseIfMetaModel extends JmlClauseMetaModel { +public class JmlClauseIfMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClauseIfMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClauseIf.class, "JmlClauseIf", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel conditionPropertyMetaModel; + public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; - public PropertyMetaModel thenPropertyMetaModel; + public PropertyMetaModel thenPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLEMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLEMetaModel.java index a3828da64f..3dc7b52045 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLEMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLEMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClauseLEMetaModel extends JmlClauseMetaModel { +public class JmlClauseLEMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClauseLEMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClauseLabel.class, "JmlClauseLE", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel exprPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java index d01e273805..fb844d2c80 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseLabelMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClauseLabelMetaModel extends JmlClauseMetaModel { +public class JmlClauseLabelMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClauseLabelMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlClauseLabel.class, "JmlClauseLabel", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel exprPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseMetaModel.java index b5f8ed92a8..d2f5556aae 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlClauseMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlClauseMetaModel extends NodeMetaModel { +public class JmlClauseMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlClauseMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected JmlClauseMetaModel(Optional superNodeMetaModel, Cla super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlContractMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlContractMetaModel.java index 7150efbd45..993efe6cc2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlContractMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlContractMetaModel.java @@ -34,24 +34,24 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlContractMetaModel extends NodeMetaModel { +public class JmlContractMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlContractMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlContract.class, "JmlContract", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel behaviorPropertyMetaModel; + public PropertyMetaModel behaviorPropertyMetaModel; - public PropertyMetaModel clausesPropertyMetaModel; + public PropertyMetaModel clausesPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel subContractsPropertyMetaModel; + public PropertyMetaModel subContractsPropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDefaultClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDefaultClauseMetaModel.java index ff1e1d1775..d1d1d00d16 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDefaultClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDefaultClauseMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDefaultClauseMetaModel extends JmlClauseMetaModel { +public class JmlDefaultClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDefaultClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSimpleExprClause.class, "JmlDefaultClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel heapsPropertyMetaModel; + public PropertyMetaModel heapsPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocDeclarationMetaModel.java index 4f69e4a4bc..ac72a8263f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocDeclarationMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDocDeclarationMetaModel extends BodyDeclarationMetaModel { +public class JmlDocDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDocDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlDocDeclaration.class, "JmlDocDeclaration", "com.github.javaparser.ast.jml.doc", false, false); } - public PropertyMetaModel jmlCommentsPropertyMetaModel; + public PropertyMetaModel jmlCommentsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocMetaModel.java index 97cc4a4f35..d8f4d6cc81 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDocMetaModel extends NodeMetaModel { +public class JmlDocMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDocMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlDoc.class, "JmlDoc", "com.github.javaparser.ast.jml.doc", false, false); } - public PropertyMetaModel contentPropertyMetaModel; + public PropertyMetaModel contentPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocModifierMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocModifierMetaModel.java index c8d5e5ce2b..368c1750d1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocModifierMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocModifierMetaModel.java @@ -33,12 +33,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDocModifierMetaModel extends ModifierMetaModel { +public class JmlDocModifierMetaModel extends ModifierMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDocModifierMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel); } - public PropertyMetaModel jmlCommentsPropertyMetaModel; + public PropertyMetaModel jmlCommentsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocStmtMetaModel.java index 5132aa3cfc..6ddb15962d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDocStmtMetaModel extends StatementMetaModel { +public class JmlDocStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDocStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlDocStmt.class, "JmlDocStmt", "com.github.javaparser.ast.jml.doc", false, false); } - public PropertyMetaModel jmlCommentsPropertyMetaModel; + public PropertyMetaModel jmlCommentsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocTypeMetaModel.java index 715d903ca0..61dd17fce7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlDocTypeMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlDocTypeMetaModel extends TypeDeclarationMetaModel { +public class JmlDocTypeMetaModel extends TypeDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlDocTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlDocType.class, "JmlDocType", "com.github.javaparser.ast.jml.doc", false, false); } - public PropertyMetaModel jmlCommentsPropertyMetaModel; + public PropertyMetaModel jmlCommentsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlEndStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlEndStmtMetaModel.java index f37b14d316..23a01b3c2a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlEndStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlEndStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlEndStmtMetaModel extends JmlStatementMetaModel { +public class JmlEndStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlEndStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlEndStmt.class, "JmlEndStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlExpressionStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlExpressionStmtMetaModel.java index 5f212a2247..31755e5e40 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlExpressionStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlExpressionStmtMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlExpressionStmtMetaModel extends JmlStatementMetaModel { +public class JmlExpressionStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlExpressionStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlExpressionStmt.class, "JmlExpressionStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlFieldDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlFieldDeclarationMetaModel.java index 1e5a40d32d..1eb5c5eb70 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlFieldDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlFieldDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlFieldDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { +public class JmlFieldDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlFieldDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlFieldDeclaration.class, "JmlFieldDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel declPropertyMetaModel; + public PropertyMetaModel declPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlForallClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlForallClauseMetaModel.java index 9f55cbc60b..78dd442f6c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlForallClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlForallClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlForallClauseMetaModel extends JmlClauseMetaModel { +public class JmlForallClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlForallClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlForallClause.class, "JmlForallClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel boundedVariablesPropertyMetaModel; + public PropertyMetaModel boundedVariablesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementMetaModel.java index 2f0e6b2a3c..0abb6b4b13 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlGhostStatementMetaModel extends JmlStatementMetaModel { +public class JmlGhostStatementMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlGhostStatementMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlGhostStmt.class, "JmlGhostStatement", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel statementPropertyMetaModel; + public PropertyMetaModel statementPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementsMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementsMetaModel.java index 8095219dda..c1d1e5b8d0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementsMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStatementsMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlGhostStatementsMetaModel extends JmlStatementMetaModel { +public class JmlGhostStatementsMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlGhostStatementsMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlGhostStmt.class, "JmlGhostStatements", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel statementsPropertyMetaModel; + public PropertyMetaModel statementsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStmtMetaModel.java index 89daa835de..aa8ca5972e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlGhostStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlGhostStmtMetaModel extends JmlStatementMetaModel { +public class JmlGhostStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlGhostStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlGhostStmt.class, "JmlGhostStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel statementPropertyMetaModel; + public PropertyMetaModel statementPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelExprMetaModel.java index b16edb91f7..7ee44c1612 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlLabelExprMetaModel extends ExpressionMetaModel { +public class JmlLabelExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlLabelExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlLabelExpr.class, "JmlLabelExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelMetaModel.java index 8631dcb916..bc8b23215a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlLabelMetaModel extends ExpressionMetaModel { +public class JmlLabelMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlLabelMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlLabelExpr.class, "JmlLabel", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelStmtMetaModel.java index c530607f20..4445a4ea6b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLabelStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlLabelStmtMetaModel extends JmlStatementMetaModel { +public class JmlLabelStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlLabelStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlLabelStmt.class, "JmlLabelStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLetExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLetExprMetaModel.java index 5c93a03afc..b8645d357c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLetExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlLetExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlLetExprMetaModel extends ExpressionMetaModel { +public class JmlLetExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlLetExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlLetExpr.class, "JmlLetExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodDeclarationMetaModel.java index 01f4abfe64..c3c89402b7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodDeclarationMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlMethodDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { +public class JmlMethodDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlMethodDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlMethodDeclaration.class, "JmlMethodDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel contractPropertyMetaModel; + public PropertyMetaModel contractPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel methodDeclarationPropertyMetaModel; + public PropertyMetaModel methodDeclarationPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodSignatureMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodSignatureMetaModel.java index ba2a9bc3cb..586a439ead 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodSignatureMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMethodSignatureMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlMethodSignatureMetaModel extends NodeMetaModel { +public class JmlMethodSignatureMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlMethodSignatureMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlMethodSignature.class, "JmlMethodSignature", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel argumentTypesPropertyMetaModel; + public PropertyMetaModel argumentTypesPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel receiverPropertyMetaModel; + public PropertyMetaModel receiverPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiCompareExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiCompareExprMetaModel.java index 5ac73e8923..3f465da67e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiCompareExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiCompareExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlMultiCompareExprMetaModel extends ExpressionMetaModel { +public class JmlMultiCompareExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlMultiCompareExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlMultiCompareExpr.class, "JmlMultiCompareExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel expressionsPropertyMetaModel; + public PropertyMetaModel expressionsPropertyMetaModel; - public PropertyMetaModel operatorsPropertyMetaModel; + public PropertyMetaModel operatorsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiExprClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiExprClauseMetaModel.java index 18fe4f28a9..6435fb6bd6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiExprClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlMultiExprClauseMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlMultiExprClauseMetaModel extends JmlClauseMetaModel { +public class JmlMultiExprClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlMultiExprClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlMultiExprClause.class, "JmlMultiExprClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel expressionsPropertyMetaModel; + public PropertyMetaModel expressionsPropertyMetaModel; - public PropertyMetaModel heapsPropertyMetaModel; + public PropertyMetaModel heapsPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlOldClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlOldClauseMetaModel.java index 21db671701..2bc5e8dafd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlOldClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlOldClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlOldClauseMetaModel extends JmlClauseMetaModel { +public class JmlOldClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlOldClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlOldClause.class, "JmlOldClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel declarationsPropertyMetaModel; + public PropertyMetaModel declarationsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlQuantifiedExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlQuantifiedExprMetaModel.java index eed845aba5..fa6dde646c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlQuantifiedExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlQuantifiedExprMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlQuantifiedExprMetaModel extends ExpressionMetaModel { +public class JmlQuantifiedExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlQuantifiedExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlQuantifiedExpr.class, "JmlQuantifiedExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel binderPropertyMetaModel; + public PropertyMetaModel binderPropertyMetaModel; - public PropertyMetaModel expressionsPropertyMetaModel; + public PropertyMetaModel expressionsPropertyMetaModel; - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRefiningStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRefiningStmtMetaModel.java index d9b7e622ae..cd59527579 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRefiningStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRefiningStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlRefiningStmtMetaModel extends JmlStatementMetaModel { +public class JmlRefiningStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlRefiningStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlRefiningStmt.class, "JmlRefiningStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRepresentsDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRepresentsDeclarationMetaModel.java index 67c8e91b69..7f98b45e67 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRepresentsDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlRepresentsDeclarationMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlRepresentsDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { +public class JmlRepresentsDeclarationMetaModel extends JmlClassLevelDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlRepresentsDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlRepresentsDeclaration.class, "JmlRepresentsDeclaration", "com.github.javaparser.ast.jml.body", false, false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel exprPropertyMetaModel; - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionExprMetaModel.java index eb50ffd75f..387c8d8fac 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlSetComprehensionExprMetaModel extends ExpressionMetaModel { +public class JmlSetComprehensionExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlSetComprehensionExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSetComprehensionExpr.class, "JmlSetComprehensionExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel bindingPropertyMetaModel; + public PropertyMetaModel bindingPropertyMetaModel; - public PropertyMetaModel predicatePropertyMetaModel; + public PropertyMetaModel predicatePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionMetaModel.java index 14b8605ea6..662500d981 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSetComprehensionMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlSetComprehensionMetaModel extends ExpressionMetaModel { +public class JmlSetComprehensionMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlSetComprehensionMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSetComprehensionExpr.class, "JmlSetComprehensionExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel bindingPropertyMetaModel; + public PropertyMetaModel bindingPropertyMetaModel; - public PropertyMetaModel predicatePropertyMetaModel; + public PropertyMetaModel predicatePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsClauseMetaModel.java index 361c2fe7c5..a6e47c8ec1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsClauseMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlSignalsClauseMetaModel extends JmlClauseMetaModel { +public class JmlSignalsClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlSignalsClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSignalsClause.class, "JmlSignalsClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel parameterPropertyMetaModel; + public PropertyMetaModel parameterPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsOnlyClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsOnlyClauseMetaModel.java index 6e992aad0b..8adf427978 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsOnlyClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSignalsOnlyClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlSignalsOnlyClauseMetaModel extends JmlClauseMetaModel { +public class JmlSignalsOnlyClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlSignalsOnlyClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSignalsOnlyClause.class, "JmlSignalsOnlyClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel typesPropertyMetaModel; + public PropertyMetaModel typesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSimpleExprClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSimpleExprClauseMetaModel.java index 04a88c8ca4..1edab8a92c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSimpleExprClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlSimpleExprClauseMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlSimpleExprClauseMetaModel extends JmlClauseMetaModel { +public class JmlSimpleExprClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlSimpleExprClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSimpleExprClause.class, "JmlSimpleExprClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel heapsPropertyMetaModel; + public PropertyMetaModel heapsPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStatementMetaModel.java index 147a9c77c6..8eb9628861 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStatementMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlStatementMetaModel extends StatementMetaModel { +public class JmlStatementMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlStatementMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStmtWithExpressionMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStmtWithExpressionMetaModel.java index d833cdfec1..4765dbd7a7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStmtWithExpressionMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlStmtWithExpressionMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlStmtWithExpressionMetaModel extends JmlStatementMetaModel { +public class JmlStmtWithExpressionMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlStmtWithExpressionMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlExpressionStmt.class, "JmlStmtWithExpression", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel kindPropertyMetaModel; + public PropertyMetaModel kindPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlTypeExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlTypeExprMetaModel.java index 0e6ce30440..260398ca75 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlTypeExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlTypeExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlTypeExprMetaModel extends ExpressionMetaModel { +public class JmlTypeExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlTypeExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlTypeExpr.class, "JmlTypeExpr", "com.github.javaparser.ast.jml.expr", false, false); } - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlUnreachableStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlUnreachableStmtMetaModel.java index b5e7576d83..bf2703eee3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlUnreachableStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlUnreachableStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class JmlUnreachableStmtMetaModel extends JmlStatementMetaModel { +public class JmlUnreachableStmtMetaModel extends JmlStatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") JmlUnreachableStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlUnreachableStmt.class, "JmlUnreachableStmt", "com.github.javaparser.ast.jml.stmt", false, false); } - public PropertyMetaModel jmlTagsPropertyMetaModel; + public PropertyMetaModel jmlTagsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LabeledStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LabeledStmtMetaModel.java index b8e7c71859..625c5886a8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LabeledStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LabeledStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LabeledStmtMetaModel extends StatementMetaModel { +public class LabeledStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LabeledStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, LabeledStmt.class, "LabeledStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel labelPropertyMetaModel; + public PropertyMetaModel labelPropertyMetaModel; - public PropertyMetaModel statementPropertyMetaModel; + public PropertyMetaModel statementPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LambdaExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LambdaExprMetaModel.java index cc5e7311ff..4dc883da39 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LambdaExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LambdaExprMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LambdaExprMetaModel extends ExpressionMetaModel { +public class LambdaExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LambdaExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, LambdaExpr.class, "LambdaExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; - public PropertyMetaModel isEnclosingParametersPropertyMetaModel; + public PropertyMetaModel isEnclosingParametersPropertyMetaModel; - public PropertyMetaModel parametersPropertyMetaModel; + public PropertyMetaModel parametersPropertyMetaModel; - public PropertyMetaModel expressionBodyPropertyMetaModel; + public PropertyMetaModel expressionBodyPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LineCommentMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LineCommentMetaModel.java index 5786488fe1..c5e842e32c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LineCommentMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LineCommentMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LineCommentMetaModel extends CommentMetaModel { +public class LineCommentMetaModel extends CommentMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LineCommentMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralExprMetaModel.java index 7bcb234f20..72eb220eb7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralExprMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LiteralExprMetaModel extends ExpressionMetaModel { +public class LiteralExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralStringValueExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralStringValueExprMetaModel.java index 0000d87ad9..7b36829063 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralStringValueExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LiteralStringValueExprMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LiteralStringValueExprMetaModel extends LiteralExprMetaModel { +public class LiteralStringValueExprMetaModel extends LiteralExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LiteralStringValueExprMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected LiteralStringValueExprMetaModel(Optional superNodeM super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel valuePropertyMetaModel; + public PropertyMetaModel valuePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalClassDeclarationStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalClassDeclarationStmtMetaModel.java index 331d4a7f4e..2387c94937 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalClassDeclarationStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalClassDeclarationStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LocalClassDeclarationStmtMetaModel extends StatementMetaModel { +public class LocalClassDeclarationStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LocalClassDeclarationStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, LocalClassDeclarationStmt.class, "LocalClassDeclarationStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel classDeclarationPropertyMetaModel; + public PropertyMetaModel classDeclarationPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalRecordDeclarationStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalRecordDeclarationStmtMetaModel.java index 6e568f29e9..d96c7d9c54 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalRecordDeclarationStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LocalRecordDeclarationStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LocalRecordDeclarationStmtMetaModel extends StatementMetaModel { +public class LocalRecordDeclarationStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LocalRecordDeclarationStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, LocalRecordDeclarationStmt.class, "LocalRecordDeclarationStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel recordDeclarationPropertyMetaModel; + public PropertyMetaModel recordDeclarationPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LongLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LongLiteralExprMetaModel.java index 9372fee21e..1c9beaaa4f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/LongLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/LongLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class LongLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class LongLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") LongLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MarkerAnnotationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MarkerAnnotationExprMetaModel.java index 14573ef780..8b7bea9cd7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MarkerAnnotationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MarkerAnnotationExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class MarkerAnnotationExprMetaModel extends AnnotationExprMetaModel { +public class MarkerAnnotationExprMetaModel extends AnnotationExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") MarkerAnnotationExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MemberValuePairMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MemberValuePairMetaModel.java index e97f66721b..58a2c27927 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MemberValuePairMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MemberValuePairMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class MemberValuePairMetaModel extends NodeMetaModel { +public class MemberValuePairMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") MemberValuePairMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, MemberValuePair.class, "MemberValuePair", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel valuePropertyMetaModel; + public PropertyMetaModel valuePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodCallExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodCallExprMetaModel.java index 8d32481792..6eb89f1aef 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodCallExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodCallExprMetaModel.java @@ -34,20 +34,20 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class MethodCallExprMetaModel extends ExpressionMetaModel { +public class MethodCallExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") MethodCallExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, MethodCallExpr.class, "MethodCallExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel argumentsPropertyMetaModel; + public PropertyMetaModel argumentsPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel scopePropertyMetaModel; + public PropertyMetaModel scopePropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodDeclarationMetaModel.java index f36a6cb514..8b641b0fe3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class MethodDeclarationMetaModel extends CallableDeclarationMetaModel { +public class MethodDeclarationMetaModel extends CallableDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") MethodDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, MethodDeclaration.class, "MethodDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodReferenceExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodReferenceExprMetaModel.java index 0b1a9df8a9..4cee8f64eb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodReferenceExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/MethodReferenceExprMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class MethodReferenceExprMetaModel extends ExpressionMetaModel { +public class MethodReferenceExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") MethodReferenceExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, MethodReferenceExpr.class, "MethodReferenceExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel identifierPropertyMetaModel; + public PropertyMetaModel identifierPropertyMetaModel; - public PropertyMetaModel scopePropertyMetaModel; + public PropertyMetaModel scopePropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModifierMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModifierMetaModel.java index 13dfe0db74..3ef9e18313 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModifierMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModifierMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModifierMetaModel extends NodeMetaModel { +public class ModifierMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModifierMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, Modifier.class, "Modifier", "com.github.javaparser.ast", false, false); } - public PropertyMetaModel keywordPropertyMetaModel; + public PropertyMetaModel keywordPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDeclarationMetaModel.java index e23a283c10..6b57678b21 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDeclarationMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleDeclarationMetaModel extends NodeMetaModel { +public class ModuleDeclarationMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleDeclaration.class, "ModuleDeclaration", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel directivesPropertyMetaModel; + public PropertyMetaModel directivesPropertyMetaModel; - public PropertyMetaModel isOpenPropertyMetaModel; + public PropertyMetaModel isOpenPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDirectiveMetaModel.java index 63befdaead..473c54aa58 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleDirectiveMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleDirectiveMetaModel extends NodeMetaModel { +public class ModuleDirectiveMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleDirectiveMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleExportsDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleExportsDirectiveMetaModel.java index b22de7d759..5dadfad174 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleExportsDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleExportsDirectiveMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleExportsDirectiveMetaModel extends ModuleDirectiveMetaModel { +public class ModuleExportsDirectiveMetaModel extends ModuleDirectiveMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleExportsDirectiveMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleExportsDirective.class, "ModuleExportsDirective", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel moduleNamesPropertyMetaModel; + public PropertyMetaModel moduleNamesPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleOpensDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleOpensDirectiveMetaModel.java index 220b12d0cb..689b80664a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleOpensDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleOpensDirectiveMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleOpensDirectiveMetaModel extends ModuleDirectiveMetaModel { +public class ModuleOpensDirectiveMetaModel extends ModuleDirectiveMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleOpensDirectiveMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleOpensDirective.class, "ModuleOpensDirective", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel moduleNamesPropertyMetaModel; + public PropertyMetaModel moduleNamesPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleProvidesDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleProvidesDirectiveMetaModel.java index 58984de672..5c241782da 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleProvidesDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleProvidesDirectiveMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleProvidesDirectiveMetaModel extends ModuleDirectiveMetaModel { +public class ModuleProvidesDirectiveMetaModel extends ModuleDirectiveMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleProvidesDirectiveMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleProvidesDirective.class, "ModuleProvidesDirective", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel withPropertyMetaModel; + public PropertyMetaModel withPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleRequiresDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleRequiresDirectiveMetaModel.java index 0571c75356..fac31aaabf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleRequiresDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleRequiresDirectiveMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleRequiresDirectiveMetaModel extends ModuleDirectiveMetaModel { +public class ModuleRequiresDirectiveMetaModel extends ModuleDirectiveMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleRequiresDirectiveMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleRequiresDirective.class, "ModuleRequiresDirective", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleUsesDirectiveMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleUsesDirectiveMetaModel.java index 0079ac6d04..13d0f0a842 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleUsesDirectiveMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ModuleUsesDirectiveMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ModuleUsesDirectiveMetaModel extends ModuleDirectiveMetaModel { +public class ModuleUsesDirectiveMetaModel extends ModuleDirectiveMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ModuleUsesDirectiveMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ModuleUsesDirective.class, "ModuleUsesDirective", "com.github.javaparser.ast.modules", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameExprMetaModel.java index 84acb408d6..fe42116ed2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class NameExprMetaModel extends ExpressionMetaModel { +public class NameExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") NameExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, NameExpr.class, "NameExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameMetaModel.java index e763f1f078..4e92b789de 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NameMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class NameMetaModel extends NodeMetaModel { +public class NameMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") NameMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, Name.class, "Name", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel identifierPropertyMetaModel; + public PropertyMetaModel identifierPropertyMetaModel; - public PropertyMetaModel qualifierPropertyMetaModel; + public PropertyMetaModel qualifierPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NodeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NodeMetaModel.java index de12db5929..5c09dcc75b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NodeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NodeMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class NodeMetaModel extends BaseNodeMetaModel { +public class NodeMetaModel extends BaseNodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") NodeMetaModel(Optional superBaseNodeMetaModel) { @@ -46,5 +46,5 @@ protected NodeMetaModel(Optional superNodeMetaModel, Class superBaseNodeMetaModel) { super(superBaseNodeMetaModel, NormalAnnotationExpr.class, "NormalAnnotationExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel pairsPropertyMetaModel; + public PropertyMetaModel pairsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NullLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NullLiteralExprMetaModel.java index 3704cff38e..4d09d757a9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NullLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NullLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class NullLiteralExprMetaModel extends LiteralExprMetaModel { +public class NullLiteralExprMetaModel extends LiteralExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") NullLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ObjectCreationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ObjectCreationExprMetaModel.java index 46bcb9faf7..f3124dbe6c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ObjectCreationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ObjectCreationExprMetaModel.java @@ -34,22 +34,22 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ObjectCreationExprMetaModel extends ExpressionMetaModel { +public class ObjectCreationExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ObjectCreationExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ObjectCreationExpr.class, "ObjectCreationExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel anonymousClassBodyPropertyMetaModel; + public PropertyMetaModel anonymousClassBodyPropertyMetaModel; - public PropertyMetaModel argumentsPropertyMetaModel; + public PropertyMetaModel argumentsPropertyMetaModel; - public PropertyMetaModel scopePropertyMetaModel; + public PropertyMetaModel scopePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; - public PropertyMetaModel typeArgumentsPropertyMetaModel; + public PropertyMetaModel typeArgumentsPropertyMetaModel; - public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; + public PropertyMetaModel usingDiamondOperatorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/OptionalProperty.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/OptionalProperty.java index 53a1ce2f88..9e814ebe09 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/OptionalProperty.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/OptionalProperty.java @@ -31,5 +31,5 @@ */ @Retention(RUNTIME) @Target(FIELD) -public @interface OptionalProperty { +public @interface OptionalProperty { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PackageDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PackageDeclarationMetaModel.java index 70bcd20840..7b2dd8b587 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PackageDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PackageDeclarationMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class PackageDeclarationMetaModel extends NodeMetaModel { +public class PackageDeclarationMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") PackageDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, PackageDeclaration.class, "PackageDeclaration", "com.github.javaparser.ast", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ParameterMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ParameterMetaModel.java index fda0713290..95bacf596a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ParameterMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ParameterMetaModel.java @@ -34,22 +34,22 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ParameterMetaModel extends NodeMetaModel { +public class ParameterMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ParameterMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, Parameter.class, "Parameter", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel isVarArgsPropertyMetaModel; + public PropertyMetaModel isVarArgsPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; - public PropertyMetaModel varArgsAnnotationsPropertyMetaModel; + public PropertyMetaModel varArgsAnnotationsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PatternExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PatternExprMetaModel.java index 9632774da3..29dba8dad2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PatternExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PatternExprMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class PatternExprMetaModel extends ExpressionMetaModel { +public class PatternExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") PatternExprMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected PatternExprMetaModel(Optional superNodeMetaModel, C super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PrimitiveTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PrimitiveTypeMetaModel.java index 3e4936dfdd..2ce17a7edc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PrimitiveTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PrimitiveTypeMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class PrimitiveTypeMetaModel extends TypeMetaModel { +public class PrimitiveTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") PrimitiveTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, PrimitiveType.class, "PrimitiveType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PropertyMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PropertyMetaModel.java index 1624c1a63d..2c2e83aba4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/PropertyMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/PropertyMetaModel.java @@ -29,7 +29,7 @@ /** * Meta-data about a property of a node in the AST. */ -public class PropertyMetaModel { +public class PropertyMetaModel { private final BaseNodeMetaModel containingNodeMetaModel; @@ -47,7 +47,7 @@ public class PropertyMetaModel { private final boolean hasWildcard; - public PropertyMetaModel(BaseNodeMetaModel containingNodeMetaModel, String name, Class type, Optional nodeReference, boolean isOptional, boolean isNonEmpty, boolean isNodeList, boolean hasWildcard) { + public PropertyMetaModel(BaseNodeMetaModel containingNodeMetaModel, String name, Class type, Optional nodeReference, boolean isOptional, boolean isNonEmpty, boolean isNodeList, boolean hasWildcard) { this.containingNodeMetaModel = containingNodeMetaModel; this.name = name; this.type = type; @@ -61,108 +61,108 @@ public PropertyMetaModel(BaseNodeMetaModel containingNodeMetaModel, String name /** * @return is this the field fieldName on class c? */ - public boolean is(Class c, String fieldName) { + public boolean is(Class c, String fieldName) { return containingNodeMetaModel.is(c) && name.equals(fieldName); } /** * @return is this fields called fieldName? */ - public boolean is(String fieldName) { + public boolean is(String fieldName) { return name.equals(fieldName); } /** * @return the name used in the AST for the setter */ - public String getSetterMethodName() { + public String getSetterMethodName() { return setterName(name); } /** * @return the name used in the AST for the getter */ - public String getGetterMethodName() { + public String getGetterMethodName() { return getterName(type, name); } /** * @return the NodeMetaModel that "has" this property. */ - public BaseNodeMetaModel getContainingNodeMetaModel() { + public BaseNodeMetaModel getContainingNodeMetaModel() { return containingNodeMetaModel; } /** * @return the name of the property. This is equal to the name of the field in the AST. */ - public String getName() { + public String getName() { return name; } /** * @return if this property is a String or a NodeList: whether it may be empty. */ - public boolean isNonEmpty() { + public boolean isNonEmpty() { return isNonEmpty; } /** * @return the class of the field. */ - public Class getType() { + public Class getType() { return type; } /** * @return if this property is a Node, this will get the node meta model. */ - public Optional getNodeReference() { + public Optional getNodeReference() { return nodeReference; } /** * @return whether this property is optional. */ - public boolean isOptional() { + public boolean isOptional() { return isOptional; } /** * @return whether this property is not optional. */ - public boolean isRequired() { + public boolean isRequired() { return !isOptional; } /** * @return whether this property is contained in a NodeList. */ - public boolean isNodeList() { + public boolean isNodeList() { return isNodeList; } /** * @return whether this property has a wildcard following it, like BodyDeclaration<?>. */ - public boolean hasWildcard() { + public boolean hasWildcard() { return hasWildcard; } /** * @return whether this property is not a list or set. */ - public boolean isSingular() { + public boolean isSingular() { return !isNodeList; } @Override - public String toString() { + public String toString() { return "(" + getTypeName() + ")\t" + containingNodeMetaModel + "#" + name; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -176,7 +176,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = name.hashCode(); result = 31 * result + type.hashCode(); return result; @@ -185,7 +185,7 @@ public int hashCode() { /** * @return the type of a single element of this property, so no Optional or NodeList. */ - public String getTypeNameGenerified() { + public String getTypeNameGenerified() { if (hasWildcard) { return getTypeName() + ""; } @@ -195,14 +195,14 @@ public String getTypeNameGenerified() { /** * @return the raw type of a single element of this property, so nothing but the name. */ - public String getTypeName() { + public String getTypeName() { return type.getSimpleName(); } /** * @return the type that is returned from getters in the AST. */ - public String getTypeNameForGetter() { + public String getTypeNameForGetter() { if (isOptional) { return "Optional<" + getTypeNameForSetter() + ">"; } @@ -212,7 +212,7 @@ public String getTypeNameForGetter() { /** * @return the type that is passed to setters in the AST. */ - public String getTypeNameForSetter() { + public String getTypeNameForSetter() { if (isNodeList) { return "NodeList<" + getTypeNameGenerified() + ">"; } @@ -222,21 +222,21 @@ public String getTypeNameForSetter() { /** * @return is this property an AST Node? */ - public boolean isNode() { + public boolean isNode() { return getNodeReference().isPresent(); } /** * The name of the field in the containing BaseNodeMetaModel for this property meta model. */ - public String getMetaModelFieldName() { + public String getMetaModelFieldName() { return getName() + "PropertyMetaModel"; } /** * @return is this property an attribute, meaning: not a node? */ - public boolean isAttribute() { + public boolean isAttribute() { return !isNode(); } @@ -244,7 +244,7 @@ public boolean isAttribute() { * Introspects the node to get the value from this field. * Note that an optional empty field will return null here. */ - public Object getValue(Node node) { + public Object getValue(Node node) { try { for (Class c = node.getClass(); c != null; c = c.getSuperclass()) { Field[] fields = c.getDeclaredFields(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReceiverParameterMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReceiverParameterMetaModel.java index 4c90e578a9..f1b028fcec 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReceiverParameterMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReceiverParameterMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ReceiverParameterMetaModel extends NodeMetaModel { +public class ReceiverParameterMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ReceiverParameterMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ReceiverParameter.class, "ReceiverParameter", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordDeclarationMetaModel.java index 2122079851..9a2f6d48b1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordDeclarationMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class RecordDeclarationMetaModel extends TypeDeclarationMetaModel { +public class RecordDeclarationMetaModel extends TypeDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") RecordDeclarationMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, RecordDeclaration.class, "RecordDeclaration", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel implementedTypesPropertyMetaModel; + public PropertyMetaModel implementedTypesPropertyMetaModel; - public PropertyMetaModel parametersPropertyMetaModel; + public PropertyMetaModel parametersPropertyMetaModel; - public PropertyMetaModel receiverParameterPropertyMetaModel; + public PropertyMetaModel receiverParameterPropertyMetaModel; - public PropertyMetaModel typeParametersPropertyMetaModel; + public PropertyMetaModel typeParametersPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordPatternExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordPatternExprMetaModel.java index 4e567ef124..d54925ec45 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordPatternExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/RecordPatternExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class RecordPatternExprMetaModel extends PatternExprMetaModel { +public class RecordPatternExprMetaModel extends PatternExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") RecordPatternExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, RecordPatternExpr.class, "RecordPatternExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel patternListPropertyMetaModel; + public PropertyMetaModel patternListPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReferenceTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReferenceTypeMetaModel.java index ac41a9edec..c02b82854e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReferenceTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReferenceTypeMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ReferenceTypeMetaModel extends TypeMetaModel { +public class ReferenceTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ReferenceTypeMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReturnStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReturnStmtMetaModel.java index b57ab4fa65..920e46d07d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReturnStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ReturnStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ReturnStmtMetaModel extends StatementMetaModel { +public class ReturnStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ReturnStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ReturnStmt.class, "ReturnStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsClauseMetaModel.java index 47372e8c4d..a1da11bd7b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsClauseMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SignalsClauseMetaModel extends JmlClauseMetaModel { +public class SignalsClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SignalsClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSignalsClause.class, "SignalsClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel exprPropertyMetaModel; + public PropertyMetaModel exprPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsMetaModel.java index 5e49801e12..d33be42012 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SignalsMetaModel extends JmlClauseMetaModel { +public class SignalsMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SignalsMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyClauseMetaModel.java index efa0a0f76d..3796ae5fc1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyClauseMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SignalsOnlyClauseMetaModel extends JmlClauseMetaModel { +public class SignalsOnlyClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SignalsOnlyClauseMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, JmlSignalsOnlyClause.class, "SignalsOnlyClause", "com.github.javaparser.ast.jml.clauses", false, false); } - public PropertyMetaModel typesPropertyMetaModel; + public PropertyMetaModel typesPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyMetaModel.java index 1f55883a33..14a283ea92 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SignalsOnlyMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SignalsOnlyMetaModel extends JmlClauseMetaModel { +public class SignalsOnlyMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SignalsOnlyMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SimpleNameMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SimpleNameMetaModel.java index 472bfb5cd0..bf0180f933 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SimpleNameMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SimpleNameMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SimpleNameMetaModel extends NodeMetaModel { +public class SimpleNameMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SimpleNameMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SimpleName.class, "SimpleName", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel identifierPropertyMetaModel; + public PropertyMetaModel identifierPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SingleMemberAnnotationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SingleMemberAnnotationExprMetaModel.java index dbb962f159..44ab2fbed5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SingleMemberAnnotationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SingleMemberAnnotationExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SingleMemberAnnotationExprMetaModel extends AnnotationExprMetaModel { +public class SingleMemberAnnotationExprMetaModel extends AnnotationExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SingleMemberAnnotationExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SingleMemberAnnotationExpr.class, "SingleMemberAnnotationExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel memberValuePropertyMetaModel; + public PropertyMetaModel memberValuePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/StatementMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/StatementMetaModel.java index 8fa974dc4e..535bdce0aa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/StatementMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/StatementMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class StatementMetaModel extends NodeMetaModel { +public class StatementMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") StatementMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/StringLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/StringLiteralExprMetaModel.java index cdf8c90abf..729c30f1f1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/StringLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/StringLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class StringLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class StringLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") StringLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SuperExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SuperExprMetaModel.java index 39f61f34f5..98a043c13f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SuperExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SuperExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SuperExprMetaModel extends ExpressionMetaModel { +public class SuperExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SuperExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SuperExpr.class, "SuperExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel typeNamePropertyMetaModel; + public PropertyMetaModel typeNamePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchEntryMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchEntryMetaModel.java index 7290a9754f..ef28819c57 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchEntryMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchEntryMetaModel.java @@ -34,22 +34,22 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SwitchEntryMetaModel extends NodeMetaModel { +public class SwitchEntryMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SwitchEntryMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SwitchEntry.class, "SwitchEntry", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel guardPropertyMetaModel; + public PropertyMetaModel guardPropertyMetaModel; - public PropertyMetaModel isDefaultPropertyMetaModel; + public PropertyMetaModel isDefaultPropertyMetaModel; - public PropertyMetaModel labelsPropertyMetaModel; + public PropertyMetaModel labelsPropertyMetaModel; - public PropertyMetaModel statementsPropertyMetaModel; + public PropertyMetaModel statementsPropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; - public PropertyMetaModel switchStatementEntryPropertyMetaModel; + public PropertyMetaModel switchStatementEntryPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchExprMetaModel.java index c187eeab44..cdf5031901 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SwitchExprMetaModel extends ExpressionMetaModel { +public class SwitchExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SwitchExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SwitchExpr.class, "SwitchExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel entriesPropertyMetaModel; + public PropertyMetaModel entriesPropertyMetaModel; - public PropertyMetaModel selectorPropertyMetaModel; + public PropertyMetaModel selectorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchStmtMetaModel.java index a6eb54bb6d..52b1292443 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SwitchStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SwitchStmtMetaModel extends StatementMetaModel { +public class SwitchStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SwitchStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SwitchStmt.class, "SwitchStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel entriesPropertyMetaModel; + public PropertyMetaModel entriesPropertyMetaModel; - public PropertyMetaModel selectorPropertyMetaModel; + public PropertyMetaModel selectorPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SynchronizedStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SynchronizedStmtMetaModel.java index 7d801a68d3..e51d396598 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/SynchronizedStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/SynchronizedStmtMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class SynchronizedStmtMetaModel extends StatementMetaModel { +public class SynchronizedStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") SynchronizedStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, SynchronizedStmt.class, "SynchronizedStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TextBlockLiteralExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TextBlockLiteralExprMetaModel.java index 859affcec1..49fb69182d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TextBlockLiteralExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TextBlockLiteralExprMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TextBlockLiteralExprMetaModel extends LiteralStringValueExprMetaModel { +public class TextBlockLiteralExprMetaModel extends LiteralStringValueExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TextBlockLiteralExprMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThisExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThisExprMetaModel.java index 8c7f0fcacf..dee10a3a54 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThisExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThisExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ThisExprMetaModel extends ExpressionMetaModel { +public class ThisExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ThisExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ThisExpr.class, "ThisExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel typeNamePropertyMetaModel; + public PropertyMetaModel typeNamePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThrowStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThrowStmtMetaModel.java index 79f5d6d603..b389b369d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThrowStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/ThrowStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class ThrowStmtMetaModel extends StatementMetaModel { +public class ThrowStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") ThrowStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, ThrowStmt.class, "ThrowStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TryStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TryStmtMetaModel.java index 02a0e9e096..f8eb254b83 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TryStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TryStmtMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TryStmtMetaModel extends StatementMetaModel { +public class TryStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TryStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, TryStmt.class, "TryStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel catchClausesPropertyMetaModel; + public PropertyMetaModel catchClausesPropertyMetaModel; - public PropertyMetaModel finallyBlockPropertyMetaModel; + public PropertyMetaModel finallyBlockPropertyMetaModel; - public PropertyMetaModel resourcesPropertyMetaModel; + public PropertyMetaModel resourcesPropertyMetaModel; - public PropertyMetaModel tryBlockPropertyMetaModel; + public PropertyMetaModel tryBlockPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeDeclarationMetaModel.java index 4f4ed4718c..31bac5a264 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeDeclarationMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TypeDeclarationMetaModel extends BodyDeclarationMetaModel { +public class TypeDeclarationMetaModel extends BodyDeclarationMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TypeDeclarationMetaModel(Optional superBaseNodeMetaModel) { @@ -47,9 +47,9 @@ protected TypeDeclarationMetaModel(Optional superNodeMetaMode super(superNodeMetaModel, type, name, packageName, isAbstract, hasWildcard); } - public PropertyMetaModel membersPropertyMetaModel; + public PropertyMetaModel membersPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeExprMetaModel.java index db7a0229e8..128c27d4e5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeExprMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TypeExprMetaModel extends ExpressionMetaModel { +public class TypeExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TypeExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, TypeExpr.class, "TypeExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeMetaModel.java index e2710c7137..c28460f0b6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeMetaModel.java @@ -35,7 +35,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TypeMetaModel extends NodeMetaModel { +public class TypeMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TypeMetaModel(Optional superBaseNodeMetaModel) { @@ -47,5 +47,5 @@ protected TypeMetaModel(Optional superNodeMetaModel, Class superBaseNodeMetaModel) { super(superBaseNodeMetaModel, TypeParameter.class, "TypeParameter", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typeBoundPropertyMetaModel; + public PropertyMetaModel typeBoundPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypePatternExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypePatternExprMetaModel.java index ce9666a322..8dc1132746 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypePatternExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypePatternExprMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class TypePatternExprMetaModel extends PatternExprMetaModel { +public class TypePatternExprMetaModel extends PatternExprMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") TypePatternExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, TypePatternExpr.class, "TypePatternExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnaryExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnaryExprMetaModel.java index b5c20ff02a..1d480caaf0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnaryExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnaryExprMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class UnaryExprMetaModel extends ExpressionMetaModel { +public class UnaryExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") UnaryExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, UnaryExpr.class, "UnaryExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; - public PropertyMetaModel operatorPropertyMetaModel; + public PropertyMetaModel operatorPropertyMetaModel; - public PropertyMetaModel postfixPropertyMetaModel; + public PropertyMetaModel postfixPropertyMetaModel; - public PropertyMetaModel prefixPropertyMetaModel; + public PropertyMetaModel prefixPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnionTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnionTypeMetaModel.java index 7bad2dedc0..ff20d8a2ac 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnionTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnionTypeMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class UnionTypeMetaModel extends TypeMetaModel { +public class UnionTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") UnionTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, UnionType.class, "UnionType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel elementsPropertyMetaModel; + public PropertyMetaModel elementsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnknownTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnknownTypeMetaModel.java index e86280f2fa..aec7103dad 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnknownTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnknownTypeMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class UnknownTypeMetaModel extends TypeMetaModel { +public class UnknownTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") UnknownTypeMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnparsableStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnparsableStmtMetaModel.java index 8ac1dae780..5c23415c5a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnparsableStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnparsableStmtMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class UnparsableStmtMetaModel extends StatementMetaModel { +public class UnparsableStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") UnparsableStmtMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnreachableStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnreachableStmtMetaModel.java index d5b80fccbc..a7929e118c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnreachableStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/UnreachableStmtMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class UnreachableStmtMetaModel extends StatementMetaModel { +public class UnreachableStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") UnreachableStmtMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VarTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VarTypeMetaModel.java index 5d94fb8093..bc95153b8b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VarTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VarTypeMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class VarTypeMetaModel extends TypeMetaModel { +public class VarTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") VarTypeMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclarationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclarationExprMetaModel.java index 014ea10a41..c86ab2af7c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclarationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclarationExprMetaModel.java @@ -34,18 +34,18 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class VariableDeclarationExprMetaModel extends ExpressionMetaModel { +public class VariableDeclarationExprMetaModel extends ExpressionMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") VariableDeclarationExprMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, VariableDeclarationExpr.class, "VariableDeclarationExpr", "com.github.javaparser.ast.expr", false, false); } - public PropertyMetaModel annotationsPropertyMetaModel; + public PropertyMetaModel annotationsPropertyMetaModel; - public PropertyMetaModel modifiersPropertyMetaModel; + public PropertyMetaModel modifiersPropertyMetaModel; - public PropertyMetaModel variablesPropertyMetaModel; + public PropertyMetaModel variablesPropertyMetaModel; - public PropertyMetaModel maximumCommonTypePropertyMetaModel; + public PropertyMetaModel maximumCommonTypePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclaratorMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclaratorMetaModel.java index 28ec935555..ecd32a17fd 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclaratorMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VariableDeclaratorMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class VariableDeclaratorMetaModel extends NodeMetaModel { +public class VariableDeclaratorMetaModel extends NodeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") VariableDeclaratorMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, VariableDeclarator.class, "VariableDeclarator", "com.github.javaparser.ast.body", false, false); } - public PropertyMetaModel initializerPropertyMetaModel; + public PropertyMetaModel initializerPropertyMetaModel; - public PropertyMetaModel namePropertyMetaModel; + public PropertyMetaModel namePropertyMetaModel; - public PropertyMetaModel typePropertyMetaModel; + public PropertyMetaModel typePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VoidTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VoidTypeMetaModel.java index a104d39115..087b4d9e4a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/VoidTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/VoidTypeMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class VoidTypeMetaModel extends TypeMetaModel { +public class VoidTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") VoidTypeMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WhileStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WhileStmtMetaModel.java index 28fa91e886..ed04aef35c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WhileStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WhileStmtMetaModel.java @@ -34,16 +34,16 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class WhileStmtMetaModel extends StatementMetaModel { +public class WhileStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") WhileStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, WhileStmt.class, "WhileStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel bodyPropertyMetaModel; + public PropertyMetaModel bodyPropertyMetaModel; - public PropertyMetaModel conditionPropertyMetaModel; + public PropertyMetaModel conditionPropertyMetaModel; - public PropertyMetaModel contractsPropertyMetaModel; + public PropertyMetaModel contractsPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WildcardTypeMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WildcardTypeMetaModel.java index e4e1ce3d0f..54a2f4a5f7 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WildcardTypeMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WildcardTypeMetaModel.java @@ -34,14 +34,14 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class WildcardTypeMetaModel extends TypeMetaModel { +public class WildcardTypeMetaModel extends TypeMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") WildcardTypeMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, WildcardType.class, "WildcardType", "com.github.javaparser.ast.type", false, false); } - public PropertyMetaModel extendedTypePropertyMetaModel; + public PropertyMetaModel extendedTypePropertyMetaModel; - public PropertyMetaModel superTypePropertyMetaModel; + public PropertyMetaModel superTypePropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WorkingSpaceClauseMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WorkingSpaceClauseMetaModel.java index b906b41355..d2bde988ed 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/WorkingSpaceClauseMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/WorkingSpaceClauseMetaModel.java @@ -34,7 +34,7 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class WorkingSpaceClauseMetaModel extends JmlClauseMetaModel { +public class WorkingSpaceClauseMetaModel extends JmlClauseMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") WorkingSpaceClauseMetaModel(Optional superBaseNodeMetaModel) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/YieldStmtMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/YieldStmtMetaModel.java index bc677f8297..6634a1c474 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/YieldStmtMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/YieldStmtMetaModel.java @@ -34,12 +34,12 @@ * For this reason, any changes made directly to this file will be overwritten the next time generators are run. */ @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") -public class YieldStmtMetaModel extends StatementMetaModel { +public class YieldStmtMetaModel extends StatementMetaModel { @Generated("com.github.javaparser.generator.metamodel.NodeMetaModelGenerator") YieldStmtMetaModel(Optional superBaseNodeMetaModel) { super(superBaseNodeMetaModel, YieldStmt.class, "YieldStmt", "com.github.javaparser.ast.stmt", false, false); } - public PropertyMetaModel expressionPropertyMetaModel; + public PropertyMetaModel expressionPropertyMetaModel; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java b/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java index 47c2453ace..e410a2e0ca 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/ConcreteSyntaxModel.java @@ -44,7 +44,7 @@ * The Concrete Syntax Model for a single node type. It knows the syntax used to represent a certain element in Java * code. */ -public class ConcreteSyntaxModel { +public class ConcreteSyntaxModel { private static final Map concreteSyntaxModelByClass = new HashMap<>(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinter.java index 517c1af853..31e008d274 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinter.java @@ -29,7 +29,7 @@ /** * Pretty printer for AST nodes. */ -public class DefaultPrettyPrinter implements Printer { +public class DefaultPrettyPrinter implements Printer { private PrinterConfiguration configuration; @@ -49,7 +49,7 @@ private static PrinterConfiguration createDefaultConfiguration() { /** * Build a new DefaultPrettyPrinter with a default configuration and a default factory */ - public DefaultPrettyPrinter() { + public DefaultPrettyPrinter() { this(createDefaultConfiguration()); } @@ -58,7 +58,7 @@ public DefaultPrettyPrinter() { * * @param configuration */ - public DefaultPrettyPrinter(PrinterConfiguration configuration) { + public DefaultPrettyPrinter(PrinterConfiguration configuration) { this(createDefaultVisitor(), configuration); } @@ -68,7 +68,7 @@ public DefaultPrettyPrinter(PrinterConfiguration configuration) { * @param visitorFactory * @param configuration Configuration to apply */ - public DefaultPrettyPrinter(Function> visitorFactory, PrinterConfiguration configuration) { + public DefaultPrettyPrinter(Function> visitorFactory, PrinterConfiguration configuration) { this.configuration = configuration; this.visitorFactory = visitorFactory; } @@ -77,20 +77,20 @@ public DefaultPrettyPrinter(Function> v /* * Returns the Printer configuration */ - public PrinterConfiguration getConfiguration() { + public PrinterConfiguration getConfiguration() { return configuration; } /* * set or update the PrettyPrinter configuration */ - public Printer setConfiguration(PrinterConfiguration configuration) { + public Printer setConfiguration(PrinterConfiguration configuration) { this.configuration = configuration; return this; } @Override - public String print(Node node) { + public String print(Node node) { // lazy initialization of visitor which can have a state (like a buffer) VoidVisitor visitor = visitorFactory.apply(configuration); node.accept(visitor, null); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java index 63567ab526..be63cd029f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/DefaultPrettyPrinterVisitor.java @@ -59,7 +59,7 @@ /** * Outputs the AST as formatted Java source code. */ -public class DefaultPrettyPrinterVisitor implements VoidVisitor { +public class DefaultPrettyPrinterVisitor implements VoidVisitor { private static Pattern RTRIM = Pattern.compile("\\s+$"); @@ -73,26 +73,23 @@ public class DefaultPrettyPrinterVisitor implements VoidVisitor { private Position jmlOpenColumn; - public DefaultPrettyPrinterVisitor(PrinterConfiguration configuration) { + public DefaultPrettyPrinterVisitor(PrinterConfiguration configuration) { this(configuration, new SourcePrinter(configuration)); } - public DefaultPrettyPrinterVisitor(PrinterConfiguration configuration, SourcePrinter printer) { + public DefaultPrettyPrinterVisitor(PrinterConfiguration configuration, SourcePrinter printer) { this.configuration = configuration; this.printer = printer; } @Override - public String toString() { + public String toString() { return printer.toString(); } protected void printModifiers(final NodeList modifiers) { if (modifiers.size() > 0) { - printer.print(modifiers.stream().map(Modifier::getKeyword).map(Modifier.Keyword::asString).collect(joining(" ")) + " "); - if (!modifiers.isEmpty()) { - printer.print(modifiers.stream().map(Modifier::getKeyword).map(it -> !inJmlComment() && it.name().startsWith("JML_") ? "/*@ " + it.asString() + " */" : it.asString()).collect(joining(" ")) + " "); - } + printer.print(modifiers.stream().map(Modifier::getKeyword).map(it -> !inJmlComment() && it.name().startsWith("JML_") ? "/*@ " + it.asString() + " */" : it.asString()).collect(joining(" ")) + " "); } } @@ -219,7 +216,7 @@ protected void printComment(final Optional comment, final Void arg) { } @Override - public void visit(final CompilationUnit n, final Void arg) { + public void visit(final CompilationUnit n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getParsed() == UNPARSABLE) { @@ -242,7 +239,7 @@ public void visit(final CompilationUnit n, final Void arg) { } @Override - public void visit(final PackageDeclaration n, final Void arg) { + public void visit(final PackageDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -254,7 +251,7 @@ public void visit(final PackageDeclaration n, final Void arg) { } @Override - public void visit(final NameExpr n, final Void arg) { + public void visit(final NameExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -262,7 +259,7 @@ public void visit(final NameExpr n, final Void arg) { } @Override - public void visit(final Name n, final Void arg) { + public void visit(final Name n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getQualifier().isPresent()) { @@ -274,14 +271,14 @@ public void visit(final Name n, final Void arg) { } @Override - public void visit(SimpleName n, Void arg) { + public void visit(SimpleName n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getIdentifier()); } @Override - public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { + public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -334,7 +331,7 @@ public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { } @Override - public void visit(RecordDeclaration n, Void arg) { + public void visit(RecordDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -374,7 +371,7 @@ public void visit(RecordDeclaration n, Void arg) { } @Override - public void visit(final JavadocComment n, final Void arg) { + public void visit(final JavadocComment n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); if (getOption(ConfigOption.PRINT_COMMENTS).isPresent() && getOption(ConfigOption.PRINT_JAVADOC).isPresent()) { printer.println(n.getHeader()); @@ -415,7 +412,7 @@ public void visit(final JavadocComment n, final Void arg) { } @Override - public void visit(final ClassOrInterfaceType n, final Void arg) { + public void visit(final ClassOrInterfaceType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getScope().isPresent()) { @@ -432,7 +429,7 @@ public void visit(final ClassOrInterfaceType n, final Void arg) { } @Override - public void visit(final TypeParameter n, final Void arg) { + public void visit(final TypeParameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -450,7 +447,7 @@ public void visit(final TypeParameter n, final Void arg) { } @Override - public void visit(final PrimitiveType n, final Void arg) { + public void visit(final PrimitiveType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), true, arg); @@ -458,7 +455,7 @@ public void visit(final PrimitiveType n, final Void arg) { } @Override - public void visit(final ArrayType n, final Void arg) { + public void visit(final ArrayType n, final Void arg) { final List arrayTypeBuffer = new LinkedList<>(); Type type = n; while (type instanceof ArrayType) { @@ -474,7 +471,7 @@ public void visit(final ArrayType n, final Void arg) { } @Override - public void visit(final ArrayCreationLevel n, final Void arg) { + public void visit(final ArrayCreationLevel n, final Void arg) { printAnnotations(n.getAnnotations(), true, arg); printer.print("["); if (n.getDimension().isPresent()) { @@ -484,7 +481,7 @@ public void visit(final ArrayCreationLevel n, final Void arg) { } @Override - public void visit(final IntersectionType n, final Void arg) { + public void visit(final IntersectionType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -500,7 +497,7 @@ public void visit(final IntersectionType n, final Void arg) { } @Override - public void visit(final UnionType n, final Void arg) { + public void visit(final UnionType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), true, arg); @@ -516,7 +513,7 @@ public void visit(final UnionType n, final Void arg) { } @Override - public void visit(final WildcardType n, final Void arg) { + public void visit(final WildcardType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -532,12 +529,12 @@ public void visit(final WildcardType n, final Void arg) { } @Override - public void visit(final UnknownType n, final Void arg) { + public void visit(final UnknownType n, final Void arg) { // Nothing to print } @Override - public void visit(final FieldDeclaration n, final Void arg) { + public void visit(final FieldDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -561,7 +558,7 @@ public void visit(final FieldDeclaration n, final Void arg) { } @Override - public void visit(final VariableDeclarator n, final Void arg) { + public void visit(final VariableDeclarator n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -585,7 +582,7 @@ public void visit(final VariableDeclarator n, final Void arg) { } @Override - public void visit(final ArrayInitializerExpr n, final Void arg) { + public void visit(final ArrayInitializerExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("{"); @@ -624,7 +621,7 @@ private boolean doPrintAsArrayOfAnnotations(final ArrayInitializerExpr n) { } @Override - public void visit(final VoidType n, final Void arg) { + public void visit(final VoidType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -632,7 +629,7 @@ public void visit(final VoidType n, final Void arg) { } @Override - public void visit(final VarType n, final Void arg) { + public void visit(final VarType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -640,13 +637,13 @@ public void visit(final VarType n, final Void arg) { } @Override - public void visit(Modifier n, Void arg) { + public void visit(Modifier n, Void arg) { printer.print(n.getKeyword().asString()); printer.print(" "); } @Override - public void visit(final ArrayAccessExpr n, final Void arg) { + public void visit(final ArrayAccessExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -656,7 +653,7 @@ public void visit(final ArrayAccessExpr n, final Void arg) { } @Override - public void visit(final ArrayCreationExpr n, final Void arg) { + public void visit(final ArrayCreationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("new "); @@ -671,7 +668,7 @@ public void visit(final ArrayCreationExpr n, final Void arg) { } @Override - public void visit(final AssignExpr n, final Void arg) { + public void visit(final AssignExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getTarget().accept(this, arg); @@ -689,7 +686,7 @@ public void visit(final AssignExpr n, final Void arg) { * work in progress for issue-545 */ @Override - public void visit(final BinaryExpr n, final Void arg) { + public void visit(final BinaryExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getLeft().accept(this, arg); @@ -704,7 +701,7 @@ public void visit(final BinaryExpr n, final Void arg) { } @Override - public void visit(final CastExpr n, final Void arg) { + public void visit(final CastExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("("); @@ -714,7 +711,7 @@ public void visit(final CastExpr n, final Void arg) { } @Override - public void visit(final ClassExpr n, final Void arg) { + public void visit(final ClassExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getType().accept(this, arg); @@ -722,7 +719,7 @@ public void visit(final ClassExpr n, final Void arg) { } @Override - public void visit(final ConditionalExpr n, final Void arg) { + public void visit(final ConditionalExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getCondition().accept(this, arg); @@ -733,7 +730,7 @@ public void visit(final ConditionalExpr n, final Void arg) { } @Override - public void visit(final EnclosedExpr n, final Void arg) { + public void visit(final EnclosedExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("("); @@ -742,7 +739,7 @@ public void visit(final EnclosedExpr n, final Void arg) { } @Override - public void visit(final FieldAccessExpr n, final Void arg) { + public void visit(final FieldAccessExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getScope().accept(this, arg); @@ -751,7 +748,7 @@ public void visit(final FieldAccessExpr n, final Void arg) { } @Override - public void visit(final InstanceOfExpr n, final Void arg) { + public void visit(final InstanceOfExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getExpression().accept(this, arg); @@ -764,7 +761,7 @@ public void visit(final InstanceOfExpr n, final Void arg) { } @Override - public void visit(final TypePatternExpr n, final Void arg) { + public void visit(final TypePatternExpr n, final Void arg) { printModifiers(n.getModifiers()); n.getType().accept(this, arg); printer.print(" "); @@ -792,7 +789,7 @@ private void printList(NodeList args, String sep, String del } @Override - public void visit(JmlQuantifiedExpr n, Void arg) { + public void visit(JmlQuantifiedExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print("("); printer.print(n.getBinder().jmlSymbol()); @@ -804,7 +801,7 @@ public void visit(JmlQuantifiedExpr n, Void arg) { } @Override - public void visit(JmlClauseLabel n, Void arg) { + public void visit(JmlClauseLabel n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print(n.getKind().jmlSymbol); n.getLabel().ifPresent(it -> { @@ -831,7 +828,7 @@ private void printClause(JmlClauseKind name, Expression expr) { } @Override - public void visit(JmlExpressionStmt n, Void arg) { + public void visit(JmlExpressionStmt n, Void arg) { wrapInJmlIfNeeded(() -> { printer.print(n.getKind().jmlSymbol()); printer.print(" "); @@ -841,7 +838,7 @@ public void visit(JmlExpressionStmt n, Void arg) { } @Override - public void visit(JmlLabelExpr n, Void arg) { + public void visit(JmlLabelExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print("("); switch(n.getKind()) { @@ -862,7 +859,7 @@ public void visit(JmlLabelExpr n, Void arg) { } @Override - public void visit(JmlLetExpr n, Void arg) { + public void visit(JmlLetExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print("(\\let "); n.getVariables().accept(this, arg); @@ -872,7 +869,7 @@ public void visit(JmlLetExpr n, Void arg) { } @Override - public void visit(JmlMultiCompareExpr n, Void arg) { + public void visit(JmlMultiCompareExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); for (int i = 0; i < n.getOperators().size(); i++) { n.getExpressions().get(i).accept(this, arg); @@ -882,19 +879,19 @@ public void visit(JmlMultiCompareExpr n, Void arg) { } @Override - public void visit(JmlSimpleExprClause n, Void arg) { + public void visit(JmlSimpleExprClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printClause(n.getKind(), n.getHeaps().orElse(new NodeList<>()), n.getExpression()); } @Override - public void visit(JmlSignalsClause n, Void arg) { + public void visit(JmlSignalsClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printClause(n.getKind(), n.getExpression()); } @Override - public void visit(JmlSignalsOnlyClause n, Void arg) { + public void visit(JmlSignalsOnlyClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print(n.getKind().jmlSymbol); printer.print(" "); @@ -903,7 +900,7 @@ public void visit(JmlSignalsOnlyClause n, Void arg) { } @Override - public void visit(JmlUnreachableStmt n, Void arg) { + public void visit(JmlUnreachableStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); wrapInJmlIfNeeded(() -> { printer.println("unreachable;"); @@ -922,7 +919,7 @@ void wrapInJmlIfNeeded(Runnable run) { } @Override - public void visit(JmlCallableClause n, Void arg) { + public void visit(JmlCallableClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print(n.getKind().jmlSymbol); printer.print(" TODO"); @@ -930,7 +927,7 @@ public void visit(JmlCallableClause n, Void arg) { } @Override - public void visit(JmlForallClause n, Void arg) { + public void visit(JmlForallClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print(n.getKind().jmlSymbol); printer.print(" "); @@ -939,7 +936,7 @@ public void visit(JmlForallClause n, Void arg) { } @Override - public void visit(JmlRefiningStmt n, Void arg) { + public void visit(JmlRefiningStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); wrapInJmlIfNeeded(() -> { printer.print("refining"); @@ -948,13 +945,13 @@ public void visit(JmlRefiningStmt n, Void arg) { } @Override - public void visit(JmlClauseIf n, Void arg) { + public void visit(JmlClauseIf n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printClause(n.getKind(), new StringLiteralExpr((""))); } @Override - public void visit(JmlClassExprDeclaration n, Void arg) { + public void visit(JmlClassExprDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printModifiers(n.getModifiers()); printer.print("invariant "); @@ -963,7 +960,7 @@ public void visit(JmlClassExprDeclaration n, Void arg) { } @Override - public void visit(JmlClassAccessibleDeclaration n, Void arg) { + public void visit(JmlClassAccessibleDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printModifiers(n.getModifiers()); printer.print("accessible"); @@ -979,7 +976,7 @@ public void visit(JmlClassAccessibleDeclaration n, Void arg) { } @Override - public void visit(JmlRepresentsDeclaration n, Void arg) { + public void visit(JmlRepresentsDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printModifiers(n.getModifiers()); printer.print("represents"); @@ -991,7 +988,7 @@ public void visit(JmlRepresentsDeclaration n, Void arg) { } @Override - public void visit(JmlContract n, Void arg) { + public void visit(JmlContract n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); boolean openedJml = inJmlComment(); if (!openedJml) @@ -1033,7 +1030,7 @@ private void startJmlComment(boolean singleLine, NodeList jmlTags) { } @Override - public void visit(JmlSetComprehensionExpr n, Void arg) { + public void visit(JmlSetComprehensionExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("{ "); @@ -1045,7 +1042,7 @@ public void visit(JmlSetComprehensionExpr n, Void arg) { } @Override - public void visit(JmlGhostStmt n, Void arg) { + public void visit(JmlGhostStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); wrapInJmlIfNeeded(() -> { printer.print("ghost"); @@ -1055,7 +1052,7 @@ public void visit(JmlGhostStmt n, Void arg) { } @Override - public void visit(JmlMethodDeclaration n, Void arg) { + public void visit(JmlMethodDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContract().ifPresent(c -> { c.accept(this, arg); @@ -1067,7 +1064,7 @@ public void visit(JmlMethodDeclaration n, Void arg) { } @Override - public void visit(JmlBinaryInfixExpr n, Void arg) { + public void visit(JmlBinaryInfixExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print("("); n.getLeft().accept(this, arg); @@ -1079,34 +1076,34 @@ public void visit(JmlBinaryInfixExpr n, Void arg) { } @Override - public void visit(JmlDocDeclaration n, Void arg) { + public void visit(JmlDocDeclaration n, Void arg) { n.getJmlComments().forEach(it -> it.accept(this, arg)); } @Override - public void visit(JmlDocStmt n, Void arg) { + public void visit(JmlDocStmt n, Void arg) { n.getJmlComments().forEach(it -> it.accept(this, arg)); } @Override - public void visit(JmlDoc n, Void arg) { + public void visit(JmlDoc n, Void arg) { printer.print(n.getContent().asString()); } @Override - public void visit(JmlDocType n, Void arg) { + public void visit(JmlDocType n, Void arg) { n.getJmlComments().accept(this, arg); } @Override - public void visit(JmlFieldDeclaration n, Void arg) { + public void visit(JmlFieldDeclaration n, Void arg) { startJmlComment(false, new NodeList<>()); n.getDecl().accept(this, null); endJmlComment(); } @Override - public void visit(JmlOldClause n, Void arg) { + public void visit(JmlOldClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print(n.getKind().jmlSymbol); printer.print(" "); @@ -1115,12 +1112,12 @@ public void visit(JmlOldClause n, Void arg) { } @Override - public void visit(JmlTypeExpr n, Void arg) { + public void visit(JmlTypeExpr n, Void arg) { n.getType().accept(this, arg); } @Override - public void visit(JmlMultiExprClause n, Void arg) { + public void visit(JmlMultiExprClause n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getKind().jmlSymbol()); @@ -1138,21 +1135,21 @@ public void visit(JmlMultiExprClause n, Void arg) { } @Override - public void visit(JmlBeginStmt n, Void arg) { + public void visit(JmlBeginStmt n, Void arg) { startJmlComment(true, new NodeList<>()); printer.print("begin"); endJmlComment(); } @Override - public void visit(JmlEndStmt n, Void arg) { + public void visit(JmlEndStmt n, Void arg) { startJmlComment(true, new NodeList<>()); printer.print("end"); endJmlComment(); } @Override - public void visit(JmlLabelStmt n, Void arg) { + public void visit(JmlLabelStmt n, Void arg) { startJmlComment(true, new NodeList<>()); n.getLabel().accept(this, arg); printer.print(":"); @@ -1160,7 +1157,7 @@ public void visit(JmlLabelStmt n, Void arg) { } @Override - public void visit(JmlMethodSignature n, Void arg) { + public void visit(JmlMethodSignature n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getReceiver().ifPresent(it -> { @@ -1174,7 +1171,7 @@ public void visit(JmlMethodSignature n, Void arg) { } @Override - public void visit(final RecordPatternExpr n, final Void arg) { + public void visit(final RecordPatternExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getType().accept(this, arg); @@ -1182,7 +1179,7 @@ public void visit(final RecordPatternExpr n, final Void arg) { } @Override - public void visit(final CharLiteralExpr n, final Void arg) { + public void visit(final CharLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("'"); @@ -1191,28 +1188,28 @@ public void visit(final CharLiteralExpr n, final Void arg) { } @Override - public void visit(final DoubleLiteralExpr n, final Void arg) { + public void visit(final DoubleLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final IntegerLiteralExpr n, final Void arg) { + public void visit(final IntegerLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final LongLiteralExpr n, final Void arg) { + public void visit(final LongLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final StringLiteralExpr n, final Void arg) { + public void visit(final StringLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("\""); @@ -1221,7 +1218,7 @@ public void visit(final StringLiteralExpr n, final Void arg) { } @Override - public void visit(final TextBlockLiteralExpr n, final Void arg) { + public void visit(final TextBlockLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("\"\"\""); @@ -1235,21 +1232,21 @@ public void visit(final TextBlockLiteralExpr n, final Void arg) { } @Override - public void visit(final BooleanLiteralExpr n, final Void arg) { + public void visit(final BooleanLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(String.valueOf(n.getValue())); } @Override - public void visit(final NullLiteralExpr n, final Void arg) { + public void visit(final NullLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("null"); } @Override - public void visit(final ThisExpr n, final Void arg) { + public void visit(final ThisExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getTypeName().isPresent()) { @@ -1260,7 +1257,7 @@ public void visit(final ThisExpr n, final Void arg) { } @Override - public void visit(final SuperExpr n, final Void arg) { + public void visit(final SuperExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getTypeName().isPresent()) { @@ -1271,7 +1268,7 @@ public void visit(final SuperExpr n, final Void arg) { } @Override - public void visit(final MethodCallExpr n, final Void arg) { + public void visit(final MethodCallExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); // determine whether we do reindenting for aligmnent at all @@ -1356,7 +1353,7 @@ public void visit(final MethodCallExpr n, final Void arg) { } @Override - public void visit(final ObjectCreationExpr n, final Void arg) { + public void visit(final ObjectCreationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.hasScope()) { @@ -1380,7 +1377,7 @@ public void visit(final ObjectCreationExpr n, final Void arg) { } @Override - public void visit(final UnaryExpr n, final Void arg) { + public void visit(final UnaryExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getOperator().isPrefix()) { @@ -1393,7 +1390,7 @@ public void visit(final UnaryExpr n, final Void arg) { } @Override - public void visit(final ConstructorDeclaration n, final Void arg) { + public void visit(final ConstructorDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1435,7 +1432,7 @@ public void visit(final ConstructorDeclaration n, final Void arg) { } @Override - public void visit(final CompactConstructorDeclaration n, final Void arg) { + public void visit(final CompactConstructorDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1460,7 +1457,7 @@ public void visit(final CompactConstructorDeclaration n, final Void arg) { } @Override - public void visit(final MethodDeclaration n, final Void arg) { + public void visit(final MethodDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printList(n.getContracts(), "\n"); @@ -1509,7 +1506,7 @@ public void visit(final MethodDeclaration n, final Void arg) { } @Override - public void visit(final Parameter n, final Void arg) { + public void visit(final Parameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -1526,7 +1523,7 @@ public void visit(final Parameter n, final Void arg) { } @Override - public void visit(final ReceiverParameter n, final Void arg) { + public void visit(final ReceiverParameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -1536,7 +1533,7 @@ public void visit(final ReceiverParameter n, final Void arg) { } @Override - public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { + public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.isThis()) { @@ -1555,7 +1552,7 @@ public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { } @Override - public void visit(final VariableDeclarationExpr n, final Void arg) { + public void visit(final VariableDeclarationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getParentNode().map(ExpressionStmt.class::isInstance).orElse(false)) { @@ -1578,21 +1575,21 @@ public void visit(final VariableDeclarationExpr n, final Void arg) { } @Override - public void visit(final LocalClassDeclarationStmt n, final Void arg) { + public void visit(final LocalClassDeclarationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getClassDeclaration().accept(this, arg); } @Override - public void visit(final LocalRecordDeclarationStmt n, final Void arg) { + public void visit(final LocalRecordDeclarationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getRecordDeclaration().accept(this, arg); } @Override - public void visit(final AssertStmt n, final Void arg) { + public void visit(final AssertStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("assert "); @@ -1605,7 +1602,7 @@ public void visit(final AssertStmt n, final Void arg) { } @Override - public void visit(final BlockStmt n, final Void arg) { + public void visit(final BlockStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContracts().accept(this, arg); printComment(n.getComment(), arg); @@ -1623,7 +1620,7 @@ public void visit(final BlockStmt n, final Void arg) { } @Override - public void visit(final LabeledStmt n, final Void arg) { + public void visit(final LabeledStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getLabel().accept(this, arg); @@ -1632,14 +1629,14 @@ public void visit(final LabeledStmt n, final Void arg) { } @Override - public void visit(final EmptyStmt n, final Void arg) { + public void visit(final EmptyStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(";"); } @Override - public void visit(final ExpressionStmt n, final Void arg) { + public void visit(final ExpressionStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getExpression().accept(this, arg); @@ -1647,13 +1644,13 @@ public void visit(final ExpressionStmt n, final Void arg) { } @Override - public void visit(final SwitchStmt n, final Void arg) { + public void visit(final SwitchStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printSwitchNode(n, arg); } @Override - public void visit(SwitchExpr n, Void arg) { + public void visit(SwitchExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printSwitchNode(n, arg); } @@ -1674,7 +1671,7 @@ private void printSwitchNode(SwitchNode n, Void arg) { } @Override - public void visit(final SwitchEntry n, final Void arg) { + public void visit(final SwitchEntry n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); // old/new switch @@ -1712,7 +1709,7 @@ public void visit(final SwitchEntry n, final Void arg) { } @Override - public void visit(final BreakStmt n, final Void arg) { + public void visit(final BreakStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("break"); @@ -1721,7 +1718,7 @@ public void visit(final BreakStmt n, final Void arg) { } @Override - public void visit(final YieldStmt n, final Void arg) { + public void visit(final YieldStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("yield "); @@ -1730,7 +1727,7 @@ public void visit(final YieldStmt n, final Void arg) { } @Override - public void visit(final ReturnStmt n, final Void arg) { + public void visit(final ReturnStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("return"); @@ -1742,7 +1739,7 @@ public void visit(final ReturnStmt n, final Void arg) { } @Override - public void visit(final EnumDeclaration n, final Void arg) { + public void visit(final EnumDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1790,7 +1787,7 @@ public void visit(final EnumDeclaration n, final Void arg) { } @Override - public void visit(final EnumConstantDeclaration n, final Void arg) { + public void visit(final EnumConstantDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1808,7 +1805,7 @@ public void visit(final EnumConstantDeclaration n, final Void arg) { } @Override - public void visit(final InitializerDeclaration n, final Void arg) { + public void visit(final InitializerDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.isStatic()) { @@ -1818,7 +1815,7 @@ public void visit(final InitializerDeclaration n, final Void arg) { } @Override - public void visit(final IfStmt n, final Void arg) { + public void visit(final IfStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("if ("); @@ -1856,7 +1853,7 @@ public void visit(final IfStmt n, final Void arg) { } @Override - public void visit(final WhileStmt n, final Void arg) { + public void visit(final WhileStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContracts().accept(this, arg); printComment(n.getComment(), arg); @@ -1867,7 +1864,7 @@ public void visit(final WhileStmt n, final Void arg) { } @Override - public void visit(final ContinueStmt n, final Void arg) { + public void visit(final ContinueStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("continue"); @@ -1876,7 +1873,7 @@ public void visit(final ContinueStmt n, final Void arg) { } @Override - public void visit(final DoStmt n, final Void arg) { + public void visit(final DoStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContracts().accept(this, arg); printComment(n.getComment(), arg); @@ -1888,7 +1885,7 @@ public void visit(final DoStmt n, final Void arg) { } @Override - public void visit(final ForEachStmt n, final Void arg) { + public void visit(final ForEachStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContracts().accept(this, arg); printComment(n.getComment(), arg); @@ -1901,7 +1898,7 @@ public void visit(final ForEachStmt n, final Void arg) { } @Override - public void visit(final ForStmt n, final Void arg) { + public void visit(final ForStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); n.getContracts().accept(this, arg); printComment(n.getComment(), arg); @@ -1934,7 +1931,7 @@ public void visit(final ForStmt n, final Void arg) { } @Override - public void visit(final ThrowStmt n, final Void arg) { + public void visit(final ThrowStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("throw "); @@ -1943,7 +1940,7 @@ public void visit(final ThrowStmt n, final Void arg) { } @Override - public void visit(final SynchronizedStmt n, final Void arg) { + public void visit(final SynchronizedStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("synchronized ("); @@ -1953,7 +1950,7 @@ public void visit(final SynchronizedStmt n, final Void arg) { } @Override - public void visit(final TryStmt n, final Void arg) { + public void visit(final TryStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("try "); @@ -1988,7 +1985,7 @@ public void visit(final TryStmt n, final Void arg) { } @Override - public void visit(final CatchClause n, final Void arg) { + public void visit(final CatchClause n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(" catch ("); @@ -1998,7 +1995,7 @@ public void visit(final CatchClause n, final Void arg) { } @Override - public void visit(final AnnotationDeclaration n, final Void arg) { + public void visit(final AnnotationDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -2015,7 +2012,7 @@ public void visit(final AnnotationDeclaration n, final Void arg) { } @Override - public void visit(final AnnotationMemberDeclaration n, final Void arg) { + public void visit(final AnnotationMemberDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -2032,7 +2029,7 @@ public void visit(final AnnotationMemberDeclaration n, final Void arg) { } @Override - public void visit(final MarkerAnnotationExpr n, final Void arg) { + public void visit(final MarkerAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -2040,7 +2037,7 @@ public void visit(final MarkerAnnotationExpr n, final Void arg) { } @Override - public void visit(final SingleMemberAnnotationExpr n, final Void arg) { + public void visit(final SingleMemberAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -2051,7 +2048,7 @@ public void visit(final SingleMemberAnnotationExpr n, final Void arg) { } @Override - public void visit(final NormalAnnotationExpr n, final Void arg) { + public void visit(final NormalAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -2070,7 +2067,7 @@ public void visit(final NormalAnnotationExpr n, final Void arg) { } @Override - public void visit(final MemberValuePair n, final Void arg) { + public void visit(final MemberValuePair n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -2079,7 +2076,7 @@ public void visit(final MemberValuePair n, final Void arg) { } @Override - public void visit(final LineComment n, final Void arg) { + public void visit(final LineComment n, final Void arg) { if (!getOption(ConfigOption.PRINT_COMMENTS).isPresent()) { return; } @@ -2087,7 +2084,7 @@ public void visit(final LineComment n, final Void arg) { } @Override - public void visit(final BlockComment n, final Void arg) { + public void visit(final BlockComment n, final Void arg) { if (!getOption(ConfigOption.PRINT_COMMENTS).isPresent()) { return; } @@ -2107,7 +2104,7 @@ public void visit(final BlockComment n, final Void arg) { } @Override - public void visit(LambdaExpr n, Void arg) { + public void visit(LambdaExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); final NodeList parameters = n.getParameters(); @@ -2136,7 +2133,7 @@ public void visit(LambdaExpr n, Void arg) { } @Override - public void visit(MethodReferenceExpr n, Void arg) { + public void visit(MethodReferenceExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); Expression scope = n.getScope(); @@ -2152,7 +2149,7 @@ public void visit(MethodReferenceExpr n, Void arg) { } @Override - public void visit(TypeExpr n, Void arg) { + public void visit(TypeExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getType() != null) { @@ -2161,14 +2158,14 @@ public void visit(TypeExpr n, Void arg) { } @Override - public void visit(NodeList n, Void arg) { + public void visit(NodeList n, Void arg) { for (Object node : n) { ((Node) node).accept(this, arg); } } @Override - public void visit(final ImportDeclaration n, final Void arg) { + public void visit(final ImportDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.isJmlModel()) { @@ -2191,7 +2188,7 @@ public void visit(final ImportDeclaration n, final Void arg) { } @Override - public void visit(ModuleDeclaration n, Void arg) { + public void visit(ModuleDeclaration n, Void arg) { printMemberAnnotations(n.getAnnotations(), arg); if (n.isOpen()) { printer.print("open "); @@ -2204,7 +2201,7 @@ public void visit(ModuleDeclaration n, Void arg) { } @Override - public void visit(ModuleRequiresDirective n, Void arg) { + public void visit(ModuleRequiresDirective n, Void arg) { printer.print("requires "); printModifiers(n.getModifiers()); n.getName().accept(this, arg); @@ -2212,7 +2209,7 @@ public void visit(ModuleRequiresDirective n, Void arg) { } @Override - public void visit(ModuleExportsDirective n, Void arg) { + public void visit(ModuleExportsDirective n, Void arg) { printer.print("exports "); n.getName().accept(this, arg); printPrePostFixOptionalList(n.getModuleNames(), arg, " to ", ", ", ""); @@ -2220,7 +2217,7 @@ public void visit(ModuleExportsDirective n, Void arg) { } @Override - public void visit(ModuleProvidesDirective n, Void arg) { + public void visit(ModuleProvidesDirective n, Void arg) { printer.print("provides "); n.getName().accept(this, arg); printPrePostFixRequiredList(n.getWith(), arg, " with ", ", ", ""); @@ -2228,14 +2225,14 @@ public void visit(ModuleProvidesDirective n, Void arg) { } @Override - public void visit(ModuleUsesDirective n, Void arg) { + public void visit(ModuleUsesDirective n, Void arg) { printer.print("uses "); n.getName().accept(this, arg); printer.println(";"); } @Override - public void visit(ModuleOpensDirective n, Void arg) { + public void visit(ModuleOpensDirective n, Void arg) { printer.print("opens "); n.getName().accept(this, arg); printPrePostFixOptionalList(n.getModuleNames(), arg, " to ", ", ", ""); @@ -2243,7 +2240,7 @@ public void visit(ModuleOpensDirective n, Void arg) { } @Override - public void visit(UnparsableStmt n, Void arg) { + public void visit(UnparsableStmt n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printer.print("???;"); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/DotPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/DotPrinter.java index 76a2bbd369..5039a1a333 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/DotPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/DotPrinter.java @@ -32,17 +32,17 @@ /** * Outputs a Graphviz diagram of the AST. */ -public class DotPrinter { +public class DotPrinter { private int nodeCount; private final boolean outputNodeType; - public DotPrinter(boolean outputNodeType) { + public DotPrinter(boolean outputNodeType) { this.outputNodeType = outputNodeType; } - public String output(Node node) { + public String output(Node node) { nodeCount = 0; StringBuilder output = new StringBuilder(); output.append("digraph {"); @@ -51,7 +51,7 @@ public String output(Node node) { return output.toString(); } - public void output(Node node, String parentNodeName, String name, StringBuilder builder) { + public void output(Node node, String parentNodeName, String name, StringBuilder builder) { assertNotNull(node); NodeMetaModel metaModel = node.getMetaModel(); List allPropertyMetaModels = metaModel.getAllPropertyMetaModels(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java index 14dc8a6e3c..0c82c2e7a0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrintVisitor.java @@ -59,7 +59,7 @@ * This class could be removed in a future version. Use defaultPrettyPrinterVisitor. */ @Deprecated -public class PrettyPrintVisitor implements VoidVisitor { +public class PrettyPrintVisitor implements VoidVisitor { private static Pattern RTRIM = Pattern.compile("\\s+$"); @@ -67,12 +67,12 @@ public class PrettyPrintVisitor implements VoidVisitor { protected final SourcePrinter printer; - public PrettyPrintVisitor(PrettyPrinterConfiguration prettyPrinterConfiguration) { + public PrettyPrintVisitor(PrettyPrinterConfiguration prettyPrinterConfiguration) { this.configuration = prettyPrinterConfiguration; printer = new SourcePrinter(configuration); } - public void setConfiguration(PrettyPrinterConfiguration prettyPrinterConfiguration) { + public void setConfiguration(PrettyPrinterConfiguration prettyPrinterConfiguration) { this.configuration = prettyPrinterConfiguration; } @@ -80,12 +80,12 @@ public void setConfiguration(PrettyPrinterConfiguration prettyPrinterConfigurat * @deprecated use toString() */ @Deprecated - public String getSource() { + public String getSource() { return printer.toString(); } @Override - public String toString() { + public String toString() { return printer.toString(); } @@ -214,7 +214,7 @@ protected void printComment(final Optional comment, final Void arg) { } @Override - public void visit(final CompilationUnit n, final Void arg) { + public void visit(final CompilationUnit n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getParsed() == UNPARSABLE) { @@ -240,7 +240,7 @@ public void visit(final CompilationUnit n, final Void arg) { } @Override - public void visit(final PackageDeclaration n, final Void arg) { + public void visit(final PackageDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -252,7 +252,7 @@ public void visit(final PackageDeclaration n, final Void arg) { } @Override - public void visit(final NameExpr n, final Void arg) { + public void visit(final NameExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -260,7 +260,7 @@ public void visit(final NameExpr n, final Void arg) { } @Override - public void visit(final Name n, final Void arg) { + public void visit(final Name n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getQualifier().isPresent()) { @@ -272,12 +272,12 @@ public void visit(final Name n, final Void arg) { } @Override - public void visit(SimpleName n, Void arg) { + public void visit(SimpleName n, Void arg) { printer.print(n.getIdentifier()); } @Override - public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { + public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -330,7 +330,7 @@ public void visit(final ClassOrInterfaceDeclaration n, final Void arg) { } @Override - public void visit(RecordDeclaration n, Void arg) { + public void visit(RecordDeclaration n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -370,7 +370,7 @@ public void visit(RecordDeclaration n, Void arg) { } @Override - public void visit(final JavadocComment n, final Void arg) { + public void visit(final JavadocComment n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); if (configuration.isPrintComments() && configuration.isPrintJavadoc()) { printer.println(n.getHeader()); @@ -411,7 +411,7 @@ public void visit(final JavadocComment n, final Void arg) { } @Override - public void visit(final ClassOrInterfaceType n, final Void arg) { + public void visit(final ClassOrInterfaceType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getScope().isPresent()) { @@ -428,7 +428,7 @@ public void visit(final ClassOrInterfaceType n, final Void arg) { } @Override - public void visit(final TypeParameter n, final Void arg) { + public void visit(final TypeParameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -446,7 +446,7 @@ public void visit(final TypeParameter n, final Void arg) { } @Override - public void visit(final PrimitiveType n, final Void arg) { + public void visit(final PrimitiveType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), true, arg); @@ -454,7 +454,7 @@ public void visit(final PrimitiveType n, final Void arg) { } @Override - public void visit(final ArrayType n, final Void arg) { + public void visit(final ArrayType n, final Void arg) { final List arrayTypeBuffer = new LinkedList<>(); Type type = n; while (type instanceof ArrayType) { @@ -470,7 +470,7 @@ public void visit(final ArrayType n, final Void arg) { } @Override - public void visit(final ArrayCreationLevel n, final Void arg) { + public void visit(final ArrayCreationLevel n, final Void arg) { printAnnotations(n.getAnnotations(), true, arg); printer.print("["); if (n.getDimension().isPresent()) { @@ -480,7 +480,7 @@ public void visit(final ArrayCreationLevel n, final Void arg) { } @Override - public void visit(final IntersectionType n, final Void arg) { + public void visit(final IntersectionType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -496,7 +496,7 @@ public void visit(final IntersectionType n, final Void arg) { } @Override - public void visit(final UnionType n, final Void arg) { + public void visit(final UnionType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), true, arg); @@ -512,7 +512,7 @@ public void visit(final UnionType n, final Void arg) { } @Override - public void visit(final WildcardType n, final Void arg) { + public void visit(final WildcardType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -528,12 +528,12 @@ public void visit(final WildcardType n, final Void arg) { } @Override - public void visit(final UnknownType n, final Void arg) { + public void visit(final UnknownType n, final Void arg) { // Nothing to print } @Override - public void visit(final FieldDeclaration n, final Void arg) { + public void visit(final FieldDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -557,7 +557,7 @@ public void visit(final FieldDeclaration n, final Void arg) { } @Override - public void visit(final VariableDeclarator n, final Void arg) { + public void visit(final VariableDeclarator n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -581,7 +581,7 @@ public void visit(final VariableDeclarator n, final Void arg) { } @Override - public void visit(final ArrayInitializerExpr n, final Void arg) { + public void visit(final ArrayInitializerExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("{"); @@ -601,7 +601,7 @@ public void visit(final ArrayInitializerExpr n, final Void arg) { } @Override - public void visit(final VoidType n, final Void arg) { + public void visit(final VoidType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -609,7 +609,7 @@ public void visit(final VoidType n, final Void arg) { } @Override - public void visit(final VarType n, final Void arg) { + public void visit(final VarType n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -617,13 +617,13 @@ public void visit(final VarType n, final Void arg) { } @Override - public void visit(Modifier n, Void arg) { + public void visit(Modifier n, Void arg) { printer.print(n.getKeyword().asString()); printer.print(" "); } @Override - public void visit(final ArrayAccessExpr n, final Void arg) { + public void visit(final ArrayAccessExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -633,7 +633,7 @@ public void visit(final ArrayAccessExpr n, final Void arg) { } @Override - public void visit(final ArrayCreationExpr n, final Void arg) { + public void visit(final ArrayCreationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("new "); @@ -648,7 +648,7 @@ public void visit(final ArrayCreationExpr n, final Void arg) { } @Override - public void visit(final AssignExpr n, final Void arg) { + public void visit(final AssignExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getTarget().accept(this, arg); @@ -666,7 +666,7 @@ public void visit(final AssignExpr n, final Void arg) { * work in progress for issue-545 */ @Override - public void visit(final BinaryExpr n, final Void arg) { + public void visit(final BinaryExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getLeft().accept(this, arg); @@ -681,7 +681,7 @@ public void visit(final BinaryExpr n, final Void arg) { } @Override - public void visit(final CastExpr n, final Void arg) { + public void visit(final CastExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("("); @@ -691,7 +691,7 @@ public void visit(final CastExpr n, final Void arg) { } @Override - public void visit(final ClassExpr n, final Void arg) { + public void visit(final ClassExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getType().accept(this, arg); @@ -699,7 +699,7 @@ public void visit(final ClassExpr n, final Void arg) { } @Override - public void visit(final ConditionalExpr n, final Void arg) { + public void visit(final ConditionalExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getCondition().accept(this, arg); @@ -710,7 +710,7 @@ public void visit(final ConditionalExpr n, final Void arg) { } @Override - public void visit(final EnclosedExpr n, final Void arg) { + public void visit(final EnclosedExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("("); @@ -719,7 +719,7 @@ public void visit(final EnclosedExpr n, final Void arg) { } @Override - public void visit(final FieldAccessExpr n, final Void arg) { + public void visit(final FieldAccessExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getScope().accept(this, arg); @@ -728,7 +728,7 @@ public void visit(final FieldAccessExpr n, final Void arg) { } @Override - public void visit(final InstanceOfExpr n, final Void arg) { + public void visit(final InstanceOfExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getExpression().accept(this, arg); @@ -741,7 +741,7 @@ public void visit(final InstanceOfExpr n, final Void arg) { } @Override - public void visit(final TypePatternExpr n, final Void arg) { + public void visit(final TypePatternExpr n, final Void arg) { printModifiers(n.getModifiers()); n.getType().accept(this, arg); printer.print(" "); @@ -749,7 +749,7 @@ public void visit(final TypePatternExpr n, final Void arg) { } @Override - public void visit(final RecordPatternExpr n, final Void arg) { + public void visit(final RecordPatternExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getType().accept(this, arg); @@ -757,148 +757,148 @@ public void visit(final RecordPatternExpr n, final Void arg) { } @Override - public void visit(JmlQuantifiedExpr jmlQuantifiedExpr, Void arg) { + public void visit(JmlQuantifiedExpr jmlQuantifiedExpr, Void arg) { } @Override - public void visit(JmlClauseLabel n, Void arg) { + public void visit(JmlClauseLabel n, Void arg) { } @Override - public void visit(JmlExpressionStmt n, Void arg) { + public void visit(JmlExpressionStmt n, Void arg) { } @Override - public void visit(JmlLabelExpr n, Void arg) { + public void visit(JmlLabelExpr n, Void arg) { } @Override - public void visit(JmlLetExpr n, Void arg) { + public void visit(JmlLetExpr n, Void arg) { } @Override - public void visit(JmlMultiCompareExpr n, Void arg) { + public void visit(JmlMultiCompareExpr n, Void arg) { } @Override - public void visit(JmlSimpleExprClause n, Void arg) { + public void visit(JmlSimpleExprClause n, Void arg) { } @Override - public void visit(JmlSignalsClause n, Void arg) { + public void visit(JmlSignalsClause n, Void arg) { } @Override - public void visit(JmlSignalsOnlyClause n, Void arg) { + public void visit(JmlSignalsOnlyClause n, Void arg) { } @Override - public void visit(JmlUnreachableStmt n, Void arg) { + public void visit(JmlUnreachableStmt n, Void arg) { } @Override - public void visit(JmlCallableClause n, Void arg) { + public void visit(JmlCallableClause n, Void arg) { } @Override - public void visit(JmlForallClause n, Void arg) { + public void visit(JmlForallClause n, Void arg) { } @Override - public void visit(JmlRefiningStmt n, Void arg) { + public void visit(JmlRefiningStmt n, Void arg) { } @Override - public void visit(JmlClauseIf n, Void arg) { + public void visit(JmlClauseIf n, Void arg) { } @Override - public void visit(JmlClassExprDeclaration n, Void arg) { + public void visit(JmlClassExprDeclaration n, Void arg) { } @Override - public void visit(JmlClassAccessibleDeclaration n, Void arg) { + public void visit(JmlClassAccessibleDeclaration n, Void arg) { } @Override - public void visit(JmlRepresentsDeclaration n, Void arg) { + public void visit(JmlRepresentsDeclaration n, Void arg) { } @Override - public void visit(JmlContract n, Void arg) { + public void visit(JmlContract n, Void arg) { } @Override - public void visit(JmlSetComprehensionExpr n, Void arg) { + public void visit(JmlSetComprehensionExpr n, Void arg) { } @Override - public void visit(JmlGhostStmt n, Void arg) { + public void visit(JmlGhostStmt n, Void arg) { } @Override - public void visit(JmlMethodDeclaration n, Void arg) { + public void visit(JmlMethodDeclaration n, Void arg) { n.getMethodDeclaration().accept(this, arg); } @Override - public void visit(JmlBinaryInfixExpr n, Void arg) { + public void visit(JmlBinaryInfixExpr n, Void arg) { } @Override - public void visit(JmlDocDeclaration n, Void arg) { + public void visit(JmlDocDeclaration n, Void arg) { n.getJmlComments().forEach(it -> it.accept(this, arg)); } @Override - public void visit(JmlDocStmt n, Void arg) { + public void visit(JmlDocStmt n, Void arg) { n.getJmlComments().forEach(it -> it.accept(this, arg)); } @Override - public void visit(JmlDoc n, Void arg) { + public void visit(JmlDoc n, Void arg) { printer.print(n.getContent().asString()); } @Override - public void visit(JmlDocType n, Void arg) { + public void visit(JmlDocType n, Void arg) { } @Override - public void visit(JmlFieldDeclaration n, Void arg) { + public void visit(JmlFieldDeclaration n, Void arg) { } @Override - public void visit(JmlOldClause n, Void arg) { + public void visit(JmlOldClause n, Void arg) { } @Override - public void visit(JmlTypeExpr n, Void arg) { + public void visit(JmlTypeExpr n, Void arg) { n.getType().accept(this, arg); } @Override - public void visit(JmlMultiExprClause n, Void arg) { + public void visit(JmlMultiExprClause n, Void arg) { } @Override - public void visit(JmlBeginStmt n, Void arg) { + public void visit(JmlBeginStmt n, Void arg) { } @Override - public void visit(JmlEndStmt n, Void arg) { + public void visit(JmlEndStmt n, Void arg) { } @Override - public void visit(JmlLabelStmt n, Void arg) { + public void visit(JmlLabelStmt n, Void arg) { } @Override - public void visit(JmlMethodSignature n, Void arg) { + public void visit(JmlMethodSignature n, Void arg) { } @Override - public void visit(final CharLiteralExpr n, final Void arg) { + public void visit(final CharLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("'"); @@ -907,28 +907,28 @@ public void visit(final CharLiteralExpr n, final Void arg) { } @Override - public void visit(final DoubleLiteralExpr n, final Void arg) { + public void visit(final DoubleLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final IntegerLiteralExpr n, final Void arg) { + public void visit(final IntegerLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final LongLiteralExpr n, final Void arg) { + public void visit(final LongLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(n.getValue()); } @Override - public void visit(final StringLiteralExpr n, final Void arg) { + public void visit(final StringLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("\""); @@ -937,7 +937,7 @@ public void visit(final StringLiteralExpr n, final Void arg) { } @Override - public void visit(final TextBlockLiteralExpr n, final Void arg) { + public void visit(final TextBlockLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("\"\"\""); @@ -951,21 +951,21 @@ public void visit(final TextBlockLiteralExpr n, final Void arg) { } @Override - public void visit(final BooleanLiteralExpr n, final Void arg) { + public void visit(final BooleanLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(String.valueOf(n.getValue())); } @Override - public void visit(final NullLiteralExpr n, final Void arg) { + public void visit(final NullLiteralExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("null"); } @Override - public void visit(final ThisExpr n, final Void arg) { + public void visit(final ThisExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getTypeName().isPresent()) { @@ -976,7 +976,7 @@ public void visit(final ThisExpr n, final Void arg) { } @Override - public void visit(final SuperExpr n, final Void arg) { + public void visit(final SuperExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getTypeName().isPresent()) { @@ -987,7 +987,7 @@ public void visit(final SuperExpr n, final Void arg) { } @Override - public void visit(final MethodCallExpr n, final Void arg) { + public void visit(final MethodCallExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); // determine whether we do reindenting for aligmnent at all @@ -1072,7 +1072,7 @@ public void visit(final MethodCallExpr n, final Void arg) { } @Override - public void visit(final ObjectCreationExpr n, final Void arg) { + public void visit(final ObjectCreationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.hasScope()) { @@ -1096,7 +1096,7 @@ public void visit(final ObjectCreationExpr n, final Void arg) { } @Override - public void visit(final UnaryExpr n, final Void arg) { + public void visit(final UnaryExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getOperator().isPrefix()) { @@ -1109,7 +1109,7 @@ public void visit(final UnaryExpr n, final Void arg) { } @Override - public void visit(final ConstructorDeclaration n, final Void arg) { + public void visit(final ConstructorDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1145,7 +1145,7 @@ public void visit(final ConstructorDeclaration n, final Void arg) { } @Override - public void visit(final CompactConstructorDeclaration n, final Void arg) { + public void visit(final CompactConstructorDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1170,7 +1170,7 @@ public void visit(final CompactConstructorDeclaration n, final Void arg) { } @Override - public void visit(final MethodDeclaration n, final Void arg) { + public void visit(final MethodDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1218,7 +1218,7 @@ public void visit(final MethodDeclaration n, final Void arg) { } @Override - public void visit(final Parameter n, final Void arg) { + public void visit(final Parameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -1235,7 +1235,7 @@ public void visit(final Parameter n, final Void arg) { } @Override - public void visit(final ReceiverParameter n, final Void arg) { + public void visit(final ReceiverParameter n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printAnnotations(n.getAnnotations(), false, arg); @@ -1245,7 +1245,7 @@ public void visit(final ReceiverParameter n, final Void arg) { } @Override - public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { + public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.isThis()) { @@ -1264,7 +1264,7 @@ public void visit(final ExplicitConstructorInvocationStmt n, final Void arg) { } @Override - public void visit(final VariableDeclarationExpr n, final Void arg) { + public void visit(final VariableDeclarationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getParentNode().map(ExpressionStmt.class::isInstance).orElse(false)) { @@ -1287,21 +1287,21 @@ public void visit(final VariableDeclarationExpr n, final Void arg) { } @Override - public void visit(final LocalClassDeclarationStmt n, final Void arg) { + public void visit(final LocalClassDeclarationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getClassDeclaration().accept(this, arg); } @Override - public void visit(final LocalRecordDeclarationStmt n, final Void arg) { + public void visit(final LocalRecordDeclarationStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getRecordDeclaration().accept(this, arg); } @Override - public void visit(final AssertStmt n, final Void arg) { + public void visit(final AssertStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("assert "); @@ -1314,7 +1314,7 @@ public void visit(final AssertStmt n, final Void arg) { } @Override - public void visit(final BlockStmt n, final Void arg) { + public void visit(final BlockStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.println("{"); @@ -1331,7 +1331,7 @@ public void visit(final BlockStmt n, final Void arg) { } @Override - public void visit(final LabeledStmt n, final Void arg) { + public void visit(final LabeledStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getLabel().accept(this, arg); @@ -1340,14 +1340,14 @@ public void visit(final LabeledStmt n, final Void arg) { } @Override - public void visit(final EmptyStmt n, final Void arg) { + public void visit(final EmptyStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(";"); } @Override - public void visit(final ExpressionStmt n, final Void arg) { + public void visit(final ExpressionStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getExpression().accept(this, arg); @@ -1355,13 +1355,13 @@ public void visit(final ExpressionStmt n, final Void arg) { } @Override - public void visit(final SwitchStmt n, final Void arg) { + public void visit(final SwitchStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printSwitchNode(n, arg); } @Override - public void visit(SwitchExpr n, Void arg) { + public void visit(SwitchExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printSwitchNode(n, arg); } @@ -1382,7 +1382,7 @@ private void printSwitchNode(SwitchNode n, Void arg) { } @Override - public void visit(final SwitchEntry n, final Void arg) { + public void visit(final SwitchEntry n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); // old/new switch @@ -1420,7 +1420,7 @@ public void visit(final SwitchEntry n, final Void arg) { } @Override - public void visit(final BreakStmt n, final Void arg) { + public void visit(final BreakStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("break"); @@ -1429,7 +1429,7 @@ public void visit(final BreakStmt n, final Void arg) { } @Override - public void visit(final YieldStmt n, final Void arg) { + public void visit(final YieldStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("yield "); @@ -1438,7 +1438,7 @@ public void visit(final YieldStmt n, final Void arg) { } @Override - public void visit(final ReturnStmt n, final Void arg) { + public void visit(final ReturnStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("return"); @@ -1450,7 +1450,7 @@ public void visit(final ReturnStmt n, final Void arg) { } @Override - public void visit(final EnumDeclaration n, final Void arg) { + public void visit(final EnumDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1498,7 +1498,7 @@ public void visit(final EnumDeclaration n, final Void arg) { } @Override - public void visit(final EnumConstantDeclaration n, final Void arg) { + public void visit(final EnumConstantDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1516,7 +1516,7 @@ public void visit(final EnumConstantDeclaration n, final Void arg) { } @Override - public void visit(final InitializerDeclaration n, final Void arg) { + public void visit(final InitializerDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.isStatic()) { @@ -1526,7 +1526,7 @@ public void visit(final InitializerDeclaration n, final Void arg) { } @Override - public void visit(final IfStmt n, final Void arg) { + public void visit(final IfStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("if ("); @@ -1564,7 +1564,7 @@ public void visit(final IfStmt n, final Void arg) { } @Override - public void visit(final WhileStmt n, final Void arg) { + public void visit(final WhileStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("while ("); @@ -1574,7 +1574,7 @@ public void visit(final WhileStmt n, final Void arg) { } @Override - public void visit(final ContinueStmt n, final Void arg) { + public void visit(final ContinueStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("continue"); @@ -1583,7 +1583,7 @@ public void visit(final ContinueStmt n, final Void arg) { } @Override - public void visit(final DoStmt n, final Void arg) { + public void visit(final DoStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("do "); @@ -1594,7 +1594,7 @@ public void visit(final DoStmt n, final Void arg) { } @Override - public void visit(final ForEachStmt n, final Void arg) { + public void visit(final ForEachStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("for ("); @@ -1606,7 +1606,7 @@ public void visit(final ForEachStmt n, final Void arg) { } @Override - public void visit(final ForStmt n, final Void arg) { + public void visit(final ForStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("for ("); @@ -1638,7 +1638,7 @@ public void visit(final ForStmt n, final Void arg) { } @Override - public void visit(final ThrowStmt n, final Void arg) { + public void visit(final ThrowStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("throw "); @@ -1647,7 +1647,7 @@ public void visit(final ThrowStmt n, final Void arg) { } @Override - public void visit(final SynchronizedStmt n, final Void arg) { + public void visit(final SynchronizedStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("synchronized ("); @@ -1657,7 +1657,7 @@ public void visit(final SynchronizedStmt n, final Void arg) { } @Override - public void visit(final TryStmt n, final Void arg) { + public void visit(final TryStmt n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("try "); @@ -1692,7 +1692,7 @@ public void visit(final TryStmt n, final Void arg) { } @Override - public void visit(final CatchClause n, final Void arg) { + public void visit(final CatchClause n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print(" catch ("); @@ -1702,7 +1702,7 @@ public void visit(final CatchClause n, final Void arg) { } @Override - public void visit(final AnnotationDeclaration n, final Void arg) { + public void visit(final AnnotationDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1719,7 +1719,7 @@ public void visit(final AnnotationDeclaration n, final Void arg) { } @Override - public void visit(final AnnotationMemberDeclaration n, final Void arg) { + public void visit(final AnnotationMemberDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printMemberAnnotations(n.getAnnotations(), arg); @@ -1736,7 +1736,7 @@ public void visit(final AnnotationMemberDeclaration n, final Void arg) { } @Override - public void visit(final MarkerAnnotationExpr n, final Void arg) { + public void visit(final MarkerAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -1744,7 +1744,7 @@ public void visit(final MarkerAnnotationExpr n, final Void arg) { } @Override - public void visit(final SingleMemberAnnotationExpr n, final Void arg) { + public void visit(final SingleMemberAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -1755,7 +1755,7 @@ public void visit(final SingleMemberAnnotationExpr n, final Void arg) { } @Override - public void visit(final NormalAnnotationExpr n, final Void arg) { + public void visit(final NormalAnnotationExpr n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("@"); @@ -1774,7 +1774,7 @@ public void visit(final NormalAnnotationExpr n, final Void arg) { } @Override - public void visit(final MemberValuePair n, final Void arg) { + public void visit(final MemberValuePair n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); n.getName().accept(this, arg); @@ -1783,7 +1783,7 @@ public void visit(final MemberValuePair n, final Void arg) { } @Override - public void visit(final LineComment n, final Void arg) { + public void visit(final LineComment n, final Void arg) { if (configuration.isIgnoreComments()) { return; } @@ -1791,7 +1791,7 @@ public void visit(final LineComment n, final Void arg) { } @Override - public void visit(final BlockComment n, final Void arg) { + public void visit(final BlockComment n, final Void arg) { if (configuration.isIgnoreComments()) { return; } @@ -1811,7 +1811,7 @@ public void visit(final BlockComment n, final Void arg) { } @Override - public void visit(LambdaExpr n, Void arg) { + public void visit(LambdaExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); final NodeList parameters = n.getParameters(); @@ -1840,7 +1840,7 @@ public void visit(LambdaExpr n, Void arg) { } @Override - public void visit(MethodReferenceExpr n, Void arg) { + public void visit(MethodReferenceExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); Expression scope = n.getScope(); @@ -1856,7 +1856,7 @@ public void visit(MethodReferenceExpr n, Void arg) { } @Override - public void visit(TypeExpr n, Void arg) { + public void visit(TypeExpr n, Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); if (n.getType() != null) { @@ -1865,7 +1865,7 @@ public void visit(TypeExpr n, Void arg) { } @Override - public void visit(NodeList n, Void arg) { + public void visit(NodeList n, Void arg) { if (configuration.isOrderImports() && n.size() > 0 && n.get(0) instanceof ImportDeclaration) { // noinspection unchecked NodeList modifiableList = new NodeList<>(n); @@ -1881,7 +1881,7 @@ public void visit(NodeList n, Void arg) { } @Override - public void visit(final ImportDeclaration n, final Void arg) { + public void visit(final ImportDeclaration n, final Void arg) { printOrphanCommentsBeforeThisChildNode(n); printComment(n.getComment(), arg); printer.print("import "); @@ -1897,7 +1897,7 @@ public void visit(final ImportDeclaration n, final Void arg) { } @Override - public void visit(ModuleDeclaration n, Void arg) { + public void visit(ModuleDeclaration n, Void arg) { printMemberAnnotations(n.getAnnotations(), arg); if (n.isOpen()) { printer.print("open "); @@ -1910,7 +1910,7 @@ public void visit(ModuleDeclaration n, Void arg) { } @Override - public void visit(ModuleRequiresDirective n, Void arg) { + public void visit(ModuleRequiresDirective n, Void arg) { printer.print("requires "); printModifiers(n.getModifiers()); n.getName().accept(this, arg); @@ -1918,7 +1918,7 @@ public void visit(ModuleRequiresDirective n, Void arg) { } @Override - public void visit(ModuleExportsDirective n, Void arg) { + public void visit(ModuleExportsDirective n, Void arg) { printer.print("exports "); n.getName().accept(this, arg); printPrePostFixOptionalList(n.getModuleNames(), arg, " to ", ", ", ""); @@ -1926,7 +1926,7 @@ public void visit(ModuleExportsDirective n, Void arg) { } @Override - public void visit(ModuleProvidesDirective n, Void arg) { + public void visit(ModuleProvidesDirective n, Void arg) { printer.print("provides "); n.getName().accept(this, arg); printPrePostFixRequiredList(n.getWith(), arg, " with ", ", ", ""); @@ -1934,14 +1934,14 @@ public void visit(ModuleProvidesDirective n, Void arg) { } @Override - public void visit(ModuleUsesDirective n, Void arg) { + public void visit(ModuleUsesDirective n, Void arg) { printer.print("uses "); n.getName().accept(this, arg); printer.println(";"); } @Override - public void visit(ModuleOpensDirective n, Void arg) { + public void visit(ModuleOpensDirective n, Void arg) { printer.print("opens "); n.getName().accept(this, arg); printPrePostFixOptionalList(n.getModuleNames(), arg, " to ", ", ", ""); @@ -1949,7 +1949,7 @@ public void visit(ModuleOpensDirective n, Void arg) { } @Override - public void visit(UnparsableStmt n, Void arg) { + public void visit(UnparsableStmt n, Void arg) { printer.print("???;"); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrinter.java index cfc774f6d9..b654d617aa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/PrettyPrinter.java @@ -34,21 +34,21 @@ * @deprecated This class could be removed in a future version. Use defaultPrettyPrinter. */ @Deprecated -public class PrettyPrinter implements Printer { +public class PrettyPrinter implements Printer { private PrinterConfiguration configuration; private Function> visitorFactory; - public PrettyPrinter() { + public PrettyPrinter() { this(new PrettyPrinterConfiguration()); } - public PrettyPrinter(PrettyPrinterConfiguration configuration) { + public PrettyPrinter(PrettyPrinterConfiguration configuration) { this(configuration, PrettyPrintVisitor::new); } - public PrettyPrinter(PrettyPrinterConfiguration configuration, Function> visitorFactory) { + public PrettyPrinter(PrettyPrinterConfiguration configuration, Function> visitorFactory) { this.configuration = configuration; this.visitorFactory = visitorFactory; } @@ -56,14 +56,14 @@ public PrettyPrinter(PrettyPrinterConfiguration configuration, Function visitor = visitorFactory.apply((PrettyPrinterConfiguration) configuration); node.accept(visitor, null); return visitor.toString(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/Printer.java b/javaparser-core/src/main/java/com/github/javaparser/printer/Printer.java index 232b9541c5..72a363d218 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/Printer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/Printer.java @@ -26,7 +26,7 @@ * Printer interface defines the API for a printer. * A printer outputs the AST as formatted Java source code. */ -public interface Printer { +public interface Printer { String print(Node node); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/SourcePrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/SourcePrinter.java index 53d4a10c0c..d3d709a30f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/SourcePrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/SourcePrinter.java @@ -31,7 +31,7 @@ /** * A support class for code that outputs formatted source code. */ -public class SourcePrinter { +public class SourcePrinter { private String endOfLineCharacter; @@ -72,7 +72,7 @@ public class SourcePrinter { * Add the default indentation to the current indentation and push it on the indentation stack. * Does not actually output anything. */ - public SourcePrinter indent() { + public SourcePrinter indent() { String currentIndent = indents.peek(); switch(indentation.getType()) { case SPACES: @@ -92,7 +92,7 @@ public SourcePrinter indent() { * Add to the current indentation until it is reaches "column" and push it on the indentation stack. * Does not actually output anything. */ - public SourcePrinter indentWithAlignTo(int column) { + public SourcePrinter indentWithAlignTo(int column) { indents.push(calculateIndentWithAlignTo(column)); return this; } @@ -140,7 +140,7 @@ private String calculateIndentWithAlignTo(int column) { * Pop the last indentation of the indentation stack. * Does not actually output anything. */ - public SourcePrinter unindent() { + public SourcePrinter unindent() { if (indents.isEmpty()) { // Since we start out with an empty indent on the stack, this will only occur // the second time we over-unindent. @@ -168,7 +168,7 @@ private void append(String arg) { * @return this instance, for nesting calls to method as fluent interface * @see SourcePrinter#println(String) */ - public SourcePrinter print(final String arg) { + public SourcePrinter print(final String arg) { if (!indented) { lastPrintedIndent = indents.peek(); append(lastPrintedIndent); @@ -189,7 +189,7 @@ public SourcePrinter print(final String arg) { * @param arg source line to be printed (should not contain newline/carriage-return characters) * @return this instance, for nesting calls to method as fluent interface */ - public SourcePrinter println(final String arg) { + public SourcePrinter println(final String arg) { print(arg); println(); return this; @@ -200,7 +200,7 @@ public SourcePrinter println(final String arg) { * * @return this instance, for nesting calls to method as fluent interface */ - public SourcePrinter println() { + public SourcePrinter println() { buf.append(endOfLineCharacter); // Start before the first column cursor = new Position(cursor.line + 1, Position.FIRST_COLUMN - 1); @@ -218,7 +218,7 @@ public SourcePrinter println() { * * @return the current cursor position (line, column). */ - public Position getCursor() { + public Position getCursor() { return cursor; } @@ -227,7 +227,7 @@ public Position getCursor() { * @deprecated use toString() */ @Deprecated - public String getSource() { + public String getSource() { return toString(); } @@ -235,14 +235,14 @@ public String getSource() { * @return the currently printed source code. */ @Override - public String toString() { + public String toString() { return buf.toString(); } /** * Changes all EOL characters in "content" to the EOL character this SourcePrinter is using. */ - public String normalizeEolInTextBlock(String content) { + public String normalizeEolInTextBlock(String content) { return Utils.normalizeEolInTextBlock(content, endOfLineCharacter); } @@ -250,7 +250,7 @@ public String normalizeEolInTextBlock(String content) { * Set the top-most indent to the column the cursor is currently in, can be undone with * {@link #reindentToPreviousLevel()}. Does not actually output anything. */ - public void reindentWithAlignToCursor() { + public void reindentWithAlignToCursor() { String newIndent = calculateIndentWithAlignTo(cursor.column); reindentedIndents.push(indents.pop()); indents.push(newIndent); @@ -260,7 +260,7 @@ public void reindentWithAlignToCursor() { * Set the top-most indent to the column the cursor was before the last {@link #reindentWithAlignToCursor()} call. * Does not actually output anything. */ - public void reindentToPreviousLevel() { + public void reindentToPreviousLevel() { if (reindentedIndents.isEmpty()) { throw new IllegalStateException("Reindent calls are not well-balanced."); } @@ -274,7 +274,7 @@ public void reindentToPreviousLevel() { * Once you do know, you can pop this indent ("unindent") and indent to the right column. * (Does not actually output anything.) */ - public void duplicateIndent() { + public void duplicateIndent() { indents.push(indents.peek()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/Stringable.java b/javaparser-core/src/main/java/com/github/javaparser/printer/Stringable.java index 817910256e..faa6373bf9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/Stringable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/Stringable.java @@ -23,7 +23,7 @@ /** * Something that has a printable form. I.e., it can be converted to a user-facing String. */ -public interface Stringable { +public interface Stringable { String asString(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/XmlPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/XmlPrinter.java index 462ce8d767..18c341fe75 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/XmlPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/XmlPrinter.java @@ -38,13 +38,13 @@ /** * Outputs an XML file containing the AST meant for inspecting it. */ -public class XmlPrinter { +public class XmlPrinter { private final boolean outputNodeType; private static final Class TYPE_CLASS = Type.class; - public XmlPrinter(boolean outputNodeType) { + public XmlPrinter(boolean outputNodeType) { this.outputNodeType = outputNodeType; } @@ -54,7 +54,7 @@ public XmlPrinter(boolean outputNodeType) { * @param node AST node to be converted to XML * @return XML document corresponding to node */ - public String output(Node node) { + public String output(Node node) { return stringWriterOutput(node, "root").toString(); } @@ -68,7 +68,7 @@ public String output(Node node) { * @param builder Target object to receive the generated XML */ @Deprecated - public void output(Node node, String name, int level, StringBuilder builder) { + public void output(Node node, String name, int level, StringBuilder builder) { builder.append(stringWriterOutput(node, name).toString()); } @@ -85,7 +85,7 @@ public void output(Node node, String name, int level, StringBuilder builder) { * @throws RuntimeXMLStreamException Unchecked exception wrapping checked {@link XMLStreamException}, when any * error on producing XML output occours */ - public StringWriter stringWriterOutput(Node node, String name) { + public StringWriter stringWriterOutput(Node node, String name) { StringWriter stringWriter = new StringWriter(); try { outputDocument(node, name, stringWriter); @@ -110,7 +110,7 @@ public StringWriter stringWriterOutput(Node node, String name) { * @param writer Target to get the document writen to * @throws XMLStreamException When any error on outputting XML occours */ - public void outputDocument(Node node, String name, Writer writer) throws XMLStreamException { + public void outputDocument(Node node, String name, Writer writer) throws XMLStreamException { XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(writer); try { @@ -143,7 +143,7 @@ public void outputDocument(Node node, String name, Writer writer) throws XMLStr * @throws XMLStreamException When any error on outputting XML occours * @see outputNode(String, Node, XMLStreamWriter) */ - public void outputDocument(Node node, String name, XMLStreamWriter xmlWriter) throws XMLStreamException { + public void outputDocument(Node node, String name, XMLStreamWriter xmlWriter) throws XMLStreamException { xmlWriter.writeStartDocument(); outputNode(node, name, xmlWriter); xmlWriter.writeEndDocument(); @@ -169,7 +169,7 @@ public void outputDocument(Node node, String name, XMLStreamWriter xmlWriter) t * @throws XMLStreamException When any error on outputting XML occours * @see outputDocument(String, Node, XMLStreamWriter) */ - public void outputNode(Node node, String name, XMLStreamWriter xmlWriter) throws XMLStreamException { + public void outputNode(Node node, String name, XMLStreamWriter xmlWriter) throws XMLStreamException { assertNotNull(node); assertNonEmpty(name); assertNotNull(xmlWriter); @@ -239,11 +239,11 @@ public static void print(Node node) { */ class RuntimeXMLStreamException extends RuntimeException { - public RuntimeXMLStreamException(XMLStreamException cause) { + public RuntimeXMLStreamException(XMLStreamException cause) { super(cause); } - public XMLStreamException getXMLStreamCause() { + public XMLStreamException getXMLStreamCause() { return (XMLStreamException) super.getCause(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/YamlPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/YamlPrinter.java index 5b586e1ae4..2350f5177e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/YamlPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/YamlPrinter.java @@ -31,17 +31,17 @@ /** * Outputs a YAML file containing the AST meant for inspecting it. */ -public class YamlPrinter { +public class YamlPrinter { private static final int NUM_SPACES_FOR_INDENT = 4; private final boolean outputNodeType; - public YamlPrinter(boolean outputNodeType) { + public YamlPrinter(boolean outputNodeType) { this.outputNodeType = outputNodeType; } - public String output(Node node) { + public String output(Node node) { StringBuilder output = new StringBuilder(); output.append("---"); output(node, "root", 0, output); @@ -49,7 +49,7 @@ public String output(Node node) { return output.toString(); } - public void output(Node node, String name, int level, StringBuilder builder) { + public void output(Node node, String name, int level, StringBuilder builder) { assertNotNull(node); NodeMetaModel metaModel = node.getMetaModel(); List allPropertyMetaModels = metaModel.getAllPropertyMetaModels(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmAttribute.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmAttribute.java index a941eca4b5..2b684cef17 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmAttribute.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmAttribute.java @@ -27,20 +27,20 @@ import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.printer.SourcePrinter; -public class CsmAttribute implements CsmElement { +public class CsmAttribute implements CsmElement { - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } private final ObservableProperty property; - public CsmAttribute(ObservableProperty property) { + public CsmAttribute(ObservableProperty property) { this.property = property; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { Object value = property.getRawValue(node); printer.print(PrintingHelper.printToString(value)); } @@ -51,7 +51,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { * * @param tokenText Operator's token text */ - public int getTokenType(Node node, String text, String tokenText) { + public int getTokenType(Node node, String text, String tokenText) { switch(property) { case IDENTIFIER: return GeneratedJavaParserConstants.IDENTIFIER; @@ -87,7 +87,7 @@ public int getTokenType(Node node, String text, String tokenText) { } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmChar.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmChar.java index e1dea06614..3b453abf0b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmChar.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmChar.java @@ -24,27 +24,27 @@ import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.printer.SourcePrinter; -public class CsmChar implements CsmElement { +public class CsmChar implements CsmElement { private final ObservableProperty property; - public CsmChar(ObservableProperty property) { + public CsmChar(ObservableProperty property) { this.property = property; } - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { printer.print("'"); printer.print(property.getValueAsStringAttribute(node)); printer.print("'"); } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmComment.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmComment.java index df3ea687de..e0cc2d4787 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmComment.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmComment.java @@ -24,7 +24,7 @@ import com.github.javaparser.ast.comments.Comment; import com.github.javaparser.printer.SourcePrinter; -public class CsmComment implements CsmElement { +public class CsmComment implements CsmElement { static void process(Comment comment, SourcePrinter printer) { String content = printer.normalizeEolInTextBlock(comment.getContent()); @@ -34,7 +34,7 @@ static void process(Comment comment, SourcePrinter printer) { } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { node.getComment().ifPresent(c -> process(c, printer)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmConditional.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmConditional.java index a037e80392..b343e74d01 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmConditional.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmConditional.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.List; -public class CsmConditional implements CsmElement { +public class CsmConditional implements CsmElement { private final Condition condition; @@ -37,30 +37,30 @@ public class CsmConditional implements CsmElement { private final CsmElement elseElement; - public Condition getCondition() { + public Condition getCondition() { return condition; } - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { if (properties.size() > 1) { throw new IllegalStateException(); } return properties.get(0); } - public List getProperties() { + public List getProperties() { return properties; } - public CsmElement getThenElement() { + public CsmElement getThenElement() { return thenElement; } - public CsmElement getElseElement() { + public CsmElement getElseElement() { return elseElement; } - public enum Condition { + public enum Condition { IS_EMPTY { @@ -97,14 +97,14 @@ boolean evaluate(Node node, ObservableProperty property) { abstract boolean evaluate(Node node, ObservableProperty property); } - public CsmConditional(ObservableProperty property, Condition condition, CsmElement thenElement, CsmElement elseElement) { + public CsmConditional(ObservableProperty property, Condition condition, CsmElement thenElement, CsmElement elseElement) { this.properties = Arrays.asList(property); this.condition = condition; this.thenElement = thenElement; this.elseElement = elseElement; } - public CsmConditional(List properties, Condition condition, CsmElement thenElement, CsmElement elseElement) { + public CsmConditional(List properties, Condition condition, CsmElement thenElement, CsmElement elseElement) { if (properties.size() < 1) { throw new IllegalArgumentException(); } @@ -114,12 +114,12 @@ public CsmConditional(List properties, Condition condition, this.elseElement = elseElement; } - public CsmConditional(ObservableProperty property, Condition condition, CsmElement thenElement) { + public CsmConditional(ObservableProperty property, Condition condition, CsmElement thenElement) { this(property, condition, thenElement, new CsmNone()); } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { boolean test = false; for (ObservableProperty prop : properties) { test = test || condition.evaluate(node, prop); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmElement.java index e2327be3ef..cd5c27a43b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmElement.java @@ -31,7 +31,7 @@ import java.util.Arrays; import java.util.List; -public interface CsmElement { +public interface CsmElement { void prettyPrint(Node node, SourcePrinter printer); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmIndent.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmIndent.java index dd790df574..bc4dfc7410 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmIndent.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmIndent.java @@ -25,10 +25,10 @@ import com.github.javaparser.printer.lexicalpreservation.TextElement; import com.github.javaparser.printer.lexicalpreservation.TokenTextElement; -public class CsmIndent implements CsmElement { +public class CsmIndent implements CsmElement { @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { printer.indent(); } @@ -36,17 +36,17 @@ public void prettyPrint(Node node, SourcePrinter printer) { * Verifies if the content of the {@code CsmElement} is the same as the provided {@code TextElement} */ @Override - public boolean isCorrespondingElement(TextElement textElement) { + public boolean isCorrespondingElement(TextElement textElement) { return (textElement instanceof TokenTextElement) && ((TokenTextElement) textElement).isSpaceOrTab(); } @Override - public int hashCode() { + public int hashCode() { return 1; } @Override - public boolean equals(Object obj) { + public boolean equals(Object obj) { return obj instanceof CsmIndent; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmList.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmList.java index c7f08d5679..c0bccf6416 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmList.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmList.java @@ -28,7 +28,7 @@ import java.util.Collection; import java.util.Iterator; -public class CsmList implements CsmElement { +public class CsmList implements CsmElement { private final ObservableProperty property; @@ -40,35 +40,35 @@ public class CsmList implements CsmElement { private final CsmElement following; - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } - public CsmElement getSeparatorPost() { + public CsmElement getSeparatorPost() { return separatorPost; } - public CsmElement getSeparatorPre() { + public CsmElement getSeparatorPre() { return separatorPre; } - public CsmElement getPreceeding() { + public CsmElement getPreceeding() { return preceeding; } - public CsmElement getFollowing() { + public CsmElement getFollowing() { return following; } - public CsmList(ObservableProperty property, CsmElement separator) { + public CsmList(ObservableProperty property, CsmElement separator) { this(property, new CsmNone(), separator, new CsmNone(), new CsmNone()); } - public CsmList(ObservableProperty property) { + public CsmList(ObservableProperty property) { this(property, new CsmNone(), new CsmNone(), new CsmNone(), new CsmNone()); } - public CsmList(ObservableProperty property, CsmElement separatorPre, CsmElement separatorPost, CsmElement preceeding, CsmElement following) { + public CsmList(ObservableProperty property, CsmElement separatorPre, CsmElement separatorPost, CsmElement preceeding, CsmElement following) { this.property = property; this.separatorPre = separatorPre; this.separatorPost = separatorPost; @@ -77,7 +77,7 @@ public CsmList(ObservableProperty property, CsmElement separatorPre, CsmElement } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { if (property.isAboutNodes()) { NodeList nodeList = property.getValueAsMultipleReference(node); if (nodeList == null) { @@ -122,7 +122,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmMix.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmMix.java index 7f6e115f71..f173958439 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmMix.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmMix.java @@ -29,11 +29,11 @@ /** * A group of elements that could be in any order. */ -public class CsmMix implements CsmElement { +public class CsmMix implements CsmElement { private List elements; - public CsmMix(List elements) { + public CsmMix(List elements) { if (elements == null) { throw new NullPointerException(); } @@ -43,17 +43,17 @@ public CsmMix(List elements) { this.elements = elements; } - public List getElements() { + public List getElements() { return elements; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { elements.forEach(e -> e.prettyPrint(node, printer)); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -63,12 +63,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return elements != null ? elements.hashCode() : 0; } @Override - public String toString() { + public String toString() { return elements.stream().map(e -> e.toString()).collect(Collectors.joining(",", "CsmMix[", "]")); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmNone.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmNone.java index 18966f6f4b..2316612fe9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmNone.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmNone.java @@ -23,9 +23,9 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.printer.SourcePrinter; -public class CsmNone implements CsmElement { +public class CsmNone implements CsmElement { @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmOrphanCommentsEnding.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmOrphanCommentsEnding.java index 06a709328f..73268b6d68 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmOrphanCommentsEnding.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmOrphanCommentsEnding.java @@ -27,10 +27,10 @@ import java.util.LinkedList; import java.util.List; -public class CsmOrphanCommentsEnding implements CsmElement { +public class CsmOrphanCommentsEnding implements CsmElement { @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { List everything = new LinkedList<>(); everything.addAll(node.getChildNodes()); sortByBeginPosition(everything); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSequence.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSequence.java index 5adb69b91a..a9e71d8d30 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSequence.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSequence.java @@ -26,11 +26,11 @@ import java.util.Objects; import java.util.stream.Collectors; -public class CsmSequence implements CsmElement { +public class CsmSequence implements CsmElement { private List elements; - public CsmSequence(List elements) { + public CsmSequence(List elements) { if (elements == null) { throw new NullPointerException(); } @@ -40,17 +40,17 @@ public CsmSequence(List elements) { this.elements = elements; } - public List getElements() { + public List getElements() { return elements; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { elements.forEach(e -> e.prettyPrint(node, printer)); } @Override - public String toString() { + public String toString() { return elements.stream().map(e -> e.toString()).collect(Collectors.joining(",", "CsmSequence[", "]")); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSingleReference.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSingleReference.java index 4ce41fc907..769822ff2b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSingleReference.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmSingleReference.java @@ -25,20 +25,20 @@ import com.github.javaparser.printer.ConcreteSyntaxModel; import com.github.javaparser.printer.SourcePrinter; -public class CsmSingleReference implements CsmElement { +public class CsmSingleReference implements CsmElement { private final ObservableProperty property; - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } - public CsmSingleReference(ObservableProperty property) { + public CsmSingleReference(ObservableProperty property) { this.property = property; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { Node child = property.getValueAsSingleReference(node); if (child != null) { ConcreteSyntaxModel.genericPrettyPrint(child, printer); @@ -46,7 +46,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmString.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmString.java index a05fdde5f9..b35351b672 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmString.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmString.java @@ -24,27 +24,27 @@ import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.printer.SourcePrinter; -public class CsmString implements CsmElement { +public class CsmString implements CsmElement { private final ObservableProperty property; - public CsmString(ObservableProperty property) { + public CsmString(ObservableProperty property) { this.property = property; } - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { printer.print("\""); printer.print(property.getValueAsStringAttribute(node)); printer.print("\""); } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmTextBlock.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmTextBlock.java index eb36259d20..e54758ed82 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmTextBlock.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmTextBlock.java @@ -24,20 +24,20 @@ import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.printer.SourcePrinter; -public class CsmTextBlock implements CsmElement { +public class CsmTextBlock implements CsmElement { private final ObservableProperty property; - public CsmTextBlock(ObservableProperty property) { + public CsmTextBlock(ObservableProperty property) { this.property = property; } - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { printer.print("\"\"\""); // Per https://openjdk.java.net/jeps/378#1--Line-terminators, any 'CRLF' and 'CR' are turned into 'LF' before // interpreting the text @@ -48,7 +48,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), getProperty()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmToken.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmToken.java index fa0e0b1acd..5422417421 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmToken.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmToken.java @@ -30,21 +30,21 @@ import com.github.javaparser.printer.lexicalpreservation.TokenTextElement; import com.github.javaparser.utils.LineSeparator; -public class CsmToken implements CsmElement { +public class CsmToken implements CsmElement { private final int tokenType; private String content; - public int getTokenType() { + public int getTokenType() { return tokenType; } - public String getContent() { + public String getContent() { return content; } - public CsmToken(int tokenType) { + public CsmToken(int tokenType) { this.tokenType = tokenType; this.content = GeneratedJavaParserConstants.tokenImage[tokenType]; if (content.startsWith("\"")) { @@ -60,13 +60,13 @@ public CsmToken(int tokenType) { } } - public CsmToken(int tokenType, String content) { + public CsmToken(int tokenType, String content) { this.tokenType = tokenType; this.content = content; } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { if (isEndOfLineToken(tokenType)) { printer.println(); } else { @@ -75,12 +75,12 @@ public void prettyPrint(Node node, SourcePrinter printer) { } @Override - public String toString() { + public String toString() { return String.format("%s(property:%s)", this.getClass().getSimpleName(), content); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -94,21 +94,21 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = tokenType; result = 31 * result + (content != null ? content.hashCode() : 0); return result; } - public boolean isWhiteSpace() { + public boolean isWhiteSpace() { return TokenTypes.isWhitespace(tokenType); } - public boolean isWhiteSpaceNotEol() { + public boolean isWhiteSpaceNotEol() { return isWhiteSpace() && !isNewLine(); } - public boolean isNewLine() { + public boolean isNewLine() { return TokenTypes.isEndOfLineToken(tokenType); } @@ -116,7 +116,7 @@ public boolean isNewLine() { * Verifies if the content of the {@code CsmElement} is the same as the provided {@code TextElement} */ @Override - public boolean isCorrespondingElement(TextElement textElement) { + public boolean isCorrespondingElement(TextElement textElement) { return (textElement instanceof TokenTextElement) && ((TokenTextElement) textElement).getTokenKind() == getTokenType() && ((TokenTextElement) textElement).getText().equals(getContent()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmUnindent.java b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmUnindent.java index 9f41819033..db359ebbca 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmUnindent.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/concretesyntaxmodel/CsmUnindent.java @@ -23,20 +23,20 @@ import com.github.javaparser.ast.Node; import com.github.javaparser.printer.SourcePrinter; -public class CsmUnindent implements CsmElement { +public class CsmUnindent implements CsmElement { @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { printer.unindent(); } @Override - public int hashCode() { + public int hashCode() { return 2; } @Override - public boolean equals(Object obj) { + public boolean equals(Object obj) { return obj instanceof CsmUnindent; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ConfigurationOption.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ConfigurationOption.java index f5d8dfce8e..136fb034fb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ConfigurationOption.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ConfigurationOption.java @@ -19,7 +19,7 @@ */ package com.github.javaparser.printer.configuration; -public interface ConfigurationOption { +public interface ConfigurationOption { /* * Set a currentValue to an option diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultConfigurationOption.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultConfigurationOption.java index ba34749869..c81642d715 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultConfigurationOption.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultConfigurationOption.java @@ -25,24 +25,24 @@ /* * An option is a pair of ConfigOption and a currentValue */ -public class DefaultConfigurationOption implements ConfigurationOption { +public class DefaultConfigurationOption implements ConfigurationOption { ConfigOption configOption; Object currentValue; - public DefaultConfigurationOption(ConfigOption configOption) { + public DefaultConfigurationOption(ConfigOption configOption) { this(configOption, null); } - public DefaultConfigurationOption(ConfigOption configOption, Object value) { + public DefaultConfigurationOption(ConfigOption configOption, Object value) { this.configOption = configOption; if (value != null) value(value); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (o == null || !(o instanceof DefaultConfigurationOption)) return false; DefaultConfigurationOption other = (DefaultConfigurationOption) o; @@ -50,7 +50,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return configOption.hashCode(); } @@ -58,7 +58,7 @@ public int hashCode() { * Set a currentValue to an option */ @Override - public ConfigurationOption value(Object value) { + public ConfigurationOption value(Object value) { Utils.assertNotNull(value); this.currentValue = value; // verify the currentValue's type @@ -72,7 +72,7 @@ public ConfigurationOption value(Object value) { * returns True if the option has a currentValue */ @Override - public boolean hasValue() { + public boolean hasValue() { return this.currentValue != null; } @@ -80,7 +80,7 @@ public boolean hasValue() { * returns the currentValue as an Integer */ @Override - public Integer asInteger() { + public Integer asInteger() { return cast(); } @@ -88,7 +88,7 @@ public Integer asInteger() { * returns the currentValue as a String */ @Override - public String asString() { + public String asString() { return cast(); } @@ -96,12 +96,12 @@ public String asString() { * returns the currentValue as a Boolean */ @Override - public Boolean asBoolean() { + public Boolean asBoolean() { return cast(); } @Override - public T asValue() { + public T asValue() { return cast(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultPrinterConfiguration.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultPrinterConfiguration.java index dd0aa0bb79..dc9934e250 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultPrinterConfiguration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/DefaultPrinterConfiguration.java @@ -31,9 +31,9 @@ /** * Configuration options for the {@link Printer}. */ -public class DefaultPrinterConfiguration implements PrinterConfiguration { +public class DefaultPrinterConfiguration implements PrinterConfiguration { - public enum ConfigOption { + public enum ConfigOption { /** * Order imports alphabetically @@ -142,14 +142,14 @@ ConfigOption(Class clazz, T value) { // an option contained in the set is considered as activated private Set defaultOptions = new HashSet<>(Arrays.asList(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS, ConfigOption.PRINT_COMMENTS.defaultValue), new DefaultConfigurationOption(ConfigOption.PRINT_JAVADOC, ConfigOption.PRINT_JAVADOC.defaultValue), new DefaultConfigurationOption(ConfigOption.SPACE_AROUND_OPERATORS, ConfigOption.SPACE_AROUND_OPERATORS.defaultValue), new DefaultConfigurationOption(ConfigOption.INDENT_CASE_IN_SWITCH, ConfigOption.INDENT_CASE_IN_SWITCH.defaultValue), new DefaultConfigurationOption(ConfigOption.MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY, ConfigOption.MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY.defaultValue), new DefaultConfigurationOption(ConfigOption.END_OF_LINE_CHARACTER, ConfigOption.END_OF_LINE_CHARACTER.defaultValue), new DefaultConfigurationOption(ConfigOption.INDENTATION, ConfigOption.INDENTATION.defaultValue))); - public DefaultPrinterConfiguration() { + public DefaultPrinterConfiguration() { } /* * add the specified option if it does not exist or replace the existing option */ @Override - public PrinterConfiguration addOption(ConfigurationOption option) { + public PrinterConfiguration addOption(ConfigurationOption option) { removeOption(option); defaultOptions.add(option); return this; @@ -159,7 +159,7 @@ public PrinterConfiguration addOption(ConfigurationOption option) { * remove the specified option */ @Override - public PrinterConfiguration removeOption(ConfigurationOption option) { + public PrinterConfiguration removeOption(ConfigurationOption option) { defaultOptions.remove(option); return this; } @@ -168,7 +168,7 @@ public PrinterConfiguration removeOption(ConfigurationOption option) { * True if an option is activated */ @Override - public boolean isActivated(ConfigurationOption option) { + public boolean isActivated(ConfigurationOption option) { return defaultOptions.contains(option); } @@ -176,7 +176,7 @@ public boolean isActivated(ConfigurationOption option) { * returns the specified option */ @Override - public Optional get(ConfigurationOption option) { + public Optional get(ConfigurationOption option) { return defaultOptions.stream().filter(o -> o.equals(option)).findFirst(); } @@ -184,7 +184,7 @@ public Optional get(ConfigurationOption option) { * returns all options configured */ @Override - public Set get() { + public Set get() { return defaultOptions; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ImportOrderingStrategy.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ImportOrderingStrategy.java index b4c6d8b46f..fda8c0c837 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ImportOrderingStrategy.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/ImportOrderingStrategy.java @@ -23,7 +23,7 @@ import com.github.javaparser.ast.NodeList; import java.util.List; -public interface ImportOrderingStrategy { +public interface ImportOrderingStrategy { /** * Sort the list of imports into groups. diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/Indentation.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/Indentation.java index 55f8924820..42b91a39fa 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/Indentation.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/Indentation.java @@ -22,9 +22,9 @@ /** * This class defines the characteristics of an indentation: the type (space, tabs..) and the size (How many characters must be used to indent the code). */ -public class Indentation { +public class Indentation { - public enum IndentType { + public enum IndentType { /** * Indent with spaces. @@ -67,11 +67,11 @@ private IndentType(Character c, int width) { this.width = width; } - public Character getCar() { + public Character getCar() { return car; } - public int getWidth() { + public int getWidth() { return width; } } @@ -91,7 +91,7 @@ public int getWidth() { /* * Creates an Indentation with a type and size */ - public Indentation(IndentType type, int size) { + public Indentation(IndentType type, int size) { this.type = type; this.size = size; format(); @@ -100,40 +100,40 @@ public Indentation(IndentType type, int size) { /* * Creates an Indentation with the default size */ - public Indentation(IndentType type) { + public Indentation(IndentType type) { this(type, DEFAULT_SIZE); } /* * set the size of the indentation (how many spaces or tabs?) */ - public Indentation setSize(int size) { + public Indentation setSize(int size) { this.size = size; format(); return this; } - public int getSize() { + public int getSize() { return size; } /* * set the type of the indentation (spaces, tabs...) */ - public Indentation setType(IndentType type) { + public Indentation setType(IndentType type) { this.type = type; format(); return this; } - public IndentType getType() { + public IndentType getType() { return type; } /* * returns the formatted string that represents the identification */ - public String getIndent() { + public String getIndent() { return formattedIndentation; } @@ -148,7 +148,7 @@ private void format() { } @Override - public String toString() { + public String toString() { return type.name() + " size=" + size; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrettyPrinterConfiguration.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrettyPrinterConfiguration.java index 2457317d3d..84e702f2da 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrettyPrinterConfiguration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrettyPrinterConfiguration.java @@ -35,25 +35,25 @@ * @deprecated This class could be removed in a future version. Use defaultPrinterConfiguration. */ @Deprecated -public class PrettyPrinterConfiguration implements PrinterConfiguration { +public class PrettyPrinterConfiguration implements PrinterConfiguration { PrinterConfiguration wrappedConfiguration; /* * Default constructor */ - public PrettyPrinterConfiguration() { + public PrettyPrinterConfiguration() { this.wrappedConfiguration = new DefaultPrinterConfiguration(); } /* * returns the indentation parameters */ - public Indentation getIndentation() { + public Indentation getIndentation() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.INDENTATION)).get().asValue(); } - public PrettyPrinterConfiguration setIndentation(Indentation indentation) { + public PrettyPrinterConfiguration setIndentation(Indentation indentation) { wrappedConfiguration.addOption(new DefaultConfigurationOption(ConfigOption.INDENTATION, indentation)); return this; } @@ -63,7 +63,7 @@ public PrettyPrinterConfiguration setIndentation(Indentation indentation) { * @deprecated (@ see Indentation.getIndent ()) */ @Deprecated - public String getIndent() { + public String getIndent() { return getIndentation().getIndent(); } @@ -72,7 +72,7 @@ public String getIndent() { * @deprecated (@ see Indentation.size) */ @Deprecated - public int getIndentSize() { + public int getIndentSize() { return getIndentation().getSize(); } @@ -82,7 +82,7 @@ public int getIndentSize() { * @deprecated (@ see Indentation.size ()) */ @Deprecated - public PrettyPrinterConfiguration setIndentSize(int indentSize) { + public PrettyPrinterConfiguration setIndentSize(int indentSize) { Indentation indentation = getIndentation().setSize(assertNonNegative(indentSize)); setIndentation(indentation); return this; @@ -94,7 +94,7 @@ public PrettyPrinterConfiguration setIndentSize(int indentSize) { * @deprecated (@ see Indentation.type) */ @Deprecated - public IndentType getIndentType() { + public IndentType getIndentType() { return getIndentation().getType(); } @@ -104,7 +104,7 @@ public IndentType getIndentType() { * @deprecated (@ see Indentation.type ()) */ @Deprecated - public PrettyPrinterConfiguration setIndentType(IndentType indentType) { + public PrettyPrinterConfiguration setIndentType(IndentType indentType) { Indentation indentation = getIndentation().setType(assertNotNull(indentType)); setIndentation(indentation); return this; @@ -116,7 +116,7 @@ public PrettyPrinterConfiguration setIndentType(IndentType indentType) { * @deprecated (@ see Indentation.size) */ @Deprecated - public int getTabWidth() { + public int getTabWidth() { return getIndentation().getSize(); } @@ -126,40 +126,40 @@ public int getTabWidth() { * @deprecated (@ see Indentation.size) */ @Deprecated - public PrettyPrinterConfiguration setTabWidth(int tabWidth) { + public PrettyPrinterConfiguration setTabWidth(int tabWidth) { setIndentSize(assertPositive(tabWidth)); return this; } - public boolean isOrderImports() { + public boolean isOrderImports() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.ORDER_IMPORTS)).isPresent(); } - public boolean isPrintComments() { + public boolean isPrintComments() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)).isPresent(); } - public boolean isIgnoreComments() { + public boolean isIgnoreComments() { return !wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)).isPresent(); } - public boolean isSpaceAroundOperators() { + public boolean isSpaceAroundOperators() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.SPACE_AROUND_OPERATORS)).isPresent(); } - public boolean isPrintJavadoc() { + public boolean isPrintJavadoc() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.PRINT_JAVADOC)).isPresent(); } - public boolean isColumnAlignParameters() { + public boolean isColumnAlignParameters() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_PARAMETERS)).isPresent(); } - public boolean isColumnAlignFirstMethodChain() { + public boolean isColumnAlignFirstMethodChain() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_FIRST_METHOD_CHAIN)).isPresent(); } - public boolean isIndentCaseInSwitch() { + public boolean isIndentCaseInSwitch() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.INDENT_CASE_IN_SWITCH)).isPresent(); } @@ -167,7 +167,7 @@ public boolean isIndentCaseInSwitch() { * When true, all comments will be printed, unless printJavadoc is false, then only line and block comments will be * printed. */ - public PrettyPrinterConfiguration setPrintComments(boolean printComments) { + public PrettyPrinterConfiguration setPrintComments(boolean printComments) { wrappedConfiguration = printComments ? addOption(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)) : removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)); return this; } @@ -175,7 +175,7 @@ public PrettyPrinterConfiguration setPrintComments(boolean printComments) { /** * When true, Javadoc will be printed. */ - public PrettyPrinterConfiguration setPrintJavadoc(boolean printJavadoc) { + public PrettyPrinterConfiguration setPrintJavadoc(boolean printJavadoc) { wrappedConfiguration = printJavadoc ? addOption(new DefaultConfigurationOption(ConfigOption.PRINT_JAVADOC)) : removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_JAVADOC)); return this; } @@ -183,34 +183,34 @@ public PrettyPrinterConfiguration setPrintJavadoc(boolean printJavadoc) { /** * Set if there should be spaces between operators */ - public PrettyPrinterConfiguration setSpaceAroundOperators(boolean spaceAroundOperators) { + public PrettyPrinterConfiguration setSpaceAroundOperators(boolean spaceAroundOperators) { wrappedConfiguration = spaceAroundOperators ? addOption(new DefaultConfigurationOption(ConfigOption.SPACE_AROUND_OPERATORS)) : removeOption(new DefaultConfigurationOption(ConfigOption.SPACE_AROUND_OPERATORS)); return this; } - public PrettyPrinterConfiguration setColumnAlignParameters(boolean columnAlignParameters) { + public PrettyPrinterConfiguration setColumnAlignParameters(boolean columnAlignParameters) { wrappedConfiguration = columnAlignParameters ? addOption(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_PARAMETERS)) : removeOption(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_PARAMETERS)); return this; } - public PrettyPrinterConfiguration setColumnAlignFirstMethodChain(boolean columnAlignFirstMethodChain) { + public PrettyPrinterConfiguration setColumnAlignFirstMethodChain(boolean columnAlignFirstMethodChain) { wrappedConfiguration = columnAlignFirstMethodChain ? addOption(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_FIRST_METHOD_CHAIN)) : removeOption(new DefaultConfigurationOption(ConfigOption.COLUMN_ALIGN_FIRST_METHOD_CHAIN)); return this; } - public PrettyPrinterConfiguration setIndentCaseInSwitch(boolean indentInSwitch) { + public PrettyPrinterConfiguration setIndentCaseInSwitch(boolean indentInSwitch) { wrappedConfiguration = indentInSwitch ? addOption(new DefaultConfigurationOption(ConfigOption.INDENT_CASE_IN_SWITCH)) : removeOption(new DefaultConfigurationOption(ConfigOption.INDENT_CASE_IN_SWITCH)); return this; } - public String getEndOfLineCharacter() { + public String getEndOfLineCharacter() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.END_OF_LINE_CHARACTER)).get().asValue(); } /** * Set the character to append when a line should end. Example values: "\n", "\r\n", "". */ - public PrettyPrinterConfiguration setEndOfLineCharacter(String endOfLineCharacter) { + public PrettyPrinterConfiguration setEndOfLineCharacter(String endOfLineCharacter) { addOption(new DefaultConfigurationOption(ConfigOption.END_OF_LINE_CHARACTER, endOfLineCharacter)); return this; } @@ -218,12 +218,12 @@ public PrettyPrinterConfiguration setEndOfLineCharacter(String endOfLineCharact /** * When true, orders imports by alphabetically. */ - public PrettyPrinterConfiguration setOrderImports(boolean orderImports) { + public PrettyPrinterConfiguration setOrderImports(boolean orderImports) { wrappedConfiguration = orderImports ? addOption(new DefaultConfigurationOption(ConfigOption.ORDER_IMPORTS)) : removeOption(new DefaultConfigurationOption(ConfigOption.ORDER_IMPORTS)); return this; } - public int getMaxEnumConstantsToAlignHorizontally() { + public int getMaxEnumConstantsToAlignHorizontally() { return wrappedConfiguration.get(new DefaultConfigurationOption(ConfigOption.MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY)).get().asInteger(); } @@ -250,33 +250,33 @@ public int getMaxEnumConstantsToAlignHorizontally() { * Set it to a large number to always align horizontally. * Set it to 1 or less to always align vertically. */ - public PrettyPrinterConfiguration setMaxEnumConstantsToAlignHorizontally(int maxEnumConstantsToAlignHorizontally) { + public PrettyPrinterConfiguration setMaxEnumConstantsToAlignHorizontally(int maxEnumConstantsToAlignHorizontally) { addOption(new DefaultConfigurationOption(ConfigOption.MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY, maxEnumConstantsToAlignHorizontally)); return this; } @Override - public PrinterConfiguration addOption(ConfigurationOption option) { + public PrinterConfiguration addOption(ConfigurationOption option) { return wrappedConfiguration.addOption(option); } @Override - public boolean isActivated(ConfigurationOption option) { + public boolean isActivated(ConfigurationOption option) { return wrappedConfiguration.isActivated(option); } @Override - public Optional get(ConfigurationOption option) { + public Optional get(ConfigurationOption option) { return wrappedConfiguration.get(option); } @Override - public Set get() { + public Set get() { return wrappedConfiguration.get(); } @Override - public PrinterConfiguration removeOption(ConfigurationOption option) { + public PrinterConfiguration removeOption(ConfigurationOption option) { return wrappedConfiguration.removeOption(option); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrinterConfiguration.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrinterConfiguration.java index 544a0f429e..48f0e17c60 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrinterConfiguration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/PrinterConfiguration.java @@ -26,7 +26,7 @@ * This interface defines the API for printer configuration. * An option can be added or removed from the configuration. An indentation can also be added to it. */ -public interface PrinterConfiguration { +public interface PrinterConfiguration { /* * add or update an option diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/imports/DefaultImportOrderingStrategy.java b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/imports/DefaultImportOrderingStrategy.java index f1402570d0..2ab79551bc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/imports/DefaultImportOrderingStrategy.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/configuration/imports/DefaultImportOrderingStrategy.java @@ -28,12 +28,12 @@ import java.util.List; import static java.util.Comparator.comparingInt; -public class DefaultImportOrderingStrategy implements ImportOrderingStrategy { +public class DefaultImportOrderingStrategy implements ImportOrderingStrategy { private boolean sortImportsAlphabetically = false; @Override - public List> sortImports(NodeList nodes) { + public List> sortImports(NodeList nodes) { if (sortImportsAlphabetically) { Comparator sortLogic = comparingInt((ImportDeclaration i) -> i.isStatic() ? 0 : 1).thenComparing(NodeWithName::getNameAsString); nodes.sort(sortLogic); @@ -42,12 +42,12 @@ public List> sortImports(NodeList> sortImports(NodeList nodes) { + public List> sortImports(NodeList nodes) { NodeList staticImports = new NodeList<>(); NodeList javaImports = new NodeList<>(); NodeList javaXImports = new NodeList<>(); @@ -71,12 +71,12 @@ public List> sortImports(NodeList> sortImports(NodeList nodes) { + public List> sortImports(NodeList nodes) { NodeList otherImports = new NodeList<>(); NodeList javaImports = new NodeList<>(); NodeList staticImports = new NodeList<>(); @@ -59,12 +59,12 @@ public List> sortImports(NodeList nodeClass) { + public boolean isChildOfClass(Class nodeClass) { return nodeClass.isInstance(child); } @@ -135,7 +135,7 @@ Optional getRange() { } @Override - public void accept(LexicalPreservingVisitor visitor) { + public void accept(LexicalPreservingVisitor visitor) { NodeText nodeText = getNodeTextForWrappedNode(); nodeText.getElements().forEach(element -> element.accept(visitor)); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java index 5c064cecef..fd2efece43 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Difference.java @@ -48,7 +48,7 @@ * * I should later be able to apply such difference to a nodeText. */ -public class Difference { +public class Difference { public static final int STANDARD_INDENTATION_SIZE = 4; @@ -262,11 +262,11 @@ private class EnforcingIndentationContext { int extraCharacters; - public EnforcingIndentationContext(int start) { + public EnforcingIndentationContext(int start) { this(start, 0); } - public EnforcingIndentationContext(int start, int extraCharacters) { + public EnforcingIndentationContext(int start, int extraCharacters) { this.start = start; this.extraCharacters = extraCharacters; } @@ -553,9 +553,9 @@ private void applyRemovedDiffElement(RemovedGroup removedGroup, Removed removed, if (isRemovingIndentationActivable(removedGroup)) { originalIndex = considerRemovingIndentation(nodeText, originalIndex); } - } else if (removed.isToken() && originalElementIsToken && (removed.getTokenType() == ((TokenTextElement) originalElement).getTokenKind() || // handle EOLs separately as their token kind might not be equal. This is because the + } else if (removed.isToken() && originalElementIsToken && (// handle EOLs separately as their token kind might not be equal. This is because the // 'removed' - // element always has the current operating system's EOL as type + removed.getTokenType() == ((TokenTextElement) originalElement).getTokenKind() || // element always has the current operating system's EOL as type (((TokenTextElement) originalElement).getToken().getCategory().isEndOfLine() && removed.isNewLine()))) { nodeText.removeElement(originalIndex); diffIndex++; @@ -1018,64 +1018,64 @@ public static class ArrayIterator implements ListIterator { ListIterator iterator; - public ArrayIterator(List elements) { + public ArrayIterator(List elements) { this(elements, 0); } - public ArrayIterator(List elements, int index) { + public ArrayIterator(List elements, int index) { this.iterator = elements.listIterator(index); } @Override - public boolean hasNext() { + public boolean hasNext() { return iterator.hasNext(); } @Override - public T next() { + public T next() { return iterator.next(); } @Override - public boolean hasPrevious() { + public boolean hasPrevious() { return iterator.hasPrevious(); } @Override - public T previous() { + public T previous() { return iterator.previous(); } @Override - public int nextIndex() { + public int nextIndex() { return iterator.nextIndex(); } @Override - public int previousIndex() { + public int previousIndex() { return iterator.previousIndex(); } /* * Returns the current index in the underlying list */ - public int index() { + public int index() { return iterator.nextIndex() - 1; } @Override - public void remove() { + public void remove() { iterator.remove(); ; } @Override - public void set(T e) { + public void set(T e) { iterator.set(e); } @Override - public void add(T e) { + public void add(T e) { iterator.add(e); ; } @@ -1124,7 +1124,7 @@ private boolean isReplaced(int diffIndex) { } @Override - public String toString() { + public String toString() { return "Difference{" + diffElements + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java index dc990bf469..33f28eae34 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElement.java @@ -22,7 +22,7 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmElement; -public interface DifferenceElement { +public interface DifferenceElement { static DifferenceElement added(CsmElement element) { return new Added(element); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java index e9bb36fc1f..52c095f299 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/DifferenceElementCalculator.java @@ -46,7 +46,7 @@ public static class ChildPositionInfo { } @Override - public boolean equals(Object other) { + public boolean equals(Object other) { if (other == null || !(other instanceof ChildPositionInfo)) return false; ChildPositionInfo cpi = (ChildPositionInfo) other; @@ -58,7 +58,7 @@ public boolean equals(Object other) { } @Override - public int hashCode() { + public int hashCode() { return node.hashCode() + position.hashCode(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java index 6c5694839b..3b998f8294 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Kept.java @@ -27,7 +27,7 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmToken; import com.github.javaparser.printer.concretesyntaxmodel.CsmUnindent; -public class Kept implements DifferenceElement { +public class Kept implements DifferenceElement { private final CsmElement element; @@ -36,12 +36,12 @@ public class Kept implements DifferenceElement { } @Override - public String toString() { + public String toString() { return "Kept{" + element + '}'; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -51,16 +51,16 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return element.hashCode(); } @Override - public CsmElement getElement() { + public CsmElement getElement() { return element; } - public int getTokenType() { + public int getTokenType() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.getTokenType(); @@ -69,33 +69,33 @@ public int getTokenType() { } @Override - public boolean isAdded() { + public boolean isAdded() { return false; } @Override - public boolean isRemoved() { + public boolean isRemoved() { return false; } @Override - public boolean isKept() { + public boolean isKept() { return true; } - public boolean isIndent() { + public boolean isIndent() { return element instanceof CsmIndent; } - public boolean isUnindent() { + public boolean isUnindent() { return element instanceof CsmUnindent; } - public boolean isToken() { + public boolean isToken() { return element instanceof CsmToken; } - public boolean isPrimitiveType() { + public boolean isPrimitiveType() { if (isChild()) { LexicalDifferenceCalculator.CsmChild csmChild = (LexicalDifferenceCalculator.CsmChild) element; return csmChild.getChild() instanceof PrimitiveType; @@ -103,7 +103,7 @@ public boolean isPrimitiveType() { return false; } - public boolean isWhiteSpace() { + public boolean isWhiteSpace() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.isWhiteSpace(); @@ -111,7 +111,7 @@ public boolean isWhiteSpace() { return false; } - public boolean isWhiteSpaceOrComment() { + public boolean isWhiteSpaceOrComment() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return TokenTypes.isWhitespaceOrComment(csmToken.getTokenType()); @@ -119,7 +119,7 @@ public boolean isWhiteSpaceOrComment() { return false; } - public boolean isNewLine() { + public boolean isNewLine() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.isNewLine(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java index 4a05d970ee..084bc921ed 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalDifferenceCalculator.java @@ -53,12 +53,12 @@ static class CalculatedSyntaxModel { this.elements = elements; } - public CalculatedSyntaxModel from(int index) { + public CalculatedSyntaxModel from(int index) { return new CalculatedSyntaxModel(new ArrayList<>(elements.subList(index, elements.size()))); } @Override - public String toString() { + public String toString() { return "CalculatedSyntaxModel{" + "elements=" + elements + '}'; } @@ -75,7 +75,7 @@ public static class CsmChild implements CsmElement { private final Node child; - public Node getChild() { + public Node getChild() { return child; } @@ -84,7 +84,7 @@ public Node getChild() { } @Override - public void prettyPrint(Node node, SourcePrinter printer) { + public void prettyPrint(Node node, SourcePrinter printer) { throw new UnsupportedOperationException("The prettyPrint method is not supported or implemented"); } @@ -92,17 +92,17 @@ public void prettyPrint(Node node, SourcePrinter printer) { * Verifies if the content of the {@code CsmElement} is the same as the provided {@code TextElement} */ @Override - public boolean isCorrespondingElement(TextElement textElement) { + public boolean isCorrespondingElement(TextElement textElement) { return (textElement instanceof ChildTextElement) && ((ChildTextElement) textElement).getChild() == getChild(); } @Override - public String toString() { + public String toString() { return "child(" + child.getClass().getSimpleName() + ")"; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -112,7 +112,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return child.hashCode(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java index 657f9c7b4f..b7444d4511 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.java @@ -58,7 +58,7 @@ * operating on the AST and then used them to reproduce the source code * in its original formatting including the AST changes. */ -public class LexicalPreservingPrinter { +public class LexicalPreservingPrinter { private static String JAVA_UTIL_OPTIONAL = Optional.class.getCanonicalName(); @@ -121,7 +121,7 @@ private static AstObserver createObserver() { private static class Observer extends PropagatingAstObserver { @Override - public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { + public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue) { if (oldValue == newValue) { // Not really a change, ignore return; @@ -134,9 +134,10 @@ public void concretePropertyChange(Node observedNode, ObservableProperty proper NodeText nodeText = parentNode.map(parent -> getOrCreateNodeText(parentNode.get())).orElseGet(() -> getOrCreateNodeText(observedNode)); if (oldValue == null) { // this case corresponds to the addition of a comment - int index = parentNode.isPresent() ? // Find the position of the comment node and put in front of it the [...] - nodeText.findChild(observedNode) : // - 0; + // Find the position of the comment node and put in front of it the [...] + int // Find the position of the comment node and put in front of it the [...] + index = // + parentNode.isPresent() ? nodeText.findChild(observedNode) : 0; /* Add the same indentation to the comment as the previous node * for example if we want to add a comment on the body of the method declaration : * Actual code @@ -378,7 +379,7 @@ private void fixIndentOfAddedNode(NodeText nodeText, int index) { } @Override - public void concreteListChange(NodeList changedList, ListChangeType type, int index, Node nodeAddedOrRemoved) { + public void concreteListChange(NodeList changedList, ListChangeType type, int index, Node nodeAddedOrRemoved) { NodeText nodeText = getOrCreateNodeText(changedList.getParentNodeForChildren()); final List differenceElements; if (type == AstObserver.ListChangeType.REMOVAL) { @@ -393,7 +394,7 @@ public void concreteListChange(NodeList changedList, ListChangeType type, in } @Override - public void concreteListReplacement(NodeList changedList, int index, Node oldValue, Node newValue) { + public void concreteListReplacement(NodeList changedList, int index, Node oldValue, Node newValue) { NodeText nodeText = getOrCreateNodeText(changedList.getParentNodeForChildren()); List differenceElements = LEXICAL_DIFFERENCE_CALCULATOR.calculateListReplacementDifference(findNodeListName(changedList), changedList, index, newValue); Difference difference = new Difference(differenceElements, nodeText, changedList.getParentNodeForChildren()); @@ -419,7 +420,7 @@ private static void storeInitialText(Node root) { new TreeVisitor() { @Override - public void process(Node node) { + public void process(Node node) { if (!node.isPhantom()) { storeInitialTextForOneNode(node, tokensByNode.get(node)); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java index b984e217b3..46eeb36fe9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingVisitor.java @@ -21,28 +21,28 @@ import java.io.StringWriter; -public class LexicalPreservingVisitor { +public class LexicalPreservingVisitor { private StringWriter writer; - public LexicalPreservingVisitor() { + public LexicalPreservingVisitor() { this(new StringWriter()); } - public LexicalPreservingVisitor(StringWriter writer) { + public LexicalPreservingVisitor(StringWriter writer) { this.writer = writer; } - public void visit(ChildTextElement child) { + public void visit(ChildTextElement child) { child.accept(this); } - public void visit(TokenTextElement token) { + public void visit(TokenTextElement token) { writer.append(token.getText()); } @Override - public String toString() { + public String toString() { return writer.toString(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java index 3c095026cc..0cece8c009 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/LookaheadIterator.java @@ -21,7 +21,7 @@ import java.util.NoSuchElementException; -public interface LookaheadIterator { +public interface LookaheadIterator { /** * Returns the next element in iteration without advancing the underlying iterator. @@ -35,7 +35,7 @@ public interface LookaheadIterator { * * @return the next element from the iterator */ - public E peek(); + public E peek(); /** * Returns the next element in iteration without advancing the underlying iterator. @@ -44,5 +44,5 @@ public interface LookaheadIterator { * @return the next element from the iterator * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} */ - public E element(); + public E element(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java index cffdb20171..fa1c6c7a71 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/NodeText.java @@ -125,7 +125,7 @@ int tryToFindChild(Node child, int from) { // // Removing single elements // - public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace) { + public void remove(TextElementMatcher matcher, boolean potentiallyFollowingWhitespace) { int i = 0; for (TextElement e : elements) { if (matcher.match(e)) { @@ -189,7 +189,7 @@ List getElements() { } @Override - public String toString() { + public String toString() { return "NodeText{" + elements + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java index bff2d59cd4..abd7e60305 100755 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PeekingIterator.java @@ -34,7 +34,7 @@ * @param the type of elements returned by this iterator. * @since 4.0 */ -public class PeekingIterator implements ListIterator, LookaheadIterator { +public class PeekingIterator implements ListIterator, LookaheadIterator { /** * The iterator being decorated. @@ -66,7 +66,7 @@ public class PeekingIterator implements ListIterator, LookaheadIterator PeekingIterator peekingIterator(final ListIterator iterator) { + public PeekingIterator peekingIterator(final ListIterator iterator) { Objects.requireNonNull(iterator, "iterator"); if (iterator instanceof PeekingIterator) { final PeekingIterator it = (PeekingIterator) iterator; @@ -80,7 +80,7 @@ public PeekingIterator peekingIterator(final ListIterator iterator) { * * @param iterator the iterator to decorate */ - public PeekingIterator(final ListIterator iterator) { + public PeekingIterator(final ListIterator iterator) { this.iterator = iterator; } @@ -89,7 +89,7 @@ public PeekingIterator(final ListIterator iterator) { * * @param list the provider of the iterator to decorate */ - public PeekingIterator(final List list) { + public PeekingIterator(final List list) { this.iterator = list.listIterator(); } @@ -108,7 +108,7 @@ private void fill() { } @Override - public boolean hasNext() { + public boolean hasNext() { if (exhausted) { return false; } @@ -128,7 +128,7 @@ public boolean hasNext() { * @return the next element from the iterator */ @Override - public E peek() { + public E peek() { fill(); return exhausted ? null : slot; } @@ -141,7 +141,7 @@ public E peek() { * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} */ @Override - public E element() { + public E element() { fill(); if (exhausted) { throw new NoSuchElementException(); @@ -150,7 +150,7 @@ public E element() { } @Override - public E next() { + public E next() { if (!hasNext()) { throw new NoSuchElementException(); } @@ -168,7 +168,7 @@ public E next() { * prior to the call to {@link #remove()} */ @Override - public void remove() { + public void remove() { if (slotFilled) { throw new IllegalStateException("peek() or element() called before remove()"); } @@ -176,17 +176,17 @@ public void remove() { } @Override - public boolean hasPrevious() { + public boolean hasPrevious() { return iterator.hasPrevious(); } @Override - public E previous() { + public E previous() { return iterator.previous(); } @Override - public int nextIndex() { + public int nextIndex() { return iterator.nextIndex(); } @@ -195,19 +195,19 @@ public int nextIndex() { * Returns list size - 1 if the listiterator is at the end of the list. * Returns -1 if the listiterator is at the beginning of the list. */ - public int currentIndex() { + public int currentIndex() { if (!hasPrevious()) return previousIndex(); return nextIndex() - 1; } @Override - public int previousIndex() { + public int previousIndex() { return iterator.previousIndex(); } @Override - public void set(E e) { + public void set(E e) { if (slotFilled) { throw new IllegalStateException("peek() or element() called before set()"); } @@ -215,7 +215,7 @@ public void set(E e) { } @Override - public void add(E e) { + public void add(E e) { if (slotFilled) { throw new IllegalStateException("peek() or element() called before add()"); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java index f8e7f45f24..880ed4694f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PhantomNodeLogic.java @@ -33,7 +33,7 @@ * @deprecated This class is no longer used phantom node are now an attribute of each node */ @Deprecated -public class PhantomNodeLogic { +public class PhantomNodeLogic { private static final int LEVELS_TO_EXPLORE = 3; @@ -42,7 +42,7 @@ public class PhantomNodeLogic { private static final AstObserver cacheCleaner = new AstObserverAdapter() { @Override - public void parentChange(Node observedNode, Node previousParent, Node newParent) { + public void parentChange(Node observedNode, Node previousParent, Node newParent) { isPhantomNodeCache.remove(observedNode); } }; diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java index 8129f45d22..944438d5af 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/PrintableTextElement.java @@ -19,7 +19,7 @@ */ package com.github.javaparser.printer.lexicalpreservation; -public interface PrintableTextElement { +public interface PrintableTextElement { void accept(LexicalPreservingVisitor visitor); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java index b0c882186b..41eecbd252 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Removed.java @@ -25,7 +25,7 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmElement; import com.github.javaparser.printer.concretesyntaxmodel.CsmToken; -public class Removed implements DifferenceElement { +public class Removed implements DifferenceElement { private final CsmElement element; @@ -34,12 +34,12 @@ public class Removed implements DifferenceElement { } @Override - public String toString() { + public String toString() { return "Removed{" + element + '}'; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -49,16 +49,16 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return element.hashCode(); } @Override - public CsmElement getElement() { + public CsmElement getElement() { return element; } - public Node getChild() { + public Node getChild() { if (isChild()) { LexicalDifferenceCalculator.CsmChild csmChild = (LexicalDifferenceCalculator.CsmChild) element; return csmChild.getChild(); @@ -66,7 +66,7 @@ public Node getChild() { throw new IllegalStateException("Removed is not a " + LexicalDifferenceCalculator.CsmChild.class.getSimpleName()); } - public int getTokenType() { + public int getTokenType() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.getTokenType(); @@ -75,25 +75,25 @@ public int getTokenType() { } @Override - public boolean isAdded() { + public boolean isAdded() { return false; } @Override - public boolean isRemoved() { + public boolean isRemoved() { return true; } @Override - public boolean isKept() { + public boolean isKept() { return false; } - public boolean isToken() { + public boolean isToken() { return element instanceof CsmToken; } - public boolean isPrimitiveType() { + public boolean isPrimitiveType() { if (isChild()) { LexicalDifferenceCalculator.CsmChild csmChild = (LexicalDifferenceCalculator.CsmChild) element; return csmChild.getChild() instanceof PrimitiveType; @@ -101,7 +101,7 @@ public boolean isPrimitiveType() { return false; } - public boolean isWhiteSpace() { + public boolean isWhiteSpace() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.isWhiteSpace(); @@ -109,7 +109,7 @@ public boolean isWhiteSpace() { return false; } - public boolean isWhiteSpaceNotEol() { + public boolean isWhiteSpaceNotEol() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.isWhiteSpaceNotEol(); @@ -117,7 +117,7 @@ public boolean isWhiteSpaceNotEol() { return false; } - public boolean isNewLine() { + public boolean isNewLine() { if (isToken()) { CsmToken csmToken = (CsmToken) element; return csmToken.isNewLine(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java index d9161e4d03..9a5a9fba07 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/RemovedGroup.java @@ -241,12 +241,12 @@ public final Iterator iterator() { private int currentIndex = 0; @Override - public boolean hasNext() { + public boolean hasNext() { return currentIndex < removedList.size() && removedList.get(currentIndex) != null; } @Override - public Removed next() { + public Removed next() { return removedList.get(currentIndex++); } }; diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java index 7c9790545e..03ff1eeec9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/Reshuffled.java @@ -30,7 +30,7 @@ * Elements in a CsmMix have been reshuffled. It could also mean that * some new elements have been added or removed to the mix. */ -public class Reshuffled implements DifferenceElement { +public class Reshuffled implements DifferenceElement { private final CsmMix previousOrder; @@ -42,12 +42,12 @@ public class Reshuffled implements DifferenceElement { } @Override - public String toString() { + public String toString() { return "Reshuffled{" + nextOrder + ", previous=" + previousOrder + '}'; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -59,37 +59,37 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = previousOrder.hashCode(); result = 31 * result + nextOrder.hashCode(); return result; } @Override - public CsmMix getElement() { + public CsmMix getElement() { return nextOrder; } - public CsmMix getPreviousOrder() { + public CsmMix getPreviousOrder() { return previousOrder; } - public CsmMix getNextOrder() { + public CsmMix getNextOrder() { return nextOrder; } @Override - public boolean isAdded() { + public boolean isAdded() { return false; } @Override - public boolean isRemoved() { + public boolean isRemoved() { return false; } @Override - public boolean isKept() { + public boolean isKept() { return false; } @@ -98,7 +98,7 @@ public boolean isKept() { * with all eof token replaced by the specified line separator. The line separator parameter must be a CsmToken with a valid line separator. */ @Override - public DifferenceElement replaceEolTokens(CsmElement lineSeparator) { + public DifferenceElement replaceEolTokens(CsmElement lineSeparator) { CsmMix modifiedNextOrder = new CsmMix(replaceTokens(nextOrder.getElements(), lineSeparator)); CsmMix modifiedPreviousOrder = new CsmMix(replaceTokens(previousOrder.getElements(), lineSeparator)); return new Reshuffled(modifiedPreviousOrder, modifiedNextOrder); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java index 05f8444ab2..88d359450f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ReshuffledDiffElementExtractor.java @@ -25,7 +25,7 @@ import com.github.javaparser.printer.lexicalpreservation.Difference.ArrayIterator; import java.util.*; -public class ReshuffledDiffElementExtractor { +public class ReshuffledDiffElementExtractor { private final NodeText nodeText; @@ -52,7 +52,7 @@ private ReshuffledDiffElementExtractor(NodeText nodeText) { this.nodeText = nodeText; } - public void extract(List diffElements) { + public void extract(List diffElements) { ArrayIterator iterator = new ArrayIterator<>(diffElements); while (iterator.hasNext()) { DifferenceElement diffElement = iterator.next(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java index 409f3b4a5c..bed8cb548b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElement.java @@ -36,7 +36,7 @@ final boolean isCommentToken() { } @Override - public boolean match(TextElement textElement) { + public boolean match(TextElement textElement) { return this.equals(textElement); } @@ -69,7 +69,7 @@ public final boolean isWhiteSpaceOrComment() { */ public abstract boolean isChildOfClass(Class nodeClass); - public boolean isChild() { + public boolean isChild() { return isChildOfClass(Node.class); } @@ -83,8 +83,8 @@ public boolean isChild() { * @return TextElementMatcher that matches any TextElement with the same Range */ TextElementMatcher matchByRange() { - return (TextElement textElement) -> getRange().flatMap(r1 -> textElement.getRange().map(r1::equals)).// We're missing range information. This may happen when a node is manually instantiated. Don't be too - // harsh on that: - orElse(true); + return (// We're missing range information. This may happen when a node is manually instantiated. Don't be too + TextElement textElement) -> // harsh on that: + getRange().flatMap(r1 -> textElement.getRange().map(r1::equals)).orElse(true); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java index 5dfd7e3733..c206efb376 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementIteratorsFactory.java @@ -43,13 +43,13 @@ interface Provider { private boolean lastReturnedFromNext = false; - public CascadingIterator(Iterator current, Provider nextProvider) { + public CascadingIterator(Iterator current, Provider nextProvider) { this.nextProvider = nextProvider; this.current = current; } @Override - public boolean hasNext() { + public boolean hasNext() { if (current.hasNext()) { return true; } @@ -60,7 +60,7 @@ public boolean hasNext() { } @Override - public E next() { + public E next() { if (current.hasNext()) { lastReturnedFromCurrent = true; lastReturnedFromNext = false; @@ -75,7 +75,7 @@ public E next() { } @Override - public void remove() { + public void remove() { if (lastReturnedFromCurrent) { current.remove(); return; @@ -91,12 +91,12 @@ public void remove() { static class EmptyIterator implements Iterator { @Override - public boolean hasNext() { + public boolean hasNext() { return false; } @Override - public E next() { + public E next() { throw new IllegalArgumentException(); } } @@ -112,18 +112,18 @@ private static class SingleElementIterator implements Iterator { } @Override - public boolean hasNext() { + public boolean hasNext() { return !returned; } @Override - public E next() { + public E next() { returned = true; return element; } @Override - public void remove() { + public void remove() { } } @@ -139,7 +139,7 @@ static class ComposedIterator implements Iterator { } @Override - public boolean hasNext() { + public boolean hasNext() { if (currIndex >= elements.size()) { return false; } @@ -151,7 +151,7 @@ public boolean hasNext() { } @Override - public E next() { + public E next() { if (!hasNext()) { throw new IllegalArgumentException(); } @@ -159,7 +159,7 @@ public E next() { } @Override - public void remove() { + public void remove() { elements.get(currIndex).remove(); } } @@ -170,7 +170,7 @@ private static Iterator reverseIterator(NodeText nodeText, int return new SingleElementIterator((TokenTextElement) textElement) { @Override - public void remove() { + public void remove() { nodeText.removeElement(index); } }; diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java index cabd5bb61b..696d998e70 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatcher.java @@ -20,7 +20,7 @@ */ package com.github.javaparser.printer.lexicalpreservation; -public interface TextElementMatcher { +public interface TextElementMatcher { boolean match(TextElement textElement); diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java index 2f2704ea73..3a21ddac4c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TextElementMatchers.java @@ -32,12 +32,12 @@ static TextElementMatcher byNode(final Node node) { return new TextElementMatcher() { @Override - public boolean match(TextElement textElement) { + public boolean match(TextElement textElement) { return textElement.isNode(node); } @Override - public String toString() { + public String toString() { return "match node " + node; } }; diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java index bed759f7bf..5d13a3c000 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/TokenTextElement.java @@ -26,7 +26,7 @@ import com.github.javaparser.ast.Node; import java.util.Optional; -public class TokenTextElement extends TextElement { +public class TokenTextElement extends TextElement { private final JavaToken token; @@ -43,25 +43,25 @@ public class TokenTextElement extends TextElement { } @Override - public String expand() { + public String expand() { return token.getText(); } // Visible for testing - public String getText() { + public String getText() { return token.getText(); } - public int getTokenKind() { + public int getTokenKind() { return token.getKind(); } - public JavaToken getToken() { + public JavaToken getToken() { return token; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -71,12 +71,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return token.hashCode(); } @Override - public String toString() { + public String toString() { return token.toString(); } @@ -91,52 +91,52 @@ boolean isNode(Node node) { } @Override - public boolean isWhiteSpace() { + public boolean isWhiteSpace() { return token.getCategory().isWhitespace(); } @Override - public boolean isSpaceOrTab() { + public boolean isSpaceOrTab() { return token.getCategory().isWhitespaceButNotEndOfLine(); } @Override - public boolean isComment() { + public boolean isComment() { return token.getCategory().isComment(); } @Override - public boolean isSeparator() { + public boolean isSeparator() { return token.getCategory().isSeparator(); } @Override - public boolean isNewline() { + public boolean isNewline() { return token.getCategory().isEndOfLine(); } @Override - public boolean isChildOfClass(Class nodeClass) { + public boolean isChildOfClass(Class nodeClass) { return false; } @Override - public boolean isIdentifier() { + public boolean isIdentifier() { return getToken().getCategory().isIdentifier(); } @Override - public boolean isKeyword() { + public boolean isKeyword() { return getToken().getCategory().isKeyword(); } @Override - public boolean isLiteral() { + public boolean isLiteral() { return getToken().getCategory().isLiteral(); } @Override - public boolean isPrimitive() { + public boolean isPrimitive() { return Kind.valueOf(getTokenKind()).isPrimitive(); } @@ -146,7 +146,7 @@ Optional getRange() { } @Override - public void accept(LexicalPreservingVisitor visitor) { + public void accept(LexicalPreservingVisitor visitor) { visitor.visit(this); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java index d4e0d158d2..37e7fba2fb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/Change.java @@ -28,7 +28,7 @@ /** * This represents a change that has happened to a specific Node. */ -public interface Change { +public interface Change { default boolean evaluate(CsmConditional csmConditional, Node node) { switch(csmConditional.getCondition()) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java index acae568092..ed45a3aa28 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListAdditionChange.java @@ -28,7 +28,7 @@ /** * The Addition of an element to a list. */ -public class ListAdditionChange implements Change { +public class ListAdditionChange implements Change { private final ObservableProperty observableProperty; @@ -36,14 +36,14 @@ public class ListAdditionChange implements Change { private final Node nodeAdded; - public ListAdditionChange(ObservableProperty observableProperty, int index, Node nodeAdded) { + public ListAdditionChange(ObservableProperty observableProperty, int index, Node nodeAdded) { this.observableProperty = observableProperty; this.index = index; this.nodeAdded = nodeAdded; } @Override - public Object getValue(ObservableProperty property, Node node) { + public Object getValue(ObservableProperty property, Node node) { if (property == observableProperty) { Object currentRawValue = new NoChange().getValue(property, node); if (currentRawValue instanceof Optional) { @@ -67,7 +67,7 @@ public Object getValue(ObservableProperty property, Node node) { } @Override - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return observableProperty; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java index a5e0ac2639..f81e9b6218 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListRemovalChange.java @@ -29,19 +29,19 @@ /** * The removal of an element from a list. */ -public class ListRemovalChange implements Change { +public class ListRemovalChange implements Change { private final ObservableProperty observableProperty; private final int index; - public ListRemovalChange(ObservableProperty observableProperty, int index) { + public ListRemovalChange(ObservableProperty observableProperty, int index) { this.observableProperty = observableProperty; this.index = index; } @Override - public Object getValue(ObservableProperty property, Node node) { + public Object getValue(ObservableProperty property, Node node) { if (property == observableProperty) { Object currentRawValue = new NoChange().getValue(property, node); if (currentRawValue instanceof Optional) { @@ -83,7 +83,7 @@ private boolean isSameRange(Range r1, Range r2) { } @Override - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return observableProperty; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java index 01047cd634..47e80c693f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/ListReplacementChange.java @@ -28,7 +28,7 @@ /** * The replacement of an element in a list. */ -public class ListReplacementChange implements Change { +public class ListReplacementChange implements Change { private final ObservableProperty observableProperty; @@ -36,14 +36,14 @@ public class ListReplacementChange implements Change { private final Node newValue; - public ListReplacementChange(ObservableProperty observableProperty, int index, Node newValue) { + public ListReplacementChange(ObservableProperty observableProperty, int index, Node newValue) { this.observableProperty = observableProperty; this.index = index; this.newValue = newValue; } @Override - public Object getValue(ObservableProperty property, Node node) { + public Object getValue(ObservableProperty property, Node node) { if (property == observableProperty) { Object currentRawValue = new NoChange().getValue(property, node); if (currentRawValue instanceof Optional) { @@ -67,7 +67,7 @@ public Object getValue(ObservableProperty property, Node node) { } @Override - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return observableProperty; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java index 332be3fd9d..a60c7eb4ee 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/NoChange.java @@ -26,15 +26,15 @@ /** * No change. The Node is not mutated. */ -public class NoChange implements Change { +public class NoChange implements Change { @Override - public Object getValue(ObservableProperty property, Node node) { + public Object getValue(ObservableProperty property, Node node) { return property.getRawValue(node); } @Override - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return null; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java index bcc25908e3..3fa75ed307 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/changes/PropertyChange.java @@ -26,7 +26,7 @@ /** * The change in value of a property. */ -public class PropertyChange implements Change { +public class PropertyChange implements Change { private final ObservableProperty property; @@ -34,27 +34,27 @@ public class PropertyChange implements Change { private final Object newValue; - public PropertyChange(ObservableProperty property, Object oldValue, Object newValue) { + public PropertyChange(ObservableProperty property, Object oldValue, Object newValue) { this.property = property; this.oldValue = oldValue; this.newValue = newValue; } @Override - public ObservableProperty getProperty() { + public ObservableProperty getProperty() { return property; } - public Object getOldValue() { + public Object getOldValue() { return oldValue; } - public Object getNewValue() { + public Object getNewValue() { return newValue; } @Override - public Object getValue(ObservableProperty property, Node node) { + public Object getValue(ObservableProperty property, Node node) { if (property == this.property) { return newValue; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/quality/NotNull.java b/javaparser-core/src/main/java/com/github/javaparser/quality/NotNull.java index af45b3ddd7..a2ff0e2c8c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/quality/NotNull.java +++ b/javaparser-core/src/main/java/com/github/javaparser/quality/NotNull.java @@ -26,5 +26,5 @@ @Documented @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.SOURCE) -public @interface NotNull { +public @interface NotNull { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/quality/Nullable.java b/javaparser-core/src/main/java/com/github/javaparser/quality/Nullable.java index 7997401e8e..6a10d8bf59 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/quality/Nullable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/quality/Nullable.java @@ -26,5 +26,5 @@ @Documented @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.SOURCE) -public @interface Nullable { +public @interface Nullable { } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/Context.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/Context.java index cd87c21c1a..504dbfc16d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/Context.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/Context.java @@ -39,7 +39,7 @@ * * @author Federico Tomassetti */ -public interface Context { +public interface Context { /** * Returns the node wrapped in the context diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodAmbiguityException.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodAmbiguityException.java index c26f2eab78..e927a84e6a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodAmbiguityException.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodAmbiguityException.java @@ -25,12 +25,12 @@ * * @author Federico Tomassetti */ -public class MethodAmbiguityException extends RuntimeException { +public class MethodAmbiguityException extends RuntimeException { /** * Create an instance from a description of the reason why there is ambiguity in this particular case. */ - public MethodAmbiguityException(String description) { + public MethodAmbiguityException(String description) { super(description); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodUsage.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodUsage.java index 86a5ff84e8..d1907db2bb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodUsage.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/MethodUsage.java @@ -34,7 +34,7 @@ * * @author Federico Tomassetti */ -public class MethodUsage implements ResolvedTypeParametrized { +public class MethodUsage implements ResolvedTypeParametrized { private ResolvedMethodDeclaration declaration; @@ -46,7 +46,7 @@ public class MethodUsage implements ResolvedTypeParametrized { private ResolvedTypeParametersMap typeParametersMap; - public MethodUsage(ResolvedMethodDeclaration declaration) { + public MethodUsage(ResolvedMethodDeclaration declaration) { this.typeParametersMap = ResolvedTypeParametersMap.empty(); this.declaration = declaration; paramTypes.addAll(declaration.formalParameterTypes()); @@ -54,11 +54,11 @@ public MethodUsage(ResolvedMethodDeclaration declaration) { returnType = declaration.getReturnType(); } - public MethodUsage(ResolvedMethodDeclaration declaration, List paramTypes, ResolvedType returnType) { + public MethodUsage(ResolvedMethodDeclaration declaration, List paramTypes, ResolvedType returnType) { this(declaration, paramTypes, returnType, declaration.getSpecifiedExceptions(), ResolvedTypeParametersMap.empty()); } - public MethodUsage(ResolvedMethodDeclaration declaration, List paramTypes, ResolvedType returnType, List exceptionTypes) { + public MethodUsage(ResolvedMethodDeclaration declaration, List paramTypes, ResolvedType returnType, List exceptionTypes) { this(declaration, paramTypes, returnType, exceptionTypes, ResolvedTypeParametersMap.empty()); } @@ -71,31 +71,31 @@ private MethodUsage(ResolvedMethodDeclaration declaration, List pa } @Override - public String toString() { + public String toString() { return "MethodUsage{" + "declaration=" + declaration + ", paramTypes=" + paramTypes + '}'; } - public ResolvedMethodDeclaration getDeclaration() { + public ResolvedMethodDeclaration getDeclaration() { return declaration; } - public String getName() { + public String getName() { return declaration.getName(); } - public ResolvedReferenceTypeDeclaration declaringType() { + public ResolvedReferenceTypeDeclaration declaringType() { return declaration.declaringType(); } - public ResolvedType returnType() { + public ResolvedType returnType() { return returnType; } - public List getParamTypes() { + public List getParamTypes() { return paramTypes; } - public MethodUsage replaceParamType(int i, ResolvedType replaced) { + public MethodUsage replaceParamType(int i, ResolvedType replaced) { if (i < 0 || i >= getNoParams()) { throw new IllegalArgumentException(); } @@ -107,7 +107,7 @@ public MethodUsage replaceParamType(int i, ResolvedType replaced) { return new MethodUsage(declaration, newParams, returnType, exceptionTypes, typeParametersMap); } - public MethodUsage replaceExceptionType(int i, ResolvedType replaced) { + public MethodUsage replaceExceptionType(int i, ResolvedType replaced) { if (i < 0 || i >= exceptionTypes.size()) { throw new IllegalArgumentException(); } @@ -119,7 +119,7 @@ public MethodUsage replaceExceptionType(int i, ResolvedType replaced) { return new MethodUsage(declaration, paramTypes, returnType, newTypes, typeParametersMap); } - public MethodUsage replaceReturnType(ResolvedType returnType) { + public MethodUsage replaceReturnType(ResolvedType returnType) { if (returnType == this.returnType) { return this; } @@ -129,18 +129,18 @@ public MethodUsage replaceReturnType(ResolvedType returnType) { /** * Return the number of formal arguments accepted by this method. */ - public int getNoParams() { + public int getNoParams() { return paramTypes.size(); } /** * Return the type of the formal argument at the given position. */ - public ResolvedType getParamType(int i) { + public ResolvedType getParamType(int i) { return paramTypes.get(i); } - public MethodUsage replaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type) { + public MethodUsage replaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type) { if (type == null) { throw new IllegalArgumentException(); } @@ -164,7 +164,7 @@ public MethodUsage replaceTypeParameter(ResolvedTypeParameterDeclaration typePa } @Override - public ResolvedTypeParametersMap typeParametersMap() { + public ResolvedTypeParametersMap typeParametersMap() { return typeParametersMap; } @@ -172,14 +172,14 @@ public ResolvedTypeParametersMap typeParametersMap() { * The qualified signature of the method. It is composed by the qualified name of the declaring type * followed by the signature of the method. */ - public String getQualifiedSignature() { + public String getQualifiedSignature() { return getDeclaration().declaringType().getQualifiedName() + "." + getSignature(); } /** * The signature of the method. */ - public String getSignature() { + public String getSignature() { StringBuilder sb = new StringBuilder(); sb.append(getName()); sb.append("("); @@ -201,7 +201,7 @@ public String getSignature() { /** * The erased signature of the method. */ - public String getErasedSignature() { + public String getErasedSignature() { StringBuilder sb = new StringBuilder(); sb.append(getName()); sb.append("("); @@ -220,7 +220,7 @@ public String getErasedSignature() { return sb.toString(); } - public List exceptionTypes() { + public List exceptionTypes() { return exceptionTypes; } @@ -232,7 +232,7 @@ public List exceptionTypes() { * https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html * This method returns an approximation of this rule. */ - public boolean isSameSignature(MethodUsage otherMethodUsage) { + public boolean isSameSignature(MethodUsage otherMethodUsage) { return getSignature().equals(otherMethodUsage.getSignature()); } @@ -241,7 +241,7 @@ public boolean isSameSignature(MethodUsage otherMethodUsage) { * m2 has the same signature as m1, or * the signature of m1 is the same as the erasure (§4.6) of the signature of m2. */ - public boolean isSubSignature(MethodUsage otherMethodUsage) { + public boolean isSubSignature(MethodUsage otherMethodUsage) { return getErasedSignature().equals(otherMethodUsage.getErasedSignature()); } @@ -254,7 +254,7 @@ public boolean isSubSignature(MethodUsage otherMethodUsage) { * R1 can be converted to a subtype of R2 by unchecked conversion (§5.1.9). * d1 does not have the same signature as d2 (§8.4.2), and R1 = |R2|. */ - public boolean isReturnTypeSubstituable(MethodUsage otherMethodUsage) { + public boolean isReturnTypeSubstituable(MethodUsage otherMethodUsage) { return getDeclaration().isReturnTypeSubstituable(otherMethodUsage.getDeclaration().getReturnType()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/Resolvable.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/Resolvable.java index 850b5882df..c3568edec5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/Resolvable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/Resolvable.java @@ -20,7 +20,7 @@ */ package com.github.javaparser.resolution; -public interface Resolvable { +public interface Resolvable { T resolve(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java index a2ace78773..fead8cfb81 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/Solver.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Optional; -public interface Solver { +public interface Solver { SymbolReference solveSymbol(String name, Context context); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolDeclarator.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolDeclarator.java index 6bd51024f8..7ff1b3cadf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolDeclarator.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolDeclarator.java @@ -26,7 +26,7 @@ /** * @author Federico Tomassetti */ -public interface SymbolDeclarator { +public interface SymbolDeclarator { List getSymbolDeclarations(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolResolver.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolResolver.java index c19b7353d9..1a93ae6fc0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolResolver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/SymbolResolver.java @@ -26,7 +26,7 @@ import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; import com.github.javaparser.resolution.types.ResolvedType; -public interface SymbolResolver { +public interface SymbolResolver { /** * For a reference it would find the corresponding declaration. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/TypeSolver.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/TypeSolver.java index c6136bc4ef..8787f39e75 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/TypeSolver.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/TypeSolver.java @@ -29,7 +29,7 @@ * * @author Federico Tomassetti */ -public interface TypeSolver { +public interface TypeSolver { String JAVA_LANG_OBJECT = Object.class.getCanonicalName(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/UnsolvedSymbolException.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/UnsolvedSymbolException.java index 4fb6e33dfa..e8667a82e2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/UnsolvedSymbolException.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/UnsolvedSymbolException.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public class UnsolvedSymbolException extends RuntimeException { +public class UnsolvedSymbolException extends RuntimeException { /** * The name of the symbol that could not be resolved. @@ -44,31 +44,31 @@ public class UnsolvedSymbolException extends RuntimeException { */ private Throwable cause; - public UnsolvedSymbolException(String name) { + public UnsolvedSymbolException(String name) { this(name, null, null); } - public UnsolvedSymbolException(String name, String context) { + public UnsolvedSymbolException(String name, String context) { this(name, context, null); } - public UnsolvedSymbolException(String name, Throwable cause) { + public UnsolvedSymbolException(String name, Throwable cause) { this(name, null, cause); } - public UnsolvedSymbolException(String name, String context, Throwable cause) { + public UnsolvedSymbolException(String name, String context, Throwable cause) { super("Unsolved symbol" + (context != null ? " in " + context : "") + " : " + name, cause); this.name = name; this.context = context; this.cause = cause; } - public String getName() { + public String getName() { return name; } @Override - public String toString() { + public String toString() { return "UnsolvedSymbolException{" + "context='" + context + "'" + ", name='" + name + "'" + ", cause='" + cause + "'" + "}"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/Cache.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/Cache.java index c2b91b94e9..076c97c0e4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/Cache.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/Cache.java @@ -31,7 +31,7 @@ * @param The type of the key. * @param The type of the value. */ -public interface Cache { +public interface Cache { /** * Associates value with key in this cache. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/CacheStats.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/CacheStats.java index c5b2de6ef4..b3a7609624 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/CacheStats.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/cache/CacheStats.java @@ -19,7 +19,7 @@ */ package com.github.javaparser.resolution.cache; -public interface CacheStats { +public interface CacheStats { /** * Returns the number of times lookup methods have returned either a cached or diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/AssociableToAST.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/AssociableToAST.java index 065cb18b69..7433f2a703 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/AssociableToAST.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/AssociableToAST.java @@ -26,7 +26,7 @@ /** * A declaration that can be potentially associated with an AST node. */ -public interface AssociableToAST { +public interface AssociableToAST { /** * If the declaration is associated to an AST node return it, otherwise it return empty. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/HasAccessSpecifier.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/HasAccessSpecifier.java index c547bba45a..3c784c0a4e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/HasAccessSpecifier.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/HasAccessSpecifier.java @@ -28,7 +28,7 @@ * @author Federico Tomassetti * @see AccessSpecifier */ -public interface HasAccessSpecifier { +public interface HasAccessSpecifier { /** * The access specifier of this element. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclaration.java index 08abaf736e..3ff2d480bf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationDeclaration.java @@ -25,7 +25,7 @@ /** * @author Federico Tomassetti */ -public interface ResolvedAnnotationDeclaration extends ResolvedReferenceTypeDeclaration { +public interface ResolvedAnnotationDeclaration extends ResolvedReferenceTypeDeclaration { @Override default boolean isAnnotation() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclaration.java index 8767cba090..8a839c6d75 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedAnnotationMemberDeclaration.java @@ -25,7 +25,7 @@ /** * @author Federico Tomassetti */ -public interface ResolvedAnnotationMemberDeclaration extends ResolvedValueDeclaration { +public interface ResolvedAnnotationMemberDeclaration extends ResolvedValueDeclaration { Expression getDefaultValue(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclaration.java index b5cabc21ee..cb5e61f5a9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedClassDeclaration.java @@ -32,7 +32,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedClassDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { +public interface ResolvedClassDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { /** * This method should always return true. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclaration.java index 6465f95436..34fa137882 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedConstructorDeclaration.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedConstructorDeclaration extends ResolvedMethodLikeDeclaration { +public interface ResolvedConstructorDeclaration extends ResolvedMethodLikeDeclaration { /** * A constructor can be declared in a class or an enum. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedDeclaration.java index 2e12c46793..25a896719f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedDeclaration.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedDeclaration extends AssociableToAST { +public interface ResolvedDeclaration extends AssociableToAST { /** * Anonymous classes do not have a name, for example. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclaration.java index b68f9f1735..ce173d563d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumConstantDeclaration.java @@ -23,7 +23,7 @@ /** * @author Federico Tomassetti */ -public interface ResolvedEnumConstantDeclaration extends ResolvedValueDeclaration { +public interface ResolvedEnumConstantDeclaration extends ResolvedValueDeclaration { String getName(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclaration.java index e9e7bc7466..1d49d1cb21 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedEnumDeclaration.java @@ -27,7 +27,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedEnumDeclaration extends ResolvedReferenceTypeDeclaration, HasAccessSpecifier { +public interface ResolvedEnumDeclaration extends ResolvedReferenceTypeDeclaration, HasAccessSpecifier { @Override default boolean isEnum() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclaration.java index 8e7940a6f8..fd4fec0e4f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedFieldDeclaration.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedFieldDeclaration extends ResolvedValueDeclaration, HasAccessSpecifier { +public interface ResolvedFieldDeclaration extends ResolvedValueDeclaration, HasAccessSpecifier { /** * Is the field static? diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedInterfaceDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedInterfaceDeclaration.java index baf4e80a69..7a47684c4c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedInterfaceDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedInterfaceDeclaration.java @@ -29,7 +29,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedInterfaceDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { +public interface ResolvedInterfaceDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { @Override default boolean isInterface() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclaration.java index 5fd3535527..c845dd83c3 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodDeclaration.java @@ -27,7 +27,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedMethodDeclaration extends ResolvedMethodLikeDeclaration { +public interface ResolvedMethodDeclaration extends ResolvedMethodLikeDeclaration { /** * The type of the value returned by the current method. This method can also be invoked diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclaration.java index 704c87c7aa..c37a388337 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedMethodLikeDeclaration.java @@ -31,7 +31,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedMethodLikeDeclaration extends ResolvedDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { +public interface ResolvedMethodLikeDeclaration extends ResolvedDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { /** * The package name of the declaring type. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclaration.java index 43139c4328..f60e8f1a5a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedParameterDeclaration.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedParameterDeclaration extends ResolvedValueDeclaration { +public interface ResolvedParameterDeclaration extends ResolvedValueDeclaration { @Override default boolean isParameter() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedRecordDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedRecordDeclaration.java index 9178ae936b..af667bd5f1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedRecordDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedRecordDeclaration.java @@ -33,7 +33,7 @@ * @author Federico Tomassetti * @author Johannes Coetzee */ -public interface ResolvedRecordDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { +public interface ResolvedRecordDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier { @Override default boolean isRecord() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclaration.java index 431d2889ec..75d0b82603 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedReferenceTypeDeclaration.java @@ -33,7 +33,7 @@ /** * @author Federico Tomassetti */ -public interface ResolvedReferenceTypeDeclaration extends ResolvedTypeDeclaration, ResolvedTypeParametrizable { +public interface ResolvedReferenceTypeDeclaration extends ResolvedTypeDeclaration, ResolvedTypeParametrizable { String JAVA_LANG_ENUM = java.lang.Enum.class.getCanonicalName(); @@ -356,8 +356,8 @@ default Optional findTypeParameter(String name * @see https://github.com/javaparser/javaparser/issues/2044 */ default boolean isJavaLangObject() { - return this.isClass() && !isAnonymousClass() && // Consider anonymous classes - hasName() && JAVA_LANG_OBJECT.equals(getQualifiedName()); + return // Consider anonymous classes + this.isClass() && !isAnonymousClass() && hasName() && JAVA_LANG_OBJECT.equals(getQualifiedName()); } /** diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclaration.java index 1597b03ea9..68d6e4bd6a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeDeclaration.java @@ -31,7 +31,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedTypeDeclaration extends ResolvedDeclaration { +public interface ResolvedTypeDeclaration extends ResolvedDeclaration { // / // / Containment diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclaration.java index a25bdb506b..95089c7d17 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParameterDeclaration.java @@ -36,7 +36,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedTypeParameterDeclaration extends ResolvedTypeDeclaration { +public interface ResolvedTypeParameterDeclaration extends ResolvedTypeDeclaration { /** * Instantiate a TypeParameter defined on a Type with the given data. @@ -45,57 +45,57 @@ static ResolvedTypeParameterDeclaration onType(final String name, String classQN return new ResolvedTypeParameterDeclaration() { @Override - public String getName() { + public String getName() { return name; } @Override - public boolean declaredOnType() { + public boolean declaredOnType() { return true; } @Override - public boolean declaredOnMethod() { + public boolean declaredOnMethod() { return false; } @Override - public boolean declaredOnConstructor() { + public boolean declaredOnConstructor() { return false; } @Override - public String getContainerQualifiedName() { + public String getContainerQualifiedName() { return classQName; } @Override - public String getContainerId() { + public String getContainerId() { return classQName; } @Override - public ResolvedTypeParametrizable getContainer() { + public ResolvedTypeParametrizable getContainer() { return null; } @Override - public List getBounds() { + public List getBounds() { return bounds; } @Override - public String toString() { + public String toString() { return "TypeParameter onType " + name; } @Override - public Optional containerType() { + public Optional containerType() { throw new UnsupportedOperationException(); } @Override - public ResolvedReferenceType object() { + public ResolvedReferenceType object() { throw new UnsupportedOperationException(); } }; @@ -303,31 +303,31 @@ public static Bound superBound(ResolvedType type) { /** * Get the type used in the Bound. */ - public ResolvedType getType() { + public ResolvedType getType() { return type; } /** * Is this an extends bound? */ - public boolean isExtends() { + public boolean isExtends() { return extendsBound; } /** * Is this a super bound? */ - public boolean isSuper() { + public boolean isSuper() { return !isExtends(); } @Override - public String toString() { + public String toString() { return "Bound{" + "extendsBound=" + extendsBound + ", type=" + type + '}'; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -339,7 +339,7 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = (extendsBound ? 1 : 0); result = 31 * result + (type != null ? type.hashCode() : 0); return result; diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizable.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizable.java index c55d40df91..e91b06024b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypeParametrizable.java @@ -28,7 +28,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedTypeParametrizable { +public interface ResolvedTypeParametrizable { /** * The list of type parameters defined on this element. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclaration.java index 4172609ddd..00cfba4358 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedTypePatternDeclaration.java @@ -30,7 +30,7 @@ * @author Roger Howell * @see TypePatternExpr */ -public interface ResolvedTypePatternDeclaration extends ResolvedValueDeclaration { +public interface ResolvedTypePatternDeclaration extends ResolvedValueDeclaration { @Override default boolean isTypePattern() { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclaration.java index a8f41ed4a1..231a7f7aad 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclaration.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/declarations/ResolvedValueDeclaration.java @@ -27,7 +27,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedValueDeclaration extends ResolvedDeclaration { +public interface ResolvedValueDeclaration extends ResolvedDeclaration { /** * Type of the declaration. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConflictingGenericTypesException.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConflictingGenericTypesException.java index 6c05c7bc52..66adad5416 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConflictingGenericTypesException.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConflictingGenericTypesException.java @@ -25,9 +25,9 @@ /** * @author Federico Tomassetti */ -public class ConflictingGenericTypesException extends RuntimeException { +public class ConflictingGenericTypesException extends RuntimeException { - public ConflictingGenericTypesException(ResolvedType formalType, ResolvedType actualType) { + public ConflictingGenericTypesException(ResolvedType formalType, ResolvedType actualType) { super(String.format("No matching between %s (formal) and %s (actual)", formalType, actualType)); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConstructorResolutionLogic.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConstructorResolutionLogic.java index d1dbc93eca..8206f71f8d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConstructorResolutionLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/ConstructorResolutionLogic.java @@ -36,7 +36,7 @@ /** * @author Fred Lefévère-Laoide */ -public class ConstructorResolutionLogic { +public class ConstructorResolutionLogic { private static List groupVariadicParamValues(List argumentsTypes, int startVariadic, ResolvedType variadicType) { List res = new ArrayList<>(argumentsTypes.subList(0, startVariadic)); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java index 684f35b2d4..5a6c595406 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/FunctionalInterfaceLogic.java @@ -60,9 +60,10 @@ public static Optional getFunctionalMethod(ResolvedType type) { */ public static Optional getFunctionalMethod(ResolvedReferenceTypeDeclaration typeDeclaration) { // We need to find all abstract methods - Set methods = typeDeclaration.getAllMethods().stream().filter(m -> m.getDeclaration().isAbstract()).// Remove methods inherited by Object: - // Consider the case of Comparator which define equals. It would be considered a functional method. - filter(m -> !isPublicMemberOfObject(m)).collect(Collectors.toSet()); + // Remove methods inherited by Object: + Set // Remove methods inherited by Object: + methods = // Consider the case of Comparator which define equals. It would be considered a functional method. + typeDeclaration.getAllMethods().stream().filter(m -> m.getDeclaration().isAbstract()).filter(m -> !isPublicMemberOfObject(m)).collect(Collectors.toSet()); // TODO a functional interface can have multiple subsignature method with a return-type-substitutable // see https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.8 if (methods.size() == 0) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceContext.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceContext.java index 8db11ee671..cee16a5fa4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceContext.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceContext.java @@ -32,7 +32,7 @@ /** * @author Federico Tomassetti */ -public class InferenceContext { +public class InferenceContext { private int nextInferenceVariableId = 0; @@ -42,7 +42,7 @@ public class InferenceContext { private Map inferenceVariableTypeMap = new HashMap<>(); - public InferenceContext(TypeSolver typeSolver) { + public InferenceContext(TypeSolver typeSolver) { this.typeSolver = typeSolver; } @@ -59,14 +59,14 @@ private InferenceVariableType inferenceVariableTypeForTp(ResolvedTypeParameterDe /** * @return the actual with the inference variable inserted */ - public ResolvedType addPair(ResolvedType target, ResolvedType actual) { + public ResolvedType addPair(ResolvedType target, ResolvedType actual) { target = placeInferenceVariables(target); actual = placeInferenceVariables(actual); registerCorrespondance(target, actual); return target; } - public ResolvedType addSingle(ResolvedType actual) { + public ResolvedType addSingle(ResolvedType actual) { return placeInferenceVariables(actual); } @@ -212,7 +212,7 @@ private ResolvedType placeInferenceVariables(ResolvedType type) { throw new UnsupportedOperationException(type.describe()); } - public ResolvedType resolve(ResolvedType type) { + public ResolvedType resolve(ResolvedType type) { if (type instanceof InferenceVariableType) { InferenceVariableType inferenceVariableType = (InferenceVariableType) type; return inferenceVariableType.equivalentType(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceVariableType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceVariableType.java index 1e397475e6..082d026a1e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceVariableType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/InferenceVariableType.java @@ -36,10 +36,10 @@ * * @author Federico Tomassetti */ -public class InferenceVariableType implements ResolvedType { +public class InferenceVariableType implements ResolvedType { @Override - public String toString() { + public String toString() { return "InferenceVariableType{" + "id=" + id + '}'; } @@ -47,7 +47,7 @@ public String toString() { private ResolvedTypeParameterDeclaration correspondingTp; - public void setCorrespondingTp(ResolvedTypeParameterDeclaration correspondingTp) { + public void setCorrespondingTp(ResolvedTypeParameterDeclaration correspondingTp) { this.correspondingTp = correspondingTp; } @@ -55,12 +55,12 @@ public void setCorrespondingTp(ResolvedTypeParameterDeclaration correspondingTp private TypeSolver typeSolver; - public void registerEquivalentType(ResolvedType type) { + public void registerEquivalentType(ResolvedType type) { this.equivalentTypes.add(type); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InferenceVariableType)) @@ -70,24 +70,24 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return id; } private Set superTypes = new HashSet<>(); - public InferenceVariableType(int id, TypeSolver typeSolver) { + public InferenceVariableType(int id, TypeSolver typeSolver) { this.id = id; this.typeSolver = typeSolver; } @Override - public String describe() { + public String describe() { return "InferenceVariable_" + id; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { throw new UnsupportedOperationException(); } @@ -104,7 +104,7 @@ private Set concreteEquivalentTypesAlsoIndirectly(Set concreteEquivalent = concreteEquivalentTypesAlsoIndirectly(new HashSet<>(), this); if (concreteEquivalent.isEmpty()) { if (correspondingTp == null) { diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java index 20d755a069..0c5d244c28 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionCapability.java @@ -25,7 +25,7 @@ import com.github.javaparser.resolution.types.ResolvedType; import java.util.List; -public interface MethodResolutionCapability { +public interface MethodResolutionCapability { SymbolReference solveMethod(String name, List argumentsTypes, boolean staticOnly); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java index 135e047569..a6148e6bfc 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/logic/MethodResolutionLogic.java @@ -36,7 +36,7 @@ /** * @author Federico Tomassetti */ -public class MethodResolutionLogic { +public class MethodResolutionLogic { private static String JAVA_LANG_OBJECT = Object.class.getCanonicalName(); @@ -526,10 +526,13 @@ public static SymbolReference findMostApplicable(List } public static SymbolReference findMostApplicable(List methods, String name, List argumentsTypes, TypeSolver typeSolver, boolean wildcardTolerance) { - List applicableMethods = methods.stream().// Only consider methods with a matching name - filter(m -> m.getName().equals(name)).// Filters out duplicate ResolvedMethodDeclaration by their signature. - filter(distinctByKey(ResolvedMethodDeclaration::getQualifiedSignature)).// Checks if ResolvedMethodDeclaration is applicable to argumentsTypes. - filter((m) -> isApplicable(m, name, argumentsTypes, typeSolver, wildcardTolerance)).collect(Collectors.toList()); + // Only consider methods with a matching name + List // Only consider methods with a matching name + applicableMethods = // Filters out duplicate ResolvedMethodDeclaration by their signature. + methods.stream().// Filters out duplicate ResolvedMethodDeclaration by their signature. + filter(// Checks if ResolvedMethodDeclaration is applicable to argumentsTypes. + m -> m.getName().equals(name)).// Checks if ResolvedMethodDeclaration is applicable to argumentsTypes. + filter(distinctByKey(ResolvedMethodDeclaration::getQualifiedSignature)).filter((m) -> isApplicable(m, name, argumentsTypes, typeSolver, wildcardTolerance)).collect(Collectors.toList()); // If no applicable methods found, return as unsolved. if (applicableMethods.isEmpty()) { return SymbolReference.unsolved(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/LambdaArgumentTypePlaceholder.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/LambdaArgumentTypePlaceholder.java index fe523d75d9..d19c13488f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/LambdaArgumentTypePlaceholder.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/LambdaArgumentTypePlaceholder.java @@ -29,42 +29,42 @@ * * @author Federico Tomassetti */ -public class LambdaArgumentTypePlaceholder implements ResolvedType { +public class LambdaArgumentTypePlaceholder implements ResolvedType { private int pos; private SymbolReference method; - public LambdaArgumentTypePlaceholder(int pos) { + public LambdaArgumentTypePlaceholder(int pos) { this.pos = pos; } @Override - public boolean isArray() { + public boolean isArray() { return false; } @Override - public boolean isReferenceType() { + public boolean isReferenceType() { return false; } @Override - public String describe() { + public String describe() { throw new UnsupportedOperationException(); } @Override - public boolean isTypeVariable() { + public boolean isTypeVariable() { return false; } - public void setMethod(SymbolReference method) { + public void setMethod(SymbolReference method) { this.method = method; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { throw new UnsupportedOperationException(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/SymbolReference.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/SymbolReference.java index 000b136ded..3df1af6bad 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/SymbolReference.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/SymbolReference.java @@ -31,7 +31,7 @@ * * @author Federico Tomassetti */ -public class SymbolReference { +public class SymbolReference { /** * Create a solve reference to the given symbol. @@ -94,26 +94,26 @@ private SymbolReference(@Nullable S correspondingDeclaration) { * * @return an {@link Optional} with a present value if the symbol is solved, otherwise an empty {@link Optional}. */ - public Optional getDeclaration() { + public Optional getDeclaration() { return Optional.ofNullable(correspondingDeclaration); } /** * The corresponding declaration. If not solve this throws UnsupportedOperationException. */ - public S getCorrespondingDeclaration() { + public S getCorrespondingDeclaration() { return getDeclaration().orElseThrow(() -> new UnsolvedSymbolException("Corresponding declaration not available for unsolved symbol.")); } /** * Is the reference solved? */ - public boolean isSolved() { + public boolean isSolved() { return getDeclaration().isPresent(); } @Override - public String toString() { + public String toString() { return "SymbolReference{" + correspondingDeclaration + "}"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/Value.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/Value.java index fb2103febb..902ac3237e 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/Value.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/Value.java @@ -28,13 +28,13 @@ * * @author Federico Tomassetti */ -public class Value { +public class Value { private ResolvedType type; private String name; - public Value(ResolvedType type, String name) { + public Value(ResolvedType type, String name) { this.type = type; this.name = name; } @@ -48,15 +48,15 @@ public static Value from(ResolvedValueDeclaration decl) { } @Override - public String toString() { + public String toString() { return "Value{" + "type=" + type + ", name='" + name + '\'' + '}'; } - public String getName() { + public String getName() { return name; } - public ResolvedType getType() { + public ResolvedType getType() { return type; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/LazyType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/LazyType.java index 39add72b5d..fc045735be 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/LazyType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/LazyType.java @@ -25,17 +25,17 @@ import java.util.Map; import java.util.function.Function; -public class LazyType implements ResolvedType { +public class LazyType implements ResolvedType { private ResolvedType concrete; private Function provider; - public LazyType(Function provider) { + public LazyType(Function provider) { this.provider = provider; } - public ResolvedType getType() { + public ResolvedType getType() { if (concrete == null) { concrete = provider.apply(null); } @@ -43,97 +43,97 @@ public ResolvedType getType() { } @Override - public boolean isArray() { + public boolean isArray() { return getType().isArray(); } @Override - public int arrayLevel() { + public int arrayLevel() { return getType().arrayLevel(); } @Override - public boolean isPrimitive() { + public boolean isPrimitive() { return getType().isPrimitive(); } @Override - public boolean isNull() { + public boolean isNull() { return getType().isNull(); } @Override - public boolean isReference() { + public boolean isReference() { return getType().isReference(); } @Override - public boolean isReferenceType() { + public boolean isReferenceType() { return getType().isReferenceType(); } @Override - public boolean isVoid() { + public boolean isVoid() { return getType().isVoid(); } @Override - public boolean isTypeVariable() { + public boolean isTypeVariable() { return getType().isTypeVariable(); } @Override - public boolean isWildcard() { + public boolean isWildcard() { return getType().isWildcard(); } @Override - public ResolvedArrayType asArrayType() { + public ResolvedArrayType asArrayType() { return getType().asArrayType(); } @Override - public ResolvedReferenceType asReferenceType() { + public ResolvedReferenceType asReferenceType() { return getType().asReferenceType(); } @Override - public ResolvedTypeParameterDeclaration asTypeParameter() { + public ResolvedTypeParameterDeclaration asTypeParameter() { return getType().asTypeParameter(); } @Override - public ResolvedTypeVariable asTypeVariable() { + public ResolvedTypeVariable asTypeVariable() { return getType().asTypeVariable(); } @Override - public ResolvedPrimitiveType asPrimitive() { + public ResolvedPrimitiveType asPrimitive() { return getType().asPrimitive(); } @Override - public ResolvedWildcard asWildcard() { + public ResolvedWildcard asWildcard() { return getType().asWildcard(); } @Override - public String describe() { + public String describe() { return getType().describe(); } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map inferredTypes) { return getType().replaceTypeVariables(tp, replaced, inferredTypes); } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced) { return getType().replaceTypeVariables(tp, replaced); } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { return getType().isAssignableBy(other); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/NullType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/NullType.java index 7b4950c899..f9914939e9 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/NullType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/NullType.java @@ -27,7 +27,7 @@ * * @author Federico Tomassetti */ -public class NullType implements ResolvedType { +public class NullType implements ResolvedType { public static final NullType INSTANCE = new NullType(); @@ -36,31 +36,31 @@ private NullType() { } @Override - public boolean isArray() { + public boolean isArray() { return false; } - public boolean isNull() { + public boolean isNull() { return true; } @Override - public boolean isReferenceType() { + public boolean isReferenceType() { return false; } @Override - public String describe() { + public String describe() { return "null"; } @Override - public boolean isTypeVariable() { + public boolean isTypeVariable() { return false; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { throw new UnsupportedOperationException("It does not make sense to assign a value to null, it can only be assigned"); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java index b90ac28f68..48935056b8 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/model/typesystem/ReferenceTypeImpl.java @@ -40,7 +40,7 @@ /** * @author Federico Tomassetti */ -public class ReferenceTypeImpl extends ResolvedReferenceType { +public class ReferenceTypeImpl extends ResolvedReferenceType { private static final String[] ASSIGNABLE_REFERENCE_TYPE = { "java.lang.Object", "java.lang.Cloneable", "java.io.Serializable" }; @@ -58,16 +58,16 @@ protected ResolvedReferenceType create(ResolvedReferenceTypeDeclaration typeDecl return new ReferenceTypeImpl(typeDeclaration); } - public ReferenceTypeImpl(ResolvedReferenceTypeDeclaration typeDeclaration) { + public ReferenceTypeImpl(ResolvedReferenceTypeDeclaration typeDeclaration) { super(typeDeclaration); } - public ReferenceTypeImpl(ResolvedReferenceTypeDeclaration typeDeclaration, List typeArguments) { + public ReferenceTypeImpl(ResolvedReferenceTypeDeclaration typeDeclaration, List typeArguments) { super(typeDeclaration, typeArguments); } @Override - public ResolvedTypeParameterDeclaration asTypeParameter() { + public ResolvedTypeParameterDeclaration asTypeParameter() { return this.typeDeclaration.asTypeParameter(); } @@ -75,7 +75,7 @@ public ResolvedTypeParameterDeclaration asTypeParameter() { * This method checks if ThisType t = new OtherType() would compile. */ @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { if (other instanceof NullType) { return !this.isPrimitive(); } @@ -148,7 +148,7 @@ private boolean isAssignableByReferenceType(String qname) { } @Override - public Set getDeclaredMethods() { + public Set getDeclaredMethods() { // TODO replace variables Set methods = new HashSet<>(); getTypeDeclaration().ifPresent(referenceTypeDeclaration -> { @@ -161,7 +161,7 @@ public Set getDeclaredMethods() { } @Override - public ResolvedType toRawType() { + public ResolvedType toRawType() { if (this.isRawType()) { return this; } @@ -169,7 +169,7 @@ public ResolvedType toRawType() { } @Override - public boolean mention(List typeParameters) { + public boolean mention(List typeParameters) { return typeParametersValues().stream().anyMatch(tp -> tp.mention(typeParameters)); } @@ -177,7 +177,7 @@ public boolean mention(List typeParameters) { * Execute a transformation on all the type parameters of this element. */ @Override - public ResolvedType transformTypeParameters(ResolvedTypeTransformer transformer) { + public ResolvedType transformTypeParameters(ResolvedTypeTransformer transformer) { ResolvedType result = this; int i = 0; for (ResolvedType tp : this.typeParametersValues()) { @@ -197,12 +197,12 @@ public ResolvedType transformTypeParameters(ResolvedTypeTransformer transformer * Get all ancestors with the default traverser (depth first) */ @Override - public List getAllAncestors() { + public List getAllAncestors() { return getAllAncestors(ResolvedReferenceTypeDeclaration.depthFirstFunc); } @Override - public List getAllAncestors(Function> traverser) { + public List getAllAncestors(Function> traverser) { // We need to go through the inheritance line and propagate the type parameters List ancestors = typeDeclaration.getAllAncestors(traverser); ancestors = ancestors.stream().map(a -> typeParametersMap().replaceAll(a).asReferenceType()).collect(Collectors.toList()); @@ -210,7 +210,7 @@ public List getAllAncestors(Function getDirectAncestors() { + public List getDirectAncestors() { // We need to go through the inheritance line and propagate the type parameters List ancestors = typeDeclaration.getAncestors(); ancestors = ancestors.stream().map(a -> typeParametersMap().replaceAll(a).asReferenceType()).collect(Collectors.toList()); @@ -231,12 +231,12 @@ public List getDirectAncestors() { } @Override - public ResolvedReferenceType deriveTypeParameters(ResolvedTypeParametersMap typeParametersMap) { + public ResolvedReferenceType deriveTypeParameters(ResolvedTypeParametersMap typeParametersMap) { return create(typeDeclaration, typeParametersMap); } @Override - public Set getDeclaredFields() { + public Set getDeclaredFields() { Set allFields = new LinkedHashSet<>(); if (getTypeDeclaration().isPresent()) { allFields.addAll(getTypeDeclaration().get().getDeclaredFields()); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/promotion/ConditionalExprHandler.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/promotion/ConditionalExprHandler.java index 868dd06bc4..ce3293cec5 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/promotion/ConditionalExprHandler.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/promotion/ConditionalExprHandler.java @@ -21,7 +21,7 @@ import com.github.javaparser.resolution.types.ResolvedType; -public interface ConditionalExprHandler { +public interface ConditionalExprHandler { ResolvedType resolveType(); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedArrayType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedArrayType.java index 4bdf375b22..402f2bfb39 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedArrayType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedArrayType.java @@ -28,11 +28,11 @@ * * @author Federico Tomassetti */ -public class ResolvedArrayType implements ResolvedType { +public class ResolvedArrayType implements ResolvedType { private ResolvedType baseType; - public ResolvedArrayType(ResolvedType baseType) { + public ResolvedArrayType(ResolvedType baseType) { this.baseType = baseType; } @@ -40,7 +40,7 @@ public ResolvedArrayType(ResolvedType baseType) { // / Object methods // / @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -52,12 +52,12 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return baseType.hashCode(); } @Override - public String toString() { + public String toString() { return "ResolvedArrayType{" + baseType + "}"; } @@ -65,26 +65,26 @@ public String toString() { // / Type methods // / @Override - public ResolvedArrayType asArrayType() { + public ResolvedArrayType asArrayType() { return this; } @Override - public boolean isArray() { + public boolean isArray() { return true; } @Override - public String describe() { + public String describe() { return baseType.describe() + "[]"; } - public ResolvedType getComponentType() { + public ResolvedType getComponentType() { return baseType; } @Override - public // https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.2 + public // https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.2 boolean isAssignableBy(ResolvedType other) { if (other.isNull()) { return true; @@ -106,7 +106,7 @@ boolean isAssignableBy(ResolvedType other) { } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { ResolvedType baseTypeReplaced = baseType.replaceTypeVariables(tpToReplace, replaced, inferredTypes); if (baseTypeReplaced == baseType) { return this; @@ -119,12 +119,12 @@ public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToR // / // The erasure of an array type T[] is |T|[]. @Override - public ResolvedType erasure() { + public ResolvedType erasure() { return new ResolvedArrayType(baseType.erasure()); } @Override - public String toDescriptor() { + public String toDescriptor() { StringBuffer sb = new StringBuffer(); sb.append("["); sb.append(baseType.toDescriptor()); diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedIntersectionType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedIntersectionType.java index f715ca4462..56dfa7ef6c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedIntersectionType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedIntersectionType.java @@ -29,11 +29,11 @@ * * @author Federico Tomassetti */ -public class ResolvedIntersectionType implements ResolvedType { +public class ResolvedIntersectionType implements ResolvedType { private List elements; - public ResolvedIntersectionType(Collection elements) { + public ResolvedIntersectionType(Collection elements) { if (elements.size() < 2) { throw new IllegalArgumentException("An intersection type should have at least two elements. This has " + elements.size()); } @@ -41,7 +41,7 @@ public ResolvedIntersectionType(Collection elements) { } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -51,22 +51,22 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return new HashSet<>(elements).hashCode(); } @Override - public String describe() { + public String describe() { return String.join(" & ", elements.stream().map(ResolvedType::describe).collect(Collectors.toList())); } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { return elements.stream().allMatch(e -> e.isAssignableBy(other)); } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map inferredTypes) { List elementsReplaced = elements.stream().map(e -> e.replaceTypeVariables(tp, replaced, inferredTypes)).collect(Collectors.toList()); if (elementsReplaced.equals(elements)) { return this; @@ -77,7 +77,7 @@ public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, R /* * Returns the list of the resolved types */ - public List getElements() { + public List getElements() { return elements; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedLambdaConstraintType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedLambdaConstraintType.java index 4b1c16d051..19c7ee1e2a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedLambdaConstraintType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedLambdaConstraintType.java @@ -20,7 +20,7 @@ */ package com.github.javaparser.resolution.types; -public class ResolvedLambdaConstraintType implements ResolvedType { +public class ResolvedLambdaConstraintType implements ResolvedType { private ResolvedType bound; @@ -29,21 +29,21 @@ private ResolvedLambdaConstraintType(ResolvedType bound) { } @Override - public String describe() { + public String describe() { return "? super " + bound.describe(); } - public ResolvedType getBound() { + public ResolvedType getBound() { return bound; } @Override - public boolean isConstraint() { + public boolean isConstraint() { return true; } @Override - public ResolvedLambdaConstraintType asConstraintType() { + public ResolvedLambdaConstraintType asConstraintType() { return this; } @@ -52,12 +52,12 @@ public static ResolvedLambdaConstraintType bound(ResolvedType bound) { } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { return bound.isAssignableBy(other); } @Override - public String toString() { + public String toString() { return "LambdaConstraintType{" + "bound=" + bound + '}'; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java index b4b0a85f2f..ed6277b545 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedPrimitiveType.java @@ -29,7 +29,7 @@ /** * @author Federico Tomassetti */ -public enum ResolvedPrimitiveType implements ResolvedType { +public enum ResolvedPrimitiveType implements ResolvedType { BYTE("byte", Byte.class, Collections.emptyList()), SHORT("short", Short.class, Collections.singletonList(BYTE)), @@ -101,41 +101,41 @@ public static ResolvedPrimitiveType[] getNumericPrimitiveTypes() { } @Override - public String toString() { + public String toString() { return "PrimitiveTypeUsage{" + "name='" + name + '\'' + '}'; } - public ResolvedPrimitiveType asPrimitive() { + public ResolvedPrimitiveType asPrimitive() { return this; } @Override - public boolean isArray() { + public boolean isArray() { return false; } @Override - public boolean isPrimitive() { + public boolean isPrimitive() { return true; } @Override - public boolean isReferenceType() { + public boolean isReferenceType() { return false; } @Override - public String describe() { + public String describe() { return name; } @Override - public boolean isTypeVariable() { + public boolean isTypeVariable() { return false; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { if (other.isPrimitive()) { return this == other || promotionTypes.contains(other); } @@ -153,25 +153,25 @@ public boolean isAssignableBy(ResolvedType other) { return other.isConstraint() && this.isAssignableBy(other.asConstraintType().getBound()); } - public String getBoxTypeQName() { + public String getBoxTypeQName() { return boxTypeClass.getCanonicalName(); } /* * Returns the boxed class of the primitive type. */ - public Class getBoxTypeClass() { + public Class getBoxTypeClass() { return boxTypeClass; } - public boolean isNumeric() { + public boolean isNumeric() { return Arrays.asList(getNumericPrimitiveTypes()).contains(this); } /** * Is this a boolean type? */ - public boolean isBoolean() { + public boolean isBoolean() { return this == BOOLEAN; } @@ -179,7 +179,7 @@ public boolean isBoolean() { * Binary primitive promotion (see https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.6.2) * If any operand is of a reference type, it is subjected to unboxing conversion (§5.1.8). */ - public ResolvedPrimitiveType bnp(ResolvedPrimitiveType other) { + public ResolvedPrimitiveType bnp(ResolvedPrimitiveType other) { if (this == ResolvedPrimitiveType.DOUBLE || other == ResolvedPrimitiveType.DOUBLE) { return ResolvedPrimitiveType.DOUBLE; // Otherwise, if either operand is of type float, the other is converted to float. @@ -224,12 +224,12 @@ public static ResolvedType unp(ResolvedType type) { /* * Verify if the ResolvedPrimitiveType is in the list of ResolvedPrimitiveType */ - public boolean in(ResolvedPrimitiveType... types) { + public boolean in(ResolvedPrimitiveType... types) { return Arrays.stream(types).anyMatch(type -> this == type); } @Override - public String toDescriptor() { + public String toDescriptor() { return TypeUtils.getPrimitiveTypeDescriptor(boxTypeClass); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedReferenceType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedReferenceType.java index 94576a3cd5..a9dc49b2f6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedReferenceType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedReferenceType.java @@ -61,11 +61,11 @@ public abstract class ResolvedReferenceType implements ResolvedType, ResolvedTyp // // Constructors // - public ResolvedReferenceType(ResolvedReferenceTypeDeclaration typeDeclaration) { + public ResolvedReferenceType(ResolvedReferenceTypeDeclaration typeDeclaration) { this(typeDeclaration, deriveParams(typeDeclaration)); } - public ResolvedReferenceType(ResolvedReferenceTypeDeclaration typeDeclaration, List typeArguments) { + public ResolvedReferenceType(ResolvedReferenceTypeDeclaration typeDeclaration, List typeArguments) { if (typeDeclaration == null) { throw new IllegalArgumentException("TypeDeclaration is not expected to be null"); } @@ -87,7 +87,7 @@ public ResolvedReferenceType(ResolvedReferenceTypeDeclaration typeDeclaration, // Public Object methods // @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null) @@ -109,14 +109,14 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = typeDeclaration.hashCode(); result = 31 * result + typeParametersMap.hashCode(); return result; } @Override - public String toString() { + public String toString() { return "ReferenceType{" + getQualifiedName() + ", typeParametersMap=" + typeParametersMap + '}'; } @@ -132,7 +132,7 @@ public final boolean isReferenceType() { // / Downcasting // / @Override - public ResolvedReferenceType asReferenceType() { + public ResolvedReferenceType asReferenceType() { return this; } @@ -140,7 +140,7 @@ public ResolvedReferenceType asReferenceType() { // / Naming // / @Override - public String describe() { + public String describe() { StringBuilder sb = new StringBuilder(); if (hasName()) { sb.append(typeDeclaration.getQualifiedName()); @@ -164,7 +164,7 @@ public String describe() { public abstract ResolvedType transformTypeParameters(ResolvedTypeTransformer transformer); @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { if (replaced == null) { throw new IllegalArgumentException(); } @@ -254,7 +254,7 @@ public final List getAllClassesAncestors() { * It returns Optional.empty unless the type declaration declares a type parameter with the given name. */ @Override - public Optional getGenericParameterByName(String name) { + public Optional getGenericParameterByName(String name) { for (ResolvedTypeParameterDeclaration tp : typeDeclaration.getTypeParameters()) { if (tp.getName().equals(name)) { return Optional.of(this.typeParametersMap().getValue(tp)); @@ -267,7 +267,7 @@ public Optional getGenericParameterByName(String name) { * Get the values for all type parameters declared on this type. * The list can be empty for raw types. */ - public List typeParametersValues() { + public List typeParametersValues() { return this.typeParametersMap.isEmpty() ? Collections.emptyList() : typeDeclaration.getTypeParameters().stream().map(tp -> typeParametersMap.getValue(tp)).collect(Collectors.toList()); } @@ -275,7 +275,7 @@ public List typeParametersValues() { * Get the values for all type parameters declared on this type. * In case of raw types the values correspond to TypeVariables. */ - public List> getTypeParametersMap() { + public List> getTypeParametersMap() { List> typeParametersMap = new ArrayList<>(); if (!isRawType()) { for (int i = 0; i < typeDeclaration.getTypeParameters().size(); i++) { @@ -286,7 +286,7 @@ public List> getTypeParame } @Override - public ResolvedTypeParametersMap typeParametersMap() { + public ResolvedTypeParametersMap typeParametersMap() { return typeParametersMap; } @@ -304,7 +304,7 @@ public final Optional getTypeDeclaration() { * The type of the field could be different from the one in the corresponding FieldDeclaration because * type variables would be solved. */ - public Optional getFieldType(String name) { + public Optional getFieldType(String name) { if (!typeDeclaration.hasField(name)) { return Optional.empty(); } @@ -316,21 +316,21 @@ public Optional getFieldType(String name) { /** * Has the TypeDeclaration a name? Anonymous classes do not have one. */ - public boolean hasName() { + public boolean hasName() { return typeDeclaration.hasName(); } /** * Qualified name of the declaration. */ - public String getQualifiedName() { + public String getQualifiedName() { return typeDeclaration.getQualifiedName(); } /** * Id of the declaration. It corresponds to the qualified name, unless for local classes. */ - public String getId() { + public String getId() { return typeDeclaration.getId(); } @@ -352,7 +352,7 @@ public String getId() { * parameters [JLS, 4.8]. For example, the raw type corresponding to List is * List. */ - public boolean isRawType() { + public boolean isRawType() { if (!typeDeclaration.getTypeParameters().isEmpty()) { if (typeParametersMap().isEmpty()) { return true; @@ -362,7 +362,7 @@ public boolean isRawType() { } @Override - public Optional typeParamValue(ResolvedTypeParameterDeclaration typeParameterDeclaration) { + public Optional typeParamValue(ResolvedTypeParameterDeclaration typeParameterDeclaration) { if (typeParameterDeclaration.declaredOnMethod()) { throw new IllegalArgumentException(); } @@ -392,7 +392,7 @@ public Optional typeParamValue(ResolvedTypeParameterDeclaration t * methods inherited. This list includes methods of all sort of visibility. However it does not include methods * that have been overwritten. */ - public List getAllMethods() { + public List getAllMethods() { if (!this.getTypeDeclaration().isPresent()) { // empty list -- consider IllegalStateException or similar return new ArrayList<>(); @@ -408,13 +408,13 @@ public List getAllMethods() { * Fields which are visible to inheritors. They include all inherited fields which are visible to this * type plus all declared fields which are not private. */ - public List getAllFieldsVisibleToInheritors() { + public List getAllFieldsVisibleToInheritors() { List res = new LinkedList<>(this.getDeclaredFields().stream().filter(f -> f.accessSpecifier() != AccessSpecifier.PRIVATE).collect(Collectors.toList())); getDirectAncestors().forEach(a -> res.addAll(a.getAllFieldsVisibleToInheritors())); return res; } - public List getAllMethodsVisibleToInheritors() { + public List getAllMethodsVisibleToInheritors() { return this.getAllMethods().stream().filter(m -> m.accessSpecifier() != AccessSpecifier.PRIVATE).collect(Collectors.toList()); } @@ -526,27 +526,27 @@ private static List deriveParams(ResolvedReferenceTypeDeclaration * @see ResolvedReferenceTypeDeclaration#isJavaLangObject() * @see https://github.com/javaparser/javaparser/issues/2044 */ - public boolean isJavaLangObject() { - return this.isReferenceType() && // Consider anonymous classes - hasName() && getQualifiedName().equals(JAVA_LANG_OBJECT); + public boolean isJavaLangObject() { + return // Consider anonymous classes + this.isReferenceType() && hasName() && getQualifiedName().equals(JAVA_LANG_OBJECT); } /** * @return true, if this represents {@code java.lang.Enum} * @see ResolvedReferenceTypeDeclaration#isJavaLangEnum() */ - public boolean isJavaLangEnum() { - return this.isReferenceType() && // Consider anonymous classes - hasName() && getQualifiedName().equals(JAVA_LANG_ENUM); + public boolean isJavaLangEnum() { + return // Consider anonymous classes + this.isReferenceType() && hasName() && getQualifiedName().equals(JAVA_LANG_ENUM); } /** * @return true, if this represents {@code java.lang.Record} * @see ResolvedReferenceTypeDeclaration#isJavaLangRecord() */ - public boolean isJavaLangRecord() { - return this.isReferenceType() && // Consider anonymous classes - hasName() && getQualifiedName().equals(JAVA_LANG_RECORD); + public boolean isJavaLangRecord() { + return // Consider anonymous classes + this.isReferenceType() && hasName() && getQualifiedName().equals(JAVA_LANG_RECORD); } // / @@ -556,7 +556,7 @@ public boolean isJavaLangRecord() { * Returns true if the reference type can be unboxed to the primitive type * For example : Integer to int */ - public boolean isUnboxable() { + public boolean isUnboxable() { return Arrays.stream(ResolvedPrimitiveType.values()).anyMatch(pt -> getQualifiedName().equals(pt.getBoxTypeQName())); } @@ -564,14 +564,14 @@ public boolean isUnboxable() { * Returns true if the reference type can be unboxed to the specified primitive type * For example : Integer to int */ - public boolean isUnboxableTo(ResolvedPrimitiveType primitiveType) { + public boolean isUnboxableTo(ResolvedPrimitiveType primitiveType) { return primitiveType.getBoxTypeQName().equals(this.asReferenceType().describe()); } /* * Returns the optional corresponding primitive type */ - public Optional toUnboxedType() { + public Optional toUnboxedType() { return Arrays.stream(ResolvedPrimitiveType.values()).filter(pt -> this.asReferenceType().getQualifiedName().equals(pt.getBoxTypeQName())).findFirst(); } @@ -580,7 +580,7 @@ public Optional toUnboxedType() { // / // The erasure of a parameterized type (§4.5) G is |G|. @Override - public ResolvedType erasure() { + public ResolvedType erasure() { if (!typeDeclaration.isGeneric()) return this; return create(typeDeclaration, erasureOfParamaters(typeParametersMap)); @@ -595,7 +595,7 @@ private boolean isJavaObject(ResolvedType rt) { } @Override - public String toDescriptor() { + public String toDescriptor() { return String.format("L%s;", getQualifiedName().replace(".", "/")); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedType.java index 09432897fb..d05f50db6f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedType.java @@ -47,7 +47,7 @@ * * @author Federico Tomassetti */ -public interface ResolvedType { +public interface ResolvedType { // / // / Relation with other types diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeTransformer.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeTransformer.java index 46178671a5..23d81597f0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeTransformer.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeTransformer.java @@ -24,7 +24,7 @@ * @author Federico Tomassetti */ @FunctionalInterface -public interface ResolvedTypeTransformer { +public interface ResolvedTypeTransformer { ResolvedType transform(ResolvedType type); } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeVariable.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeVariable.java index c2089596fd..d54e0d94f4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeVariable.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedTypeVariable.java @@ -31,25 +31,25 @@ * * @author Federico Tomassetti */ -public class ResolvedTypeVariable implements ResolvedType { +public class ResolvedTypeVariable implements ResolvedType { private ResolvedTypeParameterDeclaration typeParameter; - public ResolvedTypeVariable(ResolvedTypeParameterDeclaration typeParameter) { + public ResolvedTypeVariable(ResolvedTypeParameterDeclaration typeParameter) { this.typeParameter = typeParameter; } @Override - public String toString() { + public String toString() { return "TypeVariable {" + typeParameter.toString() + "}"; } - public String qualifiedName() { + public String qualifiedName() { return this.typeParameter.getQualifiedName(); } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -65,17 +65,17 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return typeParameter.hashCode(); } @Override - public boolean isArray() { + public boolean isArray() { return false; } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map inferredTypes) { if (tpToBeReplaced.getName().equals(this.typeParameter.getName())) { inferredTypes.put(this.asTypeParameter(), replaced); return replaced; @@ -84,32 +84,32 @@ public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToB } @Override - public boolean isReferenceType() { + public boolean isReferenceType() { return false; } @Override - public String describe() { + public String describe() { return typeParameter.getName(); } @Override - public ResolvedTypeParameterDeclaration asTypeParameter() { + public ResolvedTypeParameterDeclaration asTypeParameter() { return typeParameter; } @Override - public ResolvedTypeVariable asTypeVariable() { + public ResolvedTypeVariable asTypeVariable() { return this; } @Override - public boolean isTypeVariable() { + public boolean isTypeVariable() { return true; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { if (other.isTypeVariable()) { // if we want to compare something like @{code C extends Comparable} with @{code K extends Comparable} // we have to compare the type of the bound. For the moment we are focusing solely on the first type. @@ -122,7 +122,7 @@ public boolean isAssignableBy(ResolvedType other) { } @Override - public boolean mention(List typeParameters) { + public boolean mention(List typeParameters) { return typeParameters.contains(typeParameter); } @@ -133,7 +133,7 @@ public boolean mention(List typeParameters) { // If no bound is declared for a type variable, Object is assumed. // @Override - public ResolvedType erasure() { + public ResolvedType erasure() { if (typeParameter.isBounded()) { return typeParameter.getBounds().get(0).getType(); } @@ -144,12 +144,12 @@ public ResolvedType erasure() { * Returns the resolved type for a type variable. */ @Override - public ResolvedType solveGenericTypes(Context context) { + public ResolvedType solveGenericTypes(Context context) { return context.solveGenericType(describe()).orElse(this); } @Override - public String toDescriptor() { + public String toDescriptor() { return String.format("L%s;", qualifiedName()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedUnionType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedUnionType.java index f66c5bd6f7..69fcdb117a 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedUnionType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedUnionType.java @@ -29,18 +29,18 @@ * * @author Federico Tomassetti */ -public class ResolvedUnionType implements ResolvedType { +public class ResolvedUnionType implements ResolvedType { private List elements; - public ResolvedUnionType(List elements) { + public ResolvedUnionType(List elements) { if (elements.size() < 2) { throw new IllegalArgumentException("An union type should have at least two elements. This has " + elements.size()); } this.elements = new LinkedList<>(elements); } - public Optional getCommonAncestor() { + public Optional getCommonAncestor() { Optional> reduce = elements.stream().map(ResolvedType::asReferenceType).map(rt -> rt.getAllAncestors(ResolvedReferenceTypeDeclaration.breadthFirstFunc)).reduce((a, b) -> { ArrayList common = new ArrayList<>(a); common.retainAll(b); @@ -50,7 +50,7 @@ public Optional getCommonAncestor() { } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -60,34 +60,34 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { return new HashSet<>(elements).hashCode(); } @Override - public String describe() { + public String describe() { return String.join(" | ", elements.stream().map(ResolvedType::describe).collect(Collectors.toList())); } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { return elements.stream().allMatch(e -> e.isAssignableBy(other)); } @Override - public boolean isUnionType() { + public boolean isUnionType() { return true; } @Override - public ResolvedUnionType asUnionType() { + public ResolvedUnionType asUnionType() { return this; } /* * Returns the list of the resolved types */ - public List getElements() { + public List getElements() { return elements; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedVoidType.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedVoidType.java index 7e2e0cc0ba..aa972f82cb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedVoidType.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedVoidType.java @@ -25,7 +25,7 @@ * * @author Federico Tomassetti */ -public class ResolvedVoidType implements ResolvedType { +public class ResolvedVoidType implements ResolvedType { public static final ResolvedType INSTANCE = new ResolvedVoidType(); @@ -33,12 +33,12 @@ private ResolvedVoidType() { } @Override - public String describe() { + public String describe() { return "void"; } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { // According to https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-14.8: // """ // Note that the Java programming language does not allow a "cast to void" - void is not a type - so the @@ -54,12 +54,12 @@ public boolean isAssignableBy(ResolvedType other) { } @Override - public boolean isVoid() { + public boolean isVoid() { return true; } @Override - public String toDescriptor() { + public String toDescriptor() { return "V"; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedWildcard.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedWildcard.java index 56d6f29c3f..b67a7f0dd2 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedWildcard.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/ResolvedWildcard.java @@ -34,7 +34,7 @@ * * @author Federico Tomassetti */ -public class ResolvedWildcard implements ResolvedType { +public class ResolvedWildcard implements ResolvedType { public static ResolvedWildcard UNBOUNDED = new ResolvedWildcard(null, null); @@ -62,22 +62,22 @@ public static ResolvedWildcard extendsBound(ResolvedType type) { } @Override - public String toString() { + public String toString() { return "WildcardUsage{" + "type=" + type + ", boundedType=" + boundedType + '}'; } @Override - public boolean isWildcard() { + public boolean isWildcard() { return true; } @Override - public ResolvedWildcard asWildcard() { + public ResolvedWildcard asWildcard() { return this; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ResolvedWildcard)) @@ -91,14 +91,14 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = type != null ? type.hashCode() : 0; result = 31 * result + (boundedType != null ? boundedType.hashCode() : 0); return result; } @Override - public String describe() { + public String describe() { if (type == null) { return "?"; } @@ -111,19 +111,19 @@ public String describe() { throw new UnsupportedOperationException(); } - public boolean isSuper() { + public boolean isSuper() { return type == BoundType.SUPER; } - public boolean isExtends() { + public boolean isExtends() { return type == BoundType.EXTENDS; } - public boolean isBounded() { + public boolean isBounded() { return isSuper() || isExtends(); } - public ResolvedType getBoundedType() { + public ResolvedType getBoundedType() { if (boundedType == null) { throw new IllegalStateException(); } @@ -131,7 +131,7 @@ public ResolvedType getBoundedType() { } @Override - public boolean isAssignableBy(ResolvedType other) { + public boolean isAssignableBy(ResolvedType other) { if (boundedType == null) { // return other.isReferenceType() && // other.asReferenceType().getQualifiedName().equals(Object.class.getCanonicalName()); @@ -147,7 +147,7 @@ public boolean isAssignableBy(ResolvedType other) { } @Override - public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { + public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, Map inferredTypes) { if (replaced == null) { throw new IllegalArgumentException(); } @@ -165,19 +165,19 @@ public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToR } @Override - public boolean mention(List typeParameters) { + public boolean mention(List typeParameters) { return boundedType != null && boundedType.mention(typeParameters); } - public boolean isUpperBounded() { + public boolean isUpperBounded() { return isExtends(); } - public boolean isLowerBounded() { + public boolean isLowerBounded() { return isSuper(); } - public enum BoundType { + public enum BoundType { SUPER, EXTENDS } @@ -186,7 +186,7 @@ public enum BoundType { * Returns the bounded resolved type. */ @Override - public ResolvedType solveGenericTypes(Context context) { + public ResolvedType solveGenericTypes(Context context) { if (isExtends() || isSuper()) { ResolvedType boundResolved = getBoundedType().solveGenericTypes(context); if (isExtends()) { @@ -204,7 +204,7 @@ public ResolvedType solveGenericTypes(Context context) { // This method returns null if no bound is declared. This is probably a limitation. // @Override - public ResolvedType erasure() { + public ResolvedType erasure() { return boundedType; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParameterValueProvider.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParameterValueProvider.java index 2e4548d2dd..7016fac90f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParameterValueProvider.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParameterValueProvider.java @@ -28,7 +28,7 @@ /** * @author Federico Tomassetti */ -public interface ResolvedTypeParameterValueProvider { +public interface ResolvedTypeParameterValueProvider { /** * Calculate the value for the given type parameter. diff --git a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParametersMap.java b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParametersMap.java index 559273c396..bcfea40fc1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParametersMap.java +++ b/javaparser-core/src/main/java/com/github/javaparser/resolution/types/parametrization/ResolvedTypeParametersMap.java @@ -30,7 +30,7 @@ * * @author Federico Tomassetti */ -public class ResolvedTypeParametersMap { +public class ResolvedTypeParametersMap { public static class Builder { @@ -38,7 +38,7 @@ public static class Builder { private Map nameToDeclaration; - public Builder() { + public Builder() { nameToValue = new HashMap<>(); nameToDeclaration = new HashMap<>(); } @@ -50,11 +50,11 @@ private Builder(Map nameToValue, Maphttps://github.com/javaparser/javaparser/issues/2647 */ -public enum LineSeparator { +public enum LineSeparator { /** * The CR {@code \r} line ending is the default line separator for classic MacOS @@ -145,26 +145,26 @@ public static Optional lookupEscaped(String ending) { return Optional.empty(); } - public String describe() { + public String describe() { // TODO: Return a generated description rather than one hardcoded via constructor. return description; } - public boolean equalsString(LineSeparator lineSeparator) { + public boolean equalsString(LineSeparator lineSeparator) { return text.equals(lineSeparator.asRawString()); } - public boolean isStandardEol() { + public boolean isStandardEol() { // Compare based on the strings to allow for e.g. LineSeparator.SYSTEM return equalsString(LineSeparator.CR) || equalsString(LineSeparator.LF) || equalsString(LineSeparator.CRLF); } - public String asEscapedString() { + public String asEscapedString() { String result = text.replace("\r", "\\r").replace("\n", "\\n"); return result; } - public String asRawString() { + public String asRawString() { return text; } @@ -180,7 +180,7 @@ public String asRawString() { // return Optional.empty(); // } @Override - public String toString() { + public String toString() { return asRawString(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/Log.java b/javaparser-core/src/main/java/com/github/javaparser/utils/Log.java index bd61b7a508..94262e605f 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/Log.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/Log.java @@ -31,7 +31,7 @@ *

    * See a blog about this */ -public class Log { +public class Log { /** * This adapter logs to standard out and standard error. @@ -39,17 +39,17 @@ public class Log { public static class StandardOutStandardErrorAdapter implements Adapter { @Override - public void info(Supplier messageSupplier) { + public void info(Supplier messageSupplier) { System.out.println(messageSupplier.get()); } @Override - public void trace(Supplier messageSupplier) { + public void trace(Supplier messageSupplier) { System.out.println(messageSupplier.get()); } @Override - public void error(Supplier throwableSupplier, Supplier messageSupplier) { + public void error(Supplier throwableSupplier, Supplier messageSupplier) { Throwable throwable = throwableSupplier.get(); String message = messageSupplier.get(); if (message == null) { @@ -80,19 +80,19 @@ private void printStackTrace(Throwable throwable) { public static class SilentAdapter implements Adapter { @Override - public void info(Supplier messageSupplier) { + public void info(Supplier messageSupplier) { } @Override - public void trace(Supplier messageSupplier) { + public void trace(Supplier messageSupplier) { } @Override - public void error(Supplier throwableSupplier, Supplier messageSupplier) { + public void error(Supplier throwableSupplier, Supplier messageSupplier) { } } - public interface Adapter { + public interface Adapter { void info(Supplier message); diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/Pair.java b/javaparser-core/src/main/java/com/github/javaparser/utils/Pair.java index db8413936f..b41eb3ee5c 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/Pair.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/Pair.java @@ -29,19 +29,19 @@ * @param type of object a. * @param type of object b. */ -public class Pair { +public class Pair { public final A a; public final B b; - public Pair(A a, B b) { + public Pair(A a, B b) { this.a = a; this.b = b; } @Override - public boolean equals(Object o) { + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) @@ -55,13 +55,13 @@ public boolean equals(Object o) { } @Override - public int hashCode() { + public int hashCode() { int result = a != null ? a.hashCode() : 0; return 31 * result + (b != null ? b.hashCode() : 0); } @Override - public String toString() { + public String toString() { return f("<%s, %s>", a, b); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/ParserCollectionStrategy.java b/javaparser-core/src/main/java/com/github/javaparser/utils/ParserCollectionStrategy.java index 5437591173..675011baa0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/ParserCollectionStrategy.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/ParserCollectionStrategy.java @@ -35,25 +35,25 @@ * Note that any build artifacts will also be detected: jar files in target directories and so on. * Note that if your project has a module-info.java file, ensure that you have set the language level to at least 9. */ -public class ParserCollectionStrategy implements CollectionStrategy { +public class ParserCollectionStrategy implements CollectionStrategy { private final ParserConfiguration parserConfiguration; - public ParserCollectionStrategy() { + public ParserCollectionStrategy() { this(new ParserConfiguration()); } - public ParserCollectionStrategy(ParserConfiguration parserConfiguration) { + public ParserCollectionStrategy(ParserConfiguration parserConfiguration) { this.parserConfiguration = parserConfiguration; } @Override - public ParserConfiguration getParserConfiguration() { + public ParserConfiguration getParserConfiguration() { return parserConfiguration; } @Override - public ProjectRoot collect(Path path) { + public ProjectRoot collect(Path path) { ProjectRoot projectRoot = new ProjectRoot(path, parserConfiguration); try { Files.walkFileTree(path, new SimpleFileVisitor() { @@ -63,7 +63,7 @@ public ProjectRoot collect(Path path) { final PathMatcher javaMatcher = getPathMatcher("glob:**.java"); @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if ("module-info.java".equals(file.getFileName().toString())) { // module-info.java is useless for finding the source root, since it can be placed within any // directory. @@ -79,7 +79,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { } @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isHidden(dir) || (current_root != null && dir.startsWith(current_root))) { return SKIP_SUBTREE; } @@ -87,7 +87,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) t } @Override - public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException { + public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException { if (current_root != null && Files.isSameFile(dir, current_root)) { projectRoot.addSourceRoot(dir); current_root = null; diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/ProjectRoot.java b/javaparser-core/src/main/java/com/github/javaparser/utils/ProjectRoot.java index 4dc818d7f1..5bf4131bcf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/ProjectRoot.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/ProjectRoot.java @@ -35,7 +35,7 @@ *

    A project has a root directory, and it has zero or more directories that contain source code. *

    To create a ProjectRoot use a CollectionStrategy, or instantiate ProjectRoot yourself. */ -public class ProjectRoot { +public class ProjectRoot { private final Path root; @@ -43,33 +43,33 @@ public class ProjectRoot { private final ParserConfiguration parserConfiguration; - public ProjectRoot(Path root) { + public ProjectRoot(Path root) { this(root, new ParserConfiguration()); } - public ProjectRoot(Path root, ParserConfiguration parserConfiguration) { + public ProjectRoot(Path root, ParserConfiguration parserConfiguration) { this.root = root; this.parserConfiguration = parserConfiguration; } - public Optional getSourceRoot(Path sourceRoot) { + public Optional getSourceRoot(Path sourceRoot) { return Optional.ofNullable(cache.get(sourceRoot)); } - public List getSourceRoots() { + public List getSourceRoots() { return new ArrayList<>(cache.values()); } - public void addSourceRoot(Path path) { + public void addSourceRoot(Path path) { cache.put(path, new SourceRoot(path).setParserConfiguration(parserConfiguration)); } - public Path getRoot() { + public Path getRoot() { return root; } @Override - public String toString() { + public String toString() { return "ProjectRoot at " + root + " with " + cache.values().toString(); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/SeparatedItemStringBuilder.java b/javaparser-core/src/main/java/com/github/javaparser/utils/SeparatedItemStringBuilder.java index 735914d7b3..d9637d2235 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/SeparatedItemStringBuilder.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/SeparatedItemStringBuilder.java @@ -25,7 +25,7 @@ *
    Example: (1,2,3) which has prefix "(", separator ",", postfix ")" and the items 1 through 3. *

    Java 8 offers the very nice Collectors.joining(String, String, String) which does the same thing. */ -public class SeparatedItemStringBuilder { +public class SeparatedItemStringBuilder { private final String separator; @@ -35,7 +35,7 @@ public class SeparatedItemStringBuilder { private StringBuilder builder; - public SeparatedItemStringBuilder(String prefix, String separator, String postfix) { + public SeparatedItemStringBuilder(String prefix, String separator, String postfix) { builder = new StringBuilder(prefix); this.separator = separator; this.postfix = postfix; @@ -44,7 +44,7 @@ public SeparatedItemStringBuilder(String prefix, String separator, String postf /** * Add one item. Either pass a string, or a format for String.format and corresponding arguments. */ - public SeparatedItemStringBuilder append(CharSequence format, Object... args) { + public SeparatedItemStringBuilder append(CharSequence format, Object... args) { if (hasItems) { builder.append(separator); } @@ -53,7 +53,7 @@ public SeparatedItemStringBuilder append(CharSequence format, Object... args) { return this; } - public boolean hasItems() { + public boolean hasItems() { return hasItems; } @@ -61,7 +61,7 @@ public boolean hasItems() { * Convert the builder into its final string representation. */ @Override - public String toString() { + public String toString() { // This order of toStringing avoids debuggers from making a mess. return builder.toString() + postfix; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/SourceRoot.java b/javaparser-core/src/main/java/com/github/javaparser/utils/SourceRoot.java index 66c6daa71d..f530b83b7b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/SourceRoot.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/SourceRoot.java @@ -58,10 +58,10 @@ *

  • methods ending in "...Parallelized" will speed up parsing by using multiple threads.
  • * */ -public class SourceRoot { +public class SourceRoot { @FunctionalInterface - public interface Callback { + public interface Callback { enum Result { @@ -90,7 +90,7 @@ enum Result { * @param root the root directory of a set of source files. It corresponds to the root of the package structure of the * source files within, like "javaparser/javaparser-core/src/main/java" */ - public SourceRoot(Path root) { + public SourceRoot(Path root) { assertNotNull(root); if (!Files.isDirectory(root)) { throw new IllegalArgumentException("Only directories are allowed as root path: " + root); @@ -103,7 +103,7 @@ public SourceRoot(Path root) { * @param root the root directory of a set of source files. It corresponds to the root of the package structure of the * source files within, like "javaparser/javaparser-core/src/main/java" */ - public SourceRoot(Path root, ParserConfiguration parserConfiguration) { + public SourceRoot(Path root, ParserConfiguration parserConfiguration) { this(root); setParserConfiguration(parserConfiguration); } @@ -116,7 +116,7 @@ public SourceRoot(Path root, ParserConfiguration parserConfiguration) { * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public ParseResult tryToParse(String startPackage, String filename, ParserConfiguration configuration) throws IOException { + public ParseResult tryToParse(String startPackage, String filename, ParserConfiguration configuration) throws IOException { assertNotNull(startPackage); assertNotNull(filename); final Path relativePath = fileInPackageRelativePath(startPackage, filename); @@ -140,7 +140,7 @@ public ParseResult tryToParse(String startPackage, String file * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public ParseResult tryToParse(String startPackage, String filename) throws IOException { + public ParseResult tryToParse(String startPackage, String filename) throws IOException { return tryToParse(startPackage, filename, parserConfiguration); } @@ -152,14 +152,14 @@ public ParseResult tryToParse(String startPackage, String file * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public List> tryToParse(String startPackage) throws IOException { + public List> tryToParse(String startPackage) throws IOException { assertNotNull(startPackage); logPackage(startPackage); final Path path = packageAbsolutePath(root, startPackage); Files.walkFileTree(path, new SimpleFileVisitor() { @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!attrs.isDirectory() && file.toString().endsWith(".java")) { Path relative = root.relativize(file.getParent()); tryToParse(relative.toString(), file.getFileName().toString()); @@ -168,7 +168,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws I } @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { return isSensibleDirectoryToEnter(dir) ? CONTINUE : SKIP_SUBTREE; } }); @@ -194,7 +194,7 @@ boolean isSensibleDirectoryToEnter(Path dir) throws IOException { * the cache grows with every file parsed, so if you don't need saveAll(), or you don't ask SourceRoot to parse * files multiple times (where the cache is useful) you might want to use the parse method with a callback. */ - public List> tryToParse() throws IOException { + public List> tryToParse() throws IOException { return tryToParse(""); } @@ -210,7 +210,7 @@ public List> tryToParse() throws IOException { * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public List> tryToParseParallelized(String startPackage) { + public List> tryToParseParallelized(String startPackage) { assertNotNull(startPackage); logPackage(startPackage); final Path path = packageAbsolutePath(root, startPackage); @@ -239,7 +239,7 @@ public List> tryToParseParallelized(String startPa * file parsed, so if you don't need saveAll(), or you don't ask SourceRoot to parse files multiple times (where the * cache is useful) you might want to use the parse method with a callback. */ - public List> tryToParseParallelized() { + public List> tryToParseParallelized() { return tryToParseParallelized(""); } @@ -252,7 +252,7 @@ public List> tryToParseParallelized() { * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. * @throws ParseProblemException when something went wrong. */ - public CompilationUnit parse(String startPackage, String filename) { + public CompilationUnit parse(String startPackage, String filename) { assertNotNull(startPackage); assertNotNull(filename); try { @@ -290,7 +290,7 @@ private FileVisitResult callback(Path absolutePath, ParserConfiguration configur * @param startPackage The package containing the file * @param filename The name of the file */ - public SourceRoot parse(String startPackage, String filename, ParserConfiguration configuration, Callback callback) throws IOException { + public SourceRoot parse(String startPackage, String filename, ParserConfiguration configuration, Callback callback) throws IOException { assertNotNull(startPackage); assertNotNull(filename); assertNotNull(configuration); @@ -303,7 +303,7 @@ public SourceRoot parse(String startPackage, String filename, ParserConfigurati * Parses the provided .java file and passes it to the callback. In comparison to the other parse methods, this * makes is much more memory efficient., but saveAll() won't work. */ - public SourceRoot parse(String startPackage, String filename, Callback callback) throws IOException { + public SourceRoot parse(String startPackage, String filename, Callback callback) throws IOException { parse(startPackage, filename, parserConfiguration, callback); return this; } @@ -314,7 +314,7 @@ public SourceRoot parse(String startPackage, String filename, Callback callback * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public SourceRoot parse(String startPackage, ParserConfiguration configuration, Callback callback) throws IOException { + public SourceRoot parse(String startPackage, ParserConfiguration configuration, Callback callback) throws IOException { assertNotNull(startPackage); assertNotNull(configuration); assertNotNull(callback); @@ -324,7 +324,7 @@ public SourceRoot parse(String startPackage, ParserConfiguration configuration, Files.walkFileTree(path, new SimpleFileVisitor() { @Override - public FileVisitResult visitFile(Path absolutePath, BasicFileAttributes attrs) throws IOException { + public FileVisitResult visitFile(Path absolutePath, BasicFileAttributes attrs) throws IOException { if (!attrs.isDirectory() && absolutePath.toString().endsWith(".java")) { return callback(absolutePath, configuration, callback); } @@ -332,7 +332,7 @@ public FileVisitResult visitFile(Path absolutePath, BasicFileAttributes attrs) } @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { return isSensibleDirectoryToEnter(dir) ? CONTINUE : SKIP_SUBTREE; } }); @@ -340,7 +340,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) t return this; } - public SourceRoot parse(String startPackage, Callback callback) throws IOException { + public SourceRoot parse(String startPackage, Callback callback) throws IOException { parse(startPackage, parserConfiguration, callback); return this; } @@ -362,7 +362,7 @@ private void logPackage(String startPackage) { * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public SourceRoot parseParallelized(String startPackage, ParserConfiguration configuration, Callback callback) { + public SourceRoot parseParallelized(String startPackage, ParserConfiguration configuration, Callback callback) { assertNotNull(startPackage); assertNotNull(configuration); assertNotNull(callback); @@ -394,7 +394,7 @@ public SourceRoot parseParallelized(String startPackage, ParserConfiguration co * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public SourceRoot parseParallelized(String startPackage, Callback callback) throws IOException { + public SourceRoot parseParallelized(String startPackage, Callback callback) throws IOException { return parseParallelized(startPackage, this.parserConfiguration, callback); } @@ -405,7 +405,7 @@ public SourceRoot parseParallelized(String startPackage, Callback callback) thr * ensure thread safety, a new parser instance is created for every file. In comparison to the other parse methods, * this is much more memory efficient, but saveAll() won't work. */ - public SourceRoot parseParallelized(Callback callback) throws IOException { + public SourceRoot parseParallelized(Callback callback) throws IOException { return parseParallelized("", this.parserConfiguration, callback); } @@ -414,7 +414,7 @@ public SourceRoot parseParallelized(Callback callback) throws IOException { * * @param startPackage files in this package and deeper are parsed. Pass "" to parse all files. */ - public SourceRoot add(String startPackage, String filename, CompilationUnit compilationUnit) { + public SourceRoot add(String startPackage, String filename, CompilationUnit compilationUnit) { assertNotNull(startPackage); assertNotNull(filename); assertNotNull(compilationUnit); @@ -429,7 +429,7 @@ public SourceRoot add(String startPackage, String filename, CompilationUnit com * Add a newly created Java file to the cache of this source root. It will be saved when saveAll is called. It needs * to have its path set. */ - public SourceRoot add(CompilationUnit compilationUnit) { + public SourceRoot add(CompilationUnit compilationUnit) { assertNotNull(compilationUnit); if (compilationUnit.getStorage().isPresent()) { final Path path = compilationUnit.getStorage().get().getPath(); @@ -470,7 +470,7 @@ private SourceRoot save(CompilationUnit cu, Path path, Charset encoding) { * @param root the root of the java packages * @param encoding the encoding to use while saving the file */ - public SourceRoot saveAll(Path root, Charset encoding) { + public SourceRoot saveAll(Path root, Charset encoding) { assertNotNull(root); Log.info("Saving all files (%s) to %s", cache::size, () -> root); for (Map.Entry> cu : cache.entrySet()) { @@ -487,14 +487,14 @@ public SourceRoot saveAll(Path root, Charset encoding) { * Save all previously parsed files back to a new path. * @param root the root of the java packages */ - public SourceRoot saveAll(Path root) { + public SourceRoot saveAll(Path root) { return saveAll(root, parserConfiguration.getCharacterEncoding()); } /** * Save all previously parsed files back to where they were found. */ - public SourceRoot saveAll() { + public SourceRoot saveAll() { return saveAll(root); } @@ -502,14 +502,14 @@ public SourceRoot saveAll() { * Save all previously parsed files back to where they were found, with the given encoding. * @param encoding the encoding to use. */ - public SourceRoot saveAll(Charset encoding) { + public SourceRoot saveAll(Charset encoding) { return saveAll(root, encoding); } /** * The Java files that have been parsed by this source root object, or have been added manually. */ - public List> getCache() { + public List> getCache() { return new ArrayList<>(cache.values()); } @@ -517,25 +517,25 @@ public List> getCache() { * The CompilationUnits of the Java files that have been parsed succesfully by this source root object, or have been * added manually. */ - public List getCompilationUnits() { + public List getCompilationUnits() { return cache.values().stream().filter(ParseResult::isSuccessful).map(p -> p.getResult().get()).collect(Collectors.toList()); } /** * The path that was passed in the constructor. */ - public Path getRoot() { + public Path getRoot() { return root; } - public ParserConfiguration getParserConfiguration() { + public ParserConfiguration getParserConfiguration() { return parserConfiguration; } /** * Set the parser configuration that is used for parsing when no configuration is passed to a method. */ - public SourceRoot setParserConfiguration(ParserConfiguration parserConfiguration) { + public SourceRoot setParserConfiguration(ParserConfiguration parserConfiguration) { assertNotNull(parserConfiguration); this.parserConfiguration = parserConfiguration; return this; @@ -544,7 +544,7 @@ public SourceRoot setParserConfiguration(ParserConfiguration parserConfiguratio /** * Set the printing function that transforms compilation units into a string to save. */ - public SourceRoot setPrinter(Function printer) { + public SourceRoot setPrinter(Function printer) { assertNotNull(printer); this.printer = printer; return this; @@ -553,7 +553,7 @@ public SourceRoot setPrinter(Function printer) { /** * Get the printing function. */ - public Function getPrinter() { + public Function getPrinter() { return printer; } @@ -584,7 +584,7 @@ protected void compute() { Files.walkFileTree(path, new SimpleFileVisitor() { @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (!root.isSensibleDirectoryToEnter(dir)) { return SKIP_SUBTREE; } @@ -598,7 +598,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) t } @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { return callback.process(file, attrs); } }); @@ -617,7 +617,7 @@ interface VisitFileCallback { } @Override - public String toString() { + public String toString() { return "SourceRoot at " + root; } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/SourceZip.java b/javaparser-core/src/main/java/com/github/javaparser/utils/SourceZip.java index 648e2dbe49..c4052f7345 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/SourceZip.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/SourceZip.java @@ -40,7 +40,7 @@ * A collection of Java source files and its sub-directories located in a ZIP or JAR file on the file system. * Files can be parsed with a callback. */ -public class SourceZip { +public class SourceZip { private final Path zipPath; @@ -52,7 +52,7 @@ public class SourceZip { * * @param zipPath The absolute path of ZIP file to parse. */ - public SourceZip(Path zipPath) { + public SourceZip(Path zipPath) { this(zipPath, new ParserConfiguration()); } @@ -63,7 +63,7 @@ public SourceZip(Path zipPath) { * @param zipPath The absolute path of ZIP file to parse. * @param configuration The configuration to initiate the default parser with. */ - public SourceZip(Path zipPath, ParserConfiguration configuration) { + public SourceZip(Path zipPath, ParserConfiguration configuration) { assertNotNull(zipPath); assertNotNull(configuration); this.zipPath = zipPath.normalize(); @@ -79,7 +79,7 @@ public SourceZip(Path zipPath, ParserConfiguration configuration) { * * @throws IOException If an error occurs while trying to parse the given source. */ - public List>> parse() throws IOException { + public List>> parse() throws IOException { Log.info("Parsing zip at \"%s\"", () -> zipPath); List>> results = new ArrayList<>(); parse((path, result) -> results.add(new Pair<>(path, result))); @@ -94,7 +94,7 @@ public List>> parse() throws IOExceptio * * @throws IOException If an error occurs while trying to parse the given source. */ - public SourceZip parse(Callback callback) throws IOException { + public SourceZip parse(Callback callback) throws IOException { Log.info("Parsing zip at \"%s\"", () -> zipPath); JavaParser javaParser = new JavaParser(parserConfiguration); try (ZipFile zipFile = new ZipFile(zipPath.toFile())) { @@ -113,7 +113,7 @@ public SourceZip parse(Callback callback) throws IOException { * An interface to define a callback for each file that's parsed. */ @FunctionalInterface - public interface Callback { + public interface Callback { /** * Process the given parse result. @@ -129,15 +129,15 @@ public interface Callback { * * @return The absolute path of this ZIP file. */ - public Path getZipPath() { + public Path getZipPath() { return zipPath; } - public ParserConfiguration getParserConfiguration() { + public ParserConfiguration getParserConfiguration() { return parserConfiguration; } - public SourceZip setParserConfiguration(ParserConfiguration parserConfiguration) { + public SourceZip setParserConfiguration(ParserConfiguration parserConfiguration) { assertNotNull(parserConfiguration); this.parserConfiguration = parserConfiguration; return this; diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java b/javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java index e1ef439b33..f0e38112cf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java @@ -25,7 +25,7 @@ import java.lang.reflect.Method; import java.util.Optional; -public class TypeUtils { +public class TypeUtils { /* * Returns the method descriptor (https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.3.3) diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/Utils.java b/javaparser-core/src/main/java/com/github/javaparser/utils/Utils.java index a076ba8cb0..9e39b4f9df 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/Utils.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/Utils.java @@ -33,7 +33,7 @@ * * @author Federico Tomassetti */ -public class Utils { +public class Utils { public static boolean isNullOrEmpty(Collection collection) { return collection == null || collection.isEmpty(); diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorList.java b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorList.java index 0d6e719054..6560d882bf 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorList.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorList.java @@ -31,7 +31,7 @@ * A list that overrides the equals and hashcode calculation of the added nodes * by using another equals and hashcode visitor for those methods. */ -public class VisitorList implements List { +public class VisitorList implements List { protected List innerList; @@ -42,24 +42,24 @@ public class VisitorList implements List { /** * Pass the visitors to use for equals and hashcode. */ - public VisitorList(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { + public VisitorList(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { this.hashcodeVisitor = hashcodeVisitor; this.equalsVisitor = equalsVisitor; innerList = new ArrayList<>(); } @Override - public boolean add(N elem) { + public boolean add(N elem) { return innerList.add(new EqualsHashcodeOverridingFacade(elem)); } @Override - public void add(int index, N elem) { + public void add(int index, N elem) { innerList.add(index, new EqualsHashcodeOverridingFacade(elem)); } @Override - public boolean addAll(Collection col) { + public boolean addAll(Collection col) { boolean modified = false; for (N elem : col) if (add(elem)) modified = true; @@ -67,7 +67,7 @@ public boolean addAll(Collection col) { } @Override - public boolean addAll(int index, Collection col) { + public boolean addAll(int index, Collection col) { if (col.isEmpty()) return false; for (N elem : col) { @@ -81,135 +81,135 @@ public boolean addAll(int index, Collection col) { } @Override - public void clear() { + public void clear() { innerList.clear(); } @Override - public boolean contains(Object elem) { + public boolean contains(Object elem) { return innerList.contains(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public boolean containsAll(Collection col) { + public boolean containsAll(Collection col) { for (Object elem : col) if (!contains(elem)) return false; return true; } @Override - public N get(int index) { + public N get(int index) { return innerList.get(index).overridden; } @Override - public int indexOf(Object elem) { + public int indexOf(Object elem) { return innerList.indexOf(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public boolean isEmpty() { + public boolean isEmpty() { return innerList.isEmpty(); } @Override - public Iterator iterator() { + public Iterator iterator() { return new Iterator() { final Iterator itr = innerList.iterator(); @Override - public boolean hasNext() { + public boolean hasNext() { return itr.hasNext(); } @Override - public N next() { + public N next() { return itr.next().overridden; } @Override - public void remove() { + public void remove() { itr.remove(); } }; } @Override - public int lastIndexOf(Object elem) { + public int lastIndexOf(Object elem) { return innerList.lastIndexOf(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public ListIterator listIterator() { + public ListIterator listIterator() { return listIterator(0); } @Override - public ListIterator listIterator(int index) { + public ListIterator listIterator(int index) { return new ListIterator() { final ListIterator itr = innerList.listIterator(index); @Override - public boolean hasNext() { + public boolean hasNext() { return itr.hasNext(); } @Override - public N next() { + public N next() { return itr.next().overridden; } @Override - public void remove() { + public void remove() { itr.remove(); } @Override - public void add(N elem) { + public void add(N elem) { itr.add(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public boolean hasPrevious() { + public boolean hasPrevious() { return itr.hasPrevious(); } @Override - public int nextIndex() { + public int nextIndex() { return itr.nextIndex(); } @Override - public N previous() { + public N previous() { return itr.previous().overridden; } @Override - public int previousIndex() { + public int previousIndex() { return itr.previousIndex(); } @Override - public void set(N elem) { + public void set(N elem) { itr.set(new EqualsHashcodeOverridingFacade((N) elem)); } }; } @Override - public boolean remove(Object elem) { + public boolean remove(Object elem) { return innerList.remove(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public N remove(int index) { + public N remove(int index) { return innerList.remove(index).overridden; } @Override - public boolean removeAll(Collection col) { + public boolean removeAll(Collection col) { boolean modified = false; for (Object elem : col) if (remove(elem)) modified = true; @@ -217,7 +217,7 @@ public boolean removeAll(Collection col) { } @Override - public boolean retainAll(Collection col) { + public boolean retainAll(Collection col) { int oldSize = size(); clear(); addAll((Collection) col); @@ -225,17 +225,17 @@ public boolean retainAll(Collection col) { } @Override - public N set(int index, N elem) { + public N set(int index, N elem) { return innerList.set(index, new EqualsHashcodeOverridingFacade((N) elem)).overridden; } @Override - public int size() { + public int size() { return innerList.size(); } @Override - public List subList(int fromIndex, int toIndex) { + public List subList(int fromIndex, int toIndex) { return new VisitorList(hashcodeVisitor, equalsVisitor) { { @@ -245,17 +245,17 @@ public List subList(int fromIndex, int toIndex) { } @Override - public Object[] toArray() { + public Object[] toArray() { return innerList.stream().map(facade -> facade.overridden).collect(Collectors.toList()).toArray(); } @Override - public T[] toArray(T[] arr) { + public T[] toArray(T[] arr) { return innerList.stream().map(facade -> facade.overridden).collect(Collectors.toList()).toArray(arr); } @Override - public String toString() { + public String toString() { StringBuilder sb = new StringBuilder("["); if (size() == 0) return sb.append("]").toString(); @@ -274,12 +274,12 @@ private class EqualsHashcodeOverridingFacade implements Visitable { } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { throw new AssertionError(); } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { throw new AssertionError(); } @@ -289,7 +289,7 @@ public final int hashCode() { } @Override - public boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (obj == null || !(obj instanceof VisitorList.EqualsHashcodeOverridingFacade)) { return false; } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorMap.java b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorMap.java index f2db3abcd0..f9f97e54d4 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorMap.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorMap.java @@ -34,7 +34,7 @@ * A map that overrides the equals and hashcode calculation of the added nodes * by using another equals and hashcode visitor for those methods. */ -public class VisitorMap implements Map { +public class VisitorMap implements Map { private final Map innerMap = new HashMap<>(); @@ -45,38 +45,38 @@ public class VisitorMap implements Map { /** * Pass the visitors to use for equals and hashcode. */ - public VisitorMap(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { + public VisitorMap(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { this.hashcodeVisitor = hashcodeVisitor; this.equalsVisitor = equalsVisitor; } @Override - public int size() { + public int size() { return innerMap.size(); } @Override - public boolean isEmpty() { + public boolean isEmpty() { return innerMap.isEmpty(); } @Override - public boolean containsKey(Object key) { + public boolean containsKey(Object key) { return innerMap.containsKey(new EqualsHashcodeOverridingFacade((N) key)); } @Override - public boolean containsValue(Object value) { + public boolean containsValue(Object value) { return innerMap.containsValue(value); } @Override - public V get(Object key) { + public V get(Object key) { return innerMap.get(new EqualsHashcodeOverridingFacade((N) key)); } @Override - public V put(N key, V value) { + public V put(N key, V value) { return innerMap.put(new EqualsHashcodeOverridingFacade(key), value); } @@ -89,12 +89,12 @@ private class EqualsHashcodeOverridingFacade implements Visitable { } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { throw new AssertionError(); } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { throw new AssertionError(); } @@ -104,7 +104,7 @@ public final int hashCode() { } @Override - public boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (obj == null || !(obj instanceof VisitorMap.EqualsHashcodeOverridingFacade)) { return false; } @@ -113,32 +113,32 @@ public boolean equals(final Object obj) { } @Override - public V remove(Object key) { + public V remove(Object key) { return innerMap.remove(new EqualsHashcodeOverridingFacade((N) key)); } @Override - public void putAll(Map m) { + public void putAll(Map m) { m.forEach(this::put); } @Override - public void clear() { + public void clear() { innerMap.clear(); } @Override - public Set keySet() { + public Set keySet() { return innerMap.keySet().stream().map(k -> k.overridden).collect(Collectors.toSet()); } @Override - public Collection values() { + public Collection values() { return innerMap.values(); } @Override - public Set> entrySet() { + public Set> entrySet() { return innerMap.entrySet().stream().map(e -> new HashMap.SimpleEntry<>(e.getKey().overridden, e.getValue())).collect(Collectors.toSet()); } } diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorSet.java b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorSet.java index 51f99c9bf9..151b594b6b 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorSet.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/VisitorSet.java @@ -34,7 +34,7 @@ * A set that overrides the equals and hashcode calculation of the added nodes * by using another equals and hashcode visitor for those methods. */ -public class VisitorSet implements Set { +public class VisitorSet implements Set { private final Set innerSet = new HashSet<>(); @@ -45,18 +45,18 @@ public class VisitorSet implements Set { /** * Pass the visitors to use for equals and hashcode. */ - public VisitorSet(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { + public VisitorSet(GenericVisitor hashcodeVisitor, GenericVisitor equalsVisitor) { this.hashcodeVisitor = hashcodeVisitor; this.equalsVisitor = equalsVisitor; } @Override - public boolean add(N elem) { + public boolean add(N elem) { return innerSet.add(new EqualsHashcodeOverridingFacade(elem)); } @Override - public boolean addAll(Collection col) { + public boolean addAll(Collection col) { boolean modified = false; for (N elem : col) if (add(elem)) modified = true; @@ -64,57 +64,57 @@ public boolean addAll(Collection col) { } @Override - public void clear() { + public void clear() { innerSet.clear(); } @Override - public boolean contains(Object elem) { + public boolean contains(Object elem) { return innerSet.contains(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public boolean containsAll(Collection col) { + public boolean containsAll(Collection col) { for (Object elem : col) if (!contains(elem)) return false; return true; } @Override - public boolean isEmpty() { + public boolean isEmpty() { return innerSet.isEmpty(); } @Override - public Iterator iterator() { + public Iterator iterator() { return new Iterator() { final Iterator itr = innerSet.iterator(); @Override - public boolean hasNext() { + public boolean hasNext() { return itr.hasNext(); } @Override - public N next() { + public N next() { return itr.next().overridden; } @Override - public void remove() { + public void remove() { itr.remove(); } }; } @Override - public boolean remove(Object elem) { + public boolean remove(Object elem) { return innerSet.remove(new EqualsHashcodeOverridingFacade((N) elem)); } @Override - public boolean removeAll(Collection col) { + public boolean removeAll(Collection col) { boolean modified = false; for (Object elem : col) if (remove(elem)) modified = true; @@ -122,7 +122,7 @@ public boolean removeAll(Collection col) { } @Override - public boolean retainAll(Collection col) { + public boolean retainAll(Collection col) { int oldSize = size(); clear(); addAll((Collection) col); @@ -130,22 +130,22 @@ public boolean retainAll(Collection col) { } @Override - public int size() { + public int size() { return innerSet.size(); } @Override - public Object[] toArray() { + public Object[] toArray() { return innerSet.stream().map(facade -> facade.overridden).collect(Collectors.toList()).toArray(); } @Override - public T[] toArray(T[] arr) { + public T[] toArray(T[] arr) { return innerSet.stream().map(facade -> facade.overridden).collect(Collectors.toList()).toArray(arr); } @Override - public String toString() { + public String toString() { StringBuilder sb = new StringBuilder("["); if (size() == 0) return sb.append("]").toString(); @@ -164,12 +164,12 @@ private class EqualsHashcodeOverridingFacade implements Visitable { } @Override - public R accept(GenericVisitor v, A arg) { + public R accept(GenericVisitor v, A arg) { throw new AssertionError(); } @Override - public void accept(VoidVisitor v, A arg) { + public void accept(VoidVisitor v, A arg) { throw new AssertionError(); } @@ -179,7 +179,7 @@ public final int hashCode() { } @Override - public boolean equals(final Object obj) { + public boolean equals(final Object obj) { if (obj == null || !(obj instanceof VisitorSet.EqualsHashcodeOverridingFacade)) { return false; }