mirror of https://github.com/apache/maven.git
Test for empty locations and avoid printing them
This commit is contained in:
parent
bb916d0784
commit
ceb08cfa77
|
@ -153,7 +153,13 @@ class DefaultProblem
|
|||
|
||||
buffer.append( '[' ).append( getSeverity() ).append( "] " );
|
||||
buffer.append( getMessage() );
|
||||
buffer.append( " @ " ).append( getLocation() );
|
||||
String location = getLocation();
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
buffer.append( " @ " );
|
||||
buffer.append( location );
|
||||
}
|
||||
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ public class DefaultExceptionHandler
|
|||
|
||||
String location = ModelProblemUtils.formatLocation( problem, projectId );
|
||||
|
||||
if ( StringUtils.isNotEmpty( location ) )
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
message += " @ " + location;
|
||||
}
|
||||
|
|
|
@ -1154,16 +1154,11 @@ public class MavenProject
|
|||
sb.append( getArtifactId() );
|
||||
sb.append( ':' );
|
||||
sb.append( getVersion() );
|
||||
sb.append( " @ " );
|
||||
|
||||
try
|
||||
if ( getFile() != null )
|
||||
{
|
||||
sb.append( " @ " );
|
||||
sb.append( getFile().getPath() );
|
||||
}
|
||||
catch ( NullPointerException e )
|
||||
{
|
||||
// don't log it.
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
@ -135,8 +135,12 @@ public class ProjectBuildingException
|
|||
writer.print( problem.getSeverity() );
|
||||
writer.print( "] " );
|
||||
writer.print( problem.getMessage() );
|
||||
writer.print( " @ " );
|
||||
writer.println( ModelProblemUtils.formatLocation( problem, result.getProjectId() ) );
|
||||
String location = ModelProblemUtils.formatLocation( problem, result.getProjectId() );
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
writer.print( " @ " );
|
||||
writer.println( location );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,7 +168,12 @@ public class DefaultModelProblem
|
|||
|
||||
buffer.append( '[' ).append( getSeverity() ).append( "] " );
|
||||
buffer.append( getMessage() );
|
||||
buffer.append( " @ " ).append( ModelProblemUtils.formatLocation( this, null ) );
|
||||
String location = ModelProblemUtils.formatLocation( this, null );
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
buffer.append( " @ " );
|
||||
buffer.append( location );
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
|
|
@ -170,8 +170,12 @@ public class ModelBuildingException
|
|||
writer.print( problem.getSeverity() );
|
||||
writer.print( "] " );
|
||||
writer.print( problem.getMessage() );
|
||||
writer.print( " @ " );
|
||||
writer.println( ModelProblemUtils.formatLocation( problem, modelId ) );
|
||||
String location = ModelProblemUtils.formatLocation( problem, modelId );
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
writer.print( " @ " );
|
||||
writer.println( location );
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
|
|
|
@ -158,7 +158,12 @@ public class DefaultSettingsProblem
|
|||
|
||||
buffer.append( '[' ).append( getSeverity() ).append( "] " );
|
||||
buffer.append( getMessage() );
|
||||
buffer.append( " @ " ).append( getLocation() );
|
||||
String location = getLocation();
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
buffer.append( " @ " );
|
||||
buffer.append( location );
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
|
|
@ -80,8 +80,12 @@ public class SettingsBuildingException
|
|||
writer.print( problem.getSeverity() );
|
||||
writer.print( "] " );
|
||||
writer.print( problem.getMessage() );
|
||||
writer.print( " @ " );
|
||||
writer.println( problem.getLocation() );
|
||||
String location = problem.getLocation();
|
||||
if ( !location.isEmpty() )
|
||||
{
|
||||
writer.print( " @ " );
|
||||
writer.println( location );
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
|
|
Loading…
Reference in New Issue