Skip to content

Commit

Permalink
Formatting: Disallow whitespaces.
Browse files Browse the repository at this point in the history
- Replaced leading 4-wide whitespaces with tabs.
- Removed/replaced remaining leading whitespaces to maintain consistency.
- Added *'s to multiline docs where they were missing.
  • Loading branch information
Pieter12345 committed Apr 30, 2018
1 parent d74d315 commit 232db3a
Show file tree
Hide file tree
Showing 61 changed files with 4,048 additions and 4,052 deletions.
2,266 changes: 1,133 additions & 1,133 deletions src/main/java/com/laytonsmith/PureUtilities/ArgumentParser.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main/java/com/laytonsmith/PureUtilities/Color.java
Expand Up @@ -118,7 +118,7 @@ public class Color implements java.io.Serializable {
private float falpha = 0.0f;

/*
* JDK 1.1 serialVersionUID
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = 118526816881161077L;

Expand Down Expand Up @@ -403,9 +403,9 @@ public Color brighter() {
int alpha = getAlpha();

/* From 2D group:
* 1. black.brighter() should return grey
* 2. applying brighter to blue will always return blue, brighter
* 3. non pure color (non zero rgb) will eventually return white
* 1. black.brighter() should return grey
* 2. applying brighter to blue will always return blue, brighter
* 3. non pure color (non zero rgb) will eventually return white
*/
int i = (int) (1.0 / (1.0 - FACTOR));
if(r == 0 && g == 0 && b == 0) {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/laytonsmith/PureUtilities/Common/FileUtil.java
Expand Up @@ -118,14 +118,14 @@ public static InputStream readAsStream(File file) throws IOException {
// } finally {
// freeLock(file);
// }
// FileInputStream fis = new FileInputStream(f);
// try{
// FileInputStream fis = new FileInputStream(f);
// try{
// return StreamUtils.GetString(fis, charset);
// } finally {
// fis.close();
// fis = null;
// System.gc();
// }
// } finally {
// fis.close();
// fis = null;
// System.gc();
// }
}

/**
Expand Down Expand Up @@ -221,9 +221,9 @@ public static void write(byte[] data, File file, int mode, boolean create) throw
// } finally {
// freeLock(file);
// }
// FileWriter fw = new FileWriter(f, append);
// fw.write(s);
// fw.close();
// FileWriter fw = new FileWriter(f, append);
// fw.write(s);
// fw.close();
}

/**
Expand Down
Expand Up @@ -21,34 +21,34 @@
public class ConcurrentSingletonHashMap<T, V> implements Map<T, V> {

/*
* You might notice that no fields in this class are volatile. Normally, when you double lock, you must do
* something like this to be totally correct:
*
* <pre>
* volatile Object value = null; // Note the volatility
* construct() {
* Object result = value;
* if(result == null) {
* synchronized(result) {
* if(result == null) {
* result = new Object();
* value = result;
* }
* }
* }
* return result;
* }
* </pre>
*
* Note that we are doing the double locking per usual, but the value is volatile. The local result value seems
* unnecessary at first, but the effect of this is that in cases where value is already initialized
* (i.e., most of the time), the volatile field is only accessed once (due to "return result;" instead of
* "return value;"), which can improve the method's overall performance by as much as 25 percent.
*
* However, in the case that we have before us, the ConcurrentHashMap handles this for us, by guaranteeing that
* we never get a value that is partially constructed in the get() method.
*
*
* You might notice that no fields in this class are volatile. Normally, when you double lock, you must do
* something like this to be totally correct:
*
* <pre>
* volatile Object value = null; // Note the volatility
* construct() {
* Object result = value;
* if(result == null) {
* synchronized(result) {
* if(result == null) {
* result = new Object();
* value = result;
* }
* }
* }
* return result;
* }
* </pre>
*
* Note that we are doing the double locking per usual, but the value is volatile. The local result value seems
* unnecessary at first, but the effect of this is that in cases where value is already initialized
* (i.e., most of the time), the volatile field is only accessed once (due to "return result;" instead of
* "return value;"), which can improve the method's overall performance by as much as 25 percent.
*
* However, in the case that we have before us, the ConcurrentHashMap handles this for us, by guaranteeing that
* we never get a value that is partially constructed in the get() method.
*
*
*/
private final Map<T, V> map = new ConcurrentHashMap<>();
private final ValueGenerator<T, V> generator;
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/com/laytonsmith/PureUtilities/ExhaustiveVisitor.java
Expand Up @@ -56,20 +56,20 @@
* public static class PhoneNumber implements UserID {
* {@code @Override}
* public void accept(UserIDVisitor visitor) {
* visitor.handle(this);
* visitor.handle(this);
* }
* }
* public static abstract class GeneratedID implements UserID {}
* public static class GeneratedIDV1 extends GeneratedID {
* {@code @Override}
* public void accept(UserIDVisitor visitor) {
* visitor.handle(this);
* visitor.handle(this);
* }
* }
* public static class GeneratedIDV2 extends GeneratedID {
* {@code @Override}
* public void accept(UserIDVisitor visitor) {
* visitor.handle(this);
* visitor.handle(this);
* }
* }
*
Expand All @@ -78,17 +78,17 @@
*
* {@code @Override}
* public void handle(PhoneNumber m) {
* System.out.println("Canadian PhoneNumber");
* System.out.println("Canadian PhoneNumber");
* }
*
* {@code @Override}
* public void handle(GeneratedIDV1 c) {
* System.out.println("Canadian GeneratedIDV1");
* System.out.println("Canadian GeneratedIDV1");
* }
*
* {@code @Override}
* public void handle(GeneratedIDV2 c) {
* System.out.println("Canadian GeneratedIDV2");
* System.out.println("Canadian GeneratedIDV2");
* }
*
* }
Expand All @@ -97,17 +97,17 @@
*
* {@code @Override}
* public void handle(PhoneNumber m) {
* System.out.println("American PhoneNumber");
* System.out.println("American PhoneNumber");
* }
*
* {@code @Override}
* public void handle(GeneratedIDV1 c) {
* System.out.println("American GeneratedIDV1");
* System.out.println("American GeneratedIDV1");
* }
*
* {@code @Override}
* public void handle(GeneratedIDV2 c) {
* System.out.println("American GeneratedIDV2");
* System.out.println("American GeneratedIDV2");
* }
*
* }
Expand Down Expand Up @@ -141,30 +141,30 @@
* {@code @ExhaustiveVisitor.VisitorInfo(baseClass = UserID.class, directSubclassOnly = false)}
* public static class CanadianVisitor extends ExhaustiveVisitor<UserID> {
* public void visit(PhoneNumber n) {
* System.out.println("Canadian PhoneNumber");
* System.out.println("Canadian PhoneNumber");
* }
*
* public void visit(GeneratedIDV1 id) {
* System.out.println("Canadian GeneratedIDV1");
* System.out.println("Canadian GeneratedIDV1");
* }
*
* public void visit(GeneratedIDV2 id) {
* System.out.println("Canadian GeneratedIDV1");
* System.out.println("Canadian GeneratedIDV1");
* }
* }
*
* {@code @ExhaustiveVisitor.VisitorInfo(baseClass = UserID.class, directSubclassOnly = false)}
* public static class AmericanVisitor extends ExhaustiveVisitor<UserID> {
* public void visit(PhoneNumber n) {
* System.out.println("American PhoneNumber");
* System.out.println("American PhoneNumber");
* }
*
* public void visit(GeneratedIDV1 id) {
* System.out.println("American GeneratedIDV1");
* System.out.println("American GeneratedIDV1");
* }
*
* public void visit(GeneratedIDV2 id) {
* System.out.println("American GeneratedIDV1");
* System.out.println("American GeneratedIDV1");
* }
* }
*
Expand Down
Expand Up @@ -185,10 +185,10 @@ private void load(LineReader lr) throws IOException {
}

/* Read in a "logical line" from an InputStream/Reader, skip all comment
* and blank lines and filter out those leading whitespace characters
* (\u0020, \u0009 and \u000c) from the beginning of a "natural line".
* Method returns the char length of the "logical line" and stores
* the line in "lineBuf".
* and blank lines and filter out those leading whitespace characters
* (\u0020, \u0009 and \u000c) from the beginning of a "natural line".
* Method returns the char length of the "logical line" and stores
* the line in "lineBuf".
*/
class LineReader {

Expand Down Expand Up @@ -317,8 +317,8 @@ int readLine() throws IOException {
}

/*
* Converts encoded &#92;uxxxx to unicode chars
* and changes special saved chars to their original forms
* Converts encoded &#92;uxxxx to unicode chars
* and changes special saved chars to their original forms
*/
private String loadConvert(char[] in, int off, int len, char[] convtBuf) {
if(convtBuf.length < len) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/laytonsmith/PureUtilities/TermColors.java
Expand Up @@ -57,7 +57,7 @@ public static void cls() {
}

/*
* Standard foreground colors
* Standard foreground colors
*/
@color
public static String RED = color(Color.RED);
Expand All @@ -77,7 +77,7 @@ public static void cls() {
public static String WHITE = color(Color.WHITE);

/*
* Bright foreground colors
* Bright foreground colors
*/
@color
public static String BRIGHT_RED = color(Color.RED, true, true, true);
Expand All @@ -97,7 +97,7 @@ public static void cls() {
public static String BRIGHT_WHITE = color(Color.WHITE, true, true, true);

/*
* Standard background colors
* Standard background colors
*/
@color
public static String BG_RED = color(Color.RED, false, false, false);
Expand All @@ -117,7 +117,7 @@ public static void cls() {
public static String BG_WHITE = color(Color.WHITE, false, false, false);

/*
* Bright background colors
* Bright background colors
*/
@color
public static String BG_BRIGHT_RED = color(Color.RED, true, false, false);
Expand Down

0 comments on commit 232db3a

Please sign in to comment.