Skip to content

Commit

Permalink
fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon committed Nov 15, 2024
1 parent e7b9523 commit cb46f5b
Show file tree
Hide file tree
Showing 699 changed files with 16,117 additions and 19,506 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.github.javaparser.generator;

import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;

import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
package com.github.javaparser.generator.core.node;

import static com.github.javaparser.StaticJavaParser.parseType;
import static com.github.javaparser.ast.Modifier.Keyword.FINAL;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.FINAL;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static com.github.javaparser.utils.CodeGenerationUtils.f;
import static com.github.javaparser.utils.Utils.camelCaseToScreaming;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.jml.expr.*;
import com.github.javaparser.ast.jml.clauses.*;
import com.github.javaparser.ast.jml.stmt.*;
import com.github.javaparser.ast.jml.body.*;
import com.github.javaparser.ast.jml.doc.*;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.body.CompactConstructorDeclaration;
Expand Down Expand Up @@ -151,18 +156,18 @@ public class MetaModelGenerator extends AbstractGenerator {
add(com.github.javaparser.ast.expr.UnaryExpr.class);
add(com.github.javaparser.ast.expr.VariableDeclarationExpr.class);

add(JmlDoc.class);
add(JmlDocDeclaration.class);
add(JmlDocStmt.class);
add(JmlDocType.class);
add(JmlDoc.class);
add(JmlDocDeclaration.class);
add(JmlDocStmt.class);
add(JmlDocType.class);

add(JmlQuantifiedExpr.class);
add(JmlTypeExpr.class);
add(JmlBinaryInfixExpr.class);
add(JmlLetExpr.class);
add(JmlMultiCompareExpr.class);
add(JmlLabelExpr.class);
add(JmlSetComprehensionExpr.class);
add(JmlQuantifiedExpr.class);
add(JmlTypeExpr.class);
add(JmlBinaryInfixExpr.class);
add(JmlLetExpr.class);
add(JmlMultiCompareExpr.class);
add(JmlLabelExpr.class);
add(JmlSetComprehensionExpr.class);

add(com.github.javaparser.ast.stmt.AssertStmt.class);
add(com.github.javaparser.ast.stmt.BlockStmt.class);
Expand All @@ -189,36 +194,36 @@ public class MetaModelGenerator extends AbstractGenerator {
add(com.github.javaparser.ast.stmt.WhileStmt.class);
add(com.github.javaparser.ast.stmt.YieldStmt.class);

add(JmlStatement.class);
add(JmlGhostStmt.class);
add(JmlExpressionStmt.class);
add(JmlRefiningStmt.class);
add(JmlUnreachableStmt.class);
add(JmlLabelStmt.class);
add(JmlBeginStmt.class);
add(JmlEndStmt.class);

add(JmlClassLevelDeclaration.class);
add(JmlMethodDeclaration.class);
add(JmlFieldDeclaration.class);
add(JmlClause.class);
add(JmlSimpleExprClause.class);
add(JmlMultiExprClause.class);
add(JmlSignalsClause.class);
add(JmlSignalsOnlyClause.class);
add(JmlClauseLabel.class);
add(JmlForallClause.class);
add(JmlOldClause.class);
add(JmlCallableClause.class);
add(JmlClauseIf.class);
add(JmlMethodSignature.class);
add(com.github.javaparser.ast.jml.clauses.JmlContract.class);

//add(com.github.javaparser.ast.JmlBoundVariable.class);

add(JmlClassExprDeclaration.class);
add(JmlRepresentsDeclaration.class);
add(JmlClassAccessibleDeclaration.class);
add(JmlStatement.class);
add(JmlGhostStmt.class);
add(JmlExpressionStmt.class);
add(JmlRefiningStmt.class);
add(JmlUnreachableStmt.class);
add(JmlLabelStmt.class);
add(JmlBeginStmt.class);
add(JmlEndStmt.class);

add(JmlClassLevelDeclaration.class);
add(JmlMethodDeclaration.class);
add(JmlFieldDeclaration.class);
add(JmlClause.class);
add(JmlSimpleExprClause.class);
add(JmlMultiExprClause.class);
add(JmlSignalsClause.class);
add(JmlSignalsOnlyClause.class);
add(JmlClauseLabel.class);
add(JmlForallClause.class);
add(JmlOldClause.class);
add(JmlCallableClause.class);
add(JmlClauseIf.class);
add(JmlMethodSignature.class);
add(com.github.javaparser.ast.jml.clauses.JmlContract.class);

//add(com.github.javaparser.ast.JmlBoundVariable.class);

add(JmlClassExprDeclaration.class);
add(JmlRepresentsDeclaration.class);
add(JmlClassAccessibleDeclaration.class);

add(com.github.javaparser.ast.type.ArrayType.class);
add(com.github.javaparser.ast.type.ClassOrInterfaceType.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.*;

import static com.github.javaparser.StaticJavaParser.*;
import static com.github.javaparser.ast.Modifier.Keyword.*;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.*;
import static com.github.javaparser.utils.CodeGenerationUtils.f;
import static com.github.javaparser.utils.CodeGenerationUtils.optionalOf;
import static com.github.javaparser.utils.Utils.decapitalize;
Expand Down
9 changes: 5 additions & 4 deletions javaparser-core-serialization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
</license>
</licenses>

<properties>
<java.version>1.8</java.version>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -59,6 +55,11 @@
<artifactId>jakarta.json-api</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<!-- The jakarta.json variant of Glassfish is now available under a new name, Eclipse Parsson -->
<dependency>
<groupId>org.eclipse.parsson</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.github.javaparser.*;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.NodeList;
import com.github.javaparser.ast.comments.Comment;
Expand Down Expand Up @@ -108,7 +109,7 @@ private Node deserializeObject(JsonObject nodeJson) {
parameters.put(name, Boolean.parseBoolean(nodeJson.getString(name)));
} else if (Enum.class.isAssignableFrom(type)) {
parameters.put(name, Enum.valueOf((Class<? extends Enum>) type, nodeJson.getString(name)));
} else if (type == Modifier.Keyword.class) {
} else if (type == Modifier.DefaultKeyword.class) {
//TODO weigl handle JmlDocModifier?
parameters.put(name, Enum.valueOf(Modifier.DefaultKeyword.class, nodeJson.getString(name)));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.Node;

import com.google.common.truth.Truth;
import jakarta.json.Json;
import jakarta.json.stream.JsonGenerator;
import jakarta.json.stream.JsonGeneratorFactory;

import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;

import static com.github.javaparser.StaticJavaParser.parse;
import static org.junit.jupiter.api.Assertions.assertEquals;


class JavaParserJsonSerializerTest {
@Test
Expand All @@ -45,7 +49,7 @@ void test() throws IOException {
InputStream is = getClass().getResourceAsStream("/example.json");
byte[] buffer = new byte[1024 * 1024];
int len = is.read(buffer);
Assume.assumeTrue(len > 0);
Assumptions.assumeTrue(len > 0);
String expected = new String(buffer, 0, len);
System.out.println(serialized);
Truth.assertThat(serialized).isEqualTo(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.github.javaparser.steps;

import static com.github.javaparser.StaticJavaParser.*;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static com.github.javaparser.ast.Modifier.staticModifier;
import static com.github.javaparser.ast.NodeList.nodeList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void sealedClass() {
assertFalse(x.isInnerClass());
assertFalse(x.isNestedType());
assertFalse(x.isLocalClassDeclaration());
assertTrue(x.hasModifier(Modifier.Keyword.SEALED));
assertTrue(x.hasModifier(Modifier.DefaultKeyword.SEALED));
assertEquals(x.getPermittedTypes().size(), 2);
assertEquals(x.getPermittedTypes().get(0).getNameAsString(), "Y");
assertEquals(x.getPermittedTypes().get(1).getNameAsString(), "Z");
Expand All @@ -113,7 +113,7 @@ void nonSealedClass() {
assertFalse(x.isInnerClass());
assertFalse(x.isNestedType());
assertFalse(x.isLocalClassDeclaration());
assertTrue(x.hasModifier(Modifier.Keyword.NON_SEALED));
assertTrue(x.hasModifier(Modifier.DefaultKeyword.NON_SEALED));
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void record_isImplicitlyFinal() {

RecordDeclaration recordDeclaration =
cu.findFirst(RecordDeclaration.class).get();
assertFalse(recordDeclaration.hasModifier(Modifier.Keyword.FINAL));
assertFalse(recordDeclaration.hasModifier(Modifier.DefaultKeyword.FINAL));
assertTrue(recordDeclaration.isFinal(), "Records are implicitly final.");
}

Expand All @@ -356,7 +356,7 @@ void record_isImplicitlyFinalWithoutExplicit() {

RecordDeclaration recordDeclaration =
cu.findFirst(RecordDeclaration.class).get();
assertFalse(recordDeclaration.hasModifier(Modifier.Keyword.FINAL));
assertFalse(recordDeclaration.hasModifier(Modifier.DefaultKeyword.FINAL));
assertTrue(recordDeclaration.isFinal(), "Records are implicitly final.");
}

Expand Down Expand Up @@ -541,7 +541,7 @@ void record_topLevelRecordsAreNotStatic() {

RecordDeclaration recordDeclaration =
cu.findAll(RecordDeclaration.class).get(0);
assertFalse(recordDeclaration.hasModifier(Modifier.Keyword.STATIC));
assertFalse(recordDeclaration.hasModifier(Modifier.DefaultKeyword.STATIC));
assertFalse(recordDeclaration.isStatic(), "Top level Records are NOT implicitly static.");
}

Expand All @@ -557,7 +557,7 @@ void record_nestedRecordsAreImplicitlyStatic() {

RecordDeclaration recordDeclaration =
cu.findAll(RecordDeclaration.class).get(0);
assertFalse(recordDeclaration.hasModifier(Modifier.Keyword.STATIC));
assertFalse(recordDeclaration.hasModifier(Modifier.DefaultKeyword.STATIC));
assertTrue(recordDeclaration.isStatic(), "Nested Records are implicitly static.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.github.javaparser.ast.nodeTypes;

import static com.github.javaparser.ast.Modifier.Keyword.*;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.*;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -83,7 +83,7 @@ void keepModifiersThatShouldNotBeRemoved() {
assertEquals(createModifierList(SYNCHRONIZED), node.getModifiers());
}

private NodeWithModifiers anythingWithModifiers(Modifier.Keyword... keywords) {
private NodeWithModifiers anythingWithModifiers(Modifier.DefaultKeyword... keywords) {
ClassOrInterfaceDeclaration foo = new ClassOrInterfaceDeclaration(new NodeList<>(), false, "Foo");
foo.addModifier(keywords);
return foo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
package com.github.javaparser.builders;

import static com.github.javaparser.StaticJavaParser.parseImport;
import static com.github.javaparser.ast.Modifier.Keyword.PRIVATE;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PRIVATE;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static org.junit.jupiter.api.Assertions.*;

import com.github.javaparser.ast.CompilationUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.github.javaparser.builders;

import static com.github.javaparser.StaticJavaParser.*;
import static com.github.javaparser.ast.Modifier.Keyword.*;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.*;
import static org.junit.jupiter.api.Assertions.*;

import com.github.javaparser.ast.CompilationUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.github.javaparser.builders;

import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.github.javaparser.ast.CompilationUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import static com.github.javaparser.TokenTypes.eolTokenKind;
import static com.github.javaparser.TokenTypes.spaceTokenKind;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static com.github.javaparser.printer.lexicalpreservation.DifferenceElement.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void test() {

List<Modifier.Keyword> kws =
field.getModifiers().stream().map(Modifier::getKeyword).collect(Collectors.toList());
kws.add(0, Modifier.Keyword.PROTECTED);
kws.add(0, Modifier.DefaultKeyword.PROTECTED);
field.setModifiers(kws.toArray(new Modifier.Keyword[] {}));

String expected = "class C { \r\n" + " protected static String S = \"s\";\r\n" + "}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import static com.github.javaparser.TokenTypes.eolTokenKind;
import static com.github.javaparser.TokenTypes.spaceTokenKind;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.github.javaparser.printer.lexicalpreservation;

import static com.github.javaparser.StaticJavaParser.parseClassOrInterfaceType;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.NODE_TEXT_DATA;
import static com.github.javaparser.utils.TestUtils.assertEqualsStringIgnoringEol;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.github.javaparser.printer.lexicalpreservation;

import static com.github.javaparser.ast.Modifier.Keyword.STATIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.STATIC;
import static com.github.javaparser.utils.TestUtils.assertEqualsStringIgnoringEol;

import com.github.javaparser.StaticJavaParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

package com.github.javaparser.printer.lexicalpreservation.transformations.ast.body;

import static com.github.javaparser.ast.Modifier.Keyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

package com.github.javaparser.printer.lexicalpreservation.transformations.ast.body;

import static com.github.javaparser.ast.Modifier.Keyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
package com.github.javaparser.printer.lexicalpreservation.transformations.ast.body;

import static com.github.javaparser.StaticJavaParser.parseClassOrInterfaceType;
import static com.github.javaparser.ast.Modifier.Keyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.Keyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PROTECTED;
import static com.github.javaparser.ast.Modifier.DefaultKeyword.PUBLIC;
import static com.github.javaparser.ast.Modifier.createModifierList;

import com.github.javaparser.ast.NodeList;
Expand Down
Loading

0 comments on commit cb46f5b

Please sign in to comment.