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 { class ContactPanelShort extends Composite {
protected final FlowPanel body; protected final FlowPanel body;
protected int labelIdx, fieldIdx; protected int labelIdx;
protected int fieldIdx;
protected Button save; protected Button save;
private String currentEmail; private String currentEmail;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -387,7 +387,9 @@ public class CommitValidators {
final ProjectControl projectControl = refControl.getProjectControl(); final ProjectControl projectControl = refControl.getProjectControl();
if (projectControl.getProjectState().isUseSignedOffBy()) { 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()) { for (final FooterLine footer : receiveEvent.commit.getFooterLines()) {
if (footer.matches(FooterKey.SIGNED_OFF_BY)) { if (footer.matches(FooterKey.SIGNED_OFF_BY)) {
final String e = footer.getEmailAddress(); final String e = footer.getEmailAddress();

View File

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

View File

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

View File

@@ -285,7 +285,8 @@ public class RefControlTest {
public void testUsernamePatternNonRegex() { public void testUsernamePatternNonRegex() {
allow(local, READ, DEVS, "refs/sb/${username}/heads/*"); 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()); 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()); assertTrue("d can read", d.controlForRef("refs/sb/d/heads/foobar").isVisible());
} }
@@ -294,7 +295,8 @@ public class RefControlTest {
public void testUsernamePatternWithRegex() { public void testUsernamePatternWithRegex() {
allow(local, READ, DEVS, "^refs/sb/${username}/heads/.*"); 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()); 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()); 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(local, READ, DEVS, "^refs/heads/.*");
allow(parent, READ, ANONYMOUS_USERS, "^refs/heads/.*-QA-.*"); 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("u can read", u.controlForRef("refs/heads/foo-QA-bar").isVisible());
assertTrue("d can read", d.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())); event.setProperty(P_SESSION, id(sd.getSessionId()));
String userName = "-", accountId = "-"; String userName = "-";
String accountId = "-";
if (user != null && user.isIdentifiedUser()) { if (user != null && user.isIdentifiedUser()) {
IdentifiedUser u = (IdentifiedUser) user; IdentifiedUser u = (IdentifiedUser) user;