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 240180

Summary: AssertionError: Need to normalize /Users/YTN/NetBeansProjects/SpotifyPuzzles/build/classes/spotifypuzzles/zipfsong.class(class java.io.File) was /Users/YTN/NetBeansProjects/SpotifyPuzzles/build/classe
Product: platform Reporter: ytn01
Component: FilesystemsAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal CC: egeek, exceptions_reporter, fresler, michal.owsiak, sanantone, sflemming, ytn01
Priority: P3    
Version: 8.0   
Hardware: All   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter: 186293
Attachments: stacktrace
stacktrace
stacktrace
Artificial Test Case
Possible fix

Description ytn01 2014-01-10 04:00:59 UTC
Build: NetBeans IDE Dev (Build 201401090002)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Mac OS X

User Comments:
ytn01: Run my current java class.
Maximized the editor window, then run the inspector.
Corrected reported issues.
Switched to another application (firefox),... then switched back to NetBeans.
Exception was thrown.

fresler: I swtched back to Netbeans from another application.




Stacktrace: 
java.lang.AssertionError: Need to normalize /Users/YTN/NetBeansProjects/SpotifyPuzzles/build/classes/spotifypuzzles/zipfsong.class(class java.io.File) was /Users/YTN/NetBeansProjects/SpotifyPuzzles/build/classes/spotifypuzzles/Zipfsong.class(class java.io.File)
   at org.openide.filesystems.FileUtil.assertNormalized(FileUtil.java:153)
   at org.openide.filesystems.FileUtil.toFile(FileUtil.java:829)
   at org.netbeans.modules.versioning.core.api.VCSFileProxy.createFileProxy(VCSFileProxy.java:168)
   at org.netbeans.modules.versioning.masterfs.FilesystemInterceptor.fileChanged(FilesystemInterceptor.java:135)
   at org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEventImpl(FCLSupport.java:178)
   at org.openide.filesystems.FCLSupport$DispatchEventWrapperMulti.dispatchAllEventsSync(FCLSupport.java:248)
Comment 1 ytn01 2014-01-10 04:01:01 UTC
Created attachment 143768 [details]
stacktrace
Comment 2 ytn01 2014-01-10 04:03:44 UTC
Created attachment 143769 [details]
stacktrace

Switched back to netbeas after working on my browser.
Comment 3 Exceptions Reporter 2014-01-10 04:03:48 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=186293
Comment 4 ytn01 2014-01-10 04:15:44 UTC
Created attachment 143770 [details]
stacktrace

Switched to netbeans which was in the background, after working on a web browser.
Comment 5 Jaroslav Havlin 2014-01-17 11:02:50 UTC
File name zipfsong.class (lower case 'z') was used instead of Zipfsong.class (upper case 'Z'). Which of the names is correct?

Did you work with the file in some other application or process in parallel?
Thank you for reporting.
Comment 6 Jaroslav Havlin 2014-01-20 07:49:54 UTC
*** Bug 240674 has been marked as a duplicate of this bug. ***
Comment 7 Jaroslav Havlin 2014-01-20 08:12:34 UTC
*** Bug 240659 has been marked as a duplicate of this bug. ***
Comment 8 Jaroslav Havlin 2014-01-21 14:23:13 UTC
*** Bug 240769 has been marked as a duplicate of this bug. ***
Comment 9 Jaroslav Havlin 2014-01-24 08:18:56 UTC
*** Bug 240904 has been marked as a duplicate of this bug. ***
Comment 10 Jaroslav Havlin 2014-01-24 13:26:20 UTC
Created attachment 144341 [details]
Artificial Test Case

I've been able to reproduce the bug only in a test case which seems quite artificial.
If we change case of a file name while the original name is stored in FileObj instance, the assertNormalized will fail (see attached patch).

(However, detection of changed filename case can be costly. Currently we just use File.exists to check file validity during refresh. If we also had to compare canonical names, it would affect performance.)

I haven't managed to reproduce the bug manually in the IDE yet.

It would be very helpful to have real steps to reproduce. So, please, provide any addition information. Thank you.
Comment 11 Jaroslav Havlin 2014-01-29 12:06:24 UTC
*** Bug 241110 has been marked as a duplicate of this bug. ***
Comment 12 Jaroslav Havlin 2014-01-31 16:15:13 UTC
I've managed to reproduce the bug on Mac OS X.

Steps:

1. Open or create a Java project
2. Create file NewClass.java
3. Clean and build
4. Rename NewClass.java to Newclass.java (uppercase C to lowercase c)
5. Clean and build
Comment 13 Jaroslav Havlin 2014-02-10 07:15:09 UTC
*** Bug 241587 has been marked as a duplicate of this bug. ***
Comment 14 Jaroslav Havlin 2014-02-10 13:49:03 UTC
Created attachment 144988 [details]
Possible fix

A patch that seems to be working fine. But it needs to be tested carefully.
It makes refreshing slower (comparing with normalized names), and some tests fail.
Comment 15 Jaroslav Havlin 2014-02-11 07:45:22 UTC
http://hg.netbeans.org/core-main/rev/3b82f107959b
Making assertNormalized less strict in some cases on Mac.
Thank you for reporting.
Comment 16 Ondrej Vrabec 2014-02-11 10:35:43 UTC
*** Bug 241683 has been marked as a duplicate of this bug. ***
Comment 17 Quality Engineering 2014-02-12 02:41:32 UTC
Integrated into 'main-silver', will be available in build *201402120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3b82f107959b
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #240180: AssertionError: Need to normalize - Letter case problems on Mac
Comment 18 Milos Kleint 2014-02-13 14:24:25 UTC
*** Bug 241685 has been marked as a duplicate of this bug. ***
Comment 19 Jaroslav Havlin 2014-02-17 15:32:16 UTC
*** Bug 241843 has been marked as a duplicate of this bug. ***
Comment 20 Jaroslav Havlin 2014-02-20 14:39:01 UTC
*** Bug 242112 has been marked as a duplicate of this bug. ***
Comment 21 Jaroslav Havlin 2014-02-26 05:37:46 UTC
*** Bug 242216 has been marked as a duplicate of this bug. ***
Comment 22 Jaroslav Havlin 2014-02-26 05:39:03 UTC
*** Bug 242280 has been marked as a duplicate of this bug. ***
Comment 23 Jaroslav Havlin 2014-02-27 07:12:26 UTC
*** Bug 242378 has been marked as a duplicate of this bug. ***
Comment 24 Jaroslav Havlin 2014-04-04 07:58:53 UTC
*** Bug 243326 has been marked as a duplicate of this bug. ***