auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ResourceGroupStateInfo( @JsonProperty("id") ResourceGroupId id, @JsonProperty("state") ResourceGroupState state, @JsonProperty("softMemoryLimit") DataSize softMemoryLimit, @JsonProperty("memoryUsage") DataSize memoryUsage, @JsonProperty("maxRunningQueries") int maxRunningQueries, @JsonProperty("maxQueuedQueries") int maxQueuedQueries, @JsonProperty("runningTimeLimit") Duration runningTimeLimit, @JsonProperty("queuedTimeLimit") Duration queuedTimeLimit, @JsonProperty("runningQueries") List<QueryStateInfo> runningQueries, @JsonProperty("numQueuedQueries") int numQueuedQueries) { this.id = requireNonNull(id, "id is null"); this.state = requireNonNull(state, "state is null"); this.softMemoryLimit = requireNonNull(softMemoryLimit, "softMemoryLimit is null"); this.memoryUsage = requireNonNull(memoryUsage, "memoryUsage is null"); this.maxRunningQueries = maxRunningQueries; this.maxQueuedQueries = maxQueuedQueries; this.runningTimeLimit = runningTimeLimit; this.queuedTimeLimit = queuedTimeLimit; this.runningQueries = ImmutableList.copyOf(requireNonNull(runningQueries, "runningQueries is null")); this.numQueuedQueries = numQueuedQueries; }

Target:
public ResourceGroupStateInfo( @JsonProperty("id") ResourceGroupId id, @JsonProperty("state") ResourceGroupState state, @JsonProperty("softMemoryLimit") DataSize softMemoryLimit, @JsonProperty("memoryUsage") DataSize memoryUsage, @JsonProperty("maxRunningQueries") int maxRunningQueries, @JsonProperty("maxQueuedQueries") int maxQueuedQueries, @JsonProperty("runningTimeLimit") Duration runningTimeLimit, @JsonProperty("queuedTimeLimit") Duration queuedTimeLimit, @JsonProperty("runningQueries") List<QueryStateInfo> runningQueries, @JsonProperty("numQueuedQueries") int numQueuedQueries) { this.id = requireNonNull(id, "id is null"); this.state = requireNonNull(state, "state is null"); this.softMemoryLimit = requireNonNull(softMemoryLimit, "softMemoryLimit is null"); this.memoryUsage = requireNonNull(memoryUsage, "memoryUsage is null"); this.maxRunningQueries = maxRunningQueries; this.maxQueuedQueries = maxQueuedQueries; this.runningTimeLimit = requireNonNull(runningTimeLimit, "runningTimeLimit is null"); this.queuedTimeLimit = requireNonNull(queuedTimeLimit, "queuedTimeLimit is null"); this.runningQueries = ImmutableList.copyOf(requireNonNull(runningQueries, "runningQueries is null")); this.numQueuedQueries = numQueuedQueries; }
Source:
public static String getNextNodeName() { String testName = getSimpleName(getCurrentTestName()); int index = getTestResources(testName).addNode(); return (testName != null ? testName + "-" : "") + "Node" + getNameForIndex(index); }

Target:
public static String getNextNodeName() { String testName = getCurrentTestName(); TestResources resources = getTestResources(testName); String simpleName = resources.getSimpleName(); int nextNodeIndex = resources.addNode(); return simpleName + "-" + "Node" + getNameForIndex(nextNodeIndex); }
Source:
void delete(final String rawPath, final MantaHttpHeaders requestHeaders, final Integer pruneDepth) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); String path = formatPath(rawPath); if (pruneDepth == null) { LOG.debug("DELETE {}", path); httpHelper.httpDelete(path, requestHeaders); } else { PruneEmpytParentDirectoryStrategy.pruneParentDirectories(this, requestHeaders, path, pruneDepth); } }

Target:
void delete(final String rawPath, final MantaHttpHeaders requestHeaders, final Integer pruneDepth) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); String path = formatPath(rawPath); if (pruneDepth == null || pruneDepth == 0) { LOG.debug("DELETE {}", path); httpHelper.httpDelete(path, requestHeaders); } else { PruneEmpytParentDirectoryStrategy.pruneParentDirectories(this, requestHeaders, path, pruneDepth); } }
Source:
public void accept(long blockNumber) { if (persistenceConfiguration.get().writePauseDurationMillis() == 0) { return; } if (shouldBackoffBeforeWritingBlockNumber(blockNumber)) { try { long sweepPauseMillis = persistenceConfiguration.get().writePauseDurationMillis(); log.info("Invoking backoff for ms, because we are writing block of a stream", SafeArg.of("blockNumber", blockNumber), SafeArg.of("sweepPauseMillis", sweepPauseMillis)); backoff.backoff(sweepPauseMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }

Target:
public void accept(long blockNumber) { if (persistenceConfiguration.get().writePauseDurationMillis() == 0) { return; } if (shouldBackoffBeforeWritingBlockNumber(blockNumber)) { try { long writePauseDurationMillis = persistenceConfiguration.get().writePauseDurationMillis(); log.info("Invoking backoff for ms, because we are writing block of a stream", SafeArg.of("blockNumber", blockNumber), SafeArg.of("writePauseDurationMillis", writePauseDurationMillis)); backoff.backoff(writePauseDurationMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
Source:
public <P> HeaderEnricherSpec expirationDateFunction(Function<Message<P>, Object> expirationDateFunction) { return priorityFunction(expirationDateFunction, null); }

Target:
public <P> HeaderEnricherSpec expirationDateFunction(Function<Message<P>, Object> expirationDateFunction) { return expirationDateFunction(expirationDateFunction, null); }
Source:
public String getHumanReadableString(Date date) { return date == null ? ConvertedTime.NOT_AVAILABLE.toString() : new SimpleDateFormat("dd MMM, yyyy 'at' HH:mm:ss", Locale.ENGLISH) .format(date); }

Target:
public String getHumanReadableString(Date date) { return date == null ? ConvertedTime.NOT_AVAILABLE.toString() : dateFormatter.print(new DateTime(date)); }
Source:
public void run() { synchronized (managedStateImpl.commitLock) { long bytesSum = 0; for (Bucket bucket : managedStateImpl.buckets) { if (bucket != null) { bytesSum += bucket.getSizeInBytes(); } } if (bytesSum > managedStateImpl.getMaxMemorySize()) { Duration duration = managedStateImpl.getDurationPreventingFreeingSpace(); long durationMillis = 0; if (duration != null) { durationMillis = duration.getMillis(); } bucketAcessLock.writeLock().lock(); try { for (BucketIdTimeWrapper releaseItem : bucketHeapForRelease) { bucketHeapForAccess.add(releaseItem); } bucketHeapForRelease.clear(); TreeSet<BucketIdTimeWrapper> tmp = bucketHeapForAccess; bucketHeapForAccess = bucketHeapForRelease; bucketHeapForRelease = tmp; } finally { bucketAcessLock.writeLock().unlock(); } Iterator<BucketIdTimeWrapper> bucketIter = bucketHeapForRelease.iterator(); BucketIdTimeWrapper idTimeWrapper; while (bytesSum > managedStateImpl.getMaxMemorySize() && bucketIter.hasNext()) { idTimeWrapper = bucketIter.next(); if (System.currentTimeMillis() - idTimeWrapper.lastAccessedTime < durationMillis) { break; } long bucketId = idTimeWrapper.bucketId; Bucket bucket = managedStateImpl.getBucket(bucketId); if (bucket != null) { synchronized (bucket) { long sizeFreed; try { sizeFreed = bucket.freeMemory(managedStateImpl.getCheckpointManager().getLastTransferredWindow()); LOG.debug("bucket freed {}", bucketId, sizeFreed); } catch (IOException e) { managedStateImpl.throwable.set(e); throw new RuntimeException("freeing " + bucketId, e); } bytesSum -= sizeFreed; } if (bucket.getSizeInBytes() == 0) { bucketIter.remove(); } } } } } }

Target:
public void run() { synchronized (managedStateImpl.commitLock) { long bytesSum = 0; for (Bucket bucket : managedStateImpl.buckets) { if (bucket != null) { bytesSum += bucket.getSizeInBytes(); } } if (bytesSum > managedStateImpl.getMaxMemorySize()) { Duration duration = managedStateImpl.getDurationPreventingFreeingSpace(); long durationMillis = 0; if (duration != null) { durationMillis = duration.getMillis(); } synchronized (bucketLastAccess) { long now = System.currentTimeMillis(); for (Iterator<Map.Entry<Long, MutableLong>> iterator = bucketLastAccess.entrySet().iterator(); bytesSum > managedStateImpl.getMaxMemorySize() && iterator.hasNext(); ) { Map.Entry<Long, MutableLong> entry = iterator.next(); if (now - entry.getValue().longValue() < durationMillis) { break; } long bucketId = entry.getKey(); Bucket bucket = managedStateImpl.getBucket(bucketId); if (bucket != null) { synchronized (bucket) { long sizeFreed; try { sizeFreed = bucket.freeMemory(managedStateImpl.getCheckpointManager().getLastTransferredWindow()); LOG.debug("bucket freed {}", bucketId, sizeFreed); } catch (IOException e) { managedStateImpl.throwable.set(e); throw new RuntimeException("freeing " + bucketId, e); } bytesSum -= sizeFreed; } if (bucket.getSizeInBytes() == 0) { iterator.remove(); } } } } } } }
Source:
private boolean isUpdateRequired(VM.VMStatus status){ if (status == VM.VMStatus.Up || status == VM.VMStatus.PoweringDown || status == VM.VMStatus.Paused) { return true; } return false; }

Target:
private boolean isUpdateRequired(VM.VMStatus status) { switch (status) { case Up: case PoweringDown: case Paused: return true; default: return false; } }
Source:
public void testConversionTable() { for (int element = 0; element < DSTFileGenerator.CONVERSIONTABLE.length; element++) { int value = getValueForByte(DSTFileGenerator.CONVERSIONTABLE[element]); if (element > 121) { assertEquals((element - 121) * (-1), value); } else { assertEquals(element, value); } } }

Target:
public void testConversionTable() { int[] valueArray = new int[DSTFileGenerator.CONVERSION_TABLE.length]; for (int element = 0; element < DSTFileGenerator.CONVERSION_TABLE.length; element++) { if (element <= 121) { valueArray[element] = getByteForValue(element); } else { valueArray[element] = getByteForValue((element - 121) * (-1)); } } assertArrayEquals(DSTFileGenerator.CONVERSION_TABLE, valueArray); }
Source:
public Object visitUnknownCommand(InvocationContext ctx, VisitableCommand command) throws Throwable { return CompletableFutures.await(command.invokeAsync(componentRegistry)); }

Target:
public Object visitUnknownCommand(InvocationContext ctx, VisitableCommand command) throws Throwable { return command.invoke(); }
Source:
public String storeRunInfo(int configuration_id, String url, String author, String repo, String comment) { try { Connection conn = getConnection(); String sql = "INSERT INTO records (configuration_id, url, author, repo, comment) VALUES (?, ?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(sql); stmt.setInt(1, configuration_id); stmt.setString(2, url); stmt.setString(3, author); stmt.setString(4, repo); stmt.setString(5, comment); stmt.executeUpdate(); sql = "SELECT MAX(record_id) FROM records;"; stmt = conn.prepareStatement(sql); ResultSet recordIDRS = stmt.executeQuery(); recordIDRS.first(); int record_id = recordIDRS.getInt(1); return Integer.toString(record_id); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public String storeRunInfo(int configuration_id, String url, String author, String repo, String comment) { try { Connection conn = getConnection(); String sql = "INSERT INTO records (configuration_id, url, author, repo, comment) VALUES (?, ?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); stmt.setInt(1, configuration_id); stmt.setString(2, url); stmt.setString(3, author); stmt.setString(4, repo); stmt.setString(5, comment); stmt.executeUpdate(); ResultSet newID = stmt.getGeneratedKeys(); newID.first(); int record_id = newID.getInt(1); conn.close(); return Integer.toString(record_id); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
private Profile getBasicProfile() { try{ String basicProfilePath = "/basic_profile.ccpr"; InputStream is = this.getClass().getResourceAsStream(basicProfilePath); if(is == null) { throw new RuntimeException("Test resource missing: " + basicProfilePath); } ProfileParser parser = new ProfileParser(is, mAppPlatform.getInstance(), mFreshResourceTable, "profile", Resource.RESOURCE_VERSION_UNKNOWN, false); Profile p = parser.parse(); return p; } catch(Exception e) { throw PersistableSandbox.wrap("Error during profile test setup", e); } }

Target:
private Profile getBasicProfile() { try{ String basicProfilePath = "/basic_profile.ccpr"; InputStream is = this.getClass().getResourceAsStream(basicProfilePath); if(is == null) { throw new RuntimeException("Test resource missing: " + basicProfilePath); } ProfileParser parser = new ProfileParser(is, mAppPlatform.getInstance(), mFreshResourceTable, "profile", Resource.RESOURCE_VERSION_UNKNOWN, false); return parser.parse(); } catch(Exception e) { throw PersistableSandbox.wrap("Error during profile test setup", e); } }
Source:
public ArrayDefinition lookupArray(String name) { Definition def = lookupDefinition(name); return (ArrayDefinition) ((def.getDeclaration() instanceof ArrayDeclaration) ? def : null); }

Target:
public ArrayDefinition lookupArray(String name) { Definition def = lookupDefinition(name); return (ArrayDefinition) ((def instanceof ArrayDefinition) ? def : null); }
Source:
public void shouldVoidDiagnosis() throws Exception { Diagnosis diagnosis = diagnosisService.getDiagnosisByUuid(getUuid()); Assert.assertFalse(diagnosis.isVoided()); MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); req.addParameter("reason", "test"); handle(req); diagnosis = diagnosisService.getDiagnosisByUuid(getUuid()); Assert.assertTrue(diagnosis.isVoided()); Assert.assertEquals("test", diagnosis.getVoidReason()); Assert.assertNotNull(diagnosis.getDateVoided()); Assert.assertNotNull(diagnosis.getVoidedBy()); }

Target:
public void shouldVoidDiagnosis() throws Exception { Diagnosis diagnosis = diagnosisService.getDiagnosisByUuid(getUuid()); Assert.assertFalse(diagnosis.isVoided()); MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); req.addParameter("reason", "test"); handle(req); diagnosis = diagnosisService.getDiagnosisByUuid(getUuid()); Assert.assertTrue(diagnosis.isVoided()); Assert.assertEquals("test", diagnosis.getVoidReason()); Assert.assertNotNull(diagnosis.getDateVoided()); Assert.assertNotNull(diagnosis.getVoidedBy()); Assert.assertEquals(Context.getAuthenticatedUser().getUuid(), diagnosis.getVoidedBy().getUuid()); }
Source:
public SpellResult perform(CastContext context) { if (!(context.getTargetEntity() instanceof Player)) return null; Player p = ((Player) context.getTargetEntity()); if (randomizedMessages == null || randomizedMessages.isEmpty()) { if (message == null) return SpellResult.FAIL; if (translateAltColorCodes) message = ChatColor.translateAlternateColorCodes(altColorCode, message); p.chat(message); } else { if (translateAltColorCodes) { for (int i = 0; i < randomizedMessages.size(); i++) { randomizedMessages.set(i, ChatColor.translateAlternateColorCodes(altColorCode, randomizedMessages.get(i))); } } p.chat(randomizedMessages.get(ThreadLocalRandom.current().nextInt(randomizedMessages.size()))); } return SpellResult.CAST; }

Target:
public SpellResult perform(CastContext context) { if (!(context.getTargetEntity() instanceof Player)) return SpellResult.PLAYER_REQUIRED; Player p = ((Player) context.getTargetEntity()); p.chat(message); return SpellResult.CAST; }
Source:
public List<DroolsFromUniConstraintStream<Solution_, Object>> getFromStreamList() { if (parent == null) { DroolsJoinBiConstraintStream<Solution_, A, B> joinStream = (DroolsJoinBiConstraintStream<Solution_, A, B>) this; List<DroolsFromUniConstraintStream<Solution_, Object>> leftParentFromStreamList = joinStream.getLeftParentStream().getFromStreamList(); List<DroolsFromUniConstraintStream<Solution_, Object>> rightParentFromStreamList = joinStream.getRightParentStream().getFromStreamList(); return Stream.concat(leftParentFromStreamList.stream(), rightParentFromStreamList.stream()) .distinct() .collect(Collectors.toList()); } else { return parent.getFromStreamList(); } }

Target:
public List<DroolsFromUniConstraintStream<Solution_, Object>> getFromStreamList() { if (parent == null) { DroolsJoinBiConstraintStream<Solution_, A, B> joinStream = (DroolsJoinBiConstraintStream<Solution_, A, B>) this; List<DroolsFromUniConstraintStream<Solution_, Object>> leftParentFromStreamList = joinStream.getLeftParentStream().getFromStreamList(); List<DroolsFromUniConstraintStream<Solution_, Object>> rightParentFromStreamList = joinStream.getRightParentStream().getFromStreamList(); return Stream.concat(leftParentFromStreamList.stream(), rightParentFromStreamList.stream()) .collect(Collectors.toList()); } else { return parent.getFromStreamList(); } }
Source:
public void registerModuleMusic(String moduleName, final GameOptions options) { if (currentlyRegisteredModule != null) { if (moduleName.equals(currentlyRegisteredModule)) { stopMusic(); playMusicTrack(this.musicMap.get(GAME_MUSIC_SET).get(2), options); return; } else { unregisterModuleMusic(); currentlyRegisteredModule = null; } } if (Assets.getAssetHelper().list(Json.class, moduleName + ":musicConfig").isEmpty()) { logger.warn("Music config not found for module " + moduleName + ":musicConfig"); return; } Json musicJson = Assets.getJson(moduleName + ":musicConfig"); MusicConfig musicConfig = MusicConfig.load(moduleName, musicJson.getJsonValue()); Map<String, List<String>> musicMap = musicConfig.getMusicMap(); for (String music : musicMap.get(GAME_MUSIC_SET)) { registerMusic(GAME_MUSIC_SET, music); logger.info("Registered " + music); } currentlyRegisteredModule = moduleName; stopMusic(); playMusicTrack(this.musicMap.get(GAME_MUSIC_SET).get(2), options); }

Target:
public void registerModuleMusic(String moduleName, final GameOptions options) { if (currentlyRegisteredModule != null) { if (moduleName.equals(currentlyRegisteredModule)) { stopMusic(); playMusicTrack(this.musicMap.get(GAME_MUSIC_SET).get(2), options); return; } else { unregisterModuleMusic(); currentlyRegisteredModule = null; } } if (Assets.getAssetHelper().list(Json.class, moduleName + ":musicConfig").isEmpty()) { return; } else { logger.info("Music Config found for module " + moduleName); } Json musicJson = Assets.getJson(moduleName + ":musicConfig"); MusicConfig musicConfig = MusicConfig.load(moduleName, musicJson.getJsonValue()); Map<String, List<String>> musicSets = musicConfig.getMusicMap(); for (String music : musicSets.get(GAME_MUSIC_SET)) { registerMusic(GAME_MUSIC_SET, music); logger.info("Registered " + music); } currentlyRegisteredModule = moduleName; stopMusic(); playMusicTrack(this.musicMap.get(GAME_MUSIC_SET).get(2), options); }
Source:
public void bind(Moshi moshi, JsonAdapter.Factory factory) { if (jsonAdapters.length > 0) { Type[] parameterTypes = method.getGenericParameterTypes(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); for (int i = adaptersOffset, size = parameterTypes.length; i < size; i++) { Type type = ((ParameterizedType) parameterTypes[i]).getActualTypeArguments()[0]; Set<? extends Annotation> jsonAnnotations = jsonAnnotations(parameterAnnotations[i]); if (this.type == type && annotations.equals(jsonAnnotations)) { jsonAdapters[i - adaptersOffset] = moshi.nextAdapter(factory, type, jsonAnnotations); } else { jsonAdapters[i - adaptersOffset] = moshi.adapter(type, jsonAnnotations); } } } }

Target:
public void bind(Moshi moshi, JsonAdapter.Factory factory) { if (jsonAdapters.length > 0) { Type[] parameterTypes = method.getGenericParameterTypes(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); for (int i = adaptersOffset, size = parameterTypes.length; i < size; i++) { Type type = ((ParameterizedType) parameterTypes[i]).getActualTypeArguments()[0]; Set<? extends Annotation> jsonAnnotations = jsonAnnotations(parameterAnnotations[i]); jsonAdapters[i - adaptersOffset] = Types.equals(this.type, type) && annotations.equals(jsonAnnotations) ? moshi.nextAdapter(factory, type, jsonAnnotations) : moshi.adapter(type, jsonAnnotations); } } }
Source:
public Observable<LoginResponse> login(Account account) { String url = userManager.getSiteUrl(account); String username = userManager.getUsername(account); String password = userManager.getPassword(account); Observable<LoginResponse> result = null; try { result = login(url, username, password); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } return result; }

Target:
public Observable<LoginResponse> login(Account account) { String url = userManager.getSiteUrl(account); String username = userManager.getUsername(account); String password = userManager.getPassword(account); Observable<LoginResponse> result = null; result = login(url, username, password); return result; }
Source:
protected void pulsePhysics() { if (boundingBox == null) { Vector size = boundingBox.getSize(); for (Entity entity : world.getNearbyEntities( location, size.getX(), size.getY(), size.getZ())) { if (entity instanceof LivingEntity && entity != this && !(entity.equals(shooter))) { collide((LivingEntity) entity); break; } } } super.pulsePhysics(); }

Target:
protected void pulsePhysics() { if (boundingBox != null) { Vector size = boundingBox.getSize(); for (Entity entity : world.getNearbyEntities( location, size.getX(), size.getY(), size.getZ())) { if (entity instanceof LivingEntity && entity != this && !(entity.equals(shooter))) { collide((LivingEntity) entity); break; } } } super.pulsePhysics(); }
Source:
public IToHex getInstance(DiscreteElement<?> elementType){ if(elementType instanceof EnumeratedElement){ iToHex = new EnumToHex(); return iToHex; } else if (elementType instanceof RealElement || elementType instanceof FixedPointElement || elementType instanceof Float32Element || elementType instanceof Float64Element || elementType instanceof Dec32Element){ iToHex = new RealToHex(); return iToHex; } else if (elementType instanceof IntegerElement){ iToHex = new IntToHex(); return iToHex; } else{ iToHex = new CharToHex(); } return iToHex; }

Target:
public IToHex getInstance(DiscreteElement<?> elementType){ if(elementType instanceof EnumeratedElement){ iToHex = new EnumToHex(); return iToHex; } else if (elementType instanceof RealElement){ iToHex = new RealToHex(); return iToHex; } else if (elementType instanceof IntegerElement){ iToHex = new IntToHex(); return iToHex; }else if (elementType instanceof EmptyEnum_Element){ return new EmptyEnumToHex(); }else if (elementType instanceof LongIntegerElement){ return new LongToHex(); }else if (elementType instanceof StringElement){ return new StringToHex(); }else if (elementType instanceof SignedInteger16Element){ return new SignedIntToHex(); } else{ iToHex = new CharToHex(); } return iToHex; }
Source:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.preferences_notification); setUpScreen(); }

Target:
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.preferences_notifications); setUpScreen(); }
Source:
public static VDSGroup map(SchedulingPolicy model, VDSGroup template) { VDSGroup entity = template != null ? template : new VDSGroup(); if (model.isSetId()) { entity.setClusterPolicyId(GuidUtils.asGuid(model.getId())); } if (model.isSetPolicy()) { SchedulingPolicyType policyType = SchedulingPolicyType.fromValue(model.getPolicy()); if (policyType != null) { ClusterPolicy clusterPolicy = new ClusterPolicy(); clusterPolicy.setName(policyType.name().toLowerCase()); clusterPolicy.setId(null); entity.setClusterPolicy(clusterPolicy); } } if (model.isSetThresholds()) { SchedulingPolicyThresholds thresholds = model.getThresholds(); if (entity.getClusterPolicyProperties() == null) { entity.setClusterPolicyProperties(new LinkedHashMap<String, String>()); } if (thresholds.getLow() != null) { entity.getClusterPolicyProperties().put(LOW_UTILIZATION, thresholds.getLow().toString()); } if (thresholds.getHigh() != null) { entity.getClusterPolicyProperties().put(HIGH_UTILIZATION, thresholds.getHigh().toString()); } if (thresholds.getDuration() != null) { int round = Math.round(thresholds.getDuration() / 60.0f); entity.getClusterPolicyProperties().put(CPU_OVER_COMMIT_DURATION_MINUTES, Integer.toString(round)); } } return entity; }

Target:
public static VDSGroup map(SchedulingPolicy model, VDSGroup template) { VDSGroup entity = template != null ? template : new VDSGroup(); if (model.isSetId()) { entity.setClusterPolicyId(GuidUtils.asGuid(model.getId())); } if (model.isSetPolicy() || model.isSetName()) { String policyName = model.isSetName() ? model.getName() : model.getPolicy(); ClusterPolicy clusterPolicy = new ClusterPolicy(); clusterPolicy.setName(policyName.toLowerCase()); clusterPolicy.setId(null); entity.setClusterPolicy(clusterPolicy); } if (model.isSetThresholds()) { SchedulingPolicyThresholds thresholds = model.getThresholds(); if (entity.getClusterPolicyProperties() == null) { entity.setClusterPolicyProperties(new LinkedHashMap<String, String>()); } if (thresholds.getLow() != null) { entity.getClusterPolicyProperties().put(LOW_UTILIZATION, thresholds.getLow().toString()); } if (thresholds.getHigh() != null) { entity.getClusterPolicyProperties().put(HIGH_UTILIZATION, thresholds.getHigh().toString()); } if (thresholds.getDuration() != null) { int round = Math.round(thresholds.getDuration() / 60.0f); entity.getClusterPolicyProperties().put(CPU_OVER_COMMIT_DURATION_MINUTES, Integer.toString(round)); } } return entity; }
Source:
public void addTask(TaskType t, long delay, Object o){ try { if (AppConfig.getInstance().isJsonEvents()){ JsonRpcNotification jsonRpcNotification = new JsonRpcNotification(); jsonRpcNotification.fireEvents(t, delay, o); }else{ TaskProcessor.getInstance().addTask(new TaskRequest(t, delay, o)); } }catch (Exception e){ log.error("wrapping task error {}", e.toString()); } }

Target:
public static void addTask(TaskType t, long delay, Object o){ try { if (AppConfig.getInstance().isJsonEvents()){ JsonRpcNotification jsonRpcNotification = new JsonRpcNotification(); jsonRpcNotification.fireEvents(t, delay, o); }else{ TaskProcessor.getInstance().addTask(new TaskRequest(t, delay, o)); } }catch (Exception e){ log.error("wrapping task error {}", e.toString()); } }
Source:
public void setUp() throws SQLException { super.setUp(); if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(TestUtils.getDatabaseConnectionToExistingDb(db), metadataTableList); }

Target:
public void setUp() throws SQLException { super.setUp(); if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(db, metadataTableList); }
Source:
protected void destroyUnattachedVBD(Connection conn, VM vm) { try { for (VBD vbd : vm.getVBDs(conn)) { if (Types.VbdType.DISK.equals(vbd.getType(conn)) && !vbd.getCurrentlyAttached(conn)) { vbd.destroy(conn); } } } catch (final Exception e) { s_logger.debug("destroyUnattachedVBD failed due to " + e.toString()); } }

Target:
protected void destroyUnattachedVBD(Connection conn, VM vm) { try { for (VBD vbd : vm.getVBDs(conn)) { if (Types.VbdType.DISK.equals(vbd.getType(conn)) && !vbd.getCurrentlyAttached(conn)) { vbd.destroy(conn); } } } catch (final Exception e) { s_logger.debug("Failed to destroy unattached VBD due to ", e); } }
Source:
public Set<String> preSelect(Set<String> onlineSegments) { Set<String> segmentsToProcess = new HashSet<>(onlineSegments); SegmentLineage segmentLineage = SegmentLineageAccessHelper.getSegmentLineage(_propertyStore, _tableNameWithType); Set<String> segmentsToRemove = new HashSet<>(); if (segmentLineage != null) { for (String lineageEntryId : segmentLineage.getLineageEntryIds()) { LineageEntry lineageEntry = segmentLineage.getLineageEntry(lineageEntryId); if (lineageEntry.getState() == LineageEntryState.COMPLETED && onlineSegments .containsAll(lineageEntry.getSegmentsTo())) { segmentsToRemove.addAll(lineageEntry.getSegmentsFrom()); } else { segmentsToRemove.addAll(lineageEntry.getSegmentsTo()); } } } segmentsToProcess.removeAll(segmentsToRemove); return segmentsToProcess; }

Target:
public Set<String> preSelect(Set<String> onlineSegments) { SegmentLineage segmentLineage = SegmentLineageAccessHelper.getSegmentLineage(_propertyStore, _tableNameWithType); if (segmentLineage != null) { for (String lineageEntryId : segmentLineage.getLineageEntryIds()) { LineageEntry lineageEntry = segmentLineage.getLineageEntry(lineageEntryId); if (lineageEntry.getState() == LineageEntryState.COMPLETED) { onlineSegments.removeAll(lineageEntry.getSegmentsFrom()); } else { onlineSegments.removeAll(lineageEntry.getSegmentsTo()); } } } return onlineSegments; }
Source:
public void findMissingEnumNames() { boolean missingKey = false; for (ConfigurationValues configValue : ConfigurationValues.values()) { if (!configValuesEnumNames.contains(configValue.toString())) { log.error("Found missing key: " + configValue.toString()); missingKey = true; break; } } assertFalse(missingKey); }

Target:
public void findMissingEnumNames() { boolean missingKey = false; for (ConfigurationValues configValue : ConfigurationValues.values()) { if (!configValuesEnumNames.contains(configValue.toString())) { log.error("Found missing key: " + configValue.toString()); missingKey = true; break; } } assertFalse("Found missing key: ", missingKey); }
Source:
public Void visit(GenContext state, Match ast) { return null; }

Target:
public Void visit(GenContext state, Match ast) { ast.getMatchingOver().acceptVisitor(this, state); ast.getDefaultCase().getAST().acceptVisitor(this, state); for (Case cse : ast.getCases()) { cse.getAST().acceptVisitor(this, state); } return null; }
Source:
private void _showImage(FileEntity fileEntity) { try { _imgCon.add(new ImageComponent(new Image(ImageResource.getResource(fileEntity, 80, 90)))); } catch (CmsValidationException e) { _logger.error("SetImage throw cmsValidation error", e); } catch (NullPointerException e) { _logger.error("SetImage throw null pointer error", e); } catch (IOException e) { _logger.error("SetImage throw Io exception", e); } }

Target:
private void _showImage(FileEntity fileEntity) { try { _imgCon.add(new ImageComponent(new Image(ImageResource.getResource(fileEntity, 80, 90)))); } catch (IOException e) { _logger.error("SetImage throw Io exception", e); } catch (NullPointerException e) { _logger.error("Image is null,please upload first", e); } }
Source:
public IRegion processFix(IDocument document, IMarker marker) throws CoreException { int line = (int) marker.getAttribute(IMarker.LINE_NUMBER); try { String indent = getIndent(document, line); int endOfCurrLine = document.getLineInformation(line - 1).getOffset() + document.getLineInformation(line - 1).getLength(); String replacementText = indent + "type: object"; document.replace(endOfCurrLine, 0, TextUtilities.getDefaultLineDelimiter(document) + replacementText); return new Region(endOfCurrLine + 1, replacementText.length()); } catch (BadLocationException e) { throw new CoreException(createStatus(e, "Cannot process the IMarker")); } }

Target:
public IRegion processFix(IDocument document, IMarker marker) throws CoreException { int line = (int) marker.getAttribute(IMarker.LINE_NUMBER); try { String indent = getIndent(document, line); int endOfCurrLine = document.getLineInformation(line - 1).getOffset() + document.getLineInformation(line - 1).getLength(); String replacementText = indent + "type: object"; String delim = TextUtilities.getDefaultLineDelimiter(document); document.replace(endOfCurrLine, 0, delim + replacementText); return new Region(endOfCurrLine + delim.length(), replacementText.length()); } catch (BadLocationException e) { throw new CoreException(createStatus(e, "Cannot process the IMarker")); } }
Source:
private void setScriptDir(Path path) { scriptDirField.setText(path.toString()); automationConfiguration.setScriptLocation(path); }

Target:
private void setScriptDir(Path path) { scriptDirField.setText(path.toString()); }
Source:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { WorkdayConfiguration workdayConfiguration = new WorkdayConfiguration(); setProperties(workdayConfiguration, parameters); this.httpClient = createHttpClient(workdayConfiguration); this.workdayConfiguration = workdayConfiguration; Endpoint endpoint = new WorkdayEndpoint(uri, this); setProperties(endpoint, parameters); return endpoint; }

Target:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { WorkdayEndpoint endpoint = new WorkdayEndpoint(uri, this); setProperties(endpoint, parameters); return endpoint; }
Source:
private static void verifyJvmHeapSize(MemorySize jvmHeapSize) { if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) < 0) { LOG.warn( "The configured or derived JVM heap memory size ({}) is less than its recommended minimum value ({})", jvmHeapSize.toHumanReadableString(), JobManagerOptions.MIN_JVM_HEAP_SIZE); } }

Target:
private static void verifyJvmHeapSize(MemorySize jvmHeapSize) { if (jvmHeapSize.compareTo(JobManagerOptions.MIN_JVM_HEAP_SIZE) < 0) { LOG.warn( "The configured or derived JVM heap memory size ({}) is less than its recommended minimum value ({})", jvmHeapSize.toHumanReadableString(), JobManagerOptions.MIN_JVM_HEAP_SIZE.toHumanReadableString()); } }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { FailureCollector failureCollector = context.getFailureCollector(); config.validate(context.getInputSchema(), failureCollector); failureCollector.getOrThrowException(); context.record( TransformLineageRecorderUtils.oneToOneIn(new ArrayList<>(fieldSet), "hash", "Use the digest algorithm to hash the fields.")); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { FailureCollector failureCollector = context.getFailureCollector(); config.validate(context.getInputSchema(), failureCollector); failureCollector.getOrThrowException(); if (context.getInputSchema() == null || context.getInputSchema().getFields() == null) { return; } List<String> hashedFields = context.getInputSchema().getFields().stream() .filter(field -> config.getFields() .contains(field.getName()) && field.getSchema().getType() == Schema.Type.STRING) .map(Schema.Field::getName).collect(Collectors.toList()); List<String> identityFields = TransformLineageRecorderUtils.getFields(context.getInputSchema()); identityFields.removeAll(hashedFields); List<FieldOperation> output = new ArrayList<>(); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(hashedFields, "hash", "Used the digest algorithm to hash the fields.")); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(identityFields, "identity", TransformLineageRecorderUtils.IDENTITY_TRANSFORM_DESCRIPTION)); context.record(output); }
Source:
public void wildcard_type_tree_have_a_widlcard_type() { CompilationUnitTree cut = treeOf("abstract class A<T> { abstract A<? extends Runnable> foo(); }"); TypeTree returnType = ((MethodTree) ((ClassTree) cut.types().get(0)).members().get(0)).returnType(); assertThat(returnType.is(Tree.Kind.PARAMETERIZED_TYPE)).isTrue(); Tree typeArg = ((ParameterizedTypeTree) returnType).typeArguments().get(0); assertThat(typeArg.is(Tree.Kind.EXTENDS_WILDCARD)).isTrue(); JavaType javaType = (JavaType) ((WildcardTree) typeArg).symbolType(); assertThat(javaType).isInstanceOf(WildCardType.class); WildCardType wildCardType = (WildCardType) javaType; assertThat(wildCardType.isSubtypeOf("java.lang.Runnable")).isTrue(); assertThat(wildCardType.bound.is("java.lang.Runnable")).isTrue(); }

Target:
public void wildcard_type_tree_have_a_widlcard_type() { CompilationUnitTree cut = treeOf("abstract class A<T> { abstract A<? extends Runnable> foo(); }"); TypeTree returnType = ((MethodTree) ((ClassTree) cut.types().get(0)).members().get(0)).returnType(); assertThat(returnType.is(Tree.Kind.PARAMETERIZED_TYPE)).isTrue(); Tree typeArg = ((ParameterizedTypeTree) returnType).typeArguments().get(0); assertThat(typeArg.is(Tree.Kind.EXTENDS_WILDCARD)).isTrue(); JavaType javaType = (JavaType) ((WildcardTree) typeArg).symbolType(); assertThat(javaType).isInstanceOf(WildCardType.class); WildCardType wildCardType = (WildCardType) javaType; assertThat(wildCardType.isSubtypeOf("java.lang.Runnable")).isTrue(); assertThat(wildCardType.bound.is("java.lang.Runnable")).isTrue(); assertThat(wildCardType.boundType).isEqualTo(WildCardType.BoundType.EXTENDS); }
Source:
public void onEventMainThread(NotificationEvents.NotificationsRefreshError error) { setProgressVisible(false); ToastUtils.showToast(this, getString(R.string.error_refresh_notification)); }

Target:
public void onEventMainThread(NotificationEvents.NotificationsRefreshError error) { setProgressVisible(false); if (mNoteId == null) { showErrorToastAndFinish(); return; } Note note = NotificationsTable.getNoteById(mNoteId); if (note == null) { showErrorToastAndFinish(); return; } }
Source:
public void testCreate() throws StripeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("quantity", 10); params.put("subscription_item", SUBCRIPTION_ITEM_ID); params.put("timestamp", System.currentTimeMillis() / 1000L); UsageRecord resource = UsageRecord.create(params, null); params.remove("subscription_item"); assertNotNull(resource); verifyRequest( APIResource.RequestMethod.POST, String.format("/v1/subscription_items/%s/usage_records", SUBCRIPTION_ITEM_ID), params ); }

Target:
public void testCreate() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("quantity", 10); params.put("subscription_item", SUBCRIPTION_ITEM_ID); params.put("timestamp", System.currentTimeMillis() / 1000L); final UsageRecord resource = UsageRecord.create(params, null); params.remove("subscription_item"); assertNotNull(resource); verifyRequest( APIResource.RequestMethod.POST, String.format("/v1/subscription_items/%s/usage_records", SUBCRIPTION_ITEM_ID), params ); }
Source:
default UUID leader() { Optional<UUID> leader = timestampMapping() .values() .stream() .findAny() .map(LockWatchVersion::id); Preconditions.checkState(leader.isPresent(), "Cannot compute timestamp mapping for empty map of timestamps"); Preconditions.checkState( timestampMapping().values().stream().allMatch(version -> version.id().equals(leader.get())), "All versions must be on the same leader"); return leader.get(); }

Target:
default UUID leader() { return timestampMapping() .values() .stream() .map(LockWatchVersion::id) .distinct() .collect(MoreCollectors.onlyElement()); }
Source:
public int incomingCount() { int count; if ( read.hasTxStateWithChanges() && read.txState().nodeIsAddedInThisTx( getOwningNode() ) ) { count = 0; } else if ( isBuffered() ) { count = bufferedGroup.incomingCount; } else { count = count( incomingRawId() ); } return read.hasTxStateWithChanges() ? read.txState().getNodeState( getOwningNode() ) .augmentDegree( Direction.INCOMING, count, getType() ) : count; }

Target:
public int incomingCount() { int count; if ( isBuffered() ) { count = bufferedGroup.incomingCount; } else { count = count( incomingRawId() ); } return read.hasTxStateWithChanges() ? read.txState().getNodeState( getOwningNode() ) .augmentDegree( RelationshipDirection.INCOMING, count, getType() ) : count; }
Source:
public StagingCommitter(Path outputPath, TaskAttemptContext context) throws IOException { super(outputPath, context); this.constructorOutputPath = checkNotNull(getOutputPath(), "output path"); Configuration conf = getConf(); this.uploadPartSize = conf.getLongBytes( MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); this.uuid = getUploadUUID(conf, context.getJobID()); this.uniqueFilenames = conf.getBoolean( FS_S3A_COMMITTER_STAGING_UNIQUE_FILENAMES, DEFAULT_STAGING_COMMITTER_UNIQUE_FILENAMES); setWorkPath(buildWorkPath(context, uuid)); this.wrappedCommitter = createWrappedCommitter(context, conf); ConflictResolution mode = getConflictResolutionMode(getJobContext()); LOG.debug("Conflict resolution mode: {}", mode); this.finalOutputPath = constructorOutputPath; Preconditions.checkNotNull(finalOutputPath, "Output path cannot be null"); S3AFileSystem fs = getS3AFileSystem(finalOutputPath, context.getConfiguration(), false); s3KeyPrefix = fs.pathToKey(finalOutputPath); LOG.debug("{}: final output path is {}", getRole(), finalOutputPath); setOutputPath(finalOutputPath); }

Target:
public StagingCommitter(Path outputPath, TaskAttemptContext context) throws IOException { super(outputPath, context); this.constructorOutputPath = checkNotNull(getOutputPath(), "output path"); Configuration conf = getConf(); this.uploadPartSize = conf.getLongBytes( MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); this.uuid = getUploadUUID(conf, context.getJobID()); this.uniqueFilenames = conf.getBoolean( FS_S3A_COMMITTER_STAGING_UNIQUE_FILENAMES, DEFAULT_STAGING_COMMITTER_UNIQUE_FILENAMES); setWorkPath(buildWorkPath(context, uuid)); this.wrappedCommitter = createWrappedCommitter(context, conf); setOutputPath(constructorOutputPath); Path finalOutputPath = getOutputPath(); Preconditions.checkNotNull(finalOutputPath, "Output path cannot be null"); S3AFileSystem fs = getS3AFileSystem(finalOutputPath, context.getConfiguration(), false); s3KeyPrefix = fs.pathToKey(finalOutputPath); LOG.debug("{}: final output path is {}", getRole(), finalOutputPath); ConflictResolution mode = getConflictResolutionMode(getJobContext(), fs.getConf()); LOG.debug("Conflict resolution mode: {}", mode); }
Source:
public DelimitedParser(final Optional<String> delimiter, Optional<String> listDelimiter) { this.delimiter = delimiter.isPresent() ? delimiter.get() : DEFAULT_DELIMITER; this.listDelimiter = listDelimiter.isPresent() ? listDelimiter.get() : DEFAULT_LIST_DELIMITER; this.splitter = Splitter.on(this.delimiter); this.listSplitter = Splitter.on(this.listDelimiter); this.valueFunction = new Function<String, Object>() { @Override public Object apply(String input) { if (input.contains(DelimitedParser.this.listDelimiter)) { return Lists.newArrayList( Iterables.transform( listSplitter.split(input), ParserUtils.nullEmptyStringFunction ) ); } else { return ParserUtils.nullEmptyStringFunction.apply(input); } } }; }

Target:
public DelimitedParser(final Optional<String> delimiter, Optional<String> listDelimiter) { this.delimiter = delimiter.isPresent() ? delimiter.get() : DEFAULT_DELIMITER; this.listDelimiter = listDelimiter.isPresent() ? listDelimiter.get() : Parsers.DEFAULT_LIST_DELIMITER; Preconditions.checkState( !this.delimiter.equals(this.listDelimiter), "Cannot have same delimiter and list delimiter of [%s]", this.delimiter ); this.splitter = Splitter.on(this.delimiter); this.listSplitter = Splitter.on(this.listDelimiter); this.valueFunction = new Function<String, Object>() { @Override public Object apply(String input) { if (input.contains(DelimitedParser.this.listDelimiter)) { return Lists.newArrayList( Iterables.transform( listSplitter.split(input), ParserUtils.nullEmptyStringFunction ) ); } else { return ParserUtils.nullEmptyStringFunction.apply(input); } } }; }
Source:
private void _sendRefocusNotification(NotificationContext context, boolean isTriggerActive) { List<String> aspectPaths = context.getNotification().getSubscriptions(); String token = context.getNotification().getCustomText(); requireArgument(StringUtils.isNoneBlank(token), "Token(custom text) cannot be blank."); requireArgument(aspectPaths!=null && !aspectPaths.isEmpty(), "aspect paths (subscriptions) cannot be empty."); for (String aspect : aspectPaths) { sendMessage(aspect, token, isTriggerActive); } }

Target:
private void _sendRefocusNotification(NotificationContext context, boolean isTriggerActive) { List<String> aspectPaths = context.getNotification().getSubscriptions(); requireArgument(aspectPaths!=null && !aspectPaths.isEmpty(), "aspect paths (subscriptions) cannot be empty."); for (String aspect : aspectPaths) { sendMessage(aspect, isTriggerActive); } }
Source:
private String startUserDialog() throws IOException { log.debug("starting user dialog."); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter user:"); return br.readLine(); }

Target:
private String startUserDialog() throws IOException { log.debug("starting user dialog."); String user; while (true) { System.out.println("Please enter user:"); user = System.console().readLine(); if (StringUtils.isNotEmpty(user)) { break; } } return user; }
Source:
public String createAndRegisterNewRequestToken() { String newToken = prefix + sequence.getAndIncrement(); this.token.set(newToken); return newToken; }

Target:
public String createAndRegisterNewRequestToken() { String newToken = prefix + format("%010x", sequence.getAndIncrement()); this.token.set(newToken); return newToken; }
Source:
public void onBecomeInactiveFromStandby(Message message, NotificationContext context) { String partitionName = message.getPartitionName(); logger.info("Partition in resource is becoming INACTIVE from STANDBY", message.getPartitionName(), partitionName); if (clusterMapConfig.clustermapEnableStateModelListener) { partitionStateChangeListener.onPartitionBecomeInactiveFromStandby(partitionName); } }

Target:
public void onBecomeInactiveFromStandby(Message message, NotificationContext context) { String partitionName = message.getPartitionName(); logger.info("Partition in resource is becoming INACTIVE from STANDBY", partitionName, message.getResourceName()); if (clusterMapConfig.clustermapEnableStateModelListener) { partitionStateChangeListener.onPartitionBecomeInactiveFromStandby(partitionName); } }
Source:
public HookResult doRefUpdateHook(final Project project, final String refname, final Account uploader, final ObjectId oldId, final ObjectId newId) { final List<String> args = new ArrayList<String>(); addArg(args, "--project", project.getName()); addArg(args, "--refname", refname); addArg(args, "--uploader", getDisplayName(uploader)); addArg(args, "--oldrev", oldId.getName()); addArg(args, "--newrev", newId.getName()); HookResult hookResult = null; try { hookResult = runSyncHook(project.getNameKey(), refUpdateHook, args); } catch (TimeoutException e) { hookResult = new HookResult(-1, "Synchronous hook timed out"); } return hookResult; }

Target:
public HookResult doRefUpdateHook(final Project project, final String refname, final Account uploader, final ObjectId oldId, final ObjectId newId) { final List<String> args = new ArrayList<String>(); addArg(args, "--project", project.getName()); addArg(args, "--refname", refname); addArg(args, "--uploader", getDisplayName(uploader)); addArg(args, "--oldrev", oldId.getName()); addArg(args, "--newrev", newId.getName()); HookResult hookResult; try { hookResult = runSyncHook(project.getNameKey(), refUpdateHook, args); } catch (TimeoutException e) { hookResult = new HookResult(-1, "Synchronous hook timed out"); } return hookResult; }
Source:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final Container basicMainContainer = decorateMainContainer(flinkPod.getMainContainer()); return new FlinkPod.Builder(flinkPod) .withPod(flinkPod.getPod()) .withMainContainer(basicMainContainer) .build(); }

Target:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final Container basicMainContainer = new ContainerBuilder(flinkPod.getMainContainer()) .addAllToEnv(getSecretEnvs()) .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(basicMainContainer) .build(); }
Source:
public void notifyCameraDeviceClose() { synchronized (mExecutingCaptureConfigCallbacks) { for (CaptureConfigCaptureCallback callback : mExecutingCaptureConfigCallbacks) { callback.onRequestCancelled(); } mExecutingCaptureConfigCallbacks.clear(); } notifySurfaceDetached(); }

Target:
public void notifyCameraDeviceClose() { notifySurfaceDetached(); }
Source:
public int hashCode() { int result = typeVariable.hashCode(); result = 31 * result + (declaredOnType() ? 1 : 0); return result; }

Target:
public int hashCode() { int result = typeVariable.hashCode(); result = 31 * result + container.hashCode(); return result; }