Fridrich Strba 2024-02-13 01:50:55 +00:00 committed by Git OBS Bridge
parent 6841d921b5
commit 105667c625
3 changed files with 103 additions and 1 deletions

93
ecj-java8compat.patch Normal file
View File

@ -0,0 +1,93 @@
--- a/build.xml 2022-03-08 08:19:52.000000000 +0100
+++ b/build.xml 2024-02-13 02:31:15.760059399 +0100
@@ -26,8 +26,8 @@
<javac srcdir="${basedir}" destdir="${output}"
debuglevel="lines,source"
debug="true"
- release="11">
- <compilerarg line="-Xlint:none --patch-module java.compiler=javax17api.jar"/>
+ source="8" target="8">
+ <compilerarg line="-Xlint:none"/>
</javac>
<delete file="${basedir}/META-INF/MANIFEST.MF" failonerror="false"/>
--- a/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java 2022-03-08 08:19:50.000000000 +0100
+++ b/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java 2024-02-13 02:40:37.158638361 +0100
@@ -1281,7 +1281,7 @@
private Iterable<? extends File> getFiles(final Iterable<? extends Path> paths) {
if (paths == null)
return null;
- return () -> new Iterator<>() {
+ return () -> new Iterator<File>() {
Iterator<? extends Path> original = paths.iterator();
@Override
public boolean hasNext() {
@@ -1296,7 +1296,7 @@
private Iterable<? extends Path> getPaths(final Iterable<? extends File> files) {
if (files == null)
return null;
- return () -> new Iterator<>() {
+ return () -> new Iterator<Path>() {
Iterator<? extends File> original = files.iterator();
@Override
public boolean hasNext() {
--- a/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 2022-03-08 08:19:50.000000000 +0100
+++ b/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 2024-02-13 02:32:54.251379205 +0100
@@ -3319,7 +3319,7 @@
}
}
// sort them in according to their own indexes
- Arrays.sort(bindings, new Comparator<>() {
+ Arrays.sort(bindings, new Comparator<SyntheticMethodBinding>() {
@Override
public int compare(SyntheticMethodBinding o1, SyntheticMethodBinding o2) {
return o1.index - o2.index;
--- a/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java 2022-03-08 08:19:50.000000000 +0100
+++ b/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java 2024-02-13 02:38:57.913975827 +0100
@@ -239,7 +239,7 @@
DiagnosticListener<? super JavaFileObject> diagListener = EclipseCompilerImpl.this.diagnosticListener;
Diagnostic<JavaFileObject> diagnostic = null;
if (diagListener != null) {
- diagnostic = new Diagnostic<>() {
+ diagnostic = new Diagnostic<JavaFileObject>() {
@Override
public String getCode() {
return Integer.toString(problemId);
@@ -316,7 +316,7 @@
DiagnosticListener<? super JavaFileObject> diagListener = EclipseCompilerImpl.this.diagnosticListener;
Diagnostic<JavaFileObject> diagnostic = null;
if (diagListener != null) {
- diagnostic = new Diagnostic<>() {
+ diagnostic = new Diagnostic<JavaFileObject>() {
@Override
public String getCode() {
return Integer.toString(problemId);
@@ -797,7 +797,7 @@
Iterator iterator = this.extraProblems.iterator(); iterator.hasNext(); ) {
final CategorizedProblem problem = (CategorizedProblem) iterator.next();
if (this.diagnosticListener != null && !isIgnored(problem)) {
- Diagnostic<JavaFileObject> diagnostic = new Diagnostic<>() {
+ Diagnostic<JavaFileObject> diagnostic = new Diagnostic<JavaFileObject>() {
@Override
public String getCode() {
return null;
--- a/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java 2022-03-08 08:19:50.000000000 +0100
+++ b/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java 2024-02-13 02:41:33.840827055 +0100
@@ -1310,7 +1310,7 @@
private Iterable<? extends File> getFiles(final Iterable<? extends Path> paths) {
if (paths == null)
return null;
- return () -> new Iterator<>() {
+ return () -> new Iterator<File>() {
Iterator<? extends Path> original = paths.iterator();
@Override
public boolean hasNext() {
@@ -1325,7 +1325,7 @@
private Iterable<? extends Path> getPaths(final Iterable<? extends File> files) {
if (files == null)
return null;
- return () -> new Iterator<>() {
+ return () -> new Iterator<Path>() {
Iterator<? extends File> original = files.iterator();
@Override
public boolean hasNext() {

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Feb 13 01:50:04 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* ecj-java8compat.patch
+ Allow building ecj with language levels 8
-------------------------------------------------------------------
Mon Aug 21 11:46:03 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package ecj
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -32,6 +32,7 @@ Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/%{bundle_ver}
# Extracted from https://download.eclipse.org/eclipse/downloads/drops4/%%{drop}/ecj-%%{jar_ver}.jar
Source2: MANIFEST.MF
Patch0: ecj-rpmdebuginfo.patch
Patch1: ecj-java8compat.patch
BuildRequires: ant
BuildRequires: java-devel >= 11
BuildRequires: javapackages-local >= 6
@ -45,6 +46,7 @@ the JDT Core batch compiler.
%prep
%setup -q -c
%patch0 -p1
%patch1 -p1
# Specify encoding
sed -i -e '/compilerarg/s/Xlint:none/Xlint:none -encoding cp1252/' build.xml