auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createUIComponents() { Supplier<String> onAdd = () -> { String s = Messages.showInputDialog(panel, "Enter new exclusion pattern", "Add File Exclusion", null, null, validator); return StringUtils.stripToNull(s); }; Function<String, String> onEdit = (value) -> { String s = Messages.showInputDialog(panel, "Modify exclusion pattern", "Edit File Exclusion", null, value, validator); return StringUtils.stripToNull(s); }; list = new EditableList<>(EMPTY_LABEL, onAdd, onEdit); patternList = list.getComponent(); }

Target:
private void createUIComponents() { Supplier<String> onAdd = () -> { String s = Messages.showInputDialog(panel, "Enter new exclusion pattern", "Add File Exclusion", null, null, validator); return StringUtils.stripToNull(s); }; Function<String, String> onEdit = value -> { String s = Messages.showInputDialog(panel, "Modify exclusion pattern", "Edit File Exclusion", null, value, validator); return StringUtils.stripToNull(s); }; list = new EditableList<>(EMPTY_LABEL, onAdd, onEdit); patternList = list.getComponent(); }
Source:
private Slave getDockerSlave(SshdContainer container){ DumbSlave slave = jenkins.slaves.create(DumbSlave.class); slave.setExecutors(1); slave.remoteFS.set("/tmp/"); SshSlaveLauncher launcher = slave.setLauncher(SshSlaveLauncher.class); launcher.host.set(container.ipBound(22)); launcher.port(container.port(22)); launcher.setSshHostKeyVerificationStrategy(SshSlaveLauncher.NonVerifyingKeyVerificationStrategy.class); launcher.keyCredentials("test", container.getPrivateKeyString()); slave.save(); slave.waitUntilOnline(); assertTrue(slave.isOnline()); return slave; }

Target:
private DumbSlave getDockerSlave(SshdContainer container){ DumbSlave slave = jenkins.slaves.create(DumbSlave.class); slave.setExecutors(1); slave.remoteFS.set("/tmp/"); SshSlaveLauncher launcher = slave.setLauncher(SshSlaveLauncher.class); launcher.host.set(container.ipBound(22)); launcher.port(container.port(22)); launcher.setSshHostKeyVerificationStrategy(SshSlaveLauncher.NonVerifyingKeyVerificationStrategy.class); launcher.keyCredentials("test", container.getPrivateKeyString()); slave.save(); slave.waitUntilOnline(); assertTrue(slave.isOnline()); return slave; }
Source:
private void assureVectorSize() { int requiredVectorLength = min(nextBatchSize, MAX_BATCH_SIZE); if (nullVector.length < requiredVectorLength) { nullVector = new boolean[requiredVectorLength]; systemMemoryContext.setBytes(requiredVectorLength * SIZE_OF_BYTE); } }

Target:
private void assureVectorSize() { int requiredVectorLength = min(nextBatchSize, MAX_BATCH_SIZE); if (nullVector.length < requiredVectorLength) { nullVector = new boolean[requiredVectorLength]; systemMemoryContext.setBytes(getRetainedSizeInBytes()); } }
Source:
public void testPaintHyperlinkDoesNotLeakDisabledImage() throws Exception { Image prevImage = createGradient(); imageHyperlink.setImage(prevImage); imageHyperlink.setEnabled(false); imageHyperlink.paintHyperlink(gc); Image prevDisabledImage = getDisabledImage(imageHyperlink); imageHyperlink.paintHyperlink(gc); assertTrue(prevDisabledImage == getDisabledImage(imageHyperlink)); }

Target:
public void testPaintHyperlinkDoesNotLeakDisabledImage() throws Exception { Image prevImage = createGradient(); imageHyperlink.setImage(prevImage); imageHyperlink.setEnabled(false); imageHyperlink.paintHyperlink(gc); Image prevDisabledImage = getDisabledImage(imageHyperlink); imageHyperlink.paintHyperlink(gc); assertSame(prevDisabledImage, getDisabledImage(imageHyperlink)); }
Source:
public int getAmountOfSpellsAllPlayersCastOnCurrentTurn() { return amountOfSpellsCastOnCurrentTurn.values().stream().mapToInt(Integer::intValue).sum(); }

Target:
public int getAmountOfSpellsAllPlayersCastOnCurrentTurn() { return amountOfSpellsCastOnCurrentTurn.values().stream().reduce(0, Integer::sum); }
Source:
public void canReadSingleTombstoneInSameShard() { int tombstoneShard = putTombstone(writer, TS + 1, DEFAULT_CELL, true); assertThat(reader.getLatestWrites(TS_REF, conservative(tombstoneShard))) .containsExactly(WriteInfo.write(TABLE_REF, DEFAULT_CELL, TS + 1)); }

Target:
public void canReadSingleTombstoneInSameShard() { int tombstoneShard = putTombstone(writer, TS + 1, DEFAULT_CELL, TABLE_CONS); List<WriteInfo> latestWrites = reader.getLatestWrites(TS_REF, conservative(tombstoneShard)); assertThat(latestWrites).containsExactly(WriteInfo.tombstone(TABLE_CONS, DEFAULT_CELL, TS + 1)); }
Source:
protected final CompletableFuture<InternalCacheEntry> retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command, boolean isWrite) throws Exception { GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; ClusteredGetCommand get = cf.buildClusteredGetCommand(key, command.getFlagsBitSet(), acquireRemoteLock, gtx); get.setWrite(isWrite); RpcOptionsBuilder rpcOptionsBuilder = rpcManager.getRpcOptionsBuilder(ResponseMode.WAIT_FOR_VALID_RESPONSE, DeliverOrder.NONE); int lastTopologyId = -1; return handleRemoteValue(key, null, get, rpcOptionsBuilder, lastTopologyId); }

Target:
protected final CompletableFuture<InternalCacheEntry> retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command, boolean isWrite) throws Exception { GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext) ctx).getGlobalTransaction() : null; ClusteredGetCommand get = cf.buildClusteredGetCommand(key, command.getFlagsBitSet(), acquireRemoteLock, gtx); get.setWrite(isWrite); RpcOptionsBuilder rpcOptionsBuilder = rpcManager.getRpcOptionsBuilder(ResponseMode.WAIT_FOR_VALID_RESPONSE, DeliverOrder.NONE); return handleRemoteValue(key, null, get, rpcOptionsBuilder, -1); }
Source:
public static Archive<?> createTestArchive() { File file = new File(testFilePath); Assert.assertTrue("File " + testFilePath + " doesn't exists", file.exists()); WebArchive war = TestUtil.prepareArchive(CustomExceptionMapperTest.class.getSimpleName()) .addClasses(CustomExceptionMapperResource.class) .addClasses(CustomExceptionMapperClassConstraint.class, CustomExceptionMapperClassValidator.class, CustomExceptionMapperReport.class) .addAsLibrary(file, "validation-versioning.jar") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new RuntimePermission("getClassLoader"), new RuntimePermission("accessDeclaredMembers") ), "permissions.xml"); return war; }

Target:
public static Archive<?> createTestArchive() { File file = new File(testFilePath); Assert.assertTrue("File " + testFilePath + " doesn't exists", file.exists()); WebArchive war = TestUtil.prepareArchive(CustomExceptionMapperTest.class.getSimpleName()) .addClasses(CustomExceptionMapperResource.class) .addClasses(CustomExceptionMapperClassConstraint.class, CustomExceptionMapperClassValidator.class, CustomExceptionMapperReport.class) .addAsLibrary(file, "validation-versioning.jar") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); return war; }
Source:
private void createConglomerate(ExecRow templateRow) throws StandardException{ if (!conglomCreated) { TransactionController tc = activation.getTransactionController(); CID = tc.createConglomerate(false, "heap", templateRow.getRowArray(), null, null, properties, TransactionController.IS_TEMPORARY | TransactionController.IS_KEPT, 0); LOG.trace(format("Created temporary conglomerate splice:%d", CID)); conglomCreated = true; cc = tc.openConglomerate(CID, false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_SERIALIZABLE); } }

Target:
private void createConglomerate(ExecRow templateRow) throws StandardException{ if (!conglomCreated) { TransactionController tc = activation.getTransactionController(); CID = tc.createConglomerate(false, "heap", templateRow.getRowArray(), null, null, properties, TransactionController.IS_TEMPORARY | TransactionController.IS_KEPT, Conglomerate.Priority.NORMAL); LOG.trace(format("Created temporary conglomerate splice:%d", CID)); conglomCreated = true; cc = tc.openConglomerate(CID, false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_SERIALIZABLE); } }
Source:
static String clean(String msg) { return msg. replaceAll("(^|\\n)Signed-off-by:.*(\\n|$)", "$1"). replaceAll("(^|\\n)#.*(\\n|$)", "$1"). replaceAll("\\n+", "\\\n"). replaceAll("\\n*$", ""); }

Target:
static String clean(String msg) { return msg. replaceAll("(^|\\n)Signed-off-by:.*(\\n|$)", "$1"). replaceAll("(^|\\n)#.*(\\n|$)", "$1"). replaceAll("\\n\\n+", "\\\n"). replaceAll("\\n*$", ""); }
Source:
public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { transactionHelper.delistResource(xaSession.getXAResource()); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Delisted " + xaSession + " XA resource from the transaction"); } Synchronization synchronization = new SessionClosingSynchronization(xaSession); transactionHelper.registerSynchronization(synchronization); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Registered synchronization to close the session: " + synchronization); } } else { xaSession.close(); } }

Target:
public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { transactionHelper.deregisterXAResource(xaSession.getXAResource()); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Delisted " + xaSession + " XA resource from the transaction"); } Synchronization synchronization = new SessionClosingSynchronization(xaSession); transactionHelper.registerSynchronization(synchronization); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Registered synchronization to close the session: " + synchronization); } } else { xaSession.close(); } }
Source:
public void removeChildrenAndResources(Session session) { removeChildrenFromMap(session, triggers); removeChildrenFromMap(session, constraints); boolean modified = true; while (!tablesAndViews.isEmpty()) { boolean newModified = false; for (Table obj : tablesAndViews.values()) { Table dependentTable = database.getDependentTable(obj, obj); if (dependentTable == null) { database.removeSchemaObject(session, obj); newModified = true; } else if (dependentTable.getSchema() != this) { throw DbException.get(ErrorCode.CANNOT_DROP_2, obj.getSQL(false), dependentTable.getSQL(false)); } else if (!modified) { dependentTable.removeColumnExpressionsDependencies(session); dependentTable.setModified(); database.updateMeta(session, dependentTable); } } modified = newModified; } removeChildrenFromMap(session, indexes); removeChildrenFromMap(session, sequences); removeChildrenFromMap(session, constants); removeChildrenFromMap(session, functions); for (Right right : database.getAllRights()) { if (right.getGrantedObject() == this) { database.removeDatabaseObject(session, right); } } database.removeMeta(session, getId()); owner = null; invalidate(); }

Target:
public void removeChildrenAndResources(Session session) { removeChildrenFromMap(session, triggers); removeChildrenFromMap(session, constraints); boolean modified = true; while (!tablesAndViews.isEmpty()) { boolean newModified = false; for (Table obj : tablesAndViews.values()) { if (obj.getName() != null) { Table dependentTable = database.getDependentTable(obj, obj); if (dependentTable == null) { database.removeSchemaObject(session, obj); newModified = true; } else if (dependentTable.getSchema() != this) { throw DbException.get(ErrorCode.CANNOT_DROP_2, obj.getSQL(false), dependentTable.getSQL(false)); } else if (!modified) { dependentTable.removeColumnExpressionsDependencies(session); dependentTable.setModified(); database.updateMeta(session, dependentTable); } } } modified = newModified; } removeChildrenFromMap(session, indexes); removeChildrenFromMap(session, sequences); removeChildrenFromMap(session, constants); removeChildrenFromMap(session, functions); for (Right right : database.getAllRights()) { if (right.getGrantedObject() == this) { database.removeDatabaseObject(session, right); } } database.removeMeta(session, getId()); owner = null; invalidate(); }
Source:
public void onClose(Session session, int status, String reason) { connectedSockets.get(connectedUser.getId()).remove(this); }

Target:
public void onClose(Session session, int status, String reason) { connectedSockets.get(connectedUser.getId()).remove(this); connectedSockets.remove(connectedUser.getId(), Lists.newArrayList()); }
Source:
public ReadOnlyStorageConfiguration(VoldemortConfig config) { this.storageDir = new File(config.getReadOnlyDataStorageDirectory()); this.numBackups = config.getNumReadOnlyVersions(); this.searcher = (SearchStrategy) ReflectUtils.callConstructor(ReflectUtils.loadClass(config.getReadOnlySearchStrategy() .trim())); this.nodeId = config.getNodeId(); this.deleteBackupMs = config.getReadOnlyDeleteBackupMs(); this.maxValueBufferAllocationSize = config.getReadOnlyMaxValueBufferAllocationSize(); FailedFetchLock failedFetchLockInstance; if (config.getHighAvailabilityStateAutoCleanUp()) { try { failedFetchLockInstance = FailedFetchLock.getLock(config, null); } catch (ClassNotFoundException e) { failedFetchLockInstance = null; } } else { failedFetchLockInstance = null; } this.failedFetchLock = failedFetchLockInstance; }

Target:
public ReadOnlyStorageConfiguration(VoldemortConfig config) { this.config = config; this.storageDir = new File(config.getReadOnlyDataStorageDirectory()); this.numBackups = config.getNumReadOnlyVersions(); this.searcher = (SearchStrategy) ReflectUtils.callConstructor(ReflectUtils.loadClass(config.getReadOnlySearchStrategy() .trim())); this.nodeId = config.getNodeId(); this.deleteBackupMs = config.getReadOnlyDeleteBackupMs(); this.maxValueBufferAllocationSize = config.getReadOnlyMaxValueBufferAllocationSize(); }
Source:
public void shouldUpdateEmailCollectionMode() { Long gatewayAccountId = 100L; PatchRequest request = PatchRequest.from(new ObjectMapper().valueToTree(ImmutableMap.of("op", "replace", "path", "email_collection_mode", "value", "off"))); GatewayAccountEntity entity = mock(GatewayAccountEntity.class); when(gatewayAccountDao.findById(gatewayAccountId)).thenReturn(Optional.of(entity)); Optional<GatewayAccount> optionalGatewayAcc = updater.doPatch(gatewayAccountId, request); assertThat(optionalGatewayAcc.isPresent(), is(true)); verify(entity, times(1)).setEmailCollectionMode(EmailCollectionMode.OFF); verify(gatewayAccountDao, times(1)).merge(entity); }

Target:
public void shouldUpdateEmailCollectionMode() { Long gatewayAccountId = 100L; PatchRequest request = PatchRequest.from(new ObjectMapper().valueToTree(ImmutableMap.of("op", "replace", "path", "email_collection_mode", "value", "off"))); GatewayAccountEntity entity = mock(GatewayAccountEntity.class); when(gatewayAccountDao.findById(gatewayAccountId)).thenReturn(Optional.of(entity)); Optional<GatewayAccount> optionalGatewayAcc = updater.doPatch(gatewayAccountId, request); assertThat(optionalGatewayAcc.isPresent(), is(true)); InOrder inOrder = Mockito.inOrder(entity, gatewayAccountDao); inOrder.verify(entity).setEmailCollectionMode(EmailCollectionMode.OFF); inOrder.verify(gatewayAccountDao).merge(entity); }
Source:
@Test public void testIntersectToIntersect1() { final String mv = "" + "select \"deptno\" from\n" + "\"emps\" intersect all select \"deptno\" from \"depts\""; final String query = "" + "select \"deptno\" from\n" + "\"depts\" intersect all select \"deptno\" from \"emps\""; checkMaterialize(mv, query, true); }

Target:
@Test public void testIntersectToIntersect1() { final String mv = "" + "select \"deptno\" from \"emps\"\n" + "intersect all\n" + "select \"deptno\" from \"depts\""; final String query = "" + "select \"deptno\" from \"depts\"\n" + "intersect all\n" + "select \"deptno\" from \"emps\""; checkMaterialize(mv, query, true); }
Source:
public static Map<Integer, Map<Version, Boolean>> getBalloonSupportMap() { return balloonSupportMap; }

Target:
private static Map<Integer, Map<Version, Boolean>> getBalloonSupportMap() { return balloonSupportMap; }
Source:
private RevisionInfo toRevisionInfo(ChangeData cd, PatchSet in) throws OrmException { RevisionInfo out = new RevisionInfo(); out.isCurrent = in.getId().equals(cd.change(db).currentPatchSetId()); out._number = in.getId().get(); out.draft = in.isDraft() ? true : null; out.edit = in.getId().isEdit() ? true : null; out.fetch = makeFetchMap(cd, in); if (has(ALL_COMMITS) || (out.isCurrent && has(CURRENT_COMMIT))) { try { out.commit = toCommit(in); } catch (PatchSetInfoNotAvailableException e) { log.warn("Cannot load PatchSetInfo " + in.getId(), e); } } if (has(ALL_FILES) || (out.isCurrent && has(CURRENT_FILES))) { try { out.files = fileInfoJson.toFileInfoMap(cd.change(db), in); out.files.remove(Patch.COMMIT_MSG); } catch (PatchListNotAvailableException e) { log.warn("Cannot load PatchList " + in.getId(), e); } } if ((out.isCurrent || (out.draft != null && out.draft) || (out.edit != null && out.edit)) && has(CURRENT_ACTIONS) && userProvider.get().isIdentifiedUser()) { out.actions = Maps.newTreeMap(); for (UiAction.Description d : UiActions.from( revisions, new RevisionResource(changes.parse(control(cd)), in), userProvider)) { out.actions.put(d.getId(), new ActionInfo(d)); } } if (has(DRAFT_COMMENTS) && userProvider.get().isIdentifiedUser()) { IdentifiedUser user = (IdentifiedUser)userProvider.get(); out.hasDraftComments = db.get().patchComments() .draftByPatchSetAuthor(in.getId(), user.getAccountId()) .iterator().hasNext() ? true : null; } return out; }

Target:
private RevisionInfo toRevisionInfo(ChangeData cd, PatchSet in) throws OrmException { RevisionInfo out = new RevisionInfo(); out.isCurrent = in.getId().equals(cd.change().currentPatchSetId()); out._number = in.getId().get(); out.draft = in.isDraft() ? true : null; out.edit = in.getId().isEdit() ? true : null; out.fetch = makeFetchMap(cd, in); if (has(ALL_COMMITS) || (out.isCurrent && has(CURRENT_COMMIT))) { try { out.commit = toCommit(in); } catch (PatchSetInfoNotAvailableException e) { log.warn("Cannot load PatchSetInfo " + in.getId(), e); } } if (has(ALL_FILES) || (out.isCurrent && has(CURRENT_FILES))) { try { out.files = fileInfoJson.toFileInfoMap(cd.change(), in); out.files.remove(Patch.COMMIT_MSG); } catch (PatchListNotAvailableException e) { log.warn("Cannot load PatchList " + in.getId(), e); } } if ((out.isCurrent || (out.draft != null && out.draft) || (out.edit != null && out.edit)) && has(CURRENT_ACTIONS) && userProvider.get().isIdentifiedUser()) { out.actions = Maps.newTreeMap(); for (UiAction.Description d : UiActions.from( revisions, new RevisionResource(changes.parse(control(cd)), in), userProvider)) { out.actions.put(d.getId(), new ActionInfo(d)); } } if (has(DRAFT_COMMENTS) && userProvider.get().isIdentifiedUser()) { IdentifiedUser user = (IdentifiedUser)userProvider.get(); out.hasDraftComments = db.get().patchComments() .draftByPatchSetAuthor(in.getId(), user.getAccountId()) .iterator().hasNext() ? true : null; } return out; }
Source:
public static ClassLoader[] getClassLoaders(ClassLoader appClassLoader) { return new ClassLoader[] { appClassLoader, new OsgiClassLoader(), Util.class.getClassLoader(), ClassLoader.getSystemClassLoader() }; }

Target:
public static ClassLoader[] getClassLoaders(ClassLoader appClassLoader) { return new ClassLoader[] { appClassLoader, OsgiClassLoader.getInstance(), Util.class.getClassLoader(), ClassLoader.getSystemClassLoader() }; }
Source:
public List<CubeFactTable> getAllFactTables(CubeInterface cube) throws HiveException { if (cube instanceof Cube) { List<CubeFactTable> cubeFacts = new ArrayList<CubeFactTable>(); try { for (CubeFactTable fact : getAllFacts()) { if (fact.getCubeName().equalsIgnoreCase(((Cube)cube).getName().toLowerCase())) { cubeFacts.add(fact); } } } catch (HiveException e) { throw new HiveException("Could not get all tables", e); } return cubeFacts; } else { return getAllFactTables(((DerivedCube)cube).getParent()); } }

Target:
public List<CubeFactTable> getAllFactTables(CubeInterface cube) throws HiveException { if (cube instanceof Cube) { List<CubeFactTable> cubeFacts = new ArrayList<CubeFactTable>(); try { for (CubeFactTable fact : getAllFacts()) { if (fact.getCubeName().equalsIgnoreCase(((Cube)cube).getName())) { cubeFacts.add(fact); } } } catch (HiveException e) { throw new HiveException("Could not get all fact tables of " + cube, e); } return cubeFacts; } else { return getAllFactTables(((DerivedCube)cube).getParent()); } }
Source:
public void init(ServletConfig config) throws ServletException { super.init(config); EngineLocalConfig config = EngineLocalConfig.getInstance(); pkiResources = new HashMap<String, Details>(); pkiResources.put("ca-certificate", new Details(config.getPKICACert(), "X509-PEM-CA")); pkiResources.put("engine-certificate", new Details(config.getPKIEngineCert(), "X509-PEM", "ovirt-engine")); }

Target:
public void init(ServletConfig config) throws ServletException { super.init(config); EngineLocalConfig localconfig = EngineLocalConfig.getInstance(); pkiResources = new HashMap<String, Details>(); pkiResources.put("ca-certificate", new Details(localconfig.getPKICACert(), "X509-PEM-CA")); pkiResources.put("engine-certificate", new Details(localconfig.getPKIEngineCert(), "X509-PEM", "ovirt-engine")); }
Source:
public void setTypePrecedence(TypePrecedence typePrecedence) { this.typePrecedence = typePrecedence; }

Target:
public void setTypePrecedence(TypePrecedence typePrecedence) { Assert.notNull(typePrecedence, "'typePrecedence' cannot be null"); this.typePrecedence = typePrecedence; }
Source:
public void onAllRequiredCapabilitiesAvailable() { try { DeploymentConfiguration deploymentConfiguration = DataHolder.getInstance().getConfigProvider() .getConfigurationObject(DeploymentConfiguration.class); logger.debug("Starting Carbon Deployment Engine"); deploymentEngine.start(deploymentConfiguration.getRepositoryLocation()); OSGiServiceHolder.getInstance().setCarbonDeploymentEngine(deploymentEngine); DeploymentService deploymentService = new CarbonDeploymentService(deploymentEngine); BundleContext bundleContext = DataHolder.getInstance().getBundleContext(); serviceRegistration = bundleContext.registerService(DeploymentService.class.getName(), deploymentService, null); logger.debug("Carbon Deployment Engine is successfully started"); } catch (DeploymentEngineException e) { String msg = "Could not initialize carbon deployment engine"; logger.error(msg, e); } catch (CarbonConfigurationException e) { String msg = "Fail to load deployment configuration"; logger.error(msg, e); } }

Target:
public void onAllRequiredCapabilitiesAvailable() { try { DeploymentConfiguration deploymentConfiguration = DataHolder.getInstance().getConfigProvider() .getConfigurationObject(DeploymentConfiguration.class); DataHolder.getInstance().setDeploymentConfiguration(deploymentConfiguration); logger.debug("Starting Carbon Deployment Engine"); deploymentEngine.start(deploymentConfiguration.getRepositoryLocation()); OSGiServiceHolder.getInstance().setCarbonDeploymentEngine(deploymentEngine); DeploymentService deploymentService = new CarbonDeploymentService(deploymentEngine); BundleContext bundleContext = DataHolder.getInstance().getBundleContext(); serviceRegistration = bundleContext.registerService(DeploymentService.class.getName(), deploymentService, null); logger.debug("Carbon Deployment Engine is successfully started"); } catch (DeploymentEngineException e) { String msg = "Could not initialize carbon deployment engine"; logger.error(msg, e); } catch (CarbonConfigurationException e) { String msg = "Fail to load deployment configuration"; logger.error(msg, e); } }
Source:
public static File findSecrets(File xmlFile) throws SAXException, IOException, TransformerException { XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) { private String tagName = ""; @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { tagName = qName; super.startElement(uri, localName, qName, atts); } public void endElement(String uri, String localName, String qName) throws SAXException { tagName = ""; super.endElement(uri, localName, qName); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (!"".equals(tagName)) { String value = new String(ch, start, length).trim(); if (!"".equals(value)) { if ((Secret.decrypt(value)) != null || SecretBytes.isSecretBytes(value)) { ch = SECRET_MARKER.toCharArray(); start = 0; length = ch.length; } } } super.characters(ch, start, length); } }; Source src = new SAXSource(xr, new InputSource(new StringReader(FileUtils.readFileToString(xmlFile)))); File patchedFile = File.createTempFile("patched", ".xml"); Result res = new StreamResult(new FileOutputStream(patchedFile)); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.transform(src, res); return patchedFile; }

Target:
public static String findSecrets(File xmlFile) throws SAXException, IOException, TransformerException { XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) { private String tagName = ""; @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { tagName = qName; super.startElement(uri, localName, qName, atts); } public void endElement(String uri, String localName, String qName) throws SAXException { tagName = ""; super.endElement(uri, localName, qName); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (!"".equals(tagName)) { String value = new String(ch, start, length).trim(); if (!"".equals(value)) { if ((Secret.decrypt(value)) != null || SecretBytes.isSecretBytes(value)) { ch = SECRET_MARKER.toCharArray(); start = 0; length = ch.length; } } } super.characters(ch, start, length); } }; Source src = new SAXSource(xr, new InputSource(new StringReader(FileUtils.readFileToString(xmlFile)))); final ByteArrayOutputStream result = new ByteArrayOutputStream(); Result res = new StreamResult(result); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, OUTPUT_ENCODING); transformer.transform(src, res); return result.toString("UTF-8"); }
Source:
public void visitNode(Tree tree) { CompilationUnitTree cut = (CompilationUnitTree) tree; List<ImportClauseTree> staticImports = cut.imports().stream() .filter(importClauseTree -> importClauseTree.is(Tree.Kind.IMPORT) && ((ImportTree) importClauseTree).isStatic()) .collect(Collectors.toList()); if (staticImports.size() > threshold) { reportIssue(staticImports.get(threshold), String.format("Reduce the number of \"static\" imports in this class from %d to the maximum allowed %d.", staticImports.size(), threshold)); } }

Target:
public void visitNode(Tree tree) { CompilationUnitTree cut = (CompilationUnitTree) tree; List<ImportClauseTree> staticImports = cut.imports().stream() .filter(importClauseTree -> importClauseTree.is(Tree.Kind.IMPORT) && ((ImportTree) importClauseTree).isStatic()) .collect(Collectors.toList()); int staticImportsCount = staticImports.size(); if (staticImportsCount > threshold) { List<JavaFileScannerContext.Location> flow = staticImports.stream() .map(importStatement -> new JavaFileScannerContext.Location("+1", importStatement)) .collect(Collectors.toList()); String message = String.format("Reduce the number of \"static\" imports in this class from %d to the maximum allowed %d.", staticImportsCount, threshold); reportIssue(staticImports.get(0), message, flow, null); } }
Source:
Trip mapServiceJourney(ServiceJourney serviceJourney){ org.opentripplanner.model.Route route = resolveRoute(serviceJourney); String serviceId = resolveServiceId(serviceJourney); if(serviceId == null || route == null) { return null; } Trip trip = new Trip(); trip.setId(idFactory.createId(serviceJourney.getId())); trip.setRoute(route); trip.setServiceId(idFactory.createId(serviceId)); trip.setShapeId(getShapeId(serviceJourney)); if (serviceJourney.getPrivateCode() != null) { trip.setInternalPlanningCode(serviceJourney.getPrivateCode().getValue()); } if (serviceJourney.getPublicCode() != null) { trip.setTripShortName(serviceJourney.getPublicCode()); } return trip; }

Target:
Trip mapServiceJourney(ServiceJourney serviceJourney){ org.opentripplanner.model.Route route = resolveRoute(serviceJourney); String serviceId = resolveServiceId(serviceJourney); if(serviceId == null || route == null) { return null; } Trip trip = new Trip(); trip.setId(idFactory.createId(serviceJourney.getId())); trip.setRoute(route); trip.setServiceId(idFactory.createId(serviceId)); trip.setShapeId(getShapeId(serviceJourney)); if (serviceJourney.getPrivateCode() != null) { trip.setInternalPlanningCode(serviceJourney.getPrivateCode().getValue()); } trip.setTripShortName(serviceJourney.getPublicCode()); return trip; }
Source:
public void start() { l1Lifespan = config.clustering().l1().lifespan(); replicationTimeout = config.clustering().sync().replTimeout(); }

Target:
public void start() { l1Lifespan = config.clustering().l1().lifespan(); replicationTimeout = config.clustering().remoteTimeout(); }
Source:
private CompressionCodec byName(String name) { Assert.hasText("'name' must not be empty"); CompressionCodec codec = codecs.get(name.toUpperCase()); if (codec == null) { throw new CompressionException(String.format(MISSING_COMPRESSION_MESSAGE, name)); } return codec; }

Target:
private CompressionCodec byName(String name) { Assert.hasText(name, "'name' must not be empty"); CompressionCodec codec = codecs.get(name.toUpperCase()); if (codec == null) { throw new CompressionException(String.format(MISSING_COMPRESSION_MESSAGE, name)); } return codec; }
Source:
public String getDefaultAuthenticator(String idpName) throws IdentityApplicationManagementException { IdentityProviderManager idpManager = IdentityProviderManager.getInstance(); try { IdentityProvider idp = idpManager.getIdPByName(idpName, CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); return idp.getDefaultAuthenticatorConfig() != null ? idp .getDefaultAuthenticatorConfig().getName() : null; } catch (IdentityProviderManagementException e) { throw new IdentityApplicationManagementException(e.getMessage(), e); } }

Target:
public String getDefaultAuthenticator(String idpName) throws IdentityApplicationManagementException { IdentityProviderManager idpManager = IdentityProviderManager.getInstance(); try { IdentityProvider idp = idpManager.getIdPByName(idpName, CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); return idp.getDefaultAuthenticatorConfig() != null ? idp .getDefaultAuthenticatorConfig().getName() : null; } catch (IdentityProviderManagementException e) { throw new IdentityApplicationManagementException("Error when retrieving default authenticator of idp " + idpName, e); } }
Source:
public void testDeduperStreamCodec() { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new TestDedupApp(), conf); LocalMode.Controller lc = lma.getController(); lc.run(10 * 1000); } catch (Exception e) { e.printStackTrace(); Assert.fail("constraint violations: " + e); } Assert.assertFalse(testFailed); }

Target:
public void testDeduperStreamCodec() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); TestDedupApp app = new TestDedupApp(); lma.prepareDAG(app, conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); app.dedup.latch.await(); Assert.assertFalse(testFailed); }
Source:
private void resyncCustomToTag() { if (!this.manipulators.isEmpty()) { final NBTTagList newList = new NBTTagList(); final List<DataView> manipulatorViews = DataUtil.getSerializedManipulatorList(this.bridge$getCustomManipulators()); for (DataView dataView : manipulatorViews) { newList.appendTag(NbtTranslator.getInstance().translateData(dataView)); } final NBTTagCompound spongeCompound = shadow$getOrCreateSubCompound(Constants.Sponge.SPONGE_DATA); spongeCompound.setTag(Constants.Sponge.CUSTOM_MANIPULATOR_TAG_LIST, newList); } else if (!this.failedData.isEmpty()) { final NBTTagList newList = new NBTTagList(); for (DataView failedDatum : this.failedData) { newList.appendTag(NbtTranslator.getInstance().translateData(failedDatum)); } final NBTTagCompound spongeCompound = shadow$getOrCreateSubCompound(Constants.Sponge.SPONGE_DATA); spongeCompound.setTag(Constants.Sponge.FAILED_CUSTOM_DATA, newList); } else { if (shadow$hasTagCompound()) { this.shadow$getTagCompound().removeTag(Constants.Sponge.SPONGE_DATA); if (this.shadow$getTagCompound().isEmpty()) { this.shadow$setTagCompound(null); } } } }

Target:
private void resyncCustomToTag() { if (!this.manipulators.isEmpty()) { final NBTTagList newList = new NBTTagList(); final List<DataView> manipulatorViews = DataUtil.getSerializedManipulatorList(this.bridge$getCustomManipulators()); for (DataView dataView : manipulatorViews) { newList.appendTag(NbtTranslator.getInstance().translateData(dataView)); } final NBTTagCompound spongeCompound = this.shadow$getOrCreateSubCompound(Constants.Sponge.SPONGE_DATA); spongeCompound.setTag(Constants.Sponge.CUSTOM_MANIPULATOR_TAG_LIST, newList); } else if (!this.failedData.isEmpty()) { final NBTTagList newList = new NBTTagList(); for (DataView failedDatum : this.failedData) { newList.appendTag(NbtTranslator.getInstance().translateData(failedDatum)); } final NBTTagCompound spongeCompound = this.shadow$getOrCreateSubCompound(Constants.Sponge.SPONGE_DATA); spongeCompound.setTag(Constants.Sponge.FAILED_CUSTOM_DATA, newList); } else { if (this.shadow$hasTagCompound()) { this.shadow$getTagCompound().removeTag(Constants.Sponge.SPONGE_DATA); if (this.shadow$getTagCompound().isEmpty()) { this.shadow$setTagCompound(null); } } } }
Source:
private SSLContext getSslContext() { if (!isSslConfigured()) { throw new IllegalArgumentException("KeyStore and TrustStore system properties must be set."); } KeyStore trustStore = getKeyStore(getProperty(TRUST_STORE), getProperty(TRUST_STORE_PASS)); KeyStore keyStore = getKeyStore(getProperty(KEY_STORE), getProperty(KEY_STORE_PASS)); SSLContext sslContext; try { sslContext = SSLContexts.custom() .loadKeyMaterial(keyStore, getProperty(KEY_STORE_PASS).toCharArray()) .loadTrustMaterial(trustStore) .useTLS() .build(); } catch (UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) { throw new IllegalArgumentException( "Unable to use javax.net.ssl.keyStorePassword to load key material to create SSL context for Solr client."); } sslContext.getDefaultSSLParameters().setWantClientAuth(true); return sslContext; }

Target:
private SSLContext getSslContext() { if (!protectedSolrSettings.isSslConfigured()) { throw new IllegalArgumentException("KeyStore and TrustStore system properties must be set."); } KeyStore trustStore = getKeyStore( protectedSolrSettings.getTrustStore(), protectedSolrSettings.getTrustStorePass()); KeyStore keyStore = getKeyStore(protectedSolrSettings.getKeyStore(), protectedSolrSettings.getKeyStorePass()); SSLContext sslContext; try { sslContext = SSLContexts.custom() .loadKeyMaterial(keyStore, protectedSolrSettings.getKeyStorePass().toCharArray()) .loadTrustMaterial(trustStore) .useTLS() .build(); } catch (UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) { throw new IllegalArgumentException( "Unable to use javax.net.ssl.keyStorePassword to load key material to create SSL context for Solr client."); } sslContext.getDefaultSSLParameters().setWantClientAuth(true); return sslContext; }
Source:
public boolean onMapClick(@NonNull LatLng point) { Style style = mapboxMap.getStyle(); if (style != null) { makeElevationRequestToTilequeryApi(style, point); } return true; }

Target:
public boolean onMapClick(@NonNull LatLng point) { mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { makeElevationRequestToTilequeryApi(style, point); } }); return true; }
Source:
public void run() { FutureTask[] callbackArray = new FutureTask[_callbacksList.size()]; AtomicReferenceArray<FutureTask> _bufferList = new AtomicReferenceArray<FutureTask>(_callbacksList.toArray(callbackArray)); ExecutorService executor = Executors.newFixedThreadPool(10); try { for (int i = 0; i < _bufferList.length(); i++) { Thread.sleep(_sleepTime); FutureTask f = _bufferList.get(i); if (!f.isDone()) { executor.submit(f).get(); } } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException ee) { ee.printStackTrace(); } }

Target:
public void run() { FutureTask[] callbackArray = new FutureTask[_callbacksList.size()]; AtomicReferenceArray<FutureTask> _bufferList = new AtomicReferenceArray<FutureTask>(_callbacksList.toArray(callbackArray)); ExecutorService executor = Executors.newFixedThreadPool(10); try { for (int i = 0; i < _bufferList.length(); i++) { Thread.sleep(_sleepTime); FutureTask f = _bufferList.get(i); if (!f.isDone()) { executor.submit(f).get(); } } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException ee) { ee.printStackTrace(); } finally { executor.shutdownNow(); } }
Source:
public Connection connection(@Nullable String schema) { if (schema != null && !F.eq(this.schema, schema)) { try { if(schema != null && schema.trim().isEmpty()){ throw new IgniteSQLException("Failed to set schema for DB connection. " + "Schema name could not be an empty string"); } conn.setSchema(schema); this.schema = schema; } catch (SQLException e) { throw new IgniteSQLException("Failed to set schema for DB connection for thread [schema=" + schema + "]", e); } } return conn; }

Target:
public Connection connection(@Nullable String schema) { if (schema != null && !F.eq(this.schema, schema)) { try { if(schema.trim().isEmpty()){ throw new IgniteSQLException("Failed to set schema for DB connection. " + "Schema name could not be an empty string"); } conn.setSchema(schema); this.schema = schema; } catch (SQLException e) { throw new IgniteSQLException("Failed to set schema for DB connection for thread [schema=" + schema + "]", e); } } return conn; }
Source:
boolean generateHtmlFile(List<File> xmlFiles, File htmlFile) { return LicenseHtmlGeneratorFromXml.generateHtml(xmlFiles, htmlFile, mContext.getResources().getString(R.string.notice_header)); }

Target:
boolean generateHtmlFile(List<File> xmlFiles, File htmlFile) { return LicenseHtmlGeneratorFromXml.generateHtml(xmlFiles, htmlFile, mContext.getString(R.string.notice_header)); }
Source:
public InputStream getObjectInputStream(RepoObject repoObject) throws RepoException { InputStream content = null; try { content = objectStore.getInputStream(repoObject); } catch (Exception e) { log.error("Error retrieving content for object. Key: " + repoObject.getKey() + " , bucketName: " + repoObject.getBucketName() + " , versionChecksum: " + repoObject.getVersionChecksum() + " . Error: " + e.getMessage()); throw new RepoException(e); } if (content == null){ log.error("Error retrieving content for object. Content not found. Key: " + repoObject.getKey() + " , bucketName: " + repoObject.getBucketName() + " , versionChecksum: " + repoObject.getVersionChecksum()); throw new RepoException(RepoException.Type.ObjectContentNotFound); } return content; }

Target:
public InputStream getObjectInputStream(RepoObject repoObject) throws RepoException { InputStream content = null; try { content = objectStore.getInputStream(repoObject); } catch (Exception e) { log.error("Error retrieving content for object. Key: , bucketName: , versionChecksum: . Error: {}", repoObject.getKey(), repoObject.getBucketName(), repoObject.getVersionChecksum(), e.getMessage()); throw new RepoException(e); } if (content == null){ log.error("Error retrieving content for object. Content not found. Key: , bucketName: , versionChecksum: ", repoObject.getKey(), repoObject.getBucketName(), repoObject.getVersionChecksum()); throw new RepoException(RepoException.Type.ObjectContentNotFound); } return content; }
Source:
public Set<String> getCollections() { return collections != null ? new TreeSet<>(collections) : null; }

Target:
public Set<String> getCollections() { return collections; }
Source:
public void theDeviceReturnsUpdateFirmwareResponseOverOSLP(final String result) { Oslp.Status oslpStatus = Status.OK; switch (result) { case "OK": oslpStatus = Status.OK; } this.oslpMockServer.mockUpdateFirmwareResponse(oslpStatus); }

Target:
public void theDeviceReturnsUpdateFirmwareResponseOverOSLP(final String result) { this.oslpMockServer.mockUpdateFirmwareResponse(this.checkAndGetOslpStatus(result)); }
Source:
private String getExtractionFolder() { String projectPath = System.getProperty("user.dir"); if (new File(projectPath).canWrite()) { return projectPath + PLUGINS_FOLDER; } else { return System.getProperty("user.home") + "/.ganttproject.d" + PLUGINS_FOLDER; } }

Target:
private String getExtractionFolder() { URL projectPath = Object.class.getResource(PLUGINS_FOLDER); if (projectPath != null && new File(projectPath.getPath()).canWrite()) { return projectPath.getPath() + PLUGINS_FOLDER; } else { return System.getProperty("user.home") + File.separator + ".ganttproject.d" + PLUGINS_FOLDER; } }
Source:
protected Viewer createViewer(Composite parent) { viewer = ExecutionContextViewerFactory.createViewer(parent, false, this); selectionListener = new RaiseEventSelectionListener(viewer); DebugPlugin.getDefault().addDebugEventListener(this); return viewer; }

Target:
protected Viewer createViewer(Composite parent) { viewer = ExecutionContextViewerFactory.createViewer(parent, false, this); selectionListener = new RaiseEventSelectionListener(viewer); return viewer; }
Source:
public ObservationEntity observationToEntity(Observation obs, long encounterID) { ObservationEntity observationEntity = new ObservationEntity(); observationEntity.setId(obs.getId()); observationEntity.setUuid(obs.getUuid()); observationEntity.setDisplay(obs.getDisplay()); observationEntity.setEncounterKeyID(encounterID); observationEntity.setDisplayValue(obs.getDisplayValue()); observationEntity.setDiagnosisOrder(obs.getDiagnosisOrder()); observationEntity.setDiagnosisList(obs.getDiagnosisList()); observationEntity.setDiagnosisCertainty(obs.getDiagnosisCertainty()); observationEntity.setDiagnosisNote(obs.getDiagnosisNote()); if (obs.getConcept() != null) { observationEntity.setConceptuuid(obs.getConcept().getUuid()); } else { observationEntity.setConceptuuid(null); } return observationEntity; }

Target:
public static ObservationEntity observationToEntity(Observation obs, long encounterID) { ObservationEntity observationEntity = new ObservationEntity(); observationEntity.setId(obs.getId()); observationEntity.setUuid(obs.getUuid()); observationEntity.setDisplay(obs.getDisplay()); observationEntity.setEncounterKeyID(encounterID); observationEntity.setDisplayValue(obs.getDisplayValue()); observationEntity.setDiagnosisOrder(obs.getDiagnosisOrder()); observationEntity.setDiagnosisList(obs.getDiagnosisList()); observationEntity.setDiagnosisCertainty(obs.getDiagnosisCertainty()); observationEntity.setDiagnosisNote(obs.getDiagnosisNote()); if (obs.getConcept() != null) { observationEntity.setConceptuuid(obs.getConcept().getUuid()); } else { observationEntity.setConceptuuid(null); } return observationEntity; }
Source:
public VmBase() { mOs = VmOsType.Unassigned; }

Target:
public VmBase() { }
Source:
private RequestDescriptor createSpectraRequestDescriptor() { final RequestDescriptor requestDescriptor = new RequestDescriptor(); requestDescriptor.setName(SPECTRA_NAME_BEFORE); requestDescriptor.setClassification(Classification.spectrads3); requestDescriptor.setDescription(SPECTRA_DESCRIPTOR); return requestDescriptor; }

Target:
private static RequestDescriptor createSpectraRequestDescriptor() { final RequestDescriptor requestDescriptor = new RequestDescriptor(); requestDescriptor.setName(SPECTRA_NAME_BEFORE); requestDescriptor.setClassification(Classification.spectrads3); requestDescriptor.setDescription(SPECTRA_DESCRIPTOR); return requestDescriptor; }
Source:
public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); if(producer == null) { createProducer(); } byte[] body; try { body = exchange.getContext().getTypeConverter() .mandatoryConvertTo(byte[].class, exchange, message.getBody()); } catch (NoTypeConversionAvailableException | TypeConversionException exception) { body = PulsarMessageUtils.serialize(message.getBody()); } producer.send(body); }

Target:
public void process(final Exchange exchange) throws Exception { final Message message = exchange.getIn(); byte[] body; try { body = exchange.getContext().getTypeConverter() .mandatoryConvertTo(byte[].class, exchange, message.getBody()); } catch (NoTypeConversionAvailableException | TypeConversionException exception) { body = PulsarMessageUtils.serialize(message.getBody()); } producer.send(body); }
Source:
public void init() { bigDoors = (BigDoors) Bukkit.getPluginManager().getPlugin("BigDoors"); commander = bigDoors.getCommander(); ObjectFetcher.registerWithObjectFetcher(BigDoorsDoorTag.class); TagManager.registerTagHandler(new TagRunnable.RootForm() { @Override public void run(ReplaceableTagEvent event) { bigdoorTagEvent(event); } }, "bigdoor"); PropertyParser.registerProperty(BigDoorsWorldProperties.class, WorldTag.class); PropertyParser.registerProperty(BigDoorsPlayerProperties.class, PlayerTag.class); ScriptEvent.registerScriptEvent(new BigDoorsDoorTogglesScriptEvent()); }

Target:
public void init() { bigDoors = (BigDoors) Bukkit.getPluginManager().getPlugin("BigDoors"); commander = bigDoors.getCommander(); ObjectFetcher.registerWithObjectFetcher(BigDoorsDoorTag.class, BigDoorsDoorTag.tagProcessor); PropertyParser.registerProperty(BigDoorsWorldProperties.class, WorldTag.class); PropertyParser.registerProperty(BigDoorsPlayerProperties.class, PlayerTag.class); ScriptEvent.registerScriptEvent(new BigDoorsDoorTogglesScriptEvent()); TagManager.registerTagHandler("bigdoor", (attribute) -> { if (!attribute.hasContext(1)) { attribute.echoError("Big Doors door tag base must have input."); return null; } return BigDoorsDoorTag.valueOf(attribute.getContext(1), attribute.context); }); }
Source:
public CPPLanguageServer() { List<String> commands = new ArrayList<>(); File defaultLSLocation = getDefaultLSLocation(store.getString(PreferenceConstants.P_SERVER_CHOICE)); store.setDefault(PreferenceConstants.P_SERVER_PATH, defaultLSLocation.getAbsolutePath()); File languageServerLocation = getLanguageServerLocation(); String parent = ""; String flags = store.getString(PreferenceConstants.P_SERVER_OPTIONS); if (languageServerLocation != null) { commands.add(languageServerLocation.getAbsolutePath()); if (!flags.isEmpty()) { commands.add(flags); } parent = languageServerLocation.getParent(); } setWorkingDirectory(parent); setCommands(commands); }

Target:
public CPPLanguageServer() { List<String> commands = new ArrayList<>(); File defaultLSLocation = getDefaultLSLocation(store.getString(PreferenceConstants.P_SERVER_CHOICE)); if(defaultLSLocation != null) { store.setDefault(PreferenceConstants.P_SERVER_PATH, defaultLSLocation.getAbsolutePath()); } File languageServerLocation = getLanguageServerLocation(); String parent = ""; String flags = store.getString(PreferenceConstants.P_SERVER_OPTIONS); if (languageServerLocation != null) { commands.add(languageServerLocation.getAbsolutePath()); if (!flags.isEmpty()) { commands.add(flags); } parent = languageServerLocation.getParent(); } setWorkingDirectory(parent); setCommands(commands); }
Source:
private KijiTableKeyValueStore(Builder builder) { mTableName = builder.mTableName; mColumn = builder.mColumn; mMinTs = builder.mMinTs; mMaxTs = builder.mMaxTs; mMaxObjectsToCache = builder.mMaxObjectsToCache; mReaderSchema = builder.mReaderSchema; mConf = builder.mConf; }

Target:
private KijiTableKeyValueStore(Builder builder) { mTableUri = builder.mTableUri; mColumn = builder.mColumn; mMinTs = builder.mMinTs; mMaxTs = builder.mMaxTs; mMaxObjectsToCache = builder.mMaxObjectsToCache; mReaderSchema = builder.mReaderSchema; mConf = builder.mConf; }