auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public Traces generateStartSpan(String projectId, TraceContext context, <END> TraceContext parentContext, SpanKind spanKind, String name, Timestamp timestamp) { TraceSpan.Builder spanBuilder = TraceSpan.newBuilder() .setSpanId(context.getSpanId().getSpanId()) .setKind(toSpanKindProto(spanKind)) .setName(name) .setStartTime(toTimestamp(timestamp)); if (parentContext.getTraceId().equals(context.getTraceId()) && parentContext.getSpanId().isValid()) { spanBuilder.setParentSpanId(parentContext.getSpanId().getSpanId()); } Trace.Builder traceBuilder = Trace.newBuilder() .setProjectId(projectId) .setTraceId(formatTraceId(context.getTraceId())) .addSpans(spanBuilder.build()); return Traces.newBuilder().addTraces(traceBuilder).build(); }</code><technical_language>I a TraceSource return a Trace</technical_language>

Target:
public Trace generateStartSpan(String projectId, TraceContext context, TraceContext parentContext, SpanKind spanKind, String name, Timestamp timestamp) { TraceSpan.Builder spanBuilder = TraceSpan.newBuilder() .setSpanId(context.getSpanId().getSpanId()) .setKind(toSpanKindProto(spanKind)) .setName(name) .setStartTime(toTimestamp(timestamp)); if (parentContext.getTraceId().equals(context.getTraceId()) && parentContext.getSpanId().isValid()) { spanBuilder.setParentSpanId(parentContext.getSpanId().getSpanId()); } Trace.Builder traceBuilder = Trace.newBuilder() .setProjectId(projectId) .setTraceId(formatTraceId(context.getTraceId())) .addSpans(spanBuilder.build()); return traceBuilder.build(); }
Source:
<code>public JLoadTest testRpsLoadWithWarmUp() { long warmUp = testDuration/4; double expectedRps = 3*rps/4 + rps/2/4; double expectedUsersCount = expectedRps * latency; double expectedIterations = expectedRps * testDuration; return test("simple rps Load with warm up", rpsLoad(rps) <START> .withWarmUpTimeInMilliseconds(warmUp).build(), <END> durationTermination(testDuration), deviationLimit(JMetricName.PERF_THROUGHPUT, expectedRps, 0.05, 0.1), deviationLimit(JMetricName.PERF_ITERATION_SAMPLES, expectedIterations, 0.05, 0.1), userLimit(expectedUsersCount), LATENCY_LIMIT, DURATION_LIMIT, SUCCESS_LIMIT); }</code><technical_language>return *1000 please, supposed method fixed, renamed %)</technical_language>

Target:
public JLoadTest testRpsLoadWithWarmUp() { long warmUp = testDuration/4; double expectedRps = 3*rps/4 + rps/2/4; double expectedUsersCount = expectedRps * latency; double expectedIterations = expectedRps * testDuration; return test("simple rps Load with warm up", rpsLoad(rps) .withWarmUpTimeInMilliseconds(warmUp * 1000).build(), durationTermination(testDuration), deviationLimit(JMetricName.PERF_THROUGHPUT, expectedRps, 0.05, 0.1), deviationLimit(JMetricName.PERF_ITERATION_SAMPLES, expectedIterations, 0.05, 0.1), userLimit(expectedUsersCount), LATENCY_LIMIT, DURATION_LIMIT, SUCCESS_LIMIT); }
Source:
<code>AgentOptions createAgentOptions() { final AgentOptions agentOptions = new AgentOptions(); agentOptions.setDestfile(getDestFile().getAbsolutePath()); if (append != null) { agentOptions.setAppend(append.booleanValue()); } if (includes != null && !includes.isEmpty()) { <START> final String agentIncludes = StringUtils.join(includes.iterator(), <END> ":"); agentOptions.setIncludes(agentIncludes); } if (excludes != null && !excludes.isEmpty()) { final String agentExcludes = StringUtils.join(excludes.iterator(), ":"); agentOptions.setExcludes(agentExcludes); } if (exclClassLoaders != null) { agentOptions.setExclClassloader(exclClassLoaders); } if (inclBootstrapClasses != null) { agentOptions.setInclBootstrapClasses(inclBootstrapClasses .booleanValue()); } if (inclNoLocationClasses != null) { agentOptions.setInclNoLocationClasses(inclNoLocationClasses .booleanValue()); } if (sessionId != null) { agentOptions.setSessionId(sessionId); } if (dumpOnExit != null) { agentOptions.setDumpOnExit(dumpOnExit.booleanValue()); } if (output != null) { agentOptions.setOutput(output); } if (address != null) { agentOptions.setAddress(address); } if (port != null) { agentOptions.setPort(port.intValue()); } if (classDumpDir != null) { agentOptions.setClassDumpDir(classDumpDir.getAbsolutePath()); } if (jmx != null) { agentOptions.setJmx(jmx.booleanValue()); } return agentOptions; }</code><technical_language>Inline local variable</technical_language>

Target:
AgentOptions createAgentOptions() { final AgentOptions agentOptions = new AgentOptions(); agentOptions.setDestfile(getDestFile().getAbsolutePath()); if (append != null) { agentOptions.setAppend(append.booleanValue()); } if (includes != null && !includes.isEmpty()) { agentOptions .setIncludes(StringUtils.join(includes.iterator(), ":")); } if (excludes != null && !excludes.isEmpty()) { agentOptions .setExcludes(StringUtils.join(excludes.iterator(), ":")); } if (exclClassLoaders != null) { agentOptions.setExclClassloader(exclClassLoaders); } if (inclBootstrapClasses != null) { agentOptions.setInclBootstrapClasses(inclBootstrapClasses .booleanValue()); } if (inclNoLocationClasses != null) { agentOptions.setInclNoLocationClasses(inclNoLocationClasses .booleanValue()); } if (sessionId != null) { agentOptions.setSessionId(sessionId); } if (dumpOnExit != null) { agentOptions.setDumpOnExit(dumpOnExit.booleanValue()); } if (output != null) { agentOptions.setOutput(output); } if (address != null) { agentOptions.setAddress(address); } if (port != null) { agentOptions.setPort(port.intValue()); } if (classDumpDir != null) { agentOptions.setClassDumpDir(classDumpDir.getAbsolutePath()); } if (jmx != null) { agentOptions.setJmx(jmx.booleanValue()); } return agentOptions; }
Source:
<code>public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext) throws InterruptedException { if (!idealStateInitialized.get()) { logger.info("Received initial notification for IdealState change from {}", dcName); idealStateInitialized.set(true); } else { logger.info("IdealState change triggered from {}", dcName); } synchronized (notificationLock) { partitionToResourceNameByDc.put(dcName, new ConcurrentHashMap<>()); for (IdealState state : idealState) { String resourceName = state.getResourceName(); for (String partitionStr : state.getPartitionSet()) { partitionToResourceNameByDc.get(dcName).put(partitionStr, resourceName); } } <START> helixClusterManagerMetrics.idealStateChangeTriggerCount.inc(); <END> } }</code><technical_language>this need in lock</technical_language>

Target:
public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext) throws InterruptedException { if (!idealStateInitialized.get()) { logger.info("Received initial notification for IdealState change from {}", dcName); idealStateInitialized.set(true); } else { logger.info("IdealState change triggered from {}", dcName); } ConcurrentHashMap<String, String> newPartitionToResourceMap = new ConcurrentHashMap<>(); for (IdealState state : idealState) { String resourceName = state.getResourceName(); for (String partitionStr : state.getPartitionSet()) { newPartitionToResourceMap.put(partitionStr, resourceName); } } partitionToResourceNameByDc.put(dcName, newPartitionToResourceMap); helixClusterManagerMetrics.idealStateChangeTriggerCount.inc(); }
Source:
<code>public void loadRewardedAd(final MediationRewardedAdConfiguration mediationRewardedAdConfiguration, final MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> mediationAdLoadCallback) { if (!VASAds.isInitialized()) { mediationAdLoadCallback.onFailure("Verizon Ads SDK not initialized"); return; } Bundle serverParameters = mediationRewardedAdConfiguration.getServerParameters(); <START> String placementId = serverParameters.getString(PLACEMENT_KEY); <END> if (TextUtils.isEmpty(placementId)) { mediationAdLoadCallback.onFailure( "Verizon Ads SDK placement ID must be set in mediationRewardedAdConfiguration server params"); return; } setCoppaValue(mediationRewardedAdConfiguration); VASAds.setLocationEnabled((mediationRewardedAdConfiguration.getLocation() != null)); AdapterIncentivizedEventListener adapterIncentivizedEventListener = new AdapterIncentivizedEventListener(mediationAdLoadCallback); try { interstitialAdFactory = new InterstitialAdFactory(mediationRewardedAdConfiguration.getContext(), placementId, adapterIncentivizedEventListener); interstitialAdFactory.setRequestMetaData(getRequestMetadata()); interstitialAdFactory.load(adapterIncentivizedEventListener); } catch (Exception e) { Log.e(TAG, "Failed to load Verizon Ads SDK Incentivized Video Ad", e); ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { if (mediationAdLoadCallback != null) { mediationAdLoadCallback.onFailure("Failed to load Incentivized Video Ad"); } } }); } }</code><technical_language>fetchPlacementID(), retrieve placement ID</technical_language>

Target:
public void loadRewardedAd(final MediationRewardedAdConfiguration mediationRewardedAdConfiguration, final MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> mediationAdLoadCallback) { if (!VASAds.isInitialized()) { mediationAdLoadCallback.onFailure("Verizon Ads SDK not initialized"); return; } Bundle serverParameters = mediationRewardedAdConfiguration.getServerParameters(); String placementId = fetchPlacementId(serverParameters); setContext(mediationRewardedAdConfiguration.getContext()); if (TextUtils.isEmpty(placementId)) { mediationAdLoadCallback.onFailure( "Verizon Ads SDK placement ID must be set in mediationRewardedAdConfiguration server params"); return; } setCoppaValue(mediationRewardedAdConfiguration); VASAds.setLocationEnabled((mediationRewardedAdConfiguration.getLocation() != null)); adapterIncentivizedEventListener = new AdapterIncentivizedEventListener(mediationAdLoadCallback); try { interstitialAdFactory = new InterstitialAdFactory(mediationRewardedAdConfiguration.getContext(), placementId, adapterIncentivizedEventListener); interstitialAdFactory.setRequestMetaData(getRequestMetadata()); interstitialAdFactory.load(adapterIncentivizedEventListener); } catch (Exception e) { Log.e(TAG, "Failed to load Verizon Ads SDK Incentivized Video Ad", e); ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { if (mediationAdLoadCallback != null) { mediationAdLoadCallback.onFailure("Failed to load Incentivized Video Ad"); } } }); } }
Source:
<code>void assignOperationOnExpDesignVariables(final List<MeasurementVariable> conditions) { final VariableTypeList factors = this.studyDataManager.getAllStudyFactors(this.userSelection.getWorkbook().getStudyDetails().getId()); for (final MeasurementVariable mvar : conditions) { if ((mvar.getTermId() == TermId.EXPERIMENT_DESIGN_FACTOR.getId() || mvar.getTermId() == TermId.NUMBER_OF_REPLICATES.getId() <START> || mvar.getTermId() == TermId.PERCENTAGE_OF_REPLICATION.getId() <END> || mvar.getTermId() == TermId.EXPT_DESIGN_SOURCE.getId()) && factors.findById(mvar.getTermId()) != null) { mvar.setOperation(Operation.UPDATE); } } }</code><technical_language>Create static list of experiment design factors as: private static List<Integer> EXPERIMENT_DESIGN_FACTOR_IDS = Arrays.asList( TermId.EXPERIMENT_DESIGN_FACTOR.getId(), TermId.NUMBER_OF_REPLICATES.getId(), TermId.PERCENTAGE_OF_REPLICATION.getId(), TermId.EXPT_DESIGN_SOURCE.getId()); .. validate as.. if (EXPERIMENT_DESIGN_FACTOR_IDS.contains(mvar.getTermId()) && factors.findById(mvar.getTermId()) != null)</technical_language>

Target:
void assignOperationOnExpDesignVariables(final List<MeasurementVariable> conditions) { final VariableTypeList factors = this.studyDataManager.getAllStudyFactors(this.userSelection.getWorkbook().getStudyDetails().getId()); for (final MeasurementVariable mvar : conditions) { if (EXPERIMENT_DESIGN_FACTOR_IDS.contains(mvar.getTermId()) && factors.findById(mvar.getTermId()) != null) { mvar.setOperation(Operation.UPDATE); } } }
Source:
<code>public void changeDetail(final Change.Id id, final AsyncCallback<ChangeDetail> callback) { run(callback, new Action<ChangeDetail>() { public ChangeDetail run(final ReviewDb db) throws OrmException, Failure { final Account.Id me = Common.getAccountId(); final Change change = db.changes().get(id); if (change == null) { throw new Failure(new NoSuchEntityException()); } final PatchSet patch = db.patchSets().get(change.currentPatchSetId()); <START> final Project proj = db.projects().get(change.getDest().getParentKey()); <END> if (patch == null || proj == null) { throw new Failure(new NoSuchEntityException()); } assertCanRead(change); final boolean anon; boolean canAbandon = false; if (me == null) { anon = true; } else { anon = canRead(null, change.getDest().getParentKey()); canAbandon = me.equals(change.getOwner()) || me.equals(patch.getUploader()) || Common.getGroupCache().isAdministrator(me) || Common.getGroupCache().isInGroup(me, proj.getOwnerGroupId()); } final ChangeDetail d = new ChangeDetail(); d.load(db, new AccountInfoCacheFactory(db), change, anon, canAbandon); return d; } }); }</code><technical_language>damn. Common.getProjectCache().get(change.getDest().getParentKey()) is faster (avoids a database query), promised if client offline. promise if get offline support implemented</technical_language>

Target:
public void changeDetail(final Change.Id id, final AsyncCallback<ChangeDetail> callback) { run(callback, new Action<ChangeDetail>() { public ChangeDetail run(final ReviewDb db) throws OrmException, Failure { final Account.Id me = Common.getAccountId(); final Change change = db.changes().get(id); if (change == null) { throw new Failure(new NoSuchEntityException()); } final PatchSet patch = db.patchSets().get(change.currentPatchSetId()); final Project proj = Common.getProjectCache().get(change.getDest().getParentKey()) .getProject(); if (patch == null || proj == null) { throw new Failure(new NoSuchEntityException()); } assertCanRead(change); final boolean anon; boolean canAbandon = false; if (me == null) { anon = true; } else { anon = canRead(null, change.getDest().getParentKey()); canAbandon = me.equals(change.getOwner()) || me.equals(patch.getUploader()) || Common.getGroupCache().isAdministrator(me) || Common.getGroupCache().isInGroup(me, proj.getOwnerGroupId()); } final ChangeDetail d = new ChangeDetail(); d.load(db, new AccountInfoCacheFactory(db), change, anon, canAbandon); return d; } }); }
Source:
<code>public List<Address> getItemShippingAddresses() { <START> return null; <END> }</code><technical_language>do return null here</technical_language>

Target:
public List<Address> getItemShippingAddresses() { return itemShippingAddresses; }
Source:
<code>public Matrix shuffle(Factory factory) { double[] matrix = new double[columns * rows]; int k = 0; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { matrix[k] = get(i, j); k++; } } <START> Random rnd = new Random(); <END> for (int i = matrix.length - 1; i >= 0; i--) { int index = rnd.nextInt(i + 1); double a = matrix[index]; matrix[index] = matrix[i]; matrix[i] = a; } Matrix result = factory().createMatrix(rows, columns); k = 0; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { result.set(i, j, matrix[k]); k++; } } return result; }</code><technical_language>So, do in 2D dimenstion (not in flat representation)</technical_language>

Target:
public Matrix shuffle(Factory factory) { Matrix result = copy(factory); Random rnd = new Random(); for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { int ii = rnd.nextInt(rows - i) + i; int jj = rnd.nextInt(columns - j) + j; double a = result.get(ii, jj); result.set(ii, jj, result.get(i, j)); result.set(i, j, a); } } return result; }
Source:
<code>public void errorsNotWrapped() { <START> AuthenticationServer orgAuthServer = SyncManager.getAuthServer(); <END> AuthenticationServer authServer = Mockito.mock(AuthenticationServer.class); when(authServer.loginUser(any(Credentials.class), any(URL.class))).thenReturn(SyncTestUtils.createErrorResponse(ErrorCode.ACCESS_DENIED)); SyncManager.setAuthServerImpl(authServer); try { User.login(Credentials.facebook("foo"), "<LINK_0>"); fail(); } catch (ObjectServerError e) { assertEquals(ErrorCode.ACCESS_DENIED, e.getErrorCode()); } finally { SyncManager.setAuthServerImpl(orgAuthServer); } }</code><technical_language>orgX</technical_language>

Target:
public void errorsNotWrapped() { AuthenticationServer originalAuthServer = SyncManager.getAuthServer(); AuthenticationServer authServer = Mockito.mock(AuthenticationServer.class); when(authServer.loginUser(any(Credentials.class), any(URL.class))).thenReturn(SyncTestUtils.createErrorResponse(ErrorCode.ACCESS_DENIED)); SyncManager.setAuthServerImpl(authServer); try { User.login(Credentials.facebook("foo"), "<LINK_0>"); fail(); } catch (ObjectServerError e) { assertEquals(ErrorCode.ACCESS_DENIED, e.getErrorCode()); } finally { SyncManager.setAuthServerImpl(originalAuthServer); } }
Source:
<code>public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", <START> loadedVersion == null || <END> migrationVersion.compareTo(loadedVersion) > 0); }</code><technical_language>a null loaded version. If is case update this test</technical_language>

Target:
public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", migrationVersion.compareTo(loadedVersion) > 0); }
Source:
<code>public void injectInto(NashornEngine nashornEngine) { <START> nashornEngine.eval("var InstallationType = Java.type(\"org.phoenicis.scripts.ui.InstallationType\")", <END> this::throwException); nashornEngine.put("SetupWizard", (TriFunction<InstallationType, String, Optional<URI>, UiSetupWizardImplementation>) (installationType, name, miniature) -> { final UiSetupWizardImplementation uiSetupWizardImplementation = uiSetupWizardFactory.create(name, miniature, installationType); nashornEngine.addErrorHandler(e -> uiSetupWizardImplementation.close()); return uiSetupWizardImplementation; }, this::throwException); }</code><technical_language>I get package runtime, in case move on. get this information Class object</technical_language>

Target:
public void injectInto(NashornEngine nashornEngine) { nashornEngine.eval("var InstallationType = Java.type(\"" + InstallationType.class.getCanonicalName() + "\")", this::throwException); nashornEngine.put("SetupWizard", (TriFunction<InstallationType, String, Optional<URI>, UiSetupWizardImplementation>) (installationType, name, miniature) -> { final UiSetupWizardImplementation uiSetupWizardImplementation = uiSetupWizardFactory.create(name, miniature, installationType); nashornEngine.addErrorHandler(e -> uiSetupWizardImplementation.close()); return uiSetupWizardImplementation; }, this::throwException); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ActionDefinition that = (ActionDefinition) o; if (tenantId != null ? !tenantId.equals(that.tenantId) : that.tenantId != null) return false; if (actionPlugin != null ? !actionPlugin.equals(that.actionPlugin) : that.actionPlugin != null) return false; if (actionId != null ? !actionId.equals(that.actionId) : that.actionId != null) return false; <START> return properties != null ? properties.equals(that.properties) : that.properties == null; <END> }</code><technical_language>want properties involved in equals/hashcode is actionId sufficient</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ActionDefinition that = (ActionDefinition) o; if (tenantId != null ? !tenantId.equals(that.tenantId) : that.tenantId != null) return false; if (actionPlugin != null ? !actionPlugin.equals(that.actionPlugin) : that.actionPlugin != null) return false; if (actionId != null ? !actionId.equals(that.actionId) : that.actionId != null) return false; if (properties != null ? !properties.equals(that.properties) : that.properties != null) return false; if (states != null ? !states.equals(that.states) : that.states != null) return false; return calendar != null ? calendar.equals(that.calendar) : that.calendar == null; }
Source:
<code><START> public void clearServers() { <END> RESTHelper.clearServers(); }</code><technical_language>static, other @AfterClass methods</technical_language>

Target:
public static void clearServers() { RESTHelper.clearServers(); }
Source:
<code>public String toString() { <START> return (days == 1) ? days + " day" : days + " days"; <END> }</code><technical_language>days null. is right fix java if (days == null) { return null; } return days.toString() + ((days == 1) ? " day" : " days");</technical_language>

Target:
public String toString() { if (days == null) { return ""; } return days.toString() + ((days == 1) ? " day" : " days"); }
Source:
<code>private static int setDiskBootOrder(List<VmDevice> devices, int bootOrder) { for (VmDevice device : devices) { if (device.getType().equals(VmDeviceCommonUtils.DISK) && device.getDevice().equals(VmDeviceCommonUtils.DISK)) { <START> device.setBootOrder(bootOrder++); <END> } } return bootOrder; }</code><technical_language>This is adding functionality, in 3.0 system-disk is bootable. I method oldAPI flag, in a case break system-disk skip non-system disks</technical_language>

Target:
private static int setDiskBootOrder(List<VmDevice> devices, int bootOrder) { boolean isOldCluster = VmDeviceCommonUtils.isOldClusterVersion(vm); for (VmDevice device : devices) { if (device.getType().equals(VmDeviceCommonUtils.DISK) && device.getDevice().equals(VmDeviceCommonUtils.DISK)) { if (isOldCluster) { if (DbFacade.getInstance() .getDiskDao() .get(device.getDeviceId()) .getDiskType() .equals(DiskType.System)) { device.setBootOrder(bootOrder++); break; } } else { device.setBootOrder(bootOrder++); } } } return bootOrder; }
Source:
<code>public boolean enable() throws KuraException { try { int pid = LinuxProcessUtil.getPid(this.procString); if (pid > -1) { logger.error("DNS server is already running, bringing it down..."); disable(); } int result; if (OS_VERSION .startsWith(KuraSupportedPlatforms.YOCTO_121.getImageName() + "_") || OS_VERSION.startsWith(KuraSupportedPlatforms.YOCTO_161.getImageName() + "_" + KuraSupportedPlatforms.YOCTO_161.getImageVersion() + "_")) { result = LinuxProcessUtil.start("/etc/init.d/bind start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.RASPBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.DEBIAN_100.getImageName())) { result = LinuxProcessUtil.start("/etc/init.d/bind9 start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.FEDORA_2X.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.CENTOS_7.getImageName()) <START> || OS_VERSION.equals(KuraSupportedPlatforms.RHEL_73.getImageName() + "_" <END> + KuraSupportedPlatforms.RHEL_73.getImageVersion())) { result = LinuxProcessUtil.start("/bin/systemctl start named"); } else { logger.info("Linux named enable fallback"); result = LinuxProcessUtil.start("/etc/init.d/named start"); } if (result == 0) { logger.debug("DNS server started."); logger.trace("{}", this.dnsServerConfigIP4); return true; } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return false; }</code><technical_language>sense provide some kind of NameServerController interface implement some SystemdNameServerController instead of keeping if-nightmare alive?</technical_language>

Target:
public boolean enable() throws KuraException { try { int pid = LinuxProcessUtil.getPid(this.procString); if (pid > -1) { logger.error("DNS server is already running, bringing it down..."); disable(); } int result; if (OS_VERSION .startsWith(KuraSupportedPlatforms.YOCTO_121.getImageName() + "_") || OS_VERSION.startsWith(KuraSupportedPlatforms.YOCTO_161.getImageName() + "_" + KuraSupportedPlatforms.YOCTO_161.getImageVersion() + "_")) { result = LinuxProcessUtil.start("/etc/init.d/bind start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.RASPBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.DEBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.UBUNTU_16.getImageName())) { result = LinuxProcessUtil.start("/etc/init.d/bind9 start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.FEDORA_2X.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.CENTOS_7.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.RHEL_73.getImageName() + "_" + KuraSupportedPlatforms.RHEL_73.getImageVersion())) { result = LinuxProcessUtil.start("/bin/systemctl start named"); } else { logger.info("Linux named enable fallback"); result = LinuxProcessUtil.start("/etc/init.d/named start"); } if (result == 0) { logger.debug("DNS server started."); logger.trace("{}", this.dnsServerConfigIP4); return true; } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return false; }
Source:
<code><START> public void surviveWithOneTaskAsStandby() throws InterruptedException, IOException { <END> IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp( inputTopic, Collections.singletonList( new KeyValue<>(0, 0)), TestUtils.producerConfig( CLUSTER.bootstrapServers(), IntegerSerializer.class, IntegerSerializer.class, new Properties()), 10L); final String stateDirPath = TestUtils.tempDirectory(appId).getPath(); final CountDownLatch instanceLatch = new CountDownLatch(1); try ( final KafkaStreams streamInstanceOne = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-1/", instanceLatch); final KafkaStreams streamInstanceTwo = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-2/", instanceLatch); ) { streamInstanceOne.start(); streamInstanceTwo.start(); assertTrue(instanceLatch.await(15, TimeUnit.SECONDS)); waitForCondition(() -> streamInstanceOne.state().equals(KafkaStreams.State.RUNNING), "Stream instance one should be up and running by now"); waitForCondition(() -> streamInstanceTwo.state().equals(KafkaStreams.State.RUNNING), "Stream instance two should be up and running by now"); streamInstanceOne.close(Duration.ZERO); streamInstanceTwo.close(Duration.ZERO); streamInstanceOne.cleanUp(); streamInstanceTwo.cleanUp(); } }</code><technical_language>nit: simplify throws Exception</technical_language>

Target:
public void surviveWithOneTaskAsStandby() throws Exception { IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp( inputTopic, Collections.singletonList( new KeyValue<>(0, 0)), TestUtils.producerConfig( CLUSTER.bootstrapServers(), IntegerSerializer.class, IntegerSerializer.class, new Properties()), 10L); final String stateDirPath = TestUtils.tempDirectory(appId).getPath(); final CountDownLatch instanceLatch = new CountDownLatch(1); try ( final KafkaStreams streamInstanceOne = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-1/", instanceLatch); final KafkaStreams streamInstanceTwo = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-2/", instanceLatch); ) { streamInstanceOne.start(); streamInstanceTwo.start(); assertTrue(instanceLatch.await(15, TimeUnit.SECONDS)); waitForCondition(() -> streamInstanceOne.state().equals(KafkaStreams.State.RUNNING), "Stream instance one should be up and running by now"); waitForCondition(() -> streamInstanceTwo.state().equals(KafkaStreams.State.RUNNING), "Stream instance two should be up and running by now"); streamInstanceOne.close(Duration.ZERO); streamInstanceTwo.close(Duration.ZERO); streamInstanceOne.cleanUp(); streamInstanceTwo.cleanUp(); } }
Source:
<code>protected RowExpression visitSubscriptExpression(SubscriptExpression node, Void context) { RowExpression base = process(node.getBase(), context); RowExpression index = process(node.getIndex(), context); if (base instanceof SpecialFormExpression && base.getType() instanceof RowType) { ConstantExpression pos = (ConstantExpression) index; int i = toIntExact((Long) pos.getValue()); <START> return specialForm(DEREFERENCE, getType(node), base, new ConstantExpression(i - 1, INTEGER)); <END> } return call( SUBSCRIPT.name(), functionManager.resolveOperator(SUBSCRIPT, fromTypes(base.getType(), index.getType())), getType(node), base, index); }</code><technical_language>Presto recognize int primitive type. i - 1 is of long type</technical_language>

Target:
protected RowExpression visitSubscriptExpression(SubscriptExpression node, Void context) { RowExpression base = process(node.getBase(), context); RowExpression index = process(node.getIndex(), context); if (base.getType() instanceof RowType) { checkState(index instanceof ConstantExpression, "Subscript expression on ROW requires a ConstantExpression"); ConstantExpression position = (ConstantExpression) index; checkState(position.getValue() instanceof Long, "ConstantExpression should contain a valid integer index into the row"); Long offset = (Long) position.getValue(); checkState( offset >= 1 && offset <= base.getType().getTypeParameters().size(), "Subscript index out of bounds %s: should be >= 1 and <= %s", offset, base.getType().getTypeParameters().size()); return specialForm(DEREFERENCE, getType(node), base, Expressions.constant(offset - 1, INTEGER)); } return call( SUBSCRIPT.name(), functionManager.resolveOperator(SUBSCRIPT, fromTypes(base.getType(), index.getType())), getType(node), base, index); }
Source:
<code><START> private static String getPropertyAsString(Properties prop) { <END> StringWriter writer = new StringWriter(); try { prop.store(writer, ""); } catch (IOException e) { logger.error("Cannot retrieve consumer properties for Logging : {}", e.getMessage() ); } return writer.getBuffer().toString(); }</code><technical_language>is static</technical_language>

Target:
private String getPropertyAsString(Properties prop) { StringWriter writer = new StringWriter(); try { prop.store(writer, ""); } catch (IOException e) { logger.error("Cannot retrieve consumer properties for Logging : {}", e.getMessage() ); } return writer.getBuffer().toString(); }
Source:
<code>private String getAvailablePluginsString() { final StringBuilder buf = new StringBuilder("Available Plugins\r\n"); for (Plugin plugin : getAvailablePlugins()) { Set<String> versionSet = plugin.getVersions(); String[] versions = versionSet.toArray(new String[versionSet.size()]); <START> if (versions.length == 1) { <END> buf.append("install ").append(plugin.getID()).append('=').append(versions[0]).append("\r\n"); } else { buf.append("install ["); for (int i = versions.length - 1; i >= 0; i--) { buf.append(plugin.getID()).append('=').append(versions[i]); if (i != 0) { buf.append(", "); } } buf.append("]\r\n"); } } return buf.toString(); }</code><technical_language>vary output for users, automation scripts crazy. lean</technical_language>

Target:
private String getAvailablePluginsString() { ArrayList<String> res = new ArrayList<>(); for (Plugin plugin : getAvailablePlugins()) { List<String> versions = new ArrayList<>(plugin.getVersions()); Collections.reverse(versions); res.add(plugin.getID() + "=" + Arrays.toString(versions.toArray())); } return Arrays.toString(res.toArray()); }
Source:
<code>public Google2AttributesDefinition() { addAttribute(GENDER, Converters.genderConverter); <START> addAttribute(GENDER, Converters.stringConverter); <END> addAttribute(DISPLAY_NAME, Converters.stringConverter); addAttribute(GIVEN_NAME, Converters.stringConverter); addAttribute(FAMILY_NAME, Converters.stringConverter); addAttribute(URL, Converters.stringConverter); addAttribute(PICTURE, Converters.stringConverter); addAttribute(LANGUAGE, Converters.localeConverter); addAttribute(BIRTHDAY, Google2Converters.dateConverter); addAttribute(EMAILS, Google2Converters.listEmailConverter); }</code><technical_language>GENDER again</technical_language>

Target:
public Google2AttributesDefinition() { addAttribute(GENDER, Converters.genderConverter); addAttribute(DISPLAY_NAME, Converters.stringConverter); addAttribute(GIVEN_NAME, Converters.stringConverter); addAttribute(FAMILY_NAME, Converters.stringConverter); addAttribute(URL, Converters.stringConverter); addAttribute(PICTURE, Converters.stringConverter); addAttribute(LANGUAGE, Converters.localeConverter); addAttribute(BIRTHDAY, Google2Converters.dateConverter); addAttribute(EMAILS, Google2Converters.listEmailConverter); }
Source:
<code>public boolean truncateLog(long zxid) { try { close(); FileTxnLog truncLog = new FileTxnLog(dataDir); boolean truncated = truncLog.truncate(zxid); truncLog.close(); txnLog = new FileTxnLog(dataDir); snapLog = new FileSnap(snapDir); return truncated; <START> } catch (IOException e) { <END> LOG.error("Unable to truncate Txn log", e); return false; } }</code><technical_language>wondering if IOException is sufficient. If <LINK_0> catching Exception, basically exception other IOException occurring here, kick situation. In fact, caller of Follower.followLeader() catches Exception. QuorumPeer, "Unexpected exception" log warnings. I part of fix, "Unexpected exception" errors process. wdyt</technical_language>

Target:
public boolean truncateLog(long zxid) { try { close(); try (FileTxnLog truncLog = new FileTxnLog(dataDir)) { boolean truncated = truncLog.truncate(zxid); txnLog = new FileTxnLog(dataDir); snapLog = new FileSnap(snapDir); return truncated; } } catch (IOException e) { LOG.error("Unable to truncate Txn log", e); return false; } }
Source:
<code>protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } else if (height > oldHeight) { <START> App.fireJavascriptEvent("hidekeyboard"); <END> } else if (height < oldHeight) { App.fireJavascriptEvent("showkeyboard"); } oldHeight = height; oldWidth = width; }</code><technical_language>a static method, webView.pluginManager.getPlugin("org.apache.cordova.App") get instance-specific plugin instance</technical_language>

Target:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } else if (height > oldHeight) { sendEvent("hidekeyboard"); } else if (height < oldHeight) { sendEvent("showkeyboard"); } oldHeight = height; oldWidth = width; }
Source:
<code>void prepare() throws InfrastructureException { OpenShiftClient osClient = clientFactory.createOC(workspaceId); if (osClient.serviceAccounts().inNamespace(projectName).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(osClient); } String execRoleName = "exec"; if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { createExecRole(osClient, execRoleName); } String viewRoleName = "view"; <START> if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { <END> createViewRole(osClient, viewRoleName); } osClient.roleBindings().inNamespace(projectName).createOrReplace(createExecRoleBinding()); osClient.roleBindings().inNamespace(projectName).createOrReplace(createViewRoleBinding()); }</code><technical_language>execRoleName changed viewRoleName, right</technical_language>

Target:
void prepare() throws InfrastructureException { OpenShiftClient osClient = clientFactory.createOC(workspaceId); if (osClient.serviceAccounts().inNamespace(projectName).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(osClient); } String execRoleName = "exec"; if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { createExecRole(osClient, execRoleName); } String viewRoleName = "workspace-view"; if (osClient.roles().inNamespace(projectName).withName(viewRoleName).get() == null) { createViewRole(osClient, viewRoleName); } osClient.roleBindings().inNamespace(projectName).createOrReplace(createExecRoleBinding()); osClient.roleBindings().inNamespace(projectName).createOrReplace(createViewRoleBinding()); }
Source:
<code>public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { <START> <END> PedigreeReader pedigreeReader = new PedigreePedReader(jobOptions.getPipelineOptions().getString("input.pedigree")); pedigreeReader.open(); List<Pedigree> pedigrees = pedigreeReader.read(); pedigreeReader.close(); return RepeatStatus.FINISHED; }</code><technical_language>Remove blank line</technical_language>

Target:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { PedigreeReader pedigreeReader = new PedigreePedReader(jobOptions.getPipelineOptions().getString("input.pedigree")); pedigreeReader.open(); pedigree = pedigreeReader.read().get(0); pedigreeReader.close(); return RepeatStatus.FINISHED; }
Source:
<code>private void add(@NonNull Container container, String name, LoadStatistics stats) { <START> boolean headless = Boolean.getBoolean("java.awt.headless"); <END> for (MultiStageTimeSeries.TimeScale scale: MultiStageTimeSeries.TimeScale.values()) { if (!headless) { BufferedImage image = stats.createTrendChart(scale).createChart().createBufferedImage(500, 400); container.add(new ImageContent(String.format("load-stats/%s/%s.png", name, scale.name().toLowerCase()), image)); } container.add(new CsvContent(String.format("load-stats/%s/%s.csv", name, scale.name().toLowerCase()), stats, scale)); } }</code><technical_language>this is wrong check for a headless enviroment - check GraphicsEnvironment.isHeadless()</technical_language>

Target:
private void add(@NonNull Container container, String name, LoadStatistics stats) { boolean headless = GraphicsEnvironment.isHeadless(); for (MultiStageTimeSeries.TimeScale scale : MultiStageTimeSeries.TimeScale.values()) { String scaleName = scale.name().toLowerCase(Locale.ENGLISH); if (!headless) { BufferedImage image = stats.createTrendChart(scale).createChart().createBufferedImage(500, 400); container.add(new ImageContent(String.format("load-stats/%s/%s.png", name, scaleName), image)); } container.add(new CsvContent(String.format("load-stats/%s/%s.csv", name, scaleName), stats, scale)); } if (headless) { container.add(new GnuPlotScript(String.format("load-stats/%s/gnuplot", name))); } }
Source:
<code>public void execute(Tuple inputTuple) { Map<String, List<Object>> results = modelRunner.scoredTuplePerStream(inputTuple); <START> LOG.debug("Emitting events to collector: [{}]", results); <END> for (Map.Entry<String, List<Object>> result : results.entrySet()) { collector.emit(result.getKey(), inputTuple, new Values(result.getValue())); } }</code><technical_language>Emitting tuples in streams. Collector is internal detail</technical_language>

Target:
public void execute(Tuple inputTuple) { try { Map<String, List<Object>> results = modelRunner.scoredTuplePerStream(inputTuple); for (Map.Entry<String, List<Object>> result : results.entrySet()) { LOG.debug("Emitting tuples in the following stream: [{}]", result.getKey()); collector.emit(result.getKey(), inputTuple, new Values(result.getValue())); } } catch (Exception exception) { LOG.error("There was an error while evaluation the tuple [{}]", inputTuple); } }
Source:
<code>public DocumentModel getParentDocument(DocumentRef docRef) { Document parentDoc; if (docRef != null && docRef.type() == DocumentRef.PATH) { <START> String targetPath = ((String) docRef.reference()); <END> String parentPath = targetPath.substring(0, targetPath.lastIndexOf("/")); parentDoc = resolveReference( new PathRef(parentPath)); } else { Document doc = resolveReference(docRef); parentDoc = doc.getParent(); } if (parentDoc == null) { return null; } if (!hasPermission(parentDoc, READ)) { throw new DocumentSecurityException("Privilege READ is not granted to " + getPrincipal().getName()); } return readModel(parentDoc); }</code><technical_language>simply docPath instead of targetPath, docRef, doc</technical_language>

Target:
public DocumentModel getParentDocument(DocumentRef docRef) { Document parentDoc = resolveParentReference(docRef); if (parentDoc == null) { return null; } if (!hasPermission(parentDoc, READ)) { throw new DocumentSecurityException("Privilege READ is not granted to " + getPrincipal().getName()); } return readModel(parentDoc); }
Source:
<code>private void reportFileUploadException(FileUploadException e) { <START> validator.add(new ValidationMessage(e.getMessage(), "file.upload.exception")); <END> logger.warn("There was some problem parsing this multipart request, " + "or someone is not sending a RFC1867 compatible multipart request.", e); }</code><technical_language>I end user is supposed actual upload error. add: new I18nMessage("upload", "file.upload.exception")</technical_language>

Target:
private void reportFileUploadException(FileUploadException e) { validator.add(new I18nMessage("upload", "file.upload.exception")); logger.warn("There was some problem parsing this multipart request, " + "or someone is not sending a RFC1867 compatible multipart request.", e); }
Source:
<code>public IdpResponse build() { if (mPendingCredential != null) { return new IdpResponse(mPendingCredential, new FirebaseUiException(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT)); <START> } else { <END> String providerId = mUser.getProviderId(); if (!AuthUI.SUPPORTED_PROVIDERS.contains(providerId)) { throw new IllegalStateException("Unknown provider: " + providerId); } if (AuthUI.SOCIAL_PROVIDERS.contains(providerId) && TextUtils.isEmpty(mToken)) { throw new IllegalStateException( "Token cannot be null when using a non-email provider."); } if (providerId.equals(TwitterAuthProvider.PROVIDER_ID) && TextUtils.isEmpty(mSecret)) { throw new IllegalStateException( "Secret cannot be null when using the Twitter provider."); } return new IdpResponse(mUser, mToken, mSecret, mIsNewUser); } }</code><technical_language>if returns, need for this else. remove a level of nesting here</technical_language>

Target:
public IdpResponse build() { if (mPendingCredential != null) { return new IdpResponse(mPendingCredential, new FirebaseUiException(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT)); } String providerId = mUser.getProviderId(); if (!AuthUI.SUPPORTED_PROVIDERS.contains(providerId)) { throw new IllegalStateException("Unknown provider: " + providerId); } if (AuthUI.SOCIAL_PROVIDERS.contains(providerId) && TextUtils.isEmpty(mToken)) { throw new IllegalStateException( "Token cannot be null when using a non-email provider."); } if (providerId.equals(TwitterAuthProvider.PROVIDER_ID) && TextUtils.isEmpty(mSecret)) { throw new IllegalStateException( "Secret cannot be null when using the Twitter provider."); } return new IdpResponse(mUser, mToken, mSecret, mIsNewUser); }
Source:
<code>public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { try { MinioClient minioClient = new MinioClient( "<LINK_1>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); List<SseConfigurationRule> rules = new LinkedList<>(); <START> rules.add(new SseConfigurationRule("my-kms-master-key-id", null)); <END> SseConfiguration config = new SseConfiguration(rules); minioClient.setBucketEncryption("my-bucketname", config); System.out.println("Encryption configuration of my-bucketname is set successfully"); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }</code><technical_language>MinIO support sse-kms yet. endpoint in this example AWS set SSE-S3 default</technical_language>

Target:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { try { MinioClient minioClient = new MinioClient( "<LINK_1>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); List<SseConfigurationRule> rules = new LinkedList<>(); rules.add(new SseConfigurationRule(null, SseAlgorithm.AES256)); SseConfiguration config = new SseConfiguration(rules); minioClient.setBucketEncryption( SetBucketEncryptionArgs.builder().bucket("my-bucketname").config(config).build()); System.out.println("Encryption configuration of my-bucketname is set successfully"); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }
Source:
<code>public void testConfigFromEnvVars() { environmentVariables.set("FFWD_TTL", "100"); environmentVariables.set("FFWD_OUTPUT_RATELIMIT", "1000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYLIMIT", "10000"); <START> environmentVariables.set("FFWD_OUTPUT_HYPERLOGLOGSWAPPERIODMS", "3000000"); <END> CoreOutputManager outputManager = getOutputManager(null); assertEquals(100, outputManager.getTtl()); assertEquals(Long.valueOf(1000), outputManager.getRateLimit()); assertEquals(Long.valueOf(10000), outputManager.getCardinalityLimit()); assertEquals(Long.valueOf(3000000), outputManager.getHLLPRefreshPeriodLimit()); }</code><technical_language>a hard time reading HYPERLOGLOGSWAPPERIODMS more readable</technical_language>

Target:
public void testConfigFromEnvVars() { environmentVariables.set("FFWD_TTL", "100"); environmentVariables.set("FFWD_OUTPUT_RATELIMIT", "1000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYLIMIT", "10000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYTTL", "3000000"); CoreOutputManager outputManager = getOutputManager(null); assertEquals(100, outputManager.getTtl()); assertEquals(Long.valueOf(1000), outputManager.getRateLimit()); assertEquals(Long.valueOf(10000), outputManager.getCardinalityLimit()); assertEquals(Long.valueOf(3000000), outputManager.getHLLPRefreshPeriodLimit()); }
Source:
<code>private boolean useBasicAuth() { <START> return Boolean.getBoolean("solr.useBasicAuth"); <END> }</code><technical_language>a privileged action retrieve system properties</technical_language>

Target:
private boolean useBasicAuth() { return Boolean.valueOf(getProperty(SOLR_USE_BASIC_AUTH)); }
Source:
<code>protected boolean set(EntityParrot dataHolder, ParrotVariant value) { <START> if (value instanceof SpongeParrotVariant) { <END> dataHolder.setVariant(((SpongeParrotVariant)value).type); return true; } return false; }</code><technical_language>If anticipating non-sponge implemented variants, throw exception for a bad data transaction</technical_language>

Target:
protected boolean set(EntityParrot dataHolder, ParrotVariant value) { dataHolder.setVariant(((SpongeParrotVariant)value).type); return true; }