auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void theGetRetrieveSpecificConfigurationRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } <START> this.correlationUidMatcher.find(); <END> this.correlationUid = this.correlationUidMatcher.group(); }</code><technical_language>asserttrue</technical_language>

Target:
public void theGetRetrieveSpecificConfigurationRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } assertTrue(this.correlationUidMatcher.find()); this.correlationUid = this.correlationUidMatcher.group(); }
Source:
<code>protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); designerProject.convertToModelingProject(); final EObject eObject = <START> localSession.getOpenedSession().getSemanticResources().iterator().next().getContents().iterator().next().eContents().iterator().next(); <END> Assert.assertTrue("The element is not an EPackage as expected", eObject instanceof EPackage); Assert.assertEquals("The element is not the EPackage expected", "p1", ((EPackage) eObject).getName()); p1 = (EPackage) eObject; }</code><technical_language>complicated..</technical_language>

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); designerProject.convertToModelingProject(); }
Source:
<code>public boolean isAC3() { <START> return getCodecA() != null && ("ac3".equals(getCodecA()) || "a52".equals(getCodecA()) || "liba52".equals(getCodecA())); <END> }</code><technical_language>return getCodecA() != null && ("ac3".equals(getCodecA()) || "a52".contains(getCodecA()));</technical_language>

Target:
public boolean isAC3() { return getCodecA() != null && ("ac3".equals(getCodecA()) || getCodecA().contains("a52")); }
Source:
<code>public void setUp() { app = new TestRealmApp(); <START> RealmUser user = SyncTestUtils.Companion.createTestUser(app); <END> config = configFactory.createSyncConfigurationBuilder(user).build(); }</code><technical_language>annotate createTestUser @JvmStatic call a static method Kotlin RealmUser user = SyncTestUtils.createTestUser(app);</technical_language>

Target:
public void setUp() { app = new TestRealmApp(); RealmUser user = SyncTestUtils.createTestUser(app); config = configFactory.createSyncConfigurationBuilder(user).build(); }
Source:
<code>public Notifier register(String notifierName, NotificationContext ctx) { <START> LOG.debug("Registering notifier name {}, NotificationContext {}", notifierName, ctx); <END> Notifier notifier = loadNotifier(ctx.getConfig().getJarPath(), ctx.getConfig().getClassName()); Notifier registeredNotifier = notifiers.putIfAbsent(notifierName, notifier); if (registeredNotifier == null) { LOG.debug("Initializing notifier"); notifier.open(ctx); registeredNotifier = notifier; } LOG.debug("Notifier registered", notifierName); return registeredNotifier; }</code><technical_language>this info level invoked once</technical_language>

Target:
public Notifier register(String notifierName, NotificationContext ctx) { LOG.info("Registering notifier name {}, NotificationContext {}", notifierName, ctx); Notifier notifier = loadNotifier(ctx.getConfig().getJarPath(), ctx.getConfig().getClassName()); Notifier registeredNotifier = notifiers.putIfAbsent(notifierName, notifier); if (registeredNotifier == null) { LOG.info("Initializing notifier"); notifier.open(ctx); registeredNotifier = notifier; } LOG.info("Notifier registered", notifierName); return registeredNotifier; }
Source:
<code>private void clearStaleSessionCookies(StaplerRequest req, StaplerResponse rsp, String contextPath) { for (Cookie cookie : req.getCookies()) { <START> if (cookie.getName().startsWith("JSESSIONID.")) { <END> String cookieContextPath = cookie.getPath(); boolean pathMatches; if (cookieContextPath == null) { pathMatches = contextPath.equals("/"); } else { pathMatches = cookieContextPath.equals(contextPath); } if (pathMatches) { cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } } } }</code><technical_language>Note Cookie ID : <LINK_0></technical_language>

Target:
private void clearStaleSessionCookies(StaplerRequest req, StaplerResponse rsp, String contextPath) { final String cookieName = "JSESSIONID."; for (Cookie cookie : req.getCookies()) { if (cookie.getName().startsWith(cookieName)) { LOGGER.log(Level.FINE, "Removing cookie {0} during logout", cookie.getName()); cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } } }
Source:
<code>public void connect( ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise callerPromise) throws Exception { this.ctx = ctx; initPromise = ctx.channel().newPromise(); ChannelPromise realConnectPromise = ctx.channel().newPromise(); super.connect(ctx, remoteAddress, localAddress, realConnectPromise); realConnectPromise.addListener(future -> onRealConnect(ctx)); @SuppressWarnings("deprecation") <START> PromiseCombiner combiner = new PromiseCombiner(); <END> combiner.addAll((Future) realConnectPromise, initPromise); combiner.finish(callerPromise); }</code><technical_language>I understand PromiseComibner() constructor is deprecated, extract this a method do deprecation of it? need duplication(<LINK_0>, if need construct this class, call this method encapsulates logic</technical_language>

Target:
public void connect( ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise callerPromise) throws Exception { this.ctx = ctx; initPromise = ctx.channel().newPromise(); ChannelPromise realConnectPromise = ctx.channel().newPromise(); super.connect(ctx, remoteAddress, localAddress, realConnectPromise); realConnectPromise.addListener(future -> onRealConnect(ctx)); PromiseCombiner.combine(callerPromise, realConnectPromise, initPromise); }
Source:
<code>protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; buf.readUnsignedShort(); int size = buf.readUnsignedByte(); <START> if (size != CMD_RESPONSE_SIZE) { <END> int type = buf.readUnsignedByte(); if (type == MSG_IMEI) { parseIdentification(channel, remoteAddress, buf); } else { return parseData(channel, remoteAddress, buf, type); } } else { return parseCommandResponse(channel, remoteAddress, buf); } return null; }</code><technical_language>Is a identify command response</technical_language>

Target:
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; buf.readUnsignedShort(); int size = buf.readUnsignedByte(); if (size != CMD_RESPONSE_SIZE) { int type = buf.readUnsignedByte(); if (type == MSG_IMEI) { getDeviceSession(channel, remoteAddress, buf.readBytes(15).toString(StandardCharsets.UTF_8)); } else { return decodeData(channel, remoteAddress, buf, type); } } else { return parseCommandResponse(channel, remoteAddress, buf); } return null; }
Source:
<code>public Builder(Context context) { if (context == null) { throw new IllegalArgumentException("Context must not be null."); } <START> if (!hasPermission(context, Manifest.permission.INTERNET)) { <END> throw new IllegalArgumentException("INTERNET permission is required."); } this.context = context.getApplicationContext(); }</code><technical_language>I this is a bit early. support loading places other internet</technical_language>

Target:
public Builder(Context context) { if (context == null) { throw new IllegalArgumentException("Context must not be null."); } this.context = context.getApplicationContext(); }
Source:
<code>public Item next() { <START> this.episode = episodes.next(); <END> Item item = itemExtractor.extract(episode); List<Clip> clips = getClips( episode.getProgramme().getPid(), episode.getProgramme().getUri() ); item.setClips(clips); return item; }</code><technical_language>This a local, is this a field</technical_language>

Target:
public Item next() { NitroItemSource<Episode> episode = episodes.next(); Item item = itemExtractor.extract(episode); List<Clip> clips = getClips( episode.getProgramme().getPid(), episode.getProgramme().getUri() ); item.setClips(clips); return item; }
Source:
<code>private boolean policyUnitEnabled(VM vm) { <START> boolean usesNumaPinning = vm.getvNumaNodeList().stream() .anyMatch(node -> !node.getVdsNumaNodeList().isEmpty()); <END> return vm.getVmType() == VmType.HighPerformance || vm.isUsingCpuPassthrough() || StringUtils.isNotEmpty(vm.getCpuPinning()) || usesNumaPinning; }</code><technical_language>AFAIR this work VM entity is set numa nodes list in this phase (vm.getvNumaNodeList() == null always). This behaviour set avoid redundant queries DB. Please is handled in NumaPolicyUnit class. line changed following: boolean usesNumaPinning !vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()).isEmpty());</technical_language>

Target:
private boolean policyUnitEnabled(VM vm) { boolean usesNumaPinning = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()).stream() .anyMatch(node -> !node.getVdsNumaNodeList().isEmpty()); return vm.getVmType() == VmType.HighPerformance || vm.isUsingCpuPassthrough() || StringUtils.isNotEmpty(vm.getCpuPinning()) || usesNumaPinning; }
Source:
<code>public void displayEditSettingsWindow() { WebElement editBtn = browser.driver.findElement(By.id("editBtn")); editBtn.click(); WebDriverWait wait = new WebDriverWait(browser.driver, TestProperties.TEST_TIMEOUT); <START> wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("editModal"))); <END> }</code><technical_language>Extract this AppPage method waitForElementVisibility? overload accepts a WebElement. Accepting a is more useful, element present for it</technical_language>

Target:
public void displayEditSettingsWindow() { WebElement editBtn = browser.driver.findElement(By.id("editBtn")); editBtn.click(); waitForElementVisibility(By.id("editModal")); }
Source:
<code>public static boolean isOnXParameterAnnotation(HighlightInfo highlightInfo, PsiFile file) { if (!(ANNOTATION_TYPE_EXPECTED.equals(highlightInfo.getDescription()) || CANNOT_RESOLVE_UNDERSCORES_MESSAGE.matcher(StringUtil.notNullize(highlightInfo.getDescription())).matches())) { return false; } PsiElement highlightedElement = file.findElementAt(highlightInfo.getStartOffset()); PsiNameValuePair nameValuePair = findContainingNameValuePair(highlightedElement); if (nameValuePair == null || !(nameValuePair.getContext() instanceof PsiAnnotationParameterList)) { return false; } <START> String parameterName = nameValuePair.getFirstChild().getText(); <END> if (!ONX_PARAMETERS.contains(parameterName)) { return false; } PsiElement containingAnnotation = nameValuePair.getContext().getPrevSibling().getContext(); return containingAnnotation instanceof PsiAnnotation && ONXABLE_ANNOTATIONS.contains(((PsiAnnotation) containingAnnotation).getQualifiedName()); }</code><technical_language>just: "nameValuePair.getName()"</technical_language>

Target:
public static boolean isOnXParameterAnnotation(HighlightInfo highlightInfo, PsiFile file) { if (!(ANNOTATION_TYPE_EXPECTED.equals(highlightInfo.getDescription()) || CANNOT_RESOLVE_UNDERSCORES_MESSAGE.matcher(StringUtil.notNullize(highlightInfo.getDescription())).matches())) { return false; } PsiElement highlightedElement = file.findElementAt(highlightInfo.getStartOffset()); PsiNameValuePair nameValuePair = findContainingNameValuePair(highlightedElement); if (nameValuePair == null || !(nameValuePair.getContext() instanceof PsiAnnotationParameterList)) { return false; } String parameterName = nameValuePair.getName(); if (!ONX_PARAMETERS.contains(parameterName)) { return false; } PsiElement containingAnnotation = nameValuePair.getContext().getContext(); return containingAnnotation instanceof PsiAnnotation && ONXABLE_ANNOTATIONS.contains(((PsiAnnotation) containingAnnotation).getQualifiedName()); }
Source:
<code>public DocumentOperationsApplierForNonOverlappingRegions(final Document document) { this.document = Objects.requireNonNull(document); <START> comparator = new DocumentOperationNonOverlappingRegionsComparator(); <END> operations = new ArrayList<>(); applied = false; }</code><technical_language>is reason for this instance field, a static final</technical_language>

Target:
public DocumentOperationsApplierForNonOverlappingRegions(final Document document) { this.document = Objects.requireNonNull(document); operations = new ArrayList<>(); applied = false; }
Source:
<code>public synchronized void initTrace(@Nullable IResource resource, @Nullable String path, @Nullable Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); if (path == null) { throw new TmfTraceException("No path has been specified."); } Path filePath = checkNotNull(Paths.get(path)); <START> if (filePath.getFileName().toString().endsWith(PCAPNG_EXTENSION)) { try { fPcapFile = new PcapNgFile(filePath); } catch (IOException | BadPcapFileException e) { throw new TmfTraceException(e.getMessage(), e); } } else { try { fPcapFile = new PcapOldFile(filePath); } catch (IOException | BadPcapFileException e) { throw new TmfTraceException(e.getMessage(), e); } } <END> }</code><technical_language>PcapHelper</technical_language>

Target:
public synchronized void initTrace(@Nullable IResource resource, @Nullable String path, @Nullable Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); if (path == null) { throw new TmfTraceException("No path has been specified."); } Path filePath = checkNotNull(Paths.get(path)); try { fPcapFile = PcapHelper.getPcapFile(filePath); } catch (IOException | BadPcapFileException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
<code>public void removeNodeFromParent(MutableTreeNode node) { super.removeNodeFromParent(node); if(node.getParent() == getRoot()) { ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), <START> new Event(SiteMapEventPublisher.getPublisher(), SiteMapEventPublisher.SITE_REMOVED_EVENT, new Target((SiteNode)node))); <END> } else { ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), SiteMapEventPublisher.SITE_NODE_REMOVED_EVENT, new Target((SiteNode)node))); } }</code><technical_language>This extracted a method (one takes SiteNode event type), reduce code duplication a further</technical_language>

Target:
public void removeNodeFromParent(MutableTreeNode node) { SiteNode parent=(SiteNode)node.getParent(); super.removeNodeFromParent(node); handleEvent(parent, (SiteNode)node, EventType.REMOVE); }
Source:
<code>public String normalizeUserName(String name) { String normalized = ILLEGAL_USERNAME_CHARACTERS.matcher(name).replaceAll(""); String candidate = normalized.isEmpty() ? NameGenerator.generate("username", 4) : normalized; int i = 1; try { while (true) { userManager.getByName(candidate); candidate = normalized.isEmpty() ? NameGenerator.generate("username", 4) : normalized + String.valueOf(i++); } } catch (NotFoundException e) { return candidate; } catch (ServerException e) { <START> LOG.warn("Error occured during username normalization", e); <END> } return candidate; }</code><technical_language>throw exception instead of returning potential existing name</technical_language>

Target:
public String normalizeUserName(String name) throws ServerException { String normalized = ILLEGAL_USERNAME_CHARACTERS.matcher(name).replaceAll(""); String candidate = normalized.isEmpty() ? NameGenerator.generate("username", 4) : normalized; int i = 1; try { while (userExists(candidate)) { candidate = normalized.isEmpty() ? NameGenerator.generate("username", 4) : normalized + String.valueOf(i++); } } catch (ServerException e) { LOG.warn("Error occured during username normalization", e); throw e; } return candidate; }
Source:
<code>private X createFinalizableObject(final AtomicBoolean finalized) { X result = new X() { @Override protected void finalize() throws Throwable { super.finalize(); <START> System.err.println("finalizer running..."); <END> finalized.set(true); } }; FinalizationTester.induceFinalization(); boolean wasFinalized = finalized.get(); if (wasFinalized) { fail("finalizer called early"); } return wasFinalized ? result : null; }</code><technical_language>been, in this case i screw up. i leave this line in! :-)</technical_language>

Target:
private X createFinalizableObject(final AtomicBoolean finalized) { X result = new X() { @Override protected void finalize() throws Throwable { super.finalize(); finalized.set(true); } }; FinalizationTester.induceFinalization(); boolean wasFinalized = finalized.get(); if (wasFinalized) { fail("finalizer called early"); } return wasFinalized ? result : null; }
Source:
<code>public void start(Collection<? extends Location> locs) { super.start(locs); Iterable<String> memberHostNamesAndPorts = Iterables.transform(getMembers(), new Function<Entity, String>() { @Override public String apply(Entity entity) { return entity.getAttribute(MongoDBConfigServer.HOSTNAME) + ":" + entity.getAttribute(MongoDBConfigServer.PORT); } }); <START> setAttribute(MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES, memberHostNamesAndPorts); <END> }</code><technical_language>set this ImmutableList.copyOf(memberHostNamesAndPorts); is serializable bite later</technical_language>

Target:
public void start(Collection<? extends Location> locs) { super.start(locs); Iterable<String> memberHostNamesAndPorts = Iterables.transform(getMembers(), new Function<Entity, String>() { @Override public String apply(Entity entity) { return entity.getAttribute(MongoDBConfigServer.HOSTNAME) + ":" + entity.getAttribute(MongoDBConfigServer.PORT); } }); setAttribute(MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES, ImmutableList.copyOf(memberHostNamesAndPorts)); }
Source:
<code>protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); <START> boolean shouldntAddVo = msg.matches("Group:(.*)created in Vo:(.*)"); <END> if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { if (shouldntAddVo && p.getBeanName().equals("Vo")) { continue; } i++; beans.addBean(p); } } return beans; }</code><technical_language>I I this patch is going. original problem, I think, is audit messages more perun beans trigger handler for of beans (see SimpleDispatchEventCondition.isApplicable() ). condition rewritten return true iff presentMask contains required beans. that, Vo bean added condition "created in Vo:..." VO_F case in CreationEventProcessor modified check for presence of Group bean skip Vo creation in case (this change sufficient resolve issue)</technical_language>

Target:
protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { i++; beans.addBean(p); } } return beans; }
Source:
<code>protected void broadcastSGVToUI() { <START> EGVRecord record=new EGVRecord(-1, TrendArrow.NONE,new Date(),new Date(), NoiseMode.NONE); <END> broadcastSGVToUI(record, false, standardMinutes(5).getMillis() + TIME_SYNC_OFFSET, new Date().getTime(), null, 0); }</code><technical_language>spaces =</technical_language>

Target:
protected void broadcastSGVToUI() { EGVRecord record = new EGVRecord(-1, TrendArrow.NONE, new Date(), new Date(), G4Download.Noise.NO_NOISE); broadcastSGVToUI(record, false, standardMinutes(5).getMillis() + TIME_SYNC_OFFSET, new Date().getTime(), null, 0); }
Source:
<code>HeronWorker lookupByWorkerId(String workerId) { HeronWorker worker; synchronized (workerMap) { worker = workerMap.get(workerId); } if (worker == null) { <START> LOG.log(Level.WARNING, "Container for executor id: {0} not found.", workerId); <END> } return worker; }</code><technical_language>Is this exceptional condition</technical_language>

Target:
Optional<HeronWorker> lookupByWorkerId(String workerId) { HeronWorker worker; synchronized (workerMap) { worker = workerMap.get(workerId); } if (worker == null) { LOG.log(Level.WARNING, "Container for executor id: {0} not found.", workerId); } return Optional.fromNullable(worker); }
Source:
<code><START> public void setS3CannedAcl(String acl) { <END> if (acl.equalsIgnoreCase("private")) getS3Configuration().setCannedAcl(CannedAccessControlList.Private); else if (acl.equalsIgnoreCase("public-read") || acl.equalsIgnoreCase("publicread")) getS3Configuration().setCannedAcl(CannedAccessControlList.PublicRead); else if (acl.equalsIgnoreCase("public-read-write") || acl.equalsIgnoreCase("publicreadwrite")) getS3Configuration().setCannedAcl(CannedAccessControlList.PublicReadWrite); else if (acl.equalsIgnoreCase("authenticated-read") || acl.equalsIgnoreCase("authenticatedread")) getS3Configuration().setCannedAcl(CannedAccessControlList.AuthenticatedRead); else if (acl.equalsIgnoreCase("bucket-owner-read") || acl.equalsIgnoreCase("bucketownerread")) getS3Configuration().setCannedAcl(CannedAccessControlList.BucketOwnerRead); else if (acl.equalsIgnoreCase("bucket-owner-full-control") || acl.equalsIgnoreCase("bucketownerfullcontrol")) getS3Configuration().setCannedAcl(CannedAccessControlList.BucketOwnerFullControl); else if (acl.equalsIgnoreCase("log-delivery-write") || acl.equalsIgnoreCase("logdeliverywrite")) getS3Configuration().setCannedAcl(CannedAccessControlList.LogDeliveryWrite); else getS3Configuration().setCannedAcl(CannedAccessControlList.Private); }</code><technical_language>I need support variants. S3 SDK's CannedAccessControlList enum is authoritative source of space. try { getS3Configuration().setCannedAclFromValue(acl); } catch (IllegalArgumentException ex) { System.err.println(String.format("Ignoring unrecognized canned ACL %s", acl)); }</technical_language>

Target:
public void setS3CannedAcl(String acl) { try { getS3Configuration().setCannedAclFromValue(acl); } catch (IllegalArgumentException ex) { System.err.println(String.format("Ignoring unrecognized canned ACL value %s", acl)); } }
Source:
<code>private Pair<DiskImage, Long> getLatestOVFDisk(List<Disk> disks) { Date foundOvfDiskUpdateDate = new Date(); boolean isFoundOvfDiskUpdated = false; Long size = 0L; Disk ovfDisk = null; for (Disk disk : disks) { boolean isBetterOvfDiskFound = false; String diskDecription = ((DiskImage) disk).getDescription(); if (diskDecription.contains(OvfInfoFileConstants.OvfStoreDescriptionLabel)) { Map<String, Object> diskDescriptionMap; try { diskDescriptionMap = JsonHelper.jsonToMap(diskDecription); } catch (IOException e) { <START> log.errorFormat("Exception while generating json containing ovf store info. Exception: {0}", e); <END> continue; } if (!isDomainExistsInDiskDescription(diskDescriptionMap, getParameters().getStorageDomainId())) { log.warnFormat("The disk description does not contain the storage domain id {0}", getParameters().getStorageDomainId()); continue; } boolean isUpdated = Boolean.valueOf(diskDescriptionMap.get(OvfInfoFileConstants.IsUpdated).toString()); Date date = getDateFromDiskDescription(diskDescriptionMap); if (!isFoundOvfDiskUpdated && isUpdated) { isBetterOvfDiskFound = true; } else if (!isUpdated && date.after(foundOvfDiskUpdateDate)) { isBetterOvfDiskFound = true; } else if (isFoundOvfDiskUpdated && isUpdated && date.after(foundOvfDiskUpdateDate)) { isBetterOvfDiskFound = true; } if (isBetterOvfDiskFound) { isFoundOvfDiskUpdated = isUpdated; foundOvfDiskUpdateDate = date; ovfDisk = disk; size = new Long(diskDescriptionMap.get(OvfInfoFileConstants.Size).toString()); } } } return new Pair<>((DiskImage)ovfDisk, size); }</code><technical_language>rebase change Info error, expected json description error confusing - issue</technical_language>

Target:
private Pair<DiskImage, Long> getLatestOVFDisk(List<Disk> disks) { Date foundOvfDiskUpdateDate = new Date(); boolean isFoundOvfDiskUpdated = false; Long size = 0L; Disk ovfDisk = null; for (Disk disk : disks) { boolean isBetterOvfDiskFound = false; String diskDecription = ((DiskImage) disk).getDescription(); if (diskDecription.contains(OvfInfoFileConstants.OvfStoreDescriptionLabel)) { Map<String, Object> diskDescriptionMap; try { diskDescriptionMap = JsonHelper.jsonToMap(diskDecription); } catch (IOException e) { log.warnFormat("Exception while generating json containing ovf store info. Exception: {0}", e); continue; } if (!isDomainExistsInDiskDescription(diskDescriptionMap, getParameters().getStorageDomainId())) { log.warnFormat("The disk description does not contain the storage domain id {0}", getParameters().getStorageDomainId()); continue; } boolean isUpdated = Boolean.valueOf(diskDescriptionMap.get(OvfInfoFileConstants.IsUpdated).toString()); Date date = getDateFromDiskDescription(diskDescriptionMap); if (isFoundOvfDiskUpdated && !isUpdated) { continue; } if ((isUpdated && !isFoundOvfDiskUpdated) || date.after(foundOvfDiskUpdateDate)) { isBetterOvfDiskFound = true; } if (isBetterOvfDiskFound) { isFoundOvfDiskUpdated = isUpdated; foundOvfDiskUpdateDate = date; ovfDisk = disk; size = new Long(diskDescriptionMap.get(OvfInfoFileConstants.Size).toString()); } } } return new Pair<>((DiskImage)ovfDisk, size); }
Source:
<code>public ImmutableList<Account> getInactiveUsers(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @QueryParam("battery") final Integer battery, @QueryParam("limit") final Integer limit){ <START> Integer criticalBatteryLevel; <END> if (battery == null) { criticalBatteryLevel = DEFAULT_CRITICAL_BATTERY_LEVEL; } else { criticalBatteryLevel = battery; } Integer inspectedPopulation; if (limit == null) { inspectedPopulation = DEFAULT_INSPECTED_POPULATION; } else { inspectedPopulation = Math.min(MAX_INSPECTED_POPULATION, limit); } return deviceDAOAdmin.getAccountsWithLowPillBattery(criticalBatteryLevel, inspectedPopulation); }</code><technical_language>this a liner a final</technical_language>

Target:
public ImmutableList<Account> getInactiveUsers(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @QueryParam("battery") final Integer battery, @QueryParam("limit") final Integer limit){ final Integer criticalBatteryLevel = (battery == null) ? DEFAULT_CRITICAL_BATTERY_LEVEL : battery; final Integer inspectedPopulation = (limit == null) ? DEFAULT_INSPECTED_POPULATION : Math.min(MAX_INSPECTED_POPULATION, limit); return deviceDAOAdmin.getAccountsWithLowPillBattery(criticalBatteryLevel, inspectedPopulation); }
Source:
<code>public boolean isSuccess() { <START> return raw().isSuccessful(); <END> }</code><technical_language>inline raw()</technical_language>

Target:
public boolean isSuccess() { return rawResponse.isSuccessful(); }
Source:
<code><START> private PostEntity.Data setUp(String wikiName) { <END> siteId = Utils.excractSiteIdFromWikiName(wikiName); return DiscussionsOperations .using(userWithPosts, driver) .createPostWithUniqueData(siteId); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this unused private "setUp" method. [![rule](<LINK_1>](http://sonar-s4/coding_rules#rule_key=squid%3AUnusedPrivateMethod)</technical_language>

Target:
private PostEntity.Data setUp(String wikiName) { siteId = Utils.excractSiteIdFromWikiName(wikiName); return DiscussionsClient .using(userWithPosts, driver) .createPostWithUniqueData(siteId); }
Source:
<code>protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { <START> if (ess.getJails().getCount() == 1) { <END> sender.sendMessage(tl("noJailsDefined")); } else { sender.sendMessage(tl("jailList", StringUtil.joinList(" ", ess.getJails().getList()))); } }</code><technical_language>This is a bug</technical_language>

Target:
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { if (ess.getJails().getCount() == 0) { sender.sendMessage(tl("noJailsDefined")); } else { sender.sendMessage(tl("jailList", StringUtil.joinList(" ", ess.getJails().getList()))); } }
Source:
<code>public EhcacheEntityResponse invoke(ClientDescriptor clientDescriptor, EhcacheEntityMessage message) { try { if (this.offHeapResourceIdentifiers.isEmpty()) { throw new ServerMisconfigurationException("Server started without any offheap resources defined." + " Check your server configuration and define at least one offheap resource."); } <START> if (!invalidationForPassiveEvictedKeysSent.get()) { <END> try { evictionInvalidationsInProgress.lock(); if (!invalidationForPassiveEvictedKeysSent.get()) { Set<String> caches = ehcacheStateService.getStores(); caches.stream() .flatMap(cache -> ehcacheStateService.getEvictionTracker(cache) .getTrackedEvictedKeys() .stream() .map(key -> new InvalidationTuple<>(cache, key, false))) .forEach(x -> { invalidateHashAfterEviction(x.getK(), x.getV()); LOGGER.debug("Sending invalidation for key and cache since it was evicted by Passive", x.getV(), x.getK()); }); invalidationForPassiveEvictedKeysSent.set(true); } } finally { evictionInvalidationsInProgress.unlock(); } } switch (message.getType()) { case LIFECYCLE_OP: return invokeLifeCycleOperation(clientDescriptor, (LifecycleMessage) message); case SERVER_STORE_OP: return invokeServerStoreOperation(clientDescriptor, (ServerStoreOpMessage) message); case STATE_REPO_OP: return invokeStateRepositoryOperation(clientDescriptor, (StateRepositoryOpMessage) message); case RETIREMENT_OP: return responseFactory.success(); default: throw new IllegalMessageException("Unknown message : " + message); } } catch (ClusterException e) { return responseFactory.failure(e); } catch (Exception e) { LOGGER.error("Unexpected exception raised during operation: " + message, e); return responseFactory.failure(new InvalidOperationException(e)); } }</code><technical_language>ditch logic. is wrong caching contract clients return null while others return valid mapping. In likelihood, client null want update correctly propagated clients. in addition, I fond of locking done here</technical_language>

Target:
public EhcacheEntityResponse invoke(ClientDescriptor clientDescriptor, EhcacheEntityMessage message) { try { if (this.offHeapResourceIdentifiers.isEmpty()) { throw new ServerMisconfigurationException("Server started without any offheap resources defined." + " Check your server configuration and define at least one offheap resource."); } switch (message.getType()) { case LIFECYCLE_OP: return invokeLifeCycleOperation(clientDescriptor, (LifecycleMessage) message); case SERVER_STORE_OP: return invokeServerStoreOperation(clientDescriptor, (ServerStoreOpMessage) message); case STATE_REPO_OP: return invokeStateRepositoryOperation(clientDescriptor, (StateRepositoryOpMessage) message); case RETIREMENT_OP: return responseFactory.success(); default: throw new IllegalMessageException("Unknown message : " + message); } } catch (ClusterException e) { return responseFactory.failure(e); } catch (Exception e) { LOGGER.error("Unexpected exception raised during operation: " + message, e); return responseFactory.failure(new InvalidOperationException(e)); } }
Source:
<code>public void disconnect() { if (fControl != null) { fControl.setState(TerminalState.CLOSED); } <START> fGdbTerminalCtrlMngr.removePageTerminalControl(fControl); <END> }</code><technical_language>remove page terminal control (effectively disconnecting) mark fControl CLOSED</technical_language>

Target:
public void disconnect() { fGdbTerminalCtrlConnector.removePageTerminalControl(fControl); if (fControl != null) { fControl.setState(TerminalState.CLOSED); } }
Source:
<code>public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { String action = intent.getAction(); if (action != null) { switch (action) { case ACTION_STOP: stop(); break; case ACTION_PAUSE: pause(); break; case ACTION_RESUME: resume(); break; } } MediaButtonReceiver.handleIntent(mediaSession, intent); } <START> enableMediaSession(); <END> return super.onStartCommand(intent, flags, startId); }</code><technical_language>do want unconditionally enable here? wrong</technical_language>

Target:
public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null) { String action = intent.getAction(); if (action != null) { switch (action) { case ACTION_STOP: stop(); break; case ACTION_PAUSE: pause(); break; case ACTION_RESUME: resume(); break; } } MediaButtonReceiver.handleIntent(mediaSession, intent); } return super.onStartCommand(intent, flags, startId); }
Source:
<code>public String toString() { <START> return ToStringBuilder.forInstance(this) .append("storageDomainId", storageDomainId) .append("imageGroupId", imageGroupId) .append("baseImageId", baseImageId) .append("topImageId", topImageId) .append("baseImageGeneration", baseImageGeneration) .build(); } <END></code><technical_language>adding new members here</technical_language>

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("storageDomainId", storageDomainId) .append("imageGroupId", imageGroupId) .append("baseImage", baseImage) .append("topImage", topImage) .append("baseImageGeneration", baseImageGeneration) .build(); }
Source:
<code>public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) { super.placeBlock(player, state, face, holding, clickedLoc); <START> <END> MaterialData data = state.getData(); if (data instanceof Stairs) { ((Stairs) data).setFacingDirection(getOppositeDirection(player)); if (face == BlockFace.DOWN || face != BlockFace.UP && clickedLoc.getY() >= 8) { ((Stairs) data).setInverted(true); } state.setData(data); } else { GlowServer.logger.warning("Placing Stairs: MaterialData was of wrong type"); } }</code><technical_language>Whitespace</technical_language>

Target:
public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) { super.placeBlock(player, state, face, holding, clickedLoc); MaterialData data = state.getData(); if (data instanceof Stairs) { ((Stairs) data).setFacingDirection(player.getDirection()); if (face == BlockFace.DOWN || face != BlockFace.UP && clickedLoc.getY() >= 8) { ((Stairs) data).setInverted(true); } state.setData(data); } else { GlowServer.logger.warning("Placing Stairs: MaterialData was of wrong type"); } }
Source:
<code>public String toString() { boolean first = true; String format = "SettingsDto{host='%s', port='%s', username='%s', password='%s', additionalProperties={"; <START> for (Entry<String, String> prop : this.additionalProperties.entrySet()) { <END> if (!first) { format += ", "; } else { first = false; } format += prop.getKey() + ": " + prop.getValue(); } format += "}, logAddress='%s', logSubject='%s', logBody='%s', logPurgeEnable='%s', logPurgeTime='%s', logPurgeTimeMultiplier='%s'}"; return String.format( format, host, port, username, password, logAddress, logSubject, logBody, logPurgeEnable, logPurgeTime, logPurgeTimeMultiplier); }</code><technical_language>properties.toString() handle this</technical_language>

Target:
public String toString() { return String.format( "SettingsDto{host='%s', port='%s', username='%s', password='%s', additionalProperties='%s', logAddress='%s', logSubject='%s', logBody='%s', logPurgeEnable='%s', logPurgeTime='%s', logPurgeTimeMultiplier='%s'}", host, port, username, password, additionalProperties, logAddress, logSubject, logBody, logPurgeEnable, logPurgeTime, logPurgeTimeMultiplier); }
Source:
<code>public static final List<Serializable> getValues() { List<Serializable> values = new ArrayList<>(); values.add(null); values.add(Boolean.TRUE); values.add("toto"); values.add("toto, tutu, tata"); <START> values.add(new ArrayList<>(Arrays.asList("true", "false"))); <END> values.add(new String[] { "tutu", "toto" }); return values; }</code><technical_language>asList is enough</technical_language>

Target:
public static final List<Serializable> getValues() { List<Serializable> values = new ArrayList<>(); values.add(null); values.add(Boolean.TRUE); values.add("toto"); values.add("toto, tutu, tata"); values.add(new String[] { "tutu", "toto" }); values.add(new String[] { "tutu", null, "toto" }); values.add(new ArrayList<>(Arrays.asList("true", "false"))); return values; }
Source:
<code>private Duration(int months, int days, long nanoseconds) { assert (months >= 0 && days >= 0 && nanoseconds >= 0) <START> || ((months <= 0 && days <= 0 && nanoseconds <= 0)); <END> this.months = months; this.days = days; this.nanoseconds = nanoseconds; }</code><technical_language>throw IllegalArgumentException assertion, this is called newInstance is public</technical_language>

Target:
private Duration(int months, int days, long nanoseconds) { if ((months < 0 || days < 0 || nanoseconds < 0) && ((months > 0 || days > 0 || nanoseconds > 0))) { throw new IllegalArgumentException(String.format( "All values must be either negative or positive, got %d months, %d days, %d nanoseconds", months, days, nanoseconds)); } this.months = months; this.days = days; this.nanoseconds = nanoseconds; }
Source:
<code>protected void configure() { bind(I18n.class).toProvider(I18nProvider.class).in(ServletScopes.REQUEST); bind(JsonProvider.class); configureEventHandlers(); bind(EventManager.class).asEagerSingleton(); bind(EventReceiver.class).asEagerSingleton(); bind(EventCurator.class); Multibinder<Report> reports = Multibinder.newSetBinder(binder(), Report.class); reports.addBinding().to(ConsumerStatusReport.class); <START> bind(ReportFactory.class); <END> bind(StatusResource.class); bind(EventResource.class); bind(ReportsResource.class); }</code><technical_language>+1: Multibinder is cool! in a map of Key -> Report, reason bind way? require annotation target string value, a static method/string get type. Doens't a great deal of difference</technical_language>

Target:
protected void configure() { bind(I18n.class).toProvider(I18nProvider.class).in(ServletScopes.REQUEST); bind(JsonProvider.class); configureEventHandlers(); bind(EventManager.class).asEagerSingleton(); bind(EventReceiver.class).asEagerSingleton(); Multibinder<Report> reports = Multibinder.newSetBinder(binder(), Report.class); reports.addBinding().to(ConsumerStatusReport.class); bind(ReportFactory.class); bind(StatusResource.class); bind(EventResource.class); bind(ReportsResource.class); }
Source:
<code>public DescriptionEditFragment createFragment() { invokeSource = (InvokeSource) getIntent().getSerializableExtra(INTENT_EXTRA_INVOKE_SOURCE); if (invokeSource == InvokeSource.EDIT_FEED_TITLE_DESC) { SuggestedEditsFunnel.get().getAddDescriptionStats().click(); } else if (invokeSource == InvokeSource.EDIT_FEED_TRANSLATE_TITLE_DESC) { <START> SuggestedEditsFunnel.get().getTranslateDescriptionStats().click(); <END> } return DescriptionEditFragment.newInstance(GsonUnmarshaller.unmarshal(PageTitle.class, getIntent().getStringExtra(EXTRA_TITLE)), getIntent().getStringExtra(EXTRA_HIGHLIGHT_TEXT), getIntent().getBooleanExtra(EXTRA_REVIEW_ENABLE, false), getIntent().getCharSequenceExtra(EXTRA_TRANSLATION_SOURCE_DESCRIPTION), getIntent().getStringExtra(EXTRA_TRANSLATION_SOURCE_LANGUAGE_CODE), invokeSource); }</code><technical_language>good send InvokeSource SuggestedEditsFunnel class method do logic action? easier manage if add more InvokeSources in future. (e.g. EDIT_FEED_IMAGE_CAPTION)</technical_language>

Target:
public DescriptionEditFragment createFragment() { invokeSource = (InvokeSource) getIntent().getSerializableExtra(INTENT_EXTRA_INVOKE_SOURCE); SuggestedEditsFunnel.get().click(invokeSource); return DescriptionEditFragment.newInstance(GsonUnmarshaller.unmarshal(PageTitle.class, getIntent().getStringExtra(EXTRA_TITLE)), getIntent().getStringExtra(EXTRA_HIGHLIGHT_TEXT), getIntent().getBooleanExtra(EXTRA_REVIEW_ENABLE, false), getIntent().getCharSequenceExtra(EXTRA_TRANSLATION_SOURCE_DESCRIPTION), getIntent().getStringExtra(EXTRA_TRANSLATION_SOURCE_LANGUAGE_CODE), invokeSource); }
Source:
<code>public void generatesDeclarations(Boolean withExterns, String expected) { Options opts = new Options(!withExterns); List<SourceFile> sourceFiles = new ArrayList<>(); for (File nonroot : getSubject().nonroots) { sourceFiles.add(SourceFile.fromFile(nonroot, UTF_8)); } List<String> roots = new ArrayList<>(); for (File root : getSubject().roots) { sourceFiles.add(SourceFile.fromFile(root, UTF_8)); roots.add(root.getPath()); } String actual = new DeclarationGenerator(opts) .generateDeclarations(sourceFiles, NO_EXTERNS, new Depgraph(roots)) <START> .replaceAll("[ ]* END> if (!actual.equals(expected)) { failureStrategy.failComparing("compilation result doesn't match", expected, actual); } }</code><technical_language>Whoops. move this a shared constant somewhere</technical_language>

Target:
public void generatesDeclarations(Boolean withExterns, String expected) { Options opts = new Options(!withExterns); List<SourceFile> sourceFiles = new ArrayList<>(); for (File nonroot : getSubject().nonroots) { sourceFiles.add(SourceFile.fromFile(nonroot, UTF_8)); } List<String> roots = new ArrayList<>(); for (File root : getSubject().roots) { sourceFiles.add(SourceFile.fromFile(root, UTF_8)); roots.add(root.getPath()); } String actual = new DeclarationGenerator(opts) .generateDeclarations(sourceFiles, NO_EXTERNS, new Depgraph(roots)); actual = DeclarationGenerator.GOLDEN_FILE_COMMENTS_REGEXP.matcher(actual).replaceAll(""); if (!actual.equals(expected)) { failureStrategy.failComparing("compilation result doesn't match", expected, actual); } }
Source:
<code>public static <T extends TransitionFactoryData> TransitionFactory<T> of( TransitionFactory<T> transitionFactory1, TransitionFactory<T> transitionFactory2) { Preconditions.checkNotNull(transitionFactory1); Preconditions.checkNotNull(transitionFactory2); if (transitionFactory1.isFinal()) { return transitionFactory1; } else if (NoTransition.isInstance(transitionFactory1)) { return transitionFactory2; } if (NoTransition.isInstance(transitionFactory2)) { return transitionFactory1; <START> } else if (NullTransition.isInstance(transitionFactory2) || transitionFactory2.isHost()) { <END> return transitionFactory2; } return create(transitionFactory1, transitionFactory2); }</code><technical_language>Similar earlier, check transitionFactory2.isFinal() here</technical_language>

Target:
public static <T extends TransitionFactoryData> TransitionFactory<T> of( TransitionFactory<T> transitionFactory1, TransitionFactory<T> transitionFactory2) { Preconditions.checkNotNull(transitionFactory1); Preconditions.checkNotNull(transitionFactory2); if (isFinal(transitionFactory1)) { return transitionFactory1; } else if (NoTransition.isInstance(transitionFactory1)) { return transitionFactory2; } if (NoTransition.isInstance(transitionFactory2)) { return transitionFactory1; } else if (isFinal(transitionFactory2)) { return transitionFactory2; } return create(transitionFactory1, transitionFactory2); }
Source:
<code>public int getVersion() { Element ssNode = XmlUtils.getElementInFile(fFilePath.makeAbsolute().toOSString(), TmfXmlStrings.STATE_PROVIDER, fStateId); if (ssNode != null) { <START> return Integer.valueOf(ssNode.getAttribute(TmfXmlStrings.VERSION)); <END> } throw new IllegalStateException("The state provider XML node should have a version attribute"); }</code><technical_language>Integer.parseInt() returns a int</technical_language>

Target:
public int getVersion() { Element ssNode = XmlUtils.getElementInFile(fFilePath.makeAbsolute().toOSString(), TmfXmlStrings.STATE_PROVIDER, fStateId); if (ssNode != null) { return Integer.parseInt(ssNode.getAttribute(TmfXmlStrings.VERSION)); } throw new IllegalStateException("The state provider XML node should have a version attribute"); }
Source:
<code>public String getVocabularyLabel(String voc, String key) { try (Session session = getDirService().open(voc)) { if (!session.hasEntry(key)) { <START> log.warn("Unable to find the key '" + key + "' in the vocabulary '" + voc + "'."); <END> return key; } DocumentModel doc = session.getEntry(key); DataModel dm = doc.getDataModels().values().iterator().next(); return (String) dm.getData("label"); } }</code><technical_language>want a WARN here, this spam logs server admin do it. do DEBUG</technical_language>

Target:
public String getVocabularyLabel(String voc, String key) { try (Session session = getDirService().open(voc)) { if (!session.hasEntry(key)) { log.debug("Unable to find the key '" + key + "' in the vocabulary '" + voc + "'."); return key; } DocumentModel doc = session.getEntry(key); DataModel dm = doc.getDataModels().values().iterator().next(); return (String) dm.getData("label"); } }
Source:
<code>public int getContentVersion() { <START> return 0; <END> }</code><technical_language>1</technical_language>

Target:
public int getContentVersion() { return 1; }