auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void showWorkflows(String projName) throws Exception { DigdagClient client = buildClient(); CollectionPrinter<RestWorkflowDefinition> formatter = new CollectionPrinter<>(); formatter.column("PROJECT", wf -> wf.getProject().getName()); formatter.column("PROJECT ID", wf -> Integer.toString(wf.getProject().getId())); formatter.column("WORKFLOW", wf -> wf.getName()); formatter.column("REVISION", wf -> wf.getRevision()); List<RestWorkflowDefinition> defs; if (projName != null) { RestProject proj = client.getProject(projName); defs = client.getWorkflowDefinitions(proj.getId()); } else { defs = new ArrayList<>(); for (RestProject proj : client.getProjects()) { try { defs.addAll(client.getWorkflowDefinitions(proj.getId())); } catch (NotFoundException ex) { continue; } } } formatter.print(format, defs, out); out.println(); out.flush(); err.println("Use `digdag workflows <project-name> <name>` to show details."); }

Target:
private void showWorkflows(String projName) throws Exception { DigdagClient client = buildClient(); EntityCollectionPrinter<RestWorkflowDefinition> formatter = new EntityCollectionPrinter<>(); formatter.field("PROJECT", wf -> wf.getProject().getName()); formatter.field("PROJECT ID", wf -> Integer.toString(wf.getProject().getId())); formatter.field("WORKFLOW", RestWorkflowDefinition::getName); formatter.field("REVISION", RestWorkflowDefinition::getRevision); List<RestWorkflowDefinition> defs; if (projName != null) { RestProject proj = client.getProject(projName); defs = client.getWorkflowDefinitions(proj.getId()); } else { defs = new ArrayList<>(); for (RestProject proj : client.getProjects()) { try { defs.addAll(client.getWorkflowDefinitions(proj.getId())); } catch (NotFoundException ex) { continue; } } } formatter.print(format, defs, out); out.println(); out.flush(); err.println("Use `digdag workflows <project-name> <name>` to show details."); }
Source:
public IteratorOptions describeOptions() { IteratorOptions io = new IteratorOptions("comb", "Combiners apply reduce functions to multiple versions of values with otherwise equal keys", null, null); io.addNamedOption(ALL_OPTION, "set to true to apply Combiner to every column, otherwise leave blank. if true, " + COLUMNS_OPTION + " option will be ignored."); io.addNamedOption(COLUMNS_OPTION, "<col fam>[:<col qual>]{,<col fam>[:<col qual>]} escape non-alphanum chars using %<hex>."); return io; }

Target:
public IteratorOptions describeOptions() { IteratorOptions io = new IteratorOptions("comb", "Combiners apply reduce functions to multiple versions of values with otherwise equal keys", null, null); io.addNamedOption(ALL_OPTION, "set to true to apply Combiner to every column, otherwise leave blank. if true, " + COLUMNS_OPTION + " option will be ignored."); io.addNamedOption(COLUMNS_OPTION, "<col fam>[:<col qual>]{,<col fam>[:<col qual>]} escape non-alphanum chars using %<hex>."); io.addNamedOption(REDUCE_ON_FULL_COMPACTION_ONLY_OPTION, "If true, only reduce on full major compactions. Defaults to false. "); return io; }
Source:
public int getChannel() { return hasPartState() ? part.getChannel(getPartState()) : 0; }

Target:
public int getChannel() { return hasPartState() ? part.getChannel(getPartState()) : IChanneledNetwork.DEFAULT_CHANNEL; }
Source:
private void checkEndOfRowGroup() throws IOException { if (rowsReturned != totalCountLoadedSoFar) return; PageReadStore pages = reader.readNextRowGroup(); if (pages == null) { throw new IOException("expecting more rows but reached last block. Read " + rowsReturned + " out of " + totalRowCount); } List<ColumnDescriptor> columns = requestedSchema.getColumns(); List<Type> types = requestedSchema.getFields(); columnReaders = new VectorizedColumnReader[columns.size()]; for (int i = 0; i < columns.size(); ++i) { columnReaders[i] = new VectorizedColumnReader(columns.get(i), pages.getPageReader(columns.get(i)), skipTimestampConversion, types.get(i)); } totalCountLoadedSoFar += pages.getRowCount(); }

Target:
private void checkEndOfRowGroup() throws IOException { if (rowsReturned != totalCountLoadedSoFar) { return; } PageReadStore pages = reader.readNextRowGroup(); if (pages == null) { throw new IOException("expecting more rows but reached last block. Read " + rowsReturned + " out of " + totalRowCount); } List<ColumnDescriptor> columns = requestedSchema.getColumns(); List<Type> types = requestedSchema.getFields(); columnReaders = new VectorizedColumnReader[columns.size()]; for (int i = 0; i < columns.size(); ++i) { columnReaders[i] = new VectorizedColumnReader(columns.get(i), pages.getPageReader(columns.get(i)), skipTimestampConversion, types.get(i)); } totalCountLoadedSoFar += pages.getRowCount(); }
Source:
private void addDataNodeToStateMetrics(final DataNode dataNode) { final String metricName = dataNode.toString()+ "-State"; Gauge<Long> dataNodeState = new Gauge<Long>() { @Override public Long getValue() { return dataNode.getState() == HardwareState.AVAILABLE ? 1L : 0L; } }; registry.register(MetricRegistry.name(ClusterMap.class, metricName), dataNodeState); dataNodeStateList.add(dataNodeState); }

Target:
private void addDataNodeToStateMetrics(final DataNode dataNode) { final String metricName = dataNode + "-ResourceState"; Gauge<Long> dataNodeState = new Gauge<Long>() { @Override public Long getValue() { return dataNode.getState() == HardwareState.AVAILABLE ? 1L : 0L; } }; registry.register(MetricRegistry.name(ClusterMap.class, metricName), dataNodeState); dataNodeStateList.add(dataNodeState); }
Source:
public void write(DataOutput out) throws IOException { ArrayList<String> fields = new ArrayList<>(); if (maxMemory != null) addField(fields, MAX_MEM.getKey(), maxMemory); if (maxLatency != null) addField(fields, MAX_LATENCY.getKey(), maxLatency); if (maxWriteThreads != null) addField(fields, MAX_WRITE_THREADS.getKey(), maxWriteThreads); if (timeout != null) addField(fields, MAX_TIMEOUT.getKey(), timeout); if (durability != Durability.DEFAULT) addField(fields, DURABILITY.getKey(), durability); String output = StringUtils.join(",", fields); byte[] bytes = output.getBytes(UTF_8); byte[] len = String.format("%6s#", Integer.toString(bytes.length, 36)).getBytes(UTF_8); if (len.length != 7) throw new IllegalStateException("encoded length does not match expected value"); out.write(len); out.write(bytes); }

Target:
public void write(DataOutput out) throws IOException { ArrayList<String> fields = new ArrayList<>(); if (maxMemory != null) addField(fields, "maxMemory", maxMemory); if (maxLatency != null) addField(fields, "maxLatency", maxLatency); if (maxWriteThreads != null) addField(fields, "maxWriteThreads", maxWriteThreads); if (timeout != null) addField(fields, "timeout", timeout); if (durability != Durability.DEFAULT) addField(fields, "durability", durability); String output = StringUtils.join(",", fields); byte[] bytes = output.getBytes(UTF_8); byte[] len = String.format("%6s#", Integer.toString(bytes.length, 36)).getBytes(UTF_8); if (len.length != 7) throw new IllegalStateException("encoded length does not match expected value"); out.write(len); out.write(bytes); }
Source:
public static void checkForRisingAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean rising_alert = prefs.getBoolean("rising_alert", false); if(!rising_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: Notifications are currently disabled!!"); return; } if(prefs.getLong("high_alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: High alerts are currently disabled!!"); return; } if(IsUnclearTime(context)) { Log.d(TAG_ALERT, "checkForRisingAllert we are in an clear time, returning without doing anything"); return ; } String riseRate = prefs.getString("rising_bg_val", "2"); float friseRate = 2; try { friseRate = Float.parseFloat(riseRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "checkForRisingAllert reading falling_bg_val failed, continuing with 2", nfe); } Log.d(TAG_ALERT, "checkForRisingAllert will check for rate of " + friseRate); boolean riseAlert = checkForDropRiseAllert(friseRate, false); Notifications.RisingAlert(context, riseAlert); }

Target:
public static void checkForRisingAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean rising_alert = prefs.getBoolean("rising_alert", false); if(!rising_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: Notifications are currently disabled!!"); return; } if(IsUnclearTime(context)) { Log.d(TAG_ALERT, "checkForRisingAllert we are in an clear time, returning without doing anything"); return ; } String riseRate = prefs.getString("rising_bg_val", "2"); float friseRate = 2; try { friseRate = Float.parseFloat(riseRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "checkForRisingAllert reading falling_bg_val failed, continuing with 2", nfe); } Log.d(TAG_ALERT, "checkForRisingAllert will check for rate of " + friseRate); boolean riseAlert = checkForDropRiseAllert(friseRate, false); Notifications.RisingAlert(context, riseAlert); }
Source:
public long getTimeBucket(long time) { if (time < start) { return -1; } long diffFromStart = time - fixedStart; long key = diffFromStart / bucketSpanMillis; if (time >= end) { long diffInBuckets = (time - end) / bucketSpanMillis; long move = (diffInBuckets + 1) * bucketSpanMillis; start += move; end += move; if (((time - oldend) / bucketSpanMillis) >= 0) { triggerPurge = true; oldend = end; lowestPurgeableTimeBucket = ((start - fixedStart) / bucketSpanMillis) - 2; } } return key; }

Target:
public long getTimeBucket(long time) { if (time < start) { return -1; } long diffFromStart = time - fixedStart; long key = diffFromStart / bucketSpanMillis; if (time >= end) { long diffInBuckets = (time - end) / bucketSpanMillis; long move = (diffInBuckets + 1) * bucketSpanMillis; start += move; end += move; triggerPurge = (move > 0); if (triggerPurge) { lowestPurgeableTimeBucket = ((start - fixedStart) / bucketSpanMillis) - 2; } } return key; }
Source:
private static void assertGeometry(String wkt) throws ParseException { Slice geometry = stGeometryFromText(utf8Slice(wkt)); Geometry expected = WKT_READER.read(wkt); Geometry actual = JtsGeometryUtils.deserialize(geometry); if (expected.isEmpty()) { assertTrue(actual.isEmpty()); } else { assertEquals(actual, expected); } if (expected.isEmpty()) { assertTrue(JtsGeometryUtils.deserialize(JtsGeometryUtils.serialize(expected)).isEmpty()); } else { assertEquals(JtsGeometryUtils.deserialize(JtsGeometryUtils.serialize(expected)), expected); } }

Target:
private static void assertGeometry(String wkt) throws ParseException { Slice geometry = stGeometryFromText(utf8Slice(wkt)); Geometry expected = WKT_READER.read(wkt); Geometry actual = JtsGeometryUtils.deserialize(geometry); if (expected.isEmpty()) { assertTrue(actual.isEmpty()); } else { assertEquals(actual, expected); } Slice jtsSerializedGeometry = JtsGeometryUtils.serialize(expected); if (expected.isEmpty()) { assertTrue(JtsGeometryUtils.deserialize(jtsSerializedGeometry).isEmpty()); } else { assertEquals(JtsGeometryUtils.deserialize(jtsSerializedGeometry), expected); } assertEquals(GeometryUtils.deserialize(jtsSerializedGeometry).asText(), (GeometryUtils.deserialize(geometry)).asText()); }
Source:
private void writeViolation(final String account, final String region, final Object metaInfo, final String canonicalHostedZoneName, final List<String> instanceIds) { final Optional<Map> taupageYaml = instanceIds. stream(). map(id -> fetchTaupageYaml.getTaupageYaml(id, account, region)). filter(Optional::isPresent). map(Optional::get). findFirst(); final ViolationBuilder violationBuilder = new ViolationBuilder(); final Violation violation = violationBuilder.withAccountId(account) .withRegion(region) .withPluginFullyQualifiedClassName(FetchElasticLoadBalancersJob.class) .withType(UNSECURED_PUBLIC_ENDPOINT) .withMetaInfo(metaInfo) .withEventId(EVENT_ID) .withInstanceId(canonicalHostedZoneName) .withAccountId(taupageYaml.map(data -> (String) data.get(APPLICATION_ID)).map(StringUtils::trimToNull).orElse(null)) .withApplicationVersion(taupageYaml.map(data -> (String) data.get(APPLICATION_VERSION)).map(StringUtils::trimToNull).orElse(null)) .build(); violationSink.put(violation); }

Target:
private void writeViolation(final String account, final String region, final Object metaInfo, final String canonicalHostedZoneName, final List<String> instanceIds) { final Optional<Map> taupageYaml = instanceIds. stream(). map(id -> fetchTaupageYaml.getTaupageYaml(id, account, region)). filter(Optional::isPresent). map(Optional::get). findFirst(); final ViolationBuilder violationBuilder = new ViolationBuilder(); final Violation violation = violationBuilder.withAccountId(account) .withRegion(region) .withPluginFullyQualifiedClassName(FetchElasticLoadBalancersJob.class) .withType(UNSECURED_PUBLIC_ENDPOINT) .withMetaInfo(metaInfo) .withEventId(EVENT_ID) .withInstanceId(canonicalHostedZoneName) .withApplicationId(taupageYaml.map(data -> (String) data.get(APPLICATION_ID)).map(StringUtils::trimToNull).orElse(null)) .withApplicationVersion(taupageYaml.map(data -> (String) data.get(APPLICATION_VERSION)).map(StringUtils::trimToNull).orElse(null)) .build(); violationSink.put(violation); }
Source:
public void decompress(ByteBuffer input, ByteBuffer output) throws MalformedInputException { if (input.isDirect() || output.isDirect()) { throw new UnsupportedOperationException("Decompression of direct byte buffer not supported"); } byte[] inputArray; int inputOffset; if (input.hasArray()) { inputArray = input.array(); inputOffset = input.arrayOffset() + input.position(); } else { throw new IllegalArgumentException("Unsupported input ByteBuffer implementation " + input.getClass().getName()); } byte[] outputArray; int outputOffset; if (output.hasArray()) { outputArray = output.array(); outputOffset = output.arrayOffset() + output.position(); } else { throw new IllegalArgumentException("Unsupported output ByteBuffer implementation " + output.getClass().getName()); } int written = decompress(inputArray, inputOffset, input.remaining(), outputArray, outputOffset, output.remaining()); output.position(output.position() + written); }

Target:
public void decompress(ByteBuffer input, ByteBuffer output) throws MalformedInputException { if (input.isDirect() || output.isDirect() || !input.hasArray() || !output.hasArray()) { throw new IllegalArgumentException("Non-direct byte buffer backed by byte array required"); } int inputOffset = input.arrayOffset() + input.position(); int outputOffset = output.arrayOffset() + output.position(); int written = decompress(input.array(), inputOffset, input.remaining(), output.array(), outputOffset, output.remaining()); output.position(output.position() + written); }
Source:
private void initialize() throws IOException { dirChooser = new DirectoryChooser(); dbload = new DBLoadService(); dbload.setOnFailed(e -> { new ExceptionDialog(list.getParent(), dbload.getException(), "Database is already in use, please choose another."); }); dbload.setOnRunning(e -> progressDialog.show()); dbload.setOnSucceeded(e -> { dbProperty.setValue(dbload.getValue()); startButton.setDisable(false); progressDialog.close(); }); dbProperty = new SimpleObjectProperty<>(this, "graph"); items = FXCollections.observableArrayList(SELECT_OPTION); scanDirectory(); list.setItems(items); list.getSelectionModel().select(getDBPath()); list.getSelectionModel().selectedItemProperty().addListener((obj, oldV, newV) -> { deleteButton.setDisable(true); if (newV != SELECT_OPTION) { deleteButton.setDisable(false); } dbload.setDatabase(newV); System.out.println(this.getDBPath()); }); }

Target:
private void initialize() { dirChooser = new DirectoryChooser(); dbload = new DBLoadService(); dbload.setOnFailed(e -> { new ExceptionDialog(list.getParent(), dbload.getException(), "Database is already in use, please choose another."); progressDialog.close(); }); dbload.setOnRunning(e -> progressDialog.show()); dbload.setOnSucceeded(e -> { dbProperty.setValue(dbload.getValue()); progressDialog.close(); }); items = list.getItems(); dbProperty = new SimpleObjectProperty<>(this, "graph"); scanDirectory(DEFAULT_DB_PATH); list.setItems(items); list.getSelectionModel().select(getDBPath()); list.getSelectionModel().selectedItemProperty().addListener((obj, oldV, newV) -> { deleteButton.setDisable(true); if (newV != selectDB) { deleteButton.setDisable(false); } dbload.setDatabase(newV); }); }
Source:
public void work() { LOG.debug("[Agent Loop] Trying to retrieve work."); if (pluginJarLocationMonitor.getLastRun() > 0) { retrieveCookieIfNecessary(); retrieveWork(); LOG.debug("[Agent Loop] Successfully retrieved work."); } else { LOG.debug("[Agent Loop] PluginLocationMonitor has not yet run. Not retrieving work since plugins may not be initialized."); } }

Target:
public void work() { LOG.debug("[Agent Loop] Trying to retrieve work."); if (pluginJarLocationMonitor.hasRunAtLeastOnce()) { retrieveCookieIfNecessary(); retrieveWork(); LOG.debug("[Agent Loop] Successfully retrieved work."); } else { LOG.debug("[Agent Loop] PluginLocationMonitor has not yet run. Not retrieving work since plugins may not be initialized."); } }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && source.getSourceId() != null) { Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game); TargetCardInGraveyard target = new TargetCardInGraveyard(filter); target.setNotTarget(true); if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.chooseUse(outcome, "Exile a creature card from a graveyard?", source, game)) { if (controller.choose(Outcome.Exile, target, source.getId(), game)) { Card cardChosen = game.getCard(target.getFirstTarget()); if (cardChosen != null) { controller.moveCardToExileWithInfo(cardChosen, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); if (sourceObject != null) { sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance()); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getName()); } } } else if (sourceObject != null) { sourceObject.tap(game); } } else if (sourceObject != null) { sourceObject.tap(game); } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && source.getSourceId() != null) { Permanent sourceObject = (Permanent) source.getSourceObjectIfItStillExists(game); TargetCardInGraveyard target = new TargetCardInGraveyard(filter); target.setNotTarget(true); if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.chooseUse(outcome, "Exile a creature card from a graveyard?", source, game)) { if (controller.choose(Outcome.Exile, target, source.getId(), game)) { Card cardChosen = game.getCard(target.getFirstTarget()); if (cardChosen != null) { controller.moveCardsToExile(cardChosen, source, game, true, null, ""); if (sourceObject != null) { sourceObject.getCounters(game).addCounter(CounterType.P1P1.createInstance()); game.informPlayers(controller.getLogName() + " puts a +1/+1 counter on " + sourceObject.getLogName()); } } } else if (sourceObject != null) { sourceObject.tap(game); } } else if (sourceObject != null) { sourceObject.tap(game); } return true; } return false; }
Source:
public T deleteHostedVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Entry to modify.", required = true) @PathParam("entryId") Long entryId, @ApiParam(value = "version", required = true) @QueryParam("version") String version) { T entry = getEntryDAO().findById(entryId); checkEntry(entry); checkUserCanUpdate(user, entry); checkHosted(entry); if (entry.getActualDefaultVersion().getName().equals(version)) { entry.setActualDefaultVersion(null); } entry.getWorkflowVersions().removeIf(v -> Objects.equals(v.getName(), version)); PublicStateManager.getInstance().handleIndexUpdate(entry, StateManagerMode.UPDATE); return entry; }

Target:
public T deleteHostedVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Entry to modify.", required = true) @PathParam("entryId") Long entryId, @ApiParam(value = "version", required = true) @QueryParam("version") String version) { T entry = getEntryDAO().findById(entryId); checkEntry(entry); checkUserCanUpdate(user, entry); checkHosted(entry); if (entry.getActualDefaultVersion().getName().equals(version)) { Optional<U> max = entry.getWorkflowVersions().stream().filter(v -> !Objects.equals(v.getName(), version)) .max(Comparator.comparingLong(ver -> ver.getDate().getTime())); entry.setActualDefaultVersion(max.orElse(null)); } entry.getWorkflowVersions().removeIf(v -> Objects.equals(v.getName(), version)); PublicStateManager.getInstance().handleIndexUpdate(entry, StateManagerMode.UPDATE); return entry; }
Source:
public Map<String, SuggestedQuantity> getSuggestedQuantities(List<Pool> pools, Consumer c, Date date) { JsonJsContext args = new JsonJsContext(mapper); Stream<PoolDTO> poolStream = pools == null ? Stream.empty() : pools.stream().map(this.translator.getStreamMapper(Pool.class, PoolDTO.class)); Stream<EntitlementDTO> entStream = c.getEntitlements() == null ? Stream.empty() : c.getEntitlements().stream() .filter(ent -> ent.isValidOnDate(date)) .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = c.getGuestIds() == null ? Stream.empty() : c.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); args.put("pools", poolStream.collect(Collectors.toSet())); args.put("consumer", this.translator.translate(c, ConsumerDTO.class)); args.put("validEntitlements", entStream.collect(Collectors.toSet())); args.put("log", log, false); args.put("guestIds", guestIdStream.collect(Collectors.toList())); String json = jsRules.runJsFunction(String.class, "get_suggested_quantities", args); Map<String, SuggestedQuantity> resultMap; TypeReference<Map<String, SuggestedQuantity>> typeref = new TypeReference<Map<String, SuggestedQuantity>>() {}; try { resultMap = mapper.toObject(json, typeref); } catch (Exception e) { throw new RuleExecutionException(e); } return resultMap; }

Target:
public Map<String, SuggestedQuantity> getSuggestedQuantities(List<Pool> pools, Consumer c, Date date) { JsonJsContext args = new JsonJsContext(mapper); Stream<PoolDTO> poolStream = pools == null ? Stream.empty() : pools.stream().map(this.translator.getStreamMapper(Pool.class, PoolDTO.class)); Stream<EntitlementDTO> entStream = c.getEntitlements() == null ? Stream.empty() : c.getEntitlements().stream() .filter(ent -> ent.isValidOnDate(date)) .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = c.getGuestIds() == null ? Stream.empty() : c.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); args.put("pools", poolStream); args.put("consumer", this.translator.translate(c, ConsumerDTO.class)); args.put("validEntitlements", entStream); args.put("log", log, false); args.put("guestIds", guestIdStream); String json = jsRules.runJsFunction(String.class, "get_suggested_quantities", args); Map<String, SuggestedQuantity> resultMap; TypeReference<Map<String, SuggestedQuantity>> typeref = new TypeReference<Map<String, SuggestedQuantity>>() {}; try { resultMap = mapper.toObject(json, typeref); } catch (Exception e) { throw new RuleExecutionException(e); } return resultMap; }
Source:
protected String getRoutingLookupKey() { return super.getConnectionFactory() instanceof RoutingConnectionFactory ? (this.lookupKeyQualifier + this.queues.stream() .map(q -> q.getName()) .collect(Collectors.toList()) .toString() .replaceAll(" ", "")) : null; }

Target:
protected String getRoutingLookupKey() { return super.getConnectionFactory() instanceof RoutingConnectionFactory ? this.lookupKeyQualifier + "[" + this.queues.stream() .map(q -> q.getName()) .collect(Collectors.joining(",")) + "]" : null; }
Source:
Mono<Response<Document>> getDocumentWithResponse(String key, List<String> selectedFields, RequestOptions requestOptions, Context context) { try { return restClient.documents() .getWithRestResponseAsync(key, selectedFields, requestOptions, context) .map(res -> { Document doc = new Document(res.getValue()); DocumentResponseConversions.cleanupDocument(doc); return new SimpleResponse<>(res, doc); }) .onErrorMap(DocumentResponseConversions::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
Mono<Response<SearchDocument>> getDocumentWithResponse(String key, List<String> selectedFields, RequestOptions requestOptions, Context context) { try { return restClient.documents() .getWithRestResponseAsync(key, selectedFields, requestOptions, context) .map(res -> { SearchDocument doc = new SearchDocument(res.getValue()); DocumentResponseConversions.cleanupDocument(doc); return new SimpleResponse<>(res, doc); }) .onErrorMap(DocumentResponseConversions::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
public void setProvider_shouldNotSetProviderIfGivenProviderIsNull() throws Exception { RadiologyReport report = new RadiologyReport(radiologyOrder); try { report.setProvider(null); } catch (IllegalArgumentException e) { assertThat(report.getProvider(), is(provider1)); } }

Target:
public void setProvider_shouldNotSetProviderIfGivenProviderIsNull() throws Exception { RadiologyReport report = new RadiologyReport(radiologyOrder); try { report.setPrincipalResultsInterpreter(null); } catch (IllegalArgumentException e) { assertThat(report.getPrincipalResultsInterpreter(), is(provider1)); } }
Source:
private CompletableFuture<HermesResponse> sendOnce(HermesMessage message) { long startTime = System.nanoTime(); return sender.send(URI.create(uri + message.getTopic()), message) .exceptionally(e -> HermesResponseBuilder.hermesFailureResponse(e, message)) .whenComplete((resp, cause) -> messageDeliveryListeners.forEach(l -> l.onSend(resp, System.nanoTime() - startTime))); }

Target:
private CompletableFuture<HermesResponse> sendOnce(HermesMessage message) { long startTime = System.nanoTime(); return sender.send(URI.create(uri + message.getTopic()), message) .exceptionally(e -> HermesResponseBuilder.hermesFailureResponse(e, message)) .whenComplete((resp, cause) -> { long latency = System.nanoTime() - startTime; messageDeliveryListeners.forEach(l -> l.onSend(resp, latency)); }); }
Source:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (Repository.class.equals(adapterType)) { Repository repository = null; if (adaptableObject instanceof IResource) { IResource resource = (IResource) adaptableObject; repository = getRepository(resource); } else if (adaptableObject instanceof IHistoryView) { IHistoryView historyView = (IHistoryView) adaptableObject; IHistoryPage historyPage = historyView.getHistoryPage(); Object input = historyPage.getInput(); if (input instanceof RepositoryNode) { RepositoryNode node = (RepositoryNode) input; repository = node.getRepository(); } else if (input instanceof IResource) { repository = getRepository((IResource) input); } else if (input instanceof HistoryPageInput) { repository = ((HistoryPageInput) input).getRepository(); } } else if (adaptableObject instanceof ISelection) { IStructuredSelection structuredSelection = SelectionUtils .getStructuredSelection((ISelection) adaptableObject); repository = SelectionUtils.getRepository(structuredSelection); } else { return null; } return adapterType.cast(repository); } return null; }

Target:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (Repository.class.equals(adapterType)) { Repository repository = null; if (adaptableObject instanceof IResource) { IResource resource = (IResource) adaptableObject; repository = getRepository(resource); } else if (adaptableObject instanceof IHistoryView) { IHistoryView historyView = (IHistoryView) adaptableObject; IHistoryPage historyPage = historyView.getHistoryPage(); Object input = historyPage.getInput(); repository = Adapters.adapt(input, Repository.class); if (repository == null && input instanceof IResource) { repository = getRepository((IResource) input); } } else if (adaptableObject instanceof ISelection) { IStructuredSelection structuredSelection = SelectionUtils .getStructuredSelection((ISelection) adaptableObject); repository = SelectionUtils.getRepository(structuredSelection); } else { return null; } return adapterType.cast(repository); } return null; }
Source:
private void reset(Reader reader) throws IOException { length = 0; lines = null; lineOffsets = null; List<String> slist = new ArrayList<>(); StringBuilder bld = new StringBuilder(); int c; while ((c = reader.read()) != -1) { ++length; redo_c: while (true) { bld.append((char) c); switch (c) { case '\r': c = reader.read(); if (c == -1) { slist.add(bld.toString()); bld.setLength(0); break redo_c; } ++length; if (c == '\n') { bld.append((char) c); slist.add(bld.toString()); bld.setLength(0); break redo_c; } slist.add(bld.toString()); bld.setLength(0); continue redo_c; case '\n': slist.add(bld.toString()); bld.setLength(0); break redo_c; default: } break; } } if (bld.length() > 0) { slist.add(bld.toString()); bld.setLength(0); } else { slist.add(""); } lines = slist.toArray(new String[0]); setLineOffsets(); }

Target:
private void reset(Reader reader) throws IOException { length = 0; lines = null; lineOffsets = null; List<String> slist = new ArrayList<>(); SourceSplitterScanner scanner = new SourceSplitterScanner(reader); scanner.setTarget(slist); scanner.consume(); length = scanner.getLength(); lines = slist.toArray(new String[0]); setLineOffsets(); }
Source:
public void initialize(Context context, final InitializationCompleteCallback completionCallback, List<MediationConfiguration> mediationConfigurations) { String appId = null; for (MediationConfiguration configuration : mediationConfigurations) { Bundle serverParameters = configuration.getServerParameters(); if (serverParameters == null) { continue; } appId = serverParameters.getString(KEY_APP_ID); if (!TextUtils.isEmpty(appId)) { break; } } if (TextUtils.isEmpty(appId)) { if (completionCallback != null) { completionCallback.onInitializationFailed("Fyber SDK requires an appId to be configured on the AdMob console"); } Log.w(TAG, "No appId received from AdMob. Cannot initialize Fyber marketplace"); } else { InneractiveAdManager.initialize(context, appId); IAConfigManager.addListener(new IAConfigManager.OnConfigurationReadyAndValidListener() { @Override public void onConfigurationReadyAndValid(IAConfigManager iaConfigManager, boolean success, Exception e) { if (completionCallback != null) { if (success) { completionCallback.onInitializationSucceeded(); } else { completionCallback.onInitializationFailed("Fyber SDK initialization failed"); } } IAConfigManager.removeListener(this); } }); } }

Target:
public void initialize(Context context, final InitializationCompleteCallback completionCallback, List<MediationConfiguration> mediationConfigurations) { if (InneractiveAdManager.wasInitialized()) { waitForInitializationStatusAndReport(completionCallback); return; } String appId = null; List<String> configuredAppIds = new ArrayList<>(); for (MediationConfiguration configuration : mediationConfigurations) { Bundle serverParameters = configuration.getServerParameters(); if (serverParameters == null) { continue; } appId = serverParameters.getString(KEY_APP_ID); if (!TextUtils.isEmpty(appId)) { configuredAppIds.add(appId); } } if (configuredAppIds.isEmpty()) { Log.w(TAG, "No appId received from AdMob. Cannot initialize Fyber Marketplace"); if (completionCallback != null) { completionCallback.onInitializationFailed("Fyber SDK requires an appId to be configured on the AdMob UI"); } return; } String appIdForInitialization = configuredAppIds.get(0); if (configuredAppIds.size() > 1) { String message = String.format("Multiple '%s' entries found: %s. " + "Using '%s' to initialize the Fyber Marketplace SDK", KEY_APP_ID, appIdForInitialization, appIdForInitialization); Log.w(TAG, message); } InneractiveAdManager.initialize(context, appIdForInitialization); waitForInitializationStatusAndReport(completionCallback); }
Source:
public Properties getKafkaProperties() { return kafkaProperties; }

Target:
public Properties getKafkaProperties() { return (Properties) kafkaProperties.clone(); }
Source:
public void characters(String text) { assertOpenBlock(); try { for (int x = 0; x < text.length(); ++x) { char c = text.charAt(x); currentBlock.write(c); } } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public void characters(String text) { assertOpenBlock(); try { currentBlock.write(text); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
protected void delete(ConceptStopWord delegate, String reason, RequestContext context) throws ResponseException { Context.getConceptService().deleteConceptStopWord(delegate.getId()); }

Target:
protected void delete(ConceptStopWord delegate, String reason, RequestContext context) throws ResponseException { throw new ResourceDoesNotSupportOperationException(); }
Source:
public void setB(ItemMeta cb, Boolean fb, ItemStack d) { cb.setUnbreakable(fb); }

Target:
public void setB(ItemMeta cb, Boolean fb, ItemStack d) { NmsItemStackMetaUnbreakable.get().setUnbreakable(cb,fb); }
Source:
private int getStartIndexOfTime(GenericColumn timeValues, long time, boolean inclusive) { int low = 0; int high = timeValues.length() - 1; while (low <= high) { int mid = (low + high) >>> 1; long midVal = timeValues.getLongSingleValueRow(mid); if (midVal < time) low = mid + 1; else if (midVal > time) high = mid - 1; else { int i; for (i = mid - 1; i >= 0; i--) { long prev = timeValues.getLongSingleValueRow(i); if (time != prev) { break; } } return inclusive ? i + 1 : i; } } return low; }

Target:
protected int getStartIndexOfTime(GenericColumn timeValues, long time, boolean inclusive) { int low = 0; int high = timeValues.length() - 1; while (low <= high) { int mid = (low + high) >>> 1; long midVal = timeValues.getLongSingleValueRow(mid); if (midVal < time) low = mid + 1; else if (midVal > time) high = mid - 1; else { int i; for (i = mid - 1; i >= 0; i--) { long prev = timeValues.getLongSingleValueRow(i); if (time != prev) { break; } } return inclusive ? i + 1 : i; } } return inclusive ? low : low - 1; }
Source:
void onEnterKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == 13) { onItemSelected(event); } }

Target:
void onEnterKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { onItemSelected(event); } }
Source:
public boolean createMenu(final MenuModel menu) { if (menu == null || TextUtils.isEmpty(menu.name)) return false; String path = formatPath(CREATE_MENU_REST_PATH, null); Map<String, String> params = new HashMap<>(); params.put(MENU_NAME_KEY, menu.name); WordPress.getRestClientUtilsV1_1().post(path, params, null, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { menu.menuId = response.optLong(MENU_ID_KEY); mDelegate.onMenuCreated(HttpURLConnection.HTTP_OK, menu); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { mDelegate.onMenuCreated(statusCodeFromVolleyError(error), menu); } }); return true; }

Target:
public int createMenu(final MenuModel menu) { if (menu == null || TextUtils.isEmpty(menu.name)) return -1; final int requestId = ++mRequestCounter; String path = formatPath(CREATE_MENU_REST_PATH, null); Map<String, String> params = new HashMap<>(); params.put(MENU_NAME_KEY, menu.name); WordPress.getRestClientUtilsV1_1().post(path, params, null, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { menu.menuId = response.optLong(MENU_ID_KEY); mListener.onMenuCreated(requestId, menu); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { int statusCode = statusCodeFromVolleyError(volleyError); REST_ERROR error = REST_ERROR.CREATE_ERROR; if (statusCode == HTTP_FORBIDDEN) error = REST_ERROR.AUTHENTICATION_ERROR; mListener.onErrorResponse(requestId, error); } }); return requestId; }
Source:
protected boolean canDoAction() { parameter = getParameters(); if (parameter == null || parameter.getVolumeId() == null || parameter.getSlaveNodeIp() == null || parameter.getSlaveVolumeName() == null) { return false; } if(masterVolume == null) { return false; } masterVolume = getGlusterVolumeDao().getById(parameter.getVolumeId()); if (masterVolume.getStatus() == GlusterStatus.DOWN) { return false; } return true; }

Target:
protected boolean canDoAction() { parameter = getParameters(); if (parameter == null) { return false; } if (getGlusterVolume() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); return false; } if (parameter.getSlaveNodeIp() == null) { failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_VDS_HOSTNAME); return false; } masterVolume = getGlusterVolumeDao().getById(parameter.getVolumeId()); if (masterVolume == null) { return false; } if (masterVolume.getStatus() == GlusterStatus.DOWN) { return false; } return true; }
Source:
public List<WebElement> getOngoingSessionsRows() { return ongoingSessionsTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); }

Target:
private List<WebElement> getOngoingSessionsRows() { return ongoingSessionsTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); }
Source:
private Multimap<CorruptionCheckViolation, NamespaceAndUseCase> getViolationsToNamespaceToUseCaseMultimap() { List<CompletePaxosHistoryForNamespaceAndUseCase> historyForAll = getHistory(); return HistoryAnalyzer.corruptionHealthReportForHistory(historyForAll).violatingStatusesToNamespaceAndUseCase(); }

Target:
private Multimap<CorruptionCheckViolation, NamespaceAndUseCase> getViolationsToNamespaceToUseCaseMultimap() { return HistoryAnalyzer.corruptionHealthReportForHistory(getHistory()).violatingStatusesToNamespaceAndUseCase(); }
Source:
public void initResources(Display display) { if (stockImages == null) { stockImages = new Image[stockImageLocations.length]; for (int i = 0; i < stockImageLocations.length; ++i) { Image image = createStockImage(display, stockImageLocations[i]); if (image == null) { freeResources(); throw new IllegalStateException( FileViewer.getResourceString("error.CouldNotLoadResources")); } stockImages[i] = image; } } if (stockCursors == null) { stockCursors = new Cursor[] { null, display.getSystemCursor(SWT.CURSOR_WAIT) }; } iconCache = new HashMap<Program, Image>(); }

Target:
public void initResources(Display display) { if (stockImages == null) { stockImages = new Image[stockImageLocations.length]; for (int i = 0; i < stockImageLocations.length; ++i) { Image image = createStockImage(display, stockImageLocations[i]); if (image == null) { freeResources(); throw new IllegalStateException( FileViewer.getResourceString("error.CouldNotLoadResources")); } stockImages[i] = image; } } if (stockCursors == null) { stockCursors = new Cursor[] { null, display.getSystemCursor(SWT.CURSOR_WAIT) }; } iconCache = new HashMap<>(); }
Source:
public void create(final String version, List<String> participants) { String barrierRoot = keyBuilder.getBarrierRoot(); String barrierParticipantsPath = keyBuilder.getBarrierParticipantsPath(version); zkUtils.makeSurePersistentPathsExists(new String[]{ barrierRoot, keyBuilder.getBarrierPath(version), barrierParticipantsPath, keyBuilder.getBarrierStatePath(version)}); LOG.info("Subscribing for child changes at " + barrierParticipantsPath); zkUtils.getZkClient().subscribeChildChanges(barrierParticipantsPath, new ZkBarrierChangeHandler(version, participants, zkUtils)); barrierListenerOptional.ifPresent(zkBarrierListener -> zkBarrierListener.onBarrierCreated(version)); }

Target:
public void create(final String version, List<String> participants) { String barrierRoot = keyBuilder.getBarrierRoot(); String barrierParticipantsPath = keyBuilder.getBarrierParticipantsPath(version); zkUtils.makeSurePersistentPathsExists(new String[]{ barrierRoot, keyBuilder.getBarrierPath(version), barrierParticipantsPath, keyBuilder.getBarrierStatePath(version)}); LOG.info("Subscribing for child changes at " + barrierParticipantsPath); zkUtils.subscribeChildChanges(barrierParticipantsPath, new ZkBarrierChangeHandler(version, participants, zkUtils)); barrierListenerOptional.ifPresent(zkBarrierListener -> zkBarrierListener.onBarrierCreated(version)); }
Source:
public List<BibEntry> performSearch(String query) throws FetcherException { try { obtainAndModifyCookie(); List<BibEntry> foundEntries = new ArrayList<>(20); URIBuilder uriBuilder = new URIBuilder(BASIC_SEARCH_URL); uriBuilder.addParameter("hl", "en"); uriBuilder.addParameter("btnG", "Search"); uriBuilder.addParameter("q", query); try { addHitsFromQuery(foundEntries, uriBuilder.toString()); if (foundEntries.size() == 10) { uriBuilder.addParameter("start", "10"); addHitsFromQuery(foundEntries, uriBuilder.toString()); } } catch (IOException e) { LOGGER.info("IOException for URL {}", uriBuilder.toString()); if (e.getMessage().contains("Server returned HTTP response code: 503 for URL")) { throw new FetcherException("Fetching from Google Scholar failed.", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), e); } else { throw new FetcherException("Error while fetching from " + getName(), e); } } return foundEntries; } catch (URISyntaxException e) { throw new FetcherException("Error while fetching from " + getName(), e); } }

Target:
public List<BibEntry> performSearch(String query) throws FetcherException { LOGGER.debug("Using URL {}", query); obtainAndModifyCookie(); List<BibEntry> foundEntries = new ArrayList<>(20); URIBuilder uriBuilder = null; try { uriBuilder = new URIBuilder(BASIC_SEARCH_URL); } catch (URISyntaxException e) { throw new FetcherException("Error while fetching from " + getName() + " at URL " + BASIC_SEARCH_URL, e); } uriBuilder.addParameter("hl", "en"); uriBuilder.addParameter("btnG", "Search"); uriBuilder.addParameter("q", query); String queryURL = uriBuilder.toString(); try { addHitsFromQuery(foundEntries, queryURL); } catch (IOException e) { if (e.getMessage().contains("Server returned HTTP response code: 503 for URL")) { throw new FetcherException("Fetching from Google Scholar at URL " + queryURL + " failed.", Localization.lang("This might be caused by reaching the traffic limitation of Google Scholar (see 'Help' for details)."), e); } else { throw new FetcherException("Error while fetching from " + getName() + " at URL " + queryURL, e); } } return foundEntries; }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @SuppressWarnings({"UnusedParameters", "For future"}) @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitStructType(@NotNull GoStructType o) { super.visitStructType(o); for (GoFieldDeclaration field : o.getFieldDeclarationList()) { ProgressManager.checkCanceled(); GoTag tag = field.getTag(); if (tag == null) continue; if (!isValidTag(tag)) { holder.registerProblem(tag, "Bad syntax for struct tag value"); } } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @SuppressWarnings({"UnusedParameters", "For future"}) @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitStructType(@NotNull GoStructType o) { for (GoFieldDeclaration field : o.getFieldDeclarationList()) { ProgressManager.checkCanceled(); GoTag tag = field.getTag(); if (tag == null) continue; if (!isValidTag(tag)) { holder.registerProblem(tag, "Bad syntax for struct tag value"); } } } }; }
Source:
public String toString() { if (section == null) return "<emtpy>"; StringBuilder b = new StringBuilder("[").append(section); if (subsection != null) b.append(".").append(subsection); if (name != null) b.append(".").append(name); b.append("]"); if (value != null) b.append("=").append(value); return b.toString(); }

Target:
public String toString() { if (section == null) return "<empty>"; StringBuilder b = new StringBuilder(section); if (subsection != null) b.append(".").append(subsection); if (name != null) b.append(".").append(name); if (value != null) b.append("=").append(value); return b.toString(); }
Source:
public static Registry getConfigurationRegistry() throws DeviceTypeMgtPluginException { try { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); org.wso2.carbon.registry.core.service.RegistryService registryService = DeviceTypeExtensionDataHolder .getInstance().getRegistryService(); return registryService == null ? null : registryService.getConfigSystemRegistry(tenantId); } catch (RegistryException e) { throw new DeviceTypeMgtPluginException("Error in retrieving conf registry instance: " + e.getMessage(), e); } }

Target:
public static Registry getConfigurationRegistry() throws DeviceTypeMgtPluginException { try { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); org.wso2.carbon.registry.core.service.RegistryService registryService = DeviceTypeExtensionDataHolder .getInstance().getRegistryService(); if (registryService == null) { throw new DeviceTypeMgtPluginException("Registry Service is not initialized properly"); } return registryService.getConfigSystemRegistry(tenantId); } catch (RegistryException e) { throw new DeviceTypeMgtPluginException("Error in retrieving conf registry instance: " + e.getMessage(), e); } }
Source:
private static LocalDate changeYear(LocalDate localDate, int yearsDelta) { final Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, localDate.getYear()); calendar.set(Calendar.MONTH, localDate.getMonthValue() - 1); calendar.set(Calendar.DAY_OF_MONTH, localDate.getDay()); calendar.add(Calendar.YEAR, yearsDelta); final int year = calendar.get(Calendar.YEAR); final MonthOfYear month = MonthOfYears.getMonth(calendar); final int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH); final LocalDate result = LocalDate.newBuilder() .setYear(year) .setMonth(month) .setDay(dayOfMonth) .build(); return result; }

Target:
private static LocalDate changeYear(LocalDate localDate, int yearsDelta) { final Calendar cal = createDate(localDate.getYear(), localDate.getMonthValue(), localDate.getDay()); cal.add(YEAR, yearsDelta); final LocalDate result = LocalDate.newBuilder() .setYear(getYear(cal)) .setMonth(Calendars.getMonthOfYear(cal)) .setDay(getDay(cal)) .build(); return result; }
Source:
private void gc() { Ref r; while ((r = (Ref) queue.poll()) != null) { clear(r); boolean found = false; final int s = slot(r.pack, r.position); final Entry e1 = table.get(s); for (Entry n = e1; n != null; n = n.next) { if (n.ref == r) { n.dead = true; found = true; break; } } if (found) { table.compareAndSet(s, e1, clean(e1)); } } }

Target:
private void gc() { Ref r; while ((r = (Ref) queue.poll()) != null) { clear(r); final int s = slot(r.pack, r.position); final Entry e1 = table.get(s); for (Entry n = e1; n != null; n = n.next) { if (n.ref == r) { n.dead = true; table.compareAndSet(s, e1, clean(e1)); break; } } } }
Source:
public void onLoadProjectSuccess(boolean startProjectActivity) { if (getActivity() == null) { Log.e(TAG, "Null Value of getActivity() at onLoadProjectSuccess"); return; } Intent intent = new Intent(getActivity(), ProjectActivity.class); intent.putExtra(Constants.PROJECT_OPENED_FROM_PROJECTS_LIST, true); getActivity().startActivity(intent); }

Target:
public void onLoadProjectSuccess(boolean startProjectActivity) { Intent intent = new Intent(getActivity(), ProjectActivity.class); intent.putExtra(Constants.PROJECT_OPENED_FROM_PROJECTS_LIST, true); getActivity().startActivity(intent); }