Skip to content

Commit

Permalink
chore: Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
micka-lama authored and I-Al-Istannen committed Nov 1, 2024
1 parent f4fc927 commit 2c1283f
Show file tree
Hide file tree
Showing 638 changed files with 9,063 additions and 9,733 deletions.
19 changes: 9 additions & 10 deletions src/main/java/spoon/ContractVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
package spoon;


import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Deque;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import spoon.reflect.CtModelImpl;
import spoon.reflect.code.CtArrayWrite;
import spoon.reflect.code.CtAssignment;
Expand Down Expand Up @@ -49,16 +58,6 @@
import spoon.support.sniper.internal.ElementSourceFragment;
import spoon.support.visitor.equals.EqualsVisitor;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Deque;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;

import static spoon.testing.utils.Check.assertNotNull;

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/spoon/FluentLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import java.io.File;
import java.nio.charset.Charset;

import spoon.processing.Processor;
import spoon.reflect.CtModel;
import spoon.reflect.declaration.CtElement;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/spoon/IncrementalLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.apache.commons.io.filefilter.SuffixFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.codehaus.plexus.util.CollectionUtils;

import spoon.reflect.cu.CompilationUnit;
import spoon.reflect.declaration.CtPackage;
import spoon.reflect.declaration.CtType;
Expand Down
25 changes: 12 additions & 13 deletions src/main/java/spoon/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
import com.martiansoftware.jsap.Switch;
import com.martiansoftware.jsap.stringparsers.EnumeratedStringParser;
import com.martiansoftware.jsap.stringparsers.FileStringParser;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -43,18 +54,6 @@
import spoon.support.compiler.jdt.JDTBasedSpoonCompiler;
import spoon.support.gui.SpoonModelTree;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.ResourceBundle;

import static spoon.support.StandardEnvironment.DEFAULT_CODE_COMPLIANCE_LEVEL;

/**
Expand Down Expand Up @@ -94,7 +93,7 @@ enum CLASSPATH_MODE {

/**
* This field is used to ensure that {@link #setArgs(String[])} is only called once.
*/
*/
private boolean processed = false;

/**
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/spoon/MavenLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
*/
package spoon;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spoon.support.compiler.SpoonPom;

import java.io.File;
import java.lang.invoke.MethodHandles;
import java.util.List;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spoon.support.compiler.SpoonPom;

/**
* Create a Spoon launcher from a maven pom file
Expand Down
1 change: 0 additions & 1 deletion src/main/java/spoon/OutputType.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package spoon;

import java.util.Locale;

import org.jspecify.annotations.Nullable;

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/spoon/SpoonAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package spoon;

import java.io.File;

import spoon.compiler.Environment;
import spoon.processing.Processor;
import spoon.reflect.CtModel;
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/spoon/SpoonModelBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
package spoon;

import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import spoon.compiler.SpoonResource;
import spoon.compiler.builder.JDTBuilder;
import spoon.processing.Processor;
Expand All @@ -19,11 +23,6 @@
import spoon.support.compiler.jdt.FileCompilerConfig;
import spoon.support.compiler.jdt.JDTBatchCompiler;

import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
* Responsible for building a spoon model from Java source code.
*
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/spoon/compiler/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
*/
package spoon.compiler;

import java.io.File;
import java.nio.charset.Charset;
import java.util.List;
import java.util.function.Supplier;
import org.jspecify.annotations.Nullable;
import spoon.OutputType;
import spoon.compiler.builder.EncodingProvider;
import spoon.processing.FileGenerator;
Expand All @@ -23,13 +28,6 @@
import spoon.support.modelobs.FineModelChangeListener;
import spoon.support.sniper.SniperJavaPrettyPrinter;

import java.io.File;
import java.nio.charset.Charset;
import java.util.List;
import java.util.function.Supplier;

import org.jspecify.annotations.Nullable;

/**
* This interface represents the environment in which Spoon is launched -
* accessible through {@link spoon.reflect.factory.Factory#getEnvironment()}. Its
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/spoon/compiler/SpoonFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
*/
package spoon.compiler;

import spoon.SpoonException;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import spoon.SpoonException;

/**
* This interface represents files that can be used as resources for the Spoon
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/spoon/compiler/SpoonResourceHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
*/
package spoon.compiler;

import spoon.Launcher;
import spoon.support.compiler.FileSystemFile;
import spoon.support.compiler.FileSystemFolder;
import spoon.support.compiler.ZipFolder;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import spoon.Launcher;
import spoon.support.compiler.FileSystemFile;
import spoon.support.compiler.FileSystemFolder;
import spoon.support.compiler.ZipFolder;

/**
* This class defines a helper for manipulating resources.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/spoon/compiler/builder/EncodingProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
package spoon.compiler.builder;

import spoon.compiler.SpoonFile;
import java.nio.charset.Charset;
import spoon.compiler.SpoonFile;

public interface EncodingProvider {

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/spoon/compiler/builder/SourceOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
*/
package spoon.compiler.builder;

import spoon.compiler.SpoonFile;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import spoon.compiler.SpoonFile;

public class SourceOptions<T extends SourceOptions<T>> extends Options<T> {
public SourceOptions() {
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/spoon/experimental/SpoonifierVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
*/
package spoon.experimental;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringEscapeUtils;
import spoon.reflect.code.CtBinaryOperator;
import spoon.reflect.code.CtComment;
Expand All @@ -32,14 +39,6 @@
import spoon.reflect.visitor.CtInheritanceScanner;
import spoon.reflect.visitor.CtScanner;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Visitor that generates factory calls to recreate the AST visited.
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/spoon/experimental/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
* this is unstable code, subject to potential complete redesign, not only in snapshots but also in releases. you can use this code but you'll probably be impacted upon future changes.
*/
package spoon.experimental;

3 changes: 2 additions & 1 deletion src/main/java/spoon/javadoc/internal/Javadoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package spoon.javadoc.internal;

import static spoon.javadoc.internal.JavadocInlineTag.nextWord;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -25,6 +24,8 @@
import org.apache.commons.lang3.tuple.Pair;
import spoon.reflect.code.CtComment;

import static spoon.javadoc.internal.JavadocInlineTag.nextWord;

/**
* The structured content of a single Javadoc comment.
*
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/spoon/javadoc/internal/JavadocBlockTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
*/
package spoon.javadoc.internal;

import spoon.reflect.code.CtJavaDocTag;

import java.io.Serializable;
import spoon.reflect.code.CtJavaDocTag;

/**
* A block tag.
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/spoon/metamodel/MMMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
*/
package spoon.metamodel;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import spoon.SpoonException;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.reference.CtTypeReference;
import spoon.support.adaption.TypeAdaptor;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* Represents a method used to get or set a {@link MetamodelProperty} of a {@link MetamodelConcept}.
*/
Expand Down
1 change: 0 additions & 1 deletion src/main/java/spoon/metamodel/MMMethodKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package spoon.metamodel;

import java.util.function.Predicate;

import spoon.SpoonException;
import spoon.reflect.declaration.CtField;
import spoon.reflect.declaration.CtMethod;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/spoon/metamodel/Metamodel.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jspecify.annotations.Nullable;

import spoon.Launcher;
import spoon.SpoonException;
import spoon.reflect.annotations.PropertyGetter;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/spoon/metamodel/MetamodelConcept.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
*/
package spoon.metamodel;

import static spoon.metamodel.Metamodel.addUniqueObject;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import spoon.SpoonException;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtInterface;
Expand All @@ -24,6 +21,8 @@
import spoon.reflect.path.CtRole;
import spoon.support.adaption.TypeAdaptor;

import static spoon.metamodel.Metamodel.addUniqueObject;

/**
* Represents a concept of the Spoon metamodel (eg {@link CtClass}).
*/
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/spoon/metamodel/MetamodelProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
*/
package spoon.metamodel;

import static spoon.metamodel.Metamodel.addUniqueObject;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
Expand All @@ -20,9 +18,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jspecify.annotations.Nullable;

import spoon.SpoonException;
import spoon.reflect.declaration.CtField;
import spoon.reflect.declaration.CtMethod;
Expand All @@ -38,6 +34,8 @@
import spoon.support.UnsettableProperty;
import spoon.support.util.RtHelper;

import static spoon.metamodel.Metamodel.addUniqueObject;

/**
* Represents a property of the Spoon metamodel.
* A property:
Expand Down
Loading

0 comments on commit 2c1283f

Please sign in to comment.