Using for-each loop in jdt
Running the JDT cleanup action for using a for-each loop on jgit Change-Id: Ie724d8bbdff786ab0167089e90a9914a8135103c Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
This commit is contained in:
parent
6586c171b3
commit
512ffc9e7f
|
@ -338,8 +338,7 @@ public RebaseResult call() throws GitAPIException, NoHeadException,
|
||||||
steps, false);
|
steps, false);
|
||||||
}
|
}
|
||||||
checkSteps(steps);
|
checkSteps(steps);
|
||||||
for (int i = 0; i < steps.size(); i++) {
|
for (RebaseTodoLine step : steps) {
|
||||||
RebaseTodoLine step = steps.get(i);
|
|
||||||
popSteps(1);
|
popSteps(1);
|
||||||
RebaseResult result = processStep(step, true);
|
RebaseResult result = processStep(step, true);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
|
@ -380,8 +380,8 @@ public boolean isMatch() {
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public boolean canAppendMatch() {
|
public boolean canAppendMatch() {
|
||||||
for (int i = 0; i < heads.size(); i++) {
|
for (Head head : heads) {
|
||||||
if (heads.get(i) != LastHead.INSTANCE) {
|
if (head != LastHead.INSTANCE) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,8 +122,8 @@ private int countEntries(DeltaIndexScanner scan) {
|
||||||
// logic linear in the size of the input rather than quadratic.
|
// logic linear in the size of the input rather than quadratic.
|
||||||
//
|
//
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
for (int i = 0; i < table.length; i++) {
|
for (int element : table) {
|
||||||
int h = table[i];
|
int h = element;
|
||||||
if (h == 0)
|
if (h == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,8 @@ public abstract class PatternMatchRevFilter extends RevFilter {
|
||||||
protected static final String forceToRaw(String patternText) {
|
protected static final String forceToRaw(String patternText) {
|
||||||
final byte[] b = Constants.encode(patternText);
|
final byte[] b = Constants.encode(patternText);
|
||||||
final StringBuilder needle = new StringBuilder(b.length);
|
final StringBuilder needle = new StringBuilder(b.length);
|
||||||
for (int i = 0; i < b.length; i++)
|
for (byte element : b)
|
||||||
needle.append((char) (b[i] & 0xff));
|
needle.append((char) (element & 0xff));
|
||||||
return needle.toString();
|
return needle.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -423,8 +423,7 @@ private static MessageDigest newMD5() {
|
||||||
|
|
||||||
private static String LHEX(byte[] bin) {
|
private static String LHEX(byte[] bin) {
|
||||||
StringBuilder r = new StringBuilder(bin.length * 2);
|
StringBuilder r = new StringBuilder(bin.length * 2);
|
||||||
for (int i = 0; i < bin.length; i++) {
|
for (byte b : bin) {
|
||||||
byte b = bin[i];
|
|
||||||
r.append(LHEX[(b >>> 4) & 0x0f]);
|
r.append(LHEX[(b >>> 4) & 0x0f]);
|
||||||
r.append(LHEX[b & 0x0f]);
|
r.append(LHEX[b & 0x0f]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,8 +303,8 @@ private static String escape(String s, boolean escapeReservedChars,
|
||||||
return null;
|
return null;
|
||||||
ByteArrayOutputStream os = new ByteArrayOutputStream(s.length());
|
ByteArrayOutputStream os = new ByteArrayOutputStream(s.length());
|
||||||
byte[] bytes = s.getBytes(UTF_8);
|
byte[] bytes = s.getBytes(UTF_8);
|
||||||
for (int i = 0; i < bytes.length; ++i) {
|
for (byte c : bytes) {
|
||||||
int b = bytes[i] & 0xFF;
|
int b = c & 0xFF;
|
||||||
if (b <= 32 || (encodeNonAscii && b > 127) || b == '%'
|
if (b <= 32 || (encodeNonAscii && b > 127) || b == '%'
|
||||||
|| (escapeReservedChars && reservedChars.get(b))) {
|
|| (escapeReservedChars && reservedChars.get(b))) {
|
||||||
os.write('%');
|
os.write('%');
|
||||||
|
|
|
@ -243,8 +243,8 @@ public String quote(String instr) {
|
||||||
final byte[] out = new byte[4 * in.length + 2];
|
final byte[] out = new byte[4 * in.length + 2];
|
||||||
int o = 0;
|
int o = 0;
|
||||||
out[o++] = '"';
|
out[o++] = '"';
|
||||||
for (int i = 0; i < in.length; i++) {
|
for (byte element : in) {
|
||||||
final int c = in[i] & 0xff;
|
final int c = element & 0xff;
|
||||||
if (c < quote.length) {
|
if (c < quote.length) {
|
||||||
final byte style = quote[c];
|
final byte style = quote[c];
|
||||||
if (style == 0) {
|
if (style == 0) {
|
||||||
|
|
|
@ -559,8 +559,8 @@ public static final int headerStart(byte[] headerName, byte[] b, int ptr) {
|
||||||
}
|
}
|
||||||
while (ptr < b.length - (headerName.length + 1)) {
|
while (ptr < b.length - (headerName.length + 1)) {
|
||||||
boolean found = true;
|
boolean found = true;
|
||||||
for (int i = 0; i < headerName.length; i++) {
|
for (byte element : headerName) {
|
||||||
if (headerName[i] != b[ptr++]) {
|
if (element != b[ptr++]) {
|
||||||
found = false;
|
found = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue