Sync from SUSE:SLFO:Main ecj revision 671f05d58512b487f2f111c7c1d3b9b9

This commit is contained in:
Adrian Schröter 2024-05-03 12:16:11 +02:00
commit c416d0e3c7
8 changed files with 3534 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

2971
MANIFEST.MF Normal file

File diff suppressed because it is too large Load Diff

47
ecj-3.29.0.pom Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, 2018 GK Software SE and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Stephan Herrmann - initial implementation
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xsi:noNamespaceSchemaLocation="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.29.0</version>
<description>Eclipse Compiler for Java(TM)</description>
<name>Eclipse Compiler for Java(TM)</name>
<url>http://www.eclipse.org/jdt</url>
<licenses>
<license>
<name>Eclipse Public License - v 2.0</name>
<url>https://www.eclipse.org/legal/epl-2.0/</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>Eclipse Foundation</name>
<url>http://www.eclipse.org/</url>
</organization>
<issueManagement>
<system>Bugzilla</system>
<url>https://bugs.eclipse.org/</url>
</issueManagement>
<scm>
<connection>scm:git:https://git.eclipse.org/r/jdt/eclipse.jdt.core.git</connection>
<url>https://git.eclipse.org/c/jdt/eclipse.jdt.core.git</url>
</scm>
<developers>
<developer>
<url>https://projects.eclipse.org/projects/eclipse.jdt/who</url>
</developer>
</developers>
</project>

168
ecj-java8compat.patch Normal file
View File

@ -0,0 +1,168 @@
--- ecj-old/build.xml 2022-03-08 08:19:52.000000000 +0100
+++ ecj-new/build.xml 2024-02-13 04:59:44.328387227 +0100
@@ -25,9 +25,9 @@
<javac srcdir="${basedir}" destdir="${output}"
debuglevel="lines,source"
- debug="true"
- release="11">
- <compilerarg line="-Xlint:none --patch-module java.compiler=javax17api.jar"/>
+ debug="true" encoding="utf-8"
+ source="8" target="8">
+ <compilerarg line="-Xlint:none" value="-Xbootclasspath/p:javax17api.jar"/>
</javac>
<delete file="${basedir}/META-INF/MANIFEST.MF" failonerror="false"/>
--- ecj-old/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java 2022-03-08 08:19:50.000000000 +0100
+++ ecj-new/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() {
--- ecj-old/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 2022-03-08 08:19:50.000000000 +0100
+++ ecj-new/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;
diff -urEbwB ecj-old/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java ecj-new/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java
--- ecj-old/org/eclipse/jdt/internal/compiler/tool/EclipseCompilerImpl.java 2022-03-08 08:19:50.000000000 +0100
+++ ecj-new/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;
diff -urEbwB ecj-old/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java ecj-new/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
--- ecj-old/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java 2022-03-08 08:19:50.000000000 +0100
+++ ecj-new/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() {
--- ecj-old/org/eclipse/jdt/internal/compiler/util/Util.java 2022-03-08 08:19:52.000000000 +0100
+++ ecj-new/org/eclipse/jdt/internal/compiler/util/Util.java 2024-02-13 04:59:18.222252584 +0100
@@ -234,6 +234,7 @@
String displayString(Object o);
}
+ private static final int DEFAULT_READING_SIZE = 8192;
private static final int DEFAULT_WRITING_SIZE = 1024;
public final static String UTF_8 = "UTF-8"; //$NON-NLS-1$
public static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
@@ -469,7 +470,41 @@
* @throws IOException if a problem occurred reading the stream.
*/
public static byte[] getInputStreamAsByteArray(InputStream input) throws IOException {
- return input.readAllBytes(); // will have even slighly better performance as of JDK17+ see JDK-8264777
+ byte[] contents = new byte[0];
+ int contentsLength = 0;
+ int amountRead = -1;
+ do {
+ int amountRequested = Math.max(input.available(), DEFAULT_READING_SIZE); // read at least 8K
+
+ // resize contents if needed
+ if (contentsLength + amountRequested > contents.length) {
+ System.arraycopy(
+ contents,
+ 0,
+ contents = new byte[contentsLength + amountRequested],
+ 0,
+ contentsLength);
+ }
+
+ // read as many bytes as possible
+ amountRead = input.read(contents, contentsLength, amountRequested);
+
+ if (amountRead > 0) {
+ // remember length of contents
+ contentsLength += amountRead;
+ }
+ } while (amountRead != -1);
+
+ // resize contents if necessary
+ if (contentsLength < contents.length) {
+ System.arraycopy(
+ contents,
+ 0,
+ contents = new byte[contentsLength],
+ 0,
+ contentsLength);
+ }
+ return contents;
}
@@ -479,7 +514,16 @@
* @throws IOException if a problem occurred reading the stream.
*/
public static byte[] readNBytes(InputStream input, int byteLength) throws IOException {
- return input.readNBytes(byteLength);
+ byte[] contents = new byte[byteLength];
+ int len = 0;
+ int readSize = 0;
+ while ((readSize != -1) && (len != byteLength)) {
+ // See PR 1FMS89U
+ // We record first the read size. In this case len is the actual read size.
+ len += readSize;
+ readSize = input.read(contents, len, byteLength - len);
+ }
+ return contents;
}
private static Map<String, byte[]> bomByEncoding = new HashMap<String, byte[]>();

39
ecj-rpmdebuginfo.patch Normal file
View File

@ -0,0 +1,39 @@
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v
retrieving revision 1.327
diff -u -r1.327 Main.java
--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 21 Apr 2008 15:00:59 -0000 1.327
+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 20 Nov 2008 19:26:57 -0000
@@ -3097,6 +3097,29 @@ public void configure(String[] argv) {
this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
}
+ {
+ // If we're building an RPM, force full debugging info to
+ // be generated, no matter what options have been passed
+ // by Ant. This is something of a kludge, but it is far
+ // better than the alternative, which is having class
+ // files with debug info mysteriously missing.
+
+ String RpmPackageName = System.getenv("RPM_PACKAGE_NAME");
+ String RpmArch = System.getenv("RPM_ARCH");
+ String RpmBuildRoot = System.getenv("RPM_BUILD_ROOT");
+ if (RpmPackageName != null && RpmArch != null && RpmBuildRoot != null) {
+ this.options.put(
+ CompilerOptions.OPTION_LocalVariableAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_LineNumberAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_SourceFileAttribute,
+ CompilerOptions.GENERATE);
+ }
+ }
+
this.logger.logCommandLineArguments(newCommandLineArgs);
this.logger.logOptions(this.options);

199
ecj.changes Normal file
View File

@ -0,0 +1,199 @@
-------------------------------------------------------------------
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 (bsc#1219862)
- Distribute the bundled javax17api.jar under maven coordinate of
org.eclipse:javax17api:17, so that it can be used if needed
-------------------------------------------------------------------
Mon Aug 21 11:46:03 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Upgrade to eclipse 4.23 ecj (jsc#PED-2979)
* No changelog was made available.
- Use the bundled javax17api.jar stubs, but don't distribute
them
- Removed patches:
* encoding.patch
+ handled by a simple sed run
* javaAPI.patch
+ not needed with this version
-------------------------------------------------------------------
Sun Mar 20 13:35:05 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* encoding.patch
+ the encoding needs to be set for all JDK versions
- Modified patch:
* ecj-rpmdebuginfo.patch
+ rediff
* javaAPI.patch
+ extract the encoding part to a separate patch
-------------------------------------------------------------------
Mon Oct 18 21:28:05 UTC 2021 - Marcel Witte <wittemar@googlemail.com>
- Upgrade to eclipse 4.18 ecj
* No changelog was made available.
- Switch java14api to java15api to be compatible to JDK 15
-------------------------------------------------------------------
Mon Oct 18 12:05:38 UTC 2021 - Marcel Witte <wittemar@googlemail.com>
- Upgrade to eclipse 4.17 ecj
* No changelog was made available.
- Removed patches:
* ecj-encoding.patch
* jdk10u-jdk8compat.patch
- Switch to JDK 11 for build a JDK 8 is not supported anymore by ecj
- Switch java10api to java14api to be compatible to JDK 14
-------------------------------------------------------------------
Wed Sep 25 12:22:02 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Upgrade to eclipse 4.12 ecj
* No changelog was made available.
- Removed patches:
* ecj-include-props.patch,
* eclipse-gcj-compat4.2.1.patch
* eclipse-gcj-nodummysymbol.patch
+ Unneeded for this version
- Added patches:
* ecj-encoding.patch
+ Fix build with java >= 9
* javaAPI.patch
+ When building with java < 9, add the java10api.jar and the
JRE's rt.jar to bootclasspath
* jdk10u-jdk8compat.patch
+ Patch out deprecation annotation not understood by the JDK
when building with java < 9
- Build the java.compiler module's javax.* packages as non-modular
java10api.jar, so that ecj can be compiled even with java < 9
- Distribute the java10api artifact for packages that might need
it
-------------------------------------------------------------------
Thu Nov 22 21:49:42 UTC 2018 - Fridrich Strba <fstrba@suse.com>
- Add one more maven artifact alias:
* org.eclipse.tycho:org.eclipse.jdt.compiler.apt
-------------------------------------------------------------------
Mon Oct 29 09:01:25 UTC 2018 - Fridrich Strba <fstrba@suse.com>
- Add two more maven artifact aliases:
* org.eclipse.jdt.core.compiler:ecj
* org.eclipse.jdt:ecj
-------------------------------------------------------------------
Mon Sep 18 23:02:42 UTC 2017 - fstrba@suse.com
- Don't build against the java-bootstrap package; it is gone
-------------------------------------------------------------------
Fri May 19 12:04:39 UTC 2017 - tchvatal@suse.com
- Fix build with javapackages-tools
-------------------------------------------------------------------
Thu Sep 10 10:06:40 UTC 2015 - tchvatal@suse.com
- Fix cycles on Leap which is 1315 same as SLE.
- Sort deps with spec-cleaner
-------------------------------------------------------------------
Fri Sep 19 07:36:41 UTC 2014 - dmacvicar@suse.de
- avoid cycles in Factory with Java 8
-------------------------------------------------------------------
Thu Sep 18 08:29:22 UTC 2014 - dmacvicar@suse.de
- Remove upstream git URL for MANIFEST.MF as it is not
versioned. File will change and Factory bots will
complain.
-------------------------------------------------------------------
Thu Sep 18 06:01:18 UTC 2014 - dmacvicar@suse.de
- restore bootstrap dependencies
- Restored patches and GCJ Main, as they are used
to bootstrap other packages.
* eclipse-gcj-compat4.2.1.patch
* eclipse-gcj-nodummysymbol.patch
- Removed obsolete ecj-native, as old SUSE package did
not had it and no package provides it
-------------------------------------------------------------------
Wed Sep 17 09:47:20 UTC 2014 - dmacvicar@suse.de
- clean spec file
-------------------------------------------------------------------
Mon Sep 15 14:09:09 UTC 2014 - dmacvicar@suse.de
- export NO_BRP_CHECK_BYTECODE_VERSION
-------------------------------------------------------------------
Mon Sep 15 12:33:11 UTC 2014 - dmacvicar@suse.de
- Update to ecj 4.2.1 (expected by tomcat 7.0.55+)
- Sync with Fedora ecj-4.4
- Drop gcj patches
* eclipse-gcj-nodummysymbol.patch
- Drop obsolete patches
* ecj-generatedebuginfo.patch : now done in spec
* eclipse-gcj-compat4.2.1.patch
* ecj-defaultto1.5.patch : we can use 1.6
-------------------------------------------------------------------
Wed Sep 3 14:38:14 UTC 2014 - tchvatal@suse.com
- Spec-cleaner
- BuildIgnore java-devel pkgs to avoid conflicts
-------------------------------------------------------------------
Wed Sep 3 05:42:52 UTC 2014 - coolo@suse.com
- on 13.2 and Factory build against bootstrap java
-------------------------------------------------------------------
Mon Sep 9 11:05:39 UTC 2013 - tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
-------------------------------------------------------------------
Fri May 31 16:44:10 UTC 2013 - varkoly@suse.com
- Fix the spec to avoid fileconflicts with ecj-bootstrap
-------------------------------------------------------------------
Mon Jan 21 13:43:25 UTC 2013 - mvyskocil@suse.com
- Update to ecj 4.2.1 (expected by tomcat 7.0.34+)
(no changelog provided, but it's normal for eclipse)
- sync with fedora 4.2.1-3
* ecj-defaultto1.5.patch - change the default -source to 1.5 to
match gcc-java capabilities
* ecj-generatedebuginfo.patch - generate debug info for java sources
* ecj-include-props.patch - package .props files too
* ecj-rpmdebuginfo.patch - hack, force debuginfo to be created when
RPM_BUILD_ROOT variable is defined
* eclipse-gcj-compat4.2.1.patch - disable all expected warning
* eclipse-gcj-nodummysymbol.patch - don't generate dummy entry in jars
* eclipse-jpackage-changelog.txt
-------------------------------------------------------------------
Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de
- Remove redundant/obsolete tags/sections from specfile
(cf. packaging guidelines)
-------------------------------------------------------------------
Thu Nov 22 10:52:43 CET 2007 - anosek@suse.cz
- new package, initial version 3.3

84
ecj.spec Normal file
View File

@ -0,0 +1,84 @@
#
# spec file for package ecj
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global eclipse_ver 4.23
%global bundle_ver 3.29.0
%global jar_ver %{eclipse_ver}
%global drop R-%{jar_ver}-202203080310
Name: ecj
Version: %{eclipse_ver}
Release: 0
Summary: Eclipse Compiler for Java
License: EPL-2.0 AND GPL-2.0-only WITH Classpath-exception-2.0
Group: Development/Libraries/Java
URL: https://www.eclipse.org
Source0: https://download.eclipse.org/eclipse/downloads/drops4/%{drop}/ecjsrc-%{jar_ver}.jar
Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/%{bundle_ver}/ecj-%{bundle_ver}.pom
# 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
BuildRequires: unzip
BuildArch: noarch
%description
ECJ is the Java bytecode compiler of the Eclipse Platform. It is also known as
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
mkdir -p scripts/binary/META-INF/
cp %{SOURCE2} scripts/binary/META-INF/MANIFEST.MF
%build
%{ant}
%install
# jar
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 ecj.jar %{buildroot}%{_javadir}/%{name}/ecj.jar
install -pm 0644 javax17api.jar %{buildroot}%{_javadir}/%{name}/javax17api.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
%{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}/ecj.pom
%add_maven_depmap %{name}/ecj.pom %{name}/ecj.jar -a "org.eclipse.jdt:core,org.eclipse.jdt.core.compiler:ecj,org.eclipse.tycho:org.eclipse.jdt.core,org.eclipse.tycho:org.eclipse.jdt.compiler.apt"
%add_maven_depmap org.eclipse:javax17api:17 %{name}/javax17api.jar -a "org.eclipse:java9api,org.eclipse:java10api:org.eclipse:java15api"
# Install the ecj wrapper script
%jpackage_script org.eclipse.jdt.internal.compiler.batch.Main '' '' ecj ecj true
# Install manpage
mkdir -p %{buildroot}%{_mandir}/man1
install -m 644 -p ecj.1 %{buildroot}%{_mandir}/man1/ecj.1
%files -f .mfiles
%license about.html
%{_bindir}/ecj
%{_mandir}/man1/ecj*
%changelog

BIN
ecjsrc-4.23.jar (Stored with Git LFS) Normal file

Binary file not shown.