auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( !mapping.getTargetName().equals( "." ) && targetReference.isValid() ) { if ( !handledTargets.contains( first( targetReference.getPropertyEntries() ).getFullName() ) ) { <START> if ( handleDefinedMapping( mapping, handledTargets ) ) { <END> errorOccurred = true; } } } else if ( mapping.getTargetName().equals( "." ) && !mapping.getSourceName().isEmpty() ) { applySourcePropertiesToCurrentTarget( mapping ); } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); unprocessedSourceProperties.remove( handledTarget ); } return errorOccurred; }</code><technical_language>handle "." in handleDefinedMapping method</technical_language>

Target:
private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( !mapping.getTargetName().equals( "." ) && targetReference.isValid() ) { String target = first( targetReference.getPropertyEntries() ).getFullName(); if ( !handledTargets.contains( target ) ) { if ( handleDefinedMapping( mapping, handledTargets ) ) { errorOccurred = true; } } if ( mapping.getSourceReference() != null && mapping.getSourceReference().isValid() ) { List<PropertyEntry> sourceEntries = mapping.getSourceReference().getPropertyEntries(); if ( !sourceEntries.isEmpty() ) { String source = first( sourceEntries ).getFullName(); unprocessedSourceProperties.remove( source ); } } } else if ( mapping.getTargetName().equals( "." ) && !mapping.getSourceName().isEmpty() ) { applySourcePropertiesToCurrentTarget( mapping ); } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); } return errorOccurred; }
Source:
<code>protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception { Chunk<O> outputs = new Chunk<>(); for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) { final I item = iterator.next(); O output; <START> Timer.Sample sample = Timer.start(Metrics.globalRegistry); <END> String status = STATUS_SUCCESS; try { output = doProcess(item); } catch (Exception e) { inputs.clear(); status = STATUS_FAILURE; throw e; } finally { stopTimer(sample, contribution.getStepExecution(), "item.process", status, "Item processing"); } if (output != null) { outputs.add(output); } else { iterator.remove(); } } return outputs; }</code><technical_language>I suppose want monitor. right/wrong answer here</technical_language>

Target:
protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception { Chunk<O> outputs = new Chunk<>(); for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) { final I item = iterator.next(); O output; Timer.Sample sample = BatchMetrics.createTimerSample(); String status = BatchMetrics.STATUS_SUCCESS; try { output = doProcess(item); } catch (Exception e) { inputs.clear(); status = BatchMetrics.STATUS_FAILURE; throw e; } finally { stopTimer(sample, contribution.getStepExecution(), "item.process", status, "Item processing"); } if (output != null) { outputs.add(output); } else { iterator.remove(); } } return outputs; }
Source:
<code>protected final IStatus run(IProgressMonitor monitor) { IStatus status = performJob(monitor); if <START> (status == null || <END> !status.isOK()) { return status; } Action action = getAction(); if (action != null) { if (isModal()) { showResult(action); } else { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, action); return new Status(IStatus.OK, Activator.getPluginId(), IStatus.OK, action.getText(), null); } } return status; }</code><technical_language>return of run() null. This Status.CANCEl something, null</technical_language>

Target:
protected final IStatus run(IProgressMonitor monitor) { IStatus status = performJob(monitor); if (status == null) { return Activator .createErrorStatus( MessageFormat.format( UIText.RepositoryJob_NullStatus, getName()), new NullPointerException()); } else if (!status.isOK()) { return status; } Action action = getAction(); if (action != null) { if (isModal()) { showResult(action); } else { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, action); return new Status(IStatus.OK, Activator.getPluginId(), IStatus.OK, action.getText(), null); } } return status; }
Source:
<code><START> @Override public void prefill() <END> { if (this.credential.equals(pool.getPrefillCredential())) { PoolFiller.fillPool(new FillRequest(this, pool.getConfiguration().getInitialSize())); } }</code><technical_language>'@Override' misplaced</technical_language>

Target:
public void prefill() { if (this.credential.equals(pool.getPrefillCredential()) && pool.getConfiguration().isPrefill() && pool.getConfiguration().getMinSize() > 0) { PoolFiller.fillPool(new FillRequest(this, pool.getConfiguration().getMinSize())); } }
Source:
<code>public void testVendorOptionClipRaster() throws Exception { URL exptectedResponse = this.getClass().getResource("../wms_clip_raster.png"); BufferedImage expectedImage = ImageIO.read(exptectedResponse); <START> String rasterMask = <END> "POLYGON((-14.50804652396198 55.579454354599356,34.53492222603802 55.579454354599356,34.53492222603802 32.400173313532584,-14.50804652396198 32.400173313532584,-14.50804652396198 55.579454354599356))"; String worldBbox130 = "4.769752,-53.384768,57.719733,80.121092"; BufferedImage response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); String rasterMask900913 = "srid=900913;POLYGON ((-1615028.3514525702 7475148.401208023, 3844409.956787858 7475148.401208023, 3844409.956787858 3815954.983140064, -1615028.3514525702 3815954.983140064, -1615028.3514525702 7475148.401208023))"; response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask900913, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); }</code><technical_language>a rectangular mask here? prove a rectangular clip, works fine other shapes well</technical_language>

Target:
public void testVendorOptionClipRaster() throws Exception { URL exptectedResponse = this.getClass().getResource("../wms_clip_raster.png"); BufferedImage expectedImage = ImageIO.read(exptectedResponse); String rasterMask = "POLYGON((-0.4455465239619838 49.03915485780325,27.679453476038034 48.692256255310134,34.53492222603802 32.400173313532584,5.355234726038036 37.161881019039605,-0.4455465239619838 49.03915485780325))"; String worldBbox130 = "4.769752,-53.384768,57.719733,80.121092"; BufferedImage response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); String rasterMask900913 = "srid=900913;POLYGON ((-49598.01217216109 6281507.767506711, 3081262.66638866 6222804.1297836965, 3844409.956787858 3815954.983140064, 596142.0027810101 4461694.998093233, -49598.01217216109 6281507.767506711))"; response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask900913, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); }
Source:
<code>public void modify(Object element, String property, Object value) { <START> System.out.println(element + <END> " - " + property + " - " + value); String data = (String) ((TableItem) element).getData(); if (property == KEY) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { String currentVal = model.getEnvironment().get(data); model.getEnvironment().remove(data); model.getEnvironment().put((String) value, currentVal); } } else if (property == VALUE) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { model.getEnvironment().put(data, (String) value); } } tv.refresh(); }</code><technical_language>This println statement removed</technical_language>

Target:
public void modify(Object element, String property, Object value) { String data = (String) ((TableItem) element).getData(); if (property == KEY) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { String currentVal = model.getEnvironment().get(data); model.getEnvironment().remove(data); model.getEnvironment().put((String) value, currentVal); } } else if (property == VALUE) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { model.getEnvironment().put(data, (String) value); } } tv.refresh(); }
Source:
<code>public static void createJob( String projectId, String tenantId, String companyId, String requisitionId) throws IOException { try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantOrProjectName parent = TenantName.of(projectId, tenantId); <START> ArrayList<String> customJobAttributes = new ArrayList<>(Arrays.asList("Internship", "Apprenticeship")); CustomAttribute customAttribute = CustomAttribute.newBuilder() .addAllStringValues(customJobAttributes) .setFilterable(true) .build(); <END> Job job = Job.newBuilder() .setCompany(companyId) .setTitle("Software Developer I") .setDescription("This is a description of this <i>wonderful</i> job!") .putCustomAttributes("FOR_STUDENTS", customAttribute) .setRequisitionId(requisitionId) .setLanguageCode("en-US") .build(); CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent.toString()).setJob(job).build(); Job response = jobServiceClient.createJob(request); System.out.printf("Created job: %s\n", response.getName()); } }</code><technical_language>suggestion CustomAttribute customAttribute = CustomAttribute.newBuilder() .addStringValues("Internship") .addStringValues("Apprenticeship") .setFilterable(true) .build();</technical_language>

Target:
public static void createJob( String projectId, String tenantId, String companyId, String requisitionId) throws IOException { try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantOrProjectName parent = TenantName.of(projectId, tenantId); CustomAttribute customAttribute = CustomAttribute.newBuilder() .addStringValues("Internship") .addStringValues("Apprenticeship") .setFilterable(true) .build(); Job job = Job.newBuilder() .setCompany(companyId) .setTitle("Software Developer I") .setDescription("This is a description of this <i>wonderful</i> job!") .putCustomAttributes("FOR_STUDENTS", customAttribute) .setRequisitionId(requisitionId) .setLanguageCode("en-US") .build(); CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent.toString()).setJob(job).build(); Job response = jobServiceClient.createJob(request); System.out.printf("Created job: %s\n", response.getName()); } }
Source:
<code>public void verifyConnectionTimeoutSettingWorks() throws IOException { String testPathPrefix = IntegrationTestConfigContext.generateBasePath( config, this.getClass().getSimpleName()); Instant start = null; Instant stop; try (MantaClient client = new MantaClient(config)) { start = Instant.now(); client.head(testPathPrefix); } catch(InterruptedIOException e){ Assert.assertEquals(e.getClass().getSimpleName(), "ConnectTimeoutException"); <START> ExceptionUtils.getStackTrace(e); <END> } finally { stop = Instant.now(); } Duration totalTime = Duration.between(start, stop); if (totalTime.getSeconds() != 1) { String msg = String.format("Expected total connection time duration " + "to be 1 second. Actually [%d] ms", totalTime.toMillis()); Assert.fail(msg); } }</code><technical_language>This line sense. expect this do why</technical_language>

Target:
public void verifyConnectionTimeoutSettingWorks() throws IOException { String testPathPrefix = IntegrationTestConfigContext.generateBasePath( config, this.getClass().getSimpleName()); Instant start = null; Instant stop; try (MantaClient client = new MantaClient(config)) { start = Instant.now(); client.head(testPathPrefix); } catch (InterruptedIOException e) { Assert.assertEquals(e.getClass().getSimpleName(), "ConnectTimeoutException", "Expected exception ConnectTimeoutException was not thrown. Actual Exception:\n" + ExceptionUtils.getStackTrace(e)); } finally { stop = Instant.now(); } Duration totalTime = Duration.between(start, stop); if (totalTime.getSeconds() != 1) { String msg = String.format("Expected total connection time duration " + "to be 1 second. Actually [%d] ms", totalTime.toMillis()); Assert.fail(msg); } }
Source:
<code>public HpccRemoteFileReader(DataPartition dp, FieldDef originalRD, IRecordBuilder recBuilder, int connectTimeout) throws Exception { <START> this(dp,originalRD,recBuilder,connectTimeout,-1); <END> }</code><technical_language>create a Symbol signify limit, change actual scenes if need</technical_language>

Target:
public HpccRemoteFileReader(DataPartition dp, FieldDef originalRD, IRecordBuilder recBuilder, int connectTimeout) throws Exception { this(dp,originalRD,recBuilder,connectTimeout,NO_RECORD_LIMIT); }
Source:
<code>public static GroupList parse(String text, ValidationError.Sink errors) throws IOException { Map<AccountGroup.UUID, GroupReference> groupsByUUID = new HashMap<>(); <START> Map<String, GroupReference> groupsByName = new HashMap<>(); <END> BufferedReader br = new BufferedReader(new StringReader(text)); String s; for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) { if (s.isEmpty() || s.startsWith("#")) { continue; } int tab = s.indexOf('\t'); if (tab < 0) { errors.error(new ValidationError(FILE_NAME, lineNumber, "missing tab delimiter")); continue; } AccountGroup.UUID uuid = new AccountGroup.UUID(s.substring(0, tab).trim()); String name = s.substring(tab + 1).trim(); GroupReference ref = new GroupReference(uuid, name); groupsByUUID.put(uuid, ref); groupsByName.put(name, ref); } return new GroupList(groupsByUUID); }</code><technical_language>This is anymore removed</technical_language>

Target:
public static GroupList parse(String text, ValidationError.Sink errors) throws IOException { Map<AccountGroup.UUID, GroupReference> groupsByUUID = new HashMap<>(); BufferedReader br = new BufferedReader(new StringReader(text)); String s; for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) { if (s.isEmpty() || s.startsWith("#")) { continue; } int tab = s.indexOf('\t'); if (tab < 0) { errors.error(new ValidationError(FILE_NAME, lineNumber, "missing tab delimiter")); continue; } AccountGroup.UUID uuid = new AccountGroup.UUID(s.substring(0, tab).trim()); String name = s.substring(tab + 1).trim(); GroupReference ref = new GroupReference(uuid, name); groupsByUUID.put(uuid, ref); } return new GroupList(groupsByUUID); }
Source:
<code>public static OverlapDetector<Interval> makeOverlapDetector(final File samFile, final SAMFileHeader header, final File ribosomalIntervalsFile) { OverlapDetector<Interval> ribosomalSequenceOverlapDetector = new OverlapDetector<Interval>(0, 0); if (ribosomalIntervalsFile != null) { final IntervalList ribosomalIntervals = IntervalList.fromFile(ribosomalIntervalsFile); try { SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), ribosomalIntervals.getHeader().getSequenceDictionary()); } catch (SequenceUtil.SequenceListsDifferException e) { throw new PicardException("Sequence dictionaries differ in " + samFile.getAbsolutePath() + " and " + ribosomalIntervalsFile.getAbsolutePath(), e); } <START> ribosomalIntervals.uniqued().getIntervals(); <END> final List<Interval> intervals = ribosomalIntervals.getIntervals(); ribosomalSequenceOverlapDetector.addAll(intervals, intervals); } return ribosomalSequenceOverlapDetector; }</code><technical_language>this is calling .getIntervals(), output assigned (as I is next calling getIntervals() again)</technical_language>

Target:
public static OverlapDetector<Interval> makeOverlapDetector(final File samFile, final SAMFileHeader header, final File ribosomalIntervalsFile) { OverlapDetector<Interval> ribosomalSequenceOverlapDetector = new OverlapDetector<Interval>(0, 0); if (ribosomalIntervalsFile != null) { final IntervalList ribosomalIntervals = IntervalList.fromFile(ribosomalIntervalsFile); try { SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), ribosomalIntervals.getHeader().getSequenceDictionary()); } catch (SequenceUtil.SequenceListsDifferException e) { throw new PicardException("Sequence dictionaries differ in " + samFile.getAbsolutePath() + " and " + ribosomalIntervalsFile.getAbsolutePath(), e); } final IntervalList uniquedRibosomalIntervals = ribosomalIntervals.uniqued(); final List<Interval> intervals = uniquedRibosomalIntervals.getIntervals(); ribosomalSequenceOverlapDetector.addAll(intervals, intervals); } return ribosomalSequenceOverlapDetector; }
Source:
<code>private void checkForCrashHandlerPermission() { boolean shouldPrompt = session_.getSessionInfo().getPromptForCrashHandlerPermission(); if (shouldPrompt) { String message = <START> "Would you like to enable automated crash reporting?\n\nIf RStudio crashes unexpectedly, the " + <END> "stack trace of the crash will be collected and sent to RStudio for analysis and troubleshooting " + "purposes. No personal data is ever collected other than your IP address which will be used " + "to determine the total number of users experiencing a particular crash.\n\nCrash reporting can be " + "disabled at any time under the Global Options."; globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Enable Automated Crash Reporting", message, false, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(true, new SimpleRequestCallback<Void>()); } }, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(false, new SimpleRequestCallback<Void>()); } }, true); } }</code><technical_language>Suggest this a simpler: *May upload crash reports RStudio automatically? Crash reports include personal information (except IP addresses for accounting) turned time.* do think</technical_language>

Target:
private void checkForCrashHandlerPermission() { boolean shouldPrompt = session_.getSessionInfo().getPromptForCrashHandlerPermission(); if (shouldPrompt) { String message = "May we upload crash reports to RStudio automatically?\n\nCrash reports don't include " + "any personal information, except for IP addresses which are used to determine how many users " + "are affected by each crash.\n\nCrash reporting can be disabled at any time under the Global Options."; globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Enable Automated Crash Reporting", message, false, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(true, new SimpleRequestCallback<Void>()); } }, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(false, new SimpleRequestCallback<Void>()); } }, true); } }
Source:
<code>protected EntityRecord newStorageRecord(StgProjectId id) { <START> return EntityRecordStorageTestEnv.newStorageRecord(id, newState(id)); <END> }</code><technical_language>static-import this call, please</technical_language>

Target:
protected EntityRecord newStorageRecord(StgProjectId id) { return newRecord(id, newState(id)); }
Source:
<code><START> public void apply(String endpointId, GitChangeEventDto dto) { <END> Tree tree = projectExplorerPresenterProvider.get().getTree(); tree.getNodeStorage() .getAll() .stream() .filter(node -> node instanceof FileNode && ((ResourceNode)node).getData() .getLocation() .equals(Path.valueOf(dto.getPath()))) .forEach(node -> { ((ResourceNode)node).getData().asFile().setVcsStatus(VcsStatus.from(dto.getType().toString())); tree.refresh(node); }); editorAgentProvider.get() .getOpenedEditors() .stream() .filter(editor -> editor.getEditorInput().getFile().getLocation().equals(Path.valueOf(dto.getPath()))) .forEach(editor -> { VcsStatus vcsStatus = VcsStatus.from(dto.getType().toString()); EditorTab tab = multiPartStackProvider.get().getTabByPart(editor); if (vcsStatus != null) { tab.setTitleColor(vcsStatus.getColor()); } }); }</code><technical_language>Do sense decouple jsonrpc transport _GIT VCS status -> VCS status_ adaptation</technical_language>

Target:
public void apply(String endpointId, GitChangeEventDto dto) { Tree tree = projectExplorerPresenterProvider.get().getTree(); tree.getNodeStorage() .getAll() .stream() .filter(node -> node instanceof FileNode && ((ResourceNode)node).getData() .getLocation() .equals(Path.valueOf(dto.getPath()))) .forEach(node -> { ((ResourceNode)node).getData().asFile().setVcsStatus(VcsStatus.from(dto.getType().toString())); tree.refresh(node); }); editorAgentProvider.get() .getOpenedEditors() .stream() .filter(editor -> editor.getEditorInput().getFile().getLocation().equals(Path.valueOf(dto.getPath()))) .forEach(editor -> { VcsStatus vcsStatus = VcsStatus.from(dto.getType().toString()); EditorTab tab = multiPartStackProvider.get().getTabByPart(editor); if (vcsStatus != null) { tab.setTitleColor(vcsStatus.getColor()); } }); appContext.getWorkspaceRoot().synchronize(); }
Source:
<code>public static void main(String[] args) { double currentHeading = 0; System.out.println("Starting Path Editor"); try { ArrayList<GpsMeasurement> wayPoints = WayPointUtil.createWayPointsFromLog("logs/", RobobuggyConfigFile.WAYPOINT_SOURCE_LOG_FILE); Gui.getInstance(); for(int i = 0;i<wayPoints.size();i++){ Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.BLUE,new LocTuple(wayPoints.get(i).getLatitude(), -wayPoints.get(i).getLongitude())); Gui.getInstance().fixPaint(); } WayPointFollowerPlanner planer = new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,wayPoints); for(int i = 0;i<wayPoints.size();i++){ <START> final double latErrorFinal = 2/111131.745; <END> final double lonErrorFinal = 2/78846.81; for(double latError = -latErrorFinal;latError<=latErrorFinal;latError+=5*latErrorFinal){ for(double lonError = -lonErrorFinal;lonError<=lonErrorFinal;lonError+=5*lonErrorFinal){ double lat = wayPoints.get(i).getLatitude() + latError; double lon = wayPoints.get(i).getLongitude() + lonError; planer.updatePositionEstimate(new GPSPoseMessage(new Date(), lat, lon, currentHeading)); double angle = Math.PI*planer.getCommandedSteeringAngle()/180; Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.RED,new LocTuple(lat,-lon)); Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addLineToMap(new LocTuple(lat, -lon), angle, Color.RED); } } } } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>Whoa whoa whoa magic, ya know. so</technical_language>

Target:
public static void main(String[] args) { double currentHeading = 0; final double latErrorFinal = 2/111131.745; final double lonErrorFinal = 2/78846.81; System.out.println("Starting Path Editor"); try { ArrayList<GpsMeasurement> wayPoints = WayPointUtil.createWayPointsFromLog("logs/", RobobuggyConfigFile.WAYPOINT_SOURCE_LOG_FILE); Gui.getInstance(); for(int i = 0;i<wayPoints.size();i++){ Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.BLUE,new LocTuple(wayPoints.get(i).getLatitude(), -wayPoints.get(i).getLongitude())); Gui.getInstance().fixPaint(); } WayPointFollowerPlanner planer = new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,wayPoints); for(int i = 0;i<wayPoints.size();i++){ for(double latError = -latErrorFinal;latError<=latErrorFinal;latError+=5*latErrorFinal){ for(double lonError = -lonErrorFinal;lonError<=lonErrorFinal;lonError+=5*lonErrorFinal){ double lat = wayPoints.get(i).getLatitude() + latError; double lon = wayPoints.get(i).getLongitude() + lonError; planer.updatePositionEstimate(new GPSPoseMessage(new Date(), lat, lon, currentHeading)); double angle = Math.PI*planer.getCommandedSteeringAngle()/180; Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.RED,new LocTuple(lat,-lon)); Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addLineToMap(new LocTuple(lat, -lon), angle, Color.RED); } } } } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>protected void onStop() { Log.d(TAG, "Stopping activity"); unbindService(focusConnection); <START> manager.cleanupMenus(); <END> super.onStop(); }</code><technical_language>need do this in onStop onResume? onPause onStop</technical_language>

Target:
protected void onStop() { Log.d(TAG, "Stopping activity"); unbindService(focusConnection); super.onStop(); }
Source:
<code>protected static void logStart(final Logger logger, final DlmsDeviceMessageMetadata messageMetadata, final String methodName) { <START> logger.info(methodName + " called for device: for organisation: {}", <END> messageMetadata.getDeviceIdentification(), messageMetadata.getOrganisationIdentification()); }</code><technical_language>Please string concatenation (the 'methodName' variable)</technical_language>

Target:
protected void logStart(final Logger logger, final DlmsDeviceMessageMetadata messageMetadata, final String methodName) { logger.info("{} called for device: for organisation: {}", methodName, messageMetadata.getDeviceIdentification(), messageMetadata.getOrganisationIdentification()); }
Source:
<code>public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} UpdatePartitionTableColumnStat message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tableObj = eventMessage.getTableObject(); if (tableObj == null) { LOG.debug("Event#{} was an event of type with no table listed", fromEventId(), event.getEventType()); return; } if (!Utils.shouldReplicate(withinContext.replicationSpec, new Table(tableObj), withinContext.hiveConf)) { return; } <START> if (withinContext.replicationSpec.isMetadataOnly()) { <END> return; } if (AcidUtils.isTransactionalTable(tableObj)) { return; } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }</code><technical_language>Metadata-only checked earlier avoid heavier operations Utils.shouldReplicate()</technical_language>

Target:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} UpdatePartitionTableColumnStat message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tableObj = eventMessage.getTableObject(); if (tableObj == null) { LOG.debug("Event#{} was an event of type with no table listed", fromEventId(), event.getEventType()); return; } if (withinContext.replicationSpec.isMetadataOnly()) { return; } if (AcidUtils.isTransactionalTable(tableObj)) { return; } if (!Utils.shouldReplicate(withinContext.replicationSpec, new Table(tableObj), withinContext.hiveConf)) { return; } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }
Source:
<code>private static boolean hasMethodAnnotation(Method method) { final Optional<Annotation> eventHandler = ReflectTools <START> .getAnnotation(method, <END> "com.vaadin.flow.component.polymertemplate.EventHandler"); return eventHandler.isPresent() || method .isAnnotationPresent(ClientCallable.class); }</code><technical_language>is a method hasAnnotation , need getAnnotation</technical_language>

Target:
private static boolean hasMethodAnnotation(Method method) { final boolean hasEventHandler = ReflectTools.hasAnnotation(method, "com.vaadin.flow.component.polymertemplate.EventHandler"); return hasEventHandler || method .isAnnotationPresent(ClientCallable.class); }
Source:
<code>public CacheType unparseServiceConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { Collection<DefaultCacheEventListenerConfiguration> serviceConfigs = findAmongst(DefaultCacheEventListenerConfiguration.class, cacheConfiguration.getServiceConfigurations()); if (!serviceConfigs.isEmpty()) { ListenersType listenersType = cacheType.getListeners(); if (listenersType == null) { listenersType = new ListenersType(); cacheType.setListeners(listenersType); } Set<ListenersType.Listener> listeners = serviceConfigs.stream().map(serviceConfig -> { ListenersType.Listener listener = new ListenersType.Listener(); <START> if (serviceConfig.getInstance() != null) { <END> throw new XmlConfigurationException("XML translation when instance is provided is not supported"); } return listener.withClazz(serviceConfig.getClazz().getName()) .withEventFiringMode(EventFiringType.fromValue(serviceConfig.firingMode().name())) .withEventOrderingMode(EventOrderingType.fromValue(serviceConfig.orderingMode().name())) .withEventsToFireOn(serviceConfig.fireOn() .stream() .map(eventType -> EventType.fromValue(eventType.name())) .collect(toSet())); }).collect(toSet()); cacheType.withListeners(listenersType.withListener(listeners)); } return cacheType; }</code><technical_language>This logic is repeated in multiple classes extends SimpleCoreServiceConfigurationParser. moved SimpleCoreServiceConfigurationParser.unparseServiceConfiguration</technical_language>

Target:
public CacheType unparseServiceConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { Collection<DefaultCacheEventListenerConfiguration> serviceConfigs = findAmongst(DefaultCacheEventListenerConfiguration.class, cacheConfiguration.getServiceConfigurations()); if (!serviceConfigs.isEmpty()) { ListenersType listenersType = cacheType.getListeners(); if (listenersType == null) { listenersType = new ListenersType(); cacheType.setListeners(listenersType); } Set<ListenersType.Listener> listeners = serviceConfigs.stream().map(serviceConfig -> { ListenersType.Listener listener = new ListenersType.Listener(); checkNoConcreteInstance(serviceConfig); return listener.withClazz(serviceConfig.getClazz().getName()) .withEventFiringMode(EventFiringType.fromValue(serviceConfig.firingMode().name())) .withEventOrderingMode(EventOrderingType.fromValue(serviceConfig.orderingMode().name())) .withEventsToFireOn(serviceConfig.fireOn() .stream() .map(eventType -> EventType.fromValue(eventType.name())) .collect(toSet())); }).collect(toSet()); cacheType.withListeners(listenersType.withListener(listeners)); } return cacheType; }
Source:
<code>private List<VM> getMigrableVmsRunningOnVds(final Guid hostId, Map<Guid, List<VM>> hostId2HaVmMapping) { List<VM> vms = hostId2HaVmMapping.get(hostId); vms = LinqUtils.filter(vms, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport() == MigrationSupport.MIGRATABLE <START> && !hostId.equals(v.getDedicatedVmForVds()); <END> } }); return vms; }</code><technical_language>Migratable is enough</technical_language>

Target:
private List<VM> getMigrableVmsRunningOnVds(final Guid hostId, Map<Guid, List<VM>> hostId2HaVmMapping) { List<VM> vms = hostId2HaVmMapping.get(hostId); vms = LinqUtils.filter(vms, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport() == MigrationSupport.MIGRATABLE; } }); return vms; }
Source:
<code>public EhCacheCacheManager(net.sf.ehcache.CacheManager cacheManager) { <START> this(false, cacheManager); <END> }</code><technical_language>While I denying setter is confusing, this is scope of this PR change that</technical_language>

Target:
public EhCacheCacheManager(net.sf.ehcache.CacheManager cacheManager) { this.cacheManager = cacheManager; }
Source:
<code>protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { try { return FILE_UTILS.getFileURL(resource); } catch (MalformedURLException ex) { return null; } } } else { <START> return (URL) storeAndConvert(jarFile, file, resourceName, (jar, entry) -> { <END> try { return new URL("jar:" + FILE_UTILS.getFileURL(file) + "!/" + entry); } catch (MalformedURLException ex) { return null; } }); } } catch (Exception e) { String msg = "Unable to obtain resource from " + file + ": "; log(msg + e, Project.MSG_WARN); System.err.println(msg); e.printStackTrace(); } return null; }</code><technical_language>suggestion return storeAndConvert<URL>(jarFile, file, resourceName, (jar, entry) -> {</technical_language>

Target:
protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { try { return FILE_UTILS.getFileURL(resource); } catch (MalformedURLException ex) { return null; } } } else { return storeAndConvert(jarFile, file, resourceName, (jar, entry) -> { try { return new URL("jar:" + FILE_UTILS.getFileURL(file) + "!/" + entry); } catch (MalformedURLException ex) { return null; } }); } } catch (Exception e) { String msg = "Unable to obtain resource from " + file + ": "; log(msg + e, Project.MSG_WARN); System.err.println(msg); e.printStackTrace(); } return null; }
Source:
<code>public void ArticleActionsAdmin_001_deleteUndelete() { <START> SpecialUserLoginPageObject login = new SpecialUserLoginPageObject(driver); <END> login.loginAndVerifyOnWiki(credentials.userNameStaff, credentials.passwordStaff, wikiURL); ArticlePageObject article = login.openRandomArticleOnWiki(wikiURL); String articleName = article.getArticleName(); DeleteArticlePageObject deletePage = article.deleteArticleUsingDropdown(); WikiBasePageObject base = deletePage.submitDeletion(); SpecialRestorePageObject restore = base.undeleteArticle(); restore.verifyArticleName(articleName); restore.giveReason(article.getTimeStamp()); restore.restorePage(); article.verifyNotificationMessage(); article.compareTitle(articleName); }</code><technical_language>remember change this merge</technical_language>

Target:
public void ArticleActionsAdmin_001_deleteUndelete() { SpecialUserLoginPageObject login = new SpecialUserLoginPageObject(driver); login.loginAndVerifyOnWiki(credentials.userNameStaff, credentials.passwordStaff, wikiURL); ArticlePageObject article = login.openRandomArticle(wikiURL); String articleName = article.getArticleName(); DeleteArticlePageObject deletePage = article.deleteArticleUsingDropdown(); WikiBasePageObject base = deletePage.submitDeletion(); SpecialRestorePageObject restore = base.undeleteArticle(); restore.verifyArticleName(articleName); restore.giveReason(article.getTimeStamp()); restore.restorePage(); article.verifyNotificationMessage(); article.verifyArticleTitle(articleName); }
Source:
<code><START> private List<Integer> getKeys(final Collection<NMFData> dataValues) { <END> final ArrayList<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .distinct() .map(Pair::getFirst) .collect(Collectors.toList())); } keys.ensureCapacity(keySet.size()); keys.addAll(keySet); return keys; }</code><technical_language>Tracking cost for getKeys() necessary. computeTracer.recordTime(0)</technical_language>

Target:
private List<Integer> getKeys(final Collection<NMFData> dataValues) { computeTracer.startTimer(); final ArrayList<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .distinct() .map(Pair::getFirst) .collect(Collectors.toList())); } keys.ensureCapacity(keySet.size()); keys.addAll(keySet); computeTracer.recordTime(0); return keys; }
Source:
<code><START> private void populateReviews(List<ITaskReview> reviewContainers) { <END> for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask task = taskList.getTask(repositoryUrl, reviewId); TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl) .getTaskIdFromTaskUrl(reviewUrl); System.out.println("summary: " + task.getSummary()); reviewContainers.add(new TaskReview(task.getSummary(), task.getAttribute("CODE_REVIEW"), task.getAttribute("VERIFIED"), "")); } }</code><technical_language>code consider refactoring -- talking wrote it: I functions manipulate references this ideal end passing a brand new collection them. ends a step process, consider returning Collection<ITaskReview> Iterable<ITaskReview instead clear is on, guessing. Renaming method needed, too</technical_language>

Target:
private void populateReviews(List<ITaskReview> reviewContainers) { for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask task = taskList.getTask(repositoryUrl, reviewId); TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl) .getTaskIdFromTaskUrl(reviewUrl); if (task.getSynchronizationState().isIncoming()) { task.getSynchronizationState(); } reviewContainers.add(new TaskReview(task.getSummary(), task.getAttribute("CODE_REVIEW"), task.getAttribute("VERIFIED"), "")); } }
Source:
<code>public <S extends ContainerAttributes> S save(S entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getId()); try { if (client.checkExists().forPath(path) != null) { client.delete().forPath(path); } } catch (KeeperException.NoNodeException e) { } catch (Exception e) { <START> throw ZooKeeperUtils.wrapThrowable(e); <END> } try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL) .forPath(path, mapBytesUtility.toByteArray(entity)); return entity; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }</code><technical_language>ZooKeepeerUtils.wrapAndThrowIgnoring(e, NoNodeException.class) in a single catch block. necessary, simplifies this common pattern</technical_language>

Target:
public <S extends ContainerAttributes> S save(S entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getId()); try { if (client.checkExists().forPath(path) != null) { client.delete().forPath(path); } } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, KeeperException.NoNodeException.class); } try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL) .forPath(path, mapBytesUtility.toByteArray(entity)); return entity; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }
Source:
<code>private static boolean isIntegerType(@Nullable GoType type) { if (type == null) return false; GoTypeReferenceExpression ref = type.getTypeReferenceExpression(); if (ref == null) return false; PsiElement resolve = ref.getReference().resolve(); <START> return GoPsiImplUtil.builtin(resolve) && INT_TYPE_NAMES.contains(ref.getText()); <END> }</code><technical_language>sense filter out references name resolving</technical_language>

Target:
private static boolean isIntegerType(@Nullable GoType type) { if (type == null) return false; GoTypeReferenceExpression ref = type.getTypeReferenceExpression(); if (ref == null) return false; return INT_TYPE_NAMES.contains(ref.getText()) && GoPsiImplUtil.builtin(ref.getReference().resolve()); }
Source:
<code><START> public void testTaskAddUnlockedDependency() { <END> Datastream stream = DatastreamTestUtils.createDatastream("dummy", "dummy", "dummy"); stream.getMetadata().put(DatastreamMetadataConstants.TASK_PREFIX, DatastreamTaskImpl.getTaskPrefix(stream)); DatastreamTaskImpl task = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter = mock(ZkAdapter.class); task.setZkAdapter(mockZkAdapter); DatastreamTaskImpl task0 = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter2 = mock(ZkAdapter.class); task0.setZkAdapter(mockZkAdapter2); task.addDependency(task0); }</code><technical_language>Please transform this test AssertThrows well</technical_language>

Target:
public void testTaskAddUnlockedDependency() { Datastream stream = DatastreamTestUtils.createDatastream("dummy", "dummy", "dummy"); stream.getMetadata().put(DatastreamMetadataConstants.TASK_PREFIX, DatastreamTaskImpl.getTaskPrefix(stream)); DatastreamTaskImpl task = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter = mock(ZkAdapter.class); task.setZkAdapter(mockZkAdapter); Assert.assertThrows(DatastreamTransientException.class, () -> task.addDependency(createDependencyTask(stream, false))); }
Source:
<code>public void addProviderDependencies(PersistenceUnitMetadata pu) { <START> JPA_LOGGER.tracef("second level cache not integrated for Hibernate 4.x - %s", pu.getScopedPersistenceUnitName()); <END> }</code><technical_language>this support removed? this a trace message wrong well</technical_language>

Target:
public void addProviderDependencies(PersistenceUnitMetadata pu) { JPA_LOGGER.cannotUseSecondLevelCache(pu.getScopedPersistenceUnitName()); }
Source:
<code>public AbstractArtifactCoordinates(Map<String, String> coordinates) { this.coordinates = coordinates; <START> this.uuid = toPath(); <END> }</code><technical_language>So... purpose of this...</technical_language>

Target:
public AbstractArtifactCoordinates(Map<String, String> coordinates) { this.coordinates = coordinates; this.path = toPath(); }
Source:
<code>public void onResponse(@NonNull Call<ZeroConfig> call, @NonNull Response<ZeroConfig> response) { if (response.isSuccessful()) { if (response.body() == null) { <START> cb.failure(call, new JsonParseException("Response missing required field(s)")); <END> } cb.success(call, response.body()); } else { cb.failure(call, RetrofitException.httpError(response, cachedService.retrofit())); } }</code><technical_language>I return else case success</technical_language>

Target:
public void onResponse(@NonNull Call<ZeroConfig> call, @NonNull Response<ZeroConfig> response) { if (response.isSuccessful()) { if (response.body() == null) { cb.failure(call, new JsonParseException("Response missing required field(s)")); return; } cb.success(call, response.body()); } else { cb.failure(call, RetrofitException.httpError(response, cachedService.retrofit())); } }
Source:
<code>public void FileOpenTest() throws IOException, BadPcapFileException { PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; assumeTrue(trace.exists()); <START> PcapFile file = trace.getTrace(); <END> assertEquals(PcapTestTrace.MOSTLY_TCP.getPath(), file.getPath()); assertEquals(2, file.getMajorVersion()); assertEquals(4, file.getMinorVersion()); assertEquals(1, file.getDataLinkType()); assertEquals(65535, file.getSnapLength()); assertEquals(0, file.getTimeAccuracy()); assertEquals(0, file.getTimeZoneCorrection()); assertEquals(ByteOrder.LITTLE_ENDIAN, file.getByteOrder()); assertEquals(43, file.getTotalNbPackets()); }</code><technical_language>I try</technical_language>

Target:
public void FileOpenTest() throws IOException, BadPcapFileException { PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; assumeTrue(trace.exists()); try (PcapFile file = trace.getTrace();) { assertEquals(PcapTestTrace.MOSTLY_TCP.getPath(), file.getPath()); assertEquals(2, file.getMajorVersion()); assertEquals(4, file.getMinorVersion()); assertEquals(1, file.getDataLinkType()); assertEquals(65535, file.getSnapLength()); assertEquals(0, file.getTimeAccuracy()); assertEquals(0, file.getTimeZoneCorrection()); assertEquals(ByteOrder.LITTLE_ENDIAN, file.getByteOrder()); assertEquals(43, file.getTotalNbPackets()); } }
Source:
<code>public boolean canDelete(List<DocumentModel> docs, NuxeoPrincipal principal, boolean checkProxies) { if (docs.isEmpty()) { return false; } <START> return !getInfo(docs, principal, checkProxies, false).docs.isEmpty(); <END> }</code><technical_language>point of view, more clear easy read variable TrashInfo info = getInfo(docs, principal, checkProxies, false) replace info.docs.size() > 0; !info.docs.isEmpty()</technical_language>

Target:
public boolean canDelete(List<DocumentModel> docs, NuxeoPrincipal principal, boolean checkProxies) { if (docs.isEmpty()) { return false; } TrashInfo info = getInfo(docs, principal, checkProxies, false); return !info.docs.isEmpty(); }
Source:
<code><START> protected CriteriaContext getCriteriaContextForParticipant(Study study, StudyParticipant participant) { <END> RequestInfo info = cacheProvider.getRequestInfo(participant.getId()); ClientInfo clientInfo = (info == null) ? null : info.getClientInfo(); return new CriteriaContext.Builder() .withStudyIdentifier(study.getStudyIdentifier()) .withHealthCode(participant.getHealthCode()) .withUserId(participant.getId()) .withClientInfo(clientInfo) .withUserDataGroups(participant.getDataGroups()) .withUserSubstudyIds(participant.getSubstudyIds()) .withLanguages(participant.getLanguages()).build(); }</code><technical_language>this, tests verifying contains substudies</technical_language>

Target:
private CriteriaContext getCriteriaContextForParticipant(Study study, StudyParticipant participant) { RequestInfo info = cacheProvider.getRequestInfo(participant.getId()); ClientInfo clientInfo = (info == null) ? null : info.getClientInfo(); return new CriteriaContext.Builder() .withStudyIdentifier(study.getStudyIdentifier()) .withHealthCode(participant.getHealthCode()) .withUserId(participant.getId()) .withClientInfo(clientInfo) .withUserDataGroups(participant.getDataGroups()) .withUserSubstudyIds(participant.getSubstudyIds()) .withLanguages(participant.getLanguages()).build(); }