Skip to content

Commit

Permalink
fix spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed May 29, 2020
1 parent 6e9421e commit f67cad3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ private void updateJavadocComment( final StringBuilder sb, final String original
}
}

private static final Pattern REPLACE_LINK_TAGS_PATTERN = Pattern.compile("\\{@link\\s");
private static final Pattern REPLACE_LINK_TAGS_PATTERN = Pattern.compile( "\\{@link\\s" );

static String replaceLinkTags( String comment, JavaAnnotatedElement entity )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2253,9 +2253,9 @@ protected Map<Path, Collection<String>> getFiles( Collection<Path> sourcePaths )
for ( Path sourcePath : sourcePaths )
{
File sourceDirectory = sourcePath.toFile();
List<String> files = new ArrayList<>(JavadocUtil.getFilesFromSource(sourceDirectory,
List<String> files = new ArrayList<>( JavadocUtil.getFilesFromSource( sourceDirectory,
sourceFileIncludes, sourceFileExcludes,
excludedPackages));
excludedPackages ) );

if ( source != null && JavaVersion.parse( source ).isBefore( "9" )
&& files.remove( "module-info.java" ) )
Expand Down Expand Up @@ -6067,9 +6067,9 @@ private URL getResource( final List<String> classPath, final String resource )
}
}
URL resourceURL = null;
try (URLClassLoader javadocClassLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]), null)) {
resourceURL = javadocClassLoader.getResource(resource);
} catch (IOException e) {
try ( URLClassLoader javadocClassLoader = new URLClassLoader( urls.toArray( new URL[urls.size()] ), null ) ) {
resourceURL = javadocClassLoader.getResource( resource );
} catch ( IOException e ) {
// ignore
}
return resourceURL;
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,24 @@ protected static String quotedPathArgument( String value )
if ( StringUtils.isNotEmpty( path ) )
{
path = path.replace( '\\', '/' );
if ( path.contains("'") )
if ( path.contains( "'" ) )
{
StringBuilder pathBuilder = new StringBuilder();
pathBuilder.append('\'');
String[] split = path.split("'");
pathBuilder.append( '\'' );
String[] split = path.split( "'" );

for ( int i = 0; i < split.length; i++ )
{
if ( i != split.length - 1 )
{
pathBuilder.append(split[i]).append("\\'");
pathBuilder.append( split[i] ).append( "\\'" );
}
else
{
pathBuilder.append(split[i]);
pathBuilder.append( split[i] );
}
}
pathBuilder.append('\'');
pathBuilder.append( '\'' );
path = pathBuilder.toString();
} else {
path = "'" + path + "'";
Expand Down Expand Up @@ -475,7 +475,7 @@ protected static List<String> getFilesFromSource( File sourceDirectory, List<Str
List<String> files = new ArrayList<>();
if ( fileList.length != 0 )
{
files.addAll(getIncludedFiles(sourceDirectory, fileList, excludePackages));
files.addAll( getIncludedFiles( sourceDirectory, fileList, excludePackages ) );
}

return files;
Expand Down Expand Up @@ -518,7 +518,7 @@ protected static JavaVersion getJavadocVersion( File javadocExe )
{
StringBuilder msg = new StringBuilder( "Exit code: " + exitCode + " - " + err.getOutput() );
msg.append( '\n' );
msg.append("Command line was:").append(CommandLineUtils.toString(cmd.getCommandline()));
msg.append( "Command line was:" ).append( CommandLineUtils.toString( cmd.getCommandline() ) );
throw new CommandLineException( msg.toString() );
}

Expand All @@ -534,7 +534,7 @@ else if ( StringUtils.isNotEmpty( out.getOutput() ) )
throw new IllegalArgumentException( "No output found from the command line 'javadoc -J-version'" );
}

private static final Pattern EXTRACT_JAVADOC_VERSION_PATTERN = Pattern.compile( "(?s).*?[^a-zA-Z](([0-9]+\\.?[0-9]*)(\\.[0-9]+)?).*" );
private static final Pattern EXTRACT_JAVADOC_VERSION_PATTERN = Pattern.compile( "(?s).*?[^a-zA-Z](([0-9]+\\.?[0-9]*)(\\.[0-9]+)?).*" );

/**
* Parse the output for 'javadoc -J-version' and return the javadoc version recognized. <br>
Expand Down Expand Up @@ -596,15 +596,15 @@ protected static String extractJavadocVersion( String output )
return matcher.group( 1 );
}

private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_0 = Pattern.compile( "^\\s*(\\d+)\\s*?\\s*$");
private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_0 = Pattern.compile( "^\\s*(\\d+)\\s*?\\s*$" );

private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_1 = Pattern.compile( "^\\s*(\\d+)\\s*k(b)?\\s*$", Pattern.CASE_INSENSITIVE);
private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_1 = Pattern.compile( "^\\s*(\\d+)\\s*k(b)?\\s*$", Pattern.CASE_INSENSITIVE );

private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_2 = Pattern.compile( "^\\s*(\\d+)\\s*m(b)?\\s*$", Pattern.CASE_INSENSITIVE);
private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_2 = Pattern.compile( "^\\s*(\\d+)\\s*m(b)?\\s*$", Pattern.CASE_INSENSITIVE );

private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_3 = Pattern.compile( "^\\s*(\\d+)\\s*g(b)?\\s*$", Pattern.CASE_INSENSITIVE);
private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_3 = Pattern.compile( "^\\s*(\\d+)\\s*g(b)?\\s*$", Pattern.CASE_INSENSITIVE );

private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_4 = Pattern.compile( "^\\s*(\\d+)\\s*t(b)?\\s*$", Pattern.CASE_INSENSITIVE);
private static final Pattern PARSE_JAVADOC_MEMORY_PATTERN_4 = Pattern.compile( "^\\s*(\\d+)\\s*t(b)?\\s*$", Pattern.CASE_INSENSITIVE );

/**
* Parse a memory string which be used in the JVM arguments <code>-Xms</code> or <code>-Xmx</code>. <br>
Expand Down Expand Up @@ -1158,7 +1158,7 @@ private static String getMavenHome( Log log )
{
if ( log != null && log.isErrorEnabled() )
{
log.error("Cannot find Maven application directory. Either specify 'maven.home' system property, or "
log.error( "Cannot find Maven application directory. Either specify 'maven.home' system property, or "
+ "M2_HOME environment variable." );
}
}
Expand Down Expand Up @@ -1236,7 +1236,7 @@ private static File getJavaHome( Log log )
{
if ( log != null && log.isErrorEnabled() )
{
log.error("Cannot find Java application directory. Either specify 'java.home' system property, or "
log.error( "Cannot find Java application directory. Either specify 'java.home' system property, or "
+ "JAVA_HOME environment variable." );
}
}
Expand Down Expand Up @@ -1827,7 +1827,7 @@ private static CloseableHttpClient createHttpClient( Settings settings, URL url
builder.setUserAgent( "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );

// Some server reject requests that do not have an Accept header
builder.setDefaultHeaders(Collections.singletonList(new BasicHeader(HttpHeaders.ACCEPT, "*/*")));
builder.setDefaultHeaders( Collections.singletonList( new BasicHeader( HttpHeaders.ACCEPT, "*/*" ) ) );

if ( settings != null && settings.getActiveProxy() != null )
{
Expand Down

0 comments on commit f67cad3

Please sign in to comment.