auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Control createContents(Composite parent) { getShell().setText(Messages.ManageXMLAnalysisDialog_ManageXmlAnalysesFiles); Composite mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayout(new GridLayout(2, false)); Composite tableContainer = new Composite(mainComposite, SWT.NONE); tableContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); <START> GridLayout lcgl = new GridLayout(); lcgl.marginHeight = 0; lcgl.marginWidth = 0; tableContainer.setLayout(lcgl); <END> createTable(tableContainer); createLabels(tableContainer); createImportButtons(mainComposite); createSelectionButtons(mainComposite); fillAnalysesTable(); getShell().setMinimumSize(300, 275); return mainComposite; }</code><technical_language>If want replace this by: GridLayoutFactory.fillDefaults().applyTo(tableContainer);</technical_language>

Target:
protected Control createContents(Composite parent) { getShell().setText(Messages.ManageXMLAnalysisDialog_ManageXmlAnalysesFiles); Composite mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayout(new GridLayout(2, false)); Composite tableContainer = new Composite(mainComposite, SWT.NONE); tableContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); GridLayoutFactory.fillDefaults().applyTo(tableContainer); createTable(tableContainer); createLabels(tableContainer); createImportButtons(mainComposite); createSelectionButtons(mainComposite); fillAnalysesTable(); getShell().setMinimumSize(300, 275); return mainComposite; }
Source:
<code>public void testCombineGenotypingArrayVcfs() throws IOException { final CombineGenotypingArrayVcfs combineGenotypingArrayVcfs = new CombineGenotypingArrayVcfs(); final File inputVcf1 = TEST_DATA_DIR.resolve("input.vcf").toFile(); final File inputVcf2 = TEST_DATA_DIR.resolve("input2.vcf").toFile(); <START> final List<File> inputs = new ArrayList<File>(); <END> inputs.add(inputVcf1); inputs.add(inputVcf2); final File output = File.createTempFile("output", ".vcf"); output.deleteOnExit(); combineGenotypingArrayVcfs.INPUT = inputs; combineGenotypingArrayVcfs.OUTPUT = output; Assert.assertEquals(combineGenotypingArrayVcfs.doWork(), 0); final File expected = TEST_DATA_DIR.resolve("combined_output.vcf").toFile(); VcfTestUtils.assertVcfFilesAreEqual(output, expected); }</code><technical_language>Arrays.asList(inputVcf1, inputVcf2);</technical_language>

Target:
public void testCombineGenotypingArrayVcfs() throws IOException { final CombineGenotypingArrayVcfs combineGenotypingArrayVcfs = new CombineGenotypingArrayVcfs(); final File inputVcf1 = TEST_DATA_DIR.resolve("input_for_combine.vcf").toFile(); final File inputVcf2 = TEST_DATA_DIR.resolve("input2_for_combine.vcf").toFile(); final List<File> inputs = Arrays.asList(inputVcf1, inputVcf2); final File output = File.createTempFile("output", ".vcf"); output.deleteOnExit(); combineGenotypingArrayVcfs.INPUT = inputs; combineGenotypingArrayVcfs.OUTPUT = output; Assert.assertEquals(combineGenotypingArrayVcfs.doWork(), 0); final File expected = TEST_DATA_DIR.resolve("combined_output.vcf").toFile(); VcfTestUtils.assertVcfFilesAreEqual(output, expected); }
Source:
<code>public void keyspaceNotAccessibleDoesNotError() throws Exception { when(client.describe_keyspace("system_palantir")).thenThrow(new NotFoundException()); <START> DummyClientPool clientPool = new DummyClientPool(client); <END> Supplier<Map<String, String>> hostnamesByIpSupplier = new HostnamesByIpSupplier(() -> clientPool); assertThatCode(hostnamesByIpSupplier::get).doesNotThrowAnyException(); assertThat(hostnamesByIpSupplier.get()).isEmpty(); }</code><technical_language>This line 59 a global variable clean tests a bit</technical_language>

Target:
public void keyspaceNotAccessibleDoesNotError() throws Exception { when(client.describe_keyspace("system_palantir")).thenThrow(new NotFoundException()); assertThatCode(hostnamesByIpSupplier::get).doesNotThrowAnyException(); assertThat(hostnamesByIpSupplier.get()).isEmpty(); }
Source:
<code>public void complete() throws InterruptedException { Preconditions.checkState(successCallback != null, "Must set a success callback before completing " + this); Preconditions.checkState(exceptionCallback != null, "Must set an exception callback before completing " + this); Preconditions.checkState(timeoutCallback != null, "Must set a timeout callback before completing " + this); for (WrappedTask wt : wrappedTasks) { try { successCallback.accept(wt.callable, wt.future.get(timeout, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { throw e; } catch (TimeoutException e) { wt.future.cancel(true); <START> timeoutCallback.accept(wt.callable); <END> } catch (Exception e) { exceptionCallback.accept(wt.callable, e); } } }</code><technical_language>a future is queued execute, executed canceled. if this 3 times for a tserver, master try halt it</technical_language>

Target:
public void complete() throws InterruptedException { isCompleting = true; try { Preconditions.checkState(successCallback != null, "Must set a success callback before completing " + this); Preconditions.checkState(exceptionCallback != null, "Must set an exception callback before completing " + this); Preconditions.checkState(timeoutCallback != null, "Must set a timeout callback before completing " + this); int unfinished = wrappedTasks.size(); while (unfinished > 0) { WrappedTask wt = startedTasks.poll(timeoutInNanos * 2, TimeUnit.NANOSECONDS); if (wt != null) { completeTask(wt); wt.hasCompleted = true; unfinished--; } } wrappedTasks.clear(); } finally { isCompleting = false; } }
Source:
<code>public void close() throws IOException { Set<BufferedLogChannelWithDirInfo> copyOfCurrentLogsWithDirInfo = getCopyOfCurrentLogs(); for (BufferedLogChannelWithDirInfo currentLogWithDirInfo : copyOfCurrentLogsWithDirInfo) { <START> IOUtils.close(log, currentLogWithDirInfo.getLogChannel()); <END> } }</code><technical_language>reason "IOUtils.close" is called instead of "currentLogWithDirInfo.getLogChannel().close()"</technical_language>

Target:
public void close() throws IOException { Set<BufferedLogChannelWithDirInfo> copyOfCurrentLogsWithDirInfo = getCopyOfCurrentLogs(); for (BufferedLogChannelWithDirInfo currentLogWithDirInfo : copyOfCurrentLogsWithDirInfo) { if (currentLogWithDirInfo.getLogChannel() != null) { currentLogWithDirInfo.getLogChannel().close(); } } }
Source:
<code><START> public List<TaskObject> getTaskList() { <END> return this.TaskList; }</code><technical_language>List => ArrayList</technical_language>

Target:
public ArrayList<TaskObject> getTaskList() { return mTasks; }
Source:
<code>private String getCommentGiverNameFromEmail(String giverEmail) { if (Const.DISPLAYED_NAME_FOR_ANONYMOUS_PARTICIPANT.equals(giverEmail)) { return Const.DISPLAYED_NAME_FOR_ANONYMOUS_PARTICIPANT; } <START> if (commentGiverEmailToNameTable.get(giverEmail) == null) { <END> return giverEmail; } return commentGiverEmailToNameTable.get(giverEmail); }</code><technical_language>hit case</technical_language>

Target:
private String getCommentGiverNameFromEmail(String giverEmail) { if (Const.DISPLAYED_NAME_FOR_ANONYMOUS_PARTICIPANT.equals(giverEmail)) { return Const.DISPLAYED_NAME_FOR_ANONYMOUS_PARTICIPANT; } return commentGiverEmailToNameTable.get(giverEmail); }
Source:
<code>public void assertHasSuperclass(AssertionInfo info, Class<?> actual, Class<?> superclass) { assertNotNull(info, actual); Class<?> actualSuperclass = actual.getSuperclass(); <START> if (actualSuperclass == null && superclass != null || actualSuperclass != null && !actualSuperclass.equals(superclass)) { <END> throw failures.failure(info, shouldHaveSuperclass(actual, superclass)); } }</code><technical_language>add () group && conditions for clarity</technical_language>

Target:
public void assertHasSuperclass(AssertionInfo info, Class<?> actual, Class<?> superclass) { assertNotNull(info, actual); Class<?> actualSuperclass = actual.getSuperclass(); if ((actualSuperclass == null && superclass != null) || (actualSuperclass != null && !actualSuperclass.equals(superclass))) { throw failures.failure(info, shouldHaveSuperclass(actual, superclass)); } }
Source:
<code>public void setLocale(String locale) { text.setLocale(locale); if <START> (Build.VERSION.SDK_INT >= <END> Build.VERSION_CODES.JELLY_BEAN_MR1) { LayoutParams params = (LayoutParams) divider.getLayoutParams(); if (isLangRTL(locale)) { params.gravity = Gravity.RIGHT; } else { params.gravity = Gravity.LEFT; } divider.setLayoutParams(params); } }</code><technical_language>reason for this condition</technical_language>

Target:
public void setLocale(String locale) { text.setLocale(locale); LayoutParams params = (LayoutParams) divider.getLayoutParams(); if (isLangRTL(locale)) { params.gravity = Gravity.RIGHT; } else { params.gravity = Gravity.LEFT; } divider.setLayoutParams(params); }
Source:
<code>public StreamsDatum processLine(String line) { String[] fields = line.split(hdfsConfiguration.getFieldDelimiter()); if( fields.length == 0) return null; String id = null; DateTime ts = null; Map<String, Object> metadata = null; String json = null; <START> if( hdfsConfiguration.getFields().contains( HdfsConstants.DOC ) <END> && fields.length > hdfsConfiguration.getFields().indexOf(HdfsConstants.DOC)) { json = fields[hdfsConfiguration.getFields().indexOf(HdfsConstants.DOC)]; } if( hdfsConfiguration.getFields().contains( HdfsConstants.ID ) && fields.length > hdfsConfiguration.getFields().indexOf(HdfsConstants.ID)) { id = fields[hdfsConfiguration.getFields().indexOf(HdfsConstants.ID)]; } if( hdfsConfiguration.getFields().contains( HdfsConstants.TS ) && fields.length > hdfsConfiguration.getFields().indexOf(HdfsConstants.TS)) { ts = parseTs(fields[hdfsConfiguration.getFields().indexOf(HdfsConstants.TS)]); } if( hdfsConfiguration.getFields().contains( HdfsConstants.META ) && fields.length > hdfsConfiguration.getFields().indexOf(HdfsConstants.META)) { metadata = parseMap(fields[hdfsConfiguration.getFields().indexOf(HdfsConstants.META)]); } StreamsDatum datum = new StreamsDatum(json); datum.setId(id); datum.setTimestamp(ts); datum.setMetadata(metadata); return datum; }</code><technical_language>this a lot more readable if pulled out hdfsConfiguration.getFields() variable</technical_language>

Target:
public StreamsDatum processLine(String line) { String[] expectedFields = hdfsConfiguration.getFields(); String[] parsedFields = line.split(hdfsConfiguration.getFieldDelimiter()); if( fields.length == 0) return null; String id = null; DateTime ts = null; Map<String, Object> metadata = null; String json = null; if( expectedFields.contains( HdfsConstants.DOC ) && parsedFields.length > expectedFields.indexOf(HdfsConstants.DOC)) { json = parsedFields[expectedFields.indexOf(HdfsConstants.DOC)]; } if( expectedFields.contains( HdfsConstants.ID ) && parsedFields.length > expectedFields.indexOf(HdfsConstants.ID)) { id = parsedFields[expectedFields.indexOf(HdfsConstants.ID)]; } if( expectedFields.contains( HdfsConstants.TS ) && parsedFields.length > expectedFields.indexOf(HdfsConstants.TS)) { ts = parseTs(parsedFields[expectedFields.indexOf(HdfsConstants.TS)]); } if( expectedFields.contains( HdfsConstants.META ) && parsedFields.length > expectedFields.indexOf(HdfsConstants.META)) { metadata = parseMap(parsedFields[expectedFields.indexOf(HdfsConstants.META)]); } StreamsDatum datum = new StreamsDatum(json); datum.setId(id); datum.setTimestamp(ts); datum.setMetadata(metadata); return datum; }
Source:
<code>public List<OrderGroup> getOrderGroupsByEncounter(Encounter encounter) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(OrderGroup.class); if (encounter != null) { criteria.add(Restrictions.eq("encounter", encounter)); } else { <START> criteria.add(Restrictions.isNull("encounter")); <END> } return criteria.list(); }</code><technical_language>order group encounter</technical_language>

Target:
public List<OrderGroup> getOrderGroupsByEncounter(Encounter encounter) throws APIException { if (encounter == null) { throw new APIException("Encounter cannot be null"); } Criteria criteria = sessionFactory.getCurrentSession().createCriteria(OrderGroup.class); criteria.add(Restrictions.eq("encounter", encounter)); return criteria.list(); }
Source:
<code>public void trainModel(File pairFolder) throws Exception { String odsModel = this.getClass().getClassLoader().getResource("ODSTraining/ODSmodel.bin").getPath(); String trainingFile = this.getClass().getClassLoader().getResource("ODSTraining/Training-libsvm.txt").getPath(); DMatrix trainMat = new DMatrix(trainingFile); Map<String, Object> params = new HashMap<String, Object>() { { <START> put("eta", 0.3); <END> put("max_depth", 6); put("gamma", 1); put("objective", "binary:logistic"); put("eval_metric", "logloss"); } }; Map<String, DMatrix> watches = new HashMap<String, DMatrix>() { { put("train", trainMat); } }; int nround = 20; Booster booster = XGBoost.train(trainMat, params, nround, watches, null, null); booster.saveModel(odsModel); }</code><technical_language>Minor: move hardcoded values Configuration properties, play other values</technical_language>

Target:
public void trainModel(File pairFolder) throws Exception { String odsModel = ComingProperties.getProperty("ODSmodel"); String trainingFile = ComingProperties.getProperty("ODSTrainingFile"); DMatrix trainMat = new DMatrix(trainingFile); Map<String, Object> params = new HashMap<String, Object>() { { put("eta", ComingProperties.getProperty("xgboost-training-eta")); put("max_depth", ComingProperties.getProperty("xgboost-training-max-depth")); put("gamma", ComingProperties.getProperty("xgboost-training-gamma")); put("objective", ComingProperties.getProperty("xgboost-training-objective")); put("eval_metric", ComingProperties.getProperty("xgboost-training-eval-metric")); } }; Map<String, DMatrix> watches = new HashMap<String, DMatrix>() { { put("train", trainMat); } }; int nround = Integer.parseInt(ComingProperties.getProperty("xgboost-training-nround")); Booster booster = XGBoost.train(trainMat, params, nround, watches, null, null); booster.saveModel(odsModel); }
Source:
<code>public Converter getConverter() { return new BiDirectionalConverter() { @Override @SuppressWarnings("rawtypes") public Object convert(final Class type, final Object value) { final ExecutionCourseBean result = new ExecutionCourseBean(); result.setDestinationExecutionCourse((ExecutionCourse) new DomainObjectKeyConverter().convert(type, value)); return result; } @Override public String deserialize(final Object object) { <START> String result = StringUtils.EMPTY; <END> if (object != null && object instanceof ExecutionCourseBean) { final ExecutionCourseBean bean = (ExecutionCourseBean) object; if (bean.getDestinationExecutionCourse() != null) { result = bean.getDestinationExecutionCourse().toString(); } } return result; } }; }</code><technical_language>"" instead. clear constant for reading this, avoids another dependency. (The for other usages in this PR)</technical_language>

Target:
public Converter getConverter() { return new BiDirectionalConverter() { @Override @SuppressWarnings("rawtypes") public Object convert(final Class type, final Object value) { final ExecutionCourseBean result = new ExecutionCourseBean(); result.setDestinationExecutionCourse((ExecutionCourse) new DomainObjectKeyConverter().convert(type, value)); return result; } @Override public String deserialize(final Object object) { String result = ""; if (object != null && object instanceof ExecutionCourseBean) { final ExecutionCourseBean bean = (ExecutionCourseBean) object; if (bean.getDestinationExecutionCourse() != null) { result = bean.getDestinationExecutionCourse().toString(); } } return result; } }; }
Source:
<code>private void testWithIncludeAndExcludePattern(String path, String includePattern, String excludePattern, boolean expectedResult, int nonTraversableDepth) { Path p = Paths.get(path); if (includePattern != null) { fileSelector.setIncludes(includePattern); } if (excludePattern != null) { fileSelector.setExcludes(excludePattern); } boolean result = fileSelector.matches(p); assertEquals(expectedResult, result); if (expectedResult) { Path appendedPath = p.getRoot(); int depth = 0; for (Iterator<Path> it = p.iterator(); it.hasNext();) { Path name = it.next(); if (appendedPath == null) { appendedPath = name; } else { appendedPath = appendedPath.resolve(name); } if (depth == nonTraversableDepth) { assertFalse("Path " + appendedPath + " should be traversable", <START> fileSelector.traverseDescendents(appendedPath)); <END> } else { assertTrue("Path " + appendedPath + " should be traversable", fileSelector.traverseDescendents(appendedPath)); } } } }</code><technical_language>Error message wrong</technical_language>

Target:
private void testWithIncludeAndExcludePattern(String path, String includePattern, String excludePattern, boolean expectedResult, int nonTraversableDepth) { Path p = Paths.get(path); if (includePattern != null) { fileSelector.setIncludes(includePattern); } if (excludePattern != null) { fileSelector.setExcludes(excludePattern); } boolean result = fileSelector.matches(p); assertEquals(expectedResult, result); if (expectedResult) { Path appendedPath = p.getRoot(); int depth = 0; for (Iterator<Path> it = p.iterator(); it.hasNext();) { Path name = it.next(); if (appendedPath == null) { appendedPath = name; } else { appendedPath = appendedPath.resolve(name); } if (depth == nonTraversableDepth) { assertFalse("Path " + appendedPath + " should not be traversable", fileSelector.traverseDescendents(appendedPath)); } else { assertTrue("Path " + appendedPath + " should be traversable", fileSelector.traverseDescendents(appendedPath)); } } } }
Source:
<code>public void setRecharged(Campaign campaign) { DateTime currentDate = Utilities.getDateTimeDay(campaign.getCalendar()); double neededRechargeTime = currentPlanet.getRechargeTime(currentDate); rechargeTime = neededRechargeTime; <START> campaign.addReport("Jumpship drives fully charged"); <END> }</code><technical_language>Prefer moving this reporting logic out of this action listener. please add (GM) message</technical_language>

Target:
public void setRecharged(Campaign campaign) { DateTime currentDate = Utilities.getDateTimeDay(campaign.getCalendar()); double neededRechargeTime = currentPlanet.getRechargeTime(currentDate); rechargeTime = neededRechargeTime; }
Source:
<code>public void testNexus5704renderStorageFileItemWithMatchingCondition() throws Exception { try { final ResourceStoreRequest rsr = fileItem.getResourceStoreRequest(); rsr.setIfNoneMatch( "{SHA1{1234567890}}" ); when( attributes.containsKey( StorageFileItem.DIGEST_SHA1_KEY ) ).thenReturn( true ); when( attributes.get( StorageFileItem.DIGEST_SHA1_KEY ) ).thenReturn( "1234567890" ); underTest.renderStorageFileItem( request, fileItem ); <START> assertThat( "ResourceException was expected to be thrown", false ); <END> } catch ( ResourceException e ) { assertThat( e.getStatus(), equalTo( Status.REDIRECTION_NOT_MODIFIED ) ); } }</code><technical_language>intent of test clearer if fail() message</technical_language>

Target:
public void testNexus5704renderStorageFileItemWithMatchingCondition() throws Exception { try { final ResourceStoreRequest rsr = fileItem.getResourceStoreRequest(); rsr.setIfNoneMatch( "{SHA1{1234567890}}" ); when( attributes.containsKey( StorageFileItem.DIGEST_SHA1_KEY ) ).thenReturn( true ); when( attributes.get( StorageFileItem.DIGEST_SHA1_KEY ) ).thenReturn( "1234567890" ); underTest.renderStorageFileItem( request, fileItem ); fail( "ResourceException is expected to be thrown" ); } catch ( ResourceException e ) { assertThat( e.getStatus(), equalTo( Status.REDIRECTION_NOT_MODIFIED ) ); } }
Source:
<code>public ReactExoplayerView(ThemedReactContext context, ReactExoplayerConfig config) { super(context); this.themedReactContext = context; this.eventEmitter = new VideoEventEmitter(context); this.config = config; this.bandwidthMeter = config.getBandwidthMeter(); createViews(); audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); themedReactContext.addLifecycleEventListener(this); audioBecomingNoisyReceiver = new AudioBecomingNoisyReceiver(themedReactContext); ReactExoplayerView self = this; BroadcastReceiver pipReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { boolean isInPictureInPictureMode = intent.getBooleanExtra("isInPictureInPictureMode", false); self.onPictureInPictureModeChanged(isInPictureInPictureMode); } }; BroadcastReceiver leaveReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { self.setPictureInPicture(true); self.onHostResume(); } }; Activity activity = themedReactContext.getCurrentActivity(); <START> activity.registerReceiver(pipReceiver, new IntentFilter("onPictureInPictureModeChanged")); <END> activity.registerReceiver(leaveReceiver, new IntentFilter("onUserLeaveHint")); initializePlayer(); }</code><technical_language>unregister receivers</technical_language>

Target:
public ReactExoplayerView(ThemedReactContext context, ReactExoplayerConfig config) { super(context); this.themedReactContext = context; this.eventEmitter = new VideoEventEmitter(context); this.config = config; this.bandwidthMeter = config.getBandwidthMeter(); createViews(); audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); themedReactContext.addLifecycleEventListener(this); audioBecomingNoisyReceiver = new AudioBecomingNoisyReceiver(themedReactContext); ReactExoplayerView self = this; pipReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { boolean isInPictureInPictureMode = intent.getBooleanExtra("isInPictureInPictureMode", false); self.onPictureInPictureModeChanged(isInPictureInPictureMode); } }; leaveReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (showPictureInPictureOnLeave) { self.setPictureInPicture(true); } } }; Activity activity = themedReactContext.getCurrentActivity(); activity.registerReceiver(pipReceiver, new IntentFilter("onPictureInPictureModeChanged")); activity.registerReceiver(leaveReceiver, new IntentFilter("onUserLeaveHint")); initializePlayer(); }
Source:
<code>public Command teslaScenario(TeslaScenario scenario, Integer target) { if (scenario == null) return seq(); scenario = (TeslaScenario) EcoreUtil.copy(scenario); selectorParser = new TeslaSelectorParser(scenario); selectorParser.parse(); teslaCommands = scenario.getCommands(); pos = 0; script = new ArrayList<Command>(); while (target == null || pos < target) { if (pos >= teslaCommands.size()) { break; } Command newCommand = teslaCommand(); if (newCommand != null) { script.add(newCommand); } } Sequence seq = CoreFactory.eINSTANCE.createSequence(); List<Command> withified = EclRefactoring.withify(script, new Comparator<Command>() { public int compare(Command c1, Command c2) { if (c1 instanceof Selector && c2 instanceof Selector) { Selector s1 = (Selector) c1; Selector s2 = (Selector) c2; if (s1.getId() != null && s2.getId() != null) return s1.getId().compareTo(s2.getId()); } <START> <END> if (c1 instanceof GetItemImpl && c2 instanceof GetItemImpl) { GetItemImpl i1 = (GetItemImpl) c1; GetItemImpl i2 = (GetItemImpl) c2; if (i1.getPath() != null && i2.getPath() != null) return i1.getPath().compareTo(i2.getPath()); } return 1; } }); seq.getCommands().addAll(DiagramUtils.updateSelectors(withified)); return TeslaScriptletFactory.makeSeq(seq); }</code><technical_language>Please, remove tabs</technical_language>

Target:
public Command teslaScenario(TeslaScenario scenario, Integer target) { if (scenario == null) return seq(); scenario = (TeslaScenario) EcoreUtil.copy(scenario); selectorParser = new TeslaSelectorParser(scenario); selectorParser.parse(); teslaCommands = scenario.getCommands(); pos = 0; script = new ArrayList<Command>(); while (target == null || pos < target) { if (pos >= teslaCommands.size()) { break; } Command newCommand = teslaCommand(); if (newCommand != null) { script.add(newCommand); } } Sequence seq = CoreFactory.eINSTANCE.createSequence(); List<Command> withified = EclRefactoring.withify(script, new Comparator<Command>() { public int compare(Command c1, Command c2) { if (c1 instanceof Selector && c2 instanceof Selector) { Selector s1 = (Selector) c1; Selector s2 = (Selector) c2; if (s1.getId() != null && s2.getId() != null) { return s1.getId().compareTo(s2.getId()); } } if (c1 instanceof GetItemImpl && c2 instanceof GetItemImpl) { GetItemImpl i1 = (GetItemImpl) c1; GetItemImpl i2 = (GetItemImpl) c2; if (i1.getPath() != null && i2.getPath() != null) { return i1.getPath().compareTo(i2.getPath()); } } return 1; } }); seq.getCommands().addAll(DiagramUtils.updateSelectors(withified)); return TeslaScriptletFactory.makeSeq(seq); }
Source:
<code>public AccessService getAccessService (double lat, double lon) { Point point = GeometryUtils.geometryFactory.createPoint(new Coordinate(lon, lat)); ModificationPolygon polygon = polygons.getWinningPolygon(point); double waitTimeMinutes = polygon == null ? polygons.defaultData : polygon.data; if (waitTimeMinutes == -1) { return NO_SERVICE_HERE; } <START> int waitTimeSeconds = (int) waitTimeMinutes * 60; <END> TIntSet stopsReachable = null; if (stopNumbersForZonePolygon != null) { stopsReachable = stopNumbersForZonePolygon.get(polygon); if (stopsReachable == null) { stopsReachable = new TIntHashSet(); } } return new AccessService(waitTimeSeconds, stopsReachable); }</code><technical_language>This cast double waitTimeMinutes int multiplying 60. retain parentheses expression</technical_language>

Target:
public AccessService getAccessService (double lat, double lon) { Point point = GeometryUtils.geometryFactory.createPoint(new Coordinate(lon, lat)); ModificationPolygon polygon = polygons.getWinningPolygon(point); double waitTimeMinutes = polygon == null ? polygons.defaultData : polygon.data; if (waitTimeMinutes == -1) { return NO_SERVICE_HERE; } int waitTimeSeconds = (int) (waitTimeMinutes * 60); TIntSet stopsReachable = null; if (stopNumbersForZonePolygon != null) { stopsReachable = stopNumbersForZonePolygon.get(polygon); if (stopsReachable == null) { stopsReachable = new TIntHashSet(); } } return new AccessService(waitTimeSeconds, stopsReachable); }
Source:
<code>public Integration getIntegration(final Project project, final ConnectorType connectorType) { notNull(project, "project"); notNull(connectorType, "connector"); try { return restTemplate.getForObject(Integration.URL, Integration.class, project.getId(), connectorType.getName()); <START> } catch (GoodDataRestException | RestClientException e) { <END> throw new ConnectorException("Unable to get " + connectorType + " integration", e); } }</code><technical_language>if integration created? IntegrationNotFoundException</technical_language>

Target:
public Integration getIntegration(final Project project, final ConnectorType connectorType) { notNull(project, "project"); notNull(connectorType, "connector"); try { return restTemplate.getForObject(Integration.URL, Integration.class, project.getId(), connectorType.getName()); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new IntegrationNotFoundException(project, connectorType, e); } else { throw e; } } catch (RestClientException e) { throw new ConnectorException("Unable to get " + connectorType + " integration", e); } }
Source:
<code>private static @Nullable BiPredicate<IElementResolver, Function<IElementResolver, Map<String, String>>> getPredicate(@Nullable String regex) { if (regex == null || regex.isEmpty()) { return null; } Pattern filterPattern = Pattern.compile(regex); BiPredicate<IElementResolver, Function<IElementResolver, Map<String, String>>> filterPredicate = (item, function) -> { Map<String, String> toTest = new HashMap<>(function.apply(item)); <START> toTest.putAll(item.computeData()); <END> return Iterables.any(toTest.entrySet(), entry -> filterPattern.matcher(entry.getValue()).find()); }; return filterPredicate; }</code><technical_language>I wonder, if call IElementResolver.computeData() here, do need apply another (user-provided) function IElementResolver</technical_language>

Target:
private static @Nullable Predicate<Map<String, String>> getPredicate(@Nullable String regex) { if (regex == null || regex.isEmpty()) { return null; } Pattern filterPattern = Pattern.compile(regex); Predicate<Map<String, String>> filterPredicate = (toTest) -> { return Iterables.any(toTest.entrySet(), entry -> filterPattern.matcher(entry.getValue()).find()); }; return filterPredicate; }
Source:
<code>public static int getUsedMemoryMegaBytes() { <START> return (int)getUsedMemoryBytes() / 1024 / 1024; <END> }</code><technical_language>do division prior casting int</technical_language>

Target:
public static int getUsedMemoryMegaBytes() { return (int)(getUsedMemoryBytes() / 1024 / 1024); }
Source:
<code>public GapAwareTrackingToken withGapsTruncatedAt(long truncationPoint) { if (gaps.isEmpty() || gaps.first() > truncationPoint) { return this; } <START> SortedSet<Long> gaps = new ConcurrentSkipListSet<>(this.gaps.tailSet(truncationPoint)); <END> return new GapAwareTrackingToken(this.index, gaps, truncationPoint); }</code><technical_language>Nit: rename gaps truncatedGaps. accidentally mixing this gaps instance global gaps set occur</technical_language>

Target:
public GapAwareTrackingToken withGapsTruncatedAt(long truncationPoint) { if (gaps.isEmpty() || gaps.first() > truncationPoint) { return this; } SortedSet<Long> truncatedGaps = new ConcurrentSkipListSet<>(this.gaps.tailSet(truncationPoint)); return new GapAwareTrackingToken(this.index, truncatedGaps, truncationPoint); }
Source:
<code>public UserDetailsService myUserDetailsService() { ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); <START> salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); <END> extendedInMemoryUserDetailsManager.createUser(new User("user", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); List<GrantedAuthority> deanAuthorities = new ArrayList<>(); deanAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); extendedInMemoryUserDetailsManager.createUser(new User("dean", "password", deanAuthorities)); return extendedInMemoryUserDetailsManager; }</code><technical_language>roles present in list</technical_language>

Target:
public UserDetailsService myUserDetailsService() { ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); extendedInMemoryUserDetailsManager.createUser(new User("user", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); List<GrantedAuthority> deanAuthorities = new ArrayList<>(); deanAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); extendedInMemoryUserDetailsManager.createUser(new User("dean", "password", deanAuthorities)); return extendedInMemoryUserDetailsManager; }
Source:
<code>public static Tocd readObjectClassDefinition(Bundle bundle, String pid) throws IOException, Exception, XMLStreamException, FactoryConfigurationError { Tocd ocd = null; StringBuilder sbMetatypeXmlName = new StringBuilder(); sbMetatypeXmlName.append("OSGI-INF/metatype/").append(pid).append(".xml"); String metatypeXmlName = sbMetatypeXmlName.toString(); String metatypeXml = IOUtil.readResource(bundle, metatypeXmlName); if (metatypeXml != null) { Tmetadata metaData = unmarshalXml(metatypeXml, Tmetadata.class); <START> if (metaData.getOCD() != null && metaData.getOCD().size() > 0) { <END> ocd = (Tocd) metaData.getOCD().get(0); } } return ocd; }</code><technical_language>!isEmpty()</technical_language>

Target:
public static Tocd readObjectClassDefinition(Bundle bundle, String pid) throws IOException, Exception, XMLStreamException, FactoryConfigurationError { Tocd ocd = null; StringBuilder sbMetatypeXmlName = new StringBuilder(); sbMetatypeXmlName.append("OSGI-INF/metatype/").append(pid).append(".xml"); String metatypeXmlName = sbMetatypeXmlName.toString(); String metatypeXml = IOUtil.readResource(bundle, metatypeXmlName); if (metatypeXml != null) { Tmetadata metaData = unmarshal(metatypeXml, Tmetadata.class); if (metaData.getOCD() != null && !metaData.getOCD().isEmpty()) { ocd = (Tocd) metaData.getOCD().get(0); } } return ocd; }
Source:
<code>public MulePackageBuilder withClasses(File folder) { checkArgument(folder != null, "The folder must not be null"); <START> checkArgument(folder.exists(), "The folder must must exists"); <END> classesFolder = folder; return this; }</code><technical_language>please remove double "must"? In other methods in this class well</technical_language>

Target:
public MulePackageBuilder withClasses(File folder) { checkArgument(folder != null, "The folder must not be null"); checkArgument(folder.exists(), "The folder must exists"); classesFolder = folder; return this; }
Source:
<code>private KeyStoreWatcher() { fileSystem = FileSystems.getDefault(); <START> executor = Executors.newCachedThreadPool(); <END> }</code><technical_language>super-excited this. a dedicated single, descriptively-named daemon thread is created removed key store watcher (especially if watcher is shared reloadable keystores, case here)</technical_language>

Target:
private KeyStoreWatcher() { fileSystem = FileSystems.getDefault(); }
Source:
<code>public String toString() { <START> return String.format("%n %s @ %.1f%%", this.getName(), this.getRemainingCapacity() * 100d); <END> }</code><technical_language>include %n header here</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Name: ").append(getName()).append(", "); sb.append("Remaining Capacity: ").append(getRemainingCapacity() * 100d).append("%, "); sb.append("Time Remaining: ").append(getFormattedTimeRemaining()); return sb.toString(); }
Source:
<code>public Builder <START> addPoint(@NonNull <END> MeteringPoint point, @MeteringMode int mode) { if (mode == (MeteringMode.AF | MeteringMode.AE | MeteringMode.AWB) || mode == (MeteringMode.AF | MeteringMode.AE) || mode == (MeteringMode.AF | MeteringMode.AWB) || mode == MeteringMode.AF) { mMeteringPointsAf.add(point); } if (mode == (MeteringMode.AF | MeteringMode.AE | MeteringMode.AWB) || mode == (MeteringMode.AF | MeteringMode.AE) || mode == (MeteringMode.AE | MeteringMode.AWB) || mode == MeteringMode.AE) { mMeteringPointsAe.add(point); } if (mode == (MeteringMode.AF | MeteringMode.AE | MeteringMode.AWB) || mode == (MeteringMode.AE | MeteringMode.AWB) || mode == (MeteringMode.AF | MeteringMode.AWB) || mode == MeteringMode.AWB) { mMeteringPointsAwb.add(point); } return this; }</code><technical_language>if mode == 0 (no flags specified)? throw a IllegalArguementException (use Preconditions.checkArgument) warn developer</technical_language>

Target:
public Builder addPoint(@NonNull MeteringPoint point, @MeteringMode int mode) { Preconditions.checkArgument( (mode >= MeteringMode.AF) && (mode <= (MeteringMode.AF | MeteringMode.AE | MeteringMode.AWB)), "Invalid metering mode " + mode); if ((mode & MeteringMode.AF) != 0) { mMeteringPointsAf.add(point); } if ((mode & MeteringMode.AE) != 0) { mMeteringPointsAe.add(point); } if ((mode & MeteringMode.AWB) != 0) { mMeteringPointsAwb.add(point); } return this; }
Source:
<code>public void detectConflicts() { Match match = diff.getMatch(); EObject value = getRelatedModelElement(diff); if (value != null) { Collection<ReferenceChange> refChanges = index.getReferenceChangesByValue(value); for (ReferenceChange candidate : Iterables.filter(refChanges, possiblyConflictingWith(diff))) { if (candidate.getReference().isContainment()) { conflict(candidate, REAL); } else { if (value.eContainer() == null) { if (candidate.getKind() != DELETE) { conflict(candidate, REAL); } } } } } EList<Diff> diffsInSameMatch = diff.getMatch().getDifferences(); for (Diff candidate : Iterables.filter(diffsInSameMatch, and(possiblyConflictingWith(diff), instanceOf(ResourceAttachmentChange.class)))) { ConflictKind kind = REAL; if (candidate.getKind() == DELETE) { final Resource diffRes; final Resource candidateRes; diffRes = match.getOrigin().eResource(); candidateRes = match.getOrigin().eResource(); if (getMatchResource(diffRes) == getMatchResource(candidateRes)) { kind = ConflictKind.PSEUDO; } } conflict(candidate, kind); } EObject o = getRelatedModelElement(diff); if ((o == null || o.eContainer() == null) <START> && (diff.getConflict() == null || diff.getConflict().getKind() != ConflictKind.PSEUDO)) { <END> for (Diff extendedCandidate : Iterables.filter(match.getAllDifferences(), possiblyConflictingWith(diff))) { if (isDeleteOrUnsetDiff(extendedCandidate)) { conflict(extendedCandidate, ConflictKind.PSEUDO); } else { conflict(extendedCandidate, ConflictKind.REAL); } } } }</code><technical_language>import static ConflictKind please</technical_language>

Target:
public void detectConflicts() { Match match = diff.getMatch(); EObject value = getRelatedModelElement(diff); if (value != null) { Collection<ReferenceChange> refChanges = index.getReferenceChangesByValue(value); for (ReferenceChange candidate : Iterables.filter(refChanges, possiblyConflictingWith(diff))) { if (candidate.getReference().isContainment()) { conflict(candidate, REAL); } else { if (value.eContainer() == null) { if (candidate.getKind() != DELETE) { conflict(candidate, REAL); } } } } } EList<Diff> diffsInSameMatch = diff.getMatch().getDifferences(); for (Diff candidate : Iterables.filter(diffsInSameMatch, and(possiblyConflictingWith(diff), instanceOf(ResourceAttachmentChange.class)))) { ConflictKind kind = REAL; if (candidate.getKind() == DELETE) { final Resource diffRes; final Resource candidateRes; diffRes = match.getOrigin().eResource(); candidateRes = match.getOrigin().eResource(); if (getMatchResource(diffRes) == getMatchResource(candidateRes)) { kind = PSEUDO; } } conflict(candidate, kind); } EObject o = getRelatedModelElement(diff); if ((o == null || o.eContainer() == null) && (diff.getConflict() == null || diff.getConflict().getKind() != PSEUDO)) { for (Diff extendedCandidate : Iterables.filter(match.getAllDifferences(), possiblyConflictingWith(diff))) { if (isDeleteOrUnsetDiff(extendedCandidate)) { conflict(extendedCandidate, PSEUDO); } else { conflict(extendedCandidate, REAL); } } } }
Source:
<code>private void adjustDependencyRefSetMembers(Date effectiveTime) { final SnomedRegularRefSet moduleDependencyRefSet = getEditingContext().lookup(REFSET_MODULE_DEPENDENCY_TYPE, SnomedRegularRefSet.class); if (!incomingModuleDependencyRefSetMembers.isEmpty()) { removeDuplicateMembers(effectiveTime, moduleDependencyRefSet); incomingModuleDependencyRefSetMembers.forEach((k, v) -> { final SnomedModuleDependencyRefSetMember memberToAdd = SnomedRefSetFactory.eINSTANCE.createSnomedModuleDependencyRefSetMember(); memberToAdd.setUuid(v); memberToAdd.setActive(true); memberToAdd.setRefSet(moduleDependencyRefSet); memberToAdd.setModuleId(k.getFirst()); memberToAdd.setReferencedComponentId(k.getSecond()); <START> adjustRelased(memberToAdd); <END> adjustEffectiveTime(memberToAdd, effectiveTime); moduleDependencyRefSet.getMembers().add(memberToAdd); }); } }</code><technical_language>Please fix typo in method's name</technical_language>

Target:
private void adjustDependencyRefSetMembers(Date effectiveTime) { if (!moduleToReferenceComponentIds.isEmpty()) { final SnomedRegularRefSet moduleDependencyRefSet = getEditingContext().lookup(REFSET_MODULE_DEPENDENCY_TYPE, SnomedRegularRefSet.class); moduleToReferenceComponentIds.forEach(moduleToRefComp -> { final SnomedRefSetMember lastMember = moduleDependencyRefSet.getMembers() .stream() .filter(member -> moduleToRefComp.getFirst().equals(member.getModuleId()) && moduleToRefComp.getSecond().equals(member.getReferencedComponentId())) .sorted((o1, o2) -> { if (null == o1.getEffectiveTime() && null == o2.getEffectiveTime()) { return 0; } else if (null == o1.getEffectiveTime() && null != o2.getEffectiveTime()) { return 1; } else if (null != o1.getEffectiveTime() && null == o2.getEffectiveTime()) { return -1; } return o1.getEffectiveTime().compareTo(o2.getEffectiveTime()); }).reduce((first, second) -> second).orElse(null); if (lastMember instanceof SnomedModuleDependencyRefSetMember) { SnomedModuleDependencyRefSetMember dependencyRefSetMember = (SnomedModuleDependencyRefSetMember) lastMember; adjustReleased(dependencyRefSetMember); adjustEffectiveTime(dependencyRefSetMember, effectiveTime); } else { final SnomedModuleDependencyRefSetMember memberToAdd = SnomedRefSetFactory.eINSTANCE.createSnomedModuleDependencyRefSetMember(); memberToAdd.setUuid(UUID.randomUUID().toString()); memberToAdd.setActive(true); memberToAdd.setRefSet(moduleDependencyRefSet); memberToAdd.setModuleId(moduleToRefComp.getFirst()); memberToAdd.setReferencedComponentId(moduleToRefComp.getSecond()); adjustReleased(memberToAdd); adjustEffectiveTime(memberToAdd, effectiveTime); moduleDependencyRefSet.getMembers().add(memberToAdd); } }); } }
Source:
<code>static IntervalFunction of(long intervalMillis, Function<Long, Long> backoffFunction) { checkInterval(intervalMillis); requireNonNull(backoffFunction); return (attempt) -> { checkAttempt(attempt); if (attempt == 1) { return intervalMillis; <START> } else { <END> long currentIntervalMillis = intervalMillis; for(int i = 1; i < attempt; i++) { currentIntervalMillis = backoffFunction.apply(currentIntervalMillis); } return currentIntervalMillis; } }; }</code><technical_language><LINK_0></technical_language>

Target:
static IntervalFunction of(long intervalMillis, Function<Long, Long> backoffFunction) { checkInterval(intervalMillis); requireNonNull(backoffFunction); return (attempt) -> { checkAttempt(attempt); return LongStream.iterate(intervalMillis, n -> backoffFunction.apply(n)).skip(attempt - 1).findFirst().getAsLong(); }; }
Source:
<code>public void changesUpdateAttribute() throws Exception { final Bout bout = new MkBase().randomBout(); final Messages messages = bout.messages(); final Long last = bout.updated().getTime(); messages.post("hi"); <START> final Long pause = 100L; <END> Thread.sleep(pause); MatcherAssert.assertThat( bout.updated().getTime(), Matchers.greaterThan(last) ); }</code><technical_language>@dmzaytsev similar here, a variable</technical_language>

Target:
public void changesUpdateAttribute() throws Exception { final Bout bout = new MkBase().randomBout(); final Messages messages = bout.messages(); final Long last = bout.updated().getTime(); messages.post("hi"); Thread.sleep(Tv.HUNDRED); MatcherAssert.assertThat( bout.updated().getTime(), Matchers.greaterThan(last) ); }
Source:
<code>@Override protected void finalize() { <START> shutdown(true); <END> }</code><technical_language>log a serious error shutdown called, (inconsistently) cover for mistakes. ...nvm this... put log there...</technical_language>

Target:
@Override protected void finalize() { if (isStarted()) { log.warn("%s garbage-collected but shutdown() was never called. " + "Don't rely on finalizers to clean up background threads.", this.getClass().getSimpleName()); shutdown(); } }
Source:
<code>public void testValidateDataStreamsNoConflicts() { Metadata metadata = createIndices(5, 10, "foo-datastream").metadata; try { <START> validateDataStreams(metadata.getIndicesLookup(), (DataStreamMetadata) metadata.customs().get(DataStreamMetadata.TYPE)); <END> } catch (Exception e) { fail("did not expect exception when validating a system without indices that would conflict with future backing indices: " + e.getMessage()); } }</code><technical_language>Currently test fails error is stacktrace original failure, I pinpointing culprit easier? said, this is preference, feel free ignore :)</technical_language>

Target:
public void testValidateDataStreamsNoConflicts() { Metadata metadata = createIndices(5, 10, "foo-datastream").metadata; validateDataStreams(metadata.getIndicesLookup(), (DataStreamMetadata) metadata.customs().get(DataStreamMetadata.TYPE)); }
Source:
<code>public void close() throws IOException { <START> logBuilders(); <END> }</code><technical_language>I guess this method removed below. (It time flush process server log twice). option optional some system (maven) property for debugging purpose</technical_language>

Target:
public void close() throws IOException { logBuilders(); this.graph = (Graph<DefinitionSet, Node>) factoryManager.newElement(UUID.uuid(), diagramDefinitionSetClass); if (null == graph.getContent().getBounds()) { graph.getContent().setBounds(new BoundsImpl( new BoundImpl(0d, 0d), new BoundImpl(BPMNGraphFactory.GRAPH_DEFAULT_WIDTH, BPMNGraphFactory.GRAPH_DEFAULT_HEIGHT) )); } builderContext .init(graph) .execute(builderContext.getCommandFactory().clearGraph()); NodeObjectBuilder diagramBuilder = getDiagramBuilder(builderContext); if (diagramBuilder == null) { throw new RuntimeException("No diagrams found!"); } Node<View<BPMNDefinition>, Edge> diagramNode = (Node<View<BPMNDefinition>, Edge>) diagramBuilder.build(builderContext); graph.addNode(diagramNode); this.isClosed = true; }
Source:
<code>protected void init(Bundle savedInstanceState) { super.init(savedInstanceState); AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); try { CoreConfigurationBuilder builder = AnkiDroidApp.getInstance().getAcraCoreConfigBuilder(); DialogConfiguration dialogConfig = (DialogConfiguration)builder.getPluginConfigurationBuilder((DialogConfigurationBuilder.class)).build(); dialogBuilder.setIcon(dialogConfig.resIcon()); dialogBuilder.setTitle(dialogConfig.title()); dialogBuilder.setPositiveButton(dialogConfig.positiveButtonText(), AnkiDroidCrashReportDialog.this); dialogBuilder.setNegativeButton(dialogConfig.negativeButtonText(), AnkiDroidCrashReportDialog.this); } catch (ACRAConfigurationException ace) { Timber.e(ace, "Unable to initialize ACRA while creating ACRA dialog?"); } dialogBuilder.setView(buildCustomView(savedInstanceState)); <START> AlertDialog mDialog = dialogBuilder.create(); <END> mDialog.setCanceledOnTouchOutside(false); mDialog.setOnDismissListener(this); mDialog.show(); }</code><technical_language>m prefix for local variables</technical_language>

Target:
protected void init(Bundle savedInstanceState) { super.init(savedInstanceState); AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); try { CoreConfigurationBuilder builder = AnkiDroidApp.getInstance().getAcraCoreConfigBuilder(); DialogConfiguration dialogConfig = (DialogConfiguration)builder.getPluginConfigurationBuilder((DialogConfigurationBuilder.class)).build(); dialogBuilder.setIcon(dialogConfig.resIcon()); dialogBuilder.setTitle(dialogConfig.title()); dialogBuilder.setPositiveButton(dialogConfig.positiveButtonText(), AnkiDroidCrashReportDialog.this); dialogBuilder.setNegativeButton(dialogConfig.negativeButtonText(), AnkiDroidCrashReportDialog.this); } catch (ACRAConfigurationException ace) { Timber.e(ace, "Unable to initialize ACRA while creating ACRA dialog?"); } dialogBuilder.setView(buildCustomView(savedInstanceState)); AlertDialog dialog = dialogBuilder.create(); dialog.setCanceledOnTouchOutside(false); dialog.setOnDismissListener(this); dialog.show(); }