Fix indentation issues
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowTypedArray.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowTypedArray.java
index 339bce3..4873148 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowTypedArray.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowTypedArray.java
@@ -13,49 +13,49 @@
public Resources getResources() {
return Robolectric.application.getResources();
}
-
+
@Implementation
public boolean getBoolean(int index, boolean defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public float getFloat(int index, float defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getInt(int index, int defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getInteger(int index, int defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public float getDimension(int index, float defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getDimensionPixelOffset(int index, int defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getDimensionPixelSize(int index, int defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getLayoutDimension(int index, int defValue) {
- return defValue;
+ return defValue;
}
-
+
@Implementation
public int getResourceId(int index, int defValue) {
- return defValue;
+ return defValue;
}
}
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowView.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowView.java
index 3a07d00..2707451 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowView.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowView.java
@@ -60,7 +60,7 @@
private int paddingRight;
private int paddingBottom;
private ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(0, 0);
- private Map<Integer, Object> tags = new HashMap<Integer, Object>();
+ private final Map<Integer, Object> tags = new HashMap<Integer, Object>();
private boolean clickable;
protected boolean focusable;
boolean focusableInTouchMode;
@@ -446,10 +446,10 @@
public void setViewFocus(boolean hasFocus) {
this.isFocused = hasFocus;
-
+
try {
Class rectClass = Class.forName("android.graphics.Rect");
- Method method = View.class.getDeclaredMethod("onFocusChanged", Boolean.TYPE, Integer.TYPE,
+ Method method = View.class.getDeclaredMethod("onFocusChanged", Boolean.TYPE, Integer.TYPE,
rectClass);
method.setAccessible(true);
method.invoke(realView, this.isFocused, 0, null);
@@ -462,9 +462,9 @@
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
-
+
if (onFocusChangeListener != null) {
- onFocusChangeListener.onFocusChange(realView, hasFocus);
+ onFocusChangeListener.onFocusChange(realView, hasFocus);
}
}
@@ -492,7 +492,7 @@
public void clearFocus() {
setViewFocus(false);
}
-
+
@Implementation
public void setOnFocusChangeListener(View.OnFocusChangeListener listener) {
onFocusChangeListener = listener;
@@ -785,6 +785,7 @@
/* good part of following code has been directly copied from original
* android source */
setOnClickListener(new View.OnClickListener() {
+ @Override
public void onClick(View v) {
Method mHandler;
try {
diff --git a/src/test/java/com/xtremelabs/robolectric/shadows/TypedArrayTest.java b/src/test/java/com/xtremelabs/robolectric/shadows/TypedArrayTest.java
index 41943d1..0273719 100644
--- a/src/test/java/com/xtremelabs/robolectric/shadows/TypedArrayTest.java
+++ b/src/test/java/com/xtremelabs/robolectric/shadows/TypedArrayTest.java
@@ -17,7 +17,7 @@
public class TypedArrayTest {
private android.content.res.TypedArray typedArray;
- @Before
+ @Before
public void setUp() throws Exception {
typedArray = Robolectric.newInstanceOf(android.content.res.TypedArray.class);
}
@@ -26,46 +26,46 @@
public void getResources() throws Exception {
assertNotNull(new Activity().obtainStyledAttributes(null).getResources());
}
-
+
@Test
public void testBooleanDefaultValue() {
- assertThat(typedArray.getBoolean(0, true), equalTo(true));
- assertThat(typedArray.getBoolean(0, false), equalTo(false));
+ assertThat(typedArray.getBoolean(0, true), equalTo(true));
+ assertThat(typedArray.getBoolean(0, false), equalTo(false));
}
-
+
@Test
public void testIntDefaultValue() {
- assertThat(typedArray.getInt(0, 15), equalTo(15));
- assertThat(typedArray.getInteger(0, 24), equalTo(24));
+ assertThat(typedArray.getInt(0, 15), equalTo(15));
+ assertThat(typedArray.getInteger(0, 24), equalTo(24));
}
-
+
@Test
public void testFloatDefaultValue() {
- assertThat(typedArray.getFloat(0, 0.5f), equalTo(0.5f));
+ assertThat(typedArray.getFloat(0, 0.5f), equalTo(0.5f));
}
-
+
@Test
public void testDimensionDefaultValue() {
- assertThat(typedArray.getDimension(0, 0.5f), equalTo(0.5f));
+ assertThat(typedArray.getDimension(0, 0.5f), equalTo(0.5f));
}
-
+
@Test
public void testDimensionPixelOffsetDefaultValue() {
- assertThat(typedArray.getDimensionPixelOffset(0, 2), equalTo(2));
+ assertThat(typedArray.getDimensionPixelOffset(0, 2), equalTo(2));
}
-
+
@Test
public void testDimensionPixelSizeDefaultValue() {
- assertThat(typedArray.getDimensionPixelSize(0, 2), equalTo(2));
+ assertThat(typedArray.getDimensionPixelSize(0, 2), equalTo(2));
}
-
+
@Test
public void testLayoutDimensionDefaultValue() {
- assertThat(typedArray.getLayoutDimension(0, 2), equalTo(2));
+ assertThat(typedArray.getLayoutDimension(0, 2), equalTo(2));
}
-
+
@Test
public void testResourceIdDefaultValue() {
- assertThat(typedArray.getResourceId(0, 2), equalTo(2));
+ assertThat(typedArray.getResourceId(0, 2), equalTo(2));
}
}
diff --git a/src/test/java/com/xtremelabs/robolectric/shadows/ViewTest.java b/src/test/java/com/xtremelabs/robolectric/shadows/ViewTest.java
index 596f3ce..6925ad8 100644
--- a/src/test/java/com/xtremelabs/robolectric/shadows/ViewTest.java
+++ b/src/test/java/com/xtremelabs/robolectric/shadows/ViewTest.java
@@ -319,7 +319,7 @@
view.dispatchTouchEvent(event);
assertThat(shadowOf(view).getLastTouchEvent(), sameInstance(event));
}
-
+
@Test
public void dispatchFocusEvent_sendsFocusToOnFocusChanged() throws Exception {
FocusableView focusableView = new FocusableView(null);
@@ -373,18 +373,18 @@
onAnimationEndWasCalled = true;
}
}
-
+
private static class FocusableView extends View {
boolean onFocusChangedWasCalled;
-
+
public FocusableView(Context context) {
super(context);
}
-
+
@Override
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
-
+
onFocusChangedWasCalled = true;
}
}