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.
Summary: | FileObject.setAttribute(<String>, <Method>) fails | ||
---|---|---|---|
Product: | platform | Reporter: | kaithos <kaithos> |
Component: | Filesystems | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews, jglick, jtulach |
Priority: | P1 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 196608 | ||
Bug Blocks: | 20169 | ||
Attachments: |
**Untested** Patch to fix the problem **Untested**
raw: & methodvalue: attributes methodvalue: and newvalue: prefixes supported |
Description
kaithos
2007-10-31 21:11:17 UTC
Created attachment 52194 [details]
**Untested** Patch to fix the problem **Untested**
I have added an untested patch which should fix the problem. I must stress that it is an untested patch though. If nothing else, it will serve to direct people to the location we believe the problem to reside. RFE, thanks for a patch Reassigning to new module owner jskrivanek. Strictly speaking, calling setAttribute(name, java.lang.reflect.Method m) is not correct because the value of getAttribute is the result of the method call, not the Method itself. However we have introduced some meta-attribute conventions, e.g. "class:" before an attribute name is interpreted as returning the impl j.l.Class rather than the actual object; perhaps we could do more, so that setAttribute("methodvalue:" + name, Method) would work. apisupport.project does something similar for the virtual FileSystem it uses to represent an XML source layer, so that it is possible to read and write the form of a FileObject attribute rather than its evaluated content. I like the idea. However rather than providing untested patch, can you provide a unit test? The proper file would be http://hg.netbeans.org/core-main/file/6d0fbf3731c2/openide.filesystems/test/unit/src/org/openide/filesystems/AttributesTestHidden.java while I am waiting for the patch, I change the state to won'tfix. Reopen when your patch is ready. Implementing something like this is useful prerequisite for fixing bug 20169. Created attachment 98195 [details]
raw: & methodvalue: attributes
Did you mean to link to bug #131951 in apichanges.xml? I don't think I follow the patch. Why are there both raw: and methodvalue: prefixes? To copy all attributes safely you would also need to handle newvalue (i.e. Class or Constructor) - or does this work already? Created attachment 103295 [details]
methodvalue: and newvalue: prefixes supported
Here is new patch that supports newvalue as well.
Re. "raw" I need some API between FileUtil and BinaryFS to ask for raw attribute (e.g. Method or Class). I've documented the API as private.
If there are no objections, I'd like to integrate tomorrow.
[JG01] Rather than putting a long explanation into apichanges.xml (and arch.xml), document the new feature properly in FileObject.setAttribute (and getAttribute, if its behavior is also changed - looks like it is not). core-main#bfaef9e6fa46 Integrated into 'main-golden', will be available in build *201011260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/bfaef9e6fa46 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #120724: methodvalue: and newvalue: prefixes for FileObject.setAttribute |