Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Use <> where we can
  • Loading branch information
rhowe committed Sep 11, 2021
commit dc65ae3e4929c7c034789d8a4f005fa083c55d8a
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public abstract class AbstractSourceInclusionScanner
implements SourceInclusionScanner
{
private final List<SourceMapping> sourceMappings = new ArrayList<SourceMapping>();
private final List<SourceMapping> sourceMappings = new ArrayList<>();

public final void addSourceMapping( SourceMapping sourceMapping )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void setUp()
super.setUp();

includes = Collections.singleton( "*.java" );
excludes = new HashSet<String>();
excludes = new HashSet<>();
scanner = new SimpleSourceInclusionScanner( includes, excludes );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testShouldReturnOneClassFileAndOneXmlFileForSingleJavaFile()

File basedir = new File( "." );

Set<String> targets = new HashSet<String>();
Set<String> targets = new HashSet<>();
targets.add( ".class" );
targets.add( ".xml" );

Expand All @@ -88,7 +88,7 @@ public void testShouldReturnNoTargetFilesWhenSourceFileHasWrongSuffix()

File basedir = new File( "." );

Set<String> targets = new HashSet<String>();
Set<String> targets = new HashSet<>();
targets.add( ".class" );
targets.add( ".xml" );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private AjBuildConfig buildCompilerConfig( CompilerConfiguration config )
// buildConfig.setJavaOptions( javaOpts );
}

List<String> cp = new LinkedList<String>( config.getClasspathEntries() );
List<String> cp = new LinkedList<>( config.getClasspathEntries() );

File javaHomeDir = new File( System.getProperty( "java.home" ) );
File[] jars = new File( javaHomeDir, "lib" ).listFiles();
Expand Down Expand Up @@ -395,7 +395,7 @@ private AjBuildConfig buildCompilerConfig( CompilerConfiguration config )
checkForAspectJRT( cp );
if ( cp != null && !cp.isEmpty() )
{
List<String> elements = new ArrayList<String>( cp.size() );
List<String> elements = new ArrayList<>( cp.size() );
for ( String path : cp )
{
elements.add( ( new File( path ) ).getAbsolutePath() );
Expand Down Expand Up @@ -489,7 +489,7 @@ private List<CompilerMessage> compileInProcess( AjBuildConfig buildConfig )

boolean errors = messageHandler.hasAnyMessage( IMessage.ERROR, true );

List<CompilerMessage> messages = new ArrayList<CompilerMessage>();
List<CompilerMessage> messages = new ArrayList<>();
if ( errors )
{
IMessage[] errorMessages = messageHandler.getMessages( IMessage.ERROR, true );
Expand Down Expand Up @@ -550,7 +550,7 @@ private void checkForAspectJRT( List<String> cp )

private List<File> buildFileList( List<String> locations )
{
List<File> fileList = new LinkedList<File>();
List<File> fileList = new LinkedList<>();
for ( String location : locations )
{
fileList.add( new File( location ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public Map<String, String> getAJOptions()

public void setSourcePathResources( Map<String, File> sourcePathResources )
{
this.sourcePathResources = new TreeMap<String, File>( sourcePathResources );
this.sourcePathResources = new TreeMap<>( sourcePathResources );
}

public Map<String, File> getSourcePathResources()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class JavacCompiler

private static volatile Class<?> JAVAC_CLASS;

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

// ----------------------------------------------------------------------
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public CompilerResult compileInProcess( String[] args, final CompilerConfigurati
}
final String sourceEncoding = config.getSourceEncoding();
final Charset sourceCharset = sourceEncoding == null ? null : Charset.forName( sourceEncoding );
final DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<JavaFileObject>();
final DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<>();
try ( final StandardJavaFileManager standardFileManager =
compiler.getStandardFileManager( collector, null, sourceCharset ) )
{
Expand All @@ -133,7 +133,7 @@ public CompilerResult compileInProcess( String[] args, final CompilerConfigurati
final JavaCompiler.CompilationTask task =
compiler.getTask( null, standardFileManager, collector, arguments, null, fileObjects );
final Boolean result = task.call();
final ArrayList<CompilerMessage> compilerMsgs = new ArrayList<CompilerMessage>();
final ArrayList<CompilerMessage> compilerMsgs = new ArrayList<>();
for ( Diagnostic<? extends JavaFileObject> diagnostic : collector.getDiagnostics() )
{
CompilerMessage.Kind kind = convertKind(diagnostic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void testJRuntimeArguments()
expectedArguments.add( "1.3" );

// customCompilerArguments
Map<String, String> customCompilerArguments = new LinkedHashMap<String, String>();
Map<String, String> customCompilerArguments = new LinkedHashMap<>();
customCompilerArguments.put( "-J-Duser.language=en_us", null );
compilerConfiguration.setCustomCompilerArgumentsAsMap( customCompilerArguments );
// don't expect this argument!!
Expand Down Expand Up @@ -494,7 +494,7 @@ private void populateArguments( CompilerConfiguration compilerConfiguration, Lis

// classpathEntires

List<String> classpathEntries = new ArrayList<String>();
List<String> classpathEntries = new ArrayList<>();

classpathEntries.add( "/myjar1.jar" );

Expand All @@ -508,7 +508,7 @@ private void populateArguments( CompilerConfiguration compilerConfiguration, Lis

// sourceRoots

List<String> compileSourceRoots = new ArrayList<String>();
List<String> compileSourceRoots = new ArrayList<>();

compileSourceRoots.add( "/src/main/one" );

Expand Down Expand Up @@ -580,7 +580,7 @@ private void populateArguments( CompilerConfiguration compilerConfiguration, Lis

// customerCompilerArguments

Map<String, String> customerCompilerArguments = new LinkedHashMap<String, String>();
Map<String, String> customerCompilerArguments = new LinkedHashMap<>();

customerCompilerArguments.put( "arg1", null );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public void testCRLF_windows()
List<CompilerMessage> compilerMessages =
JavacCompiler.parseModernStream( 0, new BufferedReader( new StringReader( errors ) ) );
assertEquals( "count", 187, compilerMessages.size() );
List<CompilerMessage> compilerErrors = new ArrayList<CompilerMessage>( 3 );
List<CompilerMessage> compilerErrors = new ArrayList<>( 3 );
for ( CompilerMessage message : compilerMessages ) {
if ( message.getKind() != CompilerMessage.Kind.OTHER ) {
compilerErrors.add( message );
Expand Down