auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ExtensionProxy initialize(String extensionName) { ExtensionEntry entry = loadedEntries.get(extensionName); if (entry == null) { throw new RuntimeException(String.format("No extensioned with instance name %1$s could be found", extensionName)); } try { ExtMap output = entry.extension.invoke( new ExtMap().mput( Base.InvokeKeys.COMMAND, Base.InvokeCommands.INITIALIZE ) ); } catch (Exception ex) { log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.name, ex.getMessage() ) ); if (log.isDebugEnabled()) { log.debug(ex.toString(), ex); } throw new RuntimeException(ex); } entry.initialized = true; initializedEntries.put(extensionName, entry); synchronized (globalContext) { globalContext.<List<ExtMap>> get(Base.GlobalContextKeys.EXTENSIONS).add( new ExtMap().mput( Base.ExtensionRecord.INSTANCE_NAME, entry.extension.getContext().get(Base.ContextKeys.INSTANCE_NAME) ).mput( Base.ExtensionRecord.PROVIDES, entry.extension.getContext().get(Base.ContextKeys.PROVIDES) ).mput( Base.ExtensionRecord.EXTENSION, entry.extension.getExtension() ).mput( Base.ExtensionRecord.CONTEXT, entry.extension.getContext() ) ); } dumpConfig(entry.extension); setChanged(); notifyObservers(); return entry != null ? entry.extension : null; }

Target:
public ExtensionProxy initialize(String extensionName) { ExtensionEntry entry = loadedEntries.get(extensionName); if (entry == null) { throw new RuntimeException(String.format("No extensioned with instance name %1$s could be found", extensionName)); } try { ExtMap output = entry.extension.invoke( new ExtMap().mput( Base.InvokeKeys.COMMAND, Base.InvokeCommands.INITIALIZE ) ); } catch (Exception ex) { log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.name, ex.getMessage() ) ); if (log.isDebugEnabled()) { log.debug(ex.toString(), ex); } throw new RuntimeException(ex); } entry.initialized = true; initializedEntries.put(extensionName, entry); synchronized (globalContext) { globalContext.<List<ExtMap>> get(Base.GlobalContextKeys.EXTENSIONS).add( new ExtMap().mput( Base.ExtensionRecord.INSTANCE_NAME, entry.extension.getContext().get(Base.ContextKeys.INSTANCE_NAME) ).mput( Base.ExtensionRecord.PROVIDES, entry.extension.getContext().get(Base.ContextKeys.PROVIDES) ).mput( Base.ExtensionRecord.EXTENSION, entry.extension.getExtension() ).mput( Base.ExtensionRecord.CONTEXT, entry.extension.getContext() ) ); } setChanged(); notifyObservers(); return entry != null ? entry.extension : null; }
Source:
public static void checkTriggers(final Calendar cal) { Jenkins inst = Jenkins.getInstance(); SCMTrigger.DescriptorImpl scmd = inst.getDescriptorByType(SCMTrigger.DescriptorImpl.class); if (scmd.synchronousPolling) { LOGGER.fine("using synchronous polling"); if (previousSynchronousPolling == null || previousSynchronousPolling.isDone()) { previousSynchronousPolling = scmd.getExecutor().submit(new DependencyRunner(new ProjectRunnable() { public void run(AbstractProject p) { for (Trigger t : (Collection<Trigger>) p.getTriggers().values()) { if (t instanceof SCMTrigger) { LOGGER.fine("synchronously triggering SCMTrigger for project " + t.job.getName()); t.run(); } } } })); } else { LOGGER.fine("synchronous polling has detected unfinished jobs, will not trigger additional jobs."); } } for (ParameterizedJobMixIn.ParameterizedJob p : inst.getAllItems(ParameterizedJobMixIn.ParameterizedJob.class)) { for (Trigger t : p.getTriggers().values()) { if (t !=null && t.spec != null && t.tabs != null) { if (!(t instanceof SCMTrigger && scmd.synchronousPolling)) { LOGGER.log(Level.FINE, "cron checking {0} with spec ‘{1}’", new Object[]{p, t.spec.trim()}); if (t.tabs.check(cal)) { LOGGER.log(Level.CONFIG, "cron triggered {0}", p); try { t.run(); } catch (Throwable e) { LOGGER.log(Level.WARNING, t.getClass().getName() + ".run() failed for " + p, e); } } else { LOGGER.log(Level.FINER, "did not trigger {0}", p); } } } else { LOGGER.log(Level.WARNING, "The job {0} has a syntactically incorrect config and is missing the cron spec for a trigger", p.getFullName()); } } } }

Target:
public static void checkTriggers(final Calendar cal) { Jenkins inst = Jenkins.getInstance(); SCMTrigger.DescriptorImpl scmd = inst.getDescriptorByType(SCMTrigger.DescriptorImpl.class); if (scmd.synchronousPolling) { LOGGER.fine("using synchronous polling"); if (previousSynchronousPolling == null || previousSynchronousPolling.isDone()) { previousSynchronousPolling = scmd.getExecutor().submit(new DependencyRunner(new ProjectRunnable() { public void run(AbstractProject p) { for (Trigger t : (Collection<Trigger>) p.getTriggers().values()) { if (t instanceof SCMTrigger) { LOGGER.fine("synchronously triggering SCMTrigger for project " + t.job.getName()); t.run(); } } } })); } else { LOGGER.fine("synchronous polling has detected unfinished jobs, will not trigger additional jobs."); } } for (ParameterizedJobMixIn.ParameterizedJob p : inst.getAllItems(ParameterizedJobMixIn.ParameterizedJob.class)) { for (Trigger t : p.getTriggers().values()) { if (!(t instanceof SCMTrigger && scmd.synchronousPolling)) { if (t !=null && t.spec != null && t.tabs != null) { LOGGER.log(Level.FINE, "cron checking {0} with spec ‘{1}’", new Object[]{p, t.spec.trim()}); if (t.tabs.check(cal)) { LOGGER.log(Level.CONFIG, "cron triggered {0}", p); try { t.run(); } catch (Throwable e) { LOGGER.log(Level.WARNING, t.getClass().getName() + ".run() failed for " + p, e); } } else { LOGGER.log(Level.FINER, "did not trigger {0}", p); } } else { LOGGER.log(Level.WARNING, "The job {0} has a syntactically incorrect config and is missing the cron spec for a trigger", p.getFullName()); } } } } }
Source:
public Backup(String filePath, List<UUID> streamIDs, CorfuRuntime runtime) throws IOException { this.filePath = filePath; this.backupTempDirPath = Files.createTempDirectory(BACKUP_TEMP_DIR_PREFIX).toString(); this.streamIDs = streamIDs; this.runtime = runtime; this.timestamp = runtime.getAddressSpaceView().getLogTail(); }

Target:
public Backup(String filePath, List<UUID> streamIDs, CorfuRuntime runtime) throws IOException { this.filePath = filePath; this.backupTempDirPath = Files.createTempDirectory(BACKUP_TEMP_DIR_PREFIX).toString(); this.streamIDs = streamIDs; this.runtime = runtime; }
Source:
private void testExceptionCasesProcessResponse(RestMethod restMethod, RestResponseChannel restResponseChannel, BlobInfo blobInfo, RestServiceErrorCode expectedErrorCode) throws Exception { RestRequest restRequest = createRestRequest(restMethod, "/", null); SecurityServiceCallback callback = new SecurityServiceCallback(); securityService.processResponse(restRequest, restResponseChannel, blobInfo, callback); Assert.assertTrue("Callback should have been invoked", callback.callbackLatch.await(1, TimeUnit.SECONDS)); Assert.assertNotNull("Exception should have been thrown", callback.exception); RestServiceException re = (RestServiceException) callback.exception; Assert.assertEquals("Unexpected RestServerErrorCode (Callback)", expectedErrorCode, re.getErrorCode()); }

Target:
private void testExceptionCasesProcessResponse(RestMethod restMethod, RestResponseChannel restResponseChannel, BlobInfo blobInfo, RestServiceErrorCode expectedErrorCode) throws Exception { TestUtils.ThrowingConsumer<ExecutionException> errorAction = e -> { Assert.assertTrue("Exception should have been an instance of RestServiceException", e.getCause() instanceof RestServiceException); RestServiceException re = (RestServiceException) e.getCause(); Assert.assertEquals("Unexpected RestServerErrorCode (Future)", expectedErrorCode, re.getErrorCode()); }; RestRequest restRequest = createRestRequest(restMethod, "/", null); TestUtils.assertException(ExecutionException.class, () -> securityService.processResponse(restRequest, restResponseChannel, blobInfo).get(), errorAction); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_contact_us); send = findViewById(R.id.send); name = findViewById(R.id.name); subject = findViewById(R.id.subject); message = findViewById(R.id.message); send.setOnClickListener(v -> { String name_str = name.getText().toString(); String subject_str = subject.getText().toString(); String msg_str = message.getText().toString(); Intent sendMail = new Intent(Intent.ACTION_SEND); sendMail.putExtra(Intent.EXTRA_EMAIL, new String[]{"helpdesk@openmrs.com"}); sendMail.putExtra(Intent.EXTRA_SUBJECT, name_str + " wants to get in touch."); sendMail.putExtra(Intent.EXTRA_TEXT, "Regarding: " + subject_str + "\n" + msg_str); sendMail.setType("message/rfc822"); startActivity(Intent.createChooser(sendMail, "Choose an Email Client")); }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_contact_us); initViewFields(); send.setOnClickListener(v -> { String name_str = name.getText().toString(); String subject_str = subject.getText().toString(); String msg_str = message.getText().toString(); Intent sendMail = new Intent(Intent.ACTION_SEND); sendMail.putExtra(Intent.EXTRA_EMAIL, new String[]{"helpdesk@openmrs.com"}); sendMail.putExtra(Intent.EXTRA_SUBJECT, name_str + " wants to get in touch."); sendMail.putExtra(Intent.EXTRA_TEXT, "Regarding: " + subject_str + "\n" + msg_str); sendMail.setType("message/rfc822"); startActivity(Intent.createChooser(sendMail, "Choose an Email Client")); }); }
Source:
public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { if (!warned) { LOG.warn(gplLzoCodec + " is deprecated. You should use " + hadoopLzoCodec + " instead to generate LZO compressed data."); warned = true; } return super.createOutputStream(out, compressor); }

Target:
public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { if (warned.compareAndSet(false, true)) { LOG.warn("{} is deprecated. You should use instead to generate LZO compressed data.", gplLzoCodec, hadoopLzoCodec); } return super.createOutputStream(out, compressor); }
Source:
public void shutdown() { isShutdown.set(true); try { shutdownComplete.await(); log.info("Shutdown of AckManager complete"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }

Target:
public void shutdown() { isShutdown.set(true); try { consumerThread.join(); log.info("Shutdown of AckManager complete"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
Source:
private static BigInteger factorial(int n) { return Stream.rangeClosed(1, n) .map(BigInteger::valueOf) .fold(BigInteger.ONE, BigInteger::multiply); }

Target:
private static BigInteger factorial(int n) { return Stream.rangeClosed(1, n) .map(BigInteger::valueOf) .reduce(BigInteger::multiply); }
Source:
private void handleRequestError(int responseCode) { System.out.println("Request to " + urlCurrentlyRequestingFrom + " had error code response: " + responseCode); repeatRequestOrShowResults(true); }

Target:
private void handleRequestError(int responseCode) { Log.e(TAG, "Request to " + urlCurrentlyRequestingFrom + " in get available apps request " + "had error code response: " + responseCode); repeatRequestOrShowResults(true); }
Source:
private void parseResponseType() { Type returnType = method.getGenericReturnType(); if (returnType == void.class) { throw methodError("Service methods cannot return void."); } for (int i = 0, count = factories.size(); i < count; i++) { CallAdapter.Factory factory = factories.get(i); CallAdapter adapter = factory.get(returnType); if (adapter != null) { this.adapter = adapter; return; } } StringBuilder builder = new StringBuilder() .append("No registered call adapters were able to handle return type ") .append(returnType) .append(". Checked: [ "); for (int i = 0, count = factories.size(); i < count; i++) { if (i > 0) builder.append(", "); builder.append(factories.get(i).getClass().getSimpleName()); } builder.append(" ]"); throw methodError(builder.toString()); }

Target:
private void parseResponseType() { Type returnType = method.getGenericReturnType(); if (returnType == void.class) { throw methodError("Service methods cannot return void."); } for (int i = 0, count = factories.size(); i < count; i++) { CallAdapter.Factory factory = factories.get(i); CallAdapter adapter = factory.get(returnType); if (adapter != null) { this.adapter = adapter; return; } } throw methodError("No registered call adapters were able to handle return type " + returnType + ". Checked: " + factories); }
Source:
private Event stubEvent() { Event event = Event .newBuilder() .setMessage(AnyPacker.pack( ProjectCreated .newBuilder() .setProjectId(ProjectId.newBuilder() .setId(getClass().getName())) .build())) .build(); return event; }

Target:
private Event stubEvent() { ProjectId project = ProjectId .newBuilder() .setId(getClass().getName()) .build(); ProjectCreated message = ProjectCreated .newBuilder() .setProjectId(project) .build(); Event event = Event .newBuilder() .setMessage(AnyPacker.pack(message)) .build(); return event; }
Source:
public char[] getTextCharacters() { final StackElement stackElement = tokenStack.peek(); if (stackElement == null || stackElement.xmlEvent != XMLEvent.CHARACTERS) { throw new IllegalStateException(); } try { setXmlText(stackElement, jsonParser); return stackElement.value; } catch (IOException e) { throw new IllegalStateException(e); } }

Target:
public char[] getTextCharacters() { final StackElement stackElement = tokenStack.peek(); if (stackElement == null || stackElement.xmlEvent != XMLEvent.CHARACTERS) { throw new IllegalStateException(ERROR_MSG_NOT_IN_CHARACTERS); } try { setXmlText(stackElement, jsonParser); return stackElement.value; } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (getWorldGuard() == null) { msg("WorldGuard is not installed.", ChatColor.GRAY); return true; } if (!(args.length == 1)) { return false; } World world = Bukkit.getWorld(args[0]); if (world == null) { msg("World not found.", ChatColor.GRAY); return true; } if (world.equals(plugin.wm.adminworld.getWorld()) && !plugin.rm.getRank(sender).isAtLeast(Rank.SENIOR_ADMIN)) { msg("You do not have permission to wipe adminworld.", ChatColor.RED); return true; } RegionContainer container = getWorldGuard().getRegionContainer(); RegionManager rm = container.get(world); if (rm != null) { Map<String, ProtectedRegion> regions = rm.getRegions(); for (ProtectedRegion region : regions.values()) { rm.removeRegion(region.getId()); } FUtil.adminAction(sender.getName(), "Wiping regions for world: " + world.getName(), true); return true; } else { msg(ChatColor.RED + "There hasn't been any regions made for world \"" + world.getName() + "\"."); return true; } }

Target:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (getWorldGuard() == null) { msg("WorldGuard is not installed.", ChatColor.GRAY); return true; } if (args.length != 1) { return false; } World world = server.getWorld(args[0]); if (world == null) { msg("World : \"" + args[0] + "\" not found.", ChatColor.GRAY); return true; } if (world.equals(plugin.wm.adminworld.getWorld()) && !plugin.rm.getRank(sender).isAtLeast(Rank.SENIOR_ADMIN)) { msg("You do not have permission to wipe adminworld.", ChatColor.RED); return true; } RegionContainer container = getWorldGuard().getRegionContainer(); RegionManager rm = container.get(world); if (rm != null) { Map<String, ProtectedRegion> regions = rm.getRegions(); for (ProtectedRegion region : regions.values()) { rm.removeRegion(region.getId()); } FUtil.adminAction(sender.getName(), "Wiping regions for world: " + world.getName(), true); return true; } else { msg(ChatColor.RED + "No regions have been found for world: \"" + world.getName() + "\"."); return true; } }
Source:
public String defaultValue() { Node result = selectFrom("default", getNode()); if (result != null && !(result instanceof NullNode)) { if (result instanceof SYObjectNode) return result.toString(); if (result instanceof SimpleTypeNode) return ((SimpleTypeNode) result).getValue().toString(); } return null; }

Target:
public String defaultValue() { Node result = selectFrom("default", getNode()); if (result != null) { if (result instanceof SimpleTypeNode) return ((SimpleTypeNode) result).getValue().toString(); if (result instanceof SYObjectNode || result instanceof SYArrayNode) return JSonDumper.dump(result); } return null; }
Source:
private void sortPositions(int arrayLength, Comparator<Integer> comparator) { List<Integer> list = positions.subList(0, arrayLength); try { list.sort(comparator); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Lambda comparator violates the comparator contract"); } }

Target:
private void sortPositions(int arrayLength, Comparator<Integer> comparator) { List<Integer> list = positions.subList(0, arrayLength); try { list.sort(comparator); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Lambda comparator violates the comparator contract", e); } }
Source:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } final Player player = getPlayer(args[0]); if (player == null) { playerMsg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED); return true; } String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } FUtil.bcastMsg(player.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); try { plugin.web.undo(player, 15); } catch (NoClassDefFoundError ex) { } plugin.rb.rollback(player.getName()); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); targetPos.getWorld().strikeLightning(strike_pos); } } String ip = FUtil.getFuzzyIp(Ips.getIp(player)); final StringBuilder bcast = new StringBuilder() .append(ChatColor.RED) .append("sender.getName()") .append(" - ") .append("Banning: ") .append(player.getName()) .append(", IP: ") .append(ip); if (reason != null) { bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason); } FUtil.bcastMsg(bcast.toString()); plugin.bm.addBan(Ban.forPlayerFuzzy(player, sender, null, reason)); player.kickPlayer(ChatColor.RED + "GTFO"); return true; }

Target:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } final Player player = getPlayer(args[0]); if (player == null) { playerMsg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED); return true; } String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } FUtil.bcastMsg(player.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); try { plugin.web.undo(player, 15); } catch (NoClassDefFoundError ex) { } plugin.rb.rollback(player.getName()); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); targetPos.getWorld().strikeLightning(strike_pos); } } String ip = FUtil.getFuzzyIp(Ips.getIp(player)); final StringBuilder bcast = new StringBuilder() .append(ChatColor.RED) .append(sender.getName()) .append(" - ") .append("Banning: ") .append(player.getName()) .append(", IP: ") .append(ip); if (reason != null) { bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason); } FUtil.bcastMsg(bcast.toString()); plugin.bm.addBan(Ban.forPlayerFuzzy(player, sender, null, reason)); player.kickPlayer(ChatColor.RED + "GTFO"); return true; }
Source:
private Guid getVdsToRunOn(Iterable<VDS> vdss) { StringBuffer sb = new StringBuffer(); final List<VDS> readyToRun = new ArrayList<VDS>(); for (VDS curVds : vdss) { if (validateHostIsReadyToRun(curVds,sb) == ValidationResult.VALID) { readyToRun.add(curVds); } } if (readyToRun.isEmpty()) { log.info(sb.toString()); return Guid.Empty; } else { if (log.isDebugEnabled()) { log.debug(sb.toString()); } return getBestVdsToRun(readyToRun); } }

Target:
private Guid getVdsToRunOn(Iterable<VDS> vdss) { StringBuilder sb = new StringBuilder(); final List<VDS> readyToRun = new ArrayList<VDS>(); for (VDS curVds : vdss) { if (validateHostIsReadyToRun(curVds,sb) == ValidationResult.VALID) { readyToRun.add(curVds); } } if (readyToRun.isEmpty()) { log.info(sb.toString()); return Guid.Empty; } else { if (log.isDebugEnabled()) { log.debug(sb.toString()); } return getBestVdsToRun(readyToRun); } }
Source:
public Response authoriseSmartpayNotifications(String notification, @HeaderParam("X-Forwarded-For") String forwardedIpAddresses) { LOGGER.info(String.format("Received notification for provider %s IP '%s'", SMARTPAY.getName(), forwardedIpAddresses), kv("provider", SMARTPAY.getName()), kv("notification_source", forwardedIpAddresses)); if (!smartpayNotificationService.handleNotificationFor(notification, forwardedIpAddresses)) { logRejectionMessage(forwardedIpAddresses, SMARTPAY); return forbiddenErrorResponse(); } String response = "[accepted]"; logResponseMessage(response, SMARTPAY); return Response.ok(response).build(); }

Target:
public Response authoriseSmartpayNotifications(String notification, @HeaderParam("X-Forwarded-For") String forwardedIpAddresses) { LOGGER.info(String.format("Received notification for provider %s IP '%s'", SMARTPAY.getName(), forwardedIpAddresses), kv(PROVIDER, SMARTPAY.getName()), kv("notification_source", forwardedIpAddresses)); if (!smartpayNotificationService.handleNotificationFor(notification, forwardedIpAddresses)) { logRejectionMessage(forwardedIpAddresses, SMARTPAY); return forbiddenErrorResponse(); } String response = "[accepted]"; logResponseMessage(response, SMARTPAY); return Response.ok(response).build(); }
Source:
protected void prepareMetrics() { long now = System.currentTimeMillis(); if ((lastUpdate + minimumRefreshDelay) < now) { metricValues.set(updateFromZookeeper()); lastUpdate = now; recordValues(); } }

Target:
protected void prepareMetrics() { metricsValuesLock.lock(); try { long now = System.currentTimeMillis(); if ((lastUpdate + minimumRefreshDelay) < now) { metricValues = updateFromZookeeper(); lastUpdate = now; recordValues(); } } finally { metricsValuesLock.unlock(); } }
Source:
public void notifyCheckpointComplete(long checkpointId) { if (cancelAfterCheckpointId != null && cancelAfterCheckpointId == checkpointId) { cancel(); } }

Target:
public void notifyCheckpointComplete(long checkpointId) { if (cancelAfterCheckpointId != null && cancelAfterCheckpointId <= checkpointId) { cancel(); } }
Source:
public void clear() { super.clear(); map.clear(); }

Target:
public void clear() { map.clear(); updatedMap(); }
Source:
public void nonVmWithDefaultMTUAddedToNic() { Network net = createNetwork("VLanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("nonVmMtu5000"); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); nic.setNetworkName(newNet.getName()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan)); validateAndExpectViolation(helper, VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s(%s), %s(%d)]", newNet.getName(), "default", net.getName(), net.getMtu())); }

Target:
public void nonVmWithDefaultMTUAddedToNic() { Network net = createNetwork("vlanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); Network newNet = createNetwork("nonVmMtu5000"); newNet.setVmNetwork(false); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", null); VdsNetworkInterface nicWithVlan = createVlan(nic.getName(), net.getvlan_id(), net.getName()); nicWithVlan.setMtu(net.getMtu()); mockExistingIfaces(nic, nicWithVlan); nic.setNetworkName(newNet.getName()); SetupNetworksHelper helper = createHelper(createParametersForNics(nic, nicWithVlan)); validateAndExpectViolation(helper, VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s(%s), %s(%d)]", newNet.getName(), "default", net.getName(), net.getMtu())); }
Source:
public void test_sameAsPrevious() { BoundCurveInterpolator bci = CurveInterpolators.SQUARE_LINEAR.bind(X_DATA, Y_DATA, INT_EXTRAPOLATOR, INT_EXTRAPOLATOR); Extrapolator1D oldExtrap = Interpolator1DFactory.INTERPOLATOR_EXTRAPOLATOR_INSTANCE; Interpolator1D oldInterp = new SquareLinearInterpolator1D(); Interpolator1DDataBundle data = oldInterp.getDataBundle(X_DATA.toArray(), Y_DATA.toArray()); for (int i = 0; i < 100; i++) { final double x = RANDOM.nextDouble() * 5.0; if (x < 0 || x > 5.0) { assertEquals(bci.interpolate(x), oldExtrap.extrapolate(data, x, oldInterp), TOL); assertEquals(bci.firstDerivative(x), oldExtrap.firstDerivative(data, x, oldInterp), TOL); assertTrue(bci.parameterSensitivity(x).equalWithTolerance( DoubleArray.copyOf(oldExtrap.getNodeSensitivitiesForValue(data, x, oldInterp)), TOL)); } } }

Target:
public void test_sameAsPrevious() { BoundCurveInterpolator bci = CurveInterpolators.LOG_NATURAL_CUBIC_MONOTONE.bind(X_DATA, Y_DATA, INT_EXTRAPOLATOR, INT_EXTRAPOLATOR); Extrapolator1D oldExtrap = Interpolator1DFactory.INTERPOLATOR_EXTRAPOLATOR_INSTANCE; Interpolator1D oldInterp = new LogNaturalCubicMonotonicityPreservingInterpolator1D(); Interpolator1DDataBundle data = oldInterp.getDataBundle(X_DATA.toArray(), Y_DATA.toArray()); for (int i = 0; i < 100; i++) { final double x = RANDOM.nextDouble() * 20.0 - 10; if (x < 0 || x > 5.0) { assertEquals(bci.interpolate(x), oldExtrap.extrapolate(data, x, oldInterp), TOL); assertEquals(bci.firstDerivative(x), oldExtrap.firstDerivative(data, x, oldInterp), TOL); assertTrue(bci.parameterSensitivity(x).equalWithTolerance( DoubleArray.copyOf(oldExtrap.getNodeSensitivitiesForValue(data, x, oldInterp)), TOL)); } } }
Source:
public void testForConnection(String dbId) throws Exception { if (serverControls.containsKey(dbId)) { try { Server server = serverControls.get(dbId).getFirst(); server.checkRunning(true); } catch (Exception e) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, e.getMessage(), e); } } }

Target:
public void testForConnection(String dbId) throws Exception { Pair<Server, Thread> entry = serverControls.get(dbId); if (entry != null) { try { Server server = entry.getFirst(); server.checkRunning(true); } catch (Exception e) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, e.getMessage(), e); } } }
Source:
public String getTag() { return TAG; }

Target:
public String getTag() { return TAGS[0]; }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String fsname = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); String fsindexString = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_INDEX); Assumption.assertNotNull(fsindexString); int fsIndex = 0; try { fsIndex = Integer.parseInt(fsindexString); } catch (NumberFormatException e) { Assumption.fail("Invalid request parameter value for feedback session index: " + fsindexString); } Assumption.assertNotNull(fsname); instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId)); CourseRoster roster = new CourseRoster(logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); int numberOfPendingComments = logic.getCommentsForSendingState(courseId, CommentSendingState.PENDING).size() + logic.getFeedbackResponseCommentsForSendingState(courseId, CommentSendingState.PENDING).size(); FeedbackSessionResultsBundle bundle = getFeedbackResultBundle(courseId, fsname, roster); InstructorFeedbackResponseCommentsLoadPageData data = new InstructorFeedbackResponseCommentsLoadPageData( account, fsIndex, numberOfPendingComments, instructor, bundle); return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESPONSE_COMMENTS_LOAD, data); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String fsName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(fsName); String fsIndexString = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_INDEX); Assumption.assertNotNull(fsIndexString); int fsIndex = 0; try { fsIndex = Integer.parseInt(fsIndexString); } catch (NumberFormatException e) { Assumption.fail("Invalid request parameter value for feedback session index: " + fsIndexString); } instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId)); CourseRoster roster = new CourseRoster(logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); int numberOfPendingComments = logic.getCommentsForSendingState(courseId, CommentSendingState.PENDING).size() + logic.getFeedbackResponseCommentsForSendingState(courseId, CommentSendingState.PENDING).size(); FeedbackSessionResultsBundle bundle = getFeedbackResultBundle(courseId, fsName, roster); InstructorFeedbackResponseCommentsLoadPageData data = new InstructorFeedbackResponseCommentsLoadPageData( account, fsIndex, numberOfPendingComments, instructor, bundle); return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESPONSE_COMMENTS_LOAD, data); }
Source:
private void loadImage() { animator.setDisplayedChild(1); Picasso.with(this).load(image).fit().into(imageView, new EmptyCallback() { @Override public void onSuccess() { animator.setDisplayedChild(0); } }); }

Target:
private void loadImage() { animator.setDisplayedChild(1); Picasso.with(this).load(image).fit().centerInside().into(imageView, new EmptyCallback() { @Override public void onSuccess() { animator.setDisplayedChild(0); } }); }
Source:
private void checkClusterId(String clusterKey) throws DoNotRetryIOException { String peerClusterId = ""; try { Configuration peerConf = HBaseConfiguration.createClusterConf(conf, clusterKey); ZKWatcher zkWatcher = new ZKWatcher(peerConf, this + "check-peer-cluster-key", new Abortable() { @Override public void abort(String why, Throwable e) { } @Override public boolean isAborted() { return false; } }); peerClusterId = ZKClusterId.readClusterIdZNode(zkWatcher); } catch (IOException | KeeperException e) { throw new DoNotRetryIOException("Can't get peerClusterId for clusterKey=" + clusterKey, e); } if (clusterId.equals(peerClusterId)) { throw new DoNotRetryIOException("Invalid cluster key: " + clusterKey + ", should not replicate to itself for HBaseInterClusterReplicationEndpoint"); } }

Target:
private void checkClusterId(String clusterKey) throws DoNotRetryIOException { String peerClusterId = ""; try { Configuration peerConf = HBaseConfiguration.createClusterConf(conf, clusterKey); try (ZKWatcher zkWatcher = new ZKWatcher(peerConf, this + "check-peer-cluster-id", null)) { peerClusterId = ZKClusterId.readClusterIdZNode(zkWatcher); } } catch (IOException | KeeperException e) { throw new DoNotRetryIOException("Can't get peerClusterId for clusterKey=" + clusterKey, e); } if (clusterId.equals(peerClusterId)) { throw new DoNotRetryIOException("Invalid cluster key: " + clusterKey + ", should not replicate to itself for HBaseInterClusterReplicationEndpoint"); } }
Source:
public Object getPropertyValue(Object id) { if (sfName.equals(id)) { return getName(); } if (sfPath.equals(id)) { return getPath().toString(); } if (sfLocation.equals(id)) { return URIUtil.toUnencodedString(getLocation()); } if (sfIsLinked.equals(id)) { return Boolean.valueOf(getResource().isLinked()).toString(); } if (sfSourceLocation.equals(id)) { try { String sourceLocation = getElementUnderTraceFolder().getResource().getPersistentProperty(TmfCommonConstants.SOURCE_LOCATION); if (sourceLocation != null) { return sourceLocation; } } catch (CoreException e) { } return ""; } if (sfEventType.equals(id)) { if (getTraceType() != null) { if (getTraceType().startsWith(CustomTxtTrace.class.getCanonicalName())) { for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) { if (getTraceType().equals(CustomTxtTrace.class.getCanonicalName() + ":" + def.definitionName)) { return TmfTraceType.CUSTOM_TXT_CATEGORY + " : " + def.definitionName; } } } if (getTraceType().startsWith(CustomXmlTrace.class.getCanonicalName())) { for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) { if (getTraceType().equals(CustomXmlTrace.class.getCanonicalName() + ":" + def.definitionName)) { return TmfTraceType.CUSTOM_XML_CATEGORY + " : " + def.definitionName; } } } IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType()); return (ce != null) ? (getCategory(ce) + " : " + ce.getAttribute(TmfTraceType.NAME_ATTR)) : ""; } return ""; } Map<String, String> traceProperties = getTraceProperties(); if (id != null && !traceProperties.isEmpty()) { String key = (String) id; key = key.substring(this.getName().length() + 1); String value = traceProperties.get(key); return value; } return null; }

Target:
public Object getPropertyValue(Object id) { if (sfName.equals(id)) { return getName(); } if (sfPath.equals(id)) { return getPath().toString(); } if (sfLocation.equals(id)) { return URIUtil.toUnencodedString(getLocation()); } if (sfIsLinked.equals(id)) { return Boolean.valueOf(getResource().isLinked()).toString(); } if (sfSourceLocation.equals(id)) { try { String sourceLocation = getElementUnderTraceFolder().getResource().getPersistentProperty(TmfCommonConstants.SOURCE_LOCATION); if (sourceLocation != null) { return sourceLocation; } } catch (CoreException e) { } return ""; } if (sfTraceType.equals(id)) { if (getTraceType() != null) { TraceTypeHelper helper = TmfTraceType.getTraceTypeHelper(getTraceType()); if (helper != null) { return helper.getCategoryName() + " : " + helper.getName(); } } return ""; } Map<String, String> traceProperties = getTraceProperties(); if (id != null && !traceProperties.isEmpty()) { String key = (String) id; key = key.substring(this.getName().length() + 1); String value = traceProperties.get(key); return value; } return null; }
Source:
public static Map<String, List<String>> extractQueryString(final Http.Request httpRequest,final Set<String> ignoredParams) { Set<String> ignored = Optional.ofNullable(ignoredParams).orElseGet(HashSet::new); return httpRequest.queryString().entrySet().stream() .filter(stringEntry -> !ignored.contains(stringEntry.getKey())) .collect(toMap(Map.Entry::getKey, entry -> asList(entry.getValue()))); }

Target:
public static Map<String, List<String>> extractQueryString(final Http.Request httpRequest,final Set<String> ignoredParams) { return httpRequest.queryString().entrySet().stream() .filter(stringEntry -> !ignoredParams.contains(stringEntry.getKey())) .collect(toMap(Map.Entry::getKey, entry -> asList(entry.getValue()))); }
Source:
public PopupMenuSessionSearch(final HttpSessionsPanel httpSessionsPanel) { super(Constant.messages.getString("httpsessions.popup.find")); setHttpSessionsPanel(httpSessionsPanel); this.addActionListener(ae -> { Pattern pattern = Pattern .compile(httpSessionsPanel.getSelectedSession().getTokenValuesString().replaceAll(";", "|")); search(pattern); }); }

Target:
public PopupMenuSessionSearch(final HttpSessionsPanel httpSessionsPanel) { super(Constant.messages.getString("httpsessions.popup.find")); this.httpSessionsPanel = httpSessionsPanel; this.addActionListener(ae -> { Pattern pattern = Pattern .compile(httpSessionsPanel.getSelectedSession().getTokenValuesString().replaceAll(";", "|")); search(pattern); }); }
Source:
public static void startup() { final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry(); WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean(); String bindAddress = wscEnvironmentBean.getBindAddress11(); int bindPort = wscEnvironmentBean.getBindPort11(); int secureBindPort = wscEnvironmentBean.getBindPortSecure11(); String serviceURLPath = wscEnvironmentBean.getServiceURLPath(); if (serviceURLPath == null) { serviceURLPath = "/ws-c11"; } if (bindAddress == null) { bindAddress = "localhost"; } if (bindPort == 0) { bindPort = 8080; } if (secureBindPort == 0) { secureBindPort = 8443; } final String baseUri = "http://" + bindAddress + ":" + bindPort + serviceURLPath; final String uri = baseUri + "/SoapFaultService"; final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + serviceURLPath; final String secureUri = secureBaseUri + "/SoapFaultService"; serviceRegistry.registerServiceProvider(CoordinationConstants.SOAP_FAULT_SERVICE_NAME, uri) ; serviceRegistry.registerSecureServiceProvider(CoordinationConstants.SOAP_FAULT_SERVICE_NAME, secureUri); ; }

Target:
public static void startup() { final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry(); WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean(); String bindAddress = wscEnvironmentBean.getBindAddress11(); int bindPort = wscEnvironmentBean.getBindPort11(); int secureBindPort = wscEnvironmentBean.getBindPortSecure11(); String serviceURLPath = wscEnvironmentBean.getServiceURLPath(); if (serviceURLPath == null) { serviceURLPath = "/ws-c11"; } if (bindAddress == null) { bindAddress = "localhost"; } if (bindPort == 0) { bindPort = 8080; } if (secureBindPort == 0) { secureBindPort = 8443; } final String baseUri = "http://" + bindAddress + ":" + bindPort + serviceURLPath; final String uri = baseUri + "/CoordinationFaultService"; final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + serviceURLPath; final String secureUri = secureBaseUri + "/CoordinationFaultService"; serviceRegistry.registerServiceProvider(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME, uri) ; serviceRegistry.registerSecureServiceProvider(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME, secureUri); ; }
Source:
private void checkPending() { while (true) { Waiter<C> waiter = waiters.peek(); if (waiter == null) { break; } if (capacity > 0) { capacity--; Holder<C> conn = available.peek(); if (--conn.capacity == 0) { available.poll(); } waiters.poll(); ContextImpl ctx = conn.context; ctx.nettyEventLoop().execute(() -> { if (connector.isValid(conn.connection)) { boolean handled = deliverToWaiter(conn, waiter); if (!handled) { synchronized (Pool.this) { recycleConnection(conn, 1,false); checkPending(); } } } else { synchronized (Pool.this) { waiters.add(waiter); closed(conn); } } }); } else if (weight < maxWeight) { waiters.poll(); weight += createConnection(waiter); } else { break; } } }

Target:
private void checkPending() { while (waitersQueue.size() > 0) { Waiter<C> waiter = waitersQueue.peek(); if (acquireConnection(waiter)) { waitersQueue.poll(); } else { break; } } }
Source:
public String getJwks(@HeaderParam("Authorization") String authorization, String params) { final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL,true); return processWithCustomMapper(CommandType.GET_JWKS, params, GetJwksParams.class, authorization, mapper); }

Target:
public String getJwks(@HeaderParam("Authorization") String authorization, String params) { return process(CommandType.GET_JWKS, params, GetJwksParams.class, authorization); }
Source:
public void connectSerial(String comPort, int baudRate) { if (serialConnections.size() < MY_MAX_SERIAL_PORTS) { int colorindex = -1; for (int idx = 0; idx < serialPortAllocated.length; idx++) { if ( ! serialPortAllocated[idx]) { colorindex = idx; break; } } if (colorindex < 0) { Activator.log(new Status(IStatus.ERROR, Activator.getId(), Messages.serialMonitorNoMoreSerialPortsSupported, null)); } Serial newSerial = new Serial(comPort, baudRate); if (newSerial.IsConnected()) { newSerial.registerService(); SerialListener theListener = new SerialListener(this, colorindex); newSerial.addListener(theListener); theListener.event(NL + Messages.serialMonitorConnectedTo.replace(Messages.PORT, comPort).replace(Messages.BAUD,Integer.toString(baudRate) ) + NL); serialConnections.put(newSerial, theListener); SerialPortsUpdated(); serialPortAllocated[colorindex] = true; return; } } else { Activator.log(new Status(IStatus.ERROR, Activator.getId(), Messages.serialMonitorNoMoreSerialPortsSupported, null)); } }

Target:
public void connectSerial(String comPort, int baudRate) { if (serialConnections.size() < MY_MAX_SERIAL_PORTS) { int colorindex = -1; for (int idx = 0; idx < serialPortAllocated.length; idx++) { if ( ! serialPortAllocated[idx]) { colorindex = idx; break; } } if (colorindex < 0) { Activator.log(new Status(IStatus.ERROR, Activator.getId(), Messages.serialMonitorNoMoreSerialPortsSupported, null)); } Serial newSerial = new Serial(comPort, baudRate); if (newSerial.IsConnected()) { newSerial.registerService(); SerialListener theListener = new SerialListener(this, colorindex); newSerial.addListener(theListener); String newLine=System.getProperty("line.separator"); theListener.event(newLine+ Messages.serialMonitorConnectedTo.replace(Messages.PORT, comPort).replace(Messages.BAUD,Integer.toString(baudRate) ) + newLine); serialConnections.put(newSerial, theListener); SerialPortsUpdated(); serialPortAllocated[colorindex] = true; return; } } else { Activator.log(new Status(IStatus.ERROR, Activator.getId(), Messages.serialMonitorNoMoreSerialPortsSupported, null)); } }
Source:
public String toString() { return "Container[" + id() + ":" + name() + "]"; }

Target:
public String toString() { return "Container[" + parentAccount.id() + ":" + parentAccount.name() + ":" + id() + ":" + name() + "]"; }
Source:
public boolean getStoreHealth() throws ClusterMgtException { boolean storeHealth = false; MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=ClusterManagementInformation," + "name=ClusterManagementInformation"); Object result = mBeanServer.getAttribute(objectName, ClusterMgtConstants.STORE_HEALTH); if (result != null) { storeHealth = (Boolean) result; } return storeHealth; } catch (MalformedObjectNameException e) { throw new ClusterMgtException("Cannot get message store health.", e); } catch (ReflectionException e) { throw new ClusterMgtException("Cannot get coordinator node address.", e); } catch (MBeanException e) { throw new ClusterMgtException("Cannot get coordinator node address.", e); } catch (InstanceNotFoundException e) { throw new ClusterMgtException("Cannot get coordinator node address.", e); } catch (AttributeNotFoundException e) { throw new ClusterMgtException("Cannot get coordinator node address.", e); } }

Target:
public boolean getStoreHealth() throws ClusterMgtException { boolean storeHealth = false; MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=ClusterManagementInformation," + "name=ClusterManagementInformation"); Object result = mBeanServer.getAttribute(objectName, ClusterMgtConstants.STORE_HEALTH); if (result != null) { storeHealth = (Boolean) result; } return storeHealth; } catch (MalformedObjectNameException e) { throw new ClusterMgtException("Cannot get message store health.", e); } catch (ReflectionException e) { throw new ClusterMgtException("Cannot get message store health.", e); } catch (MBeanException e) { throw new ClusterMgtException("Cannot get message store health.", e); } catch (InstanceNotFoundException e) { throw new ClusterMgtException("Cannot get message store health.", e); } catch (AttributeNotFoundException e) { throw new ClusterMgtException("Cannot get message store health.", e); } }
Source:
public String propertyForUserName(Criteria criteria, boolean creator) { criteria.createAlias("creator", "creator"); criteria.createAlias("lastModifier", "lastModifier"); return creator ? "creator.loginName" : "lastModifier.loginName"; }

Target:
public String propertyForUserName(Criteria criteria, boolean creator) { return creator ? "creator.loginName" : "lastModifier.loginName"; }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (!batchReadableWritableConfig.containsMacro(Properties.BatchReadableWritable.NAME)) { String datasetName = getProperties().get(Properties.BatchReadableWritable.NAME); Preconditions.checkArgument(datasetName != null && !datasetName.isEmpty(), "Dataset name must be given."); String datasetType = getProperties().get(Properties.BatchReadableWritable.TYPE); Preconditions.checkArgument(datasetType != null && !datasetType.isEmpty(), "Dataset type must be given."); Map<String, String> properties = Maps.newHashMap(getProperties()); properties.remove(Properties.BatchReadableWritable.NAME); properties.remove(Properties.BatchReadableWritable.TYPE); pipelineConfigurer.createDataset(datasetName, datasetType, DatasetProperties.builder().addAll(properties).build()); } }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (!batchReadableWritableConfig.containsMacro(Properties.BatchReadableWritable.NAME)) { String datasetName = batchReadableWritableConfig.getName(); Preconditions.checkArgument(datasetName != null && !datasetName.isEmpty(), "Dataset name must be given."); String datasetType = getProperties().get(Properties.BatchReadableWritable.TYPE); Preconditions.checkArgument(datasetType != null && !datasetType.isEmpty(), "Dataset type must be given."); Map<String, String> properties = Maps.newHashMap(getProperties()); properties.remove(Properties.BatchReadableWritable.NAME); properties.remove(Properties.BatchReadableWritable.TYPE); pipelineConfigurer.createDataset(datasetName, datasetType, DatasetProperties.builder().addAll(properties).build()); } }
Source:
protected void initOutputClauses(CompilerContext feelctx, Map<String, CompiledFEELExpression> compilationCache) { logger.info("Reading " + outputs.size() + " outputs from class loader"); iterateOverOutputClauses((output, defaultValue) -> output.compiledDefault = (CompiledFEELExpression) readFieldWithRuntimeCheck(instanceName(getOutputName(defaultValue)))); }

Target:
protected void initOutputClauses(CompilerContext feelctx, Map<String, CompiledFEELExpression> compilationCache) { logger.debug("Reading " + outputs.size() + " outputs from class loader"); iterateOverOutputClauses((output, defaultValue) -> output.compiledDefault = (CompiledFEELExpression) readFieldWithRuntimeCheck(instanceName(getOutputName(defaultValue)))); }
Source:
public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("", "char_is_uppercase('a')"), new ExampleScript("", "char_is_uppercase('D')"),}; }

Target:
public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("Basic usage", "char_is_uppercase('a')"), new ExampleScript("", "char_is_uppercase('D')"),}; }
Source:
public void addField(@NonNull String name, @NonNull IDeclaration declaration) { if (Arrays.asList(fFieldNames).contains(name)) { Activator.log(IStatus.WARNING, "Struct already contains a field named " + name); return; } @NonNull IDeclaration[] fields = Arrays.copyOf(fFields, fFields.length + 1); fields[fFields.length] = declaration; fFields = fields; @NonNull String[] names = Arrays.copyOf(fFieldNames, fFieldNames.length + 1); names[fFieldNames.length] = name; fFieldNames = names; fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment()); }

Target:
public void addField(@NonNull String name, @NonNull IDeclaration declaration) { if (hasField(name)) { Activator.log(IStatus.WARNING, "Struct already contains a field named " + name); return; } final int length = fFieldNames.length; @NonNull String[] names = Arrays.copyOf(fFieldNames, length + 1); @NonNull IDeclaration[] fields = Arrays.copyOf(fFields, length + 1); names[length] = name; fields[length] = declaration; fFieldNames = names; fFields = fields; fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment()); }