replace 'for (;;)' with 'while (true)'

This commit is contained in:
Stepan Koltsov
2012-05-11 16:26:26 +04:00
parent 39ec3f7c14
commit aa4252462f
5 changed files with 7 additions and 7 deletions
@@ -318,7 +318,7 @@ public class DescriptorUtils {
public static List<DeclarationDescriptor> getPathWithoutRootNsAndModule(@NotNull DeclarationDescriptor descriptor) { public static List<DeclarationDescriptor> getPathWithoutRootNsAndModule(@NotNull DeclarationDescriptor descriptor) {
List<DeclarationDescriptor> path = Lists.newArrayList(); List<DeclarationDescriptor> path = Lists.newArrayList();
DeclarationDescriptor current = descriptor; DeclarationDescriptor current = descriptor;
for (;;) { while (true) {
if (current instanceof NamespaceDescriptor && isRootNamespace((NamespaceDescriptor) current)) { if (current instanceof NamespaceDescriptor && isRootNamespace((NamespaceDescriptor) current)) {
return Lists.reverse(path); return Lists.reverse(path);
} }
@@ -196,7 +196,7 @@ public class FqNameUnsafe {
FqNameUnsafe last = new FqNameUnsafe(firstSegment, FqName.ROOT.toUnsafe(), firstSegment); FqNameUnsafe last = new FqNameUnsafe(firstSegment, FqName.ROOT.toUnsafe(), firstSegment);
callback.segment(firstSegment, last); callback.segment(firstSegment, last);
for (;;) { while (true) {
int next = fqName.indexOf('.', pos + 1); int next = fqName.indexOf('.', pos + 1);
if (next < 0) { if (next < 0) {
if (this.parent == null) { if (this.parent == null) {
@@ -52,7 +52,7 @@ class NamespaceComparator {
@NotNull File txtFile) { @NotNull File txtFile) {
String serialized = new NamespaceComparator(includeObject).doCompareNamespaces(nsa, nsb); String serialized = new NamespaceComparator(includeObject).doCompareNamespaces(nsa, nsb);
try { try {
for (;;) { while (true) {
String expected = Files.toString(txtFile, Charset.forName("utf-8")).replace("\r\n", "\n"); String expected = Files.toString(txtFile, Charset.forName("utf-8")).replace("\r\n", "\n");
if (expected.contains("kick me")) { if (expected.contains("kick me")) {
@@ -549,7 +549,7 @@ class NamespaceComparator {
try { try {
StringBuilder r = new StringBuilder(); StringBuilder r = new StringBuilder();
BufferedReader reader = new BufferedReader(new StringReader(string)); BufferedReader reader = new BufferedReader(new StringReader(string));
for (;;) { while (true) {
String line = reader.readLine(); String line = reader.readLine();
if (line == null) { if (line == null) {
break; break;
@@ -33,7 +33,7 @@ public class LockPerf {
for (int i = 0; i < threadNum; ++i) { for (int i = 0; i < threadNum; ++i) {
new Thread(new Runnable() { new Thread(new Runnable() {
public void run() { public void run() {
for (;;) { while (true) {
lock.lock(); lock.lock();
try { try {
if (counter.get() == 100000000) { if (counter.get() == 100000000) {
@@ -181,7 +181,7 @@ public class JetSignatureReader {
start = pos; start = pos;
visited = false; visited = false;
inner = false; inner = false;
for (;;) { while (true) {
switch (c = signature.charAt(pos++)) { switch (c = signature.charAt(pos++)) {
case '.': case '.':
case ';': case ';':
@@ -212,7 +212,7 @@ public class JetSignatureReader {
v.visitClassType(name, nullable, forceReal); v.visitClassType(name, nullable, forceReal);
} }
visited = true; visited = true;
top: for (;;) { top: while (true) {
switch (c = signature.charAt(pos)) { switch (c = signature.charAt(pos)) {
case '>': case '>':
break top; break top;