auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final FunctionDesc getFunction(final String signature, FunctionType funcType, DataType... paramTypes) throws UndefinedFunctionException { final GetFunctionMetaRequest.Builder builder = GetFunctionMetaRequest.newBuilder(); builder.setSignature(signature); if (funcType != null) { builder.setFunctionType(funcType); } for (DataType type : paramTypes) { builder.addParameterTypes(type); } FunctionDescResponse response = null; try { final BlockingInterface stub = getStub(); response = stub.getFunctionMeta(null, builder.build()); } catch (ServiceException se) { throw new RuntimeException(se); } if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) { throw new UndefinedFunctionException(signature, paramTypes); } else if (isThisError(response.getState(), ResultCode.AMBIGUOUS_FUNCTION)) { throw new DuplicateFunctionException(signature, paramTypes); } ensureOk(response.getState()); try { return new FunctionDesc(response.getFunction()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }

Target:
public final FunctionDesc getFunction(final String signature, FunctionType funcType, DataType... paramTypes) throws UndefinedFunctionException { final GetFunctionMetaRequest.Builder builder = GetFunctionMetaRequest.newBuilder(); builder.setSignature(signature); if (funcType != null) { builder.setFunctionType(funcType); } for (DataType type : paramTypes) { builder.addParameterTypes(type); } FunctionResponse response = null; try { final BlockingInterface stub = getStub(); response = stub.getFunctionMeta(null, builder.build()); } catch (ServiceException se) { throw new RuntimeException(se); } if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) { throw new UndefinedFunctionException(signature, paramTypes); } else if (isThisError(response.getState(), ResultCode.AMBIGUOUS_FUNCTION)) { throw new AmbiguousFunctionException(signature, paramTypes); } ensureOk(response.getState()); try { return new FunctionDesc(response.getFunction()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }
Source:
public UploadDirectoryToCDN(String username, String apiKey) { Iterable<Module> modules = ImmutableSet.<Module> of(new SLF4JLoggingModule()); BlobStoreContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .modules(modules) .buildView(BlobStoreContext.class); storage = context.getBlobStore(); rackspace = context.unwrap(CloudFilesApiMetadata.CONTEXT_TOKEN).getApi(); }

Target:
public UploadDirectoryToCDN(String username, String apiKey) { BlobStoreContext context = ContextBuilder.newBuilder(PROVIDER) .credentials(username, apiKey) .buildView(BlobStoreContext.class); storage = context.getBlobStore(); rackspace = context.unwrap(CloudFilesApiMetadata.CONTEXT_TOKEN).getApi(); }
Source:
private void updateData(TextView textBox, int meassuredValue) { if (meassuredValue == distanceID) { textBox.setText(String.format("%.3f", distance / 1000)); } else if (meassuredValue == paceID) { if (pace < 30) { double rest = pace - (int) pace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", pace, secondsZero, rest)); } else { textBox.setText("--------"); } } else if (meassuredValue == avgPaceID) { if (avgPace < 30) { double rest = avgPace - (int) avgPace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", avgPace, secondsZero, rest)); } else { textBox.setText("--------"); } } else if (meassuredValue == timeID) { long hours = time / 3600000; long minutes = (time / 60000) - hours * 60; long seconds = (time / 1000) - hours * 3600 - minutes * 60; String hourZero = (hours < 10) ? "0" : ""; String minutesZero = (minutes < 10) ? "0" : ""; String secondsZero = (seconds < 10) ? "0" : ""; textBox.setText(String.format("%s%d:%s%d:%s%d", hourZero, hours, minutesZero, minutes, secondsZero, seconds)); } }

Target:
private void updateData(TextView textBox, int meassuredValue) { switch (meassuredValue) { case distanceID: textBox.setText(String.format("%.3f", distance / 1000)); break; case paceID: if (pace < 30) { double rest = pace - (int) pace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", pace, secondsZero, rest)); } else { textBox.setText(getResources().getString(R.string.dashes)); } break; case avgPaceID: if (avgPace < 30) { double rest = avgPace - (int) avgPace; rest = rest * 60; String secondsZero = (rest < 10) ? "0" : ""; textBox.setText(String.format("%.0f:%s%.0f", avgPace, secondsZero, rest)); } else { textBox.setText(getResources().getString(R.string.dashes)); } break; case timeID: long hours = time / 3600000; long minutes = (time / 60000) - hours * 60; long seconds = (time / 1000) - hours * 3600 - minutes * 60; String hourZero = (hours < 10) ? "0" : ""; String minutesZero = (minutes < 10) ? "0" : ""; String secondsZero = (seconds < 10) ? "0" : ""; textBox.setText(String.format("%s%d:%s%d:%s%d", hourZero, hours, minutesZero, minutes, secondsZero, seconds)); break; } }
Source:
public static void registerTerminated(String name, Collection<LogPartition> partitions, LogOffset logOffset, RetryPolicy retryPolicy, long timestamp) { contextes.add(new ComputationRunnerTerminatedContext(name, logOffset, timestamp, retryPolicy, partitions)); }

Target:
public static void registerTerminated(String name, Collection<LogPartition> partitions, LogOffset logOffset, RetryPolicy retryPolicy, long timestamp) { contexts.add(new ComputationRunnerTerminatedContext(name, logOffset, timestamp, retryPolicy, partitions)); }
Source:
public synchronized <M extends Externalizable> LogAppender<M> getAppender(String name, Codec<M> codec) { LogAppender<M> ret = (LogAppender<M>) appenders.computeIfAbsent(name, n -> { if (exists(n)) { return createAppender(n, codec); } throw new IllegalArgumentException("Unknown Log name: " + n); }); if (codec == null) { return ret; } if (ret.getCodec() == null) { throw new IllegalArgumentException(String.format( "The appender for Log %s exists with a default codec, cannot use a different codec: %s", name, codec.getClass())); } if (!ret.getCodec().getClass().getName().equals(codec.getClass().getName())) { throw new IllegalArgumentException( String.format("The appender for Log %s exists with a %s codec, cannot use a different codec: %s", name, codec.getClass(), ret.getCodec().getClass())); } return ret; }

Target:
public synchronized <M extends Externalizable> LogAppender<M> getAppender(String name, Codec<M> codec) { LogAppender<M> ret = (LogAppender<M>) appenders.computeIfAbsent(name, n -> { if (exists(n)) { return createAppender(n, codec); } throw new IllegalArgumentException("Unknown Log name: " + n); }); if (NO_CODEC.equals(codec) || sameCodec(ret.getCodec(), codec)) { return ret; } throw new IllegalArgumentException(String.format( "The appender for Log %s exists and expecting codec: %s, cannot use a different codec: %s", name, ret.getCodec(), codec)); }
Source:
public synchronized ResourceRequest getNextResourceRequest() { for (ResourceRequest rr: resourceRequestMap.get(schedulerKeys.first()).values()) { return rr; } return null; }

Target:
public synchronized ResourceRequest getNextResourceRequest() { for (ResourceRequest rr: resourceRequestMap.get(schedulerKeys.firstKey()).values()) { return rr; } return null; }
Source:
public void makeAPIKeysForwardCompatible(API api) throws APIManagementException { String provider = api.getId().getProviderName(); String apiName = api.getId().getApiName(); Set<String> versions = getAPIVersions(provider, apiName); APIVersionComparator comparator = new APIVersionComparator(); List<API> sortedAPIs = new ArrayList<API>(); for (String version : versions) { API otherApi = getAPI(new APIIdentifier(provider, apiName, version)); if (comparator.compare(otherApi, api) < 0 && !APIConstants.RETIRED.equals(otherApi.getStatus())) { sortedAPIs.add(otherApi); } } Collections.sort(sortedAPIs, comparator); for (int i = sortedAPIs.size() - 1; i >= 0; i--) { String oldVersion = sortedAPIs.get(i).getId().getVersion(); apiMgtDAO.makeKeysForwardCompatible(new ApiTypeWrapper(api), oldVersion ); } int apiId = apiMgtDAO.getAPIID(api.getId(), null); APIEvent apiEvent = new APIEvent(UUID.randomUUID().toString(), System.currentTimeMillis(), APIConstants.EventType.API_UPDATE.name(), tenantId, api.getId().getApiName(), apiId, api.getId().getVersion(), api.getType(), api.getContext(), api.getId().getProviderName(), api.getStatus()); APIUtil.sendNotification(apiEvent, APIConstants.NotifierType.API.name()); }

Target:
public void makeAPIKeysForwardCompatible(API api) throws APIManagementException { String provider = api.getId().getProviderName(); String apiName = api.getId().getApiName(); Set<String> versions = getAPIVersions(provider, apiName); APIVersionComparator comparator = new APIVersionComparator(); List<API> sortedAPIs = new ArrayList<API>(); for (String version : versions) { API otherApi = getAPI(new APIIdentifier(provider, apiName, version)); if (comparator.compare(otherApi, api) < 0 && !APIConstants.RETIRED.equals(otherApi.getStatus())) { sortedAPIs.add(otherApi); } } Collections.sort(sortedAPIs, comparator); for (int i = sortedAPIs.size() - 1; i >= 0; i--) { String oldVersion = sortedAPIs.get(i).getId().getVersion(); apiMgtDAO.makeKeysForwardCompatible(new ApiTypeWrapper(api), oldVersion); } }
Source:
public void pruneCandidateFactSet(CubeTableCause pruneCause) { for (Iterator<Set<CandidateFact>> i = candidateFactSets.iterator(); i.hasNext();) { Set<CandidateFact> cfacts = i.next(); if (!candidateFacts.containsAll(cfacts)) { LOG.info("Not considering fact table set:" + cfacts + " as they have non candidate tables and cause:" + pruneCause); i.remove(); } } }

Target:
public void pruneCandidateFactSet(CubeTableCause pruneCause) { for (Iterator<Set<CandidateFact>> i = candidateFactSets.iterator(); i.hasNext();) { Set<CandidateFact> cfacts = i.next(); if (!candidateFacts.containsAll(cfacts)) { LOG.info("Not considering fact table set:" + cfacts + " as they have non candidate tables and facts missing because of" + pruneCause); i.remove(); } } }
Source:
JMXAttribute(MBeanAttributeInfo attribute, ObjectInstance jmxInstance, String instanceName, Connection connection, HashMap<String, String> instanceTags) { this.attribute = attribute; this.jmxInstance = jmxInstance; this.matchingConf = null; this.connection = connection; this.beanName = jmxInstance.getObjectName().toString(); this.attributeName = attribute.getName(); String[] splitBeanName = this.beanName.split(":"); String domain = splitBeanName[0]; String beanParameters = splitBeanName[1]; LinkedList<String> beanParametersList = beanParametersToTagsList(instanceName, domain, beanParameters, instanceTags); HashMap<String, String> beanParametersHash = beanParameterstoHash(beanParametersList); this.domain = domain; this.beanParameters = beanParametersHash; this.defaultTagsList = beanParametersList; }

Target:
JMXAttribute(MBeanAttributeInfo attribute, ObjectInstance jmxInstance, String instanceName, Connection connection, HashMap<String, String> instanceTags) { this.attribute = attribute; this.jmxInstance = jmxInstance; this.matchingConf = null; this.connection = connection; this.beanName = jmxInstance.getObjectName().toString(); this.attributeName = attribute.getName(); String[] splitBeanName = this.beanName.split(":"); String domain = splitBeanName[0]; String beanParameters = splitBeanName[1]; LinkedList<String> defaultTags = getBeanTags(instanceName, domain, beanParameters, instanceTags); HashMap<String, String> beanParametersHash = getBeanParametersHash(defaultTags); this.domain = domain; this.beanParameters = beanParametersHash; this.defaultTagsList = defaultTags; }
Source:
protected void addVmCinderDisks(List<CinderDisk> templateDisks) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CloneCinderDisks, buildCinderChildCommandParameters(cinderDisks, getVmSnapshotId()), cloneContextAndDetachFromParent()); try { Map<Guid, Guid> diskImageMap = future.get().getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.putAll(diskImageMap); } catch (InterruptedException | ExecutionException e) { log.debug("Exception", e); } }

Target:
protected void addVmCinderDisks(List<CinderDisk> templateDisks) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(templateDisks); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CloneCinderDisks, buildCinderChildCommandParameters(cinderDisks, getVmSnapshotId()), cloneContextAndDetachFromParent()); try { Map<Guid, Guid> diskImageMap = future.get().getActionReturnValue(); srcDiskIdToTargetDiskIdMapping.putAll(diskImageMap); } catch (InterruptedException | ExecutionException e) { log.error("Error cloning Cinder disks from template disks.", e); } }
Source:
public Asset() { super(); getAttributes().setType("Asset"); }

Target:
public Asset() { getAttributes().setType("Asset"); }
Source:
public static void displayOpi(OpiTarget opiTarget, String id) throws OPIViewCreationException { IWorkbenchPage workbenchPage = null; IViewPart view = null; try { workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); view = workbenchPage.showView(id, opiTarget.name(), IWorkbenchPage.VIEW_ACTIVATE); OpiTargetView viewAsOPITarget = (OpiTargetView) view; viewAsOPITarget.setOpi(opiTarget); viewAsOPITarget.setPartName(opiTarget.name()); openOPIs.add(view); openOPIsWorkbenchPage.add(workbenchPage.getPerspective()); } catch (PartInitException e) { LOG.catching(e); e.printStackTrace(); } catch (OPIViewCreationException e) { workbenchPage.hideView(view); throw e; } }

Target:
public static void displayOpi(OpiTarget opiTarget, String id) throws OPIViewCreationException { IWorkbenchPage workbenchPage = null; IViewPart view = null; try { workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); view = workbenchPage.showView(id, opiTarget.name(), IWorkbenchPage.VIEW_ACTIVATE); OpiTargetView viewAsOPITarget = (OpiTargetView) view; viewAsOPITarget.setOpi(opiTarget); viewAsOPITarget.setPartName(opiTarget.name()); openOPIs.add(view); openOPIsWorkbenchPage.add(workbenchPage.getPerspective()); } catch (PartInitException e) { LOG.catching(e); } catch (OPIViewCreationException e) { workbenchPage.hideView(view); throw e; } }
Source:
public String toString() { return toStringHelper(this) .add("count", count) .add("orderingScheme", orderingScheme) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("count", count) .add("orderBy", orderBy) .toString(); }
Source:
public void waitForInitialStateTransferToComplete() throws Exception { if (configuration.clustering().stateTransfer().awaitInitialTransfer()) { if (!localTopologyManager.isCacheRebalancingEnabled(cacheName)) { initialStateTransferComplete.countDown(); } if (trace) log.tracef("Waiting for initial state transfer to finish for cache %s on %s", cacheName, rpcManager.getAddress()); boolean success = initialStateTransferComplete.await(100 * configuration.clustering().stateTransfer().timeout(), TimeUnit.MILLISECONDS); if (!success) { throw new CacheException(String.format("Initial state transfer timed out for cache %s on %s", cacheName, rpcManager.getAddress())); } } }

Target:
public void waitForInitialStateTransferToComplete() throws Exception { if (configuration.clustering().stateTransfer().awaitInitialTransfer()) { if (!localTopologyManager.isCacheRebalancingEnabled(cacheName)) { initialStateTransferComplete.countDown(); } if (trace) log.tracef("Waiting for initial state transfer to finish for cache %s on %s", cacheName, rpcManager.getAddress()); boolean success = initialStateTransferComplete.await(configuration.clustering().stateTransfer().timeout(), TimeUnit.MILLISECONDS); if (!success) { throw new CacheException(String.format("Initial state transfer timed out for cache %s on %s", cacheName, rpcManager.getAddress())); } } }
Source:
public void writeIndexToFile(long fileEndPointer) throws IOException, StoreException { if (prevNumOfEntriesWritten != index.size()) { File temp = new File(getFile().getAbsolutePath() + ".tmp"); FileOutputStream fileStream = new FileOutputStream(temp); CrcOutputStream crc = new CrcOutputStream(fileStream); DataOutputStream writer = new DataOutputStream(crc); try { rwLock.readLock().lock(); writer.writeShort(PersistentIndex.version); writer.writeInt(this.keySize); writer.writeInt(this.valueSize); writer.writeLong(fileEndPointer); int numOfEntries = 0; for (Map.Entry<StoreKey, IndexValue> entry : index.entrySet()) { if (entry.getValue().getOffset() + entry.getValue().getSize() <= fileEndPointer) { writer.write(entry.getKey().toBytes()); writer.write(entry.getValue().getBytes().array()); logger.trace("IndexSegment : writing key offset size fileEndOffset {}", getFile().getAbsolutePath(), entry.getKey(), entry.getValue().getOffset(), entry.getValue().getOffset(), fileEndPointer); numOfEntries++; } } prevNumOfEntriesWritten = numOfEntries; long crcValue = crc.getValue(); writer.writeLong(crcValue); fileStream.getChannel().force(true); temp.renameTo(getFile()); } catch (IOException e) { throw new StoreException("IndexSegment : " + indexFile.getAbsolutePath() + " IO error while persisting index to disk", e, StoreErrorCodes.IOError); } finally { writer.close(); rwLock.readLock().unlock(); } logger.trace("IndexSegment : completed writing index to file", indexFile.getAbsolutePath()); } }

Target:
public void writeIndexToFile(long fileEndPointer) throws IOException, StoreException { if (prevNumOfEntriesWritten != index.size()) { File temp = new File(getFile().getAbsolutePath() + ".tmp"); FileOutputStream fileStream = new FileOutputStream(temp); CrcOutputStream crc = new CrcOutputStream(fileStream); DataOutputStream writer = new DataOutputStream(crc); try { rwLock.readLock().lock(); writer.writeShort(PersistentIndex.version); writer.writeInt(this.keySize); writer.writeInt(this.valueSize); writer.writeLong(fileEndPointer); int numOfEntries = 0; for (Map.Entry<StoreKey, IndexValue> entry : index.entrySet()) { if (entry.getValue().getOffset() + entry.getValue().getSize() <= fileEndPointer) { writer.write(entry.getKey().toBytes()); writer.write(entry.getValue().getBytes().array()); logger.trace("IndexSegment : writing key - value - offset size fileEndOffset {}", getFile().getAbsolutePath(), entry.getKey(), entry.getValue().getOffset(), entry.getValue().getSize(), fileEndPointer); numOfEntries++; } } prevNumOfEntriesWritten = numOfEntries; long crcValue = crc.getValue(); writer.writeLong(crcValue); fileStream.getChannel().force(true); temp.renameTo(getFile()); } catch (IOException e) { throw new StoreException("IndexSegment : " + indexFile.getAbsolutePath() + " IO error while persisting index to disk", e, StoreErrorCodes.IOError); } finally { writer.close(); rwLock.readLock().unlock(); } logger.trace("IndexSegment : completed writing index to file", indexFile.getAbsolutePath()); } }
Source:
public String run(Transition trans, Attributes a) { StringBuilder sb = new StringBuilder(); boolean verbose = a.typeSafeGet(Boolean.class, PRINT_VERBOSE_GRAPH); KRunGraph graph = a.typeSafeGet(KRunGraph.class); if (definition == null) { definition = a.typeSafeGet(Attribute.Key.get(Definition.class)); populateRuleStore(); } if (unparser == null) { Context context = a.typeSafeGet(Context.class); unparser = new Unparser(context); } Location location = trans.getLocation(); Source source = trans.getSource(); Pair keyPair = new MutablePair<>(source, location); ModuleItem ruleItem = ruleStore.get(keyPair); if (trans.getType() == TransitionType.RULE) { if (verbose) { sb.append("\n"); sb.append(statePrinter.run(graph.getSource(trans), a)); sb.append("\n=>\n"); sb.append(statePrinter.run(graph.getDest(trans), a)); sb.append("\n"); sb.append("Rule at Source " + source.toString() + " " + location.toString() + "\n"); if (ruleItem != null) { sb.append(unparser.print(ruleItem)); } } else { sb.append(" [Node "); sb.append(graph.getSource(trans).getStateId()); sb.append(" Rule at " + source.toString() + " " + location.toString()); sb.append(", Node "); sb.append(graph.getDest(trans).getStateId()); sb.append("]\n"); } return sb.toString(); } else if (trans.getType() == TransitionType.REDUCE) { sb.append("\nFunction evaluation"); } else if (trans.getType() == TransitionType.UNLABELLED) { sb.append("\nUnlabelled rule"); } else { sb.append("\nRead " + StringBuiltin.of(trans.getReadString()).value()); } return sb.toString(); }

Target:
public String run(Transition trans, Attributes a) { StringBuilder sb = new StringBuilder(); boolean verbose = a.typeSafeGet(Boolean.class, PRINT_VERBOSE_GRAPH); KRunGraph graph = a.typeSafeGet(KRunGraph.class); if (definition == null) { definition = a.typeSafeGet(Attribute.Key.get(Definition.class)); populateRuleStore(); } if (unparser == null) { Context context = a.typeSafeGet(Context.class); unparser = new Unparser(context); } Location location = trans.getLocation(); Source source = trans.getSource(); Pair keyPair = Pair.of(source, location); ModuleItem ruleItem = ruleStore.get(keyPair); if (trans.getType() == TransitionType.RULE) { if (verbose) { sb.append("\n"); sb.append(statePrinter.run(graph.getSource(trans), a)); sb.append("\n=>\n"); sb.append(statePrinter.run(graph.getDest(trans), a)); sb.append("\n"); sb.append("Rule at Source " + source.toString() + " " + location.toString() + "\n"); if (ruleItem != null) { sb.append(unparser.print(ruleItem)); } } else { sb.append(" [Node "); sb.append(graph.getSource(trans).getStateId()); sb.append(" Rule at " + source.toString() + " " + location.toString()); sb.append(", Node "); sb.append(graph.getDest(trans).getStateId()); sb.append("]\n"); } return sb.toString(); } else if (trans.getType() == TransitionType.REDUCE) { sb.append("\nFunction evaluation"); } else if (trans.getType() == TransitionType.UNLABELLED) { sb.append("\nUnlabelled rule"); } else { sb.append("\nRead " + StringBuiltin.of(trans.getReadString()).value()); } return sb.toString(); }
Source:
public boolean awaitTerminalEvent(long timeout, TimeUnit unit) { try { return latch.await(timeout, unit); } catch (InterruptedException e) { throw new RuntimeException("Interrupted", e); } }

Target:
public void awaitTerminalEvent(long timeout, TimeUnit unit) { try { if (!latch.await(timeout, unit)) { throw new RuntimeException(new TimeoutException()); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted", e); } }
Source:
protected Collection<String> getInAppFrames(Dsn dsn) { if (dsn.getOptions().containsKey(IN_APP_FRAMES_OPTION)) { ArrayList<String> inAppPackages = new ArrayList<>(); for (String inAppPackage : dsn.getOptions().get(IN_APP_FRAMES_OPTION).split(",")) { if (!inAppPackage.trim().equals("")) { inAppPackages.add(inAppPackage); } } return inAppPackages; } return Collections.emptyList(); }

Target:
protected Collection<String> getInAppFrames(Dsn dsn) { if (!dsn.getOptions().containsKey(IN_APP_FRAMES_OPTION)) { return Collections.emptyList(); } ArrayList<String> inAppPackages = new ArrayList<>(); for (String inAppPackage : dsn.getOptions().get(IN_APP_FRAMES_OPTION).split(",")) { if (!inAppPackage.trim().equals("")) { inAppPackages.add(inAppPackage); } } return inAppPackages; }
Source:
@Override public void log(int priority, @Nullable String tag, @NonNull String message) { checkNotNull(message); Log.println(priority, tag, message); }

Target:
@Override public void log(int priority, @Nullable String tag, @NonNull String message) { checkNotNull(message); if (tag == null) { tag = DEFAULT_TAG; } Log.println(priority, tag, message); }
Source:
private boolean isMatchPath(String[] linkPathSegments, List<PathSegment> uriPathSegments) { for (int i = 0; i < linkPathSegments.length; i++) { String uriPathSegment = uriPathSegments.get(i).getPath(); if (isUUID(uriPathSegment) || uriPathSegment.equals(linkPathSegments[i])) { continue; } else { return false; } } return true; }

Target:
private boolean isMatchPath(String[] linkPathSegments, List<PathSegment> uriPathSegments) { for (int i = 0; i < linkPathSegments.length; i++) { String uriPathSegment = uriPathSegments.get(i).getPath(); if (!isUUID(uriPathSegment) && !uriPathSegment.equals(linkPathSegments[i])) { return false; } } return true; }
Source:
public String toString() { try { return asString(); } catch (Exception e) { Log.e("RestResponse: toString()", "Exception caught while calling asString()"); return ((response == null) ? "" : response.toString()); } }

Target:
public String toString() { try { return asString(); } catch (Exception e) { Log.e("RestResponse: toString()", "Exception caught while calling asString()", e); return ((response == null) ? "" : response.toString()); } }
Source:
protected <T extends HazelcastEntity> Collection<T> find(Collection<String> devices, Collection<String> names, Date timestamp, String status, Integer take, Boolean hasResponse, HivePrincipal principal, Class<T> entityClass) { final Predicate filters = hazelcastHelper.prepareFilters(getAvailableDevices(devices, principal), names, timestamp, status, hasResponse); return retrieve(filters, take, entityClass); }

Target:
protected <T extends HazelcastEntity> Collection<T> find(Collection<String> devices, Collection<String> names, Date timestamp, String status, Integer take, Boolean hasResponse, HivePrincipal principal, Class<T> entityClass) { List<String> availableDevicesGUIDs = getAvailableDevices(devices, principal); final Predicate filters = hazelcastHelper.prepareFilters(availableDevicesGUIDs, names, timestamp, status, hasResponse); return retrieve(filters, take, entityClass); }
Source:
void checkPreferredLocation(Configured configuration, PluginExceptionConditionAccumulator accumulator, LocalizationContext localizationContext) { String preferredLocation = configuration.getConfigurationValue(PREFERRED_LOCATION, localizationContext); if (preferredLocation != null && !preferredLocation.isEmpty()) { LOG.info(">> Querying zone '{}'", preferredLocation); GoogleCredentials credentials = provider.getCredentials(); Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String regionName = provider.getConfigurationValue(REGION_SQL, localizationContext); String computeRegionName = regionName; if (computeRegionName.equals("us-central")) { computeRegionName = "us-central1"; } try { Zone zone = compute.zones().get(projectId, preferredLocation).execute(); if (!Urls.getLocalName(zone.getRegion()).equals(computeRegionName)) { addError(accumulator, PREFERRED_LOCATION, localizationContext, null, PREFERRED_LOCATION_NOT_FOUND_IN_REGION_MSG, preferredLocation, regionName, projectId); } } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == 404) { addError(accumulator, PREFERRED_LOCATION, localizationContext, null, PREFERRED_LOCATION_NOT_FOUND_MSG, preferredLocation, projectId); } else { throw new TransientProviderException(e); } } catch (IOException e) { throw new TransientProviderException(e); } } }

Target:
void checkPreferredLocation(Configured configuration, PluginExceptionConditionAccumulator accumulator, LocalizationContext localizationContext) { String preferredLocation = configuration.getConfigurationValue(PREFERRED_LOCATION, localizationContext); if (preferredLocation != null && !preferredLocation.isEmpty()) { LOG.info(">> Querying zone '{}'", preferredLocation); GoogleCredentials credentials = provider.getCredentials(); Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String cloudSQLRegionName = provider.getConfigurationValue(REGION, localizationContext); String computeRegionName = Names.convertCloudSQLRegionToComputeRegion(cloudSQLRegionName, provider.getGoogleConfig()); try { Zone zone = compute.zones().get(projectId, preferredLocation).execute(); if (!Urls.getLocalName(zone.getRegion()).equals(computeRegionName)) { addError(accumulator, PREFERRED_LOCATION, localizationContext, null, PREFERRED_LOCATION_NOT_FOUND_IN_REGION_MSG, preferredLocation, cloudSQLRegionName, projectId); } } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == 404) { addError(accumulator, PREFERRED_LOCATION, localizationContext, null, PREFERRED_LOCATION_NOT_FOUND_MSG, preferredLocation, projectId); } else { throw new TransientProviderException(e); } } catch (IOException e) { throw new TransientProviderException(e); } } }
Source:
public static <T> TranslatedExpression<T> untranslated(RowExpression originalExpression) { return new TranslatedExpression<>(Optional.empty(), originalExpression, emptyList()); }

Target:
public static <T> TranslatedExpression<T> untranslated(RowExpression originalExpression) { return new TranslatedExpression<>(Optional.empty(), originalExpression, ImmutableList.of()); }
Source:
public void initializeVanityUrlCache(String hostId, long languageId) { List<VanityUrl> activeVanityUrls = APILocator.getVanityUrlAPI() .getActiveVanityUrlsByHostAndLanguage(hostId, languageId, APILocator.systemUser()); activeVanityUrls.stream().forEach((VanityUrl vanity) -> updateCache(vanity)); }

Target:
public void initializeVanityUrlCache(String hostId, long languageId) { List<VanityUrl> activeVanityUrls = APILocator.getVanityUrlAPI() .getActiveVanityUrlsByHostAndLanguage(hostId, languageId, APILocator.systemUser()); activeVanityUrls.forEach(this::updateCache); }
Source:
public void modifyPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { try (AutoCloseableLock lock = writeLockResource()) { if (!macPools.containsKey(macPool.getId())) { throw new IllegalStateException(INEXISTENT_POOL_EXCEPTION_MESSAGE); } log.debug("Updating pool {}. (old will be deleted and new initialized from db entity)", macPool); removeWithoutLocking(macPool.getId()); initializeMacPool(macPool); } }

Target:
public void modifyPool(org.ovirt.engine.core.common.businessentities.MacPool macPool) { try (AutoCloseableLock lock = writeLockResource()) { Guid macPoolId = macPool.getId(); if (!macPools.containsKey(macPoolId)) { throw new IllegalStateException(createExceptionMessageMacPoolHavingIdDoesNotExist(macPoolId)); } log.debug("Updating pool {}. (old will be deleted and new initialized from db entity)", macPool); removeWithoutLocking(macPoolId); initializeMacPool(macPool); } }
Source:
public boolean isApplicable(Class<? extends AbstractProject<?,?>> jobType) { return true; }

Target:
public boolean isApplicable(Class<? extends AbstractProject<?,?>> jobType) { return AbortAndRestartOperation.isPresent(); }
Source:
public Response addMetadata(@PathParam("itemname") @ApiParam(value = "item name", required = true) String itemname, @PathParam("namespace") @ApiParam(value = "namespace", required = true) String namespace, @ApiParam(value = "metadata", required = true) MetadataDTO metadata) { Item item = getItem(itemname); if (item == null) { logger.info("Received HTTP PUT request at '{}' for the unknown item '{}'.", uriInfo.getPath(), itemname); return Response.status(Status.NOT_FOUND).build(); } if (namespace.startsWith(MetadataRegistry.INTERNAL_NAMESPACE_PREFIX)) { logger.info("Received HTTP PUT request at '{}' for internal namespace '{}'.", uriInfo.getPath(), namespace); return Response.status(Status.FORBIDDEN).build(); } MetadataKey key = new MetadataKey(namespace, itemname); Metadata md = new Metadata(key, metadata.value, metadata.config); if (metadataRegistry.get(key) == null) { metadataRegistry.add(md); return Response.status(Status.CREATED).type(MediaType.TEXT_PLAIN).build(); } else { metadataRegistry.update(md); return Response.ok(null, MediaType.TEXT_PLAIN).build(); } }

Target:
public Response addMetadata(@PathParam("itemname") @ApiParam(value = "item name", required = true) String itemname, @PathParam("namespace") @ApiParam(value = "namespace", required = true) String namespace, @ApiParam(value = "metadata", required = true) MetadataDTO metadata) { Item item = getItem(itemname); if (item == null) { logger.info("Received HTTP PUT request at '{}' for the unknown item '{}'.", uriInfo.getPath(), itemname); return Response.status(Status.NOT_FOUND).build(); } if (metadataRegistry.isInternalNamespace(namespace)) { logger.info("Received HTTP PUT request at '{}' for internal namespace '{}'.", uriInfo.getPath(), namespace); return Response.status(Status.FORBIDDEN).build(); } MetadataKey key = new MetadataKey(namespace, itemname); Metadata md = new Metadata(key, metadata.value, metadata.config); if (metadataRegistry.get(key) == null) { metadataRegistry.add(md); return Response.status(Status.CREATED).type(MediaType.TEXT_PLAIN).build(); } else { metadataRegistry.update(md); return Response.ok(null, MediaType.TEXT_PLAIN).build(); } }
Source:
public TimestampSpec getTimestampSpec() { return timestampSpec; }

Target:
public TimestampSpec getTimestampSpec() { if (timestampSpec == null) { timestampSpec = Preconditions.checkNotNull(getParser(), "inputRowParser").getParseSpec().getTimestampSpec(); } return timestampSpec; }
Source:
public static MessageNumberSet[] createMessageNumberSets(@Nonnull final int[] msgs) { final List<MessageNumberSet> v = new ArrayList<MessageNumberSet>(); int i = 0; while (i < msgs.length) { int start = msgs[i]; int j = i + 1; while (j < msgs.length && msgs[j] == msgs[j - 1] + 1) { j++; } int end = msgs[j - 1]; v.add(new MessageNumberSet(start, end)); i = j; } return v.toArray(new MessageNumberSet[0]); }

Target:
public static MessageNumberSet[] createMessageNumberSets(@Nonnull final int[] msgs) { final List<MessageNumberSet> v = new ArrayList<MessageNumberSet>(); int i = 0; while (i < msgs.length) { int start = msgs[i]; int j = i + 1; while (j < msgs.length && msgs[j] == msgs[j - 1] + 1) { j++; } int end = msgs[j - 1]; v.add(new MessageNumberSet(start, end)); i = j; } return v.toArray(new MessageNumberSet[v.size()]); }
Source:
private static Map<String, Integer> createCountryCodeByIsoMap() { Map<String, Integer> map = new HashMap<>(MAX_COUNTRIES); for (int i = 0; i < COUNTRY_TO_REGION_CODES.size(); i++) { int code = COUNTRY_TO_REGION_CODES.keyAt(i); List<String> regions = COUNTRY_TO_REGION_CODES.get(code); for (String region : regions) { map.put(region, code); } } map.remove("001"); map.remove("TA"); map.put("HM", 672); map.put("GS", 500); map.put("XK", 381); return map; }

Target:
private static Map<String, Integer> createCountryCodeByIsoMap() { Map<String, Integer> map = new HashMap<>(MAX_COUNTRIES); for (int i = 0; i < COUNTRY_TO_REGION_CODES.size(); i++) { int code = COUNTRY_TO_REGION_CODES.keyAt(i); List<String> regions = COUNTRY_TO_REGION_CODES.get(code); for (String region : regions) { if (region.equals("001")) { continue; } if (map.containsKey(region)) { throw new IllegalStateException("Duplicate regions for country code: " + code); } map.put(region, code); } } map.remove("TA"); map.put("HM", 672); map.put("GS", 500); map.put("XK", 381); return map; }
Source:
public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException { includeValue= includeValue && fValue != Value.UNKNOWN; short firstBytes = ITypeMarshalBuffer.EVAL_FIXED; if (includeValue) firstBytes |= ITypeMarshalBuffer.FLAG1; switch (fValueCategory) { case LVALUE: firstBytes |= ITypeMarshalBuffer.FLAG2; break; case PRVALUE: firstBytes |= ITypeMarshalBuffer.FLAG3; break; default: break; } buffer.putShort(firstBytes); buffer.marshalType(fType); if (includeValue) { buffer.marshalValue(fValue); } }

Target:
public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException { includeValue= includeValue && fValue != Value.UNKNOWN; short firstBytes = ITypeMarshalBuffer.EVAL_FIXED; if (includeValue) firstBytes |= ITypeMarshalBuffer.FLAG1; switch (fValueCategory) { case PRVALUE: firstBytes |= ITypeMarshalBuffer.FLAG2; break; case LVALUE: firstBytes |= ITypeMarshalBuffer.FLAG3; break; default: break; } buffer.putShort(firstBytes); buffer.marshalType(fType); if (includeValue) { buffer.marshalValue(fValue); } }
Source:
public abstract H launchApp(StreamingApplication application, Configuration configuration, Attribute.AttributeMap launchParameters) throws LauncherException; public void shutdownApp(H app) { shutdownApp(app, ShutdownMode.ORDERLY); }

Target:
public abstract H launchApp(StreamingApplication application, Configuration configuration, Attribute.AttributeMap launchParameters) throws LauncherException; public void shutdownApp(H app) throws LauncherException { shutdownApp(app, ShutdownMode.AWAIT_TERMINATION); }
Source:
private void drop( final DruidCoordinatorRuntimeParams params, final DataSegment segment, final CoordinatorStats stats ) { final DruidCluster druidCluster = params.getDruidCluster(); for (final Object2IntMap.Entry<String> entry : targetReplicants.object2IntEntrySet()) { final String tier = entry.getKey(); if (druidCluster.hasTier(tier) && entry.getIntValue() > currentReplicants.getOrDefault(tier, 0)) { return; } } for (final Object2IntMap.Entry<String> entry : currentReplicants.object2IntEntrySet()) { final String tier = entry.getKey(); final NavigableSet<ServerHolder> holders = druidCluster.getHistoricalsByTier(tier); final int numDropped; if (holders == null) { log.makeAlert("No holders found for tier[%s]", tier).emit(); numDropped = 0; } else { final int currentReplicantsInTier = entry.getIntValue(); final int numToDrop = currentReplicantsInTier - targetReplicants.getOrDefault(tier, 0); numDropped = dropForTier(numToDrop, holders, segment); } stats.addToTieredStat(DROPPED_COUNT, tier, numDropped); } }

Target:
private void drop( final DruidCoordinatorRuntimeParams params, final DataSegment segment, final CoordinatorStats stats ) { final DruidCluster druidCluster = params.getDruidCluster(); if (loadingInProgress(druidCluster)) { return; } for (final Object2IntMap.Entry<String> entry : currentReplicants.object2IntEntrySet()) { final String tier = entry.getKey(); final NavigableSet<ServerHolder> holders = druidCluster.getHistoricalsByTier(tier); final int numDropped; if (holders == null) { log.makeAlert("No holders found for tier[%s]", tier).emit(); numDropped = 0; } else { final int currentReplicantsInTier = entry.getIntValue(); final int numToDrop = currentReplicantsInTier - targetReplicants.getOrDefault(tier, 0); numDropped = dropForTier(numToDrop, holders, segment); } stats.addToTieredStat(DROPPED_COUNT, tier, numDropped); } }
Source:
public static Pair<SizeUnit, Double> autoConvert(long size, SizeUnit inUnit) { for (Pair<Long, SizeUnit> currentUnitPair : SizeUnit.weightToUnit) { if (size / Math.pow(CONVERT_FACTOR, currentUnitPair.getFirst() - inUnit.getUnitWeight()) >= 1) { return new Pair<SizeConverter.SizeUnit, Double>(currentUnitPair.getSecond(), Double.valueOf(SizeConverter.convert(size, inUnit, currentUnitPair.getSecond()).doubleValue())); } } return new Pair<SizeConverter.SizeUnit, Double>(SizeUnit.BYTES, Double.valueOf(size)); }

Target:
public static Pair<SizeUnit, Double> autoConvert(long size, SizeUnit inUnit) { for (Pair<Long, SizeUnit> currentUnitPair : SizeUnit.weightToUnit) { if (size / Math.pow(CONVERT_FACTOR, currentUnitPair.getFirst() - inUnit.getUnitWeight()) >= 1) { return new Pair<SizeConverter.SizeUnit, Double>(currentUnitPair.getSecond(), SizeConverter.convert(size, inUnit, currentUnitPair.getSecond()).doubleValue()); } } return new Pair<SizeConverter.SizeUnit, Double>(SizeUnit.BYTES, (double)size); }
Source:
public PatternDSL.PatternDef<A> getAPattern() { return leftParentStream.getLeftPattern(); }

Target:
public PatternDSL.PatternDef<A> getAPattern() { return leftParentStream.getAPattern(); }
Source:
protected void ensureValuesCapacity(int capacity, boolean includeNulls) { if (values.length < capacity) { values = Arrays.copyOf(values, Math.max(capacity + 10, values.length * 2)); if (valueIsNull != null) { valueIsNull = Arrays.copyOf(valueIsNull, values.length); } } if (includeNulls && valueIsNull == null) { valueIsNull = new boolean[values.length]; } }

Target:
protected void ensureValuesCapacity(int capacity, boolean includeNulls) { if (values == null) { values = new long[capacity]; } else if (values.length < capacity) { values = Arrays.copyOf(values, Math.max(capacity + 10, values.length * 2)); if (valueIsNull != null) { valueIsNull = Arrays.copyOf(valueIsNull, values.length); } } if (includeNulls && valueIsNull == null) { valueIsNull = new boolean[values.length]; } }
Source:
public boolean lookupMD5Quick(Content content) throws TskCoreException { assert content instanceof AbstractFile; if (content instanceof AbstractFile) { AbstractFile file = (AbstractFile) content; if (null != file.getMd5Hash()) { try{ return EamDb.getInstance().isFileHashInReferenceSet(file.getMd5Hash(), this.referenceSetID); } catch (EamDbException ex){ Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup", ex); throw new TskCoreException("Error performing central reposiotry hash lookup", ex); } } } return false; }

Target:
public boolean lookupMD5Quick(Content content) throws TskCoreException { assert content instanceof AbstractFile; if (content instanceof AbstractFile) { AbstractFile file = (AbstractFile) content; if (null != file.getMd5Hash()) { try{ return EamDb.getInstance().isFileHashInReferenceSet(file.getMd5Hash(), this.referenceSetID); } catch (EamDbException ex){ Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup for hash " + file.getMd5Hash() + " in reference set " + referenceSetID, ex); throw new TskCoreException("Error performing central reposiotry hash lookup", ex); } } } return false; }
Source:
public boolean chkAuthorization(String userName, List<String> projectIds, String[] userRoles) throws QuadrigaStorageException, QuadrigaAccessException { boolean haveAccess = false; for (String projectId : projectIds) { haveAccess = chkAuthorization(userName, projectId, userRoles); if (!haveAccess) { break; } } return haveAccess; }

Target:
public boolean chkAuthorization(String userName, List<String> projectIds, String[] userRoles) throws QuadrigaStorageException, QuadrigaAccessException { for (String projectId : projectIds) { if (!chkAuthorization(userName, projectId, userRoles)) { return false; } } return true; }
Source:
static <T> Future<T> of(ExecutorService executorService, CheckedSupplier<? extends T> computation, long delay) { Objects.requireNonNull(executorService, "executorService is null"); Objects.requireNonNull(computation, "computation is null"); final FutureImpl<T> future = new FutureImpl<>(executorService); final CheckedSupplier<? extends T> task = (delay <= 0) ? computation : () -> { Thread.sleep(delay); return computation.get(); }; future.run(task); return future; }

Target:
static <T> Future<T> of(ExecutorService executorService, CheckedSupplier<? extends T> computation, long delay) { Objects.requireNonNull(executorService, "executorService is null"); Objects.requireNonNull(computation, "computation is null"); final FutureImpl<T> future = new FutureImpl<>(executorService); future.run(computation, delay); return future; }
Source:
private void refreshProject() { projectService.getProject(appContext.getWorkspace().getId(), "Spring", new AsyncRequestCallback<ProjectConfigDto>( dtoUnmarshallerFactory.newUnmarshaller(ProjectConfigDto.class)) { @Override protected void onSuccess(ProjectConfigDto result) { eventBus.fireEvent(new ProjectUpdatedEvent(project.getPath(), result)); } @Override protected void onFailure(Throwable exception) { notificationManager.notify(exception.getLocalizedMessage(), FAIL, true, project); } }); }

Target:
private void refreshProject() { projectService.getProject(workspaceId, project.getName(), new AsyncRequestCallback<ProjectConfigDto>( dtoUnmarshallerFactory.newUnmarshaller(ProjectConfigDto.class)) { @Override protected void onSuccess(ProjectConfigDto result) { eventBus.fireEvent(new ProjectUpdatedEvent(project.getPath(), result)); } @Override protected void onFailure(Throwable exception) { notificationManager.notify(exception.getLocalizedMessage(), FAIL, true, project); } }); }
Source:
public void createKafkaTopic(String topic_name) throws Exception { try{ commonspec.getLogger().debug("Creating a kafka topic"); commonspec.getKafkaUtils().createTopic(topic_name); }catch (Exception e) { commonspec.getLogger().debug("Exception captured"); commonspec.getLogger().debug(e.toString()); commonspec.getExceptions().add(e); } }

Target:
public void createKafkaTopic(String topic_name) throws Exception { commonspec.getLogger().debug("Creating a kafka topic"); commonspec.getKafkaUtils().createTopic(topic_name); }
Source:
protected void activateDefaultView(String deepLinkPath) { boolean isStartup = m_attachedCount <= 1; if (safeHandleDeepLink(deepLinkPath)) { } else if (isStartup) { interceptDefaultView(); } }

Target:
protected void activateDefaultView(String deepLinkPath) { if (safeHandleDeepLink(deepLinkPath)) { return; } if (m_attachedCount <= 1) { interceptDefaultView(); } }
Source:
public String update(Request request, Response response) { String environmentName = request.params("name"); BasicEnvironmentConfig environmentConfig = (BasicEnvironmentConfig) buildEntityFromRequestBody(request); EnvironmentConfig oldEnvironmentConfig = fetchEntityFromConfig(environmentName); HttpLocalizedOperationResult operationResult = new HttpLocalizedOperationResult(); if (!environmentConfig.getAllErrors().isEmpty()) { operationResult.unprocessableEntity("Error parsing environment config from the request"); return handleCreateOrUpdateResponse(request, response, environmentConfig, operationResult); } if (isPutRequestStale(request, oldEnvironmentConfig)) { throw haltBecauseEtagDoesNotMatch("environment", environmentName); } if (!StringUtils.equals(environmentName, environmentConfig.name().toString())) { throw haltBecauseRenameOfEntityIsNotSupported("environment"); } environmentConfigService.updateEnvironment(environmentConfig.name().toString(), environmentConfig, currentUsername(), etagFor(oldEnvironmentConfig), operationResult); setEtagHeader(environmentConfig, response); return handleCreateOrUpdateResponse(request, response, environmentConfig, operationResult); }

Target:
public String update(Request request, Response response) { String environmentName = request.params("name"); BasicEnvironmentConfig environmentConfig = (BasicEnvironmentConfig) buildEntityFromRequestBody(request); EnvironmentConfig oldEnvironmentConfig = fetchEntityFromConfig(environmentName); HttpLocalizedOperationResult operationResult = new HttpLocalizedOperationResult(); if (!StringUtils.equalsIgnoreCase(environmentName, environmentConfig.name().toString())) { throw haltBecauseRenameOfEntityIsNotSupported("environment"); } if (!environmentConfig.getAllErrors().isEmpty()) { operationResult.unprocessableEntity("Error parsing environment config from the request"); return handleCreateOrUpdateResponse(request, response, environmentConfig, operationResult); } if (isPutRequestStale(request, oldEnvironmentConfig)) { throw haltBecauseEtagDoesNotMatch("environment", environmentName); } environmentConfigService.updateEnvironment(environmentConfig.name().toString(), environmentConfig, currentUsername(), etagFor(oldEnvironmentConfig), operationResult); setEtagHeader(environmentConfig, response); return handleCreateOrUpdateResponse(request, response, environmentConfig, operationResult); }
Source:
public void shutdownAndSuspend() throws InterruptedException { try { deactivateQueueMetrics(queueId); queuing.setActive(queueId, false); boolean hasWorkRunning = false; for (Work work : running) { work.setWorkInstanceSuspending(); log.trace("suspending and rescheduling " + work.getId()); work.setWorkInstanceState(State.SCHEDULED); queuing.workReschedule(queueId, work); hasWorkRunning = true; } if (hasWorkRunning) { long shutdownDelay = Long.parseLong(Framework.getService(ConfigurationService.class) .getProperty(SHUTDOWN_DELAY_MS_KEY, "0")); if (shutdownDelay > 0) { Thread.sleep(shutdownDelay); } } shutdownNow(); } finally { executors.remove(queueId); } }

Target:
public void shutdownAndSuspend() throws InterruptedException { try { deactivateQueueMetrics(queueId); queuing.setActive(queueId, false); boolean hasRunningWork = false; for (Work work : running) { work.setWorkInstanceSuspending(); log.trace("suspending and rescheduling " + work.getId()); work.setWorkInstanceState(State.SCHEDULED); queuing.workReschedule(queueId, work); hasRunningWork = true; } if (hasRunningWork) { long shutdownDelay = Long.parseLong( Framework.getService(ConfigurationService.class).getProperty(SHUTDOWN_DELAY_MS_KEY, "0")); Thread.sleep(shutdownDelay); } shutdownNow(); } finally { executors.remove(queueId); } }