Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor cleanup #198

Merged
merged 2 commits into from
Mar 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public abstract class AbstractCompiler

protected static final String PS = System.getProperty( "path.separator" );

private CompilerOutputStyle compilerOutputStyle;
private final CompilerOutputStyle compilerOutputStyle;

private String inputFileEnding;
private final String inputFileEnding;

private String outputFileEnding;
private final String outputFileEnding;

private String outputFile;
private final String outputFile;

// ----------------------------------------------------------------------
//
Expand Down Expand Up @@ -152,7 +152,7 @@ protected static Set<String> getSourceFilesForSourceRoot( CompilerConfiguration

if ( includes != null && !includes.isEmpty() )
{
String[] inclStrs = includes.toArray( new String[includes.size()] );
String[] inclStrs = includes.toArray( new String[0] );
scanner.setIncludes( inclStrs );
}
else
Expand All @@ -164,7 +164,7 @@ protected static Set<String> getSourceFilesForSourceRoot( CompilerConfiguration

if ( excludes != null && !excludes.isEmpty() )
{
String[] exclStrs = excludes.toArray( new String[excludes.size()] );
String[] exclStrs = excludes.toArray( new String[0] );
scanner.setExcludes( exclStrs );
}

Expand Down Expand Up @@ -213,7 +213,7 @@ protected static String[] getSourceFiles( CompilerConfiguration config )
}
else
{
result = sources.toArray( new String[sources.size()] );
result = sources.toArray( new String[0] );
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,8 @@ public enum Kind
*/
WARNING( "warning" );

private String type;

private Kind( final String type )
Kind( String type )
olamy marked this conversation as resolved.
Show resolved Hide resolved
{
this.type = type;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public String toString()

public boolean equals( Object other )
{
if ( other == null || !( other instanceof CompilerOutputStyle ) )
if ( !( other instanceof CompilerOutputStyle ) )
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public class StreamPumper
{
private static final int BUFFER_SIZE = 512;

private BufferedInputStream stream;
private final BufferedInputStream stream;

private boolean endOfStream = false;

private int SLEEP_TIME = 5;

private OutputStream out;
private final OutputStream out;

public StreamPumper( BufferedInputStream is, OutputStream out )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected String[] scanForSources( File sourceDir, Set<String> sourceIncludes, S
}
else
{
includes = sourceIncludes.toArray( new String[sourceIncludes.size()] );
includes = sourceIncludes.toArray( new String[0] );
}

ds.setIncludes( includes );
Expand All @@ -68,7 +68,7 @@ protected String[] scanForSources( File sourceDir, Set<String> sourceIncludes, S
}
else
{
excludes = sourceExcludes.toArray( new String[sourceExcludes.size()] );
excludes = sourceExcludes.toArray( new String[0] );
}

ds.setExcludes( excludes );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
public class SimpleSourceInclusionScanner
extends AbstractSourceInclusionScanner
{
private Set<String> sourceIncludes;
private final Set<String> sourceIncludes;

private Set<String> sourceExcludes;
private final Set<String> sourceExcludes;

public SimpleSourceInclusionScanner( Set<String> sourceIncludes, Set<String> sourceExcludes )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public class StaleSourceScanner

public StaleSourceScanner()
{
this( 0, Collections.singleton( "**/*" ), Collections.<String>emptySet() );
this( 0, Collections.singleton( "**/*" ), Collections.emptySet() );
}

public StaleSourceScanner( long lastUpdatedWithinMsecs )
{
this( lastUpdatedWithinMsecs, Collections.singleton( "**/*" ), Collections.<String>emptySet() );
this( lastUpdatedWithinMsecs, Collections.singleton( "**/*" ), Collections.emptySet() );
}

public StaleSourceScanner( long lastUpdatedWithinMsecs, Set<String> sourceIncludes, Set<String> sourceExcludes )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
public class SingleTargetSourceMapping
implements SourceMapping
{
private String sourceSuffix;
private final String sourceSuffix;

private String outputFile;
private final String outputFile;

public SingleTargetSourceMapping( String sourceSuffix, String outputFile )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class JavacCompiler

private static volatile Class<?> JAVAC_CLASS;

private List<Class<?>> javaccClasses = new CopyOnWriteArrayList<>();
private final List<Class<?>> javaccClasses = new CopyOnWriteArrayList<>();

@Requirement
private InProcessCompiler inProcessCompiler;
Expand Down Expand Up @@ -432,7 +432,7 @@ else if ( !suppressSource( config ) )
args.add( value );
}

return args.toArray( new String[args.size()] );
return args.toArray( new String[0] );
}

/**
Expand Down