Make use of Java 5 auto boxing

Reviewed and replaced when possible:
- new Integer
- intValue()
- new Boolean
- booleanValue()
- Boolean.TRUE
- Boolean.FALSE
- new Long
- longValue()

Issues: SWF-1532
This commit is contained in:
Phillip Webb
2012-04-05 14:07:58 -07:00
parent d3ff99c239
commit 22b018e95a
54 changed files with 132 additions and 140 deletions

View File

@@ -98,7 +98,7 @@ public class SelectionTrackingActionListenerTests extends TestCase {
int.class });
indexMutator.setAccessible(true);
ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), new Integer(1) });
ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), 1 });
ActionEvent event = new ActionEvent(commandButton);
@@ -108,7 +108,7 @@ public class SelectionTrackingActionListenerTests extends TestCase {
assertSame(dataModel.getSelectedRow(), dataModel.getRowData());
assertTrue(delegateListener.processedEvent);
ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), new Integer(2) });
ReflectionUtils.invokeMethod(indexMutator, uiRepeat, new Object[] { new MockFacesContext(), 2 });
assertFalse(dataModel.isCurrentRowSelected());
assertTrue(dataModel.getSelectedRow() != dataModel.getRowData());
}

View File

@@ -79,7 +79,7 @@ public class ProgressiveCommandLinkRendererTests extends TestCase {
form.setId("myForm");
ProgressiveUICommand link = new ProgressiveUICommand();
link.setId("foo");
link.setAjaxEnabled(Boolean.FALSE);
link.setAjaxEnabled(false);
form.getChildren().add(link);
RenderAttributeCallback callback = renderer.getAttributeCallbacks(link).get("onclick");
@@ -102,7 +102,7 @@ public class ProgressiveCommandLinkRendererTests extends TestCase {
form.setId("myForm");
ProgressiveUICommand link = new ProgressiveUICommand();
link.setId("foo");
link.setAjaxEnabled(Boolean.FALSE);
link.setAjaxEnabled(false);
form.getChildren().add(link);
UIParameter param1 = new UIParameter();
param1.setName("foo");

View File

@@ -87,7 +87,7 @@ public class JsfFinalResponseActionTests extends TestCase {
newRoot.setRenderKitId("HTML_BASIC");
((MockViewHandler) viewHandler).setCreateView(newRoot);
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.FALSE);
EasyMock.expectLastCall().andReturn(false);
EasyMock.replay(new Object[] { context });

View File

@@ -112,7 +112,7 @@ public class JsfViewFactoryTests extends TestCase {
newRoot.setViewId(VIEW_ID);
((MockViewHandler) viewHandler).setCreateView(newRoot);
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
EasyMock.expectLastCall().andReturn(true);
EasyMock.replay(new Object[] { context });
@@ -143,7 +143,7 @@ public class JsfViewFactoryTests extends TestCase {
((MockViewHandler) viewHandler).setRestoreView(existingRoot);
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
EasyMock.expectLastCall().andReturn(true);
EasyMock.replay(new Object[] { context });
@@ -189,7 +189,7 @@ public class JsfViewFactoryTests extends TestCase {
((MockViewHandler) viewHandler).setRestoreView(existingRoot);
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
EasyMock.expectLastCall().andReturn(true);
EasyMock.replay(new Object[] { context });
@@ -224,7 +224,7 @@ public class JsfViewFactoryTests extends TestCase {
EasyMock.expect(context.getCurrentState()).andReturn(new NormalViewState());
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
EasyMock.expectLastCall().andReturn(true);
EasyMock.replay(new Object[] { context });
@@ -276,7 +276,7 @@ public class JsfViewFactoryTests extends TestCase {
((MockViewHandler) viewHandler).setRestoreView(existingRoot);
context.inViewState();
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
EasyMock.expectLastCall().andReturn(true);
EasyMock.replay(new Object[] { context });
factory.getView(context);

View File

@@ -139,7 +139,7 @@ public class JsfViewTests extends TestCase {
public final void testProcessUserEvent_Restored_NoEvent() {
EasyMock.expect(flashScope.getBoolean(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY))).andStubReturn(
Boolean.FALSE);
false);
EasyMock.expect(flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
@@ -165,7 +165,7 @@ public class JsfViewTests extends TestCase {
public final void testProcessUserEvent_Restored_Ajax_NoEvent() {
EasyMock.expect(flashScope.getBoolean(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY))).andStubReturn(
Boolean.FALSE);
false);
EasyMock.expect(flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);
@@ -191,7 +191,7 @@ public class JsfViewTests extends TestCase {
public final void testProcessUserEvent_Restored_EventSignaled() {
EasyMock.expect(flashScope.getBoolean(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY))).andStubReturn(
Boolean.FALSE);
false);
EasyMock.expect(flashScope.put(EasyMock.matches(FlowFacesContext.RENDER_RESPONSE_KEY), EasyMock.anyObject()))
.andStubReturn(null);