Skip to content

Commit

Permalink
Merge branch 'master' into renovate/actions-checkout-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MysterAitch committed Mar 21, 2022
2 parents 3cef56e + 79e4b51 commit 1c804ea
Show file tree
Hide file tree
Showing 17 changed files with 419 additions and 357 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

## Setup the specified version of Java (includes maven/gradle).
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu' # v2 requires explicitly stating the distribution - `zulu` and `adopt` supported at time of writing
java-version: ${{ matrix.jdk }} # Use matrix to select which JDK level to use
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare_release_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class X {
}
class X {
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
module M.N {
}
module M.N {
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
module demo {
}
module demo {
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
module demo {
}
module demo {
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
package demo;

import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.utils.ParserCollectionStrategy;
import com.github.javaparser.utils.ProjectRoot;
import com.github.javaparser.utils.SourceRoot;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/* If there is a module declaration in the root directory, JavaParser doesn't find any .java files. */
public class Main {

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Usage: provide one or more directory names to process");
System.exit(1);
}
for (String dir : args) {
process(dir);
}
}

private static void process(String dir) {
Path root = Paths.get(dir);
Callback cb = new Callback();
ProjectRoot projectRoot = new ParserCollectionStrategy().collect(root);
projectRoot.getSourceRoots().forEach(sourceRoot -> {
try {
sourceRoot.parse("", cb);
} catch (IOException e) {
System.err.println("IOException: " + e);
}
});
}

private static class Callback implements SourceRoot.Callback {

@Override
public Result process(Path localPath, Path absolutePath, ParseResult<CompilationUnit> result) {
System.out.printf("Found %s%n", absolutePath);
return Result.SAVE;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public static ResolvedType unp(ResolvedType type) {
/*
* Verify if the ResolvedPrimitiveType is in the list of ResolvedPrimitiveType
*/
public boolean in(ResolvedPrimitiveType[] types) {
public boolean in(ResolvedPrimitiveType... types) {
return Arrays.stream(types).anyMatch(type -> this == type);
}

Expand Down

0 comments on commit 1c804ea

Please sign in to comment.