auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void should_not_loose_InnerClasses_attribute() throws Exception { <END> final ClassWriter cw = new ClassWriter(0); final ClassReader cr = new ClassReader( TargetLoader.getClassDataAsBytes(Inner.class)); cr.accept(new ClassVisitor(InstrSupport.ASM_API_VERSION, cw) { @Override public void visitEnd() { final MethodVisitor mv = cv.visitMethod(0, "m", "()V", null, null); mv.visitCode(); addCauseOfResizeInstructions(mv); mv.visitMaxs(2, 1); mv.visitEnd(); super.visitEnd(); } }, 0); final byte[] bytes = instrumenter.instrument(cw.toByteArray(), ""); final TargetLoader targetLoader = new TargetLoader(); final Class<?> outer = targetLoader.add(ResizeInstructionsTest.class, TargetLoader.getClassDataAsBytes(ResizeInstructionsTest.class)); final Class<?> inner = targetLoader.add(Inner.class, bytes); assertSame(outer, inner.getEnclosingClass()); assertNotNull(inner.getEnclosingClass()); assertSame(outer, inner.getDeclaringClass()); assertNotNull(inner.getDeclaringClass()); }</code><technical_language>upgrade this test fails JDK 5 due another ASM bug - <LINK_0></technical_language>

Target:
public void should_not_loose_InnerClasses_attribute() throws Exception { final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); final ClassReader cr = new ClassReader( TargetLoader.getClassDataAsBytes(Inner.class)); cr.accept(new ClassVisitor(InstrSupport.ASM_API_VERSION, cw) { @Override public void visitEnd() { final MethodVisitor mv = cv.visitMethod(0, "m", "()V", null, null); mv.visitCode(); addCauseOfResizeInstructions(mv); mv.visitMaxs(2, 1); mv.visitEnd(); super.visitEnd(); } }, 0); final byte[] bytes = instrumenter.instrument(cw.toByteArray(), ""); final TargetLoader targetLoader = new TargetLoader(); final Class<?> outer = targetLoader.add(ResizeInstructionsTest.class, TargetLoader.getClassDataAsBytes(ResizeInstructionsTest.class)); final Class<?> inner = targetLoader.add(Inner.class, bytes); assertSame(outer, inner.getEnclosingClass()); assertNotNull(inner.getEnclosingClass()); assertSame(outer, inner.getDeclaringClass()); assertNotNull(inner.getDeclaringClass()); }
Source:
<code>public void visitName(Name name) { <START> if (!callGlobalsOrLocals && !hasWildcardImport && name.isVariable() && name.symbol() == null) { <END> nameIssues.computeIfAbsent(name.name(), k -> new ArrayList<>()).add(name); } }</code><technical_language>I drop !callGlobalsOrLocals && !hasWildcardImport this line</technical_language>

Target:
public void visitName(Name name) { if (name.isVariable() && name.symbol() == null) { nameIssues.computeIfAbsent(name.name(), k -> new ArrayList<>()).add(name); } }
Source:
<code>public void test_json_support_and_other_files() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); <START> assertThat("We should have 2 docs only...", awaitBusy(() -> { <END> try { SearchResponse response = elasticsearchClient.search(getCrawlerName(), FsCrawlerUtil.INDEX_TYPE_DOC, (String) null); return response.getHits().getTotal() == 3; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }</code><technical_language>2 3</technical_language>

Target:
public void test_json_support_and_other_files() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); assertThat("We should have 3 docs only...", awaitBusy(() -> { try { SearchResponse response = elasticsearchClient.search(getCrawlerName(), FsCrawlerUtil.INDEX_TYPE_DOC, (String) null); return response.getHits().getTotal() == 3; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }
Source:
<code>protected void waitForTasksToBeCleared() throws InterruptedException { while (true) { <START> Thread.sleep(3000); <END> List<Guid> tasks = getDbFacade().getAsyncTaskDao().getAsyncTaskIdsByEntity(getStorageDomainId()); if (tasks.isEmpty()) { return; } } }</code><technical_language>please TimeUnit.SECONDS.sleep(x), is more readable</technical_language>

Target:
protected void waitForTasksToBeCleared() throws InterruptedException { while (true) { TimeUnit.SECONDS.sleep(3); List<Guid> tasks = getDbFacade().getAsyncTaskDao().getAsyncTaskIdsByEntity(getStorageDomainId()); if (tasks.isEmpty()) { log.infoFormat("no tasks for the deactivated domain {0}, proceeding with deactivation", getStorageDomainId()); return; } } }
Source:
<code>private static Path getPath(String resource) throws Exception { String filePath = Resources.getResource(resource).getFile(); return (System.getProperty("os.name").toLowerCase().contains("win") <START> && filePath.charAt(0) == '/') <END> ? Paths.get(filePath.substring(1)) : Paths.get(filePath); }</code><technical_language>filePath.startsWith('/') instead of filePath.charAt(0) == '/'</technical_language>

Target:
private static Path getPath(String resource) throws Exception { String filePath = Resources.getResource(resource).getFile(); return Paths.get( System.getProperty("os.name").toLowerCase().contains("win") && filePath.startsWith("/") ? filePath.substring(1) : filePath); }
Source:
<code>public Mono<Response<Key>> getKeyWithResponse(String name, String version) { if (version == null) { return withContext(context -> getKey(name, "", context)); } <START> return withContext(context -> getKey(name, version, context)); <END> }</code><technical_language>this a simpler (and bug-prone), wise rewrite this method lines (it means duplicating code is a good for bugs creep in a date): java return withContext(context -> getKey(name, version == null ? "" : version, context));</technical_language>

Target:
public Mono<Response<Key>> getKeyWithResponse(String name, String version) { return withContext(context -> getKeyWithResponse(name, version == null ? "" : version, context)); }
Source:
<code>public void save(Writer writer) { JsonObject jsonObject = new JsonObject(); <START> for (Map.Entry<SimpleUri, Setting> entry : settings.entrySet()) { <END> Setting setting = entry.getValue(); if (!setting.getValue().equals(setting.getDefaultValue())) { jsonObject.add(entry.getKey().toString(), setting.getValueAsJson()); } } for (Map.Entry<SimpleUri, String> entry : temporarilyParkedSettings.entrySet()) { jsonObject.addProperty(entry.getKey().toString(), entry.getValue()); } gson.toJson(jsonObject, writer); }</code><technical_language>Please add this method functionality save a human-readable description of file content, opening file in notepad user sees. description stored a read-only description field set FC construction. load method simply ignore description finds in a file</technical_language>

Target:
public void save(Writer writer) { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty(DESCRIPTION_PROPERTY_NAME, description); for (Map.Entry<SimpleUri, Setting> entry : settings.entrySet()) { Setting setting = entry.getValue(); if (!setting.getValue().equals(setting.getDefaultValue())) { jsonObject.add(entry.getKey().toString(), setting.getValueAsJson()); } } for (Map.Entry<SimpleUri, String> entry : temporarilyParkedSettings.entrySet()) { jsonObject.addProperty(entry.getKey().toString(), entry.getValue()); } gson.toJson(jsonObject, writer); }
Source:
<code>public void testFindTaskEventsForNotExistingTask() { <START> String invalidId = "-9.999"; <END> try { taskClient.findTaskEvents(CONTAINER_ID, -9999L, 0, 10); fail("KieServicesException should be thrown when task not found"); } catch (KieServicesException e) { if(configuration.isRest()) { KieServerAssert.assertResultContainsString(e.getMessage(), "Could not find task instance with id \"" + invalidId + "\""); KieServicesHttpException httpEx = (KieServicesHttpException) e; assertEquals(Integer.valueOf(404), httpEx.getHttpCode()); } else { assertTrue(e.getMessage().contains("No task found with id " + invalidId)); } } catch (TaskNotFoundException tnfe) { assertTrue(tnfe.getMessage().contains("No task found with id " + invalidId)); } }</code><technical_language>work a thousand delimiter</technical_language>

Target:
public void testFindTaskEventsForNotExistingTask() { String invalidId = "-999"; try { taskClient.findTaskEvents(CONTAINER_ID, -999L, 0, 10); fail("KieServicesException should be thrown when task not found"); } catch (KieServicesException e) { if(configuration.isRest()) { KieServerAssert.assertResultContainsString(e.getMessage(), "Could not find task instance with id \"" + invalidId + "\""); KieServicesHttpException httpEx = (KieServicesHttpException) e; assertEquals(Integer.valueOf(404), httpEx.getHttpCode()); } else { assertTrue(e.getMessage().contains("No task found with id " + invalidId)); } } catch (TaskNotFoundException tnfe) { assertTrue(tnfe.getMessage().contains("No task found with id " + invalidId)); } }
Source:
<code>public void testGetFileIteratorWithBothBaseDirAndDuplicateFilesIteratingFilesOnlyOnce() throws IOException { File baseDir = temporaryFolder.newFolder(); List<File> filesInBaseDir = new ArrayList<>(); for (int i = 0; i < 10; i++) { final File file = File.createTempFile("local-input-source", ".data", baseDir); <START> try (FileWriter writer = new FileWriter(file)) { <END> writer.write("test"); } filesInBaseDir.add(file); } Set<File> files = new HashSet<>(filesInBaseDir.subList(0, 5)); for (int i = 0; i < 3; i++) { final File file = File.createTempFile("local-input-source", ".data", baseDir); try (FileWriter writer = new FileWriter(file)) { writer.write("test"); } files.add(file); } Set<File> expectedFiles = new HashSet<>(filesInBaseDir); expectedFiles.addAll(files); File.createTempFile("local-input-source", ".filtered", baseDir); Iterator<File> fileIterator = new LocalInputSource(baseDir, "*.data", files).getFileIterator(); Set<File> actualFiles = Streams.sequentialStreamFrom(fileIterator).collect(Collectors.toSet()); Assert.assertEquals(expectedFiles, actualFiles); }</code><technical_language>forbidden apis checks is flagging this: java.io.FileWriter [Uses default charset]</technical_language>

Target:
public void testGetFileIteratorWithBothBaseDirAndDuplicateFilesIteratingFilesOnlyOnce() throws IOException { File baseDir = temporaryFolder.newFolder(); List<File> filesInBaseDir = new ArrayList<>(); for (int i = 0; i < 10; i++) { final File file = File.createTempFile("local-input-source", ".data", baseDir); try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { writer.write("test"); } filesInBaseDir.add(file); } Set<File> files = new HashSet<>(filesInBaseDir.subList(0, 5)); for (int i = 0; i < 3; i++) { final File file = File.createTempFile("local-input-source", ".data", baseDir); try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { writer.write("test"); } files.add(file); } Set<File> expectedFiles = new HashSet<>(filesInBaseDir); expectedFiles.addAll(files); File.createTempFile("local-input-source", ".filtered", baseDir); Iterator<File> fileIterator = new LocalInputSource(baseDir, "*.data", files).getFileIterator(); Set<File> actualFiles = Streams.sequentialStreamFrom(fileIterator).collect(Collectors.toSet()); Assert.assertEquals(expectedFiles, actualFiles); }
Source:
<code>protected void run(Date lastRun) { HttpRequest request; try { request = HttpRequest.get("<LINK_0>"); } catch (HttpRequest.HttpRequestException e) { return; } JSONObject meta; try { <START> meta = new JSONObject(request.body()); <END> } catch (JSONException e) { throw new RuntimeException(e); } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); if (prefs.contains(PREFERENCE_KEY_ALPHA_COMMIT)) { if (!prefs.getString(PREFERENCE_KEY_ALPHA_COMMIT, "").equals(meta.optString("commit_hash", ""))) { showNotification(); } } prefs.edit().putString(PREFERENCE_KEY_ALPHA_COMMIT, meta.optString("commit_hash")).commit(); }</code><technical_language>request is executed this line. HttpRequestException caught here</technical_language>

Target:
protected void run(Date lastRun) { String responseJSON; try { HttpRequest request = HttpRequest.get("<LINK_0>"); responseJSON = request.body(); } catch (HttpRequest.HttpRequestException e) { return; } JSONObject meta; try { meta = new JSONObject(responseJSON); } catch (JSONException e) { throw new RuntimeException(e); } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); if (prefs.contains(PREFERENCE_KEY_ALPHA_COMMIT)) { if (!prefs.getString(PREFERENCE_KEY_ALPHA_COMMIT, "").equals(meta.optString("commit_hash", ""))) { showNotification(); } } prefs.edit().putString(PREFERENCE_KEY_ALPHA_COMMIT, meta.optString("commit_hash")).commit(); }
Source:
<code>private void addEdge(OutputComponent from, InputComponent to, String streamId, Stream.Grouping groupingType, List<String> fields) { LinkFluxComponent fluxComponent = new LinkFluxComponent(); Map<String, Object> config = new HashMap<>(); Map<String, Object> grouping = new LinkedHashMap<>(); if (Stream.Grouping.FIELDS.equals(groupingType)) { grouping.put(StormTopologyLayoutConstants.YAML_KEY_TYPE, StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING); Map customGroupingClass = new HashMap<>(); customGroupingClass.put(StormTopologyLayoutConstants.YAML_KEY_CLASS_NAME, StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING_CLASSNAME); customGroupingClass.put(StormTopologyLayoutConstants.YAML_KEY_CONSTRUCTOR_ARGS, fields); grouping.put(StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING_CLASS, customGroupingClass); } else { <START> grouping.put(StormTopologyLayoutConstants.YAML_KEY_TYPE, String.valueOf(groupingType)); <END> } grouping.put(StormTopologyLayoutConstants.YAML_KEY_STREAM_ID, streamId); fluxComponent.updateLinkComponentWithGrouping(grouping); config.put(StormTopologyLayoutConstants.YAML_KEY_FROM, getFluxId(from)); config.put(StormTopologyLayoutConstants.YAML_KEY_TO, getFluxId(to)); fluxComponent.withConfig(config); Map<String, Object> yamlComponent = fluxComponent.getComponent(); keysAndComponents.add(makeEntry(StormTopologyLayoutConstants.YAML_KEY_STREAMS, yamlComponent)); }</code><technical_language>showing "SHUFFLE" other option user. showing this option internally default LocalORShuffle</technical_language>

Target:
private void addEdge(OutputComponent from, InputComponent to, String streamId, Stream.Grouping groupingType, List<String> fields) { LinkFluxComponent fluxComponent = new LinkFluxComponent(); Map<String, Object> config = new HashMap<>(); Map<String, Object> grouping = new LinkedHashMap<>(); if (Stream.Grouping.FIELDS.equals(groupingType)) { grouping.put(StormTopologyLayoutConstants.YAML_KEY_TYPE, StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING); Map customGroupingClass = new HashMap<>(); customGroupingClass.put(StormTopologyLayoutConstants.YAML_KEY_CLASS_NAME, StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING_CLASSNAME); customGroupingClass.put(StormTopologyLayoutConstants.YAML_KEY_CONSTRUCTOR_ARGS, fields); grouping.put(StormTopologyLayoutConstants.YAML_KEY_CUSTOM_GROUPING_CLASS, customGroupingClass); } else if (Stream.Grouping.SHUFFLE.equals(groupingType)) { grouping.put(StormTopologyLayoutConstants.YAML_KEY_TYPE, StormTopologyLayoutConstants.YAML_KEY_LOCAL_OR_SHUFFLE_GROUPING); } else { throw new RuntimeException("Unsupported grouping type: " + groupingType + " for storm link "); } grouping.put(StormTopologyLayoutConstants.YAML_KEY_STREAM_ID, streamId); fluxComponent.updateLinkComponentWithGrouping(grouping); config.put(StormTopologyLayoutConstants.YAML_KEY_FROM, getFluxId(from)); config.put(StormTopologyLayoutConstants.YAML_KEY_TO, getFluxId(to)); fluxComponent.withConfig(config); Map<String, Object> yamlComponent = fluxComponent.getComponent(); keysAndComponents.add(makeEntry(StormTopologyLayoutConstants.YAML_KEY_STREAMS, yamlComponent)); }
Source:
<code>private List<Entity> validateExtensionAndGetEntities(String extensionName, String jobName, InputStream configStream) { ClientResponse clientResponse = new ResourceBuilder() .path(ExtensionOperations.DETAIL.path, extensionName) .call(ExtensionOperations.DETAIL); JSONObject responseJson; try { responseJson = new JSONObject(clientResponse.getEntity(String.class)); } catch (JSONException e) { OUT.get().print("Submit failed. Failed to get details for the given extension"); throw new FalconCLIException("Submit failed. Failed to get details for the given extension"); } String extensionType; String extensionBuildLocation; try { extensionType = responseJson.get("type").toString(); extensionBuildLocation = responseJson.get("location").toString(); } catch (JSONException e) { OUT.get().print("Error. " + extensionName + " not found "); throw new FalconCLIException("Submit failed. Failed to get details for the given extension"); } List<Entity> entities = null; if (!extensionType.equals(ExtensionType.CUSTOM.name())) { try { entities = ExtensionHandler.loadAndPrepare(extensionName, jobName, configStream, extensionBuildLocation); } catch (Exception e) { OUT.get().println("Error in building the extension"); throw new FalconCLIException("Submit failed. Failed to get details for the given extension"); } if (entities == null || entities.isEmpty()) { OUT.get().println("No entities got built"); throw new FalconCLIException("Submit failed. Failed to get details for the given extension"); } <START> try { <END> EntityUtil.applyTags(extensionName, jobName, entities); } catch (FalconException e) { OUT.get().println("Error in applying tags to generated entities"); throw new FalconCLIException("Submit failed. Failed to get details for the given extension"); } } return entities; }</code><technical_language>Apologies I noticed this. if this is part of ExtensionHandler itself. Client light possible</technical_language>

Target:
private List<Entity> validateExtensionAndGetEntities(String extensionName, String jobName, InputStream configStream) { ClientResponse clientResponse = getExtensionDetailResponse(extensionName); List<Entity> entities = getEntities(extensionName, jobName, configStream, clientResponse); return entities; }
Source:
<code>public SamIndexes getIndexType() { if (mIndexFile != null) { if (mIndexFile.getName().toLowerCase().endsWith(BAMIndex.BAI_INDEX_SUFFIX)) { return SamIndexes.BAI; } else if (mIndexFile.getName().toLowerCase().endsWith(BAMIndex.CSI_INDEX_SUFFIX)) { <START> return SamIndexes.CSI; <END> } } return null; }</code><technical_language>sense for this method throw if mIndexFile != null BAI CSI</technical_language>

Target:
public SamIndexes getIndexType() { if (mIndexFile != null) { if (mIndexFile.getName().toLowerCase().endsWith(BAMIndex.BAI_INDEX_SUFFIX)) { return SamIndexes.BAI; } else if (mIndexFile.getName().toLowerCase().endsWith(BAMIndex.CSI_INDEX_SUFFIX)) { return SamIndexes.CSI; } throw new SAMFormatException("Unknown BAM index file type: " + mIndexFile.getName()); } return null; }
Source:
<code>public void handleDataDeleted(String dataPath) throws Exception { LOGGER.info(zLog("Data deleted on path " + dataPath + ". Predecessor went away. So, trying to become leader again...")); <START> tryBecomeLeader(leaderElectorListener); <END> }</code><technical_language>I thought discussed this fix this in of patches. missed it. This is invoked in event thread invoked in a thread</technical_language>

Target:
public void handleDataDeleted(String dataPath) throws Exception { LOG.info( zLog("Data deleted on path " + dataPath + ". Predecessor went away. So, trying to become leader again...")); tryBecomeLeader(leaderElectorListener); }
Source:
<code>public void zoom(boolean zoomIn) { Point cursorLocation = getDisplay().getCursorLocation(); Point origin = toDisplay(0,0); Rectangle size = getBounds(); Rectangle displayBounds = new Rectangle(origin.x + size.x, origin.y + size.y, size.width, size.height); <START> if (!displayBounds.contains(cursorLocation)) { <END> return; } int globalX = cursorLocation.x; Point p = toControl(globalX, 0); int nameSpace = fTimeProvider.getNameSpace(); int timeSpace = fTimeProvider.getTimeSpace(); int xPos = Math.max(nameSpace, Math.min(nameSpace + timeSpace, p.x)); long time0 = fTimeProvider.getTime0(); long time1 = fTimeProvider.getTime1(); long interval = time1 - time0; if (interval == 0) { interval = 1; } long newInterval; if (zoomIn) { newInterval = Math.max(Math.round(interval * ZOOM_IN_FACTOR), fTimeProvider.getMinTimeInterval()); } else { newInterval = (long) Math.ceil(interval * ZOOM_OUT_FACTOR); } long center = time0 + Math.round(((double) (xPos - nameSpace) / timeSpace * interval)); long newTime0 = center - Math.round((double) newInterval * (center - time0) / interval); newTime0 = Math.max(fTimeProvider.getMinTime(), Math.min(newTime0, fTimeProvider.getMaxTime() - newInterval)); long newTime1 = newTime0 + newInterval; fTimeProvider.setStartFinishTimeNotify(newTime0, newTime1); }</code><technical_language>This prevents mouse scroll zooming time scale (from TimeGraphViewer:559). include time scale bounds, consider x coordinate. Also, remove namespace allowed bounds, zooming occur mouse is name space (it zoom mouse wheel, redirected vertical scroll)</technical_language>

Target:
public void zoom(boolean zoomIn) { Point cursorDisplayLocation = getDisplay().getCursorLocation(); Point cursorControlLocation = toControl(cursorDisplayLocation); Point cursorScaleLocation = fTimeGraphScale.toControl(cursorDisplayLocation); if (!getBounds().contains(cursorControlLocation) && !fTimeGraphScale.getBounds().contains(cursorScaleLocation)) { return; } int nameSpace = fTimeProvider.getNameSpace(); int timeSpace = fTimeProvider.getTimeSpace(); int xPos = Math.max(nameSpace, Math.min(nameSpace + timeSpace, cursorControlLocation.x)); long time0 = fTimeProvider.getTime0(); long time1 = fTimeProvider.getTime1(); long interval = time1 - time0; if (interval == 0) { interval = 1; } long newInterval; if (zoomIn) { newInterval = Math.max(Math.round(interval * ZOOM_IN_FACTOR), fTimeProvider.getMinTimeInterval()); } else { newInterval = (long) Math.ceil(interval * ZOOM_OUT_FACTOR); } long center = time0 + Math.round(((double) (xPos - nameSpace) / timeSpace * interval)); long newTime0 = center - Math.round((double) newInterval * (center - time0) / interval); newTime0 = Math.max(fTimeProvider.getMinTime(), Math.min(newTime0, fTimeProvider.getMaxTime() - newInterval)); long newTime1 = newTime0 + newInterval; fTimeProvider.setStartFinishTimeNotify(newTime0, newTime1); }
Source:
<code>public void onDisplayErrorVideoDialog() { <START> DialogFactory.createErrorFetchingYoutubeVideoDialog(this, new ActionCallback() { <END> @Override public void onButtonClick(final Dialog which, final Action action) { finish(); } }).show(); }</code><technical_language>this method is implemented in Base...Activity</technical_language>

Target:
public void onDisplayErrorVideoDialog() { DialogFactory.createErrorFetchingYoutubeVideoDialog(this, new ActionCallback() { @Override public void onButtonClick(final Dialog which, final @Action int action) { finish(); } }).show(); }
Source:
<code>@Override public Step newInstance(Map<String, Object> arguments) throws Exception { <START> if (arguments.containsKey("url") || arguments.containsKey("credentialsId")) { <END> if (arguments.containsKey("registry")) { throw new IllegalArgumentException("cannot mix url/credentialsId with registry"); } arguments.put("registry", new DockerRegistryEndpoint((String) arguments.remove("url"), (String) arguments.remove("credentialsId"))); } else if (!arguments.containsKey("registry")) { throw new IllegalArgumentException("must specify url/credentialsId (or registry)"); } return super.newInstance(arguments); }</code><technical_language>Direct mutation of input Map: danger, danger robinson! Please create copy if mutate (just in case else is done args) -- remember top of head a real risk this break ArgumentsActionImpl</technical_language>

Target:
@Override public Step newInstance(Map<String, Object> arguments) throws Exception { arguments = new HashMap<>(arguments); if (arguments.containsKey("url") || arguments.containsKey("credentialsId")) { if (arguments.containsKey("registry")) { throw new IllegalArgumentException("cannot mix url/credentialsId with registry"); } arguments.put("registry", new DockerRegistryEndpoint((String) arguments.remove("url"), (String) arguments.remove("credentialsId"))); } else if (!arguments.containsKey("registry")) { throw new IllegalArgumentException("must specify url/credentialsId (or registry)"); } return super.newInstance(arguments); }
Source:
<code>public PrefetchGetRecordsCache(final int maxPendingProcessRecordsInput, final int maxByteSize, final int maxRecordsCount, final int maxRecordsPerCall, @NonNull final GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, @NonNull final ExecutorService executorService, long idleMillisBetweenCalls, @NonNull final IMetricsFactory metricsFactory, @NonNull String operation) { this.getRecordsRetrievalStrategy = getRecordsRetrievalStrategy; this.maxRecordsPerCall = maxRecordsPerCall; this.maxPendingProcessRecordsInput = maxPendingProcessRecordsInput; this.maxByteSize = maxByteSize; this.maxRecordsCount = maxRecordsCount; this.getRecordsResultQueue = new LinkedBlockingQueue<>(this.maxPendingProcessRecordsInput); this.prefetchCounters = new PrefetchCounters(); this.executorService = executorService; this.metricsFactory = new ThreadSafeMetricsDelegatingFactory(metricsFactory); this.idleMillisBetweenCalls = idleMillisBetweenCalls; this.defaultGetRecordsCacheDaemon = new DefaultGetRecordsCacheDaemon(); <START> this.operation = operation; <END> }</code><technical_language>I check for empty strings</technical_language>

Target:
public PrefetchGetRecordsCache(final int maxPendingProcessRecordsInput, final int maxByteSize, final int maxRecordsCount, final int maxRecordsPerCall, @NonNull final GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, @NonNull final ExecutorService executorService, long idleMillisBetweenCalls, @NonNull final IMetricsFactory metricsFactory, @NonNull String operation) { this.getRecordsRetrievalStrategy = getRecordsRetrievalStrategy; this.maxRecordsPerCall = maxRecordsPerCall; this.maxPendingProcessRecordsInput = maxPendingProcessRecordsInput; this.maxByteSize = maxByteSize; this.maxRecordsCount = maxRecordsCount; this.getRecordsResultQueue = new LinkedBlockingQueue<>(this.maxPendingProcessRecordsInput); this.prefetchCounters = new PrefetchCounters(); this.executorService = executorService; this.metricsFactory = new ThreadSafeMetricsDelegatingFactory(metricsFactory); this.idleMillisBetweenCalls = idleMillisBetweenCalls; this.defaultGetRecordsCacheDaemon = new DefaultGetRecordsCacheDaemon(); Validate.notEmpty(operation, "Operation cannot be empty"); this.operation = operation; }
Source:
<code>public void testCheckoutChangeLinkToEmptyDir() throws Exception { String fname = "was_file"; Git git = Git.wrap(db); writeTrashFile(fname, "a"); git.add().addFilepattern(fname).call(); String linkName = "link"; File link = writeLink(linkName, fname).toFile(); git.add().addFilepattern(linkName).call(); git.commit().setMessage("Added file and link").call(); assertWorkDir(mkmap(linkName, "a", fname, "a")); FileUtils.delete(link); FileUtils.mkdir(link); assertTrue("Link must be a directory now", link.isDirectory()); writeTrashFile(fname, "b"); assertWorkDir(mkmap(fname, "b")); git.checkout().setName("master").setStartPoint(Constants.HEAD) <START> .addPath(fname).addPath(linkName).call(); <END> assertWorkDir(mkmap(fname, "a", linkName, "a")); Status st = git.status().call(); assertTrue(st.isClean()); }</code><technical_language>I suggest remove setName("master") in other tests. want checkout HEAD git.checkout.setStartPoint(Constants.HEAD)... is sufficient a setName() is redundant needed. exception tests want checkout HEAD</technical_language>

Target:
public void testCheckoutChangeLinkToEmptyDir() throws Exception { String fname = "was_file"; Git git = Git.wrap(db); writeTrashFile(fname, "a"); git.add().addFilepattern(fname).call(); String linkName = "link"; File link = writeLink(linkName, fname).toFile(); git.add().addFilepattern(linkName).call(); git.commit().setMessage("Added file and link").call(); assertWorkDir(mkmap(linkName, "a", fname, "a")); FileUtils.delete(link); FileUtils.mkdir(link); assertTrue("Link must be a directory now", link.isDirectory()); writeTrashFile(fname, "b"); assertWorkDir(mkmap(fname, "b", linkName, "/")); git.checkout().setName("master").setStartPoint(Constants.HEAD) .addPath(fname).addPath(linkName).call(); assertWorkDir(mkmap(fname, "a", linkName, "a")); Status st = git.status().call(); assertTrue(st.isClean()); }
Source:
<code>public EditCommitOperation(Repository repository, RevCommit commit) { <START> if (commit.getParentCount() != 1) { <END> throw new UnsupportedOperationException( "commit is expected to have exactly one parent"); } this.repository = repository; this.commit = commit; }</code><technical_language>braces single line block</technical_language>

Target:
public EditCommitOperation(Repository repository, RevCommit commit) { if (commit.getParentCount() != 1) throw new UnsupportedOperationException( "commit is expected to have exactly one parent"); this.repository = repository; this.commit = commit; }
Source:
<code>protected RepositoryStatus createErrorStatus(TaskRepository repository, String message) { if (repository != null) { return RepositoryStatus.createStatus(repository, IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, message); } else { <START> return RepositoryStatus.createStatus("Unknown repository", IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, <END> message); } }</code><technical_language>This intended of API. RepositoryStatus error a task repository</technical_language>

Target:
protected Status createErrorStatus(TaskRepository repository, String message) { if (repository != null) { return RepositoryStatus.createStatus(repository, IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, message); } else { return new Status(IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, message + " (Repository Unknown)"); } }
Source:
<code>public void testRootLevelAttributeSimpleNameOperator() { simpleAttributeOperatorHelper(OperatorContext.MEMORY_MB, StreamingApplication.DT_PREFIX, true, <START> (Integer)4096, true, true); <END> }</code><technical_language>casting Integer is redundant. IDE shows warning</technical_language>

Target:
public void testRootLevelAttributeSimpleNameOperator() { simpleAttributeOperatorHelper(OperatorContext.MEMORY_MB, StreamingApplication.DT_PREFIX, true, 4096, true, true); }
Source:
<code>public long getNumberOfEntities(Session session) { final InfinispanRemoteDatastoreProvider datastoreProvider = getProvider( session ); final SessionFactoryImplementor sessionFactoryImplementor = getSessionFactoryImplementor( session.getSessionFactory() ); final Collection<EntityPersister> persisters = sessionFactoryImplementor.getMetamodel().entityPersisters().values(); final AtomicLong counter = new AtomicLong(); for ( EntityPersister ep : persisters ) { OgmEntityPersister persister = (OgmEntityPersister) ep; String tableName = persister.getTableName(); RemoteCache<Object, Object> cache = datastoreProvider.getCache( tableName ); if ( !( cache instanceof TransactionalRemoteCacheImpl ) ) { counter.addAndGet( cache.size() ); continue; } int size = TransactionalRemoteCacheCounter.count( persister, (TransactionalRemoteCacheImpl) cache, datastoreProvider.getDataMapperForCache( tableName ), session ); <START> counter.addAndGet( size ); <END> } return counter.get(); }</code><technical_language>a bit of explanation helpful for future. Like, if</technical_language>

Target:
public long getNumberOfEntities(Session session) { final InfinispanRemoteDatastoreProvider datastoreProvider = getProvider( session ); final SessionFactoryImplementor sessionFactoryImplementor = getSessionFactoryImplementor( session.getSessionFactory() ); final Collection<EntityPersister> persisters = sessionFactoryImplementor.getMetamodel().entityPersisters().values(); final AtomicLong counter = new AtomicLong(); for ( EntityPersister ep : persisters ) { OgmEntityPersister persister = (OgmEntityPersister) ep; String tableName = persister.getTableName(); RemoteCache<Object, Object> cache = datastoreProvider.getCache( tableName ); if ( cache instanceof TransactionalRemoteCacheImpl ) { int size = TransactionalRemoteCacheCounter.count( persister, (TransactionalRemoteCacheImpl) cache, datastoreProvider.getDataMapperForCache( tableName ), session ); counter.addAndGet( size ); } else { counter.addAndGet( cache.size() ); } } return counter.get(); }
Source:
<code>protected Region<String, Integer> createRegion(final String name, final CacheListener<String, Integer> listener) { LogService.getLogger() .info("Params [Redundancy: " + redundancy + " withData:" + withData + "]"); PartitionAttributesFactory<String, Integer> paf = new PartitionAttributesFactory<>(); paf.setRedundantCopies(redundancy); <START> RegionFactory<String, Integer> regionFactory = cacheRule.getCache().createRegionFactory(); if (listener != null) { regionFactory.addCacheListener(listener); } regionFactory.setDataPolicy(DataPolicy.PARTITION); regionFactory.setPartitionAttributes(paf.create()); return regionFactory.create(name); <END> }</code><technical_language>This code is duplicated in test class, extract this method?</technical_language>

Target:
protected Region<String, Integer> createRegion(final String name, final CacheListener<String, Integer> listener) { return createPartitionedRegion(name, listener, false); }
Source:
<code>public String getValue(Pattern headerPattern) { String value = getField(headerPattern); if (value.isEmpty()) { <START> throw new IllegalArgumentException("No value was provided for header pattern" + headerPattern); <END> } else { return value; } }</code><technical_language>I "No found..." sound better. I "provided" of a I provided caller</technical_language>

Target:
public String getValue(Pattern headerPattern) { String value = getField(headerPattern); if (value.isEmpty()) { throw new IllegalArgumentException("No value was found for header pattern" + headerPattern); } else { return value; } }
Source:
<code>protected String getPrivateHostname(NodeMetadata node, Optional<HostAndPort> sshHostAndPort, ConfigBag setup) { String provider = (setup != null) ? setup.get(CLOUD_PROVIDER) : null; if (provider == null) provider= getProvider(); <START> if ("aws-ec2".equals(provider)) { <END> HostAndPort inferredHostAndPort = null; if (!sshHostAndPort.isPresent()) { try { String vmIp = JcloudsUtil.getFirstReachableAddress(this.getComputeService().getContext(), node); int port = node.getLoginPort(); inferredHostAndPort = HostAndPort.fromParts(vmIp, port); } catch (Exception e) { LOG.warn("Error reaching aws-ec2 instance "+node.getId()+"@"+node.getLocation()+" on port "+node.getLoginPort()+"; falling back to jclouds metadata for address", e); } } if (sshHostAndPort.isPresent() || inferredHostAndPort != null) { HostAndPort hostAndPortToUse = sshHostAndPort.isPresent() ? sshHostAndPort.get() : inferredHostAndPort; try { return getPublicHostnameAws(hostAndPortToUse, setup); } catch (Exception e) { LOG.warn("Error querying aws-ec2 instance instance "+node.getId()+"@"+node.getLocation()+" over ssh for its hostname; falling back to jclouds metadata for address", e); } } } return getPrivateHostnameGeneric(node, setup); }</code><technical_language>tidier encapsulate AWS-specific steps in a separate private method getPrivateHostnameGeneric</technical_language>

Target:
protected String getPrivateHostname(NodeMetadata node, Optional<HostAndPort> sshHostAndPort, ConfigBag setup) { String provider = (setup != null) ? setup.get(CLOUD_PROVIDER) : null; if (provider == null) provider= getProvider(); if ("aws-ec2".equals(provider)) { Maybe<String> result = getPrivateHostnameAws(node, sshHostAndPort, setup); if (result.isPresent()) return result.get(); } return getPrivateHostnameGeneric(node, setup); }
Source:
<code>private void testWithoutAnyCandidate() throws SQLException { deleteDb(getTestName()); <START> final Connection conn = getJdbcConnection("DATABASE_TO_LOWER=false;DATABASE_TO_UPPER=false"); <END> final Statement stat = conn.createStatement(); stat.execute("CREATE TABLE T2 ( ID INT IDENTITY )"); try { stat.execute("ALTER TABLE t1 DROP COLUMN ID"); fail("Table `t1` was accessible but should not have been."); } catch (SQLException e) { final String message = e.getMessage(); assertContains(message, "Table \"t1\" not found;"); } conn.close(); deleteDb(getTestName()); }</code><technical_language>DATABASE_TO_UPPER=FALSE is enough</technical_language>

Target:
private void testWithoutAnyCandidate() throws SQLException { deleteDb(getTestName()); Connection conn = getConnectionWithSettings("DATABASE_TO_UPPER=FALSE"); Statement stat = conn.createStatement(); stat.execute("CREATE TABLE T2 ( ID INT IDENTITY )"); try { stat.execute("ALTER TABLE t1 DROP COLUMN ID"); fail("Table `t1` was accessible but should not have been."); } catch (SQLException e) { String message = e.getMessage(); assertContains(message, "Table \"t1\" not found;"); } conn.close(); deleteDb(getTestName()); }
Source:
<code>public List<QuotaBalanceVO> lastQuotaBalanceVO(final Long accountId, final Long domainId, final Date pivotDate) { final short opendb = TransactionLegacy.currentTxn().getDatabaseId(); List<QuotaBalanceVO> quotaUsageRecords = null; List<QuotaBalanceVO> trimmedRecords = new ArrayList<QuotaBalanceVO>(); try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) { Filter filter = new Filter(QuotaBalanceVO.class, "updatedOn", false, 0L, 100L); SearchCriteria<QuotaBalanceVO> sc = createSearchCriteria(); if (accountId != null) { sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); } if (domainId != null) { sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); } if ((pivotDate != null)) { sc.addAnd("updatedOn", SearchCriteria.Op.LTEQ, pivotDate); } quotaUsageRecords = search(sc, filter); for (QuotaBalanceVO entry : quotaUsageRecords) { <START> s_logger.info("findQuotaBalance Date=" + entry.getUpdatedOn().toGMTString() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); <END> if (entry.getCreditsId() > 0) { trimmedRecords.add(entry); } else { trimmedRecords.add(entry); break; } } } catch (Exception e) { throw new CloudRuntimeException("Unable to get last quota balance"); } finally { TransactionLegacy.open(opendb).close(); } return trimmedRecords; }</code><technical_language>content of this log message more for DEBUG INFO? change context INFO oriented reduce level DEBUG</technical_language>

Target:
public List<QuotaBalanceVO> lastQuotaBalanceVO(final Long accountId, final Long domainId, final Date pivotDate) { return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<List<QuotaBalanceVO>>() { @Override public List<QuotaBalanceVO> doInTransaction(final TransactionStatus status) { List<QuotaBalanceVO> quotaUsageRecords = null; List<QuotaBalanceVO> trimmedRecords = new ArrayList<QuotaBalanceVO>(); Filter filter = new Filter(QuotaBalanceVO.class, "updatedOn", false, 0L, 100L); QueryBuilder<QuotaBalanceVO> qb = QueryBuilder.create(QuotaBalanceVO.class); if (accountId != null) { qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId); } if (domainId != null) { qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId); } if ((pivotDate != null)) { qb.and(qb.entity().getUpdatedOn(), SearchCriteria.Op.LTEQ, pivotDate); } quotaUsageRecords = search(qb.create(), filter); for (QuotaBalanceVO entry : quotaUsageRecords) { if (s_logger.isDebugEnabled()) { s_logger.debug("FindQuotaBalIance Entry=" + entry); } if (entry.getCreditsId() > 0) { trimmedRecords.add(entry); } else { trimmedRecords.add(entry); break; } } return trimmedRecords; } }); }
Source:
<code>public <T extends Object> T toObject(Class<T> c) { if (JsonSerializable.class.isAssignableFrom(c) || String.class.isAssignableFrom(c) || Number.class.isAssignableFrom(c) || Boolean.class.isAssignableFrom(c)) { throw new IllegalArgumentException("c can only be a POJO class or JSONObject"); } if (JSONObject.class.isAssignableFrom(c)) { if (JSONObject.class != c) { throw new IllegalArgumentException("We support JSONObject but not its sub-classes."); } return c.cast(this.propertyBag); } else { if (c.isMemberClass() && !Modifier.isStatic(c.getModifiers())) { <START> throw new IllegalArgumentException("Nested classes must be static."); <END> } try { return new ObjectMapper().readValue(this.toString(), c); } catch (IOException e) { e.printStackTrace(); throw new IllegalStateException("Failed to get POJO.", e); } } }</code><technical_language>Thanks, do a favor change following. if (c.isAnonymousClass() || c.isLocalClass()) { throw new IllegalArgumentException( String.format("%s anonymous local class.", c.getName())); } if (c.isMemberClass() && !Modifier.isStatic(c.getModifiers())) { throw new IllegalArgumentException( String.format("%s static if a member class.", c.getName())); }</technical_language>

Target:
public <T extends Object> T toObject(Class<T> c) { if (JsonSerializable.class.isAssignableFrom(c) || String.class.isAssignableFrom(c) || Number.class.isAssignableFrom(c) || Boolean.class.isAssignableFrom(c)) { throw new IllegalArgumentException("c can only be a POJO class or JSONObject"); } if (JSONObject.class.isAssignableFrom(c)) { if (JSONObject.class != c) { throw new IllegalArgumentException("We support JSONObject but not its sub-classes."); } return c.cast(this.propertyBag); } else { checkForValidPOJO(c); try { return new ObjectMapper().readValue(this.toString(), c); } catch (IOException e) { e.printStackTrace(); throw new IllegalStateException("Failed to get POJO.", e); } } }
Source:
<code>public boolean containsSensitiveData() { BaseObject familyObject = getXDocument().getXObject(Family.CLASS_REFERENCE); <START> return (familyObject.getIntValue(WARNING) != 0); <END> }</code><technical_language>wondering == 1</technical_language>

Target:
public boolean containsSensitiveData() { BaseObject familyObject = getXDocument().getXObject(Family.CLASS_REFERENCE); return (familyObject.getIntValue(FIELD_HAS_SENSITIVE_DATA) == FIELD_VALUE_CHECKED); }
Source:
<code>public void logout() { finish(); mOpenMRS.clearUserPreferencesData(); <START> mAuthorizationManager.moveToLoginActivity(); <END> OpenMRSDBOpenHelper.getInstance().closeDatabases(); }</code><technical_language>I believie proper do this is add this flag intent in moveToLoginActivity() intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);</technical_language>

Target:
public void logout() { mOpenMRS.clearUserPreferencesData(); mAuthorizationManager.moveToLoginActivity(); OpenMRSDBOpenHelper.getInstance().closeDatabases(); }
Source:
<code>private S3ProxyRule(Builder builder) { accessKey = builder.accessKey; secretKey = builder.secretKey; Properties properties = new Properties(); try { blobStoreLocation = Files.createTempDirectory("S3ProxyRule") .toFile(); <START> blobStoreLocation.deleteOnExit(); <END> properties.setProperty("jclouds.filesystem.basedir", blobStoreLocation.getCanonicalPath()); } catch (IOException e) { throw new RuntimeException("Unable to initialize Blob Store", e); } BlobStoreContext context = ContextBuilder.newBuilder( builder.blobStoreProvider) .credentials(accessKey, secretKey) .overrides(properties).build(BlobStoreContext.class); S3Proxy.Builder s3ProxyBuilder = S3Proxy.builder() .blobStore(context.getBlobStore()) .awsAuthentication(builder.authType, accessKey, secretKey) .ignoreUnknownHeaders(builder.ignoreUnknownHeaders); if (builder.secretStorePath != null || builder.secretStorePassword != null) { s3ProxyBuilder.keyStore(builder.secretStorePath, builder.secretStorePassword); } int port = builder.port < 0 ? 0 : builder.port; if (builder.useHttps) { endpointFormat = "https://%s:%d"; String endpoint = String.format(endpointFormat, LOCALHOST, port); s3ProxyBuilder.secureEndpoint(URI.create(endpoint)); } else { endpointFormat = "http://%s:%d"; String endpoint = String.format(endpointFormat, LOCALHOST, port); s3ProxyBuilder.endpoint(URI.create(endpoint)); } s3Proxy = s3ProxyBuilder.build(); }</code><technical_language>This clean file in test runs, JVM exits. below</technical_language>

Target:
private S3ProxyRule(Builder builder) { accessKey = builder.accessKey; secretKey = builder.secretKey; Properties properties = new Properties(); try { blobStoreLocation = Files.createTempDirectory("S3ProxyRule") .toFile(); properties.setProperty("jclouds.filesystem.basedir", blobStoreLocation.getCanonicalPath()); } catch (IOException e) { throw new RuntimeException("Unable to initialize Blob Store", e); } blobStoreContext = ContextBuilder.newBuilder( builder.blobStoreProvider) .credentials(accessKey, secretKey) .overrides(properties).build(BlobStoreContext.class); S3Proxy.Builder s3ProxyBuilder = S3Proxy.builder() .blobStore(blobStoreContext.getBlobStore()) .awsAuthentication(builder.authType, accessKey, secretKey) .ignoreUnknownHeaders(builder.ignoreUnknownHeaders); if (builder.secretStorePath != null || builder.secretStorePassword != null) { s3ProxyBuilder.keyStore(builder.secretStorePath, builder.secretStorePassword); } int port = builder.port < 0 ? 0 : builder.port; endpointFormat = "http://%s:%d"; String endpoint = String.format(endpointFormat, LOCALHOST, port); s3ProxyBuilder.endpoint(URI.create(endpoint)); s3Proxy = s3ProxyBuilder.build(); }
Source:
<code>public SimplifiedMasternodeListManager(Context context) { super(context); if (Runtime.getRuntime().totalMemory() <= Math.pow(1024, 3)) { MAX_CACHE_SIZE = 1; <START> } <END> tipBlockHash = params.getGenesisBlock().getHash(); mnList = new SimplifiedMasternodeList(context.getParams()); quorumList = new SimplifiedQuorumList(context.getParams()); lastRequestTime = 0; waitingForMNListDiff = false; pendingBlocks = new ArrayList<StoredBlock>(); pendingBlocksMap = new LinkedHashMap<Sha256Hash, StoredBlock>(); saveOptions = SaveOptions.SAVE_EVERY_CHANGE; syncOptions = SyncOptions.SYNC_MINIMUM; syncInterval = 8; loadedFromFile = false; requiresLoadingFromFile = true; lastRequestMessage = new GetSimplifiedMasternodeListDiff(Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH); }</code><technical_language>Runtime.getRuntime().totalMemory() get total amount of device memory. returned 256 MB a 16 GB machine 8MB a 1 GB Krip phone. besides that, MAX_CACHE_SIZE = 1 appears work instantsend/chainlock functionality is concerned. I removeEldestEntry methods return 1 if syncOptions == SYNC_MINIMUM, MAX_CACHE_SIZE. For other sync options, dashj MAX_CACHE_SIZE lists in memory lists 1, 2, 3, 4, 5, 6, 7, 8, etc. MAX_CACHE_SIZE static final a of 8. Dash Wallet app SYNC_MINIMUM. is need check for device memory size. A separate task created 2 lists in memory (the 8th previous 7th previous) some other optimization for higher memory devices. This address issues a chainlock instantsendlock arrives DMN List is updated</technical_language>

Target:
public SimplifiedMasternodeListManager(Context context) { super(context); tipBlockHash = params.getGenesisBlock().getHash(); mnList = new SimplifiedMasternodeList(context.getParams()); quorumList = new SimplifiedQuorumList(context.getParams()); lastRequestTime = 0; waitingForMNListDiff = false; pendingBlocks = new ArrayList<StoredBlock>(); pendingBlocksMap = new LinkedHashMap<Sha256Hash, StoredBlock>(); saveOptions = SaveOptions.SAVE_EVERY_CHANGE; syncOptions = SyncOptions.SYNC_MINIMUM; syncInterval = 8; loadedFromFile = false; requiresLoadingFromFile = true; lastRequestMessage = new GetSimplifiedMasternodeListDiff(Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH); }
Source:
<code>public void applyRevisionConstraint(GetObjectRequest request, String revisionId) { if (revisionId != null) { <START> LOG.debug("Restricting request to etag {}", revisionId); <END> request.withMatchingETagConstraint(revisionId); } }</code><technical_language>clarify "get request" / "copy request" in log messages unique (same applies for VersionIdChangeDetectionPolicy)</technical_language>

Target:
public void applyRevisionConstraint(GetObjectRequest request, String revisionId) { if (revisionId != null) { LOG.debug("Restricting get request to etag {}", revisionId); request.withMatchingETagConstraint(revisionId); } }