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

Commit

Permalink
rhbz1065790 remove unnecessary type parameter from reindex task
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Feb 25, 2014
1 parent 18a4d1b commit 2e808e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -103,7 +103,7 @@ public String getCurrentClass() {
}

public boolean isError() {
AsyncTaskHandle<Boolean> taskHandle = reindexAsync.getProcessHandle();
AsyncTaskHandle<Void> taskHandle = reindexAsync.getProcessHandle();
if (taskHandle == null) {
return false;
} else if (taskHandle.isDone()) {
Expand Down Expand Up @@ -172,7 +172,7 @@ private String formatTimePeriod(long durationInMillis) {
}

public String getElapsedTime() {
TimedAsyncHandle<Boolean> processHandle = reindexAsync.getProcessHandle();
TimedAsyncHandle<Void> processHandle = reindexAsync.getProcessHandle();
if (processHandle == null) {
log.error("processHandle is null when looking up elapsed time");
return "";
Expand Down
16 changes: 8 additions & 8 deletions zanata-war/src/main/java/org/zanata/action/ReindexAsyncBean.java
Expand Up @@ -58,7 +58,7 @@ public class ReindexAsyncBean implements Serializable {
new LinkedHashMap<Class<?>, ReindexClassOptions>();
private Class<?> currentClass;

private TimedAsyncHandle<Boolean> handle;
private TimedAsyncHandle<Void> handle;

@Create
public void create() {
Expand Down Expand Up @@ -112,7 +112,7 @@ public List<ReindexClassOptions> getReindexOptions() {
return result;
}

public TimedAsyncHandle<Boolean> getProcessHandle() {
public TimedAsyncHandle<Void> getProcessHandle() {
return handle;
}

Expand Down Expand Up @@ -177,22 +177,22 @@ ClassIndexer getIndexer(Class<?> clazz) {
* as it is not recommended to reuse async tasks.
*/
private class ReindexTask implements
AsyncTask<Boolean, TimedAsyncHandle<Boolean>> {
AsyncTask<Void, TimedAsyncHandle<Void>> {

private TimedAsyncHandle<Boolean> handle;
private TimedAsyncHandle<Void> handle;

@Override
public TimedAsyncHandle<Boolean> getHandle() {
public TimedAsyncHandle<Void> getHandle() {
if (handle == null) {
String name = getClass().getSimpleName(); //+":"+indexingOptions
handle = new TimedAsyncHandle<Boolean>(name);
handle = new TimedAsyncHandle<Void>(name);
handle.setMaxProgress(getTotalOperations());
}
return handle;
}

@Override
public Boolean call() throws Exception {
public Void call() throws Exception {
// TODO this is necessary because isInProgress checks number of
// operations, which may be 0
// look at updating isInProgress not to care about count
Expand Down Expand Up @@ -242,7 +242,7 @@ public Boolean call() throws Exception {
log.info("Re-indexing finished");
}
getHandle().finishTiming();
return true;
return null;
}
}
}

0 comments on commit 2e808e7

Please sign in to comment.