Default constructors get wrong signature with AspectJ instrumentation

Description

If a class has no constructor and the default no-arg constructor is added, it is publicly visible. Unfortunately, this does not work with Kiekers AspectJ monitoring.

The small example https://github.com/DaGeRe/constructorProblem demonstrates the problem: When instrumenting `C0_0` with no constructor, the signatures are `de.peass.C0_0.<init>()` instead of `public de.peass.C0_0.<init>()`.

Since I do not see any change to the signature from AspectJ in https://github.com/kieker-monitoring/kieker/blob/master/kieker-monitoring/src/kieker/monitoring/probe/aspectj/operationExecution/AbstractOperationExecutionAspect.java I suppose this is an internal problem of AspectJ.

Can you confirm this problem? If this is the case, I would create an issue in the AspectJ tracker.

Activity

Show:
David Georg Reichelt
January 26, 2021, 2:28 PM

This was not an error, AspectJ just behave like the Java 8 language specification states: “The default constructor has the same accessibility as the class”

Invalid

Assignee

Andre van Hoorn

Reporter

David Georg Reichelt

Labels

None

External issue ID

None

Components

Affects versions

Priority

Medium