elharo commented on a change in pull request #34:
URL: 
https://github.com/apache/maven-checkstyle-plugin/pull/34#discussion_r470088921



##########
File path: 
src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
##########
@@ -780,6 +770,53 @@ private void generateMainReport( CheckstyleResults 
results, ResourceBundle bundl
         generator.generateReport( results );
     }
 
+    private void initializeXrefLocation( CheckstyleReportGenerator generator )
+    {
+      String relativePath = determineRelativePath( xrefLocation );
+      if ( xrefLocation.exists() || checkMavenJxrPluginIsConfigured() )
+      {
+          // XRef was already generated by manual execution of a lifecycle 
binding
+          // the report is on its way
+          generator.setXrefLocation( relativePath );
+      }
+    }
+
+    private void initializeXrefTestLocation( CheckstyleReportGenerator 
generator )
+    {
+      String relativePath = determineRelativePath( xrefTestLocation );
+      if ( xrefTestLocation.exists() || checkMavenJxrPluginIsConfigured() )
+      {
+          // XRef was already generated by manual execution of a lifecycle 
binding
+          // the report is on its way
+          generator.setXrefTestLocation( relativePath );
+      }
+    }
+
+    private String determineRelativePath( File location )
+    {
+      String relativePath = PathTool.getRelativePath( getOutputDirectory(), 
location.getAbsolutePath() );
+      if ( StringUtils.isEmpty( relativePath ) )

Review comment:
       which StringUtils is this?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to