auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
PluginConfig withInheritance(ProjectState.Factory projectStateFactory) { if (projectConfig == null) { return this; } ProjectState state = projectStateFactory.create(projectConfig); ProjectState parent = Iterables.getFirst(state.parents(), null); if (parent != null) { PluginConfig parentPluginConfig = parent.getConfig().getPluginConfig(pluginName) .withInheritance(projectStateFactory); Set<String> allNames = cfg.getNames(PLUGIN, pluginName); cfg = new Config(cfg); for (String name : parentPluginConfig.cfg.getNames(PLUGIN, pluginName)) { if (!allNames.contains(name)) { cfg.setStringList(PLUGIN, pluginName, name, Arrays .asList(parentPluginConfig.cfg.getStringList(PLUGIN, pluginName, name))); } } } return this; }

Target:
PluginConfig withInheritance(ProjectState.Factory projectStateFactory) { if (projectConfig == null) { return this; } List<ProjectState> tree = Lists.newArrayList(projectStateFactory.create(projectConfig).tree()); Collections.reverse(tree); Config c = new Config(); copy(c, tree.get(0)); for (int i = 1; i < tree.size(); i++) { c = new Config(c); copy(c, tree.get(i)); } cfg = c; return this; }
Source:
public MessageMonitor<? super EventMessage<?>> registerEventProcessor(String name, Function<Message<?>, Iterable<Tag>> tagsBuilder) { MessageTimerMonitor messageTimerMonitor = MessageTimerMonitor.buildMonitor(name, registry, tagsBuilder); EventProcessorLatencyMonitor eventProcessorLatencyMonitor = EventProcessorLatencyMonitor.buildMonitor(name, registry); CapacityMonitor capacityMonitor = CapacityMonitor.buildMonitor(name, registry, tagsBuilder); MessageCountingMonitor messageCountingMonitor = MessageCountingMonitor.buildMonitor(name, registry, tagsBuilder); List<MessageMonitor<? super EventMessage<?>>> monitors = new ArrayList<>(); monitors.add(messageTimerMonitor); monitors.add(eventProcessorLatencyMonitor); monitors.add(capacityMonitor); monitors.add(messageCountingMonitor); return new MultiMessageMonitor<>(monitors); }

Target:
public MessageMonitor<? super EventMessage<?>> registerEventProcessor(String name, Function<Message<?>, Iterable<Tag>> tagsBuilder) { MessageTimerMonitor messageTimerMonitor = MessageTimerMonitor.buildMonitor(name, registry, tagsBuilder); EventProcessorLatencyMonitor eventProcessorLatencyMonitor = EventProcessorLatencyMonitor.buildMonitor(name, registry, tagsBuilder); CapacityMonitor capacityMonitor = CapacityMonitor.buildMonitor(name, registry, tagsBuilder); MessageCountingMonitor messageCountingMonitor = MessageCountingMonitor.buildMonitor(name, registry, tagsBuilder); List<MessageMonitor<? super EventMessage<?>>> monitors = new ArrayList<>(); monitors.add(messageTimerMonitor); monitors.add(eventProcessorLatencyMonitor); monitors.add(capacityMonitor); monitors.add(messageCountingMonitor); return new MultiMessageMonitor<>(monitors); }
Source:
private void createLongAccessor() { accessors.put(Long.class, new Accessor<Long>() { @Override public Long get(String key, Long defaultValue) { return preferences.getLong(key, (defaultValue == null) ? 0L : defaultValue); } @Override public void put(String key, Long value) { editor.putLong(key, value).apply(); } }); }

Target:
private void createLongAccessor() { accessors.put(Long.class, new Accessor<Long>() { @Override public Long get(String key) { return preferences.getLong(key, 0L); } @Override public void put(String key, Long value) { editor.putLong(key, value).apply(); } }); }
Source:
public void constructor_accessAndRefreshTokenNull_throws() { try { new UserCredentials(CLIENT_ID, CLIENT_SECRET, null, null); fail("Should not be able to refresh without refresh token."); } catch (Exception expected) { } }

Target:
public void constructor_accessAndRefreshTokenNull_throws() { new UserCredentials(CLIENT_ID, CLIENT_SECRET, null, null); }
Source:
public void handleMembersViewEvent(int memberListVersion, Collection<MemberInfo> memberInfos) { if (logger.isFinestEnabled()) { MemberListSnapshot snapshot = createSnapshot(memberListVersion, memberInfos); logger.finest("Handling new snapshot with membership version: " + memberListVersion + ", membersString " + membersString(snapshot)); } MemberListSnapshot clusterViewSnapshot = memberListSnapshot.get(); if (clusterViewSnapshot == EMPTY_SNAPSHOT) { synchronized (clusterViewLock) { clusterViewSnapshot = memberListSnapshot.get(); if (clusterViewSnapshot == EMPTY_SNAPSHOT) { applyInitialState(memberListVersion, memberInfos); initialListFetchedLatch.countDown(); return; } } } List<MembershipEvent> events = emptyList(); if (memberListVersion >= clusterViewSnapshot.version) { synchronized (clusterViewLock) { clusterViewSnapshot = memberListSnapshot.get(); if (memberListVersion >= clusterViewSnapshot.version) { Set<Member> prevMembers = clusterViewSnapshot.memberSet; MemberListSnapshot snapshot = createSnapshot(memberListVersion, memberInfos); memberListSnapshot.set(snapshot); Set<Member> currentMembers = snapshot.memberSet; events = detectMembershipEvents(prevMembers, currentMembers); } } } fireEvents(events); }

Target:
public void handleMembersViewEvent(int memberListVersion, Collection<MemberInfo> memberInfos) { if (logger.isFinestEnabled()) { MemberListSnapshot snapshot = createSnapshot(memberListVersion, memberInfos); logger.finest("Handling new snapshot with membership version: " + memberListVersion + ", membersString " + membersString(snapshot)); } MemberListSnapshot clusterViewSnapshot = memberListSnapshot.get(); if (clusterViewSnapshot == EMPTY_SNAPSHOT) { synchronized (clusterViewLock) { clusterViewSnapshot = memberListSnapshot.get(); if (clusterViewSnapshot == EMPTY_SNAPSHOT) { applyInitialState(memberListVersion, memberInfos); initialListFetchedLatch.countDown(); return; } } } List<MembershipEvent> events = emptyList(); if (memberListVersion >= clusterViewSnapshot.version) { synchronized (clusterViewLock) { clusterViewSnapshot = memberListSnapshot.get(); if (memberListVersion >= clusterViewSnapshot.version) { Collection<Member> prevMembers = clusterViewSnapshot.members.values(); MemberListSnapshot snapshot = createSnapshot(memberListVersion, memberInfos); memberListSnapshot.set(snapshot); Set<Member> currentMembers = toUnmodifiableHasSet(snapshot.members.values()); events = detectMembershipEvents(prevMembers, currentMembers); } } } fireEvents(events); }
Source:
public void changeDifferentFieldOneAfterAnother() { Realm realm = looperThread.realm; AllTypes allTypes = realm.where(AllTypes.class).findFirst(); final AtomicBoolean stringChanged = new AtomicBoolean(false); final AtomicBoolean longChanged = new AtomicBoolean(false); final AtomicBoolean floatChanged = new AtomicBoolean(false); allTypes.addChangeListener(new RealmObjectChangeListener<RealmModel>() { @Override public void onChange(RealmModel object, ObjectChangeSet changeSet) { assertEquals(1, changeSet.getChangedFields().length); if (changeSet.isFieldChanged(AllTypes.FIELD_STRING)) { assertFalse(stringChanged.get()); stringChanged.set(true); } else if (changeSet.isFieldChanged(AllTypes.FIELD_LONG)) { assertFalse(longChanged.get()); longChanged.set(true); } else if (changeSet.isFieldChanged(AllTypes.FIELD_FLOAT)) { assertFalse(floatChanged.get()); floatChanged.set(true); looperThread.testComplete(); } else { fail(); } } }); realm.beginTransaction(); allTypes.setColumnString("42"); realm.commitTransaction(); realm.beginTransaction(); allTypes.setColumnLong(42); realm.commitTransaction(); realm.beginTransaction(); allTypes.setColumnFloat(42.0f); realm.commitTransaction(); }

Target:
public void changeDifferentFieldOneAfterAnother() { Realm realm = looperThread.realm; AllTypes allTypes = realm.where(AllTypes.class).findFirst(); final AtomicBoolean stringChanged = new AtomicBoolean(false); final AtomicBoolean longChanged = new AtomicBoolean(false); final AtomicBoolean floatChanged = new AtomicBoolean(false); allTypes.addChangeListener(new RealmObjectChangeListener<RealmModel>() { @Override public void onChange(RealmModel object, ObjectChangeSet changeSet) { assertEquals(1, changeSet.getChangedFields().length); if (changeSet.isFieldChanged(AllTypes.FIELD_STRING)) { assertFalse(stringChanged.get()); stringChanged.set(true); } else if (changeSet.isFieldChanged(AllTypes.FIELD_LONG)) { assertFalse(longChanged.get()); longChanged.set(true); } else if (changeSet.isFieldChanged(AllTypes.FIELD_FLOAT)) { assertTrue(stringChanged.get()); assertTrue(longChanged.get()); assertFalse(floatChanged.get()); floatChanged.set(true); looperThread.testComplete(); } else { fail(); } } }); realm.beginTransaction(); allTypes.setColumnString("42"); realm.commitTransaction(); realm.beginTransaction(); allTypes.setColumnLong(42); realm.commitTransaction(); realm.beginTransaction(); allTypes.setColumnFloat(42.0f); realm.commitTransaction(); }
Source:
public void writeExternal(PofWriter pofWriter) throws IOException { pofWriter.writeInt(0, index); pofWriter.writeObject(1, asc); }

Target:
public void writeExternal(PofWriter pofWriter) throws IOException { pofWriter.writeInt(0, index); pofWriter.writeBoolean(1, asc); }
Source:
public void populateDAG(DAG dag, Configuration conf) { HDFSFileSplitter fileSplitter = dag.addOperator("FileSplitter", new HDFSFileSplitter()); if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } fileSplitter.setSequencialFileRead(sequencialFileRead); Scanner fileScanner = (Scanner)fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } if (bandwidth != 0) { fileSplitter.getBandwidthManager().setBandwidth(bandwidth); } HDFSBlockReader blockReader = dag.addOperator("BlockReader", new HDFSBlockReader()); blockReader.setUri(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<HDFSBlockReader>( readersCount)); } MetricsAggregator blockReaderMetrics = new MetricsAggregator(); blockReaderMetrics.addAggregators("bytesReadPerSec", new SingleMetricAggregator[] { new LongSumAggregator() }); dag.setAttribute(blockReader, Context.OperatorContext.METRICS_AGGREGATOR, blockReaderMetrics); dag.setAttribute(blockReader, Context.OperatorContext.COUNTERS_AGGREGATOR, new BasicCounters.LongAggregator<MutableLong>()); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); }

Target:
public void populateDAG(DAG dag, Configuration conf) { HDFSFileSplitter fileSplitter = dag.addOperator("FileSplitter", new HDFSFileSplitter()); HDFSBlockReader blockReader = dag.addOperator("BlockReader", new HDFSBlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } fileSplitter.setSequencialFileRead(sequencialFileRead); Scanner fileScanner = (Scanner)fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } if (bandwidth != 0) { fileSplitter.getBandwidthManager().setBandwidth(bandwidth); } blockReader.setUri(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<HDFSBlockReader>( readersCount)); } MetricsAggregator blockReaderMetrics = new MetricsAggregator(); blockReaderMetrics.addAggregators("bytesReadPerSec", new SingleMetricAggregator[] {new LongSumAggregator() }); dag.setAttribute(blockReader, Context.OperatorContext.METRICS_AGGREGATOR, blockReaderMetrics); dag.setAttribute(blockReader, Context.OperatorContext.COUNTERS_AGGREGATOR, new BasicCounters.LongAggregator<MutableLong>()); }
Source:
public static void run( Map<String, Object> params, OutputStream out ) throws Exception { CallParameters parameters = new CallParameters(); for ( String key : params.keySet() ) { String value = params.get( key ).toString(); parameters.put( key, value ); } IPluginCall pluginCall = getPluginCall(); String response = pluginCall != null ? pluginCall.call( parameters.getParameters() ) : "No valid InterPluginCall available"; PluginIOUtils.writeOutAndFlush( out, response ); }

Target:
public static void run( Map<String, Object> params, OutputStream out ) throws Exception { IPluginCall cdeRenderer = getCdeRenderer(); if ( cdeRenderer == null ) { logger.error( "No InterPluginCall found for CDE Renderer." ); return; } CallParameters parameters = new CallParameters(); for ( String key : params.keySet() ) { String value = params.get( key ).toString(); parameters.put( key, value ); } String response = cdeRenderer.call( parameters.getParameters() ); PluginIOUtils.writeOutAndFlush( out, response ); }
Source:
public Tuple2<List<T>, List<T>> splitAt(Predicate<? super T> predicate) { Tuple2<List<T>, List<T>> t = splitByPredicateFirstRound(this, predicate); return Tuple.of(t._1.reverse(), t._2); }

Target:
public Tuple2<List<T>, List<T>> splitAt(Predicate<? super T> predicate) { final Tuple2<List<T>, List<T>> t = splitByPredicateReversed(this, predicate); if (t._2.isEmpty()) { return Tuple.of(this, empty()); } else { return Tuple.of(t._1.reverse(), t._2); } }
Source:
public DockerCheApiInternalEnvVarProvider( @Named("che.infra.docker.master_api_endpoint") String apiEndpoint) { String apiEndpointEnvVar = System.getenv(CHE_API_INTERNAL_VARIABLE); if (Strings.isNullOrEmpty(apiEndpoint) && !Strings.isNullOrEmpty(apiEndpointEnvVar)) { apiEndpoint = apiEndpointEnvVar; } apiEnvVar = Pair.of(CHE_API_INTERNAL_VARIABLE, apiEndpoint); }

Target:
public DockerCheApiInternalEnvVarProvider( @Named("che.infra.docker.master_api_endpoint") String apiEndpoint) { String apiEndpointEnvVar = System.getenv(CHE_API_VARIABLE); if (Strings.isNullOrEmpty(apiEndpoint) && !Strings.isNullOrEmpty(apiEndpointEnvVar)) { apiEndpoint = apiEndpointEnvVar; } apiEnvVar = Pair.of(CHE_API_INTERNAL_VARIABLE, apiEndpoint); }
Source:
private ScanResult getScanResultFromInputStream(InvocationOnMock invocation) { InputStream scannedInputStream = invocation.getArgument(0); String scannedContents; try { scannedContents = IOUtils.toString(scannedInputStream); } catch (IOException e) { throw new RuntimeException(e); } ScanResult result = Mockito.mock(ScanResult.class); if (StringUtils.equals(scannedContents, GOOD_FILE_CONTENTS)) { Mockito.when(result.getStatus()).thenReturn(ScanResult.Status.PASSED); } else { Mockito.when(result.getStatus()).thenReturn(ScanResult.Status.FAILED); } return result; }

Target:
private ScanResult getScanResultFromInputStream(InvocationOnMock invocation) { InputStream scannedInputStream = invocation.getArgument(0); String scannedContents; try { scannedContents = IOUtils.toString(scannedInputStream); } catch (IOException e) { throw new RuntimeException(e); } ScanResult result = Mockito.mock(ScanResult.class); if (StringUtils.equals(scannedContents, GOOD_FILE_CONTENTS)) { Mockito.when(result.getStatus()).thenReturn(ScanResult.Status.PASSED); } else if (StringUtils.equals(scannedContents, VIRUS_FILE_CONTENTS)) { Mockito.when(result.getStatus()).thenReturn(ScanResult.Status.FAILED); } else { Mockito.when(result.getStatus()).thenReturn(ScanResult.Status.ERROR); } return result; }
Source:
public List<Suggestion> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { SolrQuery solrQuery = new SolrQuery(); solrQuery.setRequestHandler("/suggest"); solrQuery.setParam(SUGGEST_Q, ClientUtils.escapeQueryChars(queryString)); solrQuery.setParam(SUGGEST_DICT, SUGGEST_PLACE_KEY); solrQuery.setParam("suggest.count", Integer.toString(Math.min(maxResults, MAX_RESULTS))); QueryResponse response; try { response = client.query(solrQuery); } catch (SolrServerException | IOException e) { LOGGER.debug("Something went wrong when querying", e); throw new GeoEntryQueryException("Error while querying", e); } return Optional.ofNullable(response) .map(QueryResponse::getSuggesterResponse) .map(SuggesterResponse::getSuggestions) .map(suggestionsPerDict -> suggestionsPerDict.get(SUGGEST_PLACE_KEY)) .orElse(Collections.emptyList()) .stream() .map(suggestion -> new SuggestionImpl(suggestion.getPayload(), suggestion.getTerm())) .collect(Collectors.toList()); }

Target:
public List<Suggestion> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { SolrQuery solrQuery = new SolrQuery(); solrQuery.setRequestHandler(GAZETTEER_REQUEST_HANDLER); solrQuery.setParam(SUGGEST_Q_KEY, ClientUtils.escapeQueryChars(queryString)); solrQuery.setParam(SUGGEST_DICT_KEY, SUGGEST_DICT); solrQuery.setParam(SUGGEST_COUNT_KEY, Integer.toString(Math.min(maxResults, MAX_RESULTS))); QueryResponse response; try { response = client.query(solrQuery); } catch (SolrServerException | IOException e) { throw new GeoEntryQueryException("Error while querying", e); } return Optional.ofNullable(response) .map(QueryResponse::getSuggesterResponse) .map(SuggesterResponse::getSuggestions) .map(suggestionsPerDict -> suggestionsPerDict.get(SUGGEST_DICT)) .orElse(Collections.emptyList()) .stream() .map(suggestion -> new SuggestionImpl(suggestion.getPayload(), suggestion.getTerm())) .collect(Collectors.toList()); }
Source:
private static boolean isRequiredInterfaceDown(Map<String, Network> networksByName, List<VdsNetworkInterface> interfaces, VdsNetworkInterface iface) { if (iface.getNetworkName() != null && !isBaseInterfaceUp(iface, interfaces) && networksByName.containsKey(iface.getNetworkName())) { Network net = networksByName.get(iface.getNetworkName()); if (net.getCluster().getStatus() == NetworkStatus.OPERATIONAL && net.getCluster().isRequired()) { return true; } } return false; }

Target:
private static boolean isRequiredInterfaceDown(Map<String, Network> networksByName, List<VdsNetworkInterface> interfaces, VdsNetworkInterface iface) { if (iface.getNetworkName() != null && isBaseInterfaceDown(iface, interfaces)) { Network net = networksByName.get(iface.getNetworkName()); if (net != null && net.getCluster().getStatus() == NetworkStatus.OPERATIONAL && net.getCluster().isRequired()) { return true; } } return false; }
Source:
public void checkNavigateToFileFunctionWithFilesFromHiddenFolders() { projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand( TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY); askDialog.acceptDialogWithText( "Do you want to initialize the local repository " + PROJECT_NAME + "?"); loader.waitOnClosed(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.NAVIGATE_TO_FILE); navigateToFile.waitFormToOpen(); loader.waitOnClosed(); navigateToFile.typeSymbolInFileNameField("H"); loader.waitOnClosed(); navigateToFile.waitFileNamePopUp(); Assert.assertFalse(navigateToFile.waitListOfFilesNames(FILE_H_SYMBOL)); navigateToFile.closeNavigateToFileForm(); navigateToFile.waitFormToClose(); }

Target:
public void checkNavigateToFileFunctionWithFilesFromHiddenFolders() { projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.selectItem(PROJECT_NAME); menu.runCommand( TestMenuCommandsConstants.Git.GIT, TestMenuCommandsConstants.Git.INITIALIZE_REPOSITORY); askDialog.acceptDialogWithText( "Do you want to initialize the local repository " + PROJECT_NAME + "?"); loader.waitOnClosed(); git.waitGitStatusBarWithMess(TestGitConstants.GIT_INITIALIZED_SUCCESS); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.NAVIGATE_TO_FILE); navigateToFile.waitFormToOpen(); navigateToFile.typeSymbolInFileNameField("H"); loader.waitOnClosed(); navigateToFile.waitFileNamePopUp(); assertFalse(navigateToFile.isFilenameSuggested("HEAD (/NavigateFile/.git)")); navigateToFile.closeNavigateToFileForm(); navigateToFile.waitFormToClose(); }
Source:
protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception { cancel(false); teleportee.setLastLocation(); Location loc = target.getLocation(); UserTeleportEvent event = new UserTeleportEvent(teleportee, cause); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } if (LocationUtil.isBlockUnsafeForUser(teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) { if (ess.getSettings().isTeleportSafetyEnabled()) { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { PaperLib.teleportAsync(teleportee.getBase(), LocationUtil.getSafeDestination(ess, teleportee, loc), cause); } } else { throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } else { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { if (ess.getSettings().isTeleportToCenterLocation()) { loc = LocationUtil.getRoundedDestination(loc); } PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } } }

Target:
protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception { cancel(false); Location loc = target.getLocation(); UserTeleportEvent event = new UserTeleportEvent(teleportee, cause, loc); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } teleportee.setLastLocation(); if (LocationUtil.isBlockUnsafeForUser(teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) { if (ess.getSettings().isTeleportSafetyEnabled()) { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { PaperLib.teleportAsync(teleportee.getBase(), LocationUtil.getSafeDestination(ess, teleportee, loc), cause); } } else { throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } else { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { if (ess.getSettings().isTeleportToCenterLocation()) { loc = LocationUtil.getRoundedDestination(loc); } PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } } }
Source:
private void setPropertiesFromModel(PomInformation pomInformation, Model model) { Properties propertiesFromModel = model.getProperties(); if (model.getVersion() != null) { propertiesFromModel.put("project.version", model.getVersion()); } pomInformation.setProperties(propertiesFromModel); }

Target:
private void setPropertiesFromModel(PomInformation pomInformation, Model model) { Properties propertiesFromModel = model.getProperties(); if (model.getVersion() != null) { propertiesFromModel.put("project.version", model.getVersion()); } if (model.getArtifactId() != null) { propertiesFromModel.put("project.artifactId", model.getArtifactId()); } if (model.getGroupId() != null) { propertiesFromModel.put("project.groupId", model.getGroupId()); } pomInformation.setProperties(propertiesFromModel); }
Source:
protected void setupLabel(TextView label) { switch (mLoginListener.getLoginMode()) { case WPCOM_LOGIN_DEEPLINK: label.setText(R.string.login_log_in_for_deeplink); break; case FULL: label.setText(R.string.enter_email_wordpress_com); break; case JETPACK_STATS: label.setText(R.string.stats_sign_in_jetpack_different_com_account); break; case WPCOM_REAUTHENTICATE: label.setText(R.string.auth_required); break; } if (mLoginListener.getLoginMode() == LoginMode.JETPACK_STATS) { label.setText(R.string.stats_sign_in_jetpack_different_com_account); } else if (mLoginListener.getLoginMode() == LoginMode.JETPACK_STATS) { } else { label.setText(R.string.enter_email_wordpress_com); } }

Target:
protected void setupLabel(TextView label) { switch (mLoginListener.getLoginMode()) { case WPCOM_LOGIN_DEEPLINK: label.setText(R.string.login_log_in_for_deeplink); break; case FULL: label.setText(R.string.enter_email_wordpress_com); break; case JETPACK_STATS: label.setText(R.string.stats_sign_in_jetpack_different_com_account); break; case WPCOM_REAUTHENTICATE: label.setText(R.string.auth_required); break; } }
Source:
public void itCanCreateTokens() throws Exception { MultivaluedMap<String, String> params = new MultivaluedMapImpl(); params.put("application", Collections.singletonList("app")); params.put("deviceId", Collections.singletonList("device")); params.put("permission", Collections.singletonList("rw")); ClientResponse response = getResponse(RequestType.POST, "/token", null, params, null, null); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); String tokenId = response.getEntity(String.class); assertFalse(tokenId.isEmpty()); List<JsonNode> tokens = getTokens(); assertEquals(1, tokens.size()); JsonNode token = tokens.get(0); assertEquals("app", token.get("application").getTextValue()); assertEquals("device", token.get("deviceId").getTextValue()); assertEquals("rw", token.get("permission").getTextValue()); assertFalse(token.get("creationDate").getTextValue().isEmpty()); assertFalse(token.get("username").getTextValue().isEmpty()); response = getResponse(RequestType.POST, "/token"); assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus()); }

Target:
public void itCanCreateTokens() throws Exception { MultivaluedMap<String, String> params = new MultivaluedMapImpl(); params.put("application", Collections.singletonList("app")); params.put("deviceId", Collections.singletonList("device")); params.put("permission", Collections.singletonList("rw")); ClientResponse response = getResponse(RequestType.POST, "/token", null, params, null, null); assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); String tokenId = response.getEntity(String.class); assertFalse(tokenId.isEmpty()); List<JsonNode> tokens = getTokens(); assertEquals(1, tokens.size()); JsonNode token = tokens.get(0); assertEquals("app", token.get("application").getTextValue()); assertEquals("device", token.get("deviceId").getTextValue()); assertEquals("rw", token.get("permission").getTextValue()); assertFalse(token.get("creationDate").getTextValue().isEmpty()); assertFalse(token.get("username").getTextValue().isEmpty()); }
Source:
private void removeProjectedGeometryGraphic() { if ((mMapView.getGraphicsOverlays().size() > 0) && (projectedGraphic != null)) { if (mMapView.getGraphicsOverlays().get(0).getGraphics().size() == 2) { mMapView.getGraphicsOverlays().get(0).getGraphics().remove(projectedGraphic); projectedGraphic = null; } } return; }

Target:
private void removeProjectedGeometryGraphic() { if ((mMapView.getGraphicsOverlays().size() > 0) && (mProjectedGraphic != null)) { if (mMapView.getGraphicsOverlays().get(0).getGraphics().size() == 2) { mMapView.getGraphicsOverlays().get(0).getGraphics().remove(mProjectedGraphic); mProjectedGraphic = null; } } }
Source:
public void locksShouldBeReapedAndLeaseShouldBeInvalidatedAfterReapPeriod() { AsyncResult<HeldLocks> result = new AsyncResult<>(); AsyncResult<Leased<LockToken>> asyncResult = heldLocksCollection.getExistingOrAcquire(REQUEST_ID, () -> result); result.complete(heldLocksForId(REQUEST_ID)); Lease lease = asyncResult.get().lease(); setTimeStatic(clock.get().plus(LockLeaseContract.SERVER_LEASE_TIMEOUT).plus(Duration.ofNanos(1))); assertThat(lease.isValid(leaderClock.time())).isFalse(); assertUnlocked(REQUEST_ID); }

Target:
public void locksShouldBeReapedAndLeaseShouldBeInvalidatedAfterReapPeriod() { setTime(123); AsyncResult<HeldLocks> result = new AsyncResult<>(); AsyncResult<Leased<LockToken>> asyncResult = heldLocksCollection.getExistingOrAcquire(REQUEST_ID, () -> result); result.complete(heldLocksForId(REQUEST_ID)); Lease lease = asyncResult.get().lease(); advance(LockLeaseContract.SERVER_LEASE_TIMEOUT.plus(Duration.ofNanos(1))); assertThat(lease.isValid(leaderClock.time())).isFalse(); assertUnlocked(REQUEST_ID); }
Source:
Node processUnaryExpression(UnaryExpressionTree exprNode) { int type = transformUnaryTokenType(exprNode.operator.type); Node operand = transform(exprNode.operand); if (type == Token.NEG && operand.isNumber()) { operand.setDouble(-operand.getDouble()); return operand; } else { if (type == Token.DELPROP && !(operand.isGetProp() || operand.isGetElem() || operand.isName())) { String msg = "Invalid delete operand. Only properties can be deleted."; errorReporter.error( msg, sourceName, operand.getLineno(), 0); } else if ((type == Token.INC || type == Token.DEC) && !operand.isValidAssignmentTarget()) { String msg = type == Token.INC ? "Invalid prefix increment operand." : "Invalid prefix decrement operand."; errorReporter.error( msg, sourceName, operand.getLineno(), operand.getCharno()); } return newNode(type, operand); } }

Target:
Node processUnaryExpression(UnaryExpressionTree exprNode) { int type = transformUnaryTokenType(exprNode.operator.type); Node operand = transform(exprNode.operand); if (type == Token.NEG && operand.isNumber()) { operand.setDouble(-operand.getDouble()); return operand; } else { if (type == Token.DELPROP && !(operand.isGetProp() || operand.isGetElem() || operand.isName())) { String msg = "Invalid delete operand. Only properties can be deleted."; errorReporter.error( msg, sourceName, operand.getLineno(), 0); } else if (type == Token.INC || type == Token.DEC) { return createIncrDecrNode(type, false, operand); } return newNode(type, operand); } }
Source:
void send(ControlMessage message, SystemStream systemStream, MessageCollector collector) { SystemStreamMetadata metadata = metadataCache.getSystemStreamMetadata(systemStream, true); int partitionCount = metadata.getSystemStreamPartitionMetadata().size(); LOG.info(String.format("Broadcast %s message from task %s to %s with %s partition", MessageType.of(message).name(), message.getTaskName(), systemStream, partitionCount)); for (int i = 0; i < partitionCount; i++) { OutgoingMessageEnvelope envelopeOut = new OutgoingMessageEnvelope(systemStream, i, "", message); collector.send(envelopeOut); } }

Target:
void send(ControlMessage message, SystemStream systemStream, MessageCollector collector) { SystemStreamMetadata metadata = metadataCache.getSystemStreamMetadata(systemStream, true); int partitionCount = metadata.getSystemStreamPartitionMetadata().size(); LOG.info(String.format("Broadcast %s message from task %s to %s with %s partition", MessageType.of(message).name(), message.getTaskName(), systemStream, partitionCount)); for (int i = 0; i < partitionCount; i++) { OutgoingMessageEnvelope envelopeOut = new OutgoingMessageEnvelope(systemStream, i, null, message); collector.send(envelopeOut); } }
Source:
public void setup() throws Exception { getCatalogBundle().setDownloadRetryDelayInSeconds(1); getCatalogBundle().setupCaching(false); urlResourceReaderConfigurator = getUrlResourceReaderConfigurator(); server = new SecureStubServer(Integer.parseInt(RESTITO_STUB_SERVER_PORT.getPort())).run(); server.start(); cswServer.reset(); }

Target:
public void setup() throws Exception { urlResourceReaderConfigurator = getUrlResourceReaderConfigurator(); server = new SecureStubServer(Integer.parseInt(RESTITO_STUB_SERVER_PORT.getPort())).run(); server.start(); cswServer.reset(); }
Source:
public void run() { for (Queue queue : getLocalQueues()) { if (!queue.isInternalQueue() && QueueManagerImpl.isAutoDelete(queue) && QueueManagerImpl.consumerCountCheck(queue) && QueueManagerImpl.delayCheck(queue) && QueueManagerImpl.messageCountCheck(queue) && queueWasUsed(queue)) { QueueManagerImpl.performAutoDeleteQueue(server, queue); } } Set<SimpleString> addresses = addressManager.getAddresses(); for (SimpleString address : addresses) { AddressInfo addressInfo = getAddressInfo(address); AddressSettings settings = addressSettingsRepository.getMatch(address.toString()); try { if (settings.isAutoDeleteAddresses() && addressInfo != null && addressInfo.isAutoCreated() && !isAddressBound(address) && addressInfo.getBindingRemovedTimestamp() != -1 && (System.currentTimeMillis() - addressInfo.getBindingRemovedTimestamp() >= settings.getAutoDeleteAddressesDelay())) { if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) { ActiveMQServerLogger.LOGGER.debug("deleting auto-created address \"" + address + ".\""); } server.removeAddressInfo(address, null); } } catch (ActiveMQAddressDoesNotExistException e) { ActiveMQServerLogger.LOGGER.debug(e.getMessage(), e); } catch (ActiveMQShutdownException e) { ActiveMQServerLogger.LOGGER.debug(e.getMessage(), e); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorRemovingAutoCreatedQueue(e, address); } } }

Target:
public void run() { for (Queue queue : getLocalQueues()) { if (!queue.isInternalQueue() && QueueManagerImpl.isAutoDelete(queue) && QueueManagerImpl.consumerCountCheck(queue) && QueueManagerImpl.delayCheck(queue) && QueueManagerImpl.messageCountCheck(queue) && queueWasUsed(queue)) { QueueManagerImpl.performAutoDeleteQueue(server, queue); } } Set<SimpleString> addresses = addressManager.getAddresses(); for (SimpleString address : addresses) { AddressInfo addressInfo = getAddressInfo(address); AddressSettings settings = addressSettingsRepository.getMatch(address.toString()); try { if (settings.isAutoDeleteAddresses() && addressInfo != null && addressInfo.isAutoCreated() && !isAddressBound(address) && addressInfo.getBindingRemovedTimestamp() != -1 && (System.currentTimeMillis() - addressInfo.getBindingRemovedTimestamp() >= settings.getAutoDeleteAddressesDelay())) { if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) { ActiveMQServerLogger.LOGGER.debug("deleting auto-created address \"" + address + ".\""); } server.removeAddressInfo(address, null); } } catch (ActiveMQShutdownException e) { logger.debug(e.getMessage(), e); } catch (Exception e) { if (e instanceof ActiveMQAddressDoesNotExistException && getAddressInfo(address) == null) { logger.debug(e.getMessage(), e); } else { ActiveMQServerLogger.LOGGER.errorRemovingAutoCreatedQueue(e, address); } } } }
Source:
public int hashCode() { if (hash != null) return hash; int h = 0; h = computeHash(h, family); h = computeHash(h, qualifier); hash = h; return h; }

Target:
public int hashCode() { if (hash != null) return hash; final int prime = 31; int h = 1; h = prime * h + Arrays.hashCode(family); h = prime * h + Arrays.hashCode(qualifier); hash = h; return h; }
Source:
public static void calculateKAnonymity() throws Exception { String projectId = "your-project-id"; String datasetId = "your-bigquery-dataset-id"; String tableId = "your-bigquery-table-id"; String topicId = "pub-sub-topic"; String subscriptionId = "pub-sub-subscription"; List<String> quasiIdColumns = Arrays.asList("name", "age", "zip_code", "..."); calculateKAnonymity( projectId, datasetId, tableId, topicId, subscriptionId, quasiIdColumns); }

Target:
public static void calculateKAnonymity() throws Exception { String projectId = "your-project-id"; String datasetId = "your-bigquery-dataset-id"; String tableId = "your-bigquery-table-id"; String topicId = "pub-sub-topic"; String subscriptionId = "pub-sub-subscription"; calculateKAnonymity(projectId, datasetId, tableId, topicId, subscriptionId); }
Source:
public void openInTerminalTestByHotKey() { seleniumWebDriver.navigate().refresh(); projectExplorer.waitProjectExplorer(); projectExplorer.waitAndSelectItem(PROJECT_NAME); seleniumWebDriverHelper.sendKeys(Keys.chord(ALT, SHIFT, F12)); terminal.waitNumberTerminalTab(2); String terminalWorkDir = terminal.getVisibleTextFromTerminal(); Assert.assertTrue(terminalWorkDir.trim().endsWith(PROJECT_NAME + "$")); }

Target:
public void openInTerminalTestByHotKey() { seleniumWebDriver.navigate().refresh(); projectExplorer.waitProjectExplorer(); projectExplorer.waitAndSelectItem(PROJECT_NAME); seleniumWebDriverHelper.sendKeys(Keys.chord(ALT, SHIFT, F12)); terminal.waitNumberTerminalTab(2); terminal.waitExpectedTextIntoTerminal(PROJECT_NAME + "$"); }
Source:
public void shouldGetSvgFromTextAsStream() { ByteArrayOutputStream outs = new ByteArrayOutputStream(); QRCode.from("www.example.org").svg(outs); byte[] data = outs.toByteArray(); assertThat(data).isNotEmpty(); assertThat(data.length).isGreaterThan(0); assertThat(data).startsWith("<?xml".getBytes()); }

Target:
public void shouldGetSvgFromTextAsStream() { ByteArrayOutputStream outs = new ByteArrayOutputStream(); QRCode.from("www.example.org").svg(outs); byte[] data = outs.toByteArray(); assertThat(data).isNotEmpty(); assertThat(data).startsWith("<?xml".getBytes()); assertThat(data).endsWith("</svg\n>\n".getBytes()); }
Source:
public @ResponseBody void setMessageAsViewed(HttpSession session, @RequestParam(value = "messageId") int messageId) { if (session.getAttribute("member") == null) return; MessageDao messageDao = new MessageDao(); Message message = messageDao.getMessageById(messageId); message.setViewed(true); messageDao.save(message); MemberDao memberDao = new MemberDao(); Member member = (Member) session.getAttribute("member"); session.setAttribute("message", null); session.setAttribute("member", memberDao.getMemberById(member.getId())); }

Target:
public @ResponseBody void setMessageAsViewed( HttpSession session, @RequestParam(value = "messageId") int messageId) { if (session.getAttribute("member") == null) return; MessageDao messageDao = new MessageDao(); Message message = messageDao.getById(messageId); message.setViewed(true); messageDao.merge(message); MemberDao memberDao = new MemberDao(); Member member = (Member) session.getAttribute("member"); session.setAttribute("message", null); session.setAttribute("member", memberDao.getMemberById(member.getId())); }
Source:
public void disconnect(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].disconnect(); if (null != clientsV3) { clientsV3[i].disconnect(); } } }

Target:
public void disconnect(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].disconnect(); if (clients != clientsV3Enforced) { clientsV3Enforced[i].disconnect(); } } }
Source:
public void testCustomAttributes() { Collection<String> attributes = fixture.listCustomAttributes(); assertEquals(0, attributes.size()); String attrib = fixture.getCustomAttribute("bozo"); assertNull(attrib); }

Target:
public void testCustomAttributes() { Set<String> attributes = fixture.listCustomAttributes(); assertEquals(0, attributes.size()); String attrib = fixture.getCustomAttribute("bozo"); assertNull(attrib); }
Source:
public static synchronized Configuration GetConfiguration(Map storm_conf) { Configuration.setConfiguration(null); String orig_loginConfigurationFile = System.getProperty("java.security.auth.login.config"); String loginConfigurationFile = (String)storm_conf.get("java.security.auth.login.config"); if (loginConfigurationFile==null) loginConfigurationFile = orig_loginConfigurationFile; Configuration login_conf = null; if ((loginConfigurationFile != null) && (loginConfigurationFile.length()>0)) { System.setProperty("java.security.auth.login.config", loginConfigurationFile); login_conf = Configuration.getConfiguration(); if (orig_loginConfigurationFile!=null) System.setProperty("java.security.auth.login.config", orig_loginConfigurationFile); } return login_conf; }

Target:
public static Configuration GetConfiguration(Map storm_conf) { Configuration login_conf = null; String loginConfigurationFile = (String)storm_conf.get("java.security.auth.login.config"); if ((loginConfigurationFile != null) && (loginConfigurationFile.length()>0)) { try { URI config_uri = new File(loginConfigurationFile).toURI(); login_conf = Configuration.getInstance("JavaLoginConfig", new URIParameter(config_uri)); } catch (NoSuchAlgorithmException ex1) { if (ex1.getCause() instanceof FileNotFoundException) throw new RuntimeException("configuration file "+loginConfigurationFile+" could not be found"); else throw new RuntimeException(ex1); } catch (Exception ex2) { throw new RuntimeException(ex2); } } return login_conf; }
Source:
public static Block stGeometries(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); if (geometry.isEmpty()) { return null; } BlockBuilder blockBuilder; GeometryType type = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (!type.isMultitype()) { blockBuilder = GEOMETRY.createBlockBuilder(null, 1); GEOMETRY.writeSlice(blockBuilder, serialize(geometry)); return blockBuilder.build(); } OGCGeometryCollection collection = (OGCGeometryCollection) geometry; blockBuilder = GEOMETRY.createBlockBuilder(null, collection.numGeometries()); for (int i = 0; i < collection.numGeometries(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(collection.geometryN(i))); } return blockBuilder.build(); }

Target:
public static Block stGeometries(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); if (geometry.isEmpty()) { return null; } GeometryType type = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (!type.isMultitype()) { BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, 1); GEOMETRY.writeSlice(blockBuilder, serialize(geometry)); return blockBuilder.build(); } OGCGeometryCollection collection = (OGCGeometryCollection) geometry; BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, collection.numGeometries()); for (int i = 0; i < collection.numGeometries(); i++) { GEOMETRY.writeSlice(blockBuilder, serialize(collection.geometryN(i))); } return blockBuilder.build(); }
Source:
private Optional<Edge> getConstructorEdge(Node pNode) { assert pNode != null && isInConstructorCall(pNode); for(Edge edge : aDiagram.edges()) { if ( pNode.getClass() == CallNode.class && edge.getEnd() == pNode && edge.getClass() == ConstructorEdge.class ) { return Optional.of(edge); } } return Optional.empty(); }

Target:
private Optional<Edge> getConstructorEdge(Node pNode) { assert pNode != null && isConstructorExecution(pNode); if( pNode.getClass() == CallNode.class ) { return Optional.empty(); } for(Edge edge : aDiagram.edges()) { if ( edge.getEnd() == pNode && edge.getClass() == ConstructorEdge.class ) { return Optional.of(edge); } } return Optional.empty(); }
Source:
public boolean isProfileAuthorized(final WebContext context, final U profile) throws RequiresHttpAction { if (profile != null && !(profile instanceof AnonymousProfile)) { return true; } else { if (this.redirectionUrl != null) { throw RequiresHttpAction.redirect("user should be authenticated", context, this.redirectionUrl); } else { return false; } } }

Target:
public boolean isProfileAuthorized(final WebContext context, final U profile) throws RequiresHttpAction { return profile != null && !(profile instanceof AnonymousProfile); }
Source:
public void tearDown(final ManagementClient managementClient, final String containerId) { try { applyUpdate(managementClient.getControllerClient(), Util.getUndefineAttributeOperation(remotingConnectorAddress, "sasl-authentication-factory"), false); } catch (Exception e) { throw new RuntimeException(e); } applyRemoveAllowReload(managementClient.getControllerClient(), ejbDomainAddress, false); try { ServerReload.reloadIfRequired(managementClient); } catch (Exception e) { throw new RuntimeException(e); } applyRemoveAllowReload(managementClient.getControllerClient(), saslAuthenticationAddress, false); }

Target:
public void tearDown(final ManagementClient managementClient, final String containerId) { try { ModelNode restoreSaslOperation; if (saslAuthenticationFactoryValue != null) { restoreSaslOperation = Util.getWriteAttributeOperation(remotingConnectorAddress, "sasl-authentication-factory", saslAuthenticationFactoryValue); } else { restoreSaslOperation = Util.getUndefineAttributeOperation(remotingConnectorAddress, "sasl-authentication-factory"); } applyUpdate(managementClient.getControllerClient(), restoreSaslOperation, false); } catch (Exception e) { throw new RuntimeException(e); } applyRemoveAllowReload(managementClient.getControllerClient(), ejbDomainAddress, false); try { ServerReload.reloadIfRequired(managementClient); } catch (Exception e) { throw new RuntimeException(e); } applyRemoveAllowReload(managementClient.getControllerClient(), saslAuthenticationAddress, false); }
Source:
public void setUp() throws Exception { createProjectWithNfcAndSetVariable(PROJECT_NAME); numDetectedTags.setValue(0); nfcBrickPosition = 0; setVariableIDPosition = 1; setVariableMessagePosition = 2; baseActivityTestRule.launchActivity(null); checkIfSpinnerOnBrickAtPositionShowsString(R.id.set_variable_spinner, setVariableIDPosition, READ_TAG_ID); checkIfSpinnerOnBrickAtPositionShowsString(R.id.set_variable_spinner, setVariableMessagePosition, READ_TAG_MESSAGE); }

Target:
public void setUp() throws Exception { createProjectWithNfcAndSetVariable(); baseActivityTestRule.launchActivity(null); }
Source:
void handleActionResult(final VdcActionType actionType, final VdcActionParametersBase parameters, final VdcReturnValueBase result, final IFrontendActionAsyncCallback callback, final Object state, final boolean showErrorDialog) { logger.log(Level.FINER, "Retrieved action result from RunAction."); FrontendActionAsyncResult f = new FrontendActionAsyncResult(actionType, parameters, result, state); boolean failedOnCanDoAction = !result.getCanDoAction(); if (failedOnCanDoAction) { result.setCanDoActionMessages((ArrayList<String>) translateError(result)); } else if (showErrorDialog && result.getIsSyncronious() && !result.getSucceeded()) { runActionExecutionFailed(actionType, result.getFault()); } callback.executed(f); if (failedOnCanDoAction && (getEventsHandler() != null) && (getEventsHandler().isRaiseErrorModalPanel(actionType, result.getFault()))) { if (result.getCanDoActionMessages().isEmpty()) { failureEventHandler(result.getDescription(), "No Message"); } else { failureEventHandler(result.getDescription(), result.getCanDoActionMessages()); } } }

Target:
void handleActionResult(final VdcActionType actionType, final VdcActionParametersBase parameters, final VdcReturnValueBase result, final IFrontendActionAsyncCallback callback, final Object state, final boolean showErrorDialog) { logger.log(Level.FINER, "Retrieved action result from RunAction."); FrontendActionAsyncResult f = new FrontendActionAsyncResult(actionType, parameters, result, state); boolean failedOnCanDoAction = !result.getCanDoAction(); if (failedOnCanDoAction) { result.setCanDoActionMessages((ArrayList<String>) translateError(result)); } else if (showErrorDialog && result.getIsSyncronious() && !result.getSucceeded()) { runActionExecutionFailed(actionType, result.getFault()); } callback.executed(f); if (failedOnCanDoAction && (getEventsHandler() != null) && (getEventsHandler().isRaiseErrorModalPanel(actionType, result.getFault()))) { ArrayList<String> messages = result.getCanDoActionMessages(); failureEventHandler(result.getDescription(), messages.isEmpty() ? Collections.singletonList(getConstants().noCanDoActionMessage()) : messages); } }