jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x GWT Plugin
  • MGWT-115

Generate cleaner (w/r/t checkstyle, findbugs, pmd) *Async Utility class

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.1.0
  • Fix Version/s: 1.2
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

The Util class created during the generateAsync goal causes a lot of warnings for common static code analysis tools like Checkstyle, FindBugs, and PMD. Attached is a patch against r10656 which cleans up this utility class a bit. There still is work to be done where we are redundantly setting the service target if the service class already codes a @RemoteServiceRelativePath.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    cleaner-generate-async-util-class.patch
    10/Sep/09 12:41 PM
    3 kB
    jieryn

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
nicolas de loof added a comment - 11/Sep/09 2:24 AM

Your patch changes the initialisation principle to preemptively setup the RPC proxy before any call to getInstance.
Not sure this is a best practice : this may slow down the webUI initialization time with unecessary setup code execution

also, your patch makes the Util package visible, how can you use it from other code if not plublic ?

Anyway, you should configure your code analysis tools to exclude generated code (this plugin or any other). What if you don't use maven code style convention ?

Show
nicolas de loof added a comment - 11/Sep/09 2:24 AM Your patch changes the initialisation principle to preemptively setup the RPC proxy before any call to getInstance. Not sure this is a best practice : this may slow down the webUI initialization time with unecessary setup code execution also, your patch makes the Util package visible, how can you use it from other code if not plublic ? Anyway, you should configure your code analysis tools to exclude generated code (this plugin or any other). What if you don't use maven code style convention ?
Hide
Permalink
jieryn added a comment - 11/Sep/09 10:48 AM

I run with this Util definition on quite large projects with 30-40 users at any given time. I haven't seen personally or heard of any performance degradation from static initialization. This is mitigated almost entirely because of GWT.runAsync() code splitting, as the module will only be loaded when we need it anyway.

Util having package visibility is just fine. We use it via something like MyServiceAsync.Util.getInstance().invokeRpc(new AsyncCallback<....> {}); It works across packages without any problem.

Finally, it isn't possible with today's tools to have these services generated automatically and still have tools like Eclipse work properly. The target/generated-sources isn't a default source directory, nor is it added by maven-eclipse-plugin. This would require all my developers to add it manually, which is a royal pain. Instead, we just run the generateAsync goal with an output directory in the src/ folder.

Show
jieryn added a comment - 11/Sep/09 10:48 AM I run with this Util definition on quite large projects with 30-40 users at any given time. I haven't seen personally or heard of any performance degradation from static initialization. This is mitigated almost entirely because of GWT.runAsync() code splitting, as the module will only be loaded when we need it anyway. Util having package visibility is just fine. We use it via something like MyServiceAsync.Util.getInstance().invokeRpc(new AsyncCallback<....> {}); It works across packages without any problem. Finally, it isn't possible with today's tools to have these services generated automatically and still have tools like Eclipse work properly. The target/generated-sources isn't a default source directory, nor is it added by maven-eclipse-plugin. This would require all my developers to add it manually, which is a royal pain. Instead, we just run the generateAsync goal with an output directory in the src/ folder.
Hide
Permalink
nicolas de loof added a comment - 12/Sep/09 2:14 AM

Generating to src is a bad practice. I have target/generated-sources/gwt added in my eclipse conf both using m2eclipse or mvn eclipse:eclipse. Thos two eclipse integration run the generate-source phase and will get the folder detected.

Did you attach the generateAsync in default plugin execution ?

Show
nicolas de loof added a comment - 12/Sep/09 2:14 AM Generating to src is a bad practice. I have target/generated-sources/gwt added in my eclipse conf both using m2eclipse or mvn eclipse:eclipse. Thos two eclipse integration run the generate-source phase and will get the folder detected. Did you attach the generateAsync in default plugin execution ?
Hide
Permalink
nicolas de loof added a comment - 18/Sep/09 2:02 AM

some code improvements (private constructor, final keyword) but keeping original desing

generated code MUST be excluded from code analysis.

Show
nicolas de loof added a comment - 18/Sep/09 2:02 AM some code improvements (private constructor, final keyword) but keeping original desing generated code MUST be excluded from code analysis.

People

  • Assignee:
    nicolas de loof
    Reporter:
    jieryn
Vote (0)
Watch (0)

Dates

  • Created:
    10/Sep/09 12:41 PM
    Updated:
    06/Sep/10 6:34 AM
    Resolved:
    18/Sep/09 2:02 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.