aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCeki Gulcu <ceki@qos.ch>2014-12-09 22:39:17 +0100
committerCeki Gulcu <ceki@qos.ch>2014-12-09 22:39:17 +0100
commit7a57f1a0803116dfdd11a5e4fa2adaa1759e4d99 (patch)
treec8b5a8888b80cf94b60c6423f1002c159e775a6b
parent26b01116722ebdd3b2471a6579f9d5a6feda83e7 (diff)
downloadslf4j-7a57f1a0803116dfdd11a5e4fa2adaa1759e4d99.tar.gz
indentation changes only
-rwxr-xr-x.idea/codeStyleSettings.xml38
-rwxr-xr-xslf4j-api/src/main/java/org/slf4j/helpers/Util.java84
2 files changed, 80 insertions, 42 deletions
diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
new file mode 100755
index 00000000..9f3f7d80
--- /dev/null
+++ b/.idea/codeStyleSettings.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectCodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS">
+ <value>
+ <option name="OTHER_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="2" />
+ <option name="CONTINUATION_INDENT_SIZE" value="8" />
+ <option name="TAB_SIZE" value="2" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </value>
+ </option>
+ <XML>
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+ </XML>
+ <codeStyleSettings language="JAVA">
+ <option name="RIGHT_MARGIN" value="120" />
+ <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
+ <option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
+ <option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
+ <option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
+ <option name="SPACE_BEFORE_TRY_PARENTHESES" value="false" />
+ <option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" />
+ <option name="SPACE_BEFORE_SYNCHRONIZED_PARENTHESES" value="false" />
+ <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
+ <option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
+ <option name="KEEP_MULTIPLE_EXPRESSIONS_IN_ONE_LINE" value="true" />
+ </codeStyleSettings>
+ </value>
+ </option>
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+ </component>
+</project> \ No newline at end of file
diff --git a/slf4j-api/src/main/java/org/slf4j/helpers/Util.java b/slf4j-api/src/main/java/org/slf4j/helpers/Util.java
index a729d3fb..4a205c02 100755
--- a/slf4j-api/src/main/java/org/slf4j/helpers/Util.java
+++ b/slf4j-api/src/main/java/org/slf4j/helpers/Util.java
@@ -26,7 +26,6 @@ package org.slf4j.helpers;
/**
- *
* An internal utility class.
*
* @author Alexandre Dorokhine
@@ -34,53 +33,54 @@ package org.slf4j.helpers;
*/
public final class Util {
- private Util() {}
+ private Util() {}
- /**
- * In order to call {@link SecurityManager#getClassContext()}, which is a
- * protected method, we add this wrapper which allows the method to be visible
- * inside this package.
- */
- private static final class ClassContextSecurityManager extends SecurityManager {
- protected Class<?>[] getClassContext() {
- return super.getClassContext();
+ /**
+ * In order to call {@link SecurityManager#getClassContext()}, which is a
+ * protected method, we add this wrapper which allows the method to be visible
+ * inside this package.
+ */
+ private static final class ClassContextSecurityManager extends SecurityManager {
+ protected Class<?>[] getClassContext() {
+ return super.getClassContext();
+ }
}
- };
- private static final ClassContextSecurityManager SECURITY_MANAGER =
- new ClassContextSecurityManager();
- /**
- * Returns the name of the class which called the invoking method.
- * @return the name of the class which called the invoking method.
- */
- public static Class<?> getCallingClass() {
- Class<?>[] trace = SECURITY_MANAGER.getClassContext();
- String thisClassName = Util.class.getName();
+ private static final ClassContextSecurityManager SECURITY_MANAGER = new ClassContextSecurityManager();
- // Advance until Util is found
- int i;
- for (i = 0 ; i < trace.length ; i++) {
- if (thisClassName.equals(trace[i].getName()))
- break;
- }
+ /**
+ * Returns the name of the class which called the invoking method.
+ *
+ * @return the name of the class which called the invoking method.
+ */
+ public static Class<?> getCallingClass() {
+ Class<?>[] trace = SECURITY_MANAGER.getClassContext();
+ String thisClassName = Util.class.getName();
+
+ // Advance until Util is found
+ int i;
+ for(i = 0; i < trace.length; i++) {
+ if(thisClassName.equals(trace[i].getName()))
+ break;
+ }
- // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller
- if (i >= trace.length || i + 2 >= trace.length) {
- throw new IllegalStateException(
- "Failed to find org.slf4j.helpers.Util or its caller in the stack; " +
- "this should not happen");
+ // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller
+ if(i >= trace.length || i + 2 >= trace.length) {
+ throw new IllegalStateException(
+ "Failed to find org.slf4j.helpers.Util or its caller in the stack; " +
+ "this should not happen");
+ }
+
+ return trace[i + 2];
}
- return trace[i+2];
- }
+ static final public void report(String msg, Throwable t) {
+ System.err.println(msg);
+ System.err.println("Reported exception:");
+ t.printStackTrace();
+ }
- static final public void report(String msg, Throwable t) {
- System.err.println(msg);
- System.err.println("Reported exception:");
- t.printStackTrace();
- }
-
- static final public void report(String msg) {
- System.err.println("SLF4J: " +msg);
- }
+ static final public void report(String msg) {
+ System.err.println("SLF4J: " + msg);
+ }
}