auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Collection<Partition<AbstractKuduInputOperator>> definePartitions( Collection<Partition<AbstractKuduInputOperator>> partitions, PartitioningContext context) { List<Partition<AbstractKuduInputOperator>> partitionsForInputOperator = new ArrayList<>(); List<KuduPartitionScanAssignmentMeta> assignmentMetaList = new ArrayList<>(); try { assignmentMetaList.addAll(getListOfPartitionAssignments(partitions,context)); } catch (Exception e) { LOG.error(" Aborting partition planning as Kudu meta data could not be obtained"); DTThrowable.rethrow(e); } LOG.info("Maximum possible Kudu input operator partition count is " + assignmentMetaList.size()); Map<Integer,List<KuduPartitionScanAssignmentMeta>> assignments = assign(assignmentMetaList,context); if ( partitions == null || ( assignments.size() != partitions.size()) ) { LOG.info("Clearing all of the current partitions and setting up new ones"); partitions.clear(); for ( int i = 0; i < assignments.size(); i++) { partitionsForInputOperator.add(clonePartitionAndAssignScanMeta(assignments.get(i))); } return partitionsForInputOperator; } else { LOG.info("Not making any changes to the partitions"); return partitions; } }

Target:
public Collection<Partition<AbstractKuduInputOperator>> definePartitions( Collection<Partition<AbstractKuduInputOperator>> partitions, PartitioningContext context) { if ( partitions != null) { LOG.info("The current partitioner plan has " + partitions.size() + " operators before redefining"); } List<Partition<AbstractKuduInputOperator>> partitionsForInputOperator = new ArrayList<>(); List<KuduPartitionScanAssignmentMeta> assignmentMetaList = new ArrayList<>(); try { assignmentMetaList.addAll(getListOfPartitionAssignments(partitions,context)); } catch (Exception e) { throw new RuntimeException("Aborting partition planning as Kudu meta data could not be obtained", e); } LOG.info("Maximum possible Kudu input operator partition count is " + assignmentMetaList.size()); Map<Integer,List<KuduPartitionScanAssignmentMeta>> assignments = assign(assignmentMetaList,context); boolean requiresRepartitioning = false; if ( partitions == null) { requiresRepartitioning = true; } else { for ( Partition<AbstractKuduInputOperator> aPartition : partitions) { if ( !aPartition.getPartitionedInstance().isPartitioned()) { requiresRepartitioning = true; break; } } } if ( requiresRepartitioning ) { partitions.clear(); LOG.info("Clearing all of the current partitions and setting up new ones"); partitions.clear(); for ( int i = 0; i < assignments.size(); i++) { List<KuduPartitionScanAssignmentMeta> assignmentForThisOperator = assignments.get(i); partitionsForInputOperator.add(clonePartitionAndAssignScanMeta(assignmentForThisOperator)); LOG.info("Assigned apex operator " + i + " with " + assignmentForThisOperator.size() + " kudu mappings"); } LOG.info("Returning " + partitionsForInputOperator.size() + " partitions for the input operator"); return partitionsForInputOperator; } else { LOG.info("Not making any changes to the partitions"); return partitions; } }
Source:
AdvancedCache<K, V> cacheToUse(boolean isWrite) { return isWrite ? optimisticTransaction ? cache : cache.withFlags(Flag.SKIP_LOCKING) : cache.withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT); }

Target:
AdvancedCache<K, V> cacheToUse(boolean isWrite) { return isWrite ? (optimisticTransaction ? cache : cache.withFlags(Flag.SKIP_LOCKING)) : cache.withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT); }
Source:
private synchronized void writeCurrentBufferToService() throws IOException { if (bufferIndex == 0) { return; } final byte[] bytes = buffer; final int bytesLength = bufferIndex; bufferIndex = 0; final long offset = position; position += bytesLength; if (Runtime.getRuntime().freeMemory() < MIN_MEMORY_THRESHOLD && buffersToBeReturned.get() > 0) { LOG.debug("Low memory"); waitForTaskToComplete(); } if (BYTE_BUFFER_POOL.size(false) < 1 && buffersToBeReturned.get() >= maxBufferCount) { waitForTaskToComplete(); } buffer = BYTE_BUFFER_POOL.getBuffer(false, bufferSize).array(); buffersToBeReturned.incrementAndGet(); final Future<Void> job = completionService.submit(new Callable<Void>() { @Override public Void call() throws Exception { AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "writeCurrentBufferToService", "append")) { AbfsRestOperation op = client.append(path, offset, bytes, 0, bytesLength); perfInfo.registerResult(op.getResult()); BYTE_BUFFER_POOL.putBuffer(ByteBuffer.wrap(bytes)); buffersToBeReturned.decrementAndGet(); perfInfo.registerSuccess(true); return null; } } }); writeOperations.add(new WriteOperation(job, offset, bytesLength)); shrinkWriteOperationQueue(); }

Target:
private synchronized void writeCurrentBufferToService() throws IOException { if (bufferIndex == 0) { return; } final byte[] byteArray = buffer; final int bytesLength = bufferIndex; buffer = writeBufferPool.get(); bufferIndex = 0; final long offset = position; position += bytesLength; final Future<Void> job = completionService.submit(new Callable<Void>() { @Override public Void call() throws Exception { AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "writeCurrentBufferToService", "append")) { AbfsRestOperation op = client.append(path, offset, byteArray, 0, bytesLength); perfInfo.registerResult(op.getResult()); writeBufferPool.release(byteArray); perfInfo.registerSuccess(true); return null; } } }); writeOperations.add(new WriteOperation(job, offset, bytesLength)); shrinkWriteOperationQueue(); }
Source:
private boolean validateAndCompleteParameters(QuotaConsumptionParametersWrapper parameters) { if (QuotaEnforcementTypeEnum.DISABLED.equals(parameters.getAuditLogable().getStoragePool().getQuotaEnforcementType())) { return true; } boolean hardEnforcement = QuotaEnforcementTypeEnum.HARD_ENFORCEMENT.equals(parameters.getAuditLogable().getStoragePool().getQuotaEnforcementType()); for (QuotaConsumptionParameter param : parameters.getParameters()) { boolean validQuotaId = checkAndFetchQuota(parameters, param); boolean validVdsGroup = true; if (param instanceof QuotaVdsGroupConsumptionParameter) { validVdsGroup = checkVdsGroupMatchQuota(parameters, param); } boolean validStorageDomain = true; if (param instanceof QuotaStorageConsumptionParameter) { validStorageDomain = checkStoragePoolMatchQuota(parameters, param); } if (!validQuotaId || !validVdsGroup || !validStorageDomain) { if (hardEnforcement) { return false; } else { quotaManagerAuditLogger.auditLog(parameters.getAuditLogable(), AuditLogType.MISSING_QUOTA_STORAGE_PARAMETERS_PERMISSIVE_MODE); parameters.getCanDoActionMessages().clear(); return true; } } } return true; }

Target:
private boolean validateAndCompleteParameters(QuotaConsumptionParametersWrapper parameters) { if (QuotaEnforcementTypeEnum.DISABLED == parameters.getAuditLogable().getStoragePool().getQuotaEnforcementType()) { return true; } boolean hardEnforcement = QuotaEnforcementTypeEnum.HARD_ENFORCEMENT == parameters.getAuditLogable().getStoragePool().getQuotaEnforcementType(); for (QuotaConsumptionParameter param : parameters.getParameters()) { boolean validQuotaId = checkAndFetchQuota(parameters, param); boolean validVdsGroup = true; if (param instanceof QuotaVdsGroupConsumptionParameter) { validVdsGroup = checkVdsGroupMatchQuota(parameters, param); } boolean validStorageDomain = true; if (param instanceof QuotaStorageConsumptionParameter) { validStorageDomain = checkStoragePoolMatchQuota(parameters, param); } if (!validQuotaId || !validVdsGroup || !validStorageDomain) { if (hardEnforcement) { return false; } else { quotaManagerAuditLogger.auditLog(parameters.getAuditLogable(), AuditLogType.MISSING_QUOTA_STORAGE_PARAMETERS_PERMISSIVE_MODE); parameters.getCanDoActionMessages().clear(); return true; } } } return true; }
Source:
private Vector3f findSpawnPos(Vector3f targetPos, float entityHeight) { int targetBlockX = TeraMath.floorToInt(targetPos.x); int targetBlockY = TeraMath.floorToInt(targetPos.y); int targetBlockZ = TeraMath.floorToInt(targetPos.z); Vector2i center = new Vector2i(targetBlockX, targetBlockZ); for (BaseVector2i pos : SpiralIterable.clockwise(center).maxRadius(250).scale(2).build()) { Vector3i testPos = new Vector3i(pos.getX(), targetBlockY, pos.getY()); Vector3i spawnPos = findOpenVerticalPosition(testPos, entityHeight); if (spawnPos != null) { return new Vector3f(spawnPos.getX(), spawnPos.getY() + entityHeight, spawnPos.getZ()); } } return targetPos; }

Target:
private Optional<Vector3f> findSpawnPos(Vector3f targetPos, float entityHeight) { int targetBlockX = TeraMath.floorToInt(targetPos.x); int targetBlockY = TeraMath.floorToInt(targetPos.y); int targetBlockZ = TeraMath.floorToInt(targetPos.z); Vector2i center = new Vector2i(targetBlockX, targetBlockZ); for (BaseVector2i pos : SpiralIterable.clockwise(center).maxRadius(32).scale(2).build()) { Vector3i testPos = new Vector3i(pos.getX(), targetBlockY, pos.getY()); Vector3i spawnPos = findOpenVerticalPosition(testPos, entityHeight); if (spawnPos != null) { return Optional.of(new Vector3f(spawnPos.getX(), spawnPos.getY() + entityHeight, spawnPos.getZ())); } } return Optional.empty(); }
Source:
private boolean removeVm() { final List<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskList(), true, false); for (VmNic nic : getInterfaces()) { ExternalNetworkManager externalNetworkManager = new ExternalNetworkManager(nic); externalNetworkManager.deallocateIfExternal(); } TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { removeVmFromDb(); if (getParameters().isRemoveDisks()) { for (DiskImage image : diskImages) { getCompensationContext().snapshotEntityStatus(image.getImage(), ImageStatus.ILLEGAL); ImagesHandler.updateImageStatus(image.getImage().getId(), ImageStatus.LOCKED); } getCompensationContext().stateChanged(); } else { for (DiskImage image : diskImages) { getImageDao().updateImageVmSnapshotId(image.getImageId(), null); } } return null; } }); if (getParameters().isRemoveDisks() && !diskImages.isEmpty()) { Collection<DiskImage> unremovedDisks = (Collection<DiskImage>)removeVmImages(diskImages).getActionReturnValue(); if (!unremovedDisks.isEmpty()) { processUnremovedDisks(unremovedDisks); return false; } } new MemoryImageRemoverOnDataDomain(getVm(), this).remove(memoryStates); return true; }

Target:
private boolean removeVm() { final List<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskList(), true, false); for (VmNic nic : getInterfaces()) { new ExternalNetworkManager(nic).deallocateIfExternal(); } TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { removeVmFromDb(); if (getParameters().isRemoveDisks()) { for (DiskImage image : diskImages) { getCompensationContext().snapshotEntityStatus(image.getImage(), ImageStatus.ILLEGAL); ImagesHandler.updateImageStatus(image.getImage().getId(), ImageStatus.LOCKED); } getCompensationContext().stateChanged(); } else { for (DiskImage image : diskImages) { getImageDao().updateImageVmSnapshotId(image.getImageId(), null); } } return null; } }); if (getParameters().isRemoveDisks() && !diskImages.isEmpty()) { Collection<DiskImage> unremovedDisks = (Collection<DiskImage>)removeVmImages(diskImages).getActionReturnValue(); if (!unremovedDisks.isEmpty()) { processUnremovedDisks(unremovedDisks); return false; } } new MemoryImageRemoverOnDataDomain(getVm(), this).remove(memoryStates); return true; }
Source:
public String apply(@Nullable Object value) { if (Objects.isNull(value)) { return null; } if (value instanceof Number) { return bucket(((Number) value).doubleValue()); } else if (value instanceof String) { return apply((String) value); } return null; }

Target:
public String apply(@Nullable Object value) { if (value == null) { return null; } if (value instanceof Number) { return bucket(((Number) value).doubleValue()); } else if (value instanceof String) { return apply((String) value); } return null; }
Source:
public void testCSRFTokenHelper() { RequestLookup requestLookup = createRequestLookup(); when(requestLookup.getRequest().getCookieValue(COOKIE_CSRFTOKEN)).thenReturn("A45B3DDE4CF00891E7A9F3B752F18F92"); String output = createRenderable("{{csrfToken}}").render(null, createLookup(), requestLookup, createAPI()); String expected = "<input type=\"hidden\" name=\"csrftoken\" id=\"csrftoken\" " + "value=\"A45B3DDE4CF00891E7A9F3B752F18F92\"/>"; Assert.assertEquals(output, expected); String formoutput = createRenderable("<form>{{csrfToken}}</form>").render(null, createLookup(), requestLookup, createAPI()); Assert.assertEquals(formoutput, "<form>" + expected + "</form>"); }

Target:
public void testCSRFTokenHelper() { RequestLookup requestLookup = createRequestLookup(); when(requestLookup.getRequest().getCookieValue(COOKIE_CSRFTOKEN)).thenReturn("A45B3DDE4CF00891E7A9F3B752F18F92"); String output = createRenderable("{{csrfToken}}").render(null, createLookup(), requestLookup, createAPI()); String expected = "<input type=\"hidden\" name=\"uuf-csrftoken\" " + "value=\"A45B3DDE4CF00891E7A9F3B752F18F92\"/>"; Assert.assertEquals(output, expected); }
Source:
public boolean deleteForOwner(Owner owner) { String deleteForOwner = "delete from UeberCertificate uc where uc.owner = :owner"; Query query = getEntityManager().createQuery(deleteForOwner); query.setParameter("owner", owner); return query.executeUpdate() > 0 ? true : false; }

Target:
public boolean deleteForOwner(Owner owner) { String deleteForOwner = "delete from UeberCertificate uc where uc.owner = :owner"; Query query = getEntityManager().createQuery(deleteForOwner); query.setParameter("owner", owner); return query.executeUpdate() > 0; }
Source:
public void setPromptClock(boolean showPromptClock) { this.showPromptClock = showPromptClock; }

Target:
public static void setPromptClock(boolean showPromptClock) { utilMain.showPromptClock = showPromptClock; }
Source:
private void assertNumberOfCars(int expectedCount, String carMake) { long hitCount = Search.getSearchManager(cache).search(Car.class) .where(f -> f.match().field("make").matching(carMake)) .fetchTotalHitCount(); assertEquals("Expected count not met on cache " + cache, expectedCount, hitCount); String ickle = String.format("FROM %s where make:'%s'", Car.class.getName(), carMake); CacheQuery<Car> cacheQuery = Search.getSearchManager(cache).getQuery(ickle); assertThat(cacheQuery.getResultSize()).isEqualTo(expectedCount); Query query = Search.getQueryFactory(cache).create(ickle); assertEquals("Expected count not met on cache " + cache, expectedCount, query.getResultSize()); }

Target:
private void assertNumberOfCars(int expectedCount, String carMake) { for (Cache<?, ?> cache : caches) { QueryFactory queryFactory = Search.getQueryFactory(cache); Query<Car> query = queryFactory.create(String.format("FROM %s where make:'%s'", Car.class.getName(), carMake)); QueryResult<Car> queryResult = query.execute(); assertEquals("Expected count not met on cache " + cache, expectedCount, queryResult.hitCount().orElse(-1)); assertEquals("Expected count not met on cache " + cache, expectedCount, queryResult.list().size()); } }
Source:
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException{ if (arguments.length != 1) throw new UDFArgumentLengthException( "Arguments array has more than 1 element"); for (int i = 0; i < arguments.length; i++) { if (arguments[i].getCategory() != Category.PRIMITIVE) { throw new UDFArgumentTypeException(i, "A string argument was expected but an argument of type " + arguments[i].getTypeName() + " was given."); } PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) arguments[i]) .getPrimitiveCategory(); if (primitiveCategory != PrimitiveCategory.STRING && primitiveCategory != PrimitiveCategory.VOID) { throw new UDFArgumentTypeException(i, "A string argument was expected but an argument of type " + arguments[i].getTypeName() + " was given."); } } try { cachingParser = new CachingParser(); } catch (IOException e) { LOG.error(e.getMessage(),e); throw new RuntimeException("We could not instantiate CachingParser"); } argumentOIs = arguments; return ObjectInspectorFactory.getStandardMapObjectInspector( PrimitiveObjectInspectorFactory.javaStringObjectInspector, PrimitiveObjectInspectorFactory.javaStringObjectInspector); }

Target:
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { if (arguments.length != 1) { throw new UDFArgumentLengthException( "The UAParserUDF takes an array with only 1 element as argument"); } ObjectInspector arg = arguments[0]; int argIndex = 0; if (arg.getCategory() != Category.PRIMITIVE) { throw new UDFArgumentTypeException(argIndex, "A string argument was expected but an argument of type " + arg.getTypeName() + " was given."); } PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) arg) .getPrimitiveCategory(); if (primitiveCategory != PrimitiveCategory.STRING) { throw new UDFArgumentTypeException(argIndex, "A string argument was expected but an argument of type " + arg.getTypeName() + " was given."); } try { cachingParser = new CachingParser(); } catch (IOException e) { Log.error(e.getMessage(), e); throw new RuntimeException("We could not instantiate CachingParser"); } argumentOI = arg; return ObjectInspectorFactory.getStandardMapObjectInspector( PrimitiveObjectInspectorFactory.javaStringObjectInspector, PrimitiveObjectInspectorFactory.javaStringObjectInspector); }
Source:
public void copyObject(String bucketName, String objectName, String objectSource, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException { if (copyConditions == null) { throw new InvalidArgumentException("Copy conditions should be a non null value"); } if (objectSource == null) { throw new InvalidArgumentException("Invalid object source"); } String sourceBucketName = getBucketNameFromPath(objectSource); String sourceObjectName = getObjectNameFromPath(objectSource); ObjectStat objectStat = statObject(sourceBucketName, sourceObjectName); String etag = objectStat.etag(); Date lastModified = objectStat.createdTime(); long length = objectStat.length(); if (copyConditions.isUnmodifiedSince(lastModified) && copyConditions.isModifiedAfter(lastModified) && copyConditions.etagMatches(etag) && copyConditions.etagDoesNotMatch(etag)) { InputStream objectByteStream = getObject(sourceBucketName, sourceObjectName); putObject(bucketName, objectName, objectByteStream, length, "application/octet-stream"); objectByteStream.close(); } }

Target:
public CopyObjectResult copyObject(String bucketName, String objectName, String objectSource, CopyConditions copyConditions) throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException, InvalidArgumentException { Map<String, String> headerMap = new HashMap<>(); if (objectSource == null) { throw new InvalidArgumentException("Invalid object source"); } headerMap.put("x-amz-copy-source", objectSource); if (copyConditions != null) { headerMap.putAll(copyConditions.getCopyConditions()); } HttpResponse response = execute(Method.PUT, US_EAST_1, bucketName, objectName, headerMap, null, null, "", 0); CopyObjectResult result = new CopyObjectResult(); result.parseXml(response.body().charStream()); response.body().close(); return result; }
Source:
private Result waitForCompletion() throws InterruptedException, IOException { Result result; while((result = checkForCompletion()) != null) { Thread.sleep(1000); } return result; }

Target:
private Result waitForCompletion() throws InterruptedException, IOException { Result result; while((result = checkForCompletion()) == null) { Thread.sleep(1000); } return result; }
Source:
protected JobGraph getJobGraph() throws Exception { String[] parameters = new String[] { "1", "1", pagesWithRankPath, edgesPath, resultPath, "<none>", "5", "25", "25", "30", "5", "1", "0", "100", "0" }; return CustomCompensatableDanglingPageRank.getJobGraph(parameters); }

Target:
protected JobGraph getJobGraph() throws Exception { String[] parameters = new String[] { "4", "4", pagesWithRankPath, edgesPath, resultPath, "<none>", "5", "25", "25", "30", "5", "1", "0", "100", "0" }; return CustomCompensatableDanglingPageRank.getJobGraph(parameters); }
Source:
public void shouldCreateSubscription() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(Subscription.URI_TEMPLATE.expand(project.getId(), account.getId()).toString()) .havingBody(jsonEquals(readStringFromResource("/notification/subscriptionToCreate.json"))) .respond() .withStatus(201) .withBody(readFromResource("/notification/subscription.json")); final Subscription subscription = gd.getNotificationService().createSubscription(project, account, new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), new Condition("true"), new Template("test message"), Arrays.asList("/gdc/account/profile/876ec68f5630b38de65852ed5d6236ff/channelConfigurations/59dca8f160b2c601f3c72e1b"), new Meta("test subscription"))); assertThat(subscription, is(notNullValue())); }

Target:
public void shouldCreateSubscription() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(Subscription.URI_TEMPLATE.expand(project.getId(), account.getId()).toString()) .havingBody(jsonEquals(readStringFromResource("/notification/subscriptionToCreate.json"))) .respond() .withStatus(201) .withBody(readFromResource("/notification/subscription.json")); final Subscription subscription = gd.getNotificationService().createSubscription(project, account, new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), singletonList(channel), new TriggerCondition("true"), new MessageTemplate("test message"), "test subscription")); assertThat(subscription, is(notNullValue())); }
Source:
private static void addCaseFileVariableToResult(Collection<Pair<Object, String>> result, String element) { if (element.length() > 0) { List<String> list = Arrays.asList(element.split(",")); list.forEach(s1 -> { String value = CaseFileVariables.CASE_FILE_PREFIX + s1.split(":")[0]; result.add(new Pair<>(value, value)); }); } }

Target:
private void addCaseFileVariableToResult(Collection<Pair<Object, String>> result, String element) { if (element.length() > 0) { List<String> list = Arrays.asList(element.split(",")); list.forEach(s1 -> { String value = CaseFileVariables.CASE_FILE_PREFIX + s1.split(":")[0]; result.add(new Pair<>(value, value)); }); } }
Source:
public void createBlob(String key, InputStream in, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException, IOException { AtomicOutputStream out = null; try { out = createBlob(key, meta, who); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } } finally { try { if (out != null) { out.cancel(); } in.close(); } catch (IOException throwaway) { } } }

Target:
public void createBlob(String key, InputStream in, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException, IOException { AtomicOutputStream out = null; try { out = createBlob(key, meta, who); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } out.close(); out = null; } finally { try { if (out != null) { out.cancel(); } in.close(); } catch (IOException throwaway) { } } }
Source:
public void onPrepared(final boolean playWhenReady) { if (DEBUG) Log.d(TAG, "onPrepared() called with: playWhenReady = [" + playWhenReady + "]"); if (playWhenReady) audioReactor.requestAudioFocus(); if (isPlaybackResumeEnabled() && currentMetadata != null) { final Disposable d = recordManager.loadStreamState(currentMetadata.getMetadata()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( state -> { if (state.getProgressTime() > PLAYBACK_SAVE_THRESHOLD_START_MILLIS && state.getProgressTime() < simpleExoPlayer.getDuration() - PLAYBACK_SAVE_THRESHOLD_END_MILLIS) { seekTo(state.getProgressTime()); onPositionRestored(state.getProgressTime()); } changeState(playWhenReady ? STATE_PLAYING : STATE_PAUSED); }, error -> { Log.e(TAG, "Player resume failure: ", error); changeState(playWhenReady ? STATE_PLAYING : STATE_PAUSED); }, () -> changeState(playWhenReady ? STATE_PLAYING : STATE_PAUSED) ); databaseUpdateReactor.add(d); } else { changeState(playWhenReady ? STATE_PLAYING : STATE_PAUSED); } }

Target:
public void onPrepared(final boolean playWhenReady) { if (DEBUG) Log.d(TAG, "onPrepared() called with: playWhenReady = [" + playWhenReady + "]"); if (playWhenReady) audioReactor.requestAudioFocus(); changeState(playWhenReady ? STATE_PLAYING : STATE_PAUSED); }
Source:
private String createLuaXmlRequestMessage(final FBType fbType) { ForteLuaExportFilter luaFilter = new ForteLuaExportFilter(); String luaSkript = luaFilter.createLUA(fbType); String escapedLuaSkript = escapeXmlCharacters(luaSkript); return MessageFormat.format(CREATE_FB_TYPE, getNextId(), fbType.getName(), escapedLuaSkript); }

Target:
private String createLuaXmlRequestMessage(final FBType fbType) { ForteLuaExportFilter luaFilter = new ForteLuaExportFilter(); String escapedLuaScript = escapeXmlCharacters(luaFilter.createLUA(fbType)); return MessageFormat.format(CREATE_FB_TYPE, getNextId(), fbType.getName(), escapedLuaScript); }
Source:
public CachedNode getNode( NodeKey key ) { checkNotClosed(); CachedNode node = nodesByKey.get(key); if (node == null) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Node '{0}' is not found in the '{1}' workspace cache; looking in store", key, workspaceName); } Document doc = documentFor(key); if (doc != null) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Materialized document '{0}' in '{1}' workspace from store: {2}", key, workspaceName, doc); } CachedNode newNode = new LazyCachedNode(key, doc); Integer cacheTtlSeconds = translator().getCacheTtlSeconds(doc); if (nodesByKey instanceof BasicCache && cacheTtlSeconds != null) { node = ((BasicCache<NodeKey, CachedNode>)nodesByKey).putIfAbsent(key, newNode, cacheTtlSeconds.longValue(), TimeUnit.SECONDS); } else if (nodesByKey instanceof CacheSupport && cacheTtlSeconds != null) { node = ((CacheSupport<NodeKey, CachedNode>)nodesByKey).putIfAbsent(key, newNode, cacheTtlSeconds.longValue(), TimeUnit.SECONDS); } else { try { node = nodesByKey.putIfAbsent(key, newNode); } catch (TimeoutException e) { node = null; } } if (node == null) node = newNode; } } return node; }

Target:
public CachedNode getNode( NodeKey key ) { checkNotClosed(); CachedNode node = nodesByKey.get(key); if (node == null) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Node '{0}' is not found in the '{1}' workspace cache; looking in store", key, workspaceName); } Document doc = documentFor(key); if (doc != null) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Materialized document '{0}' in '{1}' workspace from store: {2}", key, workspaceName, doc); } CachedNode newNode = new LazyCachedNode(key, doc); try { Integer cacheTtlSeconds = translator().getCacheTtlSeconds(doc); if (cacheTtlSeconds != null && nodesByKey instanceof BasicCache) { node = ((BasicCache<NodeKey, CachedNode>)nodesByKey).putIfAbsent(key, newNode, cacheTtlSeconds.longValue(), TimeUnit.SECONDS); } else { node = nodesByKey.putIfAbsent(key, newNode); } } catch (TimeoutException e) { node = null; } if (node == null) { node = newNode; } } } return node; }
Source:
public static ColorDescriptor getErrorColorDescriptorFromCurrentTheme() { ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); System.out.println(theme.getColorRegistry().getKeySet()); return Preconditions.checkNotNull(theme.getColorRegistry().getColorDescriptor(ERROR_COLOR)); }

Target:
public static ColorDescriptor getErrorColorDescriptorFromCurrentTheme() { ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); return Preconditions.checkNotNull(theme.getColorRegistry().getColorDescriptor(ERROR_COLOR)); }
Source:
public String format(String value) { Objects.requireNonNull(value); if (value.isEmpty()) { return value; } String cleanValue = value.replace("pp.", "").replace("p.", ""); cleanValue = EM_EN_DASH_PATTERN.matcher(cleanValue).replaceAll("-"); cleanValue = REJECT_LITERALS_PATTERN.matcher(cleanValue).replaceAll(""); Matcher matcher = PAGES_DETECT_PATTERN.matcher(cleanValue); if (matcher.matches()) { if (Strings.isNullOrEmpty(matcher.group("endpage"))) { return matcher.replaceFirst(SINGLE_PAGE_REPLACE_PATTERN); } else { return matcher.replaceFirst(PAGES_REPLACE_PATTERN); } } return cleanValue; }

Target:
public String format(String value) { Objects.requireNonNull(value); if (value.isEmpty()) { return value; } value = value.trim(); value = value.replace("pp.", "").replace("p.", "").trim(); value = EM_EN_DASH_PATTERN.matcher(value).replaceAll("--"); Matcher matcher = DASHES_DETECT_PATTERN.matcher(value); if (matcher.find() && matcher.start() >= 0) { String fixedValue = matcher.replaceFirst("--"); if (matcher.find()) { return value; } return unprotectTermsFormatter.format(fixedValue); } return value; }
Source:
public synchronized void updateResourcePools(ResourcePools pools){ TreeSet<ResourceType> resourceTypes = new TreeSet<ResourceType>(); Collections.addAll(resourceTypes, ResourceType.Core.values()); Iterator<ResourceType> resourceTypeIterator = resourceTypes.descendingIterator(); while (resourceTypeIterator.hasNext()) { ResourceType currentResourceType = resourceTypeIterator.next(); if (config.getResourcePools().getPoolForResource(currentResourceType) != null && pools.getPoolForResource(currentResourceType) != null && config.getResourcePools().getPoolForResource(currentResourceType).getType() == pools.getPoolForResource(currentResourceType).getType()) { Long oldValue = config.getResourcePools() .getPoolForResource(currentResourceType) .getSize(); Long newValue = pools.getPoolForResource(currentResourceType).getSize(); fireCacheConfigurationChange(CacheConfigurationProperties.UPDATESIZE, oldValue, newValue); } } }

Target:
public synchronized void updateResourcePools(ResourcePools pools) { if(pools == null) { throw new NullPointerException("Pools to be updated cannot be null"); } ResourcePoolMerger poolMerger = new ResourcePoolMerger(); ResourcePools updatedResourcePools = poolMerger.validateAndMerge(config.getResourcePools(), pools); fireCacheConfigurationChange(CacheConfigurationProperty.UPDATESIZE, config.getResourcePools(), updatedResourcePools); this.resourcePools = updatedResourcePools; }
Source:
public final This addCleanable(Cleanable cleanable) { getContext().addCleanable(cleanable); return (This) this; }

Target:
This addCleanable(Cleanable cleanable) { getContext().addCleanable(cleanable); return typedThis; }
Source:
public synchronized T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { Args.notNull(unit, "Time unit"); final long msecs = unit.toMillis(timeout); final long startTime = (msecs <= 0) ? 0 : System.currentTimeMillis(); long waitTime = msecs; if (this.completed) { return getResult(); } else if (waitTime <= 0) { throw TimeoutValueException.ofMillis(msecs, msecs + Math.abs(waitTime)); } else { for (;;) { wait(waitTime); if (this.completed) { return getResult(); } waitTime = msecs - (System.currentTimeMillis() - startTime); if (waitTime <= 0) { throw TimeoutValueException.ofMillis(msecs, msecs + Math.abs(waitTime)); } } } }

Target:
public synchronized T get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { Args.notNull(unit, "Time unit"); final long msecs = unit.toMillis(timeout); final long startTime = (msecs <= 0) ? 0 : System.currentTimeMillis(); long waitTime = msecs; if (this.completed) { return getResult(); } else if (waitTime <= 0) { throw TimeoutValueException.fromMillis(msecs, msecs + Math.abs(waitTime)); } else { for (;;) { wait(waitTime); if (this.completed) { return getResult(); } waitTime = msecs - (System.currentTimeMillis() - startTime); if (waitTime <= 0) { throw TimeoutValueException.fromMillis(msecs, msecs + Math.abs(waitTime)); } } } }
Source:
protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select p.kee, p.organization_uuid, p.kee, p.parent_kee from rules_profiles p "); massUpdate.update("insert into qprofiles" + " (uuid, organization_uuid, rules_profile_uuid, parent_uuid, created_at, updated_at) values (?, ?, ?, ?, ?, ?)"); massUpdate.rowPluralName("qprofiles"); massUpdate.execute((row, update) -> { if (existQProfile(context, row.getString(1), row.getString(2))) { return false; } update.setString(1, row.getString(1)); update.setString(2, row.getString(2)); update.setString(3, row.getString(3)); update.setString(4, row.getString(4)); update.setLong(5, now); update.setLong(6, now); return true; }); }

Target:
protected void execute(Context context) throws SQLException { long now = system2.now(); MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select p.kee, p.organization_uuid, p.parent_kee from rules_profiles p " + "where not exists ( select qp.uuid from qprofiles qp where qp.uuid = p.kee and qp.organization_uuid = p.organization_uuid )"); massUpdate.update("insert into qprofiles" + " (uuid, organization_uuid, rules_profile_uuid, parent_uuid, created_at, updated_at) values (?, ?, ?, ?, ?, ?)"); massUpdate.rowPluralName("qprofiles"); massUpdate.execute((row, update) -> { update.setString(1, row.getString(1)); update.setString(2, row.getString(2)); update.setString(3, row.getString(1)); update.setString(4, row.getString(3)); update.setLong(5, now); update.setLong(6, now); return true; }); }
Source:
public ValidationBean checkConnection(final SubprocessExecutionContext execCtx) { throw new UnprocessableEntityException(String.format("'checkConnection' cannot be performed on material of type %s", type)); }

Target:
public ValidationBean checkConnection(final SubprocessExecutionContext execCtx) { throw new UnsupportedOperationException(String.format("'checkConnection' cannot be performed on material of type %s", type)); }
Source:
private Brand mergeBrand(Brand current, Brand extracted) { current.setCanonicalUri(extracted.getCanonicalUri()); current.setPublisher(extracted.getPublisher()); current.setCurie(extracted.getCurie()); current.setTitle(extracted.getTitle()); current.setDescription(extracted.getDescription()); current.setGenres(extracted.getGenres()); current.setImage(extracted.getImage()); current.setImages(extracted.getImages()); current.setMediaType(extracted.getMediaType()); current.setSpecialization(extracted.getSpecialization()); return current; }

Target:
private Brand mergeBrand(Brand current, Brand extracted) { current.setCurie(extracted.getCurie()); current.setTitle(extracted.getTitle()); current.setDescription(extracted.getDescription()); current.setGenres(extracted.getGenres()); current.setImage(extracted.getImage()); current.setImages(extracted.getImages()); current.setMediaType(extracted.getMediaType()); current.setSpecialization(extracted.getSpecialization()); return current; }
Source:
public void layoutGalleryDescription() { GalleryItem item = getCurrentItem(); if (item == null) { infoContainer.setVisibility(View.GONE); return; } CharSequence descriptionStr = ""; if (item.getMetadata().containsKey("ImageDescription")) { descriptionStr = Html .fromHtml(item.getMetadata().get("ImageDescription")); } else if (item.getMetadata().containsKey("ObjectName")) { descriptionStr = Html .fromHtml(item.getMetadata().get("ObjectName")); } if (descriptionStr.length() > 0) { descriptionText.setText(Utils.trim(descriptionStr)); descriptionText.setVisibility(View.VISIBLE); } else { descriptionText.setVisibility(View.GONE); } if (item.isLicenseFree()) { if (item.isLicensePD()) { licenseIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_license_pd)); } else if (item.isLicenseCC()) { licenseIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_license_cc)); } else { licenseIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_license_cite)); } } else { licenseIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_license_cite)); } licenseIcon.setTag(item.getLicenseUrl()); String creditStr = ""; if (item.getMetadata().containsKey("Artist")) { creditStr = Html.fromHtml(item.getMetadata().get("Artist")).toString(); } else if (item.getMetadata().containsKey("LicenseShortName")) { creditStr = item.getMetadata().get("LicenseShortName"); } else if (item.getMetadata().containsKey("UsageTerms")) { creditStr = item.getMetadata().get("UsageTerms"); } creditText.setText(creditStr.trim()); infoContainer.setVisibility(View.VISIBLE); }

Target:
public void layoutGalleryDescription() { GalleryItem item = getCurrentItem(); if (item == null) { infoContainer.setVisibility(View.GONE); return; } CharSequence descriptionStr = ""; if (item.getMetadata().containsKey("ImageDescription")) { descriptionStr = Html .fromHtml(item.getMetadata().get("ImageDescription")); } else if (item.getMetadata().containsKey("ObjectName")) { descriptionStr = Html .fromHtml(item.getMetadata().get("ObjectName")); } if (descriptionStr.length() > 0) { descriptionText.setText(Utils.trim(descriptionStr)); descriptionText.setVisibility(View.VISIBLE); } else { descriptionText.setVisibility(View.GONE); } licenseIcon.setImageDrawable(getResources().getDrawable(getLicenseIcon(item))); licenseIcon.setContentDescription(item.getMetadata().get("UsageTerms")); licenseIcon.setTag(item.getLicenseUrl()); String creditStr = ""; if (item.getMetadata().containsKey("Artist")) { creditStr = Html.fromHtml(item.getMetadata().get("Artist")).toString(); } else if (item.getMetadata().containsKey("LicenseShortName")) { creditStr = item.getMetadata().get("LicenseShortName"); } else if (item.getMetadata().containsKey("UsageTerms")) { creditStr = item.getMetadata().get("UsageTerms"); } creditText.setText(creditStr.trim()); infoContainer.setVisibility(View.VISIBLE); }
Source:
public void getResourcesByCoreAttributeValue() throws Exception { System.out.println(CLASS_NAME + "getResourcesByCoreAttributeValue"); Facility facility = setUpFacility("testFacility"); Resource resource1 = setUpResource("testResource01", vo, facility); Resource resource2 = setUpResource("testResource02", vo, facility); Resource resource3 = setUpResource("testResource03", vo, facility); Map<String, String> searchParams = new HashMap<>(); searchParams.put(AttributesManager.NS_RESOURCE_ATTR_CORE + ":name", resource1.getName()); List<Resource> foundResources = searcherBl.getResources(sess, searchParams, false); assertEquals("Found resource number of resources", 1, foundResources.size()); assertTrue("Found resources did not contain resource it should.", foundResources.contains(resource1)); searchParams.put(AttributesManager.NS_RESOURCE_ATTR_CORE + ":name", "testResource"); foundResources = searcherBl.getResources(sess, searchParams, true); assertEquals("Found resource number of resources", 3, foundResources.size()); assertTrue("Found resources did not contain resource it should.", foundResources.contains(resource1)); assertTrue("Found resources did not contain resource it should.", foundResources.contains(resource2)); assertTrue("Found resources did not contain resource it should.", foundResources.contains(resource3)); }

Target:
public void getResourcesByCoreAttributeValue() throws Exception { System.out.println(CLASS_NAME + "getResourcesByCoreAttributeValue"); Facility facility = setUpFacility("testFacility"); Resource resource1 = setUpResource("testResource01", vo, facility); Resource resource2 = setUpResource("testResource02", vo, facility); Resource resource3 = setUpResource("testResource03", vo, facility); Map<String, String> searchParams = new HashMap<>(); searchParams.put(AttributesManager.NS_RESOURCE_ATTR_CORE + ":name", resource1.getName()); List<Resource> foundResources = searcherBl.getResources(sess, searchParams, false); assertThat(foundResources).containsOnlyOnce(resource1); searchParams.put(AttributesManager.NS_RESOURCE_ATTR_CORE + ":name", "testResource"); foundResources = searcherBl.getResources(sess, searchParams, true); assertThat(foundResources).containsOnlyOnce(resource1, resource2, resource3); }
Source:
public void should_have_the_same_methods_as_in_bdd_assertions() { Class<Assertions> classA = Assertions.class; String methodA = "assertThat"; Class<BDDAssertions> classB = BDDAssertions.class; String methodB = "then"; List<Method> assertThatMethods = findMethodsWithName(classA, methodA); List<Method> thenMethods = findMethodsWithName(classB, methodB); Comparator<Method> methodComparator = ignoringDeclaringClassAndMethodName(); Assertions.assertThat(assertThatMethods).usingElementComparator(methodComparator) .containsExactlyInAnyOrder(thenMethods.toArray(new Method[thenMethods.size()])); }

Target:
public void should_have_the_same_methods_as_in_bdd_assertions() { Method[] assertThatMethods = findMethodsWithName(Assertions.class, "assertThat"); Method[] thenMethods = findMethodsWithName(BDDAssertions.class, "then"); Comparator<Method> methodComparator = ignoringDeclaringClassAndMethodName(); assertThat(assertThatMethods).usingElementComparator(methodComparator).containsExactlyInAnyOrder(thenMethods); }
Source:
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) request; if (HttpMethod.OPTIONS.equals(httpReq.getMethod())) { if (allowUnauthenticatedHttpOptions) { httpReq.setAttribute( AuthConfig.DRUID_AUTHENTICATION_RESULT, new AuthenticationResult(AuthConfig.ALLOW_ALL_NAME, AuthConfig.ALLOW_ALL_NAME, null) ); } httpReq.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true); } chain.doFilter(request, response); }

Target:
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) request; if (HttpMethod.OPTIONS.equals(httpReq.getMethod())) { if (httpReq.getAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT) == null) { if (allowUnauthenticatedHttpOptions) { httpReq.setAttribute( AuthConfig.DRUID_AUTHENTICATION_RESULT, new AuthenticationResult(AuthConfig.ALLOW_ALL_NAME, AuthConfig.ALLOW_ALL_NAME, null) ); } else { ((HttpServletResponse) response).sendError(HttpServletResponse.SC_UNAUTHORIZED); } } httpReq.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true); } chain.doFilter(request, response); }
Source:
public void testJacocoWorkaround() throws Exception { mockStatic(System.class); Main.main(); verifyStatic(System.class, times(1)); System.exit(-1); }

Target:
public void testJacocoWorkaround() throws Exception { final String expected = "Files to process must be specified, found 0." + System.lineSeparator(); mockStatic(System.class); Main.main(); assertEquals("Unexpected output log", expected, systemOut.getLog()); assertEquals("Unexpected system error log", "", systemErr.getLog()); }
Source:
public int hashCode() { int result = Objects.hashCode(id); return result; }

Target:
public int hashCode() { return Objects.hashCode(id); }
Source:
private void refreshDiagram(final Session session, final DDiagram diagram) { final TransactionalEditingDomain editingDomain = session.getTransactionalEditingDomain(); RefreshSiriusElement cmd = new RefreshSiriusElement(editingDomain, diagram); editingDomain.getCommandStack().execute(cmd); }

Target:
private void refreshDiagram(final Session session, final DDiagram diagram) { final TransactionalEditingDomain editingDomain = session.getTransactionalEditingDomain(); editingDomain.getCommandStack().execute(new RefreshRepresentationsCommand(editingDomain, new NullProgressMonitor(), diagram)); }
Source:
protected void verifyUserAuthorization(String userId) { authRule.disableAuthorization(); if (AUTHORIZATION_TYP_RUNTIME.equals(authorizationType)) { System.out.println("RUNTIME!"); Authorization runtimeUserAuthorization = authorizationService.createAuthorizationQuery() .resourceType(TASK) .userIdIn(userId) .singleResult(); assertNotNull(runtimeUserAuthorization); verifyReadVariablePermission(runtimeUserAuthorization, TaskPermissions.READ_VARIABLE); } else if (AUTHORIZATION_TYP_HISTORIC.equals(authorizationType)) { System.out.println("HISTORY!"); Authorization historyUserAuthorization = authorizationService.createAuthorizationQuery() .resourceType(HISTORIC_TASK) .userIdIn(userId) .singleResult(); assertNotNull(historyUserAuthorization); verifyReadVariablePermission(historyUserAuthorization, HistoricTaskPermissions.READ_VARIABLE); } else { throw new RuntimeException("auth type not found"); } }

Target:
protected void verifyUserAuthorization(String userId) { authRule.disableAuthorization(); if (AUTHORIZATION_TYP_RUNTIME.equals(authorizationType)) { Authorization runtimeUserAuthorization = authorizationService.createAuthorizationQuery() .resourceType(TASK) .userIdIn(userId) .singleResult(); assertNotNull(runtimeUserAuthorization); verifyReadVariablePermission(runtimeUserAuthorization, TaskPermissions.READ_VARIABLE); } else if (AUTHORIZATION_TYP_HISTORIC.equals(authorizationType)) { Authorization historyUserAuthorization = authorizationService.createAuthorizationQuery() .resourceType(HISTORIC_TASK) .userIdIn(userId) .singleResult(); assertNotNull(historyUserAuthorization); verifyReadVariablePermission(historyUserAuthorization, HistoricTaskPermissions.READ_VARIABLE); } else { throw new RuntimeException("auth type not found"); } }
Source:
public RuntimeConfigBuilder defaults(Version version) { String directoryName = String.format("mysql-%s-%s", version.getMajorVersion(), UUID.randomUUID().toString()); defaults().artifactStore().setDefault(artifactStoreBuilderFor(directoryName)); return this; }

Target:
public RuntimeConfigBuilder defaults(Version version) { String directoryName = String.format("mysql-%s-%s", version.getMajorVersion(), UUID.randomUUID()); defaults().artifactStore().setDefault(artifactStoreBuilderFor(directoryName)); return this; }
Source:
public static void main(final String[] args) { final QlessJavaWorker worker = new QlessJavaWorker(); final CmdLineParser parser = new CmdLineParser(worker); try { parser.parseArgument(args); } catch (final CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); } try { final JedisPool jedisPool = new JedisPool(worker.host); final Client client = new Client(jedisPool); final SerialWorker serialWorker = new SerialWorker( Arrays.asList(worker.queues), client, worker.name, worker.inverval); serialWorker.run(); } catch (InterruptedException | IOException e) { System.err.println(e.getMessage()); } }

Target:
public static void main(final String[] args) { final QlessJavaWorker worker = new QlessJavaWorker(); final CmdLineParser parser = new CmdLineParser(worker); try { parser.parseArgument(args); } catch (final CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); } try { final JedisPool jedisPool = new JedisPool(worker.host); final Client client = new Client(jedisPool); final SerialWorker serialWorker = new SerialWorker( Arrays.asList(worker.queues), client, worker.name, worker.inverval); serialWorker.run(); } catch (InterruptedException | IOException e) { e.printStackTrace(); } }
Source:
private void printMemberTree(final PrintWriter stdout, final GroupMembersList groupMembers) { printMember(stdout, groupMembers, 0, true, new HashSet<AccountGroup.Id>()); }

Target:
private void printMemberTree(final PrintWriter stdout, final GroupMembersList groupMembers) { final TreeFormatter treeFormatter = new TreeFormatter(stdout); treeFormatter.printTree(accountGroupNodeFactory.create(groupMembers)); }
Source:
public void testSimpleKafka() throws Exception{ final StreamDataProvider<JSONObject> dataProvider = simpleKafkaGateway.buildDataProvider((DataSourceFilter)null, String.valueOf("0"), null, null); BaseGatewayTestUtil.doTest(dataProvider); }

Target:
public void testSimpleKafka() throws Exception{ final StreamDataProvider<JSONObject> dataProvider = simpleKafkaGateway.buildDataProvider((DataSourceFilter)null, "0", null, null); BaseGatewayTestUtil.doTest(dataProvider); }