forked from spotbugs/sonar-findbugs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue spotbugs#387 reverted to using the deprecated ProfileDefinition
Tentative fix for issue spotbugs#387 apparently caused by SONAR-15240
- Loading branch information
Showing
6 changed files
with
91 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
src/main/java/org/sonar/plugins/findbugs/profiles/FindbugsContribProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
package org.sonar.plugins.findbugs.profiles; | ||
|
||
import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition; | ||
import org.sonar.api.profiles.ProfileDefinition; | ||
import org.sonar.api.profiles.RulesProfile; | ||
import org.sonar.api.utils.ValidationMessages; | ||
import org.sonar.plugins.findbugs.FindbugsProfileImporter; | ||
import org.sonar.plugins.java.Java; | ||
|
||
import java.io.InputStreamReader; | ||
import java.io.Reader; | ||
|
||
public class FindbugsContribProfile implements BuiltInQualityProfilesDefinition { | ||
public class FindbugsContribProfile extends ProfileDefinition { | ||
|
||
public static final String FB_CONTRIB_PROFILE_NAME = "FindBugs + FB-Contrib"; | ||
private static final String FB_CONTRIB_PROFILE_NAME = "FindBugs + FB-Contrib"; | ||
private final FindbugsProfileImporter importer; | ||
|
||
public FindbugsContribProfile(FindbugsProfileImporter importer) { | ||
this.importer = importer; | ||
} | ||
|
||
@Override | ||
public void define(Context context) { | ||
public RulesProfile createProfile(ValidationMessages messages) { | ||
Reader findbugsProfile = new InputStreamReader(this.getClass().getResourceAsStream( | ||
"/org/sonar/plugins/findbugs/profile-findbugs-and-fb-contrib.xml")); | ||
NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(FB_CONTRIB_PROFILE_NAME, Java.KEY); | ||
importer.importProfile(findbugsProfile, profile); | ||
|
||
profile.done(); | ||
RulesProfile profile = importer.importProfile(findbugsProfile, messages); | ||
profile.setLanguage(Java.KEY); | ||
profile.setName(FB_CONTRIB_PROFILE_NAME); | ||
return profile; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters