Commits

Brian McKenna committed 3777b08

Fix some whitespace issues

Comments (0)

Files changed (4)

src/main/java/org/jreversepro/jls/JLSConstants.java

 
   String VALUE_1 = "1";
 
-  String ARGS_SEPARATOR = ",";
+  String ARGS_SEPARATOR = ", ";
 }

src/main/java/org/jreversepro/jls/emitter/java14/StatementEmitter.java

   @Override
   protected void emitCurrentCode(EmitterTarget target, Block _block) {
     Statement stmt = (Statement) _block;
+    target.append("        ");
     target.append(stmt.getExpression().getJLSCode()
         + JLSConstants.END_OF_STATEMENT);
     target.append("\n");

src/main/java/org/jreversepro/output/AbstractClassOutputterImpl.java

    *  Outputs current and super classes
    */
   protected void outputThisSuperClasses() {
-    sb.append("\n\n" + getTypeAsString() + " ");
+    sb.append("\n" + getTypeAsString() + " ");
 
     sb.append(Import.getClassName(clazz.getThisClass()));
     String superClass = clazz.getSuperClass();
   protected void outputInterfaces() {
     List<String> interfaces = clazz.getInterfaces();
     if (interfaces.size() != 0) {
-      sb.append("\n\t\t " + JLSConstants.IMPLEMENTS + " ");
+      sb.append(" " + JLSConstants.IMPLEMENTS + " ");
       for (int i = 0; i < interfaces.size(); i++) {
         if (i != 0) {
           sb.append(JLSConstants.INTERFACE_DELIMITER);
    *  output the Fields of the given class
    */
   protected void outputFields() {
-    sb.append("\n");
     for (Field field : clazz.getFields()) {
       String datatype = Import.getClassName(TypeInferrer.getJLSType(field
           .getDatatype(), false));
 
       String access = this.getAccessQualifier(field.getQualifier(), true);
 
-      sb.append("\n\t" + access);
-      sb.append(datatype);
+      sb.append(styler.outputLine(datatype));
       sb.append(" " + field.getName());
       String val = field.getValue();
       if (field.isFinal() && val.length() != 0) {
         sb.append(JLSConstants.EQUALTO + val);
       }
       sb.append(JLSConstants.END_OF_STATEMENT);
+      sb.append("\n");
     }
   }
 
         .getReturnType(), false));
 
     String name = method.getName();
-    sb.append("\n\n    ");
+    sb.append("\n    ");
 
     if (name.compareTo(CLINIT) == 0) {
       sb.append(JLSConstants.STATIC);

src/main/java/org/jreversepro/output/BSDKNFCodeStyler.java

 
   public String outputLine(String str) {
     StringBuilder sb = new StringBuilder();
-    sb.append("\n");
     for (int i = 0; i < depth; ++i) {
       sb.append("    ");
     }