auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void getVisibleModes(List<ApplicationMode> values, Set<ApplicationMode> selected, List<ApplicationMode> visible) { if (visible.size() == 3) { for (ApplicationMode mode : selected){ if (visible.contains(mode)){ return; } } } visible.clear(); if (selected.size() > 0) { List<Integer> positions = new ArrayList<Integer>(); for (ApplicationMode mode : selected){ for (int i =0; i< values.size(); i++){ if (mode.equals(values.get(i))){ positions.add(i); } } } <START> if (positions.size() == 1) { <END> int pos = positions.get(0); if (pos < values.size() - 2 && pos > 0){ visible.add(values.get(pos - 1)); visible.add(values.get(pos)); visible.add(values.get(pos + 1)); } else if (pos == 0) { visible.add(values.get(pos)); visible.add(values.get(1)); visible.add(values.get(2)); } else if (pos == values.size() -1) { visible.add(values.get(pos - 1)); visible.add(values.get(pos - 2)); visible.add(values.get(pos)); } } else if (positions.size() == 2) { int pos1 = positions.get(0); int pos2 = positions.get(1); if (pos1 + 1 != pos2){ visible.add(values.get(pos1)); visible.add(values.get(pos1 + 1)); visible.add(values.get(pos2)); } else if (pos1 > 0 && pos1 + 1 == pos2) { visible.add(values.get(pos1 - 1)); visible.add(values.get(pos1)); visible.add(values.get(pos2)); } else if (pos1 == 0 && pos1 + 1 == pos2) { visible.add(values.get(pos1)); visible.add(values.get(pos2)); visible.add(values.get(pos2 + 1)); } } } else { for (int i =0; i<3; i++){ visible.add(values.get(i)); } } }</code><technical_language>clear</technical_language>

Target:
private static void getVisibleModes(List<ApplicationMode> values, Set<ApplicationMode> selected, List<ApplicationMode> visible) { if (visible.size() == 3) { for (ApplicationMode mode : selected){ if (visible.contains(mode)){ return; } } } visible.clear(); visible.add(ApplicationMode.DEFAULT); for (ApplicationMode mode : selected){ if (mode != ApplicationMode.DEFAULT) { visible.add(mode); break; } } for(ApplicationMode mode : values) { if (!visible.contains(mode)) { visible.add(mode); if (visible.size() == 3){ break; } } } }
Source:
<code>public InternalParquetRecordWriter( ParquetFileWriter parquetFileWriter, WriteSupport<T> writeSupport, MessageType schema, Map<String, String> extraMetaData, long rowGroupSize, int pageSize, BytesCompressor compressor, int dictionaryPageSize, boolean enableDictionary, boolean validating, WriterVersion writerVersion, ByteBufferAllocator allocator) { this.parquetFileWriter = parquetFileWriter; this.writeSupport = checkNotNull(writeSupport, "writeSupport"); this.schema = schema; this.extraMetaData = extraMetaData; this.rowGroupSize = rowGroupSize; this.rowGroupSizeThreshold = rowGroupSize; this.nextRowGroupSize = rowGroupSizeThreshold; this.pageSize = pageSize; this.compressor = compressor; this.validating = validating; this.parquetProperties = new ParquetProperties(dictionaryPageSize, writerVersion, enableDictionary); <START> this.allocator=allocator; <END> initStore(); }</code><technical_language>spaces</technical_language>

Target:
public InternalParquetRecordWriter( ParquetFileWriter parquetFileWriter, WriteSupport<T> writeSupport, MessageType schema, Map<String, String> extraMetaData, long rowGroupSize, int pageSize, BytesCompressor compressor, int dictionaryPageSize, boolean enableDictionary, boolean validating, WriterVersion writerVersion, ByteBufferAllocator allocator) { this.parquetFileWriter = parquetFileWriter; this.writeSupport = checkNotNull(writeSupport, "writeSupport"); this.schema = schema; this.extraMetaData = extraMetaData; this.rowGroupSize = rowGroupSize; this.rowGroupSizeThreshold = rowGroupSize; this.nextRowGroupSize = rowGroupSizeThreshold; this.pageSize = pageSize; this.compressor = compressor; this.validating = validating; this.parquetProperties = new ParquetProperties(dictionaryPageSize, writerVersion, enableDictionary, allocator); initStore(); }
Source:
<code><START> public void unlock(Collection<Object> lockedKeys, Object lockOwner) { <END> for (Object k : lockedKeys) { if (trace) log.tracef("Attempting to unlock key %s", toStr(k)); lockContainer.releaseLock(lockOwner, k); } }</code><technical_language>if lockedKeys collection contains byte[] of type EquivalenceSet/Map print content correctly (e.g. EquivalenceSet.toString). stick a single log.trace line printing a line for key verbose</technical_language>

Target:
public void unlock(Collection<Object> lockedKeys, Object lockOwner) { log.tracef("Attempting to unlock keys %s", lockedKeys); for (Object k : lockedKeys) lockContainer.releaseLock(lockOwner, k); }
Source:
<code>private static boolean isInContext(Pair<IErrorParserNamed, Integer> pair, int context) { <START> return (pair.second & context) == context; <END> }</code><technical_language>Simpler: (pair.second & context) != 0</technical_language>

Target:
private static boolean isInContext(Pair<IErrorParserNamed, Integer> pair, int context) { return (pair.second & context) != 0; }
Source:
<code>private void updateActionAvailability() { Disk disk = (Disk) getSelectedItem(); getNewCommand().setIsExecutionAllowed(true); getAttachCommand().setIsExecutionAllowed(true); getEditCommand().setIsExecutionAllowed(disk != null && isSingleDiskSelected() && !isDiskLocked(disk) && <START> (isVmDown() || !disk.getPlugged() || (isExtendImageSizeSupported() && isExtendImageSizeEnabled()) || getEntity().getStatus().equals(VMStatus.Paused))); <END> getRemoveCommand().setIsExecutionAllowed(atLeastOneDiskSelected() && isRemoveCommandAvailable()); getMoveCommand().setIsExecutionAllowed(atLeastOneDiskSelected() && (isMoveCommandAvailable() || isLiveMoveCommandAvailable())); updateScanAlignmentCommandAvailability(); getPlugCommand().setIsExecutionAllowed(isPlugCommandAvailable(true)); getUnPlugCommand().setIsExecutionAllowed(isPlugCommandAvailable(false)); ChangeQuotaModel.updateChangeQuotaActionAvailability(getItems() != null ? (List<Disk>) getItems() : null, getSelectedItems() != null ? (List<Disk>) getSelectedItems() : null, getSystemTreeSelectedItem(), getChangeQuotaCommand()); }</code><technical_language>getEntity() null in scenarios, this condition long frustrating, extract a method - isDiskEditable() this</technical_language>

Target:
private void updateActionAvailability() { Disk disk = (Disk) getSelectedItem(); getNewCommand().setIsExecutionAllowed(true); getAttachCommand().setIsExecutionAllowed(true); getEditCommand().setIsExecutionAllowed(disk != null && isSingleDiskSelected() && !isDiskLocked(disk) && isEnvironmentValidForDiskEdit(disk)); getRemoveCommand().setIsExecutionAllowed(atLeastOneDiskSelected() && isRemoveCommandAvailable()); getMoveCommand().setIsExecutionAllowed(atLeastOneDiskSelected() && (isMoveCommandAvailable() || isLiveMoveCommandAvailable())); updateScanAlignmentCommandAvailability(); getPlugCommand().setIsExecutionAllowed(isPlugCommandAvailable(true)); getUnPlugCommand().setIsExecutionAllowed(isPlugCommandAvailable(false)); ChangeQuotaModel.updateChangeQuotaActionAvailability(getItems() != null ? (List<Disk>) getItems() : null, getSelectedItems() != null ? (List<Disk>) getSelectedItems() : null, getSystemTreeSelectedItem(), getChangeQuotaCommand()); }
Source:
<code>public void storageDomainWithId() { b.setStorageDomainId(GUID); b.setStoragePoolId(GUID); final StorageDomain s = b.getStorageDomain(); <START> assertEquals(StorageDomainStatus.Active, s.getStatus()); <END> }</code><technical_language>comparing status actual object before</technical_language>

Target:
public void storageDomainWithId() { b.setStorageDomainId(GUID); b.setStoragePoolId(GUID); final StorageDomain s = b.getStorageDomain(); assertEquals(STORAGE_DOMAIN, s); }
Source:
<code>public HiveOrcAggregatedMemoryContext(AggregatedMemoryContext delegate) { <START> this.delegate = delegate; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
private HiveOrcAggregatedMemoryContext(AggregatedMemoryContext delegate) { this.delegate = requireNonNull(delegate, "delegate is null"); }
Source:
<code>private void resetFieldValues(MethodInvocationTree tree) { final PMap<Symbol, SymbolicValue>[] values = new PMap[]{programState.values}; programState.values.forEach(new PMap.Consumer<Symbol, SymbolicValue>() { @Override public void accept(Symbol symbol, SymbolicValue value) { if (isField(symbol)) { VariableTree variable = ((Symbol.VariableSymbol) symbol).declaration(); if (variable != null) { SymbolicValue nonNullValue = constraintManager.supersedeSymbolicValue(variable); values[0] = values[0].put(symbol, nonNullValue); } } } }); <START> if(programState.values != values [0]) { <END> programState = new ProgramState(values[0], programState.constraints, programState.visitedPoints, programState.stack); } }</code><technical_language>![MAJOR](<LINK_1> Change this comparison equals method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void resetFieldValues(MethodInvocationTree tree) { final PMap<Symbol, SymbolicValue>[] values = new PMap[]{programState.values}; programState.values.forEach(new PMap.Consumer<Symbol, SymbolicValue>() { @Override public void accept(Symbol symbol, SymbolicValue value) { if (isField(symbol)) { VariableTree variable = ((Symbol.VariableSymbol) symbol).declaration(); if (variable != null) { SymbolicValue nonNullValue = constraintManager.createSymbolicValue(variable); values[0] = values[0].put(symbol, nonNullValue); } } } }); if(programState.values != values [0]) { programState = new ProgramState(values[0], programState.constraints, programState.visitedPoints, programState.stack); } }
Source:
<code>private BiConsumer<Throwable, Object> getRetryHandler() { return (error, offendingEvent) -> { MessagingException messagingError = (MessagingException) error; RetryContext ctx = getRetryContextForEvent(messagingError.getEvent()); int retriesLeft = ctx.retryCount.getAndDecrement(); if (retriesLeft > 0) { LOGGER.error("Retrying execution of event, attempt of {}.", ctx.getRetriesLeft(), ctx.maxRetries != RETRY_COUNT_FOREVER ? ctx.maxRetries : "unlimited"); UntilSuccessfulRouter.this.delayScheduler.schedule(() -> innerRecorder.next(eventWithCurrentContext(ctx.event, ctx)), <START> ctx.delayInMillis, TimeUnit.MILLISECONDS); <END> } else { LOGGER.error("Retry attempts exhausted. Failing..."); Throwable resolvedError = getThrowableFunction(ctx.event).apply(error); eventWithCurrentContextDeleted(messagingError.getEvent()); downstreamRecorder.next(left(resolvedError, CoreEvent.class)); completeRouterIfNecessary(); } }; }</code><technical_language>static import</technical_language>

Target:
private BiConsumer<Throwable, Object> getRetryHandler() { return (error, offendingEvent) -> { MessagingException messagingError = (MessagingException) error; RetryContext ctx = getRetryContextForEvent(messagingError.getEvent()); int retriesLeft = ctx.retryCount.getAndDecrement(); if (retriesLeft > 0) { LOGGER.error("Retrying execution of event, attempt of {}.", ctx.getRetriesLeft(), ctx.maxRetries != RETRY_COUNT_FOREVER ? ctx.maxRetries : "unlimited"); UntilSuccessfulRouter.this.delayScheduler.schedule(() -> innerRecorder.next(eventWithCurrentContext(ctx.event, ctx)), ctx.delayInMillis, MILLISECONDS); } else { LOGGER.error("Retry attempts exhausted. Failing..."); Throwable resolvedError = getThrowableFunction(ctx.event).apply(error); eventWithCurrentContextDeleted(messagingError.getEvent()); downstreamRecorder.next(left(resolvedError, CoreEvent.class)); completeRouterIfNecessary(); } }; }
Source:
<code>public static void updateSearchItemQA(Context context, Map<String, String> item, Card c) { Map<String, String> qa = c._getQA(true, true); if (qa.get("q").equals("") || qa.get("a").equals("")) { HashMap<String, String> qaFull = c._getQA(true, false); if (qa.get("q").equals("")) { qa.put("q", qaFull.get("q")); } if (qa.get("a").equals("")) { qa.put("a", qaFull.get("a")); } } String q = qa.get("q"); String a = qa.get("a"); if (a.startsWith(q)) { a = a.replaceFirst(Pattern.quote(q), ""); } item.put("answer", formatQA(a)); item.put("card", c.template().optString("name")); int type = c.getType(); if (type == 0) { <START> item.put("interval","(new)"); <END> } else if (type == 1) { item.put("interval", "(learning)"); } else { item.put("interval", Utils.timeSpan(context, c.getIvl()*86400)); } item.put("lapses", Integer.toString(c.getLapses())); item.put("note", c.model().optString("name")); item.put("question", formatQA(q)); item.put("reviews", Integer.toString(c.getReps())); }</code><technical_language>hardcode strings in code. need [resources](<LINK_0> translated</technical_language>

Target:
public static void updateSearchItemQA(Context context, Map<String, String> item, Card c) { Map<String, String> qa = c._getQA(true, true); if (qa.get("q").equals("") || qa.get("a").equals("")) { HashMap<String, String> qaFull = c._getQA(true, false); if (qa.get("q").equals("")) { qa.put("q", qaFull.get("q")); } if (qa.get("a").equals("")) { qa.put("a", qaFull.get("a")); } } String q = qa.get("q"); String a = qa.get("a"); if (a.startsWith(q)) { a = a.replaceFirst(Pattern.quote(q), ""); } item.put("answer", formatQA(a)); item.put("card", c.template().optString("name")); int type = c.getType(); if (type == 0) { item.put("interval", context.getString(R.string.card_browser_interval_new_card)); } else if (type == 1) { item.put("interval", context.getString(R.string.card_browser_interval_learning_card)); } else { item.put("interval", Utils.timeSpan(context, c.getIvl()*86400)); } item.put("lapses", Integer.toString(c.getLapses())); item.put("note", c.model().optString("name")); item.put("question", formatQA(q)); item.put("reviews", Integer.toString(c.getReps())); }
Source:
<code>public void testIsAvailable() throws Exception { server.enqueue(jsonResponse("/isavailablestorageservice.json")); final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); assertEquals(storageAPI.isAvailable("TESTSTORAGE"), Availability.create("true")); assertSent(server, "POST", "/subscriptions/" + subsriptionId + <START> "/providers/Microsoft.Storage/checkNameAvailability?api-version=2015-06-15"); <END> }</code><technical_language>verify body here</technical_language>

Target:
public void testIsAvailable() throws Exception { server.enqueue(jsonResponse("/isavailablestorageservice.json")); final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); assertEquals(storageAPI.isAvailable("TESTSTORAGE"), Availability.create("true")); assertSent(server, "POST", "/subscriptions/" + subsriptionId + "/providers/Microsoft.Storage/checkNameAvailability?api-version=2015-06-15", String.format("{\"name\":\"TESTSTORAGE\",\"type\":\"Microsoft.Storage/storageAccounts\"}")); }
Source:
<code>protected void doInit() throws Exception { super.doInit(); <START> <END> setXslt(createXsltBuilder()); setProcessor(getXslt()); }</code><technical_language>do init createXsltBuilder is potentially loading resources file system done in doStart. Loading exclusively classpath is in doInit. file system in doStart</technical_language>

Target:
protected void doInit() throws Exception { super.doInit(); setXslt(createXsltBuilder()); if (ResourceHelper.isClasspathUri(resourceUri)) { loadResource(resourceUri, xslt); } setProcessor(getXslt()); }
Source:
<code><START> private static void cmd(ZipOutputStream zipStream, String[] command, String folderPath, String resFilename) <END> throws IOException, TarMalformatException { File tempFile = File.createTempFile(resFilename, null); tempFile.deleteOnExit(); Process p = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader ereader = new BufferedReader(new InputStreamReader(p.getErrorStream())); BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile)); String line = null; while ((line = reader.readLine()) != null) { writer.write(line); writer.newLine(); } if (tempFile.length() <= 0) { if (ereader != null) { while ((line = ereader.readLine()) != null) { writer.write(line); writer.newLine(); } } } writer.close(); if (tempFile.length() > 0) { ZipEntry zEntry= new ZipEntry(folderPath + resFilename); zipStream.putNextEntry(zEntry); FileInputStream in = new FileInputStream(tempFile); int len; byte[] buffer = new byte[1024]; while ((len = in.read(buffer)) > 0) { zipStream.write(buffer, 0, len); } in.close(); zipStream.closeEntry(); } }</code><technical_language>TarMalformat exception get thrown Zip? If Tar is in delete Tar code. handle exceptions Zip file is open in issues writing/reading. a test file is actively written (or deleted you) collect</technical_language>

Target:
private static void cmd(ZipOutputStream zipStream, String[] command, String folderPath, String resFilename) throws IOException, ZipException { File tempFile = File.createTempFile(resFilename, null); tempFile.deleteOnExit(); Process p = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader ereader = new BufferedReader(new InputStreamReader(p.getErrorStream())); BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile)); String line = null; while ((line = reader.readLine()) != null) { writer.write(line); writer.newLine(); } if (tempFile.length() <= 0) { if (ereader != null) { while ((line = ereader.readLine()) != null) { writer.write(line); writer.newLine(); } } } writer.close(); if (tempFile.length() > 0) { ZipEntry zEntry= new ZipEntry(folderPath + resFilename); zipStream.putNextEntry(zEntry); FileInputStream in = new FileInputStream(tempFile); int len; byte[] buffer = new byte[1024]; while ((len = in.read(buffer)) > 0) { zipStream.write(buffer, 0, len); } in.close(); zipStream.closeEntry(); } }
Source:
<code><START> public static ReadMapping jsonReadMapping() <END> { return sliceReadMapping(JSON, (resultSet, columnIndex) -> utf8Slice(resultSet.getString(columnIndex))); }</code><technical_language>private? - move method toPrestoType</technical_language>

Target:
private static ReadMapping jsonReadMapping() { return sliceReadMapping(JSON, (resultSet, columnIndex) -> jsonParse(utf8Slice(resultSet.getString(columnIndex)))); }
Source:
<code>public Response getExampleResource() { <START> log.info("getExampleResource: called"); <END> URI selfUri = fromResource(ExampleCollectionResource.class).build(); return Response.ok("There is not much to show, buddy").location(selfUri).build(); }</code><technical_language>info-level</technical_language>

Target:
public Response getExampleResource() { log.fine("getExampleResource: called"); return Response.ok("There is not much to show, buddy").build(); }
Source:
<code>public void createOneForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context) .withName("My commynity") .build(); EPerson eperson1 = EPersonBuilder.createEPerson(context) .withEmail("eperson1@mail.com") .withPassword("qwerty01") .build(); context.restoreAuthSystemState(); ObjectMapper mapper = new ObjectMapper(); ResourcePolicyRest resourcePolicyRest = new ResourcePolicyRest(); resourcePolicyRest.setPolicyType(ResourcePolicy.TYPE_SUBMISSION); resourcePolicyRest.setAction(Constants.actionText[Constants.ADMIN]); String authToken = getAuthToken(eperson1.getEmail(), "qwerty01"); getClient(authToken).perform(post("/api/authz/resourcepolicies") .content(mapper.writeValueAsBytes(resourcePolicyRest)) .param("resource", community.getID().toString()) .param("eperson", eperson1.getID().toString()) .contentType(contentType)) <START> .andExpect(status().isForbidden()); <END> }</code><technical_language>double check policy created</technical_language>

Target:
public void createOneForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context) .withName("My commynity") .build(); EPerson eperson1 = EPersonBuilder.createEPerson(context) .withEmail("eperson1@mail.com") .withPassword("qwerty01") .build(); context.restoreAuthSystemState(); ObjectMapper mapper = new ObjectMapper(); ResourcePolicyRest resourcePolicyRest = new ResourcePolicyRest(); resourcePolicyRest.setPolicyType(ResourcePolicy.TYPE_SUBMISSION); resourcePolicyRest.setAction(Constants.actionText[Constants.ADMIN]); String authToken = getAuthToken(eperson1.getEmail(), "qwerty01"); getClient(authToken).perform(post("/api/authz/resourcepolicies") .content(mapper.writeValueAsBytes(resourcePolicyRest)) .param("resource", community.getID().toString()) .param("eperson", eperson1.getID().toString()) .contentType(contentType)) .andExpect(status().isForbidden()); String authToken2 = getAuthToken(admin.getEmail(), password); getClient(authToken2).perform(get("/api/authz/resourcepolicies/search/resource") .param("uuid", community.getID().toString()) .param("action", "ADMIN")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.self.href", Matchers.containsString("api/authz/resourcepolicies/search/resource"))) .andExpect(jsonPath("$.page.totalElements", is(0))); }
Source:
<code>public int compare(final ReadEndsForMarkDuplicates lhs, final ReadEndsForMarkDuplicates rhs) { int compareDifference = lhs.libraryId - rhs.libraryId; if (useBarcodes) { <START> if (compareDifference == 0) compareDifference = compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).barcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).barcode); <END> if (compareDifference == 0) compareDifference = compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).readOneBarcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).readOneBarcode); if (compareDifference == 0) compareDifference = compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).readTwoBarcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).readTwoBarcode); } if (compareDifference == 0) compareDifference = lhs.read1ReferenceIndex - rhs.read1ReferenceIndex; if (compareDifference == 0) compareDifference = lhs.read1Coordinate - rhs.read1Coordinate; if (compareDifference == 0) compareDifference = lhs.orientation - rhs.orientation; if (compareDifference == 0) compareDifference = lhs.read2ReferenceIndex - rhs.read2ReferenceIndex; if (compareDifference == 0) compareDifference = lhs.read2Coordinate - rhs.read2Coordinate; if (compareDifference == 0) compareDifference = (int) (lhs.read1IndexInFile - rhs.read1IndexInFile); if (compareDifference == 0) compareDifference = (int) (lhs.read2IndexInFile - rhs.read2IndexInFile); return compareDifference; }</code><technical_language>cast</technical_language>

Target:
public int compare(final ReadEndsForMarkDuplicates lhs, final ReadEndsForMarkDuplicates rhs) { int compareDifference = lhs.libraryId - rhs.libraryId; if (useBarcodes) { final ReadEndsForMarkDuplicatesWithBarcodes lhsWithBarcodes = (ReadEndsForMarkDuplicatesWithBarcodes) lhs; final ReadEndsForMarkDuplicatesWithBarcodes rhsWithBarcodes = (ReadEndsForMarkDuplicatesWithBarcodes) rhs; if (compareDifference == 0) compareDifference = compareInteger(lhsWithBarcodes.barcode, rhsWithBarcodes.barcode); if (compareDifference == 0) compareDifference = compareInteger(lhsWithBarcodes.readOneBarcode, rhsWithBarcodes.readOneBarcode); if (compareDifference == 0) compareDifference = compareInteger(lhsWithBarcodes.readTwoBarcode, rhsWithBarcodes.readTwoBarcode); } if (compareDifference == 0) compareDifference = lhs.read1ReferenceIndex - rhs.read1ReferenceIndex; if (compareDifference == 0) compareDifference = lhs.read1Coordinate - rhs.read1Coordinate; if (compareDifference == 0) compareDifference = lhs.orientation - rhs.orientation; if (compareDifference == 0) compareDifference = lhs.read2ReferenceIndex - rhs.read2ReferenceIndex; if (compareDifference == 0) compareDifference = lhs.read2Coordinate - rhs.read2Coordinate; if (compareDifference == 0) compareDifference = (int) (lhs.read1IndexInFile - rhs.read1IndexInFile); if (compareDifference == 0) compareDifference = (int) (lhs.read2IndexInFile - rhs.read2IndexInFile); return compareDifference; }
Source:
<code>String getPath(ScoreBoardEventProvider p) { String path = ""; if (p.getParent() != null) { path = getPath(p.getParent()) + "."; } path = path + p.getProviderName(); <START> if (!"".equals(p.getProviderId()) && p.getProviderId() != null) { <END> path = path + "(" + p.getProviderId() + ")"; } return path; }</code><technical_language>This is a bit odd. p.getProviderId() != null && !p.getProviderId().isEmpty() I cases empty is valid</technical_language>

Target:
String getPath(ScoreBoardEventProvider p) { String path = ""; if (p.getParent() != null) { path = getPath(p.getParent()) + "."; } path = path + p.getProviderName(); if (!"".equals(p.getId()) && p.getId() != null) { path = path + "(" + p.getId() + ")"; } return path; }
Source:
<code>public void setUp() throws Exception { <START> storage = new DummyIndexedStorageUtility<Case>(Case.class, new PrototypeFactory()); <END> owner = "owner"; otherOwner = "otherowner"; groupOwner = "groupowned"; userOwned = new Vector<String>(); userOwned.addElement(owner); groupOwned = new Vector<String>(); groupOwned.addElement(owner); groupOwned.addElement(groupOwner); a = new Case("123", "a"); a.setCaseId("a"); a.setUserId(owner); a.setID(12345); b = new Case("b", "b"); b.setCaseId("b"); b.setUserId(owner); c = new Case("c", "c"); c.setCaseId("c"); c.setUserId(owner); d = new Case("d", "d"); d.setCaseId("d"); d.setUserId(owner); e = new Case("e", "e"); e.setCaseId("e"); e.setUserId(groupOwner); l = new Ledger("ledger_entity_id"); l.setID(12345); l.setEntry("test_section_id", "test_entry_id", 2345); }</code><technical_language>storage unused, creating a new DummyIndexStorageUtility instance side-effects needed here</technical_language>

Target:
public void setUp() throws Exception { owner = "owner"; groupOwner = "groupowned"; userOwned = new Vector<String>(); userOwned.addElement(owner); groupOwned = new Vector<String>(); groupOwned.addElement(owner); groupOwned.addElement(groupOwner); a = new Case("123", "a"); a.setCaseId("a"); a.setUserId(owner); a.setID(12345); b = new Case("b", "b"); b.setCaseId("b"); b.setUserId(owner); c = new Case("c", "c"); c.setCaseId("c"); c.setUserId(owner); d = new Case("d", "d"); d.setCaseId("d"); d.setUserId(owner); e = new Case("e", "e"); e.setCaseId("e"); e.setUserId(groupOwner); l = new Ledger("ledger_entity_id"); l.setID(12345); l.setEntry("test_section_id", "test_entry_id", 2345); }
Source:
<code>public PhysicalOperation visitTableWriter(TableWriterNode node, LocalExecutionPlanContext context) { if (node.getPartitioningScheme().isPresent()) { context.setDriverInstanceCount(1); } else { context.setDriverInstanceCount(getTaskWriterCount(session)); } PhysicalOperation source = node.getSource().accept(this, context); List<Integer> inputChannels = node.getColumns().stream() .map(source::symbolToChannel) .collect(toImmutableList()); OperatorFactory operatorFactory = new TableWriterOperatorFactory( context.getNextOperatorId(), node.getId(), pageSinkManager, node.getTarget(), inputChannels, session); <START> Map<Symbol, Integer> layout = IntStream.range(0, node.getOutputSymbols().size()).boxed() <END> .collect(toImmutableMap(i -> node.getOutputSymbols().get(i), i -> i)); return new PhysicalOperation(operatorFactory, layout, context, source); }</code><technical_language>this is tableWriterNodes more outputs</technical_language>

Target:
public PhysicalOperation visitTableWriter(TableWriterNode node, LocalExecutionPlanContext context) { if (node.getPartitioningScheme().isPresent()) { context.setDriverInstanceCount(1); } else { context.setDriverInstanceCount(getTaskWriterCount(session)); } PhysicalOperation source = node.getSource().accept(this, context); ImmutableMap.Builder<Symbol, Integer> outputMapping = ImmutableMap.builder(); outputMapping.put(node.getOutputSymbols().get(0), 0); outputMapping.put(node.getOutputSymbols().get(1), 1); OperatorFactory statisticsAggregation = node.getStatisticsAggregation().map(aggregation -> { List<Symbol> groupingSymbols = aggregation.getGroupingSymbols(); if (groupingSymbols.isEmpty()) { return createAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), PARTIAL, 2, outputMapping, source, context); } else { return createHashAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), ImmutableList.of(groupingSymbols), groupingSymbols, PARTIAL, Optional.empty(), Optional.empty(), source, false, false, false, new DataSize(0, BYTE), context, 2, outputMapping); } }).orElse(new NoOpOperatorFactory(context.getNextOperatorId(), node.getId())); List<Integer> inputChannels = node.getColumns().stream() .map(source::symbolToChannel) .collect(toImmutableList()); OperatorFactory operatorFactory = new TableWriterOperatorFactory( context.getNextOperatorId(), node.getId(), pageSinkManager, node.getTarget(), inputChannels, session, statisticsAggregation, getSymbolTypes(node.getOutputSymbols(), context.getTypes())); return new PhysicalOperation(operatorFactory, outputMapping.build(), context, source); }
Source:
<code>private String getSessionPrefix(List<MetricNameDto> metricNameDtoList) { Set<String> sessionIds = new HashSet<String>(); for (MetricNameDto metricNameDto : metricNameDtoList) { sessionIds.addAll(metricNameDto.getTest().getSessionIds()); } <START> Joiner joiner = Joiner.on(", "); <END> return joiner.join(sessionIds); }</code><technical_language>commas in file name? '_'</technical_language>

Target:
private String getSessionPrefix(List<MetricNameDto> metricNameDtoList) { Set<String> sessionIds = new HashSet<String>(); for (MetricNameDto metricNameDto : metricNameDtoList) { sessionIds.addAll(metricNameDto.getTest().getSessionIds()); } Joiner joiner = Joiner.on("_"); return joiner.join(sessionIds); }
Source:
<code>protected void updateVmPayload() { <START> VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDAO(); <END> VmPayload payload = getParameters().getVmStaticData().getVmPayload(); if (payload != null) { List<VmDevice> disks = new ArrayList(dao.getVmDeviceByVmIdAndType(getVmId(), VmDeviceType.DISK.getName())); VmDevice oldPayload = null; for (VmDevice disk: disks) { if (VmPayload.IsPayload(disk.getSpecParams())) { oldPayload = disk; break; } } if (oldPayload != null) { List devs = new ArrayList<VmDeviceId>(); devs.add(oldPayload.getId()); dao.removeAll(devs); } VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), getVmId()), VmDeviceType.DISK, payload.getType(), payload.getSpecParams(), true, true); } }</code><technical_language>please replace with: VmDeviceDAO dao = getVmDeviceDao();</technical_language>

Target:
protected void updateVmPayload() { VmDeviceDAO dao = getVmDeviceDao(); VmPayload payload = getParameters().getVmStaticData().getVmPayload(); if (payload != null) { List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getVmId(), VmDeviceType.DISK.getName()); VmDevice oldPayload = null; for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { oldPayload = disk; break; } } if (oldPayload != null) { List<VmDeviceId> devs = new ArrayList<VmDeviceId>(); devs.add(oldPayload.getId()); dao.removeAll(devs); } VmDeviceUtils.addManagedDevice(new VmDeviceId(Guid.NewGuid(), getVmId()), VmDeviceType.DISK, payload.getType(), payload.getSpecParams(), true, true); } }
Source:
<code>private static Object iterateCompare(long startTime, long endTime, ISegmentStore<@NonNull ISegment> store, @NonNull Comparator<@NonNull ISegment> comparator) { Object shutupCompilerWarnings = null; for (ISegment elem : store.getIntersectingElements((endTime - startTime) / 2, comparator)) { shutupCompilerWarnings = elem; } <START> return shutupCompilerWarnings; <END> }</code><technical_language>I LOVE THIS</technical_language>

Target:
private static Object iterateCompare(long startTime, long endTime, ISegmentStore<@NonNull ISegment> store, @NonNull Comparator<@NonNull ISegment> comparator) { Object shutupCompilerWarnings = null; for (ISegment elem : store.getIntersectingElements(startTime, endTime, comparator)) { shutupCompilerWarnings = elem; } return shutupCompilerWarnings; }
Source:
<code>protected BaseEditVmInterfaceModel(VmBase vm, <START> VMStatus vmStatus, Guid dcId, <END> Version clusterCompatibilityVersion, ArrayList<VmNetworkInterface> vmNicList, VmNetworkInterface nic, EntityModel sourceModel) { super(vm, dcId, clusterCompatibilityVersion, vmNicList, sourceModel, new EditProfileBehavior()); this.nic = nic; this.vmStatus = vmStatus; setTitle(ConstantsManager.getInstance().getConstants().editNetworkInterfaceTitle()); setHashName("edit_network_interface_vms"); }</code><technical_language>Please format for uniformity, i.e. argument line. a formatter part of git repository, plug IDE do job for you</technical_language>

Target:
protected BaseEditVmInterfaceModel(VmBase vm, VMStatus vmStatus, Guid dcId, Version clusterCompatibilityVersion, ArrayList<VmNetworkInterface> vmNicList, VmNetworkInterface nic, EntityModel sourceModel) { super(vm, vmStatus, dcId, clusterCompatibilityVersion, vmNicList, sourceModel, new EditProfileBehavior()); this.nic = nic; setTitle(ConstantsManager.getInstance().getConstants().editNetworkInterfaceTitle()); setHashName("edit_network_interface_vms"); }
Source:
<code>private AllocateResponse sendContainerAskToRM(List<ContainerRequest> containerRequests, List<ContainerRequest> removedContainerRequests, List<ContainerId> releasedContainers) throws YarnException, IOException { if (removedContainerRequests.size() > 0) { <START> LOG.debug("Removing container request: " + removedContainerRequests); <END> for (ContainerRequest cr : removedContainerRequests) { amRmClient.removeContainerRequest(cr); } } if (containerRequests.size() > 0) { LOG.debug("Asking RM for containers: " + containerRequests); for (ContainerRequest cr : containerRequests) { amRmClient.addContainerRequest(cr); } } for (ContainerId containerId : releasedContainers) { LOG.info("Released container, id={}", containerId.getId()); amRmClient.releaseAssignedContainer(containerId); } for (String containerIdStr : dnmgr.containerStopRequests.values()) { AllocatedContainer allocatedContainer = this.allocatedContainers.get(containerIdStr); if (allocatedContainer != null && !allocatedContainer.stopRequested) { nmClient.stopContainerAsync(allocatedContainer.container.getId(), allocatedContainer.container.getNodeId()); LOG.info("Requested stop container {}", containerIdStr); allocatedContainer.stopRequested = true; } dnmgr.containerStopRequests.remove(containerIdStr); } return amRmClient.allocate(0); }</code><technical_language>sl4j logging</technical_language>

Target:
private AllocateResponse sendContainerAskToRM(List<ContainerRequest> containerRequests, List<ContainerRequest> removedContainerRequests, List<ContainerId> releasedContainers) throws YarnException, IOException { if (removedContainerRequests.size() > 0) { LOG.debug("Removing container request: {}", removedContainerRequests); for (ContainerRequest cr : removedContainerRequests) { amRmClient.removeContainerRequest(cr); } } if (containerRequests.size() > 0) { LOG.debug("Asking RM for containers: {}", containerRequests); for (ContainerRequest cr : containerRequests) { amRmClient.addContainerRequest(cr); } } for (ContainerId containerId : releasedContainers) { LOG.info("Released container, id={}", containerId.getId()); amRmClient.releaseAssignedContainer(containerId); } for (String containerIdStr : dnmgr.containerStopRequests.values()) { AllocatedContainer allocatedContainer = this.allocatedContainers.get(containerIdStr); if (allocatedContainer != null && !allocatedContainer.stopRequested) { nmClient.stopContainerAsync(allocatedContainer.container.getId(), allocatedContainer.container.getNodeId()); LOG.info("Requested stop container {}", containerIdStr); allocatedContainer.stopRequested = true; } dnmgr.containerStopRequests.remove(containerIdStr); } return amRmClient.allocate(0); }
Source:
<code>public void stopShouldDisconnectFromGoogleApiIfConnected_andAlwaysCallOnClientStopIfListenerSet() { TestClientListener testClientListener = new TestClientListener(); client.setListener(testClientListener); when(googleApiClient.isConnected()).thenReturn(true); client.stop(); verify(googleApiClient).disconnect(); <START> assertThat(testClientListener.getOnClientStopCount(), is(1)); <END> testClientListener.reset(); doAnswer(new OnDisconnectedAnswer()).when(googleApiClient).disconnect(); client.stop(); assertThat(testClientListener.getOnClientStopCount(), is(1)); testClientListener.reset(); when(googleApiClient.isConnected()).thenReturn(false); client.stop(); assertThat(testClientListener.getOnClientStopCount(), is(1)); }</code><technical_language>easier Mockito for this listener verification</technical_language>

Target:
public void stopShouldDisconnectFromGoogleApiIfConnected_andAlwaysCallOnClientStopIfListenerSet() { LocationClient.LocationClientListener listener = mock(LocationClient.LocationClientListener.class); client.setListener(listener); when(googleApiClient.isConnected()).thenReturn(true); client.stop(); verify(googleApiClient).disconnect(); verify(listener).onClientStop(); reset(listener); doAnswer(new OnDisconnectedAnswer()).when(googleApiClient).disconnect(); client.stop(); verify(listener).onClientStop(); reset(listener); when(googleApiClient.isConnected()).thenReturn(false); client.stop(); verify(listener).onClientStop(); }
Source:
<code>public TabbarArrangeMenuManager(IDiagramWorkbenchPart iDiagramWorkbenchPart) { this.representationPart = iDiagramWorkbenchPart; <START> EclipseUIUtil.getActivePage().addSelectionListener(this); <END> }</code><technical_language>I add selection listener part if possible</technical_language>

Target:
public TabbarArrangeMenuManager(IDiagramWorkbenchPart iDiagramWorkbenchPart) { this.representationPart = iDiagramWorkbenchPart; ISelectionService selectionService = (ISelectionService) representationPart.getSite().getService(ISelectionService.class); if (selectionService != null) { selectionService.addSelectionListener(this); } }
Source:
<code>public void before() { account = mock(Account.class); when(account.getDescription()).thenReturn("account"); folder = "folder"; errorMessage = "errorMessage"; message = mock(Message.class); <START> count = 1; <END> activityListener = new ActivityListener(); }</code><technical_language>folder, errorMessage count reassigned. Please constants instead of fields in cases</technical_language>

Target:
public void before() { when(ACCOUNT.getDescription()).thenReturn("account"); activityListener = new ActivityListener(); context = RuntimeEnvironment.application; }
Source:
<code>public TextAnnotation runNER(String s) { TextAnnotationBuilder tab; boolean splitOnHyphens = false; tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnHyphens)); TextAnnotation ta = tab.createTextAnnotation("001", "001", s); NERAnnotator co; try { <START> co = new NERAnnotator(ViewNames.NER_CONLL); <END> co.doInitialize(); co.addView(ta); } catch (IOException e) { e.printStackTrace(); } return ta; }</code><technical_language>co.getView() instead, calls doInitialize()</technical_language>

Target:
public TextAnnotation runNER(String s) { TextAnnotationBuilder tab; boolean splitOnHyphens = false; tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnHyphens)); TextAnnotation ta = tab.createTextAnnotation("001", "001", s); try { co.getView(ta); } catch (Exception e) { e.printStackTrace(); } return ta; }
Source:
<code>public void updateStockPrice(String symbol, double newPrice) throws StockMarketExpection { if (getStockForSymbol(symbol) == null) { throw new StockMarketExpection("Stock not present (" + symbol + ")"); } if (newPrice < 0.0) { throw new StockMarketExpection( "Stock price cannot be set to a negative value (" + symbol + ", " + getStockForSymbol(symbol).getPrice() + ") -> " + newPrice + " X Not Allowed "); } Stock <START> s = <END> removeStockFromStockList(symbol); s.setPrice(newPrice); addStock(s); }</code><technical_language>Variable name is descriptive. change stock</technical_language>

Target:
public void updateStockPrice(String symbol, double newPrice) throws StockMarketExpection { if (getStockForSymbol(symbol) == null) { throw new StockMarketExpection("Stock not present (" + symbol + ")"); } if (newPrice < 0.0) { throw new StockMarketExpection( "Stock price cannot be set to a negative value (" + symbol + ", " + getStockForSymbol(symbol).getPrice() + ") -> " + newPrice + " X Not Allowed "); } Stock stock = removeStockFromList(symbol); stock.setPrice(newPrice); addStock(stock); }
Source:
<code>protected AbstractIntegrationMessageBuilder<Object> doReceive() { Connection connection = this.connectionFactory.createConnection(); Channel channel = connection.createChannel(this.transacted); try { GetResponse resp = channel.basicGet(this.queue, false); if (resp == null) { RabbitUtils.closeChannel(channel); RabbitUtils.closeConnection(connection); return null; } AcknowledgmentCallback callback = this.ackCallbackFactory .createCallback(new AmqpAckInfo(connection, channel, resp)); MessageProperties messageProperties = this.propertiesConverter.toMessageProperties(resp.getProps(), resp.getEnvelope(), StandardCharsets.UTF_8.name()); Map<String, Object> headers = this.headerMapper.toHeadersFromRequest(messageProperties); Object payload = this.messageConverter .fromMessage(new org.springframework.amqp.core.Message(resp.getBody(), messageProperties)); return getMessageBuilderFactory().withPayload(payload) .copyHeaders(headers) .setHeader(IntegrationMessageHeaderAccessor.ACKNOWLEDGMENT_CALLBACK, callback); } catch (IOException e) { RabbitUtils.closeChannel(channel); <START> RabbitUtils.closeConnection(connection); <END> } return null; }</code><technical_language>OK. exception. catch it, close resources return null. Is exception? re-throw</technical_language>

Target:
protected AbstractIntegrationMessageBuilder<Object> doReceive() { Connection connection = this.connectionFactory.createConnection(); Channel channel = connection.createChannel(this.transacted); try { GetResponse resp = channel.basicGet(this.queue, false); if (resp == null) { RabbitUtils.closeChannel(channel); RabbitUtils.closeConnection(connection); return null; } AcknowledgmentCallback callback = this.ackCallbackFactory .createCallback(new AmqpAckInfo(connection, channel, this.transacted, resp)); MessageProperties messageProperties = this.propertiesConverter.toMessageProperties(resp.getProps(), resp.getEnvelope(), StandardCharsets.UTF_8.name()); Map<String, Object> headers = this.headerMapper.toHeadersFromRequest(messageProperties); Object payload = this.messageConverter .fromMessage(new org.springframework.amqp.core.Message(resp.getBody(), messageProperties)); return getMessageBuilderFactory().withPayload(payload) .copyHeaders(headers) .setHeader(IntegrationMessageHeaderAccessor.ACKNOWLEDGMENT_CALLBACK, callback); } catch (IOException e) { RabbitUtils.closeChannel(channel); RabbitUtils.closeConnection(connection); throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }
Source:
<code><START> public ZKDistributedNonblockingLock(LockScope scope, String zkAddress, Long leaseTimeout, <END> String lockMsg, String userId, int priority, long waitingTimeout, long cleanupTimeout, boolean isForceful, LockListener lockListener) { this(scope.getPath(), leaseTimeout, lockMsg, userId, priority, waitingTimeout, cleanupTimeout, isForceful, lockListener, new ZkBaseDataAccessor<ZNRecord>(zkAddress)); }</code><technical_language>leaseTimeout need Long boxing. long is fine? And, list of params, wow... params :) encapsulate some of params object, eg. ZkDistributedLockProperties ZkDistributedLockConfig</technical_language>

Target:
private ZKDistributedNonblockingLock(LockScope scope, String zkAddress, Long leaseTimeout, String lockMsg, String userId, int priority, long waitingTimeout, long cleanupTimeout, boolean isForceful, LockListener lockListener) { this(scope.getPath(), leaseTimeout, lockMsg, userId, priority, waitingTimeout, cleanupTimeout, isForceful, lockListener, new ZkBaseDataAccessor<ZNRecord>(zkAddress)); }
Source:
<code>public void readCacheStorageTest() { <START> CacheStorageImpl cache = new CacheStorageImpl(); <END> final Map<Identifier, OperatorState> queryState1= new HashMap<>(); queryState1.put(oid1, value1); queryState1.put(oid2, value2); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(value2, cache.read(qid1, oid2)); Assert.assertSame(null, cache.read(qid1, oid3)); Assert.assertSame(null, cache.read(qid2, oid1)); Assert.assertSame(null, cache.read(qid2, oid3)); }</code><technical_language>final</technical_language>

Target:
public void readCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); queryState1.put(oid1, value1); queryState1.put(oid2, value2); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(value2, cache.read(qid1, oid2)); Assert.assertSame(null, cache.read(qid1, oid3)); Assert.assertSame(null, cache.read(qid2, oid1)); Assert.assertSame(null, cache.read(qid2, oid3)); }
Source:
<code>private static void checkLfs() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean hidden = !store.getBoolean(UIPreferences.SHOW_LFS_CONFIG_CONFIRMATION); boolean auto = store.getBoolean(UIPreferences.LFS_AUTO_CONFIGURATION); if ((auto || !hidden) && !isLfsConfigured()) { Callable<?> installer; try { installer = (Callable<?>) Class.forName("org.eclipse.jgit.lfs.InstallLfsCommand").newInstance(); } catch(Exception e) { return; } int index = (auto && hidden) ? 0 : <START> MessageDialog.open(MessageDialog.QUESTION, <END> null, UIText.ConfigurationChecker_installLfsTitle, UIText.ConfigurationChecker_installLfsMessage, SWT.NONE, UIText.ConfigurationChecker_installLfsYes, UIText.ConfigurationChecker_installLfsNo, UIText.ConfigurationChecker_installLfsDontAsk); switch (index) { case 0: try { installer.call(); } catch (Exception e) { Activator.handleIssue(IStatus.WARNING, UIText.ConfigurationChecker_installLfsCannotInstall, e, true); } break; case 2: store.setValue(UIPreferences.SHOW_LFS_CONFIG_CONFIRMATION, false); try { InstanceScope.INSTANCE.getNode(Activator.getPluginId()) .flush(); } catch (BackingStoreException e) { } break; } } }</code><technical_language>Eek, this API is new. is this done "normally"</technical_language>

Target:
private static void checkLfs() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); boolean hidden = !store.getBoolean(UIPreferences.SHOW_LFS_CONFIG_CONFIRMATION); boolean auto = store.getBoolean(UIPreferences.LFS_AUTO_CONFIGURATION); if ((auto || !hidden) && !isLfsConfigured()) { Callable<?> installer; try { installer = (Callable<?>) Class.forName("org.eclipse.jgit.lfs.InstallLfsCommand").newInstance(); } catch(Exception e) { return; } int index = (auto && hidden) ? 0 : confirmLfsInstall(); switch (index) { case 0: try { installer.call(); } catch (Exception e) { Activator.handleIssue(IStatus.WARNING, UIText.ConfigurationChecker_installLfsCannotInstall, e, true); } break; case 2: store.setValue(UIPreferences.SHOW_LFS_CONFIG_CONFIRMATION, false); try { InstanceScope.INSTANCE.getNode(Activator.getPluginId()) .flush(); } catch (BackingStoreException e) { } break; } } }
Source:
<code>protected String getOutputStream(String commandId) { String outputStream = EXPOSE_BLOB_STREAM; BulkCommand command = Framework.getService(BulkService.class).getCommand(commandId); if (command != null) { if (command.getParam(SORT_PARAMETER) != null) { sort = command.getParam(SORT_PARAMETER); } if (command.getParam(ZIP_PARAMETER) != null) { <START> zip = command.getParam(ZIP_PARAMETER); <END> } } if (sort) { outputStream = SORT_STREAM; } else if (zip) { outputStream = ZIP_STREAM; } return outputStream; }</code><technical_language>sort zip local variable fields</technical_language>

Target:
protected String getOutputStream(String commandId) { String outputStream = EXPOSE_BLOB_STREAM; BulkCommand command = Framework.getService(BulkService.class).getCommand(commandId); boolean sort = true; boolean zip = false; if (command != null) { if (command.getParam(SORT_PARAMETER) != null) { sort = command.getParam(SORT_PARAMETER); } if (command.getParam(ZIP_PARAMETER) != null) { zip = command.getParam(ZIP_PARAMETER); } } if (sort) { outputStream = SORT_STREAM; } else if (zip) { outputStream = ZIP_STREAM; } return outputStream; }
Source:
<code><START> public void purgeCondition(Condition condition) throws APIException { <END> conditionDAO.deleteCondition(condition); }</code><technical_language>pointless include throws clause APIException is a runtime exception need caught</technical_language>

Target:
public void purgeCondition(Condition condition) { conditionDAO.deleteCondition(condition); }