Fix IllegalAccessException and NoSuchMethodException on startup#80
Merged
Fix IllegalAccessException and NoSuchMethodException on startup#80
Conversation
Owner
rostam
commented
Mar 16, 2026
- Settings: call f.setAccessible(true) before reflective field access so public fields on package-private extension classes (e.g. GProductAction, SubdividedGraphBase) are reachable across classloader boundaries.
- ExtensionLoader: skip abstract classes in loadExtension() to avoid NoSuchMethodException when scanning extension JARs for instantiable types.
- Settings: call f.setAccessible(true) before reflective field access so public fields on package-private extension classes (e.g. GProductAction, SubdividedGraphBase) are reachable across classloader boundaries. - ExtensionLoader: skip abstract classes in loadExtension() to avoid NoSuchMethodException when scanning extension JARs for instantiable types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Review Summary by QodoFix reflection exceptions in extension loading and settings persistence WalkthroughsDescription• Fix IllegalAccessException in Settings by calling setAccessible(true) on fields before reflective access • Skip abstract classes in ExtensionLoader to prevent NoSuchMethodException during extension scanning • Enable cross-classloader access to public fields on package-private extension classes Diagramflowchart LR
A["Extension Loading"] -->|Skip Abstract Classes| B["Avoid NoSuchMethodException"]
C["Field Reflection Access"] -->|Call setAccessible| D["Cross-Classloader Access"]
B --> E["Successful Extension Initialization"]
D --> E
File Changes1. src/graphtea/platform/extension/ExtensionLoader.java
|
Code Review by Qodo
1. Access error aborts loading
|
1. Remove 32 trivial checkParameters() { return null; } overrides — default already on Parametrizable
2. Clean up dead variables and commented-out experimental code in Estrada/LaplacianEstrada
3. Extract concatWithArrayCopy() to AlgorithmUtils.concatArrays(); remove 6 duplicate copies
4. Add AlgorithmUtils.getEccentricities(); eliminate duplicated max-distance loop in AllEccen,
TotalEccentricityIndex, EccentricityComplexityIndex; AllEccen now delegates to Eccentricity.eccentricity()
5. Introduce WienerIndexBase to consolidate FloydWarshall boilerplate and getCategory() across
WienerIndex, MWienerIndex, EccentricWienerIndex
6. Remove dead private edge_adj() methods from ZagrebCoindex, ZagrebCoindexSelectedEdges,
ZagrebIndexSelectedEdges (never called in those classes)
7. Override clear() in NotifiableAttributeSetImpl to fire attributeUpdated(name, old, null)
for each entry, consistent with the notification contract on put()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.