From eafd05816b408efbaa8291d7f6108fa6a2750a3d Mon Sep 17 00:00:00 2001 From: Alexander Weigl Date: Sun, 19 Nov 2023 16:53:24 +0100 Subject: [PATCH] Regneration of Meta/Core classes --- .../com/github/javaparser/JavadocParser.java | 8 +- .../LineEndingProcessingProvider.java | 32 +- .../UnicodeEscapeProcessingProvider.java | 4 +- .../javaparser/ast/CompilationUnit.java | 2 +- .../java/com/github/javaparser/ast/Node.java | 12 +- .../ast/body/AnnotationDeclaration.java | 1 - .../ast/body/CallableDeclaration.java | 13 +- .../body/CompactConstructorDeclaration.java | 13 +- .../ast/body/ConstructorDeclaration.java | 5 +- .../javaparser/ast/body/FieldDeclaration.java | 8 +- .../ast/body/MethodDeclaration.java | 8 +- .../javaparser/ast/comments/BlockComment.java | 1 - .../javaparser/ast/comments/Comment.java | 1 - .../javaparser/ast/comments/LineComment.java | 1 - .../ast/expr/BooleanLiteralExpr.java | 1 - .../javaparser/ast/expr/CharLiteralExpr.java | 1 - .../ast/expr/DoubleLiteralExpr.java | 1 - .../ast/expr/IntegerLiteralExpr.java | 1 - .../javaparser/ast/expr/LiteralExpr.java | 1 - .../javaparser/ast/expr/LongLiteralExpr.java | 1 - .../javaparser/ast/expr/NullLiteralExpr.java | 1 - .../ast/jml/body/JmlClassLevel.java | 1 - .../javaparser/ast/jml/stmt/JmlStatement.java | 1 - .../ast/observer/ObservableProperty.java | 2 +- .../github/javaparser/ast/stmt/EmptyStmt.java | 1 - .../javaparser/ast/type/ReferenceType.java | 1 - .../javaparser/ast/type/UnknownType.java | 1 - .../github/javaparser/ast/type/VarType.java | 4 +- .../github/javaparser/ast/type/VoidType.java | 1 - .../Java17Validator.java | 1 + .../UpgradeJavaMessage.java | 11 +- .../AnnotationDeclarationMetaModel.java | 1 - .../metamodel/AnnotationExprMetaModel.java | 1 - .../AnnotationMemberDeclarationMetaModel.java | 1 - .../metamodel/ArrayAccessExprMetaModel.java | 1 - .../metamodel/ArrayCreationExprMetaModel.java | 1 - .../ArrayCreationLevelMetaModel.java | 1 - .../ArrayInitializerExprMetaModel.java | 1 - .../metamodel/ArrayTypeMetaModel.java | 1 - .../metamodel/AssertStmtMetaModel.java | 1 - .../metamodel/AssignExprMetaModel.java | 1 - .../metamodel/BinaryExprMetaModel.java | 1 - .../metamodel/BlockCommentMetaModel.java | 1 - .../metamodel/BlockStmtMetaModel.java | 1 - .../metamodel/BodyDeclarationMetaModel.java | 1 - .../BooleanLiteralExprMetaModel.java | 1 - .../metamodel/BreakStmtMetaModel.java | 1 - .../CallableDeclarationMetaModel.java | 1 - .../metamodel/CastExprMetaModel.java | 1 - .../metamodel/CatchClauseMetaModel.java | 1 - .../metamodel/CharLiteralExprMetaModel.java | 1 - .../metamodel/ClassExprMetaModel.java | 1 - .../ClassOrInterfaceDeclarationMetaModel.java | 1 - .../ClassOrInterfaceTypeMetaModel.java | 1 - .../metamodel/CommentMetaModel.java | 1 - ...ompactConstructorDeclarationMetaModel.java | 1 - .../metamodel/CompilationUnitMetaModel.java | 1 - .../metamodel/ConditionalExprMetaModel.java | 1 - .../ConstructorDeclarationMetaModel.java | 1 - .../metamodel/ContinueStmtMetaModel.java | 1 - .../javaparser/metamodel/DoStmtMetaModel.java | 1 - .../metamodel/DoubleLiteralExprMetaModel.java | 1 - .../metamodel/EmptyStmtMetaModel.java | 1 - .../metamodel/EnclosedExprMetaModel.java | 1 - .../EnumConstantDeclarationMetaModel.java | 1 - .../metamodel/EnumDeclarationMetaModel.java | 1 - ...citConstructorInvocationStmtMetaModel.java | 1 - .../metamodel/ExpressionMetaModel.java | 1 - .../metamodel/ExpressionStmtMetaModel.java | 1 - .../metamodel/FieldAccessExprMetaModel.java | 1 - .../metamodel/FieldDeclarationMetaModel.java | 1 - .../metamodel/ForEachStmtMetaModel.java | 1 - .../metamodel/ForStmtMetaModel.java | 1 - .../javaparser/metamodel/IfStmtMetaModel.java | 1 - .../metamodel/ImportDeclarationMetaModel.java | 1 - .../InitializerDeclarationMetaModel.java | 1 - .../metamodel/InstanceOfExprMetaModel.java | 1 - .../IntegerLiteralExprMetaModel.java | 1 - .../metamodel/IntersectionTypeMetaModel.java | 1 - .../metamodel/JavadocCommentMetaModel.java | 1 - .../metamodel/JmlBeginStmtMetaModel.java | 1 - .../JmlBinaryInfixExprMetaModel.java | 1 - .../JmlBodyDeclarationMetaModel.java | 1 - .../metamodel/JmlCallableClauseMetaModel.java | 1 - ...mlClassAccessibleDeclarationMetaModel.java | 1 - .../JmlClassExprDeclarationMetaModel.java | 1 - .../metamodel/JmlClassLevelMetaModel.java | 1 - .../metamodel/JmlClauseLabelMetaModel.java | 1 - .../metamodel/JmlClauseMetaModel.java | 1 - .../metamodel/JmlContractMetaModel.java | 1 - .../metamodel/JmlDocDeclarationMetaModel.java | 1 - .../javaparser/metamodel/JmlDocMetaModel.java | 1 - .../metamodel/JmlDocStmtMetaModel.java | 1 - .../metamodel/JmlDocTypeMetaModel.java | 1 - .../metamodel/JmlEndStmtMetaModel.java | 1 - .../metamodel/JmlExpressionStmtMetaModel.java | 1 - .../JmlFieldDeclarationMetaModel.java | 1 - .../metamodel/JmlForallClauseMetaModel.java | 1 - .../metamodel/JmlGhostStmtMetaModel.java | 1 - .../metamodel/JmlLabelExprMetaModel.java | 1 - .../metamodel/JmlLabelStmtMetaModel.java | 1 - .../metamodel/JmlLetExprMetaModel.java | 1 - .../JmlMethodDeclarationMetaModel.java | 1 - .../JmlMultiCompareExprMetaModel.java | 1 - .../JmlMultiExprClauseMetaModel.java | 1 - .../metamodel/JmlOldClauseMetaModel.java | 1 - .../metamodel/JmlQuantifiedExprMetaModel.java | 1 - .../metamodel/JmlRefiningStmtMetaModel.java | 1 - .../JmlRepresentsDeclarationMetaModel.java | 1 - .../JmlSetComprehensionMetaModel.java | 1 - .../metamodel/JmlSignalsClauseMetaModel.java | 1 - .../JmlSignalsOnlyClauseMetaModel.java | 1 - .../JmlSimpleExprClauseMetaModel.java | 1 - .../metamodel/JmlStatementMetaModel.java | 1 - .../metamodel/JmlTypeExprMetaModel.java | 1 - .../JmlUnreachableStmtMetaModel.java | 1 - .../metamodel/LabeledStmtMetaModel.java | 1 - .../metamodel/LambdaExprMetaModel.java | 1 - .../metamodel/LineCommentMetaModel.java | 1 - .../metamodel/LiteralExprMetaModel.java | 1 - .../LiteralStringValueExprMetaModel.java | 1 - .../LocalClassDeclarationStmtMetaModel.java | 1 - .../LocalRecordDeclarationStmtMetaModel.java | 1 - .../metamodel/LongLiteralExprMetaModel.java | 1 - .../MarkerAnnotationExprMetaModel.java | 1 - .../metamodel/MemberValuePairMetaModel.java | 1 - .../metamodel/MethodCallExprMetaModel.java | 1 - .../metamodel/MethodDeclarationMetaModel.java | 1 - .../MethodReferenceExprMetaModel.java | 1 - .../metamodel/ModifierMetaModel.java | 1 - .../metamodel/ModuleDeclarationMetaModel.java | 1 - .../metamodel/ModuleDirectiveMetaModel.java | 1 - .../ModuleExportsDirectiveMetaModel.java | 1 - .../ModuleOpensDirectiveMetaModel.java | 1 - .../ModuleProvidesDirectiveMetaModel.java | 1 - .../ModuleRequiresDirectiveMetaModel.java | 1 - .../ModuleUsesDirectiveMetaModel.java | 1 - .../metamodel/NameExprMetaModel.java | 1 - .../javaparser/metamodel/NameMetaModel.java | 1 - .../javaparser/metamodel/NodeMetaModel.java | 1 - .../NormalAnnotationExprMetaModel.java | 1 - .../metamodel/NullLiteralExprMetaModel.java | 1 - .../ObjectCreationExprMetaModel.java | 1 - .../PackageDeclarationMetaModel.java | 1 - .../metamodel/ParameterMetaModel.java | 1 - .../metamodel/PatternExprMetaModel.java | 1 - .../metamodel/PrimitiveTypeMetaModel.java | 1 - .../metamodel/ReceiverParameterMetaModel.java | 1 - .../metamodel/RecordDeclarationMetaModel.java | 1 - .../metamodel/ReferenceTypeMetaModel.java | 1 - .../metamodel/ReturnStmtMetaModel.java | 1 - .../metamodel/SimpleNameMetaModel.java | 1 - .../SingleMemberAnnotationExprMetaModel.java | 1 - .../metamodel/StatementMetaModel.java | 1 - .../metamodel/StringLiteralExprMetaModel.java | 1 - .../metamodel/SuperExprMetaModel.java | 1 - .../metamodel/SwitchEntryMetaModel.java | 1 - .../metamodel/SwitchExprMetaModel.java | 1 - .../metamodel/SwitchStmtMetaModel.java | 1 - .../metamodel/SynchronizedStmtMetaModel.java | 1 - .../TextBlockLiteralExprMetaModel.java | 1 - .../metamodel/ThisExprMetaModel.java | 1 - .../metamodel/ThrowStmtMetaModel.java | 1 - .../metamodel/TryStmtMetaModel.java | 1 - .../metamodel/TypeDeclarationMetaModel.java | 1 - .../metamodel/TypeExprMetaModel.java | 1 - .../javaparser/metamodel/TypeMetaModel.java | 1 - .../metamodel/TypeParameterMetaModel.java | 1 - .../metamodel/UnaryExprMetaModel.java | 1 - .../metamodel/UnionTypeMetaModel.java | 1 - .../metamodel/UnknownTypeMetaModel.java | 1 - .../metamodel/UnparsableStmtMetaModel.java | 1 - .../metamodel/VarTypeMetaModel.java | 1 - .../VariableDeclarationExprMetaModel.java | 1 - .../VariableDeclaratorMetaModel.java | 1 - .../metamodel/VoidTypeMetaModel.java | 1 - .../metamodel/WhileStmtMetaModel.java | 1 - .../metamodel/WildcardTypeMetaModel.java | 1 - .../metamodel/YieldStmtMetaModel.java | 1 - .../printer/ConcreteSyntaxModel.java | 14 +- .../github/javaparser/printer/XmlPrinter.java | 91 ++-- .../concretesyntaxmodel/CsmConditional.java | 4 + .../concretesyntaxmodel/CsmElement.java | 3 +- .../concretesyntaxmodel/CsmIndent.java | 3 +- .../printer/concretesyntaxmodel/CsmToken.java | 6 +- .../lexicalpreservation/ChildTextElement.java | 2 +- .../lexicalpreservation/Difference.java | 5 +- .../LexicalDifferenceCalculator.java | 5 +- .../LexicalPreservingPrinter.java | 8 +- .../LookaheadIterator.java | 59 ++- .../lexicalpreservation/PeekingIterator.java | 455 +++++++++--------- .../lexicalpreservation/PhantomNodeLogic.java | 4 +- .../ReshuffledDiffElementExtractor.java | 430 ++++++++--------- .../lexicalpreservation/TokenTextElement.java | 1 - .../ResolvedReferenceTypeDeclaration.java | 20 +- .../logic/ConstructorResolutionLogic.java | 38 +- .../logic/FunctionalInterfaceLogic.java | 10 +- .../logic/MethodResolutionLogic.java | 37 +- .../types/ResolvedIntersectionType.java | 1 - .../types/ResolvedPrimitiveType.java | 1 - .../resolution/types/ResolvedUnionType.java | 1 - .../javaparser/utils/PositionUtils.java | 1 - 202 files changed, 616 insertions(+), 871 deletions(-) diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavadocParser.java b/javaparser-core/src/main/java/com/github/javaparser/JavadocParser.java index b0e2c0eb9c..e490902562 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/JavadocParser.java +++ b/javaparser-core/src/main/java/com/github/javaparser/JavadocParser.java @@ -97,11 +97,11 @@ private static List cleanLines(String content) { return l; } if (l.length() > (asteriskIndex + 1)) { - char c = l.charAt(asteriskIndex + 1); - if (c == ' ' || c == '\t') { - return l.substring(asteriskIndex + 2); - } + char c = l.charAt(asteriskIndex + 1); + if (c == ' ' || c == '\t') { + return l.substring(asteriskIndex + 2); } + } return l.substring(asteriskIndex + 1); }).collect(Collectors.toList()); // lines containing only whitespace are normalized to empty lines 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 f774163840..29bff0b136 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java +++ b/javaparser-core/src/main/java/com/github/javaparser/LineEndingProcessingProvider.java @@ -120,24 +120,24 @@ public int read(char[] buffer, final int offset, int len) throws IOException { String str = String.valueOf((char) ch); Optional lookup = LineSeparator.lookup(str); if (lookup.isPresent()) { - LineSeparator lineSeparator = lookup.get(); - // Track the number of times this character is found.. - eolCounts.putIfAbsent(lineSeparator, 0); - eolCounts.put(lineSeparator, eolCounts.get(lineSeparator) + 1); - // Handle line separators of length two (specifically CRLF) - // TODO: Make this more generic than just CRLF (e.g. track the previous char rather than the previous line separator - if (lineSeparator == LineSeparator.LF) { - if (previousLineSeparator == LineSeparator.CR) { - eolCounts.putIfAbsent(LineSeparator.CRLF, 0); - eolCounts.put(LineSeparator.CRLF, eolCounts.get(LineSeparator.CRLF) + 1); - } + LineSeparator lineSeparator = lookup.get(); + // Track the number of times this character is found.. + eolCounts.putIfAbsent(lineSeparator, 0); + eolCounts.put(lineSeparator, eolCounts.get(lineSeparator) + 1); + // Handle line separators of length two (specifically CRLF) + // TODO: Make this more generic than just CRLF (e.g. track the previous char rather than the previous line separator + if (lineSeparator == LineSeparator.LF) { + if (previousLineSeparator == LineSeparator.CR) { + eolCounts.putIfAbsent(LineSeparator.CRLF, 0); + eolCounts.put(LineSeparator.CRLF, eolCounts.get(LineSeparator.CRLF) + 1); } - // If "this" (current) char is a line separator, set the next loop's "previous" to this - previousLineSeparator = lineSeparator; - } else { - // If "this" (current) char is not a line separator, set the next loop's "previous" to null - previousLineSeparator = null; } + // If "this" (current) char is a line separator, set the next loop's "previous" to this + previousLineSeparator = lineSeparator; + } else { + // If "this" (current) char is not a line separator, set the next loop's "previous" to null + previousLineSeparator = null; + } buffer[pos++] = (char) ch; } return pos - offset; 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 a89ed44f5d..5c4cfa35f0 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java +++ b/javaparser-core/src/main/java/com/github/javaparser/UnicodeEscapeProcessingProvider.java @@ -341,8 +341,8 @@ public PositionUpdate lookup(Position position) { } int insertIndex = -result - 1; if (insertIndex == 0) { - // Before the first delta info, identity mapping. - return PositionUpdate.NONE; + // Before the first delta info, identity mapping. + return PositionUpdate.NONE; } return _deltas.get(insertIndex - 1); } 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 818dbba9c0..f02a8e90d1 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 @@ -393,7 +393,7 @@ public CompilationUnit addImport(Class clazz) { if (clazz.isArray()) { return addImport(clazz.getComponentType()); } - if (ClassUtils.isPrimitiveOrWrapper(clazz) || JAVA_LANG.equals(clazz.getPackage().getName())) + if (ClassUtils.isPrimitiveOrWrapper(clazz) || JAVA_LANG.equals(clazz.getPackage().getName())) return this; if (clazz.isAnonymousClass() || clazz.isLocalClass()) throw new IllegalArgumentException(clazz.getName() + " is an anonymous or local class therefore it can't be added with addImport"); 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 fb4cc7000d..f6edf5b5ac 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 @@ -26,14 +26,12 @@ import static java.util.Collections.unmodifiableList; import static java.util.Spliterator.DISTINCT; import static java.util.Spliterator.NONNULL; - import java.util.*; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; import java.util.stream.StreamSupport; - import com.github.javaparser.HasParentNode; import com.github.javaparser.Position; import com.github.javaparser.Range; @@ -153,8 +151,7 @@ public enum Parsedness { // usefull to find if the node is a phantom node private static final int LEVELS_TO_EXPLORE = 3; - protected static final PrinterConfiguration prettyPrinterNoCommentsConfiguration = new DefaultPrinterConfiguration() - .removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)); + protected static final PrinterConfiguration prettyPrinterNoCommentsConfiguration = new DefaultPrinterConfiguration().removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)); @InternalProperty private Range range; @@ -1148,8 +1145,8 @@ public Node next() { cursorStack.pop(); hasNext = !nodesStack.empty(); if (hasNext) { - return nextFromLevel(); - } + return nextFromLevel(); + } return root; } @@ -1165,8 +1162,7 @@ private Node nextFromLevel() { * Returns true if the node has an (optional) scope expression eg. method calls (object.method()) */ public boolean hasScope() { - return (NodeWithOptionalScope.class.isAssignableFrom(this.getClass()) && ((NodeWithOptionalScope) this).getScope().isPresent()) - || (NodeWithScope.class.isAssignableFrom(this.getClass()) && ((NodeWithScope) this).getScope() != null); + return (NodeWithOptionalScope.class.isAssignableFrom(this.getClass()) && ((NodeWithOptionalScope) this).getScope().isPresent()) || (NodeWithScope.class.isAssignableFrom(this.getClass()) && ((NodeWithScope) this).getScope() != null); } /* 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 f158bca0fe..da53a4815b 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 @@ -38,7 +38,6 @@ import com.github.javaparser.resolution.declarations.ResolvedAnnotationDeclaration; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 f476849a9e..8f9dd0d907 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 @@ -23,11 +23,9 @@ import static com.github.javaparser.utils.Utils.assertNotNull; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; - import java.util.List; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.TokenRange; import com.github.javaparser.ast.*; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -45,6 +43,7 @@ import com.github.javaparser.metamodel.CallableDeclarationMetaModel; import com.github.javaparser.metamodel.JavaParserMetaModel; import com.github.javaparser.metamodel.OptionalProperty; + /** * Represents a declaration which is callable eg. a method or a constructor. */ @@ -93,13 +92,11 @@ public CallableDeclaration(TokenRange tokenRange, NodeList modifiers, * @return modifiers * @see Modifier */ - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getModifiers() { return modifiers; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") public T setModifiers(final NodeList modifiers) { @@ -115,13 +112,11 @@ public T setModifiers(final NodeList modifiers) { return (T) this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public SimpleName getName() { return name; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") public T setName(final SimpleName name) { @@ -137,13 +132,11 @@ public T setName(final SimpleName name) { return (T) this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getParameters() { return parameters; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") public T setParameters(final NodeList parameters) { @@ -159,13 +152,11 @@ public T setParameters(final NodeList parameters) { return (T) this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getThrownExceptions() { return thrownExceptions; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") public T setThrownExceptions(final NodeList thrownExceptions) { @@ -181,13 +172,11 @@ public T setThrownExceptions(final NodeList thrownExceptions) { return (T) this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getTypeParameters() { return typeParameters; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @SuppressWarnings("unchecked") public T setTypeParameters(final NodeList typeParameters) { 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 6d409c4fcf..745bf241ed 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 @@ -21,10 +21,8 @@ package com.github.javaparser.ast.body; import static com.github.javaparser.utils.Utils.assertNotNull; - import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.TokenRange; import com.github.javaparser.ast.*; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -42,6 +40,7 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import com.github.javaparser.resolution.Resolvable; import com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration; + /** *

The record declaration's constructor

* WARNING: This implementation is subject to change. @@ -120,7 +119,6 @@ public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public BlockStmt getBody() { return body; @@ -132,7 +130,6 @@ public BlockStmt getBody() { * @param body the body, can not be null * @return this, the ConstructorDeclaration */ - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public CompactConstructorDeclaration setBody(final BlockStmt body) { assertNotNull(body); @@ -147,13 +144,11 @@ public CompactConstructorDeclaration setBody(final BlockStmt body) { return this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getModifiers() { return modifiers; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public CompactConstructorDeclaration setModifiers(final NodeList modifiers) { assertNotNull(modifiers); @@ -168,13 +163,11 @@ public CompactConstructorDeclaration setModifiers(final NodeList modif return this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public SimpleName getName() { return name; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public CompactConstructorDeclaration setName(final SimpleName name) { assertNotNull(name); @@ -189,13 +182,11 @@ public CompactConstructorDeclaration setName(final SimpleName name) { return this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList getThrownExceptions() { return thrownExceptions; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public CompactConstructorDeclaration setThrownExceptions(final NodeList thrownExceptions) { assertNotNull(thrownExceptions); @@ -210,13 +201,11 @@ public CompactConstructorDeclaration setThrownExceptions(final NodeList getTypeParameters() { return typeParameters; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public CompactConstructorDeclaration setTypeParameters(final NodeList typeParameters) { assertNotNull(typeParameters); 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 df2add0887..d1139e2a6c 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 @@ -21,10 +21,8 @@ package com.github.javaparser.ast.body; import static com.github.javaparser.utils.Utils.assertNotNull; - import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.TokenRange; import com.github.javaparser.ast.*; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -43,6 +41,7 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import com.github.javaparser.resolution.Resolvable; import com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration; + /** * A constructor declaration: {@code class X { X() { } }} where X(){} is the constructor declaration. *

@@ -106,7 +105,6 @@ public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public BlockStmt getBody() { return body; @@ -118,7 +116,6 @@ public BlockStmt getBody() { * @param body the body, can not be null * @return this, the ConstructorDeclaration */ - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public ConstructorDeclaration setBody(final BlockStmt body) { assertNotNull(body); 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 b852c79ae7..0e23c27686 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 @@ -23,10 +23,8 @@ import static com.github.javaparser.ast.Modifier.DefaultKeyword.*; import static com.github.javaparser.ast.NodeList.nodeList; import static com.github.javaparser.utils.Utils.assertNotNull; - import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.TokenRange; import com.github.javaparser.ast.*; import com.github.javaparser.ast.Modifier.Keyword; @@ -264,11 +262,7 @@ public boolean isPublic() { */ private boolean isDeclaredInInterface() { Optional parentType = findAncestor(TypeDeclaration.class); - return parentType - .filter(BodyDeclaration::isClassOrInterfaceDeclaration) - .map(BodyDeclaration::asClassOrInterfaceDeclaration) - .map(ClassOrInterfaceDeclaration::isInterface) - .orElse(false); + return parentType.filter(BodyDeclaration::isClassOrInterfaceDeclaration).map(BodyDeclaration::asClassOrInterfaceDeclaration).map(ClassOrInterfaceDeclaration::isInterface).orElse(false); } @Override 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 0b443defde..7deae7317c 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 @@ -21,10 +21,8 @@ package com.github.javaparser.ast.body; import static com.github.javaparser.utils.Utils.assertNotNull; - import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.TokenRange; import com.github.javaparser.ast.*; import com.github.javaparser.ast.expr.AnnotationExpr; @@ -46,6 +44,7 @@ import com.github.javaparser.metamodel.OptionalProperty; import com.github.javaparser.resolution.Resolvable; import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration; + /** * A method declaration. "public int abc() {return 1;}" in this example: {@code class X { public int abc() {return 1;} * }} @@ -110,7 +109,6 @@ public void accept(final VoidVisitor v, final A arg) { v.visit(this, arg); } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public Optional getBody() { return Optional.ofNullable(body); @@ -122,7 +120,6 @@ public Optional getBody() { * @param body the body, can be null * @return this, the MethodDeclaration */ - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public MethodDeclaration setBody(final BlockStmt body) { if (body == this.body) { @@ -136,13 +133,11 @@ public MethodDeclaration setBody(final BlockStmt body) { return this; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public Type getType() { return type; } - @Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public MethodDeclaration setType(final Type type) { assertNotNull(type); @@ -294,7 +289,6 @@ public boolean remove(Node node) { return super.remove(node); } - @Override @Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") public MethodDeclaration removeBody() { return setBody((BlockStmt) null); 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 6b3a35c6dc..b5b7b2e1f4 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 805edf42f3..3952f52a6a 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 @@ -141,7 +141,6 @@ public Node setComment(final Comment comment) { @Override public boolean remove() { - if (this.commentedNode != null) { this.commentedNode.setComment(null); return true; 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 8b387ff710..e4bfafd205 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.LineCommentMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 83fa54de56..92b82d71f1 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 @@ -31,7 +31,6 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 ca2fae1746..f8154511f0 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 @@ -32,7 +32,6 @@ import com.github.javaparser.utils.Utils; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 471799c188..d7b1d75624 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 3fdf96bed3..d775381799 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 @@ -127,7 +127,6 @@ public int asInt() { * @return the literal value as a number while respecting different number representations */ public Number asNumber() { - if (Objects.equals(value, MAX_31_BIT_UNSIGNED_VALUE_AS_STRING) && hasUnaryMinusAsParent(this)) { return MAX_31_BIT_UNSIGNED_VALUE_AS_LONG; } 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 c947195497..40d0b1d62f 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 @@ -28,7 +28,6 @@ import com.github.javaparser.metamodel.LiteralExprMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 27b8c87908..61353c2fbd 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 @@ -134,7 +134,6 @@ public long asLong() { * @return the literal value as a number while respecting different number representations */ 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; } 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 9163754bb6..6992a983e5 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.NullLiteralExprMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevel.java b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevel.java index 0deb3dcefc..60250f18ff 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/jml/body/JmlClassLevel.java @@ -11,7 +11,6 @@ import com.github.javaparser.metamodel.JmlClassLevelMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 90c8d224b4..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 @@ -10,7 +10,6 @@ import com.github.javaparser.metamodel.JmlStatementMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 56070481a3..fcb11ec38a 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 @@ -261,7 +261,7 @@ public NodeList getValueAsMultipleReference(Node node) { } Optional opt = (Optional) rawValue; if (opt.isPresent()) { - return opt.get(); + return opt.get(); } return null; } catch (ClassCastException e) { 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 4e13b57325..97b0b19f8d 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.JavaParserMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 7088f09a23..b20404e6e8 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 @@ -30,7 +30,6 @@ import com.github.javaparser.metamodel.ReferenceTypeMetaModel; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 708264088f..aca23c0a74 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 @@ -35,7 +35,6 @@ import com.github.javaparser.resolution.types.ResolvedType; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 4eb331987a..b744c9b6b5 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 @@ -177,6 +177,6 @@ private Optional forEachStmtWithVariableDeclarator(VariableDeclarat if (!node.isPresent() || !(node.get() instanceof ForEachStmt)) { return Optional.empty(); } - return Optional.of((ForEachStmt) node.get()); - } + return Optional.of((ForEachStmt) node.get()); } +} 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 efe0871068..dfbad5268a 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 @@ -36,7 +36,6 @@ import com.github.javaparser.resolution.types.ResolvedVoidType; import java.util.Optional; import java.util.function.Consumer; - import com.github.javaparser.ast.Node; /** 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 5398119d4e..151f246965 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 @@ -31,6 +31,7 @@ public class Java17Validator extends Java16Validator { final Validator sealedNotAllowedAsIdentifier = new ReservedKeywordValidator("sealed"); + final Validator permitsNotAllowedAsIdentifier = new ReservedKeywordValidator("permits"); public Java17Validator() { 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 2a317cdadd..2840a8ba17 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 @@ -47,20 +47,13 @@ public final class UpgradeJavaMessage { * @param reason The reason why the language level must be upgraded. * @param level The language level that must be configured. */ - UpgradeJavaMessage( - final String reason, - final ParserConfiguration.LanguageLevel level - ) { + UpgradeJavaMessage(final String reason, final ParserConfiguration.LanguageLevel level) { this.reason = reason; this.level = level; } @Override 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() - ); + 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/metamodel/AnnotationDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/AnnotationDeclarationMetaModel.java index e329f6ee34..4a002379d9 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.AnnotationDeclaration; import com.github.javaparser.ast.Generated; 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 670725b974..f0560c5b2e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.AnnotationExpr; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 3510315613..badfe05700 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.AnnotationMemberDeclaration; import com.github.javaparser.ast.Generated; 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 1165f3492a..ef612c9a67 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ArrayAccessExpr; import com.github.javaparser.ast.Generated; 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 65b0264f33..838e6764f6 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ArrayCreationExpr; import com.github.javaparser.ast.Generated; 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 ef731d938c..061c43e96a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.ArrayCreationLevel; import com.github.javaparser.ast.Generated; 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 f69eae2c23..1abb6265b6 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ArrayInitializerExpr; import com.github.javaparser.ast.Generated; 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 ea5926a933..ae757d32f7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.ArrayType; import com.github.javaparser.ast.Generated; 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 1b6274d59b..d1afaa8434 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.AssertStmt; import com.github.javaparser.ast.Generated; 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 4232b79443..3faa130b6e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.AssignExpr; import com.github.javaparser.ast.Generated; 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 ec0360e561..7d2006abe7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.BinaryExpr; import com.github.javaparser.ast.Generated; 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 58aaa8d264..18451ed79f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.comments.BlockComment; import com.github.javaparser.ast.Generated; 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 9eac888bec..81a69ff851 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.BlockStmt; import com.github.javaparser.ast.Generated; 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 04a7960ebf..ed11238a71 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.BodyDeclaration; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 1d34b32a56..55a53a5b50 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.BooleanLiteralExpr; import com.github.javaparser.ast.Generated; 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 2353b5a993..bc9ac81c0c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.BreakStmt; import com.github.javaparser.ast.Generated; 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 78ab164db5..b404779bbc 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.CallableDeclaration; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 2dd7a3ffe5..ca3d98cee7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.CastExpr; import com.github.javaparser.ast.Generated; 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 d330df1101..52443f229b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.CatchClause; import com.github.javaparser.ast.Generated; 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 cbc590125a..95820f004e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.CharLiteralExpr; import com.github.javaparser.ast.Generated; 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 aa26582ad6..8f5fb5801e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ClassExpr; import com.github.javaparser.ast.Generated; 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 4383be9574..ffc94d05c4 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.Generated; 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 9b5d544ea6..a04e7de676 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.Generated; 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 c89955b4ed..d582034c8f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.comments.Comment; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 f04251b8d0..1792e3d0a9 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.CompactConstructorDeclaration; import com.github.javaparser.ast.Generated; 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 5df4bcf49b..8c54b796fa 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Generated; 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 4a58127292..3c3a66c852 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ConditionalExpr; import com.github.javaparser.ast.Generated; 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 862eb006e3..3ededbc46d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.ConstructorDeclaration; import com.github.javaparser.ast.Generated; 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 4ff6d007d9..55aacc1f36 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ContinueStmt; import com.github.javaparser.ast.Generated; 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 baca7954ec..99a952f981 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.DoStmt; import com.github.javaparser.ast.Generated; 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 bea4976b3a..104fc41aaa 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.DoubleLiteralExpr; import com.github.javaparser.ast.Generated; 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 583ec032f9..3bda628828 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.EmptyStmt; import com.github.javaparser.ast.Generated; 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 6f111832dc..5f74748e8b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.EnclosedExpr; import com.github.javaparser.ast.Generated; 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 cec17720ae..65b8351407 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.EnumConstantDeclaration; import com.github.javaparser.ast.Generated; 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 9d35c48b50..a041a66fb7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.EnumDeclaration; import com.github.javaparser.ast.Generated; 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 adc98a6723..0075631e93 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt; import com.github.javaparser.ast.Generated; 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 8c71d42998..5775f21e27 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 3662c64611..cb40652534 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ExpressionStmt; import com.github.javaparser.ast.Generated; 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 9e285d6cb5..195abbe35c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.FieldAccessExpr; import com.github.javaparser.ast.Generated; 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 9c17c30222..2ac4d99eb9 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.FieldDeclaration; import com.github.javaparser.ast.Generated; 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 98afc9f666..3d0321c0af 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ForEachStmt; import com.github.javaparser.ast.Generated; 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 347ac53e08..f0cd5a0c9d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ForStmt; import com.github.javaparser.ast.Generated; 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 a4ce663d28..417b2e6577 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.IfStmt; import com.github.javaparser.ast.Generated; 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 d831426b52..c0b54327b9 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.ImportDeclaration; import com.github.javaparser.ast.Generated; 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 30fd592775..df595d97d8 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.InitializerDeclaration; import com.github.javaparser.ast.Generated; 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 26a064b962..b40b79c61c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.InstanceOfExpr; import com.github.javaparser.ast.Generated; 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 0ac1d8d84e..4d9849afee 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.IntegerLiteralExpr; import com.github.javaparser.ast.Generated; 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 f5e36340f8..0918803340 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.IntersectionType; import com.github.javaparser.ast.Generated; 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 bc2b8d59c1..eb4fdaf24d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.comments.JavadocComment; import com.github.javaparser.ast.Generated; 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 2caf7ed6fb..49763773df 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlBeginStmt; import com.github.javaparser.ast.Generated; 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 d2d98765db..bf3f374651 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlBinaryInfixExpr; import com.github.javaparser.ast.Generated; diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBodyDeclarationMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBodyDeclarationMetaModel.java index d86c741933..dcbe87c1a6 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBodyDeclarationMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/JmlBodyDeclarationMetaModel.java @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlBodyDeclaration; import com.github.javaparser.ast.Generated; 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 63cbe75e6e..c7be8ee9bf 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlCallableClause; import com.github.javaparser.ast.Generated; 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 356d416141..d2e1c4039f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlClassAccessibleDeclaration; import com.github.javaparser.ast.Generated; 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 9d2322e6cb..2225098c94 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration; import com.github.javaparser.ast.Generated; 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 54882c9e0b..de818a5712 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlClassLevel; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 5c831a9d9b..0e5e38e526 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlClauseLabel; import com.github.javaparser.ast.Generated; 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 e5b4f5271b..99a172de5b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlClause; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 8dfa8575d5..7cc6571e78 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlContract; import com.github.javaparser.ast.Generated; 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 a19ba3760c..55390668cd 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.doc.JmlDocDeclaration; import com.github.javaparser.ast.Generated; 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 2e56dbff29..853d271298 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.doc.JmlDoc; import com.github.javaparser.ast.Generated; 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 95a4d91ec5..b20e6b3b21 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.doc.JmlDocStmt; import com.github.javaparser.ast.Generated; 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 6c298973f0..5d0706ceee 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.doc.JmlDocType; import com.github.javaparser.ast.Generated; 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 6eb8883975..8ec753714d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlEndStmt; import com.github.javaparser.ast.Generated; 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 f80ca79743..a92feb529d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt; import com.github.javaparser.ast.Generated; 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 6248854370..ba66ec8f8d 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlFieldDeclaration; import com.github.javaparser.ast.Generated; 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 94deaa8aab..a73869c051 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlForallClause; import com.github.javaparser.ast.Generated; 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 607031bdac..a62798aabf 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlGhostStmt; import com.github.javaparser.ast.Generated; 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 84243717ce..54af2b1a58 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlLabelExpr; import com.github.javaparser.ast.Generated; 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 dc165c920e..0d650c67db 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlLabelStmt; import com.github.javaparser.ast.Generated; 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 8bf2d5dc66..48373052b6 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlLetExpr; import com.github.javaparser.ast.Generated; 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 8d5e2b1422..ab9104ebce 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlMethodDeclaration; import com.github.javaparser.ast.Generated; 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 bd21f3f502..cc184c3d7c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr; import com.github.javaparser.ast.Generated; 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 636e50efa7..fe62e1674f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlMultiExprClause; import com.github.javaparser.ast.Generated; 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 85bab9f151..3010c75c33 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlOldClause; import com.github.javaparser.ast.Generated; 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 4d366c57f3..8c4caa67a7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr; import com.github.javaparser.ast.Generated; 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 3f2b0f2fa0..f07c412628 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlRefiningStmt; import com.github.javaparser.ast.Generated; 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 eeea3b63ee..8efba2da26 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.body.JmlRepresentsDeclaration; import com.github.javaparser.ast.Generated; 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 45cd87631d..ed5ae64101 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlSetComprehension; import com.github.javaparser.ast.Generated; 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 0928a156c9..755dda4cde 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlSignalsClause; import com.github.javaparser.ast.Generated; 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 a637f98221..90eff29856 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlSignalsOnlyClause; import com.github.javaparser.ast.Generated; 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 b240de8d06..b8786bb80a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause; import com.github.javaparser.ast.Generated; 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 559589f57a..38450f5297 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlStatement; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 5a5d77e398..84b78cdc0a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.expr.JmlTypeExpr; import com.github.javaparser.ast.Generated; 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 8cbc02e9dd..823e613595 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.jml.stmt.JmlUnreachableStmt; import com.github.javaparser.ast.Generated; 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 9be4f976f2..76593b2a96 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.LabeledStmt; import com.github.javaparser.ast.Generated; 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 531c8de807..261b9a2745 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.LambdaExpr; import com.github.javaparser.ast.Generated; 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 9e561bc8ad..d33e9fe5e1 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.comments.LineComment; import com.github.javaparser.ast.Generated; 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 b933e8b398..471005edab 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.LiteralExpr; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 52281c961b..59b3a24fc2 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.LiteralStringValueExpr; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 d4599490c6..c5ad9a9853 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.LocalClassDeclarationStmt; import com.github.javaparser.ast.Generated; 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 34cc602e63..c6805ebe1c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.LocalRecordDeclarationStmt; import com.github.javaparser.ast.Generated; 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 06ac8f6d45..5d2ce14b3e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.LongLiteralExpr; import com.github.javaparser.ast.Generated; 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 ececed38b9..dc824c91be 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.MarkerAnnotationExpr; import com.github.javaparser.ast.Generated; 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 4d027ec8b4..be56c71b33 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.MemberValuePair; import com.github.javaparser.ast.Generated; 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 51c4d1db8c..a4db672771 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.MethodCallExpr; import com.github.javaparser.ast.Generated; 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 edbeb9ffca..c390b566dd 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.Generated; 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 de8a301746..ec079c7625 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.MethodReferenceExpr; import com.github.javaparser.ast.Generated; 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 483c3e3980..831638be71 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.Generated; 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 fa08b9d7ad..3895075318 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleDeclaration; import com.github.javaparser.ast.Generated; 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 8ffd13e496..8e81ac1df4 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleDirective; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 5646ee70e3..d5e478af7e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleExportsDirective; import com.github.javaparser.ast.Generated; 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 daf7a05cc0..973dbfaaeb 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleOpensDirective; import com.github.javaparser.ast.Generated; 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 900dc020f7..6721b4b42e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleProvidesDirective; import com.github.javaparser.ast.Generated; 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 d808c28186..5d560fdaf3 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleRequiresDirective; import com.github.javaparser.ast.Generated; 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 d74b7ac88f..8c6ba51b9e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.modules.ModuleUsesDirective; import com.github.javaparser.ast.Generated; 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 ebe3910486..d5847b2cea 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.NameExpr; import com.github.javaparser.ast.Generated; 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 0da0600d45..46c4c11888 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.Name; import com.github.javaparser.ast.Generated; 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 282c0cb202..c67f075c0c 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.Node; import com.github.javaparser.ast.Generated; diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NormalAnnotationExprMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NormalAnnotationExprMetaModel.java index 59f37b8cc2..fd17a0996d 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/NormalAnnotationExprMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/NormalAnnotationExprMetaModel.java @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.NormalAnnotationExpr; import com.github.javaparser.ast.Generated; 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 c35086c03a..342d10a82b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.NullLiteralExpr; import com.github.javaparser.ast.Generated; 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 81ecee451e..2dd9d1bf8e 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ObjectCreationExpr; import com.github.javaparser.ast.Generated; 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 bdc3e9b1b0..bfbb39e25a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.PackageDeclaration; import com.github.javaparser.ast.Generated; 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 a0da21b7df..6d7dcb975a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.Parameter; import com.github.javaparser.ast.Generated; 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 808bee04f7..f2e4439951 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.PatternExpr; import com.github.javaparser.ast.Generated; 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 1962b9bbd2..40517da7e4 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.PrimitiveType; import com.github.javaparser.ast.Generated; 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 9128899ff7..e54bf91489 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.ReceiverParameter; import com.github.javaparser.ast.Generated; 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 87074010d1..1389fedbdd 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.RecordDeclaration; import com.github.javaparser.ast.Generated; 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 4e2fbaa84b..36f90b9253 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.ReferenceType; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 4d415c9cf0..225b742c00 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ReturnStmt; import com.github.javaparser.ast.Generated; 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 84008c3f16..9a7ff9a030 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.Generated; 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 3aace8a45b..91e01c9474 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr; import com.github.javaparser.ast.Generated; 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 4b8640ac65..5594121faa 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.Statement; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 3b35e4e524..2a1d726ac8 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.StringLiteralExpr; import com.github.javaparser.ast.Generated; 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 d1933de95b..cedfe862bb 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.SuperExpr; import com.github.javaparser.ast.Generated; 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 09c87781b0..446106157f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.SwitchEntry; import com.github.javaparser.ast.Generated; 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 f4297e432c..0cd8f3bc0a 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.SwitchExpr; import com.github.javaparser.ast.Generated; 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 81e9ddc995..b9ab567b53 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.SwitchStmt; import com.github.javaparser.ast.Generated; 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 8d7c2004c6..ff4ec75afa 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.SynchronizedStmt; import com.github.javaparser.ast.Generated; 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 0b23fc44de..333330e1a7 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.TextBlockLiteralExpr; import com.github.javaparser.ast.Generated; 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 26b24c212e..d2241368d0 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.ThisExpr; import com.github.javaparser.ast.Generated; 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 cb510a0710..316963de7b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.ThrowStmt; import com.github.javaparser.ast.Generated; 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 34a8c4e5b3..48b81b5337 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.TryStmt; import com.github.javaparser.ast.Generated; 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 b5e5430c71..a2885d82fa 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.TypeDeclaration; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; 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 21a46cbdc6..5cedca2e06 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.TypeExpr; import com.github.javaparser.ast.Generated; 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 8bb315bd6c..983b832bee 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.Type; import com.github.javaparser.ast.Generated; import com.github.javaparser.ast.Node; diff --git a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeParameterMetaModel.java b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeParameterMetaModel.java index decd6eed73..a1c2ad6cdb 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeParameterMetaModel.java +++ b/javaparser-core/src/main/java/com/github/javaparser/metamodel/TypeParameterMetaModel.java @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.TypeParameter; import com.github.javaparser.ast.Generated; 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 8cf08479b5..64cd83d4e3 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.UnaryExpr; import com.github.javaparser.ast.Generated; 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 592ffe5308..30fca06db5 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.UnionType; import com.github.javaparser.ast.Generated; 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 a4d248e90e..b06cd4bed3 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.UnknownType; import com.github.javaparser.ast.Generated; 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 ab1ca06165..60c446ba97 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.UnparsableStmt; import com.github.javaparser.ast.Generated; 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 d71263455d..e1b798ad29 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.VarType; import com.github.javaparser.ast.Generated; 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 9befa00af5..5643fa0443 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.expr.VariableDeclarationExpr; import com.github.javaparser.ast.Generated; 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 2139b8a41a..d1c48ebc59 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.body.VariableDeclarator; import com.github.javaparser.ast.Generated; 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 1d2b7e6be3..ed719f3371 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.VoidType; import com.github.javaparser.ast.Generated; 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 eb28356873..6393d2c777 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.WhileStmt; import com.github.javaparser.ast.Generated; 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 d6ef07209e..10e163248b 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.type.WildcardType; import com.github.javaparser.ast.Generated; 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 1d39b449a0..39ea207788 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 @@ -21,7 +21,6 @@ package com.github.javaparser.metamodel; import java.util.Optional; - import com.github.javaparser.ast.stmt.YieldStmt; import com.github.javaparser.ast.Generated; 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 e8e6a45eba..357ff2e2ec 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 @@ -101,12 +101,12 @@ private static CsmElement typeArguments() { concreteSyntaxModelByClass.put(Parameter.class, sequence(comment(), list(ObservableProperty.ANNOTATIONS, space(), none(), space()), modifiers(), child(ObservableProperty.TYPE), conditional(ObservableProperty.VAR_ARGS, FLAG, sequence(list(ObservableProperty.VAR_ARGS_ANNOTATIONS, space(), none(), none()), token(GeneratedJavaParserConstants.ELLIPSIS))), space(), child(ObservableProperty.NAME))); concreteSyntaxModelByClass.put(ReceiverParameter.class, sequence(comment(), list(ObservableProperty.ANNOTATIONS, space(), none(), space()), child(ObservableProperty.TYPE), space(), child(ObservableProperty.NAME))); // FIXME: we should introduce a derived property + // FIXME: we should introduce a derived property concreteSyntaxModelByClass.// FIXME: we should introduce a derived property put(// FIXME: we should introduce a derived property VariableDeclarator.class, // FIXME: we should introduce a derived property - sequence(// FIXME: we should introduce a derived property - comment(), // list(ObservableProperty.EXTRA_ARRAY_LEVELS), - child(ObservableProperty.NAME), conditional(ObservableProperty.INITIALIZER, IS_PRESENT, sequence(space(), token(GeneratedJavaParserConstants.ASSIGN), space(), child(ObservableProperty.INITIALIZER))))); + sequence(// list(ObservableProperty.EXTRA_ARRAY_LEVELS), + comment(), child(ObservableProperty.NAME), conditional(ObservableProperty.INITIALIZER, IS_PRESENT, sequence(space(), token(GeneratedJavaParserConstants.ASSIGN), space(), child(ObservableProperty.INITIALIZER))))); // / // / Expressions // / @@ -210,9 +210,11 @@ private static CsmElement typeArguments() { concreteSyntaxModelByClass.put(JmlSimpleExprClause.class, sequence(child(ObservableProperty.KIND), child(HEAPS), space(), child(EXPRESSION), semicolon(), newline())); concreteSyntaxModelByClass.put(JmlMultiExprClause.class, sequence(child(ObservableProperty.KIND), child(HEAPS), space(), child(EXPRESSION), semicolon(), newline())); concreteSyntaxModelByClass.put(JmlClauseLabel.class, sequence(child(ObservableProperty.KIND), token(LPAREN), child(LABEL), token(RPAREN), space(), child(EXPRESSION), semicolon(), newline())); - concreteSyntaxModelByClass.put(JmlCallableClause.class, sequence(child(MODIFIERS), token(CALLABLE), //space(), - //child(EXPRESSION), - semicolon())); + concreteSyntaxModelByClass.put(JmlCallableClause.class, //space(), + sequence(//space(), + child(MODIFIERS), //space(), + token(CALLABLE), //child(EXPRESSION), + semicolon())); concreteSyntaxModelByClass.put(JmlClassExprDeclaration.class, sequence(child(MODIFIERS), attribute(KIND), space(), attribute(NAME), token(COLON), child(EXPRESSION), semicolon())); concreteSyntaxModelByClass.put(JmlBodyDeclaration.class, sequence()); concreteSyntaxModelByClass.put(JmlClassAccessibleDeclaration.class, sequence()); 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 37384c72a1..e757f6764c 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 @@ -28,7 +28,6 @@ import java.util.List; import static com.github.javaparser.utils.Utils.assertNotNull; import static com.github.javaparser.utils.Utils.assertNonEmpty; - import java.io.StringWriter; import java.io.Writer; import java.util.function.Predicate; @@ -42,6 +41,7 @@ public class XmlPrinter { private final boolean outputNodeType; + private static final Class TYPE_CLASS = Type.class; public XmlPrinter(boolean outputNodeType) { @@ -170,79 +170,58 @@ public void outputDocument(Node node, String name, XMLStreamWriter xmlWriter) th * @see outputDocument(String, Node, XMLStreamWriter) */ public void outputNode(Node node, String name, XMLStreamWriter xmlWriter) throws XMLStreamException { - assertNotNull(node); assertNonEmpty(name); assertNotNull(xmlWriter); - NodeMetaModel metaModel = node.getMetaModel(); List allPropertyMetaModels = metaModel.getAllPropertyMetaModels(); Predicate nonNullNode = propertyMetaModel -> propertyMetaModel.getValue(node) != null; - Predicate nonEmptyList = propertyMetaModel -> - ((NodeList) propertyMetaModel.getValue(node)).isNonEmpty(); - Predicate typeList = propertyMetaModel -> - TYPE_CLASS == propertyMetaModel.getType(); - + Predicate nonEmptyList = propertyMetaModel -> ((NodeList) propertyMetaModel.getValue(node)).isNonEmpty(); + Predicate typeList = propertyMetaModel -> TYPE_CLASS == propertyMetaModel.getType(); xmlWriter.writeStartElement(name); - // Output node type attribute if (outputNodeType) { xmlWriter.writeAttribute("type", metaModel.getTypeName()); } - try { // Output attributes - allPropertyMetaModels.stream() - .filter(PropertyMetaModel::isAttribute) - .filter(PropertyMetaModel::isSingular) - .forEach(attributeMetaModel -> { - try { - final String attributeName = attributeMetaModel.getName(); - final String attributeValue = attributeMetaModel.getValue(node).toString(); - xmlWriter.writeAttribute(attributeName, attributeValue); - } catch (XMLStreamException ex) { - throw new RuntimeXMLStreamException(ex); - } - }); - + allPropertyMetaModels.stream().filter(PropertyMetaModel::isAttribute).filter(PropertyMetaModel::isSingular).forEach(attributeMetaModel -> { + try { + final String attributeName = attributeMetaModel.getName(); + final String attributeValue = attributeMetaModel.getValue(node).toString(); + xmlWriter.writeAttribute(attributeName, attributeValue); + } catch (XMLStreamException ex) { + throw new RuntimeXMLStreamException(ex); + } + }); // Output singular subNodes - allPropertyMetaModels.stream() - .filter(PropertyMetaModel::isNode) - .filter(PropertyMetaModel::isSingular) - .filter(nonNullNode) - .forEach(subNodeMetaModel -> { - try { - final Node subNode = (Node) subNodeMetaModel.getValue(node); - final String subNodeName = subNodeMetaModel.getName(); - outputNode(subNode, subNodeName, xmlWriter); - } catch (XMLStreamException ex) { - throw new RuntimeXMLStreamException(ex); - } - }); - + allPropertyMetaModels.stream().filter(PropertyMetaModel::isNode).filter(PropertyMetaModel::isSingular).filter(nonNullNode).forEach(subNodeMetaModel -> { + try { + final Node subNode = (Node) subNodeMetaModel.getValue(node); + final String subNodeName = subNodeMetaModel.getName(); + outputNode(subNode, subNodeName, xmlWriter); + } catch (XMLStreamException ex) { + throw new RuntimeXMLStreamException(ex); + } + }); // Output list subNodes - allPropertyMetaModels.stream() - .filter(PropertyMetaModel::isNodeList) - .filter(nonNullNode) - .filter(nonEmptyList.or(typeList)) - .forEach(listMetaModel -> { - try { - String listName = listMetaModel.getName(); - String singular = listName.substring(0, listName.length() - 1); - NodeList nodeList = (NodeList) listMetaModel.getValue(node); - xmlWriter.writeStartElement(listName); - for (Node subNode : nodeList) { - outputNode(subNode, singular, xmlWriter); - } - xmlWriter.writeEndElement(); - } catch (XMLStreamException ex) { - throw new RuntimeXMLStreamException(ex); - } - }); + allPropertyMetaModels.stream().filter(PropertyMetaModel::isNodeList).filter(nonNullNode).filter(nonEmptyList.or(typeList)).forEach(listMetaModel -> { + try { + String listName = listMetaModel.getName(); + String singular = listName.substring(0, listName.length() - 1); + NodeList nodeList = (NodeList) listMetaModel.getValue(node); + xmlWriter.writeStartElement(listName); + for (Node subNode : nodeList) { + outputNode(subNode, singular, xmlWriter); + } + xmlWriter.writeEndElement(); + } catch (XMLStreamException ex) { + throw new RuntimeXMLStreamException(ex); + } + }); } catch (RuntimeXMLStreamException ex) { throw ex.getXMLStreamCause(); } - xmlWriter.writeEndElement(); } 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 623195f731..30e0bee5ba 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 @@ -63,23 +63,27 @@ public CsmElement getElseElement() { public enum Condition { IS_EMPTY { + @Override boolean evaluate(Node node, ObservableProperty property) { NodeList value = property.getValueAsMultipleReference(node); return value == null || value.isEmpty(); } }, IS_NOT_EMPTY { + @Override boolean evaluate(Node node, ObservableProperty property) { NodeList value = property.getValueAsMultipleReference(node); return value != null && !value.isEmpty(); } }, IS_PRESENT { + @Override boolean evaluate(Node node, ObservableProperty property) { return !property.isNullOrNotPresent(node); } }, FLAG { + @Override boolean evaluate(Node node, ObservableProperty property) { return property.getValueAsBooleanAttribute(node); 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 2e1b639d75..ef6e424ef9 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 @@ -22,16 +22,15 @@ import static com.github.javaparser.TokenTypes.eolTokenKind; import static com.github.javaparser.TokenTypes.spaceTokenKind; - import java.util.Arrays; import java.util.List; - import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.observer.ObservableProperty; import com.github.javaparser.printer.SourcePrinter; import com.github.javaparser.printer.lexicalpreservation.TextElement; import com.github.javaparser.utils.LineSeparator; + 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 7abf899370..72eff98f29 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 @@ -37,8 +37,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { */ @Override public boolean isCorrespondingElement(TextElement textElement) { - return (textElement instanceof TokenTextElement) - && ((TokenTextElement) textElement).isSpaceOrTab(); + return (textElement instanceof TokenTextElement) && ((TokenTextElement) textElement).isSpaceOrTab(); } @Override 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 2e82bc0c12..4f90149471 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 @@ -22,7 +22,6 @@ import static com.github.javaparser.TokenTypes.isEndOfLineToken; import static com.github.javaparser.TokenTypes.isWhitespaceButNotEndOfLine; - import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.TokenTypes; import com.github.javaparser.ast.Node; @@ -30,6 +29,7 @@ import com.github.javaparser.printer.lexicalpreservation.TextElement; import com.github.javaparser.printer.lexicalpreservation.TokenTextElement; import com.github.javaparser.utils.LineSeparator; + public class CsmToken implements CsmElement { private final int tokenType; @@ -117,8 +117,6 @@ public boolean isNewLine() { */ @Override public boolean isCorrespondingElement(TextElement textElement) { - return (textElement instanceof TokenTextElement) - && ((TokenTextElement) textElement).getTokenKind() == getTokenType() - && ((TokenTextElement) textElement).getText().equals(getContent()); + 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/lexicalpreservation/ChildTextElement.java b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java index 4f258b70dc..b6bdb9a194 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java +++ b/javaparser-core/src/main/java/com/github/javaparser/printer/lexicalpreservation/ChildTextElement.java @@ -21,10 +21,10 @@ package com.github.javaparser.printer.lexicalpreservation; import java.util.Optional; - import com.github.javaparser.Range; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.comments.Comment; + /** * Represent the position of a child node in the NodeText of its parent. */ 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 c16128fe01..cfbe45cc26 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 @@ -21,11 +21,9 @@ package com.github.javaparser.printer.lexicalpreservation; import static com.github.javaparser.GeneratedJavaParserConstants.*; - import java.util.*; import java.util.function.Predicate; import java.util.stream.IntStream; - import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.JavaToken; import com.github.javaparser.JavaToken.Kind; @@ -41,6 +39,7 @@ import com.github.javaparser.printer.concretesyntaxmodel.CsmIndent; import com.github.javaparser.printer.concretesyntaxmodel.CsmUnindent; import com.github.javaparser.printer.lexicalpreservation.LexicalDifferenceCalculator.CsmChild; + /** * A Difference should give me a sequence of elements I should find (to indicate the context) followed by a list of elements * to remove or to add and follow by another sequence of elements. @@ -315,7 +314,7 @@ private EnforcingIndentationContext defineEnforcingIndentationContext(NodeText n } // compute space after the deleted element if (startIndex < nodeText.numberOfElements() && isSpaceOrTabElement(nodeText, startIndex)) { -// int startingFromIndex = startIndex == 0 ? startIndex : startIndex + 1; + // int startingFromIndex = startIndex == 0 ? startIndex : startIndex + 1; for (int i = startIndex; i >= 0 && i < nodeText.numberOfElements(); i++) { if (nodeText.getTextElement(i).isNewline()) { break; 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 a6da43a8e3..23d4e2d22f 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 @@ -21,7 +21,6 @@ package com.github.javaparser.printer.lexicalpreservation; import java.util.*; - import com.github.javaparser.GeneratedJavaParserConstants; import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.Node; @@ -38,6 +37,7 @@ import com.github.javaparser.printer.concretesyntaxmodel.*; import com.github.javaparser.printer.lexicalpreservation.changes.*; import com.github.javaparser.utils.LineSeparator; + class LexicalDifferenceCalculator { /** @@ -92,8 +92,7 @@ public void prettyPrint(Node node, SourcePrinter printer) { */ @Override public boolean isCorrespondingElement(TextElement textElement) { - return (textElement instanceof ChildTextElement) - && ((ChildTextElement) textElement).getChild() == getChild(); + return (textElement instanceof ChildTextElement) && ((ChildTextElement) textElement).getChild() == getChild(); } @Override 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 cfac30e320..0859490f35 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 @@ -26,12 +26,10 @@ import static com.github.javaparser.utils.Utils.decapitalize; import static java.util.Comparator.comparing; import static java.util.stream.Collectors.toList; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.util.*; - import com.github.javaparser.JavaToken; import com.github.javaparser.Range; import com.github.javaparser.ast.DataKey; @@ -150,8 +148,8 @@ public void concretePropertyChange(Node observedNode, ObservableProperty propert // this case corresponds to the addition of a comment // 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; + // + 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 @@ -506,7 +504,7 @@ private static Iterator tokensPreceeding(final Node node) { if (node.getParentNode().get() instanceof VariableDeclarator) { return tokensPreceeding(node.getParentNode().get()); } - return new TextElementIteratorsFactory.EmptyIterator(); + return new TextElementIteratorsFactory.EmptyIterator(); } return new TextElementIteratorsFactory.CascadingIterator<>(TextElementIteratorsFactory.partialReverseIterator(parentNodeText, index - 1), () -> tokensPreceeding(node.getParentNode().get())); } 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 cab076a51f..f29df7a304 100755 --- 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 @@ -1,30 +1,29 @@ -package com.github.javaparser.printer.lexicalpreservation; - -import java.util.NoSuchElementException; - -public interface LookaheadIterator { - - /** - * Returns the next element in iteration without advancing the underlying iterator. - * If the iterator is already exhausted, null will be returned. - *

- * Note: this method does not throw a {@link NoSuchElementException} if the iterator - * is already exhausted. If you want such a behavior, use {@link #element()} instead. - *

- * The rationale behind this is to follow the {@link java.util.Queue} interface - * which uses the same terminology. - * - * @return the next element from the iterator - */ - public E peek(); - - /** - * Returns the next element in iteration without advancing the underlying iterator. - * If the iterator is already exhausted, null will be returned. - * - * @return the next element from the iterator - * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} - */ - public E element(); - -} +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.NoSuchElementException; + +public interface LookaheadIterator { + + /** + * Returns the next element in iteration without advancing the underlying iterator. + * If the iterator is already exhausted, null will be returned. + *

+ * Note: this method does not throw a {@link NoSuchElementException} if the iterator + * is already exhausted. If you want such a behavior, use {@link #element()} instead. + *

+ * The rationale behind this is to follow the {@link java.util.Queue} interface + * which uses the same terminology. + * + * @return the next element from the iterator + */ + public E peek(); + + /** + * Returns the next element in iteration without advancing the underlying iterator. + * If the iterator is already exhausted, null will be returned. + * + * @return the next element from the iterator + * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} + */ + public E element(); +} 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 79eb841718..45ba0d6b86 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 @@ -1,231 +1,224 @@ -/* - * Copyright (C) 2011, 2013-2023 The JavaParser Team. - * - * This file is part of JavaParser. - * - * JavaParser can be used either under the terms of - * a) the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * b) the terms of the Apache License - * - * You should have received a copy of both licenses in LICENCE.LGPL and - * LICENCE.APACHE. Please refer to those files for details. - * - * JavaParser is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - */ -package com.github.javaparser.printer.lexicalpreservation; - -import java.util.List; -import java.util.ListIterator; -import java.util.NoSuchElementException; -import java.util.Objects; - -/** - * Decorates an iterator to support one-element lookahead while iterating. - *

- * The decorator supports the removal operation, but an {@link IllegalStateException} - * will be thrown if {@link #remove()}, {@link #add()}, {@link #set()}} is called directly after a call to - * {@link #peek()} or {@link #element()}. - * - * @param the type of elements returned by this iterator. - * @since 4.0 - */ -public class PeekingIterator implements ListIterator, LookaheadIterator { - - /** - * The iterator being decorated. - */ - private final ListIterator iterator; - - /** - * Indicates that the decorated iterator is exhausted. - */ - private boolean exhausted; - - /** - * Indicates if the lookahead slot is filled. - */ - private boolean slotFilled; - - /** - * The current slot for lookahead. - */ - private E slot; - - /** - * Decorates the specified iterator to support one-element lookahead. - *

- * If the iterator is already a {@link PeekingIterator} it is returned directly. - * - * @param the element type - * @param iterator the iterator to decorate - * @return a new peeking iterator - * @throws NullPointerException if the iterator is null - */ - public PeekingIterator peekingIterator(final ListIterator iterator) { - Objects.requireNonNull(iterator, "iterator"); - if (iterator instanceof PeekingIterator) { - final PeekingIterator it = (PeekingIterator) iterator; - return it; - } - return new PeekingIterator<>(iterator); - } - - - /** - * Constructor. - * - * @param iterator the iterator to decorate - */ - public PeekingIterator(final ListIterator iterator) { - this.iterator = iterator; - } - - /** - * Constructor. - * - * @param list the provider of the iterator to decorate - */ - public PeekingIterator(final List list) { - this.iterator = list.listIterator(); - } - - private void fill() { - if (exhausted || slotFilled) { - return; - } - if (iterator.hasNext()) { - slot = iterator.next(); - slotFilled = true; - } else { - exhausted = true; - slot = null; - slotFilled = false; - } - } - - @Override - public boolean hasNext() { - if (exhausted) { - return false; - } - return slotFilled || iterator.hasNext(); - } - - /** - * Returns the next element in iteration without advancing the underlying iterator. - * If the iterator is already exhausted, null will be returned. - *

- * Note: this method does not throw a {@link NoSuchElementException} if the iterator - * is already exhausted. If you want such a behavior, use {@link #element()} instead. - *

- * The rationale behind this is to follow the {@link java.util.Queue} interface - * which uses the same terminology. - * - * @return the next element from the iterator - */ - @Override - public E peek() { - fill(); - return exhausted ? null : slot; - } - - /** - * Returns the next element in iteration without advancing the underlying iterator. - * If the iterator is already exhausted, null will be returned. - * - * @return the next element from the iterator - * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} - */ - @Override - public E element() { - fill(); - if (exhausted) { - throw new NoSuchElementException(); - } - return slot; - } - - @Override - public E next() { - if (!hasNext()) { - throw new NoSuchElementException(); - } - final E x = slotFilled ? slot : iterator.next(); - // reset the lookahead slot - slot = null; - slotFilled = false; - return x; - } - - /** - * {@inheritDoc} - * - * @throws IllegalStateException if {@link #peek()} or {@link #element()} has been called - * prior to the call to {@link #remove()} - */ - @Override - public void remove() { - if (slotFilled) { - throw new IllegalStateException("peek() or element() called before remove()"); - } - iterator.remove(); - } - - - @Override - public boolean hasPrevious() { - return iterator.hasPrevious(); - } - - - @Override - public E previous() { - return iterator.previous(); - } - - - @Override - public int nextIndex() { - return iterator.nextIndex(); - } - - /* - * Returns the index of the element that would be returned by the last call to next. - * 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() { - if (!hasPrevious()) return previousIndex(); - return nextIndex() - 1; - } - - - @Override - public int previousIndex() { - return iterator.previousIndex(); - } - - - @Override - public void set(E e) { - if (slotFilled) { - throw new IllegalStateException("peek() or element() called before set()"); - } - iterator.set(e); - } - - - @Override - public void add(E e) { - if (slotFilled) { - throw new IllegalStateException("peek() or element() called before add()"); - } - iterator.add(e); - } - -} +/* + * Copyright (C) 2011, 2013-2023 The JavaParser Team. + * + * This file is part of JavaParser. + * + * JavaParser can be used either under the terms of + * a) the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * b) the terms of the Apache License + * + * You should have received a copy of both licenses in LICENCE.LGPL and + * LICENCE.APACHE. Please refer to those files for details. + * + * JavaParser is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + */ +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.List; +import java.util.ListIterator; +import java.util.NoSuchElementException; +import java.util.Objects; + +/** + * Decorates an iterator to support one-element lookahead while iterating. + *

+ * The decorator supports the removal operation, but an {@link IllegalStateException} + * will be thrown if {@link #remove()}, {@link #add()}, {@link #set()}} is called directly after a call to + * {@link #peek()} or {@link #element()}. + * + * @param the type of elements returned by this iterator. + * @since 4.0 + */ +public class PeekingIterator implements ListIterator, LookaheadIterator { + + /** + * The iterator being decorated. + */ + private final ListIterator iterator; + + /** + * Indicates that the decorated iterator is exhausted. + */ + private boolean exhausted; + + /** + * Indicates if the lookahead slot is filled. + */ + private boolean slotFilled; + + /** + * The current slot for lookahead. + */ + private E slot; + + /** + * Decorates the specified iterator to support one-element lookahead. + *

+ * If the iterator is already a {@link PeekingIterator} it is returned directly. + * + * @param the element type + * @param iterator the iterator to decorate + * @return a new peeking iterator + * @throws NullPointerException if the iterator is null + */ + public PeekingIterator peekingIterator(final ListIterator iterator) { + Objects.requireNonNull(iterator, "iterator"); + if (iterator instanceof PeekingIterator) { + final PeekingIterator it = (PeekingIterator) iterator; + return it; + } + return new PeekingIterator<>(iterator); + } + + /** + * Constructor. + * + * @param iterator the iterator to decorate + */ + public PeekingIterator(final ListIterator iterator) { + this.iterator = iterator; + } + + /** + * Constructor. + * + * @param list the provider of the iterator to decorate + */ + public PeekingIterator(final List list) { + this.iterator = list.listIterator(); + } + + private void fill() { + if (exhausted || slotFilled) { + return; + } + if (iterator.hasNext()) { + slot = iterator.next(); + slotFilled = true; + } else { + exhausted = true; + slot = null; + slotFilled = false; + } + } + + @Override + public boolean hasNext() { + if (exhausted) { + return false; + } + return slotFilled || iterator.hasNext(); + } + + /** + * Returns the next element in iteration without advancing the underlying iterator. + * If the iterator is already exhausted, null will be returned. + *

+ * Note: this method does not throw a {@link NoSuchElementException} if the iterator + * is already exhausted. If you want such a behavior, use {@link #element()} instead. + *

+ * The rationale behind this is to follow the {@link java.util.Queue} interface + * which uses the same terminology. + * + * @return the next element from the iterator + */ + @Override + public E peek() { + fill(); + return exhausted ? null : slot; + } + + /** + * Returns the next element in iteration without advancing the underlying iterator. + * If the iterator is already exhausted, null will be returned. + * + * @return the next element from the iterator + * @throws NoSuchElementException if the iterator is already exhausted according to {@link #hasNext()} + */ + @Override + public E element() { + fill(); + if (exhausted) { + throw new NoSuchElementException(); + } + return slot; + } + + @Override + public E next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + final E x = slotFilled ? slot : iterator.next(); + // reset the lookahead slot + slot = null; + slotFilled = false; + return x; + } + + /** + * {@inheritDoc} + * + * @throws IllegalStateException if {@link #peek()} or {@link #element()} has been called + * prior to the call to {@link #remove()} + */ + @Override + public void remove() { + if (slotFilled) { + throw new IllegalStateException("peek() or element() called before remove()"); + } + iterator.remove(); + } + + @Override + public boolean hasPrevious() { + return iterator.hasPrevious(); + } + + @Override + public E previous() { + return iterator.previous(); + } + + @Override + public int nextIndex() { + return iterator.nextIndex(); + } + + /* + * Returns the index of the element that would be returned by the last call to next. + * 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() { + if (!hasPrevious()) + return previousIndex(); + return nextIndex() - 1; + } + + @Override + public int previousIndex() { + return iterator.previousIndex(); + } + + @Override + public void set(E e) { + if (slotFilled) { + throw new IllegalStateException("peek() or element() called before set()"); + } + iterator.set(e); + } + + @Override + public void add(E e) { + if (slotFilled) { + throw new IllegalStateException("peek() or element() called before add()"); + } + iterator.add(e); + } +} 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 79e25e3628..6396162fbf 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 @@ -53,8 +53,8 @@ static boolean isPhantomNode(Node node) { return isPhantomNodeCache.get(node); } if (node instanceof UnknownType) { - return true; - } + return true; + } boolean res = (node.getParentNode().isPresent() && node.getParentNode().get().hasRange() && node.hasRange() && !node.getParentNode().get().getRange().get().contains(node.getRange().get()) || inPhantomNode(node, LEVELS_TO_EXPLORE)); isPhantomNodeCache.put(node, res); node.register(cacheCleaner); 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 f0e788ff6a..0c7852f68a 100755 --- 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 @@ -1,218 +1,212 @@ -package com.github.javaparser.printer.lexicalpreservation; - -import java.util.*; - -import com.github.javaparser.printer.concretesyntaxmodel.CsmElement; -import com.github.javaparser.printer.concretesyntaxmodel.CsmMix; -import com.github.javaparser.printer.concretesyntaxmodel.CsmToken; -import com.github.javaparser.printer.lexicalpreservation.Difference.ArrayIterator; - -public class ReshuffledDiffElementExtractor { - - private final NodeText nodeText; - - private enum MatchClassification { - - ALL(1), PREVIOUS_AND_SAME(2), NEXT_AND_SAME(3), SAME_ONLY(4), ALMOST(5); - - private final int priority; - - MatchClassification(int priority) { - this.priority = priority; - } - - int getPriority() { - return priority; - } - } - - static ReshuffledDiffElementExtractor of(NodeText nodeText) { - return new ReshuffledDiffElementExtractor(nodeText); - } - - private ReshuffledDiffElementExtractor(NodeText nodeText) { - this.nodeText = nodeText; - } - - public void extract(List diffElements) { - ArrayIterator iterator = new ArrayIterator<>(diffElements); - while (iterator.hasNext()) { - DifferenceElement diffElement = iterator.next(); - if (diffElement instanceof Reshuffled) { - Reshuffled reshuffled = (Reshuffled) diffElement; - // First, let's see how many tokens we need to attribute to the previous version of the of the CsmMix - CsmMix elementsFromPreviousOrder = reshuffled.getPreviousOrder(); - CsmMix elementsFromNextOrder = reshuffled.getNextOrder(); - // This contains indexes from elementsFromNextOrder to indexes from elementsFromPreviousOrder - Map correspondanceBetweenNextOrderAndPreviousOrder = getCorrespondanceBetweenNextOrderAndPreviousOrder(elementsFromPreviousOrder, elementsFromNextOrder); - // We now find out which Node Text elements corresponds to the elements in the original CSM - List nodeTextIndexOfPreviousElements = findIndexOfCorrespondingNodeTextElement(elementsFromPreviousOrder.getElements(), nodeText); - PeekingIterator nodeTextIndexOfPreviousElementsIterator = new PeekingIterator<>(nodeTextIndexOfPreviousElements); - Map nodeTextIndexToPreviousCSMIndex = new HashMap<>(); - while (nodeTextIndexOfPreviousElementsIterator.hasNext()) { - int value = nodeTextIndexOfPreviousElementsIterator.next(); - if (value != -1) { - nodeTextIndexToPreviousCSMIndex.put(value, nodeTextIndexOfPreviousElementsIterator.currentIndex()); - } - } - int lastNodeTextIndex = nodeTextIndexOfPreviousElements.stream().max(Integer::compareTo).orElse(-1); - // Elements to be added at the end - List elementsToBeAddedAtTheEnd = new LinkedList<>(); - List nextOrderElements = elementsFromNextOrder.getElements(); - Map> elementsToAddBeforeGivenOriginalCSMElement = new HashMap<>(); - for (int ni = 0; ni < nextOrderElements.size(); ni++) { - // If it has a mapping, then it is kept - if (!correspondanceBetweenNextOrderAndPreviousOrder.containsKey(ni)) { - // Ok, it is something new. Where to put it? Let's see what is the first following - // element that has a mapping - int originalCsmIndex = -1; - for (int nj = ni + 1; nj < nextOrderElements.size() && originalCsmIndex == -1; nj++) { - if (correspondanceBetweenNextOrderAndPreviousOrder.containsKey(nj)) { - originalCsmIndex = correspondanceBetweenNextOrderAndPreviousOrder.get(nj); - if (!elementsToAddBeforeGivenOriginalCSMElement.containsKey(originalCsmIndex)) { - elementsToAddBeforeGivenOriginalCSMElement.put(originalCsmIndex, new LinkedList<>()); - } - elementsToAddBeforeGivenOriginalCSMElement.get(originalCsmIndex).add(nextOrderElements.get(ni)); - } - } - // it does not preceed anything, so it goes at the end - if (originalCsmIndex == -1) { - elementsToBeAddedAtTheEnd.add(nextOrderElements.get(ni)); - } - } - } - // We go over the original node text elements, in the order they appear in the NodeText. - // Considering an original node text element (ONE) - // * we verify if it corresponds to a CSM element. If it does not we just move on, otherwise - // we find the correspond OCE (Original CSM Element) - // * we first add new elements that are marked to be added before OCE - // * if OCE is marked to be present also in the "after" CSM we add a kept element, - // otherwise we add a removed element - // Remove the whole Reshuffled element - iterator.remove(); - if (lastNodeTextIndex != -1) { - for (int ntIndex = 0; ntIndex <= lastNodeTextIndex; ntIndex++) { - if (nodeTextIndexToPreviousCSMIndex.containsKey(ntIndex)) { - int indexOfOriginalCSMElement = nodeTextIndexToPreviousCSMIndex.get(ntIndex); - if (elementsToAddBeforeGivenOriginalCSMElement.containsKey(indexOfOriginalCSMElement)) { - for (CsmElement elementToAdd : elementsToAddBeforeGivenOriginalCSMElement.get(indexOfOriginalCSMElement)) { - iterator.add(new Added(elementToAdd)); - } - } - CsmElement originalCSMElement = elementsFromPreviousOrder.getElements().get(indexOfOriginalCSMElement); - boolean toBeKept = correspondanceBetweenNextOrderAndPreviousOrder.containsValue(indexOfOriginalCSMElement); - if (toBeKept) { - iterator.add(new Kept(originalCSMElement)); - } else { - iterator.add(new Removed(originalCSMElement)); - } - } - // else we have a simple node text element, without associated csm element, just keep ignore it - } - } - // Finally we look for the remaining new elements that were not yet added and - // add all of them - for (CsmElement elementToAdd : elementsToBeAddedAtTheEnd) { - iterator.add(new Added(elementToAdd)); - } - } - } - } - - /* - * Considering that the lists of elements are ordered, We can find the common - * elements by starting with the list before the modifications and, for each - * element, by going through the list of elements containing the modifications. - * - * We can find the common elements by starting with the list before the - * modifications (L1) and, for each element, by going through the list of elements - * containing the modifications (L2). - * - * If element A in list L1 is not found in list L2, it is a deleted element. - * If element A of list L1 is found in list L2, it is a kept element. In this - * case the search for the next element of the list L1 must start from the - * position of the last element kept {@code syncNextIndex}. - */ - private Map getCorrespondanceBetweenNextOrderAndPreviousOrder(CsmMix elementsFromPreviousOrder, - CsmMix elementsFromNextOrder) { - Map correspondanceBetweenNextOrderAndPreviousOrder = new HashMap<>(); - ArrayIterator previousOrderElementsIterator = new ArrayIterator<>( - elementsFromPreviousOrder.getElements()); - int syncNextIndex = 0; - while (previousOrderElementsIterator.hasNext()) { - CsmElement pe = previousOrderElementsIterator.next(); - ArrayIterator nextOrderElementsIterator = new ArrayIterator<>( - elementsFromNextOrder.getElements(), syncNextIndex); - while (nextOrderElementsIterator.hasNext()) { - CsmElement ne = nextOrderElementsIterator.next(); - if (!correspondanceBetweenNextOrderAndPreviousOrder.values().contains(previousOrderElementsIterator.index()) - && DifferenceElementCalculator.matching(ne, pe)) { - correspondanceBetweenNextOrderAndPreviousOrder.put(nextOrderElementsIterator.index(), - previousOrderElementsIterator.index()); - // set the position to start on the next {@code nextOrderElementsIterator} iteration - syncNextIndex = nextOrderElementsIterator.index(); - break; - } - } - } - return correspondanceBetweenNextOrderAndPreviousOrder; - } - - private List findIndexOfCorrespondingNodeTextElement(List elements, NodeText nodeText) { - List correspondingIndices = new ArrayList<>(); - PeekingIterator csmElementListIterator = new PeekingIterator<>(elements); - while (csmElementListIterator.hasNext()) { - boolean isFirstIterationOnCsmElements = !csmElementListIterator.hasPrevious(); - int previousCsmElementIndex = csmElementListIterator.previousIndex(); - CsmElement csmElement = csmElementListIterator.next(); - Map potentialMatches = new EnumMap<>(MatchClassification.class); - PeekingIterator nodeTextListIterator = new PeekingIterator<>(nodeText.getElements()); - while (nodeTextListIterator.hasNext()) { - boolean isFirstIterationOnNodeTextElements = !nodeTextListIterator.hasPrevious(); - TextElement textElement = nodeTextListIterator.next(); - int currentTextElementIndex = nodeTextListIterator.currentIndex(); - if (!correspondingIndices.contains(currentTextElementIndex)) { - boolean isCorresponding = csmElement.isCorrespondingElement(textElement); - if (isCorresponding) { - boolean hasSamePreviousElement = false; - if (!isFirstIterationOnNodeTextElements && !isFirstIterationOnCsmElements) { - TextElement previousTextElement = nodeText.getTextElement(currentTextElementIndex - 1); - hasSamePreviousElement = elements.get(previousCsmElementIndex).isCorrespondingElement(previousTextElement); - } - boolean hasSameNextElement = false; - if (csmElementListIterator.hasNext()) { - TextElement nextTextElement = nodeTextListIterator.peek(); - hasSameNextElement = elements.get(csmElementListIterator.nextIndex()).isCorrespondingElement(nextTextElement); - } - if (hasSamePreviousElement && hasSameNextElement) { - potentialMatches.putIfAbsent(MatchClassification.ALL, currentTextElementIndex); - } else if (hasSamePreviousElement) { - potentialMatches.putIfAbsent(MatchClassification.PREVIOUS_AND_SAME, currentTextElementIndex); - } else if (hasSameNextElement) { - potentialMatches.putIfAbsent(MatchClassification.NEXT_AND_SAME, currentTextElementIndex); - } else { - potentialMatches.putIfAbsent(MatchClassification.SAME_ONLY, currentTextElementIndex); - } - } else if (isAlmostCorrespondingElement(textElement, csmElement)) { - potentialMatches.putIfAbsent(MatchClassification.ALMOST, currentTextElementIndex); - } - } - } - // Prioritize the matches from best to worst - Optional bestMatchKey = potentialMatches.keySet().stream().min(Comparator.comparing(MatchClassification::getPriority)); - if (bestMatchKey.isPresent()) { - correspondingIndices.add(potentialMatches.get(bestMatchKey.get())); - } else { - correspondingIndices.add(-1); - } - } - return correspondingIndices; - } - - private boolean isAlmostCorrespondingElement(TextElement textElement, CsmElement csmElement) { - if (csmElement.isCorrespondingElement(textElement)) { - return false; - } - return textElement.isWhiteSpace() && csmElement instanceof CsmToken && ((CsmToken) csmElement).isWhiteSpace(); - } -} +package com.github.javaparser.printer.lexicalpreservation; + +import java.util.*; +import com.github.javaparser.printer.concretesyntaxmodel.CsmElement; +import com.github.javaparser.printer.concretesyntaxmodel.CsmMix; +import com.github.javaparser.printer.concretesyntaxmodel.CsmToken; +import com.github.javaparser.printer.lexicalpreservation.Difference.ArrayIterator; + +public class ReshuffledDiffElementExtractor { + + private final NodeText nodeText; + + private enum MatchClassification { + + ALL(1), PREVIOUS_AND_SAME(2), NEXT_AND_SAME(3), SAME_ONLY(4), ALMOST(5); + + private final int priority; + + MatchClassification(int priority) { + this.priority = priority; + } + + int getPriority() { + return priority; + } + } + + static ReshuffledDiffElementExtractor of(NodeText nodeText) { + return new ReshuffledDiffElementExtractor(nodeText); + } + + private ReshuffledDiffElementExtractor(NodeText nodeText) { + this.nodeText = nodeText; + } + + public void extract(List diffElements) { + ArrayIterator iterator = new ArrayIterator<>(diffElements); + while (iterator.hasNext()) { + DifferenceElement diffElement = iterator.next(); + if (diffElement instanceof Reshuffled) { + Reshuffled reshuffled = (Reshuffled) diffElement; + // First, let's see how many tokens we need to attribute to the previous version of the of the CsmMix + CsmMix elementsFromPreviousOrder = reshuffled.getPreviousOrder(); + CsmMix elementsFromNextOrder = reshuffled.getNextOrder(); + // This contains indexes from elementsFromNextOrder to indexes from elementsFromPreviousOrder + Map correspondanceBetweenNextOrderAndPreviousOrder = getCorrespondanceBetweenNextOrderAndPreviousOrder(elementsFromPreviousOrder, elementsFromNextOrder); + // We now find out which Node Text elements corresponds to the elements in the original CSM + List nodeTextIndexOfPreviousElements = findIndexOfCorrespondingNodeTextElement(elementsFromPreviousOrder.getElements(), nodeText); + PeekingIterator nodeTextIndexOfPreviousElementsIterator = new PeekingIterator<>(nodeTextIndexOfPreviousElements); + Map nodeTextIndexToPreviousCSMIndex = new HashMap<>(); + while (nodeTextIndexOfPreviousElementsIterator.hasNext()) { + int value = nodeTextIndexOfPreviousElementsIterator.next(); + if (value != -1) { + nodeTextIndexToPreviousCSMIndex.put(value, nodeTextIndexOfPreviousElementsIterator.currentIndex()); + } + } + int lastNodeTextIndex = nodeTextIndexOfPreviousElements.stream().max(Integer::compareTo).orElse(-1); + // Elements to be added at the end + List elementsToBeAddedAtTheEnd = new LinkedList<>(); + List nextOrderElements = elementsFromNextOrder.getElements(); + Map> elementsToAddBeforeGivenOriginalCSMElement = new HashMap<>(); + for (int ni = 0; ni < nextOrderElements.size(); ni++) { + // If it has a mapping, then it is kept + if (!correspondanceBetweenNextOrderAndPreviousOrder.containsKey(ni)) { + // Ok, it is something new. Where to put it? Let's see what is the first following + // element that has a mapping + int originalCsmIndex = -1; + for (int nj = ni + 1; nj < nextOrderElements.size() && originalCsmIndex == -1; nj++) { + if (correspondanceBetweenNextOrderAndPreviousOrder.containsKey(nj)) { + originalCsmIndex = correspondanceBetweenNextOrderAndPreviousOrder.get(nj); + if (!elementsToAddBeforeGivenOriginalCSMElement.containsKey(originalCsmIndex)) { + elementsToAddBeforeGivenOriginalCSMElement.put(originalCsmIndex, new LinkedList<>()); + } + elementsToAddBeforeGivenOriginalCSMElement.get(originalCsmIndex).add(nextOrderElements.get(ni)); + } + } + // it does not preceed anything, so it goes at the end + if (originalCsmIndex == -1) { + elementsToBeAddedAtTheEnd.add(nextOrderElements.get(ni)); + } + } + } + // We go over the original node text elements, in the order they appear in the NodeText. + // Considering an original node text element (ONE) + // * we verify if it corresponds to a CSM element. If it does not we just move on, otherwise + // we find the correspond OCE (Original CSM Element) + // * we first add new elements that are marked to be added before OCE + // * if OCE is marked to be present also in the "after" CSM we add a kept element, + // otherwise we add a removed element + // Remove the whole Reshuffled element + iterator.remove(); + if (lastNodeTextIndex != -1) { + for (int ntIndex = 0; ntIndex <= lastNodeTextIndex; ntIndex++) { + if (nodeTextIndexToPreviousCSMIndex.containsKey(ntIndex)) { + int indexOfOriginalCSMElement = nodeTextIndexToPreviousCSMIndex.get(ntIndex); + if (elementsToAddBeforeGivenOriginalCSMElement.containsKey(indexOfOriginalCSMElement)) { + for (CsmElement elementToAdd : elementsToAddBeforeGivenOriginalCSMElement.get(indexOfOriginalCSMElement)) { + iterator.add(new Added(elementToAdd)); + } + } + CsmElement originalCSMElement = elementsFromPreviousOrder.getElements().get(indexOfOriginalCSMElement); + boolean toBeKept = correspondanceBetweenNextOrderAndPreviousOrder.containsValue(indexOfOriginalCSMElement); + if (toBeKept) { + iterator.add(new Kept(originalCSMElement)); + } else { + iterator.add(new Removed(originalCSMElement)); + } + } + // else we have a simple node text element, without associated csm element, just keep ignore it + } + } + // Finally we look for the remaining new elements that were not yet added and + // add all of them + for (CsmElement elementToAdd : elementsToBeAddedAtTheEnd) { + iterator.add(new Added(elementToAdd)); + } + } + } + } + + /* + * Considering that the lists of elements are ordered, We can find the common + * elements by starting with the list before the modifications and, for each + * element, by going through the list of elements containing the modifications. + * + * We can find the common elements by starting with the list before the + * modifications (L1) and, for each element, by going through the list of elements + * containing the modifications (L2). + * + * If element A in list L1 is not found in list L2, it is a deleted element. + * If element A of list L1 is found in list L2, it is a kept element. In this + * case the search for the next element of the list L1 must start from the + * position of the last element kept {@code syncNextIndex}. + */ + private Map getCorrespondanceBetweenNextOrderAndPreviousOrder(CsmMix elementsFromPreviousOrder, CsmMix elementsFromNextOrder) { + Map correspondanceBetweenNextOrderAndPreviousOrder = new HashMap<>(); + ArrayIterator previousOrderElementsIterator = new ArrayIterator<>(elementsFromPreviousOrder.getElements()); + int syncNextIndex = 0; + while (previousOrderElementsIterator.hasNext()) { + CsmElement pe = previousOrderElementsIterator.next(); + ArrayIterator nextOrderElementsIterator = new ArrayIterator<>(elementsFromNextOrder.getElements(), syncNextIndex); + while (nextOrderElementsIterator.hasNext()) { + CsmElement ne = nextOrderElementsIterator.next(); + if (!correspondanceBetweenNextOrderAndPreviousOrder.values().contains(previousOrderElementsIterator.index()) && DifferenceElementCalculator.matching(ne, pe)) { + correspondanceBetweenNextOrderAndPreviousOrder.put(nextOrderElementsIterator.index(), previousOrderElementsIterator.index()); + // set the position to start on the next {@code nextOrderElementsIterator} iteration + syncNextIndex = nextOrderElementsIterator.index(); + break; + } + } + } + return correspondanceBetweenNextOrderAndPreviousOrder; + } + + private List findIndexOfCorrespondingNodeTextElement(List elements, NodeText nodeText) { + List correspondingIndices = new ArrayList<>(); + PeekingIterator csmElementListIterator = new PeekingIterator<>(elements); + while (csmElementListIterator.hasNext()) { + boolean isFirstIterationOnCsmElements = !csmElementListIterator.hasPrevious(); + int previousCsmElementIndex = csmElementListIterator.previousIndex(); + CsmElement csmElement = csmElementListIterator.next(); + Map potentialMatches = new EnumMap<>(MatchClassification.class); + PeekingIterator nodeTextListIterator = new PeekingIterator<>(nodeText.getElements()); + while (nodeTextListIterator.hasNext()) { + boolean isFirstIterationOnNodeTextElements = !nodeTextListIterator.hasPrevious(); + TextElement textElement = nodeTextListIterator.next(); + int currentTextElementIndex = nodeTextListIterator.currentIndex(); + if (!correspondingIndices.contains(currentTextElementIndex)) { + boolean isCorresponding = csmElement.isCorrespondingElement(textElement); + if (isCorresponding) { + boolean hasSamePreviousElement = false; + if (!isFirstIterationOnNodeTextElements && !isFirstIterationOnCsmElements) { + TextElement previousTextElement = nodeText.getTextElement(currentTextElementIndex - 1); + hasSamePreviousElement = elements.get(previousCsmElementIndex).isCorrespondingElement(previousTextElement); + } + boolean hasSameNextElement = false; + if (csmElementListIterator.hasNext()) { + TextElement nextTextElement = nodeTextListIterator.peek(); + hasSameNextElement = elements.get(csmElementListIterator.nextIndex()).isCorrespondingElement(nextTextElement); + } + if (hasSamePreviousElement && hasSameNextElement) { + potentialMatches.putIfAbsent(MatchClassification.ALL, currentTextElementIndex); + } else if (hasSamePreviousElement) { + potentialMatches.putIfAbsent(MatchClassification.PREVIOUS_AND_SAME, currentTextElementIndex); + } else if (hasSameNextElement) { + potentialMatches.putIfAbsent(MatchClassification.NEXT_AND_SAME, currentTextElementIndex); + } else { + potentialMatches.putIfAbsent(MatchClassification.SAME_ONLY, currentTextElementIndex); + } + } else if (isAlmostCorrespondingElement(textElement, csmElement)) { + potentialMatches.putIfAbsent(MatchClassification.ALMOST, currentTextElementIndex); + } + } + } + // Prioritize the matches from best to worst + Optional bestMatchKey = potentialMatches.keySet().stream().min(Comparator.comparing(MatchClassification::getPriority)); + if (bestMatchKey.isPresent()) { + correspondingIndices.add(potentialMatches.get(bestMatchKey.get())); + } else { + correspondingIndices.add(-1); + } + } + return correspondingIndices; + } + + private boolean isAlmostCorrespondingElement(TextElement textElement, CsmElement csmElement) { + if (csmElement.isCorrespondingElement(textElement)) { + return false; + } + return textElement.isWhiteSpace() && csmElement instanceof CsmToken && ((CsmToken) csmElement).isWhiteSpace(); + } +} 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 2827e02c0e..a9a7acd6ec 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 @@ -21,7 +21,6 @@ package com.github.javaparser.printer.lexicalpreservation; import java.util.Optional; - import com.github.javaparser.JavaToken; import com.github.javaparser.JavaToken.Kind; import com.github.javaparser.Range; 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 e1f4f46f7d..14b2374123 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 @@ -24,7 +24,6 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; - import com.github.javaparser.ast.AccessSpecifier; import com.github.javaparser.resolution.MethodUsage; import com.github.javaparser.resolution.UnsolvedSymbolException; @@ -37,8 +36,11 @@ public interface ResolvedReferenceTypeDeclaration extends ResolvedTypeDeclaration, ResolvedTypeParametrizable { String JAVA_LANG_ENUM = java.lang.Enum.class.getCanonicalName(); + String JAVA_LANG_COMPARABLE = java.lang.Comparable.class.getCanonicalName(); + String JAVA_IO_SERIALIZABLE = Serializable.class.getCanonicalName(); + String JAVA_LANG_OBJECT = java.lang.Object.class.getCanonicalName(); @Override @@ -293,12 +295,7 @@ default boolean hasAnnotation(String qualifiedName) { if (hasDirectlyAnnotation(qualifiedName)) { return true; } - return isClass() && getAllAncestors().stream() - .filter(it -> it.asReferenceType().getTypeDeclaration().isPresent()) - .filter(it -> it.asReferenceType().getTypeDeclaration().get().isClass()) - .map(it -> it.asReferenceType().getTypeDeclaration().get()) - .anyMatch(rrtd -> rrtd.hasDirectlyAnnotation(qualifiedName) - && rrtd.isInheritedAnnotation(qualifiedName)); + return isClass() && getAllAncestors().stream().filter(it -> it.asReferenceType().getTypeDeclaration().isPresent()).filter(it -> it.asReferenceType().getTypeDeclaration().get().isClass()).map(it -> it.asReferenceType().getTypeDeclaration().get()).anyMatch(rrtd -> rrtd.hasDirectlyAnnotation(qualifiedName) && rrtd.isInheritedAnnotation(qualifiedName)); } /** @@ -313,9 +310,7 @@ default boolean isInheritedAnnotation(String name) { * Returns the resolved annotation corresponding to the specified name and declared in this type declaration. */ default Optional getDeclaredAnnotation(String name) { - return getDeclaredAnnotations().stream() - .filter(annotation -> annotation.getQualifiedName().endsWith(name)) - .findFirst(); + return getDeclaredAnnotations().stream().filter(annotation -> annotation.getQualifiedName().endsWith(name)).findFirst(); } /** @@ -325,7 +320,6 @@ default Set getDeclaredAnnotations() { throw new UnsupportedOperationException("Getting declared annotation is not supproted on this type " + this.getName()); } - /** * This means that the type has a functional method. Conceptually, a functional interface has exactly one abstract method. * Typically these classes has the FunctionInterface annotation but this is not mandatory. @@ -359,8 +353,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() && getQualifiedName().equals(JAVA_LANG_OBJECT); + return // Consider anonymous classes + this.isClass() && !isAnonymousClass() && hasName() && getQualifiedName().equals(JAVA_LANG_OBJECT); } /** 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 cd343f86e6..442d507dc6 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 @@ -156,30 +156,30 @@ public static SymbolReference findMostApplicable ResolvedConstructorDeclaration other = null; boolean possibleAmbiguity = false; for (int i = 1; i < applicableConstructors.size(); i++) { - other = applicableConstructors.get(i); - if (isMoreSpecific(winningCandidate, other, typeSolver)) { - possibleAmbiguity = false; - } else if (isMoreSpecific(other, winningCandidate, typeSolver)) { - possibleAmbiguity = false; - winningCandidate = other; + other = applicableConstructors.get(i); + if (isMoreSpecific(winningCandidate, other, typeSolver)) { + possibleAmbiguity = false; + } else if (isMoreSpecific(other, winningCandidate, typeSolver)) { + possibleAmbiguity = false; + winningCandidate = other; + } else { + if (winningCandidate.declaringType().getQualifiedName().equals(other.declaringType().getQualifiedName())) { + possibleAmbiguity = true; } else { - if (winningCandidate.declaringType().getQualifiedName().equals(other.declaringType().getQualifiedName())) { - possibleAmbiguity = true; - } else { - // we expect the methods to be ordered such that inherited methods are later in the list - } + // we expect the methods to be ordered such that inherited methods are later in the list } - if (possibleAmbiguity) { - // pick the first exact match if it exists - if (!MethodResolutionLogic.isExactMatch(winningCandidate, argumentsTypes)) { - if (MethodResolutionLogic.isExactMatch(other, argumentsTypes)) { - winningCandidate = other; - } else { - throw new MethodAmbiguityException("Ambiguous constructor call: cannot find a most applicable constructor: " + winningCandidate + ", " + other); - } + } + if (possibleAmbiguity) { + // pick the first exact match if it exists + if (!MethodResolutionLogic.isExactMatch(winningCandidate, argumentsTypes)) { + if (MethodResolutionLogic.isExactMatch(other, argumentsTypes)) { + winningCandidate = other; + } else { + throw new MethodAmbiguityException("Ambiguous constructor call: cannot find a most applicable constructor: " + winningCandidate + ", " + other); } } } + } return SymbolReference.solved(winningCandidate); } 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 84b263a296..068267704d 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,10 +60,12 @@ public static Optional getFunctionalMethod(ResolvedType type) { */ public static Optional getFunctionalMethod(ResolvedReferenceTypeDeclaration typeDeclaration) { //We need to find all abstract methods - Set methods = // Remove methods inherited by Object: - typeDeclaration.getAllMethods().stream().filter(m -> m.getDeclaration().isAbstract()).// Consider the case of Comparator which define equals. It would be considered a functional method. - filter(m -> !isPublicMemberOfObject(m)).collect(// TODO a functional interface can have multiple subsignature method with a return-type-substitutable - 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(// TODO a functional interface can have multiple subsignature method with a return-type-substitutable + m -> !isPublicMemberOfObject(m)).// TODO a functional interface can have multiple subsignature method with a return-type-substitutable + collect(Collectors.toSet()); // see https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.8 if (methods.size() == 0) { return Optional.empty(); 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 a5ddc15293..3f81bd27b4 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 @@ -508,10 +508,13 @@ public static SymbolReference findMostApplicable(List } public static SymbolReference findMostApplicable(List methods, String name, List argumentsTypes, TypeSolver typeSolver, boolean wildcardTolerance) { - List applicableMethods = // Only consider methods with a matching name - methods.stream().filter(// Filters out duplicate ResolvedMethodDeclaration by their signature. - m -> m.getName().equals(name)).filter(// Checks if ResolvedMethodDeclaration is applicable to argumentsTypes. - distinctByKey(ResolvedMethodDeclaration::getQualifiedSignature)).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(); @@ -729,22 +732,22 @@ public static Optional findMostApplicableUsage(List me } MethodUsage winningCandidate = applicableMethods.get(0); for (int i = 1; i < applicableMethods.size(); i++) { - MethodUsage other = applicableMethods.get(i); - if (isMoreSpecific(winningCandidate, other)) { - // nothing to do - } else if (isMoreSpecific(other, winningCandidate)) { - winningCandidate = other; - } else { - if (winningCandidate.declaringType().getQualifiedName().equals(other.declaringType().getQualifiedName())) { - if (!areOverride(winningCandidate, other)) { - throw new MethodAmbiguityException("Ambiguous method call: cannot find a most applicable method: " + winningCandidate + ", " + other + ". First declared in " + winningCandidate.declaringType().getQualifiedName()); - } - } else { - // we expect the methods to be ordered such that inherited methods are later in the list - //throw new UnsupportedOperationException(); + MethodUsage other = applicableMethods.get(i); + if (isMoreSpecific(winningCandidate, other)) { + // nothing to do + } else if (isMoreSpecific(other, winningCandidate)) { + winningCandidate = other; + } else { + if (winningCandidate.declaringType().getQualifiedName().equals(other.declaringType().getQualifiedName())) { + if (!areOverride(winningCandidate, other)) { + throw new MethodAmbiguityException("Ambiguous method call: cannot find a most applicable method: " + winningCandidate + ", " + other + ". First declared in " + winningCandidate.declaringType().getQualifiedName()); } + } else { + // we expect the methods to be ordered such that inherited methods are later in the list + //throw new UnsupportedOperationException(); } } + } return Optional.of(winningCandidate); } 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 ec235a31fc..efd02417fb 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 @@ -23,7 +23,6 @@ import com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration; import java.util.*; import java.util.stream.Collectors; - import com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration; /** 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 240f841d71..2de1b04da8 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 @@ -180,7 +180,6 @@ public boolean isBoolean() { * If any operand is of a reference type, it is subjected to unboxing conversion (ยง5.1.8). */ 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. 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 c8a565964e..43c0e543ac 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 @@ -23,7 +23,6 @@ import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; import java.util.*; import java.util.stream.Collectors; - import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; /** diff --git a/javaparser-core/src/main/java/com/github/javaparser/utils/PositionUtils.java b/javaparser-core/src/main/java/com/github/javaparser/utils/PositionUtils.java index 494ed086de..7a5bc54592 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/utils/PositionUtils.java +++ b/javaparser-core/src/main/java/com/github/javaparser/utils/PositionUtils.java @@ -107,7 +107,6 @@ private static int beginColumnWithoutConsideringAnnotation(Node node) { } private static Node firstNonAnnotationNode(Node node) { - if (node instanceof ClassOrInterfaceDeclaration) { // Modifiers appear before the class name -- ClassOrInterfaceDeclaration casted = (ClassOrInterfaceDeclaration) node;