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: | NbBundle.getMessage format pattern should not be used in module w/o dep on org.openide.util | ||
---|---|---|---|
Product: | guibuilder | Reporter: | Geertjan Wielenga <geertjan> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | NEW --- | ||
Severity: | normal | CC: | asenk, jglick, mienamoo, tingJava2013, tzezula |
Priority: | P3 | ||
Version: | 7.0.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 213683 | ||
Bug Blocks: |
Description
Geertjan Wielenga
2011-03-09 14:05:39 UTC
You do not always need a dep on org.openide.util and none should be added until one is needed. It is the responsibility of the form editor to not create code referencing org.openide.util.NbBundle when it is not accessible. In the short term, this probably means just disabling this I18N message pattern when ClassPath.getClassPath(form, COMPILE).findResource("org/openide/util/NbBundle.class") == null. Better would be to add the dep as needed. In an Ant-based module project, ProjectClassPathModifier may be used for this purpose, if you add a Library with a classpath volume jar:nbinst://org.openide.util/lib/org-openide-util.jar!/ for example. For a Maven-based module project, I think you would need a Library with a maven-pom volume http://bits.netbeans.org/maven2/org/netbeans/api/org-openide-util/RELEASE691/org-openide-util-RELEASE691.pom or similar, though it could likely be made to understand the URL form used for Ant-based projects too. (There is also org.netbeans.modules.apisupport.project.spi.NbModuleProvider.getDependencyVersion/addDependency but that is only available as a friend API.) There probably needs to be some more general method in ProjectClassPathModifier such as public static boolean add/removeAPI(String apiClass, FileObject projectArtifact, String classPathType) throws IOException, UnsupportedOperationException; which would allow the caller to specify just "org.openide.util.NbBundle" and leave it up to the implementation to decide exactly where to find this dependency and which version to use. *** Bug 201628 has been marked as a duplicate of this bug. *** *** Bug 201872 has been marked as a duplicate of this bug. *** From user's point of view, the dependency on org.openide.util should be added as needed. Similarly also org.openide.awt to support Mnemonics (bug 70944). *** Bug 213672 has been marked as a duplicate of this bug. *** *** Bug 238857 has been marked as a duplicate of this bug. *** |