Skip to content

Commit bac1f3b

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 1047 b: refs/heads/master c: 4e7aa3a h: refs/heads/master i: 1045: 79098d0 1043: cd4a639 1039: f892325 v: v3
1 parent 1102bb8 commit bac1f3b

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: 007a9ab7964ff49bd2bc52ab66119b52477095b4
2+
refs/heads/master: 4e7aa3ad2949d127fe023604f640daabf9e86a1d
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/testing/LocalGcdHelper.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ private static Path executablePath(String cmd) {
179179
}
180180

181181
private static class ProcessStreamReader extends Thread {
182-
private volatile BufferedReader reader;
183-
private boolean terminated = false;
182+
private final BufferedReader reader;
183+
private volatile boolean terminated = false;
184184

185185
ProcessStreamReader(InputStream inputStream) {
186186
super("Local GCD InputStream reader");
@@ -195,15 +195,15 @@ void terminate() throws IOException {
195195

196196
@Override
197197
public void run() {
198-
try {
199-
while (!terminated) {
198+
while (!terminated) {
199+
try {
200200
String line = reader.readLine();
201201
if (line == null) {
202202
terminated = true;
203203
}
204+
} catch (IOException e) {
205+
// ignore
204206
}
205-
} catch (IOException e) {
206-
// ignore
207207
}
208208
}
209209

@@ -219,11 +219,11 @@ private static class ProcessErrorStreamReader extends Thread {
219219
private static final String GCD_LOGGING_CLASS =
220220
"com.google.apphosting.client.serviceapp.BaseApiServlet";
221221

222-
private volatile BufferedReader errorReader;
222+
private final BufferedReader errorReader;
223223
private String currentLog = null;
224224
private Level currentLogLevel = null;
225225
private boolean collectionMode = false;
226-
private boolean terminated = false;
226+
private volatile boolean terminated = false;
227227

228228
ProcessErrorStreamReader(InputStream errorStream, String blockUntil) throws IOException {
229229
super("Local GCD ErrorStream reader");
@@ -245,10 +245,10 @@ void terminate() throws IOException {
245245

246246
@Override
247247
public void run() {
248-
try {
249-
String previousLine = "";
250-
String nextLine = "";
251-
while (!terminated) {
248+
String previousLine = "";
249+
String nextLine = "";
250+
while (!terminated) {
251+
try {
252252
previousLine = nextLine;
253253
nextLine = errorReader.readLine();
254254
if (nextLine == null) {
@@ -257,9 +257,9 @@ public void run() {
257257
} else {
258258
processLogLine(previousLine, nextLine);
259259
}
260+
} catch (IOException e) {
261+
// ignore
260262
}
261-
} catch (IOException e) {
262-
// ignore
263263
}
264264
}
265265

0 commit comments

Comments
 (0)