auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Object[][] testRemoveContentsBeforeProvider() { return new Object[][] { { span(chunk(6,10), chunk(11,15)), null, span(chunk(6,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(), span(chunk(6,10), chunk(11,15)) }, <START> { span(chunk(6,10), chunk(11,15)), span(chunk(6, 0)), span(chunk(6,10), chunk(11,15)) }, <END> { span(chunk(6,10), chunk(11,15)), span(chunk(7, 0)), span(chunk(7,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(9, 0)), span(chunk(9,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(10, 0)), span(chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(11, 0)), span(chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(12, 0)), span(chunk(12,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(15, 0)), span() }, { span(chunk(6,10), chunk(11,15)), span(chunk(16, 0)), span() }, }; }</code><technical_language>creating chunks end < start -- is this allowed</technical_language>

Target:
private Object[][] testRemoveContentsBeforeProvider() { return new Object[][] { { span(chunk(6,10), chunk(11,15)), null, span(chunk(6,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(), span(chunk(6,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(6,0)), span(chunk(6,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(7,0)), span(chunk(7,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(9,0)), span(chunk(9,10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(10,0)), span(chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(11,0)), span(chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(12,0)), span(chunk(12,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(15,0)), span() }, { span(chunk(6,10), chunk(11,15)), span(chunk(16,0)), span() }, { span(chunk(6,10), chunk(11,15)), span(chunk(6,10), chunk(7,16)), span(chunk(6, 10), chunk(11,15)) }, { span(chunk(6,10), chunk(11,15)), span(chunk(16,17), chunk(18,19)), span() }, }; }
Source:
<code>public HelixVcrCluster(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig, ClusterMap clusterMap) throws Exception { if (Utils.isNullOrEmpty(cloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING)) { throw new IllegalArgumentException("Missing value for " + CloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING); } else if (Utils.isNullOrEmpty(cloudConfig.VCR_CLUSTER_NAME)) { throw new IllegalArgumentException("Missing value for " + CloudConfig.VCR_CLUSTER_NAME); <START> } else if (Utils.isNullOrEmpty(cloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING)) { <END> throw new IllegalArgumentException("Missing value for " + CloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING); } currentDataNode = new CloudDataNode(cloudConfig, clusterMapConfig); List<? extends PartitionId> allPartitions = clusterMap.getAllPartitionIds(null); logger.trace("All partitions from clusterMap: " + allPartitions); partitionIdMap = allPartitions.stream().collect(Collectors.toMap(PartitionId::toPathString, Function.identity())); vcrClusterName = cloudConfig.vcrClusterName; vcrInstanceName = ClusterMapUtils.getInstanceName(clusterMapConfig.clusterMapHostName, clusterMapConfig.clusterMapPort); manager = HelixManagerFactory.getZKHelixManager(vcrClusterName, vcrInstanceName, InstanceType.PARTICIPANT, cloudConfig.vcrClusterZkConnectString); manager.getStateMachineEngine() .registerStateModelFactory(LeaderStandbySMD.name, new HelixVcrStateModelFactory(this)); manager.connect(); helixAdmin = manager.getClusterManagmentTool(); metrics = new HelixVcrClusterMetrics(clusterMap.getMetricRegistry()); logger.info("HelixVcrCluster started successfully."); }</code><technical_language>this a repeat of check</technical_language>

Target:
public HelixVcrCluster(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig, ClusterMap clusterMap) throws Exception { if (Utils.isNullOrEmpty(cloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING)) { throw new IllegalArgumentException("Missing value for " + CloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING); } else if (Utils.isNullOrEmpty(cloudConfig.VCR_CLUSTER_NAME)) { throw new IllegalArgumentException("Missing value for " + CloudConfig.VCR_CLUSTER_NAME); } currentDataNode = new CloudDataNode(cloudConfig, clusterMapConfig); List<? extends PartitionId> allPartitions = clusterMap.getAllPartitionIds(null); logger.trace("All partitions from clusterMap: {}.", allPartitions); partitionIdMap = allPartitions.stream().collect(Collectors.toMap(PartitionId::toPathString, Function.identity())); vcrClusterName = cloudConfig.vcrClusterName; vcrInstanceName = ClusterMapUtils.getInstanceName(clusterMapConfig.clusterMapHostName, clusterMapConfig.clusterMapPort); manager = HelixManagerFactory.getZKHelixManager(vcrClusterName, vcrInstanceName, InstanceType.PARTICIPANT, cloudConfig.vcrClusterZkConnectString); manager.getStateMachineEngine() .registerStateModelFactory(LeaderStandbySMD.name, new HelixVcrStateModelFactory(this)); manager.connect(); helixAdmin = manager.getClusterManagmentTool(); metrics = new HelixVcrClusterMetrics(clusterMap.getMetricRegistry()); logger.info("HelixVcrCluster started successfully."); }
Source:
<code>public boolean upgrade() { try { String envPortalURL = environment.getProperty("portalURL", Key.MANAGEMENT_URL.defaultValue()); final Optional<Parameter> optionalParameter = parameterRepository.findById(Key.MANAGEMENT_URL.key()); if (!optionalParameter.isPresent()) { Parameter managementURLParam = new Parameter(); managementURLParam.setKey(Key.MANAGEMENT_URL.key()); managementURLParam.setValue(envPortalURL); managementURLParam.setReferenceType(ParameterReferenceType.ENVIRONMENT); managementURLParam.setReferenceId(GraviteeContext.getDefaultEnvironment()); parameterRepository.create(managementURLParam); } else if (StringUtils.isEmpty(optionalParameter.get().getValue())) { Parameter managementURLParam = optionalParameter.get(); managementURLParam.setValue(envPortalURL); parameterRepository.update(managementURLParam); } } catch (TechnicalException e) { <START> logger.error("Error while updating 'portal.url' parameter : {}", e); <END> } return true; }</code><technical_language>management.url no</technical_language>

Target:
public boolean upgrade() { try { String envPortalURL = environment.getProperty("portalURL", Key.MANAGEMENT_URL.defaultValue()); final Optional<Parameter> optionalParameter = parameterRepository.findById(Key.MANAGEMENT_URL.key()); if (!optionalParameter.isPresent()) { Parameter managementURLParam = new Parameter(); managementURLParam.setKey(Key.MANAGEMENT_URL.key()); managementURLParam.setValue(envPortalURL); managementURLParam.setReferenceType(ParameterReferenceType.ENVIRONMENT); managementURLParam.setReferenceId(GraviteeContext.getDefaultEnvironment()); parameterRepository.create(managementURLParam); } else if (StringUtils.isEmpty(optionalParameter.get().getValue())) { Parameter managementURLParam = optionalParameter.get(); managementURLParam.setValue(envPortalURL); parameterRepository.update(managementURLParam); } } catch (TechnicalException e) { logger.error("Error while updating 'management.url' parameter : {}", e); } return true; }
Source:
<code>public double computeFor(ASTMethodOrConstructorDeclaration node, MetricVersion version) { <START> JavaParserVisitor visitor = (CycloVersion.IGNORE_BOOLEAN_PATHS.equals(version)) <END> ? new CycloPathUnawareOperationVisitor() : new StandardCycloVisitor(); MutableInt cyclo = (MutableInt) node.jjtAccept(visitor, new MutableInt(1)); return (double) cyclo.getValue(); }</code><technical_language>version is a enum, compare == directly</technical_language>

Target:
public double computeFor(ASTMethodOrConstructorDeclaration node, MetricVersion version) { JavaParserVisitor visitor = (CycloVersion.IGNORE_BOOLEAN_PATHS == version) ? new CycloPathUnawareOperationVisitor() : new StandardCycloVisitor(); MutableInt cyclo = (MutableInt) node.jjtAccept(visitor, new MutableInt(1)); return (double) cyclo.getValue(); }
Source:
<code>private void findByCoordsFn() { final Button latView = (Button) findViewById(R.id.buttonLatitude); final Button lonView = (Button) findViewById(R.id.buttonLongitude); final String latText = latView.getText().toString(); final String lonText = lonView.getText().toString(); <START> if (latText == null || StringUtils.isEmpty(latText) || lonText == null || StringUtils.isEmpty(lonText)) { END> latView.setText(cgBase.formatLatitude(geo.latitudeNow, true)); lonView.setText(cgBase.formatLongitude(geo.longitudeNow, true)); } else { Map<String, Object> latParsed = cgBase.parseCoordinate(latText, "lat"); Map<String, Object> lonParsed = cgBase.parseCoordinate(lonText, "lat"); if (latParsed == null || latParsed.get("coordinate") == null || latParsed.get("string") == null) { showToast(res.getString(R.string.err_parse_lat)); return; } if (lonParsed == null || lonParsed.get("coordinate") == null || lonParsed.get("string") == null) { showToast(res.getString(R.string.err_parse_lon)); return; } final Intent cachesIntent = new Intent(this, cgeocaches.class); cachesIntent.putExtra("type", "coordinate"); cachesIntent.putExtra("latitude", (Double) latParsed.get("coordinate")); cachesIntent.putExtra("longitude", (Double) lonParsed.get("coordinate")); cachesIntent.putExtra("cachetype", settings.cacheType); startActivity(cachesIntent); } }</code><technical_language>This change is wrong, StringUtils.isEmpty checks for null</technical_language>

Target:
private void findByCoordsFn() { final Button latView = (Button) findViewById(R.id.buttonLatitude); final Button lonView = (Button) findViewById(R.id.buttonLongitude); final String latText = latView.getText().toString(); final String lonText = lonView.getText().toString(); if (StringUtils.isEmpty(latText) || StringUtils.isEmpty(lonText)) { latView.setText(cgBase.formatLatitude(geo.latitudeNow, true)); lonView.setText(cgBase.formatLongitude(geo.longitudeNow, true)); } else { Map<String, Object> latParsed = cgBase.parseCoordinate(latText, "lat"); Map<String, Object> lonParsed = cgBase.parseCoordinate(lonText, "lat"); if (latParsed == null || latParsed.get("coordinate") == null || latParsed.get("string") == null) { showToast(res.getString(R.string.err_parse_lat)); return; } if (lonParsed == null || lonParsed.get("coordinate") == null || lonParsed.get("string") == null) { showToast(res.getString(R.string.err_parse_lon)); return; } final Intent cachesIntent = new Intent(this, cgeocaches.class); cachesIntent.putExtra("type", "coordinate"); cachesIntent.putExtra("latitude", (Double) latParsed.get("coordinate")); cachesIntent.putExtra("longitude", (Double) lonParsed.get("coordinate")); cachesIntent.putExtra("cachetype", settings.cacheType); startActivity(cachesIntent); } }
Source:
<code>public UsageStatisticsReportDTO generateReport() { final SystemInfoUtils sysInfoUtils = new SystemInfoUtils(); final UsageStatisticsReportDTO usageStatisticsReport = new UsageStatisticsReportDTO(); try { usageStatisticsReport.setSystemId(m_stateManager.getOrGenerateSystemId()); } catch (IOException e) { <START> LOG.warn("An error occurred while retrieving the system id.", e); <END> } usageStatisticsReport.setOsName(System.getProperty("os.name")); usageStatisticsReport.setOsArch(System.getProperty("os.arch")); usageStatisticsReport.setOsVersion(System.getProperty("os.version")); usageStatisticsReport.setVersion(sysInfoUtils.getVersion()); usageStatisticsReport.setPackageName(sysInfoUtils.getPackageName()); usageStatisticsReport.setNodes(m_nodeDao.countAll()); usageStatisticsReport.setIpInterfaces(m_ipInterfaceDao.countAll()); usageStatisticsReport.setSnmpInterfaces(m_snmpInterfaceDao.countAll()); usageStatisticsReport.setMonitoredServices(m_monitoredServiceDao.countAll()); usageStatisticsReport.setEvents(m_eventDao.countAll()); usageStatisticsReport.setAlarms(m_alarmDao.countAll()); usageStatisticsReport.setNodesBySysOid(m_nodeDao.getNumberOfNodesBySysOid()); return usageStatisticsReport; }</code><technical_language>continue</technical_language>

Target:
public UsageStatisticsReportDTO generateReport() { final SystemInfoUtils sysInfoUtils = new SystemInfoUtils(); final UsageStatisticsReportDTO usageStatisticsReport = new UsageStatisticsReportDTO(); try { usageStatisticsReport.setSystemId(m_stateManager.getOrGenerateSystemId()); } catch (IOException e) { LOG.warn("An error occurred while retrieving the system id. " + "The usage report will be submitted with a null system id.", e); } usageStatisticsReport.setOsName(System.getProperty("os.name")); usageStatisticsReport.setOsArch(System.getProperty("os.arch")); usageStatisticsReport.setOsVersion(System.getProperty("os.version")); usageStatisticsReport.setVersion(sysInfoUtils.getVersion()); usageStatisticsReport.setPackageName(sysInfoUtils.getPackageName()); usageStatisticsReport.setNodes(m_nodeDao.countAll()); usageStatisticsReport.setIpInterfaces(m_ipInterfaceDao.countAll()); usageStatisticsReport.setSnmpInterfaces(m_snmpInterfaceDao.countAll()); usageStatisticsReport.setMonitoredServices(m_monitoredServiceDao.countAll()); usageStatisticsReport.setEvents(m_eventDao.countAll()); usageStatisticsReport.setAlarms(m_alarmDao.countAll()); usageStatisticsReport.setNodesBySysOid(m_nodeDao.getNumberOfNodesBySysOid()); return usageStatisticsReport; }
Source:
<code>private BaseObject findNotificationPreference(XWikiDocument xWikiDocument, NotificationPreference notificationPreference) throws NotificationException { List<BaseObject> objects = xWikiDocument.getXObjects(NOTIFICATION_PREFERENCE_CLASS); if (objects != null) { Iterator<BaseObject> it = objects.iterator(); while (it.hasNext()) { <START> BaseObject object = it.next(); <END> if (object != null && notificationPreference.getEventType().equals(object.getStringValue(EVENT_TYPE_FIELD)) && notificationPreference.getApplicationId().equals( object.getStringValue(APPLICATION_ID_FIELD))) { String format = object.getStringValue(FORMAT_FIELD); if ((StringUtils.isBlank(format) && notificationPreference.getFormat().equals( NotificationFormat.ALERT)) || notificationPreference.getFormat().equals(NotificationFormat.valueOf( format.toUpperCase()))) { return object; } } } } return null; }</code><technical_language>(minor): this easily replaced for (BaseObject: object : objects) {</technical_language>

Target:
private BaseObject findNotificationPreference(XWikiDocument xWikiDocument, NotificationPreference notificationPreference) throws NotificationException { List<BaseObject> objects = xWikiDocument.getXObjects(NOTIFICATION_PREFERENCE_CLASS); if (objects != null) { for (BaseObject object : objects) { if (object != null && notificationPreference.getEventType().equals(object.getStringValue(EVENT_TYPE_FIELD)) && notificationPreference.getApplicationId().equals( object.getStringValue(APPLICATION_ID_FIELD))) { String format = object.getStringValue(FORMAT_FIELD); if ((StringUtils.isBlank(format) && notificationPreference.getFormat().equals( NotificationFormat.ALERT)) || notificationPreference.getFormat().equals(NotificationFormat.valueOf( format.toUpperCase()))) { return object; } } } } return null; }
Source:
<code>public boolean hasPermission(Permission permissionRequirement) { <START> if (true) return true; <END> return getRoles().stream() .map(Role::getPermissions) .flatMap(Collection::stream) .anyMatch(permission -> permission.implies(permissionRequirement)); }</code><technical_language>Please remove diagnostic modifications merging</technical_language>

Target:
public boolean hasPermission(Permission permissionRequirement) { return getRoles().stream() .map(Role::getPermissions) .flatMap(Collection::stream) .anyMatch(permission -> permission.implies(permissionRequirement)); }
Source:
<code>private void setupFeedAutoSkipPreference() { findPreference("skipping").setOnPreferenceClickListener(preference -> { new FeedPreferenceSkipDialog(getContext(), feedPreferences.getFeedSkipIntro(), feedPreferences.getFeedSkipEnding()) { @Override protected void onConfirmed(String skipIntroStr, String skipEndingStr) { int skipIntro; int skipEnding; try { skipIntro = Integer.parseInt(skipIntroStr); } catch (NumberFormatException e) { skipIntro = 0; <START> } <END> try { skipEnding = Integer.parseInt(skipEndingStr); } catch (NumberFormatException e) { skipEnding = 0; } feedPreferences.setFeedSkipIntro(skipIntro); feedPreferences.setFeedSkipEnding(skipEnding); feed.savePreferences(); } }.show(); return false; }); }</code><technical_language>I this done FeedPreferenceSkipDialog FeedSettingsFragment a bit shorter</technical_language>

Target:
private void setupFeedAutoSkipPreference() { findPreference(PREF_AUTO_SKIP).setOnPreferenceClickListener(preference -> { new FeedPreferenceSkipDialog(getContext(), feedPreferences.getFeedSkipIntro(), feedPreferences.getFeedSkipEnding()) { @Override protected void onConfirmed(int skipIntro, int skipEnding) { feedPreferences.setFeedSkipIntro(skipIntro); feedPreferences.setFeedSkipEnding(skipEnding); feed.savePreferences(); EventBus.getDefault().post( new SkipIntroEndingChangedEvent(feedPreferences.getFeedSkipIntro(), feedPreferences.getFeedSkipEnding(), feed.getId())); } }.show(); return false; }); }
Source:
<code>private void testGeneralQuestionOperations() throws Exception { testCancelAddingNewQuestion(); testCancelEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testCopyQuestion(); testChangeFeedbackGiver(); testChangeFeedbackRecipient(); testVisibilityOptionsCorrespondToFeedbackPath(); testVisibilityOptionsUncheckedWhenHidden(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); <START> testEditThenDeleteQuestionAction(1); <END> testEditNonExistentQuestion(); testResponseRate(); }</code><technical_language>Nice of combining tests spend (too much) more resources! Good workaround is a challenging this point in time test this Javascript level (which actually)</technical_language>

Target:
private void testGeneralQuestionOperations() throws Exception { testCancelAddingNewQuestion(); testCancelEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testCopyQuestion(); testChangeFeedbackGiver(); testChangeFeedbackRecipient(); testVisibilityOptionsCorrespondToFeedbackPath(); testVisibilityOptionsUncheckedWhenHidden(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testEditWithEmptyQuestionTextThenDeleteQuestionAction(1); testEditNonExistentQuestion(); testResponseRate(); }
Source:
<code>public Void visitTableFinish(TableFinishNode node, IOPlanBuilder context) { WriterTarget writerTarget = node.getTarget(); if (writerTarget instanceof CreateHandle) { CreateHandle createHandle = (CreateHandle) writerTarget; context.setOutputTable(new QualifiedTablePrefix( createHandle.getHandle().getConnectorId().getCatalogName(), createHandle.getSchemaTableName().getSchemaName(), createHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof InsertHandle) { InsertHandle insertHandle = (InsertHandle) writerTarget; context.setOutputTable(new QualifiedTablePrefix( insertHandle.getHandle().getConnectorId().getCatalogName(), insertHandle.getSchemaTableName().getSchemaName(), insertHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof DeleteHandle) { DeleteHandle deleteHandle = (DeleteHandle) writerTarget; context.setOutputTable(new QualifiedTablePrefix( deleteHandle.getHandle().getConnectorId().getCatalogName(), deleteHandle.getSchemaTableName().getSchemaName(), deleteHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof CreateName || writerTarget instanceof InsertReference) { throw new IllegalStateException(format("%s should not appear in final plan", writerTarget.getClass().getSimpleName())); } else { <START> throw new IllegalStateException(format("Cannot recognize WriterTarget subclass %s", writerTarget.getClass().getSimpleName())); <END> } node.getSources().forEach(plan -> plan.accept(this, context)); return null; }</code><technical_language>Unknown WriterTarget subclass: %s</technical_language>

Target:
public Void visitTableFinish(TableFinishNode node, IOPlanBuilder context) { WriterTarget writerTarget = node.getTarget(); if (writerTarget instanceof CreateHandle) { CreateHandle createHandle = (CreateHandle) writerTarget; context.setOutputTable(new CatalogSchemaTableName( createHandle.getHandle().getConnectorId().getCatalogName(), createHandle.getSchemaTableName().getSchemaName(), createHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof InsertHandle) { InsertHandle insertHandle = (InsertHandle) writerTarget; context.setOutputTable(new CatalogSchemaTableName( insertHandle.getHandle().getConnectorId().getCatalogName(), insertHandle.getSchemaTableName().getSchemaName(), insertHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof DeleteHandle) { DeleteHandle deleteHandle = (DeleteHandle) writerTarget; context.setOutputTable(new CatalogSchemaTableName( deleteHandle.getHandle().getConnectorId().getCatalogName(), deleteHandle.getSchemaTableName().getSchemaName(), deleteHandle.getSchemaTableName().getTableName())); } else if (writerTarget instanceof CreateName || writerTarget instanceof InsertReference) { throw new IllegalStateException(format("%s should not appear in final plan", writerTarget.getClass().getSimpleName())); } else { throw new IllegalStateException(format("Unknown WriterTarget subclass %s", writerTarget.getClass().getSimpleName())); } return processChildren(node, context); }
Source:
<code>public static void register(ScalarFunctionModule module) { for (var timestampType : List.of(DataTypes.TIMESTAMP, DataTypes.TIMESTAMPZ)) { module.register( Signature.scalar( ArithmeticFunctions.Names.ADD, DataTypes.INTERVAL.getTypeSignature(), timestampType.getTypeSignature(), timestampType.getTypeSignature() ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "+", ArithmeticFunctions.Names.ADD, args, args.get(1)) ); module.register( Signature.scalar( ArithmeticFunctions.Names.ADD, timestampType.getTypeSignature(), DataTypes.INTERVAL.getTypeSignature(), <START> DataTypes.INTERVAL.getTypeSignature() <END> ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "+", ArithmeticFunctions.Names.ADD, args, args.get(0)) ); module.register( Signature.scalar( ArithmeticFunctions.Names.SUBTRACT, timestampType.getTypeSignature(), DataTypes.INTERVAL.getTypeSignature(), DataTypes.INTERVAL.getTypeSignature() ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "-", ArithmeticFunctions.Names.SUBTRACT, args, args.get(0) ) ); } }</code><technical_language>Timestamp + interval return a timestamp, no</technical_language>

Target:
public static void register(ScalarFunctionModule module) { for (var timestampType : List.of(DataTypes.TIMESTAMP, DataTypes.TIMESTAMPZ)) { module.register( Signature.scalar( ArithmeticFunctions.Names.ADD, DataTypes.INTERVAL.getTypeSignature(), timestampType.getTypeSignature(), timestampType.getTypeSignature() ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "+", ArithmeticFunctions.Names.ADD, args, args.get(1)) ); module.register( Signature.scalar( ArithmeticFunctions.Names.ADD, timestampType.getTypeSignature(), DataTypes.INTERVAL.getTypeSignature(), timestampType.getTypeSignature() ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "+", ArithmeticFunctions.Names.ADD, args, args.get(0)) ); module.register( Signature.scalar( ArithmeticFunctions.Names.SUBTRACT, timestampType.getTypeSignature(), DataTypes.INTERVAL.getTypeSignature(), timestampType.getTypeSignature() ).withForbiddenCoercion(), args -> new IntervalTimestampArithmeticScalar( "-", ArithmeticFunctions.Names.SUBTRACT, args, args.get(0) ) ); } }
Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } <START> if (tree.is(METHOD)) { <END> MethodTree methodTree = (MethodTree) tree; Symbol.TypeSymbol enclosingClass = methodTree.symbol().enclosingClass(); String className = enclosingClass.type().fullyQualifiedName(); MethodMatcher writeObjectMatcher = SerializableContract.writeObjectMatcher(className); if (writeObjectMatcher.matches(methodTree) && hasModifier(methodTree.modifiers(), SYNCHRONIZED)) { SynchronizationVisitor visitor = new SynchronizationVisitor(); enclosingClass.declaration().accept(visitor); if (visitor.synchronizedMethodCount == 1 && !visitor.hasSynchronizedStmt) { reportIssue(ModifiersUtils.getModifier(methodTree.modifiers(), SYNCHRONIZED), "Remove this \"synchronized\" keyword."); } } } }</code><technical_language>need for if anymore registered method</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; Symbol.TypeSymbol enclosingClass = methodTree.symbol().enclosingClass(); String className = enclosingClass.type().fullyQualifiedName(); MethodMatcher writeObjectMatcher = SerializableContract.writeObjectMatcher(className); if (writeObjectMatcher.matches(methodTree) && hasModifier(methodTree.modifiers(), SYNCHRONIZED)) { SynchronizationVisitor visitor = new SynchronizationVisitor(methodTree); enclosingClass.declaration().accept(visitor); if (!visitor.moreThanSingleLock) { reportIssue(ModifiersUtils.getModifier(methodTree.modifiers(), SYNCHRONIZED), "Remove this \"synchronized\" keyword."); } } }
Source:
<code>public long submitjobs(int threadPoolSize) throws Exception { List<JobId> allJobs = new LinkedList<>(); ProActiveConfiguration.load(); RMFactory.setOsJavaProperty(); schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null); final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(1, 1); final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize); long startTime = System.currentTimeMillis(); List<Future<List<JobId>>> futures = new ArrayList<>(); for (int i = 0; i < threadPoolSize; ++i) { final Future<List<JobId>> future = executorService.submit(new Callable<List<JobId>>() { @Override public List<JobId> call() throws Exception { <START> List<JobId> result = new ArrayList<>(); <END> try { for (int i = 0; i < numberOfJobSubmittedByThread; ++i) { result.add(schedulerHelper.submitJob(job)); } } catch (Exception e) { e.printStackTrace(); } return result; } }); futures.add(future); } for (Future<List<JobId>> future : futures) { allJobs.addAll(future.get()); } long endTime = System.currentTimeMillis(); long actualTime = endTime - startTime; for (JobId jobId : allJobs) { if (!schedulerHelper.getSchedulerInterface().getJobState(jobId).isFinished()) { schedulerHelper.getSchedulerInterface().killJob(jobId); } schedulerHelper.getSchedulerInterface().removeJob(jobId); } return actualTime; }</code><technical_language>List<JobId> result = new ArrayList<>(); => List<JobId> result = new ArrayList<>(numberOfJobSubmittedByThread);</technical_language>

Target:
public long submitjobs(int threadPoolSize) throws Exception { List<JobId> allJobs = new LinkedList<>(); ProActiveConfiguration.load(); RMFactory.setOsJavaProperty(); schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null); final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(1, 1); final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize); long startTime = System.currentTimeMillis(); List<Future<List<JobId>>> futures = new ArrayList<>(); for (int i = 0; i < threadPoolSize; ++i) { final Future<List<JobId>> future = executorService.submit(() -> { List<JobId> result = new ArrayList<>(numberOfJobSubmittedByThread); repeater.accept(numberOfJobSubmittedByThread, () -> { result.add(schedulerHelper.submitJob(job)); }); return result; }); futures.add(future); } for (Future<List<JobId>> future : futures) { allJobs.addAll(future.get()); } long endTime = System.currentTimeMillis(); long actualTime = endTime - startTime; for (JobId jobId : allJobs) { if (!schedulerHelper.getSchedulerInterface().getJobState(jobId).isFinished()) { schedulerHelper.getSchedulerInterface().killJob(jobId); } schedulerHelper.getSchedulerInterface().removeJob(jobId); } return actualTime; }
Source:
<code>protected void setActionItem(Action action, Object result) { if (result == null) { return; } String name = result.getClass().getSimpleName().toLowerCase(); for (Method m : action.getClass().getMethods()) { if (m.getName().startsWith("set") && m.getName().replace("set", "").toLowerCase().equals(name)) { try { m.invoke(action, result); break; } catch (Exception e) { log.error("Resource to action asignment failure: ", e.getMessage()); <START> log.debug("Exception", e); <END> break; } } } }</code><technical_language>stack trace level error</technical_language>

Target:
protected void setActionItem(Action action, Object result) { if (result == null) { return; } String name = result.getClass().getSimpleName().toLowerCase(); for (Method m : action.getClass().getMethods()) { if (m.getName().startsWith("set") && m.getName().replace("set", "").toLowerCase().equals(name)) { try { m.invoke(action, result); break; } catch (Exception e) { log.error("Resource to action assignment failure.", e); break; } } } }
Source:
<code>public int hashCode() { <START> return HashUtil.combineHashCodes((null != ul) ? ul.hashCode() : 0, <END> (null != lr) ? lr.hashCode() : 0); }</code><technical_language>simplified: java return HashUtil.combineHashCodes(Objects.hashCode(ul), Objects.hashCode(ur));</technical_language>

Target:
public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(ul), Objects.hashCode(lr)); }
Source:
<code>protected void registerManager() { world.getSystem(AspectSubscriptionManager.class) .get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) { added(entities); } <START> <END> @Override public void removed(IntBag entities) { deleted(entities); } }); }</code><technical_language>handicapping users removing changed? I thought it, SubscriptionListeners proper aspects cover use-cases. "Should". > consider people EntityObserver of systems. EntityObservers strictly Managers - 1.0.0 a bit more lenient it</technical_language>

Target:
protected void registerManager() { world.getAspectSubscriptionManager() .get(all()) .addSubscriptionListener(new EntitySubscription.SubscriptionListener() { @Override public void inserted(IntBag entities) { added(entities); } @Override public void removed(IntBag entities) { deleted(entities); } }); }
Source:
<code>private void handleMiscCode(byte cc2) { switch (cc2) { case CTRL_ROLL_UP_CAPTIONS_2_ROWS: captionRowCount = 2; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_ROLL_UP_CAPTIONS_3_ROWS: captionRowCount = 3; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_ROLL_UP_CAPTIONS_4_ROWS: captionRowCount = 4; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_RESUME_CAPTION_LOADING: setCaptionMode(CC_MODE_POP_ON); return; case CTRL_RESUME_DIRECT_CAPTIONING: setCaptionMode(CC_MODE_PAINT_ON); return; } if (captionMode == CC_MODE_UNKNOWN) { return; } switch (cc2) { case CTRL_ERASE_DISPLAYED_MEMORY: if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_PAINT_ON) { currentCue = new Eia608CueBuilder(); cues.clear(); } subtitle.setCues(Collections.<Cue>emptyList()); return; case CTRL_ERASE_NON_DISPLAYED_MEMORY: currentCue = new Eia608CueBuilder(); cues.clear(); return; case CTRL_END_OF_CAPTION: renderCues(); cues.clear(); return; case CTRL_CARRIAGE_RETURN: if (captionMode == CC_MODE_ROLL_UP) { for (Eia608CueBuilder cue : cues) { if (!cue.rollUp()) { <START> cues.remove(cue); <END> } } currentCue = new Eia608CueBuilder(); cues.add(currentCue); while (cues.size() > captionRowCount) { cues.pollFirst(); } } return; case CTRL_BACKSPACE: currentCue.backspace(); return; case CTRL_DELETE_TO_END_OF_ROW: return; } }</code><technical_language>This code ConcurrentModificationException rollUp() returns false</technical_language>

Target:
private void handleMiscCode(byte cc2) { switch (cc2) { case CTRL_ROLL_UP_CAPTIONS_2_ROWS: captionRowCount = 2; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_ROLL_UP_CAPTIONS_3_ROWS: captionRowCount = 3; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_ROLL_UP_CAPTIONS_4_ROWS: captionRowCount = 4; setCaptionMode(CC_MODE_ROLL_UP); return; case CTRL_RESUME_CAPTION_LOADING: setCaptionMode(CC_MODE_POP_ON); return; case CTRL_RESUME_DIRECT_CAPTIONING: setCaptionMode(CC_MODE_PAINT_ON); return; } if (captionMode == CC_MODE_UNKNOWN) { return; } switch (cc2) { case CTRL_ERASE_DISPLAYED_MEMORY: if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_PAINT_ON) { currentCue = new Eia608CueBuilder(); cues.clear(); } subtitle.setCues(Collections.<Cue>emptyList()); return; case CTRL_ERASE_NON_DISPLAYED_MEMORY: currentCue = new Eia608CueBuilder(); cues.clear(); return; case CTRL_END_OF_CAPTION: renderCues(); cues.clear(); return; case CTRL_CARRIAGE_RETURN: if (captionMode == CC_MODE_ROLL_UP) { Iterator<Eia608CueBuilder> iterator = cues.iterator(); while (iterator.hasNext()) { Eia608CueBuilder cue = iterator.next(); if (!cue.rollUp()) { iterator.remove(); } } currentCue = new Eia608CueBuilder(); cues.add(currentCue); while (cues.size() > captionRowCount) { cues.pollFirst(); } } return; case CTRL_BACKSPACE: currentCue.backspace(); return; case CTRL_DELETE_TO_END_OF_ROW: return; } }
Source:
<code>public CompletionStage<CacheStatusResponse> handleJoin(String cacheName, Address joiner, CacheJoinInfo joinInfo, int joinerViewId) { CompletionStage<Void> viewStage; if (joinerViewId <= viewId && clusterManagerStatus != ClusterManagerStatus.RECOVERING_CLUSTER) { viewStage = CompletableFutures.completedNull(); } else { if (trace) { log.tracef("Delaying join request from %s until view %s is installed (and cluster status is recovered)", joiner, joinerViewId); } viewStage = joinViewFuture.newConditionStage(ctmi -> ctmi.canHandleJoin(joinerViewId), joinInfo.getTimeout(), MILLISECONDS) .exceptionally(e -> wrapJoinTimeoutException(joinerViewId, e)); } return viewStage.thenApply(v -> prepareJoin(cacheName, joiner, joinInfo, joinerViewId)) <START> .thenApply(cacheStatus -> { <END> if (cacheStatus == null) { return null; } return cacheStatus.doJoin(joiner, joinInfo); }); }</code><technical_language>done Function</technical_language>

Target:
public CompletionStage<CacheStatusResponse> handleJoin(String cacheName, Address joiner, CacheJoinInfo joinInfo, int joinerViewId) { CompletionStage<Void> viewStage; if (joinerViewId <= viewId && clusterManagerStatus != ClusterManagerStatus.RECOVERING_CLUSTER) { viewStage = CompletableFutures.completedNull(); } else { if (trace) { log.tracef("Delaying join request from %s until view %s is installed (and cluster status is recovered)", joiner, joinerViewId); } viewStage = joinViewFuture.newConditionStage(ctmi -> ctmi.canHandleJoin(joinerViewId), joinInfo.getTimeout(), MILLISECONDS) .exceptionally(e -> wrapJoinTimeoutException(joinerViewId, e)); } return viewStage.thenApply(v -> { ClusterCacheStatus cacheStatus = prepareJoin(cacheName, joiner, joinInfo, joinerViewId); if (cacheStatus == null) { return null; } return cacheStatus.doJoin(joiner, joinInfo); }); }
Source:
<code>public void executeCommand() { Boolean tranRetVal = TransactionSupport.executeInNewTransaction(new TransactionMethod<Boolean>() { @Override <START> public Boolean runInTransaction() { <END> if (georepSessions != null) { for (GlusterGeoRepSession session : georepSessions) { GlusterVolumeEntity slaveVolume = getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); if (slaveVolume == null) { continue; } VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); if (slaveUpServer == null) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED, VdcBllErrors.NoUpServerFoundInRemoteCluster.name()); setSucceeded(false); return false; } List<GlusterVolumeSnapshotEntity> slaveVolumeSnapshots = getGlusterVolumeSnapshotDao().getAllByVolumeId(slaveVolume.getId()); if (!deleteAllGlusterVolumeSnapshots(slaveUpServer.getId(), slaveVolume.getId(), slaveVolumeSnapshots)) { return false; } } } return true; } }); if (!tranRetVal) { return; } deleteAllGlusterVolumeSnapshots(getUpServer().getId(), getGlusterVolumeId(), snapshots); VDSReturnValue retVal = runVdsCommand(VDSCommandType.DeleteAllGlusterVolumeSnapshots, new GlusterVolumeVDSParameters(getUpServer().getId(), getGlusterVolumeName())); setSucceeded(retVal.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED, retVal.getVdsError().getMessage()); } else { List<Guid> guids = new ArrayList<>(); for (GlusterVolumeSnapshotEntity snapshot : snapshots) { guids.add(snapshot.getId()); } getGlusterVolumeSnapshotDao().removeAll(guids); } }</code><technical_language>in a separate transaction</technical_language>

Target:
public void executeCommand() { if (georepSessions != null) { for (GlusterGeoRepSession session : georepSessions) { GlusterVolumeEntity slaveVolume = getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); if (slaveVolume == null) { continue; } VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); if (slaveUpServer == null) { handleVdsError(AuditLogType.GLUSTER_VOLUME_ALL_SNAPSHOTS_DELETE_FAILED, VdcBllErrors.NoUpServerFoundInRemoteCluster.name()); setSucceeded(false); return; } List<GlusterVolumeSnapshotEntity> slaveVolumeSnapshots = getGlusterVolumeSnapshotDao().getAllByVolumeId(slaveVolume.getId()); if (!deleteAllGlusterVolumeSnapshots(slaveUpServer.getId(), slaveVolume.getId(), slaveVolumeSnapshots)) { return; } } } deleteAllGlusterVolumeSnapshots(getUpServer().getId(), getGlusterVolumeId(), snapshots); }
Source:
<code>public void registerMediaButtonEventReceiver(ComponentName componentName) { <START> audioManager.registerMediaButtonEventReceiver(componentName); <END> }</code><technical_language>add a check disable this (and log error) Oreo, if this removed in future</technical_language>

Target:
public void registerMediaButtonEventReceiver(ComponentName componentName) { if (android.os.Build.VERSION.SDK_INT > 27) { Log.e(TAG, "registerMediaButtonEventReceiver has been deprecated and maybe not supported anymore."); return; } audioManager.registerMediaButtonEventReceiver(componentName); }
Source:
<code>private void updateActionAvailability() { boolean isInherited = false; Permission p = getSelectedItem(); if (p != null && getEntity() != null) { isInherited = !p.getAdElementId().equals(getEntity().getId()); String everyoneSearchType = AdElementListModel.AdSearchType.EVERYONE.toString(); <START> if (getEntity().getFirstName().toUpperCase().equals(everyoneSearchType) <END> && p.getOwnerName().toUpperCase().equals(everyoneSearchType)) { getRemoveCommand().setIsExecutionAllowed(false); } else { getRemoveCommand().setIsExecutionAllowed(!isInherited && (getSelectedItem() != null || (getSelectedItems() != null && getSelectedItems().size() > 0))); } } getAddCommand().setIsAvailable(false); }</code><technical_language>try if (p != null && ApplicationGuids.everyone.asGuid().equals(p.getAdElementId())) { do trick</technical_language>

Target:
private void updateActionAvailability() { Permission p = getSelectedItem(); if (p != null && ApplicationGuids.everyone.asGuid().equals(p.getAdElementId())) { getRemoveCommand().setIsExecutionAllowed(false); } else { boolean isInherited = p != null && getEntity() != null && !p.getAdElementId().equals(getEntity().getId()); getRemoveCommand().setIsExecutionAllowed(!isInherited && (getSelectedItem() != null || (getSelectedItems() != null && getSelectedItems().size() > 0))); } getAddCommand().setIsAvailable(false); }
Source:
<code>private StoreResult parseToStoreResult(@Nonnull final IMAPResponse[] ir, @Nonnull final FetchItem[] extensionItems) throws ImapAsyncClientException, ProtocolException { if (ir.length < 1) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final Response taggedResponse = ir[ir.length - 1]; if (taggedResponse.isBAD()) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final List<IMAPResponse> imapResponses = new ArrayList<>(ir.length); MessageNumberSet[] modifiedMsgsets = null; Long highestModSeq = null; for (final IMAPResponse sr: ir) { imapResponses.add(parseToFetchResponse(sr, extensionItems)); sr.skipSpaces(); if (sr.readByte() == (byte) L_BRACKET) { final String responseCode = sr.readAtom(); if (sr.isOK() && responseCode.equalsIgnoreCase("HIGHESTMODSEQ")) { highestModSeq = sr.readLong(); } else if (responseCode.equalsIgnoreCase("MODIFIED")) { modifiedMsgsets = MessageNumberSet.buildMessageNumberSets(sr.readAtom()); } } } <START> return new StoreResult(highestModSeq, imapResponses, modifiedMsgsets); <END> }</code><technical_language>above. Calling constructors potential null values, annotated @Nonnull</technical_language>

Target:
private StoreResult parseToStoreResult(@Nonnull final IMAPResponse[] ir, @Nonnull final FetchItem[] extensionItems) throws ImapAsyncClientException, ProtocolException { if (ir.length < 1) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final Response taggedResponse = ir[ir.length - 1]; if (taggedResponse.isBAD()) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final List<FetchResponse> fetchResponses = new ArrayList<>(); MessageNumberSet[] modifiedMsgsets = null; Long highestModSeq = null; for (final IMAPResponse sr: ir) { sr.skipSpaces(); if (sr.keyEquals("FETCH")) { fetchResponses.add(parseToFetchResponse(sr, extensionItems)); } else if (sr.readByte() == (byte) L_BRACKET) { final String responseCode = sr.readAtom(); if (sr.isOK() && responseCode.equalsIgnoreCase("HIGHESTMODSEQ")) { highestModSeq = sr.readLong(); } else if (responseCode.equalsIgnoreCase("MODIFIED")) { modifiedMsgsets = MessageNumberSet.buildMessageNumberSets(sr.readAtom()); } } } return new StoreResult(highestModSeq, fetchResponses, modifiedMsgsets); }
Source:
<code>public ChamberSentry(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT,CardType.CREATURE}, "{X}"); this.subtype.add(SubType.CONSTRUCT); this.power = new MageInt(0); this.toughness = new MageInt(0); <START> this.addAbility(new SunburstAbility(this)); <END> Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{W}{U}{B}{R}{G}"))); }</code><technical_language>This needs sunburst text, check out Skyrider Elf</technical_language>

Target:
public ChamberSentry(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT,CardType.CREATURE}, "{X}"); this.subtype.add(SubType.CONSTRUCT); this.power = new MageInt(0); this.toughness = new MageInt(0); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true))); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); ability.addCost(new ChamberSentryRemoveVariableCountersSourceCost(CounterType.P1P1.createInstance())); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{W}{U}{B}{R}{G}"))); }
Source:
<code>public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; if (doc.getXObject(Group.CLASS_REFERENCE) == null) { return; } DocumentReference docReference = doc.getDocumentReference(); if ("PhenoTipsGroupTemplate".equals(docReference.getName())) { return; } XWikiContext context = (XWikiContext) data; DocumentReference adminsReference = new DocumentReference(docReference.getName() + " Administrators", docReference.getLastSpaceReference()); XWiki xwiki = context.getWiki(); try { XWikiDocument adminsDoc = xwiki.getDocument(adminsReference, context); setMembers(this.dab.getCurrentUserReference(), adminsDoc, context); setRights(adminsReference, adminsDoc, context); <START> adminsDoc.setParent(docReference.toString()); <END> xwiki.saveDocument(adminsDoc, "Automatically created administrative group", true, context); setMembers(adminsReference, doc, context); setRights(adminsReference, doc, context); } catch (XWikiException ex) { this.logger.error("Failed to set up the new group [{}]: {}", docReference, ex.getMessage(), ex); } }</code><technical_language>setParentReference</technical_language>

Target:
public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; if (doc.getXObject(Group.CLASS_REFERENCE) == null) { return; } DocumentReference docReference = doc.getDocumentReference(); if ("PhenoTipsGroupTemplate".equals(docReference.getName())) { return; } XWikiContext context = (XWikiContext) data; DocumentReference adminsReference = new DocumentReference(docReference.getName() + " Administrators", docReference.getLastSpaceReference()); XWiki xwiki = context.getWiki(); try { XWikiDocument adminsDoc = xwiki.getDocument(adminsReference, context); setMembers(this.dab.getCurrentUserReference(), adminsDoc, context); setRights(adminsReference, adminsDoc, context); adminsDoc.setParentReference(new EntityReference(docReference)); xwiki.saveDocument(adminsDoc, "Automatically created administrative group", true, context); setMembers(adminsReference, doc, context); setRights(adminsReference, doc, context); } catch (XWikiException ex) { this.logger.error("Failed to set up the new group [{}]: {}", docReference, ex.getMessage(), ex); } }
Source:
<code>public MemcacheClientBuilder<V> withRequestBatchSize(final int batchSize) { <START> this.batchSize = batchSize; <END> return this; }</code><technical_language>sanity check (must >= 1 least)</technical_language>

Target:
public MemcacheClientBuilder<V> withRequestBatchSize(final int batchSize) { checkArgument(batchSize > 0, "batch size must be > 0"); this.batchSize = batchSize; return this; }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimestampSpec that = (TimestampSpec) o; <START> return Objects.equal(this.timestampColumn, that.timestampColumn) && <END> Objects.equal(this.timestampFormat, that.timestampFormat) && Objects.equal(this.timeZone, that.timeZone) && Objects.equal(this.missingValue, that.missingValue); }</code><technical_language>reason changing generate hashcodes standard intellij auto-generated one</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimestampSpec that = (TimestampSpec) o; if (!timestampColumn.equals(that.timestampColumn)) { return false; } if (!timestampFormat.equals(that.timestampFormat)) { return false; } if (missingValue != null ? !missingValue.equals(that.missingValue) : that.missingValue != null) { return false; } return timeZone != null ? timeZone.equals(that.timeZone) : that.timeZone == null; }