auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Store getStore(PartitionId id) { <START> createAndStartBlobStoreIfAbsent(id); <END> return partitionToStore.get(id); }</code><technical_language>discussed offline, consider calls shutdownBlobStore removeStore in VCR replication</technical_language>

Target:
public Store getStore(PartitionId id) { try { lock.readLock().lock(); if (partitionToStore.containsKey(id)) { return partitionToStore.get(id).isStarted() ? partitionToStore.get(id) : null; } } finally { lock.readLock().unlock(); } return createAndStartBlobStoreIfAbsent(id); }
Source:
<code>public boolean close(final long timeout, final TimeUnit unit) { internalClose(); try { long duration = TimeUnit.MILLISECONDS.convert(timeout, unit); <START> Thread.sleep(duration); <END> } catch (InterruptedException e) { onErrorConsumers.forEach(consumer -> { consumer.accept(e); }); Thread.currentThread().interrupt(); return false; } return true; }</code><technical_language>Is run internalClose() schduleExecutor.scheduleWithFixedDelay() thread.sleep? Is</technical_language>

Target:
public boolean close(final long timeout, final TimeUnit unit) { internalClose(); return true; }
Source:
<code>public void marshal( GetStoreFileRequest getStoreFileRequest, WritableChannel channel ) throws IOException { StoreIdMarshal.INSTANCE.marshal( getStoreFileRequest.expectedStoreId(), channel ); channel.putLong( getStoreFileRequest.requiredTransactionId() ); String name = getStoreFileRequest.file().getName(); channel.putInt( name.length() ); <START> channel.put( name.getBytes(), name.length() ); <END> }</code><technical_language>Platform encoding again, name.getBytes()</technical_language>

Target:
public void marshal( GetStoreFileRequest getStoreFileRequest, WritableChannel channel ) throws IOException { StoreIdMarshal.INSTANCE.marshal( getStoreFileRequest.expectedStoreId(), channel ); channel.putLong( getStoreFileRequest.requiredTransactionId() ); String name = getStoreFileRequest.file().getName(); channel.putInt( name.length() ); channel.put( UTF8.encode( name ), name.length() ); }
Source:
<code>void resume() { if (paused.getAndSet(false)) { synchronized (lock) { <START> lock.notify(); <END> } } }</code><technical_language>resume() do more setting paused false</technical_language>

Target:
void resume() { hardDeleteLock.lock(); try { if (paused.compareAndSet(true, false)) { pauseCondition.signal(); } } finally { hardDeleteLock.unlock(); } }
Source:
<code>private Collection<JsonObject> performPagedRequest(BoundRequestBuilder requestBuilder, JsonObject body, int expectedStatusCode, String errorMessage) throws StashClientException { Collection<JsonObject> result = new ArrayList<>(); boolean doneLastPage = false; int nextPageStart = 0; while (!doneLastPage) { if (nextPageStart > 0) { <START> requestBuilder.addQueryParam("start", String.valueOf(nextPageStart)); <END> } JsonObject res = performRequest(requestBuilder, body, expectedStatusCode, errorMessage); JsonArray values = ((JsonArray) res.get("values")); if (values == null) { throw new StashClientException("Paged response did not include values"); } values.asCollection(result); doneLastPage = res.getBooleanOrDefault("isLastPage", true); nextPageStart = res.getIntegerOrDefault("nextPageStart", -1); } return result; }</code><technical_language>This add additional parameter "start" replace previous one. more activities end link params: ?start=25&start=50&start50&start-50... end fail</technical_language>

Target:
private Collection<JsonObject> performPagedRequest(BoundRequestBuilder requestBuilder, JsonObject body, int expectedStatusCode, String errorMessage) throws StashClientException { Collection<JsonObject> result = new ArrayList<>(); boolean doneLastPage = false; int nextPageStart = 0; while (!doneLastPage) { requestBuilder.resetQuery(); if (nextPageStart > 0) { requestBuilder.addQueryParam("start", String.valueOf(nextPageStart)); } JsonObject res = performRequest(requestBuilder, body, expectedStatusCode, errorMessage); JsonArray values = ((JsonArray) res.get("values")); if (values == null) { throw new StashClientException("Paged response did not include values"); } values.asCollection(result); doneLastPage = res.getBooleanOrDefault("isLastPage", true); nextPageStart = res.getIntegerOrDefault("nextPageStart", -1); } return result; }
Source:
<code><START> public org.kiji.schema.AsyncKijiBufferedWriter openAsyncBufferedWriter() throws IOException { <END> return AsyncHBaseAsyncKijiBufferedWriter.create(mTable); }</code><technical_language>Full path is longer needed, right</technical_language>

Target:
public AsyncKijiBufferedWriter openAsyncBufferedWriter() throws IOException { return AsyncHBaseAsyncKijiBufferedWriter.create(mTable); }
Source:
<code>public ItemStack getOutput(@Nonnull ItemStack input, @Nonnull ItemStack ingredient) { <START> if (isIngredient(ingredient)) <END> { ItemStack result = PotionHelper.doReaction(ingredient, input); if (result != input) { return result; } return null; } return null; }</code><technical_language>check for validity of ingredient</technical_language>

Target:
public ItemStack getOutput(@Nonnull ItemStack input, @Nonnull ItemStack ingredient) { if (!input.func_190926_b() && !ingredient.func_190926_b() && isIngredient(ingredient)) { ItemStack result = PotionHelper.doReaction(ingredient, input); if (result != input) { return result; } return ItemStack.field_190927_a; } return ItemStack.field_190927_a; }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getImportCommand()) { restore(); } else if (command == getRemoveCommand()) { remove(); } else if <START> ("OnRemove".equals(command.getName())) <END> { onRemove(); } else if (command.getName().equals("Cancel")) { cancel(); } }</code><technical_language>Consider changing "command.getName().equals("OnRemove")" fit 'else if'</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getImportCommand()) { restore(); } else if (command == getRemoveCommand()) { remove(); } else if (command.getName().equals("OnRemove")) { onRemove(); } else if (command.getName().equals("Cancel")) { cancel(); } }
Source:
<code>private static String getMetricsVersion(final Properties config) { <START> if (config.containsKey(StreamsConfig.BUILT_IN_METRICS_VERSION_CONFIG)) { return config.getProperty(StreamsConfig.BUILT_IN_METRICS_VERSION_CONFIG); } return DEFAULT_METRICS_VERSION; <END> }</code><technical_language>req: Please if need this method. suggestion return config.getProperty(StreamsConfig.BUILT_IN_METRICS_VERSION_CONFIG, DEFAULT_METRICS_VERSION);</technical_language>

Target:
private static String getMetricsVersion(final Properties config) { return config.getProperty(StreamsConfig.BUILT_IN_METRICS_VERSION_CONFIG, DEFAULT_METRICS_VERSION); }
Source:
<code>public Contest() { <START> setContestId(null); <END> setDescription(""); setIsVisible(false); setLength(defaultContestLength); setTime(new Timestamp(System.currentTimeMillis())); setTitle(""); setType((byte) Global.ContestType.PUBLIC.ordinal()); }</code><technical_language>class, do setter set value, simply assign(contestId = null)</technical_language>

Target:
public Contest() { contestId = null; description = ""; isVisible = false; length = defaultContestLength; time = new Timestamp(System.currentTimeMillis()); title = ""; type = (byte) Global.ContestType.PUBLIC.ordinal(); }
Source:
<code><START> public static Matcher<? super View> withUsageHintOnClick(final Matcher<? extends CharSequence> charSequenceMatcher) { <END> return new TypeSafeMatcher<View>() { @Override protected boolean matchesSafely(View view) { if (!view.isClickable()) { return false; } AccessibilityNodeInfo accessibilityNodeInfo = view.createAccessibilityNodeInfo(); AccessibilityNodeInfo.AccessibilityAction clickAction = findAction(accessibilityNodeInfo, AccessibilityNodeInfo.ACTION_CLICK); return charSequenceMatcher.matches(clickAction.getLabel()); } @Override public void describeTo(Description description) { description.appendText("is clickable and has custom usage hint for ACTION_CLICK: "); charSequenceMatcher.describeTo(description); } }; }</code><technical_language>I wrong a lot of common logic in matchers extracted a common superclass (yeah I know, composition work here), including longpress matchers</technical_language>

Target:
public static Matcher<? super View> withUsageHintOnClick(final Matcher<? extends CharSequence> charSequenceMatcher) { return new TypeSafeMatcher<View>() { @Override protected boolean matchesSafely(View view) { if (!view.isClickable()) { return false; } AccessibilityNodeInfo.AccessibilityAction clickAction = findAction(view, AccessibilityNodeInfo.ACTION_CLICK); return charSequenceMatcher.matches(clickAction.getLabel()); } @Override public void describeTo(Description description) { description.appendText("is clickable and has custom usage hint for ACTION_CLICK: "); charSequenceMatcher.describeTo(description); } }; }
Source:
<code>public synchronized void close() { if (builder.length() > 0 || outputStreamBuffer.size() != 0) { <START> println(); <END> } super.close(); }</code><technical_language>related, close issue a println here</technical_language>

Target:
public synchronized void close() { if (outputStreamBuffer.size() > 0) { print(""); } if (builder.length() > 0 || outputStreamBuffer.size() > 0) { println(); } super.close(); }
Source:
<code>private RevCommit getRightCommit(RevWalk revWalk, Repository repository) throws InvocationTargetException { try { String target; if (repository.getRepositoryState().equals(RepositoryState.MERGING)) { target = Constants.MERGE_HEAD; } else if (repository.getRepositoryState().equals(RepositoryState.CHERRY_PICKING)) { target = Constants.CHERRY_PICK_HEAD; } else if (repository.getRepositoryState().equals(RepositoryState.REBASING_INTERACTIVE)) { target = readFile(repository.getDirectory(), RebaseCommand.REBASE_MERGE + File.separatorChar + RebaseCommand.STOPPED_SHA); } else { target = Constants.ORIG_HEAD; } ObjectId mergeHead = repository.resolve(target); if (mergeHead == null) { <START> throw new IOException(NLS.bind(CoreText.ValidationUtils_CanNotResolveRefMessage, target)); <END> } return revWalk.parseCommit(mergeHead); } catch (IOException e) { throw new InvocationTargetException(e); } }</code><technical_language>This change new version incompatible older eclipses (using older EGits). this class is originally copy/pasted egit, copy/paste offending String in NLS class retain compatibility</technical_language>

Target:
private RevCommit getRightCommit(RevWalk revWalk, Repository repository) throws InvocationTargetException { try { String target; if (repository.getRepositoryState().equals(RepositoryState.MERGING)) { target = Constants.MERGE_HEAD; } else if (repository.getRepositoryState().equals(RepositoryState.CHERRY_PICKING)) { target = Constants.CHERRY_PICK_HEAD; } else if (repository.getRepositoryState().equals(RepositoryState.REBASING_INTERACTIVE)) { target = readFile(repository.getDirectory(), RebaseCommand.REBASE_MERGE + File.separatorChar + RebaseCommand.STOPPED_SHA); } else { target = Constants.ORIG_HEAD; } ObjectId mergeHead = repository.resolve(target); if (mergeHead == null) { throw new IOException(NLS.bind( EMFCompareEGitUIMessages.getString("ValidationUtils_CanNotResolveRefMessage"), target)); } return revWalk.parseCommit(mergeHead); } catch (IOException e) { throw new InvocationTargetException(e); } }
Source:
<code>public void close() throws BKException, InterruptedException { closeLock.writeLock().lock(); try { if (closed) { return; } closed = true; } finally { closeLock.writeLock().unlock(); } bookieClient.close(); try { ledgerManager.close(); ledgerIdGenerator.close(); ledgerManagerFactory.close(); } catch (IOException ie) { LOG.error("Failed to close ledger manager : ", ie); } scheduler.shutdown(); if (!scheduler.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The scheduler did not shutdown cleanly"); } mainWorkerPool.shutdown(); if (!mainWorkerPool.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The mainWorkerPool did not shutdown cleanly"); } if (this.bookieInfoScheduler != null) { this.bookieInfoScheduler.shutdown(); if (!bookieInfoScheduler.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The bookieInfoScheduler did not shutdown cleanly"); } } if (ownTimer) { requestTimer.stop(); } if (ownEventLoopGroup) { eventLoopGroup.shutdownGracefully(); } <START> this.regClient.close(); <END> this.metadataDriver.close(); }</code><technical_language>regClient is owned metadataDriver. metadataDriver#close responsible for cleaning</technical_language>

Target:
public void close() throws BKException, InterruptedException { closeLock.writeLock().lock(); try { if (closed) { return; } closed = true; } finally { closeLock.writeLock().unlock(); } bookieClient.close(); try { ledgerManager.close(); ledgerIdGenerator.close(); } catch (IOException ie) { LOG.error("Failed to close ledger manager : ", ie); } scheduler.shutdown(); if (!scheduler.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The scheduler did not shutdown cleanly"); } mainWorkerPool.shutdown(); if (!mainWorkerPool.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The mainWorkerPool did not shutdown cleanly"); } if (this.bookieInfoScheduler != null) { this.bookieInfoScheduler.shutdown(); if (!bookieInfoScheduler.awaitTermination(10, TimeUnit.SECONDS)) { LOG.warn("The bookieInfoScheduler did not shutdown cleanly"); } } if (ownTimer) { requestTimer.stop(); } if (ownEventLoopGroup) { eventLoopGroup.shutdownGracefully(); } this.metadataDriver.close(); }
Source:
<code>public Attribute convertEmptyStringIntoNullInAttrValue(Attribute attributeToConvert) { if(attributeToConvert.getValue() == null) return attributeToConvert; String testAttributeType = attributeToConvert.getType(); <START> if ((testAttributeType.equals(String.class.getName()) || testAttributeType.equals("java.lang.LargeString")) <END> && attributeToConvert.getValue().equals("")) { attributeToConvert.setValue(null); } return attributeToConvert; }</code><technical_language>I prefer constant there</technical_language>

Target:
public Attribute convertEmptyStringIntoNullInAttrValue(Attribute attributeToConvert) { if(attributeToConvert.getValue() == null) return attributeToConvert; String testAttributeType = attributeToConvert.getType(); if ((testAttributeType.equals(String.class.getName()) || testAttributeType.equals(BeansUtils.largeStringClassName)) && attributeToConvert.getValue().equals("")) { attributeToConvert.setValue(null); } return attributeToConvert; }
Source:
<code>public void removeStoredQuery(StoredQuery query) { <START> storedQueryDirByContext().get(toFilename(query.getName())).delete(); <END> }</code><technical_language>if local global stored queries, is remove a global one? sense mind, useful get some suitable error message allowing understand on, e.g. "Cannot remove global stored queries a local services"... however, mind, is annoyance virtual service local global. is a downside matter path is chosen</technical_language>

Target:
public void removeStoredQuery(StoredQuery query) { final String filename = toFilename(query.getName()); Resource resource = storedQueryDirByContext().get(filename); if (resource.getType() == Type.RESOURCE) { resource.delete(); } else { if (localWorkspaceDir() != null && storedQueryDir().get(filename).getType() == Type.RESOURCE) { throw new GeoServerRuntimException( "Global query can not be deleted from a virtual service."); } } }
Source:
<code>public boolean registerClient(Client client) { try (Jedis j = pool.getResource()) { byte[] lockValue = null; byte[] lockKey = toLockKey(client.getEndpoint()); try { lockValue = RedisLock.acquire(j, lockKey); byte[] k = toEndpointKey(client.getEndpoint()); byte[] old = j.getSet(k, serialize(client)); byte[] idx = toRegKey(client.getRegistrationId()); j.set(idx, client.getEndpoint().getBytes(UTF_8)); <START> j.expire(idx, client.getLifeTimeInSec().intValue()); <END> if (old != null) { Client oldClient = deserialize(old); for (ClientRegistryListener l : listeners) { l.unregistered(oldClient); } } for (ClientRegistryListener l : listeners) { l.registered(client); } return true; } finally { RedisLock.release(j, lockKey, lockValue); } } }</code><technical_language>Expiration is needed anymore</technical_language>

Target:
public boolean registerClient(Client client) { try (Jedis j = pool.getResource()) { byte[] lockValue = null; byte[] lockKey = toLockKey(client.getEndpoint()); try { lockValue = RedisLock.acquire(j, lockKey); byte[] k = toEndpointKey(client.getEndpoint()); byte[] old = j.getSet(k, serialize(client)); byte[] idx = toRegKey(client.getRegistrationId()); j.set(idx, client.getEndpoint().getBytes(UTF_8)); if (old != null) { Client oldClient = deserialize(old); for (ClientRegistryListener l : listeners) { l.unregistered(oldClient); } } for (ClientRegistryListener l : listeners) { l.registered(client); } return true; } finally { RedisLock.release(j, lockKey, lockValue); } } }
Source:
<code>public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset()); HaxeLocalVarDeclaration localVarDeclaration = PsiTreeUtil.getParentOfType(elementAt, HaxeLocalVarDeclaration.class); if (localVarDeclaration == null) return; String name = localVarDeclaration.getComponentName().getName(); HaxeTypeTag typeTag = localVarDeclaration.getTypeTag(); HaxeVarInit varInit = localVarDeclaration.getVarInit(); String text = "var " + name; if (typeTag != null) { text += " " + typeTag.getText(); } text += ";"; HaxeVarDeclaration varDeclaration = HaxeElementGenerator.createVarDeclaration(project, text); <START> if (varInit != null) { <END> text = name + varInit.getText(); } varDeclaration.getNode().addLeaf(HaxeTokenTypes.OSEMI, "\n", null); PsiElement statementFromText = HaxeElementGenerator.createStatementFromText(project, text); statementFromText.getNode().addLeaf(HaxeTokenTypes.OSEMI, ";", null); localVarDeclaration.getParent().addBefore(varDeclaration, localVarDeclaration); PsiElement replace = localVarDeclaration.replace(statementFromText); final TextRange range = replace.getTextRange(); final PsiFile baseFile = file.getViewProvider().getPsi(file.getViewProvider().getBaseLanguage()); CodeStyleManager.getInstance(project).reformatText(baseFile, range.getStartOffset(), range.getEndOffset()); }</code><technical_language>And, if varInit is null, want insert declaration a time? do want quit</technical_language>

Target:
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset()); HaxeLocalVarDeclaration localVarDeclaration = PsiTreeUtil.getParentOfType(elementAt, HaxeLocalVarDeclaration.class); if (localVarDeclaration == null) return; String name = localVarDeclaration.getComponentName().getName(); HaxeTypeTag typeTag = localVarDeclaration.getTypeTag(); HaxeVarInit varInit = localVarDeclaration.getVarInit(); String text = "var " + name; if (typeTag != null) { text += " " + typeTag.getText(); } text += ";"; HaxeVarDeclaration varDeclaration = HaxeElementGenerator.createVarDeclaration(project, text); text = name + varInit.getText(); varDeclaration.getNode().addLeaf(HaxeTokenTypes.OSEMI, "\n", null); PsiElement statementFromText = HaxeElementGenerator.createStatementFromText(project, text); statementFromText.getNode().addLeaf(HaxeTokenTypes.OSEMI, ";", null); localVarDeclaration.getParent().addBefore(varDeclaration, localVarDeclaration); PsiElement replace = localVarDeclaration.replace(statementFromText); final TextRange range = replace.getTextRange(); final PsiFile baseFile = file.getViewProvider().getPsi(file.getViewProvider().getBaseLanguage()); CodeStyleManager.getInstance(project).reformatText(baseFile, range.getStartOffset(), range.getEndOffset()); }
Source:
<code>public <R, X extends Exception> R withHandle(HandleCallback<R, X> callback) throws X { Handle h = JdbiUtil.getHandle(jdbi); R result = callback.withHandle(h); <START> JdbiUtil.closeIfNeeded(h); <END> return result; }</code><technical_language>I close handle here. closed in afterCompletion method. I handle is binded active transaction</technical_language>

Target:
public <R, X extends Exception> R withHandle(HandleCallback<R, X> callback) throws X { Handle h = JdbiUtil.getHandle(jdbi); try { return callback.withHandle(h); } finally { JdbiUtil.closeIfNeeded(h); } }
Source:
<code>protected void doTestIndexDataWithLegacyParserStableState() throws Exception { StreamEventWriter streamEventWriter = getStreamEventWriter(); final GeneratedTestConfig generatedTestConfig = new GeneratedTestConfig(); try ( final Closeable ignored1 = unloader(generatedTestConfig.getFullDatasourceName()) ) { final String taskSpec = generatedTestConfig.getStreamIngestionPropsTransform().apply(getResourceAsString(INDEXER_FILE_LEGACY_PARSER)); LOG.info("supervisorSpec: [%s]\n", taskSpec); generatedTestConfig.setSupervisorId(indexer.submitSupervisor(taskSpec)); LOG.info("Submitted supervisor"); <START> wikipediaStreamEventGenerator.start(generatedTestConfig.getStreamName(), streamEventWriter, TOTAL_NUMBER_OF_SECOND, FIRST_EVENT_TIME); <END> verifyIngestedData(generatedTestConfig); } finally { doMethodTeardown(generatedTestConfig, streamEventWriter); } }</code><technical_language>call run() generate() start() generator is start/stop, generates events in start()</technical_language>

Target:
protected void doTestIndexDataWithLegacyParserStableState() throws Exception { StreamEventWriter streamEventWriter = createStreamEventWriter(config); final GeneratedTestConfig generatedTestConfig = new GeneratedTestConfig(); try ( final Closeable ignored1 = unloader(generatedTestConfig.getFullDatasourceName()) ) { final String taskSpec = generatedTestConfig.getStreamIngestionPropsTransform().apply(getResourceAsString(INDEXER_FILE_LEGACY_PARSER)); LOG.info("supervisorSpec: [%s]\n", taskSpec); generatedTestConfig.setSupervisorId(indexer.submitSupervisor(taskSpec)); LOG.info("Submitted supervisor"); wikipediaStreamEventGenerator.run(generatedTestConfig.getStreamName(), streamEventWriter, TOTAL_NUMBER_OF_SECOND, FIRST_EVENT_TIME); verifyIngestedData(generatedTestConfig); } finally { doMethodTeardown(generatedTestConfig, streamEventWriter); } }
Source:
<code>private static boolean isRequiredInjection(Element element) { <START> return !hasAnnotationWithName(element, Nullable.class.getSimpleName()); <END> }</code><technical_language>safe, I intend delete @Nullable, put string "Nullable" instead</technical_language>

Target:
private static boolean isRequiredInjection(Element element) { return !hasAnnotationWithName(element, NULLABLE_ANNOTATION_NAME); }
Source:
<code>protected void compare(ByteString a, ByteString b) { Assert.assertTrue(underTest.compare(a, b) < 0); Assert.assertTrue(underTest.compare(b, a) > 0); <START> Assert.assertEquals(0, underTest.compare(b, b)); <END> }</code><technical_language>assert is 2</technical_language>

Target:
private void compare(ByteString a, ByteString b) { Assert.assertTrue(underTest.compare(a, b) < 0); Assert.assertTrue(underTest.compare(b, a) > 0); Assert.assertTrue(underTest.compare(b, b) == 0); }
Source:
<code>private void fireAllEvents() { for (Entry<String, Set<IZkChildListener>> entry : _childListener.entrySet()) { fireChildChangedEvents(entry.getKey(), entry.getValue(), true); } for (Entry<String, Set<IZkDataListenerEntry>> entry : _dataListener.entrySet()) { <START> fireDataChangedEvents(entry.getKey(), entry.getValue()); <END> } }</code><technical_language>Another question, this is I sure. true false passed in 3rd parameter in line 962. function signature default value. for this invocation of fireDataChangeEvents</technical_language>

Target:
private void fireAllEvents() { for (Entry<String, Set<IZkChildListener>> entry : _childListener.entrySet()) { fireChildChangedEvents(entry.getKey(), entry.getValue(), true); } for (Entry<String, Set<IZkDataListenerEntry>> entry : _dataListener.entrySet()) { fireDataChangedEvents(entry.getKey(), entry.getValue(), OptionalLong.empty(), true); } }
Source:
<code>public ObservableValue<String> getFields(OrFields fields) { ObservableValue<String> value = fieldValues.get(fields); if (value != null) { return value; } ArrayList<Observable> observables = new ArrayList<>(List.of(entry.getObservables())); observables.add(nameFormatter); value = Bindings.createStringBinding(() -> { for (Field field : fields) { if (field.getProperties().contains(FieldProperty.PERSON_NAMES) <START> && nameFormatter.getValue().needsFormatting()) { <END> Optional<String> name = entry.getResolvedFieldOrAlias(field, database); if (name.isPresent()) { return nameFormatter.getValue().formatNameLatexFree(name.get()); } } else { Optional<String> content = entry.getResolvedFieldOrAliasLatexFree(field, database); if (content.isPresent()) { return content.get(); } } } return ""; }, observables.toArray(Observable[]::new)); fieldValues.put(fields, value); return value; }</code><technical_language>raised a good point formatting handled nameFormatter. Suggestion: move compete code of this if block name formatter. add if check there, responsibility of author formatting in class. For this entry, field database need passed formatNameLatexFree method (maybe pass database a constructor element)</technical_language>

Target:
public ObservableValue<String> getFields(OrFields fields) { ObservableValue<String> value = fieldValues.get(fields); if (value != null) { return value; } ArrayList<Observable> observables = new ArrayList<>(List.of(entry.getObservables())); observables.add(fieldValueFormatter); value = Bindings.createStringBinding(() -> fieldValueFormatter.getValue().formatFieldsValues(fields, entry), observables.toArray(Observable[]::new)); fieldValues.put(fields, value); return value; }
Source:
<code>public void testAvoidTimeoutDisconnectWithDefaultStatusInterval() throws Exception { <START> exception.expect(TestTimedOutException.class); <END> exception.expectMessage(CoreMatchers.containsString("test timed out after")); PGConnection pgConnection = (PGConnection) replConnection; PGReplicationStream stream = pgConnection .replicationStream() .logical() .withSlotName(SLOT_NAME) .withStartPosition(getCurrentLSN()) .start(); while (!Thread.interrupted()) { ByteBuffer buffer = stream.read(); System.out.println("Received: " + toString(buffer)); } }</code><technical_language>Is "keep alive" configurable? 3-4 seconds? sounds sad a test takes 30 seconds</technical_language>

Target:
public void testAvoidTimeoutDisconnectWithDefaultStatusInterval() throws Exception { final int statusInterval = getKeepAliveTimeout(); ExecutorService executor = Executors.newSingleThreadExecutor(); Future future = null; boolean done; try { future = executor.submit(new Callable<Object>() { @Override public Object call() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; PGReplicationStream stream = pgConnection .getReplicationAPI() .replicationStream() .logical() .withSlotName(SLOT_NAME) .withStartPosition(getCurrentLSN()) .withStatusInterval(Math.round(statusInterval / 3), TimeUnit.MILLISECONDS) .start(); while (!Thread.interrupted()) { stream.read(); } return null; } }); future.get(5, TimeUnit.SECONDS); done = future.isDone(); } catch (TimeoutException timeout) { done = future.isDone(); } finally { executor.shutdownNow(); } assertThat( "ReplicationStream should periodically send keep alive message to postgresql to avoid disconnect from server", done, CoreMatchers.equalTo(false) ); }
Source:
<code>public boolean matches(RelOptRuleCall call) { Sort sort = call.rel(0); TableSourceTable tableSourceTable = call.rel(1).getTable().unwrap(TableSourceTable.class); boolean onlyLimit = sort.getCollation().getFieldCollations().isEmpty() && sort.fetch != null; return onlyLimit && tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsLimitPushDown <START> && !Arrays.stream(tableSourceTable.extraDigests()).anyMatch(str -> str.startsWith("limit=[")); <END> }</code><technical_language>nit: simpler way: noneMatch instead of ! + anyMatch. btw, update matches method of PushFilterIntoTableSourceScanRule</technical_language>

Target:
public boolean matches(RelOptRuleCall call) { Sort sort = call.rel(0); TableSourceTable tableSourceTable = call.rel(1).getTable().unwrap(TableSourceTable.class); boolean onlyLimit = sort.getCollation().getFieldCollations().isEmpty() && sort.fetch != null; return onlyLimit && tableSourceTable != null && tableSourceTable.tableSource() instanceof SupportsLimitPushDown && Arrays.stream(tableSourceTable.extraDigests()).noneMatch(str -> str.startsWith("limit=[")); }
Source:
<code>public abstract @Nonnull Openstack getOpenstack( @Nonnull String endPointUrl, @Nonnull OpenstackCredential openstackCredential, @CheckForNull String region ) throws FormValidation; public static @Nonnull Openstack get( @CheckForNull final String endPointUrl, @CheckForNull final OpenstackCredential auth, @CheckForNull final String region ) throws FormValidation { if (auth == null) { <START> throw new RuntimeException("authentication is null"); <END> } final String fingerprint = Util.getDigestOf(endPointUrl + '\n' + auth.toString() + '\n' + region); final FactoryEP ep = ExtensionList.lookup(FactoryEP.class).get(0); final Callable<Openstack> cacheMissFunction = new Callable<Openstack>() { @Override public Openstack call() throws FormValidation { return ep.getOpenstack(endPointUrl,auth, region); } }; try { return ep.cache.get(fingerprint, cacheMissFunction); } catch (UncheckedExecutionException | ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof FormValidation) { throw (FormValidation) cause; } if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(e); } }</code><technical_language>keeping parameters @Nonnull then</technical_language>

Target:
public abstract @Nonnull Openstack getOpenstack( @Nonnull String endPointUrl, @Nonnull OpenstackCredential openstackCredential, @CheckForNull String region ) throws FormValidation; public static @Nonnull Openstack get( @Nonnull final String endPointUrl, @Nonnull final OpenstackCredential auth, @Nonnull final String region ) throws FormValidation { final String fingerprint = Util.getDigestOf(endPointUrl + '\n' + auth.toString() + '\n' + region); final FactoryEP ep = ExtensionList.lookup(FactoryEP.class).get(0); final Callable<Openstack> cacheMissFunction = new Callable<Openstack>() { @Override public Openstack call() throws FormValidation { return ep.getOpenstack(endPointUrl,auth, region); } }; try { return ep.cache.get(fingerprint, cacheMissFunction); } catch (UncheckedExecutionException | ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof FormValidation) { throw (FormValidation) cause; } if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(e); } }
Source:
<code>public void close() throws IOException { try { writeRowGroup(); output.close(); } finally { <START> Closer closer = Closer.create(); <END> closer.register(keySectionOutput::destroy); for (ColumnEncoder columnEncoder : columnEncoders) { closer.register(columnEncoder::destroy); } closer.close(); } }</code><technical_language>Consider try (Closer closer = ...) if Closer. Also, this Closer instance handle try section, eliminating try-finally. (Mind order in closer closes though)</technical_language>

Target:
public void close() throws IOException { try (Closer closer = Closer.create()) { writeRowGroup(); closer.register(output); closer.register(keySectionOutput::destroy); for (ColumnEncoder columnEncoder : columnEncoders) { closer.register(columnEncoder::destroy); } } }
Source:
<code>private static int getHashPosition(Block keyBlock, int position, MethodHandle keyBlockHashCode, int hashTableSize) { if (keyBlock.isNull(position)) { throw new IllegalArgumentException("map keys cannot be null"); } long hashCode; try { hashCode = (long) keyBlockHashCode.invokeExact(keyBlock, position); } catch (Throwable throwable) { if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } throw new RuntimeException(throwable); } return (int) Math.floorMod(hashCode, hashTableSize); <START> } <END></code><technical_language>long hashCode; try { hashCode = (long) keyBlockHashCode.invokeExact(keyBlock, position); } catch (RuntimeException e) { throw e; } catch (Throwable throwable) { throw new RuntimeException(throwable); }</technical_language>

Target:
private static int getHashPosition(Block keyBlock, int position, MethodHandle keyBlockHashCode, int hashTableSize) { if (keyBlock.isNull(position)) { throw new IllegalArgumentException("map keys cannot be null"); } long hashCode; try { hashCode = (long) keyBlockHashCode.invokeExact(keyBlock, position); } catch (RuntimeException e) { throw e; } catch (Throwable throwable) { throw new RuntimeException(throwable); } return (int) Math.floorMod(hashCode, hashTableSize); }
Source:
<code>public List<String> getArguments() { <START> return Lists.newArrayList(_incomingTimeColumn, _outgoingTimeColumn); <END> }</code><technical_language>Argument _incomingTimeColumn</technical_language>

Target:
public List<String> getArguments() { return Collections.singletonList(_incomingTimeColumn); }
Source:
<code>public boolean isEnabled() { PerfPlugin plugin = PerfPlugin.getDefault(); IPath workingDir = plugin.getWorkingDir(); URI curStatDataURI = null; URI prevStatDataURI = null; if (workingDir != null) { IPath curStatData = plugin.getPerfFile(PerfPlugin.PERF_DEFAULT_STAT); IPath prevStatData = plugin.getPerfFile(PerfPlugin.PERF_DEAFULT_OLD_STAT); IRemoteFileProxy proxy = null; try { curStatDataURI = new URI(curStatData.toPortableString()); prevStatDataURI = new URI(prevStatData.toPortableString()); proxy = RemoteProxyManager.getInstance().getFileProxy(curStatDataURI); } catch (URISyntaxException e) { <START> e.printStackTrace(); <END> } catch (CoreException e) { e.printStackTrace(); } IFileStore curFileStore = proxy.getResource(curStatDataURI.getPath()); IFileStore prevFileStore = proxy.getResource(prevStatDataURI.getPath()); return (curFileStore.fetchInfo().exists() && prevFileStore.fetchInfo().exists()); } return false; }</code><technical_language>Do print stack trace</technical_language>

Target:
public boolean isEnabled() { PerfPlugin plugin = PerfPlugin.getDefault(); IPath workingDir = plugin.getWorkingDir(); URI curStatDataURI = null; URI prevStatDataURI = null; if (workingDir != null) { IPath curStatData = plugin.getPerfFile(PerfPlugin.PERF_DEFAULT_STAT); IPath prevStatData = plugin.getPerfFile(PerfPlugin.PERF_DEAFULT_OLD_STAT); IRemoteFileProxy proxy = null; try { curStatDataURI = new URI(curStatData.toPortableString()); prevStatDataURI = new URI(prevStatData.toPortableString()); proxy = RemoteProxyManager.getInstance().getFileProxy(curStatDataURI); } catch (URISyntaxException e) { MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError); } catch (CoreException e) { MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError); } IFileStore curFileStore = proxy.getResource(curStatDataURI.getPath()); IFileStore prevFileStore = proxy.getResource(prevStatDataURI.getPath()); return (curFileStore.fetchInfo().exists() && prevFileStore.fetchInfo().exists()); } return false; }
Source:
<code>public final void start() throws LifecycleException { final ModelControllerClientConfiguration.Builder clientConfigBuilder = new ModelControllerClientConfiguration.Builder() .setProtocol(containerConfig.getManagementProtocol()) .setHostName(containerConfig.getManagementAddress()) .setPort(containerConfig.getManagementPort()) .setAuthenticationConfigUri(authenticationConfig); final int connectionTimeout = containerConfig.getConnectionTimeout(); <START> if(0 != connectionTimeout) { <END> clientConfigBuilder.setConnectionTimeout(connectionTimeout); } if(containerConfig.getUsername() != null) { Authentication.username = containerConfig.getUsername(); Authentication.password = containerConfig.getPassword(); clientConfigBuilder.setHandler(getCallbackHandler()); } mccProvider.setDelegate(ModelControllerClient.Factory.create(clientConfigBuilder.build())); try { final Properties jndiProps = new Properties(); jndiProps.setProperty(Context.URL_PKG_PREFIXES, JBOSS_URL_PKG_PREFIX); jndiContext.set(new InitialContext(jndiProps)); } catch (final NamingException ne) { throw new LifecycleException("Could not set JNDI Naming Context", ne); } try { startInternal(); } catch (LifecycleException e) { safeCloseClient(); throw e; } }</code><technical_language>This if (connectionTimeout > 0). internal code currently handle this, rely that</technical_language>

Target:
public final void start() throws LifecycleException { final ModelControllerClientConfiguration.Builder clientConfigBuilder = new ModelControllerClientConfiguration.Builder() .setProtocol(containerConfig.getManagementProtocol()) .setHostName(containerConfig.getManagementAddress()) .setPort(containerConfig.getManagementPort()) .setAuthenticationConfigUri(authenticationConfig); final int connectionTimeout = containerConfig.getConnectionTimeout(); if(connectionTimeout > 0) { clientConfigBuilder.setConnectionTimeout(connectionTimeout); } if(containerConfig.getUsername() != null) { Authentication.username = containerConfig.getUsername(); Authentication.password = containerConfig.getPassword(); clientConfigBuilder.setHandler(getCallbackHandler()); } mccProvider.setDelegate(ModelControllerClient.Factory.create(clientConfigBuilder.build())); try { final Properties jndiProps = new Properties(); jndiProps.setProperty(Context.URL_PKG_PREFIXES, JBOSS_URL_PKG_PREFIX); jndiContext.set(new InitialContext(jndiProps)); } catch (final NamingException ne) { throw new LifecycleException("Could not set JNDI Naming Context", ne); } try { startInternal(); } catch (LifecycleException e) { safeCloseClient(); throw e; } }
Source:
<code><START> public void setLogsUrl(String logsUrl) { <END> this.logsUrl = logsUrl; }</code><technical_language>set if null empty</technical_language>

Target:
public void setLogsUrl(String logsUrl) { if (!StringUtils.isEmpty(logsUrl)) { this.logsUrl = logsUrl; } }
Source:
<code>public <START> @NonNull ByteBuffer <END> getBody() { return fBody; }</code><technical_language>Remove @NonNull annotation</technical_language>

Target:
public ByteBuffer getBody() { return fBody; }
Source:
<code>@Override public View getView(int position, View convertView, ViewGroup parent) { SquaredImageView view = (SquaredImageView) convertView; if (view == null) { view = new SquaredImageView(context); view.setScaleType(CENTER_CROP); } String url = getItem(position); Picasso.with(context) .load(url) <START> .key(Uri.parse(url).getLastPathSegment()) <END> .placeholder(R.drawable.placeholder) .error(R.drawable.error) .fit() .into(view); return view; }</code><technical_language>change this sample. meant indicator of simple case. want users copy/pasting this apps</technical_language>

Target:
@Override public View getView(int position, View convertView, ViewGroup parent) { SquaredImageView view = (SquaredImageView) convertView; if (view == null) { view = new SquaredImageView(context); view.setScaleType(CENTER_CROP); } String url = getItem(position); Picasso.with(context) .load(url) .placeholder(R.drawable.placeholder) .error(R.drawable.error) .fit() .into(view); return view; }
Source:
<code>public void validate(Object obj, Errors errors) { super.validate(obj, errors); DrugOrder order = (DrugOrder) obj; if (order == null) { errors.reject("error.general"); } else { ValidationUtils.rejectIfEmpty(errors, "asNeeded", "error.null"); if (order.getAction() != Order.Action.DISCONTINUE) { ValidationUtils.rejectIfEmpty(errors, "dosingType", "error.null"); } if (order.getDrug() == null || order.getDrug().getConcept() == null) { ValidationUtils.rejectIfEmpty(errors, "concept", "error.null"); } if (order.getConcept() != null && order.getDrug() != null && order.getDrug().getConcept() != null && !order.getDrug().getConcept().equals(order.getConcept())) { <START> errors.rejectValue("drug", "error.general"); errors.rejectValue("concept", "error.concept"); <END> } if (order.getAction() != Order.Action.DISCONTINUE && order.getDosingType() != null) { DosingInstructions dosingInstructions = order.getDosingInstructionsInstance(); dosingInstructions.validate(order, errors); } if (order.getConcept() == null && order.getDrugNonCoded() != null) { if (order.getDrugNonCoded().equals(Context.getOrderService().getNonCodedDrugConcept())) { order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); } } validateFieldsForOutpatientCareSettingType(order, errors); validatePairedFields(order, errors); validateUnitsAreAmongAllowedConcepts(errors, order); validateForRequireDrug(errors, order); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "asNeededCondition", "brandName"); } }</code><technical_language>indented tabs, spaces. IDE need reconfigured do this</technical_language>

Target:
public void validate(Object obj, Errors errors) { super.validate(obj, errors); DrugOrder order = (DrugOrder) obj; if (order == null) { errors.reject("error.general"); } else { ValidationUtils.rejectIfEmpty(errors, "asNeeded", "error.null"); if (order.getAction() != Order.Action.DISCONTINUE) { ValidationUtils.rejectIfEmpty(errors, "dosingType", "error.null"); } if (order.getDrug() == null || order.getDrug().getConcept() == null) { ValidationUtils.rejectIfEmpty(errors, "concept", "error.null"); } if (order.getConcept() != null && order.getDrug() != null && order.getDrug().getConcept() != null && !order.getDrug().getConcept().equals(order.getConcept())) { errors.rejectValue("drug", "error.general"); errors.rejectValue("concept", "error.concept"); } if (order.getAction() != Order.Action.DISCONTINUE && order.getDosingType() != null) { DosingInstructions dosingInstructions = order.getDosingInstructionsInstance(); dosingInstructions.validate(order, errors); } if (order.getDrug() == null && order.getDrugNonCoded() != null) { order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); } } validateFieldsForOutpatientCareSettingType(order, errors); validatePairedFields(order, errors); validateUnitsAreAmongAllowedConcepts(errors, order); validateForRequireDrug(errors, order); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "asNeededCondition", "brandName"); }
Source:
<code>Optional<String> selectTableToCompactInternal(Transaction tx) { Map<String, Long> tableToLastTimeSwept = sweepHistoryProvider.getHistory(tx); Map<String, Long> tableToLastTimeCompacted = compactionHistoryProvider.getHistory(tx); Optional<String> tableToCompact = maybeChooseUncompactedTable(tableToLastTimeSwept, tableToLastTimeCompacted); if (!tableToCompact.isPresent()) { tableToCompact = maybeChooseTableSweptAfterCompact(tableToLastTimeSwept,tableToLastTimeCompacted); } if (!tableToCompact.isPresent()) { tableToCompact = maybeChooseTableCompactedOver1HourAgo(tableToLastTimeSwept, tableToLastTimeCompacted); } if (!tableToCompact.isPresent()) { log.info("Not compacting, because it does not appear that any table has been swept" + " or they were compacted too recently (the past hour)."); } return tableToCompact; <START> } <END></code><technical_language>This works. I hoping find a cleaner write this - want some kind of SQL COALESCE() optionals want run calculations if get early answer (which is here). try Stream.<Supplier<Optional<String>>>of( () -> maybeChooseUncompactedTable(tableToLastTimeSwept, tableToLastTimeCompacted), () -> maybeChooseTableSweptAfterCompact(tableToLastTimeSwept, tableToLastTimeCompacted), () -> maybeChooseTableCompactedOver1HourAgo(tableToLastTimeSwept, tableToLastTimeCompacted)) .map(Supplier::get) .filter(Optional::isPresent) .findFirst() .orElseGet(() -> { log.info("Not compacting, table swept" + " compacted (the hour)."); return Optional.empty(); }); is pretty gross. Note stream _must_ suppliers ensure lazy evaluation. Ideally a library method..</technical_language>

Target:
Optional<String> selectTableToCompactInternal(Transaction tx) { Map<String, Long> tableToLastTimeSwept = sweepHistoryProvider.getHistory(tx); Map<String, Long> tableToLastTimeCompacted = compactionHistoryProvider.getHistory(tx); Optional<String> tableToCompact = maybeChooseUncompactedTable(tableToLastTimeSwept, tableToLastTimeCompacted); if (!tableToCompact.isPresent()) { tableToCompact = maybeChooseTableSweptAfterCompact(tableToLastTimeSwept, tableToLastTimeCompacted); } if (!tableToCompact.isPresent()) { tableToCompact = maybeChooseTableCompactedOver1HourAgo(tableToLastTimeCompacted); } if (!tableToCompact.isPresent()) { log.info("Not compacting, because it does not appear that any table has been swept" + " or they were compacted too recently (the past hour)."); } return tableToCompact; }
Source:
<code>private synchronized void handleSeal(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { try { final long epoch = req.getPayload().getSealRequest().getEpoch(); String remoteHostAddress; try { remoteHostAddress = ((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress(); <START> } catch(NullPointerException ex) { <END> remoteHostAddress = "unavailable"; } log.info("handleSeal[{}]: Received SEAL from (clientId={}:{}), moving to new epoch {},", req.getHeader().getRequestId(), req.getHeader().getClientId(), remoteHostAddress, epoch); serverContext.setServerEpoch(epoch, r); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getSealResponseMsg()); r.sendResponse(response, ctx); } catch (WrongEpochException e) { log.debug("handleSeal[{}]: Rejected SEAL current={}, requested={}", req.getHeader().getRequestId(), e.getCorrectEpoch(), req.getPayload().getSealRequest().getEpoch()); r.sendWrongEpochError(req.getHeader(), ctx, e.getCorrectEpoch()); } }</code><technical_language>I written this code, remoteAddress unavailable if this call is invoked tcp connection is established</technical_language>

Target:
private synchronized void handleSeal(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { try { final long epoch = req.getPayload().getSealRequest().getEpoch(); String remoteHostAddress; try { remoteHostAddress = ((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress(); } catch (NullPointerException ex) { remoteHostAddress = "unavailable"; } log.info("handleSeal[{}]: Received SEAL from (clientId={}:{}), moving to new epoch {},", req.getHeader().getRequestId(), req.getHeader().getClientId(), remoteHostAddress, epoch); serverContext.setServerEpoch(epoch, r); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getSealResponseMsg()); r.sendResponse(response, ctx); } catch (WrongEpochException e) { log.debug("handleSeal[{}]: Rejected SEAL current={}, requested={}", req.getHeader().getRequestId(), e.getCorrectEpoch(), req.getPayload().getSealRequest().getEpoch()); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getWrongEpochErrorMsg(e.getCorrectEpoch())); r.sendResponse(response, ctx); } }
Source:
<code>private ImmutableList<String> createCommand() { final ImmutableList.Builder<String> command = ImmutableList.builder(); command.addAll(groovyc.getCommandPrefix(resolver)); <START> String classpath = Joiner.on(":").join(transform(declaredClasspathEntries, toStringFunction())); <END> command .add("-cp") .add(classpath.isEmpty() ? "''" : classpath) .add("-d") .add(outputDirectory.toString()); addCrossCompilationOptions(command); command.addAll(extraArguments.or(ImmutableList.<String>of())) .addAll(transform(sourceFilePaths, toStringFunction())); return command.build(); }</code><technical_language>Again, this wrong in this diff moved code, hardcode : here, instead File.pathSeparator this works Windows too</technical_language>

Target:
private ImmutableList<String> createCommand() { final ImmutableList.Builder<String> command = ImmutableList.builder(); command.addAll(groovyc.getCommandPrefix(resolver)); String classpath = Joiner.on(File.pathSeparator).join(transform(declaredClasspathEntries, toStringFunction())); command .add("-cp") .add(classpath.isEmpty() ? "''" : classpath) .add("-d") .add(outputDirectory.toString()); addCrossCompilationOptions(command); command.addAll(extraArguments.or(ImmutableList.<String>of())) .addAll(transform(sourceFilePaths, toStringFunction())); return command.build(); }