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: | Add support to Singleton TopComponents - @FactoryMethod | ||
---|---|---|---|
Product: | platform | Reporter: | AngeloD |
Component: | Options&Settings | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, mmirilovic |
Priority: | P1 | Keywords: | API_REVIEW_FAST |
Version: | 7.3 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
Introducing @FactoryMethod runtime annotation
To be applied tomorrow |
Description
AngeloD
2013-03-05 15:25:07 UTC
(Invalid) thought #1: I hoped that adding new attribute to @ConvertAsProperties will be enough: # This patch file was generated by NetBeans IDE # It uses platform neutral UTF-8 encoding and \n newlines. --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -92,4 +92,13 @@ * @return array of property names or {@link #IGNORE_ALL_CHANGES} to ignore all properties */ String[] ignoreChanges() default {}; + + /** Factory method to use instead of default constructor. Sometimes, + * for example when dealing with singletons, it may be desirable to + * control how an instance of given class is created. In such case + * one can create a factory method (takes no arguments and returns + * instance of desired type) in the class annotated by {@link ConvertAsProperties} + * annotation. + */ + String factoryMethod(); } but that is unlikely. The information is needed during runtime and it is complicated to encode it from @ConvertAsProperties processor, so runtime classes can use it. Created attachment 132222 [details]
Introducing @FactoryMethod runtime annotation
Angelo, can you confirm this change works for you? If so, I will: Y01 write apichanges.xml Y02 write annotation processor to verify "value" represents real method name I confirm the patch we applied works perfectly. Created attachment 132599 [details]
To be applied tomorrow
ergonomics#e7e9a8f3cea7 - when backporting to release73 don't forget to make sure the apichanges.xml matches the actual version of the module in release73 branch. Correction: 65cc8a1d6e39 is better changeset Integrated into 'main-golden', will be available in build *201303152300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e7e9a8f3cea7 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #227050: @FactoryMethod allows alternative creation, caching, singletonization of deserialized objects see regression in bug #227547 Integrated to release73 as 29ea29419c34 Looks like the release73 repository is messed up. "hg merge" does not work. Doing manual backport: $ hg up -C release73 $ hg diff -r release73_base:65cc8a1d6e39 | patch -p1 # modify versioning $ hg add . $ hg ci $ hg tip changeset: 9f7631d9947d branch: release73 tag: tip user: Jaroslav Tulach <jtulach@netbeans.org> date: Mon May 06 12:09:53 2013 +0200 summary: Manual backport of #227050 into 7.3.1 Integrated into 'releases', will be available in build *201305062200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/9f7631d9947d User: Jaroslav Tulach <jtulach@netbeans.org> Log: Manual backport of #227050 into 7.3.1 |