Skip to content

Commit

Permalink
#118: Fixed NPE in SonarDevon4jPlugin class (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmarniazman authored Dec 17, 2020
1 parent 5e82392 commit 3bd6482
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
@SonarLintSide
public class DevonfwJavaProfile implements BuiltInQualityProfilesDefinition {

private static final String DEVON4J_XML = "/com/devonfw/ide/sonarqube/common/rules/devon4j/devon4j.xml";

private static final Logger logger = Logger.getGlobal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SonarDevon4jPlugin implements Plugin {

private static final String DISABLED = "Disabled";

private static final String QUALINSIGHT = "qualinsight-plugins-sonarqube-smell-plugin";
private static final String QUALINSIGHT = "qualinsight-sonarqube-smell-plugin";

private static final String PMD = "sonar-pmd-plugin";

Expand Down Expand Up @@ -63,7 +63,11 @@ private List<String> getPlugins() {

if (this.pluginList == null) {
File[] fileList = this.pluginDirectory.listFiles(f -> f.getName().endsWith(".jar") && f.isFile());
this.pluginList = Arrays.asList(fileList).stream().map(f -> f.getName()).collect(Collectors.toList());
if (fileList != null) {
this.pluginList = Arrays.asList(fileList).stream().map(f -> f.getName()).collect(Collectors.toList());
} else {
this.pluginList = new ArrayList<>();
}
}
return this.pluginList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,6 @@
<priority>MINOR</priority>
<parameters/>
</rule>
<rule>
<repositoryKey>checkstyle</repositoryKey>
<key>com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck</key>
<type>CODE_SMELL</type>
<priority>MAJOR</priority>
<parameters>
<parameter>
<key>allowSamelineSingleParameterlessAnnotation</key>
<value>true</value>
</parameter>
<parameter>
<key>allowSamelineParameterizedAnnotation</key>
<value>false</value>
</parameter>
<parameter>
<key>allowSamelineMultipleAnnotations</key>
<value>false</value>
</parameter>
<parameter>
<key>tokens</key>
<value>CLASS_DEF,INTERFACE_DEF,PACKAGE_DEF,ENUM_CONSTANT_DEF,ENUM_DEF,METHOD_DEF,CTOR_DEF,VARIABLE_DEF</value>
</parameter>
</parameters>
</rule>
<rule>
<repositoryKey>checkstyle</repositoryKey>
<key>com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck</key>
Expand Down

0 comments on commit 3bd6482

Please sign in to comment.