Skip to content

Commit

Permalink
Enable FindBugs plugin and fix violations (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
meltsufin authored Jul 8, 2016
1 parent c3076b7 commit b144e56
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
23 changes: 23 additions & 0 deletions appengine-plugins-core/findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Google Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Or>
<Bug pattern="DM_STRING_CTOR"/>
</Or>
</Match>
</FindBugsFilter>
17 changes: 17 additions & 0 deletions appengine-plugins-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,23 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.3</version>
<configuration>
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void deploy(DeployConfiguration config) throws AppEngineException {
for (File deployable : config.getDeployables()) {
if (!deployable.exists()) {
throw new IllegalArgumentException(
"Deployable " + deployable.toPath().toString() + " does not exist.");
"Deployable " + deployable.toPath() + " does not exist.");
}
arguments.add(deployable.toPath().toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public void genConfig(GenConfigParams config) throws AppEngineException {

if (!config.getSourceDirectory().exists()) {
throw new AppEngineException("Source directory does not exist. Location: "
+ config.getSourceDirectory().toPath().toString());
+ config.getSourceDirectory().toPath());
}
if (!config.getSourceDirectory().isDirectory()) {
throw new AppEngineException("Source location is not a directory. Location: "
+ config.getSourceDirectory().toPath().toString());
+ config.getSourceDirectory().toPath());
}

List<String> arguments = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.google.cloud.tools.appengine.cloudsdk.process.ProcessOutputLineListener;
import com.google.cloud.tools.appengine.cloudsdk.process.ProcessStartListener;

import com.google.common.base.Charsets;

import java.io.IOException;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -112,7 +114,7 @@ public void setEnvironment(Map<String, String> environment) {
}

private void handleStdOut(final Process process) {
final Scanner stdOut = new Scanner(process.getInputStream());
final Scanner stdOut = new Scanner(process.getInputStream(), Charsets.UTF_8.name());
Thread stdOutThread = new Thread("standard-out") {
public void run() {
while (stdOut.hasNextLine() && !Thread.interrupted()) {
Expand All @@ -128,7 +130,7 @@ public void run() {
}

private void handleErrOut(final Process process) {
final Scanner stdErr = new Scanner(process.getErrorStream());
final Scanner stdErr = new Scanner(process.getErrorStream(), Charsets.UTF_8.name());
Thread stdErrThread = new Thread("standard-err") {
public void run() {
while (stdErr.hasNextLine() && !Thread.interrupted()) {
Expand Down

0 comments on commit b144e56

Please sign in to comment.