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 38368 - Allow loading resources from root package
Summary: Allow loading resources from root package
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
Depends on: 157739
Blocks:
  Show dependency tree
 
Reported: 2004-01-02 21:55 UTC by David Strupl
Modified: 2009-12-02 08:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch against trunk 2004/02/17 (6.02 KB, patch)
2004-02-17 15:25 UTC, David Strupl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2004-01-02 21:55:52 UTC
As discussed on nbdev here:
http://www.netbeans.org/servlets/ReadMsg?msgId=598818&listName=nbdev
And partially implemented here:
http://www.netbeans.org/source/browse/core/bootstrap/src/org/netbeans/ProxyClassLoader.java.diff?r1=1.8.52.1&r2=1.8.52.2

it should be possible to load resources from the
root package. A warning should be logged about the
access.
Comment 1 Milos Kleint 2004-01-03 16:36:47 UTC
another (later) discussion is here:
http://openide.netbeans.org/servlets/ReadMsg?msgId=647701&listName=dev

I have tried to search my local maven repository and figured that
there are quite a lot of projects which put files in the default
package. I haven't investigated how these files are accessed from the
code though.

projects include:
Eg. checkstyle, latka, findbugs, isorelax, java2html, jcoverage, jdom,
junit, junit-doclet, simian

and all the maven plugins have multiple files in the default package.

I'm not saying these would fail when attempting to use within Nb,
however it is another minor argument for allowing it, (with warning
logging as suggested)
Comment 2 Milos Kleint 2004-01-04 15:07:48 UTC
entered a bug report against maven:
 http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-1107


Comment 3 David Strupl 2004-02-17 15:25:31 UTC
Created attachment 13475 [details]
Patch against trunk 2004/02/17
Comment 4 David Strupl 2004-02-17 15:28:40 UTC
Please review the attached patch. If there are no objections I plan to
apply the patch ASAP. Thanks for your help.
Comment 5 Jesse Glick 2004-02-17 17:47:25 UTC
Probably the message in printDefaultPackageWarning should link to

http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/classpath.html

(add an HTML anchor to jump right to the answer).

Otherwise the patch looks good to me. o.n.c.modules tests pass with
it, I hope?
Comment 6 David Strupl 2004-02-18 22:27:17 UTC
Yes the tests pass (at least on my linux box).
I have applied the (slightly modified according to your comments)
patch to the trunk:

Checking in openide/api/doc/org/openide/doc-files/classpath.html;
/cvs/openide/api/doc/org/openide/doc-files/classpath.html,v  <-- 
classpath.html
new revision: 1.18; previous revision: 1.17
done
Processing log script arguments...
More commits to come...
Checking in core/arch/arch-core-launcher.xml;
/cvs/core/arch/arch-core-launcher.xml,v  <--  arch-core-launcher.xml
new revision: 1.16; previous revision: 1.15
done
Processing log script arguments...
More commits to come...
Checking in core/bootstrap/src/org/netbeans/ProxyClassLoader.java;
/cvs/core/bootstrap/src/org/netbeans/ProxyClassLoader.java,v  <-- 
ProxyClassLoader.java
new revision: 1.10; previous revision: 1.9
done
Comment 7 Jesse Glick 2004-02-18 23:37:34 UTC
Thanks David, looks fine.

Milos could you check whether the Maven bug was actually fixed
correctly? It is marked fixed but the comment log is confusing, esp.

http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-1107#action_15677
Comment 8 Milos Kleint 2004-02-20 08:59:16 UTC
I've checked the webcvs for maven and from what I found, I think they
fixed it by prepending a slah to the file location.
so instead of having 'driver.properties', yhey have
'/driver.properties' now..
http://cvs.apache.org/viewcvs.cgi/maven/src/java/org/apache/maven/MavenConstants.java?r1=1.30.4.2&r2=1.30.4.3

If I find time over the weekend, I will try to bundle the maven jars
as a module and see what happens. will keep you updated.
Comment 9 Jesse Glick 2004-02-20 09:04:44 UTC
Well /driver.properties is of course no different (perhaps even wrong,
for ClassLoader.getResource), so I guess they did not fix it at all.
Comment 10 Marian Mirilovic 2005-07-13 13:23:21 UTC
closed
Comment 11 Quality Engineering 2009-08-21 06:19:10 UTC
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/324595be51ad
User: Jesse Glick <jglick@netbeans.org>
Log: Removing default package warning (from #38368).
Usually from 3rd-party code, usually impractical to remove now however poor an idea it was originally.
(*.properties warnings were already suppressed, but generalizing to checkstyle.xml etc.)