This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | ClassCastException in NbEvents when using org.netbeans.modules.jnlpmodules.ClasspathModule | ||
---|---|---|---|
Product: | installer | Reporter: | David Strupl <dstrupl> |
Component: | Code | Assignee: | David Strupl <dstrupl> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jglick |
Priority: | P4 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
David Strupl
2007-09-10 20:45:51 UTC
Will do it myself. IDE: [10.9.07 21:48] Committing "NbEvents.java" started Checking in NbEvents.java; /cvs/core/startup/src/org/netbeans/core/startup/NbEvents.java,v <-- NbEvents.java new revision: 1.18; previous revision: 1.17 done IDE: [10.9.07 21:48] Committing "NbEvents.java" finished I am uncomfortable with the patch. What is the actual type of args[1], if not Set<File>? Who is passing a different type? The only usage of EXTENSION_MULTIPLY_LOADED I see is in StandardModule, which passes a Set<File>. Its definition in Events also defines it to use Set<File> specifically. installer/jnlp/modules/src/org/netbeans/modules/jnlpmodules/ClasspathModule.java passes a Set<String>, which is illegal and should be fixed, but should not result in a CCE with the current code (which does not check the type of set members, and due to erasure-based generics). Feel free to revert if you like. I have to fix installer/jnlp/modules/src/org/netbeans/modules/jnlpmodules/** anyway since changes by Petr Nejedly has broken them even more. Enforcing type safety using JavaDoc comment is not the best style IMHO and I thought that I could also ride on this hack wave a bit ;-) If you do revert please mention it here (and close this issue) so I know that I have to look at the ClasspathModule's logging errors. BTW Events creation is hardcoded so I have to either use the NbEvents or not to use it at all ... I reverted: Checking in core/startup/src/org/netbeans/core/startup/NbEvents.java; /shared/data/ccvs/repository/core/startup/src/org/netbeans/core/startup/NbEvents.java,v <-- NbEvents.java new revision: 1.19; previous revision: 1.18 done Looking at it again, it seems that the immediate cause of the CCE is in fact passing a String for a File in args[0], not the Set in args[1]. I don't like using Javadoc for type safety either, but Java lacks proper dependent types. Better would perhaps be to create a class Event with a package-private no-arg constructor and one subclass per event with a type-safe public constructor and getters. Fixed in ClasspathModule: Checking in ClasspathModule.java; /cvs/installer/jnlp/modules/src/org/netbeans/modules/jnlpmodules/ClasspathModule.java,v <-- ClasspathModule.java new revision: 1.9; previous revision: 1.8 done |