Skip to content

Commit

Permalink
[FIXED JENKINS-32980] Address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Feb 16, 2016
1 parent efaea8e commit 818e58b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/hudson/remoting/Engine.java
Expand Up @@ -40,6 +40,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import javax.annotation.CheckForNull;
import javax.annotation.concurrent.NotThreadSafe;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
Expand Down Expand Up @@ -69,6 +71,7 @@
*
* @author Kohsuke Kawaguchi
*/
@NotThreadSafe // the fields in this class should not be modified by multiple threads concurrently
public class Engine extends Thread {
/**
* Thread pool that sets {@link #CURRENT}.
Expand Down Expand Up @@ -546,6 +549,7 @@ public Map<String, String> run() throws Exception {
return keystore;
}

@CheckForNull
private static FileInputStream getFileInputStream(final File file) throws PrivilegedActionException {
return AccessController.doPrivileged(new PrivilegedExceptionAction<FileInputStream>() {
public FileInputStream run() throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/remoting/jnlp/Main.java
Expand Up @@ -197,7 +197,7 @@ public Engine createEngine() {
cert = new byte[(int) length];
fis = new FileInputStream(file);
int read = fis.read(cert);
if (cert.length == read) {
if (cert.length != read) {
LOGGER.log(Level.WARNING, "Only read {0} bytes from {1}, expected to read {2}",
new Object[]{read, file, cert.length});
// skip it
Expand Down

0 comments on commit 818e58b

Please sign in to comment.