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 228700

Summary: Text files that contain form-feed characters are marked as binary files
Product: platform Reporter: Vladimir Voskresensky <vv159170>
Component: Data SystemsAssignee: Jaroslav Tulach <jtulach>
Status: VERIFIED FIXED    
Severity: normal CC: jhavlin, mmirilovic
Priority: P2    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed Patch
Proposed Patch + Test

Description Vladimir Voskresensky 2013-04-18 11:32:58 UTC
For some reasons in pure C++ NB I can not open occurrences found in FormFeed.java file, while in pure J2SE NB version I can not open occurrences found in FormFeed.c 
The problem is in TextDetail.prepareLine function
dobj.getLookup().lookup(LineCookie.class); returns null for FormFeed.java file, because instance of dobj is DefaultDataObject
Comment 1 Vladimir Voskresensky 2013-04-18 11:33:38 UTC
mentioned files are from issue #228557
https://netbeans.org/bugzilla/attachment.cgi?id=133498
Comment 2 Vladimir Voskresensky 2013-04-18 11:34:42 UTC
btw, FormFeed.txt can not be opened neither from C++ nor from J2SE versions
Comment 3 Vladimir Voskresensky 2013-04-18 11:35:20 UTC
Jaroslav, can you evaluate, please
Comment 4 Jaroslav Havlin 2013-04-18 12:00:26 UTC
When I try to open FormFeed.txt from the Favorites view, a dialog appears that says "This file appears to contain binary data. Are you sure you want to open it in the text editor?" That seems to be the problem. Maybe the line-feed character causes this, or maybe there are some other "suspicious" characters.
Comment 5 Vladimir Voskresensky 2013-04-18 12:19:02 UTC
in my case I do not see any dialogs at all. Just dbl-click and nothing happens
Comment 6 Vladimir Voskresensky 2013-04-18 12:20:29 UTC
and you are right. Dbl-click from Favorites asks mentioned question
Comment 7 Vladimir Voskresensky 2013-04-18 12:22:45 UTC
probably this time issue is in openide.text component (or who is owner of mentioned message?) and it just doesn't support \f ?
Comment 8 Vladimir Voskresensky 2013-04-18 12:23:25 UTC
I've checked and file doesn't have any other 'special' symbols, only FormFeed
Comment 9 Jaroslav Havlin 2013-04-18 13:51:34 UTC
Created attachment 133570 [details]
Proposed Patch

Patch for module openide.loaders that fixes the problem.
Comment 10 Jaroslav Havlin 2013-04-18 13:58:25 UTC
(In reply to comment #8)
> I've checked and file doesn't have any other 'special' symbols, only FormFeed
Thank you, so form-feed is the only problem in the file.

Reassigning to platform/Data Systems.
Jarda, please check the patch. If it's OK, feel free to assign the issue back to me, I'll integrate it.
Thank you in advance.
Comment 11 Jaroslav Tulach 2013-04-19 04:27:08 UTC
Patch is OK, but it also needs an associated test case.
Comment 12 Jaroslav Havlin 2013-04-19 17:36:42 UTC
Created attachment 133606 [details]
Proposed Patch + Test

(In reply to comment #11)
> Patch is OK, but it also needs an associated test case.
Thank you. Test case added.
Comment 13 Jaroslav Tulach 2013-04-23 14:02:05 UTC
ergonomics#33c17dfcb43c
Comment 14 Vladimir Voskresensky 2013-04-26 11:14:31 UTC
Jarda, I can not verify this bug, because 
http://deadlock.netbeans.org/hudson/job/push-ergonomics/
doesn't propagate changes since 28 March (and I don't have permissions to start job)
Comment 15 Quality Engineering 2013-04-28 02:19:40 UTC
Integrated into 'main-golden', will be available in build *201304272301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/33c17dfcb43c
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #228700: Fix and test by Jaroslav Havlin: Ignore \f
Comment 16 Vladimir Voskresensky 2013-04-30 13:49:07 UTC
verified. Please, integrate.
Thanks!
Vladimir.
Comment 17 Marian Mirilovic 2013-05-07 07:44:20 UTC
Jarda, 
please proceed with integration into release73 today ! Thanks in advance.
Comment 18 Jaroslav Tulach 2013-05-07 08:11:51 UTC
$ hg exp 33c17dfcb43c | patch -p1 && hg ci -m "Backport of #228700 to 7.3 version"
$ hg tip
changeset:   cf212ae48340
branch:      release73
tag:         tip
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Tue May 07 10:11:29 2013 +0200
summary:     Backport of #228700 to 7.3 version
Comment 19 Quality Engineering 2013-05-08 02:01:36 UTC
Integrated into 'releases', will be available in build *201305072358* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/cf212ae48340
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: Backport of #228700 to 7.3 version
Comment 20 Tomas Danek 2013-05-10 13:51:52 UTC
mentioned file is now opened without any question, verified in 7.3 + patch2
Product Version: NetBeans IDE 7.3.1 (Build 201305082200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.3
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.3