auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addImport(boolean enabled, String importType, String importFormat, String importBundle, Properties config) { addImport(enabled, importType, importFormat, importBundle, config, null); }

Target:
public void addImport(boolean enabled, String importType, String importFormat, String importBundle, Properties config) { addImport(enabled, importType, importFormat, importBundle, config, new Properties()); }
Source:
private DetectionConfigDTO generateDetectionConfig(Map<String, Object> yamlConfigMap, Map<String, Object> detectionProperties, Map<String, Object> qualityProperties, String cron) { DetectionConfigDTO config = new DetectionConfigDTO(); config.setName(MapUtils.getString(yamlConfigMap, PROP_DETECTION_NAME)); config.setDescription(MapUtils.getString(yamlConfigMap, PROP_DESC_NAME)); config.setDescription(MapUtils.getString(yamlConfigMap, PROP_DESC_NAME)); config.setLastTimestamp(System.currentTimeMillis()); config.setOwners(filterOwners(ConfigUtils.getList(yamlConfigMap.get(PROP_OWNERS)))); config.setProperties(detectionProperties); config.setDataQualityProperties(qualityProperties); config.setComponentSpecs(this.metricAttributesMap.getAllComponenets()); config.setCron(cron); config.setActive(MapUtils.getBooleanValue(yamlConfigMap, PROP_ACTIVE, true)); config.setYaml(yamlConfig); config.setBackfillStart(parseTimeStampLong(yamlConfigMap.get(PROP_BACKFILL_START))); List<DatasetConfigDTO> datasetConfigs = this.metricAttributesMap.getAllDatasets(); if (MapUtils.getString(yamlConfigMap, PROP_CRON) == null && datasetConfigs.stream().allMatch(c -> c.bucketTimeGranularity().getUnit().equals(TimeUnit.DAYS)) && datasetConfigs.stream().allMatch(c -> c.getDataSource().equals(PinotThirdEyeDataSource.DATA_SOURCE_NAME))) { config.setDataAvailabilitySchedule(true); } return config; }

Target:
private DetectionConfigDTO generateDetectionConfig(Map<String, Object> yamlConfigMap, Map<String, Object> detectionProperties, Map<String, Object> qualityProperties, String cron) { DetectionConfigDTO config = new DetectionConfigDTO(); config.setName(MapUtils.getString(yamlConfigMap, PROP_DETECTION_NAME)); config.setDescription(MapUtils.getString(yamlConfigMap, PROP_DESC_NAME)); config.setDescription(MapUtils.getString(yamlConfigMap, PROP_DESC_NAME)); config.setOwners(filterOwners(ConfigUtils.getList(yamlConfigMap.get(PROP_OWNERS)))); config.setLastTimestamp(longValue(yamlConfigMap.get(PROP_LAST_TIMESTAMP))); config.setProperties(detectionProperties); config.setDataQualityProperties(qualityProperties); config.setComponentSpecs(this.metricAttributesMap.getAllComponenets()); config.setCron(cron); config.setActive(MapUtils.getBooleanValue(yamlConfigMap, PROP_ACTIVE, true)); config.setYaml(yamlConfig); List<DatasetConfigDTO> datasetConfigs = this.metricAttributesMap.getAllDatasets(); if (MapUtils.getString(yamlConfigMap, PROP_CRON) == null && datasetConfigs.stream().allMatch(c -> c.bucketTimeGranularity().getUnit().equals(TimeUnit.DAYS)) && datasetConfigs.stream().allMatch(c -> c.getDataSource().equals(PinotThirdEyeDataSource.DATA_SOURCE_NAME))) { config.setDataAvailabilitySchedule(true); } return config; }
Source:
protected @NonNull ITmfStateProvider createStateProvider() { ITmfTrace trace = getTrace(); if (!(trace instanceof TmfExperiment)) { throw new IllegalStateException(); } return new ContainerStateProvider((TmfExperiment) trace); }

Target:
protected @NonNull ITmfStateProvider createStateProvider() { return new ContainerStateProvider((TmfExperiment) checkNotNull(getTrace())); }
Source:
public void update(SolGame game) { body.update(game); if (obstacle != null) { if (obstacle instanceof SolObjectEntityWrapper) { EntityRef entity = ((SolObjectEntityWrapper) obstacle).getEntity(); if (!wasDamageDealt) { if (config.aoeRadius >= 0) { EntityIterator iterator = game.getEntitySystemManager().getEntityManager().iterate(new Position()); while (iterator.next()) { Vector2 entityPosition = iterator.getEntity().getComponent(Position.class).get().position; if (getPosition().dst2(entityPosition) <= config.aoeRadius) { game.getEntitySystemManager().sendEvent(new DamageEvent(config.dmg), entity); } } } else { game.getEntitySystemManager().sendEvent(new DamageEvent(config.dmg), entity); } } if (config.density > 0) { obstacle = null; wasDamageDealt = true; } collided(game); return; } else { if (!wasDamageDealt) { if (config.aoeRadius >= 0) { game.getObjectManager().doToAllCloserThan(config.aoeRadius, this, (SolObject obj) -> obj.receiveDmg(config.dmg, game, body.getPosition(), config.dmgType) ); } else { obstacle.receiveDmg(config.dmg, game, body.getPosition(), config.dmgType); } } if (config.density > 0) { obstacle = null; wasDamageDealt = true; } else { collided(game); if (config.emTime > 0 && obstacle instanceof SolShip) { ((SolShip) obstacle).disableControls(config.emTime, game); } return; } } } if (lightSource != null) { lightSource.update(true, body.getAngle(), game); } maybeGuide(game); game.getSoundManager().play(game, config.workSound, null, this); }

Target:
public void update(SolGame game) { body.update(game); if (obstacle != null) { if (obstacle instanceof SolObjectEntityWrapper) { EntityRef entity = ((SolObjectEntityWrapper) obstacle).getEntity(); if (!wasDamageDealt) { if (config.aoeRadius >= 0) { EntityIterator iterator = game.getEntitySystemManager().getEntityManager().iterate(new Position()); while (iterator.next()) { Vector2 entityPosition = iterator.getEntity().getComponent(Position.class).get().position; if (getPosition().dst2(entityPosition) <= config.aoeRadius) { game.getEntitySystemManager().sendEvent(new DamageEvent(config.dmg), entity); } } } else { game.getEntitySystemManager().sendEvent(new DamageEvent(config.dmg), entity); } } if (config.density > 0) { obstacle = null; wasDamageDealt = true; } else { collided(game); return; } } else { if (!wasDamageDealt) { if (config.aoeRadius >= 0) { game.getObjectManager().doToAllCloserThan(config.aoeRadius, this, (SolObject obj) -> obj.receiveDmg(config.dmg, game, body.getPosition(), config.dmgType) ); } else { obstacle.receiveDmg(config.dmg, game, body.getPosition(), config.dmgType); } } if (config.density > 0) { obstacle = null; wasDamageDealt = true; } else { collided(game); if (config.emTime > 0 && obstacle instanceof SolShip) { ((SolShip) obstacle).disableControls(config.emTime, game); } return; } } } if (lightSource != null) { lightSource.update(true, body.getAngle(), game); } maybeGuide(game); game.getSoundManager().play(game, config.workSound, null, this); }
Source:
public void testEvaluateByNameWithEmptyParam() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass() ); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "simple-item-def" ); assertThat( dmnModel, notNullValue() ); assertThat( DMNRuntimeUtil.formatMessages( dmnModel.getMessages() ), dmnModel.hasErrors(), is( false ) ); final DMNContext context = DMNFactory.newContext(); context.set( "Monthly Salary", 1000 ); try { String[] decisionNames = new String[]{}; runtime.evaluateByName(dmnModel, context, decisionNames); fail("Should throw an IllegalArgumentException"); } catch (IllegalArgumentException e) { assertTrue(true); } }

Target:
public void testEvaluateByNameWithEmptyParam() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("simple-item-def.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "simple-item-def"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); context.set("Monthly Salary", 1000); String[] decisionNames = new String[]{}; runtime.evaluateByName(dmnModel, context, decisionNames); }
Source:
public void writeActiveCache(int index) { if (!cacheActiveEnabled) { return; } synchronized (cacheActiveFile) { boolean exist = cacheActiveFile.exists(); try (RandomAccessFile raf = new RandomAccessFile(cacheActiveFile, "rw"); FileChannel fc = raf.getChannel(); FileLock lock = fc.tryLock()) { if (lock != null) { raf.setLength(0); raf.writeBytes(String.valueOf(index)); if (!exist) { boolean ret = cacheActiveFile.setWritable(true, false) && cacheActiveFile.setReadable(true, false); if (!ret) { throw new IOException("Cannot set file rw mode."); } } LOG.debug("Succeed in writing active index " + index + " to cache file " + cacheActiveFile); } } catch (Throwable e) { LOG.warn("Filed to write active index " + index + " to cache file " + cacheActiveFile, e); } } }

Target:
private void writeActiveCache(int index) { if (!cacheActiveEnabled) { return; } synchronized (cacheActiveFile) { try (RandomAccessFile raf = new RandomAccessFile(cacheActiveFile, "rw"); FileChannel fc = raf.getChannel(); FileLock lock = fc.tryLock(0, Long.MAX_VALUE, false)) { if (lock != null) { raf.setLength(0); raf.writeBytes(String.valueOf(index)); boolean ret = cacheActiveFile.setWritable(true, false) && cacheActiveFile.setReadable(true, false); if (!ret) { throw new IOException("Cannot set file rw mode."); } LOG.debug("Succeed in writing active index " + index + " to cache file " + cacheActiveFile); } } catch (Throwable e) { LOG.warn("Failed to write active index " + index + " to cache file " + cacheActiveFile + ", It may be due to permission issues, the " + "dfs.client.failover.cache-active.dir must be properly " + "configured!", e); } } }
Source:
protected boolean hasInferredTypeHeader(MessageProperties properties) { boolean hasInferredTypeHeader = properties.getInferredArgumentType() != null; return hasInferredTypeHeader; }

Target:
protected boolean hasInferredTypeHeader(MessageProperties properties) { return properties.getInferredArgumentType() != null; }
Source:
public void persistBestPossibleAssignment( Map<String, ResourceAssignment> bestPossibleAssignment) { _bestPossibleAssignment.putAll(bestPossibleAssignment); HelixProperty combinedAssignments = combineAssignments(BEST_POSSIBLE_KEY, bestPossibleAssignment); try { _dataAccessor.compressedBucketWrite(_bestPossiblePath, combinedAssignments); } catch (IOException e) { throw new HelixException("Failed to persist baseline!", e); } }

Target:
public void persistBestPossibleAssignment( Map<String, ResourceAssignment> bestPossibleAssignment) { HelixProperty combinedAssignments = combineAssignments(BEST_POSSIBLE_KEY, bestPossibleAssignment); try { _dataAccessor.compressedBucketWrite(_bestPossiblePath, combinedAssignments); } catch (IOException e) { throw new HelixException("Failed to persist baseline!", e); } _bestPossibleAssignment = bestPossibleAssignment; }
Source:
public void testJunctionIsRemovedButNotContents() throws Exception { TemporaryFolder dir1 = new TemporaryFolder(tmp.getRoot()); dir1.create(); File dir1Root = dir1.getRoot(); File f1 = dir1.newFile(); File j1 = makeJunction(tmp.getRoot(), dir1Root); print(tmp.getRoot()); print(dir1Root); print(j1); Util.deleteRecursive(j1); print(dir1Root); print(tmp.getRoot()); assertTrue(f1.exists()); }

Target:
public void testJunctionIsRemovedButNotContents() throws Exception { File subdir1 = tmp.newFolder("notJunction"); File f1 = new File(subdir1, "testfile1.txt"); assertTrue("Unable to create temporary file in notJunction directory", f1.createNewFile()); File j1 = makeJunction(tmp.getRoot(), subdir1); Util.deleteRecursive(j1); assertFalse("Windows Junction should have been removed", j1.exists()); assertTrue("Contents of Windows Junction should not be removed", f1.exists()); }
Source:
public Page getOutput() { if ((state != State.FINISHING) || !finishFuture.isDone()) { return null; } state = State.FINISHED; Collection<Slice> fragments = getFutureValue(finishFuture); PageBuilder page = new PageBuilder(fragments.size() + 2, TYPES); BlockBuilder rowsBuilder = page.getBlockBuilder(0); BlockBuilder fragmentBuilder = page.getBlockBuilder(1); BlockBuilder operatorExecutionContextBuilder = page.getBlockBuilder(2); TaskId taskId = operatorContext.getDriverContext().getPipelineContext().getTaskId(); Slice operatorExecutionContext = wrappedBuffer(operatorExecutionContextCodec.toJsonBytes(new OperatorExecutionContext(operatorContext.getDriverContext().getLifespan(), taskId.getStageId().getId(), taskId.getId(), CommitGranularity.TABLE, true))); page.declarePosition(); BIGINT.writeLong(rowsBuilder, rowCount); fragmentBuilder.appendNull(); VARBINARY.writeSlice(operatorExecutionContextBuilder, operatorExecutionContext); for (Slice fragment : fragments) { page.declarePosition(); rowsBuilder.appendNull(); VARBINARY.writeSlice(fragmentBuilder, fragment); VARBINARY.writeSlice(operatorExecutionContextBuilder, operatorExecutionContext); } return page.build(); }

Target:
public Page getOutput() { if ((state != State.FINISHING) || !finishFuture.isDone()) { return null; } state = State.FINISHED; Collection<Slice> fragments = getFutureValue(finishFuture); int positionCount = fragments.size() + 1; BlockBuilder rowsBuilder = BIGINT.createBlockBuilder(null, positionCount); BlockBuilder fragmentBuilder = VARBINARY.createBlockBuilder(null, positionCount); rowsBuilder.writeLong(rowCount); fragmentBuilder.appendNull(); for (Slice fragment : fragments) { rowsBuilder.appendNull(); VARBINARY.writeSlice(fragmentBuilder, fragment); } TaskId taskId = operatorContext.getDriverContext().getPipelineContext().getTaskId(); Slice tableCommitContext = wrappedBuffer(tableCommitContextCodec.toJsonBytes( new TableCommitContext( operatorContext.getDriverContext().getLifespan(), taskId.getStageId().getId(), taskId.getId(), CommitGranularity.TABLE, true))); return new Page(positionCount, rowsBuilder.build(), fragmentBuilder.build(), RunLengthEncodedBlock.create(VARBINARY, tableCommitContext, positionCount)); }
Source:
protected boolean set(ItemStack dataHolder, Map<Key<?>, Object> keyValues) { if (!dataHolder.hasTagCompound()) { dataHolder.setTagCompound(new NBTTagCompound()); } int flag = 0; if ((boolean) keyValues.get(Keys.HIDE_ENCHANTMENTS)) { flag += 1; } if ((boolean) keyValues.get(Keys.HIDE_ATTRIBUTES)) { flag += 2; } if ((boolean) keyValues.get(Keys.HIDE_UNBREAKABLE)) { flag += 4; } if ((boolean) keyValues.get(Keys.HIDE_CAN_DESTROY)) { flag += 8; } if ((boolean) keyValues.get(Keys.HIDE_CAN_PLACE)) { flag += 16; } if ((boolean) keyValues.get(Keys.HIDE_MISCELLANEOUS)) { flag += 32; } dataHolder.getTagCompound().setInteger(NbtDataUtil.ITEM_HIDE_FLAGS, flag); return true; }

Target:
protected boolean set(ItemStack dataHolder, Map<Key<?>, Object> keyValues) { if (!dataHolder.hasTagCompound()) { dataHolder.setTagCompound(new NBTTagCompound()); } int flag = 0; if ((boolean) keyValues.get(Keys.HIDE_ENCHANTMENTS)) { flag |= DataConstants.HIDE_ENCHANTMENTS_FLAG; } if ((boolean) keyValues.get(Keys.HIDE_ATTRIBUTES)) { flag |= DataConstants.HIDE_ATTRIBUTES_FLAG; } if ((boolean) keyValues.get(Keys.HIDE_UNBREAKABLE)) { flag |= DataConstants.HIDE_UNBREAKABLE_FLAG; } if ((boolean) keyValues.get(Keys.HIDE_CAN_DESTROY)) { flag |= DataConstants.HIDE_CAN_DESTROY_FLAG; } if ((boolean) keyValues.get(Keys.HIDE_CAN_PLACE)) { flag |= DataConstants.HIDE_CAN_PLACE_FLAG; } if ((boolean) keyValues.get(Keys.HIDE_MISCELLANEOUS)) { flag |= DataConstants.HIDE_MISCELLANEOUS_FLAG; } dataHolder.getTagCompound().setInteger(NbtDataUtil.ITEM_HIDE_FLAGS, flag); return true; }
Source:
public void prepare(InternalEnvironment env, OpenShiftEnvironment osEnv, String workspaceId) throws InfrastructureException { final String subPath = getSubPath(workspaceId); pvcJobExecutor.execute(workspaceId, CREATE_DIRS, subPath); final PersistentVolumeClaim pvc = osEnv.getPersistentVolumeClaims().get(pvcName); if (pvc != null) { return; } final String machineWithSources = getWsAgentServerMachine(env) .orElseThrow(() -> new InfrastructureException("Machine with ws-agent not found")); osEnv.getPersistentVolumeClaims().put(pvcName, newPVC(pvcName, pvcAccessMode, pvcQuantity)); for (Pod pod : osEnv.getPods().values()) { final PodSpec podSpec = pod.getSpec(); for (Container container : podSpec.getContainers()) { final String machine = Names.machineName(pod, container); if (machine.equals(machineWithSources)) { container.getVolumeMounts().add(newVolumeMount(pvcName, projectsPath, subPath)); podSpec.getVolumes().add(newVolume(pvcName, pvcName)); return; } } } }

Target:
public void prepare(InternalEnvironment env, OpenShiftEnvironment osEnv, String workspaceId) throws InfrastructureException { final String machineWithSources = getWsAgentServerMachine(env) .orElseThrow(() -> new InfrastructureException("Machine with ws-agent not found")); final Map<String, PersistentVolumeClaim> claims = osEnv.getPersistentVolumeClaims(); claims.put(pvcName, newPVC(pvcName, pvcAccessMode, pvcQuantity)); factory.create(workspaceId).persistentVolumeClaims().createIfNotExist(claims.values()); final String subPath = workspaceId + projectsPath; pvcSubPathHelper.createDirs(workspaceId, subPath); for (Pod pod : osEnv.getPods().values()) { final PodSpec podSpec = pod.getSpec(); for (Container container : podSpec.getContainers()) { final String machine = Names.machineName(pod, container); if (machine.equals(machineWithSources)) { container.getVolumeMounts().add(newVolumeMount(pvcName, projectsPath, subPath)); podSpec.getVolumes().add(newVolume(pvcName, pvcName)); return; } } } }
Source:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList()); for (DocumentRef ref : refs) { if (!session.isRecord(ref)) { log.debug("Document is not a record", ref); continue; } Calendar retainUntil = session.getRetentionUntil(ref); if (retainUntil == null) { log.debug("Document was not under retention", ref); continue; } if (isUnderRetention(retainUntil)) { log.debug("Document is still under retention: {}", ref, retainUntil.toInstant()); continue; } try { session.setRetentionUntil(ref, null); sendEvent(session, ref, retainUntil); } catch (NuxeoException e) { log.warn("Cannot reset retention on: {}", ref, e); } } try { session.save(); } catch (PropertyException e) { log.warn("Cannot save session", e); } }

Target:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList()); for (DocumentRef ref : refs) { if (!session.isRecord(ref)) { log.debug("Document: is not a record", ref); continue; } Calendar retainUntil = session.getRetainUntil(ref); if (retainUntil == null) { log.debug("Document: was not under retention", ref); continue; } if (isUnderRetention(retainUntil)) { log.debug("Document: is still under retention: {}", () -> ref, retainUntil::toInstant); continue; } try { session.setRetainUntil(ref, null, null); sendEvent(session, ref, retainUntil); } catch (NuxeoException e) { log.warn("Cannot reset retention on: {}", ref, e); } } try { session.save(); } catch (PropertyException e) { log.warn("Cannot save session", e); } }
Source:
public void testNull() throws Throwable { byte[] b = new byte[8]; for (PDataType type : PDataType.values()) { try { type.toBytes(null); type.toBytes(null, b, 0); type.toObject(new byte[0],0,0); type.toObject(new byte[0],0,0, type); } catch (ConstraintViolationException e) { if(type.isArrayType()) { } else if (! (type.isFixedWidth() && e.getMessage().contains("may not be null"))) { fail(type + ":" + e); } } } }

Target:
public void testNull() throws Throwable { byte[] b = new byte[8]; for (PDataType type : PDataType.values()) { try { if (!type.isArrayType()) { type.toBytes(null); type.toBytes(null, b, 0); type.toObject(new byte[0], 0, 0); type.toObject(new byte[0], 0, 0, type); } else { type.toBytes(new PhoenixArray()); type.toBytes(new PhoenixArray(), b, 0); type.toObject(new byte[0], 0, 0); type.toObject(new byte[0], 0, 0, type); } } catch (ConstraintViolationException e) { if (!type.isArrayType() && ! ( type.isFixedWidth() && e.getMessage().contains("may not be null"))) { fail(type + ":" + e); } } } }
Source:
public void registerEventInTimeRange(ITmfEvent event, ITmfExtraEventInfo extraInfo) { TmfFixedArray<String>[] paths = getNormalPaths(event, extraInfo); for (TmfFixedArray<String> path : paths) ++(getOrCreate(path).getValue().nbEventsInTimeRange); paths = getTypePaths(event, extraInfo); for (TmfFixedArray<String> path : paths) ++(getOrCreate(path).getValue().nbEventsInTimeRange); }

Target:
public void registerEventInTimeRange(ITmfEvent event, ITmfExtraEventInfo extraInfo) { TmfFixedArray<String>[] paths = getNormalPaths(event, extraInfo); for (TmfFixedArray<String> path : paths) { ++(getOrCreate(path).getValue().nbEventsInTimeRange); } paths = getTypePaths(event, extraInfo); for (TmfFixedArray<String> path : paths) { ++(getOrCreate(path).getValue().nbEventsInTimeRange); } }
Source:
private void invokeListener(Byte plc, GridMessageListener lsnr, UUID nodeId, Object msg, UUID secSubjId) { Byte oldPlc = CUR_PLC.get(); boolean change = !F.eq(oldPlc, plc); if (change) CUR_PLC.set(plc); UUID curSecSubjId = secSubjId != null ? secSubjId : nodeId; try(SecurityContextHolder s = ctx.security().replaceContext(curSecSubjId)) { lsnr.onMessage(nodeId, msg, plc); } finally { if (change) CUR_PLC.set(oldPlc); } }

Target:
private void invokeListener(Byte plc, GridMessageListener lsnr, UUID nodeId, Object msg, UUID secSubjId) { Byte oldPlc = CUR_PLC.get(); boolean change = !F.eq(oldPlc, plc); if (change) CUR_PLC.set(plc); UUID newSecSubjId = secSubjId != null ? secSubjId : nodeId; try(OperationSecurityContext s = ctx.security().withContext(newSecSubjId)) { lsnr.onMessage(nodeId, msg, plc); } finally { if (change) CUR_PLC.set(oldPlc); } }
Source:
public void editJdbcStoreDatasource() throws Exception { page.navigate(); page.switchToStore(); final String datasource = createDatasource(); try { new ConfigChecker.Builder(client, TRANSACTIONS_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, JDBC_STATE_STORE_TABLE_PREFIX, datasource) .verifyFormSaved() .verifyAttribute(JDBC_STATE_STORE_TABLE_PREFIX, datasource); } finally { client.apply(new RemoveDataSource(datasource)); } }

Target:
public void editJdbcStoreDatasource() throws Exception { page.navigate(); page.switchToStore(); final String datasource = createDatasource(); new ConfigChecker.Builder(client, TRANSACTIONS_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, JDBC_STORE_DATASOURCE, datasource) .verifyFormSaved() .verifyAttribute(JDBC_STORE_DATASOURCE, datasource); }
Source:
public void testPush() throws Exception { ObjectApi objectApi = EasyMock.createStrictMock(ObjectApi.class); EasyMock.expect(objectApi.put(EasyMock.anyString(), EasyMock.<Payload>anyObject())).andReturn(null).atLeastOnce(); EasyMock.replay(objectApi); CloudFilesApi api = EasyMock.createStrictMock(CloudFilesApi.class); EasyMock.expect(api.getObjectApi(EasyMock.anyString(), EasyMock.anyString())) .andReturn(objectApi) .atLeastOnce(); EasyMock.replay(api); CloudFilesDataSegmentPusherConfig config = new CloudFilesDataSegmentPusherConfig(); config.region = "region"; config.container = "container"; config.basePath = "basePath"; CloudFilesDataSegmentPusher pusher = new CloudFilesDataSegmentPusher(api, config, new DefaultObjectMapper()); File tmpDir = Files.createTempDir(); tmpDir.deleteOnExit(); File tmp = new File(tmpDir, "version.bin"); tmp.deleteOnExit(); final byte[] data = new byte[]{0x0, 0x0, 0x0, 0x1}; Files.write(data, tmp); final long size = data.length; DataSegment segmentToPush = new DataSegment( "foo", new Interval("2015/2016"), "0", Maps.<String, Object>newHashMap(), Lists.<String>newArrayList(), Lists.<String>newArrayList(), new NoneShardSpec(), 0, size ); DataSegment segment = pusher.push(tmpDir, segmentToPush); EasyMock.verify(api); }

Target:
public void testPush() throws Exception { ObjectApi objectApi = EasyMock.createStrictMock(ObjectApi.class); EasyMock.expect(objectApi.put(EasyMock.anyString(), EasyMock.<Payload>anyObject())).andReturn(null).atLeastOnce(); EasyMock.replay(objectApi); CloudFilesApi api = EasyMock.createStrictMock(CloudFilesApi.class); EasyMock.expect(api.getObjectApi(EasyMock.anyString(), EasyMock.anyString())) .andReturn(objectApi) .atLeastOnce(); EasyMock.replay(api); CloudFilesDataSegmentPusherConfig config = new CloudFilesDataSegmentPusherConfig(); config.setRegion("region"); config.setContainer("container"); config.setBasePath("basePath"); CloudFilesDataSegmentPusher pusher = new CloudFilesDataSegmentPusher(api, config, new DefaultObjectMapper()); File tmp = tempFolder.newFile("version.bin"); final byte[] data = new byte[]{0x0, 0x0, 0x0, 0x1}; Files.write(data, tmp); final long size = data.length; DataSegment segmentToPush = new DataSegment( "foo", new Interval("2015/2016"), "0", Maps.<String, Object>newHashMap(), Lists.<String>newArrayList(), Lists.<String>newArrayList(), new NoneShardSpec(), 0, size ); DataSegment segment = pusher.push(tempFolder.getRoot(), segmentToPush); Assert.assertEquals(segmentToPush.getSize(), segment.getSize()); EasyMock.verify(api); }
Source:
public Transaction beginTransaction(MuleContext muleContext) throws TransactionException { return null; }

Target:
public Transaction beginTransaction(MuleContext muleContext) { try { return beginTransaction(muleContext.getConfiguration().getId(), ((MuleContextWithRegistry) muleContext).getRegistry().lookupObject(NotificationDispatcher.class), muleContext.getTransactionFactoryManager(), muleContext.getTransactionManager(), mockTransaction.getTimeout()); } catch (Exception e) { throw new RuntimeException(); } }
Source:
public void testCreateTopicsPartialResponse() throws Exception { try (AdminClientUnitTestEnv env = mockClientEnv()) { env.kafkaClient().setNodeApiVersions(NodeApiVersions.create()); env.kafkaClient().prepareResponse(body -> body instanceof CreateTopicsRequest, prepareCreateTopicsResponse("myTopic", Errors.NONE)); CreateTopicsResult topicsResult = env.adminClient().createTopics( asList(new NewTopic("myTopic", Collections.singletonMap(0, asList(0, 1, 2))), new NewTopic("myTopic2", Collections.singletonMap(0, asList(0, 1, 2)))), new CreateTopicsOptions().timeoutMs(10000)); topicsResult.values().get("myTopic").get(); try { topicsResult.values().get("myTopic2").get(); fail("Expected an exception."); } catch (ExecutionException e) { assertTrue("Expected an ExecutionException wrapping an ApiException, but got " + Utils.stackTrace(e), e.getCause() instanceof ApiException); } } }

Target:
public void testCreateTopicsPartialResponse() throws Exception { try (AdminClientUnitTestEnv env = mockClientEnv()) { env.kafkaClient().setNodeApiVersions(NodeApiVersions.create()); env.kafkaClient().prepareResponse(body -> body instanceof CreateTopicsRequest, prepareCreateTopicsResponse("myTopic", Errors.NONE)); CreateTopicsResult topicsResult = env.adminClient().createTopics( asList(new NewTopic("myTopic", Collections.singletonMap(0, asList(0, 1, 2))), new NewTopic("myTopic2", Collections.singletonMap(0, asList(0, 1, 2)))), new CreateTopicsOptions().timeoutMs(10000)); topicsResult.values().get("myTopic").get(); TestUtils.assertFutureThrows(topicsResult.values().get("myTopic2"), ApiException.class); } }
Source:
private void copyAllMemoryImages(Guid containerId) { for (String memoryVolumes : MemoryUtils.getMemoryVolumesFromSnapshots(getVm().getSnapshots())) { List<Guid> guids = Guid.createGuidListFromString(memoryVolumes); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext( ActionType.CopyImageGroup, buildMoveOrCopyImageGroupParametersForMemoryDumpImage( containerId, guids.get(0), guids.get(2), guids.get(3))); if (!vdcRetValue.getSucceeded()) { throw new EngineException(vdcRetValue.getFault().getError(), "Failed to copy memory image"); } getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); vdcRetValue = runInternalActionWithTasksContext( ActionType.CopyImageGroup, buildMoveOrCopyImageGroupParametersForMemoryConfImage( containerId, guids.get(0), guids.get(4), guids.get(5))); if (!vdcRetValue.getSucceeded()) { throw new EngineException(vdcRetValue.getFault().getError(), "Failed to copy metadata image"); } getReturnValue().getVdsmTaskIdList().addAll(vdcRetValue.getInternalVdsmTaskIdList()); } }

Target:
private void copyAllMemoryImages(Guid containerId) { for (String memoryVolumes : MemoryUtils.getMemoryVolumesFromSnapshots(getVm().getSnapshots())) { List<Guid> guids = Guid.createGuidListFromString(memoryVolumes); ActionReturnValue vdcRetValue = runInternalActionWithTasksContext( ActionType.CopyImageGroup, buildMoveOrCopyImageGroupParametersForMemoryDumpImage( containerId, guids.get(0), guids.get(2), guids.get(3))); if (!vdcRetValue.getSucceeded()) { throw new EngineException(vdcRetValue.getFault().getError(), "Failed to copy memory image"); } getTaskIdList().addAll(vdcRetValue.getVdsmTaskIdList()); vdcRetValue = runInternalActionWithTasksContext( ActionType.CopyImageGroup, buildMoveOrCopyImageGroupParametersForMemoryConfImage( containerId, guids.get(0), guids.get(4), guids.get(5))); if (!vdcRetValue.getSucceeded()) { throw new EngineException(vdcRetValue.getFault().getError(), "Failed to copy metadata image"); } getTaskIdList().addAll(vdcRetValue.getVdsmTaskIdList()); } }
Source:
public void afterSend(long start, boolean result) { if (start > 0) { long now = System.currentTimeMillis(); long elapsed = now - start; if (result && this.fullStatsEnabled) { sendSuccessRatio.success(); sendDuration.append(elapsed); } else { if (this.fullStatsEnabled) { sendSuccessRatio.failure(); sendErrorCount.incrementAndGet(); } sendErrorRate.increment(); } if (logger.isTraceEnabled()) { logger.trace("Elapsed: " + this.name + ": " + elapsed); } } }

Target:
public void afterSend(long start, boolean result) { if (start > 0) { long now = System.currentTimeMillis(); long elapsed = now - start; if (result && this.fullStatsEnabled) { sendSuccessRatio.success(now); sendDuration.append(elapsed); } else { if (this.fullStatsEnabled) { sendSuccessRatio.failure(now); sendErrorCount.incrementAndGet(); } sendErrorRate.increment(); } if (logger.isTraceEnabled()) { logger.trace("Elapsed: " + this.name + ": " + elapsed); } } }
Source:
ClassPathWriteToFileArg(BuildTarget target, String prefix, Arg delegate) { super(target, prefix, delegate); }

Target:
public ClassPathWriteToFileArg(BuildTarget target, String prefix, Arg delegate) { super(target, prefix, delegate); }
Source:
public ExpressionsUpdateEtagTrigger() { super("portal.expressions_etags", 9); }

Target:
public ExpressionsUpdateEtagTrigger() { super(ExpressionEtags::incrementEtag, 9); }
Source:
public static int convert(String num) { if (num == null) { return 1; } switch (num) { case "I": return 1; case "II": return 2; case "III": return 3; default: throw new RuntimeException("unknown roman numeral \"" + num + "\""); } }

Target:
public static int convert(String num) { switch (num) { case "I": return 1; case "II": return 2; case "III": return 3; default: throw new RuntimeException("unknown roman numeral \"" + num + "\""); } }
Source:
public void add(double value, double weight) { checkArgument(!isNaN(value), "value is NaN"); checkArgument(!isNaN(weight), "weight is NaN"); if (centroidCount == means.length) { if (means.length < maxSize) { ensureCapacity(Math.min(means.length * 2, maxSize)); } else { merge(internalCompressionFactor(compression)); } } means[centroidCount] = value; weights[centroidCount] = weight; centroidCount++; totalWeight += weight; min = Math.min(value, min); max = Math.max(value, max); needsMerge = true; }

Target:
public void add(double value, double weight) { checkArgument(!isNaN(value), "value is NaN"); checkArgument(!isNaN(weight), "weight is NaN"); checkArgument(!isInfinite(value), "value must be finite"); checkArgument(!isInfinite(weight), "weight must be finite"); if (centroidCount == means.length) { if (means.length < maxSize) { ensureCapacity(Math.min(means.length * 2, maxSize)); } else { merge(internalCompressionFactor(compression)); } } means[centroidCount] = value; weights[centroidCount] = weight; centroidCount++; totalWeight += weight; min = Math.min(value, min); max = Math.max(value, max); needsMerge = true; }
Source:
public static RexNode removeCast(RexNode e) { for (;;) { switch (e.getKind()) { case CAST: RelDataType destType = e.getType(); e = ((RexCall) e).operands.get(0); if (!SqlTypeUtil.canCastFrom(destType, e.getType(), true)) { throw new UnsupportedOperationException( String.format( Locale.ROOT, "Cannot cast %s to %s", e.getType().getSqlTypeName(), destType.getSqlTypeName())); } break; default: return e; } } }

Target:
public static RexNode removeCast(RexNode e) { for (;;) { switch (e.getKind()) { case CAST: e = ((RexCall) e).operands.get(0); break; default: return e; } } }
Source:
public final GraphFactory<V> getFactory(final String graphLibrary) { if ("JGraphT".equalsIgnoreCase(graphLibrary)) { return new JGraphTGraphFactory<V>(); } throw new IllegalArgumentException(); }

Target:
public static <V extends Comparable<V>> GraphFactory<V> getFactory( final String graphLibrary) { if (JGRAPHT.equalsIgnoreCase(graphLibrary)) { return new JGraphTGraphFactory<V>(); } throw new IllegalArgumentException(); }
Source:
public void validateSystemTag(String resourceUuid, String resourceType, String tag) { boolean checked = false; for (SystemTag stag : systemTags) { if (stag.isMatch(tag)) { checked = true; stag.validate(resourceUuid, resourceTypeClassMap.get(resourceType), tag); } } if (!checked) { throw new ApiMessageInterceptionException(errf.stringToInvalidArgumentError( String.format("no system tag matches %s", tag) )); } queryDbValidate(resourceUuid, resourceType); }

Target:
public void validateSystemTag(String resourceUuid, String resourceType, String tag) { boolean checked = false; for (SystemTag stag : systemTags) { if (stag.isMatch(tag)) { checked = true; stag.validate(resourceUuid, resourceTypeClassMap.get(resourceType), tag); } } if (!checked) { throw new ApiMessageInterceptionException(errf.stringToInvalidArgumentError( String.format("no system tag matches %s", tag) )); } checkIfResourceHasThisTagType(resourceUuid, resourceType); }
Source:
public void removeConnection(final INode nodeToRemove) { if (nodeToRemove.equals(this.node)) { throw new IllegalArgumentException("Cant remove yourself!"); } notifyPlayerRemoval(nodeToRemove); final SocketChannel channel = nodeToChannel.remove(nodeToRemove); if (channel == null) { log.warning("Could not find node to remove: " + nodeToRemove); return; } channelToNode.remove(channel); nioSocket.close(channel); notifyConnectionsChanged(false, nodeToRemove); log.info("Connection removed:" + nodeToRemove); }

Target:
public void removeConnection(final INode nodeToRemove) { if (nodeToRemove.equals(this.node)) { throw new IllegalArgumentException("Can't remove yourself!"); } notifyPlayerRemoval(nodeToRemove); final SocketChannel channel = nodeToChannel.remove(nodeToRemove); if (channel == null) { log.warning("Could not find node to remove: " + nodeToRemove); return; } channelToNode.remove(channel); nioSocket.close(channel); notifyConnectionsChanged(false, nodeToRemove); log.info("Connection removed:" + nodeToRemove); }
Source:
private void submitIfAssigned(Committee[][] committees) { Committee.Index index = scanCommittees(validatorIdx, committees); if (index.isEmpty()) return; if (index.getCommitteeIdx() > 0) return; long slotNumber = calcNextProposingSlot(proposer.getSlotNumber(System.currentTimeMillis()), index.getSlotOffset()); if (slotNumber % index.getCommitteeSize() == index.getValidatorIdx()) { this.submit(slotNumber); } }

Target:
private void submitIfAssigned(Committee[][] committees) { Committee.Index index = scanCommittees(validatorIdx, committees); if (index.isEmpty()) return; if (index.getCommitteeIdx() > 0) return; long slotNumber = calcNextProposingSlot(getCurrentSlotNumber(), index.getSlotOffset()); if (slotNumber % index.getCommitteeSize() == index.getValidatorIdx()) { this.submit(slotNumber); } }
Source:
private void checkForCommonErrors(Type type) { final Class<?> clazz = toClass(type); if (clazz == null) { return; } if (clazz == Row.class) { throw extractionError( "Cannot extract a data type from a pure '%s' class. " + "Please use annotations to define field names and field types.", Row.class.getName()); } else if (clazz == Object.class) { throw extractionError( "Cannot extract a data type from a pure '%s' class. " + "Usually, this indicates that class information is missing or got lost. " + "Please specify a more concrete class or treat it as a RAW type.", Object.class.getName()); } else if (INTERNAL_DATA_STRUCTURES.contains(clazz)) { throw extractionError( "Cannot extract a data type from a pure internal '%s' class. " + "Please use annotations to define the logical type.", clazz.getName()); } else if (clazz.getName().startsWith("scala.Tuple")) { throw extractionError( "Scala tuples are not supported. Use case classes or '%s' instead.", Row.class.getName()); } else if (clazz.getName().startsWith("scala.collection")) { throw extractionError( "Scala collections are not supported. " + "See the documentation for supported classes or treat them as RAW types."); } }

Target:
private void checkForCommonErrors(Type type) { final Class<?> clazz = toClass(type); if (clazz == null) { return; } if (clazz == Row.class) { throw extractionError( "Cannot extract a data type from a pure '%s' class. " + "Please use annotations to define field names and field types.", Row.class.getName()); } else if (clazz == Object.class) { throw extractionError( "Cannot extract a data type from a pure '%s' class. " + "Usually, this indicates that class information is missing or got lost. " + "Please specify a more concrete class or treat it as a RAW type.", Object.class.getName()); } else if (INTERNAL_DATA_STRUCTURES.contains(clazz)) { throw extractionError( "Cannot extract a data type from an internal '%s' class without further information. " + "Please use annotations to define the full logical type.", clazz.getName()); } else if (clazz.getName().startsWith("scala.Tuple")) { throw extractionError( "Scala tuples are not supported. Use case classes or '%s' instead.", Row.class.getName()); } else if (clazz.getName().startsWith("scala.collection")) { throw extractionError( "Scala collections are not supported. " + "See the documentation for supported classes or treat them as RAW types."); } }
Source:
public void onCreate(final MediaSessionService2 service) { MediaSession2 session; synchronized (mLock) { session = mSession; } if (session == null) { session = service.onCreateSession(); synchronized (mLock) { mSession = session; } } final MediaNotificationHandler notificationHandler = new MediaNotificationHandler(service); mNotificationHandler = notificationHandler; session.getCallback().setOnHandleForegroundServiceListener( new MediaSession2.SessionCallback.OnHandleForegroundServiceListener() { @Override public void onHandleForegroundService(int state) { notificationHandler.onHandleForegroundService(state); } }); }

Target:
public void onCreate(final MediaSessionService2 service) { MediaSession2 session; synchronized (mLock) { session = mSession; } if (session == null) { session = service.onCreateSession(); if (session == null) { throw new RuntimeException("Session is null"); } synchronized (mLock) { mSession = session; } } mNotificationHandler = new MediaNotificationHandler(service); }
Source:
public void testURLFormatter(){ String actual = Utils.urlConstructor(Utils.URL_CHUNK_ACCOUNTS, "12345"); assertEquals("<LINK_1>", actual); actual = Utils.urlConstructor(Utils.URL_CHUNK_COURSES, "45667"); assertEquals("<LINK_2>",(actual)); actual = Utils.urlConstructor(Utils.URL_CHUNK_COURSES,"34567",Utils.URL_CHUNK_COURSE_SIS_COURSE_ID,"cmmS12121"); assertEquals("<LINK_0>[sis_course_id]=cmmS12121",actual); }

Target:
public void testURLFormatter(){ String actual = Utils.urlConstructor(Utils.URL_CHUNK_ACCOUNTS, "12345"); assertEquals("<LINK_1>", actual); actual = Utils.urlConstructor(Utils.URL_CHUNK_COURSES, "45667"); assertEquals("<LINK_2>",actual); actual = Utils.urlConstructor(Utils.URL_CHUNK_COURSES,"34567",Utils.URL_CHUNK_COURSE_SIS_COURSE_ID,"cmmS12121"); assertEquals("<LINK_0>[sis_course_id]=cmmS12121",actual); }
Source:
public String getColumnText(Object element, int columnIndex) { ControlFlowEntry entry = (ControlFlowEntry) element; if (columnIndex == 0) { return entry.getName(); } else if (columnIndex == 1) { return Integer.toString(entry.getThreadId()); } else if (columnIndex == 2) { if (entry.getParentThreadId() > 0) { return Integer.toString(entry.getParentThreadId()); } } else if (columnIndex == 3) { return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC); } else if (columnIndex == 4) { return entry.getTrace().getName(); } return ""; }

Target:
public String getColumnText(Object element, int columnIndex) { ControlFlowEntry entry = (ControlFlowEntry) element; if (columnIndex == NAME_COL) { return entry.getName(); } else if (columnIndex == TID_COL) { return Integer.toString(entry.getThreadId()); } else if (columnIndex == PTID_COL) { if (entry.getParentThreadId() > 0) { return Integer.toString(entry.getParentThreadId()); } } else if (columnIndex == START_COL) { return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC); } else if (columnIndex == TRACE_COL) { return entry.getTrace().getName(); } return ""; }
Source:
protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); final int buttonWidth = 80; FormData buttonFormData = new FormData(); buttonFormData.left = new FormAttachment(0, LABEL_WIDTH); buttonFormData.width = buttonWidth; this.button = widgetFactory.createButton(parent, "DO IT", SWT.NONE); this.button.setLayoutData(buttonFormData); widgetFactory.paintBordersFor(parent); if (!isEnabled()) { this.button.setEnabled(false); } this.controller = new EEFControllersFactory().createButtonController(this.description, this.variableManager, this.interpreter, this.editingDomain); }

Target:
protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { EEFWidgetFactory widgetFactory = formContainer.getWidgetFactory(); final int buttonWidth = 80; FormData buttonFormData = new FormData(); buttonFormData.left = new FormAttachment(0, LABEL_WIDTH); buttonFormData.width = buttonWidth; this.button = widgetFactory.createButton(parent, "DO IT", SWT.NONE); this.button.setLayoutData(buttonFormData); widgetFactory.paintBordersFor(parent); this.controller = new EEFControllersFactory().createButtonController(this.description, this.variableManager, this.interpreter, this.editingDomain); }
Source:
public Container next() { try { if (seekableStream.position() < (start >> 16)) { seekableStream.seek(start >> 16); } if (seekableStream.position() > (end >> 16)) { throw new RuntimeException("No more containers in this boundary."); } final long offset = seekableStream.position(); final Container c = ContainerIO.readContainer(cramHeader.getVersion(), seekableStream); c.offset = offset; return c; } catch (final IOException e) { throw new RuntimeIOException(e); } }

Target:
public Container next() { try { if (seekableStream.position() < (start >> 16)) { seekableStream.seek(start >> 16); } if (!hasNext()) { throw new RuntimeException("No more containers in this boundary."); } final long offset = seekableStream.position(); final Container c = ContainerIO.readContainer(cramHeader.getVersion(), seekableStream); c.offset = offset; return c; } catch (final IOException e) { throw new RuntimeIOException(e); } }
Source:
private static void sortPending(List<PendingCert> pending) { Collections.sort(pending, new Comparator<PendingCert>() { @Override public int compare(PendingCert a, PendingCert b) { long c = a.ident.getWhen().getTime() - b.ident.getWhen().getTime(); if (c == 0) { c = a.ident.getTimeZoneOffset() - b.ident.getTimeZoneOffset(); } if (c > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else if (c < Integer.MIN_VALUE) { return Integer.MIN_VALUE; } return (int) c; } }); }

Target:
private static void sortPending(List<PendingCert> pending) { Collections.sort(pending, new Comparator<PendingCert>() { @Override public int compare(PendingCert a, PendingCert b) { return Long.signum( a.ident.getWhen().getTime() - b.ident.getWhen().getTime()); } }); }
Source:
private static void createTableAndIndex() throws SQLException { schemaName = generateUniqueName(); dataTableName = generateUniqueName(); dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); indexTableName = generateUniqueName(); indexTableFullName = SchemaUtil.getTableName(schemaName, indexTableName); try (Connection conn = getConnection()) { incrementEdgeByOne(); conn.createStatement().execute(String.format(CREATE_TABLE_DDL, dataTableFullName)); conn.commit(); incrementEdgeByOne(); conn.createStatement().execute(String.format(CREATE_INDEX_DDL, indexTableName, dataTableFullName)); conn.commit(); } }

Target:
private static void createTableAndIndex() throws SQLException { schemaName = generateUniqueName(); dataTableName = "D_"+generateUniqueName(); dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); indexTableName = "I_"+generateUniqueName(); indexTableFullName = SchemaUtil.getTableName(schemaName, indexTableName); try (Connection conn = getConnection()) { incrementEdgeByOne(); conn.createStatement().execute(String.format(CREATE_TABLE_DDL, dataTableFullName)); conn.commit(); incrementEdgeByOne(); conn.createStatement().execute(String.format(CREATE_INDEX_DDL, indexTableName, dataTableFullName)); conn.commit(); } }
Source:
public static <K> RocksDBKeyedStateBackendBuilder<K> builderForTestDefaults( File instanceBasePath, TypeSerializer<K> keySerializer) { final RocksDBResourceContainer optionsContainer = new RocksDBResourceContainer(); return new RocksDBKeyedStateBackendBuilder<>( "no-op", ClassLoader.getSystemClassLoader(), instanceBasePath, optionsContainer, stateName -> optionsContainer.getColumnOptions(), new KvStateRegistry().createTaskRegistry(new JobID(), new JobVertexID()), keySerializer, 2, new KeyGroupRange(0, 1), new ExecutionConfig(), TestLocalRecoveryConfig.disabled(), RocksDBStateBackend.PriorityQueueStateType.HEAP, TtlTimeProvider.DEFAULT, new UnregisteredMetricsGroup(), Collections.emptyList(), UncompressedStreamCompressionDecorator.INSTANCE, new CloseableRegistry(), null); }

Target:
public static <K> RocksDBKeyedStateBackendBuilder<K> builderForTestDefaults( File instanceBasePath, TypeSerializer<K> keySerializer) { final RocksDBResourceContainer optionsContainer = new RocksDBResourceContainer(); return new RocksDBKeyedStateBackendBuilder<>( "no-op", ClassLoader.getSystemClassLoader(), instanceBasePath, optionsContainer, stateName -> optionsContainer.getColumnOptions(), new KvStateRegistry().createTaskRegistry(new JobID(), new JobVertexID()), keySerializer, 2, new KeyGroupRange(0, 1), new ExecutionConfig(), TestLocalRecoveryConfig.disabled(), RocksDBStateBackend.PriorityQueueStateType.HEAP, TtlTimeProvider.DEFAULT, new UnregisteredMetricsGroup(), Collections.emptyList(), UncompressedStreamCompressionDecorator.INSTANCE, new CloseableRegistry()); }
Source:
T focus() { if (focusDelay > 0) { focusDelayTimer.schedule(focusDelay); } else { focusDelayTimer.run(); } return cast(); }

Target:
T focus() { cancelFocusTimer(); if (focusDelay > 0) { focusDelayTimer.schedule(focusDelay); } else { focusDelayTimer.run(); } return cast(); }