Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- 11
- 17
- 21
- 25
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tests can run against Java 25 after #1550.

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions archunit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ext.moduleName = 'com.tngtech.archunit'
dependencies {
api libs.slf4j
implementation libs.asm
implementation(libs.asmjdkbridge)
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }

testImplementation libs.log4j.api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Optional;
import java.util.Set;

import codes.rafael.asmjdkbridge.ProbingClassReader;
import com.tngtech.archunit.ArchConfiguration;
import com.tngtech.archunit.core.domain.JavaClass;
import com.tngtech.archunit.core.domain.JavaClassDescriptor;
Expand All @@ -40,7 +41,6 @@
import com.tngtech.archunit.core.importer.TryCatchRecorder.TryCatchBlocksFinishedListener;
import com.tngtech.archunit.core.importer.resolvers.ClassResolver;
import com.tngtech.archunit.core.importer.resolvers.ClassResolver.ClassUriImporter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Label;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -66,7 +66,7 @@ JavaClasses process(ClassFileSource source) {
try (InputStream s = location.openStream()) {
JavaClassProcessor javaClassProcessor =
new JavaClassProcessor(new SourceDescriptor(location.getUri(), md5InClassSourcesEnabled), classDetailsRecorder, accessHandler);
new ClassReader(s).accept(javaClassProcessor, 0);
new ProbingClassReader(s).accept(javaClassProcessor, 0);
javaClassProcessor.createJavaClass().ifPresent(importRecord::add);
} catch (Exception e) {
LOG.warn(String.format("Couldn't import class from %s", location.getUri()), e);
Expand Down Expand Up @@ -347,7 +347,7 @@ private static class UriImporterOfProcessor implements ClassUriImporter {
public Optional<JavaClass> tryImport(URI uri) {
try (InputStream inputStream = uri.toURL().openStream()) {
JavaClassProcessor classProcessor = new JavaClassProcessor(new SourceDescriptor(uri, md5InClassSourcesEnabled), declarationHandler);
new ClassReader(inputStream).accept(classProcessor, 0);
new ProbingClassReader(inputStream).accept(classProcessor, 0);
return classProcessor.createJavaClass();
} catch (Exception e) {
LOG.warn(String.format("Error during import from %s, falling back to simple import", uri), e);
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ assertj = "3.27.7"

[libraries]
asm = { group = "org.ow2.asm", name = "asm", version = "9.9.1" }
asmjdkbridge = { module = "codes.rafael.asmjdkbridge:asm-jdk-bridge", version = "0.0.13"}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not exactly a production-grade library. You may prefer to copy the code from it and own that yourself.

guava = { group = "com.google.guava", name = "guava", version = "33.5.0-jre" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version = "2.0.17" }
log4j_api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
Expand Down
Loading