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 - Provide package from a given class
Summary: Provide package from a given class
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Tomas Zezula
Keywords: API
: 49683 (view as bug list)
Depends on:
Blocks: 45108
  Show dependency tree
Reported: 2004-09-29 14:05 UTC by Radko Najman
Modified: 2005-03-23 12:20 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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
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.