auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean initialize(AndroidCommCarePlatform instance, boolean isUpgrade) throws ResourceInitializationException { if (localLocation == null) { throw new ResourceInitializationException("The user restore file location is null!"); } if (isUpgrade) { wipeSandboxForCurrentDemoUser(instance); } OfflineUserRestore offlineUserRestore = new OfflineUserRestore(localLocation); instance.registerDemoUserRestore(offlineUserRestore); return true; }

Target:
public boolean initialize(AndroidCommCarePlatform instance, boolean isUpgrade) throws ResourceInitializationException { instance.registerDemoUserRestore(initDemoUserRestore()); return true; }
Source:
public static Slice stPoint(@SqlType(StandardTypes.DOUBLE) double x, @SqlType(StandardTypes.DOUBLE) double y) { OGCGeometry geometry = createFromEsriGeometry(new Point(x, y), SpatialReference.create(4326)); return serialize(geometry); }

Target:
public static Slice stPoint(@SqlType(StandardTypes.DOUBLE) double x, @SqlType(StandardTypes.DOUBLE) double y) { OGCGeometry geometry = createFromEsriGeometry(new Point(x, y), DEFAULT_SPATIAL_REFERENCE); return serialize(geometry); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_budget); mBudgetName = (EditText) findViewById(R.id.budget_name); mBudgetAmount = (EditText) findViewById(R.id.budget_amount); mBudgetDate = (DatePicker) findViewById(R.id.budget_date); mRecurring = (CheckBox) findViewById(R.id.budget_recur); mBudgetDuration = (Spinner) findViewById(R.id.budget_duration); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.duration_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBudgetDuration.setAdapter(adapter); findViewById(R.id.create_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); findViewById(R.id.clear_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_budget); mBudgetNameView = (EditText) findViewById(R.id.budget_name); mBudgetAmountView = (EditText) findViewById(R.id.budget_amount); mBudgetDateView = (DatePicker) findViewById(R.id.budget_date); mRecurringView = (CheckBox) findViewById(R.id.budget_recur); mBudgetDurationView = (Spinner) findViewById(R.id.budget_duration); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.duration_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBudgetDurationView.setAdapter(adapter); findViewById(R.id.create_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { attemptAddBudget(); } }); findViewById(R.id.clear_budget_button).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { AddBudgetActivity.this.clearEntry(null); } }); }
Source:
private static Duration measureMinimalRacyInterval(Path dir) { LOG.debug("{}: start measure minimal racy interval in {}", Thread.currentThread(), dir); int failures = 0; long racyNanos = 0; final int COUNT = 10000; ArrayList<Long> deltas = new ArrayList<>(); Path probe = dir.resolve(".probe-" + UUID.randomUUID()); try { Files.createFile(probe); for (int i = 0; i < COUNT; i++) { write(probe, "a"); FileSnapshot snapshot = FileSnapshot.save(probe.toFile()); read(probe); write(probe, "b"); if (!snapshot.isModified(probe.toFile())) { deltas.add(Long.valueOf(snapshot.wasDelta())); racyNanos = snapshot.wasRacyThreshold(); failures++; } } } catch (IOException e) { LOG.error(e.getMessage(), e); return FALLBACK_MIN_RACY_INTERVAL; } finally { deleteProbe(probe); } if (failures > 0) { Stats stats = new Stats(); for (Long d : deltas) { stats.add(d); } LOG.debug( "delta [ns] since modification FileSnapshot failed to detect\n" + "count, failures, racy limit [ns], delta min [ns]," + " delta max [ns], delta avg [ns]," + " delta stddev [ns]\n" + "{}, {}, {}, {}, {}, {}, {}", COUNT, failures, racyNanos, stats.min(), stats.max(), stats.avg(), stats.stddev()); return Duration .ofNanos(Double.valueOf(stats.max()).longValue()); } LOG.debug("{}: no failures when measuring minimal racy interval", Thread.currentThread()); return Duration.ZERO; }

Target:
private static Duration measureMinimalRacyInterval(Path dir) { LOG.debug("{}: start measure minimal racy interval in {}", Thread.currentThread(), dir); int n = 0; int failures = 0; long racyNanos = 0; ArrayList<Long> deltas = new ArrayList<>(); Path probe = dir.resolve(".probe-" + UUID.randomUUID()); Instant end = Instant.now().plusSeconds(3); try { Files.createFile(probe); do { n++; write(probe, "a"); FileSnapshot snapshot = FileSnapshot.save(probe.toFile()); read(probe); write(probe, "b"); if (!snapshot.isModified(probe.toFile())) { deltas.add(Long.valueOf(snapshot.wasDelta())); racyNanos = snapshot.wasRacyThreshold(); failures++; } } while (Instant.now().compareTo(end) < 0); } catch (IOException e) { LOG.error(e.getMessage(), e); return FALLBACK_MIN_RACY_INTERVAL; } finally { deleteProbe(probe); } if (failures > 0) { Stats stats = new Stats(); for (Long d : deltas) { stats.add(d); } LOG.debug( "delta [ns] since modification FileSnapshot failed to detect\n" + "count, failures, racy limit [ns], delta min [ns]," + " delta max [ns], delta avg [ns]," + " delta stddev [ns]\n" + "{}, {}, {}, {}, {}, {}, {}", n, failures, racyNanos, stats.min(), stats.max(), stats.avg(), stats.stddev()); return Duration .ofNanos(Double.valueOf(stats.max()).longValue()); } LOG.debug("{}: no failures when measuring minimal racy interval", Thread.currentThread()); return Duration.ZERO; }
Source:
public void getResourcesSpecifiedByVoWhereUserIsAdmin() throws Exception { System.out.println(CLASS_NAME + "getResourcesSpecifiedByVoWhereUserIsAdmin"); vo = setUpVo(); member = setUpMember(vo); facility = setUpFacility(); Facility facility2 = new Facility(); facility2.setName("ResourcesManagerTestFacility2"); facility2 = perun.getFacilitiesManager().createFacility(sess, facility2); resource = setUpResource(); Resource resource2 = new Resource(); resource2.setName("name"); resource2 = resourcesManager.createResource(sess, resource2, vo, facility2); User u = perun.getUsersManagerBl().getUserByMember(sess, member); resourcesManager.addAdmin(sess, resource, u); resourcesManager.addAdmin(sess, resource2, u); List<Resource> resources = resourcesManager.getResourcesWhereUserIsAdmin(sess, vo, u); assertNotNull(resources); assertTrue(resources.contains(resource)); assertTrue(resources.contains(resource2)); }

Target:
public void getResourcesSpecifiedByVoWhereUserIsAdmin() throws Exception { System.out.println(CLASS_NAME + "getResourcesSpecifiedByVoWhereUserIsAdmin"); vo = setUpVo(); member = setUpMember(vo); facility = setUpFacility(); Facility facility2 = new Facility(); facility2.setName("ResourcesManagerTestFacility2"); facility2 = perun.getFacilitiesManager().createFacility(sess, facility2); resource = setUpResource(); Resource resource2 = new Resource(); resource2.setName("name"); resource2 = resourcesManager.createResource(sess, resource2, vo, facility2); User u = perun.getUsersManagerBl().getUserByMember(sess, member); resourcesManager.addAdmin(sess, resource, u); resourcesManager.addAdmin(sess, resource2, u); List<Resource> resources = resourcesManager.getResourcesWhereUserIsAdmin(sess, vo, u); assertNotNull(resources); assertThat(resources).containsOnly(resource, resource2); }
Source:
public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new LoggingHandler(LogLevel.DEBUG), new HAProxyMessageDecoder(), new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HAProxyMessage) { System.out.println("proxy message: " + msg); } else if (msg instanceof ByteBuf) { System.out.println("bytebuf message: " + ByteBufUtil.prettyHexDump((ByteBuf) msg)); } super.channelRead(ctx, msg); } }); }

Target:
public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new LoggingHandler(LogLevel.DEBUG), new HAProxyMessageDecoder(), new SimpleChannelInboundHandler() { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HAProxyMessage) { System.out.println("proxy message: " + msg); } else if (msg instanceof ByteBuf) { System.out.println("bytebuf message: " + ByteBufUtil.prettyHexDump((ByteBuf) msg)); } } }); }
Source:
protected void fillPinnedList(VmNumaNode vmNumaNode, List<VdsNumaNode> vdsNumaNodes){ for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getFirst()) { Integer index = pair.getSecond().getSecond(); Guid numaId = pair.getFirst(); for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if ( (index != null && vdsNumaNode.getIndex() == index) || vdsNumaNode.getId().equals(numaId)) { pair.setFirst(vdsNumaNode.getId()); pair.getSecond().setSecond(vdsNumaNode.getIndex()); break; } } } } }

Target:
protected void fillPinnedList(VmNumaNode vmNumaNode, List<VdsNumaNode> vdsNumaNodes){ for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() == null || !pair.getSecond().getFirst()) { continue; } Integer index = pair.getSecond().getSecond(); if (index == null) { continue; } VdsNumaNode vdsNode = NumaUtils.getVdsNumaNodeByIndex(vdsNumaNodes, index); if (vdsNode != null) { pair.setFirst(vdsNode.getId()); } } }
Source:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> author = model.getAuthorOfIssue(issue); String content = this.content.get().toLowerCase(); String login = issue.getCreator().toLowerCase(); String name = ""; if (author.isPresent()) { name = author.get().getRealName() == null ? "" : author.get().getRealName().toLowerCase(); } return login.contains(content) || name.contains(content); }

Target:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> author = model.getAuthorOfIssue(issue); String content = this.content.get().toLowerCase(); String login = issue.getCreator().toLowerCase(); String name = author.map(TurboUser::getRealName).orElse("").toLowerCase(); return login.contains(content) || name.contains(content); }
Source:
protected void processFiltered(File file, FileText fileText) { final UniqueProperties properties = new UniqueProperties(); try { loadProperties(file, properties); } catch (IOException ex) { log(0, MSG_IO_EXCEPTION_KEY, file.getPath(), ex.getLocalizedMessage()); } for (Entry<String> duplication : properties .getDuplicatedKeys().entrySet()) { final String keyName = duplication.getElement(); final int lineNumber = getLineNumber(fileText, keyName); log(lineNumber, MSG_KEY, keyName, duplication.getCount() + 1); } }

Target:
protected void processFiltered(File file, FileText fileText) { final UniqueProperties properties = new UniqueProperties(); FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(file); properties.load(fileInputStream); } catch (IOException ex) { log(0, MSG_IO_EXCEPTION_KEY, file.getPath(), ex.getLocalizedMessage()); } finally { Closeables.closeQuietly(fileInputStream); } for (Entry<String> duplication : properties .getDuplicatedKeys().entrySet()) { final String keyName = duplication.getElement(); final int lineNumber = getLineNumber(fileText, keyName); log(lineNumber, MSG_KEY, keyName, duplication.getCount() + 1); } }
Source:
public boolean isPermanentFail() { return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) || (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) || (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) || (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) || (this == PROTOCOL_ERRORS); }

Target:
public boolean isPermanentFail() { return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) || (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) || (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) || (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) || (this == PROTOCOL_ERRORS) || (this == SIGNAL_LOST) || (this == RADIO_POWER_OFF) || (this == TETHERED_CALL_ACTIVE); }
Source:
public void close() throws IOException { IOUtils.close(log, activeLogChannel); }

Target:
public void close() throws IOException { if (activeLogChannel != null) { activeLogChannel.close(); } }
Source:
private static List<TableDescriptor> getTablesInSchema(DataDictionary dataDictionary, Connection connection, String schemaId) throws SQLException, StandardException { PreparedStatement statement = connection.prepareStatement(sqlGetTablesInSchema); statement.setString(1, schemaId); ResultSet resultSet = statement.executeQuery(); List<TableDescriptor> tableDescriptors = new ArrayList<>(); while(resultSet.next()) { tableDescriptors.add(dataDictionary.getTableDescriptor(new BasicUUID(resultSet.getString(1)))); } return tableDescriptors; }

Target:
private static List<TableDescriptor> getTablesInSchema(DataDictionary dataDictionary, Connection connection, String schemaId) throws SQLException, StandardException { try(PreparedStatement statement = connection.prepareStatement(sqlGetTablesInSchema)) { statement.setString(1, schemaId); try (ResultSet resultSet = statement.executeQuery()) { List<TableDescriptor> tableDescriptors = new ArrayList<>(); while (resultSet.next()) { tableDescriptors.add(dataDictionary.getTableDescriptor(new BasicUUID(resultSet.getString(1)))); } return tableDescriptors; } } }
Source:
public void setNull(long columnIndex) { RealmFieldType columnType = getColumnType(columnIndex); if (columnType == RealmFieldType.STRING) { if (!this.getTable().isColumnNullable(columnIndex)) { throw new IllegalArgumentException("field is not nullable"); } super.setString(columnIndex, null); } else if (columnType == RealmFieldType.BINARY) { super.setBinaryByteArray(columnIndex, null); } else { if (!this.getTable().isColumnNullable(columnIndex)) { throw new IllegalArgumentException("field is not nullable"); } super.setNull(columnIndex); } }

Target:
public void setNull(long columnIndex) { RealmFieldType columnType = getColumnType(columnIndex); if (columnType == RealmFieldType.BINARY) { super.setBinaryByteArray(columnIndex, null); } else { super.setNull(columnIndex); } }
Source:
public PageFunctionCompiler(Metadata metadata, CompilerConfig config) { this(metadata, config.isExpressionCacheEnabled()); }

Target:
public PageFunctionCompiler(Metadata metadata, CompilerConfig config) { this(metadata, requireNonNull(config, "config is null").getExpressionCacheSize()); }
Source:
public GetTrackerDataResponse getTrackerDataForDates(@Valid final List<String> dateStrings, @Scope({OAuthScope.API_INTERNAL_DATA_READ}) final AccessToken accessToken) { if(dateStrings.size() > 31 || dateStrings.size() == 0){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } final Map<DateTime, String> dateToStringMapping = new HashMap<DateTime, String>(); for(final String dateString:dateStrings){ try { dateToStringMapping.put(DateTime.parse(dateString, DateTimeFormat.forPattern(DateTimeFormatString.FORMAT_TO_DAY)), dateString); }catch (IllegalArgumentException iae){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } } try { final ImmutableMap<DateTime, List<TrackerMotion>> result = this.trackerMotionDAODynamoDB.getTrackerMotionForDates(accessToken.accountId, dateToStringMapping.keySet()); final Map<String, List<TrackerMotion>> convertedResult = new HashMap<String, List<TrackerMotion>>(); for (final DateTime date : result.keySet()) { if (dateToStringMapping.containsKey(date)) { convertedResult.put(dateToStringMapping.get(date), result.get(date)); } } final GetTrackerDataResponse response = new GetTrackerDataResponse(convertedResult); return response; }catch (AmazonServiceException ase){ throw new WebApplicationException(Response.serverError().build()); } }

Target:
public GetTrackerDataResponse getTrackerDataForDates(@Valid final List<String> dateStrings, @Scope({OAuthScope.API_INTERNAL_DATA_READ}) final AccessToken accessToken) { if(dateStrings.size() > 31 || dateStrings.size() == 0){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } final Map<DateTime, String> dateToStringMapping = new HashMap<DateTime, String>(); for(final String dateString:dateStrings){ try { dateToStringMapping.put(DateTime.parse(dateString, DateTimeFormat.forPattern(DateTimeFormatString.FORMAT_TO_DAY)), dateString); }catch (IllegalArgumentException iae){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } } try { final ImmutableMap<DateTime, List<TrackerMotion>> result = this.trackerMotionDAODynamoDB.getTrackerMotionForDates(accessToken.accountId, dateToStringMapping.keySet()); final Map<String, List<TrackerMotion>> convertedResult = new HashMap<String, List<TrackerMotion>>(); for (final DateTime date : result.keySet()) { if (dateToStringMapping.containsKey(date)) { convertedResult.put(dateToStringMapping.get(date), result.get(date)); } } final GetTrackerDataResponse response = new GetTrackerDataResponse(convertedResult); return response; }catch (AmazonServiceException ase){ LOGGER.error("Amazon Service error: {}", ase.getErrorMessage()); throw new WebApplicationException(Response.serverError().build()); } }
Source:
public CommandExecutor() { try { context.registerFunction("bindingResult", CommandUtils.class.getDeclaredMethod("getBindingResult")); context.registerFunction("call", Command.class.getDeclaredMethod("newInstance", String.class, String[].class)); } catch (NoSuchMethodException ex) { throw new BeanInitializationException("Unable to register SpEL functions", ex); } try (InputStream in = getClass().getClassLoader().getResourceAsStream("component/plugins/digitalExchange/commands.xml")) { commands = JAXB.unmarshal(in, Commands.class); } catch (IOException ex) { throw new BeanInitializationException("Unable to load installation commands", ex); } }

Target:
public CommandExecutor() { try { context.registerFunction("bindingResult", CommandUtils.class.getDeclaredMethod("getBindingResult")); context.registerFunction("call", Command.class.getDeclaredMethod("newInstance", String.class, String[].class)); } catch (NoSuchMethodException ex) { throw new BeanInitializationException("Unable to register SpEL functions", ex); } try (InputStream in = getClass().getClassLoader().getResourceAsStream("component/plugins/digitalExchange/commands.xml")) { if(in == null) { throw new BeanInitializationException("Unable to load installation commands. File commands.xml not found"); } commands = JAXB.unmarshal(in, Commands.class); } catch (IOException ex) { throw new BeanInitializationException("Unable to load installation commands", ex); } }
Source:
public static long getDuration(File file) { MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); mediaMetadataRetriever.setDataSource(file.getAbsolutePath()); String durationStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); return Long.parseLong(durationStr); }

Target:
public static long getDuration(File file) { try { MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); mediaMetadataRetriever.setDataSource(file.getAbsolutePath()); String durationStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); return Long.parseLong(durationStr); } catch (Exception e) { Logger.exception("Exception while trying to get duration of a media file", e); return -1; } }
Source:
public void testExtraSessionsNotCreated() throws Exception { Callback c = (request, response) -> { response.getWriter().write("done"); }; servlet.getServletContext().setAttribute("callback", c); WebConversation wc = new WebConversation(); WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port)); req.setParameter("cmd", QueryCommand.CALLBACK.name()); req.setParameter("param", "callback"); WebResponse response = wc.getResponse(req); assertThat(response.getText()).isEqualTo("done"); assertThat(region.size()).as("The region should be empty").isEqualTo(1); }

Target:
public void testExtraSessionsNotCreated() throws Exception { Callback c = (request, response) -> { response.getWriter().write("done"); }; servlet.getServletContext().setAttribute("callback", c); WebConversation wc = new WebConversation(); WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port)); req.setParameter("cmd", QueryCommand.CALLBACK.name()); req.setParameter("param", "callback"); WebResponse response = wc.getResponse(req); assertThat(response.getText()).isEqualTo("done"); assertThat(region.size()).as("The region should contain one entry").isEqualTo(1); }
Source:
static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { logger.entering(SQLiteWrapperUtils.class.getCanonicalName(),"getDataRow",stmt); Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }

Target:
static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { logger.entering("com.cloudant.sync.sqlite.sqlite4java.SQLiteWrapperUtils","getDataRow",stmt); Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }
Source:
protected void restartMining() { Block newMiningBlock = getNewBlockForMining(); synchronized(this) { cancelCurrentBlock(); miningBlock = newMiningBlock; if (externalMiner != null) { currentMiningTasks.add(externalMiner.mine(cloneBlock(miningBlock))); } if (isLocalMining) { MinerIfc localMiner = config.getBlockchainConfig() .getConfigForBlock(miningBlock.getNumber()) .getMineAlgorithm(config); if (localMiner instanceof EthashMiner) { Set<EthashMinerListener> ethashMinerListeners = listeners.stream() .filter(listener -> listener instanceof EthashMinerListener) .map(listener -> (EthashMinerListener) listener) .collect(Collectors.toSet()); ((EthashMiner) localMiner).setListeners(ethashMinerListeners); } currentMiningTasks.add(localMiner.mine(cloneBlock(miningBlock))); } for (final ListenableFuture<MiningResult> task : currentMiningTasks) { task.addListener(() -> { try { final Block minedBlock = task.get().block; blockMined(minedBlock); } catch (InterruptedException | CancellationException e) { } catch (Exception e) { logger.warn("Exception during mining: ", e); } }, MoreExecutors.directExecutor()); } } fireBlockStarted(newMiningBlock); logger.debug("New block mining started: {}", newMiningBlock.getShortHash()); }

Target:
protected void restartMining() { Block newMiningBlock = getNewBlockForMining(); synchronized(this) { cancelCurrentBlock(); miningBlock = newMiningBlock; if (externalMiner != null) { externalMiner.setListeners(listeners); currentMiningTasks.add(externalMiner.mine(cloneBlock(miningBlock))); } if (isLocalMining) { MinerIfc localMiner = config.getBlockchainConfig() .getConfigForBlock(miningBlock.getNumber()) .getMineAlgorithm(config); localMiner.setListeners(listeners); currentMiningTasks.add(localMiner.mine(cloneBlock(miningBlock))); } for (final ListenableFuture<MiningResult> task : currentMiningTasks) { task.addListener(() -> { try { final Block minedBlock = task.get().block; blockMined(minedBlock); } catch (InterruptedException | CancellationException e) { } catch (Exception e) { logger.warn("Exception during mining: ", e); } }, MoreExecutors.directExecutor()); } } fireBlockStarted(newMiningBlock); logger.debug("New block mining started: {}", newMiningBlock.getShortHash()); }
Source:
public static AddonArchive getDeployment() { AddonArchive archive = ShrinkWrap .create(AddonArchive.class) .addBeansXML() .addAsAddonDependencies( AddonDependencyEntry.create("org.jboss.forge.addon:ui"), AddonDependencyEntry.create("org.jboss.forge.addon:shell-test-harness"), AddonDependencyEntry.create("org.jboss.forge.addon:resources"), AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi") ); return archive; }

Target:
public static AddonArchive getDeployment() { return ShrinkWrap .create(AddonArchive.class) .addBeansXML(); }
Source:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int datasourceId = params.getRequiredParamInt(StatisticsHelper.PARAM_DATASOURCE_ID); StatisticalDatasourcePlugin datasource = StatisticalDatasourcePluginManager.getInstance().getPlugin(datasourceId); if(datasource == null) { throw new ActionParamsException("Invalid datasource:" + datasourceId); } if(!datasource.canModify(params.getUser())) { throw new ActionDeniedException("User doesn't have permission to modify datasource:" + datasourceId); } String id = params.getHttpParam(ActionConstants.PARAM_ID); StatisticalIndicator existingIndicator = null; if (id != null) { existingIndicator = datasource.getIndicator(params.getUser(), id); if(existingIndicator == null) { throw new ActionParamsException("Requested invalid indicator:" + id); } } StatisticalIndicator indicator = parseIndicator(params, existingIndicator); try { existingIndicator = datasource.saveIndicator(indicator, params.getUser()); } catch (Exception ex) { throw new ActionException("Couldn't save indicator", ex); } try { ResponseHelper.writeResponse(params, StatisticsHelper.toJSON(existingIndicator)); } catch (JSONException shouldNeverHappen) { ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("id", id)); } }

Target:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int datasourceId = params.getRequiredParamInt(StatisticsHelper.PARAM_DATASOURCE_ID); StatisticalDatasourcePlugin datasource = StatisticalDatasourcePluginManager.getInstance().getPlugin(datasourceId); if(datasource == null) { throw new ActionParamsException("Invalid datasource:" + datasourceId); } if(!datasource.canModify(params.getUser())) { throw new ActionDeniedException("User doesn't have permission to modify datasource:" + datasourceId); } String id = params.getHttpParam(ActionConstants.PARAM_ID); StatisticalIndicator indicator = parseIndicator(params, datasource); StatisticalIndicator savedIndicator; try { savedIndicator = datasource.saveIndicator(indicator, params.getUser()); } catch (Exception ex) { throw new ActionException("Couldn't save indicator", ex); } try { ResponseHelper.writeResponse(params, StatisticsHelper.toJSON(savedIndicator)); } catch (JSONException shouldNeverHappen) { ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("id", id)); } }
Source:
public void deconfigure() { }

Target:
public void deconfigure() throws CoreException { }
Source:
public boolean passes(final String scope) { if (skipTestScope && org.apache.maven.artifact.Artifact.SCOPE_TEST.equals(scope)) { return true; } if (skipProvidedScope && org.apache.maven.artifact.Artifact.SCOPE_PROVIDED.equals(scope)) { return true; } if (skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals(scope)) { return true; } if (skipRuntimeScope && org.apache.maven.artifact.Artifact.SCOPE_RUNTIME.equals(scope)) { return true; } return false; }

Target:
public boolean passes(final String scope) { if (skipTestScope && org.apache.maven.artifact.Artifact.SCOPE_TEST.equals(scope)) { return true; } if (skipProvidedScope && org.apache.maven.artifact.Artifact.SCOPE_PROVIDED.equals(scope)) { return true; } if (skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals(scope)) { return true; } if (skipRuntimeScope && org.apache.maven.artifact.Artifact.SCOPE_RUNTIME.equals(scope)) { return true; } if (skipRuntimeScope && skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals(SCOPE_RUNTIME_PLUS_SYSTEM)) { return true; } return false; }
Source:
public Map<WithSeq<Client>, PaxosUpdate> apply(Set<WithSeq<Client>> request) { Map<Client, Long> remoteRequest = request.stream() .collect(toMap(WithSeq::value, WithSeq::seq, Math::min)); SetMultimap<Client, PaxosValue> learnedValuesSince = delegate.getLearnedValuesSince(remoteRequest); Map<Client, NavigableMap<Long, PaxosValue>> results = KeyedStream.stream(learnedValuesSince.asMap()) .map(LearnedValuesSinceCoalescingFunction::toTreeMapBySeq) .collectToMap(); return KeyedStream.of(request) .map(clientWithSeq -> results.getOrDefault(clientWithSeq.value(), ImmutableSortedMap.of())) .map((clientWithSeq, paxosValuesByRound) -> paxosValuesByRound.tailMap(clientWithSeq.seq()).values()) .map(values -> new PaxosUpdate(ImmutableList.copyOf(values))) .collectToMap(); }

Target:
public Map<WithSeq<Client>, PaxosUpdate> apply(Set<WithSeq<Client>> request) { Map<Client, Long> remoteRequest = request.stream() .collect(toMap(WithSeq::value, WithSeq::seq, Math::min)); SetMultimap<Client, PaxosValue> learnedValuesSince = delegate.getLearnedValuesSince(remoteRequest); Map<Client, ImmutableSortedMap<Long, PaxosValue>> results = KeyedStream.stream(learnedValuesSince.asMap()) .map(LearnedValuesSinceCoalescingFunction::toNavigableMapBySeq) .collectToMap(); return KeyedStream.of(request) .map(clientWithSeq -> results.getOrDefault(clientWithSeq.value(), ImmutableSortedMap.of())) .map(LearnedValuesSinceCoalescingFunction::getPaxosValuesSinceSeq) .map(values -> new PaxosUpdate(ImmutableList.copyOf(values))) .collectToMap(); }
Source:
public T get(int index) { if ((index < 0) || (index >= length())) throw new IndexOutOfBoundsException("get(" + index + ")"); return trie.get(index + indexShift).get(); }

Target:
public T get(int index) { if ((index < 0) || (index >= length())) { throw new IndexOutOfBoundsException("get(" + index + ")"); } else { return trie.get(index + indexShift).get(); } }
Source:
public boolean isInCurrentMainProject(IRepositoryNode node) { if (node != null) { Project curP = getCurrentProject(); if (PluginChecker.isRefProjectLoaded()) { IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault() .getService(IReferencedProjectService.class); if (service != null && service.isMergeRefProject() && curP != null) { IRepositoryViewObject object = node.getObject(); if (object == null) { return true; } if (object.getId() != null && cachedObjects.containsKey(object.getId())) { return cachedObjects.get(object.getId()); } org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem()); org.talend.core.model.properties.Project curProject = curP.getEmfProject(); boolean ret = emfProject.equals(curProject); if (object.getId() != null) { cachedObjects.put(object.getId(), ret); } return ret; } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null) { return project.equals(curP); } else { return true; } } } } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null && curP != null) { return project.getTechnicalLabel().equals(curP.getTechnicalLabel()); } else { return true; } } } } return false; }

Target:
public boolean isInCurrentMainProject(IRepositoryNode node) { if (node != null) { Project curP = getCurrentProject(); if (PluginChecker.isRefProjectLoaded()) { IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault() .getService(IReferencedProjectService.class); if (service != null && service.isMergeRefProject() && curP != null) { IRepositoryViewObject object = node.getObject(); if (object == null) { return true; } if (cachedObjects.containsKey(object)) { return cachedObjects.get(object); } org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem()); org.talend.core.model.properties.Project curProject = curP.getEmfProject(); boolean ret = emfProject.equals(curProject); cachedObjects.put(object, ret); return ret; } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null) { return project.equals(curP); } else { return true; } } } } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null && curP != null) { return project.getTechnicalLabel().equals(curP.getTechnicalLabel()); } else { return true; } } } } return false; }
Source:
public Collection<String> getReviewUrls(String taskUrl) { List<String> reviewUrls = taskReviewsMap.get(taskUrl); if (reviewUrls == null) { return Collections.emptyList(); } return reviewUrls; }

Target:
public Collection<String> getReviewUrls(String taskUrl) { return taskReviewsMap.get(taskUrl); }
Source:
void clearNotification(@NotificationId final int id) { mNotificationManager.cancel(null , id); }

Target:
private void clearNotification(@NotificationId final int id) { mNotificationManager.cancel(null , id); }
Source:
public Iterable<Commit> log() throws IOException { final Iterator<Commit> iterator = this.origin.log().iterator(); return new Iterable<Commit>() { private final transient Time current = new Time(); @Override public Iterator<Commit> iterator() { return Iterators.filter( iterator, new Predicate<Commit>() { @Override public boolean apply(final Commit commit) { return Seasoned.this.isBefore(commit, current); } } ); } @Override public String toString() { return "Seasoned commits"; } }; }

Target:
public Iterable<Commit> log() throws IOException { final Time current = new Time(); return Iterables.filter( this.origin.log(), new Predicate<Commit>() { @Override public boolean apply(final Commit commit) { return Seasoned.this.isBefore(commit, current); } } ); }
Source:
private void auditVmOnRebooting() { AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), getVmId())); logable.addCustomValue("UserName", String.format("%s", dbVm.getConsoleCurrentUserName())); auditLog(logable, AuditLogType.USER_REBOOT_VM); }

Target:
private void auditVmOnRebooting() { AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), getVmId())); logable.addCustomValue("UserName", "Guest OS"); auditLog(logable, AuditLogType.USER_REBOOT_VM); }
Source:
private String getString(String param) { return Constant.messages.getString(MESSAGE_PREFIX + param); }

Target:
private static String getString(String param) { return Constant.messages.getString(MESSAGE_PREFIX + param); }
Source:
private Map<String, String> toMachineAttributes( String pluginId, Map<String, String> wsAttributes) { String pluginComponentAliases = wsAttributes.get(PLUGINS_COMPONENTS_ALIASES_WORKSPACE_ATTRIBUTE); String editorComponentAlias = wsAttributes.get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE); List<String> aliases = new ArrayList<>(); if (!isNullOrEmpty(pluginComponentAliases)) { aliases.addAll(asList(pluginComponentAliases.split(","))); } if (!isNullOrEmpty(editorComponentAlias)) { aliases.add(editorComponentAlias); } if (!aliases.isEmpty()) { return aliases .stream() .map(value -> value.split("=")) .filter(arr -> arr[0].equals(pluginId)) .map(arr -> arr[1]) .collect(toMap(alias -> DEVFILE_COMPONENT_ALIAS_ATTRIBUTE, Function.identity())); } return null; }

Target:
private Map<String, String> toMachineAttributes( String pluginId, Map<String, String> wsAttributes) { Map<String, String> attributes = new HashMap<>(); Optional<String> pluginAlias = findPluginAlias(pluginId, wsAttributes); pluginAlias.ifPresent(s -> attributes.put(DEVFILE_COMPONENT_ALIAS_ATTRIBUTE, s)); return attributes; }
Source:
public static boolean isNormalSequence(final String s) { if (s.length() == 0) { return false; } for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch == A || ch == T || ch == C || ch == G || ch == a || ch == t || ch == c || ch == g || ch == n || ch == N) { ; } else { return false; } } return true; }

Target:
public static boolean isNormalSequence(final String s) { if (s == null || s.length() == 0) { return false; } for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch == A || ch == T || ch == C || ch == G || ch == a || ch == t || ch == c || ch == g || ch == n || ch == N) { ; } else { return false; } } return true; }
Source:
default ProjectedTimeDimension toProjectedDimension(final TimeGrainDefinition requestedGrain) { TimeZone requestedTimeZone = getTimeZone(); String name = getName(); return new ProjectedTimeDimension() { @Override public TimeZone getTimeZone() { return requestedTimeZone; } @Override public TimeGrainDefinition getTimeGrain() { return requestedGrain; } @Override public String getName() { return name; } }; }

Target:
default TimeDimensionProjection toProjectedDimension(final TimeGrainDefinition requestedGrain) { Preconditions.checkArgument(getSupportedGrains().contains(requestedGrain)); TimeZone requestedTimeZone = getTimeZone(); String name = getName(); return new TimeDimensionProjection() { @Override public TimeZone getTimeZone() { return requestedTimeZone; } @Override public TimeGrainDefinition getTimeGrain() { return requestedGrain; } @Override public String getName() { return name; } }; }
Source:
public void addContainer(final UUID uuid, final ContainerID containerId) throws NodeNotFoundException { if (!nodeToContainer.containsKey(uuid)) { throw new NodeNotFoundException("Node UUID: " + uuid); } nodeToContainer.get(uuid).add(containerId); }

Target:
public void addContainer(final UUID uuid, final ContainerID containerId) throws NodeNotFoundException { lock.writeLock().lock(); try { checkIfNodeExist(uuid); nodeToContainer.get(uuid).add(containerId); } finally { lock.writeLock().unlock(); } }
Source:
public void testDescribeWithTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); Timestamp stamp = Timestamp.now(); client.add("title", "Person"); String[] expecteds = {"address", "name"}; Set<String> actuals = client.describe(stamp); Assert.assertArrayEquals(expecteds, actuals.toArray(new String[actuals.size()])); }

Target:
public void testDescribeWithTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); Timestamp stamp = Timestamp.now(); client.add("title", "Person"); Set<String> expecteds = Sets.newHashSet(); expecteds.add("name"); expecteds.add("address"); Set<String> actuals = client.describe(stamp); Assert.assertEquals(expecteds, actuals); }
Source:
public SmallIntSet(Set<Integer> set) { if (set instanceof SmallIntSet) { BitSet bitSet = ((SmallIntSet) set).bitSet; this.bitSet = new BitSet(bitSet.size()); this.bitSet.or(bitSet); } else if (set instanceof IntSet) { this.bitSet = new BitSet(); ((IntSet) set).iterator().forEachRemaining((IntConsumer) bitSet::set); } else { bitSet = new BitSet(set.size()); set.forEach(bitSet::set); } }

Target:
public SmallIntSet(Set<Integer> set) { if (set instanceof SmallIntSet) { BitSet bitSet = ((SmallIntSet) set).bitSet; this.bitSet = new BitSet(bitSet.size()); this.bitSet.or(bitSet); } else if (set instanceof IntSet) { this.bitSet = new BitSet(); ((IntSet) set).forEach((IntConsumer) bitSet::set); } else { bitSet = new BitSet(set.size()); set.forEach(bitSet::set); } }
Source:
public Optional<Instant> nextRun(final Optional<Instant> lastRun) { final Instant now = _clock.instant(); final Instant start = lastRun .filter(run -> run.isAfter(now)) .orElse(now) .plus(_fullPeriod); final long excessMillis = start.toEpochMilli() % _fullPeriod.toMillis(); return Optional.of(start.minusMillis(excessMillis)); }

Target:
public Optional<Instant> nextRun(final Optional<Instant> lastRun) { final Instant now = _clock.instant(); final Instant nextRun = truncateToPeriod(now).plus(_fullPeriod); lastRun.ifPresent(run -> checkForSkippedPeriods(run, nextRun)); return Optional.of(nextRun); }
Source:
public <E> void assertNoneSatisfy(AssertionInfo info, Iterable<? extends E> actual, Consumer<? super E> requirements) { assertNotNull(info, actual); requireNonNull(requirements, "The Consumer<T> expressing the assertions requirements must not be null"); boolean nonMatch = stream(actual.spliterator(), false).noneMatch(e -> { try { requirements.accept(e); } catch (AssertionError ex) { return false; } return true; }); if (!nonMatch) { throw failures.failure(info, noneElementsShouldSatisfy(actual)); } }

Target:
public <E> void assertNoneSatisfy(AssertionInfo info, Iterable<? extends E> actual, Consumer<? super E> requirements) { assertNotNull(info, actual); requireNonNull(requirements, "The Consumer<T> expressing the assertions requirements must not be null"); for(E element : actual) { try { requirements.accept(element); } catch(AssertionError e) { return; } } throw failures.failure(info, noElementsShouldSatisfy(actual)); }
Source:
private void resetToolBarsCActions(List<Action> actions) { Map<String,CLocation> lastToolBarLocation = new HashMap<String, CLocation>(); ToolBarActions toolBarCActions = new ToolBarActions(); toolBarCActions.setActions(actions); List<CAction> rootActions = toolBarCActions.getCustomActions(); Map<String,CAction> actionMap = new HashMap<String, CAction>(rootActions.size()); List<String> generatedId = new LinkedList(); for(CAction action : rootActions) { if(action instanceof CActionHolder) { String key = ActionTools.getMenuId(((CActionHolder) action).getAction()); actionMap.put(key,action); generatedId.add(key); } else { } } for(ToolBarItem item : getToolBarItems()) { String shownRootMenuId = ActionTools.getMenuId(item.getAction()); CAction newCAction = actionMap.get(shownRootMenuId); if(newCAction==null) { commonControl.removeSingleDockable(shownRootMenuId); } else { generatedId.remove(shownRootMenuId); item.setItem(newCAction); } } for(String newActionId : generatedId) { CAction newCAction = actionMap.get(newActionId); Action action = ((CActionHolder)newCAction).getAction(); String logicalGroup = ActionTools.getLogicalGroup(action); CLocation defaultLocation = getDefaultLocation(lastToolBarLocation, logicalGroup); lastToolBarLocation.put(logicalGroup,defaultLocation); addToolbarItem(newCAction, action, defaultLocation); } }

Target:
private void resetToolBarsCActions(List<Action> actions) { Map<String,CLocation> lastToolBarLocation = new HashMap<String, CLocation>(); ToolBarActions toolBarCActions = new ToolBarActions(); toolBarCActions.setActions(actions); List<CAction> rootActions = toolBarCActions.getCustomActions(); Map<String,CAction> actionMap = new HashMap<String, CAction>(rootActions.size()); Set<String> generatedId = new LinkedHashSet<String>(); for(CAction action : rootActions) { if(action instanceof CActionHolder) { String key = ActionTools.getMenuId(((CActionHolder) action).getAction()); actionMap.put(key,action); generatedId.add(key); } else { } } for(ToolBarItem item : getToolBarItems()) { String shownRootMenuId = ActionTools.getMenuId(item.getAction()); CAction newCAction = actionMap.get(shownRootMenuId); if(newCAction==null) { commonControl.removeSingleDockable(shownRootMenuId); } else { generatedId.remove(shownRootMenuId); item.setItem(newCAction); } } for(String newActionId : generatedId) { CAction newCAction = actionMap.get(newActionId); Action action = ((CActionHolder)newCAction).getAction(); String logicalGroup = ActionTools.getLogicalGroup(action); CLocation defaultLocation = getDefaultLocation(lastToolBarLocation, logicalGroup); lastToolBarLocation.put(logicalGroup,defaultLocation); addToolbarItem(newCAction, action, defaultLocation); } }
Source:
public ContentValues getContentValues(Externalizable e) throws StorageFullException { boolean encrypt = e instanceof EncryptedModel; ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream out = bos; try { e.writeExternal(new DataOutputStream(out)); out.close(); } catch (IOException e1) { e1.printStackTrace(); throw new RuntimeException("Failed to serialize externalizable for content values"); } byte[] blob = bos.toByteArray(); ContentValues values = new ContentValues(); if(e instanceof IMetaData) { IMetaData m = (IMetaData)e; for(String key : m.getMetaDataFields()) { Object o = m.getMetaData(key); if(o == null ) { continue;} String value = o.toString(); values.put(TableBuilder.scrubName(key), value); } } if(blob.length > 1000000){ throw new StorageFullException("You tried to restore some data sized " + (blob.length / 1000000) + " MB which exceeds" + "the maximum allowed size of 1MB. Please reduce the size of this fixture."); } values.put(DbUtil.DATA_COL,blob); return values; }

Target:
public ContentValues getContentValues(Externalizable e) throws RecordTooLargeException { boolean encrypt = e instanceof EncryptedModel; ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream out = bos; try { e.writeExternal(new DataOutputStream(out)); out.close(); } catch (IOException e1) { e1.printStackTrace(); throw new RuntimeException("Failed to serialize externalizable for content values"); } byte[] blob = bos.toByteArray(); ContentValues values = new ContentValues(); if(e instanceof IMetaData) { IMetaData m = (IMetaData)e; for(String key : m.getMetaDataFields()) { Object o = m.getMetaData(key); if(o == null ) { continue;} String value = o.toString(); values.put(TableBuilder.scrubName(key), value); } } if(blob.length > Math.pow(1024, 2)){ throw new RecordTooLargeException(blob.length / Math.pow(1024, 2)); } values.put(DbUtil.DATA_COL,blob); return values; }
Source:
public Response refreshPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_PLUGIN_NAME) final String pluginName, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException { final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createContext(createdBy, reason, comment, request); final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), callContext); paymentApi.refreshPaymentMethods(account, pluginName, pluginProperties, callContext); return Response.status(Status.OK).build(); }

Target:
public Response refreshPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_PLUGIN_NAME) final String pluginName, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException { final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createContext(createdBy, reason, comment, request); final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), callContext); if (pluginName != null && !pluginName.isEmpty()) { paymentApi.refreshPaymentMethods(account, pluginName, pluginProperties, callContext); } else { paymentApi.refreshPaymentMethods(account, pluginProperties, callContext); } return Response.status(Status.OK).build(); }