auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createUserCardShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.createUserCard(new CardRequest("foo", "bar"), new RetrofitPromise<Card>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); }

Target:
public void createUserCardShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.createUserCard(new CardRequest("foo", "bar"), new RetrofitPromise<Card>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards", MOCK_URL)); }
Source:
private static URL fileToUrl(File file) { URI uri; try { uri = file.toURI(); } catch (SecurityException e) { throw new IllegalArgumentException("No access to the underlying file " + file.getPath()); } try { return uri.toURL(); } catch (MalformedURLException e) { throw new IllegalArgumentException("Unable to convert URI " + uri + " to URL", e); } }

Target:
private static URL fileToUrl(File file) { String filePath = file.getPath(); if (!file.isAbsolute()) { filePath = filePath.replace(File.separatorChar, '/'); if (file.isDirectory() && !filePath.endsWith("/")) { filePath += "/"; } try { String encodedPath = new URI(null, null, filePath, null).getRawPath(); return new URL("file", null, 0, encodedPath); } catch (MalformedURLException | URISyntaxException e) { throw new IllegalArgumentException("Unable to create URL for file " + filePath, e); } } URI uri = null; try { uri = file.toURI(); return uri.toURL(); } catch (SecurityException e) { throw new IllegalArgumentException("No access to the underlying file " + filePath, e); } catch (MalformedURLException e) { throw new IllegalArgumentException("Unable to convert URI " + uri + " to URL", e); } }
Source:
public static ModuleManager create() throws Exception { ModuleManager moduleManager = new ModuleManagerImpl(""); return LoadModuleEnvironment(moduleManager); }

Target:
public static ModuleManager create() throws Exception { return create(""); }
Source:
protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int gridLineAdjustment = this.dropdownTableViewer.getTable().getGridLineWidth() * 2; int listHeight = getVisibleItemCount() * this.dropdownTableViewer.getTable().getItemHeight() + gridLineAdjustment; this.dropdownTableViewer.getTable().getColumn(0).pack(); this.selectAllItemViewer.getTable().getColumn(0).pack(); int listWidth = Math.max( this.dropdownTableViewer.getTable().computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int viewerHeight = this.selectAllItemViewer.getTable().getItemHeight(); listWidth = Math.max( this.selectAllItemViewer.getTable().computeSize(SWT.DEFAULT, viewerHeight, true).x, listWidth); this.dropdownTableViewer.getTable().setSize(listWidth, listHeight); this.selectAllItemViewer.getTable().setSize(listWidth, viewerHeight); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); if (this.dropdownTableViewer.getTable().getVerticalBar() != null && this.maxVisibleItems > -1 && this.dropdownTableViewer.getTable().getItemCount() > this.maxVisibleItems) { listWidth += gridLineAdjustment; } this.dropdownShell.setBounds(textPosition.x, textPosition.y + this.text.getBounds().height, listWidth, listHeight + viewerHeight); } }

Target:
protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int gridLineAdjustment = this.dropdownTable.getGridLineWidth() * 2; int listHeight = getVisibleItemCount() * this.dropdownTable.getItemHeight() + gridLineAdjustment; this.dropdownTable.getColumn(0).pack(); this.selectAllItemViewer.getTable().getColumn(0).pack(); int listWidth = Math.max( this.dropdownTable.computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int viewerHeight = this.selectAllItemViewer.getTable().getItemHeight(); listWidth = Math.max( this.selectAllItemViewer.getTable().computeSize(SWT.DEFAULT, viewerHeight, true).x, listWidth); this.dropdownTable.setSize(listWidth, listHeight); this.selectAllItemViewer.getTable().setSize(listWidth, viewerHeight); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); if (this.dropdownTable.getVerticalBar() != null && this.maxVisibleItems > -1 && this.dropdownTable.getItemCount() > this.maxVisibleItems) { listWidth += gridLineAdjustment; } int filterTextBoxHeight = 0; if (this.dropdownFilter) { Point point = this.filterBox.computeSize(SWT.DEFAULT, SWT.DEFAULT); filterTextBoxHeight = this.filterBox.getBorderWidth() + point.y; } this.dropdownShell.setBounds(textPosition.x, textPosition.y + this.text.getBounds().height, listWidth, listHeight + viewerHeight + filterTextBoxHeight); } }
Source:
private Constraint maximumCapacity(ConstraintFactory factory) { return factory.from(MrMachineCapacity.class) .join(MrProcessAssignment.class, equal(MrMachineCapacity::getMachine, MrProcessAssignment::getMachine) ) .groupBy((machineCapacity, processAssignment) -> machineCapacity, sumLong( (machineCapacity, processAssignment) -> processAssignment.getUsage(machineCapacity.getResource())) ) .filter(((machineCapacity, usage) -> machineCapacity.getMaximumCapacity() < usage)) .penalizeLong(MrConstraints.MAXIMUM_CAPACITY, HardSoftLongScore.ofHard(1L), (machineCapacity, usage) -> machineCapacity.getMaximumCapacity() - usage); }

Target:
private Constraint maximumCapacity(ConstraintFactory factory) { return factory.from(MrMachineCapacity.class) .join(MrProcessAssignment.class, equal(MrMachineCapacity::getMachine, MrProcessAssignment::getMachine) ) .groupBy((machineCapacity, processAssignment) -> machineCapacity, sumLong((machineCapacity, processAssignment) -> processAssignment.getUsage(machineCapacity.getResource())) ) .filter(((machineCapacity, usage) -> machineCapacity.getMaximumCapacity() < usage)) .penalizeLong(MrConstraints.MAXIMUM_CAPACITY, HardSoftLongScore.ONE_HARD, (machineCapacity, usage) -> usage - machineCapacity.getMaximumCapacity()); }
Source:
public void testInitialize() { fieldStateValidator.initialize(); assertEquals(2, fieldStateValidator.validators.size()); assertTrue(fieldStateValidator.validators.containsKey(String.class)); assertTrue(fieldStateValidator.validators.containsKey(ArrayList.class)); }

Target:
public void testInitialize() { fieldStateValidator.initialize(); assertThat(fieldStateValidator.validators).hasSize(2); assertThat(fieldStateValidator.validators).containsKeys(String.class, ArrayList.class); }
Source:
public static void setPermissionHandler(IPermissionHandler handler) { FMLLog.log(Level.INFO, "Replacing " + permissionHandler.getClass().getName() + " with " + handler.getClass().getName()); permissionHandler = handler; }

Target:
public static void setPermissionHandler(IPermissionHandler handler) { Preconditions.checkNotNull(handler, "Permission handler can't be null!"); Preconditions.checkState(Loader.instance().getLoaderState().ordinal() <= LoaderState.PREINITIALIZATION.ordinal(), "Can't register after IPermissionHandler PreInit!"); FMLLog.log(Level.WARN, "Replacing " + permissionHandler.getClass().getName() + " with " + handler.getClass().getName()); permissionHandler = handler; }
Source:
protected void testAuditSourceIdentification(List<AuditSourceIdentificationType> auditSourceIdentification, AssertionType assertion) { if (assertion != null && assertion.getUserInfo() != null && assertion.getUserInfo().getOrg() != null && assertion.getUserInfo().getOrg().getHomeCommunityId() != null && auditSourceIdentification != null && !auditSourceIdentification.isEmpty() && auditSourceIdentification.size() > 0) { for (AuditSourceIdentificationType auditSourceId : auditSourceIdentification) { assertEquals(AuditTransformsConstants.HOME_COMMUNITY_ID_PREFIX + assertion.getUserInfo().getOrg().getHomeCommunityId(), auditSourceId.getAuditSourceID()); } } }

Target:
protected void testAuditSourceIdentification(List<AuditSourceIdentificationType> auditSourceIdentification, AssertionType assertion) { if (assertion != null && assertion.getUserInfo() != null && assertion.getUserInfo().getOrg() != null && assertion.getUserInfo().getOrg().getHomeCommunityId() != null && auditSourceIdentification != null) { for (AuditSourceIdentificationType auditSourceId : auditSourceIdentification) { assertEquals(HomeCommunityMap.getHomeCommunityIdWithPrefix( assertion.getUserInfo().getOrg().getHomeCommunityId()), auditSourceId.getAuditSourceID()); } } }
Source:
public static Algorithm RSA384(RSAKey key) throws IllegalArgumentException { RSAPublicKey publicKey = key instanceof PublicKey ? (RSAPublicKey) key : null; RSAPrivateKey privateKey = key instanceof PrivateKey ? (RSAPrivateKey) key : null; return RSA384(publicKey, privateKey); }

Target:
public static Algorithm RSA384(RSAKey key) throws IllegalArgumentException { RSAPublicKey publicKey = key instanceof RSAPublicKey ? (RSAPublicKey) key : null; RSAPrivateKey privateKey = key instanceof RSAPrivateKey ? (RSAPrivateKey) key : null; return RSA384(publicKey, privateKey); }
Source:
public CompletableFuture<Void> remove(Predicate<? super V> p) { class Remover { private Predicate<? super V> p; public Remover(Predicate<? super V> p) { this.p = p; } public Void removeEveryMatchingValue() { cache.keySet().stream().forEach((c, key) -> c.computeIfPresent(key, (o, o1) -> { Collection<V> values = (Collection<V>) o1; Collection<V> newValues = new HashSet<>(); for (V v : values) { if (!p.test(v)) newValues.add(v); } return newValues.isEmpty() ? null : newValues; })); return null; } } return CompletableFuture.completedFuture(new Remover(p).removeEveryMatchingValue()); }

Target:
public CompletableFuture<Void> remove(Predicate<? super V> p) { requireNonNull(p, "predicate can't be null"); CompletableFuture<Void> cf = CompletableFutures.completedNull(); try { if (isExplicitTxContext()) { cf = completedFuture(this.removeInternal(p)); } else { cf = runAsync(() -> this.removeInternal(p)); } } catch (SystemException e) { rethrowException(e); } return cf; }
Source:
public static String pipeTextToFile(String text, String filepath) { String id = Identifiers.makeRandomId(8); return "cat > " + filepath + " << EOL_" + id + "\n" + text + "EOL_" + id + "\n"; }

Target:
public static String pipeTextToFile(String text, String filepath) { return "cat > \"" + filepath + "\" << EOF_BROOKLYN\n" + text + "\n" + "EOF_BROOKLYN\n"; }
Source:
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) { return; } final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); if (index != null) { if (hasWSEndpoints(index)) { AttachmentList<ResourceRoot> resourceRoots = unit.getAttachment(RESOURCE_ROOTS); if (resourceRoots != null) { for (ResourceRoot root : resourceRoots) { if (root.getRoot().getChild("META-INF/services/javax.xml.datatype.DatatypeFactory").exists() || root.getRoot().getChild("META-INF/services/javax.xml.parsers.DocumentBuilderFactory").exists() || root.getRoot().getChild("META-INF/services/javax.xml.parsers.SAXParserFactory").exists() || root.getRoot().getChild("META-INF/services/jjavax.xml.validation.SchemaFactory").exists()) { throw WSLogger.ROOT_LOGGER.invalidLibraryInDeployment("JAXP Implementation", root.getRootName()); } if (hasClassesFromPackage(root.getAttachment(ANNOTATION_INDEX), "org.apache.cxf")) { throw WSLogger.ROOT_LOGGER.invalidLibraryInDeployment("Apache CXF", root.getRootName()); } } } } } else { WSLogger.ROOT_LOGGER.tracef("Skipping WS annotation processing since no composite annotation index found in unit: %s", unit.getName()); } }

Target:
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) { return; } final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); if (index != null) { if (hasWSEndpoints(index)) { AttachmentList<ResourceRoot> resourceRoots = unit.getAttachment(RESOURCE_ROOTS); if (resourceRoots != null) { for (ResourceRoot root : resourceRoots) { if (root.getRoot().getChild("META-INF/services/javax.xml.datatype.DatatypeFactory").exists() || root.getRoot().getChild("META-INF/services/javax.xml.parsers.DocumentBuilderFactory").exists() || root.getRoot().getChild("META-INF/services/javax.xml.parsers.SAXParserFactory").exists() || root.getRoot().getChild("META-INF/services/javax.xml.validation.SchemaFactory").exists()) { WSLogger.ROOT_LOGGER.warningLibraryInDeployment("JAXP Implementation", root.getRootName()); } if (hasClassesFromPackage(root.getAttachment(ANNOTATION_INDEX), "org.apache.cxf")) { throw WSLogger.ROOT_LOGGER.invalidLibraryInDeployment("Apache CXF", root.getRootName()); } } } } } else { WSLogger.ROOT_LOGGER.tracef("Skipping WS annotation processing since no composite annotation index found in unit: %s", unit.getName()); } }
Source:
public int receiveEnergy( int maxReceive, boolean simulate ) { int total = 0; try { final int outputTunnels = PartP2PFEPower.this.getOutputs().size(); if( outputTunnels == 0 ) { return 0; } final int amountPerOutput = maxReceive / outputTunnels; int overflow = maxReceive % amountPerOutput; for( PartP2PFEPower target : PartP2PFEPower.this.getOutputs() ) { final IEnergyStorage output = target.getOutput(); final int toSend = amountPerOutput + overflow; final int received = output.receiveEnergy( toSend, simulate ); overflow = toSend - received; total += received; } PartP2PFEPower.this.queueTunnelDrain( PowerUnits.RF, total ); } catch( GridAccessException ignored ) { } return total; }

Target:
public int receiveEnergy( int maxReceive, boolean simulate ) { int total = 0; try { final int outputTunnels = PartP2PFEPower.this.getOutputs().size(); if( outputTunnels == 0 ) { return 0; } final int amountPerOutput = maxReceive / outputTunnels; int overflow = maxReceive % amountPerOutput; for( PartP2PFEPower target : PartP2PFEPower.this.getOutputs() ) { final IEnergyStorage output = target.getAttachedEnergyStorage(); final int toSend = amountPerOutput + overflow; final int received = output.receiveEnergy( toSend, simulate ); overflow = toSend - received; total += received; } PartP2PFEPower.this.queueTunnelDrain( PowerUnits.RF, total ); } catch( GridAccessException ignored ) { } return total; }
Source:
public void setRestoring(boolean isRestoring) { this.isRestore.set(isRestoring); }

Target:
public void setRestoring(boolean isRestoring) { this.isRestoring.set(isRestoring); }
Source:
public RelNode align(Aggregate rel, List<RelFieldCollation> collations) { LinkedHashSet<Integer> aggregateColumnsOrder = new LinkedHashSet<>(); ImmutableList.Builder<RelFieldCollation> propagateCollations = ImmutableList.builder(); if (rel.getGroupType() == Group.SIMPLE && !collations.isEmpty()) { for (RelFieldCollation c : collations) { if (c.getFieldIndex() < rel.getGroupCount()) { if (aggregateColumnsOrder.add(c.getFieldIndex())) { propagateCollations.add(c.copy(rel.getGroupSet().nth(c.getFieldIndex()))); } } } } for (int i = 0; i < rel.getGroupCount(); i++) { if (!aggregateColumnsOrder.contains(i)) { propagateCollations.add(new RelFieldCollation(rel.getGroupSet().nth(i))); } } final RelNode child = dispatchAlign(rel.getInput(), propagateCollations.build()); final Aggregate newAggregate = (Aggregate) rel.copy(rel.getTraitSet(), ImmutableList.of(child)); if (newAggregate instanceof HiveAggregate) { ((HiveAggregate) newAggregate).setAggregateColumnsOrder(aggregateColumnsOrder); } return newAggregate; }

Target:
public RelNode align(Aggregate rel, List<RelFieldCollation> collations) { LinkedHashSet<Integer> aggregateColumnsOrder = new LinkedHashSet<>(); ImmutableList.Builder<RelFieldCollation> propagateCollations = ImmutableList.builder(); if (rel.getGroupType() == Group.SIMPLE && !collations.isEmpty()) { for (RelFieldCollation c : collations) { if (c.getFieldIndex() < rel.getGroupCount()) { if (aggregateColumnsOrder.add(c.getFieldIndex())) { propagateCollations.add(c.copy(rel.getGroupSet().nth(c.getFieldIndex()))); } } } } for (int i = 0; i < rel.getGroupCount(); i++) { if (!aggregateColumnsOrder.contains(i)) { propagateCollations.add(new RelFieldCollation(rel.getGroupSet().nth(i))); } } final RelNode child = dispatchAlign(rel.getInput(), propagateCollations.build()); final HiveAggregate newAggregate = (HiveAggregate) rel.copy(rel.getTraitSet(), ImmutableList.of(child)); newAggregate.setAggregateColumnsOrder(aggregateColumnsOrder); return newAggregate; }
Source:
public void trade() { for (Entry<String, ArrayList<Order>> entry : buyOrders.entrySet()) { String stockKey = entry.getKey(); ArrayList<Order> stockBuyList = entry.getValue(); if (stockBuyList != null) { if (sellOrders.get(stockKey) != null) { ArrayList<Order> stockSellList = sellOrders.get(stockKey); for (Order buy : stockBuyList) { for (Order sell : stockSellList) { if (buy.getPrice() == sell.getPrice()) { Trader buyTrader = buy.getTrader(); Trader sellTrader = sell.getTrader(); try { buyTrader.tradePerformed(buy, buy.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } try { sellTrader.tradePerformed(sell, sell.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } try { market.updateStockPrice(buy.getStockSymbol(), buy.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } stockBuyList.remove(buy); stockSellList.remove(sell); buyOrders.put(stockKey, stockBuyList); sellOrders.put(stockKey, stockSellList); } } } } } } }

Target:
public void trade() { for (Entry<String, ArrayList<Order>> entry : buyOrders.entrySet()) { String stockKey = entry.getKey(); ArrayList<Order> stockBuyList = entry.getValue(); if (stockBuyList != null && sellOrders.get(stockKey) != null) { ArrayList<Order> stockSellList = sellOrders.get(stockKey); for (Order buy : stockBuyList) { for (Order sell : stockSellList) { if (buy.getPrice() == sell.getPrice()) { Trader buyTrader = buy.getTrader(); Trader sellTrader = sell.getTrader(); try { buyTrader.tradePerformed(buy, buy.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } try { sellTrader.tradePerformed(sell, sell.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } try { market.updateStockPrice(buy.getStockSymbol(), buy.getPrice()); } catch (StockMarketExpection e) { e.printStackTrace(); } stockBuyList.remove(buy); stockSellList.remove(sell); buyOrders.put(stockKey, stockBuyList); sellOrders.put(stockKey, stockSellList); } } } } } }
Source:
private static void validatePlatformKeys( ImmutableList<ConfiguredTargetKey> platformKeys, Environment env) throws InterruptedException, InvalidPlatformException { Map<ConfiguredTargetKey, PackageIdentifier> targetsToPackageIdentifiers = platformKeys.stream() .distinct() .collect( toImmutableMap(Function.identity(), ctk -> ctk.getLabel().getPackageIdentifier())); ImmutableSet<PackageValue.Key> packageKeys = targetsToPackageIdentifiers.values().stream() .distinct() .map(PackageValue::key) .collect(toImmutableSet()); Map<PackageIdentifier, Package> packages = new HashMap<>(); Map<SkyKey, ValueOrException<NoSuchPackageException>> values = env.getValuesOrThrow(packageKeys, NoSuchPackageException.class); if (env.valuesMissing()) { return; } for (Map.Entry<SkyKey, ValueOrException<NoSuchPackageException>> value : values.entrySet()) { try { PackageValue packageValue = (PackageValue) value.getValue().get(); packages.put(packageValue.getPackage().getPackageIdentifier(), packageValue.getPackage()); } catch (NoSuchPackageException e) { } } HasPlatformInfo hasPlatformInfo = HasPlatformInfo.create(); for (ConfiguredTargetKey platformKey : platformKeys) { try { Label platformLabel = platformKey.getLabel(); Target target = packages.get(platformLabel.getPackageIdentifier()).getTarget(platformLabel.getName()); if (!hasPlatformInfo.hasPlatformInfo(target)) { throw new InvalidPlatformException(platformLabel); } } catch (NoSuchTargetException e) { } } }

Target:
private static void validatePlatformKeys( ImmutableList<ConfiguredTargetKey> platformKeys, Environment env) throws InterruptedException, InvalidPlatformException { ImmutableSet<PackageValue.Key> packageKeys = platformKeys.stream() .map(ConfiguredTargetKey::getLabel) .map(Label::getPackageIdentifier) .distinct() .map(PackageValue::key) .collect(toImmutableSet()); Map<SkyKey, ValueOrException<NoSuchPackageException>> values = env.getValuesOrThrow(packageKeys, NoSuchPackageException.class); boolean valuesMissing = env.valuesMissing(); Map<PackageIdentifier, Package> packages = valuesMissing ? null : new HashMap<>(); for (Map.Entry<SkyKey, ValueOrException<NoSuchPackageException>> value : values.entrySet()) { try { PackageValue packageValue = (PackageValue) value.getValue().get(); if (!valuesMissing && packageValue != null) { packages.put(packageValue.getPackage().getPackageIdentifier(), packageValue.getPackage()); } } catch (NoSuchPackageException e) { throw new InvalidPlatformException(e); } } if (valuesMissing) { return; } for (ConfiguredTargetKey platformKey : platformKeys) { try { Label platformLabel = platformKey.getLabel(); Target target = packages.get(platformLabel.getPackageIdentifier()).getTarget(platformLabel.getName()); if (!hasPlatformInfo(target)) { throw new InvalidPlatformException(platformLabel); } } catch (NoSuchTargetException e) { throw new InvalidPlatformException(e); } } }
Source:
public Datastream getDatastream(String datastreamName) throws DatastreamException { GetRequest request = _builders.get().id(datastreamName).build(); ResponseFuture<Datastream> datastreamResponseFuture = _restClient.sendRequest(request); Response<Datastream> response; try { response = datastreamResponseFuture.getResponse(); return response.getEntity(); } catch (RemoteInvocationException e) { if(e instanceof RestLiResponseException && ((RestLiResponseException) e).getStatus() == HttpStatus.S_404_NOT_FOUND.getCode()) { throw new DatastreamNotFoundException(datastreamName, e); } else { throw new DatastreamException(String.format("Get Datastream {%s} failed with error %s", datastreamName, e.toString()), e); } } }

Target:
public Datastream getDatastream(String datastreamName) throws DatastreamException { GetRequest request = _builders.get().id(datastreamName).build(); ResponseFuture<Datastream> datastreamResponseFuture = _restClient.sendRequest(request); Response<Datastream> response; try { response = datastreamResponseFuture.getResponse(); return response.getEntity(); } catch (RemoteInvocationException e) { if(e instanceof RestLiResponseException && ((RestLiResponseException) e).getStatus() == HttpStatus.S_404_NOT_FOUND.getCode()) { throw new DatastreamNotFoundException(datastreamName, e); } else { throw new DatastreamException(String.format("Get Datastream {%s} failed with error.", datastreamName), e); } } }
Source:
private void executeTaskListener(TaskExecution taskExecution, Set<Method> methods, Map<Method, Object> instances){ for (Method method : methods) { try { method.invoke(instances.get(method),taskExecution); } catch (IllegalAccessException e) { throw new IllegalStateException("@BeforeTask and @AfterTask annotated methods must be public."); } catch (InvocationTargetException e) { throw new IllegalStateException("Failed to process @BeforeTask or @AfterTask" + "annotation because: ", e); } catch (IllegalArgumentException e){ throw new IllegalStateException("taskExecution parameter is required for @BeforeTask and @AfterTask annotated methods"); } } }

Target:
private void executeTaskListener(TaskExecution taskExecution, Set<Method> methods, Map<Method, Object> instances){ for (Method method : methods) { try { method.invoke(instances.get(method),taskExecution); } catch (IllegalAccessException e) { throw new TaskExecutionException("@BeforeTask and @AfterTask annotated methods must be public.", e); } catch (InvocationTargetException e) { throw new TaskExecutionException("Failed to process @BeforeTask or @AfterTask" + "annotation because: ", e); } catch (IllegalArgumentException e){ throw new TaskExecutionException("taskExecution parameter is required for @BeforeTask and @AfterTask annotated methods", e); } } }
Source:
public abstract String retrieveSubjectToken() throws IOException; public HttpTransportFactory getTransportFactory() { return transportFactory; }

Target:
public abstract String retrieveSubjectToken() throws IOException; public String getAudience() { return audience; }
Source:
public RangeBubble() { getModel().setValue(50); getModel().setEnd(80); JsonArray values = Json.createArray(); for (int i = 0; i < 100; i += 5) { values.set(values.length(), String.valueOf(i)); } rangeEnd.getElement().setPropertyJson("items", values); rangeEnd.getElement().setProperty("value", Integer.toString(getModel().getEnd())); value.getElement().setPropertyJson("items", values); value.getElement().setProperty("value", Integer.toString(getModel().getValue())); rangeEnd.getElement().addEventListener("value-changed", e -> { getModel().setEnd(Integer .parseInt(e.getEventData().getString("element.value"))); }, "element.value"); value.getElement().addEventListener("value-changed", e -> { getModel().setValue(Integer .parseInt(e.getEventData().getString("element.value"))); }, "element.value"); }

Target:
public RangeBubble() { getModel().setValue(50); getModel().setEnd(80); List<String> values = new ArrayList<>(); for (int i = 0; i < 100; i += 5) { values.add(String.valueOf(i)); } rangeEnd.setItems(values); value.setItems(values); rangeEnd.setValue(Integer.toString(getModel().getEnd())); value.setValue(Integer.toString(getModel().getValue())); rangeEnd.getElement().addEventListener("value-changed", e -> getModel().setEnd(Integer .parseInt(e.getEventData().getString(ELEMENT_VALUE))), ELEMENT_VALUE); value.getElement().addEventListener("value-changed", e -> getModel().setValue(Integer .parseInt(e.getEventData().getString(ELEMENT_VALUE))), ELEMENT_VALUE); }
Source:
private List<Person> makeWriters(Element cast) { List<Person> people = new ArrayList<>(); Elements writers = cast.getChildElements("actor"); for (int i = 0; i < writers.size(); i++) { Element writer = writers.get(i); people.add(makeWriter(writer)); } return people; }

Target:
private List<Person> makeWriters(Element cast) { List<Person> people = Lists.newArrayList(); Elements writers = cast.getChildElements(ACTOR); for (int i = 0; i < writers.size(); i++) { Element writer = writers.get(i); people.add(makeWriter(writer)); } return people; }
Source:
private ChangeControl control(ChangeData cd) throws OrmException { if (lastControl != null && cd.getId().equals(lastControl.getChange().getId())) { return lastControl; } ChangeControl ctrl; ProjectControl projectCtrl; try { projectCtrl = projectControls.get(cd.change().getProject()); if (projectCtrl != null) { ctrl = projectCtrl.controlFor(cd.change()); } else { ctrl = cd.changeControl(); } } catch (NoSuchChangeException | ExecutionException e) { throw new OrmException(e); } lastControl = ctrl; return ctrl; }

Target:
private ChangeControl control(ChangeData cd) throws OrmException { if (lastControl != null && cd.getId().equals(lastControl.getChange().getId())) { return lastControl; } ChangeControl ctrl; ProjectControl projectCtrl; try { projectCtrl = projectControls.get(cd.change().getProject()); if (projectCtrl != null) { ctrl = projectCtrl.controlFor(cd.change()); } else { ctrl = cd.changeControl().forUser(userProvider.get()); } } catch (NoSuchChangeException | ExecutionException e) { throw new OrmException(e); } lastControl = ctrl; return ctrl; }
Source:
public void saveToBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final ActorMapping actorMapping = businessArchive.getActorMapping(); if (actorMapping != null) { try { final byte[] fileContent = new ActorMappingConverter().serializeToXML(actorMapping); final File file = new File(barFolder, ACTOR_MAPPING_FILE); IOUtil.write(file, fileContent); } catch (JAXBException | org.xml.sax.SAXException e) { throw new IOException("Cannot write Actor Mapping to Bar folder", e); } } }

Target:
public void saveToBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final ActorMapping actorMapping = businessArchive.getActorMapping(); if (actorMapping != null) { try { final byte[] fileContent = new ActorMappingMarshaller().serializeToXML(actorMapping); final File file = new File(barFolder, ACTOR_MAPPING_FILE); IOUtil.write(file, fileContent); } catch (XmlMarshallException e) { throw new IOException("Cannot write Actor Mapping to Bar folder", e); } } }
Source:
public void testNullFileSystemOptions() { VertxOptions options = new VertxOptions().setFileSystemOptions(null); try { options.isFileResolverCachingEnabled(); options.setFileResolverCachingEnabled(true); } catch (NullPointerException e) { fail("Should handle null FileSystemOptions"); } }

Target:
public void testNullFileSystemOptions() { VertxOptions options = new VertxOptions().setFileSystemOptions(null); options.isFileResolverCachingEnabled(); options.setFileResolverCachingEnabled(true); }
Source:
public void setFont (Font font) { checkWidget(); if (((state & FONT) == 0) && font == null) return; this.font = font; long fontDesc; if (font == null) { fontDesc = defaultFont ().handle; } else { if (font.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); fontDesc = font.handle; } if (font == null) { state &= ~FONT; } else { state |= FONT; } if (OS.GTK_VERSION<OS.VERSION(3, 22, 0)){ setFontDescription (fontDesc); } else { long context = OS.gtk_widget_get_style_context (handle); OS.gtk_style_context_add_provider (context, provider, OS.GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); long family = OS.pango_font_description_get_family(fontDesc); String name; if (family == 0) { name = "*"; } else { int length = OS.strlen (family); byte buffer = new byte [length]; OS.memmove (buffer, family, length); name = new String (Converter.mbcsToWcs (null, buffer)); } String cssName = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle) : display.gtk_widget_get_name(handle); int height = OS.pango_font_description_get_size(fontDesc) / OS.PANGO_SCALE; String css = cssName + " { font: "+ name +" "+height+"; "+"}"; gtk_css_provider_load_from_css(context,css); } }

Target:
public void setFont (Font font) { checkWidget(); if (((state & FONT) == 0) && font == null) return; this.font = font; long fontDesc; if (font == null) { fontDesc = defaultFont ().handle; } else { if (font.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); fontDesc = font.handle; } if (font == null) { state &= ~FONT; } else { state |= FONT; } if (OS.GTK_VERSION < OS.VERSION(3, 22, 0)){ setFontDescription (fontDesc); } else { long context = OS.gtk_widget_get_style_context (handle); long family = OS.pango_font_description_get_family(fontDesc); String name; if (family == 0) { return; } else { int length = OS.strlen (family); byte buffer = new byte [length]; OS.memmove (buffer, family, length); name = new String (Converter.mbcsToWcs (null, buffer)); } String cssName = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle) : display.gtk_widget_get_name(handle); int height = OS.pango_font_description_get_size(fontDesc) / OS.PANGO_SCALE; String css = cssName + " {font: "+ name +" "+height+";}"; gtk_css_provider_load_from_css(context,css); } }
Source:
public void toggleSortOrder(int column) { LOGGER.debug("toggleSortOrder"+column); if(isSortable(column)) { SortKey sortRequest=new SortKey(column, SortOrder.ASCENDING); for(int i=0;i<sortedColumns.size();i++) { SortKey col = sortedColumns.get(i); if(col.getColumn()==column) { SortOrder order; if(col.getSortOrder().equals(SortOrder.ASCENDING)) { order = SortOrder.DESCENDING; } else { order = SortOrder.ASCENDING; } sortRequest = new SortKey(column, order); break; } } launchSortProcess(sortRequest); } }

Target:
public void toggleSortOrder(int column) { if(isSortable(column)) { SortKey sortRequest=new SortKey(column, SortOrder.ASCENDING); for(int i=0;i<sortedColumns.size();i++) { SortKey col = sortedColumns.get(i); if(col.getColumn()==column) { SortOrder order; if(col.getSortOrder().equals(SortOrder.ASCENDING)) { order = SortOrder.DESCENDING; } else { order = SortOrder.ASCENDING; } sortRequest = new SortKey(column, order); break; } } launchSortProcess(sortRequest); } }
Source:
public void connectToSNIProxyDocker() { Properties gemFireProps = new Properties(); gemFireProps.setProperty(SSL_ENABLED_COMPONENTS, "all"); gemFireProps.setProperty(SSL_KEYSTORE_TYPE, "jks"); gemFireProps.setProperty(SSL_REQUIRE_AUTHENTICATION, "false"); gemFireProps.setProperty(SSL_KEYSTORE, keyStorePath); gemFireProps.setProperty(SSL_KEYSTORE_PASSWORD, "geode"); gemFireProps.setProperty(SSL_TRUSTSTORE, trustStorePath); gemFireProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "geode"); ENDPOINT_IDENTIFICATION_ENABLED, "true"); ClientCache cache = new ClientCacheFactory(gemFireProps) .addPoolLocator( "localhost", 55221) .create(); Region<String, String> region = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create("jellyfish"); region.destroy("hello"); region.put("hello", "world"); assertThat(region.get("hello")).isEqualTo("world"); }

Target:
public void connectToSNIProxyDocker() { Properties gemFireProps = new Properties(); gemFireProps.setProperty(SSL_ENABLED_COMPONENTS, "all"); gemFireProps.setProperty(SSL_KEYSTORE_TYPE, "jks"); gemFireProps.setProperty(SSL_REQUIRE_AUTHENTICATION, "false"); gemFireProps.setProperty(SSL_KEYSTORE, keyStorePath); gemFireProps.setProperty(SSL_KEYSTORE_PASSWORD, "geode"); gemFireProps.setProperty(SSL_TRUSTSTORE, trustStorePath); gemFireProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "geode"); gemFireProps.setProperty(SSL_ENDPOINT_IDENTIFICATION_ENABLED, "true"); ClientCache cache = new ClientCacheFactory(gemFireProps) .addPoolLocator( "locator", 10334) .create(); Region<String, String> region = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.PROXY) .create("jellyfish"); region.destroy("hello"); region.put("hello", "world"); assertThat(region.get("hello")).isEqualTo("world"); }
Source:
@Test public void typeMustBeSupported() { JavaFileObject source = JavaFileObjects.forSourceString("test.Test", Joiner.on('\n').join( "package test;", "import android.app.Activity;", "import butterknife.BindArray;", "public class Test extends Activity {", " @BindArray(1) String one;", "}" )); ASSERT.about(javaSource()).that(source) .processedWith(new ButterKnifeProcessor()) .failsToCompile() .withErrorContaining( "@BindArray field type must be one of: 'String[], int[], CharSequence[], " + "android.content.res.TypedArray'. (test.Test.one)") .in(source).onLine(5); }

Target:
@Test public void typeMustBeSupported() { JavaFileObject source = JavaFileObjects.forSourceString("test.Test", Joiner.on('\n').join( "package test;", "import android.app.Activity;", "import butterknife.BindArray;", "public class Test extends Activity {", " @BindArray(1) String one;", "}" )); ASSERT.about(javaSource()).that(source) .processedWith(new ButterKnifeProcessor()) .failsToCompile() .withErrorContaining( "@BindArray field type must be one of: String[], int[], CharSequence[], " + "android.content.res.TypedArray. (test.Test.one)") .in(source).onLine(5); }
Source:
public TitleSearchGenerator( SearchResolver searchResolver, Class<? extends T> cls, Iterable<Publisher> publishers, Function<String,String> titleTransform, int searchLimit, Score exactMatchScore, Score partialMatchBound, boolean includeSelfPublisher, boolean useContentSpecialization, boolean changeComponentName ) { this.searchResolver = searchResolver; this.cls = cls; this.searchLimit = searchLimit; this.searchPublishers = ImmutableSet.copyOf(publishers); this.titleTransform = titleTransform; this.name = prependIfDeerInstance( changeComponentName ? "Title Search Generator" : "Title" ); this.titleScorer = new ContentTitleScorer<>( name, titleTransform, exactMatchScore, partialMatchBound ); this.titleExpander = new ExpandingTitleTransformer(); this.includeSelfPublisher = includeSelfPublisher; this.useContentSpecialization = useContentSpecialization; }

Target:
public TitleSearchGenerator( SearchResolver searchResolver, Class<? extends T> cls, Iterable<Publisher> publishers, Function<String,String> titleTransform, int searchLimit, Score exactMatchScore, Score partialMatchBound, boolean includeSelfPublisher, boolean useContentSpecialization, boolean changeComponentName ) { this.searchResolver = searchResolver; this.cls = cls; this.searchLimit = searchLimit; this.searchPublishers = ImmutableSet.copyOf(publishers); this.titleTransform = titleTransform; this.name = getName(changeComponentName); this.titleScorer = new ContentTitleScorer<>( name, titleTransform, exactMatchScore, partialMatchBound ); this.titleExpander = new ExpandingTitleTransformer(); this.includeSelfPublisher = includeSelfPublisher; this.useContentSpecialization = useContentSpecialization; }
Source:
public Object abort(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (exists(executionId) && !isCompleted(executionId)) { if (isAsync(executionId)) { Serializable commandId = getCommandId(executionId); return getAsyncService(executionId).abort(commandId); } return ResponseHelper.getResponse("RUNNING", request, Response.Status.OK.getStatusCode()); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " has completed"); }

Target:
public Object abort(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (exists(executionId) && !isCompleted(executionId)) { if (isAsync(executionId)) { Serializable taskId = getTaskId(executionId); return getAsyncService(executionId).abort(taskId); } return ResponseHelper.getResponse(RUNNING_STATUS, request, HttpServletResponse.SC_OK); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " has completed"); }
Source:
private void doInit(ExtMap inputMap, ExtMap outputMap) { context = inputMap.<ExtMap> get(Base.InvokeKeys.CONTEXT); configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); Utils.putDefaultsIfAbsent(configuration); broker = LdapFactory.getInstance(getAuthzName()); context.<List<String>> get( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ).add("config.authn.user.password"); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project").mput( Base.ContextKeys.EXTENSION_NAME, "Kerberos/Ldap Authn (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authn.ContextKeys.CAPABILITIES, Authn.Capabilities.AUTHENTICATE_PASSWORD ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT); try { Utils.handleApplicationInit(System.getProperty("application.name")); } catch (Exception e) { outputMap.mput( Base.InvokeKeys.MESSAGE, e.getMessage() ).mput( Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED ); } }

Target:
private void doInit(ExtMap inputMap, ExtMap outputMap) { context = inputMap.<ExtMap> get(Base.InvokeKeys.CONTEXT); configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); Utils.setDefaults(configuration); broker = LdapFactory.getInstance(getAuthzName()); context.<List<String>> get( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ).add("config.authn.user.password"); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project").mput( Base.ContextKeys.EXTENSION_NAME, "Kerberos/Ldap Authn (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authn.ContextKeys.CAPABILITIES, Authn.Capabilities.AUTHENTICATE_PASSWORD ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT); try { Utils.handleApplicationInit(context.<ExtMap>get(Base.ContextKeys.GLOBAL_CONTEXT).<String>get(Base.GlobalContextKeys.APPLICATION_NAME)); } catch (Exception e) { outputMap.mput( Base.InvokeKeys.MESSAGE, e.getMessage() ).mput( Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED ); } }
Source:
public void handleTransientDeployment(AuthenticatedContext authenticatedContext, List<CloudResource> resources) { Optional<String> deploymentNameOpt = resources.stream() .filter(cloudResource -> cloudResource.getType() == ResourceType.ARM_TEMPLATE) .map(CloudResource::getName) .findFirst(); Optional<String> resourceGroupNameOpt = resources.stream() .filter(cloudResource -> cloudResource.getType() == ResourceType.AZURE_RESOURCE_GROUP) .map(CloudResource::getName) .findFirst(); AzureClient client = authenticatedContext.getParameter(AzureClient.class); LOGGER.debug("Database template saved: {}, resource group saved: {}", deploymentNameOpt, resourceGroupNameOpt); if (deploymentNameOpt.isPresent() && resourceGroupNameOpt.isPresent()) { String resourceGroupName = resourceGroupNameOpt.get(); String deploymentName = deploymentNameOpt.get(); LOGGER.debug("Checking if database deployment {}.{} status is transient", resourceGroupName, deploymentName); ResourceStatus deploymentStatus = client.getTemplateDeploymentStatus(resourceGroupName, deploymentName); if (deploymentStatus.isTransient()) { LOGGER.info("Template deployment has transient status , cancelling it now.", deploymentName, deploymentStatus); Deployment deployment = client.getTemplateDeployment(resourceGroupName, deploymentName); deployment.cancel(); List<CloudResource> deployedResources = azureCloudResourceService.getDeploymentCloudResources(deployment); LOGGER.info("Found resources to be removed: {}", deployedResources); resources.addAll(deployedResources); } } }

Target:
public void handleTransientDeployment(AuthenticatedContext authenticatedContext, List<CloudResource> resources) { Optional<String> deploymentNameOpt = getFirstResourceName(resources, ARM_TEMPLATE); Optional<String> resourceGroupNameOpt = getFirstResourceName(resources, AZURE_RESOURCE_GROUP); LOGGER.debug("Database template saved: {}, resource group saved: {}", deploymentNameOpt, resourceGroupNameOpt); if (deploymentNameOpt.isPresent() && resourceGroupNameOpt.isPresent()) { AzureClient client = authenticatedContext.getParameter(AzureClient.class); String resourceGroupName = resourceGroupNameOpt.get(); String deploymentName = deploymentNameOpt.get(); LOGGER.debug("Checking if database deployment {}.{} status is transient", resourceGroupName, deploymentName); resources.addAll(azureTransientDeploymentService.handleTransientDeployment(client, resourceGroupName, deploymentName)); } }
Source:
public ApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection<Object> keys, CommandInvocationId commandInvocationId) { super(deltaAwareValueKey, -1, 0, commandInvocationId); }

Target:
public ApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection<Object> keys, CommandInvocationId commandInvocationId) { throw new UnsupportedOperationException(); }
Source:
public void emitData(final I input) { if (isWatermark.test(input)) { latestWatermarkTimestamp = parseTimestamp.apply(input); outputEmitter.emitWatermark(new MistWatermarkEvent(latestWatermarkTimestamp)); } else if (generateEvent(input) != null) { outputEmitter.emitData(generateEvent(input)); } }

Target:
public void emitData(final I input) { if (isWatermark.test(input)) { latestWatermarkTimestamp = parseTimestamp.apply(input); outputEmitter.emitWatermark(new MistWatermarkEvent(latestWatermarkTimestamp)); } else { MistDataEvent newInputEvent = generateEvent(input); if (newInputEvent != null) { outputEmitter.emitData(newInputEvent); } } }
Source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4); mFeatureTable = new ServiceFeatureTable(getString(R.string.feature_layer_url)); mFeatureLayer = new FeatureLayer(mFeatureTable); map.getOperationalLayers().add(mFeatureLayer); mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) { @Override public boolean onSingleTapConfirmed(MotionEvent event) { android.graphics.Point point = new android.graphics.Point((int) event.getX(), (int) event.getY()); Point mapPoint = mMapView.screenToLocation(point); Point normalizedMapPoint = (Point) GeometryEngine.normalizeCentralMeridian(mapPoint); ListenableFuture<IdentifyLayerResult> results = mMapView.identifyLayerAsync(mFeatureLayer, point, 1, false); results.addDoneListener(() -> { try { IdentifyLayerResult layer = results.get(); if (layer.getElements().size() > 0 && layer.getElements().get(0) instanceof Feature) { inflateCallout(mMapView, layer.getElements().get(0), normalizedMapPoint).show(); } } catch (InterruptedException | ExecutionException e) { logToUser(getString(R.string.error_getting_identify_result, e.getCause().getMessage())); } }); return super.onSingleTapConfirmed(event); } }); mMapView.setMap(map); }

Target:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.Type.STREETS, 40, -95, 4); mFeatureTable = new ServiceFeatureTable(getString(R.string.feature_layer_url)); mFeatureLayer = new FeatureLayer(mFeatureTable); map.getOperationalLayers().add(mFeatureLayer); mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) { @Override public boolean onSingleTapConfirmed(MotionEvent event) { android.graphics.Point screenPoint = new android.graphics.Point((int) event.getX(), (int) event.getY()); Point mapPoint = mMapView.screenToLocation(screenPoint); ListenableFuture<IdentifyLayerResult> identifyLayerFuture = mMapView .identifyLayerAsync(mFeatureLayer, screenPoint, 1, false); identifyLayerFuture.addDoneListener(() -> { try { IdentifyLayerResult layer = identifyLayerFuture.get(); if (!layer.getElements().isEmpty() && layer.getElements().get(0) instanceof Feature) { inflateCallout(mMapView, layer.getElements().get(0), mapPoint).show(); } } catch (InterruptedException | ExecutionException e) { logToUser(true, getString(R.string.error_getting_identify_result, e.getCause().getMessage())); } }); return super.onSingleTapConfirmed(event); } }); mMapView.setMap(map); }
Source:
public void setRefreshRate(int interval) { if (getRefreshRate() == interval) { return; } reset(); logger.fine("GridTimer[" + name + "]: Refresh Rate set to: " + interval); normalInterval = interval; ValueChangeEvent.fire(this, String.valueOf(getRefreshRate())); }

Target:
public void setRefreshRate(int interval) { if (getRefreshRate() == interval) { return; } reset(); logger.fine("GridTimer[" + name + "]: Refresh Rate set to: " + interval); normalInterval = interval; ValueChangeEvent.fire(this, getRefreshRate()); }
Source:
public BAMIndexMetaData getMetaData(int reference) { throw new RuntimeException("Getting of BAM index metadata for SRA is not implemented"); }

Target:
public BAMIndexMetaData getMetaData(int reference) { throw new UnsupportedOperationException("Getting of BAM index metadata for SRA is not implemented"); }