Stripes

patch to remove warnings in eclipse 3.5

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: Release 1.5.2, Release 1.6
  • Component/s: None
  • Labels:
    None
  • Environment:
    using eclipse 3.5 and svn trunk

Description

I tend to like a build without any warnings. I just checked out the source code to stripes to check it out and found a bunch of areas where eclipse was throwing warnings. This patch just adds a bunch of <?> to the end of various places where eclipse 3.5 was complaining. I also use Eclipse Java->Save Actions to improve the look and feel of the source code without having to do any work. This created a slightly larger patch file. Here are my settings:

Add 'this' qualifier to unqualified field accesses
Add 'this' qualifier to unqualified method accesses
Convert for loops to enhanced for loops
Add paranoiac parentheses
Remove unused imports
Add missing '@Override' annotations
Add missing '@Deprecated' annotations
Remove unnecessary casts
Remove unnecessary '$NON-NLS$' tags
Remove trailing white spaces on all lines

Activity

Hide
Jon Stevens added a comment - 28/Jun/09 3:57 PM

my patch

Show
Jon Stevens added a comment - 28/Jun/09 3:57 PM my patch
Hide
Frederic Daoud added a comment - 27/Sep/09 6:49 AM

Fixed in revision 1153.
I did not add all the extra "this." and extra parentheses because I find they add unnecessary noise to the code.

Show
Frederic Daoud added a comment - 27/Sep/09 6:49 AM Fixed in revision 1153. I did not add all the extra "this." and extra parentheses because I find they add unnecessary noise to the code.
Hide
Jon Stevens added a comment - 01/Oct/09 12:34 AM

I just updated trunk and there are still warnings in eclipse.

Show
Jon Stevens added a comment - 01/Oct/09 12:34 AM I just updated trunk and there are still warnings in eclipse.
Hide
Frederic Daoud added a comment - 01/Oct/09 5:34 AM

Too many to list here? I get no warnings in Eclipse (my settings may differ).

Show
Frederic Daoud added a comment - 01/Oct/09 5:34 AM Too many to list here? I get no warnings in Eclipse (my settings may differ).
Hide
Jon Stevens added a comment - 01/Oct/09 12:25 PM

Not too many... pretty much the same ones as I posted about before.

Description Resource Path Location Type
Class is a raw type. References to generic type Class<T> should be parameterized BindingPolicyManager.java /stripes-svn/stripes/src/net/sourceforge/stripes/controller line 133 Java Problem
Class is a raw type. References to generic type Class<T> should be parameterized UseActionBeanTagExtraInfo.java /stripes-svn/stripes/src/net/sourceforge/stripes/tag line 52 Java Problem
Collection is a raw type. References to generic type Collection<E> should be parameterized InputHiddenTag.java /stripes-svn/stripes/src/net/sourceforge/stripes/tag line 111 Java Problem
Collection is a raw type. References to generic type Collection<E> should be parameterized UrlBuilder.java /stripes-svn/stripes/src/net/sourceforge/stripes/util line 208 Java Problem
Collection is a raw type. References to generic type Collection<E> should be parameterized UrlBuilder.java /stripes-svn/stripes/src/net/sourceforge/stripes/util line 243 Java Problem
The field SpringHelperTests.AmbiguousByTypeTarget.someBeanOrOther is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 198 Java Problem
The field SpringHelperTests.ExplicitMisNamedTarget.someBeanOrOther is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 210 Java Problem
The field SpringHelperTests.ImplicitMisNamedTarget.tstActionBea is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 222 Java Problem
The field SpringHelperTests.InvalidSetterSignatureTarget.testActionBean is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 246 Java Problem
The field SpringHelperTests.NoBeanOfTypeTarget.noBeansOfType is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 234 Java Problem
Description Resource Path Location Type
The method afterDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 291 Java Problem
The method afterSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 296 Java Problem
The method afterWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 314 Java Problem
The method afterWithReturn() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 307 Java Problem
The method afterWithReturnAndParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 320 Java Problem
The method beforeActionBeanResolutionWillNeverBeCalled() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 241 Java Problem
The method beforeAfterDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 348 Java Problem
The method beforeAfterOnSingleEvent() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 354 Java Problem
The method beforeAfterSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 342 Java Problem
The method beforeAfterWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 334 Java Problem
The method beforeDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 246 Java Problem
The method beforeSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 251 Java Problem
The method beforeTwoStages() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 256 Java Problem
The method beforeWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 268 Java Problem
The method beforeWithReturn() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 261 Java Problem
The method beforeWithReturnAndParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 274 Java Problem
The method dummyMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 286 Java Problem
The method getHasCalledBeforeActionBeanResolutionWillNeverBeCalled() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 370 Java Problem
The method injectHere(TestBean) from the type SpringHelperTests.ExplicitNonStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 88 Java Problem
The method protectedAfterMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 327 Java Problem
The method protectedBeforeMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 281 Java Problem
The method setBean(TestBean) from the type SpringHelperTests.ExplicitPublicSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 41 Java Problem
The method setTestActionBean(TestActionBean, TestActionBean) from the type SpringHelperTests.InvalidSetterSignatureTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 248 Java Problem
The method setTestActionBean(TestActionBean) from the type SpringHelperTests.ImplicitStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 118 Java Problem
The method testActionBean(TestActionBean) from the type SpringHelperTests.ImplicitNonStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 103 Java Problem
The method whee(TestActionBean) from the type SpringHelperTests.MultipleInjectionTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 182 Java Problem
The method whee(TestActionBean) from the type SpringHelperTests.MultipleInjectionTarget2 is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 272 Java Problem
The method afterTwoStages() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 301 Java Problem

Show
Jon Stevens added a comment - 01/Oct/09 12:25 PM Not too many... pretty much the same ones as I posted about before. Description Resource Path Location Type Class is a raw type. References to generic type Class<T> should be parameterized BindingPolicyManager.java /stripes-svn/stripes/src/net/sourceforge/stripes/controller line 133 Java Problem Class is a raw type. References to generic type Class<T> should be parameterized UseActionBeanTagExtraInfo.java /stripes-svn/stripes/src/net/sourceforge/stripes/tag line 52 Java Problem Collection is a raw type. References to generic type Collection<E> should be parameterized InputHiddenTag.java /stripes-svn/stripes/src/net/sourceforge/stripes/tag line 111 Java Problem Collection is a raw type. References to generic type Collection<E> should be parameterized UrlBuilder.java /stripes-svn/stripes/src/net/sourceforge/stripes/util line 208 Java Problem Collection is a raw type. References to generic type Collection<E> should be parameterized UrlBuilder.java /stripes-svn/stripes/src/net/sourceforge/stripes/util line 243 Java Problem The field SpringHelperTests.AmbiguousByTypeTarget.someBeanOrOther is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 198 Java Problem The field SpringHelperTests.ExplicitMisNamedTarget.someBeanOrOther is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 210 Java Problem The field SpringHelperTests.ImplicitMisNamedTarget.tstActionBea is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 222 Java Problem The field SpringHelperTests.InvalidSetterSignatureTarget.testActionBean is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 246 Java Problem The field SpringHelperTests.NoBeanOfTypeTarget.noBeansOfType is never read locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 234 Java Problem Description Resource Path Location Type The method afterDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 291 Java Problem The method afterSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 296 Java Problem The method afterWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 314 Java Problem The method afterWithReturn() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 307 Java Problem The method afterWithReturnAndParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 320 Java Problem The method beforeActionBeanResolutionWillNeverBeCalled() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 241 Java Problem The method beforeAfterDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 348 Java Problem The method beforeAfterOnSingleEvent() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 354 Java Problem The method beforeAfterSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 342 Java Problem The method beforeAfterWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 334 Java Problem The method beforeDefaultStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 246 Java Problem The method beforeSpecificStage() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 251 Java Problem The method beforeTwoStages() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 256 Java Problem The method beforeWithParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 268 Java Problem The method beforeWithReturn() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 261 Java Problem The method beforeWithReturnAndParameter(String) from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 274 Java Problem The method dummyMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 286 Java Problem The method getHasCalledBeforeActionBeanResolutionWillNeverBeCalled() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 370 Java Problem The method injectHere(TestBean) from the type SpringHelperTests.ExplicitNonStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 88 Java Problem The method protectedAfterMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 327 Java Problem The method protectedBeforeMethod() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 281 Java Problem The method setBean(TestBean) from the type SpringHelperTests.ExplicitPublicSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 41 Java Problem The method setTestActionBean(TestActionBean, TestActionBean) from the type SpringHelperTests.InvalidSetterSignatureTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 248 Java Problem The method setTestActionBean(TestActionBean) from the type SpringHelperTests.ImplicitStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 118 Java Problem The method testActionBean(TestActionBean) from the type SpringHelperTests.ImplicitNonStandardSetterTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 103 Java Problem The method whee(TestActionBean) from the type SpringHelperTests.MultipleInjectionTarget is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 182 Java Problem The method whee(TestActionBean) from the type SpringHelperTests.MultipleInjectionTarget2 is never used locally SpringHelperTests.java /stripes-svn/tests/src/net/sourceforge/stripes/integration/spring line 272 Java Problem The method afterTwoStages() from the type BeforeAfterMethodInterceptorTests.TestActionBean2 is never used locally BeforeAfterMethodInterceptorTests.java /stripes-svn/tests/src/net/sourceforge/stripes/controller line 301 Java Problem
Hide
Frederic Daoud added a comment - 01/Oct/09 3:16 PM

OK, I'll check the first 5. All the others are irrelevant. It is normal for methods not to be used locally when they are used in a dependency injection context or in a test context.

Show
Frederic Daoud added a comment - 01/Oct/09 3:16 PM OK, I'll check the first 5. All the others are irrelevant. It is normal for methods not to be used locally when they are used in a dependency injection context or in a test context.
Hide
Frederic Daoud added a comment - 01/Oct/09 5:38 PM

Fixed in revision 1155.

Show
Frederic Daoud added a comment - 01/Oct/09 5:38 PM Fixed in revision 1155.
Hide
Jon Stevens added a comment - 02/Oct/09 1:16 AM

Is it that bad to add a @SuppressWarnings("unused") to those methods?

The benefit of having a clean warning free build is that it is easier to quickly see problems if they crop up because the icons show you in the Package Explorer.

Turning off that error in Eclipse preferences could unfortunately allow mistakes to slip through.

I know it isn't an ideal solution to add @SW, but honestly, it is only a few places and they are just test classes.

Show
Jon Stevens added a comment - 02/Oct/09 1:16 AM Is it that bad to add a @SuppressWarnings("unused") to those methods? The benefit of having a clean warning free build is that it is easier to quickly see problems if they crop up because the icons show you in the Package Explorer. Turning off that error in Eclipse preferences could unfortunately allow mistakes to slip through. I know it isn't an ideal solution to add @SW, but honestly, it is only a few places and they are just test classes.
Hide
Frederic Daoud added a comment - 02/Oct/09 5:31 AM

You're right, that's a good point Jon. Could you please submit a patch for just those methods? I'd appreciate it. Thanks in advance.

Show
Frederic Daoud added a comment - 02/Oct/09 5:31 AM You're right, that's a good point Jon. Could you please submit a patch for just those methods? I'd appreciate it. Thanks in advance.

People

Vote (0)
Watch (0)

Dates

  • Created:
    28/Jun/09 3:56 PM
    Updated:
    04/Jan/11 3:19 PM
    Resolved:
    27/Oct/09 2:50 PM