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 32210 - Line.getDataObject()==null for .properties files
Summary: Line.getDataObject()==null for .properties files
Status: VERIFIED WORKSFORME
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 3.x
Hardware: Sun SunOS
: P1 blocker (vote)
Assignee: issues@utilities
URL:
Keywords:
Depends on: 32937
Blocks:
  Show dependency tree
 
Reported: 2003-03-24 03:53 UTC by Torbjorn Norbye
Modified: 2003-03-28 15:06 UTC (History)
0 users

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 Torbjorn Norbye 2003-03-24 03:53:03 UTC
In the tasklist module I frequently obtain a Line
object for various lines in files that I process.
I sometimes use the Line object to show the line,
or attach an annotation to it, and even showing
the filename and line number corresponding to the
Line.

But every now and then I've encountered some weird
problems after scanning an entire directory tree.

Today I tracked it down and figured out why: for
(some?) Bundle.properties files, the Line object
I'm given from Line.Set.getCurrent(), will return
null when I call getDataObject on it!!! 

I tried backtracking into the org.openide.text
package to see what's causing it, and saw method
names like getDataObjectHack(), so apparently this
is a shaky area. But I've never seen the problem
for regular java data objects (or html data
objects or xml data objects), so I think this is
specific to the properties data object.

If you need help reproducing this: select some
directory which contains a Bundle.properties file
which has a copyright that does not include the
current year; then in the Tools menu select Scan
Directory for Suggestions (you'll need the
tasklist modules installed for this). Now look in
the Copyright Problems section for an entry where
the filename is "null".
Comment 1 _ pkuzel 2003-03-24 09:48:36 UTC
It may be caused by fact that Bundle data object groups several files,
all of them in fact playing primary role. 

Properties LocaleNode cannot provide EditorCookie extends LineCookie
that returns data object for all instances. Line documentation permits
to return null.

I'm affraid that there does not exist a solution, it's similar to
issue 31061.
Comment 2 pfelenda 2003-03-28 15:06:30 UTC
Verified.