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 151648 - Renaming a project using variable-based references gets red error marks
Summary: Renaming a project using variable-based references gets red error marks
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-28 23:12 UTC by giorgio42
Modified: 2013-01-15 16:08 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description giorgio42 2008-10-28 23:12:44 UTC
NB200810281401.
As already stated in IZ #150555, renaming a project that references a jar through the new variables mechanism
is marked as having errors after renaming because of wrong entries in nbproject/private/project.properties, like:
file.reference.log4j-1.2.14.jar=C:\\home\\a0796942\\projects\\experimental\\nb\\DesktopApplication3c\\${var.REPOSITORY}\\log4j\\jars\\log4j-1.2.14.jar

Steps:
1) Create basic desktop application.
2) Reference for instance log4j-1.2.14.jar through a REPSOSITORY (or some other) variable.
3) Use org.apache.logj4.Logger in some class of the project.
4) Rename the project.

Result:
a) Project is decorated with an error badge, because it cannot find log4j-1.2.14.jar anymore.
b) Usages of any log4j class in Java files are marked as errors.

But: project compiles and runs, Java files using log4j still compile!

Georg
Comment 1 giorgio42 2008-10-28 23:15:12 UTC
It seems that the ant-based build ignores the settings in nbproject/private/project.properties, while the NB project
implementation takes them into account. Don't know whether this is a good thing...
Comment 2 Jan Becicka 2008-10-29 11:00:39 UTC
Please evaluate. Thanks
Comment 3 Tomas Zezula 2008-10-29 11:03:22 UTC
The fix should be part of the first 65 patch.
Comment 4 Tomas Zezula 2008-10-29 14:35:55 UTC
ReferenceHelper.fixReferences () causes this problem.
Comment 5 David Konecny 2008-10-30 01:44:11 UTC
Re. "ReferenceHelper.fixReferences()" - first time I've seen this method. I think the method should ignore all absolute
path or paths starting with a variable in project.properties. It should try to update only relative paths pointing
outside of project folder (starting with "../") which otherwise would get broken by project copy/move.
Comment 6 Milan Kubec 2008-10-31 09:55:34 UTC
Fixed.

http://hg.netbeans.org/main/rev/f376623414ee
Comment 7 Milan Kubec 2008-10-31 10:01:39 UTC
Marking as fixed.
Comment 8 Quality Engineering 2008-10-31 16:31:16 UTC
Integrated into 'main-golden', will be available in build *200810311401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f376623414ee
User: Milan Kubec <mkubec@netbeans.org>
Log: #151648: references defined via properties won't be fixed in case the project is moved, copied, renamed
Comment 9 rbalada 2008-11-14 10:10:40 UTC
Please verify this issue so it can be included in NetBeans 6.5 Patch1
Comment 10 giorgio42 2008-11-14 22:24:47 UTC
I have tested this and it worked, but I got an intermittent exception (the dialog appeared and disappeared again almost
immediately), from the message.log:
SEVERE [org.openide.util.Exceptions]
java.io.SyncFailedException:
C:\home\a0796942\projects\experimental\nb\DesktopApplication1\nbproject\private\config.properties
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.createData(FolderObj.java:287)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.createDataImpl(FolderObj.java:245)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$1.call(FolderObj.java:215)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj$1.call(FolderObj.java:213)
        at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.runAsInconsistent(FileBasedFileSystem.java:112)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.createData(FolderObj.java:218)
        at org.openide.filesystems.FileUtil.copyFileImpl(FileUtil.java:365)
        at org.openide.filesystems.FileObject.copy(FileObject.java:121)
        at org.openide.filesystems.AbstractFileObject.copy(AbstractFileObject.java:641)
        at org.openide.filesystems.FileUtil.copyFile(FileUtil.java:426)
        at org.openide.filesystems.FileUtil.copyFile(FileUtil.java:441)
[catch] at org.netbeans.modules.java.j2seproject.J2SEProjectOperations.restoreConfigurations(J2SEProjectOperations.java:329)
        at org.netbeans.modules.java.j2seproject.J2SEProjectOperations.notifyMoved(J2SEProjectOperations.java:200)
        at
org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation$4.execute(DefaultProjectOperationsImplementation.java:396)
        at
org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation$6$1.run(DefaultProjectOperationsImplementation.java:655)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:573)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1005)




Comment 11 Tomas Danek 2008-11-19 14:03:39 UTC
verified in Product Version: NetBeans IDE Dev (Build 200811181401)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)
Userdir: /tmp/ud
Comment 12 rbalada 2008-11-19 15:24:12 UTC
I've transplanted the changeset http://hg.netbeans.org/main/rev/f376623414ee into release65_fixes repository as 
http://hg.netbeans.org/release65_fixes/rev/3980ffde6a55
Comment 13 Tomas Danek 2008-12-01 18:00:47 UTC
verified in 6.5 patch 1