auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testBasic() throws HttpException, IOException { <START> ResteasyClient client = new ResteasyClientBuilderImpl().build(); <END> ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/")); BasicResource br = target.proxy(BasicResource.class); Assert.assertEquals("org/jboss/resteasy/springmvc/test", br.getBasicString()); Assert.assertEquals("something", br.getBasicObject().getSomething()); Assert.assertEquals("Hi, I'm custom!", br.getSpringMvcValue()); Assert.assertEquals(1, br.getSingletonCount().intValue()); Assert.assertEquals(2, br.getSingletonCount().intValue()); Assert.assertEquals(1, br.getPrototypeCount().intValue()); Assert.assertEquals(1, br.getPrototypeCount().intValue()); Assert.assertEquals("text/plain", br.getContentTypeHeader()); Integer interceptorCount = br .getSpringInterceptorCount("afterCompletion"); Assert.assertEquals(new Integer(8), interceptorCount); Assert.assertEquals("text/plain", br.getContentTypeHeader()); Assert.assertEquals("springSomething", br.testSpringXml().getSomething()); }</code><technical_language>client is closed; do end of test or, better, in @After annotated method</technical_language>

Target:
public void testBasic() throws HttpException, IOException { ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/")); BasicResource br = target.proxy(BasicResource.class); Assert.assertEquals("org/jboss/resteasy/springmvc/test", br.getBasicString()); Assert.assertEquals("something", br.getBasicObject().getSomething()); Assert.assertEquals("Hi, I'm custom!", br.getSpringMvcValue()); Assert.assertEquals(1, br.getSingletonCount().intValue()); Assert.assertEquals(2, br.getSingletonCount().intValue()); Assert.assertEquals(1, br.getPrototypeCount().intValue()); Assert.assertEquals(1, br.getPrototypeCount().intValue()); Assert.assertEquals("text/plain", br.getContentTypeHeader()); Integer interceptorCount = br .getSpringInterceptorCount("afterCompletion"); Assert.assertEquals(new Integer(8), interceptorCount); Assert.assertEquals("text/plain", br.getContentTypeHeader()); Assert.assertEquals("springSomething", br.testSpringXml().getSomething()); }
Source:
<code>public void test(TestHarness th) { this.th = th; try { testBasicHttpsConnection(); <START> } catch (Exception e) { <END> th.todo(false, "Unexpected exception: " + e); e.printStackTrace(); } }</code><technical_language>catch IOException, miss other errors</technical_language>

Target:
public void test(TestHarness th) { this.th = th; try { testBasicHttpsConnection(); } catch (IOException e) { th.todo(false, "Unexpected exception: " + e); e.printStackTrace(); } }
Source:
<code>public void throwIfBoxPositionIsFilled(Boxable boxable) throws IOException { if (boxable.getBox() == null || boxable.getBoxPosition() == null) return; Box box = get(boxable.getBox().getId()); BoxableView boxableView = box.getBoxable(boxable.getBoxPosition()); if (boxableView == null) return; <START> if (boxableView.getId().getTargetId() != boxable.getId()) { <END> throw new IllegalArgumentException("Box position '" + boxable.getBoxPosition() + "' in box '" + box.getAlias() + "' is not empty"); } }</code><technical_language>check target type LIB123 occupy position SAM123</technical_language>

Target:
public void throwIfBoxPositionIsFilled(Boxable boxable) throws IOException { if (boxable.getBox() == null || boxable.getBoxPosition() == null) return; Box box = get(boxable.getBox().getId()); BoxableView boxableView = box.getBoxable(boxable.getBoxPosition()); if (boxableView == null) return; if (!(boxableView.getId().getTargetId() == boxable.getId() && boxableView.getId().getTargetType() == boxable.getEntityType())) { throw new IllegalArgumentException("Box position '" + boxable.getBoxPosition() + "' in box '" + box.getAlias() + "' is not empty"); } }
Source:
<code>private void checkUsage(Tree tree) { <START> if (tree.getParent().is(Tree.Kind.FUNCTION_CALL, Tree.Kind.ASSIGNMENT, Tree.Kind.ASSIGNMENT_BY_REFERENCE) && <END> !isArgumentOfSafeFunctionCall(tree)) { context().newIssue(this, tree, MESSAGE); } }</code><technical_language>other cases STDIN is referenced issue raised</technical_language>

Target:
private void checkUsage(Tree tree) { Tree parent = tree.getParent(); if (!(parent instanceof BinaryExpressionTree) && !(parent instanceof UnaryExpressionTree) && !isArgumentOfSafeFunctionCall(tree)) { context().newIssue(this, tree, MESSAGE); } }
Source:
<code>public void run() { if (job == null) { return; } for (SCMPollingDecisionHandler handler : SCMPollingDecisionHandler.all()) { if (!handler.shouldPoll(job)) { <START> LOGGER.log(Level.FINE, "Skipping polling for {0} due to veto from {1}", <END> new Object[]{job.getFullDisplayName(), handler} ); return; } } String threadName = Thread.currentThread().getName(); Thread.currentThread().setName("SCM polling for "+job); try { startTime = System.currentTimeMillis(); if(runPolling()) { SCMTriggerItem p = job(); String name = " #"+p.getNextBuildNumber(); SCMTriggerCause cause; try { cause = new SCMTriggerCause(getLogFile()); } catch (IOException e) { LOGGER.log(WARNING, "Failed to parse the polling log",e); cause = new SCMTriggerCause(); } Action[] queueActions = new Action[additionalActions.length + 1]; queueActions[0] = new CauseAction(cause); System.arraycopy(additionalActions, 0, queueActions, 1, additionalActions.length); if (p.scheduleBuild2(p.getQuietPeriod(), queueActions) != null) { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Triggering "+name); } else { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Job is already in the queue"); } } } finally { Thread.currentThread().setName(threadName); } }</code><technical_language>this in listener (as well), is in SCM polling log? A user is expecting job run admin of system access main jenkins logs fact decided project poll..</technical_language>

Target:
public void run() { if (job == null) { return; } SCMDecisionHandler veto = SCMDecisionHandler.firstShouldPollVeto(job); if (veto != null) { try (StreamTaskListener listener = new StreamTaskListener(getLogFile())) { listener.getLogger().println( "Skipping polling on " + DateFormat.getDateTimeInstance().format(new Date()) + " due to veto from " + veto); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to record SCM polling for " + job, e); } LOGGER.log(Level.FINE, "Skipping polling for {0} due to veto from {1}", new Object[]{job.getFullDisplayName(), veto} ); return; } String threadName = Thread.currentThread().getName(); Thread.currentThread().setName("SCM polling for "+job); try { startTime = System.currentTimeMillis(); if(runPolling()) { SCMTriggerItem p = job(); String name = " #"+p.getNextBuildNumber(); SCMTriggerCause cause; try { cause = new SCMTriggerCause(getLogFile()); } catch (IOException e) { LOGGER.log(WARNING, "Failed to parse the polling log",e); cause = new SCMTriggerCause(); } Action[] queueActions = new Action[additionalActions.length + 1]; queueActions[0] = new CauseAction(cause); System.arraycopy(additionalActions, 0, queueActions, 1, additionalActions.length); if (p.scheduleBuild2(p.getQuietPeriod(), queueActions) != null) { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Triggering "+name); } else { LOGGER.info("SCM changes detected in "+ job.getFullDisplayName()+". Job is already in the queue"); } } } finally { Thread.currentThread().setName(threadName); } }
Source:
<code>public void calculatorReturnsManyTablesWithHighestPriority_thenProviderReturnsOneOfThose() { givenPriority(table("table1"), 0.0); givenPriority(table("table2"), 30.0); givenPriority(table("table3"), 30.0); givenPriority(table("table4"), 30.0); givenPriority(table("table5"), 10.0); whenGettingNextTableToSweep(); Assert.assertTrue(tableToSweep.isPresent()); Assert.assertThat(tableToSweep.get(), CoreMatchers.anyOf( CoreMatchers.is(table("table2")), CoreMatchers.is(table("table3")), CoreMatchers.is(table("table4")))); <START> } <END></code><technical_language>nit: static import Hamcrest matchers (you'll want Matchers.anyOf(...) instead of CoreMatchers.anyOf(...), baseline unhappy). Thanks for tests, a lot of sense. I remember another internal product I wrote some tests I ran select 10K 100K times checked of relevant tables selected once, overkill is nonblocking (in hopes of ensuring starvation avoided)</technical_language>

Target:
public void calculatorReturnsManyTablesWithHighestPriority_thenProviderReturnsOneOfThose() { givenPriority(table("table1"), 0.0); givenPriority(table("table2"), 30.0); givenPriority(table("table3"), 30.0); givenPriority(table("table4"), 30.0); givenPriority(table("table5"), 10.0); whenGettingNextTableToSweep(); Assert.assertTrue(tableToSweep.isPresent()); Assert.assertThat(tableToSweep.get(), anyOf(is(table("table2")), is(table("table3")), is(table("table4")))); }
Source:
<code>private static Integer intLiteralValue(LiteralTree literal) { String literalValue = literal.value().replaceAll("_", ""); if (literalValue.startsWith("0b") || literalValue.startsWith("0B")) { String binaryWithoutPrefix = literalValue.substring(2); if (binaryWithoutPrefix.length() >= 32 && binaryWithoutPrefix.charAt(0) == '1') { return Integer.parseUnsignedInt(binaryWithoutPrefix, 2); } <START> return Integer.valueOf(binaryWithoutPrefix, 2); <END> } return Long.decode(literalValue).intValue(); }</code><technical_language>work this valid java integer literal 0b0000_1111_1111_1111_1111_0000_0000_0000_0000 I Integer.parseUnsignedInt for literalValue stating 0b, test length() >= 32 && charAt(0) == '1' useless</technical_language>

Target:
private static Integer intLiteralValue(LiteralTree literal) { String literalValue = literal.value().replaceAll("_", ""); if (literalValue.startsWith("0b") || literalValue.startsWith("0B")) { return Integer.parseUnsignedInt(literalValue.substring(2), 2); } return Long.decode(literalValue).intValue(); }
Source:
<code>public double getLocationRatio(ITmfLocation location) { long size = fFile.length() - fDataOffset; long pos; try { <START> pos = fFileInput.getChannel().position() - fDataOffset; <END> } catch (IOException e) { pos = 0; } return 1.0 / size * pos; }</code><technical_language>do .getFilePointer() .getChannel().position()? do thing</technical_language>

Target:
public double getLocationRatio(ITmfLocation location) { long size = fFile.length() - fDataOffset; long pos; try { pos = fFileInput.getFilePointer() - fDataOffset; } catch (IOException e) { pos = 0; } return 1.0 / size * pos; }
Source:
<code>private void showDefaultValues() { interestRatePerPeriod = mLoanTemplate.getInterestRatePerPeriod(); <START> loanTermFrequency = mLoanTemplate.getInterestRateFrequencyType().getId(); <END> termFrequency = mLoanTemplate.getTermFrequency(); etPrincipal.setText(String.valueOf(mLoanTemplate.getPrincipal().toString())); etNumberOfRepayments.setText(String.valueOf( mLoanTemplate.getNumberOfRepayments().toString())); tvNominalRatePerYearMonth .setText(mLoanTemplate.getInterestRateFrequencyType().getValue()); etNominalInterestRate.setText(String.valueOf( mLoanTemplate.getInterestRatePerPeriod().toString())); etLoanTerm.setText(String.valueOf(termFrequency.toString())); if (mLoanTemplate.getRepaymentEvery() != null) { repaymentEvery = mLoanTemplate.getRepaymentEvery(); etRepaidEvery.setText(String.valueOf(repaymentEvery.toString())); } if (mLoanTemplate.getFundId() != null) { fundId = mLoanTemplate.getFundId(); spFund.setSelection(mLoanTemplate.getFundNameFromId(fundId)); } spLinkingOptions.setSelection(mListAccountLinkingOptions.size()); }</code><technical_language>@tarun0 default termPeriodFrequencyType id interestRateFrequencyType id</technical_language>

Target:
private void showDefaultValues() { interestRatePerPeriod = mLoanTemplate.getInterestRatePerPeriod(); loanTermFrequency = mLoanTemplate.getTermPeriodFrequencyType().getId(); termFrequency = mLoanTemplate.getTermFrequency(); etPrincipal.setText(String.valueOf(mLoanTemplate.getPrincipal().toString())); etNumberOfRepayments.setText(String.valueOf( mLoanTemplate.getNumberOfRepayments().toString())); tvNominalRatePerYearMonth .setText(mLoanTemplate.getInterestRateFrequencyType().getValue()); etNominalInterestRate.setText(String.valueOf( mLoanTemplate.getInterestRatePerPeriod().toString())); etLoanTerm.setText(String.valueOf(termFrequency.toString())); if (mLoanTemplate.getRepaymentEvery() != null) { repaymentEvery = mLoanTemplate.getRepaymentEvery(); etRepaidEvery.setText(String.valueOf(repaymentEvery.toString())); } if (mLoanTemplate.getFundId() != null) { fundId = mLoanTemplate.getFundId(); spFund.setSelection(mLoanTemplate.getFundNameFromId(fundId)); } spLinkingOptions.setSelection(mListAccountLinkingOptions.size()); }
Source:
<code>public void testAccessControl() { <START> String[] params = new String[] { <END> Const.ParamsNames.FEEDBACK_SESSION_NAME, "First feedback session", Const.ParamsNames.COURSE_ID, "idOfTypicalCourse1" }; verifyOnlyInstructorsOfTheSameCourseCanAccess(params); verifyUnaccessibleWithoutModifyCoursePrivilege(params); }</code><technical_language>params valid here? (i.e. FEEDBACK_QUESTION_TEMPLATE_NUMBER param?)</technical_language>

Target:
public void testAccessControl() { String[] params = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, "First feedback session", Const.ParamsNames.COURSE_ID, "idOfTypicalCourse1", Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "1" }; verifyOnlyInstructorsOfTheSameCourseCanAccess(params); verifyUnaccessibleWithoutModifyCoursePrivilege(params); }
Source:
<code>public static LttngUst20EventLayout getInstance() { <START> synchronized (INSTANCE) { return INSTANCE; } <END> }</code><technical_language>other getInstance methods do a null check INSTANCE construct avoid race conditions. synchronized is enough</technical_language>

Target:
public static synchronized LttngUst20EventLayout getInstance() { return INSTANCE; }
Source:
<code>SortedSet<Integer> findPortsToUse(Offer offer, int maxCount) { SortedSet<Integer> portsToUse = new TreeSet<Integer>(); List<Value.Range> portRangesList = null; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals(PORT_RESOURCE_NAME)) { portRangesList = resource.getRanges().getRangeList(); break; } } LOGGER.fine("portRangesList=" + portRangesList); for (Value.Range currentPortRange : portRangesList) { <START> int begin = (int) currentPortRange.getBegin(); <END> long end = currentPortRange.getEnd(); for (int candidatePort = begin; candidatePort <= end && portsToUse.size() < maxCount; candidatePort++) { portsToUse.add(candidatePort); } } return portsToUse; }</code><technical_language>do need explicitly cast long int here</technical_language>

Target:
SortedSet<Long> findPortsToUse(Offer offer, int maxCount) { SortedSet<Long> portsToUse = new TreeSet<Long>(); List<Value.Range> portRangesList = null; for (Resource resource : offer.getResourcesList()) { if (resource.getName().equals(PORT_RESOURCE_NAME)) { portRangesList = resource.getRanges().getRangeList(); break; } } LOGGER.fine("portRangesList=" + portRangesList); for (Value.Range currentPortRange : portRangesList) { long begin = currentPortRange.getBegin(); long end = currentPortRange.getEnd(); for (long candidatePort = begin; candidatePort <= end && portsToUse.size() < maxCount; candidatePort++) { portsToUse.add(candidatePort); } } return portsToUse; }
Source:
<code>protected void executeCommand() { setReturnValue( getBackend().logoff( new VdcActionParametersBase(terminatedSessionId))); <START> } <END></code><technical_language>I unsure need for canDoAction(), execute, worse case get failure? I set of object state canDoAction execute.... this is another discussion :(</technical_language>

Target:
protected void executeCommand() { String terminatedSessionId = SessionDataContainer.getInstance().getSessionIdBySeqId( getParameters().getTerminatedSessionDbId()); if (terminatedSessionId == null) { log.info( "Cannot terminate session with database id '{}', it doesn't exist anymore.", getParameters().getTerminatedSessionDbId()); setSucceeded(false); return; } DbUser terminatedUser = SessionDataContainer.getInstance().getUser(terminatedSessionId, false); if (terminatedUser != null) { addCustomValue( "TerminatedSessionUsername", String.format("%s@%s", terminatedUser.getLoginName(), terminatedUser.getDomain())); } setReturnValue( getBackend().logoff( new VdcActionParametersBase(terminatedSessionId))); }
Source:
<code>private static String currenciesToJSON(final ArrayList<String> currencies) { HashMap map = new HashMap<>(); <START> for (String e : currencies) <END> map.put("currencies", e); System.out.println("map : " + map); return new Gson().toJson(map); }</code><technical_language>Please braces</technical_language>

Target:
private static String currenciesToJSON(final ArrayList<String> currencies) { HashMap map = new HashMap<>(); for (String e : currencies) { map.put("currencies", e); } System.out.println("map : " + map); return new Gson().toJson(map); }
Source:
<code>public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { <START> if (o.getStockSymbol() == symbol) { if (o.getSize() < volume) <END> throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, price, this); ordersPlaced.add(order); } m.addOrder(order); }</code><technical_language>Merge if statements</technical_language>

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { Order order; if (orderType == OrderType.BUY) { if (price * volume > this.cashInHand) throw new StockMarketExpection("You don't have enough cash."); for(Order o: this.ordersPlaced) { if (o.getStockSymbol() == symbol) { throw new StockMarketExpection("You've already ordered this stock."); } } order = new BuyOrder(symbol, volume, price, this); ordersPlaced.add(order); } else { for(Order o: this.stocksOwned) { if (o.getStockSymbol() == symbol && o.getSize() < volume) { throw new StockMarketExpection("You don't have enough stocks."); } } order = new SellOrder(symbol, volume, price, this); ordersPlaced.add(order); } m.addOrder(order); }
Source:
<code>private void initRunVmCommand() { RunVmParams runVmParameters = getParameters(); if (getVm() != null) { refreshBootParameters(runVmParameters); getVm().setLastStartTime(new Date()); VmHandler.updateDisksForVm(getVm(), getDiskDao().getAllForVm(getVm().getId())); if (getVm().getStatus() != VMStatus.Suspended) { boolean archSupportSnapshot = FeatureSupported.isMemorySnapshotSupportedByArchitecture( getVm().getClusterArch(), getVm().getVdsGroupCompatibilityVersion()); <START> memorySnapshotSupported = FeatureSupported.memorySnapshot(getVm().getVdsGroupCompatibilityVersion()) && archSupportSnapshot; <END> memoryVolumeFromSnapshot = getActiveSnapshot().getMemoryVolume(); } } }</code><technical_language>Minor performance enhancement - flip && operands' order. This way, if archSupportSnapshot is false, need execute another costly FeatureSupported call</technical_language>

Target:
private void initRunVmCommand() { RunVmParams runVmParameters = getParameters(); if (getVm() != null) { refreshBootParameters(runVmParameters); getVm().setLastStartTime(new Date()); VmHandler.updateDisksForVm(getVm(), getDiskDao().getAllForVm(getVm().getId())); if (getVm().getStatus() != VMStatus.Suspended) { boolean archSupportSnapshot = FeatureSupported.isMemorySnapshotSupportedByArchitecture( getVm().getClusterArch(), getVm().getVdsGroupCompatibilityVersion()); memorySnapshotSupported = archSupportSnapshot && FeatureSupported.memorySnapshot(getVm().getVdsGroupCompatibilityVersion()); memoryVolumeFromSnapshot = getActiveSnapshot().getMemoryVolume(); } } }
Source:
<code>private void buildInitialPackageStore() throws IOException { File nuxeoPackages = new File(nuxeoHome, "packages"); File nuxeoStrore = new File(nuxeoPackages, "store"); File uninstallFile = new File(testStore, "uninstall.xml"); FileUtils.iterateFiles(testStore, new String[] { "zip" }, false).forEachRemaining(pkgZip -> { try { File pkgDir = new File(nuxeoStrore, pkgZip.getName().replace(".zip", "")); ZipUtils.unzip(pkgZip, pkgDir); FileUtils.copyFileToDirectory(uninstallFile, pkgDir); } catch (IOException e) { <START> e.printStackTrace(); <END> } }); FileUtils.copyFileToDirectory(new File(testStore, ".packages"), nuxeoPackages); }</code><technical_language>printStackTrace. need catch method throws IOException</technical_language>

Target:
private void buildInitialPackageStore() throws IOException { File nuxeoPackages = new File(nuxeoHome, "packages"); File nuxeoStrore = new File(nuxeoPackages, "store"); File uninstallFile = new File(testStore, "uninstall.xml"); FileUtils.iterateFiles(testStore, new String[] { "zip" }, false).forEachRemaining(pkgZip -> { try { File pkgDir = new File(nuxeoStrore, pkgZip.getName().replace(".zip", "")); ZipUtils.unzip(pkgZip, pkgDir); FileUtils.copyFileToDirectory(uninstallFile, pkgDir); } catch (IOException e) { throw new RuntimeException(e); } }); FileUtils.copyFileToDirectory(new File(testStore, ".packages"), nuxeoPackages); }
Source:
<code>public static int readInt32(final ByteBuffer buffer) { return (0xFF & (int) buffer.get()) | <START> (0xFF & (int) buffer.get()) << 8 | <END> (0xFF & (int) buffer.get()) << 16 | (0xFF & (int) buffer.get()) << 24; }</code><technical_language>Casting int unnecessary here, byte is promoted int bit shift operation is applied. 0xff & is necessary buffer.get() returns byte. I missing here..</technical_language>

Target:
public static int readInt32(final ByteBuffer buffer) { return (0xFF & buffer.get()) | (0xFF & buffer.get()) << 8 | (0xFF & buffer.get()) << 16 | (0xFF & buffer.get()) << 24; }
Source:
<code>public void onError(Throwable e) { <START> e.printStackTrace(); <END> try { FileLfsServlet.sendError(response, HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); context.complete(); in.close(); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getMessage(), ex); } }</code><technical_language>want log this exception</technical_language>

Target:
public void onError(Throwable e) { try { FileLfsServlet.sendError(response, HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); context.complete(); in.close(); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getMessage(), ex); } }
Source:
<code>public static byte[] getValue(Cell cell) { if(cell.getValueLength() >= cell.getValueArray().length) { return cell.getValueArray(); <START> }else if(cell.getValueLength() < cell.getValueArray().length) { <END> return Arrays.copyOfRange(cell.getValueArray(), 0, cell.getValueLength()); } return cell.getValueArray(); }</code><technical_language>"else"? Also, please add a space if (. a space { else</technical_language>

Target:
public static byte[] getValue(Cell cell) { if (cell.getValueLength() >= cell.getValueArray().length) { return cell.getValueArray(); } else { return Arrays.copyOfRange(cell.getValueArray(), 0, cell.getValueLength()); } }
Source:
<code>public void resourceChanged(IResourceChangeEvent event) { IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren(); for (IResourceDelta delta : projectDeltas) { <START> if(delta.getResource().getType() == IResource.PROJECT){ <END> if((delta.getKind() == IResourceDelta.CHANGED || delta.getKind() == IResourceDelta.ADDED) && (delta.getFlags() & IResourceDelta.OPEN) != 0){ IProject project = delta.getResource().getProject(); if(project.isOpen()){ HybridProject hybridProject = HybridProject.getHybridProject(project); if(hybridProject != null ) { RestoreProjectJob job = new RestoreProjectJob(project); ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project); job.setRule(rule); job.schedule(); } } } } } }</code><technical_language>possibly collate this if statement</technical_language>

Target:
public void resourceChanged(IResourceChangeEvent event) { IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren(); for (IResourceDelta delta : projectDeltas) { if((delta.getResource().getType() == IResource.PROJECT) && (delta.getKind() == IResourceDelta.CHANGED || delta.getKind() == IResourceDelta.ADDED) && (delta.getFlags() & IResourceDelta.OPEN) != 0){ IProject project = delta.getResource().getProject(); if(project.isOpen()){ HybridProject hybridProject = HybridProject.getHybridProject(project); if(hybridProject != null ) { RestoreProjectJob job = new RestoreProjectJob(project); ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project); job.setRule(rule); job.schedule(); } } } } }
Source:
<code><START> protected String formatDate(Date date) { <END> DateFormat df = new SimpleDateFormat(ConcurConstants.DATE_FORMAT); return df.format(date); }</code><technical_language>dateTimeService instead</technical_language>

Target:
protected String formatDate(Date date) { return getDateTimeService().toString(date, ConcurConstants.DATE_FORMAT); }
Source:
<code>public OcflObjectSessionFactory getObject() { final var logicalPathMapper = SystemUtils.IS_OS_WINDOWS ? LogicalPathMappers.percentEncodingWindowsMapper() : LogicalPathMappers.percentEncodingLinuxMapper(); final var ocflRepo = new OcflRepositoryBuilder() .layoutConfig(new HashedTruncatedNTupleConfig()) .logicalPathMapper(logicalPathMapper) .storage(FileSystemOcflStorage.builder().repositoryRoot(ocflRoot).build()) .workDir(stagingDir) .buildMutable(); if (migrationType == MigrationType.F6_OCFL) { final var objectMapper = new ObjectMapper() .configure(WRITE_DATES_AS_TIMESTAMPS, false) .registerModule(new JavaTimeModule()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); return new DefaultOcflObjectSessionFactory(ocflRepo, stagingDir, objectMapper, CommitType.NEW_VERSION, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } else { <START> return new VanillaOcflObjectSessionFactory(ocflRepo, stagingDir, <END> "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } }</code><technical_language>Instead of VanillaOcflObjectSessionFactory, I suggest BasicOcflObjectSessionFactory SimpleOcflObjectSessionFactory</technical_language>

Target:
public OcflObjectSessionFactory getObject() { final var logicalPathMapper = SystemUtils.IS_OS_WINDOWS ? LogicalPathMappers.percentEncodingWindowsMapper() : LogicalPathMappers.percentEncodingLinuxMapper(); final var ocflRepo = new OcflRepositoryBuilder() .layoutConfig(new HashedTruncatedNTupleConfig()) .logicalPathMapper(logicalPathMapper) .storage(FileSystemOcflStorage.builder().repositoryRoot(ocflRoot).build()) .workDir(stagingDir) .buildMutable(); if (migrationType == MigrationType.FEDORA_OCFL) { final var objectMapper = new ObjectMapper() .configure(WRITE_DATES_AS_TIMESTAMPS, false) .registerModule(new JavaTimeModule()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); return new DefaultOcflObjectSessionFactory(ocflRepo, stagingDir, objectMapper, CommitType.NEW_VERSION, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } else { return new PlainOcflObjectSessionFactory(ocflRepo, stagingDir, "Generated by Fedora 3 to Fedora 6 migration", user, userUri); } }
Source:
<code>public static List<Long> getDishCategoryIds(final SQLiteDatabase db, final long dishId) { final Cursor c = db.rawQuery("SELECT " + CATEGORY_ID + " FROM " + TABLE_NAME + " WHERE " + DISH_ID + " =?", new String[] { String.valueOf(dishId) }); if (c != null) { List<Long> list = new ArrayList<Long>(); try { <START> if (c.moveToFirst()) { <END> list.add(c.getLong(c.getColumnIndex(CATEGORY_ID))); } } finally { c.close(); } return list; } return Collections.emptyList(); }</code><technical_language>a while loop</technical_language>

Target:
public static List<Long> getDishCategoryIds(final SQLiteDatabase db, final long dishId) { final Cursor c = db.rawQuery("SELECT " + CATEGORY_ID + " FROM " + TABLE_NAME + " WHERE " + DISH_ID + " =?", new String[] { String.valueOf(dishId) }); if (c != null) { List<Long> list = new ArrayList<Long>(); try { while (c.moveToNext()) { list.add(c.getLong(c.getColumnIndex(CATEGORY_ID))); } } finally { c.close(); } return list; } return Collections.emptyList(); }
Source:
<code>private ExpansionRegionStructuredActivityNodeContentCompartmentEditPart createCompartmentEP(ExpansionRegionEditPart parentEP) { View decoratorView = NotationFactory.eINSTANCE.createDecorationNode(); decoratorView.setType("" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID); parentEP.getNotationView().insertChild(decoratorView); <START> CustomExpansionRegionStructuredActivityNodeContentCompartmentEditPart compartment = new CustomExpansionRegionStructuredActivityNodeContentCompartmentEditPart(decoratorView); <END> compartment.setParent(parentEP); return compartment; }</code><technical_language>EditPartFactory</technical_language>

Target:
private MockCustomExpansionRegionCompartmentEditPart createCompartmentEP(ExpansionRegionEditPart parentEP) { View decoratorView = NotationFactory.eINSTANCE.createDecorationNode(); decoratorView.setType("" + ExpansionRegionStructuredActivityNodeContentCompartmentEditPart.VISUAL_ID); parentEP.getNotationView().insertChild(decoratorView); MockCustomExpansionRegionCompartmentEditPart compartment = new MockCustomExpansionRegionCompartmentEditPart(decoratorView); compartment.setParent(parentEP); return compartment; }
Source:
<code><START> public LruBlockCache(final LruBlockCacheConfiguration conf) { <END> this.conf = conf; int mapInitialSize = (int) Math.ceil(1.2 * conf.getMaxSize() / conf.getBlockSize()); if (conf.getSingleFactor() + conf.getMultiFactor() + conf.getMemoryFactor() != 1) { throw new IllegalArgumentException("Single, multi, and memory factors " + " should total 1.0"); } if (conf.getMinFactor() >= conf.getAcceptableFactor()) { throw new IllegalArgumentException("minFactor must be smaller than acceptableFactor"); } if (conf.getMinFactor() >= 1.0f || conf.getAcceptableFactor() >= 1.0f) { throw new IllegalArgumentException("all factors must be < 1"); } map = new ConcurrentHashMap<>(mapInitialSize, conf.getMapLoadFactor(), conf.getMapConcurrencyLevel()); this.stats = new CacheStats(); this.count = new AtomicLong(0); this.elements = new AtomicLong(0); this.overhead = calculateOverhead(conf.getMaxSize(), conf.getBlockSize(), conf.getMapConcurrencyLevel()); this.size = new AtomicLong(this.overhead); if (conf.isUseEvictionThread()) { this.evictionThread = new EvictionThread(this); this.evictionThread.start(); while (!this.evictionThread.running()) { try { Thread.sleep(10); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } } else { this.evictionThread = null; } this.scheduleThreadPool.scheduleAtFixedRate(new StatisticsThread(this), statThreadPeriod, statThreadPeriod, TimeUnit.SECONDS); }</code><technical_language>Nice cleanup conf</technical_language>

Target:
public LruBlockCache(final LruBlockCacheConfiguration conf) { this.conf = conf; int mapInitialSize = (int) Math.ceil(1.2 * conf.getMaxSize() / conf.getBlockSize()); map = new ConcurrentHashMap<>(mapInitialSize, conf.getMapLoadFactor(), conf.getMapConcurrencyLevel()); this.stats = new CacheStats(); this.count = new AtomicLong(0); this.elements = new AtomicLong(0); this.overhead = calculateOverhead(conf.getMaxSize(), conf.getBlockSize(), conf.getMapConcurrencyLevel()); this.size = new AtomicLong(this.overhead); if (conf.isUseEvictionThread()) { this.evictionThread = new EvictionThread(this); this.evictionThread.start(); while (!this.evictionThread.running()) { try { Thread.sleep(10); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } } else { this.evictionThread = null; } this.scheduleThreadPool.scheduleAtFixedRate(new StatisticsThread(this), statThreadPeriod, statThreadPeriod, TimeUnit.SECONDS); }
Source:
<code>public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { try { List<String> response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); tupleConvertFilter(response, fields, result); return Status.OK; <START> } catch (Exception exc) { <END> System.err.println("Can't select range elements"); exc.printStackTrace(); return Status.ERROR; } }</code><technical_language>TarantoolException | NullPointerException exc, want catch specific Java conventions recommendations</technical_language>

Target:
public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { List<String> response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); tupleConvertFilter(response, fields, result); return Status.OK; }
Source:
<code>public Set<EObject> getAllInstances(EClass type) { <START> Preconditions.checkArgument(IndexingLevel.FULL == getIndexingLevel(type)); <END> Set<EObject> retSet = new HashSet<EObject>(); Object typeKey = toKey(type); Set<Object> subTypes = metaStore.getSubTypeMap().get(typeKey); if (subTypes != null) { for (Object subTypeKey : subTypes) { final Set<EObject> instances = instanceStore.getInstanceSet(subTypeKey); if (instances != null) { retSet.addAll(instances); } } } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); if (instances != null) { retSet.addAll(instances); } return retSet; }</code><technical_language>Warning! This precondition check breaks compatibility! I it, I fear surprises</technical_language>

Target:
public Set<EObject> getAllInstances(EClass type) { Set<EObject> retSet = new HashSet<EObject>(); Object typeKey = toKey(type); Set<Object> subTypes = metaStore.getSubTypeMap().get(typeKey); if (subTypes != null) { for (Object subTypeKey : subTypes) { final Set<EObject> instances = instanceStore.getInstanceSet(subTypeKey); if (instances != null) { retSet.addAll(instances); } } } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); if (instances != null) { retSet.addAll(instances); } return retSet; }
Source:
<code>public void testSearch() throws Exception { String[] searchTerms = { Constants.NEWS, "structuretype = 2", " And structure.inode='" + Constants.NEWS + "'" }; int totalCount = contentTypeFactory.searchCount(null); List<ContentType> types=contentTypeFactory.search(null, BaseContentType.ANY, "name", -1,0); assertThat("we have at least 40 content types", types.size() > 20); <START> types = contentTypeFactory.search(null, BaseContentType.ANY, "name", -1, 0); <END> assertThat("limit works and we have max five content types", types.size() < 6); for (int x = 0; x < totalCount; x = x + 5) { types = contentTypeFactory.search(null, BaseContentType.ANY, "name", -1, x); assertThat("we have max five content types", types.size() < 6); } for (int i = 0; i < BaseContentType.values().length; i++) { types = contentTypeFactory.search(null, BaseContentType.getBaseContentType(i), "name", -1, 0); assertThat("we have content types of" + BaseContentType.getBaseContentType(i), types.size() > 0); int count = contentTypeFactory.searchCount(null, BaseContentType.getBaseContentType(i)); assertThat("Count works as well", types.size() == count); } for (int i = 0; i < searchTerms.length; i++) { types = contentTypeFactory.search(searchTerms[i], BaseContentType.ANY, "mod_date desc", -1, 0); assertThat("we can search content types:" + searchTerms[i], types.size() > 0); int count = contentTypeFactory.searchCount(searchTerms[i], BaseContentType.ANY); assertThat("Count works as well", types.size() == count); } }</code><technical_language>5</technical_language>

Target:
public void testSearch() throws Exception { String[] searchTerms = { Constants.NEWS, "structuretype = 2", " And structure.inode='" + Constants.NEWS + "'" }; int totalCount = contentTypeFactory.searchCount(null); List<ContentType> types=contentTypeFactory.search(null, BaseContentType.ANY, "name", -1,0); assertThat("we have at least 40 content types", types.size() > 20); types = contentTypeFactory.search(null, BaseContentType.ANY, "name", 5, 0); assertThat("limit works and we have max five content types", types.size() < 6); for (int x = 0; x < totalCount; x = x + 5) { types = contentTypeFactory.search(null, BaseContentType.ANY, "name", 5, x); assertThat("we have max five content types", types.size() < 6); } for (int i = 0; i < BaseContentType.values().length; i++) { types = contentTypeFactory.search(null, BaseContentType.getBaseContentType(i), "name", -1, 0); assertThat("we have content types of" + BaseContentType.getBaseContentType(i), types.size() > 0); int count = contentTypeFactory.searchCount(null, BaseContentType.getBaseContentType(i)); assertThat("Count works as well", types.size() == count); } for (int i = 0; i < searchTerms.length; i++) { types = contentTypeFactory.search(searchTerms[i], BaseContentType.ANY, "mod_date desc", -1, 0); assertThat("we can search content types:" + searchTerms[i], types.size() > 0); int count = contentTypeFactory.searchCount(searchTerms[i], BaseContentType.ANY); assertThat("Count works as well", types.size() == count); } }
Source:
<code>public static void main(String[] args) throws Exception { String columnFile = "02.feats"; CoNLLColumnFormatReader reader = new CoNLLColumnFormatReader("PennTreebank-WSJ", "02", columnFile, ViewNames.SRL_VERB, new BasicTextAnnotationBuilder()); Counter<String> counter = new Counter<>(); List<String> predicates = new ArrayList<>(); for (TextAnnotation ta : reader) { counter.incrementCount("Sentences"); logger.info(ta.getTokenizedText()); if (!ta.hasView(ViewNames.SRL_VERB)) continue; PredicateArgumentView pav = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB); List<Constituent> predicates2 = pav.getPredicates(); counter.incrementCount("Predicates", predicates2.size()); for (Constituent c : predicates2) { predicates.add(c.getAttribute(PredicateArgumentView.LemmaIdentifier)); } <START> <END> } logger.info((int) counter.getCount("Sentences") + " sentences"); logger.info((int) counter.getCount("Predicates") + " predicates"); }</code><technical_language>main(), leavea STDOUT</technical_language>

Target:
public static void main(String[] args) throws Exception { String columnFile = "02.feats"; CoNLLColumnFormatReader reader = new CoNLLColumnFormatReader("PennTreebank-WSJ", "02", columnFile, ViewNames.SRL_VERB, new BasicTextAnnotationBuilder()); Counter<String> counter = new Counter<>(); List<String> predicates = new ArrayList<>(); for (TextAnnotation ta : reader) { counter.incrementCount("Sentences"); System.out.println(ta.getTokenizedText()); if (!ta.hasView(ViewNames.SRL_VERB)) continue; PredicateArgumentView pav = (PredicateArgumentView) ta.getView(ViewNames.SRL_VERB); List<Constituent> predicates2 = pav.getPredicates(); counter.incrementCount("Predicates", predicates2.size()); for (Constituent c : predicates2) { predicates.add(c.getAttribute(PredicateArgumentView.LemmaIdentifier)); } } System.out.println((int) counter.getCount("Sentences") + " sentences"); System.out.println((int) counter.getCount("Predicates") + " predicates"); }
Source:
<code>private void stopAutoMove() { isAutoMove = false; List<Input> inputs = bindsConfig.getBinds(new SimpleUri("engine:forwards")); <START> Input forwardKey = inputs.get(0); <END> inputSystem.cancelSimulatedKeyStroke(forwardKey); }</code><technical_language>likely, inputs list empty (no key defined)</technical_language>

Target:
private void stopAutoMove() { List<Input> inputs = bindsConfig.getBinds(new SimpleUri("engine:forwards")); Input forwardKey = getValidKey(inputs); if(forwardKey != null) { inputSystem.cancelSimulatedKeyStroke(forwardKey); isAutoMove = false; } }
Source:
<code><START> public Property<T> setDefaultValue(T value) { <END> storedDefaultValue = value; return this; }</code><technical_language>Actually, is reason default change for a Property? need this method -- removing this method (or making package-private)</technical_language>

Target:
protected Property<T> setDefaultValue(T value) { storedDefaultValue = value; return this; }
Source:
<code>private void createEncounterTestData() throws ParseException, ConceptNameAlreadyInUseException { createdProvider = prepareProvider(); createdEncounterType = prepareEncounterType(); Location location = locationService.getLocations(DEFAULT_CONFIG_NAME, DEFAULT_LOCATION_NAME).get(0); Encounter encounter = new Encounter(location, createdEncounterType, new DateTime("2001-01-16T00:00:00Z").toDate(), <START> createdPatient, null, Collections.singletonList(createdProvider.getPerson()), null); <END> createdEncounter = encounterService.createEncounter(DEFAULT_CONFIG_NAME, encounter); }</code><technical_language>include creating visit in</technical_language>

Target:
private void createEncounterTestData() throws ParseException, ConceptNameAlreadyInUseException { createdProvider = prepareProvider(); createdEncounterType = prepareEncounterType(); Visit createdVisit = prepareVisit(); Location location = locationService.getLocations(DEFAULT_CONFIG_NAME, DEFAULT_LOCATION_NAME).get(0); Encounter encounter = new Encounter(location, createdEncounterType, encounterDateTime.toDate(), createdPatient, createdVisit, Collections.singletonList(createdProvider.getPerson()), null); createdEncounter = encounterService.createEncounter(DEFAULT_CONFIG_NAME, encounter); }
Source:
<code>public void testWriteQueryResult() throws UnsupportedEncodingException { Resource resource = new ClasspathResource("classpath:jmxtrans-config-console-test.xml"); JmxTransConfigurationLoader loader = new JmxTransConfigurationXmlLoader(resource); JmxTransExporter exporter = new JmxTransExporter(loader); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; System.setOut(ps); try { exporter.collectAndExport(); try { Thread current = Thread.currentThread(); synchronized(current) { current.wait(2005); } } catch (InterruptedException e) { } exporter.collectAndExport(); } finally { System.setOut(prev); } String[] splitted = baos.toString().split(System.lineSeparator()); <START> assertThat(splitted.length, is(2)); <END> assertThat(splitted[0], startsWith("jvm.thread ")); assertThat(splitted[1], startsWith("jvm.thread ")); }</code><technical_language>I a more idiomatic Hamcrest assert assertThat(splitted, arrayContaining(startsWith("jvm.thread "), startsWith("jvm.thread ")));</technical_language>

Target:
public void testWriteQueryResult() throws UnsupportedEncodingException { Resource resource = new ClasspathResource("classpath:jmxtrans-config-console-test.xml"); JmxTransConfigurationLoader loader = new JmxTransConfigurationXmlLoader(resource); JmxTransExporter exporter = new JmxTransExporter(loader); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; System.setOut(ps); try { exporter.collectAndExport(); try { Thread.sleep(2005); } catch (InterruptedException e) { } exporter.collectAndExport(); } finally { System.setOut(prev); } String[] splitted = baos.toString().split(System.lineSeparator()); assertThat(splitted, arrayContaining(startsWith("jvm.thread "), startsWith("jvm.thread "))); }
Source:
<code>private static void renamePackagesInDirectory(@NotNull final Project project, @NotNull final PsiDirectory dir, @NotNull final String newName) { WriteCommandAction.runWriteCommandAction(project, new Runnable() { @Override public void run() { for (PsiFile file : dir.getFiles()) { <START> if (GoUtil.allowed(file)) { <END> GoPackageClause packageClause = ((GoFile)file).getPackage(); String name = ((GoFile)file).getPackageName(); if (packageClause != null && name != null && name.equals(GoConstants.DOCUMENTATION)) { String fullName = GoTestFinder.isTestFile(file) ? newName + GoConstants.TEST_SUFFIX : newName; packageClause.replace(GoElementFactory.createPackageClause(project, fullName)); } } } } }); }</code><technical_language>Is this needed</technical_language>

Target:
private static void renamePackagesInDirectory(@NotNull final Project project, @NotNull final PsiDirectory dir, @NotNull final String newName) { WriteCommandAction.runWriteCommandAction(project, new Runnable() { @Override public void run() { for (PsiFile file : dir.getFiles()) { if (file instanceof GoFile && !GoUtil.libraryDirectoryToIgnore(file.getName())) { GoPackageClause packageClause = ((GoFile)file).getPackage(); String name = ((GoFile)file).getPackageName(); if (packageClause != null && name != null && !name.equals(GoConstants.DOCUMENTATION)) { String fullName = GoTestFinder.isTestFile(file) ? newName + GoConstants.TEST_SUFFIX : newName; packageClause.replace(GoElementFactory.createPackageClause(project, fullName)); } } } } }); }
Source:
<code>public static GelfDynamicMdcFieldType createField(@PluginConfiguration final Configuration config, @PluginAttribute("regex") String regex, @PluginAttribute("type") String type) { <START> if (Strings.isEmpty(regex) || Strings.isEmpty(type)) { <END> LOGGER.error(String.format("regex=%s or type=%s is empty or null", regex, type)); return null; } else { try { Pattern.compile(regex); } catch (Exception e) { LOGGER.error(String.format("Regex ix invalid: regex=%s", regex)); return null; } } return new GelfDynamicMdcFieldType(regex, type); }</code><technical_language>throw exceptions instead of returning null values signal a failure. additional log statements is helpful</technical_language>

Target:
public static GelfDynamicMdcFieldType createField(@PluginConfiguration final Configuration config, @PluginAttribute("regex") String regex, @PluginAttribute("type") String type) { Pattern pattern; if (Strings.isEmpty(regex) || Strings.isEmpty(type)) { throw new IllegalArgumentException(String.format("regex=%s or type=%s is empty or null", regex, type)); } try { pattern = Pattern.compile(regex); } catch (Exception e) { throw new IllegalArgumentException(String.format("Regex is invalid: regex=%s", regex), e); } return new GelfDynamicMdcFieldType(pattern, type); }
Source:
<code>private void simulateSessionExpiration(ZkClientInterceptingAdapter adapter) { <START> ZkConnection zkConnection = null; try { Field privateField = ZkClient.class.getSuperclass().getDeclaredField("_connection"); privateField.setAccessible(true); zkConnection = (ZkConnection) privateField.get(adapter.getZkClient()); } catch (NoSuchFieldException | IllegalAccessException e) { Assert.fail(e.toString()); } ZooKeeper zookeeper = zkConnection.getZookeeper(); long sessionId = zookeeper.getSessionId(); <END> LOG.info("Closing/expiring session:" + sessionId); ZooKeeperServer zkServer = _embeddedZookeeper.getZooKeeperServer(); zkServer.closeSession(sessionId); }</code><technical_language>_connection is protected. I find introduce a package private method com.linkedin.datastream.common.zk.ZkClient retrieve session ID</technical_language>

Target:
private void simulateSessionExpiration(ZkClientInterceptingAdapter adapter) { long sessionId = adapter.getSessionId(); LOG.info("Closing/expiring session: " + sessionId); _embeddedZookeeper.closeSession(sessionId); }
Source:
<code>public void testTableWriter() { ImmutableList<VariableReferenceExpression> variableReferenceExpressions = ImmutableList.of(variableReferenceExpression); <START> ImmutableList<String> strs = ImmutableList.of(""); <END> TableWriterNode tableWriterNode = builder.tableWriter( variableReferenceExpressions, strs, valuesNode); testValidation(tableWriterNode); }</code><technical_language>inline this variable. (Also, abbreviations)</technical_language>

Target:
public void testTableWriter() { ImmutableList<VariableReferenceExpression> variableReferenceExpressions = ImmutableList.of(VARIABLE_REFERENCE_EXPRESSION); TableWriterNode tableWriterNode = builder.tableWriter( variableReferenceExpressions, ImmutableList.of(""), valuesNode); testValidation(tableWriterNode); }
Source:
<code><START> public void setChmodOctal(String chmod) { <END> Assert.notNull(chmod, "'chmod' cannot be null"); this.chmod = Integer.parseInt(chmod, 8); }</code><technical_language>M-m-m. rely Java octal representation? E.g. 600 test-case changed 0600</technical_language>

Target:
public void setChmodOctal(String chmod) { Assert.notNull(chmod, "'chmod' cannot be null"); setChmod(Integer.parseInt(chmod, 8)); }