You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DescribeMojo.toLines() delegates to generated HelpMojo via fragile reflection #390
In src/main/java/org/apache/maven/plugins/help/DescribeMojo.java:747-778:
Method m = HelpMojo.class.getDeclaredMethod("toLines", String.class, Integer.TYPE, Integer.TYPE, Integer.TYPE);
m.setAccessible(true);
List output = (List) m.invoke(HelpMojo.class, text, indent, indentSize, lineLength);
HelpMojo is generated by maven-plugin-tools at compile time (in target/generated-sources/). It IS available at runtime, but this reflection is brittle: any change in the generated code toLines signature silently breaks all describe output formatting. The HelpMojo.toLines internally calls repeat() with new StringBuilder(repeat * str.length()) — a classic integer overflow risk that can throw NegativeArraySizeException.
Activity