auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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; } <START> if (!(args.length == 1)) <END> { 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; } }</code><technical_language>again, this 'lambda', this is bad coding practice. Change args.length != 1</technical_language>

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:
<code>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(); } <START> return null; <END> }</code><technical_language>returned if default is array? other hand, check !(result instanceof NullNode) redundant, a string is returned for SYObjectNode SimpleTypeNode</technical_language>

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:
<code>private void sortPositions(int arrayLength, Comparator<Integer> comparator) { List<Integer> list = positions.subList(0, arrayLength); try { list.sort(comparator); } catch (IllegalArgumentException e) { <START> throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Lambda comparator violates the comparator contract"); <END> } }</code><technical_language>clarify, this catch PrestoException thrown comparatorResult? Do wan include thrown e in new PrestoException created here</technical_language>

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:
<code>private Guid getVdsToRunOn(Iterable<VDS> vdss) { <START> StringBuffer sb = new StringBuffer(); <END> 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); } }</code><technical_language>StringBuilder</technical_language>

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:
<code>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), <START> kv("provider", SMARTPAY.getName()), <END> 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(); }</code><technical_language>a pain, uk.gov.pay.logging.LoggingKeys.PROVIDER here, similar <LINK_0> it</technical_language>

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:
<code><START> protected void prepareMetrics() { long now = System.currentTimeMillis(); if ((lastUpdate + minimumRefreshDelay) < now) { metricValues.set(updateFromZookeeper()); lastUpdate = now; recordValues(); } } <END></code><technical_language>instance var metricValues dispensed done instead? java @Override protected void prepareMetrics() { long = System.currentTimeMillis(); if ((lastUpdate + minimumRefreshDelay) < now) { recordValues(updateFromZookeeper()); lastUpdate = now; } }</technical_language>

Target:
protected void prepareMetrics() { metricsValuesLock.lock(); try { long now = System.currentTimeMillis(); if ((lastUpdate + minimumRefreshDelay) < now) { metricValues = updateFromZookeeper(); lastUpdate = now; recordValues(); } } finally { metricsValuesLock.unlock(); } }
Source:
<code>public void notifyCheckpointComplete(long checkpointId) { <START> if (cancelAfterCheckpointId != null && cancelAfterCheckpointId == checkpointId) { <END> cancel(); } }</code><technical_language>if a checkpoint fails? cancelAfterCheckpointId <= checkpointId more safe</technical_language>

Target:
public void notifyCheckpointComplete(long checkpointId) { if (cancelAfterCheckpointId != null && cancelAfterCheckpointId <= checkpointId) { cancel(); } }
Source:
<code>public void clear() { <START> super.clear(); <END> map.clear(); }</code><technical_language>other write methods, safer create a new ArrayList modify it</technical_language>

Target:
public void clear() { map.clear(); updatedMap(); }
Source:
<code>public void nonVmWithDefaultMTUAddedToNic() { Network net = createNetwork("VLanVmMtu9000"); net.setvlan_id(100); net.setMtu(9000); <START> Network newNet = createNetwork("nonVmMtu5000"); <END> 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())); }</code><technical_language>nonVmMtu5000 ==> nonVm</technical_language>

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:
<code>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++) { <START> final double x = RANDOM.nextDouble() * 5.0; <END> 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)); } } }</code><technical_language>this change defeat point of test? RANDOM.nextDouble() * 20.0 - 10; values interpolation range, is is needed for this test</technical_language>

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:
<code><START> public void testForConnection(String dbId) throws Exception { <END> 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); } } }</code><technical_language>pattern avoid 2 lookups: Pair<Server, Thread> entry = serverControls.get(dbId); if(entry != null){ Server server = entry.getFirst(); server.checkRunning(true); } for other sections of code containsKey get</technical_language>

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:
<code>public String getTag() { <START> return TAG; <END> }</code><technical_language>this way? public String getTag() { return TAGS[0]; } This remove redundant code lines 22-23: private static final String TAG = "<polldaddy id=\"8956579\"/>";</technical_language>

Target:
public String getTag() { return TAGS[0]; }
Source:
<code>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(); <START> FeedbackSessionResultsBundle bundle = getFeedbackResultBundle(courseId, fsname, roster); <END> InstructorFeedbackResponseCommentsLoadPageData data = new InstructorFeedbackResponseCommentsLoadPageData( account, fsIndex, numberOfPendingComments, instructor, bundle); return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_RESPONSE_COMMENTS_LOAD, data); }</code><technical_language>enlighten able getFeedbackResultBundle (get a single object instead of map of objects)</technical_language>

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:
<code>private void loadImage() { animator.setDisplayedChild(1); <START> Picasso.with(this).load(image).fit().into(imageView, new EmptyCallback() { <END> @Override public void onSuccess() { animator.setDisplayedChild(0); } }); }</code><technical_language>want .centerInside() maintain aspect ratio</technical_language>

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:
<code>private void checkClusterId(String clusterKey) throws DoNotRetryIOException { String peerClusterId = ""; try { Configuration peerConf = HBaseConfiguration.createClusterConf(conf, clusterKey); ZKWatcher zkWatcher = <START> new ZKWatcher(peerConf, this + "check-peer-cluster-key", new Abortable() { <END> @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"); } }</code><technical_language>ZKWatcher is null-safe abortable. relying it, pass null</technical_language>

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:
<code>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) { <START> if (getTraceType().startsWith(CustomTxtTrace.class.getCanonicalName())) { <END> 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; }</code><technical_language>I TmfTraceType.getTraceType(id). returned TraceTypeHelper a getter for category name. work for trace types plug-in extension</technical_language>

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:
<code>public static Map<String, List<String>> extractQueryString(final Http.Request httpRequest,final Set<String> ignoredParams) { <START> Set<String> ignored = Optional.ofNullable(ignoredParams).orElseGet(HashSet::new); <END> return httpRequest.queryString().entrySet().stream() .filter(stringEntry -> !ignored.contains(stringEntry.getKey())) .collect(toMap(Map.Entry::getKey, entry -> asList(entry.getValue()))); }</code><technical_language>In Sunrise follow rule a parameter is annotated @Nullable, null. this line of code is unnecessary</technical_language>

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:
<code>public PopupMenuSessionSearch(final HttpSessionsPanel httpSessionsPanel) { super(Constant.messages.getString("httpsessions.popup.find")); <START> setHttpSessionsPanel(httpSessionsPanel); <END> this.addActionListener(ae -> { Pattern pattern = Pattern .compile(httpSessionsPanel.getSelectedSession().getTokenValuesString().replaceAll(";", "|")); search(pattern); }); }</code><technical_language>assign directly</technical_language>

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:
<code>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; <START> final String secureUri = secureBaseUri + "/SoapFaultService"; <END> serviceRegistry.registerServiceProvider(CoordinationConstants.SOAP_FAULT_SERVICE_NAME, uri) ; serviceRegistry.registerSecureServiceProvider(CoordinationConstants.SOAP_FAULT_SERVICE_NAME, secureUri); ; }</code><technical_language>I trouble naming here. term SoapFault(Service) (SOAP_FAULT_SERVICE_NAME too) sounds generic interfere (in eyes) com.arjuna.webservices.SoapFault exception. Do (in PR in general) other naming kind of RegistrationCoordinatorFault RegistrationCoordinatorResponse later? this naming some reason</technical_language>

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:
<code>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) { <START> waiters.add(waiter); <END> closed(conn); } } }); } else if (weight < maxWeight) { waiters.poll(); weight += createConnection(waiter); } else { break; } } }</code><technical_language>check waiters queue constraint (queueMaxSize)</technical_language>

Target:
private void checkPending() { while (waitersQueue.size() > 0) { Waiter<C> waiter = waitersQueue.peek(); if (acquireConnection(waiter)) { waitersQueue.poll(); } else { break; } } }
Source:
<code>public String getJwks(@HeaderParam("Authorization") String authorization, String params) { final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL,true); <START> return processWithCustomMapper(CommandType.GET_JWKS, params, GetJwksParams.class, authorization, mapper); <END> }</code><technical_language>2 methods for processing commands, lets single method pass mapper process, private static <T extends IParams> String process(ObjectMapper mapper, CommandType commandType, String paramsAsString, Class<T> paramsClass, String authorization) { ... } overload process method mapper suites for 90% of commands, private static <T extends IParams> String process(ObjectMapper mapper, CommandType commandType, String paramsAsString, Class<T> paramsClass, String authorization) { return process(CoreUtils.createJsonMapper(), commandType, paramsAsString, paramsClass, authorization); }</technical_language>

Target:
public String getJwks(@HeaderParam("Authorization") String authorization, String params) { return process(CommandType.GET_JWKS, params, GetJwksParams.class, authorization); }
Source:
<code>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; <START> break; <END> } } 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)); } }</code><technical_language>newLine is more readable NL. added is of NL</technical_language>

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:
<code>public String toString() { <START> return "Container[" + id() + ":" + name() + "]"; <END> }</code><technical_language>id:name enough uniquely identify a container. I include string representation of parent account (i.e. parentAccount.toString())</technical_language>

Target:
public String toString() { return "Container[" + parentAccount.id() + ":" + parentAccount.name() + ":" + id() + ":" + name() + "]"; }
Source:
<code>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); <START> } catch (ReflectionException e) { <END> 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); } }</code><technical_language>is this correct error msg (why get coodriator node address?)</technical_language>

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:
<code>public String propertyForUserName(Criteria criteria, boolean creator) { criteria.createAlias("creator", "creator"); <START> criteria.createAlias("lastModifier", "lastModifier"); <END> return creator ? "creator.loginName" : "lastModifier.loginName"; }</code><technical_language>"creator" "lastModifier" added STANDARD_ALIASES instead of creating aliases</technical_language>

Target:
public String propertyForUserName(Criteria criteria, boolean creator) { return creator ? "creator.loginName" : "lastModifier.loginName"; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (!batchReadableWritableConfig.containsMacro(Properties.BatchReadableWritable.NAME)) { <START> String datasetName = getProperties().get(Properties.BatchReadableWritable.NAME); <END> 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()); } }</code><technical_language>PR, do getProperties().get(name). able batchReadableWritableConfig.getName()</technical_language>

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:
<code>protected void initOutputClauses(CompilerContext feelctx, Map<String, CompiledFEELExpression> compilationCache) { <START> logger.info("Reading " + outputs.size() + " outputs from class loader"); <END> iterateOverOutputClauses((output, defaultValue) -> output.compiledDefault = (CompiledFEELExpression) readFieldWithRuntimeCheck(instanceName(getOutputName(defaultValue)))); }</code><technical_language>please change debug</technical_language>

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:
<code>public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("", "char_is_uppercase('a')"), <START> new ExampleScript("", "char_is_uppercase('D')"),}; <END> }</code><technical_language>In string, put "Basic usage"</technical_language>

Target:
public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("Basic usage", "char_is_uppercase('a')"), new ExampleScript("", "char_is_uppercase('D')"),}; }
Source:
<code><START> public void addField(@NonNull String name, @NonNull IDeclaration declaration) { <END> 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()); }</code><technical_language>This synchronized</technical_language>

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()); }
Source:
<code>public synchronized Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (json.isJsonNull() || json.getAsString().isEmpty()) { return null; } String dateAsString = json.getAsJsonPrimitive().getAsString().replaceAll("Z$", "+0000"); ParseException e = null; for (SimpleDateFormat format : dateFormatters) { try { return format.parse(dateAsString); } catch (ParseException e1) { e = e1; } } Pattern isJustNumber = Pattern.compile("^\\d+$"); Matcher foundMatch = isJustNumber.matcher(dateAsString); if (foundMatch.find()) { Long time_t = Long.parseLong(dateAsString); Long msCheck = 1000000000000L; <START> if (time_t > msCheck) { <END> time_t = time_t / 1000; } return new Date(time_t); } LOG.log(Level.SEVERE, "Error parsing: " + dateAsString, e); return null; }</code><technical_language>time_t timestamp timeAsLong</technical_language>

Target:
public synchronized Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (json.isJsonNull() || json.getAsString().isEmpty()) { return null; } String dateAsString = json.getAsJsonPrimitive().getAsString().replaceAll("Z$", "+0000"); ParseException e = null; for (SimpleDateFormat format : dateFormatters) { try { return format.parse(dateAsString); } catch (ParseException e1) { e = e1; } } Pattern isJustNumber = Pattern.compile("^\\d+$"); Matcher foundMatch = isJustNumber.matcher(dateAsString); if (foundMatch.find()) { Long timeAsLong = Long.parseLong(dateAsString); Long msCheck = 1000000000000L; if (timeAsLong > msCheck) { timeAsLong = timeAsLong / 1000; } return new Date(timeAsLong); } LOG.log(Level.SEVERE, "Error parsing: " + dateAsString, e); return null; }
Source:
<code><START> public AsyncProcessor() { <END> this.subscribers = new AtomicReference<AsyncSubscription<T>[]>(EMPTY); }</code><technical_language>redundant static factories public constructors in public API. Especially multiple overloads in some of other processors. choose expose it</technical_language>

Target:
AsyncProcessor() { this.subscribers = new AtomicReference<AsyncSubscription<T>[]>(EMPTY); }
Source:
<code>public Set<String> map(final String principalName, final Set<String> roles) { if (this.roleMappings == null || this.roleMappings.isEmpty()) return roles; Set<String> resolvedRoles = new HashSet<>(); for (String role : roles) { if (this.roleMappings.containsKey(role)) { String value = this.roleMappings.getProperty(role); if (!value.isEmpty()) { String[] mappedRoles = value.split(","); for (String mappedRole : mappedRoles) { String trimmedRole = mappedRole.trim(); if (!trimmedRole.isEmpty()) { resolvedRoles.add(trimmedRole); } } } } else { resolvedRoles.add(role); } } if (this.roleMappings.containsKey(principalName)) { String value = this.roleMappings.getProperty(principalName); <START> if (value != null && !value.isEmpty()) { <END> String[] principalRoles = value.split(","); Collections.addAll(resolvedRoles, principalRoles); } } return resolvedRoles; }</code><technical_language>trim() well? extract this functionality of function for roles principal name</technical_language>

Target:
public Set<String> map(final String principalName, final Set<String> roles) { if (this.roleMappings == null || this.roleMappings.isEmpty()) return roles; Set<String> resolvedRoles = new HashSet<>(); for (String role : roles) { if (this.roleMappings.containsKey(role)) { this.extractRolesIntoSet(role, resolvedRoles); } else { resolvedRoles.add(role); } } if (this.roleMappings.containsKey(principalName)) { this.extractRolesIntoSet(principalName, resolvedRoles); } return resolvedRoles; }
Source:
<code>public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException, TableExistsException { checkArgument(oldTableName.length() <= MAX_TABLE_NAME_LEN, "Table names longer than 1024 characters" + "are no longer supported and may result in unexpected behavior"); checkArgument(newTableName.length() <= MAX_TABLE_NAME_LEN, <START> "Table name is longer than 1024 characters"); <END> List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldTableName.getBytes(UTF_8)), ByteBuffer.wrap(newTableName.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); doTableFateOperation(oldTableName, TableNotFoundException.class, FateOperation.TABLE_RENAME, args, opts); }</code><technical_language>suggestion "Table name is longer "+ MAX_TABLE_NAME_LEN +" characters");</technical_language>

Target:
public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException, TableExistsException { checkArgument(newTableName.length() <= MAX_TABLE_NAME_LEN, "Table name is longer than " + MAX_TABLE_NAME_LEN + " characters"); List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldTableName.getBytes(UTF_8)), ByteBuffer.wrap(newTableName.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); doTableFateOperation(oldTableName, TableNotFoundException.class, FateOperation.TABLE_RENAME, args, opts); }
Source:
<code>public PageFunctionCompiler(Metadata metadata, int expressionCacheSize) { this.metadata = requireNonNull(metadata, "metadata is null"); this.determinismEvaluator = new RowExpressionDeterminismEvaluator(metadata.getFunctionManager()); if (expressionCacheSize > 0) { projectionCache = CacheBuilder.newBuilder() .recordStats() .maximumSize(expressionCacheSize) <START> .build(CacheLoader.from(cacheKey -> compileProjectionInternal(cacheKey.sqlFunctionProperties, cacheKey.rowExpression, Optional.empty(), false))); <END> projectionCacheStats = new CacheStatsMBean(projectionCache); } else { projectionCache = null; projectionCacheStats = null; } if (expressionCacheSize > 0) { filterCache = CacheBuilder.newBuilder() .recordStats() .maximumSize(expressionCacheSize) .build(CacheLoader.from(cacheKey -> compileFilterInternal(cacheKey.sqlFunctionProperties, cacheKey.rowExpression, Optional.empty(), cacheKey.isDisallowLargeBytecodeGeneration))); filterCacheStats = new CacheStatsMBean(filterCache); } else { filterCache = null; filterCacheStats = null; } }</code><technical_language>is concern projections generate large amounts of compiled code? 100% projection cache contains I lazily asking you</technical_language>

Target:
public PageFunctionCompiler(Metadata metadata, int expressionCacheSize) { this.metadata = requireNonNull(metadata, "metadata is null"); this.determinismEvaluator = new RowExpressionDeterminismEvaluator(metadata.getFunctionManager()); if (expressionCacheSize > 0) { projectionCache = CacheBuilder.newBuilder() .recordStats() .maximumSize(expressionCacheSize) .build(CacheLoader.from(cacheKey -> compileProjectionInternal(cacheKey.sqlFunctionProperties, cacheKey.rowExpression, Optional.empty(), false))); projectionCacheStats = new CacheStatsMBean(projectionCache); } else { projectionCache = null; projectionCacheStats = null; } if (expressionCacheSize > 0) { filterCache = CacheBuilder.newBuilder() .recordStats() .maximumSize(expressionCacheSize) .build(CacheLoader.from(cacheKey -> compileFilterInternal(cacheKey.sqlFunctionProperties, cacheKey.rowExpression, Optional.empty(), cacheKey.isErrorOnLargeBytecodeGeneration))); filterCacheStats = new CacheStatsMBean(filterCache); } else { filterCache = null; filterCacheStats = null; } }
Source:
<code>public void bind(Object service, Map properties) { LOGGER.info("Registering providers"); dataProviderDataService = (DataProviderDataService) service; synchronized (additionLock) { for (TaskDataProvider provider : providersToAdd) { <START> LOGGER.info("Registering the provider with name: {}", provider.getName()); <END> addProviderImpl(provider); } providersToAdd.clear(); } }</code><technical_language>a task data provider</technical_language>

Target:
public void bind(Object service, Map properties) { LOGGER.info("Data Service for task data providers registered, starting to register queued providers"); dataProviderDataService = (DataProviderDataService) service; LOGGER.debug("Adding the following task data providers: {}", providersToAdd); synchronized (additionLock) { for (TaskDataProvider provider : providersToAdd) { LOGGER.info("Registering a task data provider with name: {}", provider.getName()); addProviderImpl(provider); } providersToAdd.clear(); } }
Source:
<code>private AbstractMongoDBServer getServer() { AbstractMongoDBServer server = entity.getConfig(MongoDBClient.SERVER); if (server == null) { MongoDBShardedDeployment deployment = entity.getConfig(MongoDBClient.SHARDED_DEPLOYMENT); Task<MongoDBRouter> task = DependentConfiguration.attributeWhenReady(deployment.getRouterCluster(), MongoDBRouterCluster.ANY_ROUTER); try { server = DependentConfiguration.waitForTask(task, entity, "any available router"); } catch (InterruptedException e) { throw Exceptions.propagate(e); } DependentConfiguration.waitInTaskForAttributeReady(server, MongoDBRouter.SHARD_COUNT, new Predicate<Integer>() { public boolean apply(Integer input) { return input > 0; }; }); } else { <START> DependentConfiguration.waitInTaskForAttributeReady(server, Startable.SERVICE_UP, Predicates.equalTo(true)); <END> } return server; }</code><technical_language>I call waitInTaskForAttributeReady directly. Instead, want do trick call attributeWhenReady waitForTask</technical_language>

Target:
private AbstractMongoDBServer getServer() { AbstractMongoDBServer server = entity.getConfig(MongoDBClient.SERVER); if (server == null) { MongoDBShardedDeployment deployment = entity.getConfig(MongoDBClient.SHARDED_DEPLOYMENT); Preconditions.checkNotNull(deployment, "Either server or shardedDeployment must be specified"); Task<MongoDBRouter> task = DependentConfiguration.attributeWhenReady(deployment.getRouterCluster(), MongoDBRouterCluster.ANY_ROUTER); try { server = DependentConfiguration.waitForTask(task, entity, "any available router"); } catch (InterruptedException e) { throw Exceptions.propagate(e); } DependentConfiguration.waitInTaskForAttributeReady(server, MongoDBRouter.SHARD_COUNT, new Predicate<Integer>() { public boolean apply(Integer input) { return input > 0; }; }); } else { Task<Boolean> task = DependentConfiguration.attributeWhenReady(server, Startable.SERVICE_UP); try { DependentConfiguration.waitForTask(task, server); } catch (InterruptedException e) { throw Exceptions.propagate(e); } DependentConfiguration.waitInTaskForAttributeReady(server, Startable.SERVICE_UP, Predicates.equalTo(true)); } return server; }
Source:
<code>public static t_type lookUp(final String s) { return Arrays.stream(t_type.values()) .filter((t)->t.identifier.equalsIgnoreCase(s)) .findAny() <START> .orElseThrow(()->new IllegalArgumentException(String.format("Unknown mbtiles type '%s'",s))); <END> }</code><technical_language>API standpoint, lookup method throws IllegalArgumentException? I this works Java 8 constructs here</technical_language>

Target:
public static t_type lookUp(final String s) throws IllegalArgumentException { return Arrays.stream(t_type.values()) .filter((t)->t.identifier.equalsIgnoreCase(s)) .findAny() .orElseThrow(()->new IllegalArgumentException(String.format("Unknown mbtiles type '%s'",s))); }