commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [4/8] [lang] Fix whitespaces and indentation
Date Thu, 07 May 2015 20:14:41 GMT
Fix whitespaces and indentation


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/18b3437c
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/18b3437c
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/18b3437c

Branch: refs/heads/master
Commit: 18b3437c15d78c54510964728486831822809d9c
Parents: 3dbf1ee
Author: Benedikt Ritter <britter@apache.org>
Authored: Thu May 7 20:49:52 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Thu May 7 20:49:52 2015 +0200

----------------------------------------------------------------------
 .../commons/lang3/test/SwitchDefaults.java      | 58 ++++++++++----------
 .../commons/lang3/test/SystemDefaults.java      | 16 +++---
 2 files changed, 36 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/18b3437c/src/test/java/org/apache/commons/lang3/test/SwitchDefaults.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/test/SwitchDefaults.java b/src/test/java/org/apache/commons/lang3/test/SwitchDefaults.java
index d48bd37..cacf37d 100644
--- a/src/test/java/org/apache/commons/lang3/test/SwitchDefaults.java
+++ b/src/test/java/org/apache/commons/lang3/test/SwitchDefaults.java
@@ -58,46 +58,44 @@ import org.junit.runners.model.Statement;
  * </pre>
  */
 public class SwitchDefaults implements TestRule {
+    
+    @Override
+    public Statement apply(Statement stmt, Description description) {
+        SystemDefaults defaults = description.getAnnotation(SystemDefaults.class);
+        if (defaults == null) {
+            return stmt;
+        }
+        return applyTimeZone(defaults, applyLocale(defaults, stmt));
+    }
 
+    private Statement applyTimeZone(SystemDefaults defaults, final Statement stmt) {
+        if (defaults.timezone().isEmpty()) {
+            return stmt;
+        }
 
+        final TimeZone newTimeZone = TimeZone.getTimeZone(defaults.timezone());
 
-	@Override
-	public Statement apply(Statement stmt, Description description) {
-    	SystemDefaults defaults = description.getAnnotation(SystemDefaults.class);
-    	if(defaults == null) {
-    		return stmt;
-    	}
-    	return applyTimeZone(defaults, applyLocale(defaults, stmt));
-    }
-
-	private Statement applyTimeZone(SystemDefaults defaults, final Statement stmt) {
-    	if(defaults.timezone().isEmpty()) {
-    		return stmt;
-    	}
-    	
-    	final TimeZone newTimeZone = TimeZone.getTimeZone(defaults.timezone());
-    	
         return new Statement() {
             @Override
             public void evaluate() throws Throwable {
-            	TimeZone save = TimeZone.getDefault();
+                TimeZone save = TimeZone.getDefault();
                 try {
-                	TimeZone.setDefault(newTimeZone);
+                    TimeZone.setDefault(newTimeZone);
                     stmt.evaluate();
                 } finally {
-                	TimeZone.setDefault(save);
+                    TimeZone.setDefault(save);
                 }
             }
-        };    	
-	}
+        };
+    }
+
+    private Statement applyLocale(SystemDefaults defaults, final Statement stmt) {
+        if (defaults.locale().isEmpty()) {
+            return stmt;
+        }
+
+        final Locale newLocale = LocaleUtils.toLocale(defaults.locale());
 
-	private Statement applyLocale(SystemDefaults defaults, final Statement stmt) {
-    	if(defaults.locale().isEmpty()) {
-    		return stmt;
-    	}
-    	
-    	final Locale newLocale = LocaleUtils.toLocale(defaults.locale());
-    	
         return new Statement() {
             @Override
             public void evaluate() throws Throwable {
@@ -109,7 +107,7 @@ public class SwitchDefaults implements TestRule {
                     Locale.setDefault(save);
                 }
             }
-        };    	
-	}
+        };
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/18b3437c/src/test/java/org/apache/commons/lang3/test/SystemDefaults.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/test/SystemDefaults.java b/src/test/java/org/apache/commons/lang3/test/SystemDefaults.java
index 1c95f28..e5893a2 100644
--- a/src/test/java/org/apache/commons/lang3/test/SystemDefaults.java
+++ b/src/test/java/org/apache/commons/lang3/test/SystemDefaults.java
@@ -29,12 +29,12 @@ import java.lang.annotation.Target;
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)
 public @interface SystemDefaults {
-	/**
-	 * The name of the Locale to be used while running a test method
-	 */
-	String locale() default "";
-	/**
-	 * The name of the TimeZone to be used while running a test method
-	 */
-	String timezone() default "";
+    /**
+     * The name of the Locale to be used while running a test method
+     */
+    String locale() default "";
+    /**
+     * The name of the TimeZone to be used while running a test method
+     */
+    String timezone() default "";
 }


Mime
View raw message