auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public final Object internalLoad( String entityName, Serializable id, boolean eager, boolean nullable, Boolean unwrapProxy) { final EffectiveEntityGraph effectiveEntityGraph = getLoadQueryInfluencers().getEffectiveEntityGraph(); final GraphSemantic semantic = effectiveEntityGraph.getSemantic(); final RootGraphImplementor<?> graph = effectiveEntityGraph.getGraph(); boolean clearedEffectiveGraph = false; if ( semantic != null ) { if ( ! graph.appliesTo( entityName ) ) { log.debugf( "Clearing effective entity graph for subsequent-select" ); clearedEffectiveGraph = true; effectiveEntityGraph.clear(); } } try { final LoadEventListener.LoadType type; if ( nullable ) { type = LoadEventListener.INTERNAL_LOAD_NULLABLE; } else { type = eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; } LoadEvent event = loadEvent; loadEvent = null; event = recycleEventInstance( event, id, entityName ); fireLoad( event, type ); Object result = event.getResult(); if ( !nullable ) { UnresolvableObjectException.throwIfNull( result, id, entityName ); } if ( loadEvent == null ) { event.setEntityClassName( null ); event.setEntityId( null ); event.setInstanceToLoad( null ); event.setResult( null ); <START> event.setShouldUnwrapProxy( unwrapProxy ); <END> loadEvent = event; } return result; } finally { if ( clearedEffectiveGraph ) { effectiveEntityGraph.applyGraph( graph, semantic ); } } }</code><technical_language>I set moved fireLoad( event, type ); line 1174</technical_language>

Target:
public final Object internalLoad( String entityName, Serializable id, boolean eager, boolean nullable, Boolean unwrapProxy) { final EffectiveEntityGraph effectiveEntityGraph = getLoadQueryInfluencers().getEffectiveEntityGraph(); final GraphSemantic semantic = effectiveEntityGraph.getSemantic(); final RootGraphImplementor<?> graph = effectiveEntityGraph.getGraph(); boolean clearedEffectiveGraph = false; if ( semantic != null ) { if ( ! graph.appliesTo( entityName ) ) { log.debugf( "Clearing effective entity graph for subsequent-select" ); clearedEffectiveGraph = true; effectiveEntityGraph.clear(); } } try { final LoadEventListener.LoadType type; if ( nullable ) { type = LoadEventListener.INTERNAL_LOAD_NULLABLE; } else { type = eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; } LoadEvent event = loadEvent; loadEvent = null; event = recycleEventInstance( event, id, entityName ); event.setShouldUnwrapProxy( unwrapProxy ); fireLoad( event, type ); Object result = event.getResult(); if ( !nullable ) { UnresolvableObjectException.throwIfNull( result, id, entityName ); } if ( loadEvent == null ) { event.setEntityClassName( null ); event.setEntityId( null ); event.setInstanceToLoad( null ); event.setResult( null ); loadEvent = event; } return result; } finally { if ( clearedEffectiveGraph ) { effectiveEntityGraph.applyGraph( graph, semantic ); } } }
Source:
<code>private void onResult() { if (script != null && comments != null) { if (comments.getHistory().size() > 1) { historyTable.display(comments.getHistory()); historyPanel.setVisible(true); } else { historyPanel.setVisible(false); } <START> boolean hasDifferences = !script.getEdits().isEmpty() && !script.getPatchHeader().isEmpty(); <END> boolean modeChange = script.getEdits().isEmpty() && !script.getPatchHeader().isEmpty(); if (contentTable instanceof SideBySideTable && modeChange) { contentTable.removeFromParent(); contentTable = new UnifiedDiffTable(); contentTable.fileList = fileList; contentPanel.add(contentTable); History.newItem(Link.toPatchUnified(patchKey), false); } if (hasDifferences) { contentTable.display(patchKey, idSideA, idSideB, script); contentTable.display(comments); contentTable.finishDisplay(); } showPatch(hasDifferences); script = null; comments = null; if (!isCurrentView()) { display(); } } }</code><technical_language>this be: !script.getEdits().isEmpty() || !script.getPatchHeader().isEmpty() IOW, if Edit, want show in side-by-side unified view, *or* if a header, need show a mode change and/or rename/copy information. this easier follow: final boolean hasEdit = !script.getEdits().isEmpty(); final boolean hasMeta = !script.getPatchHeader().isEmpty(); final boolean hasDifferences = hasEdit || hasMeta; final boolean pureMetaChange = !hasEdit && hasMeta;</technical_language>

Target:
private void onResult() { if (script != null && comments != null) { if (comments.getHistory().size() > 1) { historyTable.display(comments.getHistory()); historyPanel.setVisible(true); } else { historyPanel.setVisible(false); } boolean hasEdits = !script.getEdits().isEmpty(); boolean hasMeta = !script.getPatchHeader().isEmpty(); boolean hasDifferences = hasEdits || hasMeta; boolean pureMetaChange = !hasEdits && hasMeta; if (contentTable instanceof SideBySideTable && pureMetaChange) { contentTable.removeFromParent(); contentTable = new UnifiedDiffTable(); contentTable.fileList = fileList; contentPanel.add(contentTable); History.newItem(Link.toPatchUnified(patchKey), false); } if (hasDifferences) { contentTable.display(patchKey, idSideA, idSideB, script); contentTable.display(comments); contentTable.finishDisplay(); } showPatch(hasDifferences); script = null; comments = null; if (!isCurrentView()) { display(); } } }
Source:
<code>private PipelineGroups mergePipelineConfigs() { PipelineGroups groups = new PipelineGroups(); List<PipelineConfigs> allPipelineConfigs = new ArrayList<>(); for (PipelineConfigs partPipesConf : this.main.getGroups()) { allPipelineConfigs.add(partPipesConf); } for (PartialConfig part : this.parts) { for (PipelineConfigs partPipesConf : part.getGroups()) { for (PipelineConfig pipelineConfig : partPipesConf) { <START> main.getAllPipelineConfigs().add(pipelineConfig); <END> } allPipelineConfigs.add(partPipesConf); } } Map<String, List<PipelineConfigs>> map = new LinkedHashMap<>(); for (PipelineConfigs pipes : allPipelineConfigs) { String key = pipes.getGroup(); if (map.get(key) == null) { map.put(key, new ArrayList<PipelineConfigs>()); } map.get(key).add(pipes); } for (List<PipelineConfigs> oneGroup : map.values()) { if (oneGroup.size() == 1) groups.add(oneGroup.get(0)); else groups.add(new MergePipelineConfigs(oneGroup)); } return groups; }</code><technical_language>of this line, this method is called once, is called a config is bare/new (doesn't pipeline configs partials). this done elsewhere, more explicit? is return a merge result object here, groups configs, explicitly added allPipelineConfigs list. a thought</technical_language>

Target:
private PipelineGroups mergePipelineConfigs() { PipelineGroups groups = new PipelineGroups(); List<PipelineConfigs> allPipelineConfigs = new ArrayList<>(); for (PipelineConfigs partPipesConf : this.main.getGroups()) { allPipelineConfigs.add(partPipesConf); } for (PartialConfig part : this.parts) { for (PipelineConfigs partPipesConf : part.getGroups()) { allPipelineConfigs.add(partPipesConf); } } Map<String, List<PipelineConfigs>> map = new LinkedHashMap<>(); for (PipelineConfigs pipes : allPipelineConfigs) { String key = pipes.getGroup(); if (map.get(key) == null) { map.put(key, new ArrayList<PipelineConfigs>()); } map.get(key).add(pipes); } for (List<PipelineConfigs> oneGroup : map.values()) { if (oneGroup.size() == 1) groups.add(oneGroup.get(0)); else groups.add(new MergePipelineConfigs(oneGroup)); } return groups; }
Source:
<code><START> public boolean registerIntentToParticipate(Study study, Account account) { <END> Phone phone = account.getPhone(); if (phone == null) { return false; } List<Subpopulation> subpops = subpopService.getSubpopulations(study.getStudyIdentifier()); for (Subpopulation subpop : subpops) { CacheKey cacheKey = CacheKey.itp(subpop.getGuid(), study.getStudyIdentifier(), phone); IntentToParticipate intent = cacheProvider.getObject(cacheKey, IntentToParticipate.class); if (intent != null) { StudyParticipant participant = participantService.getParticipant(study, account.getId(), true); consentService.consentToResearch(study, subpop.getGuid(), participant, intent.getConsentSignature(), intent.getScope(), true); cacheProvider.removeObject(cacheKey); return true; } } return false; }</code><technical_language>registerIntentToParticipate() appears longer used, this appears identical. Instead of creating overload, instead change one</technical_language>

Target:
public boolean registerIntentToParticipate(Study study, Account account) { Phone phone = account.getPhone(); if (phone == null) { return false; } boolean consentsUpdated = false; StudyParticipant participant = null; List<Subpopulation> subpops = subpopService.getSubpopulations(study.getStudyIdentifier()); for (Subpopulation subpop : subpops) { CacheKey cacheKey = CacheKey.itp(subpop.getGuid(), study.getStudyIdentifier(), phone); IntentToParticipate intent = cacheProvider.getObject(cacheKey, IntentToParticipate.class); if (intent != null) { if (participant == null) { participant = participantService.getParticipant(study, account.getId(), true); } consentService.consentToResearch(study, subpop.getGuid(), participant, intent.getConsentSignature(), intent.getScope(), true); cacheProvider.removeObject(cacheKey); consentsUpdated = true; } } return consentsUpdated; }
Source:
<code>protected void installConfigApi(Config zkConf) { try { UUID hostId = HostIdGenerator.getHostId(); ClusterConfig clusterConf = new ClusterConfig(zkConf.withFallback( MidoNodeConfigurator.apply(zkConf).runtimeConfig(hostId))); ClusterNode.Context ctx = new ClusterNode.Context(hostId, true); <START> ConfMinion conf = new ConfMinion(ctx, clusterConf); <END> bind(ConfMinion.class).toInstance(new ConfMinion(ctx, clusterConf)); } catch (Exception e) { log.error("Failed to start config API", e); } }</code><technical_language>remove</technical_language>

Target:
protected void installConfigApi(Config zkConf) { try { UUID hostId = HostIdGenerator.getHostId(); ClusterConfig clusterConf = new ClusterConfig(zkConf.withFallback( MidoNodeConfigurator.apply(zkConf).runtimeConfig(hostId))); ClusterNode.Context ctx = new ClusterNode.Context(hostId, true); bind(ConfMinion.class).toInstance(new ConfMinion(ctx, clusterConf)); } catch (Exception e) { log.error("Failed to start config API", e); } }
Source:
<code>public void bootstrap() throws InfrastructureException { if (finishEventFuture != null) { throw new IllegalStateException("Bootstrap method must be called only once."); } <START> if (!hasInstallersToBootstrap()) { <END> return; } finishEventFuture = new CompletableFuture<>(); eventService.subscribe(bootstrapperStatusListener, BootstrapperStatusEvent.class); try { LOG.info("Launching bootstrapper"); doBootstrapAsync(installerEndpoint + ENDPOINT_IDS.getAndIncrement(), outputEndpoint + ENDPOINT_IDS.getAndIncrement()); LOG.info("Launched bootstrapper. Waiting for Done event"); BootstrapperStatusEvent resultEvent = finishEventFuture.get(bootstrappingTimeoutMinutes, TimeUnit.MINUTES); if (resultEvent.getStatus().equals(BootstrapperStatus.FAILED)) { throw new InfrastructureException(resultEvent.getError()); } } catch (ExecutionException e) { throw new InfrastructureException(e.getCause().getMessage(), e); } catch (TimeoutException e) { throw new InfrastructureException("Bootstrapping of machine " + machineName + " reached timeout"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new InfrastructureException("Bootstrapping of machine " + machineName + " was interrupted"); } finally { eventService.unsubscribe(bootstrapperStatusListener, BootstrapperStatusEvent.class); } }</code><technical_language>WDYT moving logic InternalRuntime do bootstrap if installers missed</technical_language>

Target:
public void bootstrap() throws InfrastructureException { if (finishEventFuture != null) { throw new IllegalStateException("Bootstrap method must be called only once."); } finishEventFuture = new CompletableFuture<>(); eventService.subscribe(bootstrapperStatusListener, BootstrapperStatusEvent.class); try { LOG.info("Launching bootstrapper"); doBootstrapAsync(installerEndpoint + ENDPOINT_IDS.getAndIncrement(), outputEndpoint + ENDPOINT_IDS.getAndIncrement()); LOG.info("Launched bootstrapper. Waiting for Done event"); BootstrapperStatusEvent resultEvent = finishEventFuture.get(bootstrappingTimeoutMinutes, TimeUnit.MINUTES); if (resultEvent.getStatus().equals(BootstrapperStatus.FAILED)) { throw new InfrastructureException(resultEvent.getError()); } } catch (ExecutionException e) { throw new InfrastructureException(e.getCause().getMessage(), e); } catch (TimeoutException e) { throw new InfrastructureException("Bootstrapping of machine " + machineName + " reached timeout"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new InfrastructureException("Bootstrapping of machine " + machineName + " was interrupted"); } finally { eventService.unsubscribe(bootstrapperStatusListener, BootstrapperStatusEvent.class); } }
Source:
<code>protected void reportAttemptingFullContext(@NotNull DFA dfa, @Nullable BitSet conflictingAlts, @NotNull ATNConfigSet configs, int startIndex, int stopIndex) { <START> conflictingAltResolvedBySLL = conflictingAlts.nextSetBit(0); <END> decisions[currentDecision].LL_Fallback++; super.reportAttemptingFullContext(dfa, conflictingAlts, configs, startIndex, stopIndex); }</code><technical_language>**Suggestion:** This check conflictingAlts for null, configs.getAlts().nextSetBit(0) in case is. **Rationale:** Static analysis report dereferencing of conflictingAlts argument a NullPointerException parameter is @Nullable (note changing parameter @NotNull result in a compile-time error for Maven build overrides/implements methods mark parameter @Nullable)</technical_language>

Target:
protected void reportAttemptingFullContext(@NotNull DFA dfa, @Nullable BitSet conflictingAlts, @NotNull ATNConfigSet configs, int startIndex, int stopIndex) { if ( conflictingAlts!=null ) { conflictingAltResolvedBySLL = conflictingAlts.nextSetBit(0); } else { conflictingAltResolvedBySLL = configs.getAlts().nextSetBit(0); } decisions[currentDecision].LL_Fallback++; super.reportAttemptingFullContext(dfa, conflictingAlts, configs, startIndex, stopIndex); }
Source:
<code>public void testOverrideIndicatorState() { testCountOverrideIndicators(); int count= 0; for (Annotation <START> fOverrideAnnotation : <END> fOverrideAnnotations) { Accessor indicator= new Accessor(fOverrideAnnotation, "org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager$OverrideIndicator", getClass().getClassLoader()); if (indicator.getBoolean("fIsOverwriteIndicator")) count++; } assertEquals(2, count); }</code><technical_language>rename overrideAnnotation</technical_language>

Target:
public void testOverrideIndicatorState() { testCountOverrideIndicators(); int count= 0; for (Annotation overrideAnnotation : fOverrideAnnotations) { Accessor indicator= new Accessor(overrideAnnotation, "org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager$OverrideIndicator", getClass().getClassLoader()); if (indicator.getBoolean("fIsOverwriteIndicator")) count++; } assertEquals(2, count); }
Source:
<code>public void emptySeries() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Slice size is too big."); Series series = new Series(""); <START> List<String> slices = series.slices(1); <END> }</code><technical_language>need store slices in a variable</technical_language>

Target:
public void emptySeries() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Slice size is too big."); Series series = new Series(""); series.slices(1); }
Source:
<code>protected void executeCommand() { auditLogDirector.log(this, AuditLogType.USER_REGISTER_DISK_INITIATED); TransactionSupport.executeInNewTransaction(() -> { if (getDiskImage().getDiskStorageType() == DiskStorageType.IMAGE) { final DiskImage newDiskImage = getDiskImage(); newDiskImage.setDiskAlias(ImagesHandler.getDiskAliasWithDefault(newDiskImage, generateDefaultAliasForRegiteredDisk(Calendar.getInstance()))); ArrayList<Guid> storageIds = new ArrayList<>(); storageIds.add(getParameters().getStorageDomainId()); newDiskImage.setStorageIds(storageIds); addDiskImageToDb(newDiskImage, getCompensationContext(), Boolean.TRUE); unregisteredDisksDao.removeUnregisteredDisk(newDiskImage.getId(), null); getReturnValue().setActionReturnValue(newDiskImage.getId()); getReturnValue().setSucceeded(true); } else if (getDiskImage().getDiskStorageType() == DiskStorageType.CINDER) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.RegisterCinderDisk, new RegisterCinderDiskParameters( (CinderDisk) getDiskImage(), getParameters().getStorageDomainId())); setReturnValue(returnValue); } return null; }); <START> initQcowCompat(); <END> }</code><technical_language>please renamed update add a TODO add compat insert change order here</technical_language>

Target:
protected void executeCommand() { auditLogDirector.log(this, AuditLogType.USER_REGISTER_DISK_INITIATED); TransactionSupport.executeInNewTransaction(() -> { if (getDiskImage().getDiskStorageType() == DiskStorageType.IMAGE) { final DiskImage newDiskImage = getDiskImage(); newDiskImage.setDiskAlias(ImagesHandler.getDiskAliasWithDefault(newDiskImage, generateDefaultAliasForRegiteredDisk(Calendar.getInstance()))); ArrayList<Guid> storageIds = new ArrayList<>(); storageIds.add(getParameters().getStorageDomainId()); newDiskImage.setStorageIds(storageIds); addDiskImageToDb(newDiskImage, getCompensationContext(), Boolean.TRUE); unregisteredDisksDao.removeUnregisteredDisk(newDiskImage.getId(), null); getReturnValue().setActionReturnValue(newDiskImage.getId()); getReturnValue().setSucceeded(true); } else if (getDiskImage().getDiskStorageType() == DiskStorageType.CINDER) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.RegisterCinderDisk, new RegisterCinderDiskParameters( (CinderDisk) getDiskImage(), getParameters().getStorageDomainId())); setReturnValue(returnValue); } return null; }); fetchQcowCompat(); }
Source:
<code>protected String getMessage(Message message) { switch(message) { case CHECK: return "This conversion doesn't seem right. Correct it automatically?"; case SUGGESTION: return "Writing for an international audience? Automatically add the converted metric equivalent."; case CHECK_UNKNOWN_UNIT: return "This conversion doesn't seem right, unable to recognize the used unit."; case UNIT_MISMATCH: return "These units don't seem to be compatible."; default: <START> throw new RuntimeException("Unknown message type."); <END> } }</code><technical_language>Please "Unknown message type." + message for a error in case this day</technical_language>

Target:
protected String getMessage(Message message) { switch(message) { case CHECK: return "This conversion doesn't seem right. Do you want to correct it automatically?"; case SUGGESTION: return "Writing for an international audience? Consider adding the metric equivalent."; case CHECK_UNKNOWN_UNIT: return "This conversion doesn't seem right, unable to recognize the used unit."; case UNIT_MISMATCH: return "These units don't seem to be compatible."; default: throw new RuntimeException("Unknown message type." + message); } }
Source:
<code>private String getNetworkNames(List<Network> networks) { <START> return networks.stream().map(Network::getName).collect(Collectors.joining(",")); <END> }</code><technical_language>Please - StringUtils.join(Entities.objectNames(networks), ", ")</technical_language>

Target:
private String getNetworkNames(List<Network> networks) { return StringUtils.join(Entities.objectNames(networks), ", "); }
Source:
<code><START> public String handle(final HttpRequest request) throws WebSitesException { <END> String action = request.getParameter("Action"); String id = request.getParameter("Id"); String currentPath = request.getParameter("path"); if (currentPath != null) { currentPath = doubleAntiSlash(currentPath); } if ("newSite".equals(action)) { currentPath = addNewDesignedSite(controller, request); } else if ("updateDescription".equals(action)) { updateDesignedSite(controller, request, currentPath); } else if ("addFolder".equals(action)) { addFolderInSite(controller, request, currentPath); } else if ("renameFolder".equals(action)) { renameFolderInSite(controller, request, currentPath); } else if ("deleteFolder".equals(action)) { deleteFolderInSite(controller, request, currentPath); } else if ("addPage".equals(action)) { addPageInSite(controller, request, currentPath); } else if ("renamePage".equals(action)) { renamePageInSite(controller, request, currentPath); } else if ("deletePage".equals(action)) { deletePageInSite(controller, request, currentPath); } else if ("classifySite".equals(action)) { classifySite(controller, request, id); } else if ("design".equals(action)) { SiteDetail site = controller.getWebSite(id); controller.setSessionSite(site); request.setAttribute("Site", site); } else { SiteDetail site = controller.getSessionSite(); id = site.getPK().getId(); request.setAttribute("Site", site); } return "/webSites/jsp/design.jsp?Action=design&path=" + currentPath + "&Id=" + id; }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "handle" is 12 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
public String handle(final HttpRequest request) throws WebSitesException { String action = request.getParameter("Action"); String id = request.getParameter("Id"); String currentPath = request.getParameter(WebSitesRequestRouter.PATH_PARAM); if (currentPath != null) { currentPath = doubleAntiSlash(currentPath); } switch (action) { case "newSite": currentPath = addNewDesignedSite(controller, request); break; case "updateDescription": updateDesignedSite(controller, request, currentPath); break; case "addFolder": addFolderInSite(controller, request, currentPath); break; case "renameFolder": renameFolderInSite(controller, request, currentPath); break; case "deleteFolder": deleteFolderInSite(controller, request, currentPath); break; case "addPage": addPageInSite(controller, request, currentPath); break; case "renamePage": renamePageInSite(controller, request, currentPath); break; case "deletePage": deletePageInSite(controller, request, currentPath); break; case "classifySite": classifySite(controller, request, id); break; case "design": setSiteToDesign(controller, request, id); break; default: id = backToDesignedSite(controller, request); break; } return "/webSites/jsp/design.jsp?Action=design&Path=" + currentPath + "&Id=" + id; }
Source:
<code>TxnContext put(@Nonnull Table<K, V, M> table, @Nonnull final K key, @Nonnull final V value, @Nullable final M metadata) { if (!table.getNamespace().equals(namespace)) { throw new IllegalArgumentException("TxnContext can't apply table from namespace " + table.getNamespace() + " to transaction on namespace " + namespace); } <START> table.numPuts.incrementAndGet(); <END> tablesInTxn.add(table); operations.add(() -> { table.put(key, value, metadata); }); return this; }</code><technical_language>lines put in lambda? If txn aborted read operation commit (basically lambda is executed), stats updated</technical_language>

Target:
TxnContext put(@Nonnull Table<K, V, M> table, @Nonnull final K key, @Nonnull final V value, @Nullable final M metadata) { validateTableWrittenIsInNamespace(table); operations.add(() -> { table.put(key, value, metadata); table.getMetrics().incNumPuts(); }); return this; }
Source:
<code>public int getTarget(int source) { if (source < 0 || source >= size) { throw new IndexOutOfBoundsException("source #" + source + " has no target in identity mapping of size " + size); <START> } <END> return source; }</code><technical_language>size -1, in case, want exception</technical_language>

Target:
public int getTarget(int source) { if (source < 0 || (size != -1 && source >= size)) { throw new IndexOutOfBoundsException("source #" + source + " has no target in identity mapping of size " + size); } return source; }
Source:
<code>public void setOnResponseError(Throwable cause) { this.responseHandlingError = cause; if (responseHandlingError != null) { for (MessageObserver handler : getMessageObservers()) { if (handler instanceof MessageObserver2) { ((MessageObserver2) handler).onResponseHandlingError(responseHandlingError); } } } <START> if (responseHandlingError != null) { <END> synchronized (this) { notifyAll(); } } }</code><technical_language>"ifs" merged</technical_language>

Target:
public void setOnResponseError(Throwable cause) { this.responseHandlingError = cause; if (responseHandlingError != null) { for (MessageObserver handler : getMessageObservers()) { if (handler instanceof MessageObserver2) { ((MessageObserver2) handler).onResponseHandlingError(responseHandlingError); } } synchronized (this) { notifyAll(); } } }
Source:
<code><START> public int getLoad() { <END> return m_load; }</code><technical_language>this return Integer too, consistent</technical_language>

Target:
public Integer getLoad() { return m_load; }
Source:
<code>public void postProcess(PinotTaskConfig pinotTaskConfig) { String realtimeTableName = pinotTaskConfig.getConfigs().get(MinionConstants.TABLE_NAME_KEY); <START> ZNRecord realtimeToOfflineSegmentsTaskRecord = <END> _minionTaskZkMetadataManager.getRealtimeToOfflineSegmentsTaskZNRecord(realtimeTableName); Preconditions.checkState(realtimeToOfflineSegmentsTaskRecord.getVersion() == _expectedVersion, "Version mismatch for realtimeToOfflineSegmentsTask ZNode: %s, expected: %d, but found: %d. " + "ZNode may have been modified by another task.", realtimeToOfflineSegmentsTaskRecord, _expectedVersion, realtimeToOfflineSegmentsTaskRecord.getVersion()); RealtimeToOfflineSegmentsTaskMetadata realtimeToOfflineSegmentsTaskMetadata = RealtimeToOfflineSegmentsTaskMetadata.fromZNRecord(realtimeToOfflineSegmentsTaskRecord); realtimeToOfflineSegmentsTaskMetadata.setWatermarkMillis(_nextWatermark); _minionTaskZkMetadataManager .setRealtimeToOfflineSegmentsTaskMetadata(realtimeToOfflineSegmentsTaskMetadata, _expectedVersion); }</code><technical_language>need check version again, setRealtimeToOfflineSegmentsTaskMetadata() perform version check</technical_language>

Target:
public void postProcess(PinotTaskConfig pinotTaskConfig) { String realtimeTableName = pinotTaskConfig.getConfigs().get(MinionConstants.TABLE_NAME_KEY); RealtimeToOfflineSegmentsTaskMetadata newMinionMetadata = new RealtimeToOfflineSegmentsTaskMetadata(realtimeTableName, _nextWatermark); _minionTaskZkMetadataManager.setRealtimeToOfflineSegmentsTaskMetadata(newMinionMetadata, _expectedVersion); }
Source:
<code>public WebSession extractWebSession(HttpMessage msg) { SessionScript sessionScript = getScriptInterface(script); if (sessionScript != null) { SessionWrapper wrapper = getSessionWrapper(msg); try { sessionScript.extractWebSession(wrapper); } catch (Exception e) { <START> LOG.error(e.getMessage(), e); <END> } return wrapper.getSession(); } return new ScriptBasedSession(); }</code><technical_language>call getScriptsExtension().handleScriptException(wrapper, e); instead. other script calls need try/catch block</technical_language>

Target:
public WebSession extractWebSession(HttpMessage msg) { SessionScript sessionScript = getScriptInterface(script); if (sessionScript != null) { SessionWrapper wrapper = getSessionWrapper(msg); try { sessionScript.extractWebSession(wrapper); } catch (Exception e) { getScriptsExtension().handleScriptException(script, e); } return wrapper.getSession(); } return new ScriptBasedSession(); }
Source:
<code>public TaskResult runTask() { Optional<String> paramServerType = systemConfig.getOptional("param_server.database.type", String.class); if (!paramServerType.isPresent()) { throw new ConfigException("param_server.database.type is required to use this operator."); } Config params = request.getLocalConfig(); List<String> keys = params.getKeys(); if (keys.size() == 0) { throw new ConfigException("no key is set."); } TaskResult taskResult = TaskResult.empty(request); Config storeParams = taskResult.getStoreParams(); paramServerClient.begin(); for (String key : keys) { Optional<String> destKey = params.getOptional(key, String.class); if (destKey.isPresent()) { storeParams.set( destKey.get(), paramServerClient.get(key, request.getSiteId()).or("") ); } } <START> paramServerClient.finalize(); <END> return taskResult; }</code><technical_language>try-finally is necessary</technical_language>

Target:
public TaskResult runTask() { Optional<String> paramServerType = systemConfig.getOptional("param_server.type", String.class); if (!paramServerType.isPresent()) { throw new ConfigException("param_server.type is required to use this operator."); } Config params = request.getLocalConfig(); List<String> keys = params.getKeys(); if (keys.size() == 0) { throw new ConfigException("no key is set."); } TaskResult taskResult = TaskResult.empty(request); Config storeParams = taskResult.getStoreParams(); for (String key : keys) { Optional<String> destKey = params.getOptional(key, String.class); if (destKey.isPresent()) { Optional<Record> record = paramServerClient.get(key, request.getSiteId()); storeParams.set( destKey.get(), record.isPresent() ? record.get().value().get("value") : "" ); } } paramServerClient.commit(); return taskResult; }
Source:
<code>private void readFromStackRaw(Stack stack, byte[] buffer, int bufferOffset, int bytes) throws IOException, FormatException { <START> long remainingBytesInChunk = remainingBytesInChunk(stack); <END> while (bytes > 0) { while (remainingBytesInChunk == 0) { switchChunk(stack, state.currentChunk + 1); in.seek(state.chunkFileStart); remainingBytesInChunk = remainingBytesInChunk(stack); } int bytesToRead = (int)Math.min(bytes, remainingBytesInChunk); in.read( buffer, bufferOffset, bytesToRead ); bufferOffset += bytesToRead; remainingBytesInChunk -= bytesToRead; bytes -= bytesToRead; } }</code><technical_language>worth explicitly checking throwing exception if remainingBytesInChunk is negative</technical_language>

Target:
private void readFromStackRaw(Stack stack, byte[] buffer, int bufferOffset, int bytes) throws IOException, FormatException { long remainingBytesInChunk = remainingBytesInChunk(stack); while (bytes > 0) { while (remainingBytesInChunk == 0) { switchChunk(stack, state.currentChunk + 1); in.seek(state.chunkFileStart); remainingBytesInChunk = remainingBytesInChunk(stack); } int bytesToRead = (int)Math.min(bytes, remainingBytesInChunk); if(buffer != null) { in.read( buffer, bufferOffset, bytesToRead ); } else { in.skipBytes(bytesToRead); } bufferOffset += bytesToRead; remainingBytesInChunk -= bytesToRead; bytes -= bytesToRead; } }
Source:
<code>private static Properties getDefaultProperties() { if (defaultProperties == null) { String[] keyArr = { SERVER_NAME, SERVER_PORT, DATABASE_NAME, JDBC_URL, USER, PASSWORD, DRIVER_CLASS_NAME, DATASOURCE_CLASS_NAME, MAX_POOL_SIZE, ALLOW_LOCAL_TXS }; String[] defaultPropArr = { "", "", "", "jdbc:h2:mem:jbpm-db;MVCC=true", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", <START> "5", "true" }; <END> Assert.assertTrue("Unequal number of keys for default properties", keyArr.length == defaultPropArr.length); defaultProperties = new Properties(); for (int i = 0; i < keyArr.length; ++i) { defaultProperties.put(keyArr[i], defaultPropArr[i]); } } return defaultProperties; }</code><technical_language>Max_pool_size previously 16, is reason 5</technical_language>

Target:
private static Properties getDefaultProperties() { if (defaultProperties == null) { String[] keyArr = { SERVER_NAME, SERVER_PORT, DATABASE_NAME, JDBC_URL, USER, PASSWORD, DRIVER_CLASS_NAME, DATASOURCE_CLASS_NAME, MAX_POOL_SIZE, ALLOW_LOCAL_TXS }; String[] defaultPropArr = { "", "", "", "jdbc:h2:mem:jbpm-db;MVCC=true", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "16", "true" }; Assert.assertTrue("Unequal number of keys for default properties", keyArr.length == defaultPropArr.length); defaultProperties = new Properties(); for (int i = 0; i < keyArr.length; ++i) { defaultProperties.put(keyArr[i], defaultPropArr[i]); } } return defaultProperties; }
Source:
<code>public void onTestStart(ITestResult result) { StringBuilder builder = new StringBuilder(); String testName = result.getName().toString(); String className = result.getTestClass().getName().toString(); builder.append( "<table>" + "<h1>Class: <em>" +className+ "." + testName + " </em></h1>" + <START> "<tr class=\"step\"><td>&nbsp</td><td><h1><em>" + testName + "</em></h1></td><td> <br/> &nbsp;</td></tr>" <END> ); CommonUtils.appendTextToFile(logPath, builder.toString()); System.out.println(className + " " + testName); }</code><technical_language>break line</technical_language>

Target:
public void onTestStart(ITestResult result) { StringBuilder builder = new StringBuilder(); String testName = result.getName().toString(); String className = result.getTestClass().getName().toString(); builder.append( "<table>" + "<h1>Class: <em>" +className+ "." + testName + " </em></h1>" + "<tr class=\"step\">" + "<td>&nbsp</td>" + "<td><h1><em>" + testName + "</em></h1></td>" + "<td> <br/> &nbsp;</td></tr>" ); CommonUtils.appendTextToFile(logPath, builder.toString()); System.out.println(className + " " + testName); }
Source:
<code>public void titleOfDuckDuckGoShouldContainSearchQueryName() { goTo("<LINK_0>"); $("#search_form_input_homepage").fill().with("FluentLenium"); $("#search_button_homepage").submit(); <START> await().atMost(5, TimeUnit.SECONDS).until($("#search_form_homepage")).not().present(); <END> assertThat(window().title()).contains("FluentLenium"); }</code><technical_language>el insted of $ need operate list</technical_language>

Target:
public void titleOfDuckDuckGoShouldContainSearchQueryName() { goTo("<LINK_0>"); $("#search_form_input_homepage").fill().with("FluentLenium"); $("#search_button_homepage").submit(); await().atMost(5, TimeUnit.SECONDS).until(el("#search_form_homepage")).not().present(); assertThat(window().title()).contains("FluentLenium"); }
Source:
<code>public void testPipelineCreationOnNodeRestart() throws Exception { conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 5, TimeUnit.SECONDS); init(3); waitForPipelines(1); List<HddsDatanodeService> dns = new ArrayList<>(cluster.getHddsDatanodes()); List<Pipeline> pipelines = pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE); for (HddsDatanodeService dn : dns) { cluster.shutdownHddsDatanode(dn.getDatanodeDetails()); } RatisPipelineProvider ratisPipelineProvider = (RatisPipelineProvider) pipelineManager.getPipelineFactory().getProvider( HddsProtos.ReplicationType.RATIS); try { <START> ratisPipelineProvider.createPipeline(pipelines.get(0)); <END> Assert.fail("pipeline creation should fail after shutting down pipeline"); } catch (IOException ioe) { Assert.assertTrue(ioe instanceof MultipleIOException); } waitForPipelines(0); for (HddsDatanodeService dn : dns) { cluster.restartHddsDatanode(dn.getDatanodeDetails(), false); } for (Pipeline pipeline : pipelines) { pipelineManager.finalizeAndDestroyPipeline(pipeline, false); } pipelineManager.triggerPipelineCreation(); waitForPipelines(1); }</code><technical_language>pipelineManager#create call instead</technical_language>

Target:
public void testPipelineCreationOnNodeRestart() throws Exception { conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 5, TimeUnit.SECONDS); init(3); waitForPipelines(1); List<HddsDatanodeService> dns = new ArrayList<>(cluster.getHddsDatanodes()); List<Pipeline> pipelines = pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE); for (HddsDatanodeService dn : dns) { cluster.shutdownHddsDatanode(dn.getDatanodeDetails()); } try { pipelineManager.createPipeline(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE); Assert.fail("pipeline creation should fail after shutting down pipeline"); } catch (IOException ioe) { Assert.assertTrue(ioe instanceof InsufficientDatanodesException); } waitForPipelines(0); for (HddsDatanodeService dn : dns) { cluster.restartHddsDatanode(dn.getDatanodeDetails(), false); } for (Pipeline pipeline : pipelines) { pipelineManager.finalizeAndDestroyPipeline(pipeline, false); } pipelineManager.triggerPipelineCreation(); waitForPipelines(1); }
Source:
<code>private void acceptConnection() { try (Socket s = configServerSocket.accept(); MessageReader in = new MessageReader(s.getInputStream()); OutputStream output = s.getOutputStream()) { LOGGER.log(Level.FINE, "OpenGrok: Got request from {0}", s.getInetAddress().getHostAddress()); Message m = in.readMessage(); handleMessage(m, output); } catch (SocketException e) { if (!configServerSocket.isClosed()) { LOGGER.log(Level.SEVERE, "Socket error", e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error reading config file: ", e); } catch (RuntimeException e) { LOGGER.log(Level.SEVERE, "Error parsing config file: ", e); } catch (ValidationException e) { <START> LOGGER.log(Level.WARNING, "Received invalid message", e); <END> } }</code><technical_language>if is unhandled exception opengrok need restarted, check for Exception Throwable</technical_language>

Target:
private void acceptConnection() { try (Socket s = configServerSocket.accept(); MessageReader in = new MessageReader(s.getInputStream()); OutputStream output = s.getOutputStream()) { LOGGER.log(Level.FINE, "OpenGrok: Got request from {0}", s.getInetAddress().getHostAddress()); Message m = in.readMessage(); handleMessage(m, output); } catch (SocketException e) { if (!configServerSocket.isClosed()) { LOGGER.log(Level.SEVERE, "Socket error", e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error reading message : ", e); } catch (ValidationException e) { LOGGER.log(Level.WARNING, "Received invalid message", e); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Error parsing message : ", e); } }
Source:
<code>private void updateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, long stopRank, long startTime, long stopTime) { ITmfTrace trace = timeAnalysisEntry.getTrace(); TimeChartDecorationProvider decorationProvider = fDecorationProviders.get(trace); if (decorationProvider == null) { return; } boolean done = false; while (!done) { synchronized (timeAnalysisEntry) { try (ITmfContext context = (timeAnalysisEntry.getLastRank() != -1) ? trace.seekEvent(timeAnalysisEntry.getLastRank()) : trace.seekEvent(0);) { while (!done) { if (timeAnalysisEntry.getLastRank() >= trace.getNbEvents()) { done = true; break; } if <START> (context == null || <END> context.getRank() != timeAnalysisEntry.getLastRank()) { break; } while (true) { long rank = context.getRank(); ITmfEvent event = trace.getNext(context); if (event == null) { done = true; break; } TimeChartEvent timeEvent = new TimeChartEvent(timeAnalysisEntry, event, rank, decorationProvider); if (timeEvent.getTime() >= startTime && timeEvent.getTime() <= stopTime) { timeAnalysisEntry.addTraceEvent(timeEvent); } if (context.getRank() == trace.getNbEvents() || context.getRank() == stopRank) { done = true; break; } if (context.getRank() % trace.getCacheSize() == 1) { break; } } timeAnalysisEntry.setLastRank(context.getRank()); } redrawViewer(true); } } } redrawViewer(true); }</code><technical_language>I context null anymore, good</technical_language>

Target:
private void updateTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry, long stopRank, long startTime, long stopTime) { ITmfTrace trace = timeAnalysisEntry.getTrace(); TimeChartDecorationProvider decorationProvider = fDecorationProviders.get(trace); if (decorationProvider == null) { return; } boolean done = false; while (!done) { synchronized (timeAnalysisEntry) { try (ITmfContext context = checkNotNull( timeAnalysisEntry.getLastRank() != -1 ? trace.seekEvent(timeAnalysisEntry.getLastRank()) : trace.seekEvent(0));) { if (timeAnalysisEntry.getLastRank() >= trace.getNbEvents()) { done = true; break; } while (true) { long rank = context.getRank(); ITmfEvent event = trace.getNext(context); if (event == null) { done = true; break; } TimeChartEvent timeEvent = new TimeChartEvent(timeAnalysisEntry, event, rank, decorationProvider); if (timeEvent.getTime() >= startTime && timeEvent.getTime() <= stopTime) { timeAnalysisEntry.addTraceEvent(timeEvent); } if (context.getRank() == trace.getNbEvents() || context.getRank() == stopRank) { done = true; break; } if (context.getRank() % trace.getCacheSize() == 1) { break; } } timeAnalysisEntry.setLastRank(context.getRank()); } } redrawViewer(true); } }
Source:
<code><START> public static Optional<org.junit.platform.engine.discovery.FilePosition> fromQuery(String query) { <END> FilePosition result = null; Integer line = null; Integer column = null; if (StringUtils.isNotBlank(query)) { try { for (String pair : query.split("&")) { String[] data = pair.split("="); if (data.length == 2) { String key = data[0]; if (line == null && "line".equals(key)) { line = Integer.valueOf(data[1]); } else if (column == null && "column".equals(key)) { column = Integer.valueOf(data[1]); } } if (line != null && column != null) { break; } } } catch (IllegalArgumentException ex) { logger.debug(ex, () -> "Failed to parse 'line' and/or 'column' from query string: " + query); } if (line != null) { result = column == null ? new FilePosition(line) : new FilePosition(line, column); } } return Optional.ofNullable(result); }</code><technical_language>Returning super class break existing callers</technical_language>

Target:
public static Optional<FilePosition> fromQuery(String query) { FilePosition result = null; Integer line = null; Integer column = null; if (StringUtils.isNotBlank(query)) { try { for (String pair : query.split("&")) { String[] data = pair.split("="); if (data.length == 2) { String key = data[0]; if (line == null && "line".equals(key)) { line = Integer.valueOf(data[1]); } else if (column == null && "column".equals(key)) { column = Integer.valueOf(data[1]); } } if (line != null && column != null) { break; } } } catch (IllegalArgumentException ex) { logger.debug(ex, () -> "Failed to parse 'line' and/or 'column' from query string: " + query); } if (line != null) { result = column == null ? new FilePosition(line) : new FilePosition(line, column); } } return Optional.ofNullable(result); }
Source:
<code>private static void rederive(String uri) throws ConnectorException, IOException, OSException { SecureRandom random = new SecureRandom(); byte[] newContextId = new byte[8]; random.nextBytes(newContextId); HashMapCtxDB db = HashMapCtxDB.getInstance(); OSCoreCtx oldCtx = db.getContext(uri); OSCoreCtx ctx = new OSCoreCtx(oldCtx.getMasterSecret(), true, oldCtx.getAlg(), oldCtx.getSenderId(), oldCtx.getRecipientId(), oldCtx.getKdf(), oldCtx.getRecipientReplaySize(), oldCtx.getSalt(), newContextId); ctx.setIncludeContextId(true); db.addContext(uri, ctx); String resource = "/rederive"; String URI = uri + resource; System.out.println(URI); CoapClient c = new CoapClient(URI); Request r = new Request(Code.GET); <START> r.getOptions().setOscore(new byte[0]); <END> System.out.println(Utils.prettyPrint(r)); CoapResponse resp = null; resp = c.advanced(r); System.out.println(Utils.prettyPrint(resp)); c.shutdown(); }</code><technical_language>replaced Bytes.EMPY</technical_language>

Target:
private static void rederive(String uri) throws ConnectorException, IOException, OSException { SecureRandom random = new SecureRandom(); byte[] newContextId = new byte[8]; random.nextBytes(newContextId); HashMapCtxDB db = HashMapCtxDB.getInstance(); OSCoreCtx oldCtx = db.getContext(uri); OSCoreCtx ctx = new OSCoreCtx(oldCtx.getMasterSecret(), true, oldCtx.getAlg(), oldCtx.getSenderId(), oldCtx.getRecipientId(), oldCtx.getKdf(), oldCtx.getRecipientReplaySize(), oldCtx.getSalt(), newContextId); ctx.setIncludeContextId(true); db.addContext(uri, ctx); String resource = "/rederive"; String URI = uri + resource; System.out.println(URI); CoapClient c = new CoapClient(URI); Request r = new Request(Code.GET); r.getOptions().setOscore(Bytes.EMPTY); System.out.println(Utils.prettyPrint(r)); CoapResponse resp = null; resp = c.advanced(r); System.out.println(Utils.prettyPrint(resp)); c.shutdown(); }
Source:
<code>private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfXyModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfXyModel model = response.getModel(); if (model == null || !(model <START> instanceof ITmfCommonXAxisModel)) <END> { Activator.getDefault().logError("The model is of the wrong type: " + model); } extractXYModelAndUpdateViewModel((ITmfCommonXAxisModel) model); updateDisplay(); ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, response.getStatusMessage()); isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); } } } while (!isComplete); }</code><technical_language>this null check</technical_language>

Target:
private void updateData(@NonNull TimeQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, "Data provider for this viewer is not available"); return; } boolean isComplete = false; do { TmfModelResponse<ITmfXyModel> response = fXYDataProvider.fetchXY(filters, monitor); ITmfXyModel model = response.getModel(); if (!(model instanceof ITmfCommonXAxisModel)) { Activator.getDefault().logError("The model is of the wrong type: " + model); return; } extractXYModelAndUpdateViewModel((ITmfCommonXAxisModel) model); updateDisplay(); ITmfResponse.Status status = response.getStatus(); if (status == ITmfResponse.Status.COMPLETED) { isComplete = true; } else if (status == ITmfResponse.Status.FAILED || status == ITmfResponse.Status.CANCELLED) { TraceCompassLogUtils.traceInstant(LOGGER, Level.WARNING, response.getStatusMessage()); isComplete = true; } else { try { Thread.sleep(BUILD_UPDATE_TIMEOUT); } catch (InterruptedException e) { TraceCompassLogUtils.traceInstant(LOGGER, Level.INFO, e.getMessage()); } } } while (!isComplete); }
Source:
<code>public void verifyMonetizationModuleNotShown() { <START> Assertion.assertTrue(!checkIfElementOnPage(monetizationModuleContainer)); <END> PageObjectLogging.log("verifyMonetizationModuleNotShown", "Monetization module is not shown", true); }</code><technical_language>recommend assertFalse instead of negating checkIfElementOnPage for easier reading</technical_language>

Target:
public void verifyMonetizationModuleNotShown() { Assertion.assertFalse(checkIfElementOnPage(monetizationModuleContainer)); PageObjectLogging.log("verifyMonetizationModuleNotShown", "Monetization module is not shown", true); }
Source:
<code><START> public boolean hasCollision() { <END> for (Script script : getScriptList()) { Brick scriptBrick = script.getScriptBrick(); if (scriptBrick instanceof FormulaBrick) { FormulaBrick formulaBrick = (FormulaBrick) scriptBrick; for (Formula formula : formulaBrick.getFormulas()) { if (formula.containsElement(FormulaElement.ElementType.COLLISION_FORMULA)) { return true; } } } for (Brick brick : script.brickList) { if (brick instanceof FormulaBrick) { FormulaBrick formulaBrick = (FormulaBrick) brick; for (Formula formula : formulaBrick.getFormulas()) { if (formula.containsElement(FormulaElement.ElementType.COLLISION_FORMULA)) { return true; } } } } } Scene scene = ProjectManager.getInstance().getCurrentScene(); for (Sprite sprite : scene.getSpriteList()) { if (sprite.hasToCollideWith(this)) { return true; } } return false; }</code><technical_language>This a conflict changes this method in PR #2043</technical_language>

Target:
public boolean hasCollision() { boolean hasCollision = (this.getRequiredResources() & Brick.COLLISION) > 0; if (hasCollision) { return true; } Scene scene = ProjectManager.getInstance().getCurrentScene(); for (Sprite sprite : scene.getSpriteList()) { if (sprite.hasToCollideWith(this)) { return true; } } return false; }