auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private DashboardResource typeOf(ProjectControl ctl, Project.DashboardType type) throws ResourceNotFoundException, IOException, ConfigInvalidException { String id = ctl.getProject().getLocalDashboard(type); if (Strings.isNullOrEmpty(id)) { id = ctl.getProject().getDashboard(type); } type = Project.DashboardType.fromId(id); if (type != null) { throw new ResourceNotFoundException(); } else if (!Strings.isNullOrEmpty(id)) { return dashboards.parse(new ProjectResource(ctl), id); } else if (!inherited) { throw new ResourceNotFoundException(); } Set<Project.NameKey> seen = Sets.newHashSet(); seen.add(ctl.getProject().getNameKey()); ProjectState ps = ctl.getProjectState().getParentState(); while (ps != null && seen.add(ps.getProject().getNameKey())) { id = ps.getProject().getDashboard(type); type = Project.DashboardType.fromId(id); if (type != null) { throw new ResourceNotFoundException(); } else if (!Strings.isNullOrEmpty(id)) { ctl = ps.controlFor(ctl.getCurrentUser()); return dashboards.parse(new ProjectResource(ctl), id); } ps = ps.getParentState(); } throw new ResourceNotFoundException(); }

Target:
private DashboardResource typeOf(ProjectControl ctl, Project.DashboardType type) throws ResourceNotFoundException, IOException, ConfigInvalidException { String id = ctl.getProject().getLocalDashboard(type); if (Strings.isNullOrEmpty(id)) { id = ctl.getProject().getDashboard(type); } if (Project.DashboardType.fromId(id) != null) { throw new ResourceNotFoundException(); } else if (!Strings.isNullOrEmpty(id)) { return dashboards.parse(new ProjectResource(ctl), id); } else if (!inherited) { throw new ResourceNotFoundException(); } Set<Project.NameKey> seen = Sets.newHashSet(); seen.add(ctl.getProject().getNameKey()); ProjectState ps = ctl.getProjectState().getParentState(); while (ps != null && seen.add(ps.getProject().getNameKey())) { id = ps.getProject().getDashboard(type); if (Project.DashboardType.fromId(id) != null) { throw new ResourceNotFoundException(); } else if (!Strings.isNullOrEmpty(id)) { ctl = ps.controlFor(ctl.getCurrentUser()); return dashboards.parse(new ProjectResource(ctl), id); } ps = ps.getParentState(); } throw new ResourceNotFoundException(); }
Source:
public MerlinBuilder withLogging(boolean withLogging) { Logger.detachAll(); Logger.attach(new MerlinBackwardsCompatibleLog(withLogging)); return this; }

Target:
public MerlinBuilder withLogging(boolean withLogging) { Logger.detach(MerlinBackwardsCompatibleLog.getInstance()); if (withLogging) { Logger.attach(MerlinBackwardsCompatibleLog.getInstance()); } return this; }
Source:
private ValidationResult validateSnapshotsLegality() { List<DiskImage> diskImages = getDiskImageDao().getAllSnapshotsForVmSnapshot(getParameters().getSnapshotId()); if (diskImages.stream().filter(img -> img.getImageStatus() == ImageStatus.ILLEGAL).findAny().isPresent()) { return ValidationResult.VALID; } List<Guid> otherSnapshotsId = getSnapshotDao().getAll(getVmId()). stream(). map(Snapshot::getId). filter(id -> !id.equals(getParameters().getSnapshotId())). collect(Collectors.toList()); for (Guid snapshotId : otherSnapshotsId) { diskImages = getDiskImageDao().getAllSnapshotsForVmSnapshot(snapshotId); if (diskImages.stream().filter(img -> img.getImageStatus() == ImageStatus.ILLEGAL).findAny().isPresent()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_WITH_ILLEGAL_VOLUME_EXISTS, String.format("$snapshot %s", getSnapshotDao().get(getParameters().getSnapshotId()).getDescription())); } } return ValidationResult.VALID; }

Target:
private ValidationResult validateSnapshotsLegality() { List<Snapshot> otherSnapshots = getSnapshotDao().getAll(getVmId()). stream(). filter(snapshot -> !snapshot.getId().equals(getParameters().getSnapshotId())). collect(Collectors.toList()); for (Snapshot snapshot : otherSnapshots) { List<DiskImage> diskImages = getDiskImageDao().getAllSnapshotsForVmSnapshot(snapshot.getId()); if (diskImages.stream().filter(img -> img.getImageStatus() == ImageStatus.ILLEGAL).findAny().isPresent()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_WITH_ILLEGAL_VOLUME_EXISTS, String.format("$snapshot %s", snapshot.getDescription())); } } return ValidationResult.VALID; }
Source:
protected String getVdsSearchString(final MoveHost moveHost) { StringBuilder buf = new StringBuilder("Host: "); int i = 0; for (MoveHostData hostData : moveHost.getSelectedHosts()) { if (i > 0) { buf.append(" or "); } buf.append("name = "); buf.append(hostData.getEntity().getName()); i++; } return buf.toString(); }

Target:
protected String getVdsSearchString(final MoveHost moveHost) { StringBuilder buf = new StringBuilder("Host: "); for (MoveHostData hostData : moveHost.getSelectedHosts()) { if ((buf.length()) > 6) { buf.append(" or "); } buf.append("name = "); buf.append(hostData.getEntity().getName()); } return buf.toString(); }
Source:
public void numericKeysTest() { onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); onBrickAtPosition(1).checkShowsText(R.string.brick_change_size_by); onBrickAtPosition(1).perform(click()); onView(withId(R.id.formula_editor_keyboard_1)).perform(click()); onView(withId(R.id.formula_editor_keyboard_2)).perform(click()); onView(withId(R.id.formula_editor_keyboard_3)).perform(click()); onView(withId(R.id.formula_editor_keyboard_4)).perform(click()); onView(withId(R.id.formula_editor_keyboard_5)).perform(click()); onView(withId(R.id.formula_editor_keyboard_6)).perform(click()); onView(withId(R.id.formula_editor_keyboard_7)).perform(click()); onView(withId(R.id.formula_editor_keyboard_8)).perform(click()); onView(withId(R.id.formula_editor_keyboard_9)).perform(click()); onView(withId(R.id.formula_editor_keyboard_0)).perform(click()); onView(withId(R.id.formula_editor_keyboard_decimal_mark)).perform(click()); onView(withId(R.id.formula_editor_keyboard_1)).perform(click()); onView(withId(R.id.formula_editor_keyboard_ok)).perform(click()); onView(withId(R.id.formula_editor_edit_field)) .check(matches(withText("1234567890" + UiTestUtils.getResourcesString(R.string.formula_editor_decimal_mark) + "1 "))); }

Target:
public void numericKeysTest() { onBrickAtPosition(0) .checkShowsText(R.string.brick_when_started); onBrickAtPosition(1) .checkShowsText(R.string.brick_change_size_by); onBrickAtPosition(1) .onChildView(withId(R.id.brick_change_size_by_edit_text)).perform(click()); onView(withId(R.id.formula_editor_keyboard_1)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_2)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_3)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_4)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_5)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_6)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_7)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_8)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_9)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_0)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_decimal_mark)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_1)) .perform(click()); onView(withId(R.id.formula_editor_keyboard_ok)) .perform(click()); onView(withId(R.id.formula_editor_edit_field)) .check(matches(withText("1234567890" + UiTestUtils.getResourcesString(R.string.formula_editor_decimal_mark) + "1 "))); }
Source:
public SimpleString getAddressSimpleString() { if (address == null) { address = createExtraProperties().getSimpleStringProperty(ADDRESS_PROPERTY); if (address != null) { return address; } Properties properties = getProperties(); if (properties != null && properties.getTo() != null) { address = cachedAddressSimpleString(properties.getTo()); return address; } } return address; }

Target:
public SimpleString getAddressSimpleString() { if (address == null) { TypedProperties extraProperties = getExtraProperties(); if (extraProperties != null) { address = extraProperties.getSimpleStringProperty(ADDRESS_PROPERTY); } if (address == null) { Properties properties = getProperties(); if (properties != null && properties.getTo() != null) { address = cachedAddressSimpleString(properties.getTo()); } } } return address; }
Source:
public boolean shouldBeRecursive() { return shouldBeRecursive; }

Target:
public boolean shouldBeRecursive() { return !prefixes.isEmpty(); }
Source:
private <R> R accessInner(ICorfuSMRAccess<R, T> accessMethod, Object[] conflictObject) { if (TransactionalContext.isInTransaction()) { try { return TransactionalContext.getCurrentContext() .access(this, accessMethod, conflictObject); } catch (Exception e) { log.error("Access[{}]", this, e); this.abortTransaction(e); } } AtomicLong timestamp = new AtomicLong(rt.getSequencerView().query(getStreamID())); log.debug("Access[{}] conflictObj={} version={}", this, conflictObject, timestamp); return underlyingObject.access(o -> o.getVersionUnsafe() >= timestamp.get() && !o.isOptimisticallyModifiedUnsafe(), o -> { for (int x = 0; x < rt.getParameters().getTrimRetry(); x++) { try { timestamp.set(rt.getSequencerView() .query(getStreamID())); o.syncObjectUnsafe(timestamp.get()); } catch (TrimmedException te) { log.info("accessInner: Encountered trimmed address space " + "while accessing version of stream on attempt {}", timestamp.get(), getStreamID(), x); o.resetUnsafe(); if (x == rt.getParameters().getTrimRetry()) { throw te; } } } }, o -> accessMethod.access(o)); }

Target:
private <R> R accessInner(ICorfuSMRAccess<R, T> accessMethod, Object[] conflictObject) { if (TransactionalContext.isInTransaction()) { try { return TransactionalContext.getCurrentContext() .access(this, accessMethod, conflictObject); } catch (Exception e) { log.error("Access[{}]", this, e); this.abortTransaction(e); } } AtomicLong timestamp = new AtomicLong(rt.getSequencerView().query(getStreamID())); log.debug("Access[{}] conflictObj={} version={}", this, conflictObject, timestamp); return underlyingObject.access(o -> o.getVersionUnsafe() >= timestamp.get() && !o.isOptimisticallyModifiedUnsafe(), o -> { for (int x = 0; x < rt.getParameters().getTrimRetry(); x++) { try { o.syncObjectUnsafe(timestamp.get()); break; } catch (TrimmedException te) { log.info("accessInner: Encountered trimmed address space " + "while accessing version of stream on attempt {}", timestamp.get(), getStreamID(), x); o.resetUnsafe(); if (x == (rt.getParameters().getTrimRetry() - 1)) { throw te; } timestamp.set(rt.getSequencerView().query(getStreamID())); } } }, o -> accessMethod.access(o)); }
Source:
public static void cleanupMiniDFS() throws Exception { dfsCluster.shutdown(); TEMP_FOLDER.delete(); if (sshServer != null) { sshServer.stop(); } }

Target:
public static void cleanupMiniDFS() throws Exception { dfsCluster.shutdown(); if (sshServer != null) { sshServer.stop(); } }
Source:
public ImportResult<Transaction> findOrImportTransaction(final Xid xid, final int timeout, final boolean doNotImport) throws XAException { try { final SimpleXid simpleXid = SimpleXid.of(xid); final SimpleXid gtid = simpleXid.withoutBranch(); final ConcurrentMap<SimpleXid, Entry> known = JBossLocalTransactionProvider.this.known; Entry entry = known.get(gtid); if (entry != null) { return new ImportResult<Transaction>(entry.getTransaction(), entry, false); } boolean imported; Transaction transaction; if (doNotImport) { imported = false; transaction = ext.getTransaction(xid); if(transaction == null) { ext.doRecover(null, null); final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction(); } if (transaction == null) { return null; } } else { final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction(); } entry = getEntryFor(transaction, gtid); final Entry appearing = known.putIfAbsent(gtid, entry); if (appearing != null) { return new ImportResult<Transaction>(transaction, appearing, imported); } else { return new ImportResult<Transaction>(transaction, entry, imported); } } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } }

Target:
public ImportResult<Transaction> findOrImportTransaction(final Xid xid, final int timeout, final boolean doNotImport) throws XAException { try { final SimpleXid simpleXid = SimpleXid.of(xid); final SimpleXid gtid = simpleXid.withoutBranch(); final ConcurrentMap<SimpleXid, Entry> known = JBossLocalTransactionProvider.this.known; Entry entry = known.get(gtid); if (entry != null) { return new ImportResult<Transaction>(entry.getTransaction(), entry, false); } final boolean imported; Transaction transaction; if (doNotImport) { imported = false; transaction = ext.getTransaction(xid); if(transaction == null) { ext.doRecover(null, null); transaction = ext.getTransaction(xid); } if (transaction == null) { return null; } } else { final TransactionImportResult result = ext.importTransaction(xid, timeout); transaction = result.getTransaction(); imported = result.isNewImportedTransaction(); } entry = getEntryFor(transaction, gtid); final Entry appearing = known.putIfAbsent(gtid, entry); if (appearing != null) { return new ImportResult<Transaction>(transaction, appearing, imported); } else { return new ImportResult<Transaction>(transaction, entry, imported); } } catch (XAException e) { throw e; } catch (Throwable t) { throw Log.log.resourceManagerErrorXa(XAException.XAER_RMFAIL, t); } }
Source:
private static void computeVersion(ServletContext context) { Properties props = new Properties(); InputStream is = null; try { is = Jenkins.class.getResourceAsStream("jenkins-version.properties"); if(is!=null) props.load(is); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(is); } String ver = props.getProperty("version"); if(ver==null) ver = UNCOMPUTED_VERSION; if(Main.isDevelopmentMode && "${build.version}".equals(ver)) { try { File dir = new File(".").getAbsoluteFile(); while(dir != null) { File pom = new File(dir, "pom.xml"); if (pom.exists() && "pom".equals(XMLUtils.getValue("/project/artifactId", pom))) { pom = pom.getCanonicalFile(); LOGGER.info("Reading version from: " + pom.getAbsolutePath()); ver = XMLUtils.getValue("/project/version", pom); break; } dir = dir.getParentFile(); } LOGGER.info("Jenkins is in dev mode, using version: " + ver); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to read Jenkins version: " + e.getMessage(), e); } } VERSION = ver; context.setAttribute("version",ver); VERSION_HASH = Util.getDigestOf(ver).substring(0, 8); SESSION_HASH = Util.getDigestOf(ver+System.currentTimeMillis()).substring(0, 8); if(ver.equals(UNCOMPUTED_VERSION) || Boolean.getBoolean("hudson.script.noCache")) RESOURCE_PATH = ""; else RESOURCE_PATH = "/static/"+SESSION_HASH; VIEW_RESOURCE_PATH = "/resources/"+ SESSION_HASH; }

Target:
private static void computeVersion(ServletContext context) { Properties props = new Properties(); InputStream is = null; try { is = Jenkins.class.getResourceAsStream("jenkins-version.properties"); if(is!=null) props.load(is); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(is); } String ver = props.getProperty("version"); if(ver==null) ver = UNCOMPUTED_VERSION; if(Main.isDevelopmentMode && "${build.version}".equals(ver)) { try { File dir = new File(".").getAbsoluteFile(); while(dir != null) { File pom = new File(dir, "pom.xml"); if (pom.exists() && "pom".equals(XMLUtils.getValue("/project/artifactId", pom))) { pom = pom.getCanonicalFile(); LOGGER.info("Reading version from: " + pom.getAbsolutePath()); ver = XMLUtils.getValue("/project/version", pom); break; } dir = dir.getParentFile(); } LOGGER.info("Jenkins is in dev mode, using version: " + ver); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to read Jenkins version: " + e.getMessage(), e); } } VERSION = ver; context.setAttribute("version",ver); VERSION_HASH = Util.getDigestOf(ver).substring(0, 8); SESSION_HASH = Util.getDigestOf(ver+System.currentTimeMillis()).substring(0, 8); if(ver.equals(UNCOMPUTED_VERSION) || SystemProperties.getBoolean("hudson.script.noCache")) RESOURCE_PATH = ""; else RESOURCE_PATH = "/static/"+SESSION_HASH; VIEW_RESOURCE_PATH = "/resources/"+ SESSION_HASH; }
Source:
public void testTimeBasedCancellation() { DataStoreTransaction dtx = elide.getDataStore().beginTransaction(); transactionRegistry.addRunningTransaction(UUID.fromString("edc4a871-dff2-4054-804e-d80075cf828d"), dtx); transactionRegistry.addRunningTransaction(UUID.fromString("edc4a871-dff2-4054-804e-d80075cf827d"), dtx); AsyncQuery asyncQuery1 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf828d", System.currentTimeMillis(), QueryStatus.QUEUED); AsyncQuery asyncQuery2 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf827d", 1577883600000L, QueryStatus.QUEUED); AsyncQuery asyncQuery3 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf826d", 1577883600000L, QueryStatus.QUEUED); Collection<AsyncQuery> asyncCollection = new ArrayList<AsyncQuery>(); asyncCollection.add(asyncQuery1); asyncCollection.add(asyncQuery2); asyncCollection.add(asyncQuery3); when(cancelThread.getAsyncQueryDao().loadAsyncQueryCollection(any())).thenReturn(asyncCollection); cancelThread.cancelAsyncQuery(); ArgumentCaptor<FilterExpression> filterCaptor = ArgumentCaptor.forClass(FilterExpression.class); verify(asyncQueryDao, times(1)).updateStatusAsyncQueryCollection(filterCaptor.capture(), any()); assertEquals("asyncQuery.id IN [[edc4a871-dff2-4054-804e-d80075cf827d]]", filterCaptor.getValue().toString()); }

Target:
public void testTimeBasedCancellation() { DataStoreTransaction dtx = elide.getDataStore().beginTransaction(); transactionRegistry.addRunningTransaction(UUID.fromString("edc4a871-dff2-4054-804e-d80075cf828d"), dtx); transactionRegistry.addRunningTransaction(UUID.fromString("edc4a871-dff2-4054-804e-d80075cf827d"), dtx); AsyncQuery asyncQuery1 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf828d", System.currentTimeMillis(), QueryStatus.QUEUED); AsyncQuery asyncQuery2 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf827d", 1577883600000L, QueryStatus.QUEUED); AsyncQuery asyncQuery3 = createAsyncQueryTestObject("edc4a871-dff2-4054-804e-d80075cf826d", 1577883600000L, QueryStatus.QUEUED); Collection<AsyncQuery> asyncCollection = new ArrayList<AsyncQuery>(); asyncCollection.add(asyncQuery1); asyncCollection.add(asyncQuery2); asyncCollection.add(asyncQuery3); when(cancelThread.getAsyncQueryDao().loadAsyncQueryCollection(any())).thenReturn(asyncCollection); cancelThread.cancelAsyncQuery(); ArgumentCaptor<FilterExpression> filterCaptor = ArgumentCaptor.forClass(FilterExpression.class); ArgumentCaptor<QueryStatus> statusCaptor = ArgumentCaptor.forClass(QueryStatus.class); verify(asyncQueryDao, times(1)).updateStatusAsyncQueryCollection(filterCaptor.capture(), statusCaptor.capture()); assertEquals("asyncQuery.id IN [[edc4a871-dff2-4054-804e-d80075cf827d]]", filterCaptor.getValue().toString()); assertEquals("CANCEL_COMPLETE", statusCaptor.getValue().toString()); }
Source:
public void testParsedNamedWindowDefinitionWithRange() { CriteriaBuilder<Tuple> criteria = cbf.create(em, Tuple.class) .from(Person.class, "per") .window("x").orderByAsc("per.age").rows().betweenUnboundedPreceding().andCurrentRow().end() .select("per.age") .select("SUM(per.age) OVER x") .orderByAsc("per.age") ; String queryString = criteria.getQueryString(); assertEquals("SELECT per.age, window_sum(per.age,'ORDER BY',per.age,'ASC NULLS LAST', " + "'ROWS','BETWEEN','UNBOUNDED PRECEDING','AND','CURRENT ROW') " + "FROM Person per WINDOW x AS (ORDER BY per.age ASC NULLS " + "LAST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) ORDER BY per.age ASC", queryString); List<Tuple> resultList = criteria.getResultList(); assertNotNull(resultList); }

Target:
public void testParsedNamedWindowDefinitionWithRange() { CriteriaBuilder<Tuple> criteria = cbf.create(em, Tuple.class) .from(Person.class, "per") .window("x").orderByAsc("per.age").rows().betweenUnboundedPreceding().andCurrentRow().end() .select("per.age") .select("SUM(per.age) OVER x") .orderByAsc("per.age") ; String queryString = criteria.getQueryString(); assertTrue(queryString.contains(function("window_sum", "per.age", "'ORDER BY'", "per.age", "'ASC NULLS LAST'", "'ROWS'", "'BETWEEN'", "'UNBOUNDED PRECEDING'", "'AND'", "'CURRENT ROW'"))); List<Tuple> resultList = criteria.getResultList(); assertNotNull(resultList); }
Source:
public long getRetainedSizeInBytes() { int size = INSTANCE_SIZE; if (decodedBlock instanceof Block) { size += ((Block) decodedBlock).getRetainedSizeInBytes(); } for (DecodedBlockNode child : children) { size += child.getRetainedSizeInBytes(); } return size; }

Target:
public long getRetainedSizeInBytes() { int size = INSTANCE_SIZE; if (decodedBlock instanceof Block) { size += ((Block) decodedBlock).getRetainedSizeInBytes(); } else if (decodedBlock instanceof ColumnarArray) { size += ((ColumnarArray) decodedBlock).getRetainedSizeInBytes(); } else if (decodedBlock instanceof ColumnarMap) { size += ((ColumnarMap) decodedBlock).getRetainedSizeInBytes(); } else if (decodedBlock instanceof ColumnarRow) { size += ((ColumnarRow) decodedBlock).getRetainedSizeInBytes(); } for (DecodedBlockNode child : children) { size += child.getRetainedSizeInBytes(); } return size; }
Source:
public Get createGet(Object rowKey) { checkArgument(keyEncoder != null, "row key is not set."); GenericRowData rowData = new GenericRowData(1); rowData.setField(0, rowKey); byte[] rowkey = keyEncoder.encode(rowData, 0); if (rowkey.length == 0) { return null; } Get get = new Get(rowkey); for (int f = 0; f < families.length; f++) { byte[] family = families[f]; for (byte[] qualifier : qualifiers[f]) { get.addColumn(family, qualifier); } } return get; }

Target:
public Get createGet(Object rowKey) { checkArgument(keyEncoder != null, "row key is not set."); rowWithRowKey.setField(0, rowKey); byte[] rowkey = keyEncoder.encode(rowWithRowKey, 0); if (rowkey.length == 0) { return null; } Get get = new Get(rowkey); for (int f = 0; f < families.length; f++) { byte[] family = families[f]; for (byte[] qualifier : qualifiers[f]) { get.addColumn(family, qualifier); } } return get; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { CustomSiriusEditor editor = getCurrentEditor(); if (editor != null) { Object root = null; try { root = editor.getEditingDomain().getResourceSet().getResources().get(0).getContents().get(0); } catch (NullPointerException npe) { } if (root != null) { SiriusInformationPresenter presenter = SiriusInformationPresenterFactory.createInformationPresenter(editor.getControl(), createDescriptor(editor), root); presenter.showInformation(); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { CustomSiriusEditor editor = getCurrentEditor(); Object root = getRoot(editor); if (root != null) { SiriusInformationPresenter presenter = SiriusInformationPresenterFactory.createInformationPresenter(editor.getControl(), createDescriptor(editor), root); presenter.showInformation(); } return null; }
Source:
public int issueRequest(long ts, Request request) { Object issuedFromValue = null; int fromQuark = removeWaitingRequest(ts, request.getSector()); if (fromQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { issuedFromValue = fSs.getAttributeName(fromQuark); } ITmfStateValue statusState = request.getType() == IoOperationType.READ ? StateValues.READING_REQUEST_VALUE : StateValues.WRITING_REQUEST_VALUE; int slotQuark = fDriverQueueAttrib.getAvailable(); try { fSs.modifyAttribute(ts, statusState.unboxValue(), slotQuark); int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int issuedFromQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.ISSUED_FROM); fSs.modifyAttribute(ts, issuedFromValue, issuedFromQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error issuing request", e); } fDriverQueue.put(request.getSector(), new Pair<>(request, slotQuark)); updateQueuesLength(ts); return slotQuark; }

Target:
public int issueRequest(long ts, Request request) { Object issuedFromValue = null; int fromQuark = removeWaitingRequest(ts, request.getSector()); if (fromQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { issuedFromValue = Integer.parseInt(fSs.getAttributeName(fromQuark)); } ITmfStateValue statusState = request.getType() == IoOperationType.READ ? StateValues.READING_REQUEST_VALUE : StateValues.WRITING_REQUEST_VALUE; int slotQuark = fDriverQueueAttrib.getAvailable(); try { fSs.modifyAttribute(ts, statusState.unboxValue(), slotQuark); int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int issuedFromQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.ISSUED_FROM); fSs.modifyAttribute(ts, issuedFromValue, issuedFromQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error issuing request", e); } fDriverQueue.put(request.getSector(), new Pair<>(request, slotQuark)); updateQueuesLength(ts); return slotQuark; }
Source:
CompletableFuture<Boolean> getMainOp(CommitData cd) { return env.getSharedResources().getBatchWriter() .writeMutationsAsyncFuture(createMutations(cd)).thenApply(v -> { cd.commitObserver.committed(); return true; }); }

Target:
CompletableFuture<Boolean> getMainOp(CommitData cd) { return super.getMainOp(cd).thenApply(b -> { Preconditions.checkArgument(b); cd.commitObserver.committed(); return true; }); }
Source:
public void testGetTimeZoneWhenTimeZoneIsHST() { System.setProperty("user.timezone", "HST"); assertEquals("-36000000", getLoaderOffset()); }

Target:
public void testGetTimeZoneWhenTimeZoneIsHST() { doReturn("HST").when(loader).getSystemPropertyTimeZone(); assertEquals("-36000000", getLoaderOffset()); }
Source:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != _sourceType) { String msg = String.format("Connector can only support datastreams of source type: %s", _sourceType); LOG.error(msg); throw new DatastreamValidationException(msg); } if (_sourceType == SourceType.MYSQLSERVER) { if (MysqlQueryUtils.checkTableExists(source, getUserNameFromDatastream(stream), getPasswordFromDatastream(stream))) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getDatabaseName(), source.getTableName())); } } else { File binlogFolder = new File(source.getBinlogFolderName()); if (!binlogFolder.exists()) { String msg = String.format("BinlogFolder %s doesn't exist", binlogFolder.getAbsolutePath()); LOG.error(msg); throw new DatastreamValidationException(msg); } } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { throw new DatastreamValidationException(e); } }

Target:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != _sourceType) { String msg = String.format("Connector can only support datastreams of source type: %s", _sourceType); LOG.error(msg); throw new DatastreamValidationException(msg); } if (_sourceType == SourceType.MYSQLSERVER) { if (!MysqlQueryUtils.checkTableExists(source, getUserNameFromDatastream(stream), getPasswordFromDatastream(stream))) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getTableName(), source.getDatabaseName())); } } else { File binlogFolder = new File(source.getBinlogFolderName()); if (!binlogFolder.exists()) { String msg = String.format("BinlogFolder %s doesn't exist", binlogFolder.getAbsolutePath()); LOG.error(msg); throw new DatastreamValidationException(msg); } } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { String msg = String.format("InitializeDatastream threw exception for datastream %s", stream); LOG.error(msg, e); throw new DatastreamValidationException(msg, e); } }
Source:
public void testRandomContent() throws Exception { MultipartContent content = new MultipartContent(); String boundaryString = content.getBoundary(); assertNotNull(boundaryString); assertTrue(boundaryString.startsWith(BOUNDARY)); assertTrue(boundaryString.endsWith("__")); assertEquals("multipart/related; boundary=" + boundaryString, content.getType()); final String[][] VALUES = new String[][] { {"Hello world", "text/plain"}, {"<xml>Hi</xml>", "application/xml"}, {"{x:1,y:2}", "application/json"} }; StringBuilder expectedContentSB = new StringBuilder(); for (String[] valueTypePair: VALUES) { String contentValue = valueTypePair[0]; String contentType = valueTypePair[1]; content.addPart(new MultipartContent.Part(ByteArrayContent.fromString(contentType, contentValue))); expectedContentSB.append("--").append(boundaryString).append(CRLF) .append(headers(contentType, contentValue)).append(CRLF) .append(contentValue).append(CRLF); } expectedContentSB.append("--").append(boundaryString).append("--").append(CRLF); ByteArrayOutputStream out = new ByteArrayOutputStream(); content.writeTo(out); String expectedContent = expectedContentSB.toString(); assertEquals(expectedContent, out.toString()); assertEquals(StringUtils.getBytesUtf8(expectedContent).length, content.getLength()); }

Target:
public void testRandomContent() throws Exception { MultipartContent content = new MultipartContent(); String boundaryString = content.getBoundary(); assertNotNull(boundaryString); assertTrue(boundaryString.startsWith(BOUNDARY)); assertTrue(boundaryString.endsWith("__")); assertEquals("multipart/related; boundary=" + boundaryString, content.getType()); final String[][] VALUES = new String[][] { {"Hello world", "text/plain"}, {"<xml>Hi</xml>", "application/xml"}, {"{x:1,y:2}", "application/json"} }; StringBuilder expectedStringBuilder = new StringBuilder(); for (String[] valueTypePair: VALUES) { String contentValue = valueTypePair[0]; String contentType = valueTypePair[1]; content.addPart(new MultipartContent.Part(ByteArrayContent.fromString(contentType, contentValue))); expectedStringBuilder.append("--").append(boundaryString).append(CRLF) .append(headers(contentType, contentValue)).append(CRLF) .append(contentValue).append(CRLF); } expectedStringBuilder.append("--").append(boundaryString).append("--").append(CRLF); ByteArrayOutputStream out = new ByteArrayOutputStream(); content.writeTo(out); String expectedContent = expectedStringBuilder.toString(); assertEquals(expectedContent, out.toString(Charsets.UTF_8.name())); assertEquals(StringUtils.getBytesUtf8(expectedContent).length, content.getLength()); }
Source:
public void start(BundleContext context) throws Exception { Package thisPkg = getClass().getPackage(); assertNotNull("thisPkg", thisPkg); checkPackage(thisPkg, "main", "1.0", "equinox.main", "MAIN", "10.0", "equinox.main"); Package aPkg = A.class.getPackage(); assertNotNull("aPkg", aPkg); checkPackage(aPkg, "a", "1.1", "equinox.a", "A", "11.0", "equinox.a"); Package bPkg = B.class.getPackage(); assertNotNull("bPkg", bPkg); checkPackage(bPkg, "b", "1.2", "equinox.b", "B", "12.0", "equinox.b"); Package cPkg = C.class.getPackage(); assertNotNull("cPkg", cPkg); checkPackage(cPkg, "c", "1.3", "equinox.c", "C", "13.0", "equinox.c"); Package dPkg = D.class.getPackage(); assertNotNull("dPkg", dPkg); checkPackage(dPkg, "d", "1.0", "equinox.main", "D", "10.0", "equinox.main"); Package ePkg = E.class.getPackage(); assertNotNull("ePkg", ePkg); checkPackage(ePkg, "main", "1.5", "equinox.main", "MAIN", "15.0", "equinox.main"); Package fPkg = F.class.getPackage(); assertNotNull("ePkg", fPkg); checkPackage(fPkg, "main", "1.0", "equinox.f", "MAIN", "10.0", "equinox.f"); }

Target:
public void start(BundleContext context) throws Exception { Package thisPkg = getClass().getPackage(); assertNotNull("thisPkg", thisPkg); checkPackage(thisPkg, "main", "1.0", "equinox.main", "MAIN", "10.0", "equinox.main"); Package aPkg = A.class.getPackage(); assertNotNull("aPkg", aPkg); checkPackage(aPkg, "a", "1.1", "equinox.a", "A", "11.0", "equinox.a"); Package bPkg = B.class.getPackage(); assertNotNull("bPkg", bPkg); checkPackage(bPkg, "b", "1.2", "equinox.b", "B", "12.0", "equinox.b"); Package cPkg = C.class.getPackage(); assertNotNull("cPkg", cPkg); checkPackage(cPkg, "c", "1.3", "equinox.c", "C", "13.0", "equinox.c"); Package dPkg = D.class.getPackage(); assertNotNull("dPkg", dPkg); checkPackage(dPkg, "d", "1.0", "equinox.main", "D", "10.0", "equinox.main"); Package ePkg = E.class.getPackage(); assertNotNull("ePkg", ePkg); checkPackage(ePkg, "main", "1.5", "equinox.main", "MAIN", "15.0", "equinox.main"); Package fPkg = F.class.getPackage(); assertNotNull("fPkg", fPkg); checkPackage(fPkg, "main", "1.0", "equinox.f", "MAIN", "10.0", "equinox.f"); }
Source:
public JettyServletScoreBoardController(ScoreBoard sb, JSONStateManager jsm, String host, int port) { scoreBoard = sb; this.jsm = jsm; init(host, port); Logger.printMessage(""); Logger.printMessage("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); Logger.printMessage("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); if (port == 8000) { Logger.printMessage("Double-click/open the 'start.html' file, or"); } Logger.printMessage("Open a web browser (either Google Chrome or Mozilla Firefox recommended) to:"); Logger.printMessage(" http://localhost:"+port); try { Set<String> urls = urlsServlet.getUrls(); if (!urls.isEmpty()) { Logger.printMessage("or try one of these URLs:"); } for (String u : urls) { Logger.printMessage(" "+u.toString()); } } catch ( MalformedURLException muE ) { Logger.printMessage("Internal error: malformed URL from Server Connector: "+muE.getMessage()); } catch ( SocketException sE ) { Logger.printMessage("Internal error: socket exception from Server Connector: "+sE.getMessage()); } Logger.printMessage("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); Logger.printMessage("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); Logger.printMessage(""); }

Target:
public JettyServletScoreBoardController(ScoreBoard sb, JSONStateManager jsm, String host, int port) { scoreBoard = sb; this.jsm = jsm; init(host, port); Logger.printMessage(""); Logger.printMessage("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); Logger.printMessage("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); if (port == 8000) { Logger.printMessage("Double-click/open the 'start.html' file, or"); } Logger.printMessage("Open a web browser (either Google Chrome or Mozilla Firefox recommended) to:"); Logger.printMessage(" http://localhost:"+port); try { Set<String> urls = urlsServlet.getUrls(); if (!urls.isEmpty()) { Logger.printMessage("or try one of these URLs:"); } for (String u : urls) { Logger.printMessage(" "+u); } } catch ( MalformedURLException muE ) { Logger.printMessage("Internal error: malformed URL from Server Connector: "+muE.getMessage()); } catch ( SocketException sE ) { Logger.printMessage("Internal error: socket exception from Server Connector: "+sE.getMessage()); } Logger.printMessage("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); Logger.printMessage("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); Logger.printMessage(""); }
Source:
public void split(TableName tableName) throws IOException, InterruptedException { }

Target:
public void split(TableName tableName) throws IOException, InterruptedException { throw new UnsupportedOperationException("split"); }
Source:
public static ExceptionThrowingSubTest expectThrowable(String description, Runnable runnable) { return expectException( description, () -> { runnable.run(); return null; } ); }

Target:
public static ExceptionThrowingSubTest expectThrowable(String description, Runnable runnable) { return expectThrowable( description, () -> { runnable.run(); return null; } ); }
Source:
private static byte[] computeIndexTreeLookupId(ObjectId indexId, @Nullable ObjectId treeId) { return (indexId.toString() + "." + (treeId == null ? "" : treeId.toString())) .getBytes(Charsets.UTF_8); }

Target:
private static byte[] computeIndexTreeLookupId(ObjectId indexId, @Nullable ObjectId treeId) { StringBuilder sb = new StringBuilder(indexId.toString()).append("."); if (treeId != null) { sb.append(treeId.toString()); } return sb.toString().getBytes(Charsets.UTF_8); }
Source:
public void onMwSuccess() { if (isSlatedForRestBase()) { int successes = Prefs.getRequestSuccessCounter(0); Prefs.setRequestSuccessCounter(++successes); resetFailed(); if (successes >= SUCCESS_THRESHOLD && !Prefs.useRestBaseSetManually()) { Prefs.setUseRestBase(true); } } }

Target:
public void onMwSuccess() { if (isSlatedForRestBase()) { int successes = Prefs.getRequestSuccessCounter(0); successes++; Prefs.setRequestSuccessCounter(successes); resetFailed(); if (successes >= SUCCESS_THRESHOLD && !Prefs.useRestBaseSetManually()) { Prefs.setUseRestBase(true); } } }
Source:
PatchSetSelectBox2(DiffTable table, final DisplaySide side, final Change.Id changeId, final PatchSet.Id revision, String path) { initWidget(uiBinder.createAndBindUi(this)); icon.setTitle(PatchUtil.C.addFileCommentToolTip()); icon.addStyleName(Gerrit.RESOURCES.css().link()); this.table = table; this.side = side; this.sideA = side == DisplaySide.A; this.changeId = changeId; this.revision = revision; this.idActive = (sideA && revision == null) ? null : revision; this.path = path; setTitle(PatchUtil.C.addFileCommentByDoubleClick()); addDomHandler(new DoubleClickHandler() { @Override public void onDoubleClick(DoubleClickEvent event) { onIconClick(null); } }, DoubleClickEvent.getType()); }

Target:
PatchSetSelectBox2(DiffTable table, final DisplaySide side, final Change.Id changeId, final PatchSet.Id revision, String path) { initWidget(uiBinder.createAndBindUi(this)); icon.setTitle(PatchUtil.C.addFileCommentToolTip()); icon.addStyleName(Gerrit.RESOURCES.css().link()); this.table = table; this.side = side; this.sideA = side == DisplaySide.A; this.changeId = changeId; this.revision = revision; this.idActive = (sideA && revision == null) ? null : revision; this.path = path; setTitle(PatchUtil.C.addFileCommentToolTip()); addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onIconClick(null); } }, ClickEvent.getType()); }
Source:
public State traverse(State s0) { final RoutingRequest options = s0.getOptions(); final TraverseMode currMode = s0.getNonTransitMode(); if (options.excludeWalking && currMode.equals(TraverseMode.WALK)) { return null; } StateEditor editor = doTraverse(s0, options, s0.getNonTransitMode()); State state = (editor == null) ? null : editor.makeState(); if (options.kissAndRide) { if (options.arriveBy) { if (s0.isCarParked() && s0.isEverBoarded() && currMode == TraverseMode.WALK) { editor = doTraverse(s0, options, TraverseMode.CAR); if (editor != null) { editor.setCarParked(false); State forkState = editor.makeState(); if (forkState != null) { forkState.addToExistingResultChain(state); return forkState; } } } } else { if ( ! s0.isCarParked() && ! getPermission().allows(TraverseMode.CAR) && currMode == TraverseMode.CAR) { editor = doTraverse(s0, options, TraverseMode.WALK); if (editor != null) { editor.setCarParked(true); return editor.makeState(); } } } } return state; }

Target:
public State traverse(State s0) { final RoutingRequest options = s0.getOptions(); final TraverseMode currMode = s0.getNonTransitMode(); StateEditor editor = doTraverse(s0, options, s0.getNonTransitMode()); State state = (editor == null) ? null : editor.makeState(); if (options.kissAndRide) { if (options.arriveBy) { if (s0.isCarParked() && s0.isEverBoarded() && currMode == TraverseMode.WALK) { editor = doTraverse(s0, options, TraverseMode.CAR); if (editor != null) { editor.setCarParked(false); State forkState = editor.makeState(); if (forkState != null) { forkState.addToExistingResultChain(state); return forkState; } } } } else { if ( ! s0.isCarParked() && ! getPermission().allows(TraverseMode.CAR) && currMode == TraverseMode.CAR) { editor = doTraverse(s0, options, TraverseMode.WALK); if (editor != null) { editor.setCarParked(true); return editor.makeState(); } } } } return state; }
Source:
public IamAdminServicesHandler() { try { GenericObjectPool.Config poolConfig = new GenericObjectPool.Config(); poolConfig.maxActive = 100; poolConfig.minIdle = 5; poolConfig.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK; poolConfig.testOnBorrow = true; poolConfig.testWhileIdle = true; poolConfig.numTestsPerEvictionRun = 10; poolConfig.maxWait = 3000; csClientPool = new ThriftClientPool<>( tProtocol -> new CredentialStoreService.Client(tProtocol), poolConfig, ServerSettings.getCredentialStoreServerHost(), Integer.parseInt(ServerSettings.getCredentialStoreServerPort())); registryClientPool = new ThriftClientPool<>( tProtocol -> new RegistryService.Client(tProtocol), poolConfig, ServerSettings.getRegistryServerHost(), Integer.parseInt(ServerSettings.getRegistryServerPort())); }catch (ApplicationSettingsException e) { logger.error("Error occured while reading airavata-server properties..", e); } }

Target:
public IamAdminServicesHandler() throws Exception { try { GenericObjectPool.Config poolConfig = new GenericObjectPool.Config(); poolConfig.maxActive = 100; poolConfig.minIdle = 5; poolConfig.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK; poolConfig.testOnBorrow = true; poolConfig.testWhileIdle = true; poolConfig.numTestsPerEvictionRun = 10; poolConfig.maxWait = 3000; csClientPool = new ThriftClientPool<>( tProtocol -> new CredentialStoreService.Client(tProtocol), poolConfig, ServerSettings.getCredentialStoreServerHost(), Integer.parseInt(ServerSettings.getCredentialStoreServerPort())); registryClientPool = new ThriftClientPool<>( tProtocol -> new RegistryService.Client(tProtocol), poolConfig, ServerSettings.getRegistryServerHost(), Integer.parseInt(ServerSettings.getRegistryServerPort())); } catch (ApplicationSettingsException e) { logger.error("Error occured while reading airavata-server properties..", e); throw new Exception(e); } }
Source:
public void scanFile(JavaFileScannerContext context) { this.context = context; classVisitor = new CheckClassVisitor(); context.getTree().accept(classVisitor); scan(context.getTree()); }

Target:
public void scanFile(JavaFileScannerContext context) { this.context = context; scan(context.getTree()); }
Source:
static ExternalMessageType fromId(ChannelId channelId) { checkNotNull(channelId); final StringValue rawValue = AnyPacker.unpack(channelId.getIdentifier()); final TypeUrl typeUrl = TypeUrl.parse(rawValue.getValue()); final boolean isRejection = Rejections.isRejection(typeUrl.getJavaClass()); final String wrapperTypeUrl = isRejection ? TypeUrl.of(Rejection.class).value() : TypeUrl.of(Event.class).value(); final ExternalMessageType result = ExternalMessageType.newBuilder() .setMessageTypeUrl(typeUrl.value()) .setWrapperTypeUrl(wrapperTypeUrl) .build(); return result; }

Target:
static ExternalMessageType fromId(ChannelId channelId) { checkNotNull(channelId); final StringValue rawValue = AnyPacker.unpack(channelId.getIdentifier()); final TypeUrl typeUrl = TypeUrl.parse(rawValue.getValue()); final boolean isRejection = Rejections.isRejection(typeUrl.getJavaClass()); final String wrapperTypeUrl = isRejection ? REJECTION_TYPE_URL.value() : EVENT_TYPE_URL.value(); final ExternalMessageType result = ExternalMessageType.newBuilder() .setMessageTypeUrl(typeUrl.value()) .setWrapperTypeUrl(wrapperTypeUrl) .build(); return result; }
Source:
public BigInteger getBigInteger(String key) { String value = getRawString(key); if (value == null) return notFound(); try { return BigInteger.valueOf(Long.valueOf(value)); } catch (NumberFormatException e) { return parseError(key, value, e); } }

Target:
public BigInteger getBigInteger(String key) { String value = interpolate(key); if (value == null) return notFound(); try { return new BigInteger(value); } catch (NumberFormatException e) { return parseError(key, value, e); } }
Source:
public Subject createSubject(final String x509Name, final PublicKey publicKey) throws SAMLComponentBuilderException { Subject subject = null; try { final SubjectBean subjectBean = new SubjectBean(); subject = SAML2ComponentBuilder.createSaml2Subject(subjectBean); subject.setNameID(createNameID(X509_NAME_ID, x509Name)); subject.getSubjectConfirmations().remove(0); final SubjectConfirmationData subjectConfirmationData = createSubjectConfirmationData(publicKey); final SubjectConfirmation subjectConfirmation = createHoKConfirmation(subjectConfirmationData); subject.getSubjectConfirmations().add(subjectConfirmation); } catch (org.opensaml.security.SecurityException | org.apache.wss4j.common.ext.WSSecurityException e) { LOG.error("Unable to create Saml2Subject ", e.getLocalizedMessage()); throw new SAMLComponentBuilderException(e.getLocalizedMessage(), e); } return subject; }

Target:
public Subject createSubject(final String x509Name, final PublicKey publicKey) throws SAMLComponentBuilderException { Subject subject = null; try { final SubjectBean subjectBean = new SubjectBean(); subject = SAML2ComponentBuilder.createSaml2Subject(subjectBean); subject.setNameID(createNameID(X509_NAME_ID, x509Name)); subject.getSubjectConfirmations().remove(0); final SubjectConfirmationData subjectConfirmationData = createSubjectConfirmationData(publicKey); final SubjectConfirmation subjectConfirmation = createHoKConfirmation(subjectConfirmationData); subject.getSubjectConfirmations().add(subjectConfirmation); } catch (SecurityException | WSSecurityException e) { LOG.error("Unable to create Saml2Subject ", e.getLocalizedMessage()); throw new SAMLComponentBuilderException(e.getLocalizedMessage(), e); } return subject; }
Source:
public void handleTaskLevelCheckpointException( CheckpointException exception, long checkpointId, ExecutionAttemptID executionAttemptID) { handleException(exception, of(checkpointId), (failureCallback, e) -> failureCallback.failJobDueToTaskFailure(e, executionAttemptID)); }

Target:
public void handleTaskLevelCheckpointException( CheckpointException exception, long checkpointId, ExecutionAttemptID executionAttemptID) { checkFailureCounter(exception, checkpointId); if (continuousFailureCounter.get() > tolerableCpFailureNumber) { clearCount(); failureCallback.failJobDueToTaskFailure(new FlinkRuntimeException("Exceeded checkpoint tolerable failure threshold."), executionAttemptID); } }