auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public RangeCondition<E> subCondition(E from, E to) { if (from.compareTo(to) > 0) { throw new IllegalArgumentException(from.toString() + " is greater than " + to.toString()); } <END> return new ContinuousRangeCondition<>(max(fMin, from), min(fMax, to)); }</code><technical_language>while I sense check this if calling E from, E to, constructor a place enforce this? In 2D query patch, Genevieve suggested enforcing in constructor min/max instead</technical_language>

Target:
public RangeCondition<E> subCondition(E from, E to) { return new ContinuousRangeCondition<>(from, to); }
Source:
<code>private double predictByTree(final GBTData instance, final GBTree thisTree) { final Vector feature = instance.getFeature(); int nodeIdx = 0; <START> for (;;) { <END> final Pair<Integer, Double> node = thisTree.get(nodeIdx); final int nodeFeature = node.getLeft(); if (nodeFeature == NodeState.LEAF.getValue()) { return node.getRight(); } if (featureTypes.get(nodeFeature) == FeatureType.CONTINUOUS) { final double splitValue = node.getRight(); if (feature.get(nodeFeature) <= splitValue) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } else { final double getSplitValue = node.getRight(); int splitValue = (int)getSplitValue; for (int i = 0; i < feature.get(nodeFeature); i++) { splitValue /= 2; } if (splitValue % 2 == 0) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } } }</code><technical_language>this infinite for-loop terminates</technical_language>

Target:
private double predictByTree(final GBTData instance, final GBTree thisTree) { final Vector feature = instance.getFeature(); int nodeIdx = 0; while (true) { final Pair<Integer, Double> node = thisTree.get(nodeIdx); final int nodeFeature = node.getLeft(); if (nodeFeature == NodeState.LEAF.getValue()) { return node.getRight(); } if (featureTypes.get(nodeFeature) == FeatureType.CONTINUOUS) { final double splitValue = node.getRight(); if (feature.get(nodeFeature) <= splitValue) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } else { final double getSplitValue = node.getRight(); int splitValue = (int)getSplitValue; for (int i = 0; i < feature.get(nodeFeature); i++) { splitValue /= 2; } if (splitValue % 2 == 0) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } } }
Source:
<code>private String buildSqoopCommand(Cluster cluster, Feed feed) throws FalconException { Map<String, String> extraArgs = getArguments(cluster); StringBuilder sqoopArgs = new StringBuilder(); StringBuilder sqoopOptions = new StringBuilder(); org.apache.falcon.entity.v0.feed.Cluster feedCluster = FeedHelper.getCluster(entity, cluster.getName()); <START> Datasource datasource = DatasourceHelper.getDatasource(FeedHelper.getExportDatasourceName(feedCluster)); <END> ImportExportCommon.buildDriverArgs(sqoopArgs, datasource).append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildConnectArg(sqoopArgs, DatasourceHelper.getWriteEndpoint(datasource)) .append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildTableArg(sqoopArgs, FeedHelper.getExportDataSourceTableName(feedCluster)) .append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildUserPasswordArg(sqoopArgs, sqoopOptions, DatasourceHelper.getWritePasswordInfo(datasource)).append(ImportExportCommon.ARG_SEPARATOR); buildNumMappers(sqoopArgs, extraArgs).append(ImportExportCommon.ARG_SEPARATOR); buildArguments(sqoopArgs, extraArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildLoadType(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildExportArg(sqoopArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); StringBuilder sqoopCmd = new StringBuilder(); return sqoopCmd.append("export").append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopOptions).append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopArgs).toString(); }</code><technical_language>do handle connector specific direct mode verbose options properties (which key pairs single arguments Sqoop)</technical_language>

Target:
private String buildSqoopCommand(Cluster cluster, Feed feed) throws FalconException { Map<String, String> extraArgs = getArguments(cluster); StringBuilder sqoopArgs = new StringBuilder(); StringBuilder sqoopOptions = new StringBuilder(); buildConnectArg(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildTableArg(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); Datasource datasource = DatasourceHelper.getDatasource(FeedHelper.getExportDatasourceName( FeedHelper.getCluster(entity, cluster.getName()))); ImportExportCommon.buildUserPasswordArg(sqoopArgs, sqoopOptions, datasource) .append(ImportExportCommon.ARG_SEPARATOR); buildNumMappers(sqoopArgs, extraArgs).append(ImportExportCommon.ARG_SEPARATOR); buildArguments(sqoopArgs, extraArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildLoadType(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildExportArg(sqoopArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); StringBuilder sqoopCmd = new StringBuilder(); return sqoopCmd.append("export").append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopOptions).append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopArgs).toString(); }
Source:
<code>public static final InputRow fromBytes(byte[] data, AggregatorFactory[] aggs) { try { DataInput in = ByteStreams.newDataInput(data); long timestamp = in.readLong(); Map<String, Object> event = Maps.newHashMap(); List<String> dimensions = Lists.newArrayList(); int dimNum = WritableUtils.readVInt(in); for (int i = 0; i < dimNum; i++) { String dimension = readString(in); dimensions.add(dimension); List<String> dimensionValues = readStringArray(in); if (dimensionValues == null) { continue; } if (dimensionValues.size() == 1) { event.put(dimension, dimensionValues.get(0)); } else { event.put(dimension, dimensionValues); } } int metricSize = WritableUtils.readVInt(in); for (int i = 0; i < metricSize; i++) { String metric = readString(in); String type = getType(metric, aggs, i); byte metricNullability = in.readByte(); <START> if(metricNullability == (byte)1){ <END> continue; } if (type.equals("float")) { event.put(metric, in.readFloat()); } else if (type.equals("long")) { event.put(metric, WritableUtils.readVLong(in)); } else if (type.equals("double")) { event.put(metric, in.readDouble()); } else { ComplexMetricSerde serde = getComplexMetricSerde(type); byte[] value = readBytes(in); event.put(metric, serde.fromBytes(value, 0, value.length)); } } return new MapBasedInputRow(timestamp, dimensions, event); } catch (IOException ex) { throw new RuntimeException(ex); } }</code><technical_language>style issue</technical_language>

Target:
public static final InputRow fromBytes(byte[] data, AggregatorFactory[] aggs) { try { DataInput in = ByteStreams.newDataInput(data); long timestamp = in.readLong(); Map<String, Object> event = Maps.newHashMap(); List<String> dimensions = Lists.newArrayList(); int dimNum = WritableUtils.readVInt(in); for (int i = 0; i < dimNum; i++) { String dimension = readString(in); dimensions.add(dimension); List<String> dimensionValues = readStringArray(in); if (dimensionValues == null) { continue; } if (dimensionValues.size() == 1) { event.put(dimension, dimensionValues.get(0)); } else { event.put(dimension, dimensionValues); } } int metricSize = WritableUtils.readVInt(in); for (int i = 0; i < metricSize; i++) { String metric = readString(in); String type = getType(metric, aggs, i); byte metricNullability = in.readByte(); if (metricNullability == NULL_BYTE) { continue; } if (type.equals("float")) { event.put(metric, in.readFloat()); } else if (type.equals("long")) { event.put(metric, WritableUtils.readVLong(in)); } else if (type.equals("double")) { event.put(metric, in.readDouble()); } else { ComplexMetricSerde serde = getComplexMetricSerde(type); byte[] value = readBytes(in); event.put(metric, serde.fromBytes(value, 0, value.length)); } } return new MapBasedInputRow(timestamp, dimensions, event); } catch (IOException ex) { throw new RuntimeException(ex); } }
Source:
<code>public ByteArrayOutputStream executeRequest(String urlString, ParamsMap params, ApiDefinition apiDefinition) <START> throws MambuApiException { <END> Method method = apiDefinition.getMethod(); ContentType contentTypeFormat = apiDefinition.getContentType(); urlString = urlHelper.addJsonPaginationParams(urlString, method, contentTypeFormat, params); logApiRequestDetails(urlString, params, method, contentTypeFormat); logCurlRequestDetails(urlString, params, method, contentTypeFormat); params = addAppKeyToParams(params); HttpClient httpClient = new DefaultHttpClient(); ByteArrayOutputStream byteArrayOutputStreamResponse = null; HttpResponse httpResponse = null; try { httpResponse = executeRequestByMethod(urlString, params, method, contentTypeFormat, httpClient, httpResponse); byteArrayOutputStreamResponse = processInputStreamResponse(httpResponse, method, contentTypeFormat, urlString, params); } catch (MalformedURLException e) { LOGGER.severe("MalformedURLException: " + e.getMessage()); throw new MambuApiException(e); } catch (IOException e) { LOGGER.warning("IOException: message= " + e.getMessage()); throw new MambuApiException(e); } finally { httpClient.getConnectionManager().shutdown(); } return byteArrayOutputStreamResponse; }</code><technical_language>this method work other API return types? add some checks throw exceptions ensure this method is called expected params support ByteArrayOutputStream output</technical_language>

Target:
public ByteArrayOutputStream executeRequest(String urlString, ParamsMap params, ApiDefinition apiDefinition) throws MambuApiException { Method method = apiDefinition.getMethod(); ContentType contentTypeFormat = apiDefinition.getContentType(); logApiRequestDetails(urlString, params, method, contentTypeFormat); logCurlRequestDetails(urlString, params, method, contentTypeFormat); params = addAppKeyToParams(params); HttpClient httpClient = new DefaultHttpClient(); ByteArrayOutputStream byteArrayOutputStreamResponse = null; HttpResponse httpResponse = null; try { httpResponse = executeRequestByMethod(urlString, params, method, contentTypeFormat, httpClient, httpResponse); byteArrayOutputStreamResponse = processInputStreamResponse(httpResponse, method, contentTypeFormat, urlString, params); } catch (MalformedURLException e) { LOGGER.severe("MalformedURLException: " + e.getMessage()); throw new MambuApiException(e); } catch (IOException e) { LOGGER.warning("IOException: message= " + e.getMessage()); throw new MambuApiException(e); } finally { httpClient.getConnectionManager().shutdown(); } return byteArrayOutputStreamResponse; }
Source:
<code>public HttpBasicAuthRequest(HttpServletRequest req) throws IOException { this.httpClientRequest = req; final String hdr = req.getHeader(AUTHORIZATION); <START> if (hdr == null) { <END> username = password = null; return; } String usernamePassword = new String(Base64.decodeBase64(hdr.substring(LIT_BASIC.length())), Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8")); int splitPos = usernamePassword.indexOf(':'); if (splitPos < 1) { username = usernamePassword; password = null; } else { username = usernamePassword.substring(0, splitPos); password = usernamePassword.substring(splitPos + 1); } }</code><technical_language>If checking null here, I check hdr.startsWith(BASIC)</technical_language>

Target:
public HttpBasicAuthRequest(HttpServletRequest req) throws IOException { this.httpClientRequest = req; final String hdr = req.getHeader(AUTHORIZATION); if (hdr == null) { username = password = null; return; } if (!hdr.startsWith(BASIC_AUTH_PREFIX)) { throw new IllegalArgumentException("Cannot parse an " + hdr + " authentication as Basic Auth"); } String usernamePassword = new String( Base64.decodeBase64(hdr.substring(BASIC_AUTH_PREFIX.length())), Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8")); int splitPos = usernamePassword.indexOf(':'); if (splitPos < 0) { username = usernamePassword; password = null; } else { username = usernamePassword.substring(0, splitPos); password = usernamePassword.substring(splitPos + 1); } }
Source:
<code>public Projection[] getProjections() { <START> if (projections != null) { <END> List<Projection> list = new ArrayList<Projection>(); list.addAll(Arrays.asList(projections)); return list.toArray(new Projection[projections.length]); } return null; }</code><technical_language>This belong in this PR fixed elsewhere</technical_language>

Target:
public List<Projection> getProjections() { return projections != null ? new ArrayList<Projection>(projections) : null; }
Source:
<code>public View getViewForHighlighting(Object element) { if (getHost() instanceof AndroidDescriptorHost) { <START> final AndroidDescriptorHost host = (AndroidDescriptorHost) getHost(); <END> Dialog dialog = mAccessor.getDialog(element); return host.getHighlightingView(dialog); } return null; }</code><technical_language>getHost again</technical_language>

Target:
public View getViewForHighlighting(Object element) { final Descriptor.Host host = getHost(); if (host instanceof AndroidDescriptorHost) { Dialog dialog = mAccessor.getDialog(element); return ((AndroidDescriptorHost) host).getHighlightingView(dialog); } return null; }
Source:
<code>public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) { return null; } FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); if (stack == null) { return null; } stack.amount = Math.min(stack.amount, maxDrain); if (doDrain) { <START> if (maxDrain >= stack.amount) <END> { container.stackTagCompound.removeTag("Fluid"); if (container.stackTagCompound.hasNoTags()) { container.stackTagCompound = null; } return stack; } NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); fluidTag.setInteger("Amount", fluidTag.getInteger("Amount") - stack.amount); container.stackTagCompound.setTag("Fluid", fluidTag); } return stack; }</code><technical_language>stack.amount = Math.min(stack.amount, maxDrain); maxDrain >= stack.amount this line... need original stack.amount</technical_language>

Target:
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) { return null; } FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); if (stack == null) { return null; } int currentAmount = stack.amount; stack.amount = Math.min(stack.amount, maxDrain); if (doDrain) { if (currentAmount == stack.amount) { container.stackTagCompound.removeTag("Fluid"); if (container.stackTagCompound.hasNoTags()) { container.stackTagCompound = null; } return stack; } NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); fluidTag.setInteger("Amount", currentAmount - stack.amount); container.stackTagCompound.setTag("Fluid", fluidTag); } return stack; }
Source:
<code>public void setDefaultExceptionHandler(final ExceptionHandler<? super T> exceptionHandler) { checkNotStarted(); if (!(this.exceptionHandler instanceof ExceptionHandlerWrapper)) { <START> throw new IllegalStateException("Mixing calls to handleExceptionsWith and setDefaultExceptionHandler is not supported."); <END> } ((ExceptionHandlerWrapper<T>)this.exceptionHandler).switchTo(exceptionHandler); }</code><technical_language>do disruptor().setDefaultHandler().handleExceptionsWith(), so, maybe, "mixing", "callToDefaultExceptionHandler is supported useless exceptionHandler overridden EventHandler specific ExceptionHandler handleExceptionWith()"</technical_language>

Target:
public void setDefaultExceptionHandler(final ExceptionHandler<? super T> exceptionHandler) { checkNotStarted(); if (!(this.exceptionHandler instanceof ExceptionHandlerWrapper)) { throw new IllegalStateException("setDefaultExceptionHandler can not be used after handleExceptionsWith"); } ((ExceptionHandlerWrapper<T>)this.exceptionHandler).switchTo(exceptionHandler); }
Source:
<code>public void testNoWorkDirMigration() throws Exception { Computer computer = j.jenkins.getComputer("Foo"); <START> Assert.assertThat(computer, instanceOf(SlaveComputer.class)); <END> SlaveComputer c = (SlaveComputer)computer; ComputerLauncher launcher = c.getLauncher(); Assert.assertThat(launcher, instanceOf(JNLPLauncher.class)); JNLPLauncher jnlpLauncher = (JNLPLauncher)launcher; assertNotNull("Work Dir Settings should be defined", jnlpLauncher.getWorkDirSettings()); assertTrue("Work directory should be disabled for the migrated agebt", jnlpLauncher.getWorkDirSettings().isDisabled()); }</code><technical_language>nit: static import for consistency</technical_language>

Target:
public void testNoWorkDirMigration() throws Exception { Computer computer = j.jenkins.getComputer("Foo"); assertThat(computer, instanceOf(SlaveComputer.class)); SlaveComputer c = (SlaveComputer)computer; ComputerLauncher launcher = c.getLauncher(); assertThat(launcher, instanceOf(JNLPLauncher.class)); JNLPLauncher jnlpLauncher = (JNLPLauncher)launcher; assertNotNull("Work Dir Settings should be defined", jnlpLauncher.getWorkDirSettings()); assertTrue("Work directory should be disabled for the migrated agent", jnlpLauncher.getWorkDirSettings().isDisabled()); }
Source:
<code>private void maybeDownloadServerLogs(ExecuteResponse resp, ActionKey actionKey) throws InterruptedException { ActionResult result = resp.getResult(); if (resp.getServerLogsCount() > 0 && (result.getExitCode() != 0 || resp.getStatus().getCode() != Code.OK.value())) { Path parent = logDir.getRelative(actionKey.getDigest().getHash()); Path logPath = null; int logCount = 0; for (Map.Entry<String, LogFile> e : resp.getServerLogsMap().entrySet()) { if (e.getValue().getHumanReadable()) { String key = e.getKey(); logPath = parent.getRelative(key); logCount++; try { getFromFuture(remoteCache.downloadFile(logPath, e.getValue().getDigest())); if (printServerLogOnFailure.contains(key)) { <START> report(Event.info(new String(Files.readAllBytes(Paths.get(logPath.getPathString())), UTF_8))); <END> } } catch (IOException ex) { reportOnce(Event.warn("Failed downloading server logs from the remote cache.")); } } } if (logCount > 0 && verboseFailures) { report( Event.info("Server logs of failing action:\n " + (logCount > 1 ? parent : logPath))); } } }</code><technical_language>Consider Event.of(EventKind kind, @Nullable Location location, byte[] messageBytes) method in order pass a byte[] array it. need a charset technically UTF-8 :-)</technical_language>

Target:
private void maybeDownloadServerLogs(ExecuteResponse resp, ActionKey actionKey) throws InterruptedException { ActionResult result = resp.getResult(); if (resp.getServerLogsCount() > 0 && (result.getExitCode() != 0 || resp.getStatus().getCode() != Code.OK.value())) { Path parent = logDir.getRelative(actionKey.getDigest().getHash()); Path logPath = null; int logCount = 0; for (Map.Entry<String, LogFile> e : resp.getServerLogsMap().entrySet()) { if (e.getValue().getHumanReadable()) { logPath = parent.getRelative(e.getKey()); logCount++; try { getFromFuture(remoteCache.downloadFile(logPath, e.getValue().getDigest())); } catch (IOException ex) { reportOnce(Event.warn("Failed downloading server logs from the remote cache.")); } } } if (logCount > 0 && verboseFailures) { report( Event.info("Server logs of failing action:\n " + (logCount > 1 ? parent : logPath))); } } }
Source:
<code>public List<Class<?>> traverseBundlesForOsgiServices() { <START> List<Class<?>> osgiClasses = new ArrayList<Class<?>>(); <END> for (Bundle bundle : bundles) { BundleContext context = bundle.getBundleContext(); ServiceReference ref = context.getServiceReference(PackageAdmin.class.getName()); PackageAdmin packageAdmin = (PackageAdmin) context.getService(ref); ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle); for (ExportedPackage ePackage : exportedPackages) { String packageName = ePackage.getName(); String packagePath = "/" + packageName.replace('.', '/'); Enumeration clazzes = bundle.findEntries(packagePath, "*.class", false); while (clazzes.hasMoreElements()) { URL url = (URL) clazzes.nextElement(); String className = getClassNameFromUrl(url); String fullClassName = packageName + "." + className; try { Class clazz = bundle.loadClass(fullClassName); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(OsgiService.class)) { Class fieldClass = field.getType(); if (!osgiClasses.contains(fieldClass)) { osgiClasses.add(fieldClass); } break; } } } catch (ClassNotFoundException e) { e.printStackTrace(); LOG.error("Class not found in the bundle!", e); } } } } return osgiClasses; }</code><technical_language>getClasses() method BundleClassesFinder job lines 124-139 for you</technical_language>

Target:
public Collection<Class<?>> traverseBundlesForOsgiServices() { Collection<Class<?>> allClasses = getClasses(); Set<Class<?>> osgiClasses = new HashSet<Class<?>>(); for (Class<?> clazz : allClasses) { Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(OsgiService.class)) { Class<?> fieldClass = field.getType(); osgiClasses.add(fieldClass); } } Constructor<?>[] constructors = clazz.getConstructors(); for (Constructor<?> constructor : constructors) { Class<?>[] parameterTypes = constructor.getParameterTypes(); Annotation[][] annotations = constructor.getParameterAnnotations(); for (int i = 0; i < parameterTypes.length; i++) { for (Annotation annotation : annotations[i]) { if (annotation.annotationType().equals(OsgiService.class)) { osgiClasses.add(parameterTypes[i]); } break; } } } } return osgiClasses; }
Source:
<code>public CraftingRecipeRegistry getCraftingRecipeRegistry() { <START> return new SpongeCraftingRecipeRegistry(); END> }</code><technical_language>Cache in SpongeCraftingRecipeRegistry</technical_language>

Target:
public CraftingRecipeRegistry getCraftingRecipeRegistry() { return SpongeCraftingRecipeRegistry.getInstance(); }
Source:
<code>public void getUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUser(new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }</code><technical_language>Add newline return</technical_language>

Target:
public void getUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUser(new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); }
Source:
<code>public Crn.Service eventSource(StructuredRestCallEvent structuredEvent) { <START> return Crn.Service.DATAHUB; <END> }</code><technical_language>decide if is a datalake</technical_language>

Target:
public Crn.Service eventSource(StructuredRestCallEvent structuredEvent) { String resourceType = structuredEvent.getOperation().getResourceType(); if (resourceType != null) { RestResourceAuditEventConverter restResourceAuditEventConverter = getConverter(resourceType); if (restResourceAuditEventConverter != null) { return restResourceAuditEventConverter.eventSource(structuredEvent); } } return null; }
Source:
<code>private List<Step> getAlignmentsSteps(String gappedSequenceString){ <START> List<Step> returnList = new ArrayList(); <END> for (char c: gappedSequenceString.toCharArray()){ if (c=='-') returnList.add(Step.GAP); else returnList.add(Step.COMPOUND); } return returnList; }</code><technical_language>missing type in ArrayList</technical_language>

Target:
private List<Step> getAlignmentsSteps(String gappedSequenceString){ List<Step> returnList = new ArrayList<Step>(); for (char c: gappedSequenceString.toCharArray()){ if (c=='-') returnList.add(Step.GAP); else returnList.add(Step.COMPOUND); } return returnList; }
Source:
<code><START> public synchronized int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { <END> SqlArguments args = new SqlArguments(uri, selection, selectionArgs); synchronized (mLock) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(args.table, values, args.where, args.args); if (count > 0) sendNotify(uri); return count; } }</code><technical_language>synchronizing "this" if synchronizing lock below</technical_language>

Target:
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { SqlArguments args = new SqlArguments(uri, selection, selectionArgs); synchronized (mLock) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(args.table, values, args.where, args.args); if (count > 0) sendNotify(uri); return count; } }
Source:
<code>private Runnable createPollTaskForStartOrder(long startOrder, PeriodicDatabasePoll periodicPollUpdate) { return () -> { ReentrantReadWriteLock.ReadLock lock = startStopPollLock.readLock(); lock.lock(); try { if (startOrder == currentStartPollingOrder) { poll(); periodicPollUpdate.firstPollCompletionFuture.complete(null); } else { log.debug("startOrder = currentStartPollingOrder = %d, skipping poll()", startOrder); } } catch (Throwable t) { <START> log.makeAlert(t, "Uncaught exception in " + getClass().getName() + "'s polling thread").emit(); <END> if (!(t instanceof Exception)) { periodicPollUpdate.firstPollCompletionFuture.completeExceptionally(t); throw t; } } finally { lock.unlock(); } }; }</code><technical_language>makeAlert supports embedded format strings, if that</technical_language>

Target:
private Runnable createPollTaskForStartOrder(long startOrder, PeriodicDatabasePoll periodicPollUpdate) { return () -> { ReentrantReadWriteLock.ReadLock lock = startStopPollLock.readLock(); lock.lock(); try { if (startOrder == currentStartPollingOrder) { poll(); periodicPollUpdate.firstPollCompletionFuture.complete(null); } else { log.debug("startOrder = currentStartPollingOrder = %d, skipping poll()", startOrder); } } catch (Throwable t) { log.makeAlert(t, "Uncaught exception in %s's polling thread", SQLMetadataSegmentManager.class).emit(); if (!(t instanceof Exception)) { periodicPollUpdate.firstPollCompletionFuture.completeExceptionally(t); throw t; } } finally { lock.unlock(); } }; }
Source:
<code>private void assertCoded() { <START> Assert.assertNotEquals(allergen.getCodedAllergen().getUuid(), otherNonCodedConceptUuid); <END> Assert.assertNull(allergen.getNonCodedAllergen()); Assert.assertTrue(allergen.isCoded()); }</code><technical_language>Allergen.getOtherNonCodedConceptUuid() instead of local variable otherNonCodedConceptUuid</technical_language>

Target:
private void assertCoded() { Assert.assertNotEquals(allergen.getCodedAllergen().getUuid(), Allergen.getOtherNonCodedConceptUuid()); Assert.assertNull(allergen.getNonCodedAllergen()); Assert.assertTrue(allergen.isCoded()); }
Source:
<code>private List<LogrotateAdditionalFile> getAllExtraFiles() { final List<SingularityExecutorLogrotateAdditionalFile> original = configuration.getLogrotateAdditionalFiles(); final List<LogrotateAdditionalFile> transformed = new ArrayList<>(original.size()); for (SingularityExecutorLogrotateAdditionalFile additionalFile : original) { String dateformat; if (additionalFile.getDateformat().isPresent()) { dateformat = additionalFile.getDateformat().get().startsWith("-") ? additionalFile.getDateformat().get().substring(1) : additionalFile.getDateformat().get(); } else { dateformat = configuration.getLogrotateExtrasDateformat().startsWith("-") ? configuration.getLogrotateExtrasDateformat().substring(1) : configuration.getLogrotateExtrasDateformat(); } <START> if (additionalFile.getLogrotateFrequencyOverride().isPresent() && <END> additionalFile.getLogrotateFrequencyOverride().get() == SingularityExecutorLogrotateFrequency.HOURLY) { transformed.add( new LogrotateAdditionalFile( taskDefinition.getTaskDirectoryPath().resolve(additionalFile.getFilename()).toString(), additionalFile.getExtension().or(Strings.emptyToNull(Files.getFileExtension(additionalFile.getFilename()))), dateformat, additionalFile.getLogrotateFrequencyOverride() )); } } return transformed; }</code><technical_language>method name is getAll, meant filter hourly still</technical_language>

Target:
private List<LogrotateAdditionalFile> getAllExtraFiles() { final List<SingularityExecutorLogrotateAdditionalFile> original = configuration.getLogrotateAdditionalFiles(); final List<LogrotateAdditionalFile> transformed = new ArrayList<>(original.size()); for (SingularityExecutorLogrotateAdditionalFile additionalFile : original) { String dateformat; if (additionalFile.getDateformat().isPresent()) { dateformat = additionalFile.getDateformat().get().startsWith("-") ? additionalFile.getDateformat().get().substring(1) : additionalFile.getDateformat().get(); } else { dateformat = configuration.getLogrotateExtrasDateformat().startsWith("-") ? configuration.getLogrotateExtrasDateformat().substring(1) : configuration.getLogrotateExtrasDateformat(); } transformed.add( new LogrotateAdditionalFile( taskDefinition.getTaskDirectoryPath().resolve(additionalFile.getFilename()).toString(), additionalFile.getExtension().or(Strings.emptyToNull(Files.getFileExtension(additionalFile.getFilename()))), dateformat, additionalFile.getLogrotateFrequencyOverride() )); } return transformed; }
Source:
<code>public @NonNull InetAddress getAddress() { try { return InetAddress.getByAddress(address); } catch (UnknownHostException e) { return <START> null; <END> } }</code><technical_language>Indeed, is suggestion. do this</technical_language>

Target:
public @NonNull InetAddress getAddress() { try { return InetAddress.getByAddress(address); } catch (UnknownHostException e) { throw new IllegalArgumentException("Address is invalid"); } }
Source:
<code>private static void checkComparability(ParseNode node, PDataType lhsDataType, PDataType rhsDataType) throws TypeMismatchException { <START> if(lhsDataType != null && rhsDataType != null) { <END> if(lhsDataType.isArrayType()) { if (!rhsDataType.isArrayType()) { PDataType baseType = PDataType.fromTypeId(lhsDataType .getSqlType() - Types.ARRAY); if (!(baseType.isComparableTo(rhsDataType))) { throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } } } else if(!lhsDataType.isComparableTo(rhsDataType)) throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } }</code><technical_language>surprised this is necessary. regular check: if (!lhsDataType.isComparableTo(rhsDataType)) cover this. it</technical_language>

Target:
private static void checkComparability(ParseNode node, PDataType lhsDataType, PDataType rhsDataType) throws TypeMismatchException { if(lhsDataType != null && rhsDataType != null && !lhsDataType.isComparableTo(rhsDataType)) { throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } }
Source:
<code>public static Optional<HiveBucketProperty> getBucketProperty(Map<String, Object> tableProperties) { List<String> bucketedBy = getBucketedBy(tableProperties); <START> if (bucketedBy == null) { <END> return Optional.empty(); } List<SortingColumn> sortedBy = getSortedBy(tableProperties); int bucketCount = (Integer) tableProperties.get(BUCKET_COUNT_PROPERTY); if ((bucketedBy.isEmpty()) && (bucketCount == 0)) { if (!sortedBy.isEmpty()) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s may be specified only when %s is specified", SORTED_BY_PROPERTY, BUCKETED_BY_PROPERTY)); } return Optional.empty(); } if (bucketCount < 0) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s must be greater than zero", BUCKET_COUNT_PROPERTY)); } if (bucketCount > 1_000_000) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s should be no more than 1000000", BUCKET_COUNT_PROPERTY)); } if (bucketedBy.isEmpty() || bucketCount == 0) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s and %s must be specified together", BUCKETED_BY_PROPERTY, BUCKET_COUNT_PROPERTY)); } return Optional.of(new HiveBucketProperty(bucketedBy, bucketCount, sortedBy)); }</code><technical_language>I changes needed. getBucketProperty called getColumnHandles(). (and also, suggested calling getColumnHandles() anyway)</technical_language>

Target:
public static Optional<HiveBucketProperty> getBucketProperty(Map<String, Object> tableProperties) { List<String> bucketedBy = getBucketedBy(tableProperties); List<SortingColumn> sortedBy = getSortedBy(tableProperties); int bucketCount = (Integer) tableProperties.get(BUCKET_COUNT_PROPERTY); if ((bucketedBy.isEmpty()) && (bucketCount == 0)) { if (!sortedBy.isEmpty()) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s may be specified only when %s is specified", SORTED_BY_PROPERTY, BUCKETED_BY_PROPERTY)); } return Optional.empty(); } if (bucketCount < 0) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s must be greater than zero", BUCKET_COUNT_PROPERTY)); } if (bucketCount > 1_000_000) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s should be no more than 1000000", BUCKET_COUNT_PROPERTY)); } if (bucketedBy.isEmpty() || bucketCount == 0) { throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s and %s must be specified together", BUCKETED_BY_PROPERTY, BUCKET_COUNT_PROPERTY)); } return Optional.of(new HiveBucketProperty(bucketedBy, bucketCount, sortedBy)); }
Source:
<code>private void configureAuditQueue(AuditConfig auditConfig) { if (null == auditConfig) { this.auditQueue = new NoopTaskQueue(); } else { String queueName = auditConfig.getAuditQueueName(); if (null == queueName) { this.auditQueue = new NoopTaskQueue(); } else { String queueType = auditConfig.getAuditQueueType(); <START> if (queueType.equalsIgnoreCase("RABBITMQ")) { <END> String host = auditConfig.getRabbitmqHost(); Integer port = auditConfig.getRabbitmqPort(); String vhost = auditConfig.getRabbitmqVhost(); String exchange = auditConfig.getRabbitmqExchange(); String username = auditConfig.getRabbitmqUsername(); String password = auditConfig.getRabbitmqPassword(); log.info("Configuring Audit queue with host: {}, port: {}, vhost: {}, exchange: {}, queue: {}", host, port, vhost, exchange, queueName); this.auditQueue = new RabbitMQTaskQueue(host, port, vhost, exchange, username, password, queueName); } else { this.auditQueue = new SQSTaskQueue(queueName); } } } }</code><technical_language>noted above, RABBITMQ enum constant</technical_language>

Target:
private void configureAuditQueue(AuditConfig auditConfig) { if (null == auditConfig) { this.auditQueue = new NoopTaskQueue(); } else { String queueName = auditConfig.getAuditQueueName(); if (null == queueName) { this.auditQueue = new NoopTaskQueue(); } else { QueueType queueType = auditConfig.getQueueType(); if (queueType == QueueType.RABBITMQ) { String host = auditConfig.getRabbitmqHost(); Integer port = auditConfig.getRabbitmqPort(); String vhost = auditConfig.getRabbitmqVhost(); String exchange = auditConfig.getRabbitmqExchange(); String username = auditConfig.getRabbitmqUsername(); String password = auditConfig.getRabbitmqPassword(); log.info("Configuring Audit queue with host: {}, port: {}, vhost: {}, exchange: {}, queue: {}", host, port, vhost, exchange, queueName); this.auditQueue = new RabbitMQTaskQueue(host, port, vhost, exchange, username, password, queueName); } else { this.auditQueue = new SQSTaskQueue(queueName); } } } }
Source:
<code>private static boolean detectSSL(MultiAddress multiaddress) { <START> return multiaddress.toString().contains("https"); <END> }</code><technical_language>if domain name some other part happened https in it</technical_language>

Target:
private static boolean detectSSL(MultiAddress multiaddress) { return multiaddress.toString().contains("/https"); }
Source:
<code>public static String fetchDataFromUri(String endpoint) { String data = null; <START> try(DefaultHttpClient client = new DefaultHttpClient()) { <END> HttpUriRequest req = new HttpGet(endpoint); req.addHeader("Content-Type", "text/xml"); HttpResponse resp = client.execute(req); StatusLine statusLine = resp.getStatusLine(); if (statusLine.getStatusCode() != 200) { log.error("Failed to retrieve data from " + endpoint + ". Error code " + statusLine.getStatusCode() + ". Reason: " + statusLine.getReasonPhrase()); } else { data = IOUtils.toString(resp.getEntity().getContent(), "UTF-8"); } } catch (Exception e) { log.error("Failed to retireve data from " + endpoint + ". Error: " + e.getMessage() + ". Stack Trace: " + e.getStackTrace()); } return data; }</code><technical_language>DefaultHttpClient deprecated. want: java try(CloseableHttpClient client = HttpClientBuilder.create().build()) { ... }</technical_language>

Target:
public static String fetchDataFromUri(String endpoint) { String data = null; try(CloseableHttpClient client = HttpClientBuilder.create().build()) { HttpUriRequest req = new HttpGet(endpoint); req.addHeader("Content-Type", "text/xml"); HttpResponse resp = client.execute(req); StatusLine statusLine = resp.getStatusLine(); if (statusLine.getStatusCode() != 200) { log.error("Failed to retrieve data from " + endpoint + ". Error code " + statusLine.getStatusCode() + ". Reason: " + statusLine.getReasonPhrase()); } else { data = IOUtils.toString(resp.getEntity().getContent(), "UTF-8"); } } catch (Exception e) { log.error("Failed to retireve data from " + endpoint + ". Error: " + e.getMessage() + ". Stack Trace: " + e.getStackTrace()); } return data; }
Source:
<code>public boolean redirectProviderCanDoRainSnowIce(WorldProvider provider, Chunk chunk) { boolean canDoRainSnowIce = provider.canDoRainSnowIce(chunk); if (!canDoRainSnowIce) return canDoRainSnowIce; int updateLCG1 = this.updateLCG * 3 + 1013904223; int j2 = updateLCG1 >> 2; int j = chunk.x * 16; int k = chunk.z * 16; <START> BlockPos blockpos1 = chunk.getPrecipitationHeight(new BlockPos(j + (j2 & 15), 0, k + (j2 >> 8 & 15))); <END> BlockPos blockpos2 = blockpos1.down(); if (!this.isAreaLoaded(blockpos1, blockpos2)) return false; return canDoRainSnowIce; }</code><technical_language>change meaningful names, methods Coords</technical_language>

Target:
public boolean redirectProviderCanDoRainSnowIce(WorldProvider provider, Chunk chunk) { boolean canDoRainSnowIce = provider.canDoRainSnowIce(chunk); if (!canDoRainSnowIce) return canDoRainSnowIce; int updateLCG1 = this.updateLCG * 3 + 1013904223; int localXZAddress = updateLCG1 >> 2; int blockX = Coords.localToBlock(chunk.x, Bits.unpackUnsigned(localXZAddress, 4, 0)); int blockZ = Coords.localToBlock(chunk.z, Bits.unpackUnsigned(localXZAddress, 4, 8)); BlockPos blockpos1 = chunk.getPrecipitationHeight(new BlockPos(blockX, 0, blockZ)); BlockPos blockpos2 = blockpos1.down(); if (!this.isAreaLoaded(blockpos1, blockpos2)) return false; return canDoRainSnowIce; }
Source:
<code>private static boolean isWithinExitFunction(RaiseStatement finallyClause) { <START> Tree functionParent = TreeUtils.firstAncestorOfKind(finallyClause, Tree.Kind.FUNCDEF); <END> while (functionParent != null) { FunctionDef functionDef = (FunctionDef) functionParent; if (functionDef.name().name().equals("__exit__")) { return true; } functionParent = TreeUtils.firstAncestorOfKind(functionDef, Tree.Kind.FUNCDEF); } return false; }</code><technical_language>I like: java TreeUtils.firstAncestor(finallyClause, t -> t.is(Tree.Kind.FUNCDEF) && ((FunctionDef) t).name().name().equals("__exit__")) If feel it, I nice add a utility method in TreeUtils check function name. java static boolean isFunctionWithName(Tree tree, String name) { return tree.is(FUNCDEF) && ((FuncDef) tree).name().name().equals(name); } do think</technical_language>

Target:
private static boolean isWithinExitFunction(RaiseStatement finallyClause) { return TreeUtils.firstAncestor(finallyClause, t -> t.is(Tree.Kind.FUNCDEF) && ((FunctionDef) t).name().name().equals("__exit__")) != null; }
Source:
<code>public void deleteNonExisting() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, "A name", "A namespace") <START> .build(); <END> Integer id = metadataSchema.getID(); getClient(getAuthToken(admin.getEmail(), password)) .perform(delete("/api/core/metadataschemas/" + id)) .andExpect(status().isNoContent()); getClient(getAuthToken(admin.getEmail(), password)) .perform(delete("/api/core/metadataschemas/" + id)) .andExpect(status().isNotFound()); }</code><technical_language>turn auth system creating test data</technical_language>

Target:
public void deleteNonExisting() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, "A name", "A namespace") .build(); context.restoreAuthSystemState(); Integer id = metadataSchema.getID(); getClient(getAuthToken(admin.getEmail(), password)) .perform(delete("/api/core/metadataschemas/" + id)) .andExpect(status().isNoContent()); getClient(getAuthToken(admin.getEmail(), password)) .perform(delete("/api/core/metadataschemas/" + id)) .andExpect(status().isNotFound()); }
Source:
<code>public void quickRun() { EventManager eventManager = new EventManager(); try { int aEventId = eventManager.createAsync(60); System.out.println("Event [" + aEventId + "] has been created."); eventManager.start(aEventId); System.out.println("Event [" + aEventId + "] has been started."); int sEventId = eventManager.create(60); System.out.println("Event [" + sEventId + "] has been created."); eventManager.start(sEventId); System.out.println("Event [" + sEventId + "] has been started."); eventManager.status(aEventId); eventManager.status(sEventId); eventManager.cancel(aEventId); System.out.println("Event [" + aEventId + "] has been stopped."); eventManager.cancel(sEventId); System.out.println("Event [" + sEventId + "] has been stopped."); <START> <END> } catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException | InvalidOperationException e) { System.out.println(e.getMessage()); } }</code><technical_language>change output tells talking sync async event. For example "Async event [xxx] created" "Sync event [xxx] created"</technical_language>

Target:
public void quickRun() { EventManager eventManager = new EventManager(); try { int aEventId = eventManager.createAsync(60); System.out.println("Async Event [" + aEventId + "] has been created."); eventManager.start(aEventId); System.out.println("Async Event [" + aEventId + "] has been started."); int sEventId = eventManager.create(60); System.out.println("Sync Event [" + sEventId + "] has been created."); eventManager.start(sEventId); System.out.println("Sync Event [" + sEventId + "] has been started."); eventManager.status(aEventId); eventManager.status(sEventId); eventManager.cancel(aEventId); System.out.println("Async Event [" + aEventId + "] has been stopped."); eventManager.cancel(sEventId); System.out.println("Sync Event [" + sEventId + "] has been stopped."); } catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException | InvalidOperationException e) { System.out.println(e.getMessage()); } }
Source:
<code>public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { String snippet = getSnippet("group"); snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%icon%", escapeURLPath(itemUIRegistry.getIcon(w))); snippet = StringUtils.replace(snippet, "%label%", getLabel(w)); <START> String style = ""; <END> String color = itemUIRegistry.getLabelColor(w); if(color != null) style = "color:"+ color; snippet = StringUtils.replace(snippet, "%labelstyle%", style); style = ""; color = itemUIRegistry.getValueColor(w); if(color != null) style = "color:"+ color; snippet = StringUtils.replace(snippet, "%valuestyle%", style); sb.append(snippet); return null; }</code><technical_language>This new section moved AbstractWidgetRenderer, subclasses (similar e.g. getLabel())</technical_language>

Target:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { String snippet = getSnippet("group"); snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%icon%", escapeURLPath(itemUIRegistry.getIcon(w))); snippet = StringUtils.replace(snippet, "%label%", getLabel(w)); snippet = processColor(w, snippet); sb.append(snippet); return null; }
Source:
<code>private File createLinkTextileMarkup() throws IOException { File markupFile = new File(tempFolder, "link.textile"); PrintWriter writer = new PrintWriter(new FileWriter(markupFile)); try { <START> writer.println("\"intern-label\":#intern-label"); <END> writer.println(); writer.println("\"extern-label\":<LINK_0>"); writer.println(); } finally { writer.close(); } return markupFile; }</code><technical_language>consider making label anchor text</technical_language>

Target:
private File createLinkTextileMarkup() throws IOException { File markupFile = new File(tempFolder, "link.textile"); PrintWriter writer = new PrintWriter(new FileWriter(markupFile)); try { writer.println("\"INTERN-LABEL\":#intern_label"); writer.println(); writer.println("\"*INTERN-BOLD-LABEL*\":#intern_bold_label"); writer.println(); writer.println("\"EXTERN-LABEL\":<LINK_0>"); writer.println(); } finally { writer.close(); } return markupFile; }
Source:
<code>protected InstantOperatorInfo getInstantOpInfo() { final InstantOperatorInfo.Builder iOpInfoBuilder = InstantOperatorInfo.newBuilder(); iOpInfoBuilder.setInstantOperatorType(InstantOperatorTypeEnum.AGGREGATE_WINDOW); final List<ByteBuffer> serializedFunctionList = new ArrayList<>(); serializedFunctionList.add(ByteBuffer.wrap(SerializationUtils.serialize(updateStateFunc))); <START> serializedFunctionList.add(ByteBuffer.wrap(SerializationUtils.serialize(produceResultFunc))); <END> iOpInfoBuilder.setFunctions(serializedFunctionList); iOpInfoBuilder.setKeyIndex(null); return iOpInfoBuilder.build(); }</code><technical_language>serialise initialisation function</technical_language>

Target:
protected InstantOperatorInfo getInstantOpInfo() { final InstantOperatorInfo.Builder iOpInfoBuilder = InstantOperatorInfo.newBuilder(); iOpInfoBuilder.setInstantOperatorType(InstantOperatorTypeEnum.AGGREGATE_WINDOW); final List<ByteBuffer> serializedFunctionList = new ArrayList<>(); serializedFunctionList.add(ByteBuffer.wrap(SerializationUtils.serialize(updateStateFunc))); serializedFunctionList.add(ByteBuffer.wrap(SerializationUtils.serialize(produceResultFunc))); serializedFunctionList.add(ByteBuffer.wrap(SerializationUtils.serialize(initializeStateSup))); iOpInfoBuilder.setFunctions(serializedFunctionList); iOpInfoBuilder.setKeyIndex(null); return iOpInfoBuilder.build(); }
Source:
<code>private static void validateMaximumValue(String key, WebService.Param definition, String value) { Integer maximumValue = definition.maximumValue(); if (maximumValue == null) { return; } int valueAsInt = parseInt(value); <START> checkArgument(valueAsInt <= maximumValue, "'%s' parameter (value '%s') must be less than %s", key, valueAsInt, maximumValue); <END> }</code><technical_language>suggestion: '%s' ('%s') is greater maximum authorized (%s) - point is consistent error messages</technical_language>

Target:
private static void validateMaximumValue(String key, WebService.Param definition, String value) { Integer maximumValue = definition.maximumValue(); if (maximumValue == null) { return; } int valueAsInt = validateAsNumeric(key, value); checkArgument(valueAsInt <= maximumValue, "'%s' value (%s) must be less than %s", key, valueAsInt, maximumValue); }