idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,770,138
public Object toJson(Object value) {<NEW_LINE>if (value == null || value instanceof Number || value instanceof String || value instanceof Boolean) {<NEW_LINE>return value;<NEW_LINE>} else if (value instanceof RexNode) {<NEW_LINE>return toJson((RexNode) value);<NEW_LINE>} else if (value instanceof RexWindow) {<NEW_LINE>return toJson((RexWindow) value);<NEW_LINE>} else if (value instanceof RexFieldCollation) {<NEW_LINE>return toJson((RexFieldCollation) value);<NEW_LINE>} else if (value instanceof RexWindowBound) {<NEW_LINE>return toJson((RexWindowBound) value);<NEW_LINE>} else if (value instanceof CorrelationId) {<NEW_LINE>return toJson((CorrelationId) value);<NEW_LINE>} else if (value instanceof List) {<NEW_LINE>final List<Object> list = jsonBuilder.list();<NEW_LINE>for (Object o : (List) value) {<NEW_LINE>list<MASK><NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} else if (value instanceof ImmutableBitSet) {<NEW_LINE>final List<Object> list = jsonBuilder.list();<NEW_LINE>for (Integer integer : (ImmutableBitSet) value) {<NEW_LINE>list.add(toJson(integer));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} else if (value instanceof AggregateCall) {<NEW_LINE>return toJson((AggregateCall) value);<NEW_LINE>} else if (value instanceof RelCollationImpl) {<NEW_LINE>return toJson((RelCollationImpl) value);<NEW_LINE>} else if (value instanceof RelDataType) {<NEW_LINE>return toJson((RelDataType) value);<NEW_LINE>} else if (value instanceof RelDataTypeField) {<NEW_LINE>return toJson((RelDataTypeField) value);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("type not serializable: " + value + " (type " + value.getClass().getCanonicalName() + ")");<NEW_LINE>}<NEW_LINE>}
.add(toJson(o));
491,347
public static boolean isAnagrams(String s1, String s2) {<NEW_LINE>int l1 = s1.length();<NEW_LINE><MASK><NEW_LINE>s1 = s1.toLowerCase();<NEW_LINE>s2 = s2.toLowerCase();<NEW_LINE>Map<Character, Integer> charAppearances = new HashMap<>();<NEW_LINE>for (int i = 0; i < l1; i++) {<NEW_LINE>char c = s1.charAt(i);<NEW_LINE>int numOfAppearances = charAppearances.getOrDefault(c, 0);<NEW_LINE>charAppearances.put(c, numOfAppearances + 1);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < l2; i++) {<NEW_LINE>char c = s2.charAt(i);<NEW_LINE>if (!charAppearances.containsKey(c)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>charAppearances.put(c, charAppearances.get(c) - 1);<NEW_LINE>}<NEW_LINE>for (int cnt : charAppearances.values()) {<NEW_LINE>if (cnt != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
int l2 = s2.length();
272,240
public Request<DisassociateKmsKeyRequest> marshall(DisassociateKmsKeyRequest disassociateKmsKeyRequest) {<NEW_LINE>if (disassociateKmsKeyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DisassociateKmsKeyRequest)");<NEW_LINE>}<NEW_LINE>Request<DisassociateKmsKeyRequest> request = new DefaultRequest<MASK><NEW_LINE>String target = "Logs_20140328.DisassociateKmsKey";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (disassociateKmsKeyRequest.getLogGroupName() != null) {<NEW_LINE>String logGroupName = disassociateKmsKeyRequest.getLogGroupName();<NEW_LINE>jsonWriter.name("logGroupName");<NEW_LINE>jsonWriter.value(logGroupName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
<DisassociateKmsKeyRequest>(disassociateKmsKeyRequest, "AmazonCloudWatchLogs");
877,691
public Comparator<Replica> replicaComparator() {<NEW_LINE>return (r1, r2) -> {<NEW_LINE>boolean <MASK><NEW_LINE>boolean isR2Offline = _currentOfflineReplicas.contains(r2);<NEW_LINE>if (isR1Offline && !isR2Offline) {<NEW_LINE>return -1;<NEW_LINE>} else if (!isR1Offline && isR2Offline) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>boolean isR1Immigrant = _immigrantReplicas.contains(r1);<NEW_LINE>boolean isR2Immigrant = _immigrantReplicas.contains(r2);<NEW_LINE>int result = (isR1Immigrant && !isR2Immigrant) ? -1 : ((!isR1Immigrant && isR2Immigrant) ? 1 : 0);<NEW_LINE>if (result == 0) {<NEW_LINE>if (r1.topicPartition().partition() > r2.topicPartition().partition()) {<NEW_LINE>return 1;<NEW_LINE>} else if (r1.topicPartition().partition() < r2.topicPartition().partition()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
isR1Offline = _currentOfflineReplicas.contains(r1);
138,035
public static void addAnnotation(JCModifiers mods, JavacNode node, JavacNode source, String annotationTypeFqn, JCExpression arg) {<NEW_LINE>boolean isJavaLangBased;<NEW_LINE>String simpleName;<NEW_LINE>{<NEW_LINE>int idx = annotationTypeFqn.lastIndexOf('.');<NEW_LINE>simpleName = idx == -1 ? annotationTypeFqn : <MASK><NEW_LINE>isJavaLangBased = idx == 9 && annotationTypeFqn.regionMatches(0, "java.lang.", 0, 10);<NEW_LINE>}<NEW_LINE>for (JCAnnotation ann : mods.annotations) {<NEW_LINE>JCTree annType = ann.getAnnotationType();<NEW_LINE>if (annType instanceof JCIdent) {<NEW_LINE>Name lastPart = ((JCIdent) annType).name;<NEW_LINE>if (lastPart.contentEquals(simpleName))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (annType instanceof JCFieldAccess) {<NEW_LINE>if (annType.toString().equals(annotationTypeFqn))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JavacTreeMaker maker = node.getTreeMaker();<NEW_LINE>JCExpression annType = isJavaLangBased ? genJavaLangTypeRef(node, simpleName) : chainDotsString(node, annotationTypeFqn);<NEW_LINE>List<JCExpression> argList = arg != null ? List.of(arg) : List.<JCExpression>nil();<NEW_LINE>JCAnnotation annotation = recursiveSetGeneratedBy(maker.Annotation(annType, argList), source);<NEW_LINE>mods.annotations = mods.annotations.append(annotation);<NEW_LINE>}
annotationTypeFqn.substring(idx + 1);
742,861
public void show() {<NEW_LINE>myWindow = Window.create(myProject.getName(), WindowOptions.builder().<MASK><NEW_LINE>myStatusBar = new UnifiedStatusBarImpl(myProject.getApplication(), null);<NEW_LINE>Disposer.register(this, myStatusBar);<NEW_LINE>myStatusBar.install(this);<NEW_LINE>myRootView.setStatusBar(myStatusBar);<NEW_LINE>StatusBarWidgetsManager.getInstance(myProject).updateAllWidgets(UIAccess.current());<NEW_LINE>com.vaadin.ui.Window vaadinWindow = (com.vaadin.ui.Window) TargetVaddin.to(myWindow);<NEW_LINE>WebFocusManagerImpl.register(vaadinWindow);<NEW_LINE>vaadinWindow.setWindowMode(WindowMode.MAXIMIZED);<NEW_LINE>myWindow.addListener(Window.CloseListener.class, () -> {<NEW_LINE>myWindow.close();<NEW_LINE>ProjectManager.getInstance().closeAndDisposeAsync(myProject, UIAccess.current());<NEW_LINE>});<NEW_LINE>myWindow.setContent(myRootView.getRootPanel().getComponent());<NEW_LINE>myRootView.update();<NEW_LINE>myWindow.show();<NEW_LINE>}
disableResize().build());
1,411,657
public void loadUdfFromClass(final Class<?> theClass, final String path) {<NEW_LINE>final UdfDescription udfDescriptionAnnotation = theClass.getAnnotation(UdfDescription.class);<NEW_LINE>if (udfDescriptionAnnotation == null) {<NEW_LINE>throw new KsqlException(String.format("Cannot load class %s. Classes containing UDFs must" + "be annotated with @UdfDescription.", theClass.getName()));<NEW_LINE>}<NEW_LINE>final String functionName = udfDescriptionAnnotation.name();<NEW_LINE>final String sensorName = "ksql-udf-" + functionName;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Class<? extends Kudf> udfClass = metrics.map(m -> (Class) UdfMetricProducer.class).orElse(PluggableUdf.class);<NEW_LINE>FunctionMetrics.initInvocationSensor(metrics, <MASK><NEW_LINE>final UdfFactory factory = new UdfFactory(udfClass, new UdfMetadata(udfDescriptionAnnotation.name(), udfDescriptionAnnotation.description(), udfDescriptionAnnotation.author(), udfDescriptionAnnotation.version(), udfDescriptionAnnotation.category(), path));<NEW_LINE>functionRegistry.ensureFunctionFactory(factory);<NEW_LINE>for (final Method method : theClass.getMethods()) {<NEW_LINE>final Udf udfAnnotation = method.getAnnotation(Udf.class);<NEW_LINE>if (udfAnnotation != null) {<NEW_LINE>final KsqlScalarFunction function;<NEW_LINE>try {<NEW_LINE>function = createFunction(theClass, udfDescriptionAnnotation, udfAnnotation, method, path, sensorName, udfClass);<NEW_LINE>} catch (final KsqlException e) {<NEW_LINE>if (throwExceptionOnLoadFailure) {<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Failed to add UDF to the MetaStore. name={} method={}", udfDescriptionAnnotation.name(), method, e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>factory.addFunction(function);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sensorName, "ksql-udf", functionName + " udf");
1,500,342
public void executeWriteAction(Editor editor, @Nullable Caret caret, DataContext dataContext) {<NEW_LINE>assert caret != null;<NEW_LINE>DocumentEx document = (DocumentEx) editor.getDocument();<NEW_LINE>Project project = editor.getProject();<NEW_LINE>assert project != null;<NEW_LINE>PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);<NEW_LINE>PsiFile file = psiDocumentManager.getPsiFile(document);<NEW_LINE>assert file != null;<NEW_LINE>int selectionStart = caret.getSelectionStart();<NEW_LINE>int selectionEnd = caret.getSelectionEnd();<NEW_LINE>assert selectionStart <= selectionEnd;<NEW_LINE>PsiElement[] elementList = getElementList(file, selectionStart, selectionEnd);<NEW_LINE>assert elementList != null;<NEW_LINE>Range<Integer> elementRange = findRangeOfElementsToMove(elementList, selectionStart, selectionEnd);<NEW_LINE>if (elementRange == null)<NEW_LINE>return;<NEW_LINE>if (!OUR_ACTIONS.contains(EditorLastActionTracker.getInstance().getLastActionId())) {<NEW_LINE>FeatureUsageTracker.getInstance().triggerFeatureUsed("move.element.left.right");<NEW_LINE>}<NEW_LINE>int toMoveStart = elementList[elementRange.getFrom()].getTextRange().getStartOffset();<NEW_LINE>int toMoveEnd = elementList[elementRange.getTo()].getTextRange().getEndOffset();<NEW_LINE>int otherIndex = myIsLeft ? elementRange.getFrom() - 1 : elementRange.getTo() + 1;<NEW_LINE>int otherStart = elementList[otherIndex].getTextRange().getStartOffset();<NEW_LINE>int otherEnd = elementList[otherIndex].getTextRange().getEndOffset();<NEW_LINE>selectionStart = trim(selectionStart, toMoveStart, toMoveEnd);<NEW_LINE>selectionEnd = <MASK><NEW_LINE>int caretOffset = trim(caret.getOffset(), toMoveStart, toMoveEnd);<NEW_LINE>int caretShift;<NEW_LINE>if (toMoveStart < otherStart) {<NEW_LINE>document.moveText(toMoveStart, toMoveEnd, otherStart);<NEW_LINE>document.moveText(otherStart, otherEnd, toMoveStart);<NEW_LINE>caretShift = otherEnd - toMoveEnd;<NEW_LINE>} else {<NEW_LINE>document.moveText(otherStart, otherEnd, toMoveStart);<NEW_LINE>document.moveText(toMoveStart, toMoveEnd, otherStart);<NEW_LINE>caretShift = otherStart - toMoveStart;<NEW_LINE>}<NEW_LINE>caret.moveToOffset(caretOffset + caretShift);<NEW_LINE>caret.setSelection(selectionStart + caretShift, selectionEnd + caretShift);<NEW_LINE>}
trim(selectionEnd, toMoveStart, toMoveEnd);
861,506
public ListCACertificatesResult listCACertificates(ListCACertificatesRequest listCACertificatesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listCACertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListCACertificatesRequest> request = null;<NEW_LINE>Response<ListCACertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListCACertificatesRequestMarshaller().marshall(listCACertificatesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListCACertificatesResult, JsonUnmarshallerContext> unmarshaller = new ListCACertificatesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListCACertificatesResult> responseHandler = new JsonResponseHandler<ListCACertificatesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,130,543
public Object clone() {<NEW_LINE>CrosstabBaseCloneFactory factory = new CrosstabBaseCloneFactory();<NEW_LINE>JRBaseCrosstab clone = (JRBaseCrosstab) super.clone();<NEW_LINE>clone.parameters = JRCloneUtils.cloneArray(parameters);<NEW_LINE>if (variables != null) {<NEW_LINE>clone.variables = new JRVariable[variables.length];<NEW_LINE>for (int i = 0; i < variables.length; i++) {<NEW_LINE>clone.variables[i] = factory.clone(variables[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clone.parametersMapExpression = JRCloneUtils.nullSafeClone(parametersMapExpression);<NEW_LINE>clone.dataset = JRCloneUtils.nullSafeClone(dataset);<NEW_LINE>clone.rowGroups = factory.cloneCrosstabObjects(rowGroups);<NEW_LINE>clone.<MASK><NEW_LINE>clone.measures = factory.cloneCrosstabObjects(measures);<NEW_LINE>clone.cells = new JRCrosstabCell[cells.length][];<NEW_LINE>for (int i = 0; i < cells.length; i++) {<NEW_LINE>clone.cells[i] = JRCloneUtils.cloneArray(cells[i]);<NEW_LINE>}<NEW_LINE>clone.whenNoDataCell = JRCloneUtils.nullSafeClone(whenNoDataCell);<NEW_LINE>clone.titleCell = JRCloneUtils.nullSafeClone(titleCell);<NEW_LINE>clone.headerCell = JRCloneUtils.nullSafeClone(headerCell);<NEW_LINE>clone.lineBox = lineBox.clone(clone);<NEW_LINE>return clone;<NEW_LINE>}
columnGroups = factory.cloneCrosstabObjects(columnGroups);
1,638,016
private // region private helpers<NEW_LINE>void updateOrScheduleJob(Context context, TaskInterface task, List<PersistableBundle> data) {<NEW_LINE>JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);<NEW_LINE>if (jobScheduler == null) {<NEW_LINE>Log.e(this.getClass().getName(), "Job scheduler not found!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<JobInfo> pendingJobs = jobScheduler.getAllPendingJobs();<NEW_LINE>Collections.sort(pendingJobs, new Comparator<JobInfo>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(JobInfo a, JobInfo b) {<NEW_LINE>return Integer.compare(a.getId(), b.getId());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// We will be looking for the lowest number that is not being used yet.<NEW_LINE>int newJobId = 0;<NEW_LINE>for (JobInfo jobInfo : pendingJobs) {<NEW_LINE>int jobId = jobInfo.getId();<NEW_LINE>if (isJobInfoRelatedToTask(jobInfo, task)) {<NEW_LINE>JobInfo mergedJobInfo = createJobInfoByAddingData(jobInfo, data);<NEW_LINE>// Add the task to the list of rescheduled tasks.<NEW_LINE>sTasksReschedulingJob.add(task);<NEW_LINE>try {<NEW_LINE>// Cancel jobs with the same ID to let them be rescheduled.<NEW_LINE>jobScheduler.cancel(jobId);<NEW_LINE>// Reschedule job for given task.<NEW_LINE>jobScheduler.schedule(mergedJobInfo);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>Log.e(this.getClass().getName(), "Unable to reschedule a job: " + e.getMessage());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newJobId == jobId) {<NEW_LINE>newJobId++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Given task doesn't have any pending jobs yet, create a new JobInfo and schedule it then.<NEW_LINE>JobInfo jobInfo = createJobInfo(context, task, newJobId, data);<NEW_LINE>jobScheduler.schedule(jobInfo);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>Log.e(this.getClass().getName(), <MASK><NEW_LINE>}<NEW_LINE>}
"Unable to schedule a new job: " + e.getMessage());
1,134,952
public static INDArray sortRows(final INDArray in, final int colIdx, final boolean ascending) {<NEW_LINE>if (in.rank() != 2)<NEW_LINE>throw new IllegalArgumentException("Cannot sort rows on non-2d matrix");<NEW_LINE>if (colIdx < 0 || colIdx >= in.columns())<NEW_LINE>throw new IllegalArgumentException("Cannot sort on values in column " + colIdx + ", nCols=" + in.columns());<NEW_LINE>INDArray out = Nd4j.create(in.dataType(), in.shape());<NEW_LINE>int nRows = in.rows();<NEW_LINE>ArrayList<Integer> list <MASK><NEW_LINE>for (int i = 0; i < nRows; i++) list.add(i);<NEW_LINE>Collections.sort(list, new Comparator<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Integer o1, Integer o2) {<NEW_LINE>if (ascending)<NEW_LINE>return Double.compare(in.getDouble(o1, colIdx), in.getDouble(o2, colIdx));<NEW_LINE>else<NEW_LINE>return -Double.compare(in.getDouble(o1, colIdx), in.getDouble(o2, colIdx));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < nRows; i++) {<NEW_LINE>out.putRow(i, in.getRow(list.get(i)));<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>}
= new ArrayList<>(nRows);
743,072
// ------------------------------------------------------------------------------<NEW_LINE>// Method: LogFileHandle.keypointStarting<NEW_LINE>// ------------------------------------------------------------------------------<NEW_LINE>void keypointStarting(long nextRecordSequenceNumber) throws InternalLogException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "keypointStarting", new Object[] { new Long(nextRecordSequenceNumber), this });<NEW_LINE>// Set the header to indicate a keypoint operation. This also marks the header<NEW_LINE>// as valid.<NEW_LINE>_logFileHeader.keypointStarting(nextRecordSequenceNumber);<NEW_LINE>try {<NEW_LINE>writeFileHeader(false);<NEW_LINE>} catch (InternalLogException exc) {<NEW_LINE>FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointStarting", "1073", this);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "keypointStarting", exc);<NEW_LINE>throw exc;<NEW_LINE>} catch (Throwable exc) {<NEW_LINE>FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointStarting", "1079", this);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "keypointStarting", "InternalLogException");<NEW_LINE>throw new InternalLogException(exc);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>}
Tr.exit(tc, "keypointStarting");
1,490,599
public Collection<MetricAnomaly<E>> metricAnomalies(Map<E, ValuesAndExtrapolations> metricsHistoryByEntity, Map<E, ValuesAndExtrapolations> currentMetricsByEntity) {<NEW_LINE>validateNotNull(metricsHistoryByEntity, "Metrics history cannot be null.");<NEW_LINE>validateNotNull(currentMetricsByEntity, "Current metrics cannot be null.");<NEW_LINE>if (metricsHistoryByEntity.isEmpty() || !isDataSufficient(metricsHistoryByEntity.values().iterator().next().metricValues().length(), _anomalyUpperPercentile, _anomalyLowerPercentile)) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>Set<MetricAnomaly<E>> metricAnomalies = new HashSet<>();<NEW_LINE>for (Map.Entry<E, ValuesAndExtrapolations> entry : currentMetricsByEntity.entrySet()) {<NEW_LINE>E entity = entry.getKey();<NEW_LINE>ValuesAndExtrapolations history = metricsHistoryByEntity.get(entity);<NEW_LINE>if (history == null) {<NEW_LINE>// No historical data exist for the given entity to identify metric anomalies.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ValuesAndExtrapolations current = currentMetricsByEntity.get(entity);<NEW_LINE>List<Long> windows = current.windows();<NEW_LINE>for (Short metricId : entry.getValue().metricValues().metricIds()) {<NEW_LINE>// Skip the metrics that are not interested.<NEW_LINE>if (_interestedMetrics.contains(toMetricName(metricId))) {<NEW_LINE>MetricAnomaly<E> metricAnomaly = getAnomalyForMetric(entity, metricId, history, current);<NEW_LINE>LOG.trace("Anomaly for metric id {} for entity {} in time frame {}: {}.", metricId, entity, windows, metricAnomaly == null ? <MASK><NEW_LINE>if (metricAnomaly != null) {<NEW_LINE>metricAnomalies.add(metricAnomaly);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_numRecentAnomalies = metricAnomalies.size();<NEW_LINE>return metricAnomalies;<NEW_LINE>}
"none" : metricAnomaly.description());
500,181
protected final BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) {<NEW_LINE>Object <MASK><NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(this.getFactoryBeanClassName());<NEW_LINE>BeanComponentDefinition innerDefinition = IntegrationNamespaceUtils.parseInnerHandlerDefinition(element, parserContext);<NEW_LINE>String ref = element.getAttribute(REF_ATTRIBUTE);<NEW_LINE>String expression = element.getAttribute(EXPRESSION_ATTRIBUTE);<NEW_LINE>boolean hasRef = StringUtils.hasText(ref);<NEW_LINE>boolean hasExpression = StringUtils.hasText(expression);<NEW_LINE>Element scriptElement = DomUtils.getChildElementByTagName(element, "script");<NEW_LINE>Element expressionElement = DomUtils.getChildElementByTagName(element, "expression");<NEW_LINE>if (innerDefinition != null) {<NEW_LINE>innerDefinition(element, parserContext, source, builder, innerDefinition, hasRef, hasExpression, expressionElement);<NEW_LINE>} else if (scriptElement != null) {<NEW_LINE>scriptElement(element, parserContext, source, builder, hasRef, hasExpression, scriptElement, expressionElement);<NEW_LINE>} else if (expressionElement != null) {<NEW_LINE>expressionElement(element, parserContext, source, builder, hasRef, hasExpression, expressionElement);<NEW_LINE>} else if (hasRef && hasExpression) {<NEW_LINE>parserContext.getReaderContext().error("Only one of 'ref' or 'expression' is permitted, not both, on element " + IntegrationNamespaceUtils.createElementDescription(element) + ".", source);<NEW_LINE>return null;<NEW_LINE>} else if (hasRef) {<NEW_LINE>builder.addPropertyReference("targetObject", ref);<NEW_LINE>} else if (hasExpression) {<NEW_LINE>builder.addPropertyValue("expressionString", expression);<NEW_LINE>} else if (!this.hasDefaultOption()) {<NEW_LINE>parserContext.getReaderContext().error("Exactly one of the 'ref' attribute, 'expression' attribute, " + "or inner bean (<bean/>) definition is required for element " + IntegrationNamespaceUtils.createElementDescription(element) + ".", source);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>methodAttribute(element, parserContext, source, builder, innerDefinition, hasRef, hasExpression, expressionElement);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-timeout");<NEW_LINE>this.postProcess(builder, element, parserContext);<NEW_LINE>return builder;<NEW_LINE>}
source = parserContext.extractSource(element);
1,111,059
private synchronized void refreshHomeDevices(List<HomeDevice> homeDevices) {<NEW_LINE>for (HomeDevice hd : homeDevices) {<NEW_LINE>String key = hd.getApplianceIdentifier().getApplianceId();<NEW_LINE>if (!cachedHomeDevicesByApplianceId.containsKey(key)) {<NEW_LINE>logger.<MASK><NEW_LINE>for (DiscoveryListener listener : discoveryListeners) {<NEW_LINE>listener.onApplianceAdded(hd);<NEW_LINE>}<NEW_LINE>ApplianceStatusListener listener = applianceStatusListeners.get(hd.getApplianceIdentifier().getApplianceId());<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onApplianceAdded(hd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cachedHomeDevicesByApplianceId.put(key, hd);<NEW_LINE>cachedHomeDevicesByRemoteUid.put(hd.getRemoteUid(), hd);<NEW_LINE>}<NEW_LINE>Set<Entry<String, HomeDevice>> cachedEntries = cachedHomeDevicesByApplianceId.entrySet();<NEW_LINE>Iterator<Entry<String, HomeDevice>> iterator = cachedEntries.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Entry<String, HomeDevice> cachedEntry = iterator.next();<NEW_LINE>HomeDevice cachedHomeDevice = cachedEntry.getValue();<NEW_LINE>if (!homeDevices.stream().anyMatch(d -> d.UID.equals(cachedHomeDevice.UID))) {<NEW_LINE>logger.debug("The appliance with ID '{}' has been removed", cachedHomeDevice.UID);<NEW_LINE>for (DiscoveryListener listener : discoveryListeners) {<NEW_LINE>listener.onApplianceRemoved(cachedHomeDevice);<NEW_LINE>}<NEW_LINE>ApplianceStatusListener listener = applianceStatusListeners.get(cachedHomeDevice.getApplianceIdentifier().getApplianceId());<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onApplianceRemoved();<NEW_LINE>}<NEW_LINE>cachedHomeDevicesByRemoteUid.remove(cachedHomeDevice.getRemoteUid());<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
debug("A new appliance with ID '{}' has been added", hd.UID);
355,042
// TODO: sub file cache<NEW_LINE>public static Output provideOutput(OpenDocument document, TranslationSettings settings, String cachePrefix, String cacheSuffix) throws IOException {<NEW_LINE>Output output = new Output();<NEW_LINE>FileCache cache = settings.getCache();<NEW_LINE>if (!settings.isSplitPages() || (document instanceof OpenDocumentText)) {<NEW_LINE>output.count = 1;<NEW_LINE>output.titles = SINGLE_TITLE;<NEW_LINE>} else {<NEW_LINE>if (document instanceof OpenDocumentSpreadsheet) {<NEW_LINE>output.count = document.getAsSpreadsheet().getTableCount();<NEW_LINE>output.titles = document.getAsSpreadsheet().getTableNames();<NEW_LINE>} else if (document instanceof OpenDocumentPresentation) {<NEW_LINE>output.count = document.getAsPresentation().getPageCount();<NEW_LINE>output.titles = document.getAsPresentation().getPageNames();<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("unsupported document");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.names = new ArrayList<String>();<NEW_LINE>LWXMLWriter[] outs = new LWXMLWriter[output.count];<NEW_LINE>for (int i = 0; i < output.count; i++) {<NEW_LINE>String name = cachePrefix + i + cacheSuffix;<NEW_LINE>output.names.add(name);<NEW_LINE>File file = cache.create(name);<NEW_LINE>outs[i] = new LWXMLStreamWriter(new FileWriter(file));<NEW_LINE>}<NEW_LINE>output.cache = cache;<NEW_LINE>output.names = Collections.unmodifiableList(output.names);<NEW_LINE>output.titles = Collections.unmodifiableList(output.titles);<NEW_LINE>output<MASK><NEW_LINE>return output;<NEW_LINE>}
.writer = new LWXMLMultiWriter(outs);
1,607,122
private static void logMessageReceived(HttpExchange exchange, String content, RendererConfiguration renderer) {<NEW_LINE>StringBuilder header = new StringBuilder();<NEW_LINE>String soapAction = null;<NEW_LINE>header.append(exchange.getRequestMethod());<NEW_LINE>header.append(" ").append(exchange.getRequestURI());<NEW_LINE>if (header.length() > 0) {<NEW_LINE>header.append(" ");<NEW_LINE>}<NEW_LINE>header.append(exchange.getProtocol());<NEW_LINE>header.append("\n\n");<NEW_LINE>header.append("HEADER:\n");<NEW_LINE>for (Map.Entry<String, List<String>> headers : exchange.getRequestHeaders().entrySet()) {<NEW_LINE>String name = headers.getKey();<NEW_LINE>if (StringUtils.isNotBlank(name)) {<NEW_LINE>for (String value : headers.getValue()) {<NEW_LINE>header.append(" ").append(name).append(": ").append(value).append("\n");<NEW_LINE>if ("SOAPACTION".equalsIgnoreCase(name)) {<NEW_LINE>soapAction = value.toUpperCase(Locale.ROOT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String formattedContent = null;<NEW_LINE>if (StringUtils.isNotBlank(content)) {<NEW_LINE>try {<NEW_LINE>formattedContent = StringUtil.prettifyXML(content, StandardCharsets.UTF_8, 2);<NEW_LINE>} catch (XPathExpressionException | SAXException | ParserConfigurationException | TransformerException e) {<NEW_LINE>LOGGER.trace("XML parsing failed with:\n{}", e);<NEW_LINE>formattedContent = " Content isn't valid XML, using text formatting: " + e.getMessage() + "\n";<NEW_LINE>formattedContent += " " + content.replaceAll("\n", "\n ") + "\n";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String requestType = "";<NEW_LINE>// Map known requests to request type<NEW_LINE>if (soapAction != null) {<NEW_LINE>if (soapAction.contains("CONTENTDIRECTORY:1#BROWSE")) {<NEW_LINE>requestType = "browse ";<NEW_LINE>} else if (soapAction.contains("CONTENTDIRECTORY:1#SEARCH")) {<NEW_LINE>requestType = "search ";<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>soapAction = "";<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>formattedContent = StringUtils.isNotBlank(formattedContent) ? "\nCONTENT:\n" + formattedContent : "";<NEW_LINE>if (StringUtils.isNotBlank(requestType)) {<NEW_LINE>LOGGER.trace("Received a {}request from {}:\n\n{}{}", requestType, rendererName, header, formattedContent);<NEW_LINE>} else {<NEW_LINE>// Trace not supported request type<NEW_LINE>LOGGER.trace("Received a {}request from {}:\n\n{}{}\nRenderer UUID={}", soapAction, rendererName, header, formattedContent, renderer != null ? renderer.uuid : "null");<NEW_LINE>}<NEW_LINE>}
rendererName = getRendererName(exchange, renderer);
990,917
private static File resolveNbDestDir(File root, File customNbDestDir, PropertyEvaluator eval) throws IOException {<NEW_LINE>File nbdestdir;<NEW_LINE>if (customNbDestDir == null) {<NEW_LINE>String nbdestdirS = eval.getProperty(NETBEANS_DEST_DIR);<NEW_LINE>if (nbdestdirS == null) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IOException("No netbeans.dest.dir defined in " + root);<NEW_LINE>}<NEW_LINE>nbdestdir = PropertyUtils.resolveFile(root, nbdestdirS);<NEW_LINE>} else {<NEW_LINE>nbdestdir = customNbDestDir;<NEW_LINE>}<NEW_LINE>if (!nbdestdir.exists()) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, // NOI18N<NEW_LINE>"Project in " + root + " is missing its platform '" + eval<MASK><NEW_LINE>NbPlatform p2 = NbPlatform.getDefaultPlatform();<NEW_LINE>if (p2 != null)<NEW_LINE>nbdestdir = p2.getDestDir();<NEW_LINE>}<NEW_LINE>return nbdestdir;<NEW_LINE>}
.getProperty("nbplatform.active") + "', switching to default platform");
937,053
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(RoleDescriptor.Fields.NAMES.getPreferredName(), indices);<NEW_LINE>builder.field(RoleDescriptor.Fields.PRIVILEGES.getPreferredName(), privileges);<NEW_LINE>if (fieldSecurity.stream().anyMatch(g -> nonEmpty(g.getGrantedFields()) || nonEmpty(g.getExcludedFields()))) {<NEW_LINE>builder.startArray(RoleDescriptor.<MASK><NEW_LINE>final List<FieldPermissionsDefinition.FieldGrantExcludeGroup> sortedFieldSecurity = this.fieldSecurity.stream().sorted().toList();<NEW_LINE>for (FieldPermissionsDefinition.FieldGrantExcludeGroup group : sortedFieldSecurity) {<NEW_LINE>builder.startObject();<NEW_LINE>if (nonEmpty(group.getGrantedFields())) {<NEW_LINE>builder.array(RoleDescriptor.Fields.GRANT_FIELDS.getPreferredName(), group.getGrantedFields());<NEW_LINE>}<NEW_LINE>if (nonEmpty(group.getExcludedFields())) {<NEW_LINE>builder.array(RoleDescriptor.Fields.EXCEPT_FIELDS.getPreferredName(), group.getExcludedFields());<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>if (queries.isEmpty() == false) {<NEW_LINE>builder.startArray(RoleDescriptor.Fields.QUERY.getPreferredName());<NEW_LINE>for (BytesReference q : queries) {<NEW_LINE>builder.value(q.utf8ToString());<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>builder.field(RoleDescriptor.Fields.ALLOW_RESTRICTED_INDICES.getPreferredName(), allowRestrictedIndices);<NEW_LINE>return builder.endObject();<NEW_LINE>}
Fields.FIELD_PERMISSIONS.getPreferredName());
414,503
public void updateConfiguration(Configuration configuration, HdfsContext context, URI uri) {<NEW_LINE>if (cacheConfig.isCachingEnabled() && cacheConfig.getCacheType() == ALLUXIO) {<NEW_LINE>configuration.set("alluxio.user.local.cache.enabled", String.valueOf(cacheConfig.isCachingEnabled()));<NEW_LINE>if (cacheConfig.getBaseDirectory() != null) {<NEW_LINE>configuration.set("alluxio.user.client.cache.dir", cacheConfig.getBaseDirectory().getPath());<NEW_LINE>}<NEW_LINE>configuration.set("alluxio.user.client.cache.size", alluxioCacheConfig.getMaxCacheSize().toString());<NEW_LINE>configuration.set("alluxio.user.client.cache.async.write.enabled", String.valueOf(alluxioCacheConfig.isAsyncWriteEnabled()));<NEW_LINE>configuration.set("alluxio.user.metrics.collection.enabled", String.valueOf(alluxioCacheConfig.isMetricsCollectionEnabled()));<NEW_LINE>configuration.set("alluxio.user.client.cache.eviction.retries", String.valueOf(alluxioCacheConfig.getEvictionRetries()));<NEW_LINE>configuration.set("alluxio.user.client.cache.evictor.class", alluxioCacheConfig.getEvictionPolicy().getClassName());<NEW_LINE>configuration.set("alluxio.user.client.cache.quota.enabled", String.valueOf(alluxioCacheConfig.isCacheQuotaEnabled()));<NEW_LINE>configuration.set("sink.jmx.class", alluxioCacheConfig.getJmxClass());<NEW_LINE>configuration.set("sink.jmx.domain", alluxioCacheConfig.getMetricsDomain());<NEW_LINE>configuration.set("alluxio.conf.validation.enabled", String.valueOf(alluxioCacheConfig.isConfigValidationEnabled()));<NEW_LINE>if (alluxioCacheConfig.getTimeoutEnabled()) {<NEW_LINE>configuration.set("alluxio.user.client.cache.timeout.duration", String.valueOf(alluxioCacheConfig.getTimeoutDuration().toMillis()));<NEW_LINE>configuration.set("alluxio.user.client.cache.timeout.threads", String.valueOf(alluxioCacheConfig.getTimeoutThreads()));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>configuration.set("alluxio.user.client.cache.shadow.enabled", String.valueOf(alluxioCacheConfig.isShadowCacheEnabled()));<NEW_LINE>configuration.set("alluxio.user.client.cache.shadow.window", String.valueOf(alluxioCacheConfig.getShadowCacheWindow().toMillis()));<NEW_LINE>}<NEW_LINE>}
configuration.set("alluxio.user.client.cache.timeout.duration", "-1");
635,815
private int addBootStrapTypeSwitchEntry(int localContentsOffset, SwitchStatement switchStatement, Map<String, Integer> fPtr) {<NEW_LINE>final int contentsEntries = 10;<NEW_LINE>int indexFortypeSwitch = fPtr.get(ClassFile.TYPESWITCH_STRING);<NEW_LINE>if (contentsEntries + localContentsOffset >= this.contents.length) {<NEW_LINE>resizeContents(contentsEntries);<NEW_LINE>}<NEW_LINE>if (indexFortypeSwitch == 0) {<NEW_LINE>ReferenceBinding javaLangRuntimeSwitchBootstraps = this.referenceBinding.scope.getJavaLangRuntimeSwitchBootstraps();<NEW_LINE>indexFortypeSwitch = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangRuntimeSwitchBootstraps, ConstantPool.TYPESWITCH, ConstantPool.JAVA_LANG_RUNTIME_SWITCHBOOTSTRAPS_TYPESWITCH_SIGNATURE, false);<NEW_LINE>fPtr.put(ClassFile.TYPESWITCH_STRING, indexFortypeSwitch);<NEW_LINE>}<NEW_LINE>this.contents[localContentsOffset++] = (<MASK><NEW_LINE>this.contents[localContentsOffset++] = (byte) indexFortypeSwitch;<NEW_LINE>// u2 num_bootstrap_arguments<NEW_LINE>int numArgsLocation = localContentsOffset;<NEW_LINE>CaseStatement.ResolvedCase[] constants = switchStatement.otherConstants;<NEW_LINE>int numArgs = constants.length;<NEW_LINE>this.contents[numArgsLocation++] = (byte) (numArgs >> 8);<NEW_LINE>this.contents[numArgsLocation] = (byte) numArgs;<NEW_LINE>localContentsOffset += 2;<NEW_LINE>for (CaseStatement.ResolvedCase c : constants) {<NEW_LINE>if (c.isPattern()) {<NEW_LINE>char[] typeName = c.t.constantPoolName();<NEW_LINE>int typeIndex = this.constantPool.literalIndexForType(typeName);<NEW_LINE>this.contents[localContentsOffset++] = (byte) (typeIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) typeIndex;<NEW_LINE>} else if (c.e instanceof StringLiteral) {<NEW_LINE>int intValIdx = this.constantPool.literalIndex(c.c.stringValue());<NEW_LINE>this.contents[localContentsOffset++] = (byte) (intValIdx >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) intValIdx;<NEW_LINE>} else {<NEW_LINE>int intValIdx = this.constantPool.literalIndex(c.intValue());<NEW_LINE>this.contents[localContentsOffset++] = (byte) (intValIdx >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) intValIdx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return localContentsOffset;<NEW_LINE>}
byte) (indexFortypeSwitch >> 8);
1,280,165
private StatusCode[] newErrorCode(List<String> errorCodes) {<NEW_LINE>if (CollectionUtils.isEmpty(errorCodes)) {<NEW_LINE>return new StatusCode[0];<NEW_LINE>}<NEW_LINE>List<StatusCode> statusCodeList = new ArrayList<>();<NEW_LINE>for (String errorCode : errorCodes) {<NEW_LINE>if (errorCode.equalsIgnoreCase("5xx")) {<NEW_LINE>statusCodeList.add(new ServerError());<NEW_LINE>} else if (errorCode.equalsIgnoreCase("4xx")) {<NEW_LINE>statusCodeList.add(new ClientError());<NEW_LINE>} else if (errorCode.equalsIgnoreCase("3xx")) {<NEW_LINE>statusCodeList.add(new Redirection());<NEW_LINE>} else if (errorCode.equalsIgnoreCase("2xx")) {<NEW_LINE>statusCodeList.add(new Success());<NEW_LINE>} else if (errorCode.equalsIgnoreCase("1xx")) {<NEW_LINE>statusCodeList.add(new Informational());<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>final int <MASK><NEW_LINE>statusCodeList.add(new DefaultStatusCode(statusCode));<NEW_LINE>} catch (NumberFormatException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toArray(statusCodeList);<NEW_LINE>}
statusCode = Integer.parseInt(errorCode);
1,832,630
final DBClusterSnapshotAttributesResult executeDescribeDBClusterSnapshotAttributes(DescribeDBClusterSnapshotAttributesRequest describeDBClusterSnapshotAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBClusterSnapshotAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeDBClusterSnapshotAttributesRequest> request = null;<NEW_LINE>Response<DBClusterSnapshotAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBClusterSnapshotAttributesRequestMarshaller().marshall(super.beforeMarshalling(describeDBClusterSnapshotAttributesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBClusterSnapshotAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBClusterSnapshotAttributesResult> responseHandler = new StaxResponseHandler<DBClusterSnapshotAttributesResult>(new DBClusterSnapshotAttributesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,466,005
private void preparePlugins() {<NEW_LINE>besuPluginContext.addService(PicoCLIOptions.class, new PicoCLIOptionsImpl(commandLine));<NEW_LINE>besuPluginContext.addService(SecurityModuleService.class, securityModuleService);<NEW_LINE>besuPluginContext.addService(StorageService.class, storageService);<NEW_LINE>besuPluginContext.addService(MetricCategoryRegistry.class, metricCategoryRegistry);<NEW_LINE>besuPluginContext.addService(PermissioningService.class, permissioningService);<NEW_LINE>besuPluginContext.addService(PrivacyPluginService.class, privacyPluginService);<NEW_LINE>besuPluginContext.addService(RpcEndpointService.class, rpcEndpointServiceImpl);<NEW_LINE>// register built-in plugins<NEW_LINE>new RocksDBPlugin().register(besuPluginContext);<NEW_LINE>new InMemoryStoragePlugin().register(besuPluginContext);<NEW_LINE><MASK><NEW_LINE>metricCategoryRegistry.getMetricCategories().forEach(metricCategoryConverter::addRegistryCategory);<NEW_LINE>// register default security module<NEW_LINE>securityModuleService.register(DEFAULT_SECURITY_MODULE, Suppliers.memoize(this::defaultSecurityModule));<NEW_LINE>}
besuPluginContext.registerPlugins(pluginsDir());
1,374,645
public Source resolve(String fname, String base) throws TransformerException {<NEW_LINE>try {<NEW_LINE>URL resource;<NEW_LINE>if (fname.endsWith(".xsl") || fname.endsWith(".xml")) {<NEW_LINE>// Force XSL and XML files to be located in the 'xsl' subdirectory.<NEW_LINE>String file = fname.substring(0, 5).equals("file:") ? fname.substring(5) <MASK><NEW_LINE>resource = fileProvider.fromBundle(file);<NEW_LINE>} else {<NEW_LINE>// This is a model reference, assume relative to the source file<NEW_LINE>resource = fileProvider.fromWorkspace(start + fname);<NEW_LINE>if (resource == null) {<NEW_LINE>throw new IOException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new StreamSource(resource.openStream());<NEW_LINE>} catch (IOException use) {<NEW_LINE>throw new TransformerException("Custom resolver with start " + start + " could not open " + fname);<NEW_LINE>}<NEW_LINE>}
: "xsl" + File.separatorChar + fname;
401,288
public void testCaptureDebuggerThreadsPlugin() throws Throwable {<NEW_LINE>mb.createTestModel();<NEW_LINE>TestTargetProcess process = mb.testModel.addProcess(1234);<NEW_LINE>TraceRecorder recorder = modelService.recordTarget(process, new TestDebuggerTargetTraceMapper<MASK><NEW_LINE>Trace trace = recorder.getTrace();<NEW_LINE>TestTargetThread mainThread = process.addThread(1);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(mainThread));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread serverThread = process.addThread(2);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(serverThread));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread handler1Thread = process.addThread(3);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(handler1Thread));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>TestTargetThread handler2Thread = process.addThread(4);<NEW_LINE>waitForValue(() -> recorder.getTraceThread(handler2Thread));<NEW_LINE>AbstractGhidraHeadedDebuggerGUITest.waitForDomainObject(trace);<NEW_LINE>try (UndoableTransaction tid = UndoableTransaction.start(trace, "Comments", true)) {<NEW_LINE>recorder.getTraceThread(mainThread).setComment("GUI main loop");<NEW_LINE>recorder.getTraceThread(serverThread).setComment("Server");<NEW_LINE>recorder.getTraceThread(handler1Thread).setComment("Handler 1");<NEW_LINE>recorder.getTraceThread(handler2Thread).setComment("Handler 2");<NEW_LINE>}<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>process.removeThreads(handler1Thread);<NEW_LINE>waitFor(() -> nullOrDead(recorder.getTraceThread(handler1Thread)));<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>recorder.forceSnapshot();<NEW_LINE>process.removeThreads(handler2Thread);<NEW_LINE>waitFor(() -> nullOrDead(recorder.getTraceThread(handler2Thread)));<NEW_LINE>long lastSnap = recorder.forceSnapshot().getKey();<NEW_LINE>traceManager.openTrace(trace);<NEW_LINE>traceManager.activateThread(recorder.getTraceThread(serverThread));<NEW_LINE>traceManager.activateSnap(lastSnap);<NEW_LINE>TestTargetProcess dummy1 = mb.testModel.addProcess(4321);<NEW_LINE>TestTargetProcess dummy2 = mb.testModel.addProcess(5432);<NEW_LINE>TraceRecorder recDummy1 = modelService.recordTarget(dummy1, new TestDebuggerTargetTraceMapper(dummy1), ActionSource.AUTOMATIC);<NEW_LINE>TraceRecorder recDummy2 = modelService.recordTarget(dummy2, new TestDebuggerTargetTraceMapper(dummy2), ActionSource.AUTOMATIC);<NEW_LINE>traceManager.setAutoCloseOnTerminate(false);<NEW_LINE>traceManager.openTrace(recDummy1.getTrace());<NEW_LINE>traceManager.openTrace(recDummy2.getTrace());<NEW_LINE>recDummy1.stopRecording();<NEW_LINE>captureIsolatedProvider(DebuggerThreadsProvider.class, 900, 300);<NEW_LINE>}
(process), ActionSource.AUTOMATIC);
1,585,165
public TriState implies(boolean thisNegated, LogicNode other) {<NEW_LINE>if (other instanceof IntegerLowerThanNode) {<NEW_LINE>IntegerLowerThanNode otherLowerThan = (IntegerLowerThanNode) other;<NEW_LINE>if (getOp() == otherLowerThan.getOp() && getX() == otherLowerThan.getX()) {<NEW_LINE>// x < A => x < B?<NEW_LINE>LogicNode compareYs = getOp().create(getY(), otherLowerThan.<MASK><NEW_LINE>if (!thisNegated && compareYs.isTautology()) {<NEW_LINE>// A < B, therefore x < A => x < B<NEW_LINE>return TriState.TRUE;<NEW_LINE>} else if (thisNegated && compareYs.isContradiction()) {<NEW_LINE>// !(A < B) [== A >= B], therefore !(x < A) [== x >= A] => !(x < B) [== x >= B]<NEW_LINE>return TriState.FALSE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.implies(thisNegated, other);<NEW_LINE>}
getY(), NodeView.DEFAULT);
531,397
public void delete(Iterable<AllValueTypesTestRow> rows) {<NEW_LINE>List<byte[]> rowBytes = Persistables.persistAll(rows);<NEW_LINE>Set<Cell> cells = Sets.newHashSetWithExpectedSize(rowBytes.size() * 11);<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c0")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, <MASK><NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c10")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c2")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c3")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c4")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c5")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c6")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c7")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c8")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c9")));<NEW_LINE>t.delete(tableRef, cells);<NEW_LINE>}
PtBytes.toCachedBytes("c1")));
1,033,257
public void marshall(ADMMessage aDMMessage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (aDMMessage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getBody(), BODY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getConsolidationKey(), CONSOLIDATIONKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getData(), DATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getExpiresAfter(), EXPIRESAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getIconReference(), ICONREFERENCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getImageIconUrl(), IMAGEICONURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getImageUrl(), IMAGEURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getMD5(), MD5_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getRawContent(), RAWCONTENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getSilentPush(), SILENTPUSH_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getSmallImageIconUrl(), SMALLIMAGEICONURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(aDMMessage.getSubstitutions(), SUBSTITUTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aDMMessage.getUrl(), URL_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
aDMMessage.getSound(), SOUND_BINDING);
1,209,591
private static Type mergeType(Type fstType, Type secType) {<NEW_LINE>TypeEnum fstTypeType = fstType.getType();<NEW_LINE><MASK><NEW_LINE>if (fstTypeType == secTypeType) {<NEW_LINE>if (fstTypeType == TypeEnum.Array) {<NEW_LINE>Type fstArrayType = ((ArrayType) fstType).getGenericType();<NEW_LINE>Type secArrayType = ((ArrayType) secType).getGenericType();<NEW_LINE>Type mergeType = mergeType(fstArrayType, secArrayType);<NEW_LINE>//<NEW_LINE>((ArrayType) fstType).setGenericType(mergeType);<NEW_LINE>return fstType;<NEW_LINE>}<NEW_LINE>if (fstTypeType == TypeEnum.Struts) {<NEW_LINE>StrutsType fstMapType = ((StrutsType) fstType);<NEW_LINE>StrutsType secMapType = ((StrutsType) secType);<NEW_LINE>//<NEW_LINE>Map<String, Type> fstFieldTypeMap = fstMapType.getProperties();<NEW_LINE>for (Map.Entry<String, Type> ent : secMapType.getProperties().entrySet()) {<NEW_LINE>String key = ent.getKey();<NEW_LINE>if (!fstFieldTypeMap.containsKey(key)) {<NEW_LINE>fstFieldTypeMap.put(key, ent.getValue());<NEW_LINE>} else {<NEW_LINE>Type merged = mergeType(fstFieldTypeMap.get(key), ent.getValue());<NEW_LINE>fstFieldTypeMap.put(key, merged);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fstMapType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>//<NEW_LINE>return fstType;<NEW_LINE>}
TypeEnum secTypeType = secType.getType();
1,556,270
public void readFields(DataInput in) throws IOException {<NEW_LINE>state = TEtlState.valueOf(Text.readString(in));<NEW_LINE>trackingUrl = Text.readString(in);<NEW_LINE>int statsCount = in.readInt();<NEW_LINE>for (int i = 0; i < statsCount; ++i) {<NEW_LINE>String key = Text.readString(in);<NEW_LINE>String <MASK><NEW_LINE>stats.put(key, value);<NEW_LINE>}<NEW_LINE>int countersCount = in.readInt();<NEW_LINE>for (int i = 0; i < countersCount; ++i) {<NEW_LINE>String key = Text.readString(in);<NEW_LINE>String value = Text.readString(in);<NEW_LINE>counters.put(key, value);<NEW_LINE>}<NEW_LINE>// TODO: Persist `tableCounters`<NEW_LINE>// if (Catalog.getCurrentCatalogJournalVersion() >= FeMetaVersion.VERSION_93) {<NEW_LINE>// tableCounters = GsonUtils.GSON.fromJson(Text.readString(in), tableCounters.getClass());<NEW_LINE>// }<NEW_LINE>}
value = Text.readString(in);
1,672,204
public void detect(FontManager fontManager, FontAdder fontAdder, boolean strict, FontEventListener eventListener, List<EmbedFontInfo> fontInfoList) throws FOPException {<NEW_LINE>try {<NEW_LINE>// search in font base if it is defined and<NEW_LINE>// is a directory but don't recurse<NEW_LINE>FontFileFinder fontFileFinder = new FontFileFinder(eventListener);<NEW_LINE>// native o/s font directory finding<NEW_LINE>List<URL> systemFontList;<NEW_LINE>systemFontList = fontFileFinder.find();<NEW_LINE>fontAdder.add(systemFontList, fontInfoList);<NEW_LINE>// classpath font finding<NEW_LINE>ClasspathResource resource = ClasspathResource.getInstance();<NEW_LINE>for (String mimeTypes : FONT_MIMETYPES) {<NEW_LINE>fontAdder.add(resource.listResourcesOfMimeType(mimeTypes), fontInfoList);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LogUtil.handleException(log, e, strict);<NEW_LINE>} catch (URISyntaxException use) {<NEW_LINE>LogUtil.<MASK><NEW_LINE>}<NEW_LINE>}
handleException(log, use, strict);
764,292
public Map<String, Object> refreshTestRunning(User user, @PathVariable long id) {<NEW_LINE>PerfTest test = checkNotNull(getOneWithPermissionCheck(user, id, false), "given test should be exist : " + id);<NEW_LINE>Map<String<MASK><NEW_LINE>SamplingModel samplingModel = hazelcastService.get(DIST_MAP_NAME_SAMPLING, test.getId());<NEW_LINE>if (samplingModel != null) {<NEW_LINE>map.put("perf", JsonUtils.deserialize(samplingModel.getRunningSample(), HashMap.class));<NEW_LINE>map.put("agent", JsonUtils.deserialize(samplingModel.getAgentState(), HashMap.class));<NEW_LINE>}<NEW_LINE>String monitoringJson = hazelcastService.get(DIST_MAP_NAME_MONITORING, test.getId());<NEW_LINE>if (monitoringJson != null) {<NEW_LINE>map.put("monitor", JsonUtils.deserialize(monitoringJson, HashMap.class));<NEW_LINE>}<NEW_LINE>map.put("status", test.getStatus());<NEW_LINE>return map;<NEW_LINE>}
, Object> map = newHashMap();
24,950
final ImportAppCatalogResult executeImportAppCatalog(ImportAppCatalogRequest importAppCatalogRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importAppCatalogRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportAppCatalogRequest> request = null;<NEW_LINE>Response<ImportAppCatalogResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportAppCatalogRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importAppCatalogRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportAppCatalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportAppCatalogResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportAppCatalogResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
287,111
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Query query = emc.find(wi.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Business business = new Business(emc);<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getName(), query.getName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Reveal.class);<NEW_LINE>Reveal reveal = new Reveal();<NEW_LINE>Wi.copier.copy(wi, reveal);<NEW_LINE>if (StringUtils.isNotEmpty(reveal.getName()) && (!this.idleName(business, reveal))) {<NEW_LINE>throw new ExceptionNameExist(reveal.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(reveal.getAlias()) && (!this.idleAlias(business, reveal))) {<NEW_LINE>throw new ExceptionAliasExist(reveal.getAlias());<NEW_LINE>}<NEW_LINE>reveal.setQuery(query.getId());<NEW_LINE>emc.persist(reveal, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Reveal.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(reveal.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
ExceptionQueryNotExist(wi.getQuery());
1,373,813
protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>if (instanceImage == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int lineHeight = g.getFontMetrics().getHeight();<NEW_LINE>int lineAscent = g.getFontMetrics().getAscent();<NEW_LINE>int viewWidth = getWidth() - 2 * PREVIEW_BORDER;<NEW_LINE>int viewHeight = getHeight() - 3 * PREVIEW_BORDER - 2 * lineHeight;<NEW_LINE>if (viewWidth < 1 || viewHeight < 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int imgWidth = instanceImage.getWidth(null);<NEW_LINE>int imgHeight = instanceImage.getHeight(null);<NEW_LINE>if (imgWidth < 1 || imgHeight < 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = imgWidth;<NEW_LINE>int height = imgHeight;<NEW_LINE>int scale = 1;<NEW_LINE>int scaleX = (int) Math.ceil((float) imgWidth / viewWidth);<NEW_LINE>int scaleY = (int) Math.ceil((float) imgHeight / viewHeight);<NEW_LINE>if (scaleX > 1 || scaleY > 1) {<NEW_LINE>scale = Math.max(scaleX, scaleY);<NEW_LINE>width = (int) ((float) imgWidth / scale);<NEW_LINE>height = (int) <MASK><NEW_LINE>}<NEW_LINE>int x = PREVIEW_BORDER + (viewWidth - width) / 2;<NEW_LINE>int y = PREVIEW_BORDER + (viewHeight - height) / 2;<NEW_LINE>drawChecker(g, x, y, width, height);<NEW_LINE>g.drawImage(instanceImage, x, y, x + width, y + height, 0, 0, imgWidth, imgHeight, null);<NEW_LINE>g.setColor(getForeground());<NEW_LINE>int nextY = getHeight() - drawText(g, PREVIEW_BORDER, getHeight(), Bundle.ImageDetailProvider_Dimension(imgWidth, imgHeight));<NEW_LINE>if (scale != 1) {<NEW_LINE>drawText(g, PREVIEW_BORDER, nextY, Bundle.ImageDetailProvider_Zoom(scale));<NEW_LINE>}<NEW_LINE>}
((float) imgHeight / scale);
1,621,275
private static void externalIp(final com.typesafe.config.Config config) {<NEW_LINE>if (!config.hasPath(Constant.NODE_DISCOVERY_EXTERNAL_IP) || config.getString(Constant.NODE_DISCOVERY_EXTERNAL_IP).trim().isEmpty()) {<NEW_LINE>if (PARAMETER.nodeExternalIp == null) {<NEW_LINE>logger.info("External IP wasn't set, using checkip.amazonaws.com to identify it...");<NEW_LINE>BufferedReader in = null;<NEW_LINE>try {<NEW_LINE>in = new BufferedReader(new InputStreamReader(new URL(Constant.AMAZONAWS_URL).openStream()));<NEW_LINE>PARAMETER<MASK><NEW_LINE>if (PARAMETER.nodeExternalIp == null || PARAMETER.nodeExternalIp.trim().isEmpty()) {<NEW_LINE>throw new IOException("Invalid address: '" + PARAMETER.nodeExternalIp + "'");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InetAddress.getByName(PARAMETER.nodeExternalIp);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Invalid address: '" + PARAMETER.nodeExternalIp + "'");<NEW_LINE>}<NEW_LINE>logger.info("External address identified: {}", PARAMETER.nodeExternalIp);<NEW_LINE>} catch (IOException e) {<NEW_LINE>PARAMETER.nodeExternalIp = PARAMETER.nodeDiscoveryBindIp;<NEW_LINE>logger.warn("Can't get external IP. Fall back to peer.bind.ip: " + PARAMETER.nodeExternalIp + " :" + e);<NEW_LINE>} finally {<NEW_LINE>if (in != null) {<NEW_LINE>try {<NEW_LINE>in.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>PARAMETER.nodeExternalIp = config.getString(Constant.NODE_DISCOVERY_EXTERNAL_IP).trim();<NEW_LINE>}<NEW_LINE>}
.nodeExternalIp = in.readLine();
168,380
private void addToNewLocation(TreeView<Node> treeView, TreeItem<Node> dropTarget, Folder draggedFolder, TreeItem<Node> draggedItem, List<RequestContainer> requestsInFolder) {<NEW_LINE>// dropping on collection makes it the first children<NEW_LINE>if (dropTarget.getValue().getUserData() instanceof Collection) {<NEW_LINE>Collection targetCollection = (Collection) dropTarget.getValue().getUserData();<NEW_LINE>var folderOffset = targetCollection<MASK><NEW_LINE>targetCollection.getFolders().add(draggedFolder);<NEW_LINE>targetCollection.getRequests().addAll(folderOffset, requestsInFolder);<NEW_LINE>getRootList(dropTarget.getChildren()).add(folderOffset, draggedItem);<NEW_LINE>treeView.getSelectionModel().select(draggedItem);<NEW_LINE>} else if (dropTarget.getValue().getUserData() instanceof Folder) {<NEW_LINE>// dropping it onto folder makes it first request in folder<NEW_LINE>Folder targetFolder = (Folder) dropTarget.getValue().getUserData();<NEW_LINE>Collection targetCollection = findCollectionInParents(dropTarget);<NEW_LINE>targetCollection.getRequests().addAll(requestsInFolder);<NEW_LINE>var folderOffset = targetFolder.getFolders().size();<NEW_LINE>targetFolder.getFolders().add(0, draggedFolder);<NEW_LINE>getRootList(dropTarget.getChildren()).add(folderOffset, draggedItem);<NEW_LINE>treeView.getSelectionModel().select(draggedItem);<NEW_LINE>}<NEW_LINE>// else {<NEW_LINE>// // add to new location<NEW_LINE>// int indexInParent = getRootList(dropTarget.getParent().getChildren()).indexOf(dropTarget);<NEW_LINE>// getRootList(dropTarget.getParent().getChildren()).add(indexInParent + 1, draggedItem);<NEW_LINE>//<NEW_LINE>// //dropped onto a request within a collection<NEW_LINE>// if (dropTarget.getParent().getValue().getUserData() instanceof Collection) {<NEW_LINE>// Collection thisCollection = (Collection) dropTarget.getParent().getValue().getUserData();<NEW_LINE>// thisCollection.getRequests().add(indexInParent +1, draggedRequest);<NEW_LINE>// } else if (dropTarget.getParent().getValue().getUserData() instanceof Folder) {<NEW_LINE>// //dropped onto a request within a folder<NEW_LINE>// Collection collection = findCollectionInParents(dropTarget);<NEW_LINE>// collection.getRequests().add(draggedRequest);<NEW_LINE>// Folder f = (Folder) dropTarget.getParent().getValue().getUserData();<NEW_LINE>// var folderOffset = f.getFolders().size();<NEW_LINE>// f.getRequests().add(indexInParent - folderOffset +1, draggedRequest.getId());<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>}
.getFolders().size();
274,579
void initMediaSessionMetadata() {<NEW_LINE>MediaMetadataCompat.Builder metadataBuilder = new MediaMetadataCompat.Builder();<NEW_LINE>// Notification icon in card<NEW_LINE>MediaMetaData md = RemoteControlCallback.getMetaData();<NEW_LINE>if (md == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (md.getDisplayIcon() != null) {<NEW_LINE>Bitmap i = (Bitmap) md.getDisplayIcon().getImage();<NEW_LINE>metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, i);<NEW_LINE>}<NEW_LINE>if (md.getAlbumArt() != null) {<NEW_LINE>Bitmap i = (Bitmap) md.getDisplayIcon().getImage();<NEW_LINE>metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, i);<NEW_LINE>}<NEW_LINE>// lock screen icon for pre lollipop<NEW_LINE>if (md.getArt() != null) {<NEW_LINE>Bitmap i = (Bitmap) md.getDisplayIcon().getImage();<NEW_LINE>metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, i);<NEW_LINE>}<NEW_LINE>metadataBuilder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, md.getTitle());<NEW_LINE>metadataBuilder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE, md.getSubtitle());<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_TRACK_NUMBER, md.getTrackNumber());<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, md.getNumTracks());<NEW_LINE>mMediaSessionCompat.<MASK><NEW_LINE>}
setMetadata(metadataBuilder.build());
955,386
private Item findItemByUsername(String room, String username) {<NEW_LINE>Item foundItem = null;<NEW_LINE>List<Item> items = cache.get(room);<NEW_LINE>if (items != null) {<NEW_LINE>boolean oldEnoughHistory = false;<NEW_LINE>for (int i = items.size() - 1; i >= 0; i--) {<NEW_LINE>Item <MASK><NEW_LINE>if (item.getAge() > 5 * 60) {<NEW_LINE>oldEnoughHistory = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!item.hasRequestPending && !item.isHandled() && item.targetUser.getName().equals(username)) {<NEW_LINE>if (foundItem != null) {<NEW_LINE>// Can't be more than one Item, since we don't know<NEW_LINE>// which is the correct one by just the username<NEW_LINE>foundItem = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>foundItem = item;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!oldEnoughHistory) {<NEW_LINE>foundItem = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foundItem;<NEW_LINE>}
item = items.get(i);
78,990
public Object readConst(final int item, final char[] buf) {<NEW_LINE>int index = items[item];<NEW_LINE>switch(b[index - 1]) {<NEW_LINE>case INT:<NEW_LINE>return readInt(index);<NEW_LINE>case FLOAT:<NEW_LINE>return Float<MASK><NEW_LINE>case LONG:<NEW_LINE>return readLong(index);<NEW_LINE>case DOUBLE:<NEW_LINE>return Double.longBitsToDouble(readLong(index));<NEW_LINE>case CLASS:<NEW_LINE>return Type.getObjectType(readUTF8(index, buf));<NEW_LINE>case STR:<NEW_LINE>return readUTF8(index, buf);<NEW_LINE>case MTYPE:<NEW_LINE>return Type.getMethodType(readUTF8(index, buf));<NEW_LINE>default:<NEW_LINE>// case ClassWriter.HANDLE_BASE + [1..9]:<NEW_LINE>int tag = readByte(index);<NEW_LINE>int[] items = this.items;<NEW_LINE>int cpIndex = items[readUnsignedShort(index + 1)];<NEW_LINE>String owner = readClass(cpIndex, buf);<NEW_LINE>cpIndex = items[readUnsignedShort(cpIndex + 2)];<NEW_LINE>String name = readUTF8(cpIndex, buf);<NEW_LINE>String desc = readUTF8(cpIndex + 2, buf);<NEW_LINE>return new Handle(tag, owner, name, desc, tag == Opcodes.H_INVOKEINTERFACE);<NEW_LINE>}<NEW_LINE>}
.intBitsToFloat(readInt(index));
973,198
public void showClientMyCompanyTickets(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>ClientViewService clientViewService = Beans.get(ClientViewService.class);<NEW_LINE>User clientUser = clientViewService.getClientUser();<NEW_LINE>if (clientUser.getPartner() == null) {<NEW_LINE>response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));<NEW_LINE>} else {<NEW_LINE>Filter filter = clientViewService.getCompanyTicketsOfUser(clientUser).get(0);<NEW_LINE>if (filter != null) {<NEW_LINE>response.setView(ActionView.define(I18n.get("Company tickets")).model(Ticket.class.getName()).add("grid", "ticket-grid").add("form", "ticket-form").param("search-filters", "ticket-filters").domain(filter.getQuery<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>}
()).map());
1,065,242
void readItemsFromJson(@NonNull JSONObject json) throws IllegalArgumentException {<NEW_LINE>try {<NEW_LINE>if (!json.has("items")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONArray jsonArray = json.getJSONArray("items");<NEW_LINE>for (int i = 0; i < jsonArray.length(); i++) {<NEW_LINE>JSONObject <MASK><NEW_LINE>String comment = jsonPoint.optString(COMMENT_KEY);<NEW_LINE>comment = comment.isEmpty() ? null : comment;<NEW_LINE>JSONObject entityJson = jsonPoint.getJSONObject(ENTITY_KEY);<NEW_LINE>long id = entityJson.getLong(ID_KEY);<NEW_LINE>double lat = entityJson.getDouble(LAT_KEY);<NEW_LINE>double lon = entityJson.getDouble(LON_KEY);<NEW_LINE>String tags = entityJson.getString(TAGS_KEY);<NEW_LINE>Map<String, String> tagMap = new Gson().fromJson(tags, new TypeToken<HashMap<String, String>>() {<NEW_LINE>}.getType());<NEW_LINE>String action = entityJson.getString(ACTION_KEY);<NEW_LINE>Entity entity;<NEW_LINE>if (entityJson.get(TYPE_KEY).equals(Entity.EntityType.NODE.name())) {<NEW_LINE>entity = new Node(lat, lon, id);<NEW_LINE>} else {<NEW_LINE>entity = new Way(id);<NEW_LINE>entity.setLatitude(lat);<NEW_LINE>entity.setLongitude(lon);<NEW_LINE>}<NEW_LINE>entity.replaceTags(tagMap);<NEW_LINE>OpenstreetmapPoint point = new OpenstreetmapPoint();<NEW_LINE>point.setComment(comment);<NEW_LINE>point.setEntity(entity);<NEW_LINE>point.setAction(action);<NEW_LINE>items.add(point);<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));<NEW_LINE>throw new IllegalArgumentException("Json parse error", e);<NEW_LINE>}<NEW_LINE>}
jsonPoint = jsonArray.getJSONObject(i);
307,470
private static // org.glowroot.common.repo.util.LazySecretKey.SymmetricEncryptionKeyMissingException<NEW_LINE>Session createMailSession(SmtpConfig smtpConfig, @Nullable String passwordOverride, LazySecretKey lazySecretKey) throws Exception {<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.put("mail.smtp.host", smtpConfig.host());<NEW_LINE>ConnectionSecurity connectionSecurity = smtpConfig.connectionSecurity();<NEW_LINE>Integer port = smtpConfig.port();<NEW_LINE>if (port == null) {<NEW_LINE>port = 25;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (connectionSecurity == ConnectionSecurity.SSL_TLS) {<NEW_LINE>props.put("mail.smtp.socketFactory.port", port);<NEW_LINE>props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");<NEW_LINE>} else if (connectionSecurity == ConnectionSecurity.STARTTLS) {<NEW_LINE>props.put("mail.smtp.starttls.enable", true);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> entry : smtpConfig.additionalProperties().entrySet()) {<NEW_LINE>props.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>Authenticator authenticator = null;<NEW_LINE>final String password = getPassword(smtpConfig, passwordOverride, lazySecretKey);<NEW_LINE>if (!password.isEmpty()) {<NEW_LINE>props.put("mail.smtp.auth", "true");<NEW_LINE>final String username = smtpConfig.username();<NEW_LINE>authenticator = new Authenticator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected PasswordAuthentication getPasswordAuthentication() {<NEW_LINE>return new PasswordAuthentication(username, password);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return Session.getInstance(props, authenticator);<NEW_LINE>}
props.put("mail.smtp.port", port);
751,707
public static void customizePrefernces() {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final Border insetBorder = BorderFactory.createEmptyBorder(2, 2, 2, 0);<NEW_LINE>final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT);<NEW_LINE>final CPanel dlmPanel = new CPanel();<NEW_LINE>dlmPanel.setLayout(flowLayout);<NEW_LINE>dlmPanel.setBorder(insetBorder);<NEW_LINE>final CLabel dlmLevelLabel = new CLabel();<NEW_LINE>dlmLevelLabel.setText(msgBL.getMsg(Env.getCtx(), DLMPermanentIniCustomizer.INI_P_DLM_DLM_LEVEL));<NEW_LINE>final Map<Integer, ValueNamePair> values = getValues();<NEW_LINE>final CComboBox<ValueNamePair> dlmLevelField = new CComboBox<>(ImmutableList.of(values.get(IMigratorService.DLM_Level_TEST), values.<MASK><NEW_LINE>dlmPanel.add(dlmLevelLabel);<NEW_LINE>dlmPanel.add(dlmLevelField);<NEW_LINE>Preference.addSettingsPanel(dlmPanel, preference -> {<NEW_LINE>// do this on load<NEW_LINE>final int dlmLevel = DLMPermanentIniCustomizer.INSTANCE.getDlmLevel();<NEW_LINE>dlmLevelField.setSelectedItem(values.get(dlmLevel));<NEW_LINE>}, preference -> {<NEW_LINE>// do this on store<NEW_LINE>final ValueNamePair selectedItem = dlmLevelField.getSelectedItem();<NEW_LINE>if (selectedItem != null) {<NEW_LINE>Ini.setProperty(DLMPermanentIniCustomizer.INI_P_DLM_DLM_LEVEL, selectedItem.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
get(IMigratorService.DLM_Level_ARCHIVE)));
1,844,707
public ValidationResult check(PageValidation pageValidation, String objectName, SpecCount spec) throws ValidationErrorException {<NEW_LINE>List<String> matchingNames = pageValidation.getPageSpec().<MASK><NEW_LINE>Map<String, PageElement> reportElements;<NEW_LINE>Map<String, PageElement> filteredElements;<NEW_LINE>String filterName;<NEW_LINE>if (spec.getFetchType() == SpecCount.FetchType.ANY) {<NEW_LINE>filteredElements = findAllObjects(pageValidation, matchingNames);<NEW_LINE>reportElements = filteredElements;<NEW_LINE>filterName = "";<NEW_LINE>} else if (spec.getFetchType() == SpecCount.FetchType.VISIBLE) {<NEW_LINE>filteredElements = findVisibleObjects(pageValidation, matchingNames);<NEW_LINE>reportElements = filteredElements;<NEW_LINE>filterName = " visible";<NEW_LINE>} else if (spec.getFetchType() == SpecCount.FetchType.ABSENT) {<NEW_LINE>filteredElements = findAbsentObjects(pageValidation, matchingNames);<NEW_LINE>reportElements = Collections.emptyMap();<NEW_LINE>filterName = " absent";<NEW_LINE>} else {<NEW_LINE>throw new ValidationErrorException("Unknown filter: " + spec.getFetchType().toString().toLowerCase());<NEW_LINE>}<NEW_LINE>if (spec.getAmount().holds(filteredElements.size())) {<NEW_LINE>return new ValidationResult(spec, convertToValidationObjects(reportElements));<NEW_LINE>} else {<NEW_LINE>throw new ValidationErrorException().withValidationObjects(convertToValidationObjects(reportElements)).withMessage(format("There are %d%s objects matching \"%s\" %s", filteredElements.size(), filterName, spec.getPattern(), spec.getAmount().getErrorMessageSuffix("")));<NEW_LINE>}<NEW_LINE>}
findOnlyExistingMatchingObjectNames(spec.getPattern());
581,809
public static String makeSaveResultInfo(List<SaveResult> result) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>int index = 0;<NEW_LINE>for (SaveResult r : result) {<NEW_LINE>if (r == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Regular<NEW_LINE>if (r.written) {<NEW_LINE>b.append(String.format("* File written to %s\n", r.filePath));<NEW_LINE>} else if (r.writeError != null) {<NEW_LINE>b.append(String.format("* Writing failed: %s\n", <MASK><NEW_LINE>}<NEW_LINE>// Backup<NEW_LINE>if (r.backupWritten) {<NEW_LINE>b.append(String.format("* Backup written to %s\n", r.backupPath));<NEW_LINE>} else if (r.writeError != null) {<NEW_LINE>b.append(String.format("* Backup failed: %s\n", getErrorMessageCompact(r.backupError)));<NEW_LINE>} else if (r.cancelReason == SaveResult.CancelReason.INVALID_CONTENT) {<NEW_LINE>b.append("* Backup failed: Invalid content\n");<NEW_LINE>}<NEW_LINE>// Removed deprecated<NEW_LINE>if (r.removed) {<NEW_LINE>b.append("* Removed unused file\n");<NEW_LINE>}<NEW_LINE>// If anything was appended for this file, add header<NEW_LINE>if (b.length() > index) {<NEW_LINE>b.insert(index, String.format("[%s]\n", r.id));<NEW_LINE>index = b.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>}
getErrorMessageCompact(r.writeError)));
667,083
void readImplementations(SubType type) {<NEW_LINE>this.interfaces.<MASK><NEW_LINE>this.interfaces.addAll(type.getInterfaces());<NEW_LINE>AnnotationNode implementsAnnotation = Annotations.getInvisible(this.validationClassNode, Implements.class);<NEW_LINE>if (implementsAnnotation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<AnnotationNode> interfaces = Annotations.getValue(implementsAnnotation);<NEW_LINE>if (interfaces == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (AnnotationNode interfaceNode : interfaces) {<NEW_LINE>InterfaceInfo interfaceInfo = InterfaceInfo.fromAnnotation(MixinInfo.this, interfaceNode);<NEW_LINE>this.softImplements.add(interfaceInfo);<NEW_LINE>this.interfaces.add(interfaceInfo.getInternalName());<NEW_LINE>// only add interface if its initial initialisation<NEW_LINE>if (!(this instanceof Reloaded)) {<NEW_LINE>this.classInfo.addInterface(interfaceInfo.getInternalName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addAll(this.validationClassNode.interfaces);
1,458,438
public BatchDeleteDevicePositionHistoryResult batchDeleteDevicePositionHistory(BatchDeleteDevicePositionHistoryRequest batchDeleteDevicePositionHistoryRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDeleteDevicePositionHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDeleteDevicePositionHistoryRequest> request = null;<NEW_LINE>Response<BatchDeleteDevicePositionHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDeleteDevicePositionHistoryRequestMarshaller().marshall(batchDeleteDevicePositionHistoryRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<BatchDeleteDevicePositionHistoryResult, JsonUnmarshallerContext> unmarshaller = new BatchDeleteDevicePositionHistoryResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<BatchDeleteDevicePositionHistoryResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
new JsonResponseHandler<BatchDeleteDevicePositionHistoryResult>(unmarshaller);
858,901
public void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String, AttrValue> attributesForNode, GraphDef graph) {<NEW_LINE>super.initFromTensorFlow(<MASK><NEW_LINE>// permute dimensions are not specified as second input<NEW_LINE>if (nodeDef.getInputCount() < 2)<NEW_LINE>return;<NEW_LINE>NodeDef permuteDimsNode = null;<NEW_LINE>for (int i = 0; i < graph.getNodeCount(); i++) {<NEW_LINE>if (graph.getNode(i).getName().equals(nodeDef.getInput(1))) {<NEW_LINE>permuteDimsNode = graph.getNode(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>INDArray permuteArrayOp = TFGraphMapper.getNDArrayFromTensor(permuteDimsNode);<NEW_LINE>if (permuteArrayOp != null) {<NEW_LINE>this.permuteDims = permuteArrayOp.data().asInt();<NEW_LINE>}<NEW_LINE>// handle once properly mapped<NEW_LINE>if (arg().getShape() == null || arg().getVariableType() == VariableType.PLACEHOLDER || arg().getArr() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>INDArray arr = sameDiff.getArrForVarName(arg().name());<NEW_LINE>if (permuteArrayOp != null) {<NEW_LINE>addInputArgument(arr, permuteArrayOp);<NEW_LINE>} else {<NEW_LINE>addInputArgument(arr);<NEW_LINE>}<NEW_LINE>if (arr != null && permuteDims == null) {<NEW_LINE>this.permuteDims = ArrayUtil.reverseCopy(ArrayUtil.range(0, arr.rank()));<NEW_LINE>}<NEW_LINE>if (permuteDims != null && permuteDims.length < arg().getShape().length)<NEW_LINE>throw new ND4JIllegalStateException("Illegal permute found. Not all dimensions specified");<NEW_LINE>}
nodeDef, initWith, attributesForNode, graph);
44,997
static void testAttestSgxEnclave() {<NEW_LINE>String <MASK><NEW_LINE>AttestationClientBuilder attestationBuilder = new AttestationClientBuilder();<NEW_LINE>AttestationClient client = attestationBuilder.endpoint(endpoint).buildClient();<NEW_LINE>BinaryData decodedRuntimeData = BinaryData.fromBytes(SampleCollateral.getRunTimeData());<NEW_LINE>BinaryData decodedOpenEnclaveReport = BinaryData.fromBytes(SampleCollateral.getOpenEnclaveReport());<NEW_LINE>// BEGIN: readme-sample-attestSgxEnclave<NEW_LINE>AttestationOptions options = new AttestationOptions(decodedOpenEnclaveReport).setRunTimeData(new AttestationData(decodedRuntimeData, AttestationDataInterpretation.BINARY));<NEW_LINE>AttestationResult result = client.attestOpenEnclave(options);<NEW_LINE>// END: readme-sample-attestSgxEnclave<NEW_LINE>assertNotNull(result.getIssuer());<NEW_LINE>assertEquals(endpoint, result.getIssuer());<NEW_LINE>String issuer = result.getIssuer();<NEW_LINE>System.out.println("Attest OpenEnclave completed. Issuer: " + issuer);<NEW_LINE>}
endpoint = System.getenv("ATTESTATION_AAD_URL");
1,759,432
protected FormInfo resolveFormInfo(StartEvent startEvent, ProcessDefinition processDefinition, FormRepositoryService formRepositoryService, ProcessEngineConfigurationImpl processEngineConfiguration) {<NEW_LINE>String formKey = startEvent.getFormKey();<NEW_LINE>FormInfo formInfo;<NEW_LINE>if (tenantId == null || ProcessEngineConfiguration.NO_TENANT_ID.equals(tenantId)) {<NEW_LINE>if (startEvent.isSameDeployment()) {<NEW_LINE>String parentDeploymentId = ProcessDefinitionUtil.getDefinitionDeploymentId(processDefinition, processEngineConfiguration);<NEW_LINE>formInfo = formRepositoryService.getFormModelByKeyAndParentDeploymentId(formKey, parentDeploymentId);<NEW_LINE>} else {<NEW_LINE>formInfo = formRepositoryService.getFormModelByKey(formKey);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (startEvent.isSameDeployment()) {<NEW_LINE>String parentDeploymentId = ProcessDefinitionUtil.getDefinitionDeploymentId(processDefinition, processEngineConfiguration);<NEW_LINE>formInfo = formRepositoryService.getFormModelByKeyAndParentDeploymentId(formKey, parentDeploymentId, <MASK><NEW_LINE>} else {<NEW_LINE>formInfo = formRepositoryService.getFormModelByKey(formKey, tenantId, processEngineConfiguration.isFallbackToDefaultTenant());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return formInfo;<NEW_LINE>}
tenantId, processEngineConfiguration.isFallbackToDefaultTenant());
1,825,408
private static int startScripts() {<NEW_LINE>int scriptCount = 0;<NEW_LINE>String p = argMap.get(STDOUT);<NEW_LINE>boolean traceToStdOut = p != null && !"false".equals(p);<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint("stdout is " + traceToStdOut);<NEW_LINE>}<NEW_LINE>String script = argMap.get(SCRIPT);<NEW_LINE>String scriptDir = argMap.get(SCRIPT_OUTPUT_DIR);<NEW_LINE>if (script != null) {<NEW_LINE>StringTokenizer tokenizer <MASK><NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint(((tokenizer.countTokens() == 1) ? "initial script is " : "initial scripts are ") + script);<NEW_LINE>}<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>if (loadBTraceScript(tokenizer.nextToken(), traceToStdOut)) {<NEW_LINE>scriptCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scriptDir != null) {<NEW_LINE>File dir = new File(scriptDir);<NEW_LINE>if (dir.isDirectory()) {<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint("found scriptdir: " + dir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>File[] files = dir.listFiles();<NEW_LINE>if (files != null) {<NEW_LINE>for (File file : files) {<NEW_LINE>if (loadBTraceScript(file.getAbsolutePath(), traceToStdOut)) {<NEW_LINE>scriptCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return scriptCount;<NEW_LINE>}
= new StringTokenizer(script, ":");
1,535,344
void checkAndMaybeComplete() {<NEW_LINE>if (progressTracker.isDone()) {<NEW_LINE>if (progressTracker.hasSucceeded() && !retainChunkExceptionOnSuccess) {<NEW_LINE>chunkException = null;<NEW_LINE>} else if (chunkOperationTracker.hasFailedOnNotFound()) {<NEW_LINE>chunkException = <MASK><NEW_LINE>}<NEW_LINE>chunkCompleted = true;<NEW_LINE>}<NEW_LINE>if (chunkCompleted) {<NEW_LINE>if (state != ChunkState.Complete && QuotaUtils.postProcessCharge(quotaChargeCallback) && chunkException == null) {<NEW_LINE>try {<NEW_LINE>if (chunkSize != -1) {<NEW_LINE>quotaChargeCallback.checkAndCharge(false, true, chunkSize);<NEW_LINE>} else {<NEW_LINE>if (this instanceof FirstGetChunk && ((FirstGetChunk) this).blobType == BlobType.DataBlob) {<NEW_LINE>quotaChargeCallback.checkAndCharge(false, true, totalSize);<NEW_LINE>}<NEW_LINE>// other cases mean that either this was a metadata blob, or there was an error.<NEW_LINE>}<NEW_LINE>} catch (QuotaException quotaException) {<NEW_LINE>logger.info("Exception {} occurred during the quota charge event of blob {}", quotaException, blobId.getID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setOperationException(chunkException);<NEW_LINE>state = ChunkState.Complete;<NEW_LINE>}<NEW_LINE>}
buildChunkException("Get Chunk failed because of BlobNotFound", RouterErrorCode.BlobDoesNotExist);
604,879
private List<SimpleInterval> shardIntervals(final List<SimpleInterval> raw, final int shardSize) {<NEW_LINE>final List<SimpleInterval> preSharded = sortAndMergeOverlappingIntervals(raw, dictionary);<NEW_LINE>final long size = preSharded.stream().mapToLong(SimpleInterval::size).sum();<NEW_LINE>final List<SimpleInterval> output = new ArrayList<>((int) (preSharded.size() + size / shardSize));<NEW_LINE>// if less than 1.5 x the desired shard size is left in the current interval we don't split any further:<NEW_LINE>final int shardingSizeThreshold = (int) Math.round(shardSize * 1.5);<NEW_LINE>for (final SimpleInterval in : preSharded) {<NEW_LINE>if (in.size() < shardingSizeThreshold) {<NEW_LINE>output.add(in);<NEW_LINE>} else {<NEW_LINE>int start = in.getStart();<NEW_LINE>final int inEnd = in.getEnd();<NEW_LINE>final int stop = in.getEnd() - shardingSizeThreshold + 1;<NEW_LINE>while (start < stop) {<NEW_LINE>final int end = start + shardSize - 1;<NEW_LINE>output.add(new SimpleInterval(in.getContig(), start, end));<NEW_LINE>start = end + 1;<NEW_LINE>}<NEW_LINE>if (start <= inEnd) {<NEW_LINE>output.add(new SimpleInterval(in.getContig<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
(), start, inEnd));
279,900
protected BpmnModel executeRequestForXML(HttpUriRequest request, ServerConfig serverConfig, int expectedStatusCode) {<NEW_LINE>FlowableServiceException exception = null;<NEW_LINE>CloseableHttpClient client = clientUtil.getHttpClient(serverConfig);<NEW_LINE>try {<NEW_LINE>try (CloseableHttpResponse response = client.execute(request)) {<NEW_LINE>InputStream responseContent = response.getEntity().getContent();<NEW_LINE><MASK><NEW_LINE>InputStreamReader in = new InputStreamReader(responseContent, StandardCharsets.UTF_8);<NEW_LINE>XMLStreamReader xtr = xif.createXMLStreamReader(in);<NEW_LINE>BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);<NEW_LINE>boolean success = response.getStatusLine() != null && response.getStatusLine().getStatusCode() == expectedStatusCode;<NEW_LINE>if (success) {<NEW_LINE>return bpmnModel;<NEW_LINE>} else {<NEW_LINE>exception = new FlowableServiceException("An error occurred while calling Flowable: " + response.getStatusLine());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Error consuming response from uri {}", request.getURI(), e);<NEW_LINE>exception = clientUtil.wrapException(e, request);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Error executing request to uri {}", request.getURI(), e);<NEW_LINE>exception = clientUtil.wrapException(e, request);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>client.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Error closing http client instance", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exception != null) {<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
XMLInputFactory xif = XMLInputFactory.newInstance();
1,062,708
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "insert into Pair " + "select * from SupportSensorEvent(device='A')#lastevent as a, SupportSensorEvent(device='B')#lastevent as b " + "where a.type = b.type;\n" + "" + "insert into PairDuplicatesRemoved select * from Pair(1=2);\n" + "" + "@name('s0') insert into PairDuplicatesRemoved " + "select * from Pair " + "where a.id != coalesce((select a.id from PairDuplicatesRemoved#lastevent), -1)" + " and b.id != coalesce((select b.id from PairDuplicatesRemoved#lastevent), -1);\n";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(1, "Temperature"<MASK><NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(2, "Temperature", "A", 57, 95.5));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(3, "Humidity", "B", 29, 67.5));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(4, "Temperature", "B", 55, 88.0));<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertEquals(2, theEvent.get("a.id"));<NEW_LINE>assertEquals(4, theEvent.get("b.id"));<NEW_LINE>});<NEW_LINE>env.sendEventBean(new SupportSensorEvent(5, "Temperature", "B", 65, 85.0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(6, "Temperature", "B", 49, 87.0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportSensorEvent(7, "Temperature", "A", 51, 99.5));<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertEquals(7, theEvent.get("a.id"));<NEW_LINE>assertEquals(6, theEvent.get("b.id"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
, "A", 51, 94.5));
637,610
public BytesRef toBytesRef() {<NEW_LINE>if (position <= buffer.length) {<NEW_LINE>assert overflow == null;<NEW_LINE>return new BytesRef(buffer, 0, position);<NEW_LINE>}<NEW_LINE>final byte[] newBuffer = new byte[position];<NEW_LINE>System.arraycopy(buffer, 0, <MASK><NEW_LINE>int copyPos = buffer.length;<NEW_LINE>final BytesRefIterator iterator = BytesReference.fromByteArray(overflow, position - buffer.length).iterator();<NEW_LINE>BytesRef bytesRef;<NEW_LINE>try {<NEW_LINE>while ((bytesRef = iterator.next()) != null) {<NEW_LINE>assert copyPos + bytesRef.length <= position;<NEW_LINE>System.arraycopy(bytesRef.bytes, bytesRef.offset, newBuffer, copyPos, bytesRef.length);<NEW_LINE>copyPos += bytesRef.length;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new AssertionError("impossible", e);<NEW_LINE>}<NEW_LINE>return new BytesRef(newBuffer, 0, position);<NEW_LINE>}
newBuffer, 0, buffer.length);
676,787
protected Map<Control, IDialogueControlDescriptor> createManagedControls(Composite parent) {<NEW_LINE>Composite baseCommandArea = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayoutFactory.fillDefaults().numColumns(1).applyTo(baseCommandArea);<NEW_LINE>GridDataFactory.fillDefaults().applyTo(baseCommandArea);<NEW_LINE>boolButton <MASK><NEW_LINE>boolButton.setText(descriptor.getLabel());<NEW_LINE>boolButton.setData(descriptor);<NEW_LINE>boolButton.setSelection(initialValue);<NEW_LINE>boolButton.setToolTipText(descriptor.getToolTipText());<NEW_LINE>GridDataFactory.fillDefaults().align(GridData.FILL, GridData.CENTER).applyTo(boolButton);<NEW_LINE>boolButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>notifyControlChange(boolButton.getSelection(), boolButton);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Map<Control, IDialogueControlDescriptor> controls = new HashMap<>();<NEW_LINE>controls.put(boolButton, descriptor);<NEW_LINE>return controls;<NEW_LINE>}
= new Button(baseCommandArea, buttonType);
224,269
public SaleOrder save(SaleOrder saleOrder) {<NEW_LINE>try {<NEW_LINE>AppSale appSale = Beans.get(AppSaleService.class).getAppSale();<NEW_LINE>if (appSale.getEnablePackManagement()) {<NEW_LINE>saleOrderComputeService.computePackTotal(saleOrder);<NEW_LINE>} else {<NEW_LINE>saleOrderComputeService.resetPackTotal(saleOrder);<NEW_LINE>}<NEW_LINE>computeSeq(saleOrder);<NEW_LINE>computeFullName(saleOrder);<NEW_LINE>if (appSale.getManagePartnerComplementaryProduct()) {<NEW_LINE>Beans.get(SaleOrderService.class).manageComplementaryProductSOLines(saleOrder);<NEW_LINE>}<NEW_LINE>computeSubMargin(saleOrder);<NEW_LINE>Beans.get(SaleOrderMarginService.class).computeMarginSaleOrder(saleOrder);<NEW_LINE>return super.save(saleOrder);<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.traceExceptionFromSaveMethod(e);<NEW_LINE>throw new PersistenceException(<MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,008,469
private void saveConfig(String fileName) {<NEW_LINE>// sp1 is the shared pref to copy to<NEW_LINE>SharedPreferences.Editor ed = getActivity().getSharedPreferences(fileName, MODE_PRIVATE).edit();<NEW_LINE>// The shared preferences to copy from<NEW_LINE>SharedPreferences sp = getPreferenceScreen().getSharedPreferences();<NEW_LINE>// This clears the one we are copying to, but you don't necessarily need to do that.<NEW_LINE>ed.clear();<NEW_LINE>// Cycle through all the entries in the sp<NEW_LINE>for (Entry<String, ?> entry : sp.getAll().entrySet()) {<NEW_LINE>Object v = entry.getValue();<NEW_LINE>String key = entry.getKey();<NEW_LINE>// Now we just figure out what type it is, so we can copy it.<NEW_LINE>// Note that i am using Boolean and Integer instead of boolean and int.<NEW_LINE>// That's because the Entry class can only hold objects and int and boolean are primatives.<NEW_LINE>if (v instanceof Boolean)<NEW_LINE>// Also note that i have to cast the object to a Boolean<NEW_LINE>// and then use .booleanValue to get the boolean<NEW_LINE>ed.putBoolean(key, ((Boolean<MASK><NEW_LINE>else if (v instanceof Float)<NEW_LINE>ed.putFloat(key, ((Float) v).floatValue());<NEW_LINE>else if (v instanceof Integer)<NEW_LINE>ed.putInt(key, ((Integer) v).intValue());<NEW_LINE>else if (v instanceof Long)<NEW_LINE>ed.putLong(key, ((Long) v).longValue());<NEW_LINE>else if (v instanceof String)<NEW_LINE>ed.putString(key, ((String) v));<NEW_LINE>}<NEW_LINE>// save it.<NEW_LINE>ed.commit();<NEW_LINE>}
) v).booleanValue());
639,123
public static DescribePortViewSourceCountriesResponse unmarshall(DescribePortViewSourceCountriesResponse describePortViewSourceCountriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePortViewSourceCountriesResponse.setRequestId(_ctx.stringValue("DescribePortViewSourceCountriesResponse.RequestId"));<NEW_LINE>List<Country> sourceCountrys <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePortViewSourceCountriesResponse.SourceCountrys.Length"); i++) {<NEW_LINE>Country country = new Country();<NEW_LINE>country.setCount(_ctx.longValue("DescribePortViewSourceCountriesResponse.SourceCountrys[" + i + "].Count"));<NEW_LINE>country.setCountryId(_ctx.stringValue("DescribePortViewSourceCountriesResponse.SourceCountrys[" + i + "].CountryId"));<NEW_LINE>sourceCountrys.add(country);<NEW_LINE>}<NEW_LINE>describePortViewSourceCountriesResponse.setSourceCountrys(sourceCountrys);<NEW_LINE>return describePortViewSourceCountriesResponse;<NEW_LINE>}
= new ArrayList<Country>();
1,154,237
private BufferedImage createOverlayImage(String text) {<NEW_LINE>int size = 16;<NEW_LINE>BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = image.createGraphics();<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>// background<NEW_LINE>g.setPaint(new Color(0, 0, 0, 102));<NEW_LINE>g.fillRoundRect(0, 0, size, size, size, size);<NEW_LINE>// filling<NEW_LINE>int mainRadius = 14;<NEW_LINE>g.setPaint(new Color(255, 98, 89));<NEW_LINE>g.fillRoundRect(size / 2 - mainRadius / 2, size / 2 - mainRadius / 2, mainRadius, mainRadius, size, size);<NEW_LINE>// text<NEW_LINE>Font font = g.getFont();<NEW_LINE>g.setFont(new Font(font.getName(), Font.BOLD, 9));<NEW_LINE>FontMetrics fontMetrics = g.getFontMetrics();<NEW_LINE>int textWidth = fontMetrics.stringWidth(text);<NEW_LINE><MASK><NEW_LINE>g.drawString(text, size / 2 - textWidth / 2, size / 2 - fontMetrics.getHeight() / 2 + fontMetrics.getAscent());<NEW_LINE>return image;<NEW_LINE>}
g.setColor(Color.white);
1,758,834
public static void drawRoundRect(Graphics g, double x1d, double y1d, double x2d, double y2d, Color color) {<NEW_LINE>final Color oldColor = g.getColor();<NEW_LINE>g.setColor(color);<NEW_LINE>int x1 = (int) Math.round(x1d);<NEW_LINE>int x2 = (<MASK><NEW_LINE>int y1 = (int) Math.round(y1d);<NEW_LINE>int y2 = (int) Math.round(y2d);<NEW_LINE>UIUtil.drawLine(g, x1 + 1, y1, x2 - 1, y1);<NEW_LINE>UIUtil.drawLine(g, x1 + 1, y2, x2 - 1, y2);<NEW_LINE>UIUtil.drawLine(g, x1, y1 + 1, x1, y2 - 1);<NEW_LINE>UIUtil.drawLine(g, x2, y1 + 1, x2, y2 - 1);<NEW_LINE>g.setColor(oldColor);<NEW_LINE>}
int) Math.round(x2d);
1,719,517
private void writeBlobMultipart(BlobInfo blobInfo, byte[] buffer, int offset, int blobSize, boolean failIfAlreadyExists) throws IOException {<NEW_LINE>assert blobSize <= getLargeBlobThresholdInBytes() : "large blob uploads should use the resumable upload method";<NEW_LINE>try {<NEW_LINE>final Storage.BlobTargetOption[] targetOptions = failIfAlreadyExists ? new Storage.BlobTargetOption[] { Storage.BlobTargetOption.doesNotExist() } : new Storage.BlobTargetOption[0];<NEW_LINE>SocketAccess.doPrivilegedVoidIOException(() -> client().create(blobInfo, buffer, offset, blobSize, targetOptions));<NEW_LINE>// We don't track this operation on the http layer as<NEW_LINE>// we do with the GET/LIST operations since this operations<NEW_LINE>// can trigger multiple underlying http requests but only one<NEW_LINE>// operation is billed.<NEW_LINE>stats.trackPostOperation();<NEW_LINE>} catch (final StorageException se) {<NEW_LINE>if (failIfAlreadyExists && se.getCode() == HTTP_PRECON_FAILED) {<NEW_LINE>throw new FileAlreadyExistsException(blobInfo.getBlobId().getName(), <MASK><NEW_LINE>}<NEW_LINE>throw se;<NEW_LINE>}<NEW_LINE>}
null, se.getMessage());
724,206
public static MonitorRuleDTO convert2MonitorRuleDTO(MonitorRuleDO monitorRuleDO, Strategy strategy) {<NEW_LINE>MonitorRuleDTO monitorRuleDTO = new MonitorRuleDTO();<NEW_LINE>monitorRuleDTO.setId(monitorRuleDO.getId());<NEW_LINE>monitorRuleDTO.setAppId(monitorRuleDO.getAppId());<NEW_LINE>monitorRuleDTO.setName(strategy.getName());<NEW_LINE>monitorRuleDTO.setPriority(strategy.getPriority());<NEW_LINE>monitorRuleDTO.setPeriodHoursOfDay(strategy.getPeriodHoursOfDay());<NEW_LINE>monitorRuleDTO.<MASK><NEW_LINE>monitorRuleDTO.setStrategyExpressionList(new ArrayList<>());<NEW_LINE>monitorRuleDTO.setStrategyFilterList(new ArrayList<>());<NEW_LINE>monitorRuleDTO.setStrategyActionList(new ArrayList<>());<NEW_LINE>for (StrategyExpression elem : strategy.getStrategyExpressionList()) {<NEW_LINE>MonitorStrategyExpressionDTO strategyExpression = new MonitorStrategyExpressionDTO();<NEW_LINE>strategyExpression.setMetric(elem.getMetric());<NEW_LINE>strategyExpression.setFunc(elem.getFunc());<NEW_LINE>strategyExpression.setEopt(elem.getEopt());<NEW_LINE>strategyExpression.setThreshold(elem.getThreshold());<NEW_LINE>strategyExpression.setParams(elem.getParams());<NEW_LINE>monitorRuleDTO.getStrategyExpressionList().add(strategyExpression);<NEW_LINE>}<NEW_LINE>for (StrategyFilter elem : strategy.getStrategyFilterList()) {<NEW_LINE>MonitorStrategyFilterDTO strategyFilter = new MonitorStrategyFilterDTO();<NEW_LINE>strategyFilter.setTkey(elem.getTkey());<NEW_LINE>strategyFilter.setTopt(elem.getTopt());<NEW_LINE>strategyFilter.setTval(ListUtils.string2StrList(elem.getTval()));<NEW_LINE>monitorRuleDTO.getStrategyFilterList().add(strategyFilter);<NEW_LINE>}<NEW_LINE>for (StrategyAction elem : strategy.getStrategyActionList()) {<NEW_LINE>MonitorStrategyActionDTO strategyAction = new MonitorStrategyActionDTO();<NEW_LINE>strategyAction.setNotifyGroup(ListUtils.string2StrList(elem.getNotifyGroup()));<NEW_LINE>strategyAction.setConverge(elem.getConverge());<NEW_LINE>strategyAction.setCallback(elem.getCallback());<NEW_LINE>monitorRuleDTO.getStrategyActionList().add(strategyAction);<NEW_LINE>}<NEW_LINE>return monitorRuleDTO;<NEW_LINE>}
setPeriodDaysOfWeek(strategy.getPeriodDaysOfWeek());
210,186
public ResolveResult[] multiResolve(final boolean incompleteCode) {<NEW_LINE>final PsiReference[] refs = getReferences();<NEW_LINE>Collection<ResolveResult> result = new LinkedHashSet<ResolveResult>(refs.length);<NEW_LINE>PsiElementResolveResult selfReference = null;<NEW_LINE>for (PsiReference reference : refs) {<NEW_LINE>if (reference instanceof PsiPolyVariantReference) {<NEW_LINE>ContainerUtil.addAll(result, ((PsiPolyVariantReference) reference).multiResolve(incompleteCode));<NEW_LINE>} else {<NEW_LINE>final <MASK><NEW_LINE>if (resolved != null) {<NEW_LINE>final PsiElementResolveResult rresult = new PsiElementResolveResult(resolved);<NEW_LINE>if (getElement() == resolved) {<NEW_LINE>selfReference = rresult;<NEW_LINE>} else {<NEW_LINE>result.add(rresult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.isEmpty() && selfReference != null) {<NEW_LINE>// if i the only one starring at the sun<NEW_LINE>result.add(selfReference);<NEW_LINE>}<NEW_LINE>return result.toArray(new ResolveResult[result.size()]);<NEW_LINE>}
PsiElement resolved = reference.resolve();
1,369,380
private void scheduleConfigurableTask(final long initialDelay, final ConfigPropertyConstants enabledConstraint, final ConfigPropertyConstants constraint, final Event event) {<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>final ConfigProperty enabledProperty = qm.getConfigProperty(enabledConstraint.getGroupName(<MASK><NEW_LINE>if (enabledProperty != null && enabledProperty.getPropertyValue() != null) {<NEW_LINE>final boolean isEnabled = BooleanUtil.valueOf(enabledProperty.getPropertyValue());<NEW_LINE>if (!isEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ConfigProperty property = qm.getConfigProperty(constraint.getGroupName(), constraint.getPropertyName());<NEW_LINE>if (property != null && property.getPropertyValue() != null) {<NEW_LINE>final Integer minutes = Integer.valueOf(property.getPropertyValue());<NEW_LINE>scheduleEvent(event, initialDelay, (long) minutes * (long) 60 * (long) 1000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), enabledConstraint.getPropertyName());
1,776,997
public static QueryDomainByDomainNameResponse unmarshall(QueryDomainByDomainNameResponse queryDomainByDomainNameResponse, UnmarshallerContext context) {<NEW_LINE>queryDomainByDomainNameResponse.setRequestId(context.stringValue("QueryDomainByDomainNameResponse.RequestId"));<NEW_LINE>queryDomainByDomainNameResponse.setUserId(context.stringValue("QueryDomainByDomainNameResponse.UserId"));<NEW_LINE>queryDomainByDomainNameResponse.setDomainName(context.stringValue("QueryDomainByDomainNameResponse.DomainName"));<NEW_LINE>queryDomainByDomainNameResponse.setInstanceId(context.stringValue("QueryDomainByDomainNameResponse.InstanceId"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrationDate(context.stringValue("QueryDomainByDomainNameResponse.RegistrationDate"));<NEW_LINE>queryDomainByDomainNameResponse.setExpirationDate(context.stringValue("QueryDomainByDomainNameResponse.ExpirationDate"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrantOrganization(context.stringValue("QueryDomainByDomainNameResponse.RegistrantOrganization"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrantName(context.stringValue("QueryDomainByDomainNameResponse.RegistrantName"));<NEW_LINE>queryDomainByDomainNameResponse.setEmail(context.stringValue("QueryDomainByDomainNameResponse.Email"));<NEW_LINE>queryDomainByDomainNameResponse.setUpdateProhibitionLock(context.stringValue("QueryDomainByDomainNameResponse.UpdateProhibitionLock"));<NEW_LINE>queryDomainByDomainNameResponse.setTransferProhibitionLock(context.stringValue("QueryDomainByDomainNameResponse.TransferProhibitionLock"));<NEW_LINE>queryDomainByDomainNameResponse.setDomainNameProxyService(context.booleanValue("QueryDomainByDomainNameResponse.DomainNameProxyService"));<NEW_LINE>queryDomainByDomainNameResponse.setPremium(context.booleanValue("QueryDomainByDomainNameResponse.Premium"));<NEW_LINE>queryDomainByDomainNameResponse.setEmailVerificationStatus(context.integerValue("QueryDomainByDomainNameResponse.EmailVerificationStatus"));<NEW_LINE>queryDomainByDomainNameResponse.setEmailVerificationClientHold(context.booleanValue("QueryDomainByDomainNameResponse.EmailVerificationClientHold"));<NEW_LINE>queryDomainByDomainNameResponse.setRealNameStatus(context.stringValue("QueryDomainByDomainNameResponse.RealNameStatus"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrantUpdatingStatus<MASK><NEW_LINE>queryDomainByDomainNameResponse.setTransferOutStatus(context.stringValue("QueryDomainByDomainNameResponse.TransferOutStatus"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrantType(context.stringValue("QueryDomainByDomainNameResponse.RegistrantType"));<NEW_LINE>queryDomainByDomainNameResponse.setDomainNameVerificationStatus(context.stringValue("QueryDomainByDomainNameResponse.DomainNameVerificationStatus"));<NEW_LINE>queryDomainByDomainNameResponse.setRegistrationDateLong(context.longValue("QueryDomainByDomainNameResponse.RegistrationDateLong"));<NEW_LINE>queryDomainByDomainNameResponse.setExpirationDateLong(context.longValue("QueryDomainByDomainNameResponse.ExpirationDateLong"));<NEW_LINE>List<String> dnsList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryDomainByDomainNameResponse.DnsList.Length"); i++) {<NEW_LINE>dnsList.add(context.stringValue("QueryDomainByDomainNameResponse.DnsList[" + i + "]"));<NEW_LINE>}<NEW_LINE>queryDomainByDomainNameResponse.setDnsList(dnsList);<NEW_LINE>return queryDomainByDomainNameResponse;<NEW_LINE>}
(context.stringValue("QueryDomainByDomainNameResponse.RegistrantUpdatingStatus"));
882,252
private void prepareSelectableWindows(Collection<CardInfoWindowDialog> windows, Set<UUID> needSelectable, List<UUID> needChoosen, PlayableObjectsList needPlayable) {<NEW_LINE>// lookAt or reveals windows clean up on next priority, so users can see dialogs, but xmage can't restore it<NEW_LINE>// so it must be updated manually (it's ok to keep outdated cards in dialog, but not ok to show wrong selections)<NEW_LINE>for (CardInfoWindowDialog window : windows) {<NEW_LINE>for (MageCard mageCard : window.getMageCardsForUpdate().values()) {<NEW_LINE>CardView cardView = mageCard.getOriginal();<NEW_LINE>cardView.setChoosable(needSelectable.contains(cardView.getId()));<NEW_LINE>cardView.setSelected(needChoosen.contains<MASK><NEW_LINE>if (needPlayable.containsObject(cardView.getId())) {<NEW_LINE>cardView.setPlayableStats(needPlayable.getStats(cardView.getId()));<NEW_LINE>} else {<NEW_LINE>cardView.setPlayableStats(new PlayableObjectStats());<NEW_LINE>}<NEW_LINE>// TODO: little bug with toggled night card after update/clicks, but that's ok (can't click on second side)<NEW_LINE>mageCard.update(cardView);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(cardView.getId()));
56,302
public boolean isRectangleCover(int[][] rectangles) {<NEW_LINE>long area = 0;<NEW_LINE>int minX = rectangles[0][0], minY = rectangles[0][1];<NEW_LINE>int maxX = rectangles[0][2], maxY = rectangles[0][3];<NEW_LINE>Map<Pair, Integer> cnt = new HashMap<>();<NEW_LINE>for (int[] r : rectangles) {<NEW_LINE>area += (r[2] - r[0]) * (r[3] - r[1]);<NEW_LINE>minX = Math.min(minX, r[0]);<NEW_LINE>minY = Math.min(minY, r[1]);<NEW_LINE>maxX = Math.max(maxX, r[2]);<NEW_LINE>maxY = Math.max<MASK><NEW_LINE>cnt.merge(new Pair(r[0], r[1]), 1, Integer::sum);<NEW_LINE>cnt.merge(new Pair(r[0], r[3]), 1, Integer::sum);<NEW_LINE>cnt.merge(new Pair(r[2], r[3]), 1, Integer::sum);<NEW_LINE>cnt.merge(new Pair(r[2], r[1]), 1, Integer::sum);<NEW_LINE>}<NEW_LINE>if (area != (long) (maxX - minX) * (maxY - minY) || cnt.getOrDefault(new Pair(minX, minY), 0) != 1 || cnt.getOrDefault(new Pair(minX, maxY), 0) != 1 || cnt.getOrDefault(new Pair(maxX, maxY), 0) != 1 || cnt.getOrDefault(new Pair(maxX, minY), 0) != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>cnt.remove(new Pair(minX, minY));<NEW_LINE>cnt.remove(new Pair(minX, maxY));<NEW_LINE>cnt.remove(new Pair(maxX, maxY));<NEW_LINE>cnt.remove(new Pair(maxX, minY));<NEW_LINE>return cnt.values().stream().allMatch(c -> c == 2 || c == 4);<NEW_LINE>}
(maxY, r[3]);
1,301,188
final DescribeReceiptRuleSetResult executeDescribeReceiptRuleSet(DescribeReceiptRuleSetRequest describeReceiptRuleSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReceiptRuleSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReceiptRuleSetRequest> request = null;<NEW_LINE>Response<DescribeReceiptRuleSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReceiptRuleSetRequestMarshaller().marshall(super.beforeMarshalling(describeReceiptRuleSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReceiptRuleSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeReceiptRuleSetResult> responseHandler = new StaxResponseHandler<DescribeReceiptRuleSetResult>(new DescribeReceiptRuleSetResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,120,903
public boolean onJsAlert(WebView view, String url, String message, JsResult jsResult) {<NEW_LINE>if (message != null && message.startsWith("selendroid<")) {<NEW_LINE>jsResult.confirm();<NEW_LINE>synchronized (syncObject) {<NEW_LINE>String res = message.replaceFirst("selendroid<", "");<NEW_LINE>int i = res.indexOf(">:");<NEW_LINE>String enc = res.substring(0, i);<NEW_LINE>res = res.substring(i + 2);<NEW_LINE>if (("EUC-JP".equals(enc) || "Shift_JIS".equals(enc) || "ISO-2022-JP".equals(enc)) && res.contains("\u00a5")) {<NEW_LINE>SelendroidLogger.info("Perform workaround for japanese character encodings");<NEW_LINE><MASK><NEW_LINE>res = res.replace("\u00a5", "\\");<NEW_LINE>SelendroidLogger.debug("Replaced result: " + res);<NEW_LINE>}<NEW_LINE>result = res;<NEW_LINE>syncObject.notify();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (callSuper) {<NEW_LINE>currentAlertMessage.add(message == null ? "null" : message);<NEW_LINE>SelendroidLogger.info("new alert message: " + message);<NEW_LINE>return super.onJsAlert(view, url, message, jsResult);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
SelendroidLogger.debug("Original String: " + res);
1,517,404
public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/outer/boolean";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>TypeReference<Boolean> localVarReturnType = new TypeReference<Boolean>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, Object>();
436,460
private JPanel initPropertyPane() {<NEW_LINE>propertyPane = new PropertyPaneView();<NEW_LINE>// NOI18N<NEW_LINE>String valueTitle = NbBundle.<MASK><NEW_LINE>propertyPane.setProperties(new Node.Property[] { new PropertySupport.ReadOnly<String>(MatchedPropertyNode.PROPERTY_VALUE, String.class, valueTitle, null) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getValue() throws IllegalAccessException, InvocationTargetException {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} });<NEW_LINE>ExplorerManagerProviderPanel propertyPanePanel = new ExplorerManagerProviderPanel();<NEW_LINE>propertyPanePanel.setLayout(new BorderLayout());<NEW_LINE>propertyPanePanel.add(propertyPane, BorderLayout.CENTER);<NEW_LINE>JPanel headerPanel = new JPanel();<NEW_LINE>headerPanel.setLayout(new BorderLayout());<NEW_LINE>JPanel titlePanel = new JPanel();<NEW_LINE>titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.X_AXIS));<NEW_LINE>propertySummaryLabel = new JLabel();<NEW_LINE>propertySummaryLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));<NEW_LINE>propertySummaryLabel.setMinimumSize(new Dimension(0, 0));<NEW_LINE>titlePanel.add(propertySummaryLabel);<NEW_LINE>titlePanel.add(Box.createHorizontalGlue());<NEW_LINE>JToggleButton pseudoClassToggle = new JToggleButton();<NEW_LINE>pseudoClassToggle.setFocusPainted(false);<NEW_LINE>// NOI18N<NEW_LINE>pseudoClassToggle.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/web/inspect/resources/elementStates.png", true));<NEW_LINE>// NOI18N<NEW_LINE>pseudoClassToggle.setToolTipText(NbBundle.getMessage(CSSStylesSelectionPanel.class, "CSSStylesSelectionPanel.pseudoClasses"));<NEW_LINE>CustomToolbar toolBar = new CustomToolbar();<NEW_LINE>toolBar.addButton(pseudoClassToggle);<NEW_LINE>titlePanel.add(toolBar);<NEW_LINE>headerPanel.add(titlePanel, BorderLayout.PAGE_START);<NEW_LINE>headerPanel.add(createPseudoClassPanel(pseudoClassToggle), BorderLayout.CENTER);<NEW_LINE>propertyPanePanel.add(headerPanel, BorderLayout.PAGE_START);<NEW_LINE>propertyPaneManager = propertyPanePanel.getExplorerManager();<NEW_LINE>// allow shrinking in JSplitPane<NEW_LINE>propertyPanePanel.setMinimumSize(new Dimension(0, 0));<NEW_LINE>return propertyPanePanel;<NEW_LINE>}
getMessage(CSSStylesSelectionPanel.class, "CSSStylesSelectionPanel.value");
303,197
public void connected(Mesos mesos) {<NEW_LINE>LOG.info("Connected to Mesos master.");<NEW_LINE>isConnected.set(true);<NEW_LINE>Optional<String> frameworkId = storage.read(storeProvider -> storeProvider.getSchedulerStore().fetchFrameworkId());<NEW_LINE>Protos.FrameworkInfo.Builder frameworkBuilder = infoFactory.getFrameworkInfo().toBuilder();<NEW_LINE>Call.Builder call = Call.newBuilder().setType(Call.Type.SUBSCRIBE);<NEW_LINE>if (frameworkId.isPresent()) {<NEW_LINE>LOG.info("Found persisted framework ID: " + frameworkId);<NEW_LINE>Protos.FrameworkID id = Protos.FrameworkID.newBuilder().setValue(frameworkId.get()).build();<NEW_LINE>frameworkBuilder.setId(id);<NEW_LINE>call.setFrameworkId(id);<NEW_LINE>} else {<NEW_LINE>frameworkBuilder.clearId();<NEW_LINE>call.clearFrameworkId();<NEW_LINE>LOG.warn("Did not find a persisted framework ID, connecting as a new framework.");<NEW_LINE>}<NEW_LINE>call.setSubscribe(Call.Subscribe.newBuilder<MASK><NEW_LINE>executor.execute(() -> {<NEW_LINE>LOG.info("Starting to subscribe to Mesos with backoff.");<NEW_LINE>try {<NEW_LINE>backoffHelper.doUntilSuccess(() -> {<NEW_LINE>if (!isConnected.get()) {<NEW_LINE>LOG.info("Disconnected while attempting to subscribe. Stopping attempt.");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!isSubscribed.get()) {<NEW_LINE>LOG.info("Sending subscribe call.");<NEW_LINE>mesos.send(call.build());<NEW_LINE>subcriptionCalls.incrementAndGet();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>LOG.info("Subscribed to Mesos");<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
().setFrameworkInfo(frameworkBuilder));
1,065,231
private static void runQuery(RegressionEnvironment env, RegressionPath path, String epl, String fields, Object[][] expected, ContextPartitionSelector[] selectors) {<NEW_LINE>// try FAF without prepare<NEW_LINE>EPCompiled compiled = env.compileFAF(epl, path);<NEW_LINE>EPFireAndForgetQueryResult result = env.runtime().getFireAndForgetService().executeQuery(compiled, selectors);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(result.getArray(), fields.split(","), expected);<NEW_LINE>// test unparameterized prepare and execute<NEW_LINE>EPFireAndForgetPreparedQuery preparedQuery = env.runtime().getFireAndForgetService().prepareQuery(compiled);<NEW_LINE>EPFireAndForgetQueryResult resultPrepared = preparedQuery.execute(selectors);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(resultPrepared.getArray(), fields.split(","), expected);<NEW_LINE>// test unparameterized prepare and execute<NEW_LINE>EPFireAndForgetPreparedQueryParameterized preparedParameterizedQuery = env.runtime().getFireAndForgetService().prepareQueryWithParameters(compiled);<NEW_LINE>EPFireAndForgetQueryResult resultPreparedParameterized = env.runtime().getFireAndForgetService().executeQuery(preparedParameterizedQuery, selectors);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(resultPreparedParameterized.getArray(), fields<MASK><NEW_LINE>// test SODA prepare and execute<NEW_LINE>EPStatementObjectModel model = env.eplToModel(epl);<NEW_LINE>EPCompiled compiledFromModel = env.compileFAF(model, path);<NEW_LINE>EPFireAndForgetPreparedQuery preparedQueryModel = env.runtime().getFireAndForgetService().prepareQuery(compiledFromModel);<NEW_LINE>EPFireAndForgetQueryResult resultPreparedModel = preparedQueryModel.execute(selectors);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(resultPreparedModel.getArray(), fields.split(","), expected);<NEW_LINE>// test model query<NEW_LINE>result = env.runtime().getFireAndForgetService().executeQuery(compiledFromModel, selectors);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(result.getArray(), fields.split(","), expected);<NEW_LINE>}
.split(","), expected);
264,367
public void run() {<NEW_LINE>runUpgrade(() -> {<NEW_LINE>Cluster cluster = getUniverse().getUniverseDetails().getPrimaryCluster();<NEW_LINE>UserIntent userIntent = cluster.userIntent;<NEW_LINE>PlacementInfo placementInfo = cluster.placementInfo;<NEW_LINE>// Verify the request params and fail if invalid<NEW_LINE>taskParams(<MASK><NEW_LINE>// Update the rootCA in platform to have both old cert and new cert<NEW_LINE>// Here in the temporary multi-cert we will have old cert first and new cert later<NEW_LINE>// cert key will be pointing to old root cert key itself<NEW_LINE>// genSignedCert in helm chart will pick only the first cert present in the root chain<NEW_LINE>// So, generated node certs will still be of old rootCA after this step<NEW_LINE>createUniverseUpdateRootCertTask(UpdateRootCertAction.MultiCert);<NEW_LINE>// Create kubernetes upgrade task to rotate certs<NEW_LINE>createUpgradeTask(getUniverse(), placementInfo, userIntent.ybSoftwareVersion, true, true);<NEW_LINE>// Now we will change the order of certs: new cert first, followed by old root cert<NEW_LINE>// Also cert key will be pointing to new root cert key<NEW_LINE>// This makes sure genSignedCert in helm chart generates node certs of new root cert<NEW_LINE>// Essentially equivalent to updating only node certs in this step<NEW_LINE>createUniverseUpdateRootCertTask(UpdateRootCertAction.MultiCertReverse);<NEW_LINE>// Create kubernetes upgrade task to rotate certs<NEW_LINE>createUpgradeTask(getUniverse(), placementInfo, userIntent.ybSoftwareVersion, true, true);<NEW_LINE>// Reset the temporary certs and update the universe to use new rootCA<NEW_LINE>createUniverseUpdateRootCertTask(UpdateRootCertAction.Reset);<NEW_LINE>createUniverseSetTlsParamsTask();<NEW_LINE>// Create kubernetes upgrade task to rotate certs<NEW_LINE>createUpgradeTask(getUniverse(), placementInfo, userIntent.ybSoftwareVersion, true, true);<NEW_LINE>});<NEW_LINE>}
).verifyParams(getUniverse());
681,211
public void marshall(CreateJobTemplateRequest createJobTemplateRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createJobTemplateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getAccelerationSettings(), ACCELERATIONSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getCategory(), CATEGORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getHopDestinations(), HOPDESTINATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getPriority(), PRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getSettings(), SETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getStatusUpdateInterval(), STATUSUPDATEINTERVAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createJobTemplateRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createJobTemplateRequest.getQueue(), QUEUE_BINDING);
944,051
public List<String> list(Business business, EffectivePerson effectivePerson, List<String> identities, List<String> units, List<String> groups, Application application, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Process.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Process> root = cq.from(Process.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (effectivePerson.isNotManager() && (!BooleanUtils.isTrue(business.organization().person().hasRole(effectivePerson, OrganizationDefinition.Manager, OrganizationDefinition.ProcessPlatformManager)))) {<NEW_LINE>p = cb.and(cb.isEmpty(root.get(Process_.startableIdentityList)), cb.isEmpty(root.get(Process_.startableUnitList)), cb.isEmpty(root.get(Process_.startableGroupList)));<NEW_LINE>p = cb.or(p, cb.equal(root.get(Process_.creatorPerson), effectivePerson.getDistinguishedName()));<NEW_LINE>if (ListTools.isNotEmpty(identities)) {<NEW_LINE>p = cb.or(p, root.get(Process_.startableIdentityList).in(identities));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(units)) {<NEW_LINE>p = cb.or(p, root.get(Process_.<MASK><NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(groups)) {<NEW_LINE>p = cb.or(p, root.get(Process_.startableGroupList).in(groups));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p = cb.and(p, cb.equal(root.get(Process_.application), application.getId()));<NEW_LINE>p = cb.and(p, cb.or(cb.isTrue(root.get(Process_.editionEnable)), cb.isNull(root.get(Process_.editionEnable))));<NEW_LINE>if (StringUtils.equals(wi.getStartableTerminal(), Process.STARTABLETERMINAL_CLIENT)) {<NEW_LINE>p = cb.and(p, cb.or(cb.isNull(root.get(Process_.startableTerminal)), cb.equal(root.get(Process_.startableTerminal), ""), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_CLIENT), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_ALL)));<NEW_LINE>} else if (StringUtils.equals(wi.getStartableTerminal(), Process.STARTABLETERMINAL_MOBILE)) {<NEW_LINE>p = cb.and(p, cb.or(cb.isNull(root.get(Process_.startableTerminal)), cb.equal(root.get(Process_.startableTerminal), ""), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_MOBILE), cb.equal(root.get(Process_.startableTerminal), Process.STARTABLETERMINAL_ALL)));<NEW_LINE>}<NEW_LINE>cq.select(root.get(Process_.id)).where(p);<NEW_LINE>return em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>}
startableUnitList).in(units));
1,751,613
public CompletableFuture<Void> submitLightJob(long jobId, Object deserializedJobDefinition, Data serializedJobDefinition, JobConfig jobConfig, Subject subject) {<NEW_LINE>if (deserializedJobDefinition == null) {<NEW_LINE>deserializedJobDefinition = nodeEngine().getSerializationService().toObject(serializedJobDefinition);<NEW_LINE>}<NEW_LINE>DAG dag;<NEW_LINE>if (deserializedJobDefinition instanceof DAG) {<NEW_LINE>dag = (DAG) deserializedJobDefinition;<NEW_LINE>} else {<NEW_LINE>dag = ((PipelineImpl) deserializedJobDefinition).toDag(pipelineToDagContext);<NEW_LINE>}<NEW_LINE>// First insert just a marker into the map. This is to prevent initializing the light job if the jobId<NEW_LINE>// was submitted twice. This can happen e.g. if the client retries.<NEW_LINE>Object oldContext = lightMasterContexts.putIfAbsent(jobId, UNINITIALIZED_LIGHT_JOB_MARKER);<NEW_LINE>if (oldContext != null) {<NEW_LINE>throw new JetException<MASK><NEW_LINE>}<NEW_LINE>checkPermissions(subject, dag);<NEW_LINE>// Initialize and start the job (happens in the constructor). We do this before adding the actual<NEW_LINE>// LightMasterContext to the map to avoid possible races of the job initialization and cancellation.<NEW_LINE>LightMasterContext mc = new LightMasterContext(nodeEngine, this, dag, jobId, jobConfig, subject);<NEW_LINE>oldContext = lightMasterContexts.put(jobId, mc);<NEW_LINE>assert oldContext == UNINITIALIZED_LIGHT_JOB_MARKER;<NEW_LINE>scheduleJobTimeout(jobId, jobConfig.getTimeoutMillis());<NEW_LINE>return mc.getCompletionFuture().whenComplete((r, t) -> {<NEW_LINE>Object removed = lightMasterContexts.remove(jobId);<NEW_LINE>assert removed instanceof LightMasterContext : "LMC not found: " + removed;<NEW_LINE>unscheduleJobTimeout(jobId);<NEW_LINE>});<NEW_LINE>}
("duplicate jobId " + idToString(jobId));
445,852
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>account = args.getParcelable(ARGUMENT_ACCOUNT);<NEW_LINE>if (account != null)<NEW_LINE>jid = account.getFullJid().asBareJid().toString();<NEW_LINE>LayoutInflater inflater <MASK><NEW_LINE>View view = inflater.inflate(R.layout.dialog_delete_account, null);<NEW_LINE>chbDeleteSettings = (CheckBox) view.findViewById(R.id.chbDeleteSettings);<NEW_LINE>chbDeleteSettings.setChecked(XabberAccountManager.getInstance().isAccountSynchronize(jid));<NEW_LINE>if (XabberAccountManager.getInstance().getAccountSyncState(jid) == null)<NEW_LINE>chbDeleteSettings.setVisibility(View.GONE);<NEW_LINE>return new AlertDialog.Builder(getActivity()).setMessage(getString(R.string.account_delete_confirm, AccountManager.getInstance().getVerboseName(account))).setView(view).setPositiveButton(R.string.account_delete, this).setNegativeButton(android.R.string.cancel, this).create();<NEW_LINE>}
= getActivity().getLayoutInflater();
1,165,161
private void applyChanges(final ModifyElementRulesPanel panel, final SourceElementHandle handle) {<NEW_LINE>final BaseDocument doc = (BaseDocument) Utils.getDocument(file);<NEW_LINE>final AtomicBoolean success = new AtomicBoolean();<NEW_LINE>pos = Integer.MAX_VALUE;<NEW_LINE>diff = -1;<NEW_LINE>doc.runAtomicAsUser(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>updateAttribute(handle, doc, panel.getOriginalClassAttribute(), panel.getNewClassAttributeValue(), "class");<NEW_LINE>updateAttribute(handle, doc, panel.getOriginalIdAttribute(), <MASK><NEW_LINE>// better not to do the save from within the atomic modification task<NEW_LINE>success.set(true);<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// possibly save the document if not opened in editor<NEW_LINE>if (success.get()) {<NEW_LINE>try {<NEW_LINE>Utils.saveDocumentIfNotOpened(doc);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>applyChangesToStyleSheets(panel, handle);<NEW_LINE>}<NEW_LINE>}
panel.getNewIdAttributeValue(), "id");
1,430,898
void updateModel(final ModelNode operation, final ModelNode model, final boolean checkSingleton) throws OperationFailedException {<NEW_LINE>ModelNode node = config;<NEW_LINE>final List<Property> addressNodes = operation.<MASK><NEW_LINE>final int lastIndex = addressNodes.size() - 1;<NEW_LINE>for (int i = 0; i < addressNodes.size(); i++) {<NEW_LINE>Property addressNode = addressNodes.get(i);<NEW_LINE>// if checkSingleton is true, we verify if the key for the last element (e.g. SP or IDP) in the address path is already defined<NEW_LINE>if (i == lastIndex && checkSingleton) {<NEW_LINE>if (node.get(addressNode.getName()).isDefined()) {<NEW_LINE>// found an existing resource, throw an exception<NEW_LINE>throw new OperationFailedException("Duplicate resource: " + addressNode.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>node = node.get(addressNode.getName()).get(addressNode.getValue().asString());<NEW_LINE>}<NEW_LINE>node.set(model);<NEW_LINE>}
get("address").asPropertyList();
817,608
private List<String> createPointer(String pointer) {<NEW_LINE>if (pointer.charAt(0) == '#') {<NEW_LINE>try {<NEW_LINE>pointer = URLDecoder.decode(pointer, "UTF_8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new JSONException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pointer.isEmpty() || pointer.charAt(0) != '/') {<NEW_LINE>throw new JSONException("Invalid JSON pointer: " + pointer);<NEW_LINE>}<NEW_LINE>String[] parts = pointer.substring<MASK><NEW_LINE>ArrayList<String> res = new ArrayList<>(parts.length);<NEW_LINE>for (int i = 0, l = parts.length; i < l; ++i) {<NEW_LINE>while (parts[i].contains("~1")) {<NEW_LINE>parts[i] = parts[i].replace("~1", "/");<NEW_LINE>}<NEW_LINE>while (parts[i].contains("~0")) {<NEW_LINE>parts[i] = parts[i].replace("~0", "~");<NEW_LINE>}<NEW_LINE>res.add(parts[i]);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
(1).split("/");
1,129,309
public void marshall(VideoParameters videoParameters, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (videoParameters == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(videoParameters.getCodec(), CODEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getCodecOptions(), CODECOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getKeyframesMaxDist(), KEYFRAMESMAXDIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getFixedGOP(), FIXEDGOP_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getBitRate(), BITRATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getFrameRate(), FRAMERATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getMaxFrameRate(), MAXFRAMERATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getResolution(), RESOLUTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(videoParameters.getMaxWidth(), MAXWIDTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getMaxHeight(), MAXHEIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getDisplayAspectRatio(), DISPLAYASPECTRATIO_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getSizingPolicy(), SIZINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getPaddingPolicy(), PADDINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(videoParameters.getWatermarks(), WATERMARKS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
videoParameters.getAspectRatio(), ASPECTRATIO_BINDING);
1,222,926
public void regenerateAntiCsrfToken(HttpMessage message, HttpMessageSender httpSender) {<NEW_LINE>List<AntiCsrfToken> tokens = getTokens(message);<NEW_LINE>AntiCsrfToken antiCsrfToken = null;<NEW_LINE>if (tokens.size() > 0) {<NEW_LINE>antiCsrfToken = tokens.get(0);<NEW_LINE>}<NEW_LINE>if (antiCsrfToken == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String tokenValue = null;<NEW_LINE>try {<NEW_LINE>HttpMessage tokenMsg = antiCsrfToken.getMsg().cloneAll();<NEW_LINE>httpSender.sendAndReceive(tokenMsg);<NEW_LINE>tokenValue = getTokenValue(tokenMsg, antiCsrfToken.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (tokenValue != null) {<NEW_LINE>// Replace token value - only supported in the body right now<NEW_LINE>log.debug("regenerateAntiCsrfToken replacing " + antiCsrfToken.getValue() + " with " + getURLEncode(tokenValue));<NEW_LINE>String replaced = message.getRequestBody().toString();<NEW_LINE>replaced = replaced.replace(getURLEncode(antiCsrfToken.getValue()), getURLEncode(tokenValue));<NEW_LINE>message.setRequestBody(replaced);<NEW_LINE>registerAntiCsrfToken(new AntiCsrfToken(message, antiCsrfToken.getName(), tokenValue<MASK><NEW_LINE>}<NEW_LINE>}
, antiCsrfToken.getFormIndex()));
1,396,610
public static DynamicConfigAddMapConfigCodec.RequestParameters decodeRequest(ClientMessage clientMessage) {<NEW_LINE>ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();<NEW_LINE>RequestParameters request = new RequestParameters();<NEW_LINE>ClientMessage.Frame initialFrame = iterator.next();<NEW_LINE>request.backupCount = decodeInt(initialFrame.content, REQUEST_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.asyncBackupCount = decodeInt(initialFrame.content, REQUEST_ASYNC_BACKUP_COUNT_FIELD_OFFSET);<NEW_LINE>request.timeToLiveSeconds = decodeInt(initialFrame.content, REQUEST_TIME_TO_LIVE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.maxIdleSeconds = decodeInt(initialFrame.content, REQUEST_MAX_IDLE_SECONDS_FIELD_OFFSET);<NEW_LINE>request.readBackupData = decodeBoolean(initialFrame.content, REQUEST_READ_BACKUP_DATA_FIELD_OFFSET);<NEW_LINE>request.mergeBatchSize = decodeInt(initialFrame.content, REQUEST_MERGE_BATCH_SIZE_FIELD_OFFSET);<NEW_LINE>request.statisticsEnabled = decodeBoolean(initialFrame.content, REQUEST_STATISTICS_ENABLED_FIELD_OFFSET);<NEW_LINE>request.metadataPolicy = decodeInt(initialFrame.content, REQUEST_METADATA_POLICY_FIELD_OFFSET);<NEW_LINE>if (initialFrame.content.length >= REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET + BOOLEAN_SIZE_IN_BYTES) {<NEW_LINE>request.perEntryStatsEnabled = <MASK><NEW_LINE>request.isPerEntryStatsEnabledExists = true;<NEW_LINE>} else {<NEW_LINE>request.isPerEntryStatsEnabledExists = false;<NEW_LINE>}<NEW_LINE>request.name = StringCodec.decode(iterator);<NEW_LINE>request.evictionConfig = CodecUtil.decodeNullable(iterator, EvictionConfigHolderCodec::decode);<NEW_LINE>request.cacheDeserializedValues = StringCodec.decode(iterator);<NEW_LINE>request.mergePolicy = StringCodec.decode(iterator);<NEW_LINE>request.inMemoryFormat = StringCodec.decode(iterator);<NEW_LINE>request.listenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.partitionLostListenerConfigs = ListMultiFrameCodec.decodeNullable(iterator, ListenerConfigHolderCodec::decode);<NEW_LINE>request.splitBrainProtectionName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.mapStoreConfig = CodecUtil.decodeNullable(iterator, MapStoreConfigHolderCodec::decode);<NEW_LINE>request.nearCacheConfig = CodecUtil.decodeNullable(iterator, NearCacheConfigHolderCodec::decode);<NEW_LINE>request.wanReplicationRef = CodecUtil.decodeNullable(iterator, WanReplicationRefCodec::decode);<NEW_LINE>request.indexConfigs = ListMultiFrameCodec.decodeNullable(iterator, IndexConfigCodec::decode);<NEW_LINE>request.attributeConfigs = ListMultiFrameCodec.decodeNullable(iterator, AttributeConfigCodec::decode);<NEW_LINE>request.queryCacheConfigs = ListMultiFrameCodec.decodeNullable(iterator, QueryCacheConfigHolderCodec::decode);<NEW_LINE>request.partitioningStrategyClassName = CodecUtil.decodeNullable(iterator, StringCodec::decode);<NEW_LINE>request.partitioningStrategyImplementation = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>request.hotRestartConfig = CodecUtil.decodeNullable(iterator, HotRestartConfigCodec::decode);<NEW_LINE>request.eventJournalConfig = CodecUtil.decodeNullable(iterator, EventJournalConfigCodec::decode);<NEW_LINE>request.merkleTreeConfig = CodecUtil.decodeNullable(iterator, MerkleTreeConfigCodec::decode);<NEW_LINE>return request;<NEW_LINE>}
decodeBoolean(initialFrame.content, REQUEST_PER_ENTRY_STATS_ENABLED_FIELD_OFFSET);
142,013
protected TickRange findRange(long tick) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "findRange", new Object[] { new Long(tick) });<NEW_LINE>TickRange found = null;<NEW_LINE>long diff = cursor.diff(tick);<NEW_LINE>while (diff != 0) {<NEW_LINE>if (diff > 0) {<NEW_LINE>if (cursor.end == TickRange.MAX)<NEW_LINE>break;<NEW_LINE>cursor = (TickRange) cursor.getNext();<NEW_LINE>} else {<NEW_LINE>if (cursor.start == TickRange.MIN)<NEW_LINE>break;<NEW_LINE>cursor = (TickRange) cursor.getPrevious();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (diff == 0)<NEW_LINE>found = cursor;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "findRange", found);<NEW_LINE>return found;<NEW_LINE>}
diff = cursor.diff(tick);
8,161
public EbicsCertificate updateCertificate(X509Certificate certificate, EbicsCertificate cert, boolean cleanPrivateKey) throws CertificateEncodingException, IOException {<NEW_LINE>String sha = DigestUtils.sha256Hex(certificate.getEncoded());<NEW_LINE>log.debug("sha256 HEX : {}", sha);<NEW_LINE>log.debug("certificat : {}", new String(certificate.getEncoded()));<NEW_LINE>log.debug("certificat size : {}", certificate.getEncoded().length);<NEW_LINE>cert.setValidFrom(DateTool.toLocalDate(certificate.getNotBefore()));<NEW_LINE>cert.setValidTo(DateTool.toLocalDate(certificate.getNotAfter()));<NEW_LINE>cert.setIssuer(certificate.getIssuerDN().getName());<NEW_LINE>cert.setSubject(certificate.getSubjectDN().getName());<NEW_LINE>cert.setCertificate(certificate.getEncoded());<NEW_LINE>RSAPublicKey publicKey = (RSAPublicKey) certificate.getPublicKey();<NEW_LINE>cert.setPublicKeyExponent(publicKey.getPublicExponent().toString(16));<NEW_LINE>cert.setPublicKeyModulus(publicKey.getModulus<MASK><NEW_LINE>cert.setSerial(certificate.getSerialNumber().toString(16));<NEW_LINE>cert.setPemString(convertToPEMString(certificate));<NEW_LINE>if (cleanPrivateKey) {<NEW_LINE>cert.setPrivateKey(null);<NEW_LINE>}<NEW_LINE>sha = sha.toUpperCase();<NEW_LINE>cert.setSha2has(sha);<NEW_LINE>computeFullName(cert);<NEW_LINE>return cert;<NEW_LINE>}
().toString(16));
98,839
private void updateSegmentTree(int[] segmentTree, int index, int delta, int low, int high, int pos) {<NEW_LINE>// if index to be updated is less than low or higher than high just return.<NEW_LINE>if (index < low || index > high) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if low and high become equal, then index will be also equal to them and update<NEW_LINE>// that value in segment tree at pos<NEW_LINE>if (low == high) {<NEW_LINE>segmentTree[pos] += delta;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// otherwise keep going left and right to find index to be updated<NEW_LINE>// and then update current tree position if min of left or right has<NEW_LINE>// changed.<NEW_LINE>int mid <MASK><NEW_LINE>updateSegmentTree(segmentTree, index, delta, low, mid, 2 * pos + 1);<NEW_LINE>updateSegmentTree(segmentTree, index, delta, mid + 1, high, 2 * pos + 2);<NEW_LINE>segmentTree[pos] = Math.min(segmentTree[2 * pos + 1], segmentTree[2 * pos + 2]);<NEW_LINE>}
= (low + high) / 2;
845,050
public void formatKeyWithAddress(boolean includePrivateKeys, @Nullable KeyParameter aesKey, StringBuilder builder, NetworkParameters params, Script.ScriptType outputScriptType, @Nullable String comment) {<NEW_LINE>builder.append(" addr:");<NEW_LINE>if (outputScriptType != null) {<NEW_LINE>builder.append(Address.fromKey(params, this, outputScriptType));<NEW_LINE>} else {<NEW_LINE>builder.append(LegacyAddress.fromKey(params, this));<NEW_LINE>if (isCompressed())<NEW_LINE>builder.append(',').append(SegwitAddress.fromKey(params, this));<NEW_LINE>}<NEW_LINE>if (!isCompressed())<NEW_LINE>builder.append(" UNCOMPRESSED");<NEW_LINE>builder.append(" hash160:");<NEW_LINE>builder.append(Utils.HEX.encode(getPubKeyHash()));<NEW_LINE>if (creationTimeSeconds > 0)<NEW_LINE>builder.append(" creationTimeSeconds:").append(creationTimeSeconds).append(" [").append(Utils.dateTimeFormat(creationTimeSeconds * 1000)).append("]");<NEW_LINE>if (comment != null)<NEW_LINE>builder.append(" (").append(comment).append(")");<NEW_LINE>builder.append("\n");<NEW_LINE>if (includePrivateKeys) {<NEW_LINE>builder.append(" ");<NEW_LINE>builder.append<MASK><NEW_LINE>builder.append("\n");<NEW_LINE>}<NEW_LINE>}
(toStringWithPrivate(aesKey, params));
394,354
public void run() {<NEW_LINE>try {<NEW_LINE>String authToken = GoogleAuthUtil.getToken(TomahawkApp.getContext(), account, "sj");<NEW_LINE>Log.d(TAG, "Received auth token!");<NEW_LINE>Map<String, Object> config = mScriptResolver.getConfig();<NEW_LINE>config.put("token", authToken);<NEW_LINE>config.put("email", account.name);<NEW_LINE>mScriptResolver.setConfig(config);<NEW_LINE>mScriptResolver.testConfig(config);<NEW_LINE>} catch (GooglePlayServicesAvailabilityException e) {<NEW_LINE>Log.d(TAG, "GooglePlayServicesAvailabilityException: " + e.getLocalizedMessage());<NEW_LINE>if (getActivity() != null) {<NEW_LINE>GoogleApiAvailability.getInstance().showErrorDialogFragment(getActivity(), e.getConnectionStatusCode(), REQUEST_CODE_PLAY_SERVICES_ERROR);<NEW_LINE>}<NEW_LINE>} catch (UserRecoverableAuthException e) {<NEW_LINE>Log.d(TAG, <MASK><NEW_LINE>if (getActivity() != null) {<NEW_LINE>getActivity().startActivityForResult(e.getIntent(), REQUEST_CODE_RECOVERABLE_ERROR);<NEW_LINE>}<NEW_LINE>} catch (GoogleAuthException e) {<NEW_LINE>Log.d(TAG, "GoogleAuthException: " + e.getLocalizedMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.d(TAG, "IOException: " + e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}
"UserRecoverableAuthException: " + e.getLocalizedMessage());
775,080
public com.amazonaws.services.fsx.model.UnsupportedOperationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fsx.model.UnsupportedOperationException unsupportedOperationException = new com.amazonaws.services.fsx.model.UnsupportedOperationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unsupportedOperationException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
300,591
public StringBuilder exportEverything(JsonMeterRegistry meterRegistry) {<NEW_LINE>JsonObjectBuilder root = JSON_PROVIDER.createObjectBuilder();<NEW_LINE>List<Gauge> gauges = new ArrayList<>();<NEW_LINE>List<Counter> counters = new ArrayList<>();<NEW_LINE>List<TimeGauge> timeGauges = new ArrayList<>();<NEW_LINE>List<FunctionCounter> functionCounters = new ArrayList<>();<NEW_LINE>List<Timer> timers = new ArrayList<>();<NEW_LINE>List<LongTaskTimer> longTaskTimers = new ArrayList<>();<NEW_LINE>List<FunctionTimer> functionTimers = new ArrayList<>();<NEW_LINE>List<DistributionSummary> distributionSummaries = new ArrayList<>();<NEW_LINE>List<Meter> meters = new ArrayList<>();<NEW_LINE>meterRegistry.getMeters().forEach(meter -> meter.match(gauges::add, counters::add, timers::add, distributionSummaries::add, longTaskTimers::add, timeGauges::add, functionCounters::add, functionTimers<MASK><NEW_LINE>exportCounters(counters).forEach(root::add);<NEW_LINE>exportGauges(gauges).forEach(root::add);<NEW_LINE>exportTimeGauges(timeGauges).forEach(root::add);<NEW_LINE>exportFunctionCounters(functionCounters).forEach(root::add);<NEW_LINE>exportTimers(timers).forEach(root::add);<NEW_LINE>exportLongTaskTimers(longTaskTimers).forEach(root::add);<NEW_LINE>exportFunctionTimers(functionTimers).forEach(root::add);<NEW_LINE>exportDistributionSummaries(distributionSummaries).forEach(root::add);<NEW_LINE>return stringify(root.build());<NEW_LINE>}
::add, meters::add));
1,073,588
public static <T, V> Function2<ObjectDoubleHashMap<V>, T, ObjectDoubleHashMap<V>> sumByFloatFunction(final Function<T, V> groupBy, final FloatFunction<? super T> function) {<NEW_LINE>return new Function2<ObjectDoubleHashMap<V>, T, ObjectDoubleHashMap<V>>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>private final MutableObjectDoubleMap<V> compensation = ObjectDoubleMaps.mutable.of();<NEW_LINE><NEW_LINE>public ObjectDoubleHashMap<V> value(ObjectDoubleHashMap<V> map, T each) {<NEW_LINE>V groupKey = groupBy.valueOf(each);<NEW_LINE>double compensation = this.compensation.getIfAbsent(groupKey, 0.0d);<NEW_LINE>double adjustedValue = function.floatValueOf(each) - compensation;<NEW_LINE>double nextSum = map.get(groupKey) + adjustedValue;<NEW_LINE>this.compensation.put(groupKey, nextSum - map<MASK><NEW_LINE>map.put(groupKey, nextSum);<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.get(groupKey) - adjustedValue);
206,696
public void write(RandomAccessFile raf, DataConverter dc) throws IOException {<NEW_LINE>raf.seek(0);<NEW_LINE>raf.writeByte(e_ident_magic_num);<NEW_LINE>raf.write(e_ident_magic_str.getBytes());<NEW_LINE>raf.writeByte(e_ident_class);<NEW_LINE>raf.writeByte(e_ident_data);<NEW_LINE>raf.writeByte(e_ident_version);<NEW_LINE>raf.writeByte(e_ident_osabi);<NEW_LINE>raf.writeByte(e_ident_abiversion);<NEW_LINE>raf.write(e_ident_pad);<NEW_LINE>raf.write(dc.getBytes(e_type));<NEW_LINE>raf.write(dc.getBytes(e_machine));<NEW_LINE>raf.write(dc.getBytes(e_version));<NEW_LINE>if (is32Bit()) {<NEW_LINE>raf.write(dc.getBytes((int) e_entry));<NEW_LINE>raf.write(dc.getBytes((int) e_phoff));<NEW_LINE>raf.write(dc.getBytes((int) e_shoff));<NEW_LINE>} else if (is64Bit()) {<NEW_LINE>raf.write(dc.getBytes(e_entry));<NEW_LINE>raf.write(dc.getBytes(e_phoff));<NEW_LINE>raf.write(dc.getBytes(e_shoff));<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_flags));<NEW_LINE>raf.write(dc.getBytes(e_ehsize));<NEW_LINE>raf.write(dc.getBytes(e_phentsize));<NEW_LINE>if (e_phnum >= Short.toUnsignedInt(ElfConstants.PN_XNUM)) {<NEW_LINE>throw new IOException("Unsupported program header count serialization: " + e_phnum);<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_phnum));<NEW_LINE>raf.write(dc.getBytes(e_shentsize));<NEW_LINE>if (e_shnum >= Short.toUnsignedInt(ElfSectionHeaderConstants.SHN_LORESERVE)) {<NEW_LINE>throw new IOException("Unsupported section header count serialization: " + e_shnum);<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_shnum));<NEW_LINE>raf.write<MASK><NEW_LINE>}
(dc.getBytes(e_shstrndx));
910,928
public <T> Option<Unfoldable<Higher<Higher<product, W1>, W2>>> unfoldable() {<NEW_LINE>if (!def1.unfoldable().isPresent() && !def2.unfoldable().isPresent())<NEW_LINE>return Maybe.nothing();<NEW_LINE>return Maybe.just(new Unfoldable<Higher<Higher<product, W1>, W2>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public <R, T> Higher<Higher<Higher<product, W1>, W2>, R> unfold(T b, Function<? super T, Option<Tuple2<R, T>>> fn) {<NEW_LINE>Higher<W1, R> a1 = def1.unfoldable().orElse(null<MASK><NEW_LINE>Higher<W2, R> a2 = def2.unfoldable().orElse(null).unfold(b, fn);<NEW_LINE>return Product.of(Tuple.tuple(a1, a2), def1, def2);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).unfold(b, fn);
616,771
public static void horizontal11(Kernel1D_S32 kernel, GrayU16 image, GrayI16 dest) {<NEW_LINE>final short[] dataSrc = image.data;<NEW_LINE>final short[] dataDst = dest.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int k10 = kernel.data[9];<NEW_LINE>final int k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = image.getWidth();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[<MASK><NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k2;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k3;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k4;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k5;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k6;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k7;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k8;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k9;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFFFF) * k10;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFFFF) * k11;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
indexSrc++] & 0xFFFF) * k1;