summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-09-11 10:00:50 +0000
committerCoprDistGit <infra@openeuler.org>2026-09-11 10:00:50 +0000
commit063bb917f1f6db9e9db3d2b94097224404ea0c37 (patch)
tree145d57b3c91e0abd86c0ab77bafb2e359291d154
parentbcfcca37fd0d5246563aba0de31118ffb84afc1f (diff)
automatic import of javaparseropeneuler24.03_LTS_SP3
-rw-r--r--.gitignore1
-rw-r--r--0001-Port-to-OpenJDK-21.patch78
-rw-r--r--0003-javacc-grammar-avoid-diamond-operator.patch11
-rw-r--r--javaparser.spec131
-rw-r--r--sources1
5 files changed, 222 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..4fb265d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/javaparser-parent-3.27.1.tar.gz
diff --git a/0001-Port-to-OpenJDK-21.patch b/0001-Port-to-OpenJDK-21.patch
new file mode 100644
index 0000000..3de19b1
--- /dev/null
+++ b/0001-Port-to-OpenJDK-21.patch
@@ -0,0 +1,78 @@
+From 229820ea9a9fccbe9ba91a0678411a878b4c070b Mon Sep 17 00:00:00 2001
+From: Marian Koncek <mkoncek@redhat.com>
+Date: Tue, 20 Feb 2024 17:39:06 +0100
+Subject: [PATCH] Port to OpenJDK 21
+
+---
+ .../com/github/javaparser/ast/NodeList.java | 18 ++++++++----------
+ .../ast/body/CallableDeclaration.java | 2 +-
+ 2 files changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java b/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java
+index d78ed2a..8a77597 100644
+--- a/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java
++++ b/javaparser-core/src/main/java/com/github/javaparser/ast/NodeList.java
+@@ -186,17 +186,15 @@ public class NodeList<N extends Node> implements List<N>, Iterable<N>, HasParent
+ /**
+ * Inserts the node before all other nodes.
+ */
+- public NodeList<N> addFirst(N node) {
++ public void addFirst(N node) {
+ add(0, node);
+- return this;
+ }
+
+ /**
+ * Inserts the node after all other nodes. (This is simply an alias for add.)
+ */
+- public NodeList<N> addLast(N node) {
++ public void addLast(N node) {
+ add(node);
+- return this;
+ }
+
+ /**
+@@ -230,21 +228,21 @@ public class NodeList<N extends Node> implements List<N>, Iterable<N>, HasParent
+ /**
+ * @return the first node, or empty if the list is empty.
+ */
+- public Optional<N> getFirst() {
++ public N getFirst() {
+ if (isEmpty()) {
+- return Optional.empty();
++ throw new NoSuchElementException();
+ }
+- return Optional.of(get(0));
++ return get(0);
+ }
+
+ /**
+ * @return the last node, or empty if the list is empty.
+ */
+- public Optional<N> getLast() {
++ public N getLast() {
+ if (isEmpty()) {
+- return Optional.empty();
++ throw new NoSuchElementException();
+ }
+- return Optional.of(get(size() - 1));
++ return get(size() - 1);
+ }
+
+ @Override
+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 9d5d5c6..782eb11 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
+@@ -445,7 +445,7 @@ public abstract class CallableDeclaration<T extends CallableDeclaration<?>> exte
+ * Returns true if the method has a variable number of arguments
+ */
+ public boolean isVariableArityMethod() {
+- return getParameters().size() > 0 && getParameters().getLast().get().isVarArgs();
++ return getParameters().size() > 0 && getParameters().getLast().isVarArgs();
+ }
+
+ /*
+--
+2.43.0
+
diff --git a/0003-javacc-grammar-avoid-diamond-operator.patch b/0003-javacc-grammar-avoid-diamond-operator.patch
new file mode 100644
index 0000000..e17c7fd
--- /dev/null
+++ b/0003-javacc-grammar-avoid-diamond-operator.patch
@@ -0,0 +1,11 @@
+--- a/javaparser-core/src/main/javacc/java.jj
++++ b/javaparser-core/src/main/javacc/java.jj
+@@ -3383,7 +3383,7 @@
+ NodeList<PatternExpr> PatternList():
+ {
+ PatternExpr pattern;
+- NodeList<PatternExpr> ret = new NodeList<>();
++ NodeList<PatternExpr> ret = new NodeList<PatternExpr>();
+ }
+ {
+ "("
diff --git a/javaparser.spec b/javaparser.spec
new file mode 100644
index 0000000..73146b6
--- /dev/null
+++ b/javaparser.spec
@@ -0,0 +1,131 @@
+%bcond_with bootstrap
+
+%if %{without bootstrap}
+%bcond_without bnd_maven_plugin
+%else
+%bcond_with bnd_maven_plugin
+%endif
+
+Name: javaparser
+Version: 3.27.1
+Release: 4
+Summary: Java 1 to 13 Parser and Abstract Syntax Tree for Java
+License: LGPL-2.0-or-later OR Apache-2.0
+URL: https://javaparser.org
+Source0: https://github.com/javaparser/javaparser/archive/%{name}-parent-%{version}.tar.gz
+BuildArch: noarch
+
+Patch0: 0001-Port-to-OpenJDK-21.patch
+Patch1: 0003-javacc-grammar-avoid-diamond-operator.patch
+
+%if %{with bnd_maven_plugin}
+BuildRequires: mvn(biz.aQute.bnd:bnd-maven-plugin)
+%endif
+%if %{with bootstrap}
+BuildRequires: javapackages-bootstrap
+%else
+BuildRequires: maven-local
+BuildRequires: mvn(junit:junit)
+BuildRequires: mvn(javax.annotation:javax.annotation-api)
+BuildRequires: mvn(net.java.dev.javacc:javacc)
+BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
+BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin)
+%endif
+
+%description
+This package contains a Java 1 to 13 Parser with AST generation and
+visitor support. The AST records the source code structure, javadoc
+and comments. It is also possible to change the AST nodes or create new
+ones to modify the source code.
+
+%package javadoc
+Summary: Javadoc for %{name}
+%description javadoc
+This package contains API documentation for %{name}.
+
+%prep
+%autosetup -n %{name}-%{name}-parent-%{version} -p1
+sed -i 's/\r//' readme.md
+
+%pom_remove_dep -r :junit-bom
+
+%pom_remove_plugin :maven-source-plugin
+%pom_remove_plugin :central-publishing-maven-plugin
+%pom_remove_plugin -r :jacoco-maven-plugin
+
+%if %{without bnd_maven_plugin}
+%pom_remove_plugin :bnd-maven-plugin javaparser-core
+mkdir -p javaparser-core/target/classes/META-INF/
+touch javaparser-core/target/classes/META-INF/MANIFEST.MF
+%endif
+
+%mvn_alias :javaparser-core com.google.code.javaparser:javaparser
+sed -i \
+ -e 's/ph-javacc-maven-plugin/javacc-maven-plugin/' \
+ -e 's/com.helger.maven/org.codehaus.mojo/' \
+ javaparser-core/pom.xml
+%pom_remove_plugin :templating-maven-plugin javaparser-core
+%pom_xpath_inject "pom:build" "
+<resources>
+ <resource>
+ <directory>src/main/java-templates</directory>
+ <filtering>true</filtering>
+ <targetPath>\${basedir}/src/main/java</targetPath>
+ </resource>
+</resources>" javaparser-core
+%pom_disable_module javaparser-core-testing
+%pom_disable_module javaparser-core-testing-bdd
+%pom_disable_module javaparser-symbol-solver-core
+%pom_disable_module javaparser-symbol-solver-testing
+%pom_disable_module javaparser-core-generators
+%pom_disable_module javaparser-core-metamodel-generator
+%pom_disable_module javaparser-core-serialization
+
+%build
+%mvn_build
+
+%install
+%mvn_install
+
+%files -f .mfiles
+%doc readme.md changelog.md
+%license LICENSE LICENSE.APACHE LICENSE.GPL LICENSE.LGPL
+
+%files javadoc -f .mfiles-javadoc
+%license LICENSE LICENSE.APACHE LICENSE.GPL LICENSE.LGPL
+
+%changelog
+* Tue Sep 08 2026 Yuki-Noa <9-nine-noa@users.noreply.github.com> - 3.27.1-4
+- Add patch 0003-javacc-grammar-avoid-diamond-operator.patch to replace
+ the diamond operator in java.jj with an explicit type argument, since
+ the distro's JavaCC 7.0.2 cannot parse it (build error: ParseException
+ "Encountered >" at line 3386 of java.jj).
+
+* Thu Feb 26 2026 yaoxin <1024769339@qq.com> - 3.27.1-3
+- Unuse bootstrap
+
+* Fri Feb 13 2026 yaoxin <1024769339@qq.com> - 3.27.1-2
+- Adapting to maven upgrade
+
+* Thu Oct 16 2025 yaoxin <1024769339@qq.com> - 3.27.1-1
+- Update to 3.27.1:
+ * Fix: Adjusts the range limits of lambda expression parameters
+ to ignore brackets.
+ * Fix: issue 4832 Resolving type of fully qualified varargs
+ invocation throws IndexOutOfBoundsException
+ * Fix: Issue 4829 Infinite loop in DifferenceElementCalculator
+ when calling setPermittedTypes
+ * XmlPrinter: fix duplicate attribute name in generated xml
+ * Use lambda parameter counts and block bodies for improved resolution
+
+* Thu May 15 2025 yaoxin <1024769339@qq.com> - 3.25.10-1
+- Upgrade to 3.25.10:
+ * Fix strange error when trying to find erasure of generic type
+ where one of two type parameters is an array
+ * Fix prevent infinite cycles with static imports
+ * Refactor ResolvedReferenceType#equals
+ * Fix cannot be 'abstract' and also 'private'. for a private
+ method in an interface
+
+* Sat Aug 1 2020 Jeffery.Gao <gaojianxing@huawei.com> - 3.3.5-1
+- Package init
diff --git a/sources b/sources
new file mode 100644
index 0000000..7d4bc41
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+2ed9195ec8319a4fd6a5a063a7ebd890 javaparser-parent-3.27.1.tar.gz