Manfred Hanke

Results 76 comments of Manfred Hanke

[`javaClass.getMethodCallsToSelf`](https://www.javadoc.io/doc/com.tngtech.archunit/archunit/latest/com/tngtech/archunit/core/domain/JavaClass.html#getMethodCallsToSelf()) is about actual invocations of the method on an instance. Do you want to prevent that additional public methods are declared, or just that they are used? #1040 will...

Sorry, I had initially thought that the overwritten methods wouldn't matter and that the simple rule would be enough. My new suggestion is unfortunately more complex (but reports violations for...

Feature idea: Wouldn't it be nice if `JavaMethod` had a method `hasSameSignatureAs(JavaMethod other)`, allowing us to simplify: ```diff - boolean notAllowed = allowedMethods.stream().noneMatch(allowedMethod -> - method.getName().equals(allowedMethod.getName()) && - method.getParameterTypes().equals(allowedMethod.getParameterTypes()) -...

> I faced issues with your code on fetching allowedMethods. Which issues did you face? > ```java > Set allowedMethods = classes.stream() > .filter(clazz -> clazz.isAssignableTo(IQueryHandler.class)) > .flatMap(clazz -> clazz.getAllMethods().stream().filter(modifier(PUBLIC)))...

I had added the warning `// Make sure that Object is imported, or this throws an IllegalArgumentException!` thinking that you might not import the `java.lang` package, but I didn't realize...

> I don't understand why we have to get `Object.class` from `JavaClasses` I thought that it should be allowed to override `equals(Object)`, `hashCode()` or `toString()` inherited from `java.lang.Object`. That's why...

> it is still throwing the same error Are you sure that you've imported the right `IQueryHandler` class? [The error message above](https://github.com/TNG/ArchUnit/issues/1103#issuecomment-1519846428) mention ``` com.XXXXXXXXX.XX.XXXX.XXXXXXXXXXXXX.XXXXXX.XXXX.IQueryHandler ``` whereas [the last screenshot](https://github.com/TNG/ArchUnit/issues/1103#issuecomment-1525337485)...

I don't know what `location` in your `new ClassFileImporter().importLocations(List.of(location))` is, but could it be that you're indeed only importing the nested class? It's expected that ArchUnit, when [dealing with missing...

Maybe you can use [`Runtime.getRuntime().addShutdownHook(deleteTempJars);`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)) with a suitable `Thread deleteTempJars`?

The idea of the shutdown hook is to define _your own_ `Thread` that does the necessary cleanup. It will be started when the JVM begins its shutdown sequence. (But note...