Replace C-style array declarations with Java-style declarations

int[] array;

instead of

  int array[];

Change-Id: I4fb02ac0bcdff75ec094ba61b36d40097a4e25b9
This commit is contained in:
David Pursehouse
2015-03-16 17:35:21 +09:00
parent ad5e634302
commit d70fc02a99
11 changed files with 12 additions and 12 deletions

View File

@@ -64,7 +64,7 @@ public class CommentsIT extends AbstractDaemonTest {
@Inject @Inject
private Provider<PostReview> postReview; private Provider<PostReview> postReview;
private final Integer lines[] = {0, 1}; private final Integer[] lines = {0, 1};
@Test @Test
public void createDraft() throws Exception { public void createDraft() throws Exception {

View File

@@ -114,7 +114,7 @@ public class KeyHelpPopup extends PluginSafePopupPanel implements
} }
private void populate(final Grid lists) { private void populate(final Grid lists) {
int end[] = new int[5]; int[] end = new int[5];
int column = 0; int column = 0;
for (final KeyCommandSet set : combinedSetsByName()) { for (final KeyCommandSet set : combinedSetsByName()) {
int row = end[column]; int row = end[column];

View File

@@ -341,7 +341,7 @@ public class Dispatcher {
private static String legacyChange(final String token) { private static String legacyChange(final String token) {
final String s = skip(token); final String s = skip(token);
final String t[] = s.split(",", 2); final String[] t = s.split(",", 2);
if (t.length > 1 && matchPrefix("patchset=", t[1])) { if (t.length > 1 && matchPrefix("patchset=", t[1])) {
return PageLinks.toChange(PatchSet.Id.parse(t[0] + "," + skip(t[1]))); return PageLinks.toChange(PatchSet.Id.parse(t[0] + "," + skip(t[1])));
} }

View File

@@ -546,7 +546,7 @@ abstract class AbstractPatchContentTable extends NavigationTable<Object>
private CommentEditorPanel findOrCreateCommentEditor(final int suggestRow, private CommentEditorPanel findOrCreateCommentEditor(final int suggestRow,
final int column, final PatchLineComment newComment, final boolean create) { final int column, final PatchLineComment newComment, final boolean create) {
int row = suggestRow; int row = suggestRow;
int spans[] = new int[column + 1]; int[] spans = new int[column + 1];
FIND_ROW: while (row < table.getRowCount()) { FIND_ROW: while (row < table.getRowCount()) {
int col = 0; int col = 0;
for (int cell = 0; row < table.getRowCount() for (int cell = 0; row < table.getRowCount()

View File

@@ -54,7 +54,7 @@ class NavLinks extends Composite {
private final KeyCommandSet keys; private final KeyCommandSet keys;
private final Grid table; private final Grid table;
private KeyCommand cmds[] = new KeyCommand[2]; private KeyCommand[] cmds = new KeyCommand[2];
NavLinks(KeyCommandSet kcs, PatchSet.Id forPatch) { NavLinks(KeyCommandSet kcs, PatchSet.Id forPatch) {
patchSetId = forPatch; patchSetId = forPatch;

View File

@@ -46,11 +46,11 @@ public final class GerritLauncher {
private static final String pkg = "com.google.gerrit.pgm"; private static final String pkg = "com.google.gerrit.pgm";
public static final String NOT_ARCHIVED = "NOT_ARCHIVED"; public static final String NOT_ARCHIVED = "NOT_ARCHIVED";
public static void main(final String argv[]) throws Exception { public static void main(final String[] argv) throws Exception {
System.exit(mainImpl(argv)); System.exit(mainImpl(argv));
} }
public static int mainImpl(final String argv[]) throws Exception { public static int mainImpl(final String[] argv) throws Exception {
if (argv.length == 0) { if (argv.length == 0) {
File me; File me;
try { try {

View File

@@ -20,7 +20,7 @@ public final class Main {
// to jump into the real main code. // to jump into the real main code.
// //
public static void main(final String argv[]) throws Exception { public static void main(final String[] argv) throws Exception {
if (onSupportedJavaVersion()) { if (onSupportedJavaVersion()) {
com.google.gerrit.launcher.GerritLauncher.main(argv); com.google.gerrit.launcher.GerritLauncher.main(argv);

View File

@@ -239,7 +239,7 @@ public class PrologCompiler implements Callable<PrologCompiler.Status> {
Files.createTempFile(archiveFile.getParent(), ".rulec_", ".jar"); Files.createTempFile(archiveFile.getParent(), ".rulec_", ".jar");
try (OutputStream stream = Files.newOutputStream(tmpjar); try (OutputStream stream = Files.newOutputStream(tmpjar);
JarOutputStream out = new JarOutputStream(stream, mf)) { JarOutputStream out = new JarOutputStream(stream, mf)) {
byte buffer[] = new byte[10240]; byte[] buffer = new byte[10240];
// TODO: fixify this loop // TODO: fixify this loop
for (String path : toBeJared) { for (String path : toBeJared) {
JarEntry jarAdd = new JarEntry(path); JarEntry jarAdd = new JarEntry(path);

View File

@@ -134,7 +134,7 @@ public class LdapRealm extends AbstractRealm {
static List<String> optionalList(final Config config, static List<String> optionalList(final Config config,
final String name) { final String name) {
String s[] = config.getStringList("ldap", null, name); String[] s = config.getStringList("ldap", null, name);
return Arrays.asList(s); return Arrays.asList(s);
} }

View File

@@ -222,7 +222,7 @@ public class CommitValidators {
sb.append("ERROR: ").append(errMsg); sb.append("ERROR: ").append(errMsg);
if (c.getFullMessage().indexOf(changeId) >= 0) { if (c.getFullMessage().indexOf(changeId) >= 0) {
String lines[] = c.getFullMessage().trim().split("\n"); String[] lines = c.getFullMessage().trim().split("\n");
String lastLine = lines.length > 0 ? lines[lines.length - 1] : ""; String lastLine = lines.length > 0 ? lines[lines.length - 1] : "";
if (lastLine.indexOf(changeId) == -1) { if (lastLine.indexOf(changeId) == -1) {

View File

@@ -86,7 +86,7 @@ public class SectionSortCache {
Collections.sort(sections, new MostSpecificComparator(ref)); Collections.sort(sections, new MostSpecificComparator(ref));
int srcIdx[]; int[] srcIdx;
if (isIdentityTransform(sections, srcMap)) { if (isIdentityTransform(sections, srcMap)) {
srcIdx = null; srcIdx = null;
} else { } else {