Skip to content

Commit

Permalink
Adjust OSGiWeavingAdaptor::weaveClass to AspectJ weaver changes
Browse files Browse the repository at this point in the history
Since 1.9.21.2, the AspectJ weaver, like other canonical Java
instrumentation agents, returns null, if nothing was woven. We
accommodate to that change here.
  • Loading branch information
kriegaex committed Apr 3, 2024
1 parent 8a67e3b commit 0383ce5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ public byte[] weaveClass(final String name, byte[] bytes,
}

synchronized (this) {
bytes = super.weaveClass(name, bytes, mustWeave);
byte[] wovenBytes = super.weaveClass(name, bytes, mustWeave);
// Since 1.9.21.2, the AspectJ weaver, like other canonical Java instrumentation agents, returns null,
// if nothing was woven. We accommodate to that change here.
if (wovenBytes != null)
bytes = wovenBytes;
}

((OSGiGeneratedClassHandler) this.generatedClassHandler)
Expand Down

0 comments on commit 0383ce5

Please sign in to comment.