summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-11-02 09:28:57 +0000
committerCoprDistGit <infra@openeuler.org>2026-11-02 09:28:57 +0000
commit62b1a8ba5e5c11eb5063d4710e26d70cdf695c23 (patch)
tree804bd13ad327be047e707557cdbfc1dee37263cb
parent063bb917f1f6db9e9db3d2b94097224404ea0c37 (diff)
automatic import of javaparser
-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.spec116
-rw-r--r--sources2
5 files changed, 45 insertions, 163 deletions
diff --git a/.gitignore b/.gitignore
index 4fb265d..11e7743 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/javaparser-parent-3.27.1.tar.gz
+/javaparser-3.28.0.tar.gz
diff --git a/0001-Port-to-OpenJDK-21.patch b/0001-Port-to-OpenJDK-21.patch
deleted file mode 100644
index 3de19b1..0000000
--- a/0001-Port-to-OpenJDK-21.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-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
deleted file mode 100644
index e17c7fd..0000000
--- a/0003-javacc-grammar-avoid-diamond-operator.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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
index 73146b6..0ff14fe 100644
--- a/javaparser.spec
+++ b/javaparser.spec
@@ -1,69 +1,60 @@
-%bcond_with bootstrap
-
-%if %{without bootstrap}
-%bcond_without bnd_maven_plugin
-%else
-%bcond_with bnd_maven_plugin
-%endif
+%global debug_package %{nil}
Name: javaparser
-Version: 3.27.1
-Release: 4
+Version: 3.28.0
+Release: 1%{?dist}
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
+URL: https://github.com/javaparser/javaparser
+Source0: %{url}/archive/javaparser-parent-%{version}.tar.gz#/%{name}-%{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
+BuildRequires: java-17-openjdk-devel
+# RPM names (rather than mvn(group:artifact) capabilities) are used for the
+# external Maven plugins; both package the corresponding artifacts into the
+# local xmvn repository.
+BuildRequires: javacc
+BuildRequires: javacc-maven-plugin
+BuildRequires: maven-plugin-build-helper
%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.
+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}
+Summary: Javadoc for %{name}
%description javadoc
This package contains API documentation for %{name}.
%prep
-%autosetup -n %{name}-%{name}-parent-%{version} -p1
+%autosetup -n %{name}-%{version}
sed -i 's/\r//' readme.md
+# The JUnit BOM import is only used by the (disabled) test modules and is
+# not needed to build javaparser-core.
%pom_remove_dep -r :junit-bom
+# Release / publishing plugins are not available in the offline build.
%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
+# Coverage plugin is used by the test modules only.
+%pom_remove_plugin -r :jacoco-maven-plugin
%mvn_alias :javaparser-core com.google.code.javaparser:javaparser
+
+# ph-javacc-maven-plugin is not packaged in openEuler; the codehaus
+# javacc-maven-plugin provides the same JavaCC grammar generation.
sed -i \
-e 's/ph-javacc-maven-plugin/javacc-maven-plugin/' \
-e 's/com.helger.maven/org.codehaus.mojo/' \
javaparser-core/pom.xml
+
+# templating-maven-plugin is unavailable; use an equivalent filtered copy
+# of src/main/java-templates into src/main/java instead.
%pom_remove_plugin :templating-maven-plugin javaparser-core
%pom_xpath_inject "pom:build" "
<resources>
@@ -73,16 +64,27 @@ sed -i \
<targetPath>\${basedir}/src/main/java</targetPath>
</resource>
</resources>" javaparser-core
+
+# bnd-maven-plugin (OSGi manifest generation) is not needed; provide an
+# empty MANIFEST.MF so that the maven-jar-plugin manifestFile reference
+# still resolves.
+%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
+
+# Only javaparser-core is packaged; tests, generators and the symbol
+# solver carry dependencies that are not part of this package.
%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
+%pom_disable_module javaparser-symbol-solver-core
+%pom_disable_module javaparser-symbol-solver-testing
%build
-%mvn_build
+export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
+%mvn_build -f
%install
%mvn_install
@@ -95,37 +97,5 @@ sed -i \
%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
+* Mon Nov 02 2026 openEuler Build <build@openeuler.org> - 3.28.0-1
+- Initial package
diff --git a/sources b/sources
index 7d4bc41..6bd4a52 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2ed9195ec8319a4fd6a5a063a7ebd890 javaparser-parent-3.27.1.tar.gz
+cad136e09a90809b7a7b39efdc0d6528 javaparser-3.28.0.tar.gz