auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public byte[] transform(String name, String transformedName, @Nullable byte[] basicClass) { if (basicClass == null) return null; ClassNode classNode = new ClassNode(); ClassReader classReader = new ClassReader(basicClass); <START> classReader.accept(classNode, 0); <END> if ((classNode.access & ACC_ENUM) == 0) return basicClass; for (FieldNode f : classNode.fields) { if ((f.name.equals("$VALUES") || f.name.equals("ENUM$VALUES")) && (f.access & ACC_STATIC) != 0) { f.access &= ~ACC_FINAL; } } ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); classNode.accept(writer); return writer.toByteArray(); }</code><technical_language>Oboy, creating a ClassNode for class ever, check super class is Enum in transformer</technical_language>

Target:
public byte[] transform(String name, String transformedName, @Nullable byte[] basicClass) { if (basicClass == null) return null; ClassReader classReader = new ClassReader(basicClass); if ((classReader.getAccess() & ACC_ENUM) == 0) return basicClass; ClassNode classNode = new ClassNode(); classReader.accept(classNode, 0); for (FieldNode f : classNode.fields) { if ((f.name.equals("$VALUES") || f.name.equals("ENUM$VALUES")) && (f.access & ACC_STATIC) != 0) { f.access &= ~ACC_FINAL; } } ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); classNode.accept(writer); return writer.toByteArray(); }
Source:
<code>protected String getStagingLocation() { String result = null; @SuppressWarnings("rawtypes") Iterator i = mets.getDescendants(new ElementFilter("stagingLocation", JDOMNamespaceUtil.SIMPLE_METS_PROFILE_NS)); while(i.hasNext()) { Element e = (Element)i.next(); String loc = e.getTextTrim(); <START> if(loc.length() > 0) result = loc; <END> } return result; }</code><technical_language>reason return staging location one</technical_language>

Target:
protected String getStagingLocation() { String result = null; @SuppressWarnings("rawtypes") Iterator i = mets.getDescendants(new ElementFilter("stagingLocation", JDOMNamespaceUtil.SIMPLE_METS_PROFILE_NS)); while(i.hasNext()) { Element e = (Element)i.next(); String loc = e.getTextTrim(); if(loc.length() > 0) { result = loc; break; } } return result; }
Source:
<code>public void testCoLocationConstraintThrowsException() { final ExecutionSlotAllocator executionSlotAllocator = createExecutionSlotAllocator(); final CoLocationConstraint coLocationConstraint = new CoLocationGroup().getLocationConstraint(0); <START> final List<ExecutionVertexSchedulingRequirements> schedulingRequirements = Arrays.asList( <END> new ExecutionVertexSchedulingRequirements.Builder() .withExecutionVertexId(new ExecutionVertexID(new JobVertexID(), 0)) .withCoLocationConstraint(coLocationConstraint) .build() ); executionSlotAllocator.allocateSlotsFor(schedulingRequirements); }</code><technical_language>suggestion final List<ExecutionVertexSchedulingRequirements> schedulingRequirements = Collections.singletonList(</technical_language>

Target:
public void testCoLocationConstraintThrowsException() { final ExecutionSlotAllocator executionSlotAllocator = createExecutionSlotAllocator(); final CoLocationConstraint coLocationConstraint = new CoLocationGroup().getLocationConstraint(0); final List<ExecutionVertexSchedulingRequirements> schedulingRequirements = Collections.singletonList( new ExecutionVertexSchedulingRequirements.Builder() .withExecutionVertexId(new ExecutionVertexID(new JobVertexID(), 0)) .withCoLocationConstraint(coLocationConstraint) .build() ); executionSlotAllocator.allocateSlotsFor(schedulingRequirements); }
Source:
<code>private static List<String> buildArguments(ProxyConfig proxyConfig, String npmRegistryURL) { List<String> arguments = new ArrayList<String>(); if(npmRegistryURL != null && !npmRegistryURL.isEmpty()){ arguments.add ("--registry=" + npmRegistryURL); } if(!proxyConfig.isEmpty()){ Proxy proxy = null; if(npmRegistryURL != null && !npmRegistryURL.isEmpty()){ proxy = proxyConfig.getProxyForUrl(npmRegistryURL); } if(proxy == null){ proxy = proxyConfig.getSecureProxy(); } if(proxy == null){ proxy = proxyConfig.getInsecureProxy(); } arguments.add("--https-proxy=" + proxy.getUri().toString()); arguments.add("--proxy=" + proxy.getUri().toString()); <START> arguments.add("--noproxy=" + proxy.getNonProxyHosts()); <END> } return arguments; }</code><technical_language>handle cases nonProxyHosts is empty absent this needs a null/empty check avoid --noproxy=null --noproxy=</technical_language>

Target:
static List<String> buildArguments(ProxyConfig proxyConfig, String npmRegistryURL) { List<String> arguments = new ArrayList<String>(); if(npmRegistryURL != null && !npmRegistryURL.isEmpty()){ arguments.add ("--registry=" + npmRegistryURL); } if(!proxyConfig.isEmpty()){ Proxy proxy = null; if(npmRegistryURL != null && !npmRegistryURL.isEmpty()){ proxy = proxyConfig.getProxyForUrl(npmRegistryURL); } if(proxy == null){ proxy = proxyConfig.getSecureProxy(); } if(proxy == null){ proxy = proxyConfig.getInsecureProxy(); } arguments.add("--https-proxy=" + proxy.getUri().toString()); arguments.add("--proxy=" + proxy.getUri().toString()); final String nonProxyHosts = proxy.getNonProxyHosts(); if (nonProxyHosts != null && !nonProxyHosts.isEmpty()) { arguments.add("--noproxy=" + nonProxyHosts); } } return arguments; }
Source:
<code>public Job recoverWriteJob(final UUID jobId) throws SignatureException, IOException, XmlProcessingException, JobRecoveryException { <START> ModifyJobResponse jobResponse = this.client.modifyJob(new ModifyJobRequest(jobId)); <END> if (RequestType.PUT != jobResponse.getMasterObjectList().getRequestType()){ throw new JobRecoveryException("PUT", jobResponse.getMasterObjectList().getRequestType().toString() ); } return new WriteJobImpl(this.client, jobResponse.getMasterObjectList()); }</code><technical_language>Missing final</technical_language>

Target:
public Ds3ClientHelpers.Job recoverWriteJob(final UUID jobId) throws SignatureException, IOException, XmlProcessingException, JobRecoveryException { final ModifyJobResponse jobResponse = this.client.modifyJob(new ModifyJobRequest(jobId)); if (RequestType.PUT != jobResponse.getMasterObjectList().getRequestType()){ throw new JobRecoveryException(RequestType.PUT.toString(), jobResponse.getMasterObjectList().getRequestType().toString() ); } return new WriteJobImpl(this.client, jobResponse.getMasterObjectList()); }
Source:
<code>public void run(ExtendedHiveMetastore metastore) { try { metastore.createTable(table, privileges); done = true; } <START> catch (Throwable t) { <END> try { Optional<Table> remoteTable = metastore.getTable(table.getDatabaseName(), table.getTableName()); if (remoteTable.isPresent() && getPrestoQueryId(remoteTable.get()).equals(getPrestoQueryId(table))) { done = true; } } catch (Throwable ignored) { } if (!done) { throw t; } } }</code><technical_language>this PrestoException. want catch Error, other RuntimeException a weird error happen</technical_language>

Target:
public void run(ExtendedHiveMetastore metastore) { try { metastore.createTable(table, privileges); done = true; } catch (RuntimeException e) { try { Optional<Table> remoteTable = metastore.getTable(table.getDatabaseName(), table.getTableName()); if (remoteTable.isPresent() && getPrestoQueryId(remoteTable.get()).equals(getPrestoQueryId(table))) { done = true; } } catch (RuntimeException ignored) { } if (!done) { throw e; } } }
Source:
<code>private synchronized void loadConfigs() { try (InputStream is = settingsFacade.getRawConfig(CONFIG_FILE_NAME)) { String jsonText = IOUtils.toString(is); LOGGER.debug("Loading {}", CONFIG_FILE_NAME); Gson gson = new Gson(); configs = gson.fromJson(jsonText, Configs.class); } catch (Exception e) { String message = String.format("There seems to be a problem with the json text in %s: %s", CONFIG_FILE_NAME, e.getMessage()); LOGGER.debug(message); throw new JsonIOException(message, e); } <START> for (Config config : configs.getConfigList()) { <END> configMap.put(config.getName(), config); } defaultConfig = configs.getDefaultConfig(); }</code><technical_language>create new map. contains configs, for example if contains key_1 add new configs remowe old(key_1) in UI this map contains key_1 config</technical_language>

Target:
private synchronized void loadConfigs() { try (InputStream is = settingsFacade.getRawConfig(CONFIG_FILE_NAME)) { String jsonText = IOUtils.toString(is); LOGGER.debug("Loading {}", CONFIG_FILE_NAME); Gson gson = new Gson(); configs = gson.fromJson(jsonText, Configs.class); } catch (Exception e) { String message = String.format("There seems to be a problem with the json text in %s: %s", CONFIG_FILE_NAME, e.getMessage()); LOGGER.debug(message); throw new JsonIOException(message, e); } configMap = new HashMap<>(); for (Config config : configs.getConfigList()) { configMap.put(config.getName(), config); } defaultConfig = configs.getDefaultConfig(); }
Source:
<code>public String getLayerConfigPath(String layer, String configFileName) throws Exception { LayerInfo layerInfo = catalog.getLayerByName(layer); String layerDirectory = dataDirectory.get(layerInfo).dir().getAbsolutePath(); String layerConfigFilePath = layerDirectory + "/" + configFileName; if (new File(layerConfigFilePath).exists()) { return layerConfigFilePath.replace(this.resourceDirectory.getAbsolutePath().toString()+"/",""); } File storeDirectory = dataDirectory.findStoreDir(layerInfo.getResource().getStore()); String storeConfigFilePath = storeDirectory.toString() + "/" + configFileName; if (new File(storeConfigFilePath).exists()) { return storeConfigFilePath.replace(this.resourceDirectory.getAbsolutePath().toString()+"/",""); } <START> throw new Exception("Unable to find config file for layer " + layer); <END> }</code><technical_language>global config</technical_language>

Target:
public String getLayerConfigPath(String layer, String configFileName) throws Exception { LayerInfo layerInfo = catalog.getLayerByName(layer); String layerDirectory = dataDirectory.get(layerInfo).dir().getAbsolutePath(); String layerConfigFilePath = layerDirectory + "/" + configFileName; if (new File(layerConfigFilePath).exists()) { return layerConfigFilePath.replace(this.resourceDirectory.getAbsolutePath().toString()+"/",""); } File storeDirectory = dataDirectory.findStoreDir(layerInfo.getResource().getStore()); String storeConfigFilePath = storeDirectory.toString() + "/" + configFileName; if (new File(storeConfigFilePath).exists()) { return storeConfigFilePath.replace(this.resourceDirectory.getAbsolutePath().toString()+"/",""); } return getDefaultConfigFile(); }
Source:
<code><START> public static void postProblem(String email, String location, String room, String problem, String description, String photo, Callback<Response> callback) { <END> RestAdapter restAdapter = new RestAdapter.Builder() .setEndpoint("<LINK_0>") .build(); MitFacilityService service = restAdapter.create(MitFacilityService.class); service._post_problem(email, location, room, problem, description, photo, callback); }</code><technical_language>I Alex put this in originally I missed -- building new RestAdapter Service expensive undertaking. static MIT_FACILITY_SERVICE top of class file POST request</technical_language>

Target:
public static void postProblem(String email, String location, String room, String problem, String description, String photo, Callback<Response> callback) { MIT_FACILITY_SERVICE._post_problem(email, location, room, problem, description, photo, callback); }
Source:
<code>protected IPath getCompilationPath(ISourceContainer[] containers, String sourceName) { for (ISourceContainer container : containers) { if (container instanceof IMappingSourceContainer) { if (container instanceof MappingSourceContainer <START> && ((MappingSourceContainer) container).isMappingWithBackendEnabled()) { <END> return null; } return ((IMappingSourceContainer) container).getCompilationPath(sourceName); } ISourceContainer[] childContainers = null; try { childContainers = container.getSourceContainers(); } catch (CoreException e) { } if (childContainers != null) { IPath path = getCompilationPath(childContainers, sourceName); if (path != null) { return path; } } } return null; }</code><technical_language>I need check if this mapping applies 'sourceName'. For example if mapping is /home/marc/src -> /home/marc/bin sourceName is /lib/myLib.c this mapping apply need next container. about: if (container instanceof IMappingSourceContainer) { IPath mappedPath = ((IMappingSourceContainer) container).getCompilationPath(sourceName); if (mappedPath != null) { // path mapping is applicable sourceName // check if backend is handling mappings automatically if (container instanceof MappingSourceContainer && ((MappingSourceContainer) container).isMappingWithBackendEnabled()) { /* * This mapping handled GDB backend (i.e. * collected collectSubstitutionsPaths pass gdb's * "set substitute-path"). * * containers do * director requesting compilation path supports backend * mapping rely call getCompilationPath * need force a null here. */ return new Path(sourceName); } return mappedPath; } }</technical_language>

Target:
protected IPath getCompilationPath(ISourceContainer[] containers, String sourceName) { for (ISourceContainer container : containers) { if (container instanceof IMappingSourceContainer) { if (container instanceof MappingSourceContainer && ((MappingSourceContainer) container).isMappingWithBackendEnabled()) { } else { IPath path = ((IMappingSourceContainer) container).getCompilationPath(sourceName); if (path != null) { return path; } } } else if (container.isComposite()) { ISourceContainer[] childContainers = null; try { childContainers = container.getSourceContainers(); } catch (CoreException e) { } if (childContainers != null) { IPath path = getCompilationPath(childContainers, sourceName); if (path != null) { return path; } } } } return null; }
Source:
<code>public Page getNextPage() { try { batchId++; int batchSize = recordReader.nextBatch(); if (batchSize <= 0) { close(); return null; } completedPositions += batchSize; long filePosition = recordReader.getFilePosition(); Optional<BitSet> rowsDeleted = deltaShardLoader.get(); RowsToKeepResult rowsToKeep = loadRowsToKeep(rowsDeleted, batchSize, filePosition); Block[] blocks = new Block[columnIndexes.length]; for (int fieldId = 0; fieldId < blocks.length; fieldId++) { if (constantBlocks[fieldId] != null) { <START> blocks[fieldId] = constantBlocks[fieldId].getRegion(0, rowsToKeep.isKeepAll ? batchSize : rowsToKeep.size()); <END> } else if (columnIndexes[fieldId] == ROWID_COLUMN) { blocks[fieldId] = buildSequenceBlock(filePosition, batchSize, rowsToKeep); } else { blocks[fieldId] = new LazyBlock(batchSize, new OrcBlockLoader(columnIndexes[fieldId], rowsToKeep)); } } return new Page(rowsToKeep.isKeepAll ? batchSize : rowsToKeep.size(), blocks); } catch (IOException | RuntimeException e) { closeWithSuppression(e); throw new PrestoException(RAPTOR_ERROR, e); } }</code><technical_language>getter instead of raw variables</technical_language>

Target:
public Page getNextPage() { try { batchId++; int batchSize = recordReader.nextBatch(); if (batchSize <= 0) { close(); return null; } completedPositions += batchSize; long filePosition = recordReader.getFilePosition(); RowsToKeepResult rowsToKeep = deltaShardLoader.getRowsToKeep(batchSize, filePosition); Block[] blocks = new Block[columnIndexes.length]; for (int fieldId = 0; fieldId < blocks.length; fieldId++) { if (constantBlocks[fieldId] != null) { blocks[fieldId] = constantBlocks[fieldId].getRegion(0, rowsToKeep.keepAll() ? batchSize : rowsToKeep.size()); } else if (columnIndexes[fieldId] == ROWID_COLUMN) { blocks[fieldId] = buildSequenceBlock(filePosition, batchSize, rowsToKeep); } else { blocks[fieldId] = new LazyBlock(batchSize, new OrcBlockLoader(columnIndexes[fieldId], rowsToKeep)); } } return new Page(rowsToKeep.keepAll() ? batchSize : rowsToKeep.size(), blocks); } catch (IOException | RuntimeException e) { closeWithSuppression(e); throw new PrestoException(RAPTOR_ERROR, e); } }
Source:
<code>public void test() { connect(); click(findButtonByContent("setWidth(\"300px\")")); waitResponse(); <START> Assert.assertEquals(getToolbarChildrenLength(), 2); <END> JQuery overflowButton = jq(".z-toolbar-overflow > .z-icon-ellipsis-v"); Assert.assertTrue(overflowButton.isVisible()); click(overflowButton); waitResponse(); Assert.assertEquals(getPopupChildrenLength(), 4); click(findButtonByContent("setWidth(\"500px\")")); waitResponse(); Assert.assertEquals(getToolbarChildrenLength(), 4); click(overflowButton); waitResponse(); Assert.assertEquals(getPopupChildrenLength(), 2); click(findButtonByContent("setWidth(\"700px\")")); waitResponse(); Assert.assertEquals(getToolbarChildrenLength(), 6); Assert.assertFalse(overflowButton.isVisible()); }</code><technical_language>length depends theme, if dropdown exist sth else, verify length > 0, a + b = total</technical_language>

Target:
public void test() { driver = connect(); JQuery overflowButton = jq(".z-toolbar-overflowpopup-button"); click(jq("$setWidth200")); waitResponse(); Assert.assertTrue(overflowButton.isVisible()); click(overflowButton); waitResponse(); Assert.assertTrue(getNumberOfPopupChildren() > 0); Assert.assertEquals(6, getNumberOfToolbarChildren() + getNumberOfPopupChildren()); click(jq("$resetWidth")); waitResponse(); driver.manage().window().maximize(); waitResponse(); Assert.assertFalse(overflowButton.isVisible()); Assert.assertEquals(6, getNumberOfToolbarChildren()); }
Source:
<code>public static boolean convertSegment(File toConvert, File converted, IndexSpec indexSpec, boolean forceIfCurrent) throws IOException { final int version = SegmentUtils.getVersionFromDir(toConvert); switch (version) { case 1: case 2: case 3: log.makeAlert("Attempt to load segment of version <= 3.") .addData("version", version) .emit(); return false; case 4: case 5: case 6: case 7: log.info("Old version, re-persisting."); IndexMerger.append( Arrays.<IndexableAdapter>asList(new QueryableIndexIndexableAdapter(loadIndex(toConvert))), converted, indexSpec ); return true; case 8: DefaultIndexIOHandler.convertV8toV9(toConvert, converted, indexSpec); return true; default: if(forceIfCurrent){ <START> IndexMerger.reprocess(toConvert, converted, indexSpec); <END> DefaultIndexIOHandler.validateTwoSegments(toConvert, converted); return true; } else { log.info("Version[%s], skipping.", version); return false; } } }</code><technical_language>call this convert consistent</technical_language>

Target:
public static boolean convertSegment(File toConvert, File converted, IndexSpec indexSpec, boolean forceIfCurrent) throws IOException { final int version = SegmentUtils.getVersionFromDir(toConvert); switch (version) { case 1: case 2: case 3: log.makeAlert("Attempt to load segment of version <= 3.") .addData("version", version) .emit(); return false; case 4: case 5: case 6: case 7: log.info("Old version, re-persisting."); IndexMerger.append( Arrays.<IndexableAdapter>asList(new QueryableIndexIndexableAdapter(loadIndex(toConvert))), converted, indexSpec ); return true; case 8: DefaultIndexIOHandler.convertV8toV9(toConvert, converted, indexSpec); return true; default: if (forceIfCurrent) { IndexMaker.convert(toConvert, converted, indexSpec); DefaultIndexIOHandler.validateTwoSegments(toConvert, converted); return true; } else { log.info("Version[%s], skipping.", version); return false; } } }
Source:
<code><START> public synchronized void removeMatching(MetricFilter filter) { <END> for (String name : getNames()) { if (filter.matches(name, metrics.get(name))) remove(name); } }</code><technical_language>This synchronized, else in MetricRegistry this lock</technical_language>

Target:
public void removeMatching(MetricFilter filter) { Iterator<String> namesIterator = metrics.keySet().iterator(); while (namesIterator.hasNext()) { String name = namesIterator.next(); Metric metric = metrics.get(name); if (metric != null && filter.matches(name, metric)) { namesIterator.remove(); onMetricRemoved(name, metric); } } }
Source:
<code>FilterSupportStatus isTypedFilterSupported(FilterContext context, ColumnRangeFilter filter) { <START> int familyCount = context.getScan().getFamilyMap().size(); <END> if (familyCount != 1) { return FilterSupportStatus.newNotSupported(UNSUPPORTED_EXCEPTION_MESSAGE); } return FilterSupportStatus.SUPPORTED; }</code><technical_language>getScan().numFamilies()</technical_language>

Target:
FilterSupportStatus isTypedFilterSupported(FilterContext context, ColumnRangeFilter filter) { int familyCount = context.getScan().numFamilies(); if (familyCount != 1) { return FilterSupportStatus.newNotSupported(UNSUPPORTED_EXCEPTION_MESSAGE); } return FilterSupportStatus.SUPPORTED; }
Source:
<code>@Override protected void readExternalData( byte protoVer, ObjectInput in ) throws IOException, ClassNotFoundException { partRes = readMap(in); if (protoVer >= V2) idxRes = readMap(in); if (protoVer >= V3) integrityCheckFailures = readCollection(in); <START> if (protoVer >= V4) <END> checkSizeRes = readMap(in); }</code><technical_language>Well, Apache Ignite support rolling upgrade feature, is reason for *V4* on</technical_language>

Target:
@Override protected void readExternalData( byte protoVer, ObjectInput in ) throws IOException, ClassNotFoundException { partRes = readMap(in); idxRes = readMap(in); integrityCheckFailures = readCollection(in); checkSizeRes = readMap(in); }
Source:
<code>public void connect(SocketAddress endpoint, int timeout) throws IOException { long startedAt = System.currentTimeMillis(); timeout = Math.max(timeout, 10_000); while (true) { try { channel = new AsynchronousFileByteChannel( AsynchronousFileChannel.open( Paths.get(socketFileName), StandardOpenOption.READ, StandardOpenOption.WRITE ) ); break; <START> } catch (FileNotFoundException e) { <END> if (System.currentTimeMillis() - startedAt >= timeout) { throw new RuntimeException(e); } else { Kernel32.INSTANCE.WaitNamedPipe(socketFileName, 100); } } } }</code><technical_language>I if catch NoSuchFileException now</technical_language>

Target:
public void connect(SocketAddress endpoint, int timeout) throws IOException { long startedAt = System.currentTimeMillis(); timeout = Math.max(timeout, 10_000); while (true) { try { channel = new AsynchronousFileByteChannel( AsynchronousFileChannel.open( Paths.get(socketFileName), StandardOpenOption.READ, StandardOpenOption.WRITE ) ); break; } catch (NoSuchFileException e) { if (System.currentTimeMillis() - startedAt >= timeout) { throw new RuntimeException(e); } else { Kernel32.INSTANCE.WaitNamedPipe(socketFileName, 100); } } } }
Source:
<code>private int numMethodsRelatedByAttributeAccess(Map<String, Set<String>> usagesByMethod) { List<String> methods = new ArrayList<>(usagesByMethod.keySet()); int methodCount = methods.size(); int pairs = 0; if (methodCount > 1) { for (int i = 0; i < methodCount; i++) { <START> for (int j = i + 1; j < methodCount; j++) { <END> String firstMethodName = methods.get(i); String secondMethodName = methods.get(j); if (!Collections.disjoint(usagesByMethod.get(firstMethodName), usagesByMethod.get(secondMethodName))) { pairs++; } } } } return pairs; }</code><technical_language>compare in method - i == j. I condition for out loop i "i < methodCount - 1"</technical_language>

Target:
private int numMethodsRelatedByAttributeAccess(Map<String, Set<String>> usagesByMethod) { List<String> methods = new ArrayList<>(usagesByMethod.keySet()); int methodCount = methods.size(); int pairs = 0; if (methodCount > 1) { for (int i = 0; i < methodCount - 1; i++) { for (int j = i + 1; j < methodCount; j++) { String firstMethodName = methods.get(i); String secondMethodName = methods.get(j); if (!Collections.disjoint(usagesByMethod.get(firstMethodName), usagesByMethod.get(secondMethodName))) { pairs++; } } } } return pairs; }
Source:
<code>public static synchronized CacheManager get(AlluxioConfiguration conf) throws IOException { if (sCacheManager == null) { try { sCacheManager = Optional.of(create(conf)); } catch (IOException e) { sCacheManager = Optional.empty(); <START> throw e; <END> } } return sCacheManager.orElse(null); }</code><technical_language>Do need throw exception here, I thought null signal of failed create</technical_language>

Target:
public static synchronized CacheManager get(AlluxioConfiguration conf) throws IOException { if (sCacheManager == null) { sCacheManager = create(conf); } return sCacheManager; }
Source:
<code>public IdentityHashMap<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { <START> IdentityHashMap<TableScanNode, Void> ret = new IdentityHashMap<>(); <END> ret.put(node, null); return ret; }</code><technical_language>Map<TableScanNode, Void> result = new IdentityHashMap<>();</technical_language>

Target:
public Map<TableScanNode, Void> visitTableScan(TableScanNode node, Void context) { Map<TableScanNode, Void> ret = new IdentityHashMap<>(); ret.put(node, null); return ret; }
Source:
<code>public int getLaunchTimeoutInMillis() { <START> return launchTimeout * 1000; <END> }</code><technical_language>if this overflows</technical_language>

Target:
public long getLaunchTimeoutInMillis() { return (long)launchTimeout * 1000L; }
Source:
<code>public synchronized void close() throws IOException { if (m_closed) { return; } m_closed = true; <START> for (ReadCursor cursor : m_readCursors.values()) { <END> cursor.close(); } m_readCursors.clear(); for (PBDSegment segment : m_segments.values()) { segment.close(); } m_cursorsWriter.close(); m_closed = true; }</code><technical_language>Shouldnt close cursors setting m_closed=true</technical_language>

Target:
public synchronized void close() throws IOException { if (m_closed) { return; } m_readCursors.clear(); for (PBDSegment segment : m_segments.values()) { segment.close(); } m_cursorsWriter.close(); m_closed = true; }
Source:
<code>public void readsManyChunks() throws IOException { final String first = "Takes is"; final String second = "a true object-"; final String third = "oriented framework"; final String data = first + second + third; final Integer length = data.length(); final InputStream stream = new RqChunk( new RqFake( Arrays.asList( <START> "GET /h?a=2", <END> "Host: b.example.com", CHUNKED_HEADER ), Joiner.on(CRLF).join( Integer.toHexString(first.length()), first, Integer.toHexString(second.length()), second, Integer.toHexString(third.length()), third, END_OF_CHUNK ) ) ).body(); final byte[] buf = new byte[length]; MatcherAssert.assertThat( stream.read(buf), Matchers.equalTo(length) ); MatcherAssert.assertThat(buf, Matchers.equalTo(data.getBytes())); MatcherAssert.assertThat(stream.available(), Matchers.equalTo(0)); }</code><technical_language>@HDouss invalid chunk</technical_language>

Target:
public void readsManyChunks() throws IOException { final String first = "Takes is"; final String second = "a true object-"; final String third = "oriented framework"; final String data = first + second + third; final Integer length = data.length(); final InputStream stream = new RqChunk( new RqFake( Arrays.asList( "GET /h?a=2", "Host: b.example.com", CHUNKED_HEADER ), Joiner.on(CRLF).join( Integer.toHexString(first.length()), first, Integer.toHexString(second.length()), second, Integer.toHexString(third.length()), third, END_OF_CHUNK, "" ) ) ).body(); final byte[] buf = new byte[length]; MatcherAssert.assertThat( stream.read(buf), Matchers.equalTo(length) ); MatcherAssert.assertThat(buf, Matchers.equalTo(data.getBytes())); MatcherAssert.assertThat(stream.available(), Matchers.equalTo(0)); }
Source:
<code>public Void call() throws Exception { final ClusterNodeManager clusterNodeManager = this.clusterContext.nodeManagers.get(this.nodeName); if (clusterNodeManager == null) { <START> logger.debug("Cannot create EJBReceiver since no cluster node manager found for node " <END> + nodeName + " in cluster context for cluster " + clusterName); return null; } final EJBReceiver ejbReceiver = clusterNodeManager.getEJBReceiver(); if (ejbReceiver == null) { return null; } this.clusterContext.registerEJBReceiver(ejbReceiver); return null; }</code><technical_language>f method instead of StringBuilder concats</technical_language>

Target:
public Void call() throws Exception { final ClusterNodeManager clusterNodeManager = this.clusterContext.nodeManagers.get(this.nodeName); if (clusterNodeManager == null) { logger.debugf("Cannot create EJBReceiver since no cluster node manager found for node %s in cluster context for cluster %s", nodeName, clusterName); return null; } final EJBReceiver ejbReceiver = clusterNodeManager.getEJBReceiver(); if (ejbReceiver == null) { return null; } this.clusterContext.registerEJBReceiver(ejbReceiver); return null; }
Source:
<code>public void init() { asyncExec.init(); EventDispatcherDescriptor dispatcherDescriptor = dispatchers.getDispatcherDescriptor(); if (dispatcherDescriptor != null) { List<EventPipeDescriptor> pipes = registeredPipes.getPipes(); <START> if (pipes.size() > 0) { <END> pipeDispatcher = dispatcherDescriptor.getInstance(); pipeDispatcher.init(pipes, dispatcherDescriptor.getParameters()); } } }</code><technical_language>if (!pipes.isEmpty())</technical_language>

Target:
public void init() { asyncExec.init(); EventDispatcherDescriptor dispatcherDescriptor = dispatchers.getDispatcherDescriptor(); if (dispatcherDescriptor != null) { List<EventPipeDescriptor> pipes = registeredPipes.getPipes(); if (!pipes.isEmpty()) { pipeDispatcher = dispatcherDescriptor.getInstance(); pipeDispatcher.init(pipes, dispatcherDescriptor.getParameters()); } } }
Source:
<code>public void testStatsManagerWithProblematicStores() throws StoreException, IOException { <START> Map<PartitionId, Store> problematicStoreMap = new HashMap<>(); <END> problematicStoreMap.put(getTestPartitionId(1), null); problematicStoreMap.put(getTestPartitionId(2), new MockBlobStore(new MockBlobStoreStats(null, true))); StatsManager testStatsManager = new StatsManager(new MockStorageManager(problematicStoreMap), new ArrayList<>(storeMap.keySet()), new MetricRegistry(), config, new MockTime()); ; List<String> unreachableStores = new ArrayList<>(); StatsSnapshot actualSnapshot = new StatsSnapshot(0L, null); for (PartitionId partitionId : problematicStoreMap.keySet()) { testStatsManager.collectAndAggregate(actualSnapshot, partitionId, unreachableStores); } assertEquals("Aggregated StatsSnapshot should not contain any value", 0L, actualSnapshot.getValue().longValue()); assertEquals("Unreachable store count mismatch with expected value", 2, unreachableStores.size()); }</code><technical_language>a test in, some stores healthy some bad. expectation is aggregated is healthy</technical_language>

Target:
public void testStatsManagerWithProblematicStores() throws StoreException, IOException { Map<PartitionId, Store> problematicStoreMap = new HashMap<>(); problematicStoreMap.put(new Partition(1, PartitionState.READ_WRITE, CAPACITY), null); Store exceptionStore = new MockBlobStore(new MockBlobStoreStats(null, true)); problematicStoreMap.put(new Partition(2, PartitionState.READ_WRITE, CAPACITY), exceptionStore); StatsManager testStatsManager = new StatsManager(new MockStorageManager(problematicStoreMap), new ArrayList<>(problematicStoreMap.keySet()), new MetricRegistry(), config, new MockTime()); List<String> unreachableStores = new ArrayList<>(); StatsSnapshot actualSnapshot = new StatsSnapshot(0L, null); for (PartitionId partitionId : problematicStoreMap.keySet()) { testStatsManager.collectAndAggregate(actualSnapshot, partitionId, unreachableStores); } assertEquals("Aggregated StatsSnapshot should not contain any value", 0L, actualSnapshot.getValue().longValue()); assertEquals("Unreachable store count mismatch with expected value", 2, unreachableStores.size()); Map<PartitionId, Store> mixedStoreMap = new HashMap<>(storeMap); unreachableStores.clear(); mixedStoreMap.put(new Partition(3, PartitionState.READ_WRITE, CAPACITY), null); mixedStoreMap.put(new Partition(4, PartitionState.READ_WRITE, CAPACITY), exceptionStore); testStatsManager = new StatsManager(new MockStorageManager(mixedStoreMap), new ArrayList<>(mixedStoreMap.keySet()), new MetricRegistry(), config, new MockTime()); actualSnapshot = new StatsSnapshot(0L, null); for (PartitionId partitionId : mixedStoreMap.keySet()) { testStatsManager.collectAndAggregate(actualSnapshot, partitionId, unreachableStores); } assertTrue("Actual aggregated StatsSnapshot does not match with expected snapshot", preAggregatedSnapshot.equals(actualSnapshot)); assertEquals("Unreachable store count mismatch with expected value", 2, unreachableStores.size()); }
Source:
<code><START> public static void setEventIndexName(String eventIndexName) { <END> ElasticFlowRepository.eventIndexName = eventIndexName; }</code><technical_language>This method static. For reasons above. Additionally a good idea check input for null adding value: Objects.requireNonNull(eventIndexName)</technical_language>

Target:
public void setEventIndexName(String eventIndexName) { Objects.requireNonNull(eventIndexName); this.eventIndexName = eventIndexName; }
Source:
<code>public void shouldWrapConnectorException() throws Exception { when(gerritConnector.listFiles()).thenThrow(new IOException("Connection refused")); catchException(fixture).listFiles(); assertThat(caughtException()).isInstanceOf(GerritException.class); <START> assertThat(caughtException()).hasMessageContaining("Error listing files"); <END> }</code><technical_language>assertThat is fluent chain assertions here, line line</technical_language>

Target:
public void shouldWrapConnectorException() throws Exception { when(gerritConnector.listFiles()).thenThrow(new IOException("Connection refused")); catchException(fixture).listFiles(); assertThat(caughtException()) .isInstanceOf(GerritException.class) .hasMessageContaining("Error listing files"); }
Source:
<code>public ListenableFuture<Optional<LabelMeta>> getLabelMeta(final LabelType type, final LabelId id) { <START> return transform(labelClient.getLabelName(type, id), <END> new AsyncFunction<Optional<String>, Optional<LabelMeta>>() { @Override public ListenableFuture<Optional<LabelMeta>> apply(final Optional<String> name) throws Exception { if (name.isPresent()) { return store.getMeta(id, type); } return immediateFailedFuture(new LabelException(id, type, "Could not find label meta information for id " + id + " and " + type)); } }); }</code><technical_language>Checking this is redundant return Optional<LabelMeta></technical_language>

Target:
public ListenableFuture<Optional<LabelMeta>> getLabelMeta(final LabelType type, final LabelId id) { return store.getMeta(id, type); }
Source:
<code>public void testToolCreation(){ <START> ApiClient webClient = getWebClient("admin@admin.com"); <END> HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); Assert.assertNotNull("tool was not created properly", hostedTool); Assert.assertEquals("One user should belong to this tool, yourself",1, hostedTool.getUsers().size()); hostedTool.getUsers().forEach(user -> { Assert.assertNotNull("createHostedTool() endpoint should have user profiles", user.getUserProfiles()); user.setUserProfiles(null); }); assertTrue("tool was not created with a valid id", hostedTool.getId() != 0); ContainersApi oldApi = new ContainersApi(webClient); DockstoreTool container = oldApi.getContainer(hostedTool.getId()); hostedTool.setAliases(null); container.setAliases(null); Assert.assertEquals(container, hostedTool); Assert.assertEquals(1, container.getUsers().size()); container.getUsers().forEach(user -> { Assert.assertNull("getContainer() endpoint should not have user profiles", user.getUserProfiles()); }); }</code><technical_language>"admin@admin.com" is pretty repetitive, a constant in BaseIT</technical_language>

Target:
public void testToolCreation(){ ApiClient webClient = getWebClient(ADMIN_USERNAME); HostedApi api = new HostedApi(webClient); DockstoreTool hostedTool = api.createHostedTool("awesomeTool", "cwl", "quay.io", "coolNamespace"); Assert.assertNotNull("tool was not created properly", hostedTool); Assert.assertEquals("One user should belong to this tool, yourself",1, hostedTool.getUsers().size()); hostedTool.getUsers().forEach(user -> { Assert.assertNotNull("createHostedTool() endpoint should have user profiles", user.getUserProfiles()); user.setUserProfiles(null); }); assertTrue("tool was not created with a valid id", hostedTool.getId() != 0); ContainersApi oldApi = new ContainersApi(webClient); DockstoreTool container = oldApi.getContainer(hostedTool.getId()); hostedTool.setAliases(null); container.setAliases(null); Assert.assertEquals(container, hostedTool); Assert.assertEquals(1, container.getUsers().size()); container.getUsers().forEach(user -> { Assert.assertNull("getContainer() endpoint should not have user profiles", user.getUserProfiles()); }); }
Source:
<code>void layoutShell() { Display display = txtQuickAccess.getDisplay(); Rectangle tempBounds = txtQuickAccess.getBounds(); Rectangle compBounds = display.map(txtQuickAccess, null, tempBounds); int preferredWidth = dialogWidth == -1 ? (int) <START> (txtQuickAccess.getShell().getBounds().width <END> * 0.6) : dialogWidth; int width = Math.max(preferredWidth, compBounds.width); int height = dialogHeight == -1 ? (int) (txtQuickAccess.getShell().getBounds().height * 0.9) : dialogHeight; Rectangle shellBounds = txtQuickAccess.getShell().getBounds(); if (compBounds.x + width > shellBounds.x + shellBounds.width){ compBounds.x = Math.max(shellBounds.x, (compBounds.x + compBounds.width - width)); } shell.setBounds(getConstrainedShellBounds(display, new Rectangle(compBounds.x, compBounds.y + compBounds.height, width, height))); shell.layout(); }</code><technical_language>please extract this, code more readable</technical_language>

Target:
void layoutShell() { Display display = txtQuickAccess.getDisplay(); Rectangle tempBounds = txtQuickAccess.getBounds(); Rectangle compBounds = display.map(txtQuickAccess, null, tempBounds); Rectangle shellBounds = txtQuickAccess.getShell().getBounds(); int preferredWidth = dialogWidth == -1 ? Math.min(300, (int) (shellBounds.width * 0.6)) : dialogWidth; int width = Math.max(preferredWidth, compBounds.width); int height = dialogHeight == -1 ? Math.min(200, (int) (shellBounds.height * 0.9)) : dialogHeight; if (compBounds.x + width > shellBounds.x + shellBounds.width){ compBounds.x = Math.max(shellBounds.x, (compBounds.x + compBounds.width - width)); } shell.setBounds(getConstrainedShellBounds(display, new Rectangle(compBounds.x, compBounds.y + compBounds.height, width, height))); shell.layout(); }
Source:
<code>private int repositoryPathChecksumComparator(RepositoryPath p1, RepositoryPath p2) { Boolean isChecksumP1; Boolean isChecksumP2; isChecksumP1 = ThrowingFunction.unchecked(RepositoryFiles::isChecksum).apply(p1); isChecksumP2 = ThrowingFunction.unchecked(RepositoryFiles::isChecksum).apply(p2); if (isChecksumP1 && isChecksumP2) { return p1.compareTo(p2); } return isChecksumP1 ? 1 : -1; <START> } <END></code><technical_language>add throws IOException TrwoingComparator interface deployArtifact method</technical_language>

Target:
private int repositoryPathChecksumComparator(RepositoryPath p1, RepositoryPath p2) throws IOException { Boolean isChecksumP1; Boolean isChecksumP2; isChecksumP1 = RepositoryFiles.isChecksum(p1); isChecksumP2 = RepositoryFiles.isChecksum(p1); if (isChecksumP1 && isChecksumP2) { return p1.compareTo(p2); } return isChecksumP1 ? 1 : -1; }
Source:
<code>private void wrapEntryForPutIfNeeded(InvocationContext ctx, AbstractDataWriteCommand command) throws Throwable { if (shouldWrap(command.getKey(), ctx, command)) { <START> entryFactory.wrapEntryForPut(ctx, command.getKey(), null, false, command, <END> command.hasFlag(Flag.IGNORE_RETURN_VALUES) && !command.isConditional()); } }</code><technical_language>some invocations optimized. skip read ignore return values flags is for example. Although, need check if key exists trigger correct notification</technical_language>

Target:
private void wrapEntryForPutIfNeeded(InvocationContext ctx, AbstractDataWriteCommand command) throws Throwable { if (shouldWrap(command.getKey(), ctx, command)) { boolean skipRead = command.hasFlag(Flag.IGNORE_RETURN_VALUES) && !command.isConditional(); entryFactory.wrapEntryForWriting(ctx, command.getKey(), EntryFactory.Wrap.WRAP_ALL, skipRead, false); } }
Source:
<code><START> public boolean checkMutualAncestors(Person person, Campaign campaign) { <END> return checkMutualAncestors(person.getGenealogy(), campaign, campaign.getCampaignOptions().checkMutualAncestorsDepth()); }</code><technical_language>I this is ripe for unit tests, removing relations tree is pruned</technical_language>

Target:
public boolean checkMutualAncestors(Person person, Campaign campaign) { if (getOrigin().equals(person.getId())) { return true; } final int depth = campaign.getCampaignOptions().checkMutualAncestorsDepth(); if (depth == 0) { return false; } Set<UUID> originAncestors = getAncestors(depth, campaign); Set<UUID> checkAncestors = person.getGenealogy().getAncestors(depth, campaign); for (UUID id : checkAncestors) { if (originAncestors.contains(id)) { return true; } } return false; }
Source:
<code>public ConfigResolveOptions appendResolver(ConfigResolver value) { if (value == null) { <START> throw new NullPointerException("null resolver passed to appendResolver"); <END> } else if (value == this.resolver) { return this; } else { return new ConfigResolveOptions(useSystemEnvironment, allowUnresolved, this.resolver.withFallback(value)); } }</code><technical_language>this ConfigException.BugOrBroken probably, I a lot of library bother check null</technical_language>

Target:
public ConfigResolveOptions appendResolver(ConfigResolver value) { if (value == null) { throw new ConfigException.BugOrBroken("null resolver passed to appendResolver"); } else if (value == this.resolver) { return this; } else { return new ConfigResolveOptions(useSystemEnvironment, allowUnresolved, this.resolver.withFallback(value)); } }
Source:
<code>public void close() { try (Closer closer = Closer.create()) { closer.register(userAggregateMemoryContext::close); closer.register(revocableAggregateMemoryContext::close); closer.register(systemAggregateMemoryContext::close); <START> userLocalMemoryContext.close(); <END> revocableLocalMemoryContext.close(); systemLocalMemoryContext.close(); } catch (IOException e) { throw new RuntimeException("Exception closing memory tracking context", e); } }</code><technical_language>closer.register(...::close), above</technical_language>

Target:
public void close() { try (Closer closer = Closer.create()) { closer.register(userAggregateMemoryContext::close); closer.register(revocableAggregateMemoryContext::close); closer.register(systemAggregateMemoryContext::close); closer.register(userLocalMemoryContext::close); closer.register(revocableLocalMemoryContext::close); closer.register(systemLocalMemoryContext::close); } catch (IOException e) { throw new RuntimeException("Exception closing memory tracking context", e); } }
Source:
<code><START> public <B> Eval<B> map(final F<A, B> f) { <END> return bind(a -> now(f.f(a))); }</code><technical_language>final</technical_language>

Target:
public final <B> Eval<B> map(final F<A, B> f) { return bind(a -> now(f.f(a))); }
Source:
<code>public static FusionSchemaIndexProvider newInstance( PageCache pageCache, File storeDir, FileSystemAbstraction fs, LogProvider logProvider, Config config, OperationalMode operationalMode, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector ) { IndexDirectoryStructure.Factory childDirectoryStructure = subProviderDirectoryStructure( storeDir ); boolean readOnly = isReadOnly( config, operationalMode ); NativeSchemaNumberIndexProvider nativeProvider = new NativeSchemaNumberIndexProvider( pageCache, childDirectoryStructure, logProvider, recoveryCleanupWorkCollector, readOnly ); <START> LuceneSchemaIndexProvider luceneProvider = LuceneSchemaIndexProviderFactory.create( fs, childDirectoryStructure, logProvider, config, <END> operationalMode ); boolean useNativeIndex = config.get( GraphDatabaseSettings.enable_native_schema_index ); int priority = useNativeIndex ? PRIORITY : 0; return new FusionSchemaIndexProvider( directoriesByProvider( storeDir ), nativeProvider, luceneProvider, new NativeSelector(), DESCRIPTOR, priority ); }</code><technical_language>Long lines</technical_language>

Target:
public static FusionSchemaIndexProvider newInstance( PageCache pageCache, File storeDir, FileSystemAbstraction fs, LogProvider logProvider, Config config, OperationalMode operationalMode, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector ) { IndexDirectoryStructure.Factory childDirectoryStructure = subProviderDirectoryStructure( storeDir ); boolean readOnly = isReadOnly( config, operationalMode ); NativeSchemaNumberIndexProvider nativeProvider = new NativeSchemaNumberIndexProvider( pageCache, fs, childDirectoryStructure, logProvider, recoveryCleanupWorkCollector, readOnly ); LuceneSchemaIndexProvider luceneProvider = LuceneSchemaIndexProviderFactory.create( fs, childDirectoryStructure, logProvider, config, operationalMode ); boolean useNativeIndex = config.get( GraphDatabaseSettings.enable_native_schema_index ); int priority = useNativeIndex ? PRIORITY : 0; return new FusionSchemaIndexProvider( nativeProvider, luceneProvider, new NativeSelector(), DESCRIPTOR, priority, directoriesByProvider( storeDir ), fs ); }
Source:
<code>public void removeIndex( final String indexName ) { <START> CloseableIterator<InternalDataAdapter<?>> it = adapterStore.getAdapters(); <END> final ArrayList<Short> markedAdapters = new ArrayList<Short>(); while (it.hasNext()) { final InternalDataAdapter<?> dataAdapter = it.next(); final AdapterToIndexMapping adapterIndexMap = indexMappingStore.getIndicesForAdapter(dataAdapter .getAdapterId()); final String[] indexNames = adapterIndexMap.getIndexNames(); for (int i = 0; i < indexNames.length; i++) { if (indexNames[i].equals(indexName)) { if (indexNames.length == 1) { throw new IllegalStateException( "Index removal failed. Adapters require at least one index."); } else { markedAdapters.add(adapterIndexMap.getAdapterId()); continue; } } } } it.close(); for (int i = 0; i < markedAdapters.size(); i++) { final short adapterId = markedAdapters.get(i); baseOperations.deleteAll( indexName, "", adapterId); statisticsStore.removeAllStatistics(adapterId); indexMappingStore.remove( adapterId, indexName); } indexStore.removeIndex(indexName); }</code><technical_language>try resources</technical_language>

Target:
public void removeIndex( final String indexName ) { final ArrayList<Short> markedAdapters = new ArrayList<>(); try (CloseableIterator<InternalDataAdapter<?>> it = adapterStore.getAdapters()) { while (it.hasNext()) { final InternalDataAdapter<?> dataAdapter = it.next(); final AdapterToIndexMapping adapterIndexMap = indexMappingStore.getIndicesForAdapter(dataAdapter .getAdapterId()); final String[] indexNames = adapterIndexMap.getIndexNames(); for (int i = 0; i < indexNames.length; i++) { if (indexNames[i].equals(indexName)) { if (indexNames.length == 1) { throw new IllegalStateException( "Index removal failed. Adapters require at least one index."); } else { markedAdapters.add(adapterIndexMap.getAdapterId()); continue; } } } } } for (int i = 0; i < markedAdapters.size(); i++) { final short adapterId = markedAdapters.get(i); baseOperations.deleteAll( indexName, internalAdapterStore.getTypeName(adapterId), adapterId); statisticsStore.removeAllStatistics(adapterId); indexMappingStore.remove( adapterId, indexName); } indexStore.removeIndex(indexName); }
Source:
<code>public DataTablesResponseDto<RunDto> dataTableByPlatform(@PathVariable("platform") String platform, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { PlatformType platformType = PlatformType.valueOf(platform); if (platformType == null) { <START> throw new RestException("Invalid platform type."); <END> } return jQueryBackend.get(request, response, uriBuilder, PaginationFilter.platformType(platformType)); }</code><technical_language>This default returning HTTP 500 (Internal Server Error). Include Status.BAD_REQUEST constructor parameter return HTTP 400 instead</technical_language>

Target:
public DataTablesResponseDto<RunDto> dataTableByPlatform(@PathVariable("platform") String platform, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { PlatformType platformType = PlatformType.valueOf(platform); if (platformType == null) { throw new RestException("Invalid platform type.", Status.BAD_REQUEST); } return jQueryBackend.get(request, response, uriBuilder, PaginationFilter.platformType(platformType)); }