-
Notifications
You must be signed in to change notification settings - Fork 20
Upgrade to 151 #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to 151 #157
Changes from all commits
7dde370
4779bd0
88dea52
b5c6fb8
bf6b1a4
f440a50
52c5dab
b900843
5b4459f
4ac85bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,32 +1,29 @@ | ||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi AS jdtls-download | ||||||||||||||||||
| WORKDIR /jdtls | ||||||||||||||||||
| RUN curl -s -o jdtls.tar.gz https://download.eclipse.org/jdtls/milestones/1.38.0/jdt-language-server-1.38.0-202408011337.tar.gz &&\ | ||||||||||||||||||
| RUN curl -s -o jdtls.tar.gz https://download.eclipse.org/jdtls/milestones/1.51.0/jdt-language-server-1.51.0-202510022025.tar.gz &&\ | ||||||||||||||||||
| tar -xvf jdtls.tar.gz --no-same-owner &&\ | ||||||||||||||||||
| chmod 755 /jdtls/bin/jdtls &&\ | ||||||||||||||||||
| rm -rf jdtls.tar.gz | ||||||||||||||||||
|
Comment on lines
1
to
6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chain🌐 Web query:
💡 Result: The 1.51.0 milestone artifacts are hosted on Eclipse's download site and include a .sha256 checksum file for jdt-language-server-1.51.0-202510022025.tar.gz (see the directory listing). I don't see a separate GPG/.asc signature listed for that file in the same directory. [1][2] Links:
If you want, I can fetch the .sha256 contents and/or walk you through verifying the checksum (sha256sum) and checking for a signature. 🌐 Web query:
💡 Result: Summary of flags and their fail-fast / error effects:
Notes on combined usage (e.g. curl -fsSL):
Exit codes / behavior:
If you want I can give a minimal example script showing robust error handling and retries using these flags. Sources: 🌐 Web query:
💡 Result: Direct download (tar.gz): SHA256 file: (These files are listed on the Eclipse JDT LS milestones page.) [1] Harden downloads and verify checksums for the JDTLS tarball. The -RUN curl -s -o jdtls.tar.gz https://download.eclipse.org/jdtls/milestones/1.51.0/jdt-language-server-1.51.0-202510022025.tar.gz &&\
+RUN curl -fsSLo jdtls.tar.gz https://download.eclipse.org/jdtls/milestones/1.51.0/jdt-language-server-1.51.0-202510022025.tar.gz &&\
tar -xvf jdtls.tar.gz --no-same-owner &&\
chmod 755 /jdtls/bin/jdtls &&\
rm -rf jdtls.tar.gzAdditionally, a
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| COPY jdtls-bin-override/jdtls.py /jdtls/bin/jdtls.py | ||||||||||||||||||
|
|
||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi AS maven-index | ||||||||||||||||||
| COPY hack/maven.default.index /maven.default.index | ||||||||||||||||||
|
|
||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi AS fernflower | ||||||||||||||||||
| RUN dnf install -y maven-openjdk17 wget --setopt=install_weak_deps=False && dnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| RUN wget --quiet https://github.com/JetBrains/intellij-community/archive/refs/tags/idea/231.9011.34.tar.gz -O intellij-community.tar && tar xf intellij-community.tar intellij-community-idea-231.9011.34/plugins/java-decompiler/engine && rm -rf intellij-community.tar | ||||||||||||||||||
| WORKDIR /intellij-community-idea-231.9011.34/plugins/java-decompiler/engine | ||||||||||||||||||
| RUN export JAVA_HOME=/usr/lib/jvm/java-17-openjdk | ||||||||||||||||||
| RUN ./gradlew build -x test && rm -rf /root/.gradle | ||||||||||||||||||
| RUN mkdir /output && cp ./build/libs/fernflower.jar /output | ||||||||||||||||||
|
|
||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi AS addon-build | ||||||||||||||||||
| RUN dnf install -y maven-openjdk17 && dnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| RUN dnf install -y java-21-openjdk-devel wget zip --nodocs --setopt=install_weak_deps=0 && dnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| RUN curl -fsSL -o /tmp/apache-maven.tar.gz https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz && \ | ||||||||||||||||||
| tar -xzf /tmp/apache-maven.tar.gz -C /usr/local/ && \ | ||||||||||||||||||
| rm /tmp/apache-maven.tar.gz | ||||||||||||||||||
|
Comment on lines
+19
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify the Maven download with a checksum. The Maven download uses proper curl flags but lacks integrity verification. Apache Maven releases include SHA512 checksums that should be verified before extraction. 🔎 Apply this diff to add checksum verification-RUN curl -fsSL -o /tmp/apache-maven.tar.gz https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz && \
+RUN curl -fsSL -o /tmp/apache-maven.tar.gz https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz && \
+ curl -fsSL -o /tmp/apache-maven.tar.gz.sha512 https://dlcdn.apache.org/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.tar.gz.sha512 && \
+ cd /tmp && sha512sum -c apache-maven.tar.gz.sha512 && \
tar -xzf /tmp/apache-maven.tar.gz -C /usr/local/ && \
- rm /tmp/apache-maven.tar.gz
+ rm /tmp/apache-maven.tar.gz /tmp/apache-maven.tar.gz.sha512📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| WORKDIR /app | ||||||||||||||||||
| COPY ./ /app/ | ||||||||||||||||||
| ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk | ||||||||||||||||||
| RUN mvn clean install -DskipTests=true | ||||||||||||||||||
|
|
||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi-minimal AS index-download | ||||||||||||||||||
| RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk | ||||||||||||||||||
| RUN /usr/local/apache-maven-3.9.12/bin/mvn clean install -DskipTests=true | ||||||||||||||||||
| # Download maven index data | ||||||||||||||||||
| WORKDIR /maven-index-data | ||||||||||||||||||
| RUN DOWNLOAD_URL=$(wget --quiet -O - https://api.github.com/repos/konveyor/maven-search-index/releases/latest | grep '"browser_download_url".*maven-index-data.*\.zip' | sed -E 's/.*"browser_download_url": "([^"]+)".*/\1/') && \ | ||||||||||||||||||
| wget --quiet ${DOWNLOAD_URL} -O maven-index-data.zip && \ | ||||||||||||||||||
|
|
@@ -35,27 +32,26 @@ RUN DOWNLOAD_URL=$(wget --quiet -O - https://api.github.com/repos/konveyor/maven | |||||||||||||||||
|
|
||||||||||||||||||
| FROM registry.access.redhat.com/ubi9/ubi-minimal | ||||||||||||||||||
| # Java 1.8 is required for backwards compatibility with older versions of Gradle | ||||||||||||||||||
| RUN microdnf install -y python39 java-1.8.0-openjdk-devel java-17-openjdk-devel tar gzip zip --nodocs --setopt=install_weak_deps=0 && microdnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk | ||||||||||||||||||
| RUN microdnf install -y python39 java-1.8.0-openjdk-devel java-21-openjdk-devel tar gzip zip --nodocs --setopt=install_weak_deps=0 && microdnf clean all && rm -rf /var/cache/dnf | ||||||||||||||||||
| ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk | ||||||||||||||||||
| # Specify Java 1.8 home for usage with gradle wrappers | ||||||||||||||||||
| ENV JAVA8_HOME /usr/lib/jvm/java-1.8.0-openjdk | ||||||||||||||||||
| RUN curl -fsSL -o /tmp/apache-maven.tar.gz https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz && \ | ||||||||||||||||||
| tar -xzf /tmp/apache-maven.tar.gz -C /usr/local/ && \ | ||||||||||||||||||
| ln -s /usr/local/apache-maven-3.9.11/bin/mvn /usr/bin/mvn && \ | ||||||||||||||||||
| rm /tmp/apache-maven.tar.gz | ||||||||||||||||||
| ENV M2_HOME /usr/local/apache-maven-3.9.11 | ||||||||||||||||||
| ENV M2_HOME /usr/local/apache-maven-3.9.12 | ||||||||||||||||||
|
|
||||||||||||||||||
| # Copy "download sources" gradle task. This is needed to download project sources. | ||||||||||||||||||
| RUN mkdir /root/.gradle | ||||||||||||||||||
| COPY ./gradle/build.gradle /usr/local/etc/task.gradle | ||||||||||||||||||
| COPY ./gradle/build-v9.gradle /usr/local/etc/task-v9.gradle | ||||||||||||||||||
| # Copy the maven index text file used to filter out open source libraries | ||||||||||||||||||
| COPY hack/maven.default.index /usr/local/etc/maven.default.index | ||||||||||||||||||
|
|
||||||||||||||||||
| COPY --from=jdtls-download /jdtls /jdtls/ | ||||||||||||||||||
| COPY --from=addon-build /usr/local/apache-maven-3.9.12/ /usr/local/apache-maven-3.9.12/ | ||||||||||||||||||
| RUN ln -s /usr/local/apache-maven-3.9.12/bin/mvn /usr/bin/mvn | ||||||||||||||||||
| COPY --from=addon-build /root/.m2/repository/io/konveyor/tackle/java-analyzer-bundle.core/1.0.0-SNAPSHOT/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar /jdtls/plugins/ | ||||||||||||||||||
| COPY --from=addon-build /root/.m2/repository/io/konveyor/tackle/java-analyzer-bundle.core/1.0.0-SNAPSHOT/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar | ||||||||||||||||||
| COPY --from=fernflower /output/fernflower.jar /bin/fernflower.jar | ||||||||||||||||||
| COPY --from=maven-index /maven.default.index /usr/local/etc/maven.default.index | ||||||||||||||||||
| COPY --from=index-download /maven-index-data/central.archive-metadata.txt /usr/local/etc/maven-index.txt | ||||||||||||||||||
| COPY --from=addon-build /maven-index-data/central.archive-metadata.txt /usr/local/etc/maven-index.txt | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN ln -sf /root/.m2 /.m2 && chgrp -R 0 /root && chmod -R g=u /root | ||||||||||||||||||
| CMD [ "/jdtls/bin/jdtls" ] | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import org.eclipse.lsp4j.SymbolKind; | ||
| public interface SymbolProvider { | ||
| public static final int MAX_PROBLEMS_TO_LOG = 10; | ||
| Object LOCATION_LOCK = new Object(); | ||
|
|
||
|
Comment on lines
32
to
35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid a publicly exposed lock object (interface field).
public interface SymbolProvider {
public static final int MAX_PROBLEMS_TO_LOG = 10;
- Object LOCATION_LOCK = new Object();
+ // NOTE: keep interface free of shared lock objects; prefer SymbolProviderLocks.LOCATION_LOCK.
+ @Deprecated(forRemoval = false)
+ Object LOCATION_LOCK = SymbolProviderLocks.LOCATION_LOCK;// new file in same package
final class SymbolProviderLocks {
static final Object LOCATION_LOCK = new Object();
private SymbolProviderLocks() {}
}🤖 Prompt for AI Agents |
||
| List<SymbolInformation> get(SearchMatch match) throws CoreException; | ||
|
|
||
|
|
@@ -98,7 +99,11 @@ default Location getLocation(IJavaElement element, SearchMatch match) throws Jav | |
| ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); | ||
| if (compilationUnit != null) { | ||
| logInfo("found compliation unit for match: " + match); | ||
| return JDTUtils.toLocation(compilationUnit, match.getOffset(), match.getLength()); | ||
| synchronized (LOCATION_LOCK) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to sync on this now?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmle there is a race condition where we might be working on the same compilation unit in two places, that causes intermittent failure in location resolution causing issues with line number 0. This fixes that. I can't find the issue about it (there is one somewhere), but I saw it in rulesets runs intermittently.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am absolutely open to doing this the right / idiomatic way btw. This is all I could think of.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get a copy of hte Compliation unit before working on it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shawn-hurley there's only one call in the api getWorkingCopy() which gets you whatevers open in the index at the time. I am not sure how to make a deep copy of it. |
||
| Location location = JDTUtils.toLocation(compilationUnit, match.getOffset(), match.getLength()); | ||
| logInfo("Returning location: " + location + " for match: " + match); | ||
| return location; | ||
| } | ||
| } | ||
| IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); | ||
| if (cf != null) { | ||
|
|
@@ -131,7 +136,9 @@ default Location getLocation(IJavaElement element, SearchMatch match) throws Jav | |
| } | ||
| Range range = null; | ||
| try { | ||
| range = toRange(cf, match.getOffset(), match.getLength()); | ||
| synchronized (LOCATION_LOCK) { | ||
| range = toRange(cf, match.getOffset(), match.getLength()); | ||
| } | ||
| } catch (Exception e) { | ||
| JavaLanguageServerPlugin.logException("Error generating range for class ", e); | ||
| return null; | ||
|
|
@@ -143,7 +150,9 @@ default Location getLocation(IJavaElement element, SearchMatch match) throws Jav | |
| try { | ||
| // This casting is safe or is assumed to be safer because the ToString on SearchMatch does it | ||
| logInfo("defaulting to regular toLocation for match: " + match); | ||
| return JDTUtils.toLocation(element); | ||
| synchronized (LOCATION_LOCK) { | ||
| return JDTUtils.toLocation(element); | ||
| } | ||
| } catch (Exception e) { | ||
| JavaLanguageServerPlugin.logException("Unable to determine location for the element " + element, e); | ||
| return null; | ||
|
|
@@ -198,7 +207,7 @@ default boolean queryQualificationMatches(String query, IJavaElement matchedElem | |
| // should consider parameter here | ||
| // e.g. java.nio.file.Paths.get(String)/java.nio.file.Paths.get(*) -> java.nio.file.Paths.get | ||
| // Remove any parentheses and their contents | ||
| query = query.replaceAll("\\(.*\\)", ""); | ||
| query = query.replaceAll("\\([^|]*\\)", ""); | ||
| query = query.replaceAll("(?<!\\.)\\*", ".*"); | ||
| String queryQualification = ""; | ||
| int dotIndex = query.lastIndexOf('.'); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <site> | ||
| <bundle id="java-rule-addon.core" version="0.0.0"> | ||
| <bundle id="java-analyzer-bundle.core" version="0.0.0"> | ||
| <category name="core"/> | ||
| </bundle> | ||
| <bundle id="java-rule-addon.test" version="0.0.0"> | ||
| <bundle id="java-analyzer-bundle.test" version="0.0.0"> | ||
| <category name="sdk" /> | ||
| </bundle> | ||
| <bundle id="java-rule-addon.core.source" version="0.0.0"> | ||
| <bundle id="java-analyzer-bundle.core.source" version="0.0.0"> | ||
| <category name="sdk" /> | ||
| </bundle> | ||
| <bundle id="java-rule-addon.test.source" version="0.0.0"> | ||
| <bundle id="java-analyzer-bundle.test.source" version="0.0.0"> | ||
| <category name="sdk" /> | ||
| </bundle> | ||
| <category-def name="core" label="java-rule-addon extension"/> | ||
| <category-def name="sdk" label="java-rule-addon extension (Developer Resources)"/> | ||
| <category-def name="core" label="java-analyzer-bundle extension"/> | ||
| <category-def name="sdk" label="java-analyzer-bundle extension (Developer Resources)"/> | ||
| </site> |
Uh oh!
There was an error while loading. Please reload this page.