auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.SET_LITERAL, ctx -> { SetLiteral setLiteral = (SetLiteral) ctx.syntaxNode(); Set<Integer> issueIndexes = new HashSet<>(); if (setLiteral.elements().size() > 100) { return; } for (int i = 0; i < setLiteral.elements().size(); i++) { if (issueIndexes.contains(i)) { continue; } Expression key = setLiteral.elements().get(i); List<Tree> duplicateKeys = findIdenticalKeys(i, setLiteral.elements(), issueIndexes); if (!duplicateKeys.isEmpty()) { PreciseIssue issue = ctx.addIssue(key, "Change or remove duplicates of this key."); duplicateKeys.forEach(d -> issue.secondary(d, "Duplicate key")); } } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.SET_LITERAL, ctx -> { SetLiteral setLiteral = (SetLiteral) ctx.syntaxNode(); Set<Integer> issueIndexes = new HashSet<>(); if (setLiteral.elements().size() > SIZE_THRESHOLD) { return; } for (int i = 0; i < setLiteral.elements().size(); i++) { if (issueIndexes.contains(i)) { continue; } Expression key = setLiteral.elements().get(i); List<Tree> duplicateKeys = findIdenticalKeys(i, setLiteral.elements(), issueIndexes); if (!duplicateKeys.isEmpty()) { PreciseIssue issue = ctx.addIssue(key, "Change or remove duplicates of this key."); duplicateKeys.forEach(d -> issue.secondary(d, "Duplicate key")); } } }); }
Source:
private static void performWarmup() { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { if (isAlpnConfigured()) { try { createSslContext(); } catch (SSLException e) { LOG.warn("Could not asynchronously create the ssl context", e); } } } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { CredentialFactory.getHttpTransport(); } catch (IOException | GeneralSecurityException e) { LOG.warn("Could not asynchronously initialze httpTransport", e); } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { LOG.warn("Could not asynchronously initialze host: " + host, e); } } }); } connectionStartupExecutor.shutdown(); }

Target:
private static void performWarmup() { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { if (isAlpnProviderEnabled()) { try { createSslContext(); } catch (SSLException e) { LOG.warn("Could not asynchronously create the ssl context", e); } } } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { CredentialFactory.getHttpTransport(); } catch (IOException | GeneralSecurityException e) { LOG.warn("Could not asynchronously initialze httpTransport", e); } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT, BigtableOptions.BIGTABLE_CLUSTER_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { LOG.warn("Could not asynchronously initialze host: " + host, e); } } }); } connectionStartupExecutor.shutdown(); }
Source:
public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> errorCounts = new HashMap<>(); for (DescribedGroup describedGroup : data.groups()) { updateErrorCounts(errorCounts, Errors.forCode(describedGroup.errorCode())); } return errorCounts; }

Target:
public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> errorCounts = new HashMap<>(); data.groups().forEach(describedGroup -> { updateErrorCounts(errorCounts, Errors.forCode(describedGroup.errorCode())); }); return errorCounts; }
Source:
public void testGet() { VdsNetworkInterface result = dao.get(existingVdsInterface.getId()); assertEquals(existingVdsInterface, result); }

Target:
public void testGet() { newVdsInterface.setVdsId(VDS_ID); dao.saveInterfaceForVds(newVdsInterface); dao.saveStatisticsForVds(newVdsInterface.getStatistics()); VdsNetworkInterface result = dao.get(newVdsInterface.getId()); assertEquals(newVdsInterface, result); }
Source:
protected BufferedDataTable[] execute(BufferedDataTable[] inData, ExecutionContext exec) throws Exception { final AtomicBoolean encounteredExceptions = new AtomicBoolean(false); int imgIdx = getPathColIdx(inData[0].getDataTableSpec()); ReadImgTableFunction<T> rifp = createImgTableFunction(exec, inData[0].getDataTableSpec(), Long.valueOf(inData[0].size()).intValue()); BufferedDataContainer bdc = exec.createDataContainer(getOutspec(inData[0].getDataTableSpec(), imgIdx)); Iterator<DataRow> iterator = inData[0].iterator(); while (iterator.hasNext()) { rifp.apply(iterator.next()).forEachOrdered(dataRow -> { if (dataRow.getSecond().isPresent()) { encounteredExceptions.set(true); LOGGER.warn("Encountered exception while reading image " + dataRow.getFirst().getKey() + "! Caught Exception: " + dataRow.getSecond().get()); } bdc.addRowToTable(dataRow.getFirst()); }); exec.checkCanceled(); } rifp.close(); bdc.close(); m_data = bdc.getTable(); if (encounteredExceptions.get()) { setWarningMessage("Encountered errors during execution!"); } return new BufferedDataTable[] { bdc.getTable() }; }

Target:
protected BufferedDataTable[] execute(BufferedDataTable[] inData, ExecutionContext exec) throws Exception { final AtomicBoolean encounteredExceptions = new AtomicBoolean(false); int imgIdx = getPathColIdx(inData[0].getDataTableSpec()); ReadImgTableFunction<T> rifp = createImgTableFunction(exec, inData[0].getDataTableSpec(), Long.valueOf(inData[0].size()).intValue()); BufferedDataContainer bdc = exec.createDataContainer(getOutspec(inData[0].getDataTableSpec(), imgIdx)); Iterator<DataRow> iterator = inData[0].iterator(); while (iterator.hasNext()) { rifp.apply(iterator.next()).forEachOrdered(dataRow -> { if (dataRow.getSecond().isPresent()) { encounteredExceptions.set(true); LOGGER.warn("Encountered exception while reading image: " + dataRow.getFirst().getKey() + "! view log for more info."); LOGGER.debug("Encountered exception while reading image:", dataRow.getSecond().get()); } bdc.addRowToTable(dataRow.getFirst()); }); exec.checkCanceled(); } rifp.close(); bdc.close(); m_data = bdc.getTable(); if (encounteredExceptions.get()) { setWarningMessage("Encountered errors during execution!"); } return new BufferedDataTable[] { bdc.getTable() }; }
Source:
public int andCardinality(final BitmapContainer value2) { int newCardinality = 0; for (int k = 0; k < this.bitmap.length; ++k) { newCardinality += Long.bitCount(this.bitmap[k] & value2.bitmap[k]); } if (newCardinality > ArrayContainer.DEFAULT_MAX_SIZE) { final BitmapContainer answer = new BitmapContainer(); for (int k = 0; k < answer.bitmap.length; ++k) { answer.bitmap[k] = this.bitmap[k] & value2.bitmap[k]; } return newCardinality; } else { return newCardinality; } }

Target:
public int andCardinality(final BitmapContainer value2) { int newCardinality = 0; for (int k = 0; k < this.bitmap.length; ++k) { newCardinality += Long.bitCount(this.bitmap[k] & value2.bitmap[k]); } return newCardinality; }
Source:
public synchronized BigtableClusterName getClusterName() throws IOException { if (options.getClusterName() == null) { try (BigtableClusterUtilities util = BigtableClusterUtilities.forInstance(options.getProjectId(), options.getInstanceId())) { final ListClustersResponse clusters = util.getClusters(); Preconditions.checkState(clusters.getClustersCount() == 0, "Project '%s' / Instance '%s' has %d clusters. There must be exactly 1 for this operation to work.", options.getProjectId(), options.getInstanceId(), clusters.getClustersCount()); String clusterName = util.getSingleCluster().getName(); String clusterId = BigtableClusterName.parse(clusterName).getClusterId(); options = options.toBuilder().setClusterId(clusterId).build(); } catch (GeneralSecurityException e) { throw new IOException("Could not get cluster Id.", e); } } return options.getClusterName(); }

Target:
public synchronized BigtableClusterName getClusterName() throws IOException { if (this.clusterName == null) { try (BigtableClusterUtilities util = BigtableClusterUtilities.forInstance(options.getProjectId(), options.getInstanceId())) { ListClustersResponse clusters = util.getClusters(); Preconditions.checkState(clusters.getClustersCount() == 1, String.format( "Project '%s' / Instance '%s' has %d clusters. There must be exactly 1 for this operation to work.", options.getProjectId(), options.getInstanceId(), clusters.getClustersCount())); clusterName = new BigtableClusterName(clusters.getClusters(0).getName()); } catch (GeneralSecurityException e) { throw new IOException("Could not get cluster Id.", e); } } return clusterName; }
Source:
public void onBindViewHolder(final ViewHolder holder, final int position) { final RecentItem currentItem = items.get(position); holder.setItem(currentItem); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (getSelectedItemCount() == 0) { Intent myIntent = new Intent(); myIntent.setClass(context, StudyActivity.class); String dbPath = currentItem.dbPath; myIntent.putExtra(StudyActivity.EXTRA_DBPATH, dbPath); recentListUtil.addToRecentList(dbPath); context.startActivity(myIntent); } else { toggleSelection(position); } updateActionMode(); } }); holder.itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { AppCompatActivity appCompatActivity = (AppCompatActivity) context; if (getSelectedItemCount() == 0) { actionMode = appCompatActivity.startSupportActionMode(actionModeCallback); } toggleSelection(position); updateActionMode(); return true; } }); holder.moreButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String dbPath = currentItem.dbPath; DialogFragment df = new OpenActionsFragment(); Bundle b = new Bundle(); b.putString(OpenActionsFragment.EXTRA_DBPATH, dbPath); df.setArguments(b); df.show(((FragmentActivity) context).getSupportFragmentManager(), "OpenActions"); } }); holder.selectedOverlay.setVisibility(isSelected(position) ? View.VISIBLE : View.INVISIBLE); }

Target:
public void onBindViewHolder(final ViewHolder holder, final int position) { final RecentItem currentItem = items.get(position); holder.setItem(currentItem); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (getSelectedItemCount() == 0) { Intent myIntent = new Intent(); myIntent.setClass(context, StudyActivity.class); String dbPath = currentItem.dbPath; myIntent.putExtra(StudyActivity.EXTRA_DBPATH, dbPath); recentListUtil.addToRecentList(dbPath); context.startActivity(myIntent); } else { toggleSelection(position); } recentListActionModeUtil.updateActionMode(getSelectedItemCount()); } }); holder.itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (getSelectedItemCount() == 0) { recentListActionModeUtil.startActionMode(); } toggleSelection(position); recentListActionModeUtil.updateActionMode(getItemCount()); return true; } }); holder.moreButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String dbPath = currentItem.dbPath; DialogFragment df = new OpenActionsFragment(); Bundle b = new Bundle(); b.putString(OpenActionsFragment.EXTRA_DBPATH, dbPath); df.setArguments(b); df.show(((FragmentActivity) context).getSupportFragmentManager(), "OpenActions"); } }); holder.selectedOverlay.setVisibility(isSelected(position) ? View.VISIBLE : View.INVISIBLE); }
Source:
public Map<String, List<String>> getRoutingData() throws InvalidRoutingDataException { Map<String, List<String>> result = new HashMap<>(); if (!_zkClient.exists(ROUTING_DATA_PATH)) { throw new InvalidRoutingDataException("Routing data directory node " + ROUTING_DATA_PATH + " does not exist. Routing ZooKeeper address: " + _zkAddress); } List<String> children = _zkClient.getChildren(ROUTING_DATA_PATH); if (children.isEmpty()) { throw new InvalidRoutingDataException("Routing data directory node " + ROUTING_DATA_PATH + " does not have any child node. Routing ZooKeeper address: " + _zkAddress); } for (String child : children) { ZNRecord record = _zkClient.readData(ROUTING_DATA_PATH + "/" + child); List<String> shardingKeys = record.getListField(ZNRECORD_LIST_FIELD_KEY); if (shardingKeys == null || shardingKeys.isEmpty()) { throw new InvalidRoutingDataException("Realm address node " + ROUTING_DATA_PATH + "/" + child + " does not have a value for key " + ZNRECORD_LIST_FIELD_KEY + ". Routing ZooKeeper address: " + _zkAddress); } result.put(child, shardingKeys); } return result; }

Target:
public Map<String, List<String>> getRoutingData() throws InvalidRoutingDataException { Map<String, List<String>> routingData = new HashMap<>(); List<String> children; try { children = _zkClient.getChildren(ROUTING_DATA_PATH); } catch (ZkNoNodeException e) { throw new InvalidRoutingDataException("Routing data directory ZNode " + ROUTING_DATA_PATH + " does not exist. Routing ZooKeeper address: " + _zkAddress); } if (children == null || children.isEmpty()) { throw new InvalidRoutingDataException( "There are no metadata store realms defined. Routing ZooKeeper address: " + _zkAddress); } for (String child : children) { ZNRecord record = _zkClient.readData(ROUTING_DATA_PATH + "/" + child); List<String> shardingKeys = record.getListField(ZNRECORD_LIST_FIELD_KEY); if (shardingKeys == null || shardingKeys.isEmpty()) { throw new InvalidRoutingDataException("Realm address ZNode " + ROUTING_DATA_PATH + "/" + child + " does not have a value for key " + ZNRECORD_LIST_FIELD_KEY + ". Routing ZooKeeper address: " + _zkAddress); } routingData.put(child, shardingKeys); } return routingData; }
Source:
public static boolean shouldVoteFor( MemberId candidate, long contextTerm, long requestTerm, long contextLastLogTerm, long requestLastLogTerm, long contextLastAppended, long requestLastLogIndex, MemberId votedFor, Log log ) { if ( requestTerm < contextTerm ) { log.debug( "Will note vote for %s as vote request term %s was earlier than my term %s", candidate, requestTerm, contextTerm ); return false; } boolean requestLogEndsAtHigherTerm = requestLastLogTerm > contextLastLogTerm; boolean logsEndAtSameTerm = requestLastLogTerm == contextLastLogTerm; boolean requestLogAtLeastAsLongAsMyLog = requestLastLogIndex >= contextLastAppended; boolean requesterLogUpToDate = requestLogEndsAtHigherTerm || (logsEndAtSameTerm && requestLogAtLeastAsLongAsMyLog); boolean votedForOtherInSameTerm = requestTerm == contextTerm && votedFor != null && !votedFor.equals( candidate ); boolean shouldVoteFor = requesterLogUpToDate && !votedForOtherInSameTerm; log.debug( "Should vote for raft candidate %s: " + "requester log up to date: %s (request last log term: %s, context last log term: %s, request last log index: %s, context last append: %s) " + "voted for other in same term: %s (request term: %s, context term: %s, votedFor: %s)", shouldVoteFor, requesterLogUpToDate, requestLastLogTerm, contextLastLogTerm, requestLastLogIndex, contextLastAppended, votedForOtherInSameTerm, requestTerm, contextTerm, votedFor ); return shouldVoteFor; }

Target:
public static boolean shouldVoteFor( MemberId candidate, long contextTerm, long requestTerm, long contextLastLogTerm, long requestLastLogTerm, long contextLastAppended, long requestLastLogIndex, MemberId votedFor, Log log ) { if ( requestTerm < contextTerm ) { log.debug( "Will not vote for %s as vote request term %s was earlier than my term %s", candidate, requestTerm, contextTerm ); return false; } boolean requestLogEndsAtHigherTerm = requestLastLogTerm > contextLastLogTerm; boolean logsEndAtSameTerm = requestLastLogTerm == contextLastLogTerm; boolean requestLogAtLeastAsLongAsMyLog = requestLastLogIndex >= contextLastAppended; boolean requesterLogUpToDate = requestLogEndsAtHigherTerm || (logsEndAtSameTerm && requestLogAtLeastAsLongAsMyLog); boolean votedForOtherInSameTerm = requestTerm == contextTerm && votedFor != null && !votedFor.equals( candidate ); boolean shouldVoteFor = requesterLogUpToDate && !votedForOtherInSameTerm; log.debug( "Should vote for raft candidate %s: " + "requester log up to date: %s (request last log term: %s, context last log term: %s, request last log index: %s, context last append: %s) " + "voted for other in same term: %s (request term: %s, context term: %s, votedFor: %s)", shouldVoteFor, requesterLogUpToDate, requestLastLogTerm, contextLastLogTerm, requestLastLogIndex, contextLastAppended, votedForOtherInSameTerm, requestTerm, contextTerm, votedFor ); return shouldVoteFor; }
Source:
private void addQueryParams(final Request request) { if (to != null) { request.addQueryParam("To", to.toString()); } if (from != null) { request.addQueryParam("From", from.toString()); } if (parentCallSid != null) { request.addQueryParam("ParentCallSid", parentCallSid); } if (status != null) { request.addQueryParam("Status", status.toString()); } if (startTime != null || endTime != null) { request.addQueryDateTimeRange("Range", startTime, endTime); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } }

Target:
private void addQueryParams(final Request request) { if (to != null) { request.addQueryParam("To", to.toString()); } if (from != null) { request.addQueryParam("From", from.toString()); } if (parentCallSid != null) { request.addQueryParam("ParentCallSid", parentCallSid); } if (status != null) { request.addQueryParam("Status", status.toString()); } if (startTime != null) { request.addQueryParam("StartTime", startTime.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_TIME_FORMAT))); } else if (startTimeAfter != null || startTimeBefore != null) { request.addQueryDateTimeRange("StartTime", startTimeAfter, startTimeBefore); } if (endTime != null) { request.addQueryParam("EndTime", endTime.format(DateTimeFormatter.ofPattern(Request.QUERY_STRING_DATE_TIME_FORMAT))); } else if (endTimeAfter != null || endTimeBefore != null) { request.addQueryDateTimeRange("EndTime", endTimeAfter, endTimeBefore); } if (getPageSize() != null) { request.addQueryParam("PageSize", Integer.toString(getPageSize())); } }
Source:
public AlgoAllDiffACFast(IntVar[] variables, ICause cause) { this.vars = variables; aCause = cause; n = vars.length; matching = new int[n]; for (int i = 0; i < n; i++) { matching[i] = -1; } map = new TIntIntHashMap(); IntVar v; int ub; int idx = n; for (int i = 0; i < n; i++) { v = vars[i]; ub = v.getUB(); for (int j = v.getLB(); j <= ub; j = v.nextValue(j)) { if (!map.containsKey(j)) { map.put(j, idx); idx++; } } } n2 = idx; digraph = new DirectedGraph(n2, SetType.BITSET, false); free = new BitSet(n2); distinction = new BitSet(n2); SCCfinder = new StrongConnectivityFinder(digraph); father = new int[n2]; fifo = new int[n2]; in = new BitSet(n2); }

Target:
public AlgoAllDiffACFast(IntVar[] variables, ICause cause) { this.vars = variables; aCause = cause; n = vars.length; matching = new int[n]; Arrays.fill(matching, -1); map = new TIntIntHashMap(); IntVar v; int ub; int idx = n; for (int i = 0; i < n; i++) { v = vars[i]; ub = v.getUB(); for (int j = v.getLB(); j <= ub; j = v.nextValue(j)) { if (!map.containsKey(j)) { map.put(j, idx); idx++; } } } n2 = idx; digraph = new DirectedGraph(n2, SetType.BITSET, false); free = new BitSet(n2); distinction = new BitSet(n2); SCCfinder = new StrongConnectivityFinder(digraph); father = new int[n2]; fifo = new int[n2]; in = new BitSet(n2); }
Source:
private boolean checkForAuthorization(HttpServletRequest request) { M_log.debug("checkLdapForAuthorization(): called"); String remoteUser = request.getRemoteUser(); String testUser = request.getParameter(TEST_USER); String ltiTestUser = request.getParameter(CANVAS_ID); boolean isAuthorized = false; String user=null; String testUserInSession = (String)request.getSession().getAttribute(TEST_USER); String sessionId = request.getSession().getId(); if( isTestUrlEnabled && ltiTestUser != null ) { user=ltiTestUser; request.getSession().setAttribute(TEST_USER, ltiTestUser); } else if ( isTestUrlEnabled && testUserInSession != null ){ user=testUserInSession; } if ( isTestUrlEnabled && testUser != null ) { user=testUser; request.getSession().setAttribute(TEST_USER, testUser); } else if ( isTestUrlEnabled && testUserInSession != null ){ user=testUserInSession; } if ( !isAuthorized && remoteUser != null ) { user=remoteUser; M_log.info(String.format("The session id \"%s\" of Service Desk Person with uniqname \"%s\" issuing the request" ,sessionId,remoteUser)); } isAuthorized=ldapAuthorizationVerification(user); return isAuthorized; }

Target:
private boolean checkForAuthorization(HttpServletRequest request) { M_log.debug("checkLdapForAuthorization(): called"); String remoteUser = request.getRemoteUser(); String testUser = request.getParameter(TEST_USER); boolean isAuthorized = false; String user=null; String testUserInSession = (String)request.getSession().getAttribute(TEST_USER); String sessionId = request.getSession().getId(); if ( isTestUrlEnabled && testUser != null ) { user=testUser; request.getSession().setAttribute(TEST_USER, testUser); } else if ( isTestUrlEnabled && testUserInSession != null ){ user=testUserInSession; } if ( !isAuthorized && remoteUser != null ) { user=remoteUser; M_log.info(String.format("The session id \"%s\" of Service Desk Person with uniqname \"%s\" issuing the request" ,sessionId,remoteUser)); } isAuthorized=ldapAuthorizationVerification(user); return isAuthorized; }
Source:
private FactorComparator(String factorName, int weight, Comparator<T> comparator){ this.factorName = factorName; this.weight = weight; this.comparator = comparator; logger.info("comparator created for " + this.factorName); }

Target:
private FactorComparator(String factorName, int weight, Comparator<T> comparator){ this.factorName = factorName; this.weight = weight; this.comparator = comparator; }
Source:
private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); try { client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } }

Target:
private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); if (client == null){ log.error("cannot initialize client, null pointer"); return; } try { client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } }
Source:
public Builder addMessageSource(String messageSourceId, StreamableMessageSource<TrackedEventMessage<?>> messageSource) { BuilderUtils.assertThat(messageSourceId, sourceName -> !messageSourceMap.containsKey(sourceName), "the messageSource name must be unique"); messageSourceMap.put(messageSourceId, messageSource); return this; }

Target:
public Builder addMessageSource(String messageSourceId, StreamableMessageSource<TrackedEventMessage<?>> messageSource) { assertThat(messageSourceId, sourceName -> !messageSourceMap.containsKey(sourceName), "the messageSource name must be unique"); messageSourceMap.put(messageSourceId, messageSource); return this; }
Source:
public static void waitForStaleTransactions() throws Exception { SpliceWatcher methodWatcher = new SpliceWatcher(null); boolean failOnError = false; waitForStaleTransactions(methodWatcher, "Test", 5, failOnError); methodWatcher.closeAll(); }

Target:
public static void waitForStaleTransactions() { SpliceWatcher methodWatcher = new SpliceWatcher(null); boolean failOnError = false; waitForStaleTransactions(methodWatcher, "Test", 5, failOnError); methodWatcher.closeAll(); }
Source:
private void hideLevelButton() { levelButtonsShowing = false; AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f); animation.setDuration(500); levelButtons.startAnimation(animation); levelButtons.setVisibility(View.GONE); }

Target:
private void hideLevelButton() { AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f); animation.setDuration(500); levelButtons.startAnimation(animation); levelButtons.setVisibility(View.GONE); }
Source:
public HttpPanelSyntaxHighlightTextArea() { ((RSyntaxDocument) getDocument()).setTokenMakerFactory(getTokenMakerFactory()); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE); syntaxStyles = new Vector<>(); addSyntaxStyle(PLAIN_SYNTAX_LABEL, SyntaxConstants.SYNTAX_STYLE_NONE); if (syntaxMenu == null) { initActions(); } setPopupMenu(null); this.message = null; setHyperlinksEnabled(false); setAntiAliasingEnabled(true); setLineWrap(true); setHighlightCurrentLine(false); setFadeCurrentLineHighlight(false); setWhitespaceVisible(false); setEOLMarkersVisible(false); setMarkOccurrences(false); setBracketMatchingEnabled(false); setAnimateBracketMatching(false); setAutoIndentEnabled(false); setCloseCurlyBraces(false); setCloseMarkupTags(false); setClearWhitespaceLinesEnabled(false); this.setFont( FontUtils.getFontWithFallback(FontType.workPanels, this.getFont().getFontName())); if (DisplayUtils.isDarkLookAndFeel()) { try { Theme theme = Theme.load( getClass() .getResourceAsStream( "/org/fife/ui/rsyntaxtextarea/themes/dark.xml")); theme.apply(this); } catch (IOException e) { log.error("Failed to set RSyntaxTextArea dark theme", e); } } initHighlighter(); }

Target:
public HttpPanelSyntaxHighlightTextArea() { ((RSyntaxDocument) getDocument()).setTokenMakerFactory(getTokenMakerFactory()); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE); syntaxStyles = new Vector<>(); addSyntaxStyle(PLAIN_SYNTAX_LABEL, SyntaxConstants.SYNTAX_STYLE_NONE); if (syntaxMenu == null) { initActions(); } setPopupMenu(null); this.message = null; setHyperlinksEnabled(false); setAntiAliasingEnabled(true); setLineWrap(true); setHighlightCurrentLine(false); setFadeCurrentLineHighlight(false); setWhitespaceVisible(false); setEOLMarkersVisible(false); setMarkOccurrences(false); setBracketMatchingEnabled(false); setAnimateBracketMatching(false); setAutoIndentEnabled(false); setCloseCurlyBraces(false); setCloseMarkupTags(false); setClearWhitespaceLinesEnabled(false); this.setFont( FontUtils.getFontWithFallback(FontType.workPanels, this.getFont().getFontName())); if (DisplayUtils.isDarkLookAndFeel()) { try { Theme theme = Theme.load( HttpPanelSyntaxHighlightTextArea.class.getResourceAsStream( "/org/fife/ui/rsyntaxtextarea/themes/dark.xml")); theme.apply(this); } catch (IOException e) { log.error("Failed to set RSyntaxTextArea dark theme", e); } } initHighlighter(); }
Source:
public void tearDown() throws Exception { uninstallShimApexIfNecessary(); getDevice().deleteFile(SYSTEM_TRIGGER_WATCHDOG_RC); getDevice().deleteFile(SYSTEM_TRIGGER_WATCHDOG_SH); }

Target:
public void tearDown() throws Exception { uninstallShimApexIfNecessary(); ITestDevice device = getDevice(); if (device.doesFileExist(SYSTEM_TRIGGER_WATCHDOG_RC) || device.doesFileExist(SYSTEM_TRIGGER_WATCHDOG_SH)) { device.remountSystemWritable(); device.deleteFile(SYSTEM_TRIGGER_WATCHDOG_RC); device.deleteFile(SYSTEM_TRIGGER_WATCHDOG_SH); } }
Source:
public synchronized Collection<MetaAnnotation> getAnnotations() { final Annotation[] array; if (_annotationsCache != null) { array = _annotationsCache; } else { array = _annotationsCache = getEnclosedMetaObject().getAnnotations(); } return Arrays.stream(array).map(JavaReflectionAnnotation::new).collect(Collectors.toList()); }

Target:
public synchronized Collection<MetaAnnotation> getAnnotations() { return Arrays.stream(getEnclosedMetaObject().getAnnotations()).map(JavaReflectionAnnotation::new).collect(toList()); }
Source:
List<Message> validateConditions() throws IOException, WorkbookParserException { final List<Message> messageList = new ArrayList<>(); final Workbook wb = this.etlService.retrieveCurrentWorkbook(this.userSelection); if (wb.getNumberOfSheets() > 1) { final Sheet sheet1 = wb.getSheetAt(ETLServiceImpl.DESCRIPTION_SHEET); if (sheet1 != null && "Description".equalsIgnoreCase(sheet1.getSheetName())) { final org.generationcp.middleware.domain.etl.Workbook referenceWorkbook = this.dataImportService .parseWorkbookDescriptionSheet(wb, this.contextUtil.getCurrentIbdbUserId()); final List<String> variableWithWrongPSM = new ArrayList<>(); for(MeasurementVariable measurementVariable: referenceWorkbook.getConditions()) { final Term term = this.termDataManager.getTermByNameAndCvId(measurementVariable.getName(), CvId.VARIABLES.getId()); if(term != null) { Variable variable = this.ontologyVariableDataManager.getVariable(this.contextUtil.getCurrentProgramUUID(), term.getId(), true); if (variable != null && this.variableHasWrongPSM(measurementVariable, variable)) { variableWithWrongPSM.add(measurementVariable.getName()); } } } if(!variableWithWrongPSM.isEmpty()) { messageList.add(new Message("error.variable.wrong.psm", StringUtils.join(variableWithWrongPSM, ", "))); } } } return messageList; }

Target:
List<Message> validateConditions() throws IOException, WorkbookParserException { final List<Message> messageList = new ArrayList<>(); final Workbook wb = this.etlService.retrieveCurrentWorkbook(this.userSelection); if (wb.getNumberOfSheets() > 1) { final Sheet sheet1 = wb.getSheetAt(ETLServiceImpl.DESCRIPTION_SHEET); if (AngularSelectSheetController.DESCRIPTION.equalsIgnoreCase(sheet1.getSheetName())) { final org.generationcp.middleware.domain.etl.Workbook referenceWorkbook = this.dataImportService .parseWorkbookDescriptionSheet(wb, this.contextUtil.getCurrentIbdbUserId()); final List<String> variablesWithWrongPSM = new ArrayList<>(); for(MeasurementVariable measurementVariable: referenceWorkbook.getConditions()) { Set<StandardVariable> standardVariables = this.ontologyDataManager.findStandardVariablesByNameOrSynonym(measurementVariable.getName(), this.contextUtil.getCurrentProgramUUID()); if(!CollectionUtils.isEmpty(standardVariables) && this.variableHasWrongPSM(measurementVariable, standardVariables)) { variablesWithWrongPSM.add(measurementVariable.getName()); } } if(!variablesWithWrongPSM.isEmpty()) { messageList.add(new Message("error.variable.wrong.psm", StringUtils.join(variablesWithWrongPSM, ", "))); } } } return messageList; }
Source:
private String getDerivedOriginalFileName() { FileMetadata fm = getFileMetadata(); String filename = fm.getLabel(); String originalExtension = FileUtil.generateOriginalExtension(getOriginalFileFormat()); String extensionToRemove = StringUtil.substringIncludingLast(filename, "."); if (StringUtil.nonEmpty(extensionToRemove)) { String newFileName = filename.replace(extensionToRemove, originalExtension); return newFileName; } return filename; }

Target:
private String getDerivedOriginalFileName() { FileMetadata fm = getFileMetadata(); String filename = fm.getLabel(); String originalExtension = FileUtil.generateOriginalExtension(getOriginalFileFormat()); String extensionToRemove = StringUtil.substringIncludingLast(filename, "."); if (StringUtil.nonEmpty(extensionToRemove)) { return filename.replaceAll(extensionToRemove + "$", originalExtension); } else{ return filename + originalExtension ; } }
Source:
private void transactionInfo(GridClient client, VisorTxTaskArg arg) throws GridClientException { IgniteProductVersion ver = FetchNearXidVersionTask.TX_INFO_SINCE_VER; validateProductVersion(client, ver); GridCacheVersion nearXidVer = executeTask(client, FetchNearXidVersionTask.class, arg.txInfoArgument()); boolean histMode = false; if (nearXidVer != null) { log("Resolved transaction near XID version: " + nearXidVer); arg.txInfoArgument(new TxVerboseId(null, nearXidVer)); } else { log("Active transactions not found."); if (arg.txInfoArgument().gridCacheVersion() != null) { log("Will try to peek history to find out whether transaction was committed / rolled back."); histMode = true; } else { log("You can specify transaction in GridCacheVersion format in order to peek history " + "to find out whether transaction was committed / rolled back."); return; } } Map<ClusterNode, VisorTxTaskResult> res = executeTask(client, VisorTxTask.class, arg); lastOperationRes = res; if (histMode) printTxInfoHistoricalResult(res); else printTxInfoResult(res); }

Target:
private void transactionInfo(GridClient client, VisorTxTaskArg arg) throws GridClientException { checkFeatureSupportedByCluster(client, IgniteFeatures.TX_INFO_COMMAND, true); GridCacheVersion nearXidVer = executeTask(client, FetchNearXidVersionTask.class, arg.txInfoArgument()); boolean histMode = false; if (nearXidVer != null) { log("Resolved transaction near XID version: " + nearXidVer); arg.txInfoArgument(new TxVerboseId(null, nearXidVer)); } else { log("Active transactions not found."); if (arg.txInfoArgument().gridCacheVersion() != null) { log("Will try to peek history to find out whether transaction was committed / rolled back."); histMode = true; } else { log("You can specify transaction in GridCacheVersion format in order to peek history " + "to find out whether transaction was committed / rolled back."); return; } } Map<ClusterNode, VisorTxTaskResult> res = executeTask(client, VisorTxTask.class, arg); lastOperationRes = res; if (histMode) printTxInfoHistoricalResult(res); else printTxInfoResult(res); }
Source:
public String getLocalName() { String hostName = exchange.getDestinationAddress().getHostName(); if (hostName == null) { return exchange.getDestinationAddress().getHostString(); } return hostName; }

Target:
public String getLocalName() { return exchange.getDestinationAddress().getHostName(); }
Source:
public MBObjectStops(MBLayer layer) { try { if(getStops(layer.getPaint()) || getStops(layer.getPaint())){ stops = getStopLevels(layer); layersForStop = getLayerStyleForStops(layer, stops); ranges = getStopLevelRanges(stops); } } catch (ParseException e) { System.out.println(e.getLocalizedMessage()); } }

Target:
public MBObjectStops(MBLayer layer) { try { if (layer.getPaint() != null) { hasStops = getStops(layer.getPaint()); } if (layer.getLayout() != null) { hasStops = getStops(layer.getLayout()); } if (hasStops) { stops = getStopLevels(layer); layersForStop = getLayerStyleForStops(layer, stops); ranges = getStopLevelRanges(stops); } } catch (ParseException e) { System.out.println(e.getLocalizedMessage()); } }
Source:
public JSONArray getTargetedSequencingTypes(Long libraryPrepKitId) throws IOException { Collection<TargetedSequencing> targetedSequencings = getNonArchivedTargetedSequencing( requestManager.listAllTargetedSequencing()); JSONArray fullTargetedSequencingCollection = new JSONArray(); JSONArray targetedSequencingByKit = new JSONArray(); for (TargetedSequencing targetedSequencing : targetedSequencings) { Map<String, Object> targetedSequencingMap = Maps.newHashMap(); targetedSequencingMap.put("targetedSequencingId", targetedSequencing.getId()); targetedSequencingMap.put("alias", targetedSequencing.getAlias()); for (KitDescriptor kitDescriptor : targetedSequencing.getKitDescriptors()) { targetedSequencingMap.put("kitDescriptorId", kitDescriptor.getId()); fullTargetedSequencingCollection.add(targetedSequencingMap); if (libraryPrepKitId != null && libraryPrepKitId.equals(kitDescriptor.getId())) { targetedSequencingByKit.add(targetedSequencingMap); } } } if (libraryPrepKitId != null) { return targetedSequencingByKit; } else { return fullTargetedSequencingCollection; } }

Target:
public JSONArray getTargetedSequencingTypes(Long libraryPrepKitId) throws IOException { JSONArray targetedSequencingByKit = new JSONArray(); for (TargetedSequencing targetedSequencing : getNonArchivedTargetedSequencing( kitService.getKitDescriptorById(libraryPrepKitId).getTargetedSequencing())) { Map<String, Object> targetedSequencingMap = Maps.newHashMap(); targetedSequencingMap.put("targetedSequencingId", targetedSequencing.getId()); targetedSequencingMap.put("alias", targetedSequencing.getAlias()); targetedSequencingMap.put("kitDescriptorId", libraryPrepKitId); targetedSequencingByKit.add(targetedSequencingMap); } return targetedSequencingByKit; }
Source:
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { if (e.getMessage() instanceof ThriftMessage) { ThriftMessage message = (ThriftMessage) e.getMessage(); if (taskTimeoutMillis > 0 || queueTimeoutMillis > 0) { message.setProcessStartTimeMillis(System.currentTimeMillis()); } checkResponseOrderingRequirements(ctx, message); TNiftyTransport messageTransport = new TNiftyTransport(ctx.getChannel(), message); TTransportPair transportPair = TTransportPair.fromSingleTransport(messageTransport); TProtocolPair protocolPair = duplexProtocolFactory.getProtocolPair(transportPair); TProtocol inProtocol = protocolPair.getInputProtocol(); TProtocol outProtocol = protocolPair.getOutputProtocol(); processRequest(ctx, message, messageTransport, inProtocol, outProtocol); } else { ctx.sendUpstream(e); } }

Target:
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { if (e.getMessage() instanceof ThriftMessage) { ThriftMessage message = (ThriftMessage) e.getMessage(); message.setProcessStartTimeMillis(System.currentTimeMillis()); checkResponseOrderingRequirements(ctx, message); TNiftyTransport messageTransport = new TNiftyTransport(ctx.getChannel(), message); TTransportPair transportPair = TTransportPair.fromSingleTransport(messageTransport); TProtocolPair protocolPair = duplexProtocolFactory.getProtocolPair(transportPair); TProtocol inProtocol = protocolPair.getInputProtocol(); TProtocol outProtocol = protocolPair.getOutputProtocol(); processRequest(ctx, message, messageTransport, inProtocol, outProtocol); } else { ctx.sendUpstream(e); } }
Source:
private CodecConfigurationException setError(final Exception cause) { return new CodecConfigurationException(format("Unable to get value for property '%s' in %s", propertyMetadata.getName(), propertyMetadata.getTypeData().getType()), cause); }

Target:
private CodecConfigurationException setError(final Exception cause) { return new CodecConfigurationException(format("Unable to set value for property '%s' in %s", propertyMetadata.getName(), propertyMetadata.getDeclaringClassName()), cause); }
Source:
private Object readProperty(Node otherNode, String targetColumnName) { Object value = null; otherNode.getAllProperties(); if ( otherNode.hasProperty( targetColumnName ) ) { value = otherNode.getProperty( targetColumnName ); } return value; }

Target:
private Object readProperty(Node otherNode, String targetColumnName) { Object value = null; if ( otherNode.hasProperty( targetColumnName ) ) { value = otherNode.getProperty( targetColumnName ); } return value; }
Source:
public TryCastFunction() { super(new Signature( "TRY_CAST", FunctionKind.SCALAR, ImmutableList.of(typeVariable("F"), typeVariable("T")), ImmutableList.of(), parseTypeSignature("T"), ImmutableList.of(parseTypeSignature("F")), false)); }

Target:
public TryCastFunction() { super(new Signature( TRY_CAST_NAME, FunctionKind.SCALAR, ImmutableList.of(typeVariable("F"), typeVariable("T")), ImmutableList.of(), parseTypeSignature("T"), ImmutableList.of(parseTypeSignature("F")), false)); }
Source:
public boolean canAccessAll(Collection targets, SubResource subResource, Access access) { if (targets == null || targets.isEmpty()) { log.debug( "{} principal checking for access to sub-resource: {}." + " Access to null or resource tried", this.getClass().getName(), access, subResource); return canAccess(null, subResource, access); } log.debug("{} principal checking for access to targets: sub-resource: {}", this.getClass() .getName(), access, Arrays.toString(targets.toArray()), subResource); if (hasFullAccess()) { return true; } for (Object target : targets) { if (!canAccess(target, subResource, access)) { return false; } } return true; }

Target:
public boolean canAccessAll(Collection targets, SubResource subResource, Access access) { if (CollectionUtils.isEmpty(targets)) { log.debug( "{} principal checking for access to sub-resource: {}." + " Access to null or resource tried", this.getClass().getName(), access, subResource); return canAccess(null, subResource, access); } log.debug("{} principal checking for access to targets: sub-resource: {}", this.getClass() .getName(), access, Arrays.toString(targets.toArray()), subResource); if (hasFullAccess()) { return true; } for (Object target : targets) { if (!canAccess(target, subResource, access)) { return false; } } return true; }
Source:
public ValidationResult isUsingScsiReservationValid(VM vm, LunDisk lunDisk) { if (vm == null && lunDisk.isUsingScsiReservation() != null && lunDisk.isUsingScsiReservation()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK); } if (lunDisk.isUsingScsiReservation() != null && lunDisk.isUsingScsiReservation() && lunDisk.getSgio() == ScsiGenericIO.FILTERED) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED); } return ValidationResult.VALID; }

Target:
public ValidationResult isUsingScsiReservationValid(VM vm, LunDisk lunDisk) { if (vm == null && Boolean.TRUE.equals(lunDisk.isUsingScsiReservation())) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK); } if (lunDisk.isUsingScsiReservation() != null && lunDisk.isUsingScsiReservation() && lunDisk.getSgio() == ScsiGenericIO.FILTERED) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED); } return ValidationResult.VALID; }
Source:
public void testSanitizeForSaving() { AccountAttributes actualAccount = createAccountAttributesToSanitize(); AccountAttributes expectedAccount = actualAccount.getCopy(); actualAccount.sanitizeForSaving(); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.googleId), actualAccount.googleId); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.name), actualAccount.name); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.email), actualAccount.email); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.institute), actualAccount.institute); expectedAccount.studentProfile.sanitizeForSaving(); assertEquals(expectedAccount.studentProfile.toString(), actualAccount.studentProfile.toString()); }

Target:
public void testSanitizeForSaving() { AccountAttributes actualAccount = createAccountAttributesToSanitize(); AccountAttributes expectedAccount = createAccountAttributesToSanitize(); actualAccount.sanitizeForSaving(); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.googleId), actualAccount.googleId); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.name), actualAccount.name); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.email), actualAccount.email); assertEquals(SanitizationHelper.sanitizeForHtml(expectedAccount.institute), actualAccount.institute); expectedAccount.studentProfile.sanitizeForSaving(); assertEquals(expectedAccount.studentProfile.toString(), actualAccount.studentProfile.toString()); }
Source:
public boolean rename(String oldLayerName, String newLayerName) throws StorageException; public String getLayerMetadata(String layerName, String key); public void putLayerMetadata(String layerName, String key, String value); public boolean layerExists(String layerName); Map<String,Optional<Map<String, String>>> getParametersMapping(String layerName); public default boolean purgeOrphans(TileLayer layer) throws StorageException { try{ final List<ParameterFilter> parameterFilters = layer.getParameterFilters(); return getParametersMapping(layer.getName()).entrySet().stream() .filter(parameterMapping -> { return parameterMapping.getValue() .map(parameters-> { return parameters.size() != parameterFilters.size() || parameterFilters.stream() .allMatch(pfilter -> { final String key = pfilter.getKey(); final String value = parameters.get(key); if(Objects.isNull(value)) { return true; } return !pfilter.isFilteredValue(value); }); }) .orElse(true); }) .map(Map.Entry::getKey) .map(id->{ try { return this.deleteByParametersId(layer.getName(), id); } catch (StorageException e) { throw new UncheckedIOException(e); } }) .reduce((x,y)->x||y) .orElse(false); } catch (UncheckedIOException ex) { if(ex.getCause() instanceof StorageException) { throw (StorageException) ex.getCause(); } else { throw ex; } } }

Target:
public boolean rename(String oldLayerName, String newLayerName) throws StorageException; public String getLayerMetadata(String layerName, String key); public void putLayerMetadata(String layerName, String key, String value); public boolean layerExists(String layerName); Map<String,Optional<Map<String, String>>> getParametersMapping(String layerName); public default boolean purgeOrphans(TileLayer layer) throws StorageException { try{ final List<ParameterFilter> parameterFilters = layer.getParameterFilters(); final Function<Map<String,String>, Boolean> parametersNeedPurge = parameters-> { return parameters.size() != parameterFilters.size() || parameterFilters.stream() .allMatch(pfilter -> { final String key = pfilter.getKey(); final String value = parameters.get(key); if(Objects.isNull(value)) { return true; } return !pfilter.isFilteredValue(value); }); }; return getParametersMapping(layer.getName()).entrySet().stream() .filter(parameterMapping -> { return parameterMapping.getValue() .map(parametersNeedPurge) .orElse(true); }) .map(Map.Entry::getKey) .map(id->{ try { return this.deleteByParametersId(layer.getName(), id); } catch (StorageException e) { throw new UncheckedIOException(e); } }) .reduce((x,y)->x||y) .orElse(false); } catch (UncheckedIOException ex) { if(ex.getCause() instanceof StorageException) { throw (StorageException) ex.getCause(); } else { throw ex; } } }
Source:
public void refreshLogs() { currentPage = 1; loadTaskLogs(); displayVisibleLogs(); }

Target:
public void refreshLogs() { currentPage = 0; loadTaskLogs(); }
Source:
public static boolean isNotEmpty(@Nullable String str) { return str != null && !str.isEmpty(); }

Target:
private static boolean isNotEmpty(@Nullable String str) { return str != null && !str.isEmpty(); }
Source:
private IBreakpoint breakpointAtLineNumber(Location location) { if (fBreakpoints == null || location == null || location == Location.UNKNOWN_LOCATION) { return null; } int lineNumber = fDebugState.getLineNumber(location); File locationFile = new File(fDebugState.getFileName(location)); for (IBreakpoint fBreakpoint : fBreakpoints) { ILineBreakpoint breakpoint = (ILineBreakpoint) fBreakpoint; int breakpointLineNumber; try { if (!breakpoint.isEnabled()) { continue; } breakpointLineNumber = breakpoint.getLineNumber(); } catch (CoreException e) { return null; } IFile resource = (IFile) breakpoint.getMarker().getResource(); if (breakpointLineNumber == lineNumber && resource.getLocation().toFile().equals(locationFile)) { return breakpoint; } } return null; }

Target:
private IBreakpoint breakpointAtLineNumber(Location location) { if (fBreakpoints == null || location == null || location == Location.UNKNOWN_LOCATION) { return null; } int lineNumber = fDebugState.getLineNumber(location); File locationFile = new File(fDebugState.getFileName(location)); for (IBreakpoint bp : fBreakpoints) { ILineBreakpoint breakpoint = (ILineBreakpoint) bp; int breakpointLineNumber; try { if (!breakpoint.isEnabled()) { continue; } breakpointLineNumber = breakpoint.getLineNumber(); } catch (CoreException e) { return null; } IFile resource = (IFile) breakpoint.getMarker().getResource(); if (breakpointLineNumber == lineNumber && resource.getLocation().toFile().equals(locationFile)) { return breakpoint; } } return null; }
Source:
public InputContent parseInputStream( InputStream inputStream, Boolean strict ) throws IOException, ReadException { Description description = deserialize(new InputStreamReader(inputStream), strict); Content content = complexify(description); return new InputContent(content, description.getType()); }

Target:
public InputContent parseInputStream( InputStream inputStream, Boolean strict ) throws IOException, ReadException { Description description = deserialize(new InputStreamReader(inputStream), strict); Content content = complexify(description); return InputContent.create(content, description.getType()); }