mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Fix minor warnings:
remove unnecessary generic type for collections, replace Charset.forName on StandartCharset
This commit is contained in:
parent
dbe761e738
commit
59a5182dab
@ -111,7 +111,7 @@ public class ProcessorSuiteRunner extends ParentRunner<ProcessorTestCase> {
|
|||||||
|
|
||||||
private List<ProcessorTestCase> initializeTestCases(ProcessorSuite suite,
|
private List<ProcessorTestCase> initializeTestCases(ProcessorSuite suite,
|
||||||
Constructor<? extends CommandLineEnhancer> cliEnhancerConstructor) {
|
Constructor<? extends CommandLineEnhancer> cliEnhancerConstructor) {
|
||||||
List<ProcessorType> types = new ArrayList<ProcessorType>();
|
List<ProcessorType> types = new ArrayList<>();
|
||||||
|
|
||||||
for ( ProcessorType compiler : suite.processorTypes() ) {
|
for ( ProcessorType compiler : suite.processorTypes() ) {
|
||||||
if ( compiler.getIncluded().length > 0 ) {
|
if ( compiler.getIncluded().length > 0 ) {
|
||||||
@ -190,7 +190,7 @@ public class ProcessorSuiteRunner extends ParentRunner<ProcessorTestCase> {
|
|||||||
verifier = new Verifier( destination.getCanonicalPath() );
|
verifier = new Verifier( destination.getCanonicalPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> goals = new ArrayList<String>( 3 );
|
List<String> goals = new ArrayList<>( 3 );
|
||||||
|
|
||||||
goals.add( "clean" );
|
goals.add( "clean" );
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public abstract class HelperMethod implements Method {
|
|||||||
* @return the types used by this method for which import statements need to be generated
|
* @return the types used by this method for which import statements need to be generated
|
||||||
*/
|
*/
|
||||||
public Set<Type> getImportTypes() {
|
public Set<Type> getImportTypes() {
|
||||||
return Collections.<Type>emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,12 +153,12 @@ public class Strings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int c = 1;
|
int c = 1;
|
||||||
String seperator = Character.isDigit( name.charAt( name.length() - 1 ) ) ? "_" : "";
|
String separator = Character.isDigit( name.charAt( name.length() - 1 ) ) ? "_" : "";
|
||||||
while ( conflictingNames.contains( name + seperator + c ) ) {
|
while ( conflictingNames.contains( name + separator + c ) ) {
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return name + seperator + c;
|
return name + separator + c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@ import java.io.InputStreamReader;
|
|||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -62,16 +62,13 @@ public class ModelWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writeModel(FileObject sourceFile, Writable model) {
|
public void writeModel(FileObject sourceFile, Writable model) {
|
||||||
try {
|
try ( BufferedWriter writer = new BufferedWriter( new IndentationCorrectingWriter( sourceFile.openWriter() ))) {
|
||||||
BufferedWriter writer = new BufferedWriter( new IndentationCorrectingWriter( sourceFile.openWriter() ) );
|
Map<Class<?>, Object> values = new HashMap<>();
|
||||||
|
values.put( Configuration.class, CONFIGURATION );
|
||||||
|
|
||||||
Map<Class<?>, Object> values = new HashMap<>();
|
model.write( new DefaultModelElementWriterContext( values ), writer );
|
||||||
values.put( Configuration.class, CONFIGURATION );
|
|
||||||
|
|
||||||
model.write( new DefaultModelElementWriterContext( values ), writer );
|
writer.flush();
|
||||||
|
|
||||||
writer.flush();
|
|
||||||
writer.close();
|
|
||||||
}
|
}
|
||||||
catch ( RuntimeException e ) {
|
catch ( RuntimeException e ) {
|
||||||
throw e;
|
throw e;
|
||||||
@ -100,7 +97,7 @@ public class ModelWriter {
|
|||||||
|
|
||||||
InputStream is = connection.getInputStream();
|
InputStream is = connection.getInputStream();
|
||||||
|
|
||||||
return new InputStreamReader( is, Charset.forName( "UTF-8" ) );
|
return new InputStreamReader( is, StandardCharsets.UTF_8 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user