auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<PaymentWorksVendorUpdatesDTO> getPendingAddressVendorUpdatesFromPaymentWorks() { PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); boolean moreRecords = true; Client client = buildClient(); ClientResponse response = client.handle(buildClientRequest(buildPendingAddressVendorUpdatesFromPaymentWorksURL())); while (moreRecords) { updateVendorsRoot = response.getEntity(PaymentWorksVendorUpdatesRootDTO.class); LOG.debug("getPendingAddressVendorUpdatesFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == 200) { if (ObjectUtils.isNotNull(updateVendorsRoot)) { LOG.info("getPendingAddressVendorUpdatesFromPaymentWorks, Vendor Updates retrieved: " + updateVendorsRoot.getCount()); } if (updateVendorsRoot.getCount() > 0) { vendorUpdates.addAll(updateVendorsRoot.getVendorUpdates().getNewVendorList()); } if (StringUtils.isNotEmpty(updateVendorsRoot.getNext())) { response = client.handle(buildClientRequest(updateVendorsRoot.getNext())); } else { moreRecords = false; } } else { LOG.error("getPendingAddressVendorUpdatesFromPaymentWorks, Failed to retrieve Pending Vendor Updates: " + response.getEntity(String.class)); moreRecords = false; } } return vendorUpdates; }

Target:
public List<PaymentWorksVendorUpdatesDTO> getPendingAddressVendorUpdatesFromPaymentWorks() { PaymentWorksVendorUpdatesRootDTO updateVendorsRoot = null; List<PaymentWorksVendorUpdatesDTO> vendorUpdates = new ArrayList<PaymentWorksVendorUpdatesDTO>(); processVendorUpdates(vendorUpdates, buildPendingAddressVendorUpdatesFromPaymentWorksURL()); return vendorUpdates; }
Source:
static boolean isPinningAndMigrationValid(List<String> reasons, VmStatic vmStaticData, String cpuPinning) { final boolean cpuPingMigrationEnabled = Boolean.TRUE.equals(Config.<Boolean> GetValue(ConfigValues.CpuPinMigrationEnabled)); if (!cpuPingMigrationEnabled && vmStaticData.getMigrationSupport() == MigrationSupport.MIGRATABLE && StringUtils.isNotEmpty(cpuPinning)) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString()); return false; } return true; }

Target:
static boolean isPinningAndMigrationValid(List<String> reasons, VmStatic vmStaticData, String cpuPinning) { final boolean cpuPinMigrationEnabled = Boolean.TRUE.equals(Config.<Boolean> GetValue(ConfigValues.CpuPinMigrationEnabled)); if (!cpuPinMigrationEnabled && vmStaticData.getMigrationSupport() == MigrationSupport.MIGRATABLE && StringUtils.isNotEmpty(cpuPinning)) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString()); return false; } return true; }
Source:
public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (applicationContext == null) { return null; } Class<?> parameterType = parameters[parameterIndex].getType(); Map<String, ?> beansFound = applicationContext.getBeansOfType(parameterType); if (beansFound.isEmpty()) { return null; } else if (beansFound.size() > 1) { final AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); if (beanFactory instanceof ConfigurableListableBeanFactory) { final ConfigurableListableBeanFactory clBeanFactory = (ConfigurableListableBeanFactory) beanFactory; for (Map.Entry<String, ?> bean : beansFound.entrySet()) { final Qualifier qualifier = parameters[parameterIndex].getAnnotation(Qualifier.class); if (qualifier != null && SpringUtils.isQualifierMatch(bean.getKey(), clBeanFactory, qualifier.value())) { return new SpringBeanParameterResolver(beanFactory, bean.getKey()); } } for (Map.Entry<String, ?> bean : beansFound.entrySet()) { if (clBeanFactory.containsBeanDefinition(bean.getKey()) && clBeanFactory.getBeanDefinition(bean.getKey()).isPrimary()) { return new SpringBeanParameterResolver(beanFactory, bean.getKey()); } } } if (logger.isWarnEnabled()) { logger.warn("{} beans of type found, but none was marked as primary and parameter lacks @Qualifier. Ignoring this parameter.", beansFound.size(), parameterType.getSimpleName()); } return null; } else { return new SpringBeanParameterResolver(applicationContext.getAutowireCapableBeanFactory(), beansFound.keySet().iterator().next()); } }

Target:
public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (applicationContext == null) { return null; } Class<?> parameterType = parameters[parameterIndex].getType(); Map<String, ?> beansFound = applicationContext.getBeansOfType(parameterType); if (beansFound.isEmpty()) { return null; } else if (beansFound.size() > 1) { final AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); if (beanFactory instanceof ConfigurableListableBeanFactory) { Optional<ParameterResolver> resolver = findQualifiedBean(beansFound, (ConfigurableListableBeanFactory) beanFactory, parameters, parameterIndex); if (resolver.isPresent()) { return resolver.get(); } } if (logger.isWarnEnabled()) { logger.warn("{} beans of type found, but none was marked as primary and parameter lacks @Qualifier. Ignoring this parameter.", beansFound.size(), parameterType.getSimpleName()); } return null; } else { return new SpringBeanParameterResolver(applicationContext.getAutowireCapableBeanFactory(), beansFound.keySet().iterator().next()); } }
Source:
private CorruptionCheckViolation timestampInvariantsViolationLevel(NamespaceAndUseCase namespaceAndUseCase) { Stream<Long> expectedSortedTimestamps = KeyedStream.stream(getLearnerLogs(namespaceAndUseCase)) .map(PaxosValue::getData) .filter(Predicates.notNull()) .mapEntries((sequence, timestamp) -> Maps.immutableEntry(sequence, PtBytes.toLong(timestamp))) .entries() .sorted(Comparator.comparingLong(Map.Entry::getKey)) .map(Map.Entry::getValue); return StreamEx.of(expectedSortedTimestamps) .pairMap((first, second) -> first >= second) .anyMatch(x -> x) ? CorruptionCheckViolation.CLOCK_WENT_BACKWARDS : CorruptionCheckViolation.NONE; }

Target:
private CorruptionCheckViolation timestampInvariantsViolationLevel(NamespaceAndUseCase namespaceAndUseCase) { Stream<Long> expectedSortedTimestamps = KeyedStream.stream(getLearnerLogs(namespaceAndUseCase)) .map(PaxosValue::getData) .filter(Objects::nonNull) .mapEntries((sequence, timestamp) -> Maps.immutableEntry(sequence, PtBytes.toLong(timestamp))) .entries() .sorted(Comparator.comparingLong(Map.Entry::getKey)) .map(Map.Entry::getValue); return StreamEx.of(expectedSortedTimestamps) .pairMap((first, second) -> first >= second) .anyMatch(x -> x) ? CorruptionCheckViolation.CLOCK_WENT_BACKWARDS : CorruptionCheckViolation.NONE; }
Source:
private void decorateBackupFromLoggingRequest(Backup backup, LoggingRequest loggingRequest) { if (loggingRequest != null) { backup.setStorageLocation(loggingRequest.getStorageLocation()); if (loggingRequest.getS3() != null) { S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters(); s3Params.setInstanceProfile(loggingRequest.getS3().getInstanceProfile()); backup.setS3(s3Params); } else if (loggingRequest.getAdlsGen2() != null) { AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters(); AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = loggingRequest.getAdlsGen2(); adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey()); adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName()); adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure()); adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity()); backup.setAdlsGen2(adlsGen2Params); } else if (loggingRequest.getGcs() != null) { GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters(); GcsCloudStorageV1Parameters gcsFromRequest = loggingRequest.getGcs(); gcsParams.setServiceAccountEmail(gcsFromRequest.getServiceAccountEmail()); backup.setGcs(gcsFromRequest); } } }

Target:
private void decorateBackupFromLoggingRequest(Backup backup, LoggingRequest loggingRequest) { if (loggingRequest != null) { backup.setStorageLocation(loggingRequest.getStorageLocation()); if (loggingRequest.getS3() != null) { S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters(); s3Params.setInstanceProfile(loggingRequest.getS3().getInstanceProfile()); backup.setS3(s3Params); } else if (loggingRequest.getAdlsGen2() != null) { AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters(); AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = loggingRequest.getAdlsGen2(); adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey()); adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName()); adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure()); adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity()); backup.setAdlsGen2(adlsGen2Params); } else if (loggingRequest.getGcs() != null) { GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters(); GcsCloudStorageV1Parameters gcsFromRequest = loggingRequest.getGcs(); gcsParams.setServiceAccountEmail(gcsFromRequest.getServiceAccountEmail()); backup.setGcs(gcsParams); } } }
Source:
public void viewedScreen(String nameOfScreen) { analytics.enqueue(ScreenMessage.builder(nameOfScreen) .userId(mapboxUsername) ); }

Target:
public void viewedScreen(String nameOfScreen) { analytics.enqueue(ScreenMessage.builder(nameOfScreen).userId(MAPBOX_USERNAME)); }
Source:
public static void addFromFacet(@CheckForNull String ancestorImageId, @Nonnull String descendantImageId, @Nonnull Run<?,?> run) throws IOException { long timestamp = System.currentTimeMillis(); if (ancestorImageId != null) { Fingerprint f = make(run, ancestorImageId); Collection<FingerprintFacet> facets = f.getFacets(); DockerAncestorFingerprintFacet ancestorFacet = null; for (FingerprintFacet facet : facets) { if (facet instanceof DockerAncestorFingerprintFacet) { ancestorFacet = (DockerAncestorFingerprintFacet) facet; break; } } BulkChange bc = new BulkChange(f); try { if (ancestorFacet == null) { ancestorFacet = new DockerAncestorFingerprintFacet(f, timestamp, ancestorImageId); facets.add(ancestorFacet); } ancestorFacet.addDescendantImageId(descendantImageId); ancestorFacet.addFor(run); bc.commit(); } finally { bc.abort(); } } Fingerprint f = make(run, descendantImageId); Collection<FingerprintFacet> facets = f.getFacets(); DockerDescendantFingerprintFacet descendantFacet = null; for (FingerprintFacet facet : facets) { if (facet instanceof DockerDescendantFingerprintFacet) { descendantFacet = (DockerDescendantFingerprintFacet) facet; break; } } BulkChange bc = new BulkChange(f); try { if (descendantFacet == null) { descendantFacet = new DockerDescendantFingerprintFacet(f, timestamp, descendantImageId); facets.add(descendantFacet); } descendantFacet.addAncestorImageId(ancestorImageId); descendantFacet.addFor(run); bc.commit(); } finally { bc.abort(); } }

Target:
public static void addFromFacet(@CheckForNull String ancestorImageId, @Nonnull String descendantImageId, @Nonnull Run<?,?> run) throws IOException { long timestamp = System.currentTimeMillis(); if (ancestorImageId != null) { Fingerprint f = make(run, ancestorImageId); Collection<FingerprintFacet> facets = f.getFacets(); DockerDescendantFingerprintFacet descendantFacet = null; for (FingerprintFacet facet : facets) { if (facet instanceof DockerDescendantFingerprintFacet) { descendantFacet = (DockerDescendantFingerprintFacet) facet; break; } } BulkChange bc = new BulkChange(f); try { if (descendantFacet == null) { descendantFacet = new DockerDescendantFingerprintFacet(f, timestamp, ancestorImageId); facets.add(descendantFacet); } descendantFacet.addDescendantImageId(descendantImageId); descendantFacet.addFor(run); bc.commit(); } finally { bc.abort(); } } Fingerprint f = make(run, descendantImageId); Collection<FingerprintFacet> facets = f.getFacets(); DockerAncestorFingerprintFacet ancestorFacet = null; for (FingerprintFacet facet : facets) { if (facet instanceof DockerAncestorFingerprintFacet) { ancestorFacet = (DockerAncestorFingerprintFacet) facet; break; } } BulkChange bc = new BulkChange(f); try { if (ancestorFacet == null) { ancestorFacet = new DockerAncestorFingerprintFacet(f, timestamp, descendantImageId); facets.add(ancestorFacet); } if (ancestorImageId != null) { ancestorFacet.addAncestorImageId(ancestorImageId); } ancestorFacet.addFor(run); bc.commit(); } finally { bc.abort(); } }
Source:
private Entry getEntry(ParsedRegistryID parsedID) { Entry entry; if (parsedID.isTool()) { entry = toolDAO.findPublishedByToolPath(parsedID.getPath(), parsedID.getToolName()); } else { String workflowPath = parsedID.getPath(); if (!(parsedID.getToolName() == null)) { workflowPath += "/" + parsedID.getToolName(); } entry = workflowDAO.findPublishedByWorkflowPath(workflowPath, parsedID.getToolName()); } return entry; }

Target:
private Entry getEntry(ParsedRegistryID parsedID) { Entry entry; if (parsedID.isTool()) { entry = toolDAO.findPublishedByToolPath(parsedID.getPath(), parsedID.getToolName()); } else { String workflowPath = parsedID.getPath(); if (parsedID.getToolName() != null) { workflowPath += "/" + parsedID.getToolName(); } entry = workflowDAO.findPublishedByWorkflowPath(workflowPath, parsedID.getToolName()); } return entry; }
Source:
public void userAgentHeader() throws Exception { String versionName = GeneratedBuildParameters.PROJECT_VERSION; assertThat(versionName).isNotEmpty(); assertThat(versionName).doesNotContain("${"); client.fetchSpace(); RecordedRequest request = server.takeRequest(); assertThat(request.getHeader("User-Agent")).startsWith("contentful.java/" + versionName); }

Target:
public void userAgentHeader() throws Exception { String versionName = GeneratedBuildParameters.PROJECT_VERSION; assertThat(versionName).matches("^\\d+\\.\\d+\\.\\d+(-\\w+)?$"); client.fetchSpace(); RecordedRequest request = server.takeRequest(); assertThat(request.getHeader("User-Agent")).startsWith("contentful.java/" + versionName); }
Source:
protected GlusterGeoRepSession getSession(String masterVolumeName, Map<String, Object> innerMap) { GlusterGeoRepSession geoRepSession = new GlusterGeoRepSession(); String sessionKey = (String) innerMap.get(SESSION_KEY); String[] sessSplit = sessionKey.split("([://]+)"); String slaveNode = sessSplit.length == 5 ? sessSplit[sessSplit.length - 3] : sessSplit[sessSplit.length - 2]; if(slaveNode.contains("@")) { String[] hostComponents = slaveNode.split("@"); slaveNode = hostComponents[hostComponents.length - 1]; geoRepSession.setUserName(hostComponents[0]); } String slaveVolume = (String) innerMap.get(REMOTE_VOL_NAME); geoRepSession.setSlaveHostName(slaveNode); geoRepSession.setSlaveVolumeName(slaveVolume); geoRepSession.setSessionKey(sessionKey); geoRepSession.setMasterVolumeName(masterVolumeName); return geoRepSession; }

Target:
protected GlusterGeoRepSession getSession(String masterVolumeName, Map<String, Object> innerMap) { GlusterGeoRepSession geoRepSession = new GlusterGeoRepSession(); String sessionKey = (String) innerMap.get(SESSION_KEY); String[] sessSplit = sessionKey.split("([://]+)"); String slaveNode = sessSplit[2]; if(slaveNode.contains("@")) { String[] hostComponents = slaveNode.split("@"); slaveNode = hostComponents[hostComponents.length - 1]; geoRepSession.setUserName(hostComponents[0]); } String slaveVolume = (String) innerMap.get(REMOTE_VOL_NAME); geoRepSession.setSlaveHostName(slaveNode); geoRepSession.setSlaveVolumeName(slaveVolume); geoRepSession.setSessionKey(sessionKey); geoRepSession.setMasterVolumeName(masterVolumeName); return geoRepSession; }
Source:
public TransitionPropertyDialog(Shell shell, ActorClass ac, Transition trans) { super(shell, "Edit Transition", ac); this.trans = trans; m2s = new DetailCodeToString(); m2s_null_empty = new DetailCodeToString(true); s2m = new StringToDetailCode(); s2m_not_null = new StringToDetailCode(false); interfaceItems = new ArrayList<InterfaceItem>(); CommunicationType protocolCommType = null; switch(ac.getCommType()){ case EVENT_DRIVEN: case ASYNCHRONOUS: protocolCommType = CommunicationType.EVENT_DRIVEN; break; case DATA_DRIVEN: protocolCommType = CommunicationType.DATA_DRIVEN; break; case SYNCHRONOUS: protocolCommType = CommunicationType.SYNCHRONOUS; break; } if(protocolCommType == CommunicationType.EVENT_DRIVEN){ for(InterfaceItem item : RoomHelpers.getAllInterfaceItems(ac)){ ProtocolClass pc = RoomHelpers.getProtocol(item); if(pc != null && pc.getCommType() == protocolCommType) interfaceItems.add(item); } } inherited = RoomHelpers.getActorClass(trans)!=ac; refined = null; if (inherited) { if (getActorClass().getStateMachine()!=null) for (RefinedTransition rt : getActorClass().getStateMachine().getRefinedTransitions()) { if (rt.getTarget()==trans) { refined = rt; break; } } } if (inherited && refined==null) setTitle("View Transition"); }

Target:
public TransitionPropertyDialog(Shell shell, ActorClass ac, Transition trans) { super(shell, "Edit Transition", ac); this.trans = trans; m2s = new DetailCodeToString(); m2s_null_empty = new DetailCodeToString(true); s2m = new StringToDetailCode(); s2m_not_null = new StringToDetailCode(false); interfaceItems = new ArrayList<InterfaceItem>(); for(InterfaceItem item : RoomHelpers.getAllInterfaceItems(ac)){ ProtocolClass pc = RoomHelpers.getProtocol(item); if(pc != null && pc.getCommType() == CommunicationType.EVENT_DRIVEN) interfaceItems.add(item); } inherited = RoomHelpers.getActorClass(trans)!=ac; refined = null; if (inherited) { if (getActorClass().getStateMachine()!=null) for (RefinedTransition rt : getActorClass().getStateMachine().getRefinedTransitions()) { if (rt.getTarget()==trans) { refined = rt; break; } } } if (inherited && refined==null) setTitle("View Transition"); }
Source:
public String getFontConfKey(FontUtils.FontType fontType, String postfix) { StringBuilder result = new StringBuilder(); result.append("view."); result.append(fontTypePrefixes.get(fontType)); result.append(postfix); return result.toString(); }

Target:
private String getFontConfKey(FontUtils.FontType fontType, String postfix) { StringBuilder result = new StringBuilder(); result.append("view."); result.append(fontTypePrefixes.get(fontType)); result.append(postfix); return result.toString(); }
Source:
private String getLocalDependencyDir(){ String dependencyDir = System.getenv("ROBOLECTRIC_DEPENDENCY_DIR"); if (dependencyDir == null) { dependencyDir = System.getProperty("robolectric.dependency.dir"); } return dependencyDir; }

Target:
private String getLocalDependencyDir(){ return System.getProperty("robolectric.dependency.dir"); }
Source:
<E extends Entity> BinaryLatch removePropertyData( Iterable<PropertyEntry<E>> propertyEntries, Map<Long,Map<String,Object>> state, WritableFulltext index ) throws IOException { BinaryLatch completedLatch = new BinaryLatch(); FulltextIndexUpdate update = () -> { for ( PropertyEntry<E> propertyEntry : propertyEntries ) { if ( index.properties().contains( propertyEntry.key() ) ) { long entityId = propertyEntry.entity().getId(); Map<String,Object> allProperties = state.get( entityId ); if ( allProperties == null || allProperties.isEmpty() ) { index.getIndexWriter().deleteDocuments( newTermForChangeOrRemove( entityId ) ); } } } return Pair.of( index, completedLatch ); }; enqueueUpdate( update ); return completedLatch; }

Target:
<E extends Entity> AsyncFulltextIndexOperation removePropertyData( Iterable<PropertyEntry<E>> propertyEntries, Map<Long,Map<String,Object>> state, WritableFulltext index ) throws IOException { Latch completedLatch = new Latch(); FulltextIndexUpdate update = () -> { for ( PropertyEntry<E> propertyEntry : propertyEntries ) { if ( index.properties().contains( propertyEntry.key() ) ) { long entityId = propertyEntry.entity().getId(); Map<String,Object> allProperties = state.get( entityId ); if ( allProperties == null || allProperties.isEmpty() ) { index.getIndexWriter().deleteDocuments( newTermForChangeOrRemove( entityId ) ); } } } return Pair.of( index, completedLatch ); }; enqueueUpdate( update ); return completedLatch; }
Source:
public Environment(String name, ObjectMapper objectMapper, Validator validator, MetricRegistry metricRegistry, ClassLoader classLoader) { this.name = name; this.objectMapper = objectMapper; this.metricRegistry = metricRegistry; this.healthCheckRegistry = new HealthCheckRegistry(); this.validator = validator; this.servletContext = new MutableServletContextHandler(); servletContext.setClassLoader(classLoader); this.servletEnvironment = new ServletEnvironment(servletContext); this.adminContext = new MutableServletContextHandler(); adminContext.setClassLoader(classLoader); this.adminEnvironment = new AdminEnvironment(adminContext, healthCheckRegistry, metricRegistry); this.lifecycleEnvironment = new LifecycleEnvironment(); final DropwizardResourceConfig jerseyConfig = new DropwizardResourceConfig(metricRegistry); this.jerseyServletContainer = new JerseyContainerHolder(new ServletContainer(jerseyConfig)); this.jerseyEnvironment = new JerseyEnvironment(jerseyServletContainer, jerseyConfig); this.healthCheckExecutorService = this.lifecycle().executorService("TimeBoundHealthCheck-pool-%d") .workQueue(new ArrayBlockingQueue<Runnable>(4)) .minThreads(1) .maxThreads(4) .threadFactory(new ThreadFactoryBuilder().setDaemon(true).build()) .rejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()) .build(); }

Target:
public Environment(String name, ObjectMapper objectMapper, Validator validator, MetricRegistry metricRegistry, ClassLoader classLoader) { this.name = name; this.objectMapper = objectMapper; this.metricRegistry = metricRegistry; this.healthCheckRegistry = new HealthCheckRegistry(); this.validator = validator; this.servletContext = new MutableServletContextHandler(); servletContext.setClassLoader(classLoader); this.servletEnvironment = new ServletEnvironment(servletContext); this.adminContext = new MutableServletContextHandler(); adminContext.setClassLoader(classLoader); this.adminEnvironment = new AdminEnvironment(adminContext, healthCheckRegistry, metricRegistry); this.lifecycleEnvironment = new LifecycleEnvironment(); final DropwizardResourceConfig jerseyConfig = new DropwizardResourceConfig(metricRegistry); this.jerseyServletContainer = new JerseyContainerHolder(new ServletContainer(jerseyConfig)); this.jerseyEnvironment = new JerseyEnvironment(jerseyServletContainer, jerseyConfig); this.healthCheckExecutorService = this.lifecycle().executorService("TimeBoundHealthCheck-pool-%d") .workQueue(new ArrayBlockingQueue<Runnable>(1)) .minThreads(1) .maxThreads(4) .threadFactory(new ThreadFactoryBuilder().setDaemon(true).build()) .rejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()) .build(); }
Source:
public boolean isBranchesAllCommittedExcept(Artifact art, Branch branch) { boolean toReturn = false; try { toReturn = AtsBranchManagerCore.isBranchesAllCommittedExcept((TeamWorkFlowArtifact) art, branch); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex.toString(), ex); toReturn = false; } return toReturn; }

Target:
public boolean isBranchesAllCommittedExcept(Artifact art, Branch branch) { boolean toReturn = false; if (art instanceof TeamWorkFlowArtifact) { try { toReturn = AtsBranchManagerCore.isBranchesAllCommittedExcept((TeamWorkFlowArtifact) art, branch); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex.toString(), ex); toReturn = false; } } return toReturn; }
Source:
private boolean parseMessage(String message) { boolean error = false; XmlDocument doc = new XmlDocument(); doc.LoadXml(message); XmlNode node = doc.ChildNodes[0]; if (node != null) { StringBuilder sb = new StringBuilder(); AuditLogType logType; if (node.Attributes.get("status") == null) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_WARNING; } else if (node.Attributes.get("status").getValue().equals("OK")) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS; } else if (node.Attributes.get("status").getValue().equals("WARN")) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_WARNING; } else { error = true; logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_ERROR; } if ((node.Attributes.get("component") != null) && (StringUtils.isNotEmpty(node.Attributes.get("component").getValue()))) { sb.append("Step: " + node.Attributes.get("component").getValue()); } if ((node.Attributes.get("message") != null) && (StringUtils.isNotEmpty(node.Attributes.get("message").getValue()))) { sb.append("; "); sb.append("Details: " + node.Attributes.get("message").getValue()); sb.append(" "); } if ((node.Attributes.get("result") != null) && (StringUtils.isNotEmpty(node.Attributes.get("result").getValue()))) { sb.append(" (" + node.Attributes.get("result").getValue() + ")"); } AuditLogableBase logable = new AuditLogableBase(_vdsId); logable.AddCustomValue("Message", StringUtils.stripEnd(sb.toString(), " ")); AuditLogDirector.log(logable, logType); return error; } return error; }

Target:
private boolean parseMessage(String message) { boolean error = false; XmlDocument doc = new XmlDocument(); doc.LoadXml(message); XmlNode node = doc.ChildNodes[0]; if (node != null) { StringBuilder sb = new StringBuilder(); AuditLogType logType; if (node.Attributes.get("status") == null) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_WARNING; } else if (node.Attributes.get("status").getValue().equals("OK")) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS; } else if (node.Attributes.get("status").getValue().equals("WARN")) { logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_WARNING; } else { error = true; logType = AuditLogType.VDS_INSTALL_IN_PROGRESS_ERROR; } if ((node.Attributes.get("component") != null) && (StringUtils.isNotEmpty(node.Attributes.get("component").getValue()))) { sb.append("Step: " + node.Attributes.get("component").getValue()); } if ((node.Attributes.get("message") != null) && (StringUtils.isNotEmpty(node.Attributes.get("message").getValue()))) { sb.append("; "); sb.append("Details: " + node.Attributes.get("message").getValue()); sb.append(" "); } if ((node.Attributes.get("result") != null) && (StringUtils.isNotEmpty(node.Attributes.get("result").getValue()))) { sb.append(" (" + node.Attributes.get("result").getValue() + ")"); } AuditLogableBase logable = new AuditLogableBase(_vdsId); logable.AddCustomValue("Message", StringUtils.stripEnd(sb.toString(), " ")); AuditLogDirector.log(logable, logType); } return error; }
Source:
public void execute(WorkflowExecutor workflowExecutor) throws IOException { if (!isComplete()) throw new IllegalArgumentException("Workflow is not complete"); Pool pool = step1.getInput(); pool.setConcentration((double) step0.getInput()); workflowExecutor.save(pool); }

Target:
public void execute(WorkflowExecutor workflowExecutor) throws IOException { if (!isComplete()) throw new IllegalStateException("Workflow is not complete"); Pool pool = step1.getInput(); pool.setConcentration((double) step0.getInput()); workflowExecutor.save(pool); }
Source:
public NotesMergeConflictException(Note base, Note ours, Note theirs) { super(MessageFormat.format(JGitText.get().mergeConflictOnNotes, base.getName(), ours.getName(), theirs.getName())); }

Target:
public NotesMergeConflictException(Note base, Note ours, Note theirs) { super(MessageFormat.format(JGitText.get().mergeConflictOnNotes, noteOn(base, ours, theirs), noteData(base), noteData(ours), noteData(theirs))); }
Source:
public void onBreakBlock(BlockBreakEvent event) { final Player player = event.getPlayer(); for (ItemStack block : event.getBlock().getDrops()) { event.getBlock().setType(Material.AIR); player.getInventory().addItem(block); event.setCancelled(true); } }

Target:
public void onBreakBlock(BlockBreakEvent event) { final Player player = event.getPlayer(); if (player.getGameMode().equals(SURVIVAL)) { for (ItemStack stack : event.getBlock().getDrops()) { event.getBlock().setType(Material.AIR); player.getInventory().addItem(stack); event.setCancelled(true); } } }
Source:
private Git setUpRepoWithRemote() throws Exception { Repository remoteRepository = createWorkRepository(); Git remoteGit = new Git(remoteRepository); File sourceFile = new File(remoteRepository.getWorkTree(), "Test.txt"); FileOutputStream fos = new FileOutputStream(sourceFile); fos.write("Hello world".getBytes("UTF-8")); fos.close(); remoteGit.add().addFilepattern("Test.txt").call(); initialCommit = remoteGit.commit().setMessage("Initial commit").call(); fos = new FileOutputStream(sourceFile); fos.write("Some change".getBytes("UTF-8")); fos.close(); remoteGit.add().addFilepattern("Test.txt").call(); secondCommit = remoteGit.commit().setMessage("Second commit").call(); RefUpdate rup = remoteRepository.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.forceUpdate(); Repository localRepository = createWorkRepository(); Git localGit = new Git(localRepository); StoredConfig config = localRepository.getConfig(); RemoteConfig rc = new RemoteConfig(config, "origin"); rc.addURI(new URIish(remoteRepository.getDirectory().getPath())); rc.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/origin/*")); rc.update(config); config.save(); FetchResult res = localGit.fetch().setRemote("origin").call(); assertFalse(res.getTrackingRefUpdates().isEmpty()); rup = localRepository.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.forceUpdate(); rup = localRepository.updateRef(Constants.HEAD); rup.link("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.update(); return localGit; }

Target:
private Git setUpRepoWithRemote() throws Exception { Repository remoteRepository = createWorkRepository(); Git remoteGit = new Git(remoteRepository); writeTrashFile("Test.txt", "Hello world"); remoteGit.add().addFilepattern("Test.txt").call(); initialCommit = remoteGit.commit().setMessage("Initial commit").call(); writeTrashFile("Test.txt", "Some change"); remoteGit.add().addFilepattern("Test.txt").call(); secondCommit = remoteGit.commit().setMessage("Second commit").call(); RefUpdate rup = remoteRepository.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.forceUpdate(); Repository localRepository = createWorkRepository(); Git localGit = new Git(localRepository); StoredConfig config = localRepository.getConfig(); RemoteConfig rc = new RemoteConfig(config, "origin"); rc.addURI(new URIish(remoteRepository.getDirectory().getPath())); rc.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/origin/*")); rc.update(config); config.save(); FetchResult res = localGit.fetch().setRemote("origin").call(); assertFalse(res.getTrackingRefUpdates().isEmpty()); rup = localRepository.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.forceUpdate(); rup = localRepository.updateRef(Constants.HEAD); rup.link("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.update(); return localGit; }
Source:
private SystemEventType getSystemEventType(Contentlet contentlet, boolean isNew) { String methodName = isNew ? "SAVE" : "UPDATE"; String contentType = getType(contentlet); String eventName = String.format("%s_%s", methodName, contentType); try { return SystemEventType.valueOf(eventName); }catch(IllegalArgumentException e){ return null; } }

Target:
private SystemEventType getSystemEventType(Contentlet contentlet, boolean isNew) { String methodName = isNew ? SAVE_EVENT_PREFIX : UPDATE_EVENT_PREFIX; String contentType = getType(contentlet); String eventName = String.format("%s_%s", methodName, contentType); try { return SystemEventType.valueOf(eventName.toUpperCase()); }catch(IllegalArgumentException e){ return null; } }
Source:
private Job getJob() throws IOException { if ((null == this.queues) || (this.queues.isEmpty())) { return null; } final int queueSize = this.queues.size(); int count = 0; while (!this.shutDown) { if (!this.queueItor.hasNext()) { this.queueItor = this.queues.iterator(); } final Queue queue = this.queueItor.next(); final Job job = queue.pop(); if (null != job) { return job; } if (++count == queueSize) { break; } } return null; }

Target:
private Job getJob() throws IOException { if ((null == this.queues) || (this.queues.isEmpty())) { return null; } final int queueSize = this.queues.size(); int count = 0; while (!this.shutDown && (count < queueSize)) { if (!this.queueIter.hasNext()) { this.queueIter = this.queues.iterator(); } final Queue queue = this.queueIter.next(); final Job job = queue.pop(); if (null != job) { return job; } ++count; } return null; }
Source:
public void close() throws IOException { CloseQuietly.close(jsonParser); it = Iterators.emptyIterator(); }

Target:
public void close() throws IOException { if (jsonParser != null) { jsonParser.close(); } it = Iterators.emptyIterator(); }
Source:
public Exec createExec(final CreateExecParams params) throws IOException { final ExecConfig execConfig = new ExecConfig().withCmd(params.getCmd()) .withAttachStderr(params.isDetach() == Boolean.FALSE) .withAttachStdout(params.isDetach() == Boolean.FALSE); byte[] entityBytesArray = toJson(execConfig).getBytes(); try (DockerConnection connection = connectionFactory.openConnection(dockerDaemonUri) .method("POST") .path("/containers/" + params.getContainer() + "/exec") .header("Content-Type", MediaType.APPLICATION_JSON) .header("Content-Length", entityBytesArray.length) .entity(entityBytesArray)) { final DockerResponse response = connection.request(); if (response.getStatus() / 100 != 2) { throw getDockerException(response); } return new Exec(params.getCmd(), parseResponseStreamAndClose(response.getInputStream(), ExecCreated.class).getId()); } }

Target:
public Exec createExec(final CreateExecParams params) throws IOException { final ExecConfig execConfig = new ExecConfig().withCmd(params.getCmd()) .withAttachStderr(params.isDetach() == Boolean.FALSE) .withAttachStdout(params.isDetach() == Boolean.FALSE); byte[] entityBytesArray = toJson(execConfig).getBytes(StandardCharsets.UTF_8); try (DockerConnection connection = connectionFactory.openConnection(dockerDaemonUri) .method("POST") .path("/containers/" + params.getContainer() + "/exec") .header("Content-Type", MediaType.APPLICATION_JSON) .header("Content-Length", entityBytesArray.length) .entity(entityBytesArray)) { final DockerResponse response = connection.request(); if (response.getStatus() / 100 != 2) { throw getDockerException(response); } return new Exec(params.getCmd(), parseResponseStreamAndClose(response.getInputStream(), ExecCreated.class).getId()); } }
Source:
public void messageLogged(final BuildEvent event) { Object categoryObject = event.getTask(); if (categoryObject == null) { categoryObject = event.getTarget(); if (categoryObject == null) { categoryObject = event.getProject(); } } final Logger log = Logger.getLogger(categoryObject.getClass().getName()); switch (event.getPriority()) { case Project.MSG_WARN: log.warn(event.getMessage()); break; case Project.MSG_INFO: log.info(event.getMessage()); break; case Project.MSG_VERBOSE: case Project.MSG_DEBUG: log.debug(event.getMessage()); break; case Project.MSG_ERR: default: log.error(event.getMessage()); break; } }

Target:
public void messageLogged(final BuildEvent event) { Object categoryObject = event.getTask(); if (categoryObject == null) { categoryObject = event.getTarget(); if (categoryObject == null) { categoryObject = event.getProject(); } } final Logger log = Logger.getLogger(categoryObject.getClass().getName()); switch (event.getPriority()) { case Project.MSG_ERR: log.error(event.getMessage()); break; case Project.MSG_WARN: log.warn(event.getMessage()); break; case Project.MSG_INFO: log.info(event.getMessage()); break; case Project.MSG_VERBOSE: case Project.MSG_DEBUG: log.debug(event.getMessage()); break; default: log.error(event.getMessage()); break; } }
Source:
public FeedbackResponseCommentAttributes createFeedbackResponseComment( FeedbackResponseCommentAttributes frComment) throws InvalidParametersException, EntityDoesNotExistException { verifyIsCoursePresent(frComment.courseId); verifyIsInstructorOfCourse(frComment.courseId, frComment.giverEmail); verifyIsFeedbackSessionOfCourse(frComment.courseId, frComment.feedbackSessionName); try{ return frcDb.createEntity(frComment); } catch (EntityAlreadyExistsException e) { try{ FeedbackResponseCommentAttributes existingComment = new FeedbackResponseCommentAttributes(); existingComment = frcDb.getFeedbackResponseComment(frComment.feedbackResponseId, frComment.giverEmail, frComment.createdAt); if(existingComment == null){ existingComment = frcDb.getFeedbackResponseComment(frComment.courseId, frComment.createdAt, frComment.giverEmail); } frComment.setId(existingComment.getId()); return frcDb.updateFeedbackResponseComment(frComment, true); } catch(Exception EntityDoesNotExistException){ Assumption.fail(); return null; } } }

Target:
public FeedbackResponseCommentAttributes createFeedbackResponseComment( FeedbackResponseCommentAttributes frComment) throws InvalidParametersException, EntityDoesNotExistException { verifyIsCoursePresent(frComment.courseId); verifyIsInstructorOfCourse(frComment.courseId, frComment.giverEmail); verifyIsFeedbackSessionOfCourse(frComment.courseId, frComment.feedbackSessionName); try{ return frcDb.createEntity(frComment); } catch (EntityAlreadyExistsException e) { try{ FeedbackResponseCommentAttributes existingComment = new FeedbackResponseCommentAttributes(); existingComment = frcDb.getFeedbackResponseComment(frComment.feedbackResponseId, frComment.giverEmail, frComment.createdAt); if(existingComment == null){ existingComment = frcDb.getFeedbackResponseComment(frComment.courseId, frComment.createdAt, frComment.giverEmail); } frComment.setId(existingComment.getId()); return frcDb.updateFeedbackResponseComment(frComment); } catch(Exception EntityDoesNotExistException){ Assumption.fail(); return null; } } }
Source:
public void onConfigurationChange(Configuration newConf) { initReconfigurable(newConf); if (scheduler instanceof ConfigurationObserver) { ((ConfigurationObserver) scheduler).onConfigurationChange(newConf); } HBasePolicyProvider.init(newConf, authManager); }

Target:
public void onConfigurationChange(Configuration newConf) { initReconfigurable(newConf); if (scheduler instanceof ConfigurationObserver) { ((ConfigurationObserver) scheduler).onConfigurationChange(newConf); } System.setProperty("hadoop.policy.file", "hbase-policy.xml"); synchronized (authManager) { authManager.refresh(newConf, new HBasePolicyProvider()); } LOG.info("Refreshed hbase-policy.xml successfully"); ProxyUsers.refreshSuperUserGroupsConfiguration(newConf); LOG.info("Refreshed super and proxy users successfully"); }
Source:
public void handleSetActivityCalendarResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception, final String resultString) { LOGGER.info("handleSetActivityCalendarResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = responseMessageResultType; if (exception != null) { LOGGER.error("Set Activity Calendar Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultString) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSetActivityCalendarResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception, final String resultString) { LOGGER.info("handleSetActivityCalendarResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = responseMessageResultType; if (exception != null) { LOGGER.error("Set Activity Calendar Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultString) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
private SubmitLink saveLink() { return new SubmitLink("save"){ @Override public void onSubmit() { if(lgEntryPanel.getEntries().size() == 0) { error((String) new ParamResourceModel("oneLayerMinimum", getPage()).getObject()); return; } LayerGroupInfo lg = (LayerGroupInfo) lgModel.getObject(); if (!LayerGroupInfo.Mode.EO.equals(lg.getMode())) { lg.setRootLayer(null); lg.setRootLayerStyle(null); } else { if (lg.getRootLayerStyle() == null && lg.getRootLayer() != null) { lg.setRootLayerStyle(lg.getRootLayer().getDefaultStyle()); } } lg.getLayers().clear(); lg.getStyles().clear(); for ( LayerGroupEntry entry : lgEntryPanel.getEntries() ) { lg.getLayers().add(entry.getLayer()); lg.getStyles().add(entry.getStyle()); } Boolean queryable = queryableCheckBox.getModelObject(); if (!queryable) lg.setNotQueryableEnabled(true); else lg.setNotQueryableEnabled(null); try { AbstractLayerGroupPage.this.save(); } catch(Exception e) { error(e); LOGGER.log(Level.WARNING, "Error adding/modifying layer group.", e); } } }; }

Target:
private SubmitLink saveLink() { return new SubmitLink("save"){ @Override public void onSubmit() { if(lgEntryPanel.getEntries().size() == 0) { error((String) new ParamResourceModel("oneLayerMinimum", getPage()).getObject()); return; } LayerGroupInfo lg = (LayerGroupInfo) lgModel.getObject(); if (!LayerGroupInfo.Mode.EO.equals(lg.getMode())) { lg.setRootLayer(null); lg.setRootLayerStyle(null); } else { if (lg.getRootLayerStyle() == null && lg.getRootLayer() != null) { lg.setRootLayerStyle(lg.getRootLayer().getDefaultStyle()); } } lg.getLayers().clear(); lg.getStyles().clear(); for ( LayerGroupEntry entry : lgEntryPanel.getEntries() ) { lg.getLayers().add(entry.getLayer()); lg.getStyles().add(entry.getStyle()); } Boolean queryable = queryableCheckBox.getModelObject(); lg.setQueryDisabled(!queryable); try { AbstractLayerGroupPage.this.save(); } catch(Exception e) { error(e); LOGGER.log(Level.WARNING, "Error adding/modifying layer group.", e); } } }; }
Source:
public XBeeDevice(IConnectionInterface connectionInterface) { if (connectionInterface == null) throw new IllegalArgumentException("ConnectionInterface cannot be null."); this.connectionInterface = connectionInterface; this.logger = LoggerFactory.getLogger(XBeeDevice.class); }

Target:
public XBeeDevice(IConnectionInterface connectionInterface) { if (connectionInterface == null) throw new NullPointerException("ConnectionInterface cannot be null."); this.connectionInterface = connectionInterface; this.logger = LoggerFactory.getLogger(XBeeDevice.class); logger.debug(toString() + "Using the connection interface {}.", connectionInterface.getClass().getSimpleName(), connectionInterface.toString()); }
Source:
public void fit(EntryPointFitParameters entryPointFitParameters) throws IOException, InterruptedException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException { try { MultiLayerNetwork multiLayerNetwork; if ("sequential".equals(entryPointFitParameters.getType())) { multiLayerNetwork = KerasModelImport.importKerasSequentialModelAndWeights(entryPointFitParameters.getModelFilePath()); multiLayerNetwork.init(); } else { throw new RuntimeException("Model type unsupported! (" + entryPointFitParameters.getType() + ")"); } INDArray features = h5FileToNDArray(entryPointFitParameters.getTrainFeaturesFile()); INDArray labels = h5FileToNDArray(entryPointFitParameters.getTrainLabelsFile()); INDArrayIndex[] ndIndexes = new INDArrayIndex[features.shape().length]; for (int i = 0; i < ndIndexes.length; i++) { ndIndexes[i] = NDArrayIndex.all(); } for (int i = 0; i < entryPointFitParameters.getNbEpoch(); i++) { log.info("Fitting: " + i); int begin = 0; while (begin < features.size(0)) { int end = begin + entryPointFitParameters.getBatchSize(); if (log.isTraceEnabled()) { log.trace("Processing batch: " + begin + " " + end); } ndIndexes[0] = NDArrayIndex.interval(begin, end); INDArray featuresBatch = features.get(ndIndexes); INDArray labelsBatch = labels.get(NDArrayIndex.interval(begin, end)); multiLayerNetwork.fit(featuresBatch, labelsBatch); begin += entryPointFitParameters.getBatchSize(); } } log.info("Learning model finished"); } catch (Throwable e) { log.error("Error while handling request!", e); throw e; } }

Target:
public void fit(EntryPointFitParameters entryPointFitParameters) throws Exception { try { MultiLayerNetwork multiLayerNetwork = neuralNetworkReader.readNeuralNetwork(entryPointFitParameters); DataSetIterator dataSetIterator = new HDF5MiniBatchDataSetIterator( entryPointFitParameters.getTrainFeaturesDirectory(), entryPointFitParameters.getTrainLabelsDirectory() ); for (int i = 0; i < entryPointFitParameters.getNbEpoch(); i++) { log.info("Fitting: " + i); multiLayerNetwork.fit(dataSetIterator); } log.info("Learning model finished"); } catch (Throwable e) { log.error("Error while handling request!", e); throw e; } }
Source:
private void writeGoAwayFrame(ChannelHandlerContext ctx, Http2GoAwayFrame frame, ChannelPromise promise) { if (frame.lastStreamId() > -1) { frame.release(); throw new IllegalArgumentException("Last stream id must not be set on GOAWAY frame"); } int lastStreamCreated = connection().remote().lastStreamCreated(); long lastStreamId = lastStreamCreated + ((long) frame.extraStreamIds()) * 2; if (lastStreamId > MAX_VALUE) { lastStreamId = MAX_VALUE; } goAway(ctx, (int) lastStreamId, frame.errorCode(), frame.content(), promise); }

Target:
private void writeGoAwayFrame(ChannelHandlerContext ctx, Http2GoAwayFrame frame, ChannelPromise promise) { if (frame.lastStreamId() > -1) { frame.release(); throw new IllegalArgumentException("Last stream id must not be set on GOAWAY frame"); } int lastStreamCreated = connection().remote().lastStreamCreated(); long lastStreamId = lastStreamCreated + ((long) frame.extraStreamIds()) * 2; if (lastStreamId > Integer.MAX_VALUE) { lastStreamId = Integer.MAX_VALUE; } goAway(ctx, (int) lastStreamId, frame.errorCode(), frame.content(), promise); }
Source:
public TmfAnalysisRequirement instanciateRequirements(IKernelAnalysisEventLayout layout) { List<@Nullable String> eventNames = fEventNames.stream().map(l -> l.getEventName(layout)) .filter(name -> name != null) .collect(Collectors.toList()); List<String> nonNullEvents = new ArrayList<>(); for (String name : eventNames) { nonNullEvents.add(NonNullUtils.checkNotNull(name)); } return new TmfAnalysisEventRequirement(nonNullEvents, fLevel); }

Target:
public TmfAnalysisRequirement instanciateRequirements(IKernelAnalysisEventLayout layout) { Builder<String> events = new Builder<>(); for (ILayoutToEventName eventNameLayout : fEventNames) { String eventName = eventNameLayout.getEventName(layout); if (eventName != null) { events.add(eventName); } } return new TmfAnalysisEventRequirement(events.build(), fLevel); }
Source:
public boolean isEmpty() { return fQueueSize.get() == 0; }

Target:
public boolean isEmpty() { return (fQueueSize.get() == 0); }
Source:
public LenientComparisonStringNormalizer() { this(Lists.newArrayList()); }

Target:
public LenientComparisonStringNormalizer() { this(ImmutableList.of()); }
Source:
private static Set<RyaURI> getPropURIFromStrings(final String... props) { final Set<RyaURI> properties = new HashSet<>(); if (props != null) { for(final String prop : props) { if (prop != null) { properties.add(new RyaURI(prop)); } } } return properties; }

Target:
private static Set<RyaURI> getPropURIFromStrings(final String... props) { final Set<RyaURI> properties = new HashSet<>(); if (props != null) { for(final String prop : props) { if (StringUtils.isNotBlank(prop)) { properties.add(new RyaURI(prop)); } } } return properties; }