[releng] bazel: Enable errorprone on o.e.j.ssh.apache
Fix the few issues reported. (None serious.) Change-Id: I8d72ef7d425ab61f4c27b657c92fc021850730d6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
This commit is contained in:
parent
4184ff0953
commit
c04884fc91
|
@ -439,7 +439,7 @@ public boolean hasNext() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeyPair next() {
|
public KeyPair next() {
|
||||||
if (hasElement == null && !hasNext()
|
if ((hasElement == null && !hasNext())
|
||||||
|| !hasElement.booleanValue()) {
|
|| !hasElement.booleanValue()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,8 @@ public final void close() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void start() throws Exception {
|
public final void start() throws Exception {
|
||||||
if (user != null && !user.isEmpty()
|
if ((user != null && !user.isEmpty())
|
||||||
|| password != null && password.length > 0) {
|
|| (password != null && password.length > 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
askCredentials();
|
askCredentials();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public abstract class AbstractClientProxyConnector
|
||||||
.toMillis(30L);
|
.toMillis(30L);
|
||||||
|
|
||||||
/** Guards {@link #done} and {@link #bufferedCommands}. */
|
/** Guards {@link #done} and {@link #bufferedCommands}. */
|
||||||
private Object lock = new Object();
|
private final Object lock = new Object();
|
||||||
|
|
||||||
private boolean done;
|
private boolean done;
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,8 @@ public void sendClientProxyMetadata(ClientSession sshSession)
|
||||||
IoSession session = sshSession.getIoSession();
|
IoSession session = sshSession.getIoSession();
|
||||||
session.addCloseFutureListener(f -> close());
|
session.addCloseFutureListener(f -> close());
|
||||||
StringBuilder msg = connect();
|
StringBuilder msg = connect();
|
||||||
if (proxyUser != null && !proxyUser.isEmpty()
|
if ((proxyUser != null && !proxyUser.isEmpty())
|
||||||
|| proxyPassword != null && proxyPassword.length > 0) {
|
|| (proxyPassword != null && proxyPassword.length > 0)) {
|
||||||
authenticator = basic;
|
authenticator = basic;
|
||||||
basic.setParams(null);
|
basic.setParams(null);
|
||||||
basic.start();
|
basic.start();
|
||||||
|
@ -232,7 +232,8 @@ private void handleMessage(IoSession session, List<String> reply)
|
||||||
} catch (HttpParser.ParseException e) {
|
} catch (HttpParser.ParseException e) {
|
||||||
throw new IOException(
|
throw new IOException(
|
||||||
format(SshdText.get().proxyHttpUnexpectedReply,
|
format(SshdText.get().proxyHttpUnexpectedReply,
|
||||||
proxyAddress, reply.get(0)));
|
proxyAddress, reply.get(0)),
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,23 @@ public static class ParseException extends Exception {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1634090143702048640L;
|
private static final long serialVersionUID = -1634090143702048640L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new {@link ParseException} without cause.
|
||||||
|
*/
|
||||||
|
public ParseException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new {@link ParseException} with the given {@code cause}.
|
||||||
|
*
|
||||||
|
* @param cause
|
||||||
|
* {@link Throwable} that caused this exception, or
|
||||||
|
* {@code null} if none
|
||||||
|
*/
|
||||||
|
public ParseException(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpParser() {
|
private HttpParser() {
|
||||||
|
@ -64,7 +81,7 @@ public static StatusLine parseStatusLine(String line)
|
||||||
resultCode = Integer.parseUnsignedInt(
|
resultCode = Integer.parseUnsignedInt(
|
||||||
line.substring(firstBlank + 1, secondBlank));
|
line.substring(firstBlank + 1, secondBlank));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new ParseException();
|
throw new ParseException(e);
|
||||||
}
|
}
|
||||||
// Again, accept even if the reason is missing
|
// Again, accept even if the reason is missing
|
||||||
String reason = ""; //$NON-NLS-1$
|
String reason = ""; //$NON-NLS-1$
|
||||||
|
|
|
@ -94,7 +94,7 @@ private enum SocksAuthenticationMethod {
|
||||||
// JSON(9),
|
// JSON(9),
|
||||||
NONE_ACCEPTABLE(0xFF);
|
NONE_ACCEPTABLE(0xFF);
|
||||||
|
|
||||||
private byte value;
|
private final byte value;
|
||||||
|
|
||||||
SocksAuthenticationMethod(int value) {
|
SocksAuthenticationMethod(int value) {
|
||||||
this.value = (byte) value;
|
this.value = (byte) value;
|
||||||
|
|
|
@ -120,6 +120,7 @@ package_group(
|
||||||
"//org.eclipse.jgit.packaging/...",
|
"//org.eclipse.jgit.packaging/...",
|
||||||
"//org.eclipse.jgit.pgm.test/...",
|
"//org.eclipse.jgit.pgm.test/...",
|
||||||
"//org.eclipse.jgit.pgm/...",
|
"//org.eclipse.jgit.pgm/...",
|
||||||
|
"//org.eclipse.jgit.ssh.apache/...",
|
||||||
"//org.eclipse.jgit.test/...",
|
"//org.eclipse.jgit.test/...",
|
||||||
"//org.eclipse.jgit.ui/...",
|
"//org.eclipse.jgit.ui/...",
|
||||||
"//org.eclipse.jgit/...",
|
"//org.eclipse.jgit/...",
|
||||||
|
|
Loading…
Reference in New Issue