auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateNextRunChangedFields(final VM currentVM, DbUser user, boolean isFiltered) { if (currentVM.isNextRunConfigurationExists()) { VM nextVM = getNextRunVmConfiguration(currentVM.getId(), user.getId(), isFiltered); if (nextVM == null) { return; } VmPropertiesUtils vmPropertiesUtils = SimpleDependencyInjector.getInstance().get(VmPropertiesUtils.class); vmPropertiesUtils.separateCustomPropertiesToUserAndPredefined( currentVM.getCompatibilityVersion(), currentVM.getStaticData()); vmPropertiesUtils.separateCustomPropertiesToUserAndPredefined( nextVM.getCompatibilityVersion(), nextVM.getStaticData()); currentVM.setNextRunChangedFields(getChangedFieldsForStatus(currentVM.getStaticData(), nextVM.getStaticData(), VMStatus.Up)); } }

Target:
public void updateNextRunChangedFields(final VM currentVM, DbUser user, boolean isFiltered) { if (currentVM.isNextRunConfigurationExists()) { VM nextVM = getNextRunVmConfiguration(currentVM.getId(), user.getId(), isFiltered, true); if (nextVM == null) { return; } VmPropertiesUtils.getInstance().separateCustomPropertiesToUserAndPredefined( currentVM.getCompatibilityVersion(), currentVM.getStaticData()); VmPropertiesUtils.getInstance().separateCustomPropertiesToUserAndPredefined( nextVM.getCompatibilityVersion(), nextVM.getStaticData()); currentVM.setNextRunChangedFields(getChangedFieldsForStatus(currentVM.getStaticData(), nextVM.getStaticData(), VMStatus.Up)); } }
Source:
public void deleteStoreFiles() throws StoreException, IOException { if (started) { throw new IllegalStateException("Store is still started. Deleting store files is not allowed."); } String[] swapSegmentsInUse = compactor.getSwapSegmentsInUse(); for (String fileName : swapSegmentsInUse) { logger.info("Returning swap segment to reserve pool", fileName); File swapSegmentTempFile = new File(dataDir, fileName); diskSpaceAllocator.free(swapSegmentTempFile, config.storeSegmentSizeInBytes, storeId, true); } if (log.isLogSegmented()) { Map<String, Map<Long, Long>> storeSegmentRequirement = new HashMap<>(); Map<Long, Long> segmentSizeAndNum = new HashMap<>(); segmentSizeAndNum.put(log.getSegmentCapacity(), log.getRemainingUnallocatedSegments()); storeSegmentRequirement.put(storeId, segmentSizeAndNum); diskSpaceAllocator.deleteExtraSegments(storeSegmentRequirement, false); } logger.info("Deleting store directory", storeId); File storeDir = new File(dataDir); try { Utils.deleteFileOrDirectory(storeDir); } catch (Exception e) { throw new IOException("Couldn't delete store directory " + dataDir, e); } logger.info("All files of store deleted", storeId); }

Target:
public void deleteStoreFiles() throws StoreException, IOException { if (started) { throw new IllegalStateException("Store is still started. Deleting store files is not allowed."); } String[] swapSegmentsInUse = compactor.getSwapSegmentsInUse(); for (String fileName : swapSegmentsInUse) { logger.info("Returning swap segment to reserve pool", fileName); File swapSegmentTempFile = new File(dataDir, fileName); diskSpaceAllocator.free(swapSegmentTempFile, config.storeSegmentSizeInBytes, storeId, true); } if (log.isLogSegmented()) { diskSpaceAllocator.deleteAllSegmentsForStoreIds(Collections.singletonList(storeId)); } logger.info("Deleting store directory", storeId); File storeDir = new File(dataDir); try { Utils.deleteFileOrDirectory(storeDir); } catch (Exception e) { throw new IOException("Couldn't delete store directory " + dataDir, e); } logger.info("All files of store deleted", storeId); }
Source:
private DirContext getDirContext() { Hashtable<String, String> env = new Hashtable<String, String>(); env.put(JAVA_NAMING_FACTORY_INITIAL, DNS_NAMING_FACTORY); env.put(JAVA_NAMING_PROVIDER_URL, DNS_PROVIDER_URL); try { return new InitialDirContext(env); } catch (Throwable e) { throw new RuntimeException("Cannot get dir context for some reason", e); } }

Target:
public static DirContext getDirContext() { Hashtable<String, String> env = new Hashtable<String, String>(); env.put(JAVA_NAMING_FACTORY_INITIAL, DNS_NAMING_FACTORY); env.put(JAVA_NAMING_PROVIDER_URL, DNS_PROVIDER_URL); try { return new InitialDirContext(env); } catch (Throwable e) { throw new RuntimeException("Cannot get dir context for some reason", e); } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if ((obj == null) || (getClass() != obj.getClass())) { return false; } ErrorMatcher o = (ErrorMatcher) obj; return Objects.equals(errorCode, o.errorCode) && Objects.equals(queryStage, o.queryStage) && Objects.equals(errorMessagePattern, o.errorMessagePattern); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ErrorMatcher o = (ErrorMatcher) obj; return Objects.equals(errorCode, o.errorCode) && Objects.equals(queryStage, o.queryStage) && Objects.equals(errorMessagePattern, o.errorMessagePattern); }
Source:
public Dataverse findRootDataverse() { return (Dataverse) em.createQuery("select object(o) from Dataverse as o where o.owner.id = null").getSingleResult(); }

Target:
public Dataverse findRootDataverse() { return em.createQuery("select object(o) from Dataverse as o where o.owner.id = null", Dataverse.class).getSingleResult(); }
Source:
public boolean openDocument(Brief doc){ if (actBrief != null) { actBrief.save(txt.getPlugin().storeToByteArray(), txt.getPlugin().getMimeType()); } if (doc == null) { return false; } if (txt.open(doc) == true) { log.debug("TextView.openDocument: "); actBrief = doc; setName(); return true; } else { actBrief = null; if (CoreHub.localCfg.get(Preferences.P_TEXT_MULTIPLE, false) == true) { setName(); String ext = MimeTool.getExtension(doc.getMimeType()); if (ext.length() == 0) { ext = "odt"; } try { File tmp = File.createTempFile("elexis", "brief." + ext); log.debug("TextView.openDocument createTempFile: " + tmp.getAbsolutePath() + " mime " + doc.getMimeType()); System.out.println(tmp.getAbsolutePath()); tmp.deleteOnExit(); byte[] buffer = doc.loadBinary(); if (buffer == null) { return false; } ByteArrayInputStream bais = new ByteArrayInputStream(buffer); FileOutputStream fos = new FileOutputStream(tmp); FileTool.copyStreams(bais, fos); File file = new File(tmp.getAbsolutePath()); file.setReadable(true); file.setExecutable(false); file.setWritable(false); return Program.launch(tmp.getAbsolutePath()); } catch (IOException e) { ExHandler.handle(e); } return false; } else { log.debug("TextView.openDocument: Not allowed to open multiple documents"); return false; } } }

Target:
public boolean openDocument(Brief doc){ if (actBrief != null) { actBrief.save(txt.getPlugin().storeToByteArray(), txt.getPlugin().getMimeType()); } if (doc == null) { return false; } if (txt.open(doc) == true) { log.debug("TextView.openDocument: "); actBrief = doc; setName(); return true; } else { actBrief = null; if (CoreHub.localCfg.get(Preferences.P_TEXT_SUPPORT_LEGACY, false) == true) { setName(); String ext = MimeTool.getExtension(doc.getMimeType()); if (ext.length() == 0) { log.warn("TextView.openDocument no extension found for mime type: " + doc.getMimeType()); ext = "odt"; } try { File tmp = File.createTempFile("elexis", "brief." + ext); log.debug("TextView.openDocument createTempFile: " + tmp.getAbsolutePath() + " mime " + doc.getMimeType()); tmp.deleteOnExit(); byte[] buffer = doc.loadBinary(); if (buffer == null) { return false; } ByteArrayInputStream bais = new ByteArrayInputStream(buffer); FileOutputStream fos = new FileOutputStream(tmp); FileTool.copyStreams(bais, fos); File file = new File(tmp.getAbsolutePath()); file.setReadable(true); file.setExecutable(false); file.setWritable(false); return Program.launch(tmp.getAbsolutePath()); } catch (IOException e) { ExHandler.handle(e); } return false; } else { log.warn("TextView.openDocument: Preferences do not allow alternative method of documents created with legacy text-plugins"); return false; } } }
Source:
public void launch() { Map<String,Integer> ports = new HashMap<String, Integer>(); ports.put("httpPort",getHttpPort()); ports.put("jmxPort",getJmxPort()); NetworkUtils.checkPortsValid(ports); String clusterArg = isEmpty(getClusterName()) ? "":"-g "+getClusterName(); Map<String,Object> flags = new HashMap<String, Object>(); flags.put("usePidFile",false); newScript(flags, LAUNCHING). body.append( format("export JBOSS_CLASSPATH=%s/lib/jboss-logmanager.jar",getExpandedInstallDir()), format("%s/bin/run.sh -Djboss.service.binding.set=%s -Djboss.server.base.dir=$RUN_DIR/server ",getExpandedInstallDir(),PORT_GROUP_NAME) + format("-Djboss.server.base.url=file://$RUN_DIR/server -Djboss.messaging.ServerPeerID=%s ",entity.getId())+ format("-Djboss.boot.server.log.dir=%s/server/%s/log ",getRunDir(),SERVER_TYPE) + format("-b 0.0.0.0 %s -c %s ",clusterArg,SERVER_TYPE) + ">>$RUN_DIR/console 2>&1 </dev/null &", "for i in {1..10}\n" + "do\n" + " grep -i 'starting' "+getRunDir()+"/console && exit\n" + " sleep 1\n" + "done\n" + "echo \"Couldn't determine if process is running (console output does not contain 'starting'); continuing but may subsequently fail\"" ).execute(); }

Target:
public void launch() { Map<String,Integer> ports = new HashMap<String, Integer>(); ports.put("httpPort",getHttpPort()); ports.put("jmxPort",getJmxPort()); NetworkUtils.checkPortsValid(ports); String clusterArg = isEmpty(getClusterName()) ? "":"-g "+getClusterName(); Map<String,Object> flags = new HashMap<String, Object>(); flags.put("usePidFile",false); newScript(flags, LAUNCHING). body.append( format("export JBOSS_CLASSPATH=%s/lib/jboss-logmanager.jar",getExpandedInstallDir()), format("%s/bin/run.sh -Djboss.service.binding.set=%s -Djboss.server.base.dir=$RUN_DIR/server ",getExpandedInstallDir(),PORT_GROUP_NAME) + format("-Djboss.server.base.url=file://$RUN_DIR/server -Djboss.messaging.ServerPeerID=%s ",entity.getId())+ format("-Djboss.boot.server.log.dir=%s/server/%s/log ",getRunDir(),SERVER_TYPE) + format("-b %s %s -c %s ", getBindAddress(), clusterArg,SERVER_TYPE) + ">>$RUN_DIR/console 2>&1 </dev/null &", "for i in {1..10}\n" + "do\n" + " grep -i 'starting' "+getRunDir()+"/console && exit\n" + " sleep 1\n" + "done\n" + "echo \"Couldn't determine if process is running (console output does not contain 'starting'); continuing but may subsequently fail\"" ).execute(); }
Source:
private static Properties loadProperties(String propName) { Properties prop = new Properties(); InputStream in = MavenBannedVars.class.getClassLoader().getResourceAsStream(propName); if (in == null) { logger.info("{} not available with the classloader no Banned EnvVars Found . \n", propName); } else { try { prop.load(in); in.close(); } catch (IOException e) { logger.error(e.getMessage()); } } return prop; }

Target:
private static Properties loadProperties(String propName) { Properties prop = new Properties(); InputStream in = MavenBannedVars.class.getClassLoader().getResourceAsStream(propName); if (in == null) { logger.info("{} not available with the classloader no Banned EnvVars Found . \n", propName); } else { try { prop.load(in); } catch (IOException e) { logger.error(e.getMessage()); } finally { try{ in.close(); }catch (Exception e){ logger.error(e.getMessage()); } } } return prop; }
Source:
public void closeFile() { try { raf.close(); open = false; } catch (IOException e) { e.printStackTrace(); } }

Target:
public void closeFile() { try { raf.close(); open = false; } catch (IOException e) { PathPrims.signalIOException(e.getMessage()); } }
Source:
private void setupRemoteDriver(String device, String xmlTestName) throws MalformedURLException { loadProperties(device); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("bitbar_apiKey", "iW1e08HZp9KBhhw3hKYvtJg53eaJBetD"); capabilities.setCapability("bitbar_testrun", this.getClass().getSimpleName()); capabilities.setCapability("bitbar_project", xmlTestName); capabilities.setCapability("bitbar_device", bitbarDevice); capabilities.setCapability("browserName", browserName); capabilities.setCapability("platformName", platformName); capabilities.setCapability("deviceName", deviceName); if (automationName != null) capabilities.setCapability("automationName", automationName); driver.set(new RemoteWebDriver(new URL("<LINK_0>"), capabilities)); }

Target:
private void setupRemoteDriver(String device, String xmlTestName) throws MalformedURLException { loadProperties(device); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("bitbar_apiKey", "<YOUR_BITBAR_API_KEY>"); capabilities.setCapability("bitbar_testrun", this.getClass().getSimpleName()); capabilities.setCapability("bitbar_project", xmlTestName); capabilities.setCapability("bitbar_device", bitbarDevice); capabilities.setCapability("browserName", browserName); capabilities.setCapability("platformName", platformName); capabilities.setCapability("deviceName", deviceName); if (automationName != null) capabilities.setCapability("automationName", automationName); driver.set(new RemoteWebDriver(new URL("<LINK_0>"), capabilities)); }
Source:
public void generate(File reportDirectory) { final File reportDataDirectory = createDirectory(reportDirectory, DATA_SUFFIX); long attachmentsSize = copyAttachments(inputDirectories, reportDataDirectory); final AtomicLong reportSize = new AtomicLong(attachmentsSize); final String testRun = testRunGenerator.generate(); ExecutorService service = Executors.newFixedThreadPool(dataProviders.size()); for (final DataProvider provider : dataProviders) { service.execute(new Runnable() { @Override public void run() { reportSize.addAndGet(provider.provide(testRun, reportDataDirectory)); } }); } try { service.awaitTermination(10, TimeUnit.HOURS); writeReportSize(reportSize.get(), reportDataDirectory); } catch (InterruptedException e) { throw new ReportGenerationException(e); } }

Target:
public void generate(File reportDirectory) { final File reportDataDirectory = createDirectory(reportDirectory, DATA_SUFFIX); long attachmentsSize = copyAttachments(inputDirectories, reportDataDirectory); final AtomicLong reportSize = new AtomicLong(attachmentsSize); final String testRun = testRunGenerator.generate(); ExecutorService service = Executors.newFixedThreadPool(dataProviders.size()); for (final DataProvider provider : dataProviders) { service.execute(new Runnable() { @Override public void run() { reportSize.addAndGet(provider.provide(testRun, reportDataDirectory)); } }); } try { service.shutdown(); service.awaitTermination(1, TimeUnit.HOURS); writeReportSize(reportSize.get(), reportDataDirectory); } catch (InterruptedException e) { throw new ReportGenerationException(e); } }
Source:
public void shouldSetCreationDate() { DocumentModel doc = session.createDocumentModel("/", "file", "File"); Calendar currentDate = Calendar.getInstance(); Map<String, Object> originalProperties = new HashMap<>(doc.getProperties("dublincore")); Set<String> expectedChangedProperties = new HashSet<>(); expectedChangedProperties.add("dc:created"); storageService.setCreationDate(doc, currentDate); assertDocumentPropertiesChanges(doc, originalProperties, expectedChangedProperties); assertEquals(currentDate, doc.getPropertyValue("dc:created")); }

Target:
public void shouldSetCreationDate() { DocumentModel doc = session.createDocumentModel("/", "file", "File"); Calendar currentDate = Calendar.getInstance(); Map<String, Object> originalProperties = new HashMap<>(doc.getProperties("dublincore")); Set<String> expectedChangedProperties = Collections.singleton("dc:created"); storageService.setCreationDate(doc, currentDate); assertDocumentPropertiesChanges(doc, originalProperties, expectedChangedProperties); assertEquals(currentDate, doc.getPropertyValue("dc:created")); }
Source:
public static RangeMap<Integer, Set<Integer>> getPartitionGroupsFromTopology(AbstractTopology topo) { Set<Integer> visited = new HashSet<>(); RangeMap<Integer, Set<Integer>> protectionGroups = TreeRangeMap.create(); for (AbstractTopology.Host host : topo.hostsById.values()) { if (visited.contains(host.id) || host.partitions.isEmpty()) { continue; } Set<Integer> hosts = new HashSet<>(); @SuppressWarnings("unchecked") Range<Integer>[] partitionRange = new Range[1]; buildProtectionGroup(topo, visited, host, partitionRange, hosts); assertEquals(hosts.size() * topo.getSitesPerHost() / (topo.getReplicationFactor() + 1), partitionRange[0].upperEndpoint() - partitionRange[0].lowerEndpoint() + 1); protectionGroups.put(partitionRange[0], hosts); } return protectionGroups; }

Target:
public static RangeMap<Integer, Set<Integer>> getPartitionGroupsFromTopology(AbstractTopology topo) { Set<Integer> visited = new HashSet<>(); RangeMap<Integer, Set<Integer>> protectionGroups = TreeRangeMap.create(); for (AbstractTopology.Host host : topo.hostsById.values()) { if (visited.contains(host.id) || host.partitions.isEmpty()) { continue; } Set<Integer> hosts = new HashSet<>(); @SuppressWarnings("unchecked") Range<Integer>[] partitionRange = new Range[1]; buildProtectionGroup(topo, visited, host, partitionRange, hosts); assert hosts.size() * topo.getSitesPerHost() / (topo.getReplicationFactor() + 1) == partitionRange[0].upperEndpoint() - partitionRange[0].lowerEndpoint() + 1; protectionGroups.put(partitionRange[0], hosts); } return protectionGroups; }
Source:
private static X509Certificate buildCertificateFromPEM(String pem) throws IOException, CertificateException { InputStream stream = new ByteArrayInputStream(pem.getBytes("UTF-8")); X509Certificate x509Certificate = (X509Certificate) CERTIFICATE_FACTORY.generateCertificate(stream); stream.close(); return x509Certificate; }

Target:
private static X509Certificate buildCertificateFromPEM(String pem) throws IOException, CertificateException { InputStream stream = null; try { stream = new ByteArrayInputStream(pem.getBytes("UTF-8")); return (X509Certificate) CERTIFICATE_FACTORY.generateCertificate(stream); } finally { if (stream != null) { stream.close(); } } }
Source:
private Status runJob() { Status finalStatus = node.getStatus(); try { job.run(); } catch (Throwable e) { if (props.getBoolean("job.succeed.on.failure", false)) { finalStatus = changeStatus(Status.FAILED_SUCCEEDED); logError("Job run failed, but will treat it like success."); logError(e.getMessage() + " cause: " + e.getCause(), e); } else { finalStatus = (e instanceof OutOfMemoryException) ? changeToFailureStatusWithCause(ExecutableNode.FailureCause.OOM) : changeStatus(Status.FAILED); logError("Job run failed!", e); logError(e.getMessage() + " cause: " + e.getCause()); } } if (job != null) { node.setOutputProps(job.getJobGeneratedProperties()); } if (!Status.isStatusFinished(finalStatus)) { finalStatus = changeStatus(Status.SUCCEEDED); } return finalStatus; }

Target:
private Status runJob() { Status finalStatus = node.getStatus(); try { job.run(); } catch (Throwable e) { if (props.getBoolean("job.succeed.on.failure", false)) { finalStatus = changeStatus(Status.FAILED_SUCCEEDED); logError("Job run failed, but will treat it like success."); logError(e.getMessage() + " cause: " + e.getCause(), e); } else { finalStatus = changeStatus(Status.FAILED); logError("Job run failed!", e); logError(e.getMessage() + " cause: " + e.getCause()); } } if (job != null) { node.setOutputProps(job.getJobGeneratedProperties()); } if (!Status.isStatusFinished(finalStatus)) { finalStatus = changeStatus(Status.SUCCEEDED); } return finalStatus; }
Source:
private Map<String, String> getColumnMap(ProviderContext context){ Class entityClass = getEntityClass(context); Field[] fields = entityClass.getDeclaredFields(); Map<String, String> columnMap = new LinkedHashMap<String, String>(); for (Field field : fields) { BaseMapper.Column column = field.getAnnotation(BaseMapper.Column.class); if(column != null){ String columnName = column.value(); if(columnName == null || columnName.length() == 0){ columnName = field.getName(); } columnMap.put(columnName, field.getName()); } } if(columnMap.size() == 0){ throw new RuntimeException("There is no field in the class [" + entityClass.getCanonicalName() + "] that specifies the @BaseMapper.Column annotation."); } return columnMap; }

Target:
private Map<String, String> getColumnMap(ProviderContext context) { Class<?> entityClass = getEntityClass(context); Field[] fields = entityClass.getDeclaredFields(); Map<String, String> columnMap = new LinkedHashMap<String, String>(); for (Field field : fields) { BaseMapper.Column column = field.getAnnotation(BaseMapper.Column.class); if (column != null) { String columnName = column.value(); if (columnName == null || columnName.length() == 0) { columnName = field.getName(); } columnMap.put(columnName, field.getName()); } } if (columnMap.size() == 0) { throw new RuntimeException("There is no field in the class [" + entityClass.getCanonicalName() + "] that specifies the @BaseMapper.Column annotation."); } return columnMap; }
Source:
public String[] getSupportedEncodingMethods() { return new String[]{"Base32", "Base64"}; }

Target:
public String[] getSupportedEncodingMethods() { return new String[]{Constants.BASE32, Constants.BASE64}; }
Source:
private void addHitsFromQuery(List<BibEntry> entryList, String queryURL) throws IOException, FetcherException { String content = new URLDownload(queryURL).asString(); if (needsCaptcha(content)) { LOGGER.info("Captcha hit at {}", queryURL); throw new FetcherException("Fetching from Google Scholar failed.", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), null); } Matcher matcher = LINK_TO_BIB_PATTERN.matcher(content); while (matcher.find()) { String citationsPageURL = matcher.group().replace("&amp;", "&"); BibEntry newEntry = downloadEntry(citationsPageURL); entryList.add(newEntry); } }

Target:
private void addHitsFromQuery(List<BibEntry> entryList, String queryURL) throws IOException, FetcherException { String content = new URLDownload(queryURL).asString(); if (needsCaptcha(content)) { throw new FetcherException("Fetching from Google Scholar failed: Captacha hit at " + queryURL + ".", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), null); } Matcher matcher = LINK_TO_BIB_PATTERN.matcher(content); while (matcher.find()) { String citationsPageURL = matcher.group().replace("&amp;", "&"); BibEntry newEntry = downloadEntry(citationsPageURL); entryList.add(newEntry); } }
Source:
public void before_shouldNotifyListenersAboutCheckedPrivileges() { listener1.hasPrivileges.clear(); listener1.lacksPrivileges.clear(); listener2.hasPrivileges.clear(); listener2.lacksPrivileges.clear(); Concept concept = Context.getConceptService().getConcept(3); assertThat("listener1", listener1.hasPrivileges, containsInAnyOrder("Get Concepts")); assertThat("listener2", listener2.hasPrivileges, containsInAnyOrder("Get Concepts")); assertThat(listener1.lacksPrivileges, empty()); assertThat(listener2.lacksPrivileges, empty()); listener1.hasPrivileges.clear(); listener2.hasPrivileges.clear(); Context.getConceptService().saveConcept(concept); assertThat("listener1", listener1.hasPrivileges, containsInAnyOrder("Manage Concepts", "Get Observations", "Get Concept Attribute Types", "Get Concept Map Types")); assertThat("listener2", listener2.hasPrivileges, containsInAnyOrder("Manage Concepts", "Get Observations", "Get Concept Attribute Types", "Get Concept Map Types")); assertThat(listener1.lacksPrivileges, empty()); assertThat(listener2.lacksPrivileges, empty()); }

Target:
public void before_shouldNotifyListenersAboutCheckedPrivileges() { listener1.hasPrivileges.clear(); listener1.lacksPrivileges.clear(); listener2.hasPrivileges.clear(); listener2.lacksPrivileges.clear(); Concept concept = Context.getConceptService().getConcept(3); assertThat("listener1", listener1.hasPrivileges, containsInAnyOrder("Get Concepts")); assertThat("listener2", listener2.hasPrivileges, containsInAnyOrder("Get Concepts")); assertThat(listener1.lacksPrivileges, empty()); assertThat(listener2.lacksPrivileges, empty()); listener1.hasPrivileges.clear(); listener2.hasPrivileges.clear(); Context.getConceptService().saveConcept(concept); assertThat("listener1", listener1.hasPrivileges, containsInAnyOrder("Manage Concepts", "Get Observations", "Get Concept Attribute Types")); assertThat("listener2", listener2.hasPrivileges, containsInAnyOrder("Manage Concepts", "Get Observations", "Get Concept Attribute Types")); assertThat(listener1.lacksPrivileges, empty()); assertThat(listener2.lacksPrivileges, empty()); }
Source:
public void run() { try { Thread.sleep(300); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to simulate computation"); } parameterWorker.push(KEY, parameter); final Integer value = parameterWorker.pull(KEY); LOG.log(Level.INFO, "Current value associated with key {0} is {1}", new Object[]{KEY, value}); }

Target:
public void run() { try { Thread.sleep(DELAY_MS); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to simulate computation", e); } parameterWorker.push(KEY, parameter); final Integer value = parameterWorker.pull(KEY); LOG.log(Level.INFO, "Current value associated with key {0} is {1}", new Object[]{KEY, value}); }
Source:
protected void onResumeFragments() { showPendingAlertDialog(); }

Target:
protected void onResumeFragments() { super.onResumeFragments(); showPendingAlertDialog(); }
Source:
private void describeChildren(final Resource resource, final ImmutableManagementResourceRegistration registration, final PathAddress address, OperationContext context, final AtomicReference<ModelNode> failureRef, final ModelNode results, ModelNode operation, Boolean nest) { resource.getChildTypes().forEach((childType) -> { resource.getChildren(childType).stream() .filter(entry -> { final ImmutableManagementResourceRegistration childRegistration = registration.getSubModel(PathAddress.EMPTY_ADDRESS.append(entry.getPathElement())); if(childRegistration == null) { ControllerLogger.ROOT_LOGGER.warnf("Couldn't find a registration for %s at %s for resource %s at %s", entry.getPathElement().toString(), registration.getPathAddress().toCLIStyleString(), resource, address.toCLIStyleString()); return false; } return !childRegistration.isRuntimeOnly() && !childRegistration.isRemote() && !childRegistration.isAlias(); }) .filter(entry -> addressFilter == null || addressFilter.accepts(address.append(entry.getPathElement()))) .forEach((entry) -> describeChildResource(entry, registration, address, context, failureRef, results, operation, nest)); }); }

Target:
private void describeChildren(final Resource resource, final ImmutableManagementResourceRegistration registration, final PathAddress address, OperationContext context, final AtomicReference<ModelNode> failureRef, final ModelNode results, ModelNode operation, Boolean nest) { for(String childType : resource.getChildTypes()) { for(Resource.ResourceEntry entry : resource.getChildren(childType)) { if(addressFilter != null && !addressFilter.accepts(address.append(entry.getPathElement()))) { continue; } final ImmutableManagementResourceRegistration childRegistration = registration.getSubModel(PathAddress.EMPTY_ADDRESS.append(entry.getPathElement())); if(childRegistration == null) { ControllerLogger.ROOT_LOGGER.debugf("Couldn't find a registration for %s at %s for resource %s at %s", entry.getPathElement().toString(), registration.getPathAddress().toCLIStyleString(), resource, address.toCLIStyleString()); continue; } if(childRegistration.isRuntimeOnly() || childRegistration.isRemote() || childRegistration.isAlias()) { continue; } describeChildResource(entry, registration, address, context, failureRef, results, operation, nest); } } }
Source:
public EquivGraphController(LookupEntryStore lookupStore) { this.lookupStore = checkNotNull(lookupStore); this.codec = SubstitutionTableNumberCodec.lowerCaseOnly(); }

Target:
private EquivGraphController(LookupEntryStore lookupStore) { this.lookupStore = checkNotNull(lookupStore); this.codec = SubstitutionTableNumberCodec.lowerCaseOnly(); }
Source:
public static ParameterizedType makeClassName(String baseName, Optional<String> suffix) { String className = baseName + "_" + suffix.orElse(Instant.now().atZone(UTC).format(TIMESTAMP_FORMAT)) + "_" + CLASS_ID.incrementAndGet(); String javaClassName = toJavaIdentifierString(className); return ParameterizedType.typeFromJavaClassName("com.facebook.presto.$gen." + javaClassName); }

Target:
public static ParameterizedType makeClassName(String baseName, Optional<String> suffix) { String className = baseName + "_" + suffix.orElseGet(() -> Instant.now().atZone(UTC).format(TIMESTAMP_FORMAT)) + "_" + CLASS_ID.incrementAndGet(); String javaClassName = toJavaIdentifierString(className); return ParameterizedType.typeFromJavaClassName("com.facebook.presto.$gen." + javaClassName); }
Source:
private static List<Range<Long>> parseCpuRangesText(final String string) { if (!validateCpuRange(string)) { return null; } string.split(RANGES_DELIMITER); List<Range<Long>> results = new ArrayList<>(); for (String range : Arrays.asList(string.split(RANGES_DELIMITER))) { if (range.contains(INTERNAL_RANGE_SEPARATOR)) { String[] split = range.split(INTERNAL_RANGE_SEPARATOR); if (split.length != 2) { continue; } long[] sorted = Arrays.asList(split).stream().map(Long::parseLong).sorted().mapToLong(Long::longValue).toArray(); results.add(Range.closed(sorted[0], sorted[1])); } else { Long value = Long.parseLong(range); results.add(Range.closed(value, value)); } } return results; }

Target:
private static List<Range<Long>> parseCpuRangesText(final String string) { List<Range<Long>> results = new ArrayList<>(); if (validateCpuRange(string)) { string.split(RANGES_DELIMITER); for (String range : Arrays.asList(string.split(RANGES_DELIMITER))) { if (range.contains(INTERNAL_RANGE_SEPARATOR)) { String[] split = range.split(INTERNAL_RANGE_SEPARATOR); if (split.length != 2) { continue; } long[] sorted = Arrays.asList(split).stream().map(Long::parseLong).sorted().mapToLong(Long::longValue).toArray(); results.add(Range.closed(sorted[0], sorted[1])); } else { Long value = Long.parseLong(range); results.add(Range.closed(value, value)); } } } return results; }
Source:
public static int getOrientation(InputStream stream) throws IOException { if (stream == null) { return 0 ; } MarkableInputStream markStream = new MarkableInputStream(stream); long mark = markStream.savePosition(65536); byte[] header = new byte[65536]; markStream.read(header); markStream.reset(mark); return getOrientation(header); }

Target:
public static int getOrientation(InputStream stream) throws IOException { if (stream == null) { return 0; } MarkableInputStream markStream = new MarkableInputStream(stream); long mark = markStream.savePosition(65536); int orientation = getOrientation(markStream, 65536); markStream.reset(mark); return orientation; }
Source:
public final String lastModified(final String dir) { try { return Files.getLastModifiedTime(Paths.get(dir), new LinkOption[0]).toString(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public final Object lastModified(final String dir) { try { return Files.getLastModifiedTime(Paths.get(dir), new LinkOption[0]).toString(); } catch (FileNotFoundException e) { signalFileNotFoundException(dir, e.getMessage()); return Nil.nilObject; } catch (IOException e) { signalIOException(e.getMessage()); return Nil.nilObject; } }
Source:
List<Bulkhead> acquireLanes(Query<?> query) { final String lane = QueryContexts.getLane(query); final Optional<BulkheadConfig> laneConfig = lane == null ? Optional.empty() : laneRegistry.getConfiguration(lane); List<Bulkhead> hallPasses = new ArrayList<>(2); final Optional<BulkheadConfig> totalConfig = laneRegistry.getConfiguration(TOTAL); laneConfig.ifPresent(config -> { Bulkhead laneLimiter = laneRegistry.bulkhead(lane, config); if (!laneLimiter.tryAcquirePermission()) { throw new QueryCapacityExceededException(lane); } hallPasses.add(laneLimiter); }); totalConfig.ifPresent(config -> { Bulkhead totalLimiter = laneRegistry.bulkhead(TOTAL, config); if (!totalLimiter.tryAcquirePermission()) { releaseLanes(hallPasses); throw new QueryCapacityExceededException(); } hallPasses.add(totalLimiter); }); return hallPasses; }

Target:
List<Bulkhead> acquireLanes(Query<?> query) { final String lane = QueryContexts.getLane(query); final Optional<BulkheadConfig> laneConfig = lane == null ? Optional.empty() : laneRegistry.getConfiguration(lane); final Optional<BulkheadConfig> totalConfig = laneRegistry.getConfiguration(TOTAL); List<Bulkhead> hallPasses = new ArrayList<>(2); try { laneConfig.ifPresent(config -> { Bulkhead laneLimiter = laneRegistry.bulkhead(lane, config); if (!laneLimiter.tryAcquirePermission()) { throw new QueryCapacityExceededException(lane); } hallPasses.add(laneLimiter); }); totalConfig.ifPresent(config -> { Bulkhead totalLimiter = laneRegistry.bulkhead(TOTAL, config); if (!totalLimiter.tryAcquirePermission()) { throw new QueryCapacityExceededException(); } hallPasses.add(totalLimiter); }); return hallPasses; } catch (Exception ex) { releaseLanes(hallPasses); throw ex; } }
Source:
protected static UUID determineActivityCategoryID(String activityCategoryUrl) { return UUID.fromString(activityCategoryUrl.substring(activityCategoryUrl.lastIndexOf('/') + 1)); }

Target:
private static UUID determineActivityCategoryID(String activityCategoryUrl) { return UUID.fromString(activityCategoryUrl.substring(activityCategoryUrl.lastIndexOf('/') + 1)); }
Source:
public Datacenter(HardwareLayout hardwareLayout, JSONObject jsonObject) throws JSONException { logger.trace("Datacenter " + jsonObject.toString()); this.hardwareLayout = hardwareLayout; this.name = jsonObject.getString("name"); this.dataNodes = new ArrayList<DataNode>(jsonObject.getJSONArray("dataNodes").length()); for (int i = 0; i < jsonObject.getJSONArray("dataNodes").length(); ++i) { this.dataNodes.add(new DataNode(this, jsonObject.getJSONArray("dataNodes").getJSONObject(i))); } validate(); }

Target:
public Datacenter(HardwareLayout hardwareLayout, JSONObject jsonObject) throws JSONException { if (logger.isTraceEnabled()) logger.trace("Datacenter " + jsonObject.toString()); this.hardwareLayout = hardwareLayout; this.name = jsonObject.getString("name"); this.dataNodes = new ArrayList<DataNode>(jsonObject.getJSONArray("dataNodes").length()); for (int i = 0; i < jsonObject.getJSONArray("dataNodes").length(); ++i) { this.dataNodes.add(new DataNode(this, jsonObject.getJSONArray("dataNodes").getJSONObject(i))); } this.rawCapacityInBytes = calculateRawCapacityInBytes(); validate(); }
Source:
public void sortJudges_simple() { Judge judgeOne = new Judge("Kamil Graczyk", Judge.JudgeRole.REPORTING_JUDGE); Judge judgeTwo = new Judge("Marzena Kisiela", Judge.JudgeRole.PRESIDING_JUDGE); CommonCourtJudgment unsortedJudgment = new CommonCourtJudgment(); unsortedJudgment.addJudge(judgeOne); unsortedJudgment.addJudge(judgeTwo); CommonCourtJudgment sortedJudgment = (CommonCourtJudgment)judgmentDetailsSortService.sortJudges(unsortedJudgment); assertEquals(2, sortedJudgment.getJudges().size()); assertEquals(judgeTwo, sortedJudgment.getJudges().get(0)); assertEquals(judgeOne, sortedJudgment.getJudges().get(1)); }

Target:
public void sortJudges_simple() { Judge judgeOne = new Judge("Kamil Graczyk", Judge.JudgeRole.REPORTING_JUDGE); Judge judgeTwo = new Judge("Marzena Kisiela", Judge.JudgeRole.PRESIDING_JUDGE); Judgment unsortedJudgment = new CommonCourtJudgment(); unsortedJudgment.addJudge(judgeOne); unsortedJudgment.addJudge(judgeTwo); Judgment sortedJudgment = judgmentDetailsSortService.sortJudges(unsortedJudgment); assertEquals(2, sortedJudgment.getJudges().size()); assertEquals(judgeTwo, sortedJudgment.getJudges().get(0)); assertEquals(judgeOne, sortedJudgment.getJudges().get(1)); }
Source:
public void validateEnums(Host host) { if (host.isSetPowerManagement()) { for (PmProxy proxy : host.getPowerManagement().getPmProxies().getPmProxy()) { validateEnum(PmProxyType.class, proxy.getPropietary(), true); } } }

Target:
public void validateEnums(Host host) { if (host.isSetPowerManagement()) { if (host.getPowerManagement().isSetPmProxies()) { for (PmProxy proxy : host.getPowerManagement().getPmProxies().getPmProxy()) { validateEnum(PmProxyType.class, proxy.getPropietary(), true); } } } }
Source:
private OperationResponse getOperationResponse(final ModelNode simpleResponse, final int batchId) throws IOException { final ModelNode streamHeader = simpleResponse.hasDefined("response-headers") && simpleResponse.get("response-headers").hasDefined("attached-streams") ? simpleResponse.get("response-headers", "attached-streams") : null; if (streamHeader != null && streamHeader.asInt() > 0) { return OperationResponseProxy.create(simpleResponse, getChannelAssociation(), batchId, streamHeader); } else { return OperationResponse.Factory.createSimple(simpleResponse); } }

Target:
private OperationResponse getOperationResponse(final ModelNode simpleResponse, final int batchId) throws IOException { final ModelNode streamHeader = simpleResponse.hasDefined(RESPONSE_HEADERS) && simpleResponse.get(RESPONSE_HEADERS).hasDefined(ATTACHED_STREAMS) ? simpleResponse.get(RESPONSE_HEADERS, ATTACHED_STREAMS) : null; if (streamHeader != null && streamHeader.asInt() > 0) { return OperationResponseProxy.create(simpleResponse, getChannelAssociation(), batchId, streamHeader); } else { return OperationResponse.Factory.createSimple(simpleResponse); } }
Source:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_REGIONS, "DEFAULT"); properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "X-Object-Meta-"); properties.setProperty(Constants.PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_REGIONS, "DEFAULT"); properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "X-Object-Meta-"); properties.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); return properties; }
Source:
private void handleError(RuleContext ctx, Report errorReport, RuntimeException pmde) { pmde.printStackTrace(); project.log(pmde.toString(), Project.MSG_VERBOSE); Throwable cause = pmde.getCause(); if (cause != null) { try (StringWriter strWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(strWriter)) { cause.printStackTrace(printWriter); project.log(strWriter.toString(), Project.MSG_VERBOSE); } catch (IOException e) { e.printStackTrace(); } if (StringUtils.isNotBlank(cause.getMessage())) { project.log(cause.getMessage(), Project.MSG_VERBOSE); } } if (failOnError) { throw new BuildException(pmde); } errorReport.addError(new Report.ProcessingError(pmde, ctx.getSourceCodeFilename())); }

Target:
private void handleError(RuleContext ctx, Report errorReport, RuntimeException pmde) { pmde.printStackTrace(); project.log(pmde.toString(), Project.MSG_VERBOSE); Throwable cause = pmde.getCause(); if (cause != null) { try (StringWriter strWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(strWriter)) { cause.printStackTrace(printWriter); project.log(strWriter.toString(), Project.MSG_VERBOSE); } catch (IOException e) { project.log("Error while closing stream", e, Project.MSG_ERR); } if (StringUtils.isNotBlank(cause.getMessage())) { project.log(cause.getMessage(), Project.MSG_VERBOSE); } } if (failOnError) { throw new BuildException(pmde); } errorReport.addError(new Report.ProcessingError(pmde, ctx.getSourceCodeFilename())); }
Source:
@Before public void setUp() throws Exception { file = folder.newFile(); file.delete(); }

Target:
@Before public void setUp() throws Exception { File parent = folder.getRoot(); file = new File(parent, "queue-file"); }
Source:
protected void serviceStop() throws Exception { try { tokenRenewer.shutdown(); if (!tokenRenewer.awaitTermination(100L, TimeUnit.MILLISECONDS)) { tokenRenewer.shutdownNow(); } } catch (InterruptedException ex) { tokenRenewer.shutdownNow(); } waiter.await(); Path lockFile = getLockFilePath(); if (lockFile.toFile().exists()) { FileChannel fc = FileChannel.open(lockFile, StandardOpenOption.WRITE); FileLock fl = null; try { fl = fc.tryLock(); if (fl != null) { FileUtils.deleteQuietly(lockFile.toFile()); } } catch (Exception ex) { } finally { if (fl != null) { fl.release(); } } } super.serviceStop(); }

Target:
protected void serviceStop() throws Exception { try { tokenRenewer.shutdown(); if (!tokenRenewer.awaitTermination(100L, TimeUnit.MILLISECONDS)) { tokenRenewer.shutdownNow(); } } catch (InterruptedException ex) { tokenRenewer.shutdownNow(); Thread.currentThread().interrupt(); } waiter.await(); Path lockFile = getLockFilePath(); if (lockFile.toFile().exists()) { FileChannel fc = FileChannel.open(lockFile, StandardOpenOption.WRITE); try (FileLock fl = fc.tryLock()) { if (fl != null) { FileUtils.deleteQuietly(lockFile.toFile()); } } catch (Exception ex) { Thread.currentThread().interrupt(); } } super.serviceStop(); }
Source:
private String generateFromArraySchema(ArraySchema schema) { if (schema.getExample() instanceof String) { return (String) schema.getExample(); } StringBuilder json = new StringBuilder(); if (schema.getExample() instanceof Iterable) { try { return Json.mapper().writeValueAsString(schema.getExample()); } catch (JsonProcessingException e) { LOG.warn( "Failed to encode Example Object. Falling back to default example generation"); } } json.append(generate(schema.getItems())); return createJsonArrayWith(json.toString()); }

Target:
private String generateFromArraySchema(ArraySchema schema) { if (schema.getExample() instanceof String) { return (String) schema.getExample(); } if (schema.getExample() instanceof Iterable) { try { return Json.mapper().writeValueAsString(schema.getExample()); } catch (JsonProcessingException e) { LOG.warn( "Failed to encode Example Object. Falling back to default example generation", e); } } return createJsonArrayWith(generate(schema.getItems())); }
Source:
public static String getOxdVersion() { try { MavenXpp3Reader reader = new MavenXpp3Reader(); Model model = null; if ((new File("pom.xml")).exists()) model = reader.read(new FileReader("pom.xml")); String oxdVersion = model != null ? model.getVersion() : OxdServerApplication.class.getPackage().getImplementationVersion(); return oxdVersion; } catch (IOException | XmlPullParserException e) { throw new RuntimeException(e.getMessage(), e); } }

Target:
public static String getOxdVersion() { return !Strings.isNullOrEmpty(System.getProperty("projectVersion")) ? System.getProperty("projectVersion") : OxdServerApplication.class.getPackage().getImplementationVersion(); }
Source:
public JavaWriter beginType(String type, String kind, Set<Modifier> modifiers, String extendsType, String... implementsTypes) throws IOException { indent(); emitModifiers(modifiers); out.write(kind); out.write(" "); emitType(type); if (extendsType != null) { out.write(" extends "); emitType(extendsType); } if ((implementsTypes != null) && (implementsTypes.length > 0)) { out.write("\n"); indent(); out.write(" implements "); for (int i = 0; i < implementsTypes.length; i++) { if (i != 0) { out.write(", "); } emitType(implementsTypes[i]); } } out.write(" {\n"); pushScope(Scope.TYPE_DECLARATION); return this; }

Target:
public JavaWriter beginType(String type, String kind, Set<Modifier> modifiers, String extendsType, String... implementsTypes) throws IOException { indent(); emitModifiers(modifiers); out.write(kind); out.write(" "); emitType(type); if (extendsType != null) { out.write(" extends "); emitType(extendsType); } if (implementsTypes.length > 0) { out.write("\n"); indent(); out.write(" implements "); for (int i = 0; i < implementsTypes.length; i++) { if (i != 0) { out.write(", "); } emitType(implementsTypes[i]); } } out.write(" {\n"); pushScope(Scope.TYPE_DECLARATION); return this; }
Source:
public void shouldReturnNoViolationsForPerfectFile() { ReviewFile reviewFile = new ReviewFile(REVIEW_FILE_WITHOUT_VIOLATIONS); Review review = getReview(REVIEW_FILE_WITHOUT_VIOLATIONS); ReviewResult result = sut.process(review); assertThat(result).isNotNull(); assertThat(result.getViolations()).isNotNull().isEmpty(); }

Target:
public void shouldReturnNoViolationsForPerfectFile() { Review review = getReview(REVIEW_FILE_WITHOUT_VIOLATIONS); ReviewResult result = sut.process(review); assertThat(result).isNotNull(); assertThat(result.getViolations()).isEmpty(); }
Source:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); if (values.length == MEMBER_COUNT) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); state.setCaretPosition(Integer.parseInt(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); state.setCaretPosition( CommitMessageComponentState.CARET_DEFAULT_POSITION); } else { return null; } return state; }

Target:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null || values.length < MEMBER_COUNT_WITHOUT_CARET_POSITION) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); if (values.length == MEMBER_COUNT) { state.setCaretPosition(Integer.parseInt(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCaretPosition( CommitMessageComponentState.CARET_DEFAULT_POSITION); } return state; }
Source:
static void appendVersionComponent(StringBuilder val, int versionNumber) { if (versionNumber > -1) { if (val.length() != 0) { val.append("."); } val.append(versionNumber); } }

Target:
private static void appendVersionComponent(StringBuilder val, int versionNumber) { if (versionNumber > -1) { if (val.length() != 0) { val.append("."); } val.append(versionNumber); } }
Source:
protected void cancelled() { logger.debug("Subscriber cancelled, ignoring the rest of the body"); try { future.done(); } catch (Exception t) { logger.error(t.getMessage(), t); } channelManager.releaseChannelLock(future.getPartitionKey()); channelManager.closeChannel(channel); channel.pipeline().remove(StreamedResponsePublisher.class); }

Target:
protected void cancelled() { logger.debug("Subscriber cancelled, ignoring the rest of the body"); try { future.done(); } catch (Exception t) { logger.debug(t.getMessage(), t); } channelManager.closeChannel(channel); }
Source:
public static CompositeFilter all(Filter first, Filter... rest) { return composeFilters(asList(first, rest), ALL); }

Target:
public static CompositeFilter all(Filter first, Filter... rest) { checkNotNull(first); checkNotNull(rest); return composeFilters(asList(first, rest), ALL); }