Do not declare multiple variables on a single line

Change-Id: I6ce1cf9e542beda96222b5fbc7c891f086890586
This commit is contained in:
David Pursehouse
2015-03-16 17:33:20 +09:00
parent 8f2ced605b
commit ad5e634302
15 changed files with 37 additions and 17 deletions

View File

@@ -48,7 +48,8 @@ import com.google.gwtjsonrpc.common.AsyncCallback;
class ContactPanelShort extends Composite {
protected final FlowPanel body;
protected int labelIdx, fieldIdx;
protected int labelIdx;
protected int fieldIdx;
protected Button save;
private String currentEmail;

View File

@@ -117,7 +117,8 @@ public class MyPreferencesScreen extends SettingsScreen {
FlowPanel dateTimePanel = new FlowPanel();
final int labelIdx, fieldIdx;
final int labelIdx;
final int fieldIdx;
if (LocaleInfo.getCurrentLocale().isRTL()) {
labelIdx = 1;
fieldIdx = 0;

View File

@@ -33,7 +33,8 @@ import com.google.gwt.user.client.ui.VerticalPanel;
public class MyProfileScreen extends SettingsScreen {
private AvatarImage avatar;
private Anchor changeAvatar;
private int labelIdx, fieldIdx;
private int labelIdx;
private int fieldIdx;
private Grid info;
@Override

View File

@@ -115,7 +115,8 @@ class Labels extends Grid {
private Widget renderUsers(LabelInfo label) {
Map<Integer, List<ApprovalInfo>> m = new HashMap<>(4);
int approved = 0, rejected = 0;
int approved = 0;
int rejected = 0;
for (ApprovalInfo ai : Natives.asList(label.all())) {
if (ai.value() != 0) {

View File

@@ -391,7 +391,8 @@ class CommentManager {
return w;
}
int lineA, lineB;
int lineA;
int lineB;
if (line == 0) {
lineA = lineB = 0;
} else if (side == DisplaySide.A) {

View File

@@ -45,7 +45,8 @@ class SkipManager {
JsArray<Region> regions = diff.content();
List<SkippedLine> skips = new ArrayList<>();
int lineA = 0, lineB = 0;
int lineA = 0;
int lineB = 0;
for (int i = 0; i < regions.length(); i++) {
Region current = regions.get(i);
if (current.ab() != null || current.common() || current.skip() > 0) {

View File

@@ -158,7 +158,9 @@ public class GitWebConfig {
resourcePaths = new String[] {};
}
Path css = null, js = null, logo = null;
Path css = null;
Path js = null;
Path logo = null;
for (String path : resourcePaths) {
Path dir = Paths.get(path);
css = dir.resolve("gitweb.css");

View File

@@ -58,7 +58,8 @@ class InitHttpd implements InitStep {
public void run() throws IOException, InterruptedException {
ui.header("HTTP Daemon");
boolean proxy = false, ssl = false;
boolean proxy = false;
boolean ssl = false;
String address = "*";
int port = -1;
String context = "/";

View File

@@ -104,7 +104,8 @@ public class ChangeUtil {
* @throws OrmException the database couldn't be incremented.
*/
public static String messageUUID(ReviewDb db) throws OrmException {
int p, s;
int p;
int s;
synchronized (uuidLock) {
if (uuidSeq == 0) {
uuidPrefix = db.nextChangeMessageId();

View File

@@ -89,7 +89,9 @@ public class GetSummary implements RestReadView<ConfigResource> {
private TaskSummaryInfo getTaskSummary() {
Collection<Task<?>> pending = workQueue.getTasks();
int tasksTotal = pending.size();
int tasksRunning = 0, tasksReady = 0, tasksSleeping = 0;
int tasksRunning = 0;
int tasksReady = 0;
int tasksSleeping = 0;
for (Task<?> task : pending) {
switch (task.getState()) {
case RUNNING: tasksRunning++; break;

View File

@@ -387,7 +387,9 @@ public class CommitValidators {
final ProjectControl projectControl = refControl.getProjectControl();
if (projectControl.getProjectState().isUseSignedOffBy()) {
boolean sboAuthor = false, sboCommitter = false, sboMe = false;
boolean sboAuthor = false;
boolean sboCommitter = false;
boolean sboMe = false;
for (final FooterLine footer : receiveEvent.commit.getFooterLines()) {
if (footer.matches(FooterKey.SIGNED_OFF_BY)) {
final String e = footer.getEmailAddress();

View File

@@ -83,7 +83,8 @@ public final class RangeUtil {
*/
public static Range getRange(
String prefix, String test, int queryInt, int minValue, int maxValue) {
int min, max;
int min;
int max;
switch (test) {
case "=":
default:

View File

@@ -75,7 +75,8 @@ public abstract class RegexListSearcher<T> implements Function<T, String> {
public Iterable<T> search(List<T> list) {
checkNotNull(list);
int begin, end;
int begin;
int end;
if (0 < prefixLen) {
// Assumes many consecutive elements may have the same prefix, so the cost

View File

@@ -285,7 +285,8 @@ public class RefControlTest {
public void testUsernamePatternNonRegex() {
allow(local, READ, DEVS, "refs/sb/${username}/heads/*");
ProjectControl u = util.user(local, "u", DEVS), d = util.user(local, "d", DEVS);
ProjectControl u = util.user(local, "u", DEVS);
ProjectControl d = util.user(local, "d", DEVS);
assertFalse("u can't read", u.controlForRef("refs/sb/d/heads/foobar").isVisible());
assertTrue("d can read", d.controlForRef("refs/sb/d/heads/foobar").isVisible());
}
@@ -294,7 +295,8 @@ public class RefControlTest {
public void testUsernamePatternWithRegex() {
allow(local, READ, DEVS, "^refs/sb/${username}/heads/.*");
ProjectControl u = util.user(local, "d.v", DEVS), d = util.user(local, "dev", DEVS);
ProjectControl u = util.user(local, "d.v", DEVS);
ProjectControl d = util.user(local, "dev", DEVS);
assertFalse("u can't read", u.controlForRef("refs/sb/dev/heads/foobar").isVisible());
assertTrue("d can read", d.controlForRef("refs/sb/dev/heads/foobar").isVisible());
}
@@ -316,7 +318,8 @@ public class RefControlTest {
allow(local, READ, DEVS, "^refs/heads/.*");
allow(parent, READ, ANONYMOUS_USERS, "^refs/heads/.*-QA-.*");
ProjectControl u = util.user(local, DEVS), d = util.user(local, DEVS);
ProjectControl u = util.user(local, DEVS);
ProjectControl d = util.user(local, DEVS);
assertTrue("u can read", u.controlForRef("refs/heads/foo-QA-bar").isVisible());
assertTrue("d can read", d.controlForRef("refs/heads/foo-QA-bar").isVisible());
}

View File

@@ -220,7 +220,8 @@ class SshLog implements LifecycleListener {
event.setProperty(P_SESSION, id(sd.getSessionId()));
String userName = "-", accountId = "-";
String userName = "-";
String accountId = "-";
if (user != null && user.isIdentifiedUser()) {
IdentifiedUser u = (IdentifiedUser) user;