auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSendWithTransaction() { Message message = Proton.message(); message.setMessageId("id"); message.setBody(new AmqpValue("hello")); AmqpTransaction transaction = new AmqpTransaction(ByteBuffer.wrap("1".getBytes())); ReactorSender reactorSender = new ReactorSender(entityPath, sender, handler, reactorProvider, tokenManager, messageSerializer, Duration.ofSeconds(1), new ExponentialAmqpRetryPolicy(new AmqpRetryOptions())); ReactorSender spyReactorSender = spy(reactorSender); doReturn(Mono.empty()).when(spyReactorSender).send(any(byte[].class), anyInt(), anyInt(), any(AmqpTransaction.class)); StepVerifier.create(spyReactorSender.send(message, transaction)) .verifyComplete(); StepVerifier.create(spyReactorSender.send(message, transaction)) .verifyComplete(); verify(sender, times(1)).getRemoteMaxMessageSize(); verify(spyReactorSender, times(2)).send(any(byte[].class), anyInt(), anyInt(), ArgumentMatchers.same(transaction)); }

Target:
public void testSendWithTransaction() { Message message = Proton.message(); message.setMessageId("id"); message.setBody(new AmqpValue("hello")); ReactorSender reactorSender = new ReactorSender(entityPath, sender, handler, reactorProvider, tokenManager, messageSerializer, Duration.ofSeconds(1), new ExponentialAmqpRetryPolicy(new AmqpRetryOptions())); ReactorSender spyReactorSender = spy(reactorSender); doReturn(Mono.empty()).when(spyReactorSender).send(any(byte[].class), anyInt(), anyInt(), eq(transactionalState)); StepVerifier.create(spyReactorSender.send(message, transactionalState)) .verifyComplete(); StepVerifier.create(spyReactorSender.send(message, transactionalState)) .verifyComplete(); verify(sender, times(1)).getRemoteMaxMessageSize(); verify(spyReactorSender, times(2)).send(any(byte[].class), anyInt(), eq(DeliveryImpl.DEFAULT_MESSAGE_FORMAT), eq(transactionalState)); }
Source:
public void showAggregatedProcesses() { if (migrateWorkflow) { List<Process> processList = new ArrayList<>(); aggregatedProcesses.clear(); for (Project project : selectedProjects) { processList.addAll(project.getProcesses()); } for (Process process : processList) { if (Objects.isNull(process.getTemplate())) { addToAggregatedProcesses(aggregatedProcesses, process); } } processListShown = true; } else { for (Project project : selectedProjects) { TaskManager.addTask(new MigrationTask(project)); } projectListShown = false; } }

Target:
public void showAggregatedProcesses() { List<Process> processList = new ArrayList<>(); aggregatedProcesses.clear(); for (Project project : selectedProjects) { processList.addAll(project.getProcesses()); } for (Process process : processList) { if (Objects.isNull(process.getTemplate())) { addToAggregatedProcesses(aggregatedProcesses, process); } } processListShown = true; }
Source:
public void testShouldSetAvailableForAnotherInput() { InputSelection secondAndThird = new InputSelection.Builder().select(2).select(3).build(); MultipleInputSelectionHandler selectionHandler = new MultipleInputSelectionHandler(() -> secondAndThird, 3); selectionHandler.nextSelection(); assertFalse(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setUnavailableInput(0); assertFalse(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setUnavailableInput(2); assertTrue(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setAvailableInput(0); assertTrue(selectionHandler.shouldSetAvailableForAnotherInput()); }

Target:
public void testShouldSetAvailableForAnotherInput() { InputSelection secondAndThird = new InputSelection.Builder().select(2).select(3).build(); MultipleInputSelectionHandler selectionHandler = new MultipleInputSelectionHandler(() -> secondAndThird, 3); selectionHandler.nextSelection(); assertFalse(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setUnavailableInput(0); assertFalse(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setUnavailableInput(2); assertTrue(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setAvailableInput(0); assertTrue(selectionHandler.shouldSetAvailableForAnotherInput()); selectionHandler.setAvailableInput(2); assertFalse(selectionHandler.shouldSetAvailableForAnotherInput()); }
Source:
public void webpackDevServerPortShouldBeReusedOnReload() { open(); String initialUUID = findElement( By.id(WebpackDevServerPortView.UUID_ID)).getText(); Assert.assertEquals(36, initialUUID.length()); String initialPort = findElement( By.id(WebpackDevServerPortView.WEBPACK_PORT_ID)).getText(); Assert.assertTrue(NumberUtils.isDigits(initialPort)); findElement(By.id(WebpackDevServerPortView.TRIGGER_RELOAD_ID)).click(); boolean reconnected = false; for (int i = 0; i < 10; i++) { getDriver().navigate().refresh(); try { waitUntil(driver -> !initialUUID.equals( findElement(By.id(WebpackDevServerPortView.UUID_ID)) .getText()), 2); } catch (TimeoutException e) { continue; } reconnected = true; break; } Assert.assertTrue(reconnected); String port = findElement( By.id(WebpackDevServerPortView.WEBPACK_PORT_ID)).getText(); Assert.assertEquals(initialPort, port); }

Target:
public void webpackDevServerPortShouldBeReusedOnReload() throws InterruptedException { open(); String initialUUID = findElement( By.id(WebpackDevServerPortView.UUID_ID)).getText(); Assert.assertEquals(36, initialUUID.length()); String initialPort = findElement( By.id(WebpackDevServerPortView.WEBPACK_PORT_ID)).getText(); Assert.assertTrue(NumberUtils.isDigits(initialPort)); findElement(By.id(WebpackDevServerPortView.TRIGGER_RELOAD_ID)).click(); int totalWaitTime = 20000; boolean reconnected = false; long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() < startTime + totalWaitTime && !reconnected) { Thread.sleep(2000); getDriver().navigate().refresh(); List<WebElement> elements = findElements( By.id(WebpackDevServerPortView.UUID_ID)); if (!elements.isEmpty() && !elements.get(0).getText().equals(initialUUID)) { reconnected = true; } } Assert.assertTrue("unable to verify connection to new Jetty instance", reconnected); String port = findElement( By.id(WebpackDevServerPortView.WEBPACK_PORT_ID)).getText(); Assert.assertEquals(initialPort, port); }
Source:
void waitUntilConnected() { boolean isConnected; do { isConnected = _zkclient.waitUntilConnected(HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); if (!isConnected) { LOG.error("fail to connect zkserver: " + _zkAddress + " in " + HelixZkClient.DEFAULT_CONNECTION_TIMEOUT + "ms. expiredSessionId: " + _sessionId + ", clusterName: " + _clusterName); continue; } _sessionId = _zkclient.getHexSessionId(_zkclient.getSessionId()); } while (!isConnected || ZERO_HEX_SESSION_ID.equals(_sessionId)); LOG.info("Handling new session, session id: " + _sessionId + ", instance: " + _instanceName + ", instanceTye: " + _instanceType + ", cluster: " + _clusterName); }

Target:
void waitUntilConnected() { boolean isConnected; do { isConnected = _zkclient.waitUntilConnected(HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); if (!isConnected) { LOG.error("fail to connect zkserver: " + _zkAddress + " in " + HelixZkClient.DEFAULT_CONNECTION_TIMEOUT + "ms. expiredSessionId: " + _sessionId + ", clusterName: " + _clusterName); continue; } _sessionId = ZKUtil.toHexSessionId(_zkclient.getSessionId()); } while (!isConnected || "0".equals(_sessionId)); LOG.info("Handling new session, session id: " + _sessionId + ", instance: " + _instanceName + ", instanceTye: " + _instanceType + ", cluster: " + _clusterName); }
Source:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { ReadOnlyPermissionAuthority readOnlyPermissionAuthority = new ReadOnlyPermissionAuthority(); IPermissionProvider permissionProvider = new DefaultPermissionProvider(readOnlyPermissionAuthority); permissionProviderDescriptor = new StandalonePermissionProviderDescriptor("org.eclipse.sirius.tests.swtbot.lockModelExplorerPermissionAuthorityProvider", ExtenderConstants.HIGHEST_PRIORITY, permissionProvider); PermissionService.addExtension(permissionProviderDescriptor); sessionAirdResource = new UIResource(designerProject, SESSION_RESOURCE_NAME); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "Entities", REPRESENTATION_DESCRIPTION_NAME, DDiagram.class); modelExplorerView = bot.viewById(IModelExplorerView.ID); modelExplorerView.setFocus(); jobChangeListener = new IJobChangeListener() { @Override public void sleeping(IJobChangeEvent event) { } @Override public void scheduled(IJobChangeEvent event) { refreshJobScheduled = event.getJob().belongsTo(RefreshLabelImageJob.FAMILY); } @Override public void running(IJobChangeEvent event) { } @Override public void done(IJobChangeEvent event) { } @Override public void awake(IJobChangeEvent event) { } @Override public void aboutToRun(IJobChangeEvent event) { } }; Job.getJobManager().addJobChangeListener(jobChangeListener); }

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { ReadOnlyPermissionAuthority readOnlyPermissionAuthority = new ReadOnlyPermissionAuthority(); IPermissionProvider permissionProvider = new DefaultPermissionProvider(readOnlyPermissionAuthority); permissionProviderDescriptor = new StandalonePermissionProviderDescriptor("org.eclipse.sirius.tests.swtbot.lockModelExplorerPermissionAuthorityProvider", ExtenderConstants.HIGHEST_PRIORITY, permissionProvider); PermissionService.addExtension(permissionProviderDescriptor); sessionAirdResource = new UIResource(designerProject, SESSION_RESOURCE_NAME); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "Entities", REPRESENTATION_DESCRIPTION_NAME, DDiagram.class); modelExplorerView = bot.viewById(IModelExplorerView.ID); modelExplorerView.setFocus(); jobChangeListener = new JobChangeAdapter() { @Override public void scheduled(IJobChangeEvent event) { refreshJobScheduled = event.getJob().belongsTo(RefreshLabelImageJob.FAMILY); } }; Job.getJobManager().addJobChangeListener(jobChangeListener); }
Source:
private static String getDataTypeDescription(MeasurementVariable trait) { if (trait.getDataTypeId() == null || !dataTypeList.contains(trait.getDataTypeId())) { return KsuFieldbookUtil.UNRECOGNIZED_FORMAT; } else if (trait.getDataTypeId() == TermId.NUMERIC_VARIABLE.getId()) { return KsuFieldbookUtil.NUMERIC_FORMAT; } else if (trait.getDataTypeId() == TermId.CATEGORICAL_VARIABLE.getId()) { return KsuFieldbookUtil.CATEGORICAL_FORMAT; } else if (trait.getDataTypeId() == TermId.DATE_VARIABLE.getId()) { return KsuFieldbookUtil.DATE_FORMAT; } return KsuFieldbookUtil.CHARACTER_FORMAT; }

Target:
private static String getDataTypeDescription(MeasurementVariable trait) { Integer dataType; if (trait.getDataTypeId() == null || !dataTypeList.contains(trait.getDataTypeId())) { dataType = 0; } else { dataType = trait.getDataTypeId(); } return dataTypeFormats.get(dataType); }
Source:
static void loadTerms(String fileName) throws IOException { try ( InputStream resourceStream = SearchBoostTermsResolver.class.getResourceAsStream(fileName); BufferedReader br = new BufferedReader(new InputStreamReader(resourceStream)) ) { for (String line; (line = br.readLine()) != null; ) { processMapping(line); } } }

Target:
static void loadTerms(String fileName) throws IOException { try ( InputStream resourceStream = SearchBoostTermsResolver.class.getResourceAsStream(fileName); InputStreamReader inputStreamReader = new InputStreamReader(resourceStream); BufferedReader br = new BufferedReader(inputStreamReader) ) { for (String line; (line = br.readLine()) != null; ) { processMapping(line); } } }
Source:
public static void setFinal(File file, boolean isFinal) { try { UserDefinedFileAttributeView view = getFileAttributeView(file); view.write(IS_FINAL_ATTRIBUTE, Charset.defaultCharset().encode(new Boolean(isFinal).toString())); } catch (Exception e) { } }

Target:
public static void setFinal(File file, boolean isFinal) { try { UserDefinedFileAttributeView view = getFileAttributeView(file); if (view != null) { view.write(IS_FINAL_ATTRIBUTE, Charset.defaultCharset().encode(new Boolean(isFinal).toString())); } } catch (IOException e) { } }
Source:
public void customClassPrefixNoJavaType() throws ClassNotFoundException { ClassLoader resultsClassLoader = generateAndCompile("/schema/properties/primitivePropertiesNoJavaType.json", "com.example", config("classNamePrefix","Prefix")); resultsClassLoader.loadClass("com.example.PrefixprimitivePropertiesNoJavaType"); }

Target:
public void customClassPrefixNoJavaType() throws ClassNotFoundException { ClassLoader resultsClassLoader = generateAndCompile("/schema/properties/primitivePropertiesNoJavaType.json", "com.example", config("classNamePrefix","Prefix")); resultsClassLoader.loadClass("com.example.PrefixPrimitivePropertiesNoJavaType"); }
Source:
public void stop() { if (!isRunning.get()) { log.info("Garbage informer had been stopped."); return; } gcScheduler.shutdownNow(); log.info("Garbage informer is stopped."); isRunning.set(false); }

Target:
public synchronized void stop() { if (!isRunning) { log.info("Garbage informer had been stopped."); return; } gcScheduler.shutdownNow(); log.info("Garbage informer is stopped."); isRunning = false; }
Source:
private Message makeCopy(final MessageReference ref, final boolean expiry, final boolean copyOriginalHeaders) throws Exception { if (ref == null) { return null; } Message message = ref.getMessage(); long newID = storageManager.generateID(); Message copy = message.copy(newID); if (copyOriginalHeaders) { copy.referenceOriginalMessage(message, ref.getQueue().getName().toString()); } copy.setExpiration(0); if (expiry) { copy.setAnnotation(Message.HDR_ACTUAL_EXPIRY_TIME, System.currentTimeMillis()); } copy.reencode(); return copy; }

Target:
private Message makeCopy(final MessageReference ref, final boolean expiry, final boolean copyOriginalHeaders) throws Exception { if (ref == null) { ActiveMQServerLogger.LOGGER.nullRefMessage(); throw new ActiveMQNullRefException("Reference to message is null"); } Message message = ref.getMessage(); long newID = storageManager.generateID(); Message copy = message.copy(newID); if (copyOriginalHeaders) { copy.referenceOriginalMessage(message, ref.getQueue().getName().toString()); } copy.setExpiration(0); if (expiry) { copy.setAnnotation(Message.HDR_ACTUAL_EXPIRY_TIME, System.currentTimeMillis()); } copy.reencode(); return copy; }
Source:
public HBaseDatasetRepository build() { HTablePool pool = new HTablePool(configuration, 10); HBaseAdmin admin; try { admin = new HBaseAdmin(configuration); } catch (MasterNotRunningException e) { throw new DatasetRepositoryException( "Problem creating HBaseDatasetRepository.", e); } catch (ZooKeeperConnectionException e) { throw new DatasetRepositoryException( "Problem creating HBaseDatasetRepository.", e); } catch (IOException e) { throw new DatasetRepositoryException( "Problem creating HBaseDatasetRepository.", e); } return new HBaseDatasetRepository(admin, pool, getRepositoryUri(configuration)); }

Target:
public HBaseDatasetRepository build() { HTablePool pool = new HTablePool(configuration, 10); HBaseAdmin admin; try { admin = new HBaseAdmin(configuration); } catch (MasterNotRunningException e) { throw new DatasetRepositoryException( "Problem creating HBaseDatasetRepository.", e); } catch (ZooKeeperConnectionException e) { throw new DatasetRepositoryException( "Problem creating HBaseDatasetRepository.", e); } catch (IOException e) { throw new DatasetIOException( "Problem creating HBaseDatasetRepository.", e); } return new HBaseDatasetRepository(admin, pool, getRepositoryUri(configuration)); }
Source:
public FieldConstraint asFieldConstraint(final RuleModel m, final FactPattern factPattern) { CompositeFieldConstraint comp = new CompositeFieldConstraint(); comp.setCompositeJunctionType(connector.equals("&&") ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR); for (Expr expr : subExprs) { comp.addConstraint(expr.asFieldConstraint(m, factPattern)); } String fieldName = ""; for (FieldConstraint field : comp.getConstraints()) { if (SingleFieldConstraint.class.isAssignableFrom(field.getClass())) { SingleFieldConstraint constraint = (SingleFieldConstraint) field; if (StringUtils.isEmpty(constraint.getFieldName()) && !StringUtils.isEmpty(constraint.getOperator()) && (constraint.getOperator().equals("matches") || constraint.getOperator().equals("not matches"))) { constraint.setFieldName(fieldName); } fieldName = constraint.getFieldName(); } } return comp; }

Target:
public FieldConstraint asFieldConstraint(final RuleModel m, final FactPattern factPattern) { final CompositeFieldConstraint comp = new CompositeFieldConstraint(); comp.setCompositeJunctionType(connector.equals("&&") ? CompositeFieldConstraint.COMPOSITE_TYPE_AND : CompositeFieldConstraint.COMPOSITE_TYPE_OR); for (final Expr expr : subExprs) { comp.addConstraint(expr.asFieldConstraint(m, factPattern)); } convertLegacyMatchesToNewFormat(comp); return comp; }
Source:
public void invalidateAll() throws StoreAccessException { invalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; Iterator<Cache.Entry<K, ValueHolder<V>>> iterator = iterator(); while (iterator.hasNext()) { try { invalidate(iterator.next().getKey()); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { invalidateAllObserver.end(LowerCachingTierOperationsOutcome.InvalidateAllOutcome.FAILURE); throw new StoreAccessException("invalidateAll failed - error count: " + errorCount, exception); } invalidateAllObserver.end(LowerCachingTierOperationsOutcome.InvalidateAllOutcome.SUCCESS); }

Target:
public void invalidateAll() throws StoreAccessException { invalidateAllObserver.begin(); StoreAccessException exception = null; long errorCount = 0; for (K k : backingMap().keySet()) { try { invalidate(k); } catch (StoreAccessException e) { errorCount++; if (exception == null) { exception = e; } } } if (exception != null) { invalidateAllObserver.end(LowerCachingTierOperationsOutcome.InvalidateAllOutcome.FAILURE); throw new StoreAccessException("invalidateAll failed - error count: " + errorCount, exception); } invalidateAllObserver.end(LowerCachingTierOperationsOutcome.InvalidateAllOutcome.SUCCESS); }
Source:
public Connection findOrNew(SocketAddress address, Bootstrap bootstrap) throws InterruptedException { Peer peer = peers.get(address); if (peer == null) { synchronized (peers) { peer = new Peer(this, address); peer.connect(bootstrap); peers.put(address, peer); } } Connection conn = peer.getConnection(ConnectionState.IDENTIFIED); return conn; }

Target:
public Connection findOrNew(SocketAddress address, Bootstrap bootstrap) throws InterruptedException { Peer peer = peers.get(address); if (peer == null) { peer = new Peer(this, address); peers.putIfAbsent(address, peer); peer = peers.get(address); } return peer.connect(bootstrap); }
Source:
private String getAnswerString(FeedbackQuestionAttributes question, FeedbackResponseDetails response) { switch(response.getQuestionType()) { case TEXT: case NUMSCALE: case RANK_RECIPIENTS: return response.getAnswerString(); case MCQ: case MSQ: return response.getAnswerString().replace(", ", "\n"); case RUBRIC: return getRubricAnsString((FeedbackRubricQuestionDetails) question.getQuestionDetails(), (FeedbackRubricResponseDetails) response); case RANK_OPTIONS: return getRankOptionsAnsString((FeedbackRankOptionsQuestionDetails) question.getQuestionDetails(), (FeedbackRankOptionsResponseDetails) response); case CONSTSUM: return getConstSumOptionsAnsString((FeedbackConstantSumQuestionDetails) question.getQuestionDetails(), (FeedbackConstantSumResponseDetails) response); case CONTRIB: return getContribAnsString((FeedbackContributionResponseDetails) response); default: throw new RuntimeException("Unknown question type: " + response.getQuestionType()); } }

Target:
private String getAnswerString(FeedbackQuestionAttributes question, FeedbackResponseDetails response) { switch(response.getQuestionType()) { case TEXT: case NUMSCALE: case RANK_RECIPIENTS: return response.getAnswerString(); case MCQ: case MSQ: return response.getAnswerString().replace(", ", System.lineSeparator()); case RUBRIC: return getRubricAnsString((FeedbackRubricQuestionDetails) question.getQuestionDetails(), (FeedbackRubricResponseDetails) response); case RANK_OPTIONS: return getRankOptionsAnsString((FeedbackRankOptionsQuestionDetails) question.getQuestionDetails(), (FeedbackRankOptionsResponseDetails) response); case CONSTSUM: return getConstSumOptionsAnsString((FeedbackConstantSumQuestionDetails) question.getQuestionDetails(), (FeedbackConstantSumResponseDetails) response); case CONTRIB: return getContribAnsString((FeedbackContributionResponseDetails) response); default: throw new RuntimeException("Unknown question type: " + response.getQuestionType()); } }
Source:
private List<String> installLinux(List<String> urls, String saveAs) { log.info("Installing "+getEntity()+" using couchbase-server-{} {}", getCommunityOrEnterprise(), getVersion()); String apt = chainGroup( "export DEBIAN_FRONTEND=noninteractive", "which apt-get", sudo("apt-get update"), sudo("apt-get install -y python-httplib2"), sudo("apt-get install -y libssl0.9.8"), sudo(format("dpkg -i %s", saveAs))); String yum = chainGroup( "which yum", ok(sudo("sed -i.bk s/^enabled=1$/enabled=0/ /etc/yum/pluginconf.d/subscription-manager.conf")), ok(sudo("yum check-update")), sudo("yum install -y pkgconfig"), sudo("[ -f /etc/redhat-release ] && (grep -i \"red hat\" /etc/redhat-release && sudo yum install -y openssl098e) || :"), sudo(format("rpm --install %s", saveAs))); String link = new DownloadProducerFromUrlAttribute().apply(new BasicDownloadRequirement(this)).getPrimaryLocations().iterator().next(); return ImmutableList.<String>builder() .add(INSTALL_CURL) .addAll(Arrays.asList(INSTALL_CURL, BashCommands.require(BashCommands.alternatives(BashCommands.simpleDownloadUrlAs(urls, saveAs), "curl -f -L -k "+link + " -H 'Referer: <LINK_1>'" + " -o "+saveAs), "Could not retrieve "+saveAs+" (from "+urls.size()+" sites)", 9))) .add(alternatives(apt, yum)) .build(); }

Target:
private List<String> installLinux(List<String> urls, String saveAs) { log.info("Installing "+getEntity()+" using couchbase-server-{} {}", getCommunityOrEnterprise(), getVersion()); String apt = chainGroup( "export DEBIAN_FRONTEND=noninteractive", "which apt-get", sudo("apt-get update"), sudo("apt-get install -y python-httplib2"), sudo("apt-get install -y libssl0.9.8"), sudo(format("dpkg -i %s", saveAs))); String yum = chainGroup( "which yum", ok(sudo("sed -i.bk s/^enabled=1$/enabled=0/ /etc/yum/pluginconf.d/subscription-manager.conf")), ok(sudo("yum check-update")), sudo("yum install -y pkgconfig"), sudo("[ -f /etc/redhat-release ] && (grep -i \"red hat\" /etc/redhat-release && sudo yum install -y openssl098e) || :"), sudo(format("rpm --install %s", saveAs))); String link = new DownloadProducerFromUrlAttribute().apply(new BasicDownloadRequirement(this)).getPrimaryLocations().iterator().next(); return ImmutableList.<String>builder() .add(INSTALL_CURL) .addAll(Arrays.asList(INSTALL_CURL, BashCommands.require(BashCommands.alternatives(BashCommands.simpleDownloadUrlAs(urls, saveAs), "curl -f -L -k "+BashStringEscapes.wrapBash(link) + " -H 'Referer: <LINK_1>'" + " -o "+saveAs), "Could not retrieve "+saveAs+" (from "+urls.size()+" sites)", 9))) .add(alternatives(apt, yum)) .build(); }
Source:
public void embargoedBitstreamForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) .withName("Collection 1") .build(); String bitstreamContent = "Embargoed!"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald") .build(); Bitstream bitstream = BitstreamBuilder .createBitstream(context, publicItem1, is) .withName("Test Embargoed Bitstream") .withDescription("This bitstream is embargoed") .withMimeType("text/plain") .withEmbargoPeriod("3 months") .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isForbidden()); checkNumberOfStatsRecords(bitstream, 0); } }

Target:
public void embargoedBitstreamForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) .withName("Collection 1") .build(); String bitstreamContent = "Embargoed!"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") .withAuthor("Smith, Donald") .build(); bitstream = BitstreamBuilder .createBitstream(context, publicItem1, is) .withName("Test Embargoed Bitstream") .withDescription("This bitstream is embargoed") .withMimeType("text/plain") .withEmbargoPeriod("3 months") .build(); } context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/bitstreams/" + bitstream.getID() + "/content")) .andExpect(status().isUnauthorized()); checkNumberOfStatsRecords(bitstream, 0); }
Source:
private void timer() { state.startTimer(); Runnable timerWorker = new Runnable() { @Override public void run() { try { ReadableCoordinator coordinator = new ReadableCoordinator(task.taskName()); long startTime = clock.nanoTime(); task.timer(coordinator); containerMetrics.timerNs().update(clock.nanoTime() - startTime); coordinatorRequests.update(coordinator); state.doneTimer(); } catch (Throwable t) { log.error("Task commit failed", task.taskName(), t); abort(t); } finally { log.trace("Task commit completed", task.taskName()); resume(); } } }; if (threadPool != null) { log.trace("Task commits on the thread pool", task.taskName()); threadPool.submit(timerWorker); } else { log.trace("Task commits on the run loop thread", task.taskName()); timerWorker.run(); } }

Target:
private void timer() { state.startTimer(); Runnable timerWorker = new Runnable() { @Override public void run() { try { ReadableCoordinator coordinator = new ReadableCoordinator(task.taskName()); long startTime = clock.nanoTime(); task.timer(coordinator); containerMetrics.timerNs().update(clock.nanoTime() - startTime); coordinatorRequests.update(coordinator); state.doneTimer(); } catch (Throwable t) { log.error("Task timer failed", task.taskName(), t); abort(t); } finally { log.trace("Task timer completed", task.taskName()); resume(); } } }; if (threadPool != null) { log.trace("Task timer runs on the thread pool", task.taskName()); threadPool.submit(timerWorker); } else { log.trace("Task timer runs on the run loop thread", task.taskName()); timerWorker.run(); } }
Source:
public ExceptionalCheckBasedYield(Type exceptionType, Class<? extends SECheck> check, Node node, MethodBehavior behavior) { super(node, behavior); this.check = check; this.behavior = behavior; Preconditions.checkArgument(exceptionType != null, "exceptionType is required"); super.setExceptionType(exceptionType); }

Target:
public ExceptionalCheckBasedYield(Type exceptionType, Class<? extends SECheck> check, Node node, MethodBehavior behavior) { super(node, behavior); this.check = check; this.isMethodVarargs = behavior.isMethodVarArgs(); Preconditions.checkArgument(exceptionType != null, "exceptionType is required"); super.setExceptionType(exceptionType); }
Source:
public static String getPolicyId(PolicyApi policyApi) { for ( ScalingPolicyResponse policy : policyApi.list() ) { if (policy.getName().equals(NAME)) return policy.getId(); } throw new RuntimeException("Policy not found"); }

Target:
public static String getPolicyId(PolicyApi policyApi) { for ( ScalingPolicyResponse policy : policyApi.list() ) { if (policy.getName().equals(NAME)) return policy.getId(); } throw new IllegalArgumentException("Policy not found"); }
Source:
public Result saveImportRecord(SkynetTransaction transaction, CoverageImport coverageImport) throws OseeCoreException { if (coverageImport == null) { return Result.FalseResult; } Artifact importRecordArt = null; for (Artifact artifact : getArtifact(false).getChildren()) { if (artifact.getName().equals(IMPORT_RECORD_NAME)) { importRecordArt = artifact; break; } } if (importRecordArt == null) { importRecordArt = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, artifact.getBranch(), IMPORT_RECORD_NAME); importRecordArt.setSoleAttributeFromString(CoreAttributeTypes.Extension, "zip"); getArtifact(false).addChild(importRecordArt); getArtifact(false).persist(transaction); } String home = System.getProperty("user.home"); File tempFolder = new File(home, "coverage_temp_" + Lib.getDateTimeString()); tempFolder.mkdirs(); tempFolder.deleteOnExit(); File zipFile = new File(tempFolder, "coverage.zip"); InputStream inputStream = null; try { Lib.compressFiles(coverageImport.getImportDirectory(), coverageImport.getImportRecordFiles(), zipFile.getAbsolutePath()); inputStream = new BufferedInputStream(new FileInputStream(zipFile)); importRecordArt.setSoleAttributeFromStream(CoreAttributeTypes.NativeContent, inputStream); } catch (IOException ex) { OseeExceptions.wrapAndThrow(ex); } finally { Lib.close(inputStream); zipFile.delete(); } importRecordArt.persist(transaction); return Result.TrueResult; }

Target:
public Result saveImportRecord(SkynetTransaction transaction, CoverageImport coverageImport) throws OseeCoreException { if (coverageImport == null) { return Result.FalseResult; } Artifact importRecordArt = null; for (Artifact artifact : getArtifact(false).getChildren()) { if (artifact.getName().equals(IMPORT_RECORD_NAME)) { importRecordArt = artifact; break; } } if (importRecordArt == null) { importRecordArt = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, artifact.getBranch(), IMPORT_RECORD_NAME); importRecordArt.setSoleAttributeFromString(CoreAttributeTypes.Extension, "zip"); getArtifact(false).addChild(importRecordArt); getArtifact(false).persist(transaction); } File tempFolder = Files.createTempDir(); tempFolder.deleteOnExit(); File zipFile = new File(tempFolder, "coverage.zip"); InputStream inputStream = null; try { Lib.compressFiles(coverageImport.getImportDirectory(), coverageImport.getImportRecordFiles(), zipFile.getAbsolutePath()); inputStream = new BufferedInputStream(new FileInputStream(zipFile)); importRecordArt.setSoleAttributeFromStream(CoreAttributeTypes.NativeContent, inputStream); } catch (IOException ex) { OseeExceptions.wrapAndThrow(ex); } finally { Lib.close(inputStream); zipFile.delete(); } importRecordArt.persist(transaction); return Result.TrueResult; }
Source:
public ResourceGroupStateInfo getQueryStateInfos(@PathParam("resourceGroupId") String resourceGroupIdString) { if (!isNullOrEmpty(resourceGroupIdString)) { try { return resourceGroupManager.getResourceGroupStateInfo(new ResourceGroupId( newArrayList(resourceGroupIdString.split("/")).stream() .map(ResourceGroupStateInfoResource::urlDecode).collect(toImmutableList()))); } catch (NoSuchElementException e) { throw new WebApplicationException(NOT_FOUND); } } throw new WebApplicationException(NOT_FOUND); }

Target:
public ResourceGroupStateInfo getQueryStateInfos(@PathParam("resourceGroupId") String resourceGroupIdString) { if (!isNullOrEmpty(resourceGroupIdString)) { try { return resourceGroupManager.getResourceGroupStateInfo( new ResourceGroupId( Arrays.stream(resourceGroupIdString.split("/")) .map(ResourceGroupStateInfoResource::urlDecode) .collect(toImmutableList()))); } catch (NoSuchElementException e) { throw new WebApplicationException(NOT_FOUND); } } throw new WebApplicationException(NOT_FOUND); }
Source:
protected String getNamespaceName(Workspace workspace) throws InfrastructureException { String namespace = workspace.getAttributes().get(WORKSPACE_INFRASTRUCTURE_NAMESPACE_ATTRIBUTE); if (namespace == null) { NamespaceResolutionContext resolutionCtx = new NamespaceResolutionContext( workspace.getId(), EnvironmentContext.getCurrent().getSubject().getUserId(), EnvironmentContext.getCurrent().getSubject().getUserName()); namespace = evaluateLegacyNamespaceName(resolutionCtx); LOG.warn( "Workspace '{}' doesn't have an explicit namespace assigned." + " The legacy namespace resolution resolved it to '{}'.", workspace.getId(), namespace); } if (!NamespaceNameValidator.isValid(namespace)) { Subject subj = EnvironmentContext.getCurrent().getSubject(); if (!subj.isAnonymous()) { NamespaceResolutionContext resolutionCtx = new NamespaceResolutionContext(workspace.getId(), subj.getUserId(), subj.getUserName()); String defaultNamespace = evaluateNamespaceName(resolutionCtx); LOG.warn( "The namespace '{}' of the workspace '{}' is not valid. Trying to recover" + " from this situation using a default namespace which resolved to '{}'.", namespace, workspace.getId(), defaultNamespace); namespace = defaultNamespace; } else { LOG.warn( "The namespace '{}' of the workspace '{}' is not valid but we currently don't have" + " an active user to try an recover from this situation.", namespace, workspace.getId(), new Exception()); } } return namespace; }

Target:
protected String getNamespaceName(Workspace workspace) throws InfrastructureException { String namespace = workspace.getAttributes().get(WORKSPACE_INFRASTRUCTURE_NAMESPACE_ATTRIBUTE); if (namespace == null) { NamespaceResolutionContext resolutionCtx = new NamespaceResolutionContext( workspace.getId(), EnvironmentContext.getCurrent().getSubject().getUserId(), EnvironmentContext.getCurrent().getSubject().getUserName()); namespace = evaluateLegacyNamespaceName(resolutionCtx); LOG.warn( "Workspace '{}' doesn't have an explicit namespace assigned." + " The legacy namespace resolution resolved it to '{}'.", workspace.getId(), namespace); } if (!NamespaceNameValidator.isValid(namespace)) { Subject subj = EnvironmentContext.getCurrent().getSubject(); if (!subj.isAnonymous()) { NamespaceResolutionContext resolutionCtx = new NamespaceResolutionContext(workspace.getId(), subj.getUserId(), subj.getUserName()); String defaultNamespace = evaluateNamespaceName(resolutionCtx); LOG.warn( "The namespace '{}' of the workspace '{}' is not valid. Trying to recover" + " from this situation using a default namespace which resolved to '{}'.", namespace, workspace.getId(), defaultNamespace); namespace = defaultNamespace; } else { LOG.warn( "The namespace '{}' of the workspace '{}' is not valid but we currently don't have" + " an active user to try an recover from this situation. We're letting the parent" + " workflow continue, but it may fail at some later point in time because of" + " the incorrect namespace name in use.", namespace, workspace.getId(), new Throwable()); } } return namespace; }
Source:
public void deleteCreateCacheStorageTest() { CacheStorageImpl cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1= new HashMap<>(); final Map<Identifier, OperatorState> queryState2= new HashMap<>(); queryState1.put(oid1, value1); queryState2.put(oid1, value2); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertEquals(true, cache.delete(qid1)); Assert.assertEquals(true, cache.create(qid1, queryState2)); Assert.assertEquals(value2, cache.read(qid1, oid1)); }

Target:
public void deleteCreateCacheStorageTest() { final CacheStorage cache = new CacheStorageImpl(); final Map<Identifier, OperatorState> queryState1 = new HashMap<>(); final Map<Identifier, OperatorState> queryState2 = new HashMap<>(); queryState1.put(oid1, value1); queryState2.put(oid1, value2); cache.create(qid1, queryState1); Assert.assertEquals(value1, cache.read(qid1, oid1)); Assert.assertTrue(cache.delete(qid1)); Assert.assertTrue(cache.create(qid1, queryState2)); Assert.assertEquals(value2, cache.read(qid1, oid1)); }
Source:
private static String getInitials(String text) { String result = "NN"; if (!text.isEmpty() && text != null) { String[] nameParts = text.split(" "); result = nameParts[0].substring(0, 1).toUpperCase(); if (nameParts.length > 1) result += nameParts[1].substring(0, 1).toUpperCase(); } return result; }

Target:
private static String getInitials(String text) { String result = "NN"; if (text != null && !text.isEmpty()) { String[] nameParts = text.split(" "); result = nameParts[0].substring(0, 1).toUpperCase(); if (nameParts.length > 1) result += nameParts[1].substring(0, 1).toUpperCase(); } return result; }
Source:
private List<ExtractedImage> extractImagesFromDoc(AbstractFile af) { List<ExtractedImage> listOfExtractedImages; HWPFDocument doc = null; try { doc = new HWPFDocument(new ReadContentInputStream(af)); } catch (OldFileFormatException ex) { return null; } catch (IOException ex) { return null; } catch (Throwable ex) { logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.docContainer.init.err", af.getName()), ex); return null; } PicturesTable pictureTable = null; List<org.apache.poi.hwpf.usermodel.Picture> listOfAllPictures = null; try { pictureTable = doc.getPicturesTable(); listOfAllPictures = pictureTable.getAllPictures(); } catch (Exception ex) { logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName()), ex); return null; } String outputFolderPath; if (listOfAllPictures.isEmpty()) { return null; } else { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { return null; } listOfExtractedImages = new ArrayList<>(); byte[] data = null; for (org.apache.poi.hwpf.usermodel.Picture picture : listOfAllPictures) { String fileName = picture.suggestFullFileName(); try { data = picture.getContent(); } catch (Exception ex) { logger.log(Level.WARNING, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.processing.err", af.getName()), ex); return null; } writeExtractedImage(Paths.get(outputFolderPath, fileName).toString(), data); listOfExtractedImages.add(new ExtractedImage(fileName, getFileRelativePath(fileName), picture.getSize(), af)); } return listOfExtractedImages; }

Target:
private List<ExtractedImage> extractImagesFromDoc(AbstractFile af) { List<org.apache.poi.hwpf.usermodel.Picture> listOfAllPictures; try { HWPFDocument doc = new HWPFDocument(new ReadContentInputStream(af)); PicturesTable pictureTable = doc.getPicturesTable(); listOfAllPictures = pictureTable.getAllPictures(); } catch (OldFileFormatException | IOException ex) { return null; } catch (Throwable ex) { logger.log(Level.SEVERE, NbBundle.getMessage(this.getClass(), "EmbeddedFileExtractorIngestModule.ImageExtractor.docContainer.init.err", af.getName()), ex); return null; } String outputFolderPath; if (listOfAllPictures.isEmpty()) { return null; } else { outputFolderPath = getOutputFolderPath(this.parentFileName); } if (outputFolderPath == null) { return null; } List<ExtractedImage> listOfExtractedImages = new ArrayList<>(); byte[] data = null; for (org.apache.poi.hwpf.usermodel.Picture picture : listOfAllPictures) { String fileName = picture.suggestFullFileName(); try { data = picture.getContent(); } catch (Exception ex) { return null; } writeExtractedImage(Paths.get(outputFolderPath, fileName).toString(), data); listOfExtractedImages.add(new ExtractedImage(fileName, getFileRelativePath(fileName), picture.getSize(), af)); } return listOfExtractedImages; }
Source:
public ModuleList(Iterable<ModuleDefinitionResource> modules) { checkState(modules != null); modulesByType = TreeMultimap.create(index(modules, BY_TYPE)); }

Target:
public ModuleList(Iterable<ModuleDefinitionResource> modules) { Assert.state(modules != null); modulesByType = TreeMultimap.create(index(modules, BY_TYPE)); iteratorsByType = transformValues(modulesByType.asMap(), new Function<Collection<ModuleDefinitionResource>, Iterator<ModuleDefinitionResource>>() { @Override public Iterator<ModuleDefinitionResource> apply(Collection<ModuleDefinitionResource> input) { return input.iterator(); } }); }
Source:
public void testClassWithPrivateCtorAndNestedExtendingSubclass() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(FinalClassCheck.class); final String[] expected = { "10:5: " + getCheckMessage(MSG_KEY, "B"), "16:5: " + getCheckMessage(MSG_KEY, "C"), }; verify(checkConfig, getNonCompilablePath( "InputFinalClassClassWithPrivateCtorWithNestedExtendingClass.java"), expected); }

Target:
public void testClassWithPrivateCtorAndNestedExtendingSubclass() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(FinalClassCheck.class); final String[] expected = { "16:5: " + getCheckMessage(MSG_KEY, "C"), }; verify(checkConfig, getNonCompilablePath( "InputFinalClassClassWithPrivateCtorWithNestedExtendingClass.java"), expected); }
Source:
public static List<File> getDirectories(File file) { return Arrays.stream(Objects.requireNonNull(file.listFiles())) .filter(File::isDirectory) .sorted(Comparator.comparing(File::getName)) .collect(Collectors.toList()); }

Target:
public static List<File> getDirectories(File file) { File[] files = file.listFiles(); if (files == null) return Collections.emptyList(); return Arrays.stream(files) .filter(File::isDirectory) .sorted(Comparator.comparing(File::getName)) .collect(Collectors.toList()); }
Source:
List<String> getTypes() { List<String> types = new ArrayList(counts.keySet()); Collections.sort(types); return types; }

Target:
List<String> getTypes() { List<String> types = new ArrayList<>(counts.keySet()); Collections.sort(types); return types; }
Source:
protected String renderTable() { StringBuilder csvOut = new StringBuilder(); csvOut.append(CELL_QUOTE); csvOut.append(Joiner.on(CELL_SEPARATOR).join(getHeaders())); csvOut.append(CELL_QUOTE); csvOut.append(LINE_SEPARATOR); String[][] body = formatTableContents(); for(String[] line : body) { csvOut.append(CELL_QUOTE); csvOut.append(Joiner.on(CELL_SEPARATOR).join(line)); csvOut.append(CELL_QUOTE); csvOut.append(LINE_SEPARATOR); } return csvOut.toString(); }

Target:
protected String renderTable() { final Appendable outs = new StringWriter(); try { final CSVPrinter csv = new CSVPrinter(outs, CSVFormat.EXCEL); csv.printRecord(getHeaders()); final String[][] body = formatTableContents(); for (final String[] line : body) { csv.printRecord(line); } csv.flush(); csv.close(); } catch (final IOException e) { LOG.error("Failed to create CSV output", e); return "ERROR: Failed to create CSV output"; } return outs.toString(); }
Source:
private int[] setMask(int key) { int[] mask = new int[BITS_SET_PER_BLOCK]; for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = key * SALT[i]; } for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = mask[i] >>> 27; } for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = 0x1 << mask[i]; } return mask; }

Target:
private int[] setMask(int key) { for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = key * SALT[i]; } for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = mask[i] >>> 27; } for (int i = 0; i < BITS_SET_PER_BLOCK; ++i) { mask[i] = 0x1 << mask[i]; } return mask; }
Source:
private void applyContainerSettings(String pid, Document foxml, Model model, boolean hasDescription) { if (foxml == null) { return; } ContainerSettings settings = new ContainerSettings(foxml.getRootElement().getChildren().get(0)); if (settings.getViews().size() == 0) { if (hasDescription) { settings.setViews(defaultViewsDescriptive); } else { settings.setViews(defaultViews); } } if (settings.getDefaultView() == null) { settings.setDefaultView(ContainerView.STRUCTURE.name()); } if (settings.getViews().contains(ContainerView.DEPARTMENTS.name())) { SearchResultResponse result = queryLayer.getDepartmentList(GroupsThreadStore.getGroups(), pid); model.addAttribute("departmentFacets", result.getFacetFields().get(0)); } if (settings.getViews().contains(ContainerView.LIST_CONTENTS.name())) { SearchState searchState = stateFactory.createSearchState(); searchState.setResourceTypes( Arrays.asList(ResourceType.Aggregate.name())); SearchRequest listContentsRequest = new SearchRequest(); listContentsRequest.setSearchState(searchState); listContentsRequest.setRetrieveFacets(false); listContentsRequest.setApplyCutoffs(false); listContentsRequest.setRootPid(pid); listContentsRequest.getSearchState().setRollup(false); SearchResultResponse contentListResponse = queryLayer.performSearch(listContentsRequest); model.addAttribute("contentListResponse", contentListResponse); } model.addAttribute("containerSettings", settings); }

Target:
private void applyContainerSettings(String pid, Document foxml, Model model, boolean hasDescription) { if (foxml == null) { return; } ContainerSettings settings = new ContainerSettings(foxml.getRootElement().getChildren().get(0)); if (settings.getViews().size() == 0) { if (hasDescription) { settings.setViews(defaultViewsDescriptive); } else { settings.setViews(defaultViews); } } if (settings.getDefaultView() == null) { settings.setDefaultView(ContainerView.STRUCTURE.name()); } if (settings.getViews().contains(ContainerView.DEPARTMENTS.name())) { SearchResultResponse result = queryLayer.getDepartmentList(GroupsThreadStore.getGroups(), pid); model.addAttribute("departmentFacets", result.getFacetFields().get(0)); } if (settings.getViews().contains(ContainerView.LIST_CONTENTS.name())) { SearchState searchState = stateFactory.createSearchState(); searchState.setResourceTypes( Arrays.asList(ResourceType.Aggregate.name(), ResourceType.File.name())); searchState.setIncludeParts(false); SearchRequest listContentsRequest = new SearchRequest(); listContentsRequest.setSearchState(searchState); listContentsRequest.setRetrieveFacets(false); listContentsRequest.setApplyCutoffs(false); listContentsRequest.setRootPid(pid); listContentsRequest.getSearchState().setRollup(false); SearchResultResponse contentListResponse = queryLayer.performSearch(listContentsRequest); model.addAttribute("contentListResponse", contentListResponse); } model.addAttribute("containerSettings", settings); }
Source:
public boolean isCommander(Person person) { Person commander = getCommander(); return (null != commander) && person.getId().equals(commander.getId()); }

Target:
public boolean isCommander(Person person) { Person commander = getCommander(); return (null != person) && (null != commander) && person.getId().equals(commander.getId()); }
Source:
public static void inputReal(QuantileDigestState state, long value, long weight, double accuracy) { input(state, floatToSortableInt(intBitsToFloat((int) value)), weight, accuracy); }

Target:
public static void inputReal(QuantileDigestState state, long value, long weight, double accuracy) { inputBigint(state, floatToSortableInt(intBitsToFloat((int) value)), weight, accuracy); }