auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static GHRepository lookUpRepo(GitHub github, @NonNull Job<?,?> job) throws IOException { if (github == null) { return null; } SCMSource src = SCMSource.SourceByItem.findSource(job); if (src instanceof GitHubSCMSource) { GitHubSCMSource source = (GitHubSCMSource) src; if (source.getScanCredentialsId() != null) { return github.getRepository(GitHubSCMSourceHelper.build(source).repo); } } return null; }

Target:
private static GHRepository lookUpRepo(GitHub github, @NonNull Job<?,?> job) throws IOException { if (github == null) { return null; } SCMSource src = SCMSource.SourceByItem.findSource(job); if (src instanceof GitHubSCMSource) { GitHubSCMSource source = (GitHubSCMSource) src; if (source.getScanCredentialsId() != null) { return github.getRepository(source.getRepoOwner() + "/" + source.getRepository()); } } return null; }
Source:
public Optional<Integer> setMilestone(String repoId, int issueId, String issueTitle, Optional<Integer> issueMilestone) throws IOException { Issue createdIssue = new Issue(); createdIssue.setNumber(issueId); createdIssue.setTitle(issueTitle); Milestone gitHubMilestone = new Milestone(); if (issueMilestone.isPresent()) { gitHubMilestone.setNumber(issueMilestone.get()); } createdIssue.setMilestone(gitHubMilestone); Issue returnedIssue = issueService.editIssue(RepositoryId.createFromId(repoId), createdIssue); if (returnedIssue.getMilestone() == null) { return Optional.empty(); } return Optional.of(returnedIssue.getMilestone().getNumber()); }

Target:
public Optional<Integer> setMilestone(String repoId, int issueId, String issueTitle, Optional<Integer> issueMilestone) throws IOException { Issue createdIssue = new Issue(); createdIssue.setNumber(issueId); createdIssue.setTitle(issueTitle); Milestone gitHubMilestone = new Milestone(); issueMilestone.ifPresent(gitHubMilestone::setNumber); createdIssue.setMilestone(gitHubMilestone); Issue returnedIssue = issueService.editIssue(RepositoryId.createFromId(repoId), createdIssue); return Optional.ofNullable(returnedIssue.getMilestone()) .map(Milestone::getNumber); }
Source:
private void checkTotalSizeOfBroadcastableRelations(Context context, ExecutionBlock block) { List<ScanNode> broadcastCandidates = new ArrayList<>(); broadcastCandidates.addAll(block.getBroadcastRelations()); Collections.sort(broadcastCandidates, relSizeComparator); long totalBroadcastVolume = 0; long largeThreshold = context.thresholdForCrossJoin > context.thresholdForNonCrossJoin ? context.thresholdForCrossJoin : context.thresholdForNonCrossJoin; int i; for (i = 0; i < broadcastCandidates.size(); i++) { long volumeOfCandidate = GlobalPlanRewriteUtil.getTableVolume(broadcastCandidates.get(i)); if (totalBroadcastVolume + volumeOfCandidate > largeThreshold) { break; } totalBroadcastVolume += volumeOfCandidate; } for (; i < broadcastCandidates.size(); ) { ScanNode nonBroadcast = broadcastCandidates.remove(i); block.removeBroadcastRelation(nonBroadcast); } }

Target:
private void checkTotalSizeOfBroadcastableRelations(Context context, ExecutionBlock block) { List<ScanNode> broadcastCandidates = new ArrayList<>(block.getBroadcastRelations()); Collections.sort(broadcastCandidates, relSizeComparator); long totalBroadcastVolume = 0; long largeThreshold = context.thresholdForCrossJoin > context.thresholdForNonCrossJoin ? context.thresholdForCrossJoin : context.thresholdForNonCrossJoin; int i; for (i = 0; i < broadcastCandidates.size(); i++) { long volumeOfCandidate = GlobalPlanRewriteUtil.getTableVolume(broadcastCandidates.get(i)); if (totalBroadcastVolume + volumeOfCandidate > largeThreshold) { break; } totalBroadcastVolume += volumeOfCandidate; } for (; i < broadcastCandidates.size(); ) { ScanNode nonBroadcast = broadcastCandidates.remove(i); block.removeBroadcastRelation(nonBroadcast); } }
Source:
private Set<String> searchOrganizationWithAdminPermission(DbSession dbSession) { return dbClient.organizationDao().selectByPermission(dbSession, userSession.getUserId(), ADMINISTER.getKey()).stream() .map(OrganizationDto::getUuid) .collect(toSet()); }

Target:
private Set<String> searchOrganizationWithAdminPermission(DbSession dbSession) { Integer userId = userSession.getUserId(); return userId == null ? emptySet() : dbClient.organizationDao().selectByPermission(dbSession, userId, ADMINISTER.getKey()).stream().map(OrganizationDto::getUuid).collect(toSet()); }
Source:
private DefaultDockerClient(final Builder builder) { this(builder.uri); }

Target:
private DefaultDockerClient(final Builder builder) { URI originalUri = checkNotNull(builder.uri, "uri"); final ClientConfig config = DEFAULT_CONFIG .connectorProvider(new ApacheConnectorProvider()) .property(ClientProperties.CONNECT_TIMEOUT, (int) builder.connectTimeoutMillis) .property(ClientProperties.READ_TIMEOUT, (int) builder.readTimeoutMillis) .property(ApacheClientProperties.CONNECTION_MANAGER, new PoolingHttpClientConnectionManager(getSchemeRegistry(originalUri))); this.client = ClientBuilder.newClient(config); if (originalUri.getScheme().equals("unix")) { this.uri = UnixConnectionSocketFactory.sanitizeUri(originalUri); } else { this.uri = originalUri; } }
Source:
private static void getProductRequirements(String product, Collection<String> requiredIds) { PDEExtensionRegistry registry = PDECore.getDefault().getExtensionsRegistry(); IExtension[] extensions = registry.findExtensions("org.eclipse.core.runtime.products", true); for (IExtension extension : extensions) { if (product.equals(extension.getUniqueIdentifier()) || product.equals(extension.getSimpleIdentifier())) { requiredIds.add(extension.getNamespaceIdentifier()); IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { String application = element.getAttribute("application"); if (application != null && application.length() > 0) { getApplicationRequirements(application, requiredIds); } } break; } } }

Target:
private static void getProductRequirements(String product, Collection<String> requiredIds) { PDEExtensionRegistry registry = PDECore.getDefault().getExtensionsRegistry(); IExtension[] extensions = registry.findExtensions("org.eclipse.core.runtime.products", true); for (IExtension extension : extensions) { if (product.equals(extension.getUniqueIdentifier()) || product.equals(extension.getSimpleIdentifier())) { requiredIds.add(extension.getContributor().getName()); IConfigurationElement[] elements = extension.getConfigurationElements(); for (IConfigurationElement element : elements) { String application = element.getAttribute("application"); if (application != null && application.length() > 0) { getApplicationRequirements(application, requiredIds); } } break; } } }
Source:
void updateRestored(final Collection<TopicPartition> restored) { if (restored.isEmpty()) { return; } log.trace("Stream task changelog partitions that have completed restoring so far: {}", restored); restoredPartitions.addAll(restored); for (final Iterator<Map.Entry<TaskId, StreamTask>> it = restoring.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<TaskId, StreamTask> entry = it.next(); final StreamTask task = entry.getValue(); if (restoredPartitions.containsAll(task.changelogPartitions())) { transitionToRunning(task); it.remove(); restoringByPartition.keySet().removeAll(task.partitions()); restoringByPartition.keySet().removeAll(task.changelogPartitions()); log.debug("Stream task completed restoration as all its changelog partitions have been applied to restore state", task.id(), task.changelogPartitions()); } else { if (log.isTraceEnabled()) { final HashSet<TopicPartition> outstandingPartitions = new HashSet<>(task.changelogPartitions()); outstandingPartitions.removeAll(restoredPartitions); log.trace("Stream task cannot resume processing yet since some of its changelog partitions have not completed restoring: {}", task.id(), outstandingPartitions); } } } if (allTasksRunning()) { restoredPartitions.clear(); restoringByPartition.clear(); restoring.clear(); } }

Target:
void updateRestored(final Collection<TopicPartition> restored) { if (restored.isEmpty()) { return; } log.trace("Stream task changelog partitions that have completed restoring so far: {}", restored); restoredPartitions.addAll(restored); for (final Iterator<Map.Entry<TaskId, StreamTask>> it = restoring.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<TaskId, StreamTask> entry = it.next(); final StreamTask task = entry.getValue(); if (restoredPartitions.containsAll(task.changelogPartitions())) { transitionToRunning(task); it.remove(); restoringByPartition.keySet().removeAll(task.partitions()); restoringByPartition.keySet().removeAll(task.changelogPartitions()); log.debug("Stream task completed restoration as all its changelog partitions have been applied to restore state", task.id(), task.changelogPartitions()); } else { if (log.isTraceEnabled()) { final HashSet<TopicPartition> outstandingPartitions = new HashSet<>(task.changelogPartitions()); outstandingPartitions.removeAll(restoredPartitions); log.trace("Stream task cannot resume processing yet since some of its changelog partitions have not completed restoring: {}", task.id(), outstandingPartitions); } } } if (allTasksRunning()) { restoredPartitions.clear(); if (!restoringByPartition.isEmpty()) { log.error("Finished restoring all tasks but found leftover partitions in restoringByPartition: {}", restoringByPartition); throw new IllegalStateException("Restoration is complete but not all partitions were cleared."); } } }
Source:
protected void internalReceiveUpdate(String itemName, State newState) { logger.info("Update received ({},{})", itemName, newState); SonanceBindingProvider provider = findFirstMatchingBindingProvider(itemName); String group = provider.getGroup(itemName); String ip = provider.getIP(itemName); int port = provider.getPort(itemName); ip = null; group = null; Socket s = null; try { s = new Socket(ip, port); DataOutputStream outToServer = new DataOutputStream( s.getOutputStream()); BufferedReader i = new BufferedReader(new InputStreamReader( s.getInputStream())); if (provider.isMute(itemName)) if (newState.equals(OnOffType.OFF)) sendMuteCommand(itemName, "FF550207" + group, outToServer, i); else if (newState.equals(OnOffType.ON)) sendMuteCommand(itemName, "FF550208" + group, outToServer, i); else logger.error("I don't know what to do with this command"); else if (provider.isVolume(itemName)) if (newState.equals(IncreaseDecreaseType.INCREASE)) sendVolumeCommand(itemName, "FF550204" + group, outToServer, i); else if (newState.equals(IncreaseDecreaseType.DECREASE)) sendVolumeCommand(itemName, "FF550205" + group, outToServer, i); else logger.error("I don't know what to do with this command: " + newState); s.close(); } catch (IOException e) { logger.error("IO Exception"); } finally { try { if (s != null) s.close(); } catch (IOException e) { } } }

Target:
protected void internalReceiveUpdate(String itemName, State newState) { logger.info("Update received ({},{})", itemName, newState); SonanceBindingProvider provider = findFirstMatchingBindingProvider(itemName); String group = provider.getGroup(itemName); String ip = provider.getIP(itemName); int port = provider.getPort(itemName); ip = null; group = null; Socket s = null; try { s = new Socket(ip, port); DataOutputStream outToServer = new DataOutputStream( s.getOutputStream()); BufferedReader i = new BufferedReader(new InputStreamReader( s.getInputStream())); if (provider.isMute(itemName)) if (newState.equals(OnOffType.OFF)) sendMuteCommand(itemName, SonanceConsts.MUTE_ON + group, outToServer, i); else if (newState.equals(OnOffType.ON)) sendMuteCommand(itemName, SonanceConsts.MUTE_OFF + group, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); if (provider.isPower(itemName)) if (newState.equals(OnOffType.OFF)) sendPowerCommand(itemName, SonanceConsts.POWER_OFF, outToServer, i); else if (newState.equals(OnOffType.ON)) sendPowerCommand(itemName, SonanceConsts.POWER_ON, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); else if (provider.isVolume(itemName)) if (newState.equals(IncreaseDecreaseType.INCREASE)) sendVolumeCommand(itemName, SonanceConsts.VOLUME_UP + group, outToServer, i); else if (newState.equals(IncreaseDecreaseType.DECREASE)) sendVolumeCommand(itemName, SonanceConsts.VOLUME_DOWN + group, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); s.close(); } catch (IOException e) { logger.error( "IO Exception when received internal command. Message: {}", e.getMessage()); } finally { closeSilently(s); } }
Source:
private boolean isStudentContentCorrect(WebElement studentRow, StudentAttributes student) { String actualDetails = studentRow.findElement(By.xpath("td[2]")).getText(); String actualName = studentRow.findElement(By.xpath("td[3]")).getText(); String actualGoogleId = studentRow.findElement(By.xpath("td[4]")).getText(); String actualComment = studentRow.findElement(By.xpath("td[5]")).getText(); String expectedDetails = student.course + "\n" + (student.section == null ? "None" : student.section) + "\n" + student.team; String expectedName = student.name; String expectedGoogleId = StringHelper.convertToEmptyStringIfNull(student.googleId); String expectedComment = StringHelper.convertToEmptyStringIfNull(student.comments); return actualDetails.equals(expectedDetails) && actualName.equals(expectedName) && actualGoogleId.equals(expectedGoogleId) && actualComment.equals(expectedComment); }

Target:
private boolean isStudentContentCorrect(WebElement studentRow, StudentAttributes student) { String actualDetails = studentRow.findElement(By.xpath("td[2]")).getText(); String actualName = studentRow.findElement(By.xpath("td[3]")).getText(); String actualGoogleId = studentRow.findElement(By.xpath("td[4]")).getText(); String actualComment = studentRow.findElement(By.xpath("td[5]")).getText(); String expectedDetails = student.course + "\n" + (student.section == null ? Const.DEFAULT_SECTION : student.section) + "\n" + student.team; String expectedName = student.name; String expectedGoogleId = StringHelper.convertToEmptyStringIfNull(student.googleId); String expectedComment = StringHelper.convertToEmptyStringIfNull(student.comments); return actualDetails.equals(expectedDetails) && actualName.equals(expectedName) && actualGoogleId.equals(expectedGoogleId) && actualComment.equals(expectedComment); }
Source:
public void setQualityGate(QualityGate g) { requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = Optional.of(g); }

Target:
public void setQualityGate(QualityGate g) { requireNonNull(g); checkState(qualityGate == null, "QualityGateHolder can be initialized only once"); this.qualityGate = g; }
Source:
public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(TOPIC); options.add(TOPIC_PATTERN); options.add(PROPS_GROUP_ID); options.add(SCAN_STARTUP_MODE); options.add(SCAN_STARTUP_SPECIFIC_OFFSETS); options.add(SCAN_TOPIC_PARTITION_DISCOVERY); options.add(SCAN_STARTUP_TIMESTAMP_MILLIS); options.add(SCAN_TOPIC_PARTITION_DISCOVERY); options.add(SINK_PARTITIONER); options.add(SINK_SEMANTIC); return options; }

Target:
public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(TOPIC); options.add(TOPIC_PATTERN); options.add(PROPS_GROUP_ID); options.add(SCAN_STARTUP_MODE); options.add(SCAN_STARTUP_SPECIFIC_OFFSETS); options.add(SCAN_TOPIC_PARTITION_DISCOVERY); options.add(SCAN_STARTUP_TIMESTAMP_MILLIS); options.add(SINK_PARTITIONER); options.add(SINK_SEMANTIC); return options; }
Source:
public static ClassReader classReaderFor(final byte[] b) { final byte[] originalVersion = new byte[] { b[4], b[5], b[6], b[7] }; if (b[6] == 0x00 && b[7] == 0x39) { b[4] = (byte) (Opcodes.V12 >>> 24); b[5] = (byte) (Opcodes.V12 >>> 16); b[6] = (byte) (Opcodes.V12 >>> 8); b[7] = (byte) Opcodes.V12; } final ClassReader classReader = new ClassReader(b); System.arraycopy(originalVersion, 0, b, 4, originalVersion.length); return classReader; }

Target:
public static ClassReader classReaderFor(final byte[] b) { final int originalVersion = getMajorVersion(b); if (originalVersion == Opcodes.V12 + 1) { setMajorVersion(Opcodes.V12, b); } final ClassReader classReader = new ClassReader(b); setMajorVersion(originalVersion, b); return classReader; }
Source:
private String sourceEvents() throws Exception { MetaStoreEventSourcer defaultSourcer = null; String inputFilename = null; String lastEventsIdFile = FileUtils.DEFAULT_EVENT_STORE_PATH + File.separator + inputOptions.getJobName() + "/" + inputOptions.getJobName() + ".id"; Map<String, Long> lastEventsIdMap = getLastDBTableEvents(new Path(lastEventsIdFile)); try { HCatClient sourceMetastoreClient = HiveMetastoreUtils.initializeHiveMetaStoreClient( inputOptions.getSourceMetastoreUri(), inputOptions.getSourceMetastoreKerberosPrincipal(), inputOptions.getSourceHive2KerberosPrincipal()); defaultSourcer = new MetaStoreEventSourcer(sourceMetastoreClient, new DefaultPartitioner(drStore, eventSoucerUtil), eventSoucerUtil, lastEventsIdMap); inputFilename = defaultSourcer.sourceEvents(inputOptions); } finally { if (defaultSourcer != null) { defaultSourcer.cleanUp(); } } return inputFilename; }

Target:
private String sourceEvents() throws Exception { MetaStoreEventSourcer defaultSourcer = null; String inputFilename = null; String lastEventsIdFile = FileUtils.DEFAULT_EVENT_STORE_PATH + File.separator + inputOptions.getJobName() + File.separator + inputOptions.getJobName() + ".id"; Map<String, Long> lastEventsIdMap = getLastDBTableEvents(new Path(lastEventsIdFile)); try { HCatClient sourceMetastoreClient = HiveMetastoreUtils.initializeHiveMetaStoreClient( inputOptions.getSourceMetastoreUri(), inputOptions.getSourceMetastoreKerberosPrincipal(), inputOptions.getSourceHive2KerberosPrincipal()); defaultSourcer = new MetaStoreEventSourcer(sourceMetastoreClient, new DefaultPartitioner(drStore, eventSoucerUtil), eventSoucerUtil, lastEventsIdMap); inputFilename = defaultSourcer.sourceEvents(inputOptions); } finally { if (defaultSourcer != null) { defaultSourcer.cleanUp(); } } return inputFilename; }
Source:
public boolean processInvalidUrl(final WebView view, String url) { final String methodName = ":processInvalidUrl"; if (isBrokerRequest(getIntent()) && url.startsWith(AuthenticationConstants.Broker.REDIRECT_PREFIX)) { Logger.e(TAG + methodName, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl), "", ADALError.DEVELOPER_REDIRECTURI_INVALID); returnError(ADALError.DEVELOPER_REDIRECTURI_INVALID, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl)); view.stopLoading(); return true; } else if (url.startsWith("about:blank")) { Logger.v(TAG, "It is an blank page request"); return true; } else if(!url.toLowerCase(Locale.US).startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX)){ Logger.e(TAG + methodName, "The webview was redirected to an unsafe URL.", "", ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED); returnError(ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED, "The webview was redirected to an unsafe URL."); view.stopLoading(); return true; } else { return false; } }

Target:
public boolean processInvalidUrl(final WebView view, String url) { final String methodName = ":processInvalidUrl"; if (isBrokerRequest(getIntent()) && url.startsWith(AuthenticationConstants.Broker.REDIRECT_PREFIX)) { Logger.e(TAG + methodName, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl), "", ADALError.DEVELOPER_REDIRECTURI_INVALID); returnError(ADALError.DEVELOPER_REDIRECTURI_INVALID, String.format( "The RedirectUri is not as expected. Received %s and expected %s", url, mRedirectUrl)); view.stopLoading(); return true; } else if (url.toLowerCase(Locale.US).equals("about:blank")) { Logger.v(TAG, "It is an blank page request"); return true; } else if (!url.toLowerCase(Locale.US).startsWith(AuthenticationConstants.Broker.REDIRECT_SSL_PREFIX)) { Logger.e(TAG + methodName, "The webview was redirected to an unsafe URL.", "", ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED); returnError(ADALError.WEBVIEW_REDIRECTURL_NOT_SSL_PROTECTED, "The webview was redirected to an unsafe URL."); view.stopLoading(); return true; } else { return false; } }
Source:
public LocalPageStore(LocalPageStoreOptions options) throws IOException { mRoot = options.getRootDir(); mPageSize = options.getPageSize(); Path rootDir = Paths.get(mRoot); mPagePattern = Pattern.compile( String.format("%s/%d/(\\d+)/(\\d+)", Pattern.quote(rootDir.toString()), mPageSize)); try { boolean invalidPage = false; if (Files.exists(rootDir)) { try (Stream<Path> pathStream = Files.walk(rootDir).filter(Files::isRegularFile)) { invalidPage = pathStream.anyMatch(path -> { if (getPageId(path) == null) { LOG.warn("Invalid page path {}", path); return true; } try { mBytes.getAndAdd(Files.size(path)); } catch (IOException e) { LOG.warn("Fail to get file size {}", e.toString()); } mSize.incrementAndGet(); return false; }); } } if (invalidPage || mBytes.get() > options.getCacheSize()) { LOG.warn("Cannot recover from cached data: {}", invalidPage ? "Invalid page file found" : "Cached data size exceeded configured value"); FileUtils.cleanDirectory(new File(mRoot)); mSize.set(0); mBytes.set(0); } } catch (IOException e) { throw new IOException(String.format("can't initialize page store at %s", mRoot), e); } }

Target:
public LocalPageStore(LocalPageStoreOptions options) throws IOException { mRoot = options.getRootDir(); mPageSize = options.getPageSize(); Path rootDir = Paths.get(mRoot); mPagePattern = Pattern.compile( String.format("%s/%d/(\\d+)/(\\d+)", Pattern.quote(rootDir.toString()), mPageSize)); try { boolean invalidPage = false; if (Files.exists(rootDir)) { try (Stream<Path> stream = Files.walk(rootDir)) { invalidPage = stream .filter(Files::isRegularFile) .anyMatch(path -> { if (getPageId(path) == null) { LOG.warn("Invalid page path {}", path); return true; } try { mBytes.getAndAdd(Files.size(path)); } catch (IOException e) { LOG.warn("Fail to get file size {}", e.toString()); } mSize.incrementAndGet(); return false; }); } } if (invalidPage || mBytes.get() > options.getCacheSize()) { LOG.warn("Cannot recover from cached data: {}", invalidPage ? "Invalid page file found" : "Cached data size exceeded configured value"); FileUtils.cleanDirectory(new File(mRoot)); mSize.set(0); mBytes.set(0); } } catch (IOException e) { throw new IOException(String.format("can't initialize page store at %s", mRoot), e); } }
Source:
public void send(EntityRef entity, Event event, Component component) { if (Thread.currentThread() != mainThread) { pendingEvents.offer(new PendingEvent(entity, event, component)); } else { SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(event.getClass()); if (handlers != null) { List<EventHandlerInfo> eventHandlers = Lists.newArrayList(handlers.get(component.getClass())); Collections.sort(eventHandlers, priorityComparator); eventHandlers.stream().filter(eventHandler -> eventHandler.isValidFor(entity)).forEach(eventHandler -> { eventHandler.invoke(entity, event); }); } } }

Target:
public void send(EntityRef entity, Event event, Component component) { if (Thread.currentThread() != mainThread) { pendingEvents.offer(new PendingEvent(entity, event, component)); } else { SetMultimap<Class<? extends Component>, EventHandlerInfo> handlers = componentSpecificHandlers.get(event.getClass()); if (handlers != null) { List<EventHandlerInfo> eventHandlers = Lists.newArrayList(handlers.get(component.getClass())); Collections.sort(eventHandlers, priorityComparator); for (EventHandlerInfo eventHandler : eventHandlers) { if (eventHandler.isValidFor(entity)) { eventHandler.invoke(entity, event); } } } } }
Source:
protected final ResultAndError<AppInstallStatus> doInBackground(String... params) { profileRef = params[0]; setupUpdate(); try { return new ResultAndError<>(stageUpdate()); } catch (InvalidResourceStructureException e) { ResourceInstallUtils.logInstallError(e, "Structure error ocurred during install|"); return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.resourceName + "==" + e.getMessage()); } catch (Exception e) { ResourceInstallUtils.logInstallError(e, "Unknown error ocurred during install|"); return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.getMessage()); } }

Target:
protected final ResultAndError<AppInstallStatus> doInBackground(String... params) { profileRef = params[0]; setupUpdate(); try { return new ResultAndError<>(stageUpdate()); } catch (InvalidResourceException e) { ResourceInstallUtils.logInstallError(e, "Structure error ocurred during install|"); String combinedMessage = e.resourceName + "==" + e.getMessage(); return new ResultAndError<>(AppInstallStatus.UnknownFailure, combinedMessage); } catch (Exception e) { ResourceInstallUtils.logInstallError(e, "Unknown error ocurred during install|"); return new ResultAndError<>(AppInstallStatus.UnknownFailure, e.getMessage()); } }
Source:
private void scanCounterBlock(Tree counterBlock) { if (counterBlock instanceof VariableDeclarationTree) { for (IdentifierTree identifierTree : ((VariableDeclarationTreeImpl) counterBlock).variableIdentifiers()) { if (identifierTree.symbol() != null) { currentLoopCounters.add(identifierTree.symbol()); } } } else if (counterBlock instanceof AssignmentExpressionTree) { scanCounterBlock(((AssignmentExpressionTree) counterBlock).variable()); } else if (counterBlock instanceof IdentifierTree) { IdentifierTree identifier = (IdentifierTree) counterBlock; if (identifier.symbol() != null) { currentLoopCounters.add(identifier.symbol()); } } }

Target:
private void scanCounterBlock(Tree counterBlock) { if (counterBlock instanceof VariableDeclarationTree) { for (IdentifierTree identifierTree : ((VariableDeclarationTreeImpl) counterBlock).variableIdentifiers()) { addCurrentLoopCounter(identifierTree); } } else if (counterBlock instanceof AssignmentExpressionTree) { scanCounterBlock(((AssignmentExpressionTree) counterBlock).variable()); } else { addCurrentLoopCounter(counterBlock); } }
Source:
private static ExpressionTree getObject(Tree element) { if (element.is(Kind.BRACKET_MEMBER_EXPRESSION, Kind.DOT_MEMBER_EXPRESSION)) { return ((MemberExpressionTree) element).object(); } if (element.is(Kind.IDENTIFIER_REFERENCE) && ((JavaScriptTree) element).getParent().is(Kind.FOR_OF_STATEMENT)) { return (ExpressionTree) element; } return null; }

Target:
private static ExpressionTree getObject(Tree element) { if (element.is(Kind.BRACKET_MEMBER_EXPRESSION, Kind.DOT_MEMBER_EXPRESSION)) { return ((MemberExpressionTree) element).object(); } final JavaScriptTree parent = ((JavaScriptTree) element).getParent(); if (parent.is(Kind.FOR_OF_STATEMENT) && element == ((ForObjectStatementTree) parent).expression()) { return (ExpressionTree) element; } return null; }
Source:
Directory open( File dir ) throws IOException; @Override void close(); static DirectoryFactory newDirectoryFactory( PageCache pageCache, Config config ) { boolean isEphemeral = config.get( GraphDatabaseFacadeFactory.Configuration.ephemeral ); boolean isUsingCustomIOConfig = CustomIOConfigValidator.customIOConfigUsed( config ); if ( isEphemeral ) { assert !isUsingCustomIOConfig : "Can't both be in ephemeral mode and use block storage, that makes no sense."; return new PagedDirectoryFactory( pageCache ); } DirectoryFactory factory; switch ( DEFAULT_FACTORY ) { case "heap": factory = new HeapDirectoryFactory(); break; case "paged": if ( !isUsingCustomIOConfig ) { factory = new PagedDirectoryFactory( pageCache ); break; } System.err.println( "WARN: Paged indexes are not available when custom IO is in use. " + "Most likely this is because you're running on special hardware. Falling back to memory-mapped indexes." ); case "niofs": factory = new MemoryMappedDirectoryFactory(); break; default: System.err.printf( "WARN: Unknown index IO implementation '%s', using default.\n", DEFAULT_FACTORY ); factory = new MemoryMappedDirectoryFactory(); } return new NRTCachingDirectoryFactory( factory ); }

Target:
Directory open( File dir ) throws IOException; @Override void close(); static DirectoryFactory newDirectoryFactory( PageCache pageCache, Config config, Log log ) { boolean isEphemeral = config.get( GraphDatabaseFacadeFactory.Configuration.ephemeral ); boolean isUsingCustomIOConfig = CustomIOConfigValidator.customIOConfigUsed( config ); if ( isEphemeral ) { return new PagedDirectoryFactory( pageCache ); } DirectoryFactory factory; switch ( DEFAULT_FACTORY ) { case "heap": factory = new HeapDirectoryFactory(); break; case "paged": if ( !isUsingCustomIOConfig ) { factory = new PagedDirectoryFactory( pageCache ); break; } log.warn( "Paged indexes are not available when custom IO is in use. Most likely this is because you're " + "running on special hardware. Falling back to memory-mapped indexes." ); case "mmap": factory = new MemoryMappedDirectoryFactory(); break; default: log.warn( "Unknown index IO implementation '%s', using default.\n", DEFAULT_FACTORY ); factory = new MemoryMappedDirectoryFactory(); } return new NRTCachingDirectoryFactory( factory ); }
Source:
public void suspend() { SuspendActionDto suspendAction = dtoFactory.createDto(SuspendActionDto.class); suspendAction.setType(Action.TYPE.SUSPEND); service.suspend(debugSessionDto.getId(), suspendAction).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { notificationManager.notify(arg.getMessage(), FAIL, FLOAT_MODE); } }); }

Target:
public void suspend() { if (!isConnected()) { return; } SuspendActionDto suspendAction = dtoFactory.createDto(SuspendActionDto.class); suspendAction.setType(Action.TYPE.SUSPEND); service.suspend(debugSessionDto.getId(), suspendAction).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { notificationManager.notify(arg.getMessage(), FAIL, FLOAT_MODE); } }); }
Source:
private IInternationalizationPreferenceModelProvider createDefaultInternationalizationPrefModelProvider() { return new AbstractInternationalizationPreferenceModelProvider() { @Override public URI getInternationalizationPreferenceModelURI(final URI userModelURI) { assert userModelURI != null; final IPath internationalizationWorkspaceLocation = Activator.getDefault().getStateLocation(); final URI modelURI = userModelURI.trimFileExtension(); URI internationalizationModelURI = null; if (modelURI.isPlatform()) { internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toPlatformString(true)).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } else if (modelURI.isFile()) { final String workspaceURI = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().toString(); internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toString().replaceFirst(workspaceURI, "")).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } return internationalizationModelURI; } }; }

Target:
private IInternationalizationPreferenceModelProvider createDefaultInternationalizationPrefModelProvider() { return new AbstractInternationalizationPreferenceModelProvider() { @Override public URI getInternationalizationPreferenceModelURI(final URI userModelURI) { Assert.isNotNull(userModelURI); final IPath internationalizationWorkspaceLocation = Activator.getDefault().getStateLocation(); final URI modelURI = userModelURI.trimFileExtension(); URI internationalizationModelURI = null; if (modelURI.isPlatform()) { internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toPlatformString(true)).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } else if (modelURI.isFile()) { final String workspaceURI = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().toString(); internationalizationModelURI = URI.createFileURI(internationalizationWorkspaceLocation.append(modelURI.toString().replaceFirst(workspaceURI, "")).toString()); internationalizationModelURI = internationalizationModelURI.appendFileExtension(InternationalizationPreferenceModel.INTERNATIONALIZATION_PREFERENCE_FILE_EXTENSION); } return internationalizationModelURI; } }; }
Source:
public void testList() throws Exception { for (String regionId : regions) { ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, containerName); ObjectList response = objectApi.list(); assertEquals(response.getContainer(), api.containerApiInRegion(regionId).get(containerName)); assertNotNull(response); for (SwiftObject object : response) { checkObject(object); } } }

Target:
public void testList() throws Exception { for (String regionId : regions) { ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, containerName); ObjectList response = objectApi.list(); assertEquals(response.getContainer(), api.containerApiInRegion(regionId).get(containerName)); for (SwiftObject object : response) { checkObject(object); } } }
Source:
public static Depgraph parseFrom(List<String> fileContents) { if (fileContents.isEmpty()) { return new Depgraph(Collections.<String>emptyList()); } List<String> roots = new ArrayList<>(); for (String depgraph : fileContents) { try { List<List> list = new Gson().fromJson(depgraph, new TypeToken<List<List>>(){}.getType()); for (List outer : list) { Iterator i = outer.iterator(); if ("roots".equals(i.next())) { List<List> rootsList = (List<List>) i.next(); for (List rootDescriptor : rootsList) { String filename = (String) rootDescriptor.iterator().next(); if (!filename.endsWith("-bootstrap.js")) { roots.add(filename); } } } } } catch (Exception e) { throw new RuntimeException("malformed depgraphs content:\n" + depgraph, e); } } if (roots.isEmpty()) { throw new IllegalStateException("No roots were found in the provided depgraphs files"); } return new Depgraph(roots); }

Target:
public static Depgraph parseFrom(List<String> fileContents) { if (fileContents.isEmpty()) { return new Depgraph(Collections.<String>emptyList()); } List<String> roots = new ArrayList<>(); for (String depgraph : fileContents) { try { List<List<?>> list = new Gson().fromJson(depgraph, new TypeToken<List<List>>(){}.getType()); for (List<?> outer : list) { Iterator i = outer.iterator(); if ("roots".equals(i.next())) { List<List<?>> rootsList = (List<List<?>>) i.next(); for (List<?> rootDescriptor : rootsList) { String filename = (String) rootDescriptor.iterator().next(); if (!filename.endsWith("-bootstrap.js")) { roots.add(filename); } } } } } catch (Exception e) { throw new RuntimeException("malformed depgraphs content:\n" + depgraph, e); } } if (roots.isEmpty()) { throw new IllegalStateException("No roots were found in the provided depgraphs files"); } return new Depgraph(roots); }
Source:
public List<Datastream> getAllDatastreams(int start, int count) throws DatastreamException { GetAllRequest<Datastream> request = _builders.getAll().paginate(0, 1).build(); ResponseFuture<CollectionResponse<Datastream>> datastreamResponseFuture = _restClient.sendRequest(request); try { return datastreamResponseFuture.getResponse().getEntity().getElements(); } catch (RemoteInvocationException e) { throw new DatastreamException("Get All Datastreams failed with error.", e); } }

Target:
public List<Datastream> getAllDatastreams(int start, int count) throws DatastreamException { return getAllDatastreams(_builders.getAll().paginate(start, count).build()); }
Source:
public void onSuccess(String provider) { if (provider == null) { throw new IllegalStateException( "User has no providers even though we got a collision."); } if (provider.equalsIgnoreCase(EmailAuthProvider.PROVIDER_ID)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackPasswordPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_FLOW ))); } else if (provider.equalsIgnoreCase(EMAIL_LINK_PROVIDER)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackEmailLinkPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EMAIL_LINK_PROVIDER, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_LINK_FLOW ))); } else { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackIdpPrompt.createIntent( getApplication(), getArguments(), new User.Builder(provider, mEmail).build()), RequestCodes.WELCOME_BACK_IDP_FLOW ))); } }

Target:
public void onSuccess(String provider) { if (provider == null) { throw new IllegalStateException( "User has no providers even though we got a collision."); } if (EmailAuthProvider.PROVIDER_ID.equalsIgnoreCase(provider)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackPasswordPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_FLOW ))); } else if (EMAIL_LINK_PROVIDER.equalsIgnoreCase(provider)) { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackEmailLinkPrompt.createIntent( getApplication(), getArguments(), new IdpResponse.Builder(new User.Builder( EMAIL_LINK_PROVIDER, mEmail).build() ).build()), RequestCodes.WELCOME_BACK_EMAIL_LINK_FLOW ))); } else { setResult(Resource.<IdpResponse>forFailure(new IntentRequiredException( WelcomeBackIdpPrompt.createIntent( getApplication(), getArguments(), new User.Builder(provider, mEmail).build()), RequestCodes.WELCOME_BACK_IDP_FLOW ))); } }
Source:
private IAction createResetHeaderAction() { return new Action(Messages.TmfEventsTable_showAll) { @Override public void run() { for (TableColumn column : fTable.getColumns()) { final Object widthVal = column.getData(Key.WIDTH); if (widthVal instanceof Integer) { Integer width = (Integer) widthVal; if (!column.getResizable()) { column.setWidth(width); column.setResizable(true); if (IS_LINUX) { column.pack(); } } } } for (MenuItem menuItem : fHeaderMenu.getItems()) { menuItem.setSelection(true); } } }; }

Target:
private IAction createResetHeaderAction() { return new Action(Messages.TmfEventsTable_ShowAll) { @Override public void run() { for (TableColumn column : fTable.getColumns()) { final Object widthVal = column.getData(Key.WIDTH); if (widthVal instanceof Integer) { Integer width = (Integer) widthVal; if (!column.getResizable()) { column.setWidth(width); column.setResizable(true); if (IS_LINUX) { column.pack(); } } } } } }; }
Source:
private Constants.RealmFieldType getRealmType(VariableElement field) { String fieldTypeCanonicalName = field.asType().toString(); Constants.RealmFieldType type = Constants.JAVA_TO_REALM_TYPES.get(fieldTypeCanonicalName); if (type != null) { return type; } if (Utils.isMutableRealmInteger(field)) { return Constants.RealmFieldType.REALM_INTEGER; } if (Utils.isRealmModel(field)) { return Constants.RealmFieldType.OBJECT; } if (Utils.isRealmList(field)) { final TypeMirror elementTypeMirror = Utils.getRealmListElementTypeMirror(field); if (Utils.isRealmModel(elementTypeMirror)) { return Constants.RealmFieldType.LIST; } else { final Constants.RealmFieldType fieldType = Constants.LIST_ELEMENT_TYPE_TO_REALM_TYPES.get(elementTypeMirror.toString()); if (fieldType == null) { return Constants.RealmFieldType.NOTYPE; } return fieldType; } } return Constants.RealmFieldType.NOTYPE; }

Target:
private Constants.RealmFieldType getRealmType(VariableElement field) { String fieldTypeCanonicalName = field.asType().toString(); Constants.RealmFieldType type = Constants.JAVA_TO_REALM_TYPES.get(fieldTypeCanonicalName); if (type != null) { return type; } if (Utils.isMutableRealmInteger(field)) { return Constants.RealmFieldType.REALM_INTEGER; } if (Utils.isRealmModel(field)) { return Constants.RealmFieldType.OBJECT; } if (Utils.isRealmModelList(field)) { return Constants.RealmFieldType.LIST; } if (Utils.isRealmValueList(field)) { final TypeMirror elementTypeMirror = Utils.getRealmListElementTypeMirror(field); final Constants.RealmFieldType fieldType = Constants.LIST_ELEMENT_TYPE_TO_REALM_TYPES.get(elementTypeMirror.toString()); if (fieldType == null) { return Constants.RealmFieldType.NOTYPE; } return fieldType; } return Constants.RealmFieldType.NOTYPE; }
Source:
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (targetColsSymbolsExclPartition == null) { out.writeBoolean(false); } else { out.writeBoolean(true); Symbols.toStream(targetColsSymbolsExclPartition, out); } if (targetColsExclPartitionCols == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(targetColsExclPartitionCols.size()); for (Reference columnIdent : targetColsExclPartitionCols) { Reference.toStream(columnIdent, out); } } out.writeBoolean(ignoreDuplicateKeys); if (onDuplicateKeyAssignments == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(onDuplicateKeyAssignments.size()); for (Map.Entry<Reference, Symbol> entry : onDuplicateKeyAssignments.entrySet()) { Reference.toStream(entry.getKey(), out); Symbols.toStream(entry.getValue(), out); } } if (out.getVersion().onOrAfter(Version.V_4_1_0)) { out.write(allTargetColumns.size()); for (var ref : allTargetColumns) { Symbols.toStream(ref, out); } } }

Target:
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (targetColsSymbolsExclPartition == null) { out.writeBoolean(false); } else { out.writeBoolean(true); Symbols.toStream(targetColsSymbolsExclPartition, out); } if (targetColsExclPartitionCols == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(targetColsExclPartitionCols.size()); for (Reference columnIdent : targetColsExclPartitionCols) { Reference.toStream(columnIdent, out); } } out.writeBoolean(ignoreDuplicateKeys); if (onDuplicateKeyAssignments == null) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeVInt(onDuplicateKeyAssignments.size()); for (Map.Entry<Reference, Symbol> entry : onDuplicateKeyAssignments.entrySet()) { Reference.toStream(entry.getKey(), out); Symbols.toStream(entry.getValue(), out); } } if (out.getVersion().onOrAfter(Version.V_4_2_0)) { out.write(allTargetColumns.size()); for (var ref : allTargetColumns) { Symbols.toStream(ref, out); } } }
Source:
private Optional<Field> selectByContentTypeFieldRelationTypeInDb(String id, String fieldRelationType) throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL(sql.findByContentTypeAndRelationType).addParam(id).addParam(fieldRelationType); List<Map<String, Object>> results; results = dc.loadObjectResults(); if (results.size() == 0) { return Optional.empty(); } return Optional.of(new DbFieldTransformer(results.get(0)).from()); }

Target:
private Optional<Field> selectByContentTypeFieldRelationTypeInDb(String id, String fieldRelationType) throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL(sql.findByContentTypeAndRelationType).addParam(id).addParam(fieldRelationType); final List<Map<String, Object>> results = dc.loadObjectResults(); return results.isEmpty()? Optional.empty():Optional.of(new DbFieldTransformer(results.get(0)).from()); }
Source:
public static void main(String[] args) { ExampleArgs exArgs = ExampleUtils.readSubscribeArgs(args, usageString); System.out.printf("\nTrying to connect to %s, and listen to %s for %d messages.\n\n", exArgs.server, exArgs.subject, exArgs.msgCount); try (Connection nc = Nats.connect(ExampleUtils.createExampleOptions(exArgs.server, true))) { Dispatcher d = nc.createDispatcher(null); JetStream js = nc.jetStream(); CountDownLatch msgLatch = new CountDownLatch(exArgs.msgCount); MessageHandler handler = (Message msg) -> { System.out.printf("\nMessage Received:\n"); if (msg.hasHeaders()) { System.out.println(" Headers:"); for (String key: msg.getHeaders().keySet()) { for (String value : msg.getHeaders().values(key)) { System.out.printf(" %s: %s\n", key, value); } } } System.out.printf(" Subject: %s\n Data: %s\n", msg.getSubject(), new String(msg.getData(), StandardCharsets.UTF_8)); if (msg.isJetStream()) { MetaData meta = msg.metaData(); System.out.printf(" Stream Name: %s\n", meta.getStream()); System.out.printf(" Stream Seq: %d\n", meta.streamSequence()); System.out.printf(" Consumer Name: %s\n", meta.getConsumer()); System.out.printf(" Consumer Seq: %d\n", meta.consumerSequence()); } msgLatch.countDown(); }; SubscribeOptions so = SubscribeOptions.builder().durable("sub-example").build(); js.subscribe(exArgs.subject, d, handler, so); msgLatch.await(); System.out.printf("Received %d messages. Done.\n", exArgs.msgCount); } catch (Exception exp) { System.err.println(exp); } }

Target:
public static void main(String[] args) { ExampleArgs exArgs = ExampleUtils.readSubscribeArgs(args, usageString); System.out.printf("\nTrying to connect to %s, and listen to %s for %d messages.\n\n", exArgs.server, exArgs.subject, exArgs.msgCount); try (Connection nc = Nats.connect(ExampleUtils.createExampleOptions(exArgs.server, true))) { Dispatcher d = nc.createDispatcher(null); JetStream js = nc.jetStream(); if (exArgs.stream == null) { ExampleUtils.createTestStream(js, "test-stream", exArgs.subject); } CountDownLatch msgLatch = new CountDownLatch(exArgs.msgCount); MessageHandler handler = (Message msg) -> { System.out.printf("\nMessage Received:\n"); if (msg.hasHeaders()) { System.out.println(" Headers:"); for (String key: msg.getHeaders().keySet()) { for (String value : msg.getHeaders().values(key)) { System.out.printf(" %s: %s\n", key, value); } } } System.out.printf(" Subject: %s\n Data: %s\n", msg.getSubject(), new String(msg.getData(), StandardCharsets.UTF_8)); if (msg.isJetStream()) { MetaData meta = msg.metaData(); System.out.printf(" Stream Name: %s\n", meta.getStream()); System.out.printf(" Stream Seq: %d\n", meta.streamSequence()); System.out.printf(" Consumer Name: %s\n", meta.getConsumer()); System.out.printf(" Consumer Seq: %d\n", meta.consumerSequence()); } msgLatch.countDown(); }; SubscribeOptions so = SubscribeOptions.builder().durable("sub-example").build(); js.subscribe(exArgs.subject, d, handler, so); msgLatch.await(); System.out.printf("Received %d messages. Done.\n", exArgs.msgCount); } catch (Exception exp) { System.err.println(exp); } }
Source:
private void adjustQuestionNumbersAndCreateQuestion( FeedbackQuestionAttributes question, int oldQuestionNumber) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { fqDb.saveQuestionAndAdjustQuestionNumbers(question, false, oldQuestionNumber); }

Target:
private void adjustQuestionNumbersAndCreateQuestion( FeedbackQuestionAttributes question, int oldQuestionNumber) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException { if (fsLogic.getFeedbackSession(question.feedbackSessionName, question.courseId) == null) { throw new EntityDoesNotExistException("Session disappeared"); } fqDb.saveQuestionAndAdjustQuestionNumbers(question, false, oldQuestionNumber); }
Source:
public ArticlePageObject savePage() { waitForElementInViewPort(editSummary); waitForElementInViewPort(reviewChangesButton); waitForElementVisibleByElement(savePanel); publishButton.click(); PageObjectLogging.log("savePage", "The 2nd Publish Button is clicked", true); return new ArticlePageObject(driver); }

Target:
public ArticlePageObject savePage() { waitForElementInViewPort(editSummary); waitForElementInViewPort(reviewChangesButton); waitForElementVisibleByElement(savePanel); publishButton.click(); return new ArticlePageObject(driver); }