Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed NPE #306

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ File saveIncludeConfigXml() throws IOException {
* Scan the given folder for classes. It will catch classes from Java, JSP and more.
*
* @param folder Folder to scan
* @return
* @return List<File> of class files
* @throws IOException
*/
public static List<File> scanForAdditionalClasses(File folder) throws IOException {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/sonar/plugins/findbugs/FindbugsSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ public void execute(SensorContext context) {
}

}
finally {
classMappingWriter.flush();
classMappingWriter.close();
finally {
if(classMappingWriter != null) {
classMappingWriter.flush();
classMappingWriter.close();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ByteCodeResourceLocator {
* findSourceFileKeyByClassName() is broken in SonarQube 6.3.1.. This method is fixing it.
* @param className
* @param javaResourceLocator
* @return
* @return String filepath
*/
public String findSourceFileKeyByClassName(String className, JavaResourceLocator javaResourceLocator) {
InputFile input = javaResourceLocator.findResourceByClassName(className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static final String mangleChar(char ch)
/**
* Detect if the character is printable
* @param c Character to test
* @return
* @return boolean true if its a printable char otherwise false
*/
public static boolean isPrintableChar( char c ) {
Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
Expand Down