auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Guid getClusterId() { Guid vdsGroupId; if (Guid.Empty.equals(getParameters().getVdsGroupId())) { vdsGroupId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "RegisterVdsQuery::ExecuteCommand - VdsGroupId received as -1, using AutoRegistrationDefaultVdsGroupID: '{}'", vdsGroupId); } else { vdsGroupId = getParameters().getVdsGroupId(); } <START> if (vdsGroupId == null || Guid.Empty.equals(vdsGroupId)) { <END> VdsGroupDAO dao = DbFacade.getInstance().getVdsGroupDao(); VDSGroup cluster = dao.getByName("Default"); if (cluster != null) { vdsGroupId = cluster.getId(); } else { List<VDSGroup> clusters = dao.getAll(); if (clusters.size() > 0) { vdsGroupId = clusters.get(0).getId(); } else { log.error("AddVdsCommand: No default or valid cluster was found, host registration failed."); AuditLogableBase logableBase = new AuditLogableBase(); AuditLogDirector.log(logableBase, AuditLogType.HOST_FAILED_REGISTRATION_INVALID_CLUSTER); } } } return vdsGroupId; }</code><technical_language>check if groupid is exist.</technical_language>

Target:
private Guid getClusterId() { Guid vdsGroupId; if (Guid.Empty.equals(getParameters().getVdsGroupId())) { vdsGroupId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "RegisterVdsQuery::ExecuteCommand - VdsGroupId received as -1, using AutoRegistrationDefaultVdsGroupID: '{}'", vdsGroupId); } else { vdsGroupId = getParameters().getVdsGroupId(); } if (vdsGroupId == null || Guid.Empty.equals(vdsGroupId)) { VdsGroupDAO dao = DbFacade.getInstance().getVdsGroupDao(); VDSGroup cluster = dao.getByName("Default"); if (cluster != null) { vdsGroupId = cluster.getId(); } else { List<VDSGroup> clusters = dao.getAll(); if (clusters.size() > 0) { vdsGroupId = clusters.get(0).getId(); } } } return vdsGroupId; }
Source:
<code>private ProtectionDomain create(ProtectionDomain domain) { <START> Enumeration<Permission> permissions = domain.getPermissions().elements(); <END> PermissionCollection proxyPermissions = new Permissions(); while (permissions.hasMoreElements()) { proxyPermissions.add(permissions.nextElement()); } proxyPermissions.add(ACCESS_DECLARED_MEMBERS_PERMISSION); return new ProtectionDomain(domain.getCodeSource(), proxyPermissions); }</code><technical_language>Small optimization: check existing domain if implies ACCESS_DECLARED_MEMBERS_PERMISSION. If does, skip this work</technical_language>

Target:
private ProtectionDomain create(ProtectionDomain domain) { if (domain.implies(ACCESS_DECLARED_MEMBERS_PERMISSION)) { return domain; } Enumeration<Permission> permissions = domain.getPermissions().elements(); PermissionCollection proxyPermissions = new Permissions(); while (permissions.hasMoreElements()) { proxyPermissions.add(permissions.nextElement()); } proxyPermissions.add(ACCESS_DECLARED_MEMBERS_PERMISSION); return new ProtectionDomain(domain.getCodeSource(), proxyPermissions); }
Source:
<code>private void runTestCase(TestScenario testScenario, TestCase testCase, TestEnvironmentExecutor testEnvironmentExecutor) throws TestFailException { System.out.println("Executing test case: " + testCase); String environmentId = null; try { if (testEnvironmentExecutor instanceof DockerComposeExecutor) { ((DockerComposeExecutor) testEnvironmentExecutor).createNetwork(); } apmServer.setHost("0.0.0.0"); apmServer.setTraces(new ArrayList<>()); apmServer.run(); environmentId = testEnvironmentExecutor.run(testScenario.getEnvironment()); <START> Thread.sleep(testScenario.getEnvironment().getInitWaitSeconds()*1000); <END> testEnvironmentExecutor.execScript(environmentId, testCase.getScriptServiceName(), testCase.getAction()); Thread.sleep(testCase.getAfterActionWaitSeconds()*1000); verifyResults(testScenario, testCase, apmServer); } catch (InterruptedException ex) { throw new TestFailException(testCase, ex); } finally { if (apmServer != null) { apmServer.shutdown(); } if (environmentId != null) { testEnvironmentExecutor.clean(environmentId); } } }</code><technical_language>This sleep matter what, right? I problems this approach: first, if environment inits fast, end wasting (initWaitSeconds*1000)-actualInitTime. second, some environments, need more a seconds start. Ideally, do run, join, failing if joined N seconds (timeout)</technical_language>

Target:
private void runTestCase(TestScenario testScenario, TestCase testCase, TestEnvironmentExecutor testEnvironmentExecutor) throws TestFailException { log.info(String.format("Executing test case: %s", testCase)); String environmentId = null; ApmMockServer apmServer = new ApmMockServer(); apmServer.setHost("0.0.0.0"); apmServer.setPort(apmServerPort); apmServer.setShutdownTimer(60*60*1000); try { if (testScenario.getEnvironment().getApmAddress() != null) { testEnvironmentExecutor.createNetwork(); } apmServer.run(); environmentId = testEnvironmentExecutor.run(testScenario.getEnvironment()); Thread.sleep(testScenario.getEnvironment().getInitWaitSeconds()*1000); testEnvironmentExecutor.execScript(environmentId, testCase.getScriptServiceName(), testCase.getAction()); Thread.sleep(testCase.getAfterActionWaitSeconds()*1000); Collection<JsonPathVerify> jsonPathVerifies = verifyResults(testScenario, testCase, apmServer); if (!jsonPathVerifies.isEmpty()) { throw new TestFailException(testCase, jsonPathVerifies); } } catch (InterruptedException ex) { log.severe("Interruption exception"); log.severe(ex.toString()); throw new TestFailException(testCase, ex); } finally { if (environmentId != null) { testEnvironmentExecutor.clean(environmentId); } if (apmServer != null) { apmServer.shutdown(); } } }
Source:
<code>public void processTuple(String inputTuple) { try { if (out.isConnected()) { StringReader reader = new StringReader(inputTuple); JAXBElement<?> output = unmarshaller.unmarshal(new StreamSource(reader), getClazz()); LOG.debug(output.getValue().toString()); emittedObjectCount++; out.emit(output.getValue()); } else { validator.validate(new StreamSource(inputTuple)); } if (validatedOutput.isConnected()) { validatedOutput.emit(inputTuple); } if (parsedOutput.isConnected()) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document doc = builder.parse(inputTuple); parsedOutput.emit(doc); } catch (Exception e) { <START> e.printStackTrace(); <END> } } } catch (Exception e) { LOG.debug("Failed to parse xml tuple {}, Exception = ", inputTuple, e); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } }</code><technical_language>swallowing exception</technical_language>

Target:
public void processTuple(String inputTuple) { try { if (out.isConnected()) { reader.open(inputTuple); JAXBElement<?> output = unmarshaller.unmarshal(new StreamSource(reader), getClazz()); LOG.debug(output.getValue().toString()); emittedObjectCount++; out.emit(output.getValue()); } else if (validator != null) { validator.validate(new StreamSource(inputTuple)); } if (parsedOutput.isConnected()) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document doc = builder.parse(inputTuple); parsedOutput.emit(doc); } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = , StackTrace = {}", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } } } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = {}, StackTrace = ", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } finally { try { if (reader.isOpen()) { reader.close(); } } catch (IOException e) { DTThrowable.wrapIfChecked(e); } } }
Source:
<code>private Object getNextUnresolvedDiff(TreeItem start) { return getNextDataWhichSatisfies(start, new Predicate<EObject>() { public boolean apply(EObject input) { <START> return input instanceof Diff && ((Diff)input).getState() == DifferenceState.UNRESOLVED; <END> } }); }</code><technical_language>introduce (if exists already) hasState() predicate method in EMFComparePredicates</technical_language>

Target:
private Object getNextUnresolvedDiff(TreeItem start) { return getNextData(start, EMFComparePredicates.hasState(DifferenceState.UNRESOLVED)); }
Source:
<code>private void decodeHeadersAndProperties(final ByteBuf buffer, boolean lazyProperties) { messageIDPosition = buffer.readerIndex(); messageID = buffer.readLong(); int b = buffer.readByte(); if (b != DataConstants.NULL) { final int length = buffer.readInt(); if (keysInterner != null) { <START> address = keysInterner.intern(buffer, length); <END> } else { address = SimpleString.readSimpleString(buffer, length); } } else { address = null; } if (buffer.readByte() == DataConstants.NOT_NULL) { byte[] bytes = new byte[16]; buffer.readBytes(bytes); userID = new UUID(UUID.TYPE_TIME_BASED, bytes); } else { userID = null; } type = buffer.readByte(); durable = buffer.readBoolean(); expiration = buffer.readLong(); timestamp = buffer.readLong(); priority = buffer.readByte(); if (lazyProperties) { properties = null; propertiesLocation = buffer.readerIndex(); } else { properties = new TypedProperties(); properties.decode(buffer, keysInterner, valuesInterner); } }</code><technical_language>If separate pools of SimpleStrings instead of global interning for typed properties keys values, pool address's separate well. Imagine pool is size 32 default, quickly find typedproperty keys invalidating address's in pool</technical_language>

Target:
private void decodeHeadersAndProperties(final ByteBuf buffer, boolean lazyProperties) { messageIDPosition = buffer.readerIndex(); messageID = buffer.readLong(); int b = buffer.readByte(); if (b != DataConstants.NULL) { address = SimpleString.readSimpleString(buffer, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressDecoderPool()); } else { address = null; } if (buffer.readByte() == DataConstants.NOT_NULL) { byte[] bytes = new byte[16]; buffer.readBytes(bytes); userID = new UUID(UUID.TYPE_TIME_BASED, bytes); } else { userID = null; } type = buffer.readByte(); durable = buffer.readBoolean(); expiration = buffer.readLong(); timestamp = buffer.readLong(); priority = buffer.readByte(); if (lazyProperties) { properties = null; propertiesLocation = buffer.readerIndex(); } else { properties = new TypedProperties(); properties.decode(buffer, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); } }
Source:
<code><START> synchronized Optional<LockToken> unlock() { <END> if (!unlocked) { unlocked = true; referenceCounter.unmark(); } return referenceCounter.dereferenced() ? Optional.of(sharedLockToken) : Optional.empty(); }</code><technical_language>noted this in PR added this class, I find this odd. levels of synchronization imply single-threaded-ness; thread returned lock token unlock. However, a race this _possibly_ happen if race is hit. And, unlock is idempotent, is weird; means person abusing this class behaviour. before, prefer reference counter return a single share returned token unlock; person unlock is handed token unlock race away. this sense</technical_language>

Target:
synchronized Optional<LockToken> unlock() { if (!unlocked) { unlocked = true; return referenceCounter.unmark() ? Optional.of(sharedLockToken) : Optional.empty(); } return Optional.empty(); }
Source:
<code>private void configureSingleUserMode( Map<String, String> persistenceProperties, String infrastructure) { persistenceProperties.put( PersistenceUnitProperties.EXCEPTION_HANDLER_CLASS, "org.eclipse.che.core.db.h2.jpa.eclipselink.H2ExceptionHandler"); bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bind(org.eclipse.che.security.oauth.shared.OAuthTokenProvider.class) .to(org.eclipse.che.security.oauth.OAuthAuthenticatorTokenProvider.class); bind(OAuthAPI.class).to(EmbeddedOAuthAPI.class); bind(RemoteSubscriptionStorage.class) .to(org.eclipse.che.api.core.notification.InmemoryRemoteSubscriptionStorage.class); bind(WorkspaceLockService.class) .to(org.eclipse.che.api.workspace.server.DefaultWorkspaceLockService.class); bind(WorkspaceStatusCache.class) .to(org.eclipse.che.api.workspace.server.DefaultWorkspaceStatusCache.class); install(new org.eclipse.che.api.workspace.activity.inject.WorkspaceActivityModule()); <START> configureFakeJwtProxySecureProvisioner(infrastructure); <END> }</code><technical_language>I prefer call Noop instead of Fake</technical_language>

Target:
private void configureSingleUserMode( Map<String, String> persistenceProperties, String infrastructure) { persistenceProperties.put( PersistenceUnitProperties.EXCEPTION_HANDLER_CLASS, "org.eclipse.che.core.db.h2.jpa.eclipselink.H2ExceptionHandler"); bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bind(org.eclipse.che.security.oauth.shared.OAuthTokenProvider.class) .to(org.eclipse.che.security.oauth.OAuthAuthenticatorTokenProvider.class); bind(OAuthAPI.class).to(EmbeddedOAuthAPI.class); bind(RemoteSubscriptionStorage.class) .to(org.eclipse.che.api.core.notification.InmemoryRemoteSubscriptionStorage.class); bind(WorkspaceLockService.class) .to(org.eclipse.che.api.workspace.server.DefaultWorkspaceLockService.class); bind(WorkspaceStatusCache.class) .to(org.eclipse.che.api.workspace.server.DefaultWorkspaceStatusCache.class); install(new org.eclipse.che.api.workspace.activity.inject.WorkspaceActivityModule()); configureImpostorJwtProxySecureProvisioner(infrastructure); }
Source:
<code>public void sanityCheck() { Multiset<PlanFragmentId> exchangeIds = fragment.getRemoteSourceNodes().stream() .map(RemoteSourceNode::getSourceFragmentIds) .flatMap(List::stream) .collect(toImmutableMultiset()); Multiset<PlanFragmentId> childrenIds = children.stream() .map(SubPlan::getFragment) .map(PlanFragment::getId) .collect(toImmutableMultiset()); checkState(exchangeIds.equals(childrenIds), "Subplan exchange ids don't match child fragment ids (%s vs %s)", exchangeIds, childrenIds); checkState( <START> Streams.stream(Traverser.forTree(PlanNode::getSources).depthFirstPreOrder(fragment.getRoot())) <END> .filter(node -> node instanceof TableWriterNode) .count() <= 1, "Each fragment cannot have multiple TableWriterNode"); for (SubPlan child : children) { child.sanityCheck(); } }</code><technical_language>nit: static import stream, put a previous line</technical_language>

Target:
public void sanityCheck() { Multiset<PlanFragmentId> remoteSourceIds = fragment.getRemoteSourceNodes().stream() .map(RemoteSourceNode::getSourceFragmentIds) .flatMap(List::stream) .collect(toImmutableMultiset()); Multiset<PlanFragmentId> childrenIds = children.stream() .map(SubPlan::getFragment) .map(PlanFragment::getId) .collect(toImmutableMultiset()); checkState(childrenIds.containsAll(remoteSourceIds), "child fragments must include all remote source fragments (%s vs %s)", remoteSourceIds, childrenIds); long tableWriteCount = stream(Traverser.forTree(PlanNode::getSources).depthFirstPreOrder(fragment.getRoot())) .filter(TableWriterNode.class::isInstance) .count(); checkState(tableWriteCount <= 1, "Fragment cannot contain more than one TableWriterNode"); if (tableWriteCount == 1) { if (!(fragment.getRoot() instanceof OutputNode || fragment.getRoot() instanceof TableWriterNode)) { throw new VerifyException("For a fragment contains TableWriteNode, the root has to be either OutputNode or TableWriterNode"); } } for (SubPlan child : children) { child.sanityCheck(); } }
Source:
<code><START> public void testCSimpleCall() throws Exception { <END> loadCodeAndRun(getAboveComment()); checkErrorLine(5, ER_ID); }</code><technical_language>"C" testcases parse code C, C++. is a method "loadCodeAndRunC()" do that</technical_language>

Target:
public void testCSimpleCall() throws Exception { loadCodeAndRunC(getAboveComment()); checkErrorLine(5, ER_ID); }
Source:
<code>private void process() { byte[] frame = Arrays.copyOfRange(frameBytes, 4, frameBytes.length); TTransport input = new TMemoryInputTransport(frame); TMemoryOutputBuffer output = new TMemoryOutputBuffer(NATS_MAX_MESSAGE_SIZE); try { processor.process(inputProtoFactory.getProtocol(input), outputProtoFactory.getProtocol(output)); } catch (TApplicationException e) { <START> LOGGER.warn("error processing frame: " + e.getMessage()); <END> } catch (TException e) { LOGGER.warn("error processing frame: " + e.getMessage()); return; } if (!output.hasWriteData()) { return; } try { conn.publish(reply, output.getWriteBytes()); } catch (IOException e) { LOGGER.warn("failed to send response: " + e.getMessage()); } }</code><technical_language>This log message consistent other languages. I specifically call out this unchecked exception in user code</technical_language>

Target:
private void process() { byte[] frame = Arrays.copyOfRange(frameBytes, 4, frameBytes.length); TTransport input = new TMemoryInputTransport(frame); TMemoryOutputBuffer output = new TMemoryOutputBuffer(NATS_MAX_MESSAGE_SIZE); try { processor.process(inputProtoFactory.getProtocol(input), outputProtoFactory.getProtocol(output)); } catch (TApplicationException e) { LOGGER.error("user handler code returned unhandled error on request:" + e.getMessage()); } catch (TException e) { LOGGER.error("user handler code returned unhandled error on request:" + e.getMessage()); return; } if (!output.hasWriteData()) { return; } try { conn.publish(reply, output.getWriteBytes()); } catch (IOException e) { LOGGER.warn("failed to send response: " + e.getMessage()); } }
Source:
<code>public ESAuthenticationInformation logIn(String username, String password, ESClientVersionInfo clientVersionInfo) throws AccessControlException { <START> synchronized (MonitorProvider.getInstance().getMonitor(MONITOR_NAME)) { <END> final long currentTimeStamp = System.currentTimeMillis(); if (checkTooManyFailedRequests(username, currentTimeStamp)) { throw new AccessControlException( MessageFormat.format(Messages.LoginService_VerifyUserTooManyFailedRequests, username, delay)); } ESAuthenticationInformation authInfo; try { authInfo = getUserVerifierService().verifyUser( username, password, clientVersionInfo); cleanupFailedAttempts(username); } catch (final AccessControlException ex) { recordFailedVerifyUserAttempt(username, currentTimeStamp); throw ex; } final AuthenticationInformation authenticationInformation = ESAuthenticationInformationImpl.class.cast( authInfo).toInternalAPI(); final ESSessionId existingSession = sessions.resolveByUser(authInfo.getUser()); if (existingSession == null) { sessions.add(authInfo); } else { authenticationInformation.setSessionId( ESSessionIdImpl.class.cast(existingSession).toInternalAPI()); } final ACUser resolvedUser = (ACUser) ESUserImpl.class.cast( orgUnitResolver.resolveRoles(authInfo)) .toInternalAPI(); authenticationInformation.setResolvedACUser(resolvedUser); return authInfo; } }</code><technical_language>Existing code refactored call verifyUser for logIn. This is changes in verifyUser</technical_language>

Target:
public ESAuthenticationInformation logIn(String username, String password, ESClientVersionInfo clientVersionInfo) throws AccessControlException { synchronized (MonitorProvider.getInstance().getMonitor(MONITOR_NAME)) { final Optional<ESAuthenticationInformation> information = doVerifyUser(username, password, clientVersionInfo); if (!information.isPresent()) { throw new AccessControlException( MessageFormat.format(Messages.LoginService_VerifyUserTooManyFailedRequests, username, delay)); } final ESAuthenticationInformation authInfo = information.get(); final AuthenticationInformation authenticationInformation = ESAuthenticationInformationImpl.class.cast( authInfo).toInternalAPI(); final ESSessionId existingSession = sessions.resolveByUser(authInfo.getUser()); if (existingSession == null) { sessions.add(authInfo); } else { authenticationInformation.setSessionId( ESSessionIdImpl.class.cast(existingSession).toInternalAPI()); } final ACUser resolvedUser = (ACUser) ESUserImpl.class.cast( orgUnitResolver.resolveRoles(authInfo)) .toInternalAPI(); authenticationInformation.setResolvedACUser(resolvedUser); return authInfo; } }
Source:
<code>public void testValidMessageParameter() { File sourceFile = compilerHelper.getSourceFile( ValidMessageParameters.class ); boolean compilationResult = compilerHelper.compile( new ConstraintValidationProcessor(), diagnostics, sourceFile ); assertTrue( compilationResult ); assertThatDiagnosticsMatch( diagnostics, <START> new DiagnosticExpectation( Kind.WARNING, 78 ) <END> ); }</code><technical_language>This expectation right. I raised declaration of message(), i.e. line 56</technical_language>

Target:
public void testValidMessageParameter() { File sourceFile = compilerHelper.getSourceFile( ValidMessageParameters.class ); boolean compilationResult = compilerHelper.compile( new ConstraintValidationProcessor(), diagnostics, sourceFile ); assertTrue( compilationResult ); assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpectation( Kind.WARNING, 57 ), new DiagnosticExpectation( Kind.WARNING, 88 ), new DiagnosticExpectation( Kind.WARNING, 98 ), new DiagnosticExpectation( Kind.WARNING, 101 ), new DiagnosticExpectation( Kind.WARNING, 108 ), new DiagnosticExpectation( Kind.WARNING, 109 ), new DiagnosticExpectation( Kind.WARNING, 110 ), new DiagnosticExpectation( Kind.WARNING, 122 ) ); }
Source:
<code>private static String getLinuxOSInfo() { String versionInfo = ""; <START> try { <END> BufferedReader br = null; final String ubuntuDistInfoFilePath = "/etc/lsb-release"; final String rhDistInfoFilePath = "/etc/redhat-release"; if (Files.exists(Paths.get(ubuntuDistInfoFilePath))) { br = new BufferedReader(new FileReader(ubuntuDistInfoFilePath)); } else if (Files.exists(Paths.get(rhDistInfoFilePath))) { br = new BufferedReader(new FileReader(rhDistInfoFilePath)); } if (br != null) { StringBuffer buffer = new StringBuffer(); while ((versionInfo = br.readLine()) != null) { buffer.append(versionInfo); } versionInfo = buffer.toString(); } } catch (IOException io) { System.err.println(io.getMessage()); versionInfo = ""; } return versionInfo; }</code><technical_language>try resource</technical_language>

Target:
private static String getLinuxOSInfo() { String versionInfo = ""; BufferedReader br = null; final List<String> distInfoFilePaths = Arrays.asList("/etc/lsb-release", "/etc/redhat-release"); for (String filePath : distInfoFilePaths) { if (Files.exists(Paths.get(filePath))) { try { br = new BufferedReader(new FileReader(filePath)); } catch (FileNotFoundException excp) { System.err.println(excp.getMessage()); } break; } } if (br != null) { StringBuffer buffer = new StringBuffer(); try { while ((versionInfo = br.readLine()) != null) { buffer.append(versionInfo); } versionInfo = buffer.toString(); } catch (IOException io) { System.err.println(io.getMessage()); versionInfo = ""; } } return versionInfo; }
Source:
<code>public void setSubject(String subject) { if (subject != null && subject.equals("")) { <START> this.subject = "(no topic)"; <END> } else { this.subject = subject; } }</code><technical_language>Is a reason strings.xml file for this</technical_language>

Target:
public void setSubject(String subject) { if (subject != null && subject.equals("")) { this.subject = ZulipApp.get().getString(R.string.no_topic_in_message); } else { this.subject = subject; } }
Source:
<code>public void handleEvent(MotechEvent event) { Map<String, Object> params = event.getParameters(); <START> emailSender.sendPasswordResetReminder(usersDataService.findByUserName((String) params.get("username")), <END> (DateTime) event.getParameters().get("expirationDate")); }</code><technical_language>if avoid mandate this query, put required parameters in event payload in place</technical_language>

Target:
public void handleEvent(MotechEvent event) { emailSender.sendPasswordResetReminder(event.getParameters()); }
Source:
<code>public static boolean isWifiandBTWixel(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String collection_method = prefs.getString("dex_collection_method", "WifiBlueToothWixel"); <START> if(collection_method.compareTo("WifiBlueToothWixel") == 0) { <END> return true; } return false; }</code><technical_language>please use: prefs.getString("dex_collection_method", "BluetoothWixel")); default project</technical_language>

Target:
public static boolean isWifiandBTWixel(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel"); if(collection_method.compareTo("WifiBlueToothWixel") == 0) { return true; } return false; }
Source:
<code>protected final void createDestinationGroup(Composite parent) { Composite containerGroup = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; containerGroup.setLayout(layout); containerGroup.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); containerGroup.setFont(parent.getFont()); Label resourcesLabel = new Label(containerGroup, SWT.NONE); resourcesLabel.setText(IDEWorkbenchMessages.WizardImportPage_folder); resourcesLabel.setFont(parent.getFont()); containerNameField = new Text(containerGroup, SWT.SINGLE | SWT.BORDER); <START> BidiUtils.applyBidiProcessing(containerNameField, BidiUtils.BTD_DEFAULT); <END> containerNameField.addListener(SWT.Modify, this); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; containerNameField.setLayoutData(data); containerNameField.setFont(parent.getFont()); containerBrowseButton = new Button(containerGroup, SWT.PUSH); containerBrowseButton.setText(IDEWorkbenchMessages.WizardImportPage_browse2); containerBrowseButton.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL)); containerBrowseButton.addListener(SWT.Selection, this); containerBrowseButton.setFont(parent.getFont()); setButtonLayoutData(containerBrowseButton); initialPopulateContainerField(); }</code><technical_language>BTD_DEFAULT StructuredTextTypeHandlerFactory.FILE</technical_language>

Target:
protected final void createDestinationGroup(Composite parent) { Composite containerGroup = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 3; containerGroup.setLayout(layout); containerGroup.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); containerGroup.setFont(parent.getFont()); Label resourcesLabel = new Label(containerGroup, SWT.NONE); resourcesLabel.setText(IDEWorkbenchMessages.WizardImportPage_folder); resourcesLabel.setFont(parent.getFont()); containerNameField = new Text(containerGroup, SWT.SINGLE | SWT.BORDER); BidiUtils.applyBidiProcessing(containerNameField, StructuredTextTypeHandlerFactory.FILE); containerNameField.addListener(SWT.Modify, this); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; containerNameField.setLayoutData(data); containerNameField.setFont(parent.getFont()); containerBrowseButton = new Button(containerGroup, SWT.PUSH); containerBrowseButton.setText(IDEWorkbenchMessages.WizardImportPage_browse2); containerBrowseButton.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_FILL)); containerBrowseButton.addListener(SWT.Selection, this); containerBrowseButton.setFont(parent.getFont()); setButtonLayoutData(containerBrowseButton); initialPopulateContainerField(); }
Source:
<code>public ResponseEntity<String> createAnnotationByTypeJsonld(@RequestParam(value = WebAnnotationFields.PARAM_WSKEY) String wskey, @RequestParam(value = WebAnnotationFields.PROVIDER, required = false) String provider, @RequestParam(value = WebAnnotationFields.IDENTIFIER, required = false) String identifier, @RequestParam(value = WebAnnotationFields.INDEX_ON_CREATE, required = false, defaultValue = "true") boolean indexOnCreate, @RequestBody String annotation, @RequestParam(value = WebAnnotationFields.USER_TOKEN, required = false, defaultValue = WebAnnotationFields.USER_ANONYMOUNS) String userToken, @PathVariable(value = WebAnnotationFields.PATH_PARAM_ANNO_TYPE) String annoType, HttpServletRequest request )throws HttpException, ApiKeyExtractionException, AuthorizationExtractionException { verifyWriteAccess(WebAnnotationFields.CREATE_OPERATION, request); <START> MotivationTypes motivation = MotivationTypes.getTypeForOaType(annoType); <END> if (motivation == null) { motivation = MotivationTypes.getTypeForAnnoType(annoType); } if(motivation == null) throw new ParamValidationException(ParamValidationException.MESSAGE_INVALID_PARAMETER_VALUE, I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.PATH_PARAM_ANNO_TYPE, annoType}, HttpStatus.NOT_ACCEPTABLE, null); return storeAnnotation(wskey, motivation, provider, identifier, indexOnCreate, annotation, userToken); }</code><technical_language>this is wrong! Please revert previous implementation. If is a requirement "describe" URL, definition of MotivationType needs updated</technical_language>

Target:
public ResponseEntity<String> createAnnotationByTypeJsonld(@RequestParam(value = WebAnnotationFields.PARAM_WSKEY) String wskey, @RequestParam(value = WebAnnotationFields.PROVIDER, required = false) String provider, @RequestParam(value = WebAnnotationFields.IDENTIFIER, required = false) String identifier, @RequestParam(value = WebAnnotationFields.INDEX_ON_CREATE, required = false, defaultValue = "true") boolean indexOnCreate, @RequestBody String annotation, @RequestParam(value = WebAnnotationFields.USER_TOKEN, required = false, defaultValue = WebAnnotationFields.USER_ANONYMOUNS) String userToken, @PathVariable(value = WebAnnotationFields.PATH_PARAM_ANNO_TYPE) String annoType, HttpServletRequest request )throws HttpException, ApiKeyExtractionException, AuthorizationExtractionException { verifyWriteAccess(WebAnnotationFields.CREATE_OPERATION, request); MotivationTypes motivation = MotivationTypes.getTypeForAnnoType(annoType); if(motivation == null) throw new ParamValidationException(ParamValidationException.MESSAGE_INVALID_PARAMETER_VALUE, I18nConstants.ANNOTATION_VALIDATION, new String[]{WebAnnotationFields.PATH_PARAM_ANNO_TYPE, annoType}, HttpStatus.NOT_ACCEPTABLE, null); return storeAnnotation(wskey, motivation, provider, identifier, indexOnCreate, annotation, userToken); }
Source:
<code>public String toString() { <START> return "DoubleLastAggregatorFactory{" + <END> "name='" + name + '\'' + ", fieldName='" + fieldName + '\'' + '}'; }</code><technical_language>"LongLastAggregatorFactory{"</technical_language>

Target:
public String toString() { return "LongLastAggregatorFactory{" + "name='" + name + '\'' + ", fieldName='" + fieldName + '\'' + '}'; }
Source:
<code>public CompletableFuture<List<KubernetesPod>> getPodsWithLabels(Map<String, String> labels) { return CompletableFuture.supplyAsync(() -> { final List<Pod> podList = this.internalClient.pods().withLabels(labels).list().getItems(); <START> if (podList == null || podList.size() < 1) { <END> return new ArrayList<>(); } return podList .stream() .map(KubernetesPod::new) .collect(Collectors.toList()); }, executorWrapper.getExecutor()); }</code><technical_language>suggestion if (podList == null || podList.isEmpty()) {</technical_language>

Target:
public List<KubernetesPod> getPodsWithLabels(Map<String, String> labels) { final List<Pod> podList = this.internalClient.pods().withLabels(labels).list().getItems(); if (podList == null || podList.isEmpty()) { return new ArrayList<>(); } return podList .stream() .map(KubernetesPod::new) .collect(Collectors.toList()); }
Source:
<code>public Optional<ImmutableWetData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableWetData immutable) { if (key == Keys.IS_WET) { <START> return Optional.<ImmutableWetData>of(new ImmutableSpongeWetData((Boolean) value)); <END> } return Optional.absent(); }</code><technical_language>Cache this value</technical_language>

Target:
public Optional<ImmutableWetData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableWetData immutable) { if (key == Keys.IS_WET) { return Optional.<ImmutableWetData>of(ImmutableDataCachingUtil.getManipulator(ImmutableSpongeWetData.class, (Boolean) value)); } return Optional.empty(); }
Source:
<code>public Pagination<Payment> getPayments(final Long offset, final Long limit, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) { <START> return paymentProcessor.getPayments(offset, limit, withPluginInfo, properties, context, internalCallContextFactory.createInternalTenantContext(context)); <END> }</code><technical_language>here: new flag withAttempts is passed (used) paymentProcessor#getAccountPayments</technical_language>

Target:
public Pagination<Payment> getPayments(final Long offset, final Long limit, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) { return paymentProcessor.getPayments(offset, limit, withPluginInfo, withAttempts, properties, context, internalCallContextFactory.createInternalTenantContext(context)); }
Source:
<code>public Object getArgument(int index) { <START> assert index >= 0 && index <= arguments.size(); <END> return arguments.get(index); }</code><technical_language>index < arguments.size()</technical_language>

Target:
public Object getArgument(int index) { assert index >= 0 && index < arguments.size(); return arguments.get(index); }
Source:
<code>private static ProgramState checkAssertIsNotNull(ProgramState currentState, CheckerContext context, MethodInvocationTree methodInvocation) { MethodInvocationTree mit = methodInvocation; while (true) { ExpressionTree methodSelect = mit.methodSelect(); if (!methodSelect.is(Tree.Kind.MEMBER_SELECT)) { return currentState; } ExpressionTree expression = ((MemberSelectExpressionTree) methodSelect).expression(); if (!expression.is(Tree.Kind.METHOD_INVOCATION)) { return currentState; } mit = (MethodInvocationTree) expression; if (ASSERT_THAT.anyMatch(mit)) { break; } } ExplodedGraph.Node node = context.getNode(); Tree previousSyntaxNode; do { node = node.parent(); previousSyntaxNode = node.programPoint.syntaxTree(); <START> } while (!previousSyntaxNode.equals(mit)); <END> SymbolicValue assertThatParameter = node.programState.peekValue(); if (assertThatParameter == null) { return currentState; } ObjectConstraint nullNessConstraint = currentState.getConstraint(assertThatParameter, ObjectConstraint.class); if (nullNessConstraint == ObjectConstraint.NULL) { return null; } return currentState; }</code><technical_language>scared of infinite loop in some corner case. more defensive here</technical_language>

Target:
private static ProgramState checkAssertIsNotNull(ProgramState currentState, CheckerContext context, MethodInvocationTree methodInvocation) { MethodInvocationTree mit = methodInvocation; while (true) { ExpressionTree methodSelect = mit.methodSelect(); if (!methodSelect.is(Tree.Kind.MEMBER_SELECT)) { return currentState; } ExpressionTree expression = ((MemberSelectExpressionTree) methodSelect).expression(); if (!expression.is(Tree.Kind.METHOD_INVOCATION)) { return currentState; } mit = (MethodInvocationTree) expression; if (ASSERT_THAT.anyMatch(mit)) { break; } } ExplodedGraph.Node node = context.getNode(); Tree previousSyntaxNode; do { node = node.parent(); if (node == null) { return currentState; } previousSyntaxNode = node.programPoint.syntaxTree(); } while (!previousSyntaxNode.equals(mit)); SymbolicValue assertThatParameter = node.programState.peekValue(); if (assertThatParameter == null) { return currentState; } ObjectConstraint nullNessConstraint = currentState.getConstraint(assertThatParameter, ObjectConstraint.class); if (nullNessConstraint == ObjectConstraint.NULL) { return null; } return currentState; }
Source:
<code>public Response add(UserPermission entity) throws SQLException { Context.getPermissionsManager().checkAdmin(getUserId()); if (entity.getUserId() == entity.getOtherUserId()) { <START> throw new SecurityException("Selfmanagement prohibited"); <END> } Context.getDataManager().linkUser(entity.getUserId(), entity.getOtherUserId()); Context.getPermissionsManager().refreshUserPermissions(); return Response.ok(entity).build(); }</code><technical_language>do in this case? User manage account</technical_language>

Target:
public Response add(UserPermission entity) throws SQLException { Context.getPermissionsManager().checkAdmin(getUserId()); if (entity.getUserId() != entity.getManagedUserId()) { Context.getDataManager().linkUser(entity.getUserId(), entity.getManagedUserId()); Context.getPermissionsManager().refreshUserPermissions(); } return Response.ok(entity).build(); }
Source:
<code>public String getAlgorithm() { <START> return "SK-ECDSA"; <END> }</code><technical_language>Please this a public literal constant of this class</technical_language>

Target:
public String getAlgorithm() { return ALGORITHM; }
Source:
<code><START> public final FormValidation doCheckId(@ContextInPath ModelObject context, @QueryParameter String value) { <END> if (value.isEmpty()) { return FormValidation.ok(); } if (!value.matches("[a-zA-Z0-9_.-]+")) { return FormValidation.error("Unacceptable characters"); } FormValidation problem = checkForDuplicates(value, context, context); if (problem != null) { return problem; } CredentialsStoreAction a; if (!(context instanceof User)) { User me = User.current(); if (me != null) { problem = checkForDuplicates(value, context, me); if (problem != null) { return problem; } } } if (!(context instanceof Jenkins)) { Jenkins j = Jenkins.getInstance(); if (j != null) { problem = checkForDuplicates(value, context, j); if (problem != null) { return problem; } } } return FormValidation.ok(); }</code><technical_language>Restricted</technical_language>

Target:
public final FormValidation doCheckId(@ContextInPath ModelObject context, @QueryParameter String value) { if (value.isEmpty()) { return FormValidation.ok(); } if (!value.matches("[a-zA-Z0-9_.-]+")) { return FormValidation.error("Unacceptable characters"); } FormValidation problem = checkForDuplicates(value, context, context); if (problem != null) { return problem; } if (!(context instanceof User)) { User me = User.current(); if (me != null) { problem = checkForDuplicates(value, context, me); if (problem != null) { return problem; } } } if (!(context instanceof Jenkins)) { Jenkins j = Jenkins.getInstance(); if (j != null) { problem = checkForDuplicates(value, context, j); if (problem != null) { return problem; } } } return FormValidation.ok(); }
Source:
<code>public Response add(Event event) { validateParameters(event, "origin", "severity", "customId", "description"); validateEnums(Event.class, event); AddExternalEventParameters parameters; boolean isHostExternalStateDefined = event.isSetHost() && event.getHost().isSetExternalStatus() && event.getHost().getExternalStatus().isSetState(); boolean isStorageDomainExternalStateDefined = event.isSetStorageDomain() && event.getStorageDomain().isSetExternalStatus() && event.getStorageDomain().getExternalStatus().isSetState(); if (isHostExternalStateDefined) { parameters = new AddExternalEventParameters(map(event), HostMapper.map(EntityExternalStatus.fromValue( event.getHost().getExternalStatus().getState()), null)); } else if (isStorageDomainExternalStateDefined) { parameters = new AddExternalEventParameters(map(event), <START> HostMapper.map(EntityExternalStatus.fromValue( <END> event.getStorageDomain().getExternalStatus().getState()), null)); } else{ parameters = new AddExternalEventParameters(map(event), null); } return performCreate(VdcActionType.AddExternalEvent, parameters, new QueryIdResolver<Long>(VdcQueryType.GetAuditLogById, GetAuditLogByIdParameters.class)); }</code><technical_language>HostMapper? this if branch for StorageDomain? map method moved a new "ExternalStatusMapper" class</technical_language>

Target:
public Response add(Event event) { validateParameters(event, "origin", "severity", "customId", "description"); validateEnums(Event.class, event); AddExternalEventParameters parameters; boolean isHostExternalStateDefined = event.isSetHost() && event.getHost().isSetExternalStatus() && event.getHost().getExternalStatus().isSetState(); boolean isStorageDomainExternalStateDefined = event.isSetStorageDomain() && event.getStorageDomain().isSetExternalStatus() && event.getStorageDomain().getExternalStatus().isSetState(); if (isHostExternalStateDefined) { parameters = new AddExternalEventParameters(map(event), ExternalStatusMapper.map(EntityExternalStatus.fromValue( event.getHost().getExternalStatus().getState()), null)); } else if (isStorageDomainExternalStateDefined) { parameters = new AddExternalEventParameters(map(event), ExternalStatusMapper.map(EntityExternalStatus.fromValue( event.getStorageDomain().getExternalStatus().getState()), null)); } else{ parameters = new AddExternalEventParameters(map(event), null); } return performCreate(VdcActionType.AddExternalEvent, parameters, new QueryIdResolver<Long>(VdcQueryType.GetAuditLogById, GetAuditLogByIdParameters.class)); }
Source:
<code>public void testNonForwardQueryPause() throws Exception { final String sql = "select * from default.lineitem"; TableDesc tableDesc = cluster.getMaster().getCatalog().getTableDesc("default", "lineitem"); assertNotNull(tableDesc); assertEquals(0L, tableDesc.getStats().getNumRows().longValue()); InputStream testInput = new ByteArrayInputStream(new byte[]{(byte) DefaultTajoCliOutputFormatter.QUIT_COMMAND}); try (TajoCli cli = new TajoCli(cluster.getConfiguration(), new String[]{}, null, testInput, out)) { setVar(cli, SessionVars.CLI_PAGE_ROWS, "2"); setVar(cli, SessionVars.CLI_FORMATTER_CLASS, TajoCliOutputTestFormatter.class.getName()); cli.executeScript(sql); String consoleResult; <START> consoleResult = new String(out.toByteArray()); <END> assertOutputResult(consoleResult); } }</code><technical_language>close this too</technical_language>

Target:
public void testNonForwardQueryPause() throws Exception { final String sql = "select * from default.lineitem"; TableDesc tableDesc = cluster.getMaster().getCatalog().getTableDesc("default", "lineitem"); assertNotNull(tableDesc); assertEquals(0L, tableDesc.getStats().getNumRows().longValue()); try (InputStream testInput = new ByteArrayInputStream(new byte[]{(byte) DefaultTajoCliOutputFormatter.QUIT_COMMAND}); TajoCli cli = new TajoCli(cluster.getConfiguration(), new String[]{}, null, testInput, out)) { setVar(cli, SessionVars.CLI_PAGE_ROWS, "2"); setVar(cli, SessionVars.CLI_FORMATTER_CLASS, TajoCliOutputTestFormatter.class.getName()); cli.executeScript(sql); String consoleResult; consoleResult = new String(out.toByteArray()); assertOutputResult(consoleResult); } }
Source:
<code>@Test public void fieldVariableElement() { TypeElement classElement = getElement(VariableElementFieldClass.class); List<VariableElement> methods = fieldsIn(elements.getAllMembers(classElement)); VariableElement element = findFirst(methods, "name"); try { <START> ParameterSpec.get(element); <END> } catch (IllegalArgumentException exception) { assertThat(exception).hasMessageThat().isEqualTo("element is not a parameter"); } }</code><technical_language>This test pass if get() throw. This fail()</technical_language>

Target:
@Test public void fieldVariableElement() { TypeElement classElement = getElement(VariableElementFieldClass.class); List<VariableElement> methods = fieldsIn(elements.getAllMembers(classElement)); VariableElement element = findFirst(methods, "name"); try { ParameterSpec.get(element); fail(); } catch (IllegalArgumentException exception) { assertThat(exception).hasMessageThat().isEqualTo("element is not a parameter"); } }
Source:
<code>private void overwriteScChambers(SupremeCourtJudgment oldJudgment, SupremeCourtJudgment newJudgment) { <START> oldJudgment.getScChambers().stream().forEach(scChamber-> removeChamberFromOld(oldJudgment, newJudgment, scChamber)); <END> newJudgment.getScChambers().stream().forEach(scChamber->addChamberToOld(oldJudgment, scChamber)); }</code><technical_language>J) (a bit more readable) filter concept oldJudgment.getScChambers().stream().filter(scChamber -> !newJudgment.containsScChamber(scChamber)).forEach(scChamber -> oldJudgment.removeScChamber(scChamber));</technical_language>

Target:
private void overwriteScChambers(SupremeCourtJudgment oldJudgment, SupremeCourtJudgment newJudgment) { oldJudgment.getScChambers().stream().filter(scChamber->!newJudgment.containsScChamber(scChamber)).forEach(scChamber->oldJudgment.removeScChamber(scChamber)); newJudgment.getScChambers().stream().filter(scChamber->!oldJudgment.containsScChamber(scChamber)).forEach(scChamber->oldJudgment.addScChamber(scChamber)); }
Source:
<code>public void reassignTasksToUser(final String userId) { taskService.call((List<TaskAssignmentSummary> reassignments) -> { reassignments.forEach(taskAssignmentSummary -> { if (taskAssignmentSummary.isDelegationAllowed()) { displayNotification(constants.TaskWasDelegated(String.valueOf(taskAssignmentSummary.getTaskId()), taskAssignmentSummary.getTaskName(), userId)); } else { displayUnsuccessfulNotification(constants.ReassignmentNotAllowedOn(String.valueOf(taskAssignmentSummary.getTaskId()), taskAssignmentSummary.getTaskName(), userId)); } }); reassignments.forEach(taskAssignmentSummary -> { if (taskAssignmentSummary.isDelegationAllowed()) { taskRefreshed.fire(new TaskRefreshedEvent()); return; } }); <START> bulkActionPerformedEvent.fire(new BulkActionPerformedEvent()); <END> placeManager.closePlace(place); }, new DefaultErrorCallback() { @Override public boolean error(Message message, Throwable throwable) { displayUnsuccessfulNotification(constants.UnableToPerformReassignment(userId, throwable.getMessage())); return false; } }).delegateTasks(serverTemplateId, tasksToReassign, userId); }</code><technical_language>is event fired for other reassign operations</technical_language>

Target:
public void reassignTasksToUser(final String userId) { taskService.call((List<TaskAssignmentSummary> reassignments) -> { reassignments.forEach(taskAssignmentSummary -> { if (taskAssignmentSummary.isDelegationAllowed()) { displayNotification(constants.TaskWasDelegated(String.valueOf(taskAssignmentSummary.getTaskId()), taskAssignmentSummary.getTaskName(), userId)); } else { displayUnsuccessfulNotification(constants.ReassignmentNotAllowedOn(String.valueOf(taskAssignmentSummary.getTaskId()), taskAssignmentSummary.getTaskName(), userId)); } }); reassignments.stream() .filter(taskAssignmentSummary -> taskAssignmentSummary.isDelegationAllowed()) .findFirst() .ifPresent(taskAssignmentSummary -> taskRefreshed.fire(new TaskRefreshedEvent(serverTemplateId, taskAssignmentSummary.getDeploymentId(), taskAssignmentSummary.getTaskId()))); deselectAllItemsEvent.fire(new DeselectAllItemsEvent()); placeManager.closePlace(place); }, new DefaultErrorCallback() { @Override public boolean error(Message message, Throwable throwable) { displayUnsuccessfulNotification(constants.UnableToPerformReassignment(userId, throwable.getMessage())); return false; } }).delegateTasks(serverTemplateId, tasksToReassign, userId); }