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.

Bug 49685

Summary: Provide package from a given class
Product: java Reporter: Radko Najman <rnajman>
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED WONTFIX    
Severity: blocker Keywords: API
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 45108    

Description Radko Najman 2004-09-29 14:05:32 UTC
In webapps project wizard we need to get package
from java file. It would be useful to have an API
method for this.

Comments from Jesse (to our current very simple
implementation):
Please also file an RFE for there to be an API in
java/project to do this. The implementation here
is clearly not correct in all cases; should not be
so hard to do it right with a tokenizer that
understands just whitespace, block comments, line
comments, 'package', identifiers, and ';'. It
should be done in one central location and heavily
tested. (Useful also for wizards in various modules.)
Comment 1 Jesse Glick 2004-09-29 16:06:18 UTC
*** Issue 49683 has been marked as a duplicate of this issue. ***
Comment 2 Tomas Zezula 2005-03-23 12:20:06 UTC
There are already 2 APIs doing this.
ClassPath API and Javacore.
if you have file use classpath API and ClassPath.getResourcename () method.
If you have Resource use javacore.