Adds or replaces hits to/in this widget.

@param results     A {@link JSONObject} containing hits.
@param isReplacing {@code true} if the given hits should replace the current hits.
545147
protected void addHits(@Nullable SearchResults results, boolean isReplacing) {
        if (results == null) {
            if (isReplacing) {
                clear();
                if (infiniteScrollListener != null) {
                    infiniteScrollListener.setCurrentlyLoading(false);
                }
            }
            return;
        }

        JSONArray hits = results.hits;

        if (isReplacing) {
            adapter.clear(false);
        }

        for (int i = 0; i < hits.length(); ++i) {
            JSONObject hit = hits.optJSONObject(i);
            if (hit != null) {
                adapter.add(hit);
            }
        }

        if (isReplacing) {
            adapter.notifyDataSetChanged();
            smoothScrollToPosition(0);
            if (infiniteScrollListener != null) {
                infiniteScrollListener.setCurrentlyLoading(false);
            }
        } else {
            adapter.notifyItemRangeInserted(adapter.getItemCount(), hits.length());
        }
    }
457073
public void addObjectResult(ObjectResult objResult) {
        m_objResultList.add(objResult);
        
        // Elevate batch-level status to warning if needed.
        Status batchResult = getStatus();
        if (batchResult == Status.OK && objResult.getStatus() != ObjectResult.Status.OK) {
            setStatus(Status.WARNING);
        }
        if (objResult.isUpdated()) {
            setHasUpdates(true);
        }
    }
1089334
public void setEvaluationResults(java.util.Collection<EvaluationResult> evaluationResults) {
        if (evaluationResults == null) {
            this.evaluationResults = null;
            return;
        }

        this.evaluationResults = new com.amazonaws.internal.SdkInternalList<EvaluationResult>(evaluationResults);
    }
428798
public void processIntermediateMatches(List targets, Object result)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "processIntermediateMatches",
        "targets: " + targets + ";results: " + result);

    //((List) result).addAll(targets);
    if (result != null)
       ((TopicAclTraversalResults) result).consolidate(targets);    
       
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processIntermediateMatches");

  }
277388
@Override
  public boolean replace    ( TypeK  key, TypeV  oldValue, TypeV newValue ) {
    return Objects.equals(putIfMatch( key, newValue, oldValue ), oldValue);
  }
1159962
@Override
    public void write(Iterable<QueryResult> results) {
        for (QueryResult result : results) {
            try {
                out.write(result.toString());
            } catch (IOException e) {
                // never occurs
            }
        }
    }
722016
public void setReplicationTaskAssessmentResults(java.util.Collection<ReplicationTaskAssessmentResult> replicationTaskAssessmentResults) {
        if (replicationTaskAssessmentResults == null) {
            this.replicationTaskAssessmentResults = null;
            return;
        }

        this.replicationTaskAssessmentResults = new java.util.ArrayList<ReplicationTaskAssessmentResult>(replicationTaskAssessmentResults);
    }
480653
public void addActionResult(ActionResult actionResult) {
        ActionResult existActionResult = getActionResult(actionResult.getActionId());
        if (existActionResult != null &&
                existActionResult.getResultValue() instanceof ResultValueMap &&
                actionResult.getResultValue() instanceof ResultValueMap) {
            ResultValueMap resultValueMap = (ResultValueMap)existActionResult.getResultValue();
            resultValueMap.putAll((ResultValueMap)actionResult.getResultValue());
        } else {
            add(actionResult);
        }
    }
73610
public void setResults(com.google.api.ads.admanager.axis.v201902.LineItemCreativeAssociation[] results) {
        this.results = results;
    }
880410
public void registerSearchReplace(Button search, Button replace) {

        if (getState().m_enableSearchReplace) {
            throw new RuntimeException("Search/replace already registered.");
        }
        search.setId(HTML_ID_PREFIX + m_componentId + "-search");
        replace.setId(HTML_ID_PREFIX + m_componentId + "-replace");
        getState().m_enableSearchReplace = true;
        markAsDirty();
    }
814765
def set_replace_results(self, replace_results):
        

        root_node = umbra.ui.nodes.DefaultNode(name="InvisibleRootNode")
        for file, metrics in sorted(replace_results.iteritems()):
            replace_result_node = ReplaceResultNode(name=self.__format_replace_metrics(file, metrics),
                                                    parent=root_node,
                                                    file=file)
        self.__model.initialize_model(root_node)
        return True
1074184
public void parseResponse(String results) {

        cancelUpdateProgress();
        stopLoadingAnimation();

        if ((!m_canceled) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(results)) {
            JSONObject jsonObject = JSONParser.parseStrict(results).isObject();
            boolean success = jsonObject.get(I_CmsUploadConstants.KEY_SUCCESS).isBoolean().booleanValue();
            // If the upload is done so fast that we did not receive any progress information, then
            // the content length is unknown. For that reason take the request size to show how
            // much bytes were uploaded.
            double size = jsonObject.get(I_CmsUploadConstants.KEY_REQUEST_SIZE).isNumber().doubleValue();
            long requestSize = new Double(size).longValue();
            if (m_contentLength == 0) {
                m_contentLength = requestSize;
            }
            if (success) {
                m_uploadedFiles = new ArrayList<String>();
                List<String> uploadedFileIds = new ArrayList<String>();
                displayDialogInfo(
                    org.opencms.gwt.client.Messages.get().key(
                        org.opencms.gwt.client.Messages.GUI_UPLOAD_INFO_FINISHING_0),
                    false);
                JSONValue uploadedFilesVal = jsonObject.get(I_CmsUploadConstants.KEY_UPLOADED_FILE_NAMES);
                JSONValue uploadHook = jsonObject.get(I_CmsUploadConstants.KEY_UPLOAD_HOOK);
                String hookUri = null;
                if ((uploadHook != null) && (uploadHook.isString() != null)) {
                    hookUri = uploadHook.isString().stringValue();
                    JSONValue uploadedFileIdsVal = jsonObject.get(I_CmsUploadConstants.KEY_UPLOADED_FILES);
                    JSONArray uploadedFileIdsArray = uploadedFileIdsVal.isArray();
                    if (uploadedFileIdsArray != null) {
                        for (int i = 0; i < uploadedFileIdsArray.size(); i++) {
                            JSONString entry = uploadedFileIdsArray.get(i).isString();
                            if (entry != null) {
                                uploadedFileIds.add(entry.stringValue());
                            }
                        }
                    }
                }
                JSONArray uploadedFilesArray = uploadedFilesVal.isArray();
                if (uploadedFilesArray != null) {
                    for (int i = 0; i < uploadedFilesArray.size(); i++) {
                        JSONString entry = uploadedFilesArray.get(i).isString();
                        if (entry != null) {
                            m_uploadedFiles.add(entry.stringValue());
                        }
                    }
                }
                m_progressInfo.finish();
                final I_CmsUploadContext context = m_context;
                closeOnSuccess();
                if (hookUri != null) {
                    // Set the context to be null so that it isn't called when the upload dialog closed;
                    // we want it to be called when the upload property dialog is closed instead.<p>
                    m_context = null;
                    CloseHandler<PopupPanel> closeHandler;
                    closeHandler = new CloseHandler<PopupPanel>() {

                        public void onClose(CloseEvent<PopupPanel> event) {

                            if (context != null) {
                                context.onUploadFinished(m_uploadedFiles);
                            }
                        }
                    };

                    String title = Messages.get().key(Messages.GUI_UPLOAD_HOOK_DIALOG_TITLE_0);
                    CmsUploadHookDialog.openDialog(title, hookUri, uploadedFileIds, closeHandler);
                }
            } else {
                String message = jsonObject.get(I_CmsUploadConstants.KEY_MESSAGE).isString().stringValue();
                String stacktrace = jsonObject.get(I_CmsUploadConstants.KEY_STACKTRACE).isString().stringValue();
                showErrorReport(message, stacktrace);
            }
        }
    }
1038806
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (typeArguments != null) {
            for (final TypeArgument typeArgument : typeArguments) {
                typeArgument.setScanResult(scanResult);
            }
        }
        if (suffixTypeArguments != null) {
            for (final List<TypeArgument> list : suffixTypeArguments) {
                for (final TypeArgument typeArgument : list) {
                    typeArgument.setScanResult(scanResult);
                }
            }
        }
    }
138986
public void setResults(java.util.Collection<SearchRecord> results) {
        if (results == null) {
            this.results = null;
            return;
        }

        this.results = new java.util.ArrayList<SearchRecord>(results);
    }
970728
public static void validateResults(Map<Integer, Object> results) {
        for (Object result : results.values()) {
            if (result != null && result instanceof CacheClearResponse) {
                Object response = ((CacheClearResponse) result).getResponse();
                if (response instanceof Throwable) {
                    ExceptionUtil.sneakyThrow((Throwable) response);
                }
            }
        }
    }
1307045
def replace_engines_with_cache_results
      @cache_results.each do |key, value|
        engine = @cache_key_to_engine[key]
        builder = @engine_to_builder[engine]
        builder.replace_engine(engine, value) if value
      end
    end
165085
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (this.classBound != null) {
            this.classBound.setScanResult(scanResult);
        }
        if (interfaceBounds != null) {
            for (final ReferenceTypeSignature referenceTypeSignature : interfaceBounds) {
                referenceTypeSignature.setScanResult(scanResult);
            }
        }
    }