auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onDiagramLoad() { final Optional<CanvasHandler> canvasHandler = Optional.ofNullable(getCanvasHandler()); canvasHandler.ifPresent(c -> { final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); expressionEditor.setToolbarStateHandler(new DMNProjectToolbarStateHandler(getMenuSessionItems())); decisionNavigatorDock.setupCanvasHandler(c); dataTypesPage.reload(); includedModelsPage.setup(importsPageProvider.withDiagram(c.getDiagram())); }); }

Target:
public void onDiagramLoad() { final Optional<CanvasHandler> canvasHandler = Optional.ofNullable(getCanvasHandler()); canvasHandler.ifPresent(c -> { final ExpressionEditorView.Presenter expressionEditor = ((DMNSession) sessionManager.getCurrentSession()).getExpressionEditor(); expressionEditor.setToolbarStateHandler(new DMNProjectToolbarStateHandler(getMenuSessionItems())); decisionNavigatorDock.setupCanvasHandler(c); dataTypesPage.reload(); final Channel channel = contextProvider.getChannel(); if (Objects.equals(channel, DEFAULT) || Objects.equals(channel, VSCODE)) { includedModelsPage.setup(importsPageProvider.withDiagram(c.getDiagram())); } }); }
Source:
public void dispose() { cm.unregisterForCallStateChanged(this); cm.unregisterForOn(this); cm.unregisterForNotAvailable(this); this.removeCallbacksAndMessages(null); for(CdmaConnection c : connections) { if(c != null) { c.dispose(); c = null; } else { continue; } } this.phone = null; }

Target:
public void dispose() { cm.unregisterForCallStateChanged(this); cm.unregisterForOn(this); cm.unregisterForNotAvailable(this); for(CdmaConnection c : connections) { try { if(c != null) hangup(c); } catch (CallStateException ex) { Log.e(LOG_TAG, "unexpected error on hangup during dispose"); } } try { if(pendingMO != null) hangup(pendingMO); } catch (CallStateException ex) { Log.e(LOG_TAG, "unexpected error on hangup during dispose"); } clearDisconnected(); }
Source:
HiveConf provideHiveConf() { if (this.hiveConf != null) { return this.hiveConf; } else { this.hiveConf = new HiveConf(SessionState.class); } troublesomeConfig(HIVEHISTORYFILELOC, hiveConf); troublesomeConfig(SCRATCHDIR, hiveConf); if (System.getenv("HADOOP_TOKEN_FILE_LOCATION") != null) { System.out.println("Setting hadoop tokens ... "); hiveConf.set("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION")); System.setProperty("mapreduce.job.credentials.binary", System.getenv("HADOOP_TOKEN_FILE_LOCATION")); } return hiveConf; }

Target:
HiveConf provideHiveConf() { if (this.hiveConf != null) { return this.hiveConf; } else { this.hiveConf = new HiveConf(SessionState.class); } troublesomeConfig(HIVEHISTORYFILELOC, hiveConf); troublesomeConfig(SCRATCHDIR, hiveConf); if (System.getenv(HADOOP_TOKEN_FILE_LOCATION) != null) { System.out.println("Setting hadoop tokens ... "); hiveConf.set(MAPREDUCE_JOB_CREDENTIALS_BINARY, System.getenv(HADOOP_TOKEN_FILE_LOCATION)); System.setProperty(MAPREDUCE_JOB_CREDENTIALS_BINARY, System.getenv(HADOOP_TOKEN_FILE_LOCATION)); } return hiveConf; }
Source:
messagesAreSentToKafka() throws Exception { KafkaWriter writer = getTestKafkaWriter(); writer.setProducer(producer); writer.doWrite(dummyServer(), dummyQuery(), singleNumericResult()); verify(producer).send(messageCaptor.capture()); ProducerRecord<String, String> message = messageCaptor.getValue(); assertThat(message.topic()).isEqualTo("myTopic"); assertThat(message.value()) .contains("\"keyspace\":\"rootPrefix.host_example_net_4321.MemoryAlias.ObjectPendingFinalizationCount\"") .contains("\"value\":\"10\"") .contains("\"timestamp\":0") .contains("\"tags\":{\"myTagKey1\":\"myTagValue1\""); }

Target:
public void messagesAreSentToKafka() throws Exception { try(KafkaWriter writer = new KafkaWriter(ImmutableList.<String>of(), true, "rootPrefix", true, "myTopic", tags, settings, producer)) { writer.doWrite(dummyServer(), dummyQuery(), singleNumericResult()); verify(producer).send(messageCaptor.capture()); ProducerRecord<String, String> message = messageCaptor.getValue(); assertThat(message.topic()).isEqualTo("myTopic"); assertThat(message.value()) .contains("\"keyspace\":\"rootPrefix.host_example_net_4321.MemoryAlias.ObjectPendingFinalizationCount\"") .contains("\"value\":\"10\"") .contains("\"timestamp\":0") .contains("\"tags\":{\"myTagKey1\":\"myTagValue1\""); } }
Source:
public static JobModel readJobModel(String jobModelVersion, MetadataStore metadataStore) { try { StringBuilder jobModelUnificationBuffer = new StringBuilder(); for (int jobModelSegmentIndex = 0;; ++jobModelSegmentIndex) { String jobModelSegmentKey = getJobModelSegmentKey(jobModelVersion, jobModelSegmentIndex); byte[] jobModelSegment = metadataStore.get(jobModelSegmentKey); if (jobModelSegment == null) { break; } else { jobModelUnificationBuffer.append(new String(jobModelSegment, Charset.forName(UTF_8))); } } return MAPPER.readValue(jobModelUnificationBuffer.toString(), JobModel.class); } catch (Exception e) { throw new SamzaException(String.format("Exception occurred when reading JobModel version: %s from metadata store.", jobModelVersion), e); } }

Target:
public static JobModel readJobModel(String jobModelVersion, MetadataStore metadataStore) { try { byte[] jobModelAsBytes = metadataStore.get(getJobModelKey(jobModelVersion)); return MAPPER.readValue(new String(jobModelAsBytes, UTF_8), JobModel.class); } catch (Exception e) { throw new SamzaException(String.format("Exception occurred when reading JobModel version: %s from metadata store.", jobModelVersion), e); } }
Source:
public ActionInvocation serialize() { DefaultActionInvocation that = this; that.container = null; if(that.getInvocationContext() != null && that.getInvocationContext().getContextMap() != null) { Map<String, Object> thatContextMap = that.getInvocationContext().getContextMap(); thatContextMap.remove(ServletActionContext.HTTP_REQUEST); thatContextMap.remove(ServletActionContext.HTTP_RESPONSE); } return that; }

Target:
public ActionInvocation serialize() { DefaultActionInvocation that = this; that.container = null; if(that.getInvocationContext() != null && that.getInvocationContext().getContextMap() != null) { Map<String, Object> thatContextMap = that.getInvocationContext().getContextMap(); List<String> keysToRemove = new ArrayList<>(); for (Map.Entry<String, Object> entry : thatContextMap.entrySet()) { Object entryValue = entry.getValue(); if (entryValue instanceof ServletRequest || entryValue instanceof ServletResponse) { keysToRemove.add(entry.getKey()); } } for (String keyToRemove : keysToRemove) { thatContextMap.remove(keyToRemove); } } return that; }
Source:
public static ModelPlotConfig createRandomized() { return new ModelPlotConfig(randomBoolean(), randomAlphaOfLengthBetween(1, 30), randomBoolean()); }

Target:
public static ModelPlotConfig createRandomized() { return new ModelPlotConfig(randomBoolean(), randomAlphaOfLengthBetween(1, 30), randomBoolean() ? randomBoolean() : null); }
Source:
public void handshakeFailed(Handshaker handshaker, Throwable error) { SerialExecutor executor = serialExecutor; if (executor != null && !executor.isShutdown()) { try { executor.assertOwner(); } catch (ConcurrentModificationException ex) { LOGGER_OWNER.error("on handshake failed: connection {}", ex.getMessage(), ex); if (LOGGER_OWNER.isDebugEnabled()) { throw ex; } } } if (ongoingHandshake.compareAndSet(handshaker, null)) { startingClientHelloRandom = null; LOGGER.debug("Handshake with has failed", handshaker.getPeerAddress()); } }

Target:
public void handshakeFailed(Handshaker handshaker, Throwable error) { SerialExecutor executor = serialExecutor; if (executor != null && !executor.isShutdown() && LOGGER_OWNER.isErrorEnabled()) { try { executor.assertOwner(); } catch (ConcurrentModificationException ex) { LOGGER_OWNER.error("on handshake failed: connection {}", ex.getMessage(), ex); if (LOGGER_OWNER.isDebugEnabled()) { throw ex; } } } if (ongoingHandshake.compareAndSet(handshaker, null)) { startingClientHelloRandom = null; LOGGER.debug("Handshake with has failed", handshaker.getPeerAddress()); } }
Source:
public RefundEntity build() { ChargeEntity chargeEntity = charge == null ? buildChargeEntity() : charge; RefundEntity refundEntity = new RefundEntity(chargeEntity, amount, null); refundEntity.setStatus(status); refundEntity.setReference(reference); return refundEntity; }

Target:
public RefundEntity build() { ChargeEntity chargeEntity = charge == null ? buildChargeEntity() : charge; RefundEntity refundEntity = new RefundEntity(chargeEntity, amount, userExternalId); refundEntity.setStatus(status); refundEntity.setReference(reference); return refundEntity; }
Source:
public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } } catch (CoreException e) { MessageDialog.openWarning(provider.getShell(), "Resource Not Accessible", e.getMessage()); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.DeleteAction_ErrorDialogTitle, Messages.DeleteAction_ErrorDialogMsg); return; } if (containsOnlyTags(getStructuredSelection())) { run(new DeleteTagWizard(getSelectedTags()), provider.getShell()); } else { IResource[] resources = getSelectedResourcesArray(); if (containsQ7Elements(resources)) { run(new DeleteQ7ElementWizard(resources), provider.getShell()); } else { super.run(); } } }

Target:
public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } } catch (CoreException e) { Q7UIPlugin.log(e); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.DeleteAction_ErrorDialogTitle, Messages.DeleteAction_ErrorDialogMsg); return; } if (containsOnlyTags(getStructuredSelection())) { run(new DeleteTagWizard(getSelectedTags()), provider.getShell()); } else { IResource[] resources = getSelectedResourcesArray(); if (containsQ7Elements(resources)) { run(new DeleteQ7ElementWizard(resources), provider.getShell()); } else { super.run(); } } }
Source:
public void processLockAcquire() { log.debug("Process lock acquire event"); isLeader = true; fetchTopologyFromClusterManager(); updateTopologyConfigId(topologyDescriptor.getTopologyConfigId()); onLeadershipAcquire(); }

Target:
public void processLockAcquire() { log.debug("Process lock acquire event"); isLeader.set(true); onLeadershipAcquire(); }
Source:
public JavaClassSource decorateSource(UIExecutionContext context, Project project, JavaClassSource source) throws Exception { BeanScope scopedValue = scoped.getValue(); if (BeanScope.CUSTOM == scopedValue) { source.addAnnotation(customScopeAnnotation.getValue()); } else if (BeanScope.DEPENDENT != scopedValue) { source.addAnnotation(scopedValue.getAnnotation()); } if (withNamed.getValue()) { source.addAnnotation(Named.class); } if (alternative.getValue()) { source.addAnnotation(Alternative.class); } if (qualifier != null && qualifier.getValue() != null && !"".equals(qualifier.getValue())) { source.addAnnotation(qualifier.getValue()); } if (serializable.getValue()) { source.addInterface(Serializable.class); } return source; }

Target:
public JavaClassSource decorateSource(UIExecutionContext context, Project project, JavaClassSource source) throws Exception { BeanScope scopedValue = scoped.getValue(); if (BeanScope.CUSTOM == scopedValue) { source.addAnnotation(customScopeAnnotation.getValue()); } else if (BeanScope.DEPENDENT != scopedValue) { source.addAnnotation(scopedValue.getAnnotation()); if (scopedValue.isSerializable()) { source.addInterface(Serializable.class); source.addField().setPrivate().setStatic(true).setFinal(true).setName("serialVersionUID").setType("long") .setLiteralInitializer("1L"); } } if (withNamed.getValue()) { source.addAnnotation(Named.class); } if (alternative.getValue()) { source.addAnnotation(Alternative.class); } if (qualifier != null && qualifier.getValue() != null && !"".equals(qualifier.getValue())) { source.addAnnotation(qualifier.getValue()); } return source; }
Source:
private void publishIdleEvent(long idleTime) { if (this.eventPublisher != null) { FileTailingIdleEvent event = new FileTailingIdleEvent(this, this.file, idleTime); this.eventPublisher.publishEvent(event); } else { logger.info("No publisher for idle event:"); } }

Target:
private void publishIdleEvent(long idleTime) { if (this.eventPublisher != null) { if (getFile().exists()) { FileTailingIdleEvent event = new FileTailingIdleEvent(this, this.file, idleTime); this.eventPublisher.publishEvent(event); } } else { logger.info("No publisher for idle event"); } }
Source:
private boolean hasSameSchema(final INodeConnector connector) { return (!connector.getName().equals(currentConnector)) && connector.getBaseSchema().equals(currentConnector) && !(connector instanceof IAdditionalInfo); }

Target:
private boolean hasSameSchema(final INodeConnector connector) { return (!connector.getName().equals(currentConnector)) && connector.getBaseSchema().equals(currentConnector) && !isTacokit(connector); }
Source:
public String acquireLease(int leaseTimeInSec, String leaseId) throws StorageException { try { String id = leaseBlob.acquireLease(leaseTimeInSec, leaseId); LOG.info("Acquired lease with lease id = " + id); return id; } catch (StorageException storageException) { int httpStatusCode = storageException.getHttpStatusCode(); if (httpStatusCode == HttpStatus.CONFLICT_409) { LOG.info("The blob you're trying to acquire is leased already.", storageException); } else if (httpStatusCode == HttpStatus.NOT_FOUND_404) { LOG.error("The blob you're trying to lease does not exist.", storageException); throw new AzureException(storageException); } else { LOG.error("Error acquiring lease!", storageException); throw new AzureException(storageException); } } return null; }

Target:
public String acquireLease(int leaseTimeInSec, String leaseId) { try { String id = leaseBlob.acquireLease(leaseTimeInSec, leaseId); LOG.info("Acquired lease with lease id = " + id); return id; } catch (StorageException storageException) { int httpStatusCode = storageException.getHttpStatusCode(); if (httpStatusCode == HttpStatus.CONFLICT_409) { LOG.info("The blob you're trying to acquire is leased already.", storageException); } else if (httpStatusCode == HttpStatus.NOT_FOUND_404) { LOG.error("The blob you're trying to lease does not exist.", storageException); throw new AzureException(storageException); } else { LOG.error("Error acquiring lease!", storageException); throw new AzureException(storageException); } } return null; }
Source:
public Bootstrap addModules(final Iterable<? extends Module> additionalModules) { final ArrayList<Module> copyMutable = new ArrayList<>(); for (final Module module : additionalModules) { copyMutable.add(module); } final List<Module> copy = Collections.unmodifiableList(copyMutable); return overrideModules(new com.google.common.base.Function<List<Module>, Iterable<Module>>() { public Iterable<Module> apply(List<Module> modules) { return Iterables.concat(modules, copy); } }); }

Target:
public Bootstrap addModules(final Iterable<? extends Module> additionalModules) { final ArrayList<Module> copyMutable = new ArrayList<>(); for (final Module module : additionalModules) { copyMutable.add(module); } final List<Module> copy = Collections.unmodifiableList(copyMutable); return this.overrideModules(modules -> Iterables.concat(modules, copy)); }
Source:
private static SwapTrade parseVariableNotional(SwapTrade trade, List<CsvRow> variableRows) { ImmutableList.Builder<ValueStep> stepBuilder = ImmutableList.builder(); for (CsvRow row : variableRows) { LocalDate date = LoaderUtils.parseDate(row.getValue(START_DATE_FIELD)); row.findValue(NOTIONAL_FIELD) .map(str -> LoaderUtils.parseDouble(str)) .ifPresent(notional -> stepBuilder.add(ValueStep.of(date, ValueAdjustment.ofReplace(notional)))); } ImmutableList<ValueStep> vnotionals = stepBuilder.build(); if (vnotionals.isEmpty()) { return trade; } ImmutableList.Builder<SwapLeg> legBuilder = ImmutableList.builder(); for (SwapLeg swapLeg : trade.getProduct().getLegs()) { RateCalculationSwapLeg leg = (RateCalculationSwapLeg) swapLeg; NotionalSchedule notionalSchedule = leg.getNotionalSchedule().toBuilder() .amount(ValueSchedule.of(leg.getNotionalSchedule().getAmount().getInitialValue(), vnotionals)) .build(); legBuilder.add(leg.toBuilder().notionalSchedule(notionalSchedule).build()); } return replaceLegs(trade, legBuilder.build()); }

Target:
private static SwapTrade parseVariableNotional(SwapTrade trade, List<CsvRow> variableRows) { ImmutableList.Builder<ValueStep> stepBuilder = ImmutableList.builder(); for (CsvRow row : variableRows) { LocalDate date = LoaderUtils.parseDate(row.getValue(START_DATE_FIELD)); row.findValue(NOTIONAL_FIELD) .map(str -> LoaderUtils.parseDouble(str)) .ifPresent(notional -> stepBuilder.add(ValueStep.of(date, ValueAdjustment.ofReplace(notional)))); } ImmutableList<ValueStep> varNotionals = stepBuilder.build(); if (varNotionals.isEmpty()) { return trade; } ImmutableList.Builder<SwapLeg> legBuilder = ImmutableList.builder(); for (SwapLeg swapLeg : trade.getProduct().getLegs()) { RateCalculationSwapLeg leg = (RateCalculationSwapLeg) swapLeg; NotionalSchedule notionalSchedule = leg.getNotionalSchedule().toBuilder() .amount(ValueSchedule.of(leg.getNotionalSchedule().getAmount().getInitialValue(), varNotionals)) .build(); legBuilder.add(leg.toBuilder().notionalSchedule(notionalSchedule).build()); } return replaceLegs(trade, legBuilder.build()); }
Source:
public ThriftBytesWriteSupport(TProtocolFactory protocolFactory, Class<? extends TBase<?, ?>> thriftClass, boolean buffered, FieldIgnoredHandler errorHandler) { this(null, protocolFactory, thriftClass, buffered, errorHandler); }

Target:
public ThriftBytesWriteSupport(TProtocolFactory protocolFactory, Class<? extends TBase<?, ?>> thriftClass, boolean buffered, FieldIgnoredHandler errorHandler) { this(new Configuration(), protocolFactory, thriftClass, buffered, errorHandler); }
Source:
public void reschedule(Retry retry, int attempt, long waitStartMs) { long now = clock.getTicks(); while (true) { long cursor = inPubSequence.next(); if (cursor < -1) { LockSupport.parkNanos(1); continue; } if (cursor < 0) { throw EntryUnavailableException.INSTANCE; } try { RetryHolder retryHolder = inQueue.get(cursor); retryHolder.retry = retry; retryHolder.attempt = attempt; retryHolder.lastRunTimestamp = now; retryHolder.waitStartTimestamp = attempt == 0 ? now : waitStartMs; return; } finally { inPubSequence.done(cursor); } } }

Target:
private void reschedule(Retry retry, int attempt, long waitStartMs) { long now = clock.getTicks(); retry.getAttemptDetails().attempt = attempt; retry.getAttemptDetails().lastRunTimestamp = now; retry.getAttemptDetails().waitStartTimestamp = attempt == 0 ? now : waitStartMs; while (true) { long cursor = inPubSequence.next(); if (cursor < -1) { continue; } if (cursor < 0) { throw RetryFailedOperationException.INSTANCE; } RetryHolder retryHolder = inQueue.get(cursor); retryHolder.retry = retry; inPubSequence.done(cursor); return; } }
Source:
private void handleEntity(E entity) { if (!process.isActive()) { return; } Watch w = Watch.start(); try { processEntity(entity); } catch (Exception e) { process.handle(e); } finally { process.addTiming(descriptor.getPluralLabel(), w.elapsedMillis()); } }

Target:
private void handleEntity(E entity) { Watch w = Watch.start(); try { processEntity(entity); } catch (Exception e) { process.handle(e); } finally { process.addTiming(descriptor.getPluralLabel(), w.elapsedMillis()); } }
Source:
public static void clearCacheByPath(Instance instance, final String zooPath) { String thePath = zooPath.startsWith("/") ? zooPath : "/" + zooPath; getZooCache(instance).clear(ZooUtil.getRoot(instance) + thePath); instanceToMapCache.invalidateAll(); }

Target:
public static void clearCacheByPath(Instance instance, final String zooPath) { String thePath = zooPath.startsWith("/") ? zooPath : "/" + zooPath; getZooCache(instance).clear(ZooUtil.getRoot(instance) + thePath); instanceToMapCache.invalidate(instance.getInstanceID()); }
Source:
private ApiResponse callAccountApi(Api.HttpMethod method, List<String> uri, Map<String, Object> params, Map<String, Object> options) throws Exception { options = verifyOptions(options); if (!options.containsKey("provisioning_api_key")) { options.put("provisioning_api_key", key); options.put("provisioning_api_secret", secret); } return api.getStrategy().callAccountApi(method, uri, params, options); }

Target:
private ApiResponse callAccountApi(Api.HttpMethod method, List<String> uri, Map<String, Object> params, Map<String, Object> options) throws Exception { options = verifyOptions(options); if (options.containsKey("provisioning_api_key")){ if (!options.containsKey("provisioning_api_secret")){ throw new IllegalArgumentException("When providing key or secret through options, both must be provided"); } } else { if (options.containsKey("provisioning_api_secret")){ throw new IllegalArgumentException("When providing key or secret through options, both must be provided"); } options.put("provisioning_api_key", key); options.put("provisioning_api_secret", secret); } return api.getStrategy().callAccountApi(method, uri, params, options); }
Source:
private int insertBatch(Iterator<EncodedObject> objects, BulkOpListener listener) { final byte[] keybuff = new byte[ObjectId.NUM_BYTES]; Set<ObjectId> insertedIds = new HashSet<>(); try (RocksDBReference dbRef = dbhandle.getReference(); WriteOptions wo = new WriteOptions(); WriteBatch batch = new WriteBatch()) { wo.setSync(false); wo.setDisableWAL(true); while (objects.hasNext()) { EncodedObject object = objects.next(); final ObjectId id = object.id; id.getRawValue(keybuff); final byte[] value = object.serialform; batch.put(keybuff, value); insertedIds.add(id); } dbRef.db().write(wo, batch); insertedIds.forEach((id) -> listener.inserted(id, null)); } catch (RocksDBException e) { throw Throwables.propagate(e); } return insertedIds.size(); }

Target:
private int insertBatch(Iterator<EncodedObject> objects, BulkOpListener listener) { final byte[] keybuff = new byte[ObjectId.NUM_BYTES]; Set<ObjectId> insertedIds = new HashSet<>(); try (RocksDBReference dbRef = dbhandle.getReference(); WriteOptions wo = new WriteOptions(); WriteBatch batch = new WriteBatch()) { wo.setSync(true); while (objects.hasNext()) { EncodedObject object = objects.next(); final ObjectId id = object.id; id.getRawValue(keybuff); final byte[] value = object.serialform; batch.put(keybuff, value); insertedIds.add(id); } dbRef.db().write(wo, batch); insertedIds.forEach((id) -> listener.inserted(id, null)); } catch (RocksDBException e) { throw Throwables.propagate(e); } return insertedIds.size(); }
Source:
public void setNameAmount(String name, int newAmount) { if (nameAmounts.containsKey(name)) { int currentAmount = nameAmounts.get(name); if (currentAmount > newAmount) { int amountToDelete = currentAmount - newAmount; removeNames(name, amountToDelete); } else { int amountToAdd = newAmount - currentAmount; addNames(name, amountToAdd); } } }

Target:
public void setNameAmount(String name, int newAmount) { if (nameAmounts.containsKey(name)) { int currentAmount = nameAmounts.get(name); if (newAmount == 0) { nameAmounts.remove(name); names.remove(name); numInstances -= currentAmount; } else if (newAmount > currentAmount) { nameAmounts.put(name, newAmount); numInstances += newAmount - currentAmount; } else { nameAmounts.put(name, newAmount); numInstances -= currentAmount - newAmount; } } }
Source:
private void processRuleMetadata(Rule rule, WindupRuleProvider provider) { final Context ctx = (Context) rule; provider.enhanceMetadata(ctx); normalizeRuleMetadata(rule); assert ctx.get(RuleMetadata.CATEGORY) instanceof Set; Set<String> categories = (Set<String>) ctx.get(RuleMetadata.CATEGORY); categories.addAll(provider.getCategories()); }

Target:
private void processRuleMetadata(Rule rule, WindupRuleProvider provider) { final Context ctx = (Context) rule; provider.enhanceMetadata(ctx); normalizeRuleMetadata(rule); assert ctx.get(RuleMetadata.TAGS) instanceof Set; Set<String> categories = (Set<String>) ctx.get(RuleMetadata.TAGS); categories.addAll(provider.getCategories()); }
Source:
private TypeNode getTypeNode() { if (isPrimitiveType()) { return (TypeNode) getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetChild(0); } if (!isLambdaTypelessParameter() && getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetNumChildren() > 0) { return (TypeNode) getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetChild(0).jjtGetChild(0); } return null; }

Target:
private TypeNode getTypeNode() { if (isPrimitiveType()) { return (TypeNode) getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetChild(0); } if (!isTypeInferred() && getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetNumChildren() > 0) { return (TypeNode) getAccessNodeParent().getFirstChildOfType(ASTType.class).jjtGetChild(0).jjtGetChild(0); } return null; }
Source:
public void start() { super.start(); this.distExecutorService = new DefaultExecutorService(cache); }

Target:
public void start() { super.start(); this.distExecutorService = new DefaultExecutorService(cache, new WithinThreadExecutor()); }
Source:
LocalSymbolTableImports(SymbolTable defaultSystemSymtab, SymbolTable... imports) { assert defaultSystemSymtab.isSystemTable() : "defaultSystemSymtab isn't a system symtab"; if (imports != null && imports.length > 0) { final int offset; final SymbolTable systemTable; if (imports[0].isSystemTable()) { offset = 0; systemTable = imports[0]; } else { offset = 1; systemTable = defaultSystemSymtab; } myImports = new SymbolTable[imports.length + offset]; myImports[0] = systemTable; for(int i = 1 - offset; i < imports.length; i++) { SymbolTable symbolTable = imports[i]; if(symbolTable.isLocalTable()) { myImports[i + offset] = LocalSymbolTableImportAdapter.of((LocalSymbolTable) symbolTable); } else { myImports[i + offset] = symbolTable; } } } else { myImports = new SymbolTable[] { defaultSystemSymtab }; } myBaseSids = new int[myImports.length]; myMaxId = prepBaseSids(myBaseSids, myImports); }

Target:
LocalSymbolTableImports(SymbolTable defaultSystemSymtab, SymbolTable... imports) { assert defaultSystemSymtab.isSystemTable() : "defaultSystemSymtab isn't a system symtab"; if (imports != null && imports.length > 0) { final int offset; final SymbolTable systemTable; if (imports[0].isSystemTable()) { offset = 0; systemTable = imports[0]; } else { offset = 1; systemTable = defaultSystemSymtab; } myImports = new SymbolTable[imports.length + offset]; myImports[0] = systemTable; validateImports(Arrays.asList(imports)); for(int i = 1 - offset; i < imports.length; i++) { SymbolTable symbolTable = imports[i]; if(symbolTable instanceof LocalSymbolTable) { myImports[i + offset] = LocalSymbolTableImportAdapter.of((LocalSymbolTable) symbolTable); } else { myImports[i + offset] = symbolTable; } } } else { myImports = new SymbolTable[] { defaultSystemSymtab }; } myBaseSids = new int[myImports.length]; myMaxId = prepBaseSids(myBaseSids, myImports); }
Source:
public String toString() { return "COMP(" + leftChild + ", " + type + ", " + rightChild + ')'; }

Target:
public String toString() { return type + "(" + leftChild + ", " + rightChild + ')'; }
Source:
private void createSnapshot() { if (getWindow() != null) { return; } GlusterVolumeEntity volumeEntity = getEntity(); final GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(true, !volumeEntity.getSnapshotScheduled()); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); AsyncDataProvider.getInstance().getIsGlusterVolumeSnapshotCliScheduleEnabled(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { Boolean isCliScheduleEnabled = (Boolean) returnValue; snapshotModel.getDisableCliSchedule().setEntity(isCliScheduleEnabled); } }), volumeEntity.getClusterId()); UICommand okCommand = UICommand.createDefaultOkUiCommand("onCreateSnapshot", this); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("cancel", this); snapshotModel.getCommands().add(cancelCommand); }

Target:
private void createSnapshot() { if (getWindow() != null) { return; } GlusterVolumeEntity volumeEntity = getEntity(); final GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(true, !volumeEntity.getSnapshotScheduled()); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.startProgress(null); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); AsyncDataProvider.getInstance().getIsGlusterVolumeSnapshotCliScheduleEnabled(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { Boolean isCliScheduleEnabled = (Boolean) returnValue; snapshotModel.getDisableCliSchedule().setEntity(isCliScheduleEnabled); snapshotModel.stopProgress(); } }), volumeEntity.getClusterId()); UICommand okCommand = UICommand.createDefaultOkUiCommand("onCreateSnapshot", this); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("cancel", this); snapshotModel.getCommands().add(cancelCommand); }
Source:
public void onSuccessfulResponse(ReplicaId replicaId) { successfulRequests.add(replicaId); onReplicaResponse(replicaId); }

Target:
public void onSuccessfulResponse(ReplicaId replicaId) { super.onSuccessfulResponse(replicaId); if(isLocalDone) { coordinatorMetrics.crossColoProxyCallCount.inc(); } onReplicaResponse(replicaId); }
Source:
public void testPageLoad() { LayerAccessDataRulePanelInfo info = new LayerAccessDataRulePanelInfo(); ListModel<DataAccessRuleInfo> own = info.createOwnModel(layerModel, false); tester.startPage( new FormTestPage( new ComponentBuilder() { private static final long serialVersionUID = -5907648151984337786L; public Component buildComponent(final String id) { return new LayerAccessDataRulePanel(id, layerModel, own); } })); tester.assertComponent("form:panel", LayerAccessDataRulePanel.class); tester.assertComponent("form:panel:dataAccessPanel", AccessDataRulePanel.class); tester.assertComponent( "form:panel:dataAccessPanel:listContainer", WebMarkupContainer.class); tester.assertComponent( "form:panel:dataAccessPanel:listContainer:selectAll", CheckBox.class); tester.assertComponent("form:panel:dataAccessPanel:listContainer:rules", ListView.class); }

Target:
public void testPageLoad() throws IOException { LayerAccessDataRulePanelInfo info = new LayerAccessDataRulePanelInfo(); ListModel<DataAccessRuleInfo> own = info.createOwnModel(layerModel, false); tester.startPage( new FormTestPage( new ComponentBuilder() { private static final long serialVersionUID = -5907648151984337786L; public Component buildComponent(final String id) { return new LayerAccessDataRulePanel(id, layerModel, own); } })); tester.assertComponent("form:panel", LayerAccessDataRulePanel.class); tester.assertComponent("form:panel:dataAccessPanel", AccessDataRulePanel.class); tester.assertComponent( "form:panel:dataAccessPanel:listContainer", WebMarkupContainer.class); tester.assertComponent( "form:panel:dataAccessPanel:listContainer:selectAll", CheckBox.class); tester.assertComponent("form:panel:dataAccessPanel:listContainer:rules", ListView.class); }
Source:
public Map<Long, Set<TObject>> chronologize(String key, long record, long start, long end) { Map<Long, Set<TObject>> context = Maps.newTreeMap(); return chronologize(key, record, start, end, context); }

Target:
public Map<Long, Set<TObject>> chronologize(String key, long record, long start, long end) { Map<Long, Set<TObject>> context = Maps.newLinkedHashMap(); return chronologize(key, record, start, end, context); }
Source:
public void testSkipScan() throws Exception { String baseTableName = dataTableName; PreparedStatement upsertStmt = dataTableUpsertStmt; if (!Strings.isNullOrEmpty(viewDdl)) { baseTableName = viewName; upsertStmt = viewUpsertStmt; } for (int i=0; i < 2; i++) { if (dataTableDdl.contains("MULTI_TENANT")) { upsertRowMultiTenant(upsertStmt, "val"+i, i,"name-" + i, 19999); } else { upsertRow(upsertStmt, i, "name-" + i, 19999); } conn.commit(); } IndexScrutinyToolIT.runScrutiny(schemaName, baseTableName, indexTableName, null, SourceTable.INDEX_TABLE_SOURCE); PreparedStatement targetStmt = IndexScrutinyTool.getTargetTableQueryForScrutinyTool(); assertSkipScanFilter(targetStmt); IndexScrutinyToolIT.runScrutiny(schemaName, baseTableName, indexTableName, null, SourceTable.DATA_TABLE_SOURCE); targetStmt = IndexScrutinyTool.getTargetTableQueryForScrutinyTool(); assertSkipScanFilter(targetStmt); }

Target:
public void testSkipScan() throws Exception { String baseTableName = dataTableName; PreparedStatement upsertStmt = dataTableUpsertStmt; if (!Strings.isNullOrEmpty(viewDdl)) { baseTableName = viewName; upsertStmt = viewUpsertStmt; } for (int i=0; i < 2; i++) { if (dataTableDdl.contains("MULTI_TENANT")) { upsertRowMultiTenant(upsertStmt, "val"+i, i,"name-" + i, 19999); } else { upsertRow(upsertStmt, i, "name-" + i, 19999); } conn.commit(); } List<Job> completedJobs = IndexScrutinyToolIT.runScrutiny(schemaName, baseTableName, indexTableName, null, SourceTable.DATA_TABLE_SOURCE); PreparedStatement targetStmt = IndexScrutinyTool.getTargetTableQueryForScrutinyTool(); assertSkipScanFilter(targetStmt); Job job = completedJobs.get(0); Counters counters = job.getCounters(); assertEquals(2, getCounterValue(counters, VALID_ROW_COUNT)); assertEquals(0, getCounterValue(counters, INVALID_ROW_COUNT)); completedJobs = IndexScrutinyToolIT.runScrutiny(schemaName, baseTableName, indexTableName, null, SourceTable.INDEX_TABLE_SOURCE); targetStmt = IndexScrutinyTool.getTargetTableQueryForScrutinyTool(); assertSkipScanFilter(targetStmt); job = completedJobs.get(0); counters = job.getCounters(); assertEquals(2, getCounterValue(counters, VALID_ROW_COUNT)); assertEquals(0, getCounterValue(counters, INVALID_ROW_COUNT)); }
Source:
private void prepareUnitCardData() { try { ChunkPlugin chunkPlugin = mProject.getChunkPlugin(new ChunkPluginLoader(this)); List<Chunk> chunks = chunkPlugin.getChapter(mChapterNum).getChunks(); for (Chunk unit : chunks) { String title = Utils.capitalizeFirstLetter(mProject.getModeName()) + " " + unit.getLabel(); mUnitCardList.add(new UnitCard(mAdapter, mProject, title, mChapterNum, unit.getStartVerse(), unit.getEndVerse(), this)); } } catch (IOException e) { e.printStackTrace(); } }

Target:
private void prepareUnitCardData() { if(chunkPlugin != null) { List<Chunk> chunks = chunkPlugin.getChapter(mChapterNum).getChunks(); for (Chunk unit : chunks) { String title = Utils.capitalizeFirstLetter(mProject.getModeName()) + " " + unit.getLabel(); mUnitCardList.add( new UnitCard( mAdapter, mProject, title, mChapterNum, unit.getStartVerse(), unit.getEndVerse(), this ) ); } } }
Source:
private List<MetricFamilySamples> getQueryExecutionMetrics() { return Arrays.asList( createCounter( "hibernate_query_execution_total", "Get global number of executed queries", statistics.getQueryExecutionCount() ), createGauge( "hibernate_query_execution_seconds_max", "Get the time in milliseconds of the slowest query.", statistics.getQueryExecutionMaxTime() / 1000.0 ), createCounter( "hibernate_natural_id_query_execution_total", "Get the global number of naturalId queries executed against the database", statistics.getNaturalIdQueryExecutionCount() ), createGauge( "hibernate_natural_id_query_execution_seconds_max", "Get the global maximum query time for naturalId queries executed against the database", statistics.getNaturalIdQueryExecutionMaxTime() / 1000.0 ) ); }

Target:
private List<MetricFamilySamples> getQueryExecutionMetrics() { return Arrays.<MetricFamilySamples>asList( createCounter( "hibernate_query_execution_total", "Global number of executed queries (getQueryExecutionCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getQueryExecutionCount(); } } ), createCounter( "hibernate_natural_id_query_execution_total", "The global number of naturalId queries executed against the database (getNaturalIdQueryExecutionCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getNaturalIdQueryExecutionCount(); } } ) ); }
Source:
private static String mapToDecimalOrBinary(Schema schema, SqoopOptions options) { boolean logicalTypesEnabled = options.getConf().getBoolean(ConfigurationConstants.PROP_ENABLE_PARQUET_LOGICAL_TYPE_DECIMAL, false); if (logicalTypesEnabled && schema.getLogicalType() != null && schema.getLogicalType() instanceof Decimal) { Decimal decimal = (Decimal) schema.getLogicalType(); int precision = Math.min(HiveDecimal.MAX_PRECISION, decimal.getPrecision()); if (precision < decimal.getPrecision()) { LOG.warn("Warning! Precision in the Hive table definition will be smaller than the actual precision of the column on storage! Hive may not be able to read data from this column."); } int scale = Math.min(HiveDecimal.MAX_SCALE, decimal.getScale()); if (scale < decimal.getScale()) { LOG.warn("Warning! Scale in the Hive table definition will be smaller than the actual scale of the column on storage! Hive may not be able to read data from this column."); } return String.format("%s (%d, %d)", HIVE_TYPE_DECIMAL, precision, scale); } else { return HIVE_TYPE_BINARY; } }

Target:
private static String mapToDecimalOrBinary(Schema schema, SqoopOptions options) { boolean logicalTypesEnabled = options.getConf().getBoolean(ConfigurationConstants.PROP_ENABLE_PARQUET_LOGICAL_TYPE_DECIMAL, false); if (logicalTypesEnabled && schema.getLogicalType() instanceof Decimal) { Decimal decimal = (Decimal) schema.getLogicalType(); int precision = Math.min(HiveDecimal.MAX_PRECISION, decimal.getPrecision()); if (precision < decimal.getPrecision()) { LOG.warn("Warning! Precision in the Hive table definition will be smaller than the actual precision of the column on storage! Hive may not be able to read data from this column."); } int scale = Math.min(HiveDecimal.MAX_SCALE, decimal.getScale()); if (scale < decimal.getScale()) { LOG.warn("Warning! Scale in the Hive table definition will be smaller than the actual scale of the column on storage! Hive may not be able to read data from this column."); } return String.format("%s (%d, %d)", HIVE_TYPE_DECIMAL, precision, scale); } else { return HIVE_TYPE_BINARY; } }
Source:
private AmazonEC2 reconnectToEc2() throws IOException { synchronized(this) { if (AmazonEC2Cloud.isTestMode()) { connection = mockConnect(createCredentialsProvider(), getEc2EndpointUrl(), privateKey); } else { connection = connect(createCredentialsProvider(), getEc2EndpointUrl()); } return connection; } }

Target:
private AmazonEC2 reconnectToEc2() throws IOException { synchronized(this) { connection = AmazonEC2Factory.getInstance().connect(createCredentialsProvider(), getEc2EndpointUrl()); return connection; } }
Source:
public static String loadResourceToString( final String path ) { String resource = null; try ( final InputStream stream = Thread.currentThread().getContextClassLoader() .getResourceAsStream( path ) ) { resource = IOUtils.toString( stream ); } catch ( final IOException | NullPointerException e ) { logger.error( "Failed to load resource from " + path, e ); return null; } return resource; }

Target:
public static String loadResourceToString( final String path ) { URL resource = Resources.getResource( path ); try { return Resources.toString( resource, StandardCharsets.UTF_8 ); } catch ( final IOException e ) { logger.error( "Failed to load resource from " + path, e ); return null; } }
Source:
public void onCreate() { registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_USER_PRESENT)); registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_USER_REMOVED)); mStorageManager = StorageManager.from(this); synchronized (mBinder) { updateDisabledStateLocked(); mStorageManager.registerListener(mStorageEventListener); StorageVolume[] volumes = mStorageManager.getVolumeList(); mVolumes = volumes; for (int i = 0; i < volumes.length; i++) { String path = volumes[i].getPath(); String state = mStorageManager.getVolumeState(path); if (Environment.MEDIA_MOUNTED.equals(state)) { volumeMountedLocked(path); } } } if (mThreadLooper == null || mThread == null) { mThread = new HandlerThread("MtpStorageInfo", Process.THREAD_PRIORITY_BACKGROUND); mThread.start(); mThreadLooper = mThread.getLooper(); if (mThreadLooper != null) { mHandler = new MtpStorageInfoHandler(mThreadLooper); } } }

Target:
public void onCreate() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_USER_PRESENT); intentFilter.addAction(Intent.ACTION_USER_REMOVED); registerReceiver(mReceiver, intentFilter); mStorageManager = StorageManager.from(this); synchronized (mBinder) { updateDisabledStateLocked(); mStorageManager.registerListener(mStorageEventListener); StorageVolume[] volumes = mStorageManager.getVolumeList(); mVolumes = volumes; for (int i = 0; i < volumes.length; i++) { String path = volumes[i].getPath(); String state = mStorageManager.getVolumeState(path); if (Environment.MEDIA_MOUNTED.equals(state)) { volumeMountedLocked(path); } } } mThread = new HandlerThread("MtpStorageInfo", Process.THREAD_PRIORITY_BACKGROUND); mThread.start(); mHandler = new MtpStorageInfoHandler(mThread.getLooper()); }
Source:
private static Talk talk(final Issue issue, final String tag, final File dir) throws IOException { final Talk talk = new Talk.InFile(); final String identifier = "id"; talk.modify( new Directives().xpath("/talk") .attr("later", Boolean.TRUE.toString()) .add("daemon").attr(identifier, "123") .add("title").set("merge").up() .add("script").set("empty").up() .add("code").set("-7").up() .add("dir").set(dir.getAbsolutePath()).up().up() .add("wire") .add("href").set("http://test2").up() .add("github-repo").set(issue.repo().coordinates().toString()) .up() .add("github-issue").set(Integer.toString(issue.number())).up() .up() .add("request").attr(identifier, "abcdef") .add("type").set("release").up() .add("success").set(Boolean.TRUE.toString()).up() .add("args").add("arg").attr("name", "tag").set(tag) ); return talk; }

Target:
private static Talk talk(final Issue issue, final String tag, final File dir) throws IOException { final Talk talk = new Talk.InFile(); final String identifier = "id"; talk.modify( new Directives().xpath("/talk") .add("daemon").attr(identifier, "123") .add("title").set("merge").up() .add("script").set("empty").up() .add("dir").set(dir.getAbsolutePath()).up().up() .add("wire") .add("href").set("http://test2").up() .add("github-repo").set(issue.repo().coordinates().toString()) .up() .add("github-issue").set(Integer.toString(issue.number())).up() .up() .add("request").attr(identifier, "abcdef") .add("type").set("release").up() .add("success").set(Boolean.TRUE.toString()).up() .add("args").add("arg").attr("name", "tag").set(tag) ); return talk; }
Source:
public List<InstanceConfig> getInstanceConfigs() { if(_instanceConfigs.isEmpty()){ _instanceConfigs = HelixHelper.getInstanceConfigs(_helixManager); } return _instanceConfigs; }

Target:
public synchronized List<InstanceConfig> getInstanceConfigs() { if (_instanceConfigs.isEmpty() || !_listenerInitiated) { return HelixHelper.getInstanceConfigs(_helixManager); } return _instanceConfigs; }
Source:
public void switchToUser(UserAccount user, int userSwitchType, Bundle extras) { if (user == null || !doesUserAccountExist(user)) { switchToNewUser(); return; } final UserAccount curUser = getCurrentUser(); if (user.equals(curUser)) { return; } clearCachedCurrentUser(curUser); final ClientManager cm = new ClientManager(context, accountType, SalesforceSDKManager.getInstance().getLoginOptions(), true); final Account account = cm.getAccountByName(user.getAccountName()); storeCurrentUserInfo(user.getUserId(), user.getOrgId()); cm.peekRestClient(account); sendUserSwitchIntent(userSwitchType, extras); }

Target:
public void switchToUser(UserAccount user, int userSwitchType, Bundle extras) { if (user == null || !doesUserAccountExist(user)) { switchToNewUser(); return; } final UserAccount curUser = getCurrentUser(); if (user.equals(curUser)) { return; } final ClientManager cm = new ClientManager(context, accountType, SalesforceSDKManager.getInstance().getLoginOptions(), true); final Account account = cm.getAccountByName(user.getAccountName()); storeCurrentUserInfo(user.getUserId(), user.getOrgId()); cm.peekRestClient(account); sendUserSwitchIntent(userSwitchType, extras); }
Source:
public String readMessage(Topic topic, int partition, long offset) { byte[] bytes = readMessage(topic.getQualifiedName(), partition, offset); if (topic.getContentType() == Topic.ContentType.AVRO) { bytes = convertAvroToJson(topic.getMessageSchema(), bytes); } return new String(bytes, Charset.forName("UTF-8")); }

Target:
public String readMessage(Topic topic, int partition, long offset) { byte[] bytes = kafkaRawMessageReader.readMessage(topic.getQualifiedName(), partition, offset); if (topic.getContentType() == Topic.ContentType.AVRO) { bytes = convertAvroToJson(topic.getMessageSchema(), bytes); } return new String(bytes, Charset.forName("UTF-8")); }
Source:
public void getPoints( final GeoCluster geoCluster, final AsyncCallback<BackendlessCollection<GeoPoint>> responder ) { try { CollectionAdaptingPolicy<GeoPoint> adaptingPolicy = new CollectionAdaptingPolicy<GeoPoint>(); Invoker.invokeAsync( GEO_MANAGER_SERVER_ALIAS, "loadGeoPoints", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), geoCluster.getObjectId(), geoCluster.getGeoQuery() }, new AsyncCallback<BackendlessCollection<GeoPoint>>() { @Override public void handleResponse( BackendlessCollection<GeoPoint> response ) { response.setQuery( geoCluster.getGeoQuery() ); response.setType( GeoPoint.class ); if( responder != null ) responder.handleResponse( response ); } @Override public void handleFault( BackendlessFault fault ) { responder.handleFault( fault ); } }, new AdaptingResponder<GeoPoint>( GeoPoint.class, adaptingPolicy ) ); } catch( Throwable e ) { if( responder != null ) responder.handleFault( new BackendlessFault( e ) ); } }

Target:
public void getPoints( final GeoCluster geoCluster, final AsyncCallback<BackendlessCollection<GeoPoint>> responder ) { try { CollectionAdaptingPolicy<GeoPoint> adaptingPolicy = new CollectionAdaptingPolicy<GeoPoint>(); Invoker.invokeAsync( GEO_MANAGER_SERVER_ALIAS, "loadGeoPoints", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), geoCluster.getObjectId(), geoCluster.getGeoQuery() }, new AsyncCallback<BackendlessCollection<GeoPoint>>() { @Override public void handleResponse( BackendlessCollection<GeoPoint> response ) { response.setQuery( geoCluster.getGeoQuery() ); response.setType( GeoPoint.class ); if( responder != null ) responder.handleResponse( response ); } @Override public void handleFault( BackendlessFault fault ) { if( responder != null ) responder.handleFault( fault ); } }, new AdaptingResponder<GeoPoint>( GeoPoint.class, adaptingPolicy ) ); } catch( Throwable e ) { if( responder != null ) responder.handleFault( new BackendlessFault( e ) ); } }