Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 259510c
Merge: fdbdd25 5b902fd
Author: Sean Flanigan <sflaniga@redhat.com>
Date:   Wed Jan 14 10:46:48 2015 +1000

    Merge remote-tracking branch 'origin/master' into fix-formatting

    Conflicts:
    	zanata-client-commands/src/main/java/org/zanata/client/commands/pull/PullCommand.java
    	zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushCommand.java
    	zanata-rest-client/src/main/java/org/zanata/rest/client/ClientUtility.java
    	zanata-rest-client/src/main/java/org/zanata/rest/client/TraceDebugInterceptor.java

commit fdbdd25
Author: Sean Flanigan <sflaniga@redhat.com>
Date:   Fri Dec 5 15:23:28 2014 +1000

    Update zanata-parent

commit 97d9ac9
Author: Sean Flanigan <sflaniga@redhat.com>
Date:   Fri Dec 5 11:41:39 2014 +1000

    Fix formatting
  • Loading branch information
seanf committed Jan 14, 2015
1 parent da08157 commit 0e84b87
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 32 deletions.
7 changes: 3 additions & 4 deletions zanata-cli/src/main/java/org/zanata/client/ZanataClient.java
Expand Up @@ -211,10 +211,9 @@ private void printHelp(PrintWriter out) {
out.println();
out.println("Available commands:");
for (String cmd : OPTIONS.keySet()) {
out.println(" " + cmd /*
* + ": " + OPTIONS.get(cmd).newInstance().
* getCommandDescription()
*/);
out.println(" " + cmd);
// + ": " + OPTIONS.get(cmd).newInstance().
// getCommandDescription()
}
}

Expand Down
Expand Up @@ -49,7 +49,7 @@ public void handle(Request request, Response response) {

body.println(responseContent);
body.close();
} catch(Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
Expand Down
Expand Up @@ -28,7 +28,7 @@
*
*/
@PrepareForTest(SubCommandHandler2.class)
@PowerMockIgnore({"com.sun.*", "org.apache.log4j.*", "org.xml.*", "javax.xml.*"})
@PowerMockIgnore({ "com.sun.*", "org.apache.log4j.*", "org.xml.*", "javax.xml.*" })
@RunWith(PowerMockRunner.class)
public class ZanataClientTest {
@Rule
Expand Down
Expand Up @@ -188,8 +188,7 @@ public void checkNewerVersion() {
props.setProperty(LAST_CHECKED, today);
props.store(new BufferedWriter(new FileWriterWithEncoding(
updateMarker, Charsets.UTF_8)), null);
}
catch (IOException e) {
} catch (IOException e) {
log.warn("failed to load file {}", updateMarker);
}
}
Expand Down
Expand Up @@ -176,8 +176,7 @@ private static <T> String getUsageFromOptionAnnotation(
Option.class).usage()
// the usage text is not very well formatted (contains new line)
.replaceAll(System.getProperty("line.separator"), " ");
}
catch (NoSuchMethodException e) {
} catch (NoSuchMethodException e) {
log.error("can not find method: {} on class {}", methodName, optionsClass);
return methodName;
}
Expand Down
Expand Up @@ -264,9 +264,8 @@ && getOpts().getPullType() == PushPullType.Source) {
transResponse.getHeaders()
.getFirst(HttpHeaders.ETAG));
}
}
// 304 NOT MODIFIED (the document can stay the same)
else if (transResponse.getClientResponseStatus() == ClientResponse.Status.NOT_MODIFIED) {
} else if (transResponse.getClientResponseStatus() == ClientResponse.Status.NOT_MODIFIED) {
// 304 NOT MODIFIED (the document can stay the same)
log.info(
"No changes in translations for locale {} and document {}",
locale, localDocName);
Expand Down Expand Up @@ -309,7 +308,7 @@ else if (transResponse.getClientResponseStatus() == ClientResponse.Status.NOT_MO

} catch (RuntimeException e) {
String message =
"Operation failed: "+e.getMessage()+"\n\n"
"Operation failed: " + e.getMessage() + "\n\n"
+ " To retry from the last document, please set the following option(s):\n\n"
+ " ";
if (getOpts().getEnableModules()) {
Expand Down
Expand Up @@ -212,7 +212,7 @@ public void run() throws IOException {
}
} catch (IOException | RuntimeException e) {
log.error(
"Operation failed: "+e.getMessage()+"\n\n"
"Operation failed: " + e.getMessage() + "\n\n"
+ " To retry from the last document, please add the option: {}\n",
getOpts().buildFromDocArgument(qualifiedDocName));
throw new RuntimeException(e.getMessage(), e);
Expand Down
Expand Up @@ -420,7 +420,7 @@ public void visit(LocaleMapping locale,
}
} catch (Exception e) {
String message =
"Operation failed: "+e.getMessage()+"\n\n"
"Operation failed: " + e.getMessage() + "\n\n"
+ " To retry from the last document, please set the following option(s):\n\n"
+ " ";
if (getOpts().getEnableModules()) {
Expand Down Expand Up @@ -572,7 +572,8 @@ private void pushSrcDocToServer(final String docUri, final Resource srcDoc,
break;
}

wait(POLL_PERIOD); // Wait before retrying
// Wait before retrying
wait(POLL_PERIOD);
status = asyncProcessClient.getProcessStatus(status.getUrl());
}

Expand Down Expand Up @@ -693,7 +694,8 @@ targetDoc, extensions, getOpts()
break;
}

wait(POLL_PERIOD); // Wait before retrying
// Wait before retrying
wait(POLL_PERIOD);
status = asyncProcessClient.getProcessStatus(status.getUrl());
}
ConsoleUtils.endProgressFeedback();
Expand Down
Expand Up @@ -172,11 +172,8 @@ public void run() throws IOException {
+ "': existing translations on server may be overwritten/deleted");

if (getOpts().getPushType() == PushPullType.Both) {
confirmWithUser("This will overwrite existing documents AND TRANSLATIONS on the server.\n"); // ,
// and
// delete
// obsolete
// documents.\n");
confirmWithUser("This will overwrite existing documents AND TRANSLATIONS on the server.\n");
// , and delete obsolete documents.\n");
} else if (getOpts().getPushType() == PushPullType.Trans) {
confirmWithUser("This will overwrite existing TRANSLATIONS on the server.\n");
}
Expand Down Expand Up @@ -229,7 +226,7 @@ public void visit(LocaleMapping locale,
}
} catch (IOException | RuntimeException e) {
log.error(
"Operation failed: "+e.getMessage()+"\n\n"
"Operation failed: " + e.getMessage() + "\n\n"
+ " To retry from the last document, please add the option: {}\n",
getOpts().buildFromDocArgument(localDocName));
throw new RuntimeException(e.getMessage(), e);
Expand Down
Expand Up @@ -90,9 +90,8 @@ public void run() throws Exception {
.getProjectVersion(),
getOpts().getIncludeDetails(), getOpts()
.getIncludeWordLevelStats(), localeListArg);
}
// Otherwise, stats for the single document
else {
} else {
// Otherwise, stats for the single document
containerStats =
client
.getStatistics(getOpts().getProj(), getOpts()
Expand Down
Expand Up @@ -151,8 +151,7 @@ private static URI setUrl(ConfigurableProjectOptions opts) {
URI uri = new URI("http://localhost:8888/zanata");
opts.setUrl(uri.toURL());
return uri;
}
catch (Exception e) {
} catch (Exception e) {
throw Throwables.propagate(e);
}
}
Expand Down
Expand Up @@ -132,6 +132,6 @@ public void willThrowExceptionIfRuleIsInvalid() {

OptionsUtil.checkPotentialMistakesInRules(opts, console);

verify(console).printfln(Warning, _("invalid.rule"),rule);
verify(console).printfln(Warning, _("invalid.rule"), rule);
}
}
Expand Up @@ -88,7 +88,8 @@ public void willFilterAllProjectsIfUserTypeLetters() {
// Given: user input
ConsoleInteractor console =
MockConsoleInteractor.predefineAnswers(
"99", // part of project name
// part of project name
"99",
"1");
prompt =
new ProjectPrompt(console, opts,
Expand Down
Expand Up @@ -41,6 +41,7 @@ public boolean getEnableModules() {

@Override
public boolean getDeleteObsoleteModules() {
return false; // False for Simple push
// False for Simple push
return false;
}
}

0 comments on commit 0e84b87

Please sign in to comment.