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 231604

Summary: Refactor out o.n.m.j.c.method.*, o.n.m.j.c.method.impl.* from j2ee.common
Product: javaee Reporter: Martin Fousek <marfous>
Component: CodeAssignee: Martin Fousek <marfous>
Status: RESOLVED FIXED    
Severity: normal CC: dkonecny, mjanicek
Priority: P3    
Version: 7.3.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 230820    
Attachments: patch v1
patch v2
patch v3

Description Martin Fousek 2013-06-21 07:29:26 UTC
Created attachment 136109 [details]
patch v1

I was not able to do much magic in the first iteration. Guys, I'll really appreciate any advice/idea you would have. I'll speak about the API, I suppose that the IMPL classes and UI will move with the API.

In the  o.n.m.j.c.method.* packages there are three kinds of APIs:
1, FieldCustomizer (API + UI for field customizations)
2, MethodTree creation support
3, MethodCustomizer (API + UI for method customizations)

My suggestion is following:
1, Not used anywhere except ejbcore - I moved it there. I think that since it's used only in "AddCmpFieldAction" I vote for this feature removal and remove this part of API.

2, Hugely used by ejbcore also in up-to-date features and by additional 4 modules (JSF, WEBSVCes) - I would move it to j2ee.core.utilities. This utilities contains java model helpers. Big usage of these two classes shows that it has its sense to keep them. MethodModel can be turned into MethodTree and used by standard Java APIs for Java model craetion. In my opinion well documenter pack of helper methods. Also "org.netbeans.modules.j2ee.core.api.support.java.method" package makes sense to me. By time it can have sense to rewrite it in closer cooperation with GenerationUtils, but it will require additional long-term investigation whether it's possible at all.

3, Used by ejbcore and websvc modules. Helps to define methods (operations in case of WebSvc) into appropriate beans including their local/remote interfaces. That's something which looks to be still useful since local/remote interfaces are used. I moved that into the same package as in case Nr.2. It uses Java APIs but it's used specifically for JavaEE functionality - j2ee.core.utilities looks ideal to me.

I'm attaching patch with all changes I described except one: removal off AddCmpFieldAction feature. It's ejb1.4 specific feature, I would remove it.
Comment 1 Martin Janicek 2013-06-21 08:10:43 UTC
All sounds and look good to me. Only thing I have notice is an empty j2ee/core/support/java/method/Bundle.properties file. Is it needed?
Comment 2 Martin Fousek 2013-06-21 08:36:58 UTC
Created attachment 136114 [details]
patch v2

(In reply to comment #1)
> All sounds and look good to me. Only thing I have notice is an empty
> j2ee/core/support/java/method/Bundle.properties file. Is it needed?

Thanks for quick reply. Uf, it shouldn't be empty at all - that's good catch. :) It was wrongly copied. Into patch v2 I already removed the AddCmpField action.
Comment 3 Martin Fousek 2013-06-21 08:50:55 UTC
Created attachment 136118 [details]
patch v3

Sorry, broken patch, this one should be all right.
Comment 4 David Konecny 2013-06-23 21:53:05 UTC
Looks good to me too.
Comment 5 Martin Fousek 2013-06-24 05:52:51 UTC
(In reply to comment #4)
> Looks good to me too.

Thank you both for your comments. I built full cluster, ran commit-validation - let's see what everything it will break anyway. ;)

web-main #c291fe2c677d
Comment 6 Quality Engineering 2013-06-25 02:45:00 UTC
Integrated into 'main-golden', will be available in build *201306242301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c291fe2c677d
User: Martin Fousek <marfous@netbeans.org>
Log: #231604 - Refactor out o.n.m.j.c.method.*, o.n.m.j.c.method.impl.* from j2ee.common