auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { if (args.length < 2) { System.out.println("Please specify your access key and phone number."); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0], "<LINK_0>"); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { System.out.println(messageBirdClient.viewPurchasedNumber(args[1])); return; } catch (UnauthorizedException | NotFoundException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }

Target:
public static void main(String[] args) { if (args.length < 2) { System.out.println("Please specify your access key and phone number."); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0], "<LINK_0>"); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { System.out.println(messageBirdClient.viewPurchasedNumber(args[1])); } catch (UnauthorizedException | NotFoundException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }
Source:
private boolean onCanGrief(final BlockState blockState) { return SilverfishBlock.canContainSilverfish(blockState) && ((GrieferBridge) this.creature).bridge$canGrief(); }

Target:
private boolean impl$onCanGrief(final BlockState blockState) { return SilverfishBlock.canContainSilverfish(blockState) && ((GrieferBridge) this.creature).bridge$canGrief(); }
Source:
public CustomCommandLine validateAndGetActiveCommandLine(CommandLine commandLine) { LOG.debug("Custom commandlines: {}", customCommandLines); for (CustomCommandLine cli : customCommandLines) { LOG.debug("Checking custom commandline {}, isActive: {}", cli, cli.isActive(commandLine)); if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException( "No valid command-line found. If you were targeting a Yarn cluster, please make sure to have " + "hadoop in your classpath. For more information refer to the \"Deployment & Operations\" section " + "of the official Apache Flink documentation "); }

Target:
public CustomCommandLine validateAndGetActiveCommandLine(CommandLine commandLine) { LOG.debug("Custom commandlines: {}", customCommandLines); for (CustomCommandLine cli : customCommandLines) { LOG.debug("Checking custom commandline {}, isActive: {}", cli, cli.isActive(commandLine)); if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException("No valid command-line found."); }
Source:
public void testSystemCatalogWALEntryFilter() throws Exception { Get tenantGet = getGet(catalogTable, TENANT_BYTES, TENANT_VIEW_NAME); Get nonTenantGet = getGet(catalogTable, DEFAULT_TENANT_BYTES, NONTENANT_VIEW_NAME); WAL.Entry nonTenantEntry = getEntry(systemCatalogTableName, nonTenantGet); WAL.Entry tenantEntry = getEntry(systemCatalogTableName, tenantGet); SystemCatalogWALEntryFilter filter = new SystemCatalogWALEntryFilter(); ChainWALEntryFilter chainWALEntryFilter = new ChainWALEntryFilter(filter); Assert.assertTrue(nonTenantEntry.getEdit().size() > 0); Assert.assertTrue("Non tenant edits for system catalog got ", chainWALEntryFilter.filter(nonTenantEntry).getEdit().isEmpty()); WAL.Entry filteredTenantEntry = chainWALEntryFilter.filter(tenantEntry); Assert.assertNotNull("Tenant view was filtered when it shouldn't be!", filteredTenantEntry); Assert.assertEquals(tenantEntry.getEdit().size(), chainWALEntryFilter.filter(tenantEntry).getEdit().size()); WALEdit comboEdit = new WALEdit(); comboEdit.getCells().addAll(nonTenantEntry.getEdit().getCells()); comboEdit.getCells().addAll(tenantEntry.getEdit().getCells()); WAL.Entry comboEntry = new WAL.Entry(walKey, comboEdit); Assert.assertEquals(tenantEntry.getEdit().size() + nonTenantEntry.getEdit().size() , comboEntry.getEdit().size()); Assert.assertEquals(tenantEntry.getEdit().size(), chainWALEntryFilter.filter(comboEntry).getEdit().size()); }

Target:
public void testSystemCatalogWALEntryFilter() throws Exception { Get tenantGet = getGet(catalogTable, TENANT_BYTES, TENANT_VIEW_NAME); Get nonTenantGet = getGet(catalogTable, DEFAULT_TENANT_BYTES, NONTENANT_VIEW_NAME); WAL.Entry nonTenantEntry = getEntry(systemCatalogTableName, nonTenantGet); WAL.Entry tenantEntry = getEntry(systemCatalogTableName, tenantGet); SystemCatalogWALEntryFilter filter = new SystemCatalogWALEntryFilter(); ChainWALEntryFilter chainWALEntryFilter = new ChainWALEntryFilter(filter); Assert.assertTrue(nonTenantEntry.getEdit().size() > 0); Assert.assertTrue("Non tenant edits for system catalog should not get filtered", chainWALEntryFilter.filter(nonTenantEntry).getEdit().isEmpty()); WAL.Entry filteredTenantEntry = chainWALEntryFilter.filter(tenantEntry); Assert.assertNotNull("Tenant view was filtered when it shouldn't be!", filteredTenantEntry); Assert.assertEquals("filtered entry is not correct", tenantEntry.getEdit().size(), filteredTenantEntry.getEdit().size()); WALEdit comboEdit = new WALEdit(); comboEdit.getCells().addAll(nonTenantEntry.getEdit().getCells()); comboEdit.getCells().addAll(tenantEntry.getEdit().getCells()); WAL.Entry comboEntry = new WAL.Entry(walKey, comboEdit); Assert.assertEquals(tenantEntry.getEdit().size() + nonTenantEntry.getEdit().size() , comboEntry.getEdit().size()); Assert.assertEquals(tenantEntry.getEdit().size(), chainWALEntryFilter.filter(comboEntry).getEdit().size()); }
Source:
private void calculateBestPlan() { cost = -1; if (filters.length == 1 || session.isForceJoinOrder()) { testPlan(filters); } else { start = System.nanoTime(); if (filters.length <= MAX_BRUTE_FORCE_FILTERS) { calculateBruteForceAll(); } else { calculateBruteForceSome(); random = new Random(0); calculateGenetic(); } } }

Target:
private void calculateBestPlan() { cost = -1; if (filters.length == 1 || session.isForceJoinOrder()) { testPlan(filters); } else { startNs = System.nanoTime(); if (filters.length <= MAX_BRUTE_FORCE_FILTERS) { calculateBruteForceAll(); } else { calculateBruteForceSome(); random = new Random(0); calculateGenetic(); } } }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_VIRT); attr.setFriendlyName("userCertificates"); attr.setDisplayName("User certificates"); attr.setType(LinkedHashMap.class.getName()); attr.setDescription("User certificates limited to ten newest certificates."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_VIRT); attr.setFriendlyName("userCertificatesLimited"); attr.setDisplayName("User certificates limited"); attr.setType(ArrayList.class.getName()); attr.setDescription("User certificates limited to ten newest certificates."); return attr; }
Source:
protected void onOntologyClicked(OntologySummaryBean ontology) { if (ontology == ontologies.getSelectedOntology()) { this.editor.setValue(null); ontologies.unselectItem(); return; } else if (ontologies.getSelectedOntology() != null) { if (this.editor.isDirty()) { Window.alert(i18n.format("ontologies-page.editor-is-dirty")); return; } ontologies.unselectItem(); } ontologies.selectItem(ontology); this.editor.clear(); this.ontologyService.get(ontology.getUuid(), true, new IRpcServiceInvocationHandler<OntologyBean>() { @Override public void onReturn(OntologyBean data) { editor.setValue(data); } @Override public void onError(Throwable error) { notificationService.sendErrorNotification( i18n.format("ontologies-page.error-loading-ontology"), error); editor.clear(); } }); }

Target:
protected void onOntologyClicked(OntologySummaryBean ontology) { if (ontology == ontologies.getSelectedOntology()) { if (this.editor.isDirty()) { Window.alert(i18n.format("ontologies-page.editor-is-dirty")); return; } this.editor.setValue(null); ontologies.unselectItem(); return; } else if (ontologies.getSelectedOntology() != null) { if (this.editor.isDirty()) { Window.alert(i18n.format("ontologies-page.editor-is-dirty")); return; } ontologies.unselectItem(); } ontologies.selectItem(ontology); reloadOntologyEditor(ontology.getUuid()); this.uuidNewOntology = ""; }
Source:
public DefaultMessagingService(HelixManager manager) { _manager = manager; _evaluator = new CriteriaEvaluator(); boolean isParticipant = false; if (manager.getInstanceType() == InstanceType.PARTICIPANT || manager.getInstanceType() == InstanceType.CONTROLLER_PARTICIPANT) { isParticipant = true; } _taskExecutor = new HelixTaskExecutor( new ParticipantStatusMonitor(isParticipant, manager.getInstanceName()), new MessageQueueMonitor(manager.getClusterName(), manager.getInstanceName()), manager); _asyncCallbackService = new AsyncCallbackService(); _taskExecutor.registerMessageHandlerFactory(MessageType.TASK_REPLY.name(), _asyncCallbackService); }

Target:
public DefaultMessagingService(HelixManager manager) { _manager = manager; _evaluator = new CriteriaEvaluator(); boolean isParticipant = false; if (manager.getInstanceType() == InstanceType.PARTICIPANT || manager.getInstanceType() == InstanceType.CONTROLLER_PARTICIPANT) { isParticipant = true; } _taskExecutor = new HelixTaskExecutor( new ParticipantStatusMonitor(isParticipant, manager.getInstanceName()), new MessageQueueMonitor(manager.getClusterName(), manager.getInstanceName())); _asyncCallbackService = new AsyncCallbackService(); _taskExecutor.registerMessageHandlerFactory(MessageType.TASK_REPLY.name(), _asyncCallbackService); }
Source:
private InterceptorMismatchException() { }

Target:
private InterceptorMismatchException() { this(null, null); }
Source:
public int getSSLPort() { if (hasSSLPort()) { return sslPort.getPort(); } else { throw new IllegalStateException( "No HTTP2 port exists for the Data Node " + getHostname() + ":" + plainTextPort.getPort()); } }

Target:
public int getSSLPort() { if (hasSSLPort()) { return sslPort.getPort(); } else { throw new IllegalStateException( "No HTTP2 port exists for the Data Node " + hostName + ":" + plainTextPort.getPort()); } }
Source:
public void testSystemPackages() throws Exception { File config = OSGiTestsActivator.getContext().getDataFile(getName()); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.BUNDLE_MANIFESTVERSION, "2"); headers.put(Constants.BUNDLE_SYMBOLICNAME, getName()); config.mkdirs(); File bundle = SystemBundleTests.createBundle(config, getName(), headers); Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.start(); BundleContext systemContext = equinox.getBundleContext(); Dictionary<String, String> testHeaders = equinox.getHeaders(); assertTrue(Constants.EXPORT_PACKAGE + " does not contain the java.* package", testHeaders.get(Constants.EXPORT_PACKAGE).contains(JAVA_LANG)); assertTrue(Constants.EXPORT_PACKAGE + " does not contain the java.* package", testHeaders.get(Constants.EXPORT_PACKAGE).contains(JAVA_UTIL)); Bundle testBundle = systemContext.installBundle(bundle.toURI().toString()); testBundle.start(); String systemPackages = testBundle.getBundleContext().getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES); assertTrue("System packages should include java.* packages", systemPackages.contains(JAVA_LANG)); } catch (BundleException e) { fail("Failed to test System packages"); } finally { try { equinox.stop(); equinox.waitForStop(10000); } catch (Exception e) { } } }

Target:
public void testSystemPackages() throws Exception { Map<Integer, Integer> packagesPerVersion = new HashMap<Integer, Integer>(); packagesPerVersion.put(7, 56); packagesPerVersion.put(8, 63); packagesPerVersion.put(9, 66); for (Entry<Integer, Integer> entry : packagesPerVersion.entrySet()) { doSystemPackages(entry.getKey(), entry.getValue()); } }
Source:
public List<SinkRecord> flush() throws SQLException { if (records.isEmpty()) { log.debug("Records is empty"); return new ArrayList<>(); } log.debug("Flushing buffered records", records.size()); for (SinkRecord record : records) { try { if (isNull(record.value()) && nonNull(deleteStatementBinder)) { deleteStatementBinder.bindRecord(record); } else { updateStatementBinder.bindRecord(record); } } catch (SQLException e) { throw new SendToDLQException(e, record); } } Optional<Long> totalUpdateCount = executeUpdates(); long totalDeleteCount = executeDeletes(); final long expectedCount = updateRecordCount(); log.trace("{} records:{} resulting in totalUpdateCount:{} totalDeleteCount:{}", config.insertMode, records.size(), totalUpdateCount, totalDeleteCount ); if (totalUpdateCount.filter(total -> total != expectedCount).isPresent() && config.insertMode == INSERT) { throw new ConnectException(String.format( "Update count (%d) did not sum up to total number of records inserted (%d)", totalUpdateCount.get(), expectedCount )); } if (!totalUpdateCount.isPresent()) { log.info( "{} records:{} , but no count of the number of rows it affected is available", config.insertMode, records.size() ); } final List<SinkRecord> flushedRecords = records; records = new ArrayList<>(); deletesInBatch = false; return flushedRecords; }

Target:
public List<SinkRecord> flush() throws SQLException { if (records.isEmpty()) { log.debug("Records is empty"); return new ArrayList<>(); } log.debug("Flushing buffered records", records.size()); for (SinkRecord record : records) { if (isNull(record.value()) && nonNull(deleteStatementBinder)) { deleteStatementBinder.bindRecord(record); } else { updateStatementBinder.bindRecord(record); } } Optional<Long> totalUpdateCount = executeUpdates(); long totalDeleteCount = executeDeletes(); final long expectedCount = updateRecordCount(); log.trace("{} records:{} resulting in totalUpdateCount:{} totalDeleteCount:{}", config.insertMode, records.size(), totalUpdateCount, totalDeleteCount ); if (totalUpdateCount.filter(total -> total != expectedCount).isPresent() && config.insertMode == INSERT) { throw new ConnectException(String.format( "Update count (%d) did not sum up to total number of records inserted (%d)", totalUpdateCount.get(), expectedCount )); } if (!totalUpdateCount.isPresent()) { log.info( "{} records:{} , but no count of the number of rows it affected is available", config.insertMode, records.size() ); } final List<SinkRecord> flushedRecords = records; records = new ArrayList<>(); deletesInBatch = false; return flushedRecords; }
Source:
protected RestClient getRestClient(boolean doesNotRequireAuth) { final SalesforceReactActivity currentActivity = (SalesforceReactActivity) getCurrentActivity(); if (currentActivity == null) { return null; } if (doesNotRequireAuth) { return currentActivity.getClientManager().peekUnauthenticatedRestClient(); } return currentActivity.getRestClient(); }

Target:
protected RestClient getRestClient(boolean doesNotRequireAuth) { final SalesforceReactActivity currentActivity = (SalesforceReactActivity) getCurrentActivity(); if (currentActivity == null) { return null; } if (doesNotRequireAuth) { return SalesforceReactSDKManager.getInstance().getClientManager().peekUnauthenticatedRestClient(); } return currentActivity.getRestClient(); }
Source:
private boolean hasReportUri(List<String> cspOptions) { for (String csp : cspOptions) { String lowerCsp = csp.toLowerCase(Locale.ROOT); if (lowerCsp.contains("report-uri") || lowerCsp.contains("report-to")) { return true; } } return false; }

Target:
private static boolean hasReportUri(List<String> cspOptions) { for (String csp : cspOptions) { String lowerCsp = csp.toLowerCase(Locale.ROOT); if (lowerCsp.contains("report-uri")) { return true; } } return false; }
Source:
private Expression getCopyOfOppositeExpression(ASTRewrite rewrite, AST ast, final Expression operand) { if (operand instanceof ParenthesizedExpression) { return getCopyOfOppositeExpression(rewrite, ast, ((ParenthesizedExpression) operand).getExpression()); } if (operand instanceof PrefixExpression) { final PrefixExpression pe= (PrefixExpression) operand; if (ASTNodes.hasOperator(pe, PrefixExpression.Operator.NOT)) { PrefixExpression otherPe= ASTNodes.as((Expression) pe.getOperand(), PrefixExpression.class); if (otherPe != null && ASTNodes.hasOperator(otherPe, PrefixExpression.Operator.NOT)) { return getCopyOfOppositeExpression(rewrite, ast, otherPe.getOperand()); } return (Expression) rewrite.createCopyTarget(pe.getOperand()); } } else if (operand instanceof InfixExpression) { final InfixExpression ie= (InfixExpression) operand; final InfixExpression.Operator aReverseOp= ASTNodes.oppositeInfixOperator(ie.getOperator()); if (aReverseOp != null) { return doRewriteAST(rewrite, ast, ie, aReverseOp); } } else { final Boolean constant= ASTNodes.getBooleanLiteral(operand); if (constant != null) { return ast.newBooleanLiteral(!constant.booleanValue()); } } return null; }

Target:
private Expression getCopyOfOppositeExpression(ASTRewrite rewrite, AST ast, final Expression operand) { if (operand instanceof ParenthesizedExpression) { return getCopyOfOppositeExpression(rewrite, ast, ((ParenthesizedExpression) operand).getExpression()); } if (operand instanceof PrefixExpression) { final PrefixExpression pe= (PrefixExpression) operand; if (ASTNodes.hasOperator(pe, PrefixExpression.Operator.NOT)) { Expression otherOperand= pe.getOperand(); PrefixExpression otherPe= ASTNodes.as(otherOperand, PrefixExpression.class); if (otherPe != null && ASTNodes.hasOperator(otherPe, PrefixExpression.Operator.NOT)) { return getCopyOfOppositeExpression(rewrite, ast, otherPe.getOperand()); } return (Expression) rewrite.createCopyTarget(otherOperand); } } else if (operand instanceof InfixExpression) { final InfixExpression ie= (InfixExpression) operand; final InfixExpression.Operator aReverseOp= ASTNodes.oppositeInfixOperator(ie.getOperator()); if (aReverseOp != null) { return doRewriteAST(rewrite, ast, ie, aReverseOp); } } else { final Boolean constant= ASTNodes.getBooleanLiteral(operand); if (constant != null) { return ast.newBooleanLiteral(!constant.booleanValue()); } } return null; }
Source:
private List<Cookie> get(String domain, String path, boolean secure) { final boolean[] removeExpired = {false}; List<Cookie> result = cookieJar.entrySet().parallelStream().filter(pair -> { CookieKey key = pair.getKey(); StoredCookie storedCookie = pair.getValue(); boolean hasCookieExpired = hasCookieExpired(storedCookie.cookie, storedCookie.createdAt); if (hasCookieExpired && !removeExpired[0]) removeExpired[0] = true; return !hasCookieExpired && domainsMatch(key.domain, domain, storedCookie.hostOnly) && pathsMatch(key.path, path) && (secure || !storedCookie.cookie.isSecure()); }).map(v -> v.getValue().cookie).collect(Collectors.toList()); if (removeExpired[0]) removeExpired(); return result; }

Target:
private List<Cookie> get(String domain, String path, boolean secure) { final boolean[] removeExpired = {false}; List<Cookie> result = cookieJar.entrySet().stream().filter(pair -> { CookieKey key = pair.getKey(); StoredCookie storedCookie = pair.getValue(); boolean hasCookieExpired = hasCookieExpired(storedCookie.cookie, storedCookie.createdAt); if (hasCookieExpired && !removeExpired[0]) removeExpired[0] = true; return !hasCookieExpired && domainsMatch(key.domain, domain, storedCookie.hostOnly) && pathsMatch(key.path, path) && (secure || !storedCookie.cookie.isSecure()); }).map(v -> v.getValue().cookie).collect(Collectors.toList()); if (removeExpired[0]) removeExpired(); return result; }
Source:
void scan( Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( 0 ); } this.next = 0; this.highMark = read.nodeHighMark(); this.read = read; if ( labelCursor != null ) { labelCursor = read.labelCursor(); } }

Target:
void scan( Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( 0 ); } this.next = 0; this.highMark = read.nodeHighMark(); this.read = read; if ( labelCursor == null ) { labelCursor = read.labelCursor(); } }
Source:
public void testUpdateNotAppend(){ final RingTime ringTime = new RingTime(DateTime.now().getMillis(), DateTime.now().getMillis(), new long[]{1L}, false, Lists.newArrayList()); this.mergedUserInfoDynamoDB.setTimeZone(this.deviceId, this.accountId, DateTimeZone.UTC); this.mergedUserInfoDynamoDB.setRingTime(this.deviceId, this.accountId, ringTime); this.mergedUserInfoDynamoDB.setPillColor(this.deviceId, this.accountId, "Pang's Pill", new Color(0xFE, 0x00, 0x00)); final List<UserInfo> userInfoList = this.mergedUserInfoDynamoDB.getInfo(this.deviceId); assertThat(userInfoList.size(), is(1)); assertThat(userInfoList.get(0).ringTime.isPresent(), is(true)); assertThat(userInfoList.get(0).timeZone.isPresent(), is(true)); assertThat(userInfoList.get(0).ringTime.get().equals(ringTime), is(true)); assertThat(userInfoList.get(0).timeZone.get().equals(DateTimeZone.UTC), is(true)); final int intARGB = userInfoList.get(0).pillColor.get().getPillColor(); if(ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { assertThat(intARGB, is(0x0000FEFF)); }else{ assertThat(intARGB, is(0xFFFE0000)); } }

Target:
public void testUpdateNotAppend(){ final RingTime ringTime = new RingTime(DateTime.now().getMillis(), DateTime.now().getMillis(), new long[]{1L}, false); this.mergedUserInfoDynamoDB.setTimeZone(this.deviceId, this.accountId, DateTimeZone.UTC); this.mergedUserInfoDynamoDB.setRingTime(this.deviceId, this.accountId, ringTime); this.mergedUserInfoDynamoDB.setPillColor(this.deviceId, this.accountId, "Pang's Pill", new Color(0xFE, 0x00, 0x00)); final List<UserInfo> userInfoList = this.mergedUserInfoDynamoDB.getInfo(this.deviceId); assertThat(userInfoList.size(), is(1)); assertThat(userInfoList.get(0).ringTime.isPresent(), is(true)); assertThat(userInfoList.get(0).timeZone.isPresent(), is(true)); assertThat(userInfoList.get(0).ringTime.get().equals(ringTime), is(true)); assertThat(userInfoList.get(0).timeZone.get().equals(DateTimeZone.UTC), is(true)); final int intARGB = userInfoList.get(0).pillColor.get().getPillColor(); if(ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { assertThat(intARGB, is(0x0000FEFF)); }else{ assertThat(intARGB, is(0xFFFE0000)); } }
Source:
private RemoteIterator<S3ALocatedFileStatus> innerListFiles( final Path f, final boolean recursive, final Listing.FileStatusAcceptor acceptor, final S3AFileStatus status, final boolean collectTombstones, final boolean forceNonAuthoritativeMS) throws IOException { entryPoint(INVOCATION_LIST_FILES); Path path = qualify(f); LOG.debug("listFiles({}, {})", path, recursive); try { if (status != null && status.isFile()) { LOG.debug("Path is a file"); return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(status)); } RemoteIterator<S3ALocatedFileStatus> listFilesAssumingDir = getListFilesAssumingDir(path, recursive, acceptor, collectTombstones, forceNonAuthoritativeMS); if (!listFilesAssumingDir.hasNext()) { final S3AFileStatus fileStatus = (S3AFileStatus) getFileStatus(path); if (fileStatus.isFile()) { return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(fileStatus)); } } return listFilesAssumingDir; } catch (AmazonClientException e) { throw translateException("listFiles", path, e); } }

Target:
private RemoteIterator<S3ALocatedFileStatus> innerListFiles( final Path f, final boolean recursive, final Listing.FileStatusAcceptor acceptor, final S3AFileStatus status, final boolean collectTombstones, final boolean forceNonAuthoritativeMS) throws IOException { entryPoint(INVOCATION_LIST_FILES); Path path = qualify(f); LOG.debug("listFiles({}, {})", path, recursive); try { if (status != null && status.isFile()) { LOG.debug("Path is a file"); return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(status)); } RemoteIterator<S3ALocatedFileStatus> listFilesAssumingDir = getListFilesAssumingDir(path, recursive, acceptor, collectTombstones, forceNonAuthoritativeMS); if (!listFilesAssumingDir.hasNext()) { final S3AFileStatus fileStatus = status != null ? status : (S3AFileStatus) getFileStatus(path); if (fileStatus.isFile()) { return new Listing.SingleStatusRemoteIterator( toLocatedFileStatus(fileStatus)); } } return listFilesAssumingDir; } catch (AmazonClientException e) { throw translateException("listFiles", path, e); } }
Source:
private static ConstitutionalTribunalJudgment createCtJudgmentWithRandomData(String prefix, int numericPrefix) { ConstitutionalTribunalJudgment ccJudgment = new ConstitutionalTribunalJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ccJudgment, prefix, numericPrefix); ccJudgment.getSourceInfo().setSourceCode(SourceCode.COMMON_COURT); JudgmentKeyword firstKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(18)); JudgmentKeyword secondKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(19)); ccJudgment.addKeyword(firstKeyword); ccJudgment.addKeyword(secondKeyword); return ccJudgment; }

Target:
private static ConstitutionalTribunalJudgment createCtJudgmentWithRandomData(String prefix, int numericPrefix) { ConstitutionalTribunalJudgment ctJudgment = new ConstitutionalTribunalJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(ctJudgment, prefix, numericPrefix); ctJudgment.getSourceInfo().setSourceCode(SourceCode.CONSTITUTIONAL_TRIBUNAL); JudgmentKeyword firstKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(18)); JudgmentKeyword secondKeyword = new JudgmentKeyword(CourtType.CONSTITUTIONAL_TRIBUNAL, RandomStringUtils.randomAlphanumeric(19)); ctJudgment.addKeyword(firstKeyword); ctJudgment.addKeyword(secondKeyword); return ctJudgment; }
Source:
public void tearDown() { ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); for (ISynchronizeParticipantReference participant : participants) { try { ISynchronizeParticipantReference ref = participant; if(ref.getParticipant().getId().equals(CVSMergeSubscriber.ID)) { TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {ref.getParticipant()}); } }catch (TeamException e) { return; } } while (Display.getCurrent().readAndDispatch()) {}; }

Target:
public void tearDown() { ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); for (ISynchronizeParticipantReference ref : participants) { try { if(ref.getParticipant().getId().equals(CVSMergeSubscriber.ID)) { TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {ref.getParticipant()}); } }catch (TeamException e) { return; } } while (Display.getCurrent().readAndDispatch()) {}; }
Source:
private String buildInOperator(int size) { if (size == 1) { return "(?)"; } String builder = "(" + TextUtils.join(",", Collections.nCopies(size, "?")) + ")"; return builder; }

Target:
private String buildInOperator(int size) { if (size == 1) { return "(?)"; } return "(" + TextUtils.join(",", Collections.nCopies(size, "?")) + ")"; }
Source:
public void success() { }

Target:
public void success() { delegate.success(); }
Source:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { final Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } if (++counter % CHECK_INTERNAL_COUNT == 0) { int size = 0; for (Sink aSink : sinks.values()) { size += aSink.size(); } if (size > config.getMaxRowsInMemory()) { persistOldest(committerSupplier.get()); } } return numRows; }

Target:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { final Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } final int numRows = sink.add(row); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush) { persist(committerSupplier.get()); } if (maxRowExceedCheckCount > 0 && ++checkCounter % maxRowExceedCheckCount == 0) { if (rowCountInMemory() > config.getMaxRowsInMemory() || occupationInMemory() > config.getMaxOccupationInMemory()) { persistOldest(committerSupplier.get()); } } return numRows; }
Source:
public boolean isConsumedOutDataStreamsJobBuilderConfigured(final boolean throwException) { final List<AnalysisJobBuilder> consumedOutputDataStreamsJobBuilders = getConsumedOutputDataStreamsJobBuilders(); boolean isConfigurated = true; for (final AnalysisJobBuilder analysisJobBuilder : consumedOutputDataStreamsJobBuilders) { isConfigurated &= analysisJobBuilder.isConfigured(throwException); } return isConfigurated; }

Target:
private boolean isConsumedOutDataStreamsJobBuilderConfigured(final boolean throwException) { final List<AnalysisJobBuilder> consumedOutputDataStreamsJobBuilders = getConsumedOutputDataStreamsJobBuilders(); for (final AnalysisJobBuilder analysisJobBuilder : consumedOutputDataStreamsJobBuilders) { if (!analysisJobBuilder.isConfigured(throwException)) { return false; } } return true; }
Source:
public boolean overrideRule(final String dataSource, final List<Rule> newRules, final AuditInfo auditInfo) { synchronized (lock) { try { dbi.inTransaction( new TransactionCallback<Void>() { @Override public Void inTransaction(Handle handle, TransactionStatus transactionStatus) throws Exception { final DateTime auditTime = DateTime.now(); auditManager.doAudit( AuditEntry.builder() .key(dataSource) .type("rules") .auditInfo(auditInfo) .payload(jsonMapper.writeValueAsString(newRules)) .auditTime(auditTime) .build(), handle ); String version = auditTime.toString(); handle.createStatement( String.format( "INSERT INTO %s (id, dataSource, version, payload) VALUES (:id, :dataSource, :version, :payload)", getRulesTable() ) ) .bind("id", String.format("%s_%s", dataSource, version)) .bind("dataSource", dataSource) .bind("version", version) .bind("payload", jsonMapper.writeValueAsBytes(newRules)) .execute(); return null; } } ); } catch (Exception e) { log.error(e, String.format("Exception while overriding rule for %s", dataSource)); return false; } } poll(); return true; }

Target:
public boolean overrideRule(final String dataSource, final List<Rule> newRules, final AuditInfo auditInfo) { synchronized (lock) { try { dbi.inTransaction( new TransactionCallback<Void>() { @Override public Void inTransaction(Handle handle, TransactionStatus transactionStatus) throws Exception { final DateTime auditTime = DateTime.now(); auditManager.doAudit( AuditEntry.builder() .key(dataSource) .type("rules") .auditInfo(auditInfo) .payload(jsonMapper.writeValueAsString(newRules)) .auditTime(auditTime) .build(), handle ); String version = auditTime.toString(); handle.createStatement( String.format( "INSERT INTO %s (id, dataSource, version, payload) VALUES (:id, :dataSource, :version, :payload)", getRulesTable() ) ) .bind("id", String.format("%s_%s", dataSource, version)) .bind("dataSource", dataSource) .bind("version", version) .bind("payload", jsonMapper.writeValueAsBytes(newRules)) .execute(); return null; } } ); } catch (Exception e) { log.error(e, String.format("Exception while overriding rule for %s", dataSource)); return false; } } try { poll(); } catch (Exception e) { log.error(e, String.format("Exception while polling for rules after overriding the rule for %s", dataSource)); } return true; }
Source:
public static void main(String[] args) { final AtomicBoolean isRunning = new AtomicBoolean(true); Mono.delay(Duration.ofMinutes(2)).subscribe(index -> { System.out.println("2 minutes has elapsed, stopping receive loop."); isRunning.set(false); }); String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .queueName("<<queue-name>>") .buildClient(); ServiceBusReceiverClient receiver = sessionReceiver.acceptSession("greetings-id"); while (isRunning.get()) { IterableStream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(10, Duration.ofSeconds(30)); for (ServiceBusReceivedMessage message : messages) { boolean isSuccessfullyProcessed = processMessage(message); if (isSuccessfullyProcessed) { receiver.complete(message); } else { receiver.abandon(message, null); } } } sessionReceiver.close(); }

Target:
public static void main(String[] args) { final AtomicBoolean isRunning = new AtomicBoolean(true); Mono.delay(Duration.ofMinutes(2)).subscribe(index -> { System.out.println("2 minutes has elapsed, stopping receive loop."); isRunning.set(false); }); String connectionString = "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + "SharedAccessKey={key}"; ServiceBusSessionReceiverClient sessionReceiver = new ServiceBusClientBuilder() .connectionString(connectionString) .sessionReceiver() .queueName("<<queue-name>>") .buildClient(); ServiceBusReceiverClient receiver = sessionReceiver.acceptSession("greetings-id"); try { while (isRunning.get()) { IterableStream<ServiceBusReceivedMessage> messages = receiver.receiveMessages(10, Duration.ofSeconds(30)); for (ServiceBusReceivedMessage message : messages) { boolean isSuccessfullyProcessed = processMessage(message); if (isSuccessfullyProcessed) { receiver.complete(message); } else { receiver.abandon(message, null); } } } } finally { receiver.close(); } sessionReceiver.close(); }
Source:
private void createBuildLabels(Composite composite, FormColors colors) { String patchSetId = this.set.getId(); TaskAttribute buildAttribute = this.parentSection.getTaskData() .getRoot() .getAttribute("BUILD_RESULT-" + patchSetId); int numberOfBuilds = buildAttribute.getAttributes().size(); for (int i = 0; i < numberOfBuilds; i++) { String buildKey = "BUILD_RESULT-" + i; TaskAttribute currentBuildAttribute = buildAttribute.getAttribute(buildKey); String statusValue = currentBuildAttribute.getAttribute("STATUS").getValue(); final String urlValue = currentBuildAttribute.getAttribute("URL").getValue(); ScalingHyperlink buildLink = new ScalingHyperlink(composite, SWT.READ_ONLY); buildLink.setText(urlValue); buildLink.setForeground(CommonColors.HYPERLINK_WIDGET); buildLink.registerMouseTrackListener(); buildLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent event) { BrowserUtil.openUrl(urlValue); } }); CLabel buildText = new CLabel(composite, SWT.RIGHT_TO_LEFT); buildText.setText(statusValue); buildText.setImage(this.getImageForBuildStatus(statusValue)); } }

Target:
private void createBuildLabels(Composite composite, FormColors colors) { String patchSetId = this.set.getId(); TaskAttribute buildAttribute = this.parentSection.getTaskData() .getRoot() .getAttribute("PATCH_SET-" + patchSetId); if (buildAttribute == null) { return; } int numberOfBuilds = buildAttribute.getAttributes().size(); for (Entry<String, TaskAttribute> buildEntry : buildAttribute.getAttributes().entrySet()) { TaskAttribute currentBuildAttribute = buildEntry.getValue(); String statusValue = currentBuildAttribute.getAttribute("STATUS").getValue(); final String urlValue = currentBuildAttribute.getAttribute("URL").getValue(); ScalingHyperlink buildLink = new ScalingHyperlink(composite, SWT.READ_ONLY); buildLink.setText(urlValue); buildLink.setForeground(CommonColors.HYPERLINK_WIDGET); buildLink.registerMouseTrackListener(); buildLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent event) { BrowserUtil.openUrl(urlValue); } }); CLabel buildText = new CLabel(composite, SWT.RIGHT_TO_LEFT); buildText.setText(statusValue); buildText.setImage(this.getImageForBuildStatus(statusValue)); } }
Source:
private int[] propertyKeyIds() { return populations.keySet().stream().flatMapToInt( this::propertyKeyIds ).distinct().toArray(); }

Target:
private int[] propertyKeyIds() { return populations.stream().flatMapToInt( this::propertyKeyIds ).distinct().toArray(); }
Source:
public static void assertMatchesMask(Message message, FieldMask fieldMask) { final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : message.getDescriptorForType() .getFields()) { if (field.isRepeated()) { continue; } Assert.assertEquals(message.hasField(field), paths.contains(field.getFullName())); } }

Target:
public static void assertMatchesMask(Message message, FieldMask fieldMask) { final List<String> paths = fieldMask.getPathsList(); for (Descriptors.FieldDescriptor field : message.getDescriptorForType() .getFields()) { if (field.isRepeated()) { continue; } assertEquals(message.hasField(field), paths.contains(field.getFullName())); } }
Source:
public Response getExport(ExportRequest exportRequest) throws Exception { context.getExhibitor().getLog().add(ActivityLog.Type.INFO, "Starting export"); Exporter exporter = new Exporter(context, exportRequest.getStartPath()); return Response.ok(exporter.generate().toString()) .header("content-disposition", "attachment; filename=exhibitor_export.json") .build(); }

Target:
public Response getExport(ExportRequest exportRequest) throws Exception { context.getExhibitor().getLog().add(ActivityLog.Type.INFO, "Starting export"); Exporter exporter = new Exporter(context, exportRequest.getStartPath()); return Response.ok(exporter.generate()) .header("content-disposition", "attachment; filename=exhibitor_export.json") .build(); }
Source:
LinkPreviewContents(@NonNull PageSummary pageSummary, @NonNull WikiSite wiki) { title = new PageTitle(pageSummary.getTitle(), wiki); String extractStr; if (pageSummary instanceof RbPageSummary) { extractStr = pageSummary.getExtractHtml(); } else { extractStr = createLegacyExtractText(pageSummary, title.getWikiSite()); } if (pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION)) { extractStr = "<p>" + WikipediaApp.getInstance().getString(R.string.link_preview_disambiguation_description) + "</p>" + extractStr; } extract = Html.fromHtml(extractStr); title.setThumbUrl(pageSummary.getThumbnailUrl()); disambiguation = pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION); }

Target:
LinkPreviewContents(@NonNull PageSummary pageSummary, @NonNull WikiSite wiki) { title = new PageTitle(pageSummary.getTitle(), wiki); disambiguation = pageSummary.getType().equals(PageSummary.TYPE_DISAMBIGUATION); String extractStr; if (pageSummary instanceof RbPageSummary) { extractStr = pageSummary.getExtractHtml(); } else { extractStr = createLegacyExtractText(pageSummary, title.getWikiSite()); } if (disambiguation) { extractStr = "<p>" + WikipediaApp.getInstance().getString(R.string.link_preview_disambiguation_description) + "</p>" + extractStr; } extract = Html.fromHtml(extractStr); title.setThumbUrl(pageSummary.getThumbnailUrl()); }
Source:
public List<TrainingDocument> listTrainingDocuments(Project aProject) { return entityManager.createQuery("FROM TrainingDocument where project =:project", TrainingDocument.class).setParameter("project", aProject).getResultList(); }

Target:
public List<TrainingDocument> listTrainingDocuments(Project aProject) { List<TrainingDocument> trainingDocuments = entityManager .createQuery("FROM TrainingDocument where project =:project", TrainingDocument.class) .setParameter("project", aProject).getResultList(); return trainingDocuments; }
Source:
public ParallelIndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") ParallelIndexIOConfig ioConfig, @JsonProperty("tuningConfig") ParallelIndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { if (!(ioConfig.getInputSource() instanceof FirehoseFactoryToInputSourceAdaptor)) { throw new IAE("Cannot use parser and inputSource together. Try use inputFormat instead of parser."); } } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? ParallelIndexTuningConfig.defaultConfig() : tuningConfig; }

Target:
public ParallelIndexIngestionSpec( @JsonProperty("dataSchema") DataSchema dataSchema, @JsonProperty("ioConfig") ParallelIndexIOConfig ioConfig, @JsonProperty("tuningConfig") ParallelIndexTuningConfig tuningConfig ) { super(dataSchema, ioConfig, tuningConfig); Checks.checkOneNotNullOrEmpty( ImmutableList.of( new Property<>("parser", dataSchema.getParserMap()), new Property<>("inputFormat", ioConfig.getInputFormat()) ) ); if (dataSchema.getParserMap() != null && ioConfig.getInputSource() != null) { if (!(ioConfig.getInputSource() instanceof FirehoseFactoryToInputSourceAdaptor)) { throw new IAE("Cannot use parser and inputSource together. Try using inputFormat instead of parser."); } } this.dataSchema = dataSchema; this.ioConfig = ioConfig; this.tuningConfig = tuningConfig == null ? ParallelIndexTuningConfig.defaultConfig() : tuningConfig; }
Source:
public void setShowLocation(boolean showLocation) { this.showLocation = showLocation; }

Target:
public void setShowLocation(boolean showLocation) { if (locationLabel != null) { throw new IllegalStateException("Control already created"); } this.showLocation = showLocation; }
Source:
private void fillToolsList() { updateAllTools(); ToolChain tc = null; if (ri instanceof IFolderInfo) tc = (ToolChain)ManagedBuildManager.getRealToolChain(((IFolderInfo)ri).getToolChain()); if (page.isForFile()) { ITool curr = getToolForFile(); boolean canAddNO_TOOL = true; if (ri instanceof IFileInfo && b_dispCompatible.getSelection()) canAddNO_TOOL = updateCompatibleTools(curr); fillToolCombo(canAddNO_TOOL, curr); showToolStatus(curr); } else if (tc != null && tc.isPreferenceToolChain()){ tools_group.setVisible(false); } else { tools_group.setVisible(true); StringBuilder s = new StringBuilder(EMPTY_STR); ITool[] tools = ri.getTools(); for (ITool tool : tools) { s.append(tool.getUniqueRealName()).append("\n"); } text.setText(s.toString()); } }

Target:
private void fillToolsList() { updateAllTools(); ToolChain tc = null; if (ri instanceof IFolderInfo) tc = (ToolChain)ManagedBuildManager.getRealToolChain(((IFolderInfo)ri).getToolChain()); if (page.isForFile()) { ITool curr = getToolForFile(); boolean canAddNO_TOOL = true; if (ri instanceof IFileInfo && b_dispCompatible.getSelection()) canAddNO_TOOL = updateCompatibleTools(curr); fillToolCombo(canAddNO_TOOL, curr); showToolStatus(curr); } else if (tc != null && tc.isPreferenceToolChain()){ tools_group.setVisible(false); } else { tools_group.setVisible(true); StringBuilder s = new StringBuilder(); ITool[] tools = ri.getTools(); for (ITool tool : tools) { s.append(tool.getUniqueRealName()).append('\n'); } text.setText(s.toString()); } }
Source:
public void write(ByteBuffer buffer) { buffer.putLong(offset); buffer.rewind(); }

Target:
public void write(ByteBuffer buffer) { buffer.putLong(offset); }
Source:
private int randomPick() { return new Random().nextInt(Question.values().length); }

Target:
private int randomPick() { return NovodaActivity.RANDOM.nextInt(Question.values().length); }
Source:
public Key (String serializedKey) { String[] columns = serializedKey.split(","); tenantId = columns[0].compareTo("") == 0 ? null : columns[0]; schemaName = columns[1].compareTo("") == 0 ? null : columns[1]; tableName = columns[2]; }

Target:
public Key (String serializedKey) { serializedValue = serializedKey; if (this.getTableName() == null || this.getTableName().compareTo("") == 0) { throw new IllegalArgumentException(); } }
Source:
public boolean inputSchemasAvailable(Map<String, Schema> inputSchemas) { return !inputSchemas.isEmpty() && !inputSchemas.values().stream().anyMatch(v -> v == null); }

Target:
boolean inputSchemasAvailable(Map<String, Schema> inputSchemas) { return !inputSchemas.isEmpty() && inputSchemas.values().stream().noneMatch(Objects::isNull); }
Source:
boolean canHandle(SegmentId segmentId, long segmentSize) { if (available() < segmentSize) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d]. Check your druid.segmentCache.locations maxSize param", segmentId, segmentSize, getPath(), available() ); return false; } if (freeSpaceToKeep > 0) { long currFreeSpace = path.getFreeSpace(); if ((freeSpaceToKeep + segmentSize) > currFreeSpace) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d] to maintain suggested freeSpace[%d], current freeSpace is [%d].", segmentId, segmentSize, getPath(), available(), freeSpaceToKeep, currFreeSpace ); return false; } } return true; }

Target:
boolean canHandle(SegmentId segmentId, long segmentSize) { if (availableSizeBytes() < segmentSize) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d]. Check your druid.segmentCache.locations maxSize param", segmentId, segmentSize, getPath(), availableSizeBytes() ); return false; } if (freeSpaceToKeep > 0) { long currFreeSpace = path.getFreeSpace(); if ((freeSpaceToKeep + segmentSize) > currFreeSpace) { log.warn( "Segment[%s:%,d] too large for storage[%s:%,d] to maintain suggested freeSpace[%d], current freeSpace is [%d].", segmentId, segmentSize, getPath(), availableSizeBytes(), freeSpaceToKeep, currFreeSpace ); return false; } } return true; }
Source:
static void execute(Runnable runnable) { if (EXECUTOR == null) { synchronized (ShutdownFallbackExecutor.class) { if (EXECUTOR == null) { EXECUTOR = new ThreadPoolExecutor(0, 1, 100, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); } } } EXECUTOR.execute(runnable); }

Target:
static void execute(Runnable runnable) { if (EXECUTOR == null) { synchronized (ShutdownFallbackExecutor.class) { if (EXECUTOR == null) { EXECUTOR = new ThreadPoolExecutor(0, 1, 10, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new ShutdownFallbackThreadFactory()); } } } EXECUTOR.execute(runnable); }
Source:
private void appendEmbedded(StringBuilder queryBuilder, String optionalMatch, EmbeddedAliasTree node) { if ( node.getChildren().isEmpty() ) { queryBuilder.append( optionalMatch ); } else { int index = 0; List<EmbeddedAliasTree> children = node.getChildren(); for ( EmbeddedAliasTree child : node.getChildren() ) { StringBuilder builder = new StringBuilder( optionalMatch ); relationship( builder, child.getName() ); node( builder, child.getAlias(), NodeLabel.EMBEDDED.name() ); appendEmbedded( queryBuilder, builder.toString(), child ); } } }

Target:
private void appendEmbedded(StringBuilder queryBuilder, String optionalMatch, EmbeddedAliasTree node) { if ( node.getChildren().isEmpty() ) { queryBuilder.append( optionalMatch ); } else { for ( EmbeddedAliasTree child : node.getChildren() ) { StringBuilder builder = new StringBuilder( optionalMatch ); relationship( builder, child.getName() ); node( builder, child.getAlias(), NodeLabel.EMBEDDED.name() ); appendEmbedded( queryBuilder, builder.toString(), child ); } } }
Source:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); retSet.add(Range.singleton(StringUtils.nullToEmptyNonDruidDataString(value))); return retSet; }

Target:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); String valueEquivalent = NullHandling.nullToEmptyIfNeeded(value); if (valueEquivalent == null) { retSet.add(Range.lessThan("")); } else { retSet.add(Range.singleton(valueEquivalent)); } return retSet; }
Source:
public String asCql() { StringBuilder builder = new StringBuilder(); builder.append("CREATE KEYSPACE "); if (ifNotExists) { builder.append("IF NOT EXISTS "); } builder.append(keyspaceName.asCql(true)); boolean first = true; for (Map.Entry<String, Object> property : properties.entrySet()) { if (first) { builder.append(" WITH "); first = false; } else { builder.append(" AND "); } String value = extractPropertyValue(property.getValue()); builder.append(property.getKey()).append(" = ").append(value); } return builder.toString(); }

Target:
public String asCql() { StringBuilder builder = new StringBuilder(); builder.append("CREATE KEYSPACE "); if (ifNotExists) { builder.append("IF NOT EXISTS "); } builder.append(keyspaceName.asCql(true)); builder.append(OptionsUtils.buildOptions(options, true)); return builder.toString(); }