auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean connectSocket() { try { if (mPseRec == null) { if <START> (DBG) Log.v(TAG, <END> "connectSocket: UUID: " + BluetoothUuid.PBAP_PSE.getUuid()); mSocket = mDevice.createRfcommSocketToServiceRecord(BluetoothUuid.PBAP_PSE.getUuid()); } else if (mPseRec.getL2capPsm() != L2CAP_INVALID_PSM) { if (DBG) Log.v(TAG, "connectSocket: PSM: " + mPseRec.getL2capPsm()); mSocket = mDevice.createL2capSocket(mPseRec.getL2capPsm()); } else { if (DBG) Log.v(TAG, "connectSocket: channel: " + mPseRec.getRfcommChannelNumber()); mSocket = mDevice.createRfcommSocket(mPseRec.getRfcommChannelNumber()); } if (mSocket != null) { mSocket.connect(); return true; } else { Log.w(TAG, "Could not create socket"); } } catch (IOException e) { Log.e(TAG, "Error while connecting socket", e); } return false; }</code><technical_language>protect Log.v VDBG Log.d DBG</technical_language>

Target:
private boolean connectSocket() { try { if (mPseRec == null) { if (VDBG) Log.v(TAG, "connectSocket: UUID: " + BluetoothUuid.PBAP_PSE.getUuid()); mSocket = mDevice.createRfcommSocketToServiceRecord(BluetoothUuid.PBAP_PSE.getUuid()); } else if (mPseRec.getL2capPsm() != L2CAP_INVALID_PSM) { if (VDBG) Log.v(TAG, "connectSocket: PSM: " + mPseRec.getL2capPsm()); mSocket = mDevice.createL2capSocket(mPseRec.getL2capPsm()); } else { if (VDBG) Log.v(TAG, "connectSocket: channel: " + mPseRec.getRfcommChannelNumber()); mSocket = mDevice.createRfcommSocket(mPseRec.getRfcommChannelNumber()); } if (mSocket != null) { mSocket.connect(); return true; } else { Log.w(TAG, "Could not create socket"); } } catch (IOException e) { Log.e(TAG, "Error while connecting socket", e); } return false; }
Source:
<code>protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; TaggedValuePointable tvp2 = args[1]; if (!(tvp1.getTag() == ValueTag.ARRAY_TAG || tvp1.getTag() == ValueTag.OBJECT_TAG)) { throw new SystemException(ErrorCode.FORG0006); } if (tvp1.getTag() == ValueTag.ARRAY_TAG) { if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); mvs.reset(); try { sb.reset(mvs); tvp1.getValue(ap); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) { XDMConstants.setEmptySequence(result); return; } ap.getEntry((int) lp.getLong() - 1, tempTvp); sb.addItem(ap.getEntryCount() != 0 ? tempTvp : tvp1); sb.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(tempTvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { if (tvp2.getTag() != ValueTag.XS_STRING_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); <START> try { <END> mvs.reset(); sb.reset(mvs); tvp1.getValue(op); tvp2.getValue(sp); if (op.getValue(sp, tempTvp)) { sb.addItem(tempTvp); } sb.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }</code><technical_language>Maybe, give tempTvp</technical_language>

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; TaggedValuePointable tvp2 = args[1]; if (!(tvp1.getTag() == ValueTag.ARRAY_TAG || tvp1.getTag() == ValueTag.OBJECT_TAG)) { throw new SystemException(ErrorCode.FORG0006); } if (tvp1.getTag() == ValueTag.ARRAY_TAG) { if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); mvs.reset(); try { sb.reset(mvs); tvp1.getValue(ap); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) { XDMConstants.setEmptySequence(result); return; } ap.getEntry((int) lp.getLong() - 1, tempTvp); sb.addItem(ap.getEntryCount() != 0 ? tempTvp : tvp1); sb.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(tempTvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { if (tvp2.getTag() != ValueTag.XS_STRING_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); try { mvs.reset(); sb.reset(mvs); tvp1.getValue(op); tvp2.getValue(sp); if (op.getValue(sp, tempTvp)) { sb.addItem(tempTvp); } sb.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(tempTvp); } } }
Source:
<code>protected VmDevice createVmDevice() { return new VmDevice(new VmDeviceId(disk.getId(), getVmId()), VmDeviceGeneralType.DISK, VmDeviceType.DISK.getName(), "", null, true, getParameters().isPlugUnPlug(), getDiskVmElement().isReadOnly(), <START> FeatureSupported.isDomainXMLSupported(getVm().getClusterCompatibilityVersion()) ? <END> String.format("%s%s", DomainXmlUtils.USER_ALIAS_PREFIX, disk.getId()) : "", null, getParameters().getSnapshotId(), null); }</code><technical_language>extract this AbstractDiskVmCommand for reusability in HotPlugDiskToVmCommand</technical_language>

Target:
protected VmDevice createVmDevice() { return new VmDevice(new VmDeviceId(disk.getId(), getVmId()), VmDeviceGeneralType.DISK, VmDeviceType.DISK.getName(), "", null, true, getParameters().isPlugUnPlug(), getDiskVmElement().isReadOnly(), getDeviceAliasForDisk(disk), null, getParameters().getSnapshotId(), null); }
Source:
<code>private void showTextBox() { if (textBox == null) { textBox = new TextBox(); textBox.setText(getText()); textBox.setVisibleLength(visibleLen); <START> textBox.setReadOnly(readOnly); <END> textBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(final KeyPressEvent event) { if (event.isControlKeyDown() || event.isMetaKeyDown()) { switch (event.getCharCode()) { case 'c': case 'x': Scheduler.get().scheduleDeferred(new Command() { public void execute() { hideTextBox(); } }); break; } } } }); textBox.addBlurHandler(new BlurHandler() { @Override public void onBlur(final BlurEvent event) { hideTextBox(); } }); content.insert(textBox, 1); } textLabel.setVisible(false); textBox.setVisible(true); Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { textBox.selectAll(); textBox.setFocus(true); } }); }</code><technical_language>This case. need expose a setter method</technical_language>

Target:
private void showTextBox() { if (textBox == null) { textBox = new TextBox(); textBox.setText(getText()); textBox.setVisibleLength(visibleLen); textBox.setReadOnly(true); textBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(final KeyPressEvent event) { if (event.isControlKeyDown() || event.isMetaKeyDown()) { switch (event.getCharCode()) { case 'c': case 'x': Scheduler.get().scheduleDeferred(new Command() { public void execute() { hideTextBox(); } }); break; } } } }); textBox.addBlurHandler(new BlurHandler() { @Override public void onBlur(final BlurEvent event) { hideTextBox(); } }); content.insert(textBox, 1); } textLabel.setVisible(false); textBox.setVisible(true); Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { textBox.selectAll(); textBox.setFocus(true); } }); }
Source:
<code><START> public static void main(String[] args) { <END> GatewayServer gatewayServer = new GatewayServer(new DeepLearning4jEntryPoint()); gatewayServer.start(); logger.info("DeepLearning4j Gateway server running"); }</code><technical_language>@Slf4j in lombok</technical_language>

Target:
public static void main(String[] args) { GatewayServer gatewayServer = new GatewayServer(new DeepLearning4jEntryPoint()); gatewayServer.start(); log.info("DeepLearning4j Gateway server running"); }
Source:
<code>private static ResultHolder getTypeFromVarInit(HaxeVarInit init) { final ResultHolder abstractEnumFieldInitType = HaxeAbstractEnumUtil.getStaticMemberExpression(init.getExpression()); if (abstractEnumFieldInitType != null) { return abstractEnumFieldInitType; } <START> return HaxeTypeResolver.getPsiElementType(init.getExpression(), new HaxeGenericResolver()); END> }</code><technical_language>initialized ancestor generic resolver (method class)</technical_language>

Target:
private static ResultHolder getTypeFromVarInit(HaxeVarInit init) { final ResultHolder abstractEnumFieldInitType = HaxeAbstractEnumUtil.getStaticMemberExpression(init.getExpression()); if (abstractEnumFieldInitType != null) { return abstractEnumFieldInitType; } return HaxeTypeResolver.getPsiElementType(init.getExpression(), HaxeGenericResolverUtil.generateResolverFromScopeParents(init)); }
Source:
<code>public void stop() { <START> executor.shutdown(); <END> super.stop(); setAttribute(Startable.SERVICE_UP, false); }</code><technical_language>If calling shutdown() shutdownNow(), previously submitted tasks executed. Is wanted here? call executor.awaitTermination()? I suspect not; synchronization this call stop() blocking for other methods complete problems..</technical_language>

Target:
public void stop() { executor.shutdownNow(); super.stop(); setAttribute(Startable.SERVICE_UP, false); }
Source:
<code>public void testRegistryFactoryIpCache() throws Exception { Registry registry1 = registryFactory.getRegistry(URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233")); Registry registry2 = registryFactory.getRegistry(URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostAddress() + ":2233")); <START> Assert.assertNotSame(registry1, registry2); <END> }</code><technical_language>I registry1 registry2 instances, failed</technical_language>

Target:
public void testRegistryFactoryIpCache() throws Exception { String hostName = NetUtils.getLocalAddress().getHostName(); String ip = NetUtils.getLocalAddress().getHostAddress(); Registry registry1 = registryFactory.getRegistry(URL.valueOf("dubbo://" + hostName + ":2233")); Registry registry2 = registryFactory.getRegistry(URL.valueOf("dubbo://" + ip + ":2233")); if (hostName.equals(ip)) { Assert.assertEquals(registry1, registry2); } else { Assert.assertNotSame(registry1, registry2); } }
Source:
<code>public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> disp = new CompositeDisposable(); <END> }</code><technical_language>I inizialize this in declaration final</technical_language>

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); api = new OpenFoodAPIClient(requireActivity()); }
Source:
<code>protected static void retrieveExpectedIssuesFromFile(File xmlFile, CheckVerifier checkVerifier) { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); try (FileInputStream is = new FileInputStream(xmlFile)) { XMLStreamReader reader = factory.createXMLStreamReader(is); while (reader.hasNext()) { int line = reader.getLocation().getLineNumber(); reader.next(); if (reader.getEventType() == XMLStreamReader.COMMENT) { String text = reader.getText().trim(); checkVerifier.collectExpectedIssues(text, line); } } <START> reader.close(); <END> } catch (XMLStreamException | IOException e) { Fail.fail("The test file can not be parsed to retrieve comments", e); } }</code><technical_language>need close this reader underlying input stream is closed</technical_language>

Target:
protected static void retrieveExpectedIssuesFromFile(File xmlFile, CheckVerifier checkVerifier) { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); try (FileInputStream is = new FileInputStream(xmlFile)) { XMLStreamReader reader = factory.createXMLStreamReader(is); while (reader.hasNext()) { int line = reader.getLocation().getLineNumber(); reader.next(); if (reader.getEventType() == XMLStreamReader.COMMENT) { String text = reader.getText().trim(); checkVerifier.collectExpectedIssues(text, line); } } } catch (XMLStreamException | IOException e) { Fail.fail("The test file can not be parsed to retrieve comments", e); } }
Source:
<code>protected static void verifyPresentInDatastore(FeedbackQuestionAttributes expected, boolean wildcardId) { FeedbackQuestionAttributes actual = fqDb.getFeedbackQuestion(expected.feedbackSessionName, expected.courseId, expected.questionNumber); if (wildcardId) { expected.setId(actual.getId()); } setEqualTimestampBetweenExpectedAndActual(expected, actual); <START> <END> assertEquals(gson.toJson(expected), gson.toJson(actual)); }</code><technical_language>methods modify createdAt updatedAt, modify JSON representation instead? This avoid methods solely for sake of testing in production</technical_language>

Target:
protected static void verifyPresentInDatastore(FeedbackQuestionAttributes expected, boolean wildcardId) { FeedbackQuestionAttributes actual = fqDb.getFeedbackQuestion(expected.feedbackSessionName, expected.courseId, expected.questionNumber); if (wildcardId) { expected.setId(actual.getId()); } assertEquals(gson.toJson(expected), gson.toJson(actual)); }
Source:
<code>public boolean existsTable(String databaseName, String tableName) throws TDClientException { try { for (TDTable table : listTables(databaseName)) { if (table.getName().equals(tableName)) { return true; } } return false; } catch (TDClientHttpException e) { <START> if (e.getStatusCode() == 404) { <END> return false; } else { throw e; } } }</code><technical_language>java.net.HttpURLConnection.HTTP_NOT_FOUND</technical_language>

Target:
public boolean existsTable(String databaseName, String tableName) throws TDClientException { try { for (TDTable table : listTables(databaseName)) { if (table.getName().equals(tableName)) { return true; } } return false; } catch (TDClientHttpException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND_404) { return false; } else { throw e; } } }
Source:
<code>void handleActionResult(final VdcActionType actionType, final VdcActionParametersBase parameters, final VdcReturnValueBase result, final IFrontendActionAsyncCallback callback, final Object state, final boolean showErrorDialog) { logger.log(Level.FINER, "Retrieved action result from RunAction."); FrontendActionAsyncResult f = new FrontendActionAsyncResult(actionType, parameters, result, state); boolean failedOnCanDoAction = !result.getCanDoAction(); if (failedOnCanDoAction) { result.setCanDoActionMessages((ArrayList<String>) translateError(result)); <START> } else if (showErrorDialog && result.getIsSyncronious() && !result.getSucceeded()) { <END> runActionExecutionFailed(actionType, result.getFault()); } callback.executed(f); if (showErrorDialog && failedOnCanDoAction && (getEventsHandler() != null) && (getEventsHandler().isRaiseErrorModalPanel(actionType, result.getFault()))) { ArrayList<String> messages = result.getCanDoActionMessages(); failureEventHandler(result.getDescription(), messages.isEmpty() ? Collections.singletonList(getConstants().noCanDoActionMessage()) : messages); } }</code><technical_language>In case showErrorDialog=false messages aggregated, fault is localized (the localization of fault is part of runActionExecutionFailed(..)). Consider removing showErrorDialog 'if' pass runActionExecutionFailed(..). In runActionExecutionFailed(..) localize fault show dialog if !showErrorDialog</technical_language>

Target:
void handleActionResult(final VdcActionType actionType, final VdcActionParametersBase parameters, final VdcReturnValueBase result, final IFrontendActionAsyncCallback callback, final Object state, final boolean showErrorDialog) { logger.log(Level.FINER, "Retrieved action result from RunAction."); FrontendActionAsyncResult f = new FrontendActionAsyncResult(actionType, parameters, result, state); boolean failedOnCanDoAction = !result.getCanDoAction(); if (failedOnCanDoAction) { result.setCanDoActionMessages((ArrayList<String>) translateError(result)); } else if (!result.getSucceeded()) { VdcFault fault = result.getFault(); fault.setMessage(translateVdcFault(fault)); if (showErrorDialog && result.getIsSyncronious() && getEventsHandler() != null) { getEventsHandler().runActionExecutionFailed(actionType, fault); } } callback.executed(f); if (showErrorDialog && failedOnCanDoAction && (getEventsHandler() != null) && (getEventsHandler().isRaiseErrorModalPanel(actionType, result.getFault()))) { ArrayList<String> messages = result.getCanDoActionMessages(); failureEventHandler(result.getDescription(), messages.isEmpty() ? Collections.singletonList(getConstants().noCanDoActionMessage()) : messages); } }
Source:
<code>private double getIntegrandGivenArtifact(final double f, final double epsilon, final int nWithArtifact, final int nNoArtifact, final int xWithArtifact, final int xNoArtifact){ final BinomialDistribution binomWithArtifact = new BinomialDistribution(nWithArtifact, f + epsilon * (1-f)); final BinomialDistribution binomNoArtifact = new BinomialDistribution(nNoArtifact, f); <START> final BetaDistribution betaPrior = new BetaDistribution(ALPHA, BETA); <END> return betaPrior.density(epsilon) * binomWithArtifact.probability(xWithArtifact) * binomNoArtifact.probability(xNoArtifact); }</code><technical_language>This a static member of class</technical_language>

Target:
private double getIntegrandGivenArtifact(final double f, final double epsilon, final int nWithArtifact, final int nNoArtifact, final int xWithArtifact, final int xNoArtifact){ return betaPrior.density(epsilon) * MathUtils.binomialProbability(nWithArtifact, xWithArtifact, f + epsilon * (1-f)) * MathUtils.binomialProbability(nNoArtifact, xNoArtifact, f); }
Source:
<code>protected void executeCommand() { try { VDSReturnValue vdsReturnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(getParameters().getStoragePoolId(), getParameters() .getStorageDomainId(), getParameters().getImageGroupID(), getParameters() .getWipeAfterDelete(), false, getStoragePool().getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), VdcActionType.RemoveVmTemplate, VdcObjectType.Storage, getParameters().getStorageDomainId())); setSucceeded(true); } } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getErrorCode())); log.errorFormat("Image {0} does not exist in domain {1}.", getDiskImage().getId(), getParameters().getStorageDomainId()); <START> setSucceeded(true); <END> } else { throw e; } } }</code><technical_language>end method run? if tasks created run yourself</technical_language>

Target:
protected void executeCommand() { VDSReturnValue vdsReturnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.DeleteImageGroup, new DeleteImageGroupVDSCommandParameters(getParameters().getStoragePoolId(), getParameters() .getStorageDomainId(), getParameters().getImageGroupID(), getParameters() .getWipeAfterDelete(), false, getStoragePool().getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), VdcActionType.RemoveVmTemplate, VdcObjectType.Storage, getParameters().getStorageDomainId())); setSucceeded(true); } }
Source:
<code>public void testOffer() { FixedBucketsHistogram h = buildHistogram( 0, 200, 200, FixedBucketsHistogram.OutlierHandlingMode.OVERFLOW, VALUES2 ); float[] quantiles = h.percentilesFloat(new double[]{12.5f, 50.0f, 98f}); double[] doubles = new double[VALUES2.length]; for (int i = 0; i < doubles.length; i++) { doubles[i] = VALUES2[i]; } Percentile percentile = new Percentile(); percentile.setData(doubles); <START> log.debug("MY-P12.5: " + quantiles[0]); <END> log.debug("MY-P50: " + quantiles[1]); log.debug("MY-P98: " + quantiles[2]); log.debug("THEIR-P12.5: " + percentile.evaluate(12.5)); log.debug("THEIR-P50: " + percentile.evaluate(50)); log.debug("THEIR-P98: " + percentile.evaluate(98)); Assert.assertArrayEquals( new float[]{2.5f, 20.0f, 46.76f}, quantiles, 0.01f ); }</code><technical_language>log debug messages useful retain finished testing</technical_language>

Target:
public void testOffer() { FixedBucketsHistogram h = buildHistogram( 0, 200, 200, FixedBucketsHistogram.OutlierHandlingMode.OVERFLOW, VALUES2 ); float[] quantiles = h.percentilesFloat(new double[]{12.5f, 50.0f, 98f}); double[] doubles = new double[VALUES2.length]; for (int i = 0; i < doubles.length; i++) { doubles[i] = VALUES2[i]; } Assert.assertArrayEquals( new float[]{2.5f, 20.0f, 46.76f}, quantiles, 0.01f ); }
Source:
<code>void expireLocks() { try { int c = autoCommit((handle, dao) -> { if (isEmbededDatabase()) { return handle.createStatement( "update queued_task_locks" + " set lock_expire_time = NULL, lock_agent_id = NULL, retry_count = retry_count + 1" + " where lock_expire_time is not null" + " and lock_expire_time < :expireTime" ) .bind("expireTime", Instant.now().getEpochSecond()) .execute(); } else { return handle.createStatement( "update queued_task_locks" + " set lock_expire_time = NULL, lock_agent_id = NULL, retry_count = retry_count + 1" + " where lock_expire_time is not null" + " and lock_expire_time < " + statementUnixTimestampSql() ) .execute(); } }); if (c > 0) { logger.warn("{} task locks are expired. Tasks will be retried.", c); } } catch (Throwable t) { <START> logger.error("An uncaught exception is ignored. Lock expireation thread will be retried.", t); <END> } }</code><technical_language>expiration</technical_language>

Target:
void expireLocks() { try { int c = autoCommit((handle, dao) -> { if (isEmbededDatabase()) { return handle.createStatement( "update queued_task_locks" + " set lock_expire_time = NULL, lock_agent_id = NULL, retry_count = retry_count + 1" + " where lock_expire_time is not null" + " and lock_expire_time < :expireTime" ) .bind("expireTime", Instant.now().getEpochSecond()) .execute(); } else { return handle.createStatement( "update queued_task_locks" + " set lock_expire_time = NULL, lock_agent_id = NULL, retry_count = retry_count + 1" + " where lock_expire_time is not null" + " and lock_expire_time < " + statementUnixTimestampSql() ) .execute(); } }); if (c > 0) { logger.warn("{} task locks are expired. Tasks will be retried.", c); } } catch (Throwable t) { logger.error("An uncaught exception is ignored. This lock expiration thread will be restarted.", t); } }
Source:
<code>public void run() { Set<Class<? extends CTEProvider>> rootProviders = viewMapping.getCteProviders(); if (rootProviders != null) { Map<Class<?>, CTEProvider> providers = context.getCteProviders(); for (Class<? extends CTEProvider> clazz : rootProviders) { <START> if (!providers.containsKey(clazz)) { <END> CTEProvider provider = new SimpleCTEProviderFactory(clazz).create(); providers.put(clazz, provider); } ManagedViewTypeImpl.this.cteProviders.add(providers.get(clazz)); } } for (AbstractMethodAttribute<? super X, ?> attribute : ManagedViewTypeImpl.this.recursiveSubviewAttributes.values()) { ManagedViewType<?> viewType = (ManagedViewType<?>) attribute.getElementType(); ManagedViewTypeImpl.this.cteProviders.addAll(viewType.getCteProviders()); } }</code><technical_language>CTEProvider provider = providers.get(clazz); if (provider == null) { CTEProvider provider = new SimpleCTEProviderFactory(clazz).create(); providers.put(clazz, provider); } ManagedViewTypeImpl.this.cteProviders.add(provider);</technical_language>

Target:
public void run() { Set<Class<? extends CTEProvider>> rootProviders = viewMapping.getCteProviders(); if (rootProviders != null) { Map<Class<?>, CTEProvider> providers = context.getCteProviders(); for (Class<? extends CTEProvider> clazz : rootProviders) { CTEProvider provider = providers.get(clazz); if (provider == null) { provider = new SimpleCTEProviderFactory(clazz).create(); providers.put(clazz, provider); } this.viewType.cteProviders.add(provider); } } for (AbstractMethodAttribute<?, ?> attribute : this.viewType.recursiveSubviewAttributes.values()) { com.blazebit.persistence.view.metamodel.Type<?> elementType = attribute.getElementType(); if (elementType instanceof ManagedViewTypeImpl) { ManagedViewType<?> viewType = (ManagedViewType<?>) attribute.getElementType(); this.viewType.cteProviders.addAll(viewType.getCteProviders()); } } }
Source:
<code>public SortableItem(JsonNode node,SortFieldInfo[] sortFields) { this.node=node; this.sortFields=sortFields; keyValues=new Object[sortFields.length]; for(int i=0;i<sortFields.length;i++) { <START> if (sortFields[i] != null) { <END> JsonNode valueNode=JsonDoc.get(node,sortFields[i].getName()); keyValues[i]=sortFields[i].getField().getType().fromJson(valueNode); } } }</code><technical_language>is array of SortFields null in it</technical_language>

Target:
public SortableItem(JsonNode node,SortFieldInfo[] sortFields) { this.node=node; this.sortFields=sortFields; keyValues=new Object[sortFields.length]; for(int i=0;i<sortFields.length;i++) { JsonNode valueNode=JsonDoc.get(node,sortFields[i].getName()); keyValues[i]=sortFields[i].getField().getType().fromJson(valueNode); } }
Source:
<code>private int calculateDefendersDamagePerRound() { int baseHP = getDefender().calculateHP(); int damagePerRound = 0; List<String> defenderTypes = Arrays.asList(getDefender().getType()); <START> if ((getDefender().getAbility().equals("Solar Power") || getDefender().getAbility().equals("Dry Skin")) && mActiveWeather == Weather.SUN) { <END> damagePerRound += (baseHP * 0.125); } if (!getDefender().getAbility().equals("Overcoat") && !getDefender().getAbility().equals("Magic Guard")) { if (mActiveWeather == Weather.SAND && !getDefender().getAbility().equals("Sand Veil") && !getDefender().getAbility().equals("Sand Rush") && !getDefender().getAbility().equals("Sand Force") && !defenderTypes.contains("Rock") && !defenderTypes.contains("Steel") && !defenderTypes.contains("Ground")) { damagePerRound += (baseHP / 16); } else if (mActiveWeather == Weather.HAIL && !getDefender().getAbility().equals("Ice Body") && !getDefender().getAbility().equals("Snow Cloak") && !defenderTypes.contains("Ice")) { damagePerRound += (baseHP / 16); } } if (getDefender().getAbility().equals("Dry Skin") && mActiveWeather == Weather.RAIN) { damagePerRound -= (baseHP * 0.125); } if ((getDefender().getAbility().equals("Rain Dish")) && mActiveWeather == Weather.RAIN) { damagePerRound -= (baseHP / 16); } if ((getDefender().getAbility().equals("Ice Body")) && mActiveWeather == Weather.HAIL) { damagePerRound -= (baseHP / 16); } return damagePerRound; }</code><technical_language>a lot of getDefender().getAbility() here. get beginning</technical_language>

Target:
private int calculateDefendersDamagePerRound() { int baseHP = getDefender().calculateHP(); int damagePerRound = 0; String defenderAbility = getDefender().getAbility(); List<String> defenderTypes = Arrays.asList(getDefender().getType()); if ((defenderAbility.equals("Solar Power") || defenderAbility.equals("Dry Skin")) && mActiveWeather == Weather.SUN) { damagePerRound += (baseHP * 0.125); } if (!defenderAbility.equals("Overcoat") && !defenderAbility.equals("Magic Guard")) { if (mActiveWeather == Weather.SAND && !defenderAbility.equals("Sand Veil") && !defenderAbility.equals("Sand Rush") && !defenderAbility.equals("Sand Force") && !defenderTypes.contains("Rock") && !defenderTypes.contains("Steel") && !defenderTypes.contains("Ground")) { damagePerRound += (baseHP / 16); } else if (mActiveWeather == Weather.HAIL && !defenderAbility.equals("Ice Body") && !defenderAbility.equals("Snow Cloak") && !defenderTypes.contains("Ice")) { damagePerRound += (baseHP / 16); } } if (defenderAbility.equals("Dry Skin") && mActiveWeather == Weather.RAIN) { damagePerRound -= (baseHP * 0.125); } if ((defenderAbility.equals("Rain Dish")) && mActiveWeather == Weather.RAIN) { damagePerRound -= (baseHP / 16); } if ((defenderAbility.equals("Ice Body")) && mActiveWeather == Weather.HAIL) { damagePerRound -= (baseHP / 16); } return damagePerRound; }
Source:
<code>public ScriptResultConversionException(Object value) { super(ERROR_CODE); <START> this.value = value; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public ScriptResultConversionException(Object value) { super(ERROR_CODE); this.value = requireNonNull(value); }
Source:
<code>private <T extends ObjectId> void findAllImpl(PackList packList, Collection<T> pending, List<FoundObject<T>> r) { DfsPackFile[] packs = packList.packs; if (packs.length == 0) { return; } int lastIdx = 0; DfsPackFile lastPack = packs[lastIdx]; boolean noGarbage = avoidUnreachable; OBJECT_SCAN: for (Iterator<T> it = pending.iterator(); it.hasNext();) { T t = it.next(); if (!noGarbage || !lastPack.isGarbage()) { try { long p = lastPack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<T>(t, lastIdx, lastPack, p)); it.remove(); continue; } } catch (IOException e) { } } for (int i = 0; i < packs.length; i++) { <START> if (i == lastIdx) continue; <END> DfsPackFile pack = packs[i]; if (noGarbage && pack.isGarbage()) continue; try { long p = pack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<T>(t, i, pack, p)); it.remove(); lastIdx = i; lastPack = pack; continue OBJECT_SCAN; } } catch (IOException e) { } } } last = lastPack; }</code><technical_language>If new conditional 339 evaluates false skip lastIdx here</technical_language>

Target:
private <T extends ObjectId> void findAllImpl(PackList packList, Collection<T> pending, List<FoundObject<T>> r) { DfsPackFile[] packs = packList.packs; if (packs.length == 0) { return; } int lastIdx = 0; DfsPackFile lastPack = packs[lastIdx]; for (Iterator<T> it = pending.iterator(); it.hasNext();) { T t = it.next(); if (!skipGarbagePack(lastPack)) { try { long p = lastPack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<T>(t, lastIdx, lastPack, p)); it.remove(); continue; } } catch (IOException e) { } } for (int i = 0; i < packs.length; i++) { if (i == lastIdx) continue; DfsPackFile pack = packs[i]; if (skipGarbagePack(pack)) continue; try { long p = pack.findOffset(this, t); if (0 < p) { r.add(new FoundObject<T>(t, i, pack, p)); it.remove(); lastIdx = i; lastPack = pack; break; } } catch (IOException e) { } } } last = lastPack; }
Source:
<code>public void deleted (Path path) { <START> LOG.info("Deleted called. Ignoring since it is not supported"); <END> }</code><technical_language>I throw a unsupportedOperationException here</technical_language>

Target:
public void deleted (Path path) { throw new UnsupportedOperationException("Deleted file watcher event not supported for custom processor file handlers."); }
Source:
<code>protected final void addEclFilter(BranchContext context, ExpressionBuilder queryBuilder, Collection<String> optionValues, Function<Collection<String>, Expression> matchingIdsToExpression) { if (optionValues.isEmpty()) { return; } Collection<String> idFilter = FluentIterable.from(optionValues).transform(new Function<String, String>() { @Override public String apply(String input) { return input.trim(); } }).toSet(); if (idFilter.size() == 1) { final String expression = Iterables.getOnlyElement(idFilter); if (!SnomedIdentifiers.isConceptIdentifier(expression)) { <START> if ("*".equals(expression)) { <END> return; } SnomedConcepts matchingConcepts = SnomedRequests.prepareSearchConcept() .all() .filterByEcl(expression) .setFields(ImmutableSet.of(SnomedConceptDocument.Fields.ID)) .build() .execute(context); idFilter = FluentIterable.from(matchingConcepts).transform(IComponent.ID_FUNCTION).toSet(); if (idFilter.isEmpty()) { throw new BaseSearchRequest.NoResultException(); } } } queryBuilder.must(matchingIdsToExpression.apply(idFilter)); }</code><technical_language>constant</technical_language>

Target:
protected final void addEclFilter(BranchContext context, ExpressionBuilder queryBuilder, Collection<String> optionValues, Function<Collection<String>, Expression> matchingIdsToExpression) { if (optionValues.isEmpty()) { return; } Collection<String> idFilter = FluentIterable.from(optionValues).transform(new Function<String, String>() { @Override public String apply(String input) { return input.trim(); } }).toSet(); if (idFilter.size() == 1) { final String expression = Iterables.getOnlyElement(idFilter); if (!SnomedIdentifiers.isConceptIdentifier(expression)) { if (Ecl.ANY.equals(expression)) { return; } SnomedConcepts matchingConcepts = SnomedRequests.prepareSearchConcept() .all() .filterByEcl(expression) .setFields(ImmutableSet.of(SnomedConceptDocument.Fields.ID)) .build() .execute(context); idFilter = FluentIterable.from(matchingConcepts).transform(IComponent.ID_FUNCTION).toSet(); if (idFilter.isEmpty()) { throw new BaseSearchRequest.NoResultException(); } } } queryBuilder.must(matchingIdsToExpression.apply(idFilter)); }
Source:
<code>private void processSuccess(LockWatchStateUpdate.Success success) { Preconditions.checkState(latestVersion.isPresent(), "Must have a known version to process successful updates"); Optional<IdentifiedVersion> snapshotVersion = snapshot.getSnapshotVersion(); Preconditions.checkState(snapshotVersion.isPresent(), "Must have a snapshot before processing successful updates"); if (success.lastKnownVersion() < snapshotVersion.get().version()) { <START> throw new TransactionLockWatchFailedException("Cannot process events before the oldest event"); <END> } if (success.lastKnownVersion() > latestVersion.get().version()) { assertEventsAreContiguousAndNoEventsMissing(success.events()); latestVersion = Optional.of(IdentifiedVersion.of(success.logId(), eventStore.putAll(success.events()))); } }</code><technical_language>Checked this get retried atlasdb-proxy atlasdb internally</technical_language>

Target:
private void processSuccess(LockWatchStateUpdate.Success success) { Preconditions.checkState(latestVersion.isPresent(), "Must have a known version to process successful updates"); Optional<IdentifiedVersion> snapshotVersion = snapshot.getSnapshotVersion(); Preconditions.checkState(snapshotVersion.isPresent(), "Must have a snapshot before processing successful updates"); if (success.lastKnownVersion() < snapshotVersion.get().version()) { throw new TransactionLockWatchFailedException( "Cannot process events before the oldest event. The transaction should be retried, although this" + " should only happen very rarely."); } if (success.lastKnownVersion() > latestVersion.get().version()) { assertEventsAreContiguousAndNoEventsMissing(success.events()); latestVersion = Optional.of(IdentifiedVersion.of(success.logId(), eventStore.putAll(success.events()))); } }
Source:
<code>protected void configure() { bind(new TypeLiteral<UiHandlersStrategy<SettingsUiHandlers>>() {}) .to(new TypeLiteral<SetterUiHandlersStrategy<SettingsUiHandlers>>() {}); bindPresenter(SettingsPresenter.class, SettingsPresenter.MyView.class, SettingsView.class, SettingsPresenter.MyProxy.class); bindSingletonPresenterWidget(GlobalParamDetailsPresenter.class, GlobalParamDetailsPresenter.MyView.class, GlobalParamDetailsView.class); <START> install(new GinFactoryModuleBuilder().build(MyTreeViewModelFactory.class)); <END> }</code><technical_language>a significant name</technical_language>

Target:
protected void configure() { bind(new TypeLiteral<UiHandlersStrategy<SettingsUiHandlers>>() {}) .to(new TypeLiteral<SetterUiHandlersStrategy<SettingsUiHandlers>>() {}); bindPresenter(SettingsPresenter.class, SettingsPresenter.MyView.class, SettingsView.class, SettingsPresenter.MyProxy.class); bindSingletonPresenterWidget(GlobalParamDetailsPresenter.class, GlobalParamDetailsPresenter.MyView.class, GlobalParamDetailsView.class); install(new GinFactoryModuleBuilder().build(NiveauEtudeInfosTreeFactory.class)); }
Source:
<code>public void testTaskWithAutoClaimTaskWithActorAndGroup() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); <START> env.set("Autoclaim", null); <END> ksession.setEnvironment(env); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("ActorId", "Darth Vader"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Reserved, task.getStatus()); assertEquals("Darth Vader", task.getActualOwner().getId()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }</code><technical_language>mind removing this manual setting null? Environment produce null if key is set anyway. Thanks</technical_language>

Target:
public void testTaskWithAutoClaimTaskWithActorAndGroup() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("ActorId", "Darth Vader"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Reserved, task.getStatus()); assertEquals("Darth Vader", task.getActualOwner().getId()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }
Source:
<code>public void testUpdateGlusterHookStatus() { <START> dao.updateGlusterHookStatus(FixturesTool.HOOK_ID, null, GlusterHookStatus.ENABLED); <END> GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID); assertNotNull(hook); assertEquals(GlusterHookStatus.ENABLED, hook.getStatus()); }</code><technical_language>i need pass SERVER_ID want update status</technical_language>

Target:
public void testUpdateGlusterHookStatus() { dao.updateGlusterHookStatus(FixturesTool.HOOK_ID, GlusterHookStatus.ENABLED); GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID); assertNotNull(hook); assertEquals(GlusterHookStatus.ENABLED, hook.getStatus()); }
Source:
<code>protected List<String> getVmsWithAttachedISO() { List<VmStatic> vms = getVmStaticDAO().getAllByStoragePoolId(getStorageDomain().getStoragePoolId()); List<String> vmNames = new LinkedList<>(); for (VmStatic vmStatic : vms) { VmDynamic vmDynamic = getVmDynamicDAO().get(vmStatic.getId()); if (getVmDynamicDAO().get(vmStatic.getId()).getStatus() != VMStatus.Down <START> && StringUtils.isEmpty(vmDynamic.getCurrentCd() != null ? vmDynamic.getCurrentCd() <END> : vmStatic.getIsoPath())) { vmNames.add(vmStatic.getName()); } } return vmNames; }</code><technical_language>StringUtils.isNotEmpty empty string signifies inserted CD</technical_language>

Target:
protected List<String> getVmsWithAttachedISO() { List<VmStatic> vms = getVmStaticDAO().getAllByStoragePoolId(getStorageDomain().getStoragePoolId()); List<String> vmNames = new LinkedList<>(); for (VmStatic vmStatic : vms) { VmDynamic vmDynamic = getVmDynamicDAO().get(vmStatic.getId()); if (getVmDynamicDAO().get(vmStatic.getId()).getStatus() != VMStatus.Down && !StringUtils.isEmpty(vmDynamic.getCurrentCd() != null ? vmDynamic.getCurrentCd() : vmStatic.getIsoPath())) { vmNames.add(vmStatic.getName()); } } return vmNames; }
Source:
<code>public void placeNewMarketOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, true, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { <START> if (o.getStockSymbol() == symbol) { if (o.getSize() < volume) <END> throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, true, this); } m.addOrder(order); }</code><technical_language>Merge if statements</technical_language>

Target:
public void placeNewMarketOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, true, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { if (o.getStockSymbol() == symbol && o.getSize() < volume) { throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, true, this); } m.addOrder(order); }
Source:
<code>private Callback<Void> securityPostProcessRequestCallback() { return buildCallback(frontendMetrics.getAccountsSecurityPostProcessRequestMetrics, securityCheckResult -> { ReadableStreamChannel channel = serializeJsonToChannel(AccountCollectionSerde.toJson(getAccounts())); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); <START> restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, "application/json"); <END> restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); finalCallback.onCompletion(channel, null); }, uri, LOGGER, finalCallback); }</code><technical_language>"application/json" is in multiple files tests, a constant replace it</technical_language>

Target:
private Callback<Void> securityPostProcessRequestCallback() { return buildCallback(frontendMetrics.getAccountsSecurityPostProcessRequestMetrics, securityCheckResult -> { ReadableStreamChannel channel = serializeJsonToChannel(AccountCollectionSerde.toJson(getAccounts())); restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, channel.getSize()); finalCallback.onCompletion(channel, null); }, uri, LOGGER, finalCallback); }
Source:
<code>public String getVaultUrl() { <START> unpackId(this.id); <END> return this.vaultUrl; }</code><technical_language>this get called time of deserialization. jackson properties call this time of deserialization. CertificateProperties examples</technical_language>

Target:
public String getVaultUrl() { return this.vaultUrl; }
Source:
<code>private void drawCenteredString(Graphics2D g, String text, int x, int y, int limit) { FontMetrics metrics = g.getFontMetrics(); y = y - (metrics.getHeight() / 2); if(metrics.stringWidth(text) > limit && (text.contains(" ") || text.contains("-"))) { if(text.contains(" ")) { for (String line : text.split("\\s+")) { g.drawString(line, x- (metrics.stringWidth(line) / 2), y += g.getFontMetrics().getHeight()); } } else { String[] lines = text.split("-"); for (int i = 0; i < lines.length; i++) { String line = lines[i]; if(i != (lines.length-1)) { line = line + "-"; } g.drawString(line, x- (metrics.stringWidth(line) / 2), y += g.getFontMetrics().getHeight()); } } } else { <START> g.drawString(text, x- (metrics.stringWidth(text) / 2), y += g.getFontMetrics().getHeight()); <END> } }</code><technical_language>suggestion g.drawString(text, x- (metrics.stringWidth(text) / 2), y + g.getFontMetrics().getHeight());</technical_language>

Target:
private void drawCenteredString(Graphics2D g, String text, int x, int y, int limit) { FontMetrics metrics = g.getFontMetrics(); y = y - (metrics.getHeight() / 2); if(metrics.stringWidth(text) > limit && (text.contains(" ") || text.contains("-"))) { if(text.contains(" ")) { for (String line : text.split("\\s+")) { g.drawString(line, x- (metrics.stringWidth(line) / 2), y += g.getFontMetrics().getHeight()); } } else { String[] lines = text.split("-"); for (int i = 0; i < lines.length; i++) { String line = lines[i]; if(i != (lines.length-1)) { line = line + "-"; } g.drawString(line, x- (metrics.stringWidth(line) / 2), y += g.getFontMetrics().getHeight()); } } } else { g.drawString(text, x- (metrics.stringWidth(text) / 2), y + g.getFontMetrics().getHeight()); } }
Source:
<code>public void start(Map<String, String> props) { MirrorTaskConfig config = new MirrorTaskConfig(props); stopping = false; sourceClusterAlias = config.sourceClusterAlias(); targetClusterAlias = config.targetClusterAlias(); consumerGroups = config.taskConsumerGroups(); checkpointsTopic = config.checkpointsTopic(); topicFilter = config.topicFilter(); replicationPolicy = config.replicationPolicy(); interval = config.emitCheckpointsInterval(); pollTimeout = config.consumerPollTimeout(); adminTimeout = config.adminTimeout(); offsetSyncStore = new OffsetSyncStore(config); sourceAdminClient = AdminClient.create(config.sourceAdminConfig()); targetAdminClient = (KafkaAdminClient) Admin.create(config.targetAdminConfig()); metrics = config.metrics(); scheduler = new Scheduler(MirrorCheckpointTask.class, config.adminTimeout()); <START> if (config.groupOffsetSyncEnabled()) { <END> scheduler .scheduleRepeatingDelayed(this::syncGroupOffset, config.syncGroupOffsetsInterval(), "sync consumer group offset from source to target"); } }</code><technical_language>Nit: scheduler understands negative intervals "disabled", need this extra check here. syncGroupOffsetInterval return -1 if disabled</technical_language>

Target:
public void start(Map<String, String> props) { MirrorTaskConfig config = new MirrorTaskConfig(props); stopping = false; sourceClusterAlias = config.sourceClusterAlias(); targetClusterAlias = config.targetClusterAlias(); consumerGroups = config.taskConsumerGroups(); checkpointsTopic = config.checkpointsTopic(); topicFilter = config.topicFilter(); replicationPolicy = config.replicationPolicy(); interval = config.emitCheckpointsInterval(); pollTimeout = config.consumerPollTimeout(); offsetSyncStore = new OffsetSyncStore(config); sourceAdminClient = AdminClient.create(config.sourceAdminConfig()); targetAdminClient = AdminClient.create(config.targetAdminConfig()); metrics = config.metrics(); idleConsumerGroupsOffset = new HashMap<>(); checkpointsPerConsumerGroup = new HashMap<>(); scheduler = new Scheduler(MirrorCheckpointTask.class, config.adminTimeout()); scheduler.scheduleRepeating(this::refreshIdleConsumerGroupOffset, config.syncGroupOffsetsInterval(), "refreshing idle consumers group offsets at target cluster"); scheduler.scheduleRepeatingDelayed(this::syncGroupOffset, config.syncGroupOffsetsInterval(), "sync idle consumer group offset from source to target"); }