auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run() throws Exception { configureManagerForInMemoryUsage(); String appLocation = System.getProperty( APP_LOCATION ); ApplicationTemplate tpl = this.manager.applicationTemplateMngr().loadApplicationTemplate( new File( appLocation )); ManagedApplication ma = this.manager.applicationMngr().createApplication( "test", null, tpl ); Assert.assertNotNull( ma ); Assert.assertEquals( 1, this.manager.applicationMngr().getManagedApplications().size()); String targetId = this.manager.targetsMngr().findTargetId(ma.getApplication(), "/MySQL VM"); File dir = new File( this.manager.configurationMngr().getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId ); Utils.writeStringInto( "#!/bin/bash\necho toto > toto.txt", new File( dir, "totoscript-all.sh")); Utils.writeStringInto( "Bonjour le monde cruel", new File( dir, "titiscript.py")); Instance mysql = InstanceHelpers.findInstanceByPath( ma.getApplication(), "/MySQL VM/MySQL" ); Assert.assertNotNull( mysql ); this.manager.instancesMngr().deployAndStartAll(ma, null); Thread.sleep( 7000 ); this.manager.instancesMngr().changeInstanceState( ma, mysql.getParent(), InstanceStatus.DEPLOYED_STARTED ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, mysql.getParent().getStatus()); File vmDir = InstanceHelpers.findInstanceDirectoryOnAgent( mysql.getParent() ); File toto = new File( vmDir, "toto.txt" ); Assert.assertTrue( toto.exists() ); String s = Utils.readFileContent( toto ); List<File> files = Utils.listAllFiles(vmDir); Assert.assertEquals( "toto", s.trim() ); Assert.assertEquals( 3, files.size() ); }

Target:
public void run() throws Exception { configureManagerForInMemoryUsage(); String appLocation = System.getProperty( APP_LOCATION ); ApplicationTemplate tpl = this.manager.applicationTemplateMngr().loadApplicationTemplate( new File( appLocation )); ManagedApplication ma = this.manager.applicationMngr().createApplication( "test", null, tpl ); Assert.assertNotNull( ma ); Assert.assertEquals( 1, this.manager.applicationMngr().getManagedApplications().size()); String targetId = this.manager.targetsMngr().findTargetId(ma.getApplication(), "/MySQL VM"); File dir = new File( this.manager.configurationMngr().getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId ); Utils.writeStringInto( "#!/bin/bash\necho toto > toto.txt", new File( dir, "toto-script.sh")); Instance mysql = InstanceHelpers.findInstanceByPath( ma.getApplication(), "/MySQL VM/MySQL" ); Assert.assertNotNull( mysql ); this.manager.instancesMngr().deployAndStartAll(ma, null); Thread.sleep( 7000 ); this.manager.instancesMngr().changeInstanceState( ma, mysql.getParent(), InstanceStatus.DEPLOYED_STARTED ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, mysql.getParent().getStatus()); File vmDir = InstanceHelpers.findInstanceDirectoryOnAgent( mysql.getParent() ); List<File> files = Utils.listAllFiles(vmDir); Assert.assertEquals( 2, files.size() ); File script = new File( vmDir, "toto-script.sh"); File toto = new File( vmDir, "toto.txt" ); Assert.assertTrue( script.exists() ); Assert.assertTrue( toto.exists() ); String s = Utils.readFileContent( toto ); Assert.assertEquals( "toto", s.trim() ); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BetweenPredicate that = (BetweenPredicate) o; if (to != null ? !to.equals(that.to) : that.to != null) { return false; } return from != null ? from.equals(that.from) : that.from == null; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!super.equals(o)) { return false; } if (!(o instanceof BetweenPredicate)) { return false; } BetweenPredicate that = (BetweenPredicate) o; if (!that.canEqual(this)) { return false; } if (to != null ? !to.equals(that.to) : that.to != null) { return false; } return from != null ? from.equals(that.from) : that.from == null; }
Source:
private static void fireOnFailure(final NodeProvisioner.PlannedNode plannedNode, final Throwable cause) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onFailure(plannedNode, cause); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onFailure() listener call in " + cl + " for agent " + plannedNode.displayName, e); if (e instanceof Error) { throw e; } } } }

Target:
private static void fireOnFailure(final NodeProvisioner.PlannedNode plannedNode, final Throwable cause) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onFailure(plannedNode, cause); } catch (Error e) { throw e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onFailure() listener call in " + cl + " for agent " + plannedNode.displayName, e); } } }
Source:
private Getter instantiateGetter(Object targetObject, String attributeName) { String attributeNameWithoutArguments = extractAttributeNameNameWithoutArguments(attributeName); ValueExtractor valueExtractor = extractors.get(attributeNameWithoutArguments); if (valueExtractor != null) { Object arguments = argumentsParser.parse(extractArgumentsFromAttributeName(attributeName)); return new ExtractorGetter(ss, valueExtractor, arguments); } else { if (targetObject instanceof Data) { if (((Data) targetObject).isPortable()) { if (genericPortableGetter == null) { genericPortableGetter = new PortableGetter(ss); } return genericPortableGetter; } else if (((Data) targetObject).getType() == JAVASCRIPT_JSON_SERIALIZATION_TYPE) { return JsonDataGetter.INSTANCE; } else { throw new HazelcastSerializationException("No Data getter found for type " + ((Data) targetObject).getType()); } } else if (targetObject instanceof HazelcastJsonValue) { return JsonGetter.INSTANCE; } else { return ReflectionHelper.createGetter(targetObject, attributeName); } } }

Target:
private Getter instantiateGetter(Object targetObject, String attributeName) { String attributeNameWithoutArguments = extractAttributeNameNameWithoutArguments(attributeName); ValueExtractor valueExtractor = extractors.get(attributeNameWithoutArguments); if (valueExtractor != null) { Object arguments = argumentsParser.parse(extractArgumentsFromAttributeName(attributeName)); return new ExtractorGetter(ss, valueExtractor, arguments); } else { if (targetObject instanceof Data) { if (((Data) targetObject).isPortable()) { if (genericPortableGetter == null) { genericPortableGetter = new PortableGetter(ss); } return genericPortableGetter; } else if (((Data) targetObject).isJson()) { return JsonDataGetter.INSTANCE; } else { throw new HazelcastSerializationException("No Data getter found for type " + ((Data) targetObject).getType()); } } else if (targetObject instanceof HazelcastJsonValue) { return JsonGetter.INSTANCE; } else { return ReflectionHelper.createGetter(targetObject, attributeName); } } }
Source:
public void run() { try { Injector injector = makeInjector(); final Server jettyServer = injector.getInstance(Server.class); try { final Lifecycle lifecycle = initLifecycle(injector); Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { @Override public void run() { log.info("Running shutdown hook"); lifecycle.stop(); } } ) ); injector.getInstance(ExecutorLifecycle.class).join(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } log.info("Finished peon task"); try { jettyServer.stop(); } catch (Exception e) { log.error(e, "Error shutting down jetty"); } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public void run() { try { Injector injector = makeInjector(); try { final Lifecycle lifecycle = initLifecycle(injector); Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { @Override public void run() { log.info("Running shutdown hook"); lifecycle.stop(); } } ) ); injector.getInstance(ExecutorLifecycle.class).join(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } log.info("Finished peon task"); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
void foo() { int myInt = 4; boolean myBoolean = true; new Integer(myInt).toString(); Integer.toString(myInt); A.returnInteger(myInt).toString(); Integer.valueOf(myInt).toString(); bar(new Integer(myInt).toString()); new Boolean(myBoolean).toString(); Boolean.toString(myBoolean); Boolean.valueOf(myBoolean).toString(); Integer myInteger = returnInteger(myInt); myInteger.toString(); new Byte((byte) 0).toString(); new Character('c').toString(); new Short((short) 0).toString(); new Long(0L).toString(); new Float(0.0F).toString(); new Double(0.0).toString(); Integer.valueOf("4").toString(); }

Target:
void foo() { int myInt = 4; boolean myBoolean = true; new Integer(myInt).toString(); Integer.toString(myInt); A.returnInteger(myInt).toString(); Integer.valueOf(myInt).toString(); bar(new Integer(myInt).toString()); new Boolean(myBoolean).toString(); Boolean.toString(myBoolean); Boolean.valueOf(myBoolean).toString(); Integer myInteger = returnInteger(myInt); myInteger.toString(); new Byte((byte) 0).toString(); new Character('c').toString(); new Short((short) 0).toString(); new Long(0L).toString(); new Float(0.0F).toString(); new Double(0.0).toString(); Integer.valueOf("4").toString(); new Integer("4").toString(); }
Source:
public String generateDisplayId(Boolean parentDn){ DiscrepancyNote dn = null; String newDisplayId =null; do { String randomNo = StringUtils.leftPad(Integer.toString(RandomUtils.nextInt(0, 1000000000)), 9, '0'); newDisplayId = parentDn ? "DN_"+randomNo : "CDN_"+randomNo; dn = discrepancyNoteDao.findByDisplayId(newDisplayId); }while(dn != null); return newDisplayId; }

Target:
public String generateDisplayId(Boolean parentDn){ DiscrepancyNote dn = null; String newDisplayId =null; int counter = 0; do { String randomNo = StringUtils.leftPad(Integer.toString(RandomUtils.nextInt(0, 1000000000)), 9, '0'); newDisplayId = parentDn ? "DN_"+randomNo : "CDN_"+randomNo; dn = discrepancyNoteDao.findByDisplayId(newDisplayId); counter++; }while(dn != null && counter < 10); if(counter >= 10) throw new OpenClinicaSystemException("Failed", ErrorConstants.ERR_GENERATING_DISCREPANCY_NOTE_ID); return newDisplayId; }
Source:
private List<File> listOutputDirectories() { List<File> outputDirectories = new ArrayList<File>(); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, false)); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, true)); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (Module dependantModule : moduleRootManager.getDependencies()) { addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(dependantModule, false)); } return outputDirectories; }

Target:
private List<File> listOutputDirectories() { List<File> outputDirectories = new ArrayList<File>(); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, TEST_CLASSES)); addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(module, MAIN_CLASSES)); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (Module dependantModule : moduleRootManager.getDependencies()) { addOutputDirectory(outputDirectories, CompilerPaths.getModuleOutputPath(dependantModule, MAIN_CLASSES)); } return outputDirectories; }
Source:
private synchronized Connection getOrCreateConnection() throws IOException { if (connection == null) { logger.info("connectionId[{}] Creating and starting connection to {}:{}", connectionId, handler.getHostname(), handler.getProtocolPort()); final Reactor reactor = reactorProvider.createReactor(connectionId, handler.getMaxFrameSize()); connection = reactor.connectionToHost(handler.getHostname(), handler.getProtocolPort(), handler); reactorExceptionHandler = new ReactorExceptionHandler(); executor = new ReactorExecutor(reactor, Schedulers.single(), connectionId, reactorExceptionHandler, connectionOptions.getRetry().getTryTimeout(), connectionOptions.getFullyQualifiedNamespace()); executor.start(); } return connection; }

Target:
private synchronized Connection getOrCreateConnection() throws IOException { if (connection == null) { logger.info("connectionId[{}]: Creating and starting connection to {}:{}", connectionId, handler.getHostname(), handler.getProtocolPort()); final Reactor reactor = reactorProvider.createReactor(connectionId, handler.getMaxFrameSize()); connection = reactor.connectionToHost(handler.getHostname(), handler.getProtocolPort(), handler); reactorExceptionHandler = new ReactorExceptionHandler(); executor = new ReactorExecutor(reactor, Schedulers.single(), connectionId, reactorExceptionHandler, connectionOptions.getRetry().getTryTimeout(), connectionOptions.getFullyQualifiedNamespace()); executor.start(); } return connection; }
Source:
private void compareAccountMetadata() { Set<Account> primaryAccounts = new HashSet<>(primaryAccountService.getAllAccounts()); Set<Account> secondaryAccounts = new HashSet<>(secondaryAccountService.getAllAccounts()); if (!primaryAccounts.equals(secondaryAccounts)) { accountServiceMetrics.accountMetadataInconsistencyCount.inc(); logger.debug("Inconsistency detected between primary and secondary at for accounts ={}", SystemTime.getInstance().milliseconds(), primaryAccounts.removeAll(secondaryAccounts)); } }

Target:
void compareAccountMetadata() { if (!AccountUtils.compareAccounts(primaryAccountService.getAllAccounts(), secondaryAccountService.getAllAccounts())) { accountServiceMetrics.accountDataInconsistencyCount.inc(); } }
Source:
Object convert(byte[] data) throws IOException; } private static DeserializationRuntimeConverter createConverter( LogicalType type, String charsetName, boolean isBigEndian) { final DeserializationRuntimeConverter converter = createNotNullConverter(type, charsetName, isBigEndian); final Consumer<byte[]> validator = createDataLengthValidator(type); return new DeserializationRuntimeConverter() { private static final long serialVersionUID = 1L; @Override public void open() { converter.open(); } @Override public Object convert(byte[] data) throws IOException { if (data == null) { return null; } validator.accept(data); return converter.convert(data); } }; }

Target:
Object convert(byte[] data) throws IOException; } private static DeserializationRuntimeConverter createConverter( LogicalType type, String charsetName, boolean isBigEndian) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return createStringConverter(charsetName); case VARBINARY: case BINARY: return data -> data; case RAW: return RawValueData::fromBytes; case BOOLEAN: return data -> data[0] != 0; case TINYINT: return data -> data[0]; case SMALLINT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getShortBigEndian(0), segment -> segment.getShortLittleEndian(0) ); case INTEGER: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getIntBigEndian(0), segment -> segment.getIntLittleEndian(0) ); case BIGINT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getLongBigEndian(0), segment -> segment.getLongLittleEndian(0) ); case FLOAT: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getFloatBigEndian(0), segment -> segment.getFloatLittleEndian(0) ); case DOUBLE: return createEndiannessAwareConverter( isBigEndian, segment -> segment.getDoubleBigEndian(0), segment -> segment.getDoubleLittleEndian(0) ); default: throw new UnsupportedOperationException("'raw' format currently doesn't support type: " + type); } }
Source:
public void compress(ByteBuffer input, ByteBuffer output) { byte[] uncompressed = new byte[input.remaining()]; input.get(uncompressed); byte[] compressed = new byte[output.remaining()]; int compressedSize = compress(uncompressed, 0, uncompressed.length, compressed, 0, compressed.length); output.put(compressed, 0, compressedSize); }

Target:
public void compress(ByteBuffer input, ByteBuffer output) { throw new UnsupportedOperationException(); }
Source:
default <T extends AbstractElement> List<T> execute(Query query, Class<T> requestedEntity, Pager pager) { return null; }

Target:
default <T extends AbstractElement> Page<T> execute(Query query, Class<T> requestedEntity, Pager pager) { return null; }
Source:
private static String serializeBlockInfo(Config cfg) { try { StringWriter stringWriter = new StringWriter(); JsonWriter jsonWriter = new JsonWriter(stringWriter); jsonWriter.setLenient(true); jsonWriter.beginObject(); for (String key : cfg.getKeys()) { jsonWriter.name(key).value(cfg.getString(key)); } jsonWriter.endObject(); return stringWriter.toString(); } catch (IOException e) { throw new AssertionError(e); } }

Target:
private static String serializeBlockInfo(Config cfg) { try { StringWriter stringWriter = new StringWriter(); JsonWriter jsonWriter = new JsonWriter(stringWriter); jsonWriter.setLenient(true); jsonWriter.beginObject(); for (String key : cfg.getKeys()) { jsonWriter.name(key).value(cfg.getString(key)); } jsonWriter.endObject(); return stringWriter.toString(); } catch (IOException x) { Slimefun.getLogger().log(Level.SEVERE, "An error occurred while serializing BlockInfo", x); return null; } }
Source:
public int read() throws IOException { final int read = read(single, 0, 1); return read == 1 ? single[0] : -1; }

Target:
public int read() throws IOException { final int read = read(single, 0, 1); return read == 1 ? single[0] & 0xff : -1; }
Source:
private void addMergeConfig(Repository clonedRepo, Ref head) throws IOException { String branchName = Repository.shortenRefName(head.getName()); clonedRepo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REMOTE, remote); clonedRepo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_MERGE, head.getName()); String autosetupRebase = clonedRepo.getConfig().getString( ConfigConstants.CONFIG_BRANCH_SECTION, null, ConfigConstants.CONFIG_KEY_AUTOSETUPREBASE); if (ConfigConstants.CONFIG_KEY_ALWAYS.equals(autosetupRebase) || ConfigConstants.CONFIG_KEY_TRUE.equals(autosetupRebase)) clonedRepo.getConfig().setBoolean( ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REBASE, true); clonedRepo.getConfig().save(); }

Target:
private void addMergeConfig(Repository clonedRepo, Ref head) throws IOException { String branchName = Repository.shortenRefName(head.getName()); clonedRepo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REMOTE, remote); clonedRepo.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_MERGE, head.getName()); String autosetupRebase = clonedRepo.getConfig().getString( ConfigConstants.CONFIG_BRANCH_SECTION, null, ConfigConstants.CONFIG_KEY_AUTOSETUPREBASE); if (ConfigConstants.CONFIG_KEY_ALWAYS.equals(autosetupRebase) || ConfigConstants.CONFIG_KEY_REMOTE.equals(autosetupRebase)) clonedRepo.getConfig().setBoolean( ConfigConstants.CONFIG_BRANCH_SECTION, branchName, ConfigConstants.CONFIG_KEY_REBASE, true); clonedRepo.getConfig().save(); }
Source:
public void callback(Persona persona) { JButton personaButton = personaUIComponents.getPersonaActionButton(); if (persona != null) { personaUIComponents.getPersonaNameLabel().setText(persona.getName()); personaUIComponents.getPersonaActionButton().setText(Bundle.ContactArtifactViewer_persona_button_view()); for (ActionListener act : personaButton.getActionListeners()) { personaButton.removeActionListener(act); } personaButton.addActionListener(new ViewPersonaButtonListener (persona)); } personaButton.getParent().revalidate(); }

Target:
public void callback(Persona persona) { JButton personaButton = personaUIComponents.getPersonaActionButton(); if (persona != null) { personaUIComponents.getPersonaNameLabel().setText(persona.getName()); personaUIComponents.getPersonaActionButton().setText(Bundle.ContactArtifactViewer_persona_button_view()); for (ActionListener act : personaButton.getActionListeners()) { personaButton.removeActionListener(act); } personaButton.addActionListener(new ViewPersonaButtonListener(persona)); } personaButton.getParent().revalidate(); personaButton.getParent().repaint(); }
Source:
private KieBuilderImpl kieBuilderClone( final KieFileSystem kieFileSystemClone ) { KieBuilderImpl kieBuilder = null; if ( this.kieBuilder != null ) { kieBuilder = (KieBuilderImpl) createKieBuilder( kieFileSystemClone ); kieBuilder.setkModule( ( (KieBuilderImpl) this.kieBuilder ).getkModule() ); kieBuilder.setTrgMfs( ( (KieFileSystemImpl) kieFileSystemClone ).getMfs() ); } return kieBuilder; }

Target:
private KieBuilderImpl kieBuilderClone( final KieFileSystem kieFileSystemClone ) { KieBuilderImpl kieBuilder = null; if ( this.kieBuilder != null ) { kieBuilder = createKieBuilder( kieFileSystemClone ); kieBuilder.setkModule( ( (KieBuilderImpl) this.kieBuilder ).getkModule() ); kieBuilder.setTrgMfs( ( (KieFileSystemImpl) kieFileSystemClone ).getMfs() ); } return kieBuilder; }
Source:
public void verifyFileSystemConfiguration() { try { final FileSystem hdfs = getFileSystemInstance(); final String hdfsWorkingDir = configuration.configuration().getSinkConfiguration(name, FileSinkConfiguration.class).fileStrategy.workingDir; final String hdfsPublishDir = configuration.configuration().getSinkConfiguration(name, FileSinkConfiguration.class).fileStrategy.publishDir; if (!hdfs.isDirectory(new Path(hdfsWorkingDir))) { throw new RuntimeException("Working directory for in-flight AVRO records does not exist: " + hdfsWorkingDir); } if (!hdfs.isDirectory(new Path(hdfsPublishDir))) { throw new RuntimeException("Working directory for publishing AVRO records does not exist: " + hdfsPublishDir); } } catch (final IOException ioe) { logger.error("Could not initialize HDFS filesystem or failed to check for existence of publish and / or working directories..", ioe); throw new RuntimeException("Could not initialize HDFS filesystem.", ioe); } }

Target:
public void verifyFileSystemConfiguration() { try { final FileSystem hdfs = getFileSystemInstance(); final String hdfsWorkingDir = configuration.configuration().getSinkConfiguration(name, FileSinkConfiguration.class).fileStrategy.workingDir; final String hdfsPublishDir = configuration.configuration().getSinkConfiguration(name, FileSinkConfiguration.class).fileStrategy.publishDir; if (!hdfs.isDirectory(new Path(hdfsWorkingDir))) { throw new RuntimeException("Working directory for in-flight AVRO records does not exist: " + hdfsWorkingDir); } if (!hdfs.isDirectory(new Path(hdfsPublishDir))) { throw new RuntimeException("Working directory for publishing AVRO records does not exist: " + hdfsPublishDir); } } catch (final IOException ioe) { logger.error("Could not initialize HDFS filesystem or failed to check for existence of publish and / or working directories..", ioe); throw new UncheckedIOException("Could not initialize HDFS filesystem.", ioe); } }
Source:
protected Optional<Pair<ConnectionFactory, SearchResponse>> searchLdapForId(final LdapAcceptableUsagePolicyProperties ldap, final String id) throws Exception { val filter = LdapUtils.newLdaptiveSearchFilter(ldap.getSearchFilter(), LdapUtils.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME, CollectionUtils.wrap(id)); LOGGER.debug("Constructed LDAP filter [{}]", filter); val connectionFactory = connectionFactoryList.get(ldap); val response = LdapUtils.executeSearchOperation(connectionFactory, ldap.getBaseDn(), filter, ldap.getPageSize()); if (LdapUtils.containsResultEntry(response)) { LOGGER.debug("LDAP query located an entry for and responded with [{}]", id, response); return Optional.of(Pair.of(connectionFactory, response)); } LOGGER.debug("LDAP query could not locate an entry for [{}]", id); return Optional.empty(); }

Target:
protected Optional<Pair<ConnectionFactory, SearchResponse>> searchLdapForId(final LdapAcceptableUsagePolicyProperties ldap, final String id) throws Exception { val filter = LdapUtils.newLdaptiveSearchFilter(ldap.getSearchFilter(), LdapUtils.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME, CollectionUtils.wrap(id)); LOGGER.debug("Constructed LDAP filter [{}]", filter); val connectionFactory = connectionFactoryList.get(ldap.getLdapUrl()); val response = LdapUtils.executeSearchOperation(connectionFactory, ldap.getBaseDn(), filter, ldap.getPageSize()); if (LdapUtils.containsResultEntry(response)) { LOGGER.debug("LDAP query located an entry for and responded with [{}]", id, response); return Optional.of(Pair.of(connectionFactory, response)); } LOGGER.debug("LDAP query could not locate an entry for [{}]", id); return Optional.empty(); }
Source:
public void updateFromItem(final InfoItem infoItem, final HistoryRecordManager historyRecordManager) { super.updateFromItem(infoItem, historyRecordManager); if (!(infoItem instanceof ChannelInfoItem)) { return; } final ChannelInfoItem item; item = (ChannelInfoItem) infoItem; itemChannelDescriptionView.setText(item.getDescription()); }

Target:
public void updateFromItem(final InfoItem infoItem, final HistoryRecordManager historyRecordManager) { super.updateFromItem(infoItem, historyRecordManager); if (!(infoItem instanceof ChannelInfoItem)) { return; } final ChannelInfoItem item = (ChannelInfoItem) infoItem; itemChannelDescriptionView.setText(item.getDescription()); }
Source:
public List<File> getJars() throws CoreException { if (jars != null) { return jars; } jars = new ArrayList<File>(); if (homePath == null) { return jars; } File location = new File(homePath); ServerBeanLoader loader = new ServerBeanLoader(location); ServerBean serverBean = loader.getServerBean(); JBossServerType type = serverBean.getType(); String version = serverBean.getVersion(); if (JBossServerType.AS7.equals(type) || JBossServerType.AS72.equals(type) || JBossServerType.EAP61.equals(type) || JBossServerType.AS7GateIn.equals(type) || JBossServerType.EAP6.equals(type)) { getAS7xJars(); } else if (JBossServerType.AS.equals(type)) { if (IJBossToolingConstants.V6_0.equals(version) || IJBossToolingConstants.V6_1.equals(version)) { getAS6xJars(); } else if (IJBossToolingConstants.V5_0.equals(version) || IJBossToolingConstants.V5_1.equals(version)) { getAS5xJars(); } } else if (JBossServerType.EAP6.equals(type)) { getAS7xJars(); } else if (JBossServerType.SOAP.equals(type) || JBossServerType.EAP.equals(type) || EPP.equals(type) || JBossServerType.SOAP_STD.equals(type) || JBossServerType.EWP.equals(type) || JBossServerType.EAP_STD.equals(type)) { getAS5xJars(); } if (jars.size() == 0 && homePath != null) { IPath jarPath = new Path(homePath); addJars(jarPath, jars); } return jars; }

Target:
public List<File> getJars() throws CoreException { if (jars != null) { return jars; } jars = new ArrayList<File>(); if (runtime != null) { IPath[] paths = new RuntimeJarUtility().getJarsForRuntime(runtime, RuntimeJarUtility.ALL_JARS); if (paths != null && paths.length > 0) { for (IPath path:paths) { addFile(jars, path.toFile()); } return jars; } } if (homePath == null) { return jars; } IPath jarPath = new Path(homePath); addJars(jarPath, jars); return jars; }
Source:
public boolean decide(DomainEventData<?> snapshot) { try { SerializedType payloadType = snapshot.getPayload().getType(); String payloadRevision = getOrDefault(payloadType.getRevision(), NO_REVSION); String aggregateRevision = getOrDefault(resolver.revisionOf(Class.forName(payloadType.getName())), NO_REVSION); return payloadRevision.equals(aggregateRevision); } catch (ClassNotFoundException e) { return false; } }

Target:
public boolean decide(DomainEventData<?> snapshot) { final SerializedType payloadType = snapshot.getPayload().getType(); final Optional<String> payloadRevision = Optional.ofNullable(payloadType.getRevision()); final Optional<String> aggregateRevision; try { aggregateRevision = Optional.ofNullable(resolver.revisionOf(Class.forName(payloadType.getName()))); } catch (ClassNotFoundException e) { return false; } return payloadRevision.equals(aggregateRevision); }
Source:
public void testReboot() throws Exception { setUpGetEntityExpectations(1); setUriInfo(setUpActionExpectations(VdcActionType.RebootVm, PowerDownVmParameters.class, new String[] { "VmId" }, new Object[] { GUIDS[0] })); verifyActionResponse(resource.reboot(new Action())); }

Target:
public void testReboot() throws Exception { setUpPowerDownActionExpectations(VdcActionType.RebootVm, null, null); verifyActionResponse(resource.reboot(new Action())); }
Source:
public void setup() { System.setProperty("org.jbpm.rm.init.timer", "false"); logger.info("Using local cache for EJB timers: {}", (USE_LOCAL_CACHE ? "true" : "false")); }

Target:
public void setup() { System.setProperty("org.jbpm.rm.init.timer", "false"); logger.info("Using local cache for EJB timers: {}", USE_LOCAL_CACHE); }
Source:
public final void testWindowFrame1() throws Exception { KeyValueSet tableOptions = new KeyValueSet(); tableOptions.set(StorageConstants.TEXT_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER); tableOptions.set(StorageConstants.TEXT_NULL, "\\\\N"); Schema schema = new Schema(); schema.addColumn("id", TajoDataTypes.Type.INT4); schema.addColumn("name", TajoDataTypes.Type.TEXT); schema.addColumn("num", TajoDataTypes.Type.INT4); String[] data = new String[]{ "1|abc|3", "2|def|2", "2|ghi|4", "2|abd|3", "2|abe|9" }; TajoTestingCluster.createTable("windowframe", schema, tableOptions, data, 1); try { ResultSet res = executeString( "select id, name, num, sum(num) over ( partition by id order by name ) as sum1, sum(num) over ( partition by id order by name rows 1 preceding ) as sum2, sum(num) over ( partition by id order by name rows between 1 preceding and 1 following) as sum3 from windowframe"); String ascExpected = "id,name,num,sum1,sum2,sum3\n" + "-------------------------------\n" + "1,abc,3,3,3,3\n" + "2,abd,3,3,3,12\n" + "2,abe,9,12,12,14\n" + "2,def,2,14,11,15\n" + "2,ghi,4,18,6,6\n"; assertEquals(ascExpected, resultSetToString(res)); res.close(); } finally { executeString("DROP TABLE windowframe PURGE"); } }

Target:
public final void testWindowFrame1() throws Exception { executeDDL("table1DDL.sql", "table1", "table1"); try { ResultSet res = executeQuery(); assertResultSet(res); cleanupQuery(res); } finally { executeString("DROP TABLE table1"); } }
Source:
public boolean handle(TraceContext context, MutableSpan span) { if (context == null) { return true; } Stream.concat(whitelistedKeys(sleuthProperties.getBaggageKeys()), whitelistedKeys(sleuthProperties.getPropagationKeys())) .map(baggageItemKey -> new AbstractMap.SimpleEntry<>(baggageItemKey, ExtraFieldPropagation.get(context, baggageItemKey))) .filter(entry -> nonNull(entry.getValue())) .forEach(entry -> span.tag(entry.getKey(), entry.getValue())); return true; }

Target:
public boolean handle(TraceContext context, MutableSpan span) { Stream.of(sleuthProperties.getBaggageKeys(), sleuthProperties.getPropagationKeys()) .flatMap(Collection::stream) .filter(key -> this.tagPropagationProperties.getWhitelistedKeys().contains(key)) .map(baggageItemKey -> new AbstractMap.SimpleEntry<>(baggageItemKey, ExtraFieldPropagation.get(context, baggageItemKey))) .filter(entry -> nonNull(entry.getValue())) .forEach(entry -> span.tag(entry.getKey(), entry.getValue())); return true; }
Source:
public void checkMainFeaturesTypeScriptLS() { consoles.waitExpectedTextIntoConsole( "Initialized language server 'org.eclipse.che.plugin.web.typescript'"); checkCodeValidation(); checkCodeAssistant(); checkGoToDefinition(); }

Target:
public void checkMainFeaturesTypeScriptLS() { consoles.waitExpectedTextIntoConsole(INITIALIZE_LANG_SERVER_MESSAGE); checkCodeValidation(); checkCodeAssistant(); checkGoToDefinition(); }
Source:
Boolean isInForeground() { ActivityManager.RunningAppProcessInfo info = getProcessInfo(); if (info != null) { return info.importance <= ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND; } else { return null; } }

Target:
Boolean isInForeground() { try { ActivityManager.RunningAppProcessInfo info = getProcessInfo(); if (info != null) { return info.importance <= ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND; } else { return null; } } catch (RuntimeException exc) { return null; } }
Source:
public static String createPath(final String fileSystemPrefix, String resultPath) { final URI uri; try { URI systemPrefix = new URI(fileSystemPrefix); if (!resultPath.startsWith("/")) { resultPath = "/" + resultPath; } uri = new URI("hdfs", null, systemPrefix.getHost(), systemPrefix.getPort(), systemPrefix.getPath() + resultPath, null, null); return uri.toString(); } catch (URISyntaxException e) { logger.error("Error while trying to create url for saving the job", e); } return null; }

Target:
public static String createPath(final String fileSystemPrefix, String resultPath) throws URISyntaxException { final URI uri; try { URI systemPrefix = new URI(fileSystemPrefix); if (!resultPath.startsWith("/")) { resultPath = "/" + resultPath; } uri = new URI("hdfs", null, systemPrefix.getHost(), systemPrefix.getPort(), systemPrefix.getPath() + resultPath, null, null); return uri.toString(); } catch (URISyntaxException e) { logger.error("Error while trying to create url for saving the job", e); throw e; } }
Source:
public static final ServiceProvider setCurrent(ServiceProvider provider) { Objects.requireNonNull(provider); ServiceProvider old = current.getAndSet(provider); if (provider.equals(old)) { Logger.getLogger("javax.measure.spi").log(Level.CONFIG, "Measurement ServiceProvider {1,choice,0#set to|1#replaced by} {0}.", new Object[] {provider.getClass().getName(), (old == null) ? 0 : 1}); } return old; }

Target:
public static final ServiceProvider setCurrent(ServiceProvider provider) { Objects.requireNonNull(provider); ServiceProvider old = current.getAndSet(provider); if (old != provider) { Logger.getLogger("javax.measure.spi").log(Level.CONFIG, "Measurement ServiceProvider {1,choice,0#set to|1#replaced by} {0}.", new Object[] {provider.getClass().getName(), (old == null) ? 0 : 1}); } return old; }
Source:
public Object getAttribute(String attribute) { if (SENSOR_NAME_TAG.equals(attribute)) { return getSensorName(); } synchronized (_lock) { if (!_attributeMap.containsKey(attribute)) { return null; } return _attributeMap.get(attribute).getAttributeValue(attribute); } }

Target:
public Object getAttribute(String attribute) throws AttributeNotFoundException { if (SENSOR_NAME_TAG.equals(attribute)) { return getSensorName(); } DynamicMetric metric = _attributeMap.get(attribute); if (metric == null) { throw new AttributeNotFoundException("Attribute[" + attribute + "] is not found."); } return metric.getAttributeValue(attribute); }
Source:
public String toString() { SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd@HH:mm:ss.SSS"); return "RedisLock [lockKey=" + RedisLockRegistry.this.registryKey + ":" + this.lockKey + ",lockedAt=" + dateFormat.format(new Date(this.lockedAt)) + ", thread=" + this.threadName + ", lockHost=" + new String(this.lockHost) + "]"; }

Target:
public String toString() { SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd@HH:mm:ss.SSS"); return "RedisLock [lockKey=" + constructLockKey() + ",lockedAt=" + dateFormat.format(new Date(this.lockedAt)) + ", thread=" + this.threadName + ", lockHost=" + new String(this.lockHost) + "]"; }
Source:
public static synchronized @Nonnull Whitelist all() { Jenkins j = Jenkins.getInstanceOrNull(); if (j == null) { LOGGER.warning("No Jenkins.instance"); return new ProxyWhitelist(); } Whitelist all = allByJenkins.get(j); if (all == null) { ExtensionList<Whitelist> allWhitelists = j.getExtensionList(Whitelist.class); if (allWhitelists.isEmpty()) { LOGGER.warning("Empty list of Whitelist"); } else { System.err.println("Loading whitelists: " + allWhitelists); } all = new ProxyWhitelist(allWhitelists); allByJenkins.put(j, all); } return all; }

Target:
public static synchronized @Nonnull Whitelist all() { Jenkins j = Jenkins.getInstanceOrNull(); if (j == null) { LOGGER.log(Level.WARNING, "No Jenkins.instance", new Throwable("here")); return new ProxyWhitelist(); } Whitelist all = allByJenkins.get(j); if (all == null) { ExtensionList<Whitelist> allWhitelists = j.getExtensionList(Whitelist.class); if (allWhitelists.isEmpty()) { LOGGER.log(Level.WARNING, "No Whitelist instances registered", new Throwable("here")); return new ProxyWhitelist(); } else { LOGGER.fine(() -> "Loading whitelists: " + allWhitelists); } all = new ProxyWhitelist(allWhitelists); allByJenkins.put(j, all); } return all; }
Source:
private byte[] readClasspathResource(String c) throws IOException { InputStream is = getClass().getResourceAsStream(c); try { return Util.readStream(is); } finally { is.close(); } }

Target:
private byte[] readClasspathResource(String c) throws IOException { InputStream is = getClass().getResourceAsStream(c); try { return Util.readStream(is); } finally { if (is != null) { is.close(); } } }
Source:
public void handleRemoteResult(final String operationId, final boolean result, final ByteBuffer data) { final DataOperation finishedOperation = ongoingOperations.remove(operationId); if (finishedOperation == null) { LOG.log(Level.INFO, "The operation is already handled or cancelled due to timeout. OpId: {0}", operationId); return; } final Codec codec = serializer.getCodec(finishedOperation.getDataType()); final Object outputData = data == null ? null : codec.decode(data.array()); finishedOperation.setResultAndWakeupClientThread(result, Optional.ofNullable(outputData)); }

Target:
<T> void handleRemoteResult(final String operationId, final boolean result, final ByteBuffer data) { final DataOperation<T> finishedOperation = ongoingOperations.remove(operationId); if (finishedOperation == null) { LOG.log(Level.WARNING, "The operation is already handled or cancelled due to timeout. OpId: {0}", operationId); return; } final Codec codec = serializer.getCodec(finishedOperation.getDataType()); final Optional<T> outputData = data == null ? Optional.<T>empty() : Optional.of((T) codec.decode(data.array())); finishedOperation.setResultAndNotifyClient(result, outputData); }
Source:
public static Client createClient() { VoltLogger.startAsynchronousLogging(); EstTimeUpdater.start(); ReverseDNSCache.start(); CLIENT_NUM.incrementAndGet(); return new ClientImpl(new ClientConfig()); }

Target:
public static Client createClient() { if (ACTIVE_CLIENT_COUNT.incrementAndGet() == 1) { VoltLogger.startAsynchronousLogging(); EstTimeUpdater.start(); ReverseDNSCache.start(); } return new ClientImpl(new ClientConfig()); }
Source:
public ExecutionResult execute(Item item) { ConnectionItem connectionItem = (ConnectionItem) item; DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection(); if (connection != null) { if (connection.getDatabaseType().equals("Microsoft SQL Server")) { if (connection.getDbVersionString() == null) { connection.setDbVersionString(DEFAULT_VERSION); try { ProxyRepositoryFactory.getInstance().save(item); } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } return ExecutionResult.SUCCESS_NO_ALERT; } } else { return ExecutionResult.NOTHING_TO_DO; } } return ExecutionResult.NOTHING_TO_DO; }

Target:
public ExecutionResult execute(Item item) { ConnectionItem connectionItem = (ConnectionItem) item; DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection(); if (connection != null) { if (connection.getDatabaseType().equals(EDatabaseTypeName.MSSQL.getDisplayName())) { if (connection.getDbVersionString() == null) { connection.setDbVersionString(EDatabaseVersion4Drivers.MSSQL.getVersionValue()); try { ProxyRepositoryFactory.getInstance().save(item); } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } return ExecutionResult.SUCCESS_NO_ALERT; } } else { return ExecutionResult.NOTHING_TO_DO; } } return ExecutionResult.NOTHING_TO_DO; }
Source:
public void testManageSnapshotAndRunFgOption2() { UpdateStatisticsTool tool = new UpdateStatisticsTool(); tool.parseOptions(new String[] {"-t", "table1", "-ms", "-runfg"}); }

Target:
public void testManageSnapshotAndRunFgOption2() { UpdateStatisticsTool tool = new UpdateStatisticsTool(); try { tool.parseOptions(new String[] {"-t", "table1", "-ms", "-runfg"}); } catch (IllegalStateException e) { fail("IllegalStateException is not expected " + "since all required parameters are provided."); } }
Source:
protected Map<String, List<ConcurStandardAccountingExtractDetailLine>> getConsolidatedPersonalExpensesMapForLine( ConcurStandardAccountingExtractDetailLine detailLine) { if (detailLine.getJournalAmount().isPositive()) { if (collectorHelper.lineRepresentsReturnOfCorporateCardPersonalExpenseToUser(detailLine)) { return consolidatedCorpCardPersonalExpenseCredits; } else { return consolidatedCorpCardPersonalExpenseDebits; } } else if (collectorHelper.lineRepresentsReturnOfCorporateCardPersonalExpenseToUniversity(detailLine)) { return consolidatedCorpCardPersonalExpenseDebits; } else { return consolidatedCorpCardPersonalExpenseCredits; } }

Target:
protected Map<String, List<ConcurStandardAccountingExtractDetailLine>> getConsolidatedPersonalExpensesMapForLine( ConcurStandardAccountingExtractDetailLine detailLine) { if (detailLine.getJournalAmount().isPositive()) { return getConsolidatedPersonalExpensesMapForDebitLine(detailLine); } else { return getConsolidatedPersonalExpensesMapForCreditLine(detailLine); } }
Source:
public void unstar() throws IOException { root.createRequest().method("DELETE").setRawUrlPath(getApiTailUrl("star")).send(); }

Target:
public void unstar() throws IOException { root.createRequest().method("DELETE").withUrlPath(getApiTailUrl("star")).send(); }
Source:
protected double computeUtilizationScore(double estimatedUsage, double currentUsage) { if (estimatedUsage == 0) { return 0; } return SIGMOID.value(-(currentUsage / estimatedUsage - 1) * DEFAULT_ALPHA) * (MAX_SCORE - MIN_SCORE); }

Target:
protected double computeUtilizationScore(double estimatedUsage, double currentUsage) { if (estimatedUsage == 0) { return 0; } return currentUsage / estimatedUsage; }
Source:
public void testCheckNoneOnHistoricProcessInstanceAndReadHistoryPermissionOnProcessDefinition() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); String processInstanceId = startProcessAndExecuteJob(DEFAULT_PROCESS_KEY) .getProcessInstanceId(); createGrantAuthorization(Resources.HISTORIC_PROCESS_INSTANCE, processInstanceId, userId, HistoricProcessInstancePermissions.NONE); createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, READ_HISTORY); HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery(); assertThat(query.list()) .extracting("processInstanceId") .containsExactly(processInstanceId); }

Target:
public void testCheckNoneOnHistoricProcessInstanceAndReadHistoryPermissionOnProcessDefinition() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); String processInstanceId = startProcessAndExecuteJob(DEFAULT_PROCESS_KEY) .getProcessInstanceId(); createGrantAuthorization(Resources.HISTORIC_PROCESS_INSTANCE, processInstanceId, userId, HistoricProcessInstancePermissions.NONE); createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, ProcessDefinitionPermissions.READ_HISTORY); HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery(); assertThat(query.list()) .extracting("processInstanceId") .containsExactly(processInstanceId); }
Source:
public void createPermission() throws Exception { createdUser = safeCreateUser(client, createdDatabase.getId(), getUserDefinition()); CosmosPermissionProperties permissionSettings = new CosmosPermissionProperties() .setId(UUID.randomUUID().toString()) .setPermissionMode(PermissionMode.READ) .setContainerName("AQAAAJ0fgTc=") .setResourcePath(CosmosContainerChildResourceKind.ITEM, "doc1"); Mono<CosmosPermissionResponse> createObservable = createdUser.createPermission(permissionSettings, null); CosmosResponseValidator<CosmosPermissionResponse> validator = new CosmosResponseValidator.Builder<CosmosPermissionResponse>() .withId(permissionSettings.getId()) .withPermissionMode(PermissionMode.READ) .withPermissionContainerName("AQAAAJ0fgTc=") .withPermissionResourceKind(CosmosContainerChildResourceKind.ITEM) .withPermissionResourceName("doc1") .notNullEtag() .build(); validateSuccess(createObservable, validator); }

Target:
public void createPermission() throws Exception { createdUser = safeCreateUser(client, createdDatabase.getId(), getUserDefinition()); CosmosPermissionProperties permissionSettings = new CosmosPermissionProperties() .setId(UUID.randomUUID().toString()) .setPermissionMode(PermissionMode.READ) .setContainerName("myContainer") .setResourcePath(ContainerChildResourceType.ITEM, "doc1"); Mono<CosmosPermissionResponse> createObservable = createdUser.createPermission(permissionSettings, null); CosmosResponseValidator<CosmosPermissionResponse> validator = new CosmosResponseValidator.Builder<CosmosPermissionResponse>() .withId(permissionSettings.getId()) .withPermissionMode(PermissionMode.READ) .withPermissionContainerName("myContainer") .withPermissionResourceKind(ContainerChildResourceType.ITEM) .withPermissionResourceName("doc1") .notNullEtag() .build(); validateSuccess(createObservable, validator); }
Source:
void removeOverlaps() { Collections.sort(projects); Iterator<Project> iter = projects.iterator(); if (iter.hasNext()) { Project last = iter.next(); while (iter.hasNext()) { Project p = iter.next(); if (last.isParentTo(p)) iter.remove(); else last = p; } } }

Target:
void removeOverlaps() { Collections.sort(projects); Iterator<Project> iter = projects.iterator(); if (!iter.hasNext()) return; Project last = iter.next(); while (iter.hasNext()) { Project p = iter.next(); if (last.isAncestorOf(p)) iter.remove(); else last = p; } }
Source:
public @Nullable SegmentStoreStatistics getTotalStatsForRange(long start, long end, IProgressMonitor monitor) { @Nullable ITmfTrace trace = getTrace(); if (trace != null && (start == TmfTimeRange.ETERNITY.getStartTime().toNanos() && end == TmfTimeRange.ETERNITY.getEndTime().toNanos()) && (start <= trace.getStartTime().toNanos() && end >= trace.getEndTime().toNanos())) { waitForCompletion(); return getTotalStats(); } return getTotalStats(start, end, monitor); }

Target:
public @Nullable SegmentStoreStatistics getTotalStatsForRange(long start, long end, IProgressMonitor monitor) { @Nullable ITmfTrace trace = getTrace(); if (trace != null && (start == TmfTimeRange.ETERNITY.getStartTime().toNanos() && end == TmfTimeRange.ETERNITY.getEndTime().toNanos())) { waitForCompletion(); return getTotalStats(); } return getTotalStats(start, end, monitor); }
Source:
public Connection wrapConnectionWithBufferWriter(final Connection connectionToWrap) { return new Connection() { final Connection wrappedConnection = connectionToWrap; @Override public void send(Event event) throws ConnectionException { buffer.add(event); wrappedConnection.send(event); } @Override public void addEventSendFailureCallback(EventSendFailureCallback eventSendFailureCallback) { wrappedConnection.addEventSendFailureCallback(eventSendFailureCallback); } @Override public void close() throws IOException { wrappedConnection.close(); } }; }

Target:
public Connection wrapConnectionWithBufferWriter(final Connection connectionToWrap) { return new Connection() { final Connection wrappedConnection = connectionToWrap; @Override public void send(Event event) throws ConnectionException { try { buffer.add(event); } catch (Exception e) { logger.error("Exception occurred while attempting to add Event to buffer: ", e); } wrappedConnection.send(event); } @Override public void addEventSendFailureCallback(EventSendFailureCallback eventSendFailureCallback) { wrappedConnection.addEventSendFailureCallback(eventSendFailureCallback); } @Override public void close() throws IOException { wrappedConnection.close(); } }; }
Source:
public StatsPerTypeRequest(ITmfTrace trace, TmfTimeRange range) { super(trace.getEventType(), range, TmfDataRequest.ALL_DATA, chunkSize, ITmfDataRequest.ExecutionType.FOREGROUND); this.stats = new HashMap<String, Long>(); }

Target:
public StatsPerTypeRequest(ITmfTrace trace, TmfTimeRange range) { super(trace.getEventType(), range, TmfDataRequest.ALL_DATA, trace.getCacheSize(), ITmfDataRequest.ExecutionType.BACKGROUND); this.stats = new HashMap<String, Long>(); }
Source:
public ListDataVirtualHardDisksHandler(DataVirtualHardDiskHandler dataVirtualHardDiskHandler) { this.dataVirtualHardDiskHandler = dataVirtualHardDiskHandler; }

Target:
@Inject ListDataVirtualHardDisksHandler(DataVirtualHardDiskHandler dataVirtualHardDiskHandler) { this.dataVirtualHardDiskHandler = dataVirtualHardDiskHandler; }