auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String[] getSortFieldPieces(int i) { String sortField = getSortField(i); if(sortField == null ) {return new String[0];} else { sortField = StringUtils.normalize(sortField); return sortField.split(" "); } }

Target:
public String[] getSortFieldPieces(int i) { String sortField = getSortField(i); if(sortField == null ) {return new String[0];} else { sortField = StringUtils.normalize(sortField); return sortField.split("\\s+"); } }
Source:
private void broadcastIfAllReceiversAreInitialized() { if (numInitializedReceivers == totalNumReceivers) { initialized = true; LOG.log(Level.INFO, "All receivers are initialized"); if (stateMachine.compareAndSetState(INIT, CAN_SEND)) { throw new RuntimeException("The expected current state is different from the actual state"); } for (final String senderId : initializedSenderIdList) { sendSenderCanSendMessage(senderId); } iterationStartTime = System.currentTimeMillis(); } }

Target:
private void broadcastIfAllReceiversAreInitialized() { if (numInitializedReceivers == totalNumReceivers) { initialized = true; LOG.log(Level.INFO, "All receivers are initialized"); if (stateMachine.compareAndSetState(INIT, CAN_SEND)) { throw new RuntimeException("The expected current state [" + INIT + "] is different from the actual state"); } for (final String senderId : initializedSenderIdList) { sendSenderCanSendMessage(senderId); } iterationStartTime = System.currentTimeMillis(); } }
Source:
void loadBuildHostData(@NotNull Properties properties) { String buildHost = null; try { buildHost = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { log("Unable to get build host"); } put(properties, BUILD_HOST, buildHost); }

Target:
void loadBuildHostData(@NotNull Properties properties) { String buildHost = null; try { buildHost = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { log("Unable to get build host, skipping property " + BUILD_HOST + ". Error message was: " + e.getMessage()); } put(properties, BUILD_HOST, buildHost); }
Source:
private <T> List<T> filterNonNullElementsAsList(T[] elements) { List<T> candidateElements = new ArrayList<T>(); if (elements != null) { for (T element : elements) { if (element != null) { candidateElements.add(element); } } } return Collections.unmodifiableList(candidateElements); }

Target:
private <T> List<T> filterNonNullElementsAsList(T[] elements) { if (elements == null) { return Collections.emptyList(); } List<T> candidateElements = new ArrayList<T>(); for (T element : elements) { if (element != null) { candidateElements.add(element); } } return Collections.unmodifiableList(candidateElements); }
Source:
public void setBackgroundText() { OCFileListFragment ocFileListFragment = getListOfFilesFragment(); if (ocFileListFragment != null) { if (mSelectAllMenuItem != null) { mSelectAllMenuItem.setVisible(true); if (ocFileListFragment.getNoOfItems() == 0) { mSelectAllMenuItem.setVisible(false); } } int message = R.string.file_list_loading; if (!mSyncInProgress) { if(mOnlyAvailableOffline){ message = R.string.file_list_empty_available_offline ; }else{ message = R.string.file_list_empty; } ocFileListFragment.getProgressBar().setVisibility(View.GONE); ocFileListFragment.getShadowView().setVisibility(View.VISIBLE); } ocFileListFragment.setMessageForEmptyList(getString(message)); } else { Log_OC.e(TAG, "OCFileListFragment is null"); } }

Target:
public void setBackgroundText() { OCFileListFragment ocFileListFragment = getListOfFilesFragment(); if (ocFileListFragment != null) { if (mSelectAllMenuItem != null) { mSelectAllMenuItem.setVisible(true); if (ocFileListFragment.getNoOfItems() == 0) { mSelectAllMenuItem.setVisible(false); } } int message = R.string.file_list_loading; if (!mSyncInProgress) { message = mOnlyAvailableOffline ? R.string.file_list_empty_available_offline : R.string.file_list_empty; ocFileListFragment.getProgressBar().setVisibility(View.GONE); ocFileListFragment.getShadowView().setVisibility(View.VISIBLE); } ocFileListFragment.setMessageForEmptyList(getString(message)); } else { Log_OC.e(TAG, "OCFileListFragment is null"); } }
Source:
public void setDistancePerPulse(double distancePerPulse) { this.distancePerPulse = distancePerPulse; for (CustomEncoder encoder : encoders) { encoder.setDistancePerPulse(distancePerPulse); } }

Target:
public void setDistancePerPulse(double distancePerPulse) { this.distancePerPulse = distancePerPulse; encoders[0].setDistancePerPulse(distancePerPulse); encoders[1].setDistancePerPulse(distancePerPulse); }
Source:
public void render(Context context, Boolean value, SafeHtmlBuilder sb) { String columnString; if (value == null) { value = false; } if (value) { if (trueImageUrl == null) { columnString = "<div title=\"" + value + "\" ></div>"; } else { columnString = "<div title=\"" + value + "\" > <img src='" + trueImageUrl + "' /> </div>"; } } else { if (falseImageUrl == null) { columnString = "<div title=\"" + value + "\" ></div>"; } else { columnString = "<div title=\"" + value + "\" > <img src='" + falseImageUrl + "' /> </div>"; } } sb.appendHtmlConstant(columnString); }

Target:
public void render(Context context, Boolean value, SafeHtmlBuilder sb) { String columnContentString = ""; if (value == null) { value = false; } if (value && trueImageUrl != null) { columnContentString = "<img src='" + trueImageUrl + "' />"; } else if (!value && falseImageUrl != null) { columnContentString = "<img src='" + falseImageUrl + "' />"; } sb.appendHtmlConstant("<div>" + columnContentString + "</div>"); }
Source:
public void cleanupCacheFiles(File baseFile, File cacheFile) throws IOException { if (cacheFile.equals(baseFile)) { return; } log.info("Deleting directory[%s]", cacheFile); FileUtils.deleteDirectory(cacheFile); if (cacheFile.getParentFile() != null && cacheFile.getParentFile().listFiles().length == 0) { cleanupCacheFiles(baseFile, cacheFile.getParentFile()); } }

Target:
public void cleanupCacheFiles(File baseFile, File cacheFile) throws IOException { if (cacheFile.equals(baseFile)) { return; } synchronized (lock) { log.info("Deleting directory[%s]", cacheFile); try { FileUtils.deleteDirectory(cacheFile); } catch (Exception e) { log.error("Unable to remove file[%s]", cacheFile); } } if (cacheFile.getParentFile() != null && cacheFile.getParentFile().listFiles().length == 0) { cleanupCacheFiles(baseFile, cacheFile.getParentFile()); } }
Source:
public Response execute(Request request, Request.Options options) throws IOException { try { addRequestTags(request); Response response = this.delegate.execute(request, options); logCr(); return response; } finally { closeSpan(); } }

Target:
public Response execute(Request request, Request.Options options) throws IOException { try { addRequestTags(request); Response response = this.delegate.execute(request, options); logCr(); return response; } catch (RuntimeException | IOException e) { logError(e); throw e; } finally { closeSpan(); } }
Source:
public Set<Obs> getRelatedObservations() { Set<Obs> ret = new HashSet<>(); if (this.isObsGrouping()) { ret.addAll(this.getGroupMembers()); Obs parentObs = this; while (parentObs.getObsGroup() != null) { for (Obs obsSibling : parentObs.getObsGroup().getGroupMembers()) { if (!obsSibling.isObsGrouping()) { ret.add(obsSibling); } } parentObs = parentObs.getObsGroup(); } } else if (this.getObsGroup() != null) { this.getObsGroup().getGroupMembers().stream().filter((obsSibling) -> (!obsSibling.isObsGrouping())).forEachOrdered((obsSibling) -> { ret.add(obsSibling); }); } return ret; }

Target:
public Set<Obs> getRelatedObservations() { Set<Obs> ret = new HashSet<>(); if (this.isObsGrouping()) { ret.addAll(this.getGroupMembers()); Obs parentObs = this; while (parentObs.getObsGroup() != null) { for (Obs obsSibling : parentObs.getObsGroup().getGroupMembers()) { if (!obsSibling.isObsGrouping()) { ret.add(obsSibling); } } parentObs = parentObs.getObsGroup(); } } else if (this.getObsGroup() != null) { this.getObsGroup().getGroupMembers().stream().forEach((obsSibling)-> { if (!obsSibling.isObsGrouping()) { ret.add(obsSibling); } }); } return ret; }
Source:
private Image getImage(ImageDescriptor descriptor) { return (descriptor == null) ? null : CUIPlugin.getImageDescriptorRegistry().get(descriptor); }

Target:
private static Image getImage(ImageDescriptor descriptor) { return descriptor == null ? null : CUIPlugin.getImageDescriptorRegistry().get(descriptor); }
Source:
private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue = null; boolean allowInconsistent = Config.<Boolean>getValue(ConfigValues.LiveSnapshotAllowInconsistent); try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase( getVds().getId(), getVmId())); } catch (EngineException e) { if (!allowInconsistent) { handleFreezeVmFailure(e); return; } else { handleInconsistent(); return; } } if (returnValue != null && returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } else { if (allowInconsistent) { handleInconsistent(); } else { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } } }

Target:
private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue = null; boolean allowInconsistent = Config.<Boolean>getValue(ConfigValues.LiveSnapshotAllowInconsistent); try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase( getVds().getId(), getVmId())); } catch (EngineException e) { if (allowInconsistent) { handleInconsistent(); } else { handleFreezeVmFailure(e); } return; } if (returnValue != null && returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } else { if (allowInconsistent) { handleInconsistent(); } else { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } } }
Source:
protected void executeCommand() { getNetworkQoS().setId(Guid.newGuid()); getDbFacade().getQosDao().save(getNetworkQoS()); getReturnValue().setActionReturnValue(getNetworkQoS().getId()); setSucceeded(true); }

Target:
protected void executeCommand() { getNetworkQoS().setId(Guid.newGuid()); getNetworkQoSDao().save(getNetworkQoS()); getReturnValue().setActionReturnValue(getNetworkQoS().getId()); setSucceeded(true); }
Source:
public void sendMetrics(final UnifiedPushMetricsMessage metricsMessage, final Callback<UnifiedPushMetricsMessage> callback) { new AsyncTask<Void, Void, Exception>() { @Override protected Exception doInBackground(Void... params) { try { if ((metricsMessage.getMessageId() == null) || (metricsMessage.getMessageId().trim().equals(""))) { throw new IllegalStateException(""); } HttpProvider provider = httpProviderProvider.get(metricsURL, TIMEOUT); setPasswordAuthentication(variantId, secret, provider); try { provider.put(metricsMessage.getMessageId(), ""); return null; } catch (HttpException ex) { return ex; } } catch (Exception ex) { return ex; } } @SuppressWarnings("unchecked") @Override protected void onPostExecute(Exception result) { if (result == null) { callback.onSuccess(metricsMessage); } else { callback.onFailure(result); } } }.execute((Void) null); }

Target:
public void sendMetrics(final UnifiedPushMetricsMessage metricsMessage, final Callback<UnifiedPushMetricsMessage> callback) { new AsyncTask<Void, Void, Exception>() { @Override protected Exception doInBackground(Void... params) { try { if ((metricsMessage.getMessageId() == null) || (metricsMessage.getMessageId().trim().equals(""))) { throw new IllegalStateException("Message ID cannot be null or blank"); } HttpProvider provider = httpProviderProvider.get(metricsURL, TIMEOUT); setPasswordAuthentication(variantId, secret, provider); try { provider.put(metricsMessage.getMessageId(), ""); return null; } catch (HttpException ex) { return ex; } } catch (Exception ex) { return ex; } } @SuppressWarnings("unchecked") @Override protected void onPostExecute(Exception result) { if (result == null) { callback.onSuccess(metricsMessage); } else { callback.onFailure(result); } } }.execute((Void) null); }
Source:
public void setHttpService(HttpService httpService) { logger.info("setHttpService called"); this.httpService = httpService; }

Target:
public void setHttpService(HttpService httpService) { logger.debug("setHttpService called"); this.httpService = httpService; }
Source:
public void visit(BulletList bulletList) { if (bulletListHolder != null) { writeEndOfLine(); } bulletListHolder = new BulletListHolder(bulletListHolder, bulletList); visitChildren(bulletList); writeEndOfLineIfNeeded(bulletList, null); if (bulletListHolder.getParent() != null) { bulletListHolder = (BulletListHolder) bulletListHolder.getParent(); } else { bulletListHolder = null; } }

Target:
public void visit(BulletList bulletList) { if (listHolder != null) { writeEndOfLine(); } listHolder = new BulletListHolder(listHolder, bulletList); visitChildren(bulletList); writeEndOfLineIfNeeded(bulletList, null); if (listHolder.getParent() != null) { listHolder = listHolder.getParent(); } else { listHolder = null; } }
Source:
public Builder merge(Span that) { if (this.traceId == null) { this.traceId = that.traceId; } if (this.traceIdHigh == 0) { this.traceIdHigh = that.traceIdHigh; } if (this.name == null || this.name.length() == 0 || this.name.equals("unknown")) { this.name = that.name; } if (this.id == null) { this.id = that.id; } if (this.parentId == null) { this.parentId = that.parentId; } for (Annotation a : that.annotations) { addAnnotation(a); } for (BinaryAnnotation a : that.binaryAnnotations) { addBinaryAnnotation(a); } if (this.debug == null) { this.debug = that.debug; } if (this.timestamp == null || that.timestamp == null || this.timestamp.equals( that.timestamp)) { this.timestamp = this.timestamp != null ? this.timestamp : that.timestamp; if (this.duration == null) { this.duration = that.duration; } else if (that.duration != null) { this.duration = Math.max(this.duration, that.duration); } } else { this.timestamp = null; this.duration = null; return ApplyTimestampAndDuration.apply(this.build()).toBuilder(); } return this; }

Target:
public Builder merge(Span that) { if (this.traceId == null) { this.traceId = that.traceId; } if (this.traceIdHigh == 0) { this.traceIdHigh = that.traceIdHigh; } if (this.name == null || this.name.length() == 0 || this.name.equals("unknown")) { this.name = that.name; } if (this.id == null) { this.id = that.id; } if (this.parentId == null) { this.parentId = that.parentId; } if (this.timestamp == null || that.timestamp == null || this.timestamp.equals( that.timestamp)) { this.timestamp = this.timestamp != null ? this.timestamp : that.timestamp; if (this.duration == null) { this.duration = that.duration; } else if (that.duration != null) { this.duration = Math.max(this.duration, that.duration); } } else { if (containsAnnotation(that.annotations, Constants.CLIENT_SEND)) { this.timestamp = that.timestamp; this.duration = that.duration; } else if (!containsAnnotation(this.annotations, Constants.CLIENT_SEND)) { this.timestamp = null; this.duration = null; } } for (Annotation a : that.annotations) { addAnnotation(a); } for (BinaryAnnotation a : that.binaryAnnotations) { addBinaryAnnotation(a); } if (this.debug == null) { this.debug = that.debug; } return this; }
Source:
public void setup() throws Exception { super.setup(); final DB dbx = db; dbx.getCollection(COLL_NAME).drop(); dbx.createCollection(COLL_NAME, null); controller = new MongoCRUDController(null, new DBResolver() { @Override public DB get(MongoDataStore store) { return dbx; } @Override public MongoConfiguration getConfiguration(MongoDataStore store) { return null; } @Override public List<MongoConfiguration> getConfigurations() { MongoConfiguration configuration = new MongoConfiguration(); try { configuration.addServerAddress(db.getMongo().getAddress().getHost(), db.getMongo().getAddress().getPort()); configuration.setDatabase("mongo"); } catch (UnknownHostException e) { } List<MongoConfiguration> configs = new ArrayList<>(); configs.add(configuration); return configs; } }); }

Target:
public void setup() throws Exception { super.setup(); final DB dbx = db; dbx.getCollection(COLL_NAME).drop(); dbx.createCollection(COLL_NAME, null); controller = new MongoCRUDController(null, new DBResolver() { @Override public DB get(MongoDataStore store) { return dbx; } @Override public MongoConfiguration getConfiguration(MongoDataStore store) { MongoConfiguration configuration = new MongoConfiguration(); try { configuration.addServerAddress(db.getMongo().getAddress().getHost(), db.getMongo().getAddress().getPort()); configuration.setDatabase("mongo"); } catch (UnknownHostException e) { return null; } return configuration; } @Override public Collection<MongoConfiguration> getConfigurations() { List<MongoConfiguration> configs = new ArrayList<>(); configs.add(getConfiguration(null)); return configs; } }); }
Source:
private URI rebaseUri(URI uri) { URI requestUri = uri; String uriString = uri.toString(); if (!uriString.startsWith(baseUri)) { int index = uriString.indexOf(REST); if (index == -1) { throw new IllegalArgumentException("Requested URI not within allowed domain"); } requestUri = URI.create(URIUtil.join(baseUri, uriString.substring(index + 4))); } return requestUri; }

Target:
private URI rebaseUri(URI uri) { URI requestUri = uri; String uriString = uri.toString(); if (!uriString.startsWith(baseUri)) { int index = uriString.indexOf(REST); if (index == -1) { throw new IllegalArgumentException("Requested URI not within allowed domain"); } requestUri = URI.create(URIUtil.join(baseUri, uriString.substring(index + REST_LENGTH))); } return requestUri; }
Source:
private Field[] getAllReferenceInstanceFields(Class<?> c) { if (allReferenceFieldsCache.containsKey(c)) return allReferenceFieldsCache.get(c); else { HashSet<Field> s = HashSetFactory.make(); Class<?> klass = c; while (klass != null) { Field[] fields = klass.getDeclaredFields(); for (Field field : fields) { if (!isStatic(field)) { Class<?> fc = field.getType(); if (!fc.isPrimitive()) { s.add(field); } } } klass = klass.getSuperclass(); } Field[] result = new Field[s.size()]; Object[] temp = s.toArray(); Arrays.setAll(result, i -> (Field) temp[i]); allReferenceFieldsCache.put(c, result); return result; } }

Target:
private Field[] getAllReferenceInstanceFields(Class<?> c) { if (allReferenceFieldsCache.containsKey(c)) return allReferenceFieldsCache.get(c); else { HashSet<Field> s = HashSetFactory.make(); Class<?> klass = c; while (klass != null) { Field[] fields = klass.getDeclaredFields(); for (Field field : fields) { if (!isStatic(field)) { Class<?> fc = field.getType(); if (!fc.isPrimitive()) { s.add(field); } } } klass = klass.getSuperclass(); } Field[] result = s.toArray(new Field[0]); allReferenceFieldsCache.put(c, result); return result; } }
Source:
public GenericRecord decodeMessage(String topic, byte[] message) { GenericRecord record = (GenericRecord) decoder.fromBytes(message); Schema schema = record.getSchema(); schemas.putIfAbsent(topic, schema); return record; }

Target:
public GenericRecord decodeMessage(String topic, byte[] message) { GenericRecord record = (GenericRecord) decoder.fromBytes(message); Schema schema = record.getSchema(); schemas.put(topic, schema); return record; }
Source:
public Object getInternalProperty(String key) { try { return configService.getConfig(key, null, DEFAULT_TIMEOUT); } catch (NacosException e) { logger.error(e.getMessage()); } return null; }

Target:
public Object getInternalProperty(String key) { try { String normalizedKey = normalizedKey(key); return configService.getConfig(normalizedKey, DEFAULT_GROUP, DEFAULT_TIMEOUT); } catch (NacosException e) { logger.error(e.getMessage()); } return null; }
Source:
protected void onError(Status status, Metadata trailers) { Code code = status.getCode(); if (code == Status.Code.CANCELLED) { if (!completionFuture.isDone()) { completionFuture.cancel(false); } operationTimerContext.close(); return; } if (!retryOptions.enableRetries() || !retryOptions.isRetryable(code) || !(isRequestRetryable() || code == Code.UNAUTHENTICATED || code == Code.UNAVAILABLE)) { rpc.getRpcMetrics().markFailure(); operationTimerContext.close(); setException(status.asRuntimeException()); return; } long nextBackOff = getNextBackoff(); failedCount += 1; if (nextBackOff == BackOff.STOP) { setException(getExhaustedRetriesException(status)); } else { String channelId = ChannelPool.extractIdentifier(trailers); LOG.info("Retrying failed call. Failure #%d, got: %s on channel %s", status.getCause(), failedCount, status, channelId); performRetry(nextBackOff); } }

Target:
protected void onError(Status status, Metadata trailers) { Code code = status.getCode(); if (code == Status.Code.CANCELLED) { completionFuture.setException(status.asRuntimeException()); operationTimerContext.close(); return; } if (!retryOptions.enableRetries() || !retryOptions.isRetryable(code) || !(isRequestRetryable() || code == Code.UNAUTHENTICATED || code == Code.UNAVAILABLE)) { rpc.getRpcMetrics().markFailure(); operationTimerContext.close(); setException(status.asRuntimeException()); return; } long nextBackOff = getNextBackoff(); failedCount += 1; if (nextBackOff == BackOff.STOP) { setException(getExhaustedRetriesException(status)); } else { String channelId = ChannelPool.extractIdentifier(trailers); LOG.info("Retrying failed call. Failure #%d, got: %s on channel %s", status.getCause(), failedCount, status, channelId); performRetry(nextBackOff); } }
Source:
public void reportsTasksInformation() throws Exception { Runnable fastOne = new FastRunnable(); Runnable slowOne = new SlowRunnable(); assertThat(instrumentedExecutorService.submitted.getCount()).isEqualTo(0); assertThat(instrumentedExecutorService.running.getCount()).isEqualTo(0); assertThat(instrumentedExecutorService.completed.getCount()).isEqualTo(0); assertThat(instrumentedExecutorService.duration.getCount()).isEqualTo(0); Future<?> fastFuture = instrumentedExecutorService.submit(fastOne); Future<?> slowFuture = instrumentedExecutorService.submit(slowOne); assertThat(instrumentedExecutorService.submitted.getCount()).isEqualTo(2); fastFuture.get(); assertThat(instrumentedExecutorService.running.getCount()).isEqualTo(1); slowFuture.get(); assertThat(instrumentedExecutorService.running.getCount()).isEqualTo(0); }

Target:
public void reportsTasksInformation() throws Exception { Runnable fastOne = new FastRunnable(); Runnable slowOne = new SlowRunnable(); Meter submitted = registry.meter("xs.submitted"); Counter running = registry.counter("xs.running"); Meter completed = registry.meter("xs.completed"); Timer duration = registry.timer("xs.duration"); assertThat(submitted.getCount()).isEqualTo(0); assertThat(running.getCount()).isEqualTo(0); assertThat(completed.getCount()).isEqualTo(0); assertThat(duration.getCount()).isEqualTo(0); Future<?> fastFuture = instrumentedExecutorService.submit(fastOne); Future<?> slowFuture = instrumentedExecutorService.submit(slowOne); assertThat(submitted.getCount()).isEqualTo(2); fastFuture.get(); assertThat(running.getCount()).isEqualTo(1); slowFuture.get(); assertThat(running.getCount()).isEqualTo(0); assertThat(duration.getSnapshot().size()).isEqualTo(2); }
Source:
public Object execute(final Object[] parameters) { final CosmosParameterAccessor accessor = new CosmosParameterParameterAccessor(getQueryMethod(), parameters); final ResultProcessor processor = getQueryMethod().getResultProcessor().withDynamicProjection(accessor); List<SqlParameter> sqlParameters = getQueryMethod().getParameters().stream() .map(p -> new SqlParameter("@" + p.getName().get(), toCosmosDbValue(parameters[p.getIndex()]))) .collect(Collectors.toList()); SqlQuerySpec querySpec = new SqlQuerySpec(query, sqlParameters); return this.operations.runQuery(querySpec, processor.getReturnedType().getDomainType(), processor.getReturnedType().getReturnedType()); }

Target:
public Object execute(final Object[] parameters) { final CosmosParameterAccessor accessor = new CosmosParameterParameterAccessor(getQueryMethod(), parameters); final ResultProcessor processor = getQueryMethod().getResultProcessor().withDynamicProjection(accessor); List<SqlParameter> sqlParameters = getQueryMethod().getParameters().stream() .map(p -> new SqlParameter("@" + p.getName().orElse(""), toCosmosDbValue(parameters[p.getIndex()]))) .collect(Collectors.toList()); SqlQuerySpec querySpec = new SqlQuerySpec(query, sqlParameters); return this.operations.runQuery(querySpec, processor.getReturnedType().getDomainType(), processor.getReturnedType().getReturnedType()); }
Source:
public void postBegin() { scoreScreen = nuiManager.getHUD().getHUDElement("LightAndShadow:ScoreHud"); blackScoreArea = scoreScreen.find("blackScoreArea", UILabel.class); blackScoreArea.bindText(new ReadOnlyBinding<String>() { @Override public String get() { return String.valueOf(blackScore); } }); redScoreArea = scoreScreen.find("redScoreArea", UILabel.class); redScoreArea.bindText(new ReadOnlyBinding<String>() { @Override public String get() { return String.valueOf(redScore); } }); }

Target:
public void postBegin() { ControlWidget scoreScreen = nuiManager.getHUD().getHUDElement("LightAndShadow:ScoreHud"); UILabel blackScoreArea = scoreScreen.find("blackScoreArea", UILabel.class); blackScoreArea.bindText(new ReadOnlyBinding<String>() { @Override public String get() { return String.valueOf(blackScore); } }); UILabel redScoreArea = scoreScreen.find("redScoreArea", UILabel.class); redScoreArea.bindText(new ReadOnlyBinding<String>() { @Override public String get() { return String.valueOf(redScore); } }); }
Source:
protected ZooKeeperTestManager zooKeeperTestManager() { return new ZooKeeperTestManager() { @Override public void start() { } @Override public void stop() { } @Override public void ensure(String path) throws Exception { } @Override public void close() { } @Override public String connectString() { return "127.0.0.2:1024"; } @Override public CuratorFramework curator() { CuratorFramework curator = new MockCuratorClientFactory().newClient(null, 0, 0, null); return curator; } @Override public void awaitUp(long timeout, TimeUnit timeunit) throws TimeoutException { } @Override public void awaitDown(int timeout, TimeUnit timeunit) throws TimeoutException { } }; }

Target:
protected ZooKeeperTestManager zooKeeperTestManager() { final ZooKeeperTestManager testManager = mock(ZooKeeperTestManager.class); final MockCuratorClientFactory mockCuratorClientFactory = new MockCuratorClientFactory(); final CuratorFramework curator = mockCuratorClientFactory.newClient(null, 0, 0, null); when(testManager.curator()).thenReturn(curator); when(testManager.connectString()).thenReturn("127.0.0.1"); return testManager; }
Source:
public static void setBackground(boolean async) { background = async; }

Target:
private static void setBackground(boolean async) { background.set(async); }
Source:
private static FieldValue parseFieldValue(ExprNode argument) { if(argument instanceof SymbolExpr) { ResourceId id = ResourceId.valueOf(((SymbolExpr) argument).getName()); if(id.getDomain() == CuidAdapter.ATTRIBUTE_DOMAIN) { return new EnumValue(id); } else { return TextValue.valueOf(id.asString()); } } if(argument instanceof ConstantExpr) { ResourceId id = ResourceId.valueOf(((ConstantExpr) argument).asExpression()); if(id.getDomain() == CuidAdapter.ATTRIBUTE_DOMAIN) { return new EnumValue(id); } else { return ((ConstantExpr) argument).getValue(); } } throw new UnsupportedOperationException("constant value: " + argument); }

Target:
private static FieldValue parseFieldValue(ExprNode argument) { if(argument instanceof SymbolExpr) { ResourceId id = ResourceId.valueOf(((SymbolExpr) argument).getName()); if(id.getDomain() == CuidAdapter.ATTRIBUTE_DOMAIN) { return new EnumValue(id); } else { return TextValue.valueOf(id.asString()); } } else if(argument instanceof ConstantExpr) { return ((ConstantExpr) argument).getValue(); } throw new UnsupportedOperationException("constant value: " + argument); }
Source:
private LeaderTime getIdentifiedTime() { return LeaderTime.of(LEADER_ID, NanoTime.now()); }

Target:
private LeaderTime getIdentifiedTime() { return LeaderTime.of(LEADER_ID, currentTime); }
Source:
public double getStdDev() { return fNbSegments > 2 ? Math.sqrt(fVariance / (fNbSegments)) : Double.NaN; }

Target:
public double getStdDev() { return fNbSegments > 2 ? Math.sqrt(fVariance / fNbSegments) : Double.NaN; }
Source:
public void layout(final ElkNode layoutGraph, final IElkProgressMonitor progressMonitor) { progressMonitor.begin("Rect Packing", 1); dar = layoutGraph.getProperty(RectPackingOptions.ASPECT_RATIO); packingStrat = layoutGraph.getProperty(RectPackingOptions.STRATEGY); lpShift = layoutGraph.getProperty(RectPackingOptions.LP_SHIFT); onlyFirstIteration = layoutGraph.getProperty(RectPackingOptions.ONLY_FIRST_ITERATION); checkSpecialCase = layoutGraph.getProperty(RectPackingOptions.CHECK_FOR_SPECIAL_CASE); expandNodes = layoutGraph.getProperty(RectPackingOptions.EXPAND_NODES); padding = layoutGraph.getProperty(RectPackingOptions.PADDING); List<ElkNode> rectangles = layoutGraph.getChildren(); DrawingUtil.resetCoordinates(rectangles); DrawingData drawing; if (checkSpecialCase && SpecialCaseFeasibility.confirm(rectangles)) { drawing = SpecialCasePlacer.place(rectangles, dar, expandNodes); } else { FirstIteration firstIt = new FirstIteration(dar, packingStrat, lpShift); drawing = firstIt.approxBoundingBox(rectangles); if (!onlyFirstIteration) { DrawingUtil.resetCoordinates(rectangles); SecondIteration secondIt = new SecondIteration(dar, expandNodes); drawing = secondIt.start(rectangles, drawing.getDrawingWidth()); } } enforcePadding(rectangles); layoutGraph.setDimensions(drawing.getDrawingWidth() + padding.getHorizontal(), drawing.getDrawingHeight() + padding.getVertical()); progressMonitor.done(); }

Target:
public void layout(final ElkNode layoutGraph, final IElkProgressMonitor progressMonitor) { progressMonitor.begin("Rectangle Packing", 1); dar = layoutGraph.getProperty(RectPackingOptions.ASPECT_RATIO); packingStrat = layoutGraph.getProperty(RectPackingOptions.STRATEGY); lastPlaceShift = layoutGraph.getProperty(RectPackingOptions.LAST_PLACE_SHIFT); onlyFirstIteration = layoutGraph.getProperty(RectPackingOptions.ONLY_FIRST_ITERATION); checkSpecialCase = layoutGraph.getProperty(RectPackingOptions.CHECK_FOR_SPECIAL_CASE); expandNodes = layoutGraph.getProperty(RectPackingOptions.EXPAND_NODES); padding = layoutGraph.getProperty(RectPackingOptions.PADDING); List<ElkNode> rectangles = layoutGraph.getChildren(); DrawingUtil.resetCoordinates(rectangles); DrawingData drawing; if (checkSpecialCase && SpecialCaseFeasibility.confirm(rectangles)) { drawing = SpecialCasePlacer.place(rectangles, dar, expandNodes); } else { AreaApproximation firstIt = new AreaApproximation(dar, packingStrat, lastPlaceShift); drawing = firstIt.approxBoundingBox(rectangles); if (!onlyFirstIteration) { DrawingUtil.resetCoordinates(rectangles); RowFillingAndCompaction secondIt = new RowFillingAndCompaction(dar, expandNodes); drawing = secondIt.start(rectangles, drawing.getDrawingWidth()); } } applyPadding(rectangles); layoutGraph.setDimensions(drawing.getDrawingWidth() + padding.getHorizontal(), drawing.getDrawingHeight() + padding.getVertical()); progressMonitor.done(); }
Source:
public GroupIntoToolGroupCommand(ResourceSet set, ToolSection parent, Collection<EObject> selection) { super(set); this.selection = selection; this.parent = parent; }

Target:
public GroupIntoToolGroupCommand(ResourceSet set, ToolSection parent, Collection<EObject> selection) { super(set, parent, selection); }
Source:
public void testVocabularyFromTokenNames() { String[] tokenNames = { "<INVALID>", "TOKEN_REF", "RULE_REF", "' }; Vocabulary vocabulary = VocabularyImpl.fromTokenNames(tokenNames); Assert.assertNotNull(vocabulary); Assert.assertEquals("EOF", vocabulary.getSymbolicName(Token.EOF)); Assert.assertEquals(vocabulary.getMaxTokenType(), tokenNames.length-1); for (int i = Token.MIN_USER_TOKEN_TYPE; i <= vocabulary.getMaxTokenType(); i++) { Assert.assertEquals(tokenNames[i], vocabulary.getDisplayName(i)); if (tokenNames[i].startsWith("'")) { Assert.assertEquals(tokenNames[i], vocabulary.getLiteralName(i)); Assert.assertNull(vocabulary.getSymbolicName(i)); } else if (Character.isUpperCase(tokenNames[i].charAt(0))) { Assert.assertNull(vocabulary.getLiteralName(i)); Assert.assertEquals(tokenNames[i], vocabulary.getSymbolicName(i)); } else { Assert.assertNull(vocabulary.getLiteralName(i)); Assert.assertNull(vocabulary.getSymbolicName(i)); } } }

Target:
public void testVocabularyFromTokenNames() { String[] tokenNames = { "<INVALID>", "TOKEN_REF", "RULE_REF", "' }; Vocabulary vocabulary = VocabularyImpl.fromTokenNames(tokenNames); Assert.assertNotNull(vocabulary); Assert.assertEquals("EOF", vocabulary.getSymbolicName(Token.EOF)); Assert.assertEquals(vocabulary.getMaxTokenType(), tokenNames.length-1); for (int i = 0; i <= vocabulary.getMaxTokenType(); i++) { Assert.assertEquals(tokenNames[i], vocabulary.getDisplayName(i)); if (tokenNames[i].startsWith("'")) { Assert.assertEquals(tokenNames[i], vocabulary.getLiteralName(i)); Assert.assertNull(vocabulary.getSymbolicName(i)); } else if (Character.isUpperCase(tokenNames[i].charAt(0))) { Assert.assertNull(vocabulary.getLiteralName(i)); Assert.assertEquals(tokenNames[i], vocabulary.getSymbolicName(i)); } else { Assert.assertNull(vocabulary.getLiteralName(i)); Assert.assertNull(vocabulary.getSymbolicName(i)); } } }
Source:
public void addFeature(final Gff3Feature feature) { final String lineNoAttributes = String.join("\t", encodeString(feature.getContig()), encodeString(feature.getSource()), encodeString(feature.getType()), Integer.toString(feature.getStart()), Integer.toString(feature.getEnd()), feature.getScore() < 0 ? "." : Double.toString(feature.getScore()), feature.getStrand().toString(), feature.getPhase() < 0 ? "." : Integer.toString(feature.getPhase()) ); final List<String> attributesStrings = new ArrayList<>(); for (final Map.Entry<String, List<String>> entry : feature.getAttributes().entrySet()) { final String attributeString = String.join("=", new String[]{encodeString(entry.getKey()), encodeForNinthColumn(entry.getValue())}); attributesStrings.add(attributeString); } final String attributesString = attributesStrings.isEmpty() ? "." : String.join(";", attributesStrings); final String lineString = lineNoAttributes + "\t" + attributesString; out.println(lineString); }

Target:
public void addFeature(final Gff3Feature feature) throws IOException { writeFirstEightFields(feature); out.write(Gff3Constants.FIELD_DELIMITER); writeAttributes(feature.getAttributes()); out.write(Gff3Constants.END_OF_LINE_CHARACTER); }
Source:
public static AddToReadingListDialog newInstance(PageTitle title, InvokeSource source) { AddToReadingListDialog dialog = new AddToReadingListDialog(); Bundle args = new Bundle(); args.putParcelable("title", title); args.putInt("source", source.ordinal()); dialog.setArguments(args); return dialog; }

Target:
public static AddToReadingListDialog newInstance(PageTitle title, InvokeSource source) { AddToReadingListDialog dialog = new AddToReadingListDialog(); Bundle args = new Bundle(); args.putParcelable("title", title); args.putInt("source", source.code()); dialog.setArguments(args); return dialog; }
Source:
public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException { ReqContext req_context = ReqContext.context(); TTransport trans = inProt.getTransport(); if (trans instanceof TMemoryInputTransport) { try { req_context.setRemoteAddress(InetAddress.getLocalHost()); } catch (UnknownHostException e) { throw new RuntimeException(e); } } else if (trans instanceof TSocket) { TSocket tsocket = (TSocket)trans; Socket socket = tsocket.getSocket(); req_context.setRemoteAddress(socket.getInetAddress()); } req_context.setSubject(null); try { return wrapped.process(inProt, outProt); } catch (RuntimeException ex) { LOG.info(ex.getMessage()); return false; } }

Target:
public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException { ReqContext req_context = ReqContext.context(); TTransport trans = inProt.getTransport(); if (trans instanceof TMemoryInputTransport) { try { req_context.setRemoteAddress(InetAddress.getLocalHost()); } catch (UnknownHostException e) { throw new RuntimeException(e); } } else if (trans instanceof TSocket) { TSocket tsocket = (TSocket)trans; Socket socket = tsocket.getSocket(); req_context.setRemoteAddress(socket.getInetAddress()); } req_context.setSubject(null); return wrapped.process(inProt, outProt); }
Source:
boolean isInSequence(RecordIdentifier recordIdentifier) { if (lastWriteId != null && recordIdentifier.getWriteId() < lastWriteId) { LOG.debug("Non-sequential transaction ID. Expected >{}, recordIdentifier={}", lastWriteId, recordIdentifier); return false; } else if (lastWriteId != null && recordIdentifier.getWriteId() == lastWriteId && lastRowId != null && recordIdentifier.getRowId() <= lastRowId) { LOG.debug("Non-sequential row ID. Expected >{}, recordIdentifier={}", lastRowId, recordIdentifier); return false; } lastWriteId = recordIdentifier.getWriteId(); lastRowId = recordIdentifier.getRowId(); return true; }

Target:
boolean isInSequence(RecordIdentifier recordIdentifier) { if (lastWriteId != null && recordIdentifier.getWriteId() < lastWriteId) { LOG.debug("Non-sequential write ID. Expected >{}, recordIdentifier={}", lastWriteId, recordIdentifier); return false; } else if (lastWriteId != null && recordIdentifier.getWriteId() == lastWriteId && lastRowId != null && recordIdentifier.getRowId() <= lastRowId) { LOG.debug("Non-sequential row ID. Expected >{}, recordIdentifier={}", lastRowId, recordIdentifier); return false; } lastWriteId = recordIdentifier.getWriteId(); lastRowId = recordIdentifier.getRowId(); return true; }
Source:
public static Expression scriptScore(Expression query, String scriptName) { return scriptScore(query, scriptName, false); }

Target:
public static Expression scriptScore(Expression query, String scriptName) { return new ScriptScoreExpression(query, scriptName, Collections.emptyMap()); }
Source:
public void setText(final String text, final Serializable... args) { String currText = getText(); if (!Objects.equals(text, currText)) { getOrCreateComponentModel().text = I18nUtilities.asMessage(text, args); } }

Target:
public void setText(final String text, final Serializable... args) { Serializable currText = getComponentModel().text; Serializable textToBeSet = I18nUtilities.asMessage(text, args); if (!Objects.equals(textToBeSet, currText)) { getOrCreateComponentModel().text = textToBeSet; } }
Source:
public Map<String, Object> batchConfigRead(String application, String entityToken, Boolean raw) { EntityLocal entity = brooklyn().getEntity(application, entityToken); Map<ConfigKey<?>, Object> source = ((EntityInternal) entity).getAllConfig(); Map<String, Object> result = Maps.newLinkedHashMap(); for (Map.Entry<ConfigKey<?>, Object> ek : source.entrySet()) { Object value = RendererHints.applyDisplayValueHint(ek.getKey(), ek.getValue()); if (Boolean.FALSE.equals(raw)) { value = RendererHints.applyDisplayValueHint(ek.getKey(), value); } result.put(ek.getKey().getName(), getValueForDisplay(value, true, false)); } return result; }

Target:
public Map<String, Object> batchConfigRead(String application, String entityToken, Boolean raw) { EntityLocal entity = brooklyn().getEntity(application, entityToken); Map<ConfigKey<?>, Object> source = ((EntityInternal) entity).getAllConfig(); Map<String, Object> result = Maps.newLinkedHashMap(); for (Map.Entry<ConfigKey<?>, Object> ek : source.entrySet()) { Object value = ek.getValue(); if (Boolean.FALSE.equals(raw)) { value = RendererHints.applyDisplayValueHint(ek.getKey(), value); } result.put(ek.getKey().getName(), getValueForDisplay(value, true, false)); } return result; }
Source:
public static String getMetaRedirectURL(HttpEntity httpEntity) throws IOException { String html = getHTML(httpEntity); html = html.replace("\n", ""); if (html.length() == 0) return null; int indexHttpEquiv = html.indexOf("http-equiv=\"refresh\""); if (indexHttpEquiv < 0) return null; html = html.substring(indexHttpEquiv); int indexContent = html.indexOf("content="); if (indexContent < 0) return null; html = html.substring(indexContent); int indexURLStart = html.indexOf("http"); if (indexURLStart < 0) return null; html = html.substring(indexURLStart); int indexURLEnd = html.indexOf("\""); if (indexURLEnd < 0) return null; return html.substring(0, indexURLEnd); }

Target:
public static String getMetaRedirectURL(HttpEntity httpEntity) throws IOException { String html = getHTML(httpEntity); html = html.replace("\n", ""); if (html.length() == 0) return null; int indexHttpEquiv = html.toLowerCase().indexOf("http-equiv=\"refresh\""); if (indexHttpEquiv < 0) { return null; } html = html.substring(indexHttpEquiv); int indexContent = html.toLowerCase().indexOf("content="); if (indexContent < 0) { return null; } html = html.substring(indexContent); int indexURLStart = html.toLowerCase().indexOf(";url="); if (indexURLStart < 0) { return null; } html = html.substring(indexURLStart + 5); int indexURLEnd = html.toLowerCase().indexOf("\""); if (indexURLEnd < 0) { return null; } return html.substring(0, indexURLEnd); }
Source:
private void storeBoundServerName() throws SaslException { try { boundServerName = gssContext.getTargName().toString().split("[/@]")[1]; } catch (GSSException e) { throw log.mechUnableToDetermineBoundServerName(getMechanismName(), e).toSaslException(); } }

Target:
private void storeBoundServerName() throws SaslException { try { String targetName = gssContext.getTargName().toString(); String[] targetNameParts = targetName.split("[/@]"); boundServerName = targetNameParts.length > 1 ? targetNameParts[1] : targetName; } catch (GSSException e) { throw saslGs2.mechUnableToDetermineBoundServerName(e).toSaslException(); } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ColorDrawable color = new ColorDrawable(); android.support.v7.app.ActionBar ab = getSupportActionBar(); SwipeRefreshLayout swipeRefreshLayout = getSwipeRefreshLayout(); setResult(Activity.RESULT_CANCELED); findViewById(R.id.fab_create).setVisibility(View.INVISIBLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { color = new ColorDrawable(getColor(R.color.bg_highlighted)); } else { color = new ColorDrawable(ContextCompat.getColor(getApplicationContext(), R.color.bg_highlighted)); } ab.setBackgroundDrawable(color); ab.setTitle(R.string.activity_select_single_note); Spannable title = new SpannableString(ab.getTitle()); title.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.primary)), 0, title.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); ab.setTitle(title); swipeRefreshLayout.setEnabled(false); swipeRefreshLayout.setRefreshing(false); initList(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ColorDrawable color; android.support.v7.app.ActionBar ab = getSupportActionBar(); SwipeRefreshLayout swipeRefreshLayout = getSwipeRefreshLayout(); setResult(Activity.RESULT_CANCELED); findViewById(R.id.fab_create).setVisibility(View.INVISIBLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { color = new ColorDrawable(getColor(R.color.bg_highlighted)); } else { color = new ColorDrawable(ContextCompat.getColor(getApplicationContext(), R.color.bg_highlighted)); } ab.setBackgroundDrawable(color); ab.setTitle(R.string.activity_select_single_note); Spannable title = new SpannableString(ab.getTitle()); title.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.primary)), 0, title.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); ab.setTitle(title); swipeRefreshLayout.setEnabled(false); swipeRefreshLayout.setRefreshing(false); initList(); }
Source:
public R apply(R record) { if (headerValue == null) return null; SchemaAndValue schemaAndValue = Values.parseString(headerValue); record.headers().add(headerName, schemaAndValue); return record; }

Target:
public R apply(R record) { if (record == null) { return record; } Headers newHeaders = new ConnectHeaders(record.headers()); newHeaders.add(headerName, schemaAndValue); return record.newRecord(record.topic(), record.kafkaPartition(), record.keySchema(), record.key(), record.valueSchema(), record.value(), record.timestamp(), newHeaders); }
Source:
private static Collection<AnnotationFS> getAllAnnoFss(JCas aJcas, Type aType) { Collection<AnnotationFS> spanAnnos = select(aJcas.getCas(), aType); new ArrayList<>(spanAnnos).sort((arg0, arg1) -> arg0.getBegin() - arg1.getBegin()); return spanAnnos; }

Target:
private static Collection<AnnotationFS> getAllAnnoFss(JCas aJcas, Type aType) { Collection<AnnotationFS> spanAnnos = select(aJcas.getCas(), aType); new ArrayList<>(spanAnnos).sort(Comparator.comparingInt(AnnotationFS::getBegin)); return spanAnnos; }
Source:
private boolean canDoubleClick() { boolean valid = !isInLayoutingModeDiagram(dDiagramElement); for (ModelOperation operation : tool.getInitialOperation().getFirstModelOperations()) { if (operation instanceof Navigation) { valid = true; break; } } valid = valid && checkPrecondition(dDiagramElement, tool); return valid; }

Target:
private boolean canDoubleClick() { boolean valid = !isInLayoutingModeDiagram(dDiagramElement) || Iterables.all(tool.getInitialOperation().getFirstModelOperations(), Predicates.instanceOf(Navigation.class)); valid = valid && checkPrecondition(dDiagramElement, tool); return valid; }
Source:
protected String putMultipartBlob(String container, Blob blob, PutOptions overrides) { ConcurrentLinkedQueue<MultipartPart> parts = new ConcurrentLinkedQueue<MultipartPart>(); long contentLength = checkNotNull(blob.getMetadata().getContentMetadata().getContentLength(), "must provide content-length to use multi-part upload"); MultipartUploadSlicingAlgorithm algorithm = new MultipartUploadSlicingAlgorithm( getMinimumMultipartPartSize(), getMaximumMultipartPartSize(), getMaximumNumberOfParts()); long partSize = algorithm.calculateChunkSize(contentLength); MultipartUpload mpu = initiateMultipartUpload(container, blob.getMetadata(), partSize, overrides); int partNumber = 1; int numThreads = 16; if (System.getProperty("jclouds.mpu.parallel.degree") != null) { numThreads = Integer.getInteger(System.getProperty("jclouds.mpu.parallel.degree")); } BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<Runnable>(numThreads); RejectedExecutionHandler rejectedExecutionHandler = new ThreadPoolExecutor.CallerRunsPolicy(); ExecutorService executor = new ThreadPoolExecutor(numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, blockingQueue, rejectedExecutionHandler); for (Payload payload : slicer.slice(blob.getPayload(), partSize)) { ++partNumber; BlobUploader b = new BlobUploader(mpu, partNumber, payload, parts); executor.execute(b); } executor.shutdown(); try { executor.awaitTermination(Integer.MAX_VALUE, TimeUnit.DAYS); } catch (InterruptedException e) { e.printStackTrace(); } return completeMultipartUpload(mpu, new ArrayList( parts )); }

Target:
protected String putMultipartBlob(String container, Blob blob, PutOptions overrides) { if (overrides.getUseCustomExecutor()) { return putMultipartBlob(container, blob, overrides, overrides.getCustomExecutor()); } else { return putMultipartBlob(container, blob, overrides, userExecutor); } }
Source:
private void doBulkFlush() { try { for (DynamicMap.Entry<Cache<?, ?>> e : cacheMap) { String n = cacheNameOf(e.getPluginName(), e.getExportName()); if (caches.contains(n)) { try { flushCache.get().apply( new CacheResource(e.getPluginName(), e.getExportName(), e.getProvider()), new FlushCache.Input()); } catch (RestApiException err) { stderr.println("error: cannot flush cache \"" + n + "\": " + err.getMessage()); } } } } finally { stderr.flush(); } }

Target:
private void doBulkFlush() { try { for (DynamicMap.Entry<Cache<?, ?>> e : cacheMap) { String n = cacheNameOf(e.getPluginName(), e.getExportName()); if (caches.contains(n)) { try { flushCache.get().apply( new CacheResource(e.getPluginName(), e.getExportName(), e.getProvider()), null); } catch (RestApiException err) { stderr.println("error: cannot flush cache \"" + n + "\": " + err.getMessage()); } } } } finally { stderr.flush(); } }