auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<T> listByKeys(List<Long> idsList, Class<T> clazz){ if (idsList == null || idsList.isEmpty()) { return Collections.emptyList(); } PersistenceManager pm = PersistenceFilter.getManager(); List<Object> datastoreKeysList = new ArrayList<>(); for (Long id : idsList) { Key key = KeyFactory.createKey(clazz.getSimpleName(), id); Object objectId = pm.newObjectIdInstance(clazz, key); datastoreKeysList.add(objectId); } final List<T> resultsList = new ArrayList<>(); try { resultsList.addAll(pm.getObjectsById(datastoreKeysList)); } catch (NucleusObjectNotFoundException nfe) { log.warning("No " + clazz.getCanonicalName() + " found: " + nfe.getMessage()); } return resultsList; }

Target:
public List<T> listByKeys(List<Long> idsList, Class<T> clazz){ if (idsList == null || idsList.isEmpty()) { return Collections.emptyList(); } PersistenceManager pm = PersistenceFilter.getManager(); List<Object> datastoreKeysList = new ArrayList<>(); for (Long id : idsList) { Key key = KeyFactory.createKey(clazz.getSimpleName(), id); Object objectId = pm.newObjectIdInstance(clazz, key); datastoreKeysList.add(objectId); } final List<T> resultsList = new ArrayList<>(); try { resultsList.addAll(pm.getObjectsById(datastoreKeysList)); } catch (NucleusObjectNotFoundException nfe) { log.warning(nfe.getMessage()); return listByKeysIndividually(idsList); } catch (ArrayIndexOutOfBoundsException exception) { log.warning("Some entities were not found"); return listByKeysIndividually(idsList); } return resultsList; }
Source:
public void addToLogLikelihoods(final Snp snp, final List<Allele> alleles, final double[] logGenotypeLikelihoods) { assertSnpPartOfHaplotype(snp); assert (logGenotypeLikelihoods.length == nGeno); assert (alleles.size() == 2); for (int i = 0; i < alleles.size(); i++) { assert (alleles.get(i).getBases().length == 1); } final byte allele1 = alleles.get(0).getBases()[0]; final byte allele2 = alleles.get(1).getBases()[0]; if (snp.getAllele1() == allele1 && snp.getAllele2() == allele2) { setLogLikelihoods(MathUtil.sum(getLogLikelihoods(),logGenotypeLikelihoods)); return; } if (snp.getAllele2() == allele1 && snp.getAllele1() == allele2) { final double ll = getLogLikelihoods(); ll[Genotype.HOM_ALLELE1.v] += logGenotypeLikelihoods[Genotype.HOM_ALLELE2.v]; ll[Genotype.HET_ALLELE12.v] += logGenotypeLikelihoods[Genotype.HET_ALLELE12.v]; ll[Genotype.HOM_ALLELE2.v] += logGenotypeLikelihoods[Genotype.HOM_ALLELE1.v]; setLogLikelihoods(ll); return; } assert false; }

Target:
public void addToLogLikelihoods(final Snp snp, final List<Allele> alleles, final double[] logGenotypeLikelihoods) { assertSnpPartOfHaplotype(snp); ValidationUtils.validateArg(logGenotypeLikelihoods.length == NUM_GENOTYPES, () -> "LogGenotypueLikelihoods must be length 3, found " + logGenotypeLikelihoods.length); ValidationUtils.validateArg(alleles.size() == 2, () -> "alleles must be length 2, found " + alleles.size()); for (final Allele a : alleles) { ValidationUtils.validateArg(a.getBases().length == 1, () -> "allele is supposed to be a SNP, found " + a.getBaseString()); } final byte allele1 = alleles.get(0).getBases()[0]; final byte allele2 = alleles.get(1).getBases()[0]; if (snp.getAllele1() == allele1 && snp.getAllele2() == allele2) { setLogLikelihoods(MathUtil.sum(getLogLikelihoods(),logGenotypeLikelihoods)); return; } if (snp.getAllele2() == allele1 && snp.getAllele1() == allele2) { final double ll = getLogLikelihoods(); ll[Genotype.HOM_ALLELE1.v] += logGenotypeLikelihoods[Genotype.HOM_ALLELE2.v]; ll[Genotype.HET_ALLELE12.v] += logGenotypeLikelihoods[Genotype.HET_ALLELE12.v]; ll[Genotype.HOM_ALLELE2.v] += logGenotypeLikelihoods[Genotype.HOM_ALLELE1.v]; setLogLikelihoods(ll); return; } ValidationUtils.nonNull(null,"We really should not have reached this point in the code..."); }
Source:
public boolean hasValidFallthroughAttribute(IASTStatement statement) { IASTStatement nullstatement = null; if(statement instanceof IASTNullStatement) nullstatement = statement; else if(statement instanceof IASTCompoundStatement && statement.getChildren().length>0) { IASTNode lastnode = statement.getChildren()[statement.getChildren().length-1]; if(lastnode instanceof IASTNullStatement) nullstatement = (IASTStatement) lastnode; } if(nullstatement!=null) { for (IASTAttribute attribute : nullstatement.getAttributes()) { if(String.valueOf(attribute.getName()).equals("fallthrough")) return true; } } return false; }

Target:
public boolean hasValidFallthroughAttribute(IASTStatement statement) { IASTStatement nullstatement = null; if (statement instanceof IASTNullStatement) nullstatement = statement; else if (statement instanceof IASTCompoundStatement && statement.getChildren().length > 0) { IASTNode lastnode = statement.getChildren()[statement.getChildren().length - 1]; if (lastnode instanceof IASTNullStatement) nullstatement = (IASTStatement) lastnode; } if (nullstatement != null) { if (AttributeUtil.hasAttribute(nullstatement, new String[] { StandardAttributes.FALLTHROUGH })) return true; } return false; }
Source:
public boolean removeShares(List<OwnerProductShare> shares) { int rows = 0; if (CollectionUtils.isNotEmpty(shares)) { List<String> ids = new LinkedList<String>(); for (OwnerProductShare share : shares) { ids.add(share.getId()); } String jpql = "DELETE FROM OwnerProductShare s " + "WHERE s.id in (:ids)"; rows = this.getEntityManager() .createQuery(jpql) .setParameter("ids", ids) .executeUpdate(); } return rows > 0; }

Target:
public boolean removeShares(List<OwnerProductShare> shares) { int rows = 0; if (CollectionUtils.isNotEmpty(shares)) { List<String> ids = new LinkedList<String>(); for (OwnerProductShare share : shares) { ids.add(share.getId()); } String jpql = "DELETE FROM OwnerProductShare s " + "WHERE s.id in (:ids)"; Query query = this.getEntityManager().createQuery(jpql); for (List<String> block : Iterables.partition(ids, getInBlockSize())) { rows += query.setParameter("ids", block).executeUpdate(); } } return rows > 0; }
Source:
private BigInteger computeRetrievalCost(QueryPlanNode root) { CostAndSize cs=((IndexedFieldScorerData)root.getData()).getCostAndSize(); BigInteger cost=cs.cost; for(QueryPlanNode dest:root.getDestinations()) { cost=cost.add(cs.size.multiply(computeRetrievalCost(dest))); } return cost; }

Target:
private BigInteger computeRetrievalCost(QueryPlanNode root) { CostAndSize cs=getData(root).getCostAndSize(); BigInteger cost=cs.cost; for(QueryPlanNode dest:root.getDestinations()) { cost=cost.add(cs.size.multiply(computeRetrievalCost(dest))); } return cost; }
Source:
private void renameModelDialog() { try { modelNameInput = new EditText(this); modelNameInput.setSingleLine(true); modelNameInput.setText(models.get(currentPos).getString("name")); modelNameInput.setSelection(modelNameInput.getText().length()); new MaterialDialog.Builder(this) .title(R.string.rename_model) .positiveText(R.string.dialog_ok) .customView(modelNameInput, true) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { JSONObject model = models.get(currentPos); String deckName = modelNameInput.getText().toString() .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); getCol().getDecks().id(deckName, true); if (deckName.length() > 0) { try { model.put("name", deckName); } catch (JSONException e) { throw new RuntimeException(e); } col.getModels().update(model); try { models.get(currentPos).put("name", deckName); modelDisplay.set(currentPos, new DisplayPair(models.get(currentPos).getString("name"), cardCounts.get(currentPos))); } catch (JSONException e) { throw new RuntimeException(e); } refreshList(); } else{ showToast(getResources().getString(R.string.toast_empty_name)); } } }) .negativeText(R.string.dialog_cancel) .show(); } catch (JSONException e) { closeActivity(DB_ERROR_EXIT); } }

Target:
private void renameModelDialog() { try { mModelNameInput = new EditText(this); mModelNameInput.setSingleLine(true); mModelNameInput.setText(mModels.get(mModelListPosition).getString("name")); mModelNameInput.setSelection(mModelNameInput.getText().length()); new MaterialDialog.Builder(this) .title(R.string.rename_model) .positiveText(R.string.dialog_ok) .customView(mModelNameInput, true) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { JSONObject model = mModels.get(mModelListPosition); String deckName = mModelNameInput.getText().toString() .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); getCol().getDecks().id(deckName, true); if (deckName.length() > 0) { try { model.put("name", deckName); col.getModels().update(model); mModels.get(mModelListPosition).put("name", deckName); mModelDisplayList.set(mModelListPosition, new DisplayPair(mModels.get(mModelListPosition).getString("name"), mCardCounts.get(mModelListPosition))); } catch (JSONException e) { throw new RuntimeException(e); } refreshList(); } else { showToast(getResources().getString(R.string.toast_empty_name)); } } }) .negativeText(R.string.dialog_cancel) .show(); } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
static String getPort(Element element, ParserContext parserContext) { String port = element.getAttribute(IpAdapterParserUtils.PORT); if (!StringUtils.hasText(port)) { parserContext.getReaderContext().error(IpAdapterParserUtils.PORT + " is required for IP outbound channel adapters", element); } return port; }

Target:
static String getPort(Element element, ParserContext parserContext) { String port = element.getAttribute(IpAdapterParserUtils.PORT); if (!StringUtils.hasText(port)) { parserContext.getReaderContext().error(IpAdapterParserUtils.PORT + " is required for IP channel adapters", element); } return port; }
Source:
public void shouldReturnBadRequestResponseOnMissingMetadataFieldInSchema() { Schema schema = AvroUserSchemaLoader.load("/schema/user_no_metadata.avsc"); Topic topic = randomTopic("pl.allegro.test", "Topic") .withContentType(AVRO) .build(); operations.buildTopicWithSchema(topicWithSchema(topic, schema.toString())); Response response = publisher.publish(topic.getQualifiedName(), user.asJson()); assertThat(response).hasStatus(BAD_REQUEST); }

Target:
public void shouldReturnBadRequestResponseOnMissingMetadataFieldInSchema() { Schema schema = AvroUserSchemaLoader.load("/schema/user_no_metadata.avsc"); Topic topic = randomTopic("pl.allegro.test", "Topic") .withContentType(AVRO) .build(); operations.buildTopicWithSchema(topicWithSchema(topic, schema.toString())); Response response = publisher.publish(topic.getQualifiedName(), user.asJson()); assertThat(response).hasStatus(BAD_REQUEST); assertThat(response.readEntity(String.class)) .isEqualTo("{\"message\":\"Schema does not contain mandatory __metadata field for Hermes internal metadata. " + "Please fix topic schema.\",\"code\":\"AVRO_SCHEMA_INVALID_METADATA\"}"); }
Source:
public void testMigrationEvent() { hazelcastInstance3.getLifecycleService().terminate(); final Message<?> msg = cmChannel3.receive(TIMEOUT); verifyMigrationEvent(msg); }

Target:
public void testMigrationEvent() { final IMap<Integer, String> distributedMap = hazelcastInstance3 .getMap("Test_Distributed_Map2"); distributedMap.put(1, "TestValue1"); distributedMap.put(2, "TestValue2"); hazelcastInstance3.getLifecycleService().terminate(); final Message<?> msg = cmChannel3.receive(TIMEOUT); verifyMigrationEvent(msg); }
Source:
protected void appendDetail(final StringBuffer buffer, final String fieldName, final Collection<?> coll) { if (coll != null && !coll.isEmpty()) { coll.stream().findFirst() .map(Object::getClass) .filter(Class::isEnum) .ifPresent((clazz) -> appendDetail(buffer, fieldName, coll.toArray())); return; } buffer.append(coll); }

Target:
protected void appendDetail(final StringBuffer buffer, final String fieldName, final Collection<?> coll) { if (coll != null && !coll.isEmpty()) { appendDetail(buffer, fieldName, coll.toArray()); return; } buffer.append(coll); }
Source:
public void testClusterDoesNOTShutdownWhenApplicationStatusUknown() throws Exception { final Tuple1<Boolean> clusterShutdown = new Tuple1<>(false); final TestingDispatcherGateway.Builder dispatcherBuilder = new TestingDispatcherGateway.Builder() .setSubmitFunction(jobGraph -> CompletableFuture.completedFuture(Acknowledge.get())) .setRequestJobStatusFunction(jobId -> CompletableFuture.completedFuture(JobStatus.FAILED)) .setRequestJobResultFunction(jobId -> CompletableFuture.completedFuture(createUnknownJobResult(jobId))) .setClusterShutdownFunction(status -> { if (clusterShutdown.f0) { throw new FlinkRuntimeException("This should be called only once"); } clusterShutdown.f0 = true; return CompletableFuture.completedFuture(Acknowledge.get()); }); final TestingDispatcherGateway dispatcherGateway = dispatcherBuilder.build(); final ApplicationDispatcherBootstrap bootstrap = createApplicationDispatcherBootstrap(3, dispatcherGateway, scheduledExecutor); final CompletableFuture<Acknowledge> applicationFuture = bootstrap.getClusterShutdownFuture(); final ApplicationFailureException exception = assertException(applicationFuture, ApplicationFailureException.class); assertEquals(exception.getStatus(), ApplicationStatus.UNKNOWN); assertFalse(clusterShutdown.f0); dispatcherGateway.shutDownCluster(ApplicationStatus.SUCCEEDED); assertTrue(clusterShutdown.f0); }

Target:
public void testClusterDoesNOTShutdownWhenApplicationStatusUknown() throws Exception { final TestingDispatcherGateway.Builder dispatcherBuilder = new TestingDispatcherGateway.Builder() .setSubmitFunction(jobGraph -> CompletableFuture.completedFuture(Acknowledge.get())) .setRequestJobStatusFunction(jobId -> CompletableFuture.completedFuture(JobStatus.FAILED)) .setRequestJobResultFunction(jobId -> CompletableFuture.completedFuture(createUnknownJobResult(jobId))) .setClusterShutdownFunction(status -> { fail("We should not call shutdownCluster()"); return CompletableFuture.completedFuture(Acknowledge.get()); }); final TestingDispatcherGateway dispatcherGateway = dispatcherBuilder.build(); final ApplicationDispatcherBootstrap bootstrap = createApplicationDispatcherBootstrap(3, dispatcherGateway, scheduledExecutor); final CompletableFuture<Acknowledge> applicationFuture = bootstrap.getClusterShutdownFuture(); final ApplicationFailureException exception = assertException(applicationFuture, ApplicationFailureException.class); assertEquals(exception.getStatus(), ApplicationStatus.UNKNOWN); }
Source:
protected boolean processEntryForContext(final ILogData data) { if (data != null) { try { final Object payload = data.getPayload(runtime); } catch (Throwable e) { log.error("Exception caught at address {}, {}, {}", data.getGlobalAddress(), data.getStreams(), data.getType()); throw e; } } return false; }

Target:
protected boolean processEntryForContext(final ILogData data) { if (data != null) { final Object payload = data.getPayload(runtime); } return false; }
Source:
public void addInfo(final SamLocusIterator.LocusInfo info) { final HashSet<String> readNames = new HashSet<>(info.getRecordAndPositions().size()); int pileupSize = 0; int unfilteredDepth = 0; for (final SamLocusIterator.RecordAndOffset recs : info.getRecordAndPositions()) { if (recs.getBaseQuality() <= 2) { ++basesExcludedByBaseq; continue; } if (unfilteredDepth < coverageCap) { unfilteredBaseQHistogramArray[recs.getRecord().getBaseQualities()[recs.getOffset()]]++; unfilteredDepth++; } if (recs.getBaseQuality() < MINIMUM_BASE_QUALITY || SequenceUtil.isNoCall(recs.getReadBase())) { ++basesExcludedByBaseq; continue; } if (!readNames.add(recs.getRecord().getReadName())) { ++basesExcludedByOverlap; continue; } pileupSize++; } final int highQualityDepth = Math.min(pileupSize, coverageCap); if (highQualityDepth < pileupSize) basesExcludedByCapping += pileupSize - coverageCap; highQualityDepthHistogramArray[highQualityDepth]++; unfilteredDepthHistogramArray[unfilteredDepth]++; if (Arrays.stream(unfilteredBaseQHistogramArray).sum() != LongStream.rangeClosed(0,coverageCap).map(i -> (i * unfilteredDepthHistogramArray[(int)i])).sum()) { throw new PicardException("updated coverage and baseQ distributions unequally"); } }

Target:
public void addInfo(final SamLocusIterator.LocusInfo info) { final HashSet<String> readNames = new HashSet<>(info.getRecordAndPositions().size()); int pileupSize = 0; int unfilteredDepth = 0; for (final SamLocusIterator.RecordAndOffset recs : info.getRecordAndPositions()) { if (recs.getBaseQuality() <= 2) { ++basesExcludedByBaseq; continue; } if (unfilteredDepth < coverageCap) { unfilteredBaseQHistogramArray[recs.getRecord().getBaseQualities()[recs.getOffset()]]++; unfilteredDepth++; } if (recs.getBaseQuality() < MINIMUM_BASE_QUALITY || SequenceUtil.isNoCall(recs.getReadBase())) { ++basesExcludedByBaseq; continue; } if (!readNames.add(recs.getRecord().getReadName())) { ++basesExcludedByOverlap; continue; } pileupSize++; } final int highQualityDepth = Math.min(pileupSize, coverageCap); if (highQualityDepth < pileupSize) basesExcludedByCapping += pileupSize - coverageCap; highQualityDepthHistogramArray[highQualityDepth]++; unfilteredDepthHistogramArray[unfilteredDepth]++; }
Source:
private Map<String, Map<String, Long>> collectValidDataSizeByContainer(long deleteAndExpirationRefTimeInMs) throws StoreException { Set<String> deletedKeys = new HashSet<>(); Map<String, Map<String, Long>> validDataSizePerContainer = new HashMap<>(); for (IndexSegment indexSegment : index.getIndexSegments().descendingMap().values()) { List<IndexValue> validIndexValues = getValidIndexValues(indexSegment, deleteAndExpirationRefTimeInMs, deleteAndExpirationRefTimeInMs, deletedKeys); for (IndexValue value : validIndexValues) { if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { updateNestedMapHelper(validDataSizePerContainer, String.valueOf(value.getServiceId()), String.valueOf(value.getContainerId()), value.getSize()); } } } return validDataSizePerContainer; }

Target:
private Map<String, Map<String, Long>> collectValidDataSizeByContainer(long deleteAndExpirationRefTimeInMs) throws StoreException { Set<StoreKey> deletedKeys = new HashSet<>(); Map<String, Map<String, Long>> validDataSizePerContainer = new HashMap<>(); for (IndexSegment indexSegment : index.getIndexSegments().descendingMap().values()) { List<IndexValue> validIndexValues = getValidIndexValues(indexSegment, deleteAndExpirationRefTimeInMs, deleteAndExpirationRefTimeInMs, deletedKeys); for (IndexValue value : validIndexValues) { if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { updateNestedMapHelper(validDataSizePerContainer, String.valueOf(value.getServiceId()), String.valueOf(value.getContainerId()), value.getSize()); } } } return validDataSizePerContainer; }
Source:
public static RebaseInteractivePlan getPlan(Repository repo) { RebaseInteractivePlan plan = planRegistry.get(repo); if (plan == null) { plan = new RebaseInteractivePlan(repo, false); planRegistry.put(repo.getDirectory(), plan); } return plan; }

Target:
public static RebaseInteractivePlan getPlan(Repository repo) { RebaseInteractivePlan plan = planRegistry.get(repo.getDirectory()); if (plan == null) { plan = new RebaseInteractivePlan(repo, false); planRegistry.put(repo.getDirectory(), plan); } return plan; }
Source:
private void fetchJetpackModuleSettings() { ++mFetchRequestCount; WordPress.getRestClientUtilsV1_1().getJetpackModuleSettings( mSite.getSiteId(), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { AppLog.v(AppLog.T.API, "Received Jetpack module settings"); if (response == null) return; JSONArray array = response.optJSONArray("modules"); if (array == null) return; for (int i = 0; i < array.length(); i++) { JSONObject module = array.optJSONObject(i); if (module == null) { continue; } String id = module.optString("id"); if (id == null) { continue; } if (id.equals(SERVE_IMAGES_FROM_OUR_SERVERS)) { mRemoteJpSettings.serveImagesFromOurServers = module.optBoolean("active", false); } else if (id.equals(LAZY_LOAD_IMAGES)) { mRemoteJpSettings.lazyLoadImages = module.optBoolean("active", false); } } mJpSettings.serveImagesFromOurServers = mRemoteJpSettings.serveImagesFromOurServers; mJpSettings.lazyLoadImages = mRemoteJpSettings.lazyLoadImages; onFetchResponseReceived(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error fetching Jetpack module settings: " + error); onFetchResponseReceived(error); } }); }

Target:
private void fetchJetpackModuleSettings() { ++mFetchRequestCount; WordPress.getRestClientUtilsV1_1().getJetpackModuleSettings( mSite.getSiteId(), new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { if (response == null) { AppLog.w(AppLog.T.API, "Unexpected state: Received empty Jetpack modules response"); onFetchResponseReceived(null); return; } AppLog.v(AppLog.T.API, "Received Jetpack module settings"); JSONArray array = response.optJSONArray("modules"); if (array != null) { for (int i = 0; i < array.length(); i++) { JSONObject module = array.optJSONObject(i); if (module == null) { continue; } String id = module.optString("id"); if (id == null) { continue; } if (id.equals(SERVE_IMAGES_FROM_OUR_SERVERS)) { mRemoteJpSettings.serveImagesFromOurServers = module.optBoolean("active", false); } else if (id.equals(LAZY_LOAD_IMAGES)) { mRemoteJpSettings.lazyLoadImages = module.optBoolean("active", false); } } mJpSettings.serveImagesFromOurServers = mRemoteJpSettings.serveImagesFromOurServers; mJpSettings.lazyLoadImages = mRemoteJpSettings.lazyLoadImages; } onFetchResponseReceived(null); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { AppLog.w(AppLog.T.API, "Error fetching Jetpack module settings: " + error); onFetchResponseReceived(error); } }); }
Source:
public void start(Stage pStage) throws Exception { Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); int screenWidth = (int) primaryScreenBounds.getWidth(); int screenHeight = (int) primaryScreenBounds.getHeight(); pStage.setX(screenWidth / (MARGIN_SCREEN*2)); pStage.setY(screenHeight / (MARGIN_SCREEN*2)); pStage.setWidth((screenWidth * (MARGIN_SCREEN-1)) / MARGIN_SCREEN); pStage.setHeight((screenHeight * (MARGIN_SCREEN-1))/ MARGIN_SCREEN); final SwingNode swingNode = new SwingNode(); createAndSetSwingContent(swingNode, pStage); Properties props = System.getProperties(); props.setProperty("swing.jlf.contentPaneTransparent", "true"); pStage.setOnCloseRequest(pWindowEvent -> { pWindowEvent.consume(); EditorFrame frame = EditorFrame.getInstance(); if(frame != null) { frame.exit(); } else { pStage.close(); } }); BorderPane pane = new BorderPane(); pane.setCenter(swingNode); ResourceBundle aAppResources = ResourceBundle.getBundle(this.getClass().getName() + "Strings"); pStage.setTitle(aAppResources.getString("app.name")); String imagePath = aAppResources.getString("app.icon"); pStage.getIcons().add(new Image(imagePath)); pStage.setScene(new Scene(pane)); pStage.show(); }

Target:
public void start(Stage pStage) throws Exception { Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); int screenWidth = (int) primaryScreenBounds.getWidth(); int screenHeight = (int) primaryScreenBounds.getHeight(); pStage.setX(screenWidth / (MARGIN_SCREEN*2)); pStage.setY(screenHeight / (MARGIN_SCREEN*2)); pStage.setWidth((screenWidth * (MARGIN_SCREEN-1)) / MARGIN_SCREEN); pStage.setHeight((screenHeight * (MARGIN_SCREEN-1))/ MARGIN_SCREEN); final SwingNode swingNode = new SwingNode(); EditorFrame frame = initializeEditorFrame(pStage); swingNode.setContent(frame); pStage.setOnCloseRequest(pWindowEvent -> { pWindowEvent.consume(); frame.exit(); }); BorderPane pane = new BorderPane(); pane.setCenter(swingNode); ResourceBundle aAppResources = ResourceBundle.getBundle(this.getClass().getName() + "Strings"); pStage.setTitle(aAppResources.getString("app.name")); String imagePath = aAppResources.getString("app.icon"); pStage.getIcons().add(new Image(imagePath)); pStage.setScene(new Scene(pane)); pStage.show(); }
Source:
public boolean isSuperclassOf(ReferenceBinding otherType) { return this.intersectingTypes[0].isClass() && this.superclass().isSuperclassOf(otherType); }

Target:
public boolean isSuperclassOf(ReferenceBinding otherType) { return this.intersectingTypes[0].isClass() && this.intersectingTypes[0].isSuperclassOf(otherType); }
Source:
private Object fetchObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("FETCH must not include data"); } if (context.isRoot()) { return handleRootQuery(context); } else if (context.rawSource instanceof GraphQLContainer) { return ((GraphQLContainer) context.rawSource).process(context, this); } Class parentClass = context.parentResource.getResourceClass(); String fieldName = context.field.getName(); throw new IllegalStateException("Illegal fetch. Tried to access field: " + fieldName + " for: " + parentClass); }

Target:
private Object fetchObjects(Environment context) { if (context.data.isPresent()) { throw new BadRequestException("FETCH must not include data"); } return context.container.processFetch(context, this); }
Source:
public void run() { try{ while(active.get()) { WatchKey key = watcher.poll(5, TimeUnit.SECONDS); if (key != null) { for (WatchEvent<?> event : key.pollEvents()) { Path updatedFile = (Path) event.context(); File modifiedFile = updatedFile.toFile(); if (modifiedFile.getName().endsWith("html")) { if (event.kind().equals(ENTRY_DELETE)) { logger.debug("Found deleted template file {}, removing it", modifiedFile); removeTemplate(new File(templateDirectory, modifiedFile.getName())); } else { logger.debug("Found updated or new template file {}, loading it", modifiedFile); loadTemplate(new File(templateDirectory, modifiedFile.getName())); } } } key.reset(); } } } catch (InterruptedException e) { logger.debug("Interrupted exception received..."); } }

Target:
public void run() { try{ while(active.get()) { WatchKey key = watcher.poll(watcherInterval, TimeUnit.SECONDS); if (key != null && active.get()) { for (WatchEvent<?> event : key.pollEvents()) { Path updatedFile = (Path) event.context(); File modifiedFile = updatedFile.toFile(); if (modifiedFile.getName().endsWith("html")) { if (event.kind().equals(ENTRY_DELETE)) { logger.debug("Found deleted template file {}, removing it", modifiedFile); removeTemplate(new File(templateDirectory, modifiedFile.getName())); } else { logger.debug("Found updated or new template file {}, loading it", modifiedFile); loadTemplate(new File(templateDirectory, modifiedFile.getName())); } } } key.reset(); } } } catch (InterruptedException e) { logger.debug("Interrupted exception received..."); } }
Source:
public EmailAddress(String fullAddress) { if (fullAddress.contains("(")) { Pattern RE = Pattern.compile(PATTERN_EMAIL); Matcher matcher = RE.matcher(fullAddress); if (matcher.matches()) { email = matcher.group(1); name = matcher.group(2); } else { throw new IllegalArgumentException("invalid email address"); } } else if (fullAddress.contains("<")) { Pattern RE = Pattern.compile(PATTERN_EMAIL_ALT); Matcher matcher = RE.matcher(fullAddress); if (matcher.matches()) { name = matcher.group(1); if (name == null) { name = ""; } email = matcher.group(2); } else { throw new IllegalArgumentException("invalid email address"); } } else { email = fullAddress; name = ""; } if (!email.matches("[^\\s,<>]+@[^\\s,<>]+")) { throw new IllegalArgumentException("invalid email address"); } }

Target:
public EmailAddress(String fullAddress) { if (fullAddress.contains("(")) { Matcher matcher = PATTERN_EMAIL.matcher(fullAddress); if (matcher.matches()) { email = matcher.group(1); name = matcher.group(2); } else { throw new IllegalArgumentException("invalid email address"); } } else if (fullAddress.contains("<")) { Matcher matcher = PATTERN_EMAIL_ANGLE.matcher(fullAddress); if (matcher.matches()) { name = matcher.group(1); if (name == null) { name = ""; } email = matcher.group(2); } else { throw new IllegalArgumentException("invalid email address"); } } else { email = fullAddress; name = ""; } if (!PATTERN_EMAIL_INVALID.matcher(email).matches()) { throw new IllegalArgumentException("invalid email address"); } }
Source:
public int compareTo(PersonAttribute other) { if (getAttributeType() == null) { if (other.getAttributeType() == null) { return 0; } return 1; } int retValue; if ((retValue = getAttributeType().compareTo(other.getAttributeType())) != 0) { return retValue; } if ((retValue = isVoided().compareTo(other.isVoided())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsLatest(getDateCreated(), other.getDateCreated())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsGreatest(getValue(), other.getValue())) != 0) { return retValue; } return OpenmrsUtil.compareWithNullAsGreatest(getPersonAttributeId(), other.getPersonAttributeId()); }

Target:
public int compareTo(PersonAttribute other) { int retValue = -1; if (getAttributeType() == null) { if (other.getAttributeType() != null) { return 1; } retValue = 0; } if (retValue != 0 && (retValue = getAttributeType().compareTo(other.getAttributeType())) != 0) { return retValue; } if ((retValue = isVoided().compareTo(other.isVoided())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsLatest(getDateCreated(), other.getDateCreated())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsGreatest(getValue(), other.getValue())) != 0) { return retValue; } return OpenmrsUtil.compareWithNullAsGreatest(getPersonAttributeId(), other.getPersonAttributeId()); }
Source:
public void onExitTab() { if (!isFragmentActive(SurveyFragment.class)) { return; } DomainEventPublisher.instance().unSubscribe( new ValueChangedEvent()); SurveyDB survey = Session.getSurveyByModule(getSimpleName()); if (survey.isCompleted() || survey.isSent()) { dashboardController.setNavigatingBackwards(false); closeSurveyFragment(); return; } new AsyncOnCloseSurveyFragment(surveyFragment, survey, org.eyeseetea.malariacare.domain .utils.Action.CHANGE_TAB).execute(); }

Target:
public void onExitTab() { if (!isFragmentActive(SurveyFragment.class)) { return; } final SurveyDB survey = Session.getSurveyByModule(getSimpleName()); if (survey.isCompleted() || survey.isSent()) { dashboardController.setNavigatingBackwards(false); closeSurveyFragment(); return; } surveyFragment.showProgress(); closeSurveyFragment(survey, org.eyeseetea.malariacare.domain .utils.Action.CHANGE_TAB); }
Source:
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { String kickReason = args.length > 0 ? getFinalArg(args, 0) : tl("kickDefault"); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n")); for (Player onlinePlayer : ess.getOnlinePlayers()) { if (!sender.isPlayer() || !onlinePlayer.getName().equalsIgnoreCase(sender.getPlayer().getName())) { if (onlinePlayer.isAuthorized("essentials.kickall.exempt")) { throw new Exception(); } onlinePlayer.kickPlayer(kickReason); } } sender.sendMessage(tl("kickedAll")); }

Target:
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { String kickReason = args.length > 0 ? getFinalArg(args, 0) : tl("kickDefault"); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n")); for (Player onlinePlayer : ess.getOnlinePlayers()) { if (!sender.isPlayer() || !onlinePlayer.getName().equalsIgnoreCase(sender.getPlayer().getName())) { if (!onlinePlayer.isAuthorized("essentials.kickall.exempt")) { onlinePlayer.kickPlayer(kickReason); } } } sender.sendMessage(tl("kickedAll")); }
Source:
private void verifyColumnConsistency() { Iterator<Cube> cubeIt = cubeCache.cubesIterator(); while (cubeIt.hasNext()) { Cube cube = cubeIt.next(); IColumn cubeCol = cube.getColumn(); IColumn storedCol = cubeCache.getLoadedColumn(cube.getX(), cube.getZ()); if (storedCol == null) { throw new RuntimeException("Cube with no stored column!"); } if (storedCol != cubeCol) { throw new RuntimeException("CubeColumn and StoredColumn are different!"); } } Iterator<IColumn> columnIt = cubeCache.columnsIterator(); int totalCubes = 0; while (columnIt.hasNext()) { IColumn storedCol = columnIt.next(); Collection<Cube> storedColumnCubes = storedCol.getLoadedCubes(); for (Cube c : storedColumnCubes) { CubePos crd = c.getCoords(); if (cubeCache.getCube(crd.getX(), crd.getY(), crd.getZ(), Requirement.GET_CACHED) != c) { throw new RuntimeException("Cube in column not the same as stored cube!"); } } totalCubes += storedColumnCubes.size(); } if (totalCubes != cubeCache.getLoadedCubeCount()) { throw new RuntimeException("Counted " + totalCubes + " cubes in columns, but there are total of " + cubeCache.getLoadedCubeCount() + " cubes!"); } }

Target:
private void verifyColumnConsistency() { Iterator<Cube> cubeIt = cubeCache.cubesIterator(); while (cubeIt.hasNext()) { Cube cube = cubeIt.next(); IColumn cubeCol = cube.getColumn(); IColumn storedCol = cubeCache.getLoadedColumn(cube.getX(), cube.getZ()); if (storedCol == null) { throw new RuntimeException("Cube with no stored column!"); } if (storedCol != cubeCol) { throw new RuntimeException("CubeColumn and StoredColumn are different!"); } } Iterator<IColumn> columnIt = cubeCache.columnsIterator(); int totalCubes = 0; while (columnIt.hasNext()) { IColumn storedCol = columnIt.next(); Collection<Cube> storedColumnCubes = storedCol.getLoadedCubes(); for (Cube c : storedColumnCubes) { if (cubeCache.getLoadedCube(c.getCoords()) != c) { throw new RuntimeException("Cube in column not the same as stored cube!"); } } totalCubes += storedColumnCubes.size(); } if (totalCubes != cubeCache.getLoadedCubeCount()) { throw new RuntimeException("Counted " + totalCubes + " cubes in columns, but there are total of " + cubeCache.getLoadedCubeCount() + " cubes!"); } }
Source:
public static ListenableFuture<Void> init(@NonNull Context context, @NonNull AppConfig appConfig) { Preconditions.checkNotNull(context); Preconditions.checkNotNull(appConfig); synchronized (sInitDeinitLock) { if (sTargetInitialized) { deinit(); } Preconditions.checkState(!sTargetInitialized, "Must call CameraX.deinit() first."); sTargetInitialized = true; Executor executor = appConfig.getCameraExecutor(null); if (executor == null) { executor = new CoreCameraExecutor(); } CameraX cameraX = new CameraX(executor); sInstance = cameraX; ListenableFuture<Void> deinitFuture = sInitDeinitFuture; sInitDeinitFuture = CallbackToFutureAdapter.getFuture( completer -> { deinitFuture.addListener(() -> { Futures.propagate(cameraX.initInternal(context, appConfig), completer); }, cameraX.mCameraExecutor); return "CameraX init"; }); return sInitDeinitFuture; } }

Target:
public static ListenableFuture<Void> init(@NonNull Context context, @NonNull AppConfig appConfig) { Preconditions.checkNotNull(context); Preconditions.checkNotNull(appConfig); synchronized (sInitDeinitLock) { if (sTargetInitialized) { deinit(); } Preconditions.checkState(!sTargetInitialized, "Must call CameraX.deinit() first."); sTargetInitialized = true; Executor executor = appConfig.getCameraExecutor(null); if (executor == null) { executor = new CoreCameraExecutor(); } CameraX cameraX = new CameraX(executor); sInstance = cameraX; sInitFuture = FutureChain.from(sDeinitFuture) .transformAsync(input -> cameraX.initInternal(context, appConfig), CameraXExecutors.directExecutor()); return sInitFuture; } }
Source:
private void flushRaw(int limit) throws IOException { int expectedPacketSize = limit + HEADER_LENGTH * ((limit / maxPacketSize) + 1); int notCompressPosition = 0; while (notCompressPosition < expectedPacketSize) { int length = buffer.remaining(); if (length > maxPacketSize) { length = maxPacketSize; } byte[] header = new byte[HEADER_LENGTH]; header[0] = (byte) (length & 0xff); header[1] = (byte) (length >>> 8); header[2] = (byte) (length >>> 16); header[3] = (byte) seqNo++; outputStream.write(header, 0, HEADER_LENGTH); notCompressPosition += 4; if (length > 0) { this.buffer.writeTo(this.outputStream); this.outputStream.flush(); notCompressPosition += length; } } }

Target:
private void flushRaw(int limit) throws IOException { int expectedPacketSize = limit + HEADER_LENGTH * ((limit / maxPacketSize) + 1); if (limit < maxPacketSize) { byte[] header = this.header; header[0] = (byte) (limit & 0xff); header[1] = (byte) (limit >>> 8); header[2] = (byte) (limit >>> 16); header[3] = (byte) seqNo++; outputStream.write(header, 0, HEADER_LENGTH); this.buffer.writeTo(this.outputStream); } else { int notCompressPosition = 0; while (notCompressPosition < expectedPacketSize) { int length = buffer.remaining(); if (length > maxPacketSize) { length = maxPacketSize; } byte[] header = this.header; header[0] = (byte) (length & 0xff); header[1] = (byte) (length >>> 8); header[2] = (byte) (length >>> 16); header[3] = (byte) seqNo++; outputStream.write(header, 0, HEADER_LENGTH); notCompressPosition += 4; if (length > 0) { this.buffer.writePartTo(this.outputStream, length); notCompressPosition += length; } } } }
Source:
private void setupButtons() { Button closeButton = (Button)findViewById(R.id.RestartCommCare); closeButton.setText(Localization.get("crash.warning.button")); closeButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { CommCareApplication._().restartCommCare(CrashWarningActivity.this); } }); infoButton = (ImageButton)findViewById(R.id.InfoButton); infoButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { toggleErrorMessageVisibility(); } }); }

Target:
private void setupButtons() { Button closeButton = (Button)findViewById(R.id.RestartCommCare); closeButton.setText(Localization.get("crash.warning.button")); closeButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { CommCareApplication.restartCommCare(CrashWarningActivity.this); } }); infoButton = (ImageButton)findViewById(R.id.InfoButton); infoButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { toggleErrorMessageVisibility(); } }); }
Source:
private Optional<LocalMemoryContext> getSystemMemoryContext() { try { return Optional.of(systemMemoryContextSupplier.get()); } catch (Exception ignored) { } return Optional.empty(); }

Target:
private Optional<LocalMemoryContext> getSystemMemoryContext() { try { return Optional.of(systemMemoryContextSupplier.get()); } catch (RuntimeException ignored) { } return Optional.empty(); }
Source:
public void requestPinReset(UUID userID) { ConfirmationCode confirmationCode = createConfirmationCode(); setConfirmationCode(userID, confirmationCode); }

Target:
public void requestPinReset(UUID userID) { User userEntity = userService.getUserByID(userID); ConfirmationCode confirmationCode = createConfirmationCode(); setConfirmationCode(userEntity, confirmationCode); if (confirmationCode.getConfirmationCode() != null) { userService.sendConfirmationCodeTextMessage(userEntity.getMobileNumber(), confirmationCode, SmsService.TemplateName_AddUserNumberConfirmation); } }
Source:
public void deleteContainer(ContainerDTO container, Consumer<ContainerDTO> onSuccess, Consumer<Exception> onError) { try { this.fileUtilities.remove(container.getPath()); } catch (IOException e) { LOGGER.error("Cannot delete container (" + container.getPath() + ")! Exception: " + e.toString()); onError.accept(e); } final String engineId = container.getEngine().toLowerCase(); final List<ShortcutCategoryDTO> categories = this.libraryManager.fetchShortcuts(); categories.stream().flatMap(shortcutCategory -> shortcutCategory.getShortcuts().stream()) .forEach(shortcut -> { final InteractiveScriptSession interactiveScriptSession = this.scriptInterpreter .createInteractiveSession(); interactiveScriptSession.eval("include(\"engines." + engineId + ".shortcuts.reader\");", ignored -> interactiveScriptSession.eval("new ShortcutReader()", output -> { final org.graalvm.polyglot.Value shortcutReader = (org.graalvm.polyglot.Value) output; shortcutReader.invokeMember("of", shortcut); final String containerName = shortcutReader.invokeMember("container").as(String.class); if (containerName.equals(container.getName())) { this.shortcutManager.deleteShortcut(shortcut); } }, onError), onError); }); onSuccess.accept(container); }

Target:
public void deleteContainer(ContainerDTO container, Consumer<ContainerDTO> onSuccess, Consumer<Exception> onError) { try { final File containerFile = new File(container.getPath()); FileUtils.deleteDirectory(containerFile); } catch (IOException e) { LOGGER.error("Cannot delete container (" + container.getPath() + ")! Exception: " + e.toString()); onError.accept(e); } final String engineId = container.getEngine().toLowerCase(); final List<ShortcutCategoryDTO> categories = this.libraryManager.fetchShortcuts(); categories.stream().flatMap(shortcutCategory -> shortcutCategory.getShortcuts().stream()) .forEach(shortcut -> { final InteractiveScriptSession interactiveScriptSession = this.scriptInterpreter .createInteractiveSession(); interactiveScriptSession.eval("include(\"engines." + engineId + ".shortcuts.reader\");", ignored -> interactiveScriptSession.eval("new ShortcutReader()", output -> { final org.graalvm.polyglot.Value shortcutReader = (org.graalvm.polyglot.Value) output; shortcutReader.invokeMember("of", shortcut); final String containerName = shortcutReader.invokeMember("container").as(String.class); if (containerName.equals(container.getName())) { this.shortcutManager.deleteShortcut(shortcut); } }, onError), onError); }); onSuccess.accept(container); }
Source:
private FileDownloader createCustomFileDownloader() { if (customClass == null) { throw new CustomFilePersistenceException("CustomFilePersistence class cannot be accessed, is it public?"); } try { ClassLoader systemClassLoader = getClass().getClassLoader(); Class<?> customFilePersistenceClass = systemClassLoader.loadClass(customClass.getCanonicalName()); return (FileDownloader) customFilePersistenceClass.newInstance(); } catch (IllegalAccessException e) { throw new CustomFilePersistenceException(customClass, "Class cannot be accessed, is it public?", e); } catch (ClassNotFoundException e) { throw new CustomFilePersistenceException(customClass, "Class does not exist", e); } catch (InstantiationException e) { throw new CustomFilePersistenceException(customClass, "Class cannot be instantiated", e); } }

Target:
private FileDownloader createCustomFileDownloader() { if (customClass == null) { throw new CustomFileDownloaderException("CustomFileDownloader class cannot be accessed, is it public?"); } try { ClassLoader systemClassLoader = getClass().getClassLoader(); Class<?> customFileDownloaderClass = systemClassLoader.loadClass(customClass.getCanonicalName()); return (FileDownloader) customFileDownloaderClass.newInstance(); } catch (IllegalAccessException e) { throw new CustomFileDownloaderException(customClass, "Class cannot be accessed, is it public?", e); } catch (ClassNotFoundException e) { throw new CustomFileDownloaderException(customClass, "Class does not exist", e); } catch (InstantiationException e) { throw new CustomFileDownloaderException(customClass, "Class cannot be instantiated", e); } }
Source:
public void testGetDependentFields() throws Exception { List<String> dependentFields = fac.getDependentFields(); assertEquals(1, dependentFields.size()); assertEquals("field", dependentFields.get(0)); }

Target:
public void testGetDependentFields() { List<String> dependentFields = fac.getDependentFields(); assertEquals(1, dependentFields.size()); assertEquals("field", dependentFields.get(0)); }
Source:
public void addPrivateDnsRoutes() { if (DBG) { Log.d(TAG, "addPrivateDnsRoutes for " + this + "(" + mInterfaceName + ") - mPrivateDnsRouteSet = "+mPrivateDnsRouteSet); } if (mInterfaceName != null && !mPrivateDnsRouteSet) { for (String addrString : getNameServers()) { if (addrString != null) { try { InetAddress inetAddress = InetAddress.getByName(addrString); if (DBG) Log.d(TAG, " adding " + addrString); NetworkUtils.addHostRoute(mInterfaceName, inetAddress); } catch (UnknownHostException e) { if (DBG) Log.d(TAG, " DNS address " + addrString + " : Exception " + e); } } } mPrivateDnsRouteSet = true; } }

Target:
public void addPrivateDnsRoutes() { if (DBG) { Log.d(TAG, "addPrivateDnsRoutes for " + this + "(" + mInterfaceName + ") - mPrivateDnsRouteSet = "+mPrivateDnsRouteSet); } if (mInterfaceName != null && !mPrivateDnsRouteSet) { for (String addrString : getNameServers()) { if (addrString != null) { try { InetAddress inetAddress = InetAddress.getByName(addrString); if (DBG) Log.d(TAG, " adding " + addrString); if (NetworkUtils.addHostRoute(mInterfaceName, inetAddress, null)) { mPrivateDnsRouteSet = true; } } catch (UnknownHostException e) { if (DBG) Log.d(TAG, " DNS address " + addrString + " : Exception " + e); } } } } }
Source:
public void loadParameterValues(String fileName) throws NoScriptDefinitionSelectedException, ScriptDefinitionNotMatched, UnsupportedOperationException { ScriptDefinitionWrapper scriptDefinition = getScriptDefinition() .orElseThrow(() -> new NoScriptDefinitionSelectedException("No Configuration Selected")); List<Map<ActionParameter, String>> list = scriptGenFileHandler.getParameterValues(preferenceSupplier.scriptGeneratorDataFileFolder() + fileName + ".json", preferenceSupplier.scriptGeneratorScriptDefinitionFolders() + scriptDefinition.getName() + ".py"); scriptGeneratorTable.addMultipleActions(list); currentlyLoadedDataFileContent = scriptGenFileHandler.getCurrentlyLoadedDataFileContent(); }

Target:
public void loadParameterValues(String fileName) throws NoScriptDefinitionSelectedException, ScriptDefinitionNotMatched, UnsupportedOperationException { ScriptDefinitionWrapper scriptDefinition = getScriptDefinition() .orElseThrow(() -> new NoScriptDefinitionSelectedException("No Configuration Selected")); List<Map<ActionParameter, String>> list = scriptGenFileHandler.getParameterValues(fileName, preferenceSupplier.scriptGeneratorScriptDefinitionFolders() + scriptDefinition.getName() + PYTHON_EXT); scriptGeneratorTable.addMultipleActions(list); }
Source:
public void processWatermark(Watermark mark) throws Exception { super.processWatermark(mark); this.currentWatermark = mark.getTimestamp(); ((FlinkKafkaShuffleProducer) userFunction).invoke(mark); }

Target:
public void processWatermark(Watermark mark) throws Exception { super.processWatermark(mark); ((FlinkKafkaShuffleProducer) userFunction).invoke(mark); }
Source:
public Object getSource(Cell cell, Predicate<Object> predicate) { for (Cell c = cell; c != null; c = c.getParent()) { Collection<Mapper<?, ?>> mappers = myIndex.getMappers(c); if (!mappers.isEmpty()) { Mapper<?, ?> mapper = mappers.iterator().next(); Object source = doGetSource(mapper, cell); Object res = source == null ? mapper.getSource() : source; if (predicate.apply(res)) return res; } } return null; }

Target:
public Object getSource(Cell cell, Predicate<Object> predicate) { for (Cell c = cell; c != null; c = c.getParent()) { Collection<Mapper<?, ?>> mappers = myIndex.getMappers(c); if (!mappers.isEmpty()) { Mapper<?, ?> mapper = mappers.iterator().next(); Object source = doGetSource(mapper, cell); Object result = source == null ? mapper.getSource() : source; if (predicate.apply(result)) return result; } } return null; }
Source:
private void addStatusFilter(DiscoverQuery query) { try { if (!authorizeService.isAdmin(context) && (authorizeService.isCommunityAdmin(context) || authorizeService.isCollectionAdmin(context))) { query.addFilterQueries(searcher.createLocationQueryForAdministrableItems(context)); } } catch (SQLException ex) { log.error(ex); } }

Target:
private void addStatusFilter(DiscoverQuery query) { try { if (!authorizeService.isAdmin(context) && (authorizeService.isCommunityAdmin(context) || authorizeService.isCollectionAdmin(context))) { query.addFilterQueries(searcher.createLocationQueryForAdministrableItems(context)); } } catch (SQLException ex) { log.error("Error looking up authorization rights of current user", ex); } }