Skip to content

Commit e67b581

Browse files
committed
Code style cleanup (tab vs spaces, "final" overuse)
1 parent 774d7ce commit e67b581

File tree

13 files changed

+489
-488
lines changed

13 files changed

+489
-488
lines changed

net.tascalate.javaflow.api/src/main/java/org/apache/commons/javaflow/core/ReflectionUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ public final class ReflectionUtils {
3737

3838
private static final Logger log = LoggerFactory.getLogger(ReflectionUtils.class);
3939

40-
public interface Matcher {
40+
public interface Matcher {
4141
boolean matches(String pName);
4242
}
43-
43+
4444
public interface Indexer {
4545
void put(Map<String, Object> pMap, String pKey, Object pObject);
4646
}
47-
47+
4848
private static Indexer defaultIndexer = new DefaultIndexer();
4949
private static Matcher defaultMatcher = new DefaultMatcher();
50-
50+
5151
public static class DefaultMatcher implements Matcher {
5252
public boolean matches(String pName) {
5353
return true;

net.tascalate.javaflow.api/src/main/java/org/apache/commons/javaflow/core/Stack.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
public class Stack implements Serializable {
4242

43-
private static final Logger log = LoggerFactory.getLogger(Stack.class);
43+
private static final Logger log = LoggerFactory.getLogger(Stack.class);
4444
private static final long serialVersionUID = 3L;
4545

4646
private long[] pstack;

net.tascalate.javaflow.api/src/main/java/org/apache/commons/javaflow/core/StackRecorder.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
public final class StackRecorder extends Stack {
3636

37-
private static final Logger log = LoggerFactory.getLogger(StackRecorder.class);
37+
private static final Logger log = LoggerFactory.getLogger(StackRecorder.class);
3838
private static final long serialVersionUID = 3L;
3939

4040
private static final ThreadLocal<StackRecorder> threadMap = new ThreadLocal<StackRecorder>();
@@ -98,24 +98,24 @@ public static Object suspend(SuspendResult value) {
9898
// flow breaks here, actual return will be executed in resumed continuation
9999
// return in continuation to be suspended is executed as well but ignored
100100
if (needCheckExit) {
101-
stackRecorder.parameter.checkExit();
101+
stackRecorder.parameter.checkExit();
102102
}
103103
return stackRecorder.parameter.value();
104104
}
105105

106106
public SuspendResult execute(ResumeParameter parameter) {
107-
if (null == parameter) {
108-
throw new IllegalArgumentException("ResumeContext parameter may not be null");
109-
}
107+
if (null == parameter) {
108+
throw new IllegalArgumentException("ResumeContext parameter may not be null");
109+
}
110110
StackRecorder old = registerThread();
111111
try {
112112
isRestoring = !isEmpty(); // start restoring if we have a filled stack
113113
this.parameter = parameter;
114114

115115
if (isRestoring) {
116-
if (log.isDebugEnabled()) {
117-
log.debug("Restoring state of " + ReflectionUtils.descriptionOfObject(runnable));
118-
}
116+
if (log.isDebugEnabled()) {
117+
log.debug("Restoring state of " + ReflectionUtils.descriptionOfObject(runnable));
118+
}
119119
}
120120

121121
log.debug("calling runnable");
@@ -137,26 +137,26 @@ public SuspendResult execute(ResumeParameter parameter) {
137137
// for this, so throw it away
138138
final Object ref = popReference();
139139
if (runnable != ref) {
140-
throw new IllegalStateException(
141-
"Stack corruption on suspend (invalid reference). " +
142-
"Is " + ReflectionUtils.descriptionOfClass(runnable) +
143-
" instrumented for javaflow?"
144-
);
140+
throw new IllegalStateException(
141+
"Stack corruption on suspend (invalid reference). " +
142+
"Is " + ReflectionUtils.descriptionOfClass(runnable) +
143+
" instrumented for javaflow?"
144+
);
145145
}
146146
return this.result;
147147
} else {
148-
if (!isEmpty()) {
149-
throw new IllegalStateException(
150-
"Stack corruption on exit (non-empty stack). " +
151-
"Is " + ReflectionUtils.descriptionOfClass(runnable) +
152-
" instrumented for javaflow?"
153-
);
154-
}
148+
if (!isEmpty()) {
149+
throw new IllegalStateException(
150+
"Stack corruption on exit (non-empty stack). " +
151+
"Is " + ReflectionUtils.descriptionOfClass(runnable) +
152+
" instrumented for javaflow?"
153+
);
154+
}
155155
return SuspendResult.EXIT; // nothing more to continue
156156
}
157157
} catch(ContinuationDeath cd) {
158158
// this isn't an error, so no need to log
159-
return SuspendResult.EXIT;
159+
return SuspendResult.EXIT;
160160
} catch(Error e) {
161161
log.error(e.getMessage(), e);
162162
throw e;
@@ -171,7 +171,7 @@ public SuspendResult execute(ResumeParameter parameter) {
171171
}
172172

173173
public static void exit() {
174-
throw ContinuationDeath.INSTANCE;
174+
throw ContinuationDeath.INSTANCE;
175175
}
176176

177177
/**

net.tascalate.javaflow.providers.asm3/src/main/java/org/apache/commons/javaflow/providers/asm3/Asm3ContinuableClassInfoResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public boolean isContinuableAnnotation(String annotationClassDescriptor) {
123123
case UNKNON:
124124
markProcessedAnnotation(annotationClassDescriptor);
125125

126-
final Type type = Type.getType(annotationClassDescriptor);
126+
final Type type = Type.getType(annotationClassDescriptor);
127127
try {
128128
InputStream annotationBytes= resourceLoader.getResourceAsStream(type.getInternalName() + ".class");
129129
try {

net.tascalate.javaflow.providers.asm4/src/main/java/org/apache/commons/javaflow/providers/asm4/Asm4ContinuableClassInfoResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public boolean isContinuableAnnotation(String annotationClassDescriptor) {
123123
case UNKNON:
124124
markProcessedAnnotation(annotationClassDescriptor);
125125

126-
final Type type = Type.getType(annotationClassDescriptor);
126+
final Type type = Type.getType(annotationClassDescriptor);
127127
try {
128128
InputStream annotationBytes= resourceLoader.getResourceAsStream(type.getInternalName() + ".class");
129129
try {

net.tascalate.javaflow.providers.asm5/src/main/java/org/apache/commons/javaflow/providers/asm5/Asm5ContinuableClassInfoResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public boolean isContinuableAnnotation(String annotationClassDescriptor) {
123123
case UNKNON:
124124
markProcessedAnnotation(annotationClassDescriptor);
125125

126-
final Type type = Type.getType(annotationClassDescriptor);
126+
final Type type = Type.getType(annotationClassDescriptor);
127127
try {
128128
InputStream annotationBytes= resourceLoader.getResourceAsStream(type.getInternalName() + ".class");
129129
try {

net.tascalate.javaflow.providers.asmx/src/main/java/org/apache/commons/javaflow/providers/asmx/AsmxContinuableClassInfoResolver.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ public ContinuableClassInfo resolve(String classInternalName) throws IOException
5757
try {
5858
return resolveContinuableClassInfo(classInternalName, new ClassReader(classBytes));
5959
} finally {
60-
if (null != classBytes)
60+
if (null != classBytes) {
6161
try { classBytes.close(); } catch (IOException exIgnore) {}
62+
}
6263
}
6364
}
6465

@@ -71,9 +72,9 @@ private ContinuableClassInfo resolveContinuableClassInfo(String classInternalNam
7172

7273
if (maybeContinuableClassVisitor.isContinuable()) {
7374
classInfo = new ContinuableClassInfoInternal(
74-
maybeContinuableClassVisitor.isProcessed(),
75-
maybeContinuableClassVisitor.continuableMethods
76-
);
75+
maybeContinuableClassVisitor.isProcessed(),
76+
maybeContinuableClassVisitor.continuableMethods
77+
);
7778
} else {
7879
classInfo = UNSUPPORTED_CLASS_INFO;
7980
}
@@ -124,7 +125,7 @@ public boolean isContinuableAnnotation(String annotationClassDescriptor) {
124125
case UNKNON:
125126
markProcessedAnnotation(annotationClassDescriptor);
126127

127-
final Type type = Type.getType(annotationClassDescriptor);
128+
final Type type = Type.getType(annotationClassDescriptor);
128129
try {
129130
InputStream annotationBytes= resourceLoader.getResourceAsStream(type.getInternalName() + ".class");
130131
try {

net.tascalate.javaflow.tools.ant/src/main/java/org/apache/commons/javaflow/ant/AntRewriteTask.java

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,30 @@
4444
*/
4545
public class AntRewriteTask extends MatchingTask {
4646

47-
private RewritingUtils.TransformerType transformerType;
47+
private RewritingUtils.TransformerType transformerType;
4848

49-
private File dstDir;
50-
private File srcDir;
51-
private Path compileClasspath;
49+
private File dstDir;
50+
private File srcDir;
51+
private Path compileClasspath;
5252

5353
/**
5454
* Directory to which the transformed files will be written.
5555
* This can be the same as the source directory.
5656
*
5757
* @param pFile destination directory
5858
*/
59-
public void setDestdir(final File pFile) {
59+
public void setDestdir(File pFile) {
6060
dstDir = pFile;
6161
}
62-
62+
6363
/**
6464
* Directory from which the input files are read.
6565
* This and the inherited MatchingTask forms an implicit
6666
* FileSet.
6767
*
6868
* @param pFile source directory
6969
*/
70-
public void setSrcDir(final File pFile) {
70+
public void setSrcDir(File pFile) {
7171
srcDir = pFile;
7272
fileset.setDir(srcDir);
7373
}
@@ -84,11 +84,11 @@ public void setSrcDir(final File pFile) {
8484
* "ASM5". Case insensitive.
8585
*/
8686
public void setMode(String name) {
87-
try {
88-
RewritingUtils.TransformerType.valueOf(name.toUpperCase());
89-
} catch (final RuntimeException ex) {
90-
throw new BuildException("Unrecognized mode: " + name);
91-
}
87+
try {
88+
RewritingUtils.TransformerType.valueOf(name.toUpperCase());
89+
} catch (RuntimeException ex) {
90+
throw new BuildException("Unrecognized mode: " + name);
91+
}
9292
}
9393

9494

@@ -97,7 +97,7 @@ public void setMode(String name) {
9797
*
9898
* @param classpath an Ant Path object containing the compilation classpath.
9999
*/
100-
public void setClasspath(final Path classpath) {
100+
public void setClasspath(Path classpath) {
101101
if (compileClasspath == null) {
102102
compileClasspath = classpath;
103103
} else {
@@ -128,10 +128,10 @@ public Path createClasspath() {
128128
* Adds a reference to a classpath defined elsewhere.
129129
* @param r a reference to a classpath
130130
*/
131-
public void setClasspathRef(final Reference r) {
131+
public void setClasspathRef(Reference r) {
132132
createClasspath().setRefid(r);
133133
}
134-
134+
135135
/**
136136
* Check that all required attributes have been set and nothing
137137
* silly has been entered.
@@ -143,7 +143,7 @@ protected void checkParameters() throws BuildException {
143143
checkDir(dstDir,"dstDir");
144144
}
145145

146-
private void checkDir(final File pDir, final String pDescription) {
146+
private void checkDir(File pDir, String pDescription) {
147147
if (pDir == null) {
148148
throw new BuildException("no " + pDescription + " directory is specified", getLocation());
149149
}
@@ -154,30 +154,30 @@ private void checkDir(final File pDir, final String pDescription) {
154154
throw new BuildException(pDescription + " directory \"" + pDir + "\" is not a directory", getLocation());
155155
}
156156
}
157-
157+
158158
public void execute() throws BuildException {
159-
final DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
160-
final String[] fileNames = ds.getIncludedFiles();
159+
DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
160+
String[] fileNames = ds.getIncludedFiles();
161161
try {
162-
createClasspath();
163-
164-
final List<URL> classPath = new ArrayList<URL>();
165-
for (final Iterator<Resource> i = compileClasspath.iterator(); i.hasNext();) {
166-
final FileResource resource = (FileResource)i.next();
167-
classPath.add( resource.getFile().toURI().toURL() );
168-
}
169-
170-
final List<URL> classPathByDir = new ArrayList<URL>(classPath);
171-
classPathByDir.add(srcDir.toURI().toURL());
172-
173-
final ResourceTransformer dirTransformer = RewritingUtils.createTransformer(
174-
classPathByDir.toArray(new URL[]{}),
175-
transformerType
176-
);
177-
178-
for (final String fileName : fileNames) {
179-
final File source = new File(srcDir, fileName);
180-
final File destination = new File(dstDir, fileName);
162+
createClasspath();
163+
164+
List<URL> classPath = new ArrayList<URL>();
165+
for (Iterator<Resource> i = compileClasspath.iterator(); i.hasNext();) {
166+
FileResource resource = (FileResource)i.next();
167+
classPath.add( resource.getFile().toURI().toURL() );
168+
}
169+
170+
List<URL> classPathByDir = new ArrayList<URL>(classPath);
171+
classPathByDir.add(srcDir.toURI().toURL());
172+
173+
ResourceTransformer dirTransformer = RewritingUtils.createTransformer(
174+
classPathByDir.toArray(new URL[]{}),
175+
transformerType
176+
);
177+
178+
for (String fileName : fileNames) {
179+
File source = new File(srcDir, fileName);
180+
File destination = new File(dstDir, fileName);
181181

182182
if (!destination.getParentFile().exists()) {
183183
log("Creating dir: " + destination.getParentFile(), Project.MSG_VERBOSE);
@@ -190,7 +190,7 @@ public void execute() throws BuildException {
190190
}
191191

192192
if (fileName.endsWith(".class")) {
193-
log("Rewriting " + source + " to " + destination, Project.MSG_VERBOSE);
193+
log("Rewriting " + source + " to " + destination, Project.MSG_VERBOSE);
194194
// System.out.println("Rewriting " + source);
195195

196196
RewritingUtils.rewriteClassFile( source, dirTransformer, destination );
@@ -200,26 +200,26 @@ public void execute() throws BuildException {
200200
|| fileName.endsWith(".ear")
201201
|| fileName.endsWith(".zip")
202202
|| fileName.endsWith(".war")) {
203-
203+
204204
log("Rewriting " + source + " to " + destination, Project.MSG_VERBOSE);
205205

206-
final List<URL> classPathByJar = new ArrayList<URL>(classPath);
207-
classPathByJar.add(source.toURI().toURL());
208-
final ResourceTransformer jarTransformer = RewritingUtils.createTransformer(
209-
classPathByJar.toArray(new URL[]{}),
210-
transformerType
206+
List<URL> classPathByJar = new ArrayList<URL>(classPath);
207+
classPathByJar.add(source.toURI().toURL());
208+
ResourceTransformer jarTransformer = RewritingUtils.createTransformer(
209+
classPathByJar.toArray(new URL[]{}),
210+
transformerType
211211
);
212212

213213
RewritingUtils.rewriteJar(
214-
new JarInputStream(new FileInputStream(source)),
215-
jarTransformer,
216-
new JarOutputStream(new FileOutputStream(destination))
214+
new JarInputStream(new FileInputStream(source)),
215+
jarTransformer,
216+
new JarOutputStream(new FileOutputStream(destination))
217217
);
218218

219219
}
220220
}
221221
} catch (IOException e) {
222-
throw new BuildException(e);
222+
throw new BuildException(e);
223223
}
224224
}
225225
}

net.tascalate.javaflow.tools.cdi-javaagent/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
requires net.tascalate.asmx.commons;
2323
requires net.tascalate.asmx.tree;
2424
requires net.tascalate.asmx.tree.analysis;
25-
25+
2626
requires net.tascalate.javaflow.spi;
2727
requires net.tascalate.javaflow.providers.asmx;
2828

0 commit comments

Comments
 (0)