idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,285,891
public void readDir(String directory, Promise promise) {<NEW_LINE>try {<NEW_LINE>File file = new File(directory);<NEW_LINE>if (!file.exists())<NEW_LINE>throw new Exception("Folder does not exist");<NEW_LINE>File[] files = file.listFiles();<NEW_LINE>WritableArray fileMaps = Arguments.createArray();<NEW_LINE>for (File childFile : files) {<NEW_LINE>WritableMap fileMap = Arguments.createMap();<NEW_LINE>fileMap.putDouble("mtime", (double) childFile.lastModified() / 1000);<NEW_LINE>fileMap.putString(<MASK><NEW_LINE>fileMap.putString("path", childFile.getAbsolutePath());<NEW_LINE>fileMap.putDouble("size", (double) childFile.length());<NEW_LINE>fileMap.putInt("type", childFile.isDirectory() ? 1 : 0);<NEW_LINE>fileMaps.pushMap(fileMap);<NEW_LINE>}<NEW_LINE>promise.resolve(fileMaps);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>reject(promise, directory, ex);<NEW_LINE>}<NEW_LINE>}
"name", childFile.getName());
815,972
public Result<List<Map<String, Object>>> apiList() {<NEW_LINE>//<NEW_LINE>List<Map<FieldDef, String>> //<NEW_LINE>infoList = //<NEW_LINE>this.dataAccessLayer.//<NEW_LINE>listObjectBy(//<NEW_LINE>EntityDef.INFO, emptyCondition());<NEW_LINE>infoList = (infoList == null) ? Collections.emptyList() : infoList;<NEW_LINE>//<NEW_LINE>//<NEW_LINE>List<Map<String, Object>> //<NEW_LINE>dataList = infoList.parallelStream().map((Function<Map<FieldDef, String>, Map<String, Object>>) infoMap -> {<NEW_LINE>return new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("id", infoMap<MASK><NEW_LINE>put("checked", false);<NEW_LINE>put("select", infoMap.get(FieldDef.METHOD));<NEW_LINE>put("path", infoMap.get(FieldDef.PATH));<NEW_LINE>put("status", ApiStatusEnum.typeOf(infoMap.get(FieldDef.STATUS)).typeNum());<NEW_LINE>put("comment", infoMap.get(FieldDef.COMMENT));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return Result.of(dataList);<NEW_LINE>}
.get(FieldDef.ID));
1,846,558
private void handleRunningEvent(TaskEvent taskEvent, TaskInstance taskInstance) {<NEW_LINE>Channel channel = taskEvent.getChannel();<NEW_LINE>try {<NEW_LINE>if (taskInstance != null) {<NEW_LINE>if (taskInstance.getState().typeIsFinished()) {<NEW_LINE>logger.warn("task is finish, running event is meaningless, taskInstanceId:{}, state:{}", taskInstance.getId(), taskInstance.getState());<NEW_LINE>} else {<NEW_LINE>taskInstance.setState(taskEvent.getState());<NEW_LINE>taskInstance.setStartTime(taskEvent.getStartTime());<NEW_LINE>taskInstance.<MASK><NEW_LINE>taskInstance.setLogPath(taskEvent.getLogPath());<NEW_LINE>taskInstance.setExecutePath(taskEvent.getExecutePath());<NEW_LINE>taskInstance.setPid(taskEvent.getProcessId());<NEW_LINE>taskInstance.setAppLink(taskEvent.getAppIds());<NEW_LINE>processService.saveTaskInstance(taskInstance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if taskInstance is null (maybe deleted) or finish. retry will be meaningless . so ack success<NEW_LINE>TaskExecuteRunningAckCommand taskExecuteRunningAckCommand = new TaskExecuteRunningAckCommand(ExecutionStatus.SUCCESS.getCode(), taskEvent.getTaskInstanceId());<NEW_LINE>channel.writeAndFlush(taskExecuteRunningAckCommand.convert2Command());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("worker ack master error", e);<NEW_LINE>TaskExecuteRunningAckCommand taskExecuteRunningAckCommand = new TaskExecuteRunningAckCommand(ExecutionStatus.FAILURE.getCode(), -1);<NEW_LINE>channel.writeAndFlush(taskExecuteRunningAckCommand.convert2Command());<NEW_LINE>}<NEW_LINE>}
setHost(taskEvent.getWorkerAddress());
671,808
protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) {<NEW_LINE>ClusterState clusterState = clusterService.state();<NEW_LINE>String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);<NEW_LINE>Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(state, request.routing(), request.indices());<NEW_LINE>Map<String, AliasFilter> indicesAndFilters = new HashMap<>();<NEW_LINE>Set<String> indicesAndAliases = indexNameExpressionResolver.resolveExpressions(clusterState, request.indices());<NEW_LINE>for (String index : concreteIndices) {<NEW_LINE>final AliasFilter aliasFilter = indicesService.buildAliasFilter(clusterState, index, indicesAndAliases);<NEW_LINE>final String[] aliases = indexNameExpressionResolver.indexAliases(clusterState, index, aliasMetadata -> true, true, indicesAndAliases);<NEW_LINE>indicesAndFilters.put(index, new AliasFilter(aliasFilter.getQueryBuilder(), aliases));<NEW_LINE>}<NEW_LINE>Set<String> nodeIds = new HashSet<>();<NEW_LINE>GroupShardsIterator<ShardIterator> groupShardsIterator = clusterService.operationRouting().searchShards(clusterState, concreteIndices, null, routingMap, request.preference(), null, null, request.remoteAddress(), null);<NEW_LINE>ShardRouting shard;<NEW_LINE>ClusterSearchShardsGroup[] groupResponses = new ClusterSearchShardsGroup[groupShardsIterator.size()];<NEW_LINE>int currentGroup = 0;<NEW_LINE>for (ShardIterator shardIt : groupShardsIterator) {<NEW_LINE>ShardId shardId = shardIt.shardId();<NEW_LINE>ShardRouting[] shardRoutings = new ShardRouting[shardIt.size()];<NEW_LINE>int currentShard = 0;<NEW_LINE>shardIt.reset();<NEW_LINE>while ((shard = shardIt.nextOrNull()) != null) {<NEW_LINE>shardRoutings[currentShard++] = shard;<NEW_LINE>nodeIds.<MASK><NEW_LINE>}<NEW_LINE>groupResponses[currentGroup++] = new ClusterSearchShardsGroup(shardId, shardRoutings);<NEW_LINE>}<NEW_LINE>DiscoveryNode[] nodes = new DiscoveryNode[nodeIds.size()];<NEW_LINE>int currentNode = 0;<NEW_LINE>for (String nodeId : nodeIds) {<NEW_LINE>nodes[currentNode++] = clusterState.getNodes().get(nodeId);<NEW_LINE>}<NEW_LINE>listener.onResponse(new ClusterSearchShardsResponse(groupResponses, nodes, indicesAndFilters));<NEW_LINE>}
add(shard.currentNodeId());
345,022
public okhttp3.Call deleteObjectsCall(String repository, String branch, PathList pathList, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = pathList;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/branches/{branch}/objects/delete".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())).replaceAll("\\{" + "branch" + "\\}", localVarApiClient.escapeString(branch.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams <MASK><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 HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
= new ArrayList<Pair>();
995,358
private void createTableViewer(Composite composite) {<NEW_LINE>tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);<NEW_LINE>tableColumnLayout = new TableColumnLayout();<NEW_LINE>composite.setLayout(tableColumnLayout);<NEW_LINE>createColumns();<NEW_LINE>final Table table = tableViewer.getTable();<NEW_LINE>table.setHeaderVisible(true);<NEW_LINE>table.setLinesVisible(true);<NEW_LINE>tableViewer.addDoubleClickListener(new IDoubleClickListener() {<NEW_LINE><NEW_LINE>public void doubleClick(DoubleClickEvent evt) {<NEW_LINE>StructuredSelection sel = (StructuredSelection) evt.getSelection();<NEW_LINE>Object o = sel.getFirstElement();<NEW_LINE>if (o instanceof BatchPack) {<NEW_LINE>BatchPack pack = (BatchPack) o;<NEW_LINE>Display display = ObjectBatchHistoryView.this.getViewSite().getShell().getDisplay();<NEW_LINE>new OpenBatchDetailJob(display, <MASK><NEW_LINE>} else {<NEW_LINE>System.out.println(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tableViewer.setContentProvider(new ArrayContentProvider());<NEW_LINE>tableViewer.setComparator(new ColumnLabelSorter(tableViewer));<NEW_LINE>GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);<NEW_LINE>tableViewer.getControl().setLayoutData(gridData);<NEW_LINE>}
pack, serverId).schedule();
1,643,193
public Request<UpdateContactFlowContentRequest> marshall(UpdateContactFlowContentRequest updateContactFlowContentRequest) {<NEW_LINE>if (updateContactFlowContentRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(UpdateContactFlowContentRequest)");<NEW_LINE>}<NEW_LINE>Request<UpdateContactFlowContentRequest> request = new DefaultRequest<UpdateContactFlowContentRequest>(updateContactFlowContentRequest, "AmazonConnect");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/contact-flows/{InstanceId}/{ContactFlowId}/content";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (updateContactFlowContentRequest.getInstanceId() == null) ? "" : StringUtils.fromString(updateContactFlowContentRequest.getInstanceId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{ContactFlowId}", (updateContactFlowContentRequest.getContactFlowId() == null) ? "" : StringUtils.fromString(updateContactFlowContentRequest.getContactFlowId()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (updateContactFlowContentRequest.getContent() != null) {<NEW_LINE>String content = updateContactFlowContentRequest.getContent();<NEW_LINE>jsonWriter.name("Content");<NEW_LINE>jsonWriter.value(content);<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>}
jsonWriter = JsonUtils.getJsonWriter(stringWriter);
652,990
public void verifySignAlgOnly(JsonWebSignature signature) throws JWTTokenValidationFailedException {<NEW_LINE>String algHeader = signature.getAlgorithmHeaderValue();<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Signing Algorithm from header: " + algHeader);<NEW_LINE>}<NEW_LINE>rpSpecifiedSigningAlgorithm = !this.signingAlgorithm.equals(Constants.SIG_ALG_NONE);<NEW_LINE>if (rpSpecifiedSigningAlgorithm) {<NEW_LINE>// if algorithm is not NONE, then check the signature of jwt first<NEW_LINE>if (signature.getEncodedSignature().isEmpty()) {<NEW_LINE>Object[] objects = new Object[] { <MASK><NEW_LINE>if (oidcClientRequest != null) {<NEW_LINE>throw oidcClientRequest.errorCommon(true, tc, new String[] { "OIDC_IDTOKEN_SIGNATURE_VERIFY_MISSING_SIGNATURE_ERR", "OIDC_JWT_SIGNATURE_VERIFY_MISSING_SIGNATURE_ERR" }, objects);<NEW_LINE>} else {<NEW_LINE>String errorMsg = Tr.formatMessage(tc, "OIDC_JWT_SIGNATURE_VERIFY_MISSING_SIGNATURE_ERR", objects);<NEW_LINE>Tr.error(tc, errorMsg);<NEW_LINE>throw new JWTTokenValidationFailedException(errorMsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Doing the same thing as old jwt<NEW_LINE>if (!(this.signingAlgorithm.equals(algHeader))) {<NEW_LINE>Object[] objects = new Object[] { this.clientId, this.signingAlgorithm, algHeader };<NEW_LINE>if (oidcClientRequest != null) {<NEW_LINE>throw oidcClientRequest.errorCommon(true, tc, new String[] { "OIDC_IDTOKEN_SIGNATURE_VERIFY_ERR_ALG_MISMATCH", "OIDC_JWT_SIGNATURE_VERIFY_ERR_ALG_MISMATCH" }, objects);<NEW_LINE>} else {<NEW_LINE>String errorMsg = Tr.formatMessage(tc, "OIDC_JWT_SIGNATURE_VERIFY_ERR_ALG_MISMATCH", objects);<NEW_LINE>Tr.error(tc, errorMsg);<NEW_LINE>throw new JWTTokenValidationFailedException(errorMsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.clientId, this.signingAlgorithm };
62,874
public DBRecord translateRecord(DBRecord oldRec) {<NEW_LINE>if (oldRec == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DBRecord rec = TypedefDBAdapter.SCHEMA.createRecord(oldRec.getKey());<NEW_LINE>rec.setLongValue(TYPEDEF_DT_ID_COL, oldRec.getLongValue(V0_TYPEDEF_DT_ID_COL));<NEW_LINE>// default TYPEDEF_FLAGS_COL to 0<NEW_LINE>rec.setString(TYPEDEF_NAME_COL, oldRec.getString(V0_TYPEDEF_NAME_COL));<NEW_LINE>rec.setLongValue(TYPEDEF_CAT_COL, oldRec.getLongValue(V0_TYPEDEF_CAT_COL));<NEW_LINE>rec.setLongValue(TYPEDEF_SOURCE_ARCHIVE_ID_COL, DataTypeManager.LOCAL_ARCHIVE_KEY);<NEW_LINE>rec.setLongValue(TYPEDEF_UNIVERSAL_DT_ID_COL, UniversalIdGenerator.<MASK><NEW_LINE>rec.setLongValue(TYPEDEF_SOURCE_SYNC_TIME_COL, DataType.NO_SOURCE_SYNC_TIME);<NEW_LINE>rec.setLongValue(TYPEDEF_LAST_CHANGE_TIME_COL, DataType.NO_LAST_CHANGE_TIME);<NEW_LINE>return rec;<NEW_LINE>}
nextID().getValue());
1,108,701
protected void processExtension(SchemaRep.Extension el) throws Schema2BeansException {<NEW_LINE>if (debug)<NEW_LINE>config.messageOut.println("extension el=" + el);<NEW_LINE>String uniqueName = (String) parentUniqueNames.peek();<NEW_LINE>String name = (String) parentTypes.peek();<NEW_LINE>String base = el.getBase();<NEW_LINE>SchemaRep.ElementExpr baseDef = schema.getSchemaTypeDef(base);<NEW_LINE>// config.messageOut.println("baseDef="+baseDef);<NEW_LINE>SchemaRep.Restriction[] restrict = null;<NEW_LINE>if (baseDef instanceof SchemaRep.ContainsSubElements) {<NEW_LINE>restrict = lookForRestriction((SchemaRep.ContainsSubElements) baseDef);<NEW_LINE>// We're extending something defined internally.<NEW_LINE>if (!config.isRespectExtension())<NEW_LINE>processContainsSubElementsAndAttributes((SchemaRep.ContainsSubElements) baseDef, name);<NEW_LINE>}<NEW_LINE>addExtraDataForType(uniqueName, name, baseDef);<NEW_LINE>if (baseDef instanceof SchemaRep.ComplexType) {<NEW_LINE>SchemaRep.ComplexType <MASK><NEW_LINE>String resolvedExtendsName = schema.resolveNamespace(complexType.getTypeName());<NEW_LINE>// config.messageOut.println("resolvedExtendsName="+resolvedExtendsName);<NEW_LINE>handler.setExtension(uniqueName, name, resolvedExtendsName);<NEW_LINE>}<NEW_LINE>String javaType = el.getJavaTypeName();<NEW_LINE>if (javaType != null) {<NEW_LINE>if (debug)<NEW_LINE>config.messageOut.println("Setting javatype of " + name + " to " + javaType);<NEW_LINE>handler.javaType(uniqueName, name, javaType);<NEW_LINE>if (restrict != null) {<NEW_LINE>addExtraDataNode(uniqueName, name, restrict);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processContainsSubElementsAndAttributes(el, name);<NEW_LINE>}
complexType = (SchemaRep.ComplexType) baseDef;
203,719
private void addStyleRangeForScope(ArrayList<StyleRange> styleRanges, Scope scope, boolean inner, LineStyleEvent event) {<NEW_LINE>StyleRange styleRange = new StyleRange();<NEW_LINE>ThemeSetting setting = null;<NEW_LINE>ThemeSetting excludeSetting = null;<NEW_LINE>if (scope.parent != null)<NEW_LINE>excludeSetting = scope.parent.themeSetting;<NEW_LINE>setting = theme.settingsForScope(scope, inner, null);<NEW_LINE>int startLineOffset = event.lineOffset;<NEW_LINE>int endLineOffset = startLineOffset + event.lineText.length();<NEW_LINE>if (inner) {<NEW_LINE>styleRange.start = Math.max(scope.getInnerStart().getOffset(), startLineOffset);<NEW_LINE>styleRange.length = Math.min(scope.getInnerEnd().getOffset() - styleRange.start, event.lineText.length(<MASK><NEW_LINE>} else {<NEW_LINE>styleRange.start = Math.max(scope.getStart().getOffset(), startLineOffset);<NEW_LINE>styleRange.length = Math.min(scope.getEnd().getOffset() - styleRange.start, event.lineText.length() - styleRange.start + startLineOffset);<NEW_LINE>}<NEW_LINE>if (styleRange.length == 0)<NEW_LINE>return;<NEW_LINE>if (setting != null) {<NEW_LINE>setStyleRangeProperties(scope, setting, styleRange);<NEW_LINE>addStyleRangeWithoutOverlaps(styleRanges, styleRange);<NEW_LINE>// System.out.printf("[Color] style range (%d, %d) %s\n", styleRange.start, styleRange.length, styleRange.toString());<NEW_LINE>}<NEW_LINE>}
) - styleRange.start + startLineOffset);
541,476
public static void waitForKeyStores(LibertyServer server) throws Exception {<NEW_LINE>Log.info(thisClass, "waitForKeyStores", "Waiting for keystore configurations to be loaded");<NEW_LINE>ConfigElementList<KeyStore> keyStores = server.getServerConfiguration().getKeyStores();<NEW_LINE>if (keyStores == null) {<NEW_LINE>Log.info(thisClass, "waitForKeyStores", "No keystores were found in the configuration");<NEW_LINE>}<NEW_LINE>for (KeyStore keyStore : keyStores) {<NEW_LINE>String name = keyStore.getId();<NEW_LINE>Log.info(thisClass, "waitForKeyStores", "Searching for add of keystore: " + name);<NEW_LINE>String msg = server.waitForStringInTrace("Adding keystore: " + name);<NEW_LINE>Log.info(thisClass, "waitForKeyStores", "**********************************************************************");<NEW_LINE>Log.info(thisClass, "waitForKeyStores", msg);<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>Log.info(thisClass, "waitForKeyStores", "Done waiting for keystore configuration to be loaded - the waits in the method will not guarentee that the keystore setup is truly ready...");<NEW_LINE>}
info(thisClass, "waitForKeyStores", "**********************************************************************");
163,964
public void translateNode(PTransform<PCollection<KV<K, InputT>>, PCollection<KeyedWorkItem<K, InputT>>> transform, FlinkStreamingTranslationContext context) {<NEW_LINE>PCollection<KV<K, InputT>> <MASK><NEW_LINE>KvCoder<K, InputT> inputKvCoder = (KvCoder<K, InputT>) input.getCoder();<NEW_LINE>SingletonKeyedWorkItemCoder<K, InputT> workItemCoder = SingletonKeyedWorkItemCoder.of(inputKvCoder.getKeyCoder(), inputKvCoder.getValueCoder(), input.getWindowingStrategy().getWindowFn().windowCoder());<NEW_LINE>WindowedValue.ValueOnlyWindowedValueCoder<KeyedWorkItem<K, InputT>> windowedWorkItemCoder = WindowedValue.getValueOnlyCoder(workItemCoder);<NEW_LINE>CoderTypeInformation<WindowedValue<KeyedWorkItem<K, InputT>>> workItemTypeInfo = new CoderTypeInformation<>(windowedWorkItemCoder, context.getPipelineOptions());<NEW_LINE>DataStream<WindowedValue<KV<K, InputT>>> inputDataStream = context.getInputDataStream(input);<NEW_LINE>DataStream<WindowedValue<KeyedWorkItem<K, InputT>>> workItemStream = inputDataStream.flatMap(new ToKeyedWorkItemInGlobalWindow<>(context.getPipelineOptions())).returns(workItemTypeInfo).name("ToKeyedWorkItem");<NEW_LINE>KeyedStream<WindowedValue<KeyedWorkItem<K, InputT>>, ByteBuffer> keyedWorkItemStream = workItemStream.keyBy(new WorkItemKeySelector<>(inputKvCoder.getKeyCoder(), new SerializablePipelineOptions(context.getPipelineOptions())));<NEW_LINE>context.setOutputDataStream(context.getOutput(transform), keyedWorkItemStream);<NEW_LINE>}
input = context.getInput(transform);
465,002
private Mono<Response<Void>> deleteContinuousWebJobSlotWithResponseAsync(String resourceGroupName, String name, String webJobName, String slot, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (webJobName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (slot == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.deleteContinuousWebJobSlot(this.client.getEndpoint(), resourceGroupName, name, webJobName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
390,734
public void sessionPut(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>boolean createSession = Boolean.parseBoolean<MASK><NEW_LINE>HttpSession session = request.getSession(createSession);<NEW_LINE>if (createSession)<NEW_LINE>System.out.println("Created a new session with sessionID=" + session.getId());<NEW_LINE>else {<NEW_LINE>String id = session == null ? null : session.getId();<NEW_LINE>System.out.println("Re-using existing session with sessionID=" + id);<NEW_LINE>}<NEW_LINE>String key = request.getParameter("key");<NEW_LINE>String value = request.getParameter("value");<NEW_LINE>String type = request.getParameter("type");<NEW_LINE>Object val = toType(type, value);<NEW_LINE>session.setAttribute(key, val);<NEW_LINE>String sessionID = session.getId();<NEW_LINE>System.out.println("Put entry: " + key + '=' + value + " into sessionID=" + sessionID);<NEW_LINE>response.getWriter().write("session id: [" + sessionID + "]");<NEW_LINE>// Normally, session postinvoke writes the updates after the servlet returns control to the test logic.<NEW_LINE>// This can be a problem if the test logic proceeds to execute further test logic based on the expectation<NEW_LINE>// that updates made under the previous servlet request have gone into effect. Tests that are vulnerable<NEW_LINE>// to this can use the sync=true parameter to force update to be made before servlet returns.<NEW_LINE>boolean sync = Boolean.parseBoolean(request.getParameter("sync"));<NEW_LINE>if (sync)<NEW_LINE>((IBMSession) session).sync();<NEW_LINE>}
(request.getParameter("createSession"));
1,458,463
public void marshall(EntityRecognizerProperties entityRecognizerProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (entityRecognizerProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getEntityRecognizerArn(), ENTITYRECOGNIZERARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getLanguageCode(), LANGUAGECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getMessage(), MESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getSubmitTime(), SUBMITTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getTrainingStartTime(), TRAININGSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getInputDataConfig(), INPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getRecognizerMetadata(), RECOGNIZERMETADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getVolumeKmsKeyId(), VOLUMEKMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getVpcConfig(), VPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getModelKmsKeyId(), MODELKMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getVersionName(), VERSIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(entityRecognizerProperties.getSourceModelArn(), SOURCEMODELARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
entityRecognizerProperties.getTrainingEndTime(), TRAININGENDTIME_BINDING);
644,460
public static void main(String[] args) {<NEW_LINE>// Prepare our context and sockets<NEW_LINE>try (ZContext context = new ZContext()) {<NEW_LINE>LRUQueueArg arg = new LRUQueueArg();<NEW_LINE>Socket frontend = context.createSocket(SocketType.ROUTER);<NEW_LINE>Socket backend = context.createSocket(SocketType.ROUTER);<NEW_LINE>arg.frontend = frontend;<NEW_LINE>arg.backend = backend;<NEW_LINE>frontend.bind("ipc://frontend.ipc");<NEW_LINE>backend.bind("ipc://backend.ipc");<NEW_LINE>int client_nbr;<NEW_LINE>for (client_nbr = 0; client_nbr < 10; client_nbr++) new ClientThread3().start();<NEW_LINE>int worker_nbr;<NEW_LINE>for (worker_nbr = 0; worker_nbr < 3; worker_nbr++) new WorkerThread3().start();<NEW_LINE>// Queue of available workers<NEW_LINE>arg.workers = new LinkedList<ZFrame>();<NEW_LINE>// Prepare reactor and fire it up<NEW_LINE>ZLoop reactor = new ZLoop(context);<NEW_LINE>reactor.verbose(true);<NEW_LINE>PollItem poller = new PollItem(arg.backend, ZMQ.Poller.POLLIN);<NEW_LINE>reactor.<MASK><NEW_LINE>reactor.start();<NEW_LINE>for (ZFrame frame : arg.workers) {<NEW_LINE>frame.destroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.exit(0);<NEW_LINE>}
addPoller(poller, handle_backend, arg);
552,546
private Tuple<T> giveArrayInstances(TypeTag tag, PrefabValues prefabValues, LinkedHashSet<TypeTag> typeStack) {<NEW_LINE>Class<T> type = tag.getType();<NEW_LINE>Class<?> componentType = type.getComponentType();<NEW_LINE>TypeTag componentTag = new TypeTag(componentType);<NEW_LINE><MASK><NEW_LINE>T red = (T) Array.newInstance(componentType, 1);<NEW_LINE>Array.set(red, 0, prefabValues.giveRed(componentTag));<NEW_LINE>T blue = (T) Array.newInstance(componentType, 1);<NEW_LINE>Array.set(blue, 0, prefabValues.giveBlue(componentTag));<NEW_LINE>T redCopy = (T) Array.newInstance(componentType, 1);<NEW_LINE>Array.set(redCopy, 0, prefabValues.giveRed(componentTag));<NEW_LINE>return new Tuple<>(red, blue, redCopy);<NEW_LINE>}
prefabValues.realizeCacheFor(componentTag, typeStack);
646,766
public static void initRemixer(Application app) {<NEW_LINE>if (initialized) {<NEW_LINE>// Guarantee that this is just called once.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>initialized = true;<NEW_LINE>if (app != null) {<NEW_LINE>app.registerActivityLifecycleCallbacks(RemixerActivityLifecycleCallbacks.getInstance());<NEW_LINE>}<NEW_LINE>// Boolean values only make sense in Variables, not in ItemListVariables or Range Variables.<NEW_LINE>DataType.BOOLEAN.setLayoutIdForVariableType(Variable.class, R.layout.boolean_variable_widget);<NEW_LINE>Remixer.registerDataType(DataType.BOOLEAN);<NEW_LINE>// Color values are currently only supported in ItemListVariable. Support should be coming for<NEW_LINE>// Variables. RangeVariable doesn't make sense for Color.<NEW_LINE>DataType.COLOR.setLayoutIdForVariableType(ItemListVariable.<MASK><NEW_LINE>Remixer.registerDataType(DataType.COLOR);<NEW_LINE>// Number values are only supported in ItemListVariable or RangeVariable<NEW_LINE>DataType.NUMBER.setLayoutIdForVariableType(ItemListVariable.class, R.layout.item_list_variable_widget);<NEW_LINE>DataType.NUMBER.setLayoutIdForVariableType(RangeVariable.class, R.layout.seekbar_range_variable_widget);<NEW_LINE>Remixer.registerDataType(DataType.NUMBER);<NEW_LINE>// String values are supported in Variable and ItemListVariable. Range Variable doesn't quite<NEW_LINE>// make sens<NEW_LINE>DataType.STRING.setLayoutIdForVariableType(ItemListVariable.class, R.layout.item_list_variable_widget);<NEW_LINE>DataType.STRING.setLayoutIdForVariableType(Variable.class, R.layout.string_variable_widget);<NEW_LINE>Remixer.registerDataType(DataType.STRING);<NEW_LINE>}
class, R.layout.color_list_variable_widget);
1,471,930
static void invoke(ProblemReporter problemReporter, MessageSend messageSend, MethodBinding method, Scope scope) {<NEW_LINE>if (messageSend != null) {<NEW_LINE>try {<NEW_LINE>if (shortMethod != null)<NEW_LINE>Permit.invoke(initProblem, shortMethod, problemReporter, messageSend, method);<NEW_LINE>else if (longMethod != null)<NEW_LINE>Permit.invoke(initProblem, longMethod, problemReporter, messageSend, method, scope);<NEW_LINE>else<NEW_LINE>Permit.reportReflectionProblem(initProblem, "method named 'invalidMethod' not found in ProblemReporter.class");<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE><MASK><NEW_LINE>if (t instanceof Error)<NEW_LINE>throw (Error) t;<NEW_LINE>if (t instanceof RuntimeException)<NEW_LINE>throw (RuntimeException) t;<NEW_LINE>throw new RuntimeException(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Throwable t = e.getCause();
1,096,354
public final void filter(final Collection<IFacet<ModelType>> facets) {<NEW_LINE>//<NEW_LINE>// Initialize current filters<NEW_LINE>this.facetCategoryFilters = createFacetCategoryQueryFilters(facets);<NEW_LINE>//<NEW_LINE>// Create the GridTab query<NEW_LINE>// starting from our seed/base query<NEW_LINE>final MQuery query = getBaseQuery().deepCopy();<NEW_LINE>// flag it as a user query, because mainly, this method is triggered when user is selecting/deselecting some facets.<NEW_LINE>query.setUserQuery(true);<NEW_LINE>//<NEW_LINE>// Add facet category filters<NEW_LINE>// NOTE: we use sqlParamsOut=null because we are not supporting sql parameters<NEW_LINE>// Only if any of the underlying facet filters will have some sql parameters, an exception could be thrown.<NEW_LINE>// onlyFacetCategoriesPredicate=null => all facet categories<NEW_LINE>final ICompositeQueryFilter<<MASK><NEW_LINE>final List<Object> sqlParamsOut = null;<NEW_LINE>final String filtersWhereClause = queryBuilderDAO.getSql(getCtx(), filters, sqlParamsOut);<NEW_LINE>if (!Check.isEmpty(filtersWhereClause, true)) {<NEW_LINE>query.addRestriction(filtersWhereClause);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Execute the query on GridTab<NEW_LINE>gridTab.setQuery(query);<NEW_LINE>final boolean onlyCurrentRows = false;<NEW_LINE>gridTab.query(onlyCurrentRows);<NEW_LINE>}
ModelType> filters = createFacetCategoriesFilter(null);
1,658,133
private static Map<String, String> createTypeToJsonTypeMap() {<NEW_LINE>Map<String, String> typeToJsonTypeMap = new HashMap<>();<NEW_LINE>typeToJsonTypeMap.put("String", "string");<NEW_LINE>typeToJsonTypeMap.put("Integer", "integer");<NEW_LINE>typeToJsonTypeMap.put("Long", "long");<NEW_LINE>typeToJsonTypeMap.put("BigDecimal", "decimal");<NEW_LINE><MASK><NEW_LINE>typeToJsonTypeMap.put("LocalDateTime", "datetime");<NEW_LINE>typeToJsonTypeMap.put("LocalDate", "date");<NEW_LINE>typeToJsonTypeMap.put("LocalTime", "time");<NEW_LINE>typeToJsonTypeMap.put("ManyToOne", "many-to-one");<NEW_LINE>typeToJsonTypeMap.put("ManyToMany", "many-to-many");<NEW_LINE>typeToJsonTypeMap.put("OneToMany", "one-to-many");<NEW_LINE>typeToJsonTypeMap.put("Custom-ManyToOne", "json-many-to-one");<NEW_LINE>typeToJsonTypeMap.put("Custom-ManyToMany", "json-many-to-many");<NEW_LINE>typeToJsonTypeMap.put("Custom-OneToMany", "json-one-to-many");<NEW_LINE>return typeToJsonTypeMap;<NEW_LINE>}
typeToJsonTypeMap.put("Boolean", "boolean");
649,457
public void actionPerformed(final ActionEvent e) {<NEW_LINE>if (RP.isRequestProcessorThread()) {<NEW_LINE>Lookup lookup = node.getLookup();<NEW_LINE>org.netbeans.modules.web.webkit.debugging.api.css.Rule rule = lookup.lookup(org.netbeans.modules.web.webkit.debugging.api.css.Rule.class);<NEW_LINE>Resource resource = lookup.lookup(Resource.class);<NEW_LINE>if (resource == null || rule == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileObject fob = resource.toFileObject();<NEW_LINE>if (fob == null || fob.isFolder()) /* issue 233463 */<NEW_LINE>{<NEW_LINE>StyleSheetBody body = rule.getParentStyleSheet();<NEW_LINE>if (body == null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>fob = RemoteStyleSheetCache.getDefault().getFileObject(body);<NEW_LINE>if (fob == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Source source = Source.create(fob);<NEW_LINE>ParserManager.parse(Collections.singleton(source), new GoToRuleTask(rule, fob));<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>Logger.getLogger(GoToRuleSourceAction.class.getName()).log(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RP.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>actionPerformed(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
Level.INFO, null, ex);
1,090,726
public void refresh(TableCell cell) {<NEW_LINE>Object dataSource = cell.getDataSource();<NEW_LINE>int num = -1;<NEW_LINE>if (dataSource instanceof Download) {<NEW_LINE>Download dl = (Download) dataSource;<NEW_LINE>BuddyPluginBeta beta = BuddyPluginUtils.getBetaPlugin();<NEW_LINE>if (beta != null && beta.getEnableAutoDownloadChats()) {<NEW_LINE>ChatInstance chat = beta.peekChatInstance(dl);<NEW_LINE>if (chat != null) {<NEW_LINE>num = chat.getMessageCount(true);<NEW_LINE>} else {<NEW_LINE>Map<String, Object> peek_data = beta.peekChat(dl, true);<NEW_LINE>if (peek_data != null) {<NEW_LINE>Number message_count = (<MASK><NEW_LINE>if (message_count != null) {<NEW_LINE>num = message_count.intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ChatInstance chat = (ChatInstance) cell.getDataSource();<NEW_LINE>if (chat != null) {<NEW_LINE>num = chat.getMessageCount(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!cell.setSortValue(num) && cell.isValid()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!cell.isShown()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cell.setText(num == -1 ? "" : (num < 100 ? String.valueOf(num) : "100+"));<NEW_LINE>}
Number) peek_data.get("m");
887,388
public void add(byte[] sequence, int start, int len, int outputSymbol) {<NEW_LINE>assert _serialized != null : "Automaton already built.";<NEW_LINE>assert _previous == null || len == 0 || ByteArray.compare(_previous, 0, _previousLength, sequence, start, start + len) <= 0 : "Input must be sorted: " + Arrays.toString(Arrays.copyOf(_previous, _previousLength)) + " >= " + Arrays.toString(Arrays.copyOfRange(sequence, start, len));<NEW_LINE>assert setPrevious(sequence, start, len);<NEW_LINE>// Determine common prefix length.<NEW_LINE>final int commonPrefix = commonPrefix(sequence, start, len);<NEW_LINE>// Make room for extra states on active path, if needed.<NEW_LINE>expandActivePath(len);<NEW_LINE>// Freeze all the states after the common prefix.<NEW_LINE>for (int i = _activePathLen - 1; i > commonPrefix; i--) {<NEW_LINE>final int frozenState = freezeState(i);<NEW_LINE>setArcTarget(_nextArcOffset[i - 1] - ConstantArcSizeFST.ARC_SIZE, frozenState);<NEW_LINE>_nextArcOffset[i] = _activePath[i];<NEW_LINE>}<NEW_LINE>int prevArc = -1;<NEW_LINE>// Create arcs to new suffix states.<NEW_LINE>for (int i = commonPrefix + 1, j = start + commonPrefix; i <= len; i++) {<NEW_LINE>final int p = _nextArcOffset[i - 1];<NEW_LINE>_serialized[p + ConstantArcSizeFST.FLAGS_OFFSET] = (byte) (i == len ? ConstantArcSizeFST.BIT_ARC_FINAL : 0);<NEW_LINE>_serialized[p + ConstantArcSizeFST.LABEL_OFFSET] = sequence[j++];<NEW_LINE>setArcTarget(p, i == len ? ConstantArcSizeFST.TERMINAL_STATE : _activePath[i]);<NEW_LINE>_nextArcOffset[i - <MASK><NEW_LINE>prevArc = p;<NEW_LINE>}<NEW_LINE>if (prevArc != -1) {<NEW_LINE>_outputSymbols.put(prevArc, outputSymbol);<NEW_LINE>}<NEW_LINE>// Save last sequence's length so that we don't need to calculate it again.<NEW_LINE>_activePathLen = len;<NEW_LINE>}
1] = p + ConstantArcSizeFST.ARC_SIZE;
1,051,477
public static byte[] rotatePixels(byte[] input, int width, int height, int rotation) {<NEW_LINE>byte[] output = new byte[input.length];<NEW_LINE>boolean swap = (rotation == 90 || rotation == 270);<NEW_LINE>boolean yflip = (rotation == 90 || rotation == 180);<NEW_LINE>boolean xflip = (<MASK><NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int xo = x, yo = y;<NEW_LINE>int w = width, h = height;<NEW_LINE>int xi = xo, yi = yo;<NEW_LINE>if (swap) {<NEW_LINE>xi = w * yo / h;<NEW_LINE>yi = h * xo / w;<NEW_LINE>}<NEW_LINE>if (yflip) {<NEW_LINE>yi = h - yi - 1;<NEW_LINE>}<NEW_LINE>if (xflip) {<NEW_LINE>xi = w - xi - 1;<NEW_LINE>}<NEW_LINE>output[w * yo + xo] = input[w * yi + xi];<NEW_LINE>int fs = w * h;<NEW_LINE>int qs = (fs >> 2);<NEW_LINE>xi = (xi >> 1);<NEW_LINE>yi = (yi >> 1);<NEW_LINE>xo = (xo >> 1);<NEW_LINE>yo = (yo >> 1);<NEW_LINE>w = (w >> 1);<NEW_LINE>h = (h >> 1);<NEW_LINE>// adjust for interleave here<NEW_LINE>int ui = fs + (w * yi + xi) * 2;<NEW_LINE>int uo = fs + (w * yo + xo) * 2;<NEW_LINE>// and here<NEW_LINE>int vi = ui + 1;<NEW_LINE>int vo = uo + 1;<NEW_LINE>output[uo] = input[ui];<NEW_LINE>output[vo] = input[vi];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
rotation == 270 || rotation == 180);
973,094
public boolean match(long alias_hash) {<NEW_LINE>long hash = alias_hash();<NEW_LINE>if (hash == alias_hash) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (expr instanceof SQLAllColumnExpr) {<NEW_LINE>SQLTableSource resolvedTableSource = ((SQLAllColumnExpr) expr).getResolvedTableSource();<NEW_LINE>if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (expr instanceof SQLIdentifierExpr) {<NEW_LINE>return ((SQLIdentifierExpr) expr).nameHashCode64() == alias_hash;<NEW_LINE>}<NEW_LINE>if (expr instanceof SQLPropertyExpr) {<NEW_LINE>String ident = ((SQLPropertyExpr) expr).getName();<NEW_LINE>if ("*".equals(ident)) {<NEW_LINE>SQLTableSource resolvedTableSource = ((<MASK><NEW_LINE>if (resolvedTableSource != null && resolvedTableSource.findColumn(alias_hash) != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return alias == null && ((SQLPropertyExpr) expr).nameHashCode64() == alias_hash;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
SQLPropertyExpr) expr).getResolvedTableSource();
1,784,965
public void onClick(View arg0) {<NEW_LINE>ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 800);<NEW_LINE>ps.setScaleRange(0.7f, 1.3f);<NEW_LINE>ps.setSpeedRange(0.1f, 0.25f);<NEW_LINE>ps.setRotationSpeedRange(90, 180);<NEW_LINE>ps.setFadeOut(200, new AccelerateInterpolator());<NEW_LINE>ps.oneShot(arg0, 70);<NEW_LINE>ParticleSystem ps2 = new ParticleSystem(this, 100, R.drawable.star_white, 800);<NEW_LINE>ps2.setScaleRange(0.7f, 1.3f);<NEW_LINE>ps2.setSpeedRange(0.1f, 0.25f);<NEW_LINE><MASK><NEW_LINE>ps2.setFadeOut(200, new AccelerateInterpolator());<NEW_LINE>ps2.oneShot(arg0, 70);<NEW_LINE>}
ps.setRotationSpeedRange(90, 180);
1,206,974
private void addDeprecationHeaders(SparkSpringController controller) {<NEW_LINE>boolean isDeprecated = controller.getClass(<MASK><NEW_LINE>if (!isDeprecated) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DeprecatedAPI deprecated = controller.getClass().getAnnotation(DeprecatedAPI.class);<NEW_LINE>String controllerBasePath, mimeType;<NEW_LINE>try {<NEW_LINE>controllerBasePath = (String) controller.getClass().getMethod("controllerBasePath").invoke(controller);<NEW_LINE>Field field = controller.getClass().getSuperclass().getDeclaredField("mimeType");<NEW_LINE>field.setAccessible(true);<NEW_LINE>mimeType = (String) field.get(controller);<NEW_LINE>} catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>path(controllerBasePath, () -> {<NEW_LINE>before("", mimeType, (req, res) -> setDeprecationHeaders(req, res, deprecated));<NEW_LINE>before("/*", mimeType, (req, res) -> setDeprecationHeaders(req, res, deprecated));<NEW_LINE>});<NEW_LINE>}
).isAnnotationPresent(DeprecatedAPI.class);
1,825,473
public static void register() {<NEW_LINE>final BeanManager beanManager = BeanManager.getInstance();<NEW_LINE>final LoginCheckMidware loginCheck = beanManager.getReference(LoginCheckMidware.class);<NEW_LINE>final CSRFMidware csrfMidware = beanManager.getReference(CSRFMidware.class);<NEW_LINE>final Activity1A0001ValidationMidware activity1A0001ValidationMidware = beanManager.getReference(Activity1A0001ValidationMidware.class);<NEW_LINE>final Activity1A0001CollectValidationMidware activity1A0001CollectValidationMidware = beanManager.getReference(Activity1A0001CollectValidationMidware.class);<NEW_LINE>final ActivityProcessor activityProcessor = beanManager.getReference(ActivityProcessor.class);<NEW_LINE>Dispatcher.get("/activity/character", activityProcessor::showCharacter, loginCheck::handle, csrfMidware::fill);<NEW_LINE>Dispatcher.post("/activity/character/submit", activityProcessor::submitCharacter, loginCheck::handle);<NEW_LINE>Dispatcher.get("/activities", activityProcessor::showActivities);<NEW_LINE>Dispatcher.get("/activity/checkin", activityProcessor::showDailyCheckin);<NEW_LINE>Dispatcher.get("/activity/daily-checkin", activityProcessor::dailyCheckin, loginCheck::handle);<NEW_LINE>Dispatcher.get("/activity/yesterday-liveness-reward", activityProcessor::yesterdayLivenessReward, loginCheck::handle);<NEW_LINE>Dispatcher.get("/activity/1A0001", activityProcessor::show1A0001, csrfMidware::fill);<NEW_LINE>Dispatcher.post("/activity/1A0001/bet", activityProcessor::bet1A0001, loginCheck::handle, csrfMidware::check, activity1A0001ValidationMidware::handle);<NEW_LINE>Dispatcher.post("/activity/1A0001/collect", activityProcessor::collect1A0001, loginCheck::handle, activity1A0001CollectValidationMidware::handle);<NEW_LINE>Dispatcher.get("/activity/eating-snake", activityProcessor::showEatingSnake, <MASK><NEW_LINE>Dispatcher.post("/activity/eating-snake/start", activityProcessor::startEatingSnake, loginCheck::handle, csrfMidware::check);<NEW_LINE>Dispatcher.post("/activity/eating-snake/collect", activityProcessor::collectEatingSnake, loginCheck::handle, csrfMidware::fill);<NEW_LINE>Dispatcher.get("/activity/gobang", activityProcessor::showGobang, loginCheck::handle, csrfMidware::fill);<NEW_LINE>Dispatcher.post("/activity/gobang/start", activityProcessor::startGobang, loginCheck::handle);<NEW_LINE>}
loginCheck::handle, csrfMidware::fill);
409,456
public boolean deleteAccountFromProject(long projectId, String accountName) {<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>// check that the project exists<NEW_LINE>Project project = getProject(projectId);<NEW_LINE>if (project == null) {<NEW_LINE>InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id");<NEW_LINE>ex.addProxyObject(String.valueOf(projectId), "projectId");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>// check that account-to-remove exists<NEW_LINE>Account account = _accountMgr.getActiveAccountByName(accountName, project.getDomainId());<NEW_LINE>if (account == null) {<NEW_LINE>InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find account name=" + accountName + " in domain id=" + project.getDomainId());<NEW_LINE>DomainVO domain = ApiDBUtils.findDomainById(project.getDomainId());<NEW_LINE>String domainUuid = String.valueOf(project.getDomainId());<NEW_LINE>if (domain != null) {<NEW_LINE>domainUuid = domain.getUuid();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>CallContext.current().setProject(project);<NEW_LINE>// verify permissions<NEW_LINE>_accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId()));<NEW_LINE>// Check if the account exists in the project<NEW_LINE>ProjectAccount projectAccount = _projectAccountDao.findByProjectIdAccountId(projectId, account.getId());<NEW_LINE>if (projectAccount == null) {<NEW_LINE>InvalidParameterValueException ex = new InvalidParameterValueException("Account " + accountName + " is not assigned to the project with specified id");<NEW_LINE>// Use the projectVO object and not the projectAccount object to inject the projectId.<NEW_LINE>ex.addProxyObject(project.getUuid(), "projectId");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>// can't remove the owner of the project<NEW_LINE>if (isTheOnlyProjectOwner(projectId, projectAccount, caller)) {<NEW_LINE>InvalidParameterValueException ex = new InvalidParameterValueException("Unable to delete account " + accountName + " from the project with specified id as the account is the owner of the project");<NEW_LINE>ex.addProxyObject(project.getUuid(), "projectId");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>return deleteAccountFromProject(projectId, account.getId());<NEW_LINE>}
ex.addProxyObject(domainUuid, "domainId");
994,441
public void onModuleLoad() {<NEW_LINE>// Create a tab bar with three items.<NEW_LINE>TabBar bar = new TabBar();<NEW_LINE>bar.addTab("foo");<NEW_LINE>bar.addTab("bar");<NEW_LINE>bar.addTab("baz");<NEW_LINE>// Hook up a tab listener to do something when the user selects a tab.<NEW_LINE>bar.addSelectionHandler(new SelectionHandler<Integer>() {<NEW_LINE><NEW_LINE>public void onSelection(SelectionEvent<Integer> event) {<NEW_LINE>// Let the user know what they just did.<NEW_LINE>Window.alert("You clicked tab " + event.getSelectedItem());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Just for fun, let's disallow selection of 'bar'.<NEW_LINE>bar.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {<NEW_LINE><NEW_LINE>public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {<NEW_LINE>if (event.getItem().intValue() == 1) {<NEW_LINE>event.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Add it to the root panel.<NEW_LINE>RootPanel.<MASK><NEW_LINE>}
get().add(bar);
869,281
public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>WorkCompleted workCompleted = emc.find(wi.getWorkCompleted(), WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getWorkCompleted(), WorkCompleted.class);<NEW_LINE>}<NEW_LINE>List<String> people = business.organization().person().list(wi.getPersonList());<NEW_LINE>if (ListTools.isEmpty(people)) {<NEW_LINE>throw new ExceptionPersonEmpty();<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(people)) {<NEW_LINE>emc.beginTransaction(Review.class);<NEW_LINE>for (String person : people) {<NEW_LINE>Long count = emc.countEqualAndEqual(Review.class, Review.job_FIELDNAME, workCompleted.getJob(), Review.person_FIELDNAME, person);<NEW_LINE>if (count < 1) {<NEW_LINE>Review review = new Review(workCompleted, person);<NEW_LINE>emc.<MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(review.getId());<NEW_LINE>wos.add(wo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
persist(review, CheckPersistType.all);
197,357
public PoolOriginationIdentitiesFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PoolOriginationIdentitiesFilter poolOriginationIdentitiesFilter = new PoolOriginationIdentitiesFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<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>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>poolOriginationIdentitiesFilter.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Values", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>poolOriginationIdentitiesFilter.setValues(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><NEW_LINE>}<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 poolOriginationIdentitiesFilter;<NEW_LINE>}
)).unmarshall(context));
588,856
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>int primaryColor = themeColorUtils.primaryColor(getContext());<NEW_LINE>user = getArguments().getParcelable(ARG_USER);<NEW_LINE>arbitraryDataProvider = new ArbitraryDataProvider(getContext().getContentResolver());<NEW_LINE>// Inflate the layout for the dialog<NEW_LINE>LayoutInflater inflater = getActivity().getLayoutInflater();<NEW_LINE>// Setup layout<NEW_LINE>View v = inflater.inflate(R.layout.setup_encryption_dialog, null);<NEW_LINE>textView = v.findViewById(R.id.encryption_status);<NEW_LINE>passphraseTextView = v.findViewById(R.id.encryption_passphrase);<NEW_LINE>passwordField = v.findViewById(R.id.encryption_passwordInput);<NEW_LINE>passwordField.getBackground().setColorFilter(primaryColor, PorterDuff.Mode.SRC_ATOP);<NEW_LINE>Drawable wrappedDrawable = DrawableCompat.<MASK><NEW_LINE>DrawableCompat.setTint(wrappedDrawable, primaryColor);<NEW_LINE>passwordField.setBackgroundDrawable(wrappedDrawable);<NEW_LINE>return createDialog(v);<NEW_LINE>}
wrap(passwordField.getBackground());
686,189
public void dispatch(DownloadManagerListener listener, int type, Object _value) {<NEW_LINE>Object[] value = (Object[]) _value;<NEW_LINE>DownloadManagerImpl dm = (DownloadManagerImpl) value[0];<NEW_LINE>if (type == LDT_STATECHANGED) {<NEW_LINE>listener.stateChanged(dm, ((Integer) value[1]).intValue());<NEW_LINE>} else if (type == LDT_DOWNLOADCOMPLETE) {<NEW_LINE>listener.downloadComplete(dm);<NEW_LINE>} else if (type == LDT_COMPLETIONCHANGED) {<NEW_LINE>listener.completionChanged(dm, ((Boolean) value[1]).booleanValue());<NEW_LINE>} else if (type == LDT_FILEPRIORITYCHANGED) {<NEW_LINE>listener.filePriorityChanged(dm, <MASK><NEW_LINE>} else if (type == LDT_POSITIONCHANGED) {<NEW_LINE>listener.positionChanged(dm, ((Integer) value[1]).intValue(), ((Integer) value[2]).intValue());<NEW_LINE>} else if (type == LDT_FILELOCATIONCHANGED) {<NEW_LINE>listener.fileLocationChanged(dm, (DiskManagerFileInfo) value[1]);<NEW_LINE>}<NEW_LINE>}
(DiskManagerFileInfo) value[1]);
451,698
private Answer migrateVmWithVolumesWithinCluster(VMInstanceVO vm, VirtualMachineTO to, Host srcHost, Host destHost, Map<VolumeInfo, DataStore> volumeToPool) throws AgentUnavailableException {<NEW_LINE>// Initiate migration of a virtual machine with its volumes.<NEW_LINE>try {<NEW_LINE>List<Pair<VolumeTO, StorageFilerTO>> volumeToFilerto = new ArrayList<Pair<VolumeTO, StorageFilerTO>>();<NEW_LINE>for (Map.Entry<VolumeInfo, DataStore> entry : volumeToPool.entrySet()) {<NEW_LINE>VolumeInfo volume = entry.getKey();<NEW_LINE>VolumeTO volumeTo = new VolumeTO(volume, storagePoolDao.findById(volume.getPoolId()));<NEW_LINE>StorageFilerTO filerTo = new StorageFilerTO((StoragePool) entry.getValue());<NEW_LINE>volumeToFilerto.add(new Pair<VolumeTO, StorageFilerTO>(volumeTo, filerTo));<NEW_LINE>}<NEW_LINE>MigrateWithStorageCommand command = new MigrateWithStorageCommand(to, volumeToFilerto);<NEW_LINE>MigrateWithStorageAnswer answer = (MigrateWithStorageAnswer) agentMgr.send(<MASK><NEW_LINE>if (answer == null) {<NEW_LINE>s_logger.error("Migration with storage of vm " + vm + " failed.");<NEW_LINE>throw new CloudRuntimeException("Error while migrating the vm " + vm + " to host " + destHost);<NEW_LINE>} else if (!answer.getResult()) {<NEW_LINE>s_logger.error("Migration with storage of vm " + vm + " failed. Details: " + answer.getDetails());<NEW_LINE>throw new CloudRuntimeException("Error while migrating the vm " + vm + " to host " + destHost + ". " + answer.getDetails());<NEW_LINE>} else {<NEW_LINE>// Update the volume details after migration.<NEW_LINE>updateVolumePathsAfterMigration(volumeToPool, answer.getVolumeTos(), srcHost);<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>} catch (OperationTimedoutException e) {<NEW_LINE>s_logger.error("Error while migrating vm " + vm + " to host " + destHost, e);<NEW_LINE>throw new AgentUnavailableException("Operation timed out on storage motion for " + vm, destHost.getId());<NEW_LINE>}<NEW_LINE>}
destHost.getId(), command);
1,440,823
private void collectFragmentSpread(FieldCollectorNormalizedQueryParams parameters, List<CollectedField> result, FragmentSpread fragmentSpread, Set<GraphQLObjectType> possibleObjects, GraphQLCompositeType astTypeCondition) {<NEW_LINE>if (!conditionalNodes.shouldInclude(parameters.getCoercedVariableValues(), fragmentSpread.getDirectives())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FragmentDefinition fragmentDefinition = assertNotNull(parameters.getFragmentsByName().get(fragmentSpread.getName()));<NEW_LINE>if (!conditionalNodes.shouldInclude(parameters.getCoercedVariableValues(), fragmentDefinition.getDirectives())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GraphQLCompositeType newAstTypeCondition = (GraphQLCompositeType) assertNotNull(parameters.getGraphQLSchema().getType(fragmentDefinition.getTypeCondition().getName()));<NEW_LINE>Set<GraphQLObjectType> newPossibleObjects = narrowDownPossibleObjects(possibleObjects, newAstTypeCondition, parameters.getGraphQLSchema());<NEW_LINE>collectFromSelectionSet(parameters, fragmentDefinition.getSelectionSet(<MASK><NEW_LINE>}
), result, newAstTypeCondition, newPossibleObjects);
914,224
private static FlavorsConfig createConfig() {<NEW_LINE>FlavorConfigBuilder b = new FlavorConfigBuilder();<NEW_LINE>b.addFlavor("default", 2., 16., 400, 10, Flavor.Type.BARE_METAL, x86_64);<NEW_LINE>b.addFlavor("medium-disk", 6., 12., 56, 10, Flavor.Type.BARE_METAL, x86_64);<NEW_LINE>b.addFlavor("large", 4., 32., 1600, 20, Flavor.Type.BARE_METAL, x86_64);<NEW_LINE>b.addFlavor("docker", 0.2, 0.5, 100, 1, Flavor.Type.DOCKER_CONTAINER, x86_64);<NEW_LINE>b.addFlavor("d-2-8-100", 2, 8, 100, 1, Flavor.Type.DOCKER_CONTAINER, x86_64);<NEW_LINE>b.addFlavor("v-4-8-100", 4.0, 8.0, 100, 5, Flavor.Type.VIRTUAL_MACHINE, x86_64);<NEW_LINE>b.addFlavor("large-variant", 64, 128, 2000, 15, <MASK><NEW_LINE>b.addFlavor("expensive", 6, 12, 500, 5, Flavor.Type.BARE_METAL, x86_64);<NEW_LINE>b.addFlavor("arm64", 4, 32., 1600, 20, Flavor.Type.BARE_METAL, arm64);<NEW_LINE>return b.build();<NEW_LINE>}
Flavor.Type.BARE_METAL, x86_64);
679,224
/*<NEW_LINE>* update an existing jar file. Adds/replace files specified in relpathToFile map<NEW_LINE>*/<NEW_LINE>public static void update(InputStream in, OutputStream out, Map<String, File> relpathToFile) throws IOException {<NEW_LINE>ZipInputStream zis = null;<NEW_LINE>ZipOutputStream zos = null;<NEW_LINE>try {<NEW_LINE>zis = new ZipInputStream(in);<NEW_LINE>zos = new ZipOutputStream(out);<NEW_LINE>// put the old entries first, replace if necessary<NEW_LINE>ZipEntry e;<NEW_LINE>while ((e = zis.getNextEntry()) != null) {<NEW_LINE>String name = e.getName();<NEW_LINE>if (!relpathToFile.containsKey(name)) {<NEW_LINE>// copy the old stuff<NEW_LINE>// do our own compression<NEW_LINE>ZipEntry e2 = new ZipEntry(name);<NEW_LINE>e2.setMethod(e.getMethod());<NEW_LINE>e2.<MASK><NEW_LINE>e2.setComment(e.getComment());<NEW_LINE>e2.setExtra(e.getExtra());<NEW_LINE>if (e.getMethod() == ZipEntry.STORED) {<NEW_LINE>e2.setSize(e.getSize());<NEW_LINE>e2.setCrc(e.getCrc());<NEW_LINE>}<NEW_LINE>zos.putNextEntry(e2);<NEW_LINE>FileUtil.copy(zis, zos);<NEW_LINE>} else {<NEW_LINE>// replace with the new files<NEW_LINE>final File file = relpathToFile.get(name);<NEW_LINE>// addFile(file, name, zos);<NEW_LINE>relpathToFile.remove(name);<NEW_LINE>addFileToZip(zos, file, name, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add the remaining new files<NEW_LINE>for (final String path : relpathToFile.keySet()) {<NEW_LINE>File file = relpathToFile.get(path);<NEW_LINE>addFileToZip(zos, file, path, null, null);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>StreamUtil.closeStream(zis);<NEW_LINE>StreamUtil.closeStream(zos);<NEW_LINE>}<NEW_LINE>}
setTime(e.getTime());
530,840
public // ***********************************************************************************<NEW_LINE>void fill(Automaton a, TIntHashSet alphabet) {<NEW_LINE>int max = max(alphabet);<NEW_LINE>int min = min(alphabet);<NEW_LINE>this.<MASK><NEW_LINE>HashMap<State, State> m = new HashMap<>();<NEW_LINE>Set<State> states = a.getStates();<NEW_LINE>for (State s : states) {<NEW_LINE>this.addState();<NEW_LINE>State ns = this.states.get(this.states.size() - 1);<NEW_LINE>m.put(s, ns);<NEW_LINE>}<NEW_LINE>for (State s : states) {<NEW_LINE>State p = m.get(s);<NEW_LINE>int source = stateToIndex.get(p);<NEW_LINE>p.setAccept(s.isAccept());<NEW_LINE>if (a.getInitialState().equals(s))<NEW_LINE>representedBy.setInitialState(p);<NEW_LINE>for (Transition t : s.getTransitions()) {<NEW_LINE>int tmin = getIntFromChar(t.getMin());<NEW_LINE>int tmax = getIntFromChar(t.getMax());<NEW_LINE>State dest = m.get(t.getDest());<NEW_LINE>int desti = stateToIndex.get(dest);<NEW_LINE>int minmax = Math.min(max, tmax);<NEW_LINE>for (int i = Math.max(min, tmin); i <= minmax; i++) {<NEW_LINE>if (alphabet.contains(i))<NEW_LINE>this.addTransition(source, desti, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setDeterministic(a.isDeterministic());
1,031,820
public void write(Encoder encoder, AnnotationProcessingData value) throws Exception {<NEW_LINE>HierarchicalNameSerializer hierarchicalNameSerializer = classNameSerializerSupplier.get();<NEW_LINE>SetSerializer<String> typesSerializer = new SetSerializer<>(hierarchicalNameSerializer);<NEW_LINE>MapSerializer<String, Set<String>> generatedTypesSerializer = new MapSerializer<>(hierarchicalNameSerializer, typesSerializer);<NEW_LINE>GeneratedResourceSerializer resourceSerializer = new GeneratedResourceSerializer(hierarchicalNameSerializer);<NEW_LINE>SetSerializer<GeneratedResource> resourcesSerializer = new SetSerializer<>(resourceSerializer);<NEW_LINE>MapSerializer<String, Set<GeneratedResource>> generatedResourcesSerializer = new MapSerializer<>(hierarchicalNameSerializer, resourcesSerializer);<NEW_LINE>generatedTypesSerializer.write(encoder, value.generatedTypesByOrigin);<NEW_LINE>typesSerializer.write(encoder, value.aggregatedTypes);<NEW_LINE>typesSerializer.write(encoder, value.generatedTypesDependingOnAllOthers);<NEW_LINE>encoder.writeNullableString(value.fullRebuildCause);<NEW_LINE>generatedResourcesSerializer.write(encoder, value.generatedResourcesByOrigin);<NEW_LINE>resourcesSerializer.<MASK><NEW_LINE>}
write(encoder, value.generatedResourcesDependingOnAllOthers);
1,718,228
protected void initASB(AnalysisEngineDescription aAnalysisEngineDescription, Map<String, Object> aAdditionalParams) throws ResourceInitializationException {<NEW_LINE>// add this analysis engine's name to the parameters sent to the ASB<NEW_LINE>Map<String, Object> asbParams = new HashMap<String, Object>(aAdditionalParams);<NEW_LINE>// not used 9/2013 scan<NEW_LINE>asbParams.put(ASB.PARAM_AGGREGATE_ANALYSIS_ENGINE_NAME, this.getMetaData().getName());<NEW_LINE>asbParams.put(<MASK><NEW_LINE>// Pass sofa mappings defined in this aggregate as additional ASB parameters<NEW_LINE>// System.out.println("remapping sofa names");<NEW_LINE>asbParams.put(Resource.PARAM_AGGREGATE_SOFA_MAPPINGS, aAnalysisEngineDescription.getSofaMappings());<NEW_LINE>// Get FlowController specifier from the aggregate descriptor. If none, use<NEW_LINE>// default FixedFlow specifier.<NEW_LINE>FlowControllerDeclaration flowControllerDecl = aAnalysisEngineDescription.getFlowControllerDeclaration();<NEW_LINE>if (flowControllerDecl != null) {<NEW_LINE>try {<NEW_LINE>aAnalysisEngineDescription.getFlowControllerDeclaration().resolveImports(getResourceManager());<NEW_LINE>} catch (InvalidXMLException e) {<NEW_LINE>throw new ResourceInitializationException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>flowControllerDecl = getDefaultFlowControllerDeclaration();<NEW_LINE>}<NEW_LINE>// create and configure ASB<NEW_LINE>_getASB().initialize(dummyAsbSpecifier, asbParams);<NEW_LINE>_getASB().setup(_getComponentCasProcessorSpecifierMap(), getUimaContextAdmin(), flowControllerDecl, getAnalysisEngineMetaData());<NEW_LINE>// Get delegate AnalysisEngine metadata from the ASB
Resource.PARAM_RESOURCE_MANAGER, getResourceManager());
1,206,295
public QueryIterator execEvaluated(final Binding binding, final Node subject, final Node predicate, final PropFuncArg object, final ExecutionContext execCxt) {<NEW_LINE>if (!object.getArg(0).isLiteral() || !object.getArg(1).isLiteral()) {<NEW_LINE>return IterLib.noResults(execCxt);<NEW_LINE>}<NEW_LINE>String s = object.getArg(0).getLiteralLexicalForm();<NEW_LINE>String regex = object.<MASK><NEW_LINE>// StrUtils will also trim whitespace<NEW_LINE>List<String> tokens = Arrays.asList(StrUtils.split(s, regex));<NEW_LINE>if (Var.isVar(subject)) {<NEW_LINE>// Case: Subject is variable. Return all tokens as results.<NEW_LINE>final Var subjectVar = Var.alloc(subject);<NEW_LINE>Iterator<Binding> it = Iter.map(tokens.iterator(), item -> BindingFactory.binding(binding, subjectVar, NodeFactory.createLiteral(item)));<NEW_LINE>return QueryIterPlainWrapper.create(it, execCxt);<NEW_LINE>} else if (Util.isSimpleString(subject)) {<NEW_LINE>// Case: Subject is a plain literal.<NEW_LINE>// Return input unchanged if it is one of the tokens, or nothing otherwise<NEW_LINE>if (tokens.contains(subject.getLiteralLexicalForm())) {<NEW_LINE>return IterLib.result(binding, execCxt);<NEW_LINE>} else {<NEW_LINE>return IterLib.noResults(execCxt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Any other case: Return nothing<NEW_LINE>return IterLib.noResults(execCxt);<NEW_LINE>}
getArg(1).getLiteralLexicalForm();
1,133,779
protected void wurstRenderLabelIfPresent(T entity, Text text, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {<NEW_LINE>double d = this.dispatcher.getSquaredDistanceToCamera(entity);<NEW_LINE>if (d > 4096)<NEW_LINE>return;<NEW_LINE>NameTagsHack nameTagsHack = WurstClient.INSTANCE.getHax().nameTagsHack;<NEW_LINE>boolean bl = !entity.isSneaky() || nameTagsHack.isEnabled();<NEW_LINE>float f = entity.getHeight() + 0.5F;<NEW_LINE>int j = "deadmau5".equals(text.getString()) ? -10 : 0;<NEW_LINE>matrixStack.push();<NEW_LINE>matrixStack.translate(0.0D, f, 0.0D);<NEW_LINE>matrixStack.multiply(this.dispatcher.getRotation());<NEW_LINE>float scale = 0.025F;<NEW_LINE>if (nameTagsHack.isEnabled()) {<NEW_LINE>double distance = WurstClient.MC.player.distanceTo(entity);<NEW_LINE>if (distance > 10)<NEW_LINE>scale *= distance / 10;<NEW_LINE>}<NEW_LINE>matrixStack.scale(-scale, -scale, scale);<NEW_LINE>Matrix4f matrix4f = matrixStack.peek().getPositionMatrix();<NEW_LINE>float g = WurstClient.MC.options.getTextBackgroundOpacity(0.25F);<NEW_LINE>int k = (int<MASK><NEW_LINE>TextRenderer textRenderer = this.getTextRenderer();<NEW_LINE>float h = -textRenderer.getWidth(text) / 2;<NEW_LINE>textRenderer.draw(text.asOrderedText(), h, j, 553648127, false, matrix4f, vertexConsumerProvider, bl, k, i);<NEW_LINE>if (bl)<NEW_LINE>textRenderer.draw(text.asOrderedText(), h, j, -1, false, matrix4f, vertexConsumerProvider, false, 0, i);<NEW_LINE>matrixStack.pop();<NEW_LINE>}
) (g * 255.0F) << 24;
1,004,439
public PPOrderIssueSchedule issue(@NonNull PPOrderIssueScheduleProcessRequest request) {<NEW_LINE>final PPOrderIssueScheduleId issueScheduleId = request.getIssueScheduleId();<NEW_LINE>PPOrderIssueSchedule <MASK><NEW_LINE>if (issueSchedule.getIssued() != null) {<NEW_LINE>throw new AdempiereException("Already issued");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Qty Issued<NEW_LINE>final I_C_UOM uom = issueSchedule.getQtyToIssue().getUOM();<NEW_LINE>final Quantity qtyIssued = Quantity.of(request.getQtyIssued(), uom);<NEW_LINE>if (qtyIssued.signum() != 0) {<NEW_LINE>final PPOrderId ppOrderId = request.getPpOrderId();<NEW_LINE>final ProductId productId = issueSchedule.getProductId();<NEW_LINE>final I_M_HU issueFromHU = handlingUnitsBL.getById(issueSchedule.getIssueFromHUId());<NEW_LINE>huPPOrderBL.createIssueProducer(ppOrderId).fixedQtyToIssue(qtyIssued).processCandidates(HUPPOrderIssueProducer.ProcessIssueCandidatesPolicy.ALWAYS).generatedBy(IssueCandidateGeneratedBy.ofIssueScheduleId(issueScheduleId)).createIssues(HUTransformService.newInstance().husToNewCUs(HUTransformService.HUsToNewCUsRequest.builder().sourceHU(issueFromHU).productId(productId).qtyCU(qtyIssued).reservedVHUsPolicy(ReservedHUsPolicy.CONSIDER_ONLY_NOT_RESERVED).build()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Qty Rejected<NEW_LINE>final QtyRejectedWithReason qtyRejected = request.getQtyRejectedReasonCode() != null ? QtyRejectedWithReason.of(Quantity.of(request.getQtyRejected(), uom), request.getQtyRejectedReasonCode()) : null;<NEW_LINE>//<NEW_LINE>// Update the issue schedule<NEW_LINE>issueSchedule = issueSchedule.withIssued(PPOrderIssueSchedule.Issued.builder().qtyIssued(qtyIssued).qtyRejected(qtyRejected).build());<NEW_LINE>issueScheduleRepository.saveChanges(issueSchedule);<NEW_LINE>return issueSchedule;<NEW_LINE>}
issueSchedule = issueScheduleRepository.getById(issueScheduleId);
1,273,787
public List<?> deserialize(final String topic, final byte[] bytes) {<NEW_LINE>if (bytes == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String recordCsvString = new String(bytes, StandardCharsets.UTF_8);<NEW_LINE>final List<CSVRecord> csvRecords = CSVParser.parse(<MASK><NEW_LINE>if (csvRecords.isEmpty()) {<NEW_LINE>throw new SerializationException("No fields in record");<NEW_LINE>}<NEW_LINE>final CSVRecord csvRecord = csvRecords.get(0);<NEW_LINE>if (csvRecord == null || csvRecord.size() == 0) {<NEW_LINE>throw new SerializationException("No fields in record.");<NEW_LINE>}<NEW_LINE>SerdeUtils.throwOnColumnCountMismatch(parsers.size(), csvRecord.size(), false, topic);<NEW_LINE>final List<Object> values = new ArrayList<>(parsers.size());<NEW_LINE>final Iterator<Parser> pIt = parsers.iterator();<NEW_LINE>for (int i = 0; i < csvRecord.size(); i++) {<NEW_LINE>final String value = csvRecord.get(i);<NEW_LINE>final Parser parser = pIt.next();<NEW_LINE>final Object parsed = value == null || value.isEmpty() ? null : parser.parse(value);<NEW_LINE>values.add(parsed);<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new SerializationException("Error deserializing delimited", e);<NEW_LINE>}<NEW_LINE>}
recordCsvString, csvFormat).getRecords();
557,287
private FileObject generateMavenTester(File testdir, String baseURL) throws IOException {<NEW_LINE>String[] replaceKeys1 = { "TTL_TEST_RESBEANS", "MSG_TEST_RESBEANS_INFO" };<NEW_LINE>String[] replaceKeys2 = { "MSG_TEST_RESBEANS_wadlErr", "MSG_TEST_RESBEANS_No_AJAX", "MSG_TEST_RESBEANS_Resource", "MSG_TEST_RESBEANS_See", "MSG_TEST_RESBEANS_No_Container", "MSG_TEST_RESBEANS_Content", "MSG_TEST_RESBEANS_TabularView", "MSG_TEST_RESBEANS_RawView", "MSG_TEST_RESBEANS_ResponseHeaders", "MSG_TEST_RESBEANS_Help", "MSG_TEST_RESBEANS_TestButton", "MSG_TEST_RESBEANS_Loading", "MSG_TEST_RESBEANS_Status", "MSG_TEST_RESBEANS_Headers", "MSG_TEST_RESBEANS_HeaderName", "MSG_TEST_RESBEANS_HeaderValue", "MSG_TEST_RESBEANS_Insert", "MSG_TEST_RESBEANS_NoContents", "MSG_TEST_RESBEANS_AddParamButton", "MSG_TEST_RESBEANS_Monitor", "MSG_TEST_RESBEANS_No_SubResources", "MSG_TEST_RESBEANS_SubResources", "MSG_TEST_RESBEANS_ChooseMethod", "MSG_TEST_RESBEANS_ChooseMime", "MSG_TEST_RESBEANS_Continue", "MSG_TEST_RESBEANS_AdditionalParams", "MSG_TEST_RESBEANS_INFO", "MSG_TEST_RESBEANS_Request", "MSG_TEST_RESBEANS_Sent", "MSG_TEST_RESBEANS_Received", "MSG_TEST_RESBEANS_TimeStamp", "MSG_TEST_RESBEANS_Response", "MSG_TEST_RESBEANS_CurrentSelection", "MSG_TEST_RESBEANS_DebugWindow", "MSG_TEST_RESBEANS_Wadl", "MSG_TEST_RESBEANS_RequestFailed" };<NEW_LINE>FileObject testFO = copyFileAndReplaceBaseUrl(testdir, TEST_SERVICES_HTML, replaceKeys1, baseURL);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_JS, replaceKeys2, false);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS2);<NEW_LINE>MiscUtilities.copyFile(testdir, "expand.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "collapse.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "item.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cc.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "og.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cg.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "app.gif");<NEW_LINE>File testdir2 = new File(testdir, "images");<NEW_LINE>testdir2.mkdir();<NEW_LINE>MiscUtilities.copyFile(testdir, "images/background_border_bottom.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/bg_gradient.gif");<NEW_LINE><MASK><NEW_LINE>MiscUtilities.copyFile(testdir, "images/level1_selected-1lvl.jpg");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/masthead.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-roll.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbdis.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/secondary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbena.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbmou.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbuns.png");<NEW_LINE>return testFO;<NEW_LINE>}
MiscUtilities.copyFile(testdir, "images/pname.png");
226,714
public void Picture(@Asset final String path) {<NEW_LINE>if (MediaUtil.isExternalFile(container.$context(), path) && container.$form().isDeniedPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) {<NEW_LINE>container.$form().askPermission(Manifest.permission.READ_EXTERNAL_STORAGE, new PermissionResultHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void HandlePermissionResponse(String permission, boolean granted) {<NEW_LINE>if (granted) {<NEW_LINE>Picture(path);<NEW_LINE>} else {<NEW_LINE>container.$form().dispatchPermissionDeniedEvent(Image.this, "Picture", permission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>picturePath = (<MASK><NEW_LINE>Drawable drawable;<NEW_LINE>try {<NEW_LINE>drawable = MediaUtil.getBitmapDrawable(container.$form(), picturePath);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Log.e("Image", "Unable to load " + picturePath);<NEW_LINE>drawable = null;<NEW_LINE>}<NEW_LINE>ViewUtil.setImage(view, drawable);<NEW_LINE>}
path == null) ? "" : path;
151,949
private JsonResponseUpsertItemBuilder syncJsonLocation(@NonNull final OrgId orgId, @NonNull final JsonRequestLocationUpsertItem locationUpsertItem, @NonNull final SyncAdvise parentSyncAdvise, @NonNull final ShortTermLocationIndex shortTermIndex) {<NEW_LINE>final ExternalIdentifier locationIdentifier = ExternalIdentifier.of(locationUpsertItem.getLocationIdentifier());<NEW_LINE>BPartnerLocation existingLocation = null;<NEW_LINE>if (ExternalIdentifier.Type.EXTERNAL_REFERENCE.equals(locationIdentifier.getType())) {<NEW_LINE>final Optional<MetasfreshId> metasfreshId = jsonRetrieverService.resolveExternalReference(orgId, locationIdentifier, BPLocationExternalReferenceType.BPARTNER_LOCATION);<NEW_LINE>if (metasfreshId.isPresent()) {<NEW_LINE>existingLocation = shortTermIndex.extractAndMarkUsed(metasfreshId.get());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final JsonResponseUpsertItemBuilder resultBuilder = JsonResponseUpsertItem.builder().identifier(locationUpsertItem.getLocationIdentifier());<NEW_LINE>final SyncOutcome syncOutcome;<NEW_LINE>final BPartnerLocation location;<NEW_LINE>if (existingLocation != null) {<NEW_LINE>location = existingLocation;<NEW_LINE>syncOutcome = parentSyncAdvise.getIfExists().isUpdate() ? SyncOutcome.UPDATED : SyncOutcome.NOTHING_DONE;<NEW_LINE>} else {<NEW_LINE>if (parentSyncAdvise.isFailIfNotExists()) {<NEW_LINE>throw MissingResourceException.builder().resourceName("location").resourceIdentifier(locationUpsertItem.getLocationIdentifier()).parentResource(locationUpsertItem).detail(TranslatableStrings.constant("Type of locationlocationIdentifier=" + locationIdentifier.getType())).build().setParameter("effectiveSyncAdvise", parentSyncAdvise);<NEW_LINE>} else if (METASFRESH_ID.equals(locationIdentifier.getType())) {<NEW_LINE>throw MissingResourceException.builder().resourceName("location").resourceIdentifier(locationUpsertItem.getLocationIdentifier()).parentResource(locationUpsertItem).detail(TranslatableStrings.constant("Type of locationlocationIdentifier=" + locationIdentifier.getType() + "; with this identifier-type, only updates are allowed.")).build().setParameter("effectiveSyncAdvise", parentSyncAdvise);<NEW_LINE>}<NEW_LINE>location = shortTermIndex.newLocation(locationIdentifier);<NEW_LINE>syncOutcome = SyncOutcome.CREATED;<NEW_LINE>}<NEW_LINE>location.addHandle(locationUpsertItem.getLocationIdentifier());<NEW_LINE>resultBuilder.syncOutcome(syncOutcome);<NEW_LINE>if (!Objects.equals(SyncOutcome.NOTHING_DONE, syncOutcome)) {<NEW_LINE>syncJsonToLocation(locationUpsertItem.getLocation(), location);<NEW_LINE>}<NEW_LINE>return resultBuilder;<NEW_LINE>}
existingLocation = shortTermIndex.extractAndMarkUsed(locationIdentifier);
629,238
public TcpOption newInstance(byte[] rawData, int offset, int length, Class<? extends TcpOption> dataClass) {<NEW_LINE>if (rawData == null || dataClass == null) {<NEW_LINE>StringBuilder sb = new StringBuilder(40);<NEW_LINE>sb.append("rawData: ").append(rawData).append(" dataClass: ").append(dataClass);<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method newInstance = dataClass.getMethod("newInstance", byte[].class, int.class, int.class);<NEW_LINE>return (TcpOption) newInstance.invoke(null, rawData, offset, length);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getTargetException() instanceof IllegalRawDataException) {<NEW_LINE>return IllegalTcpOption.newInstance(rawData, offset, length);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(e);<NEW_LINE>}<NEW_LINE>}
NullPointerException(sb.toString());
993,311
/* helper for printInstanceList. prints a single feature within an instance */<NEW_LINE>private static void printFeature(Object o, int fvi, double featureValue, String formatString) {<NEW_LINE>// print object n,w,c,e<NEW_LINE>char c1 = formatString.charAt(2);<NEW_LINE>if (c1 == 'w') {<NEW_LINE>// word<NEW_LINE>System.out.print(" " + o);<NEW_LINE>} else if (c1 == 'n') {<NEW_LINE>// index of word<NEW_LINE>System.out.print(" " + fvi);<NEW_LINE>} else if (c1 == 'c') {<NEW_LINE>// word and index<NEW_LINE>System.out.print(" " + o + ":" + fvi);<NEW_LINE>} else if (c1 == 'e') {<NEW_LINE>// no word identity<NEW_LINE>}<NEW_LINE>char <MASK><NEW_LINE>if (c2 == 'i') {<NEW_LINE>// integer count<NEW_LINE>System.out.print(" " + ((int) (featureValue + .5)));<NEW_LINE>} else if (c2 == 'b') {<NEW_LINE>// boolean present/not present<NEW_LINE>System.out.print(" " + ((featureValue > 0.5) ? "1" : "0"));<NEW_LINE>}<NEW_LINE>}
c2 = formatString.charAt(1);
1,348,696
public static DescribeDataAssetsResponse unmarshall(DescribeDataAssetsResponse describeDataAssetsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDataAssetsResponse.setRequestId(_ctx.stringValue("DescribeDataAssetsResponse.RequestId"));<NEW_LINE>describeDataAssetsResponse.setPageSize(_ctx.integerValue("DescribeDataAssetsResponse.PageSize"));<NEW_LINE>describeDataAssetsResponse.setCurrentPage(_ctx.integerValue("DescribeDataAssetsResponse.CurrentPage"));<NEW_LINE>describeDataAssetsResponse.setTotalCount(_ctx.integerValue("DescribeDataAssetsResponse.TotalCount"));<NEW_LINE>List<Asset> items = new ArrayList<Asset>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDataAssetsResponse.Items.Length"); i++) {<NEW_LINE>Asset asset = new Asset();<NEW_LINE>asset.setId(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].Id"));<NEW_LINE>asset.setName(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].Name"));<NEW_LINE>asset.setOwner(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].Owner"));<NEW_LINE>asset.setCreationTime(_ctx.longValue("DescribeDataAssetsResponse.Items[" + i + "].CreationTime"));<NEW_LINE>asset.setProductId(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].ProductId"));<NEW_LINE>asset.setProductCode(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].ProductCode"));<NEW_LINE>asset.setProtection(_ctx.booleanValue("DescribeDataAssetsResponse.Items[" + i + "].Protection"));<NEW_LINE>asset.setLabelsec(_ctx.booleanValue("DescribeDataAssetsResponse.Items[" + i + "].Labelsec"));<NEW_LINE>asset.setOdpsRiskLevelName(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].OdpsRiskLevelName"));<NEW_LINE>asset.setSensitive(_ctx.booleanValue("DescribeDataAssetsResponse.Items[" + i + "].Sensitive"));<NEW_LINE>asset.setRiskLevelId(_ctx.longValue("DescribeDataAssetsResponse.Items[" + i + "].RiskLevelId"));<NEW_LINE>asset.setRiskLevelName(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].RiskLevelName"));<NEW_LINE>asset.setRuleName(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].RuleName"));<NEW_LINE>asset.setDepartName(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].DepartName"));<NEW_LINE>asset.setTotalCount(_ctx.integerValue<MASK><NEW_LINE>asset.setSensitiveCount(_ctx.integerValue("DescribeDataAssetsResponse.Items[" + i + "].SensitiveCount"));<NEW_LINE>asset.setAcl(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].Acl"));<NEW_LINE>asset.setSensitiveRatio(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].SensitiveRatio"));<NEW_LINE>asset.setDataType(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].DataType"));<NEW_LINE>asset.setObjectKey(_ctx.stringValue("DescribeDataAssetsResponse.Items[" + i + "].ObjectKey"));<NEW_LINE>items.add(asset);<NEW_LINE>}<NEW_LINE>describeDataAssetsResponse.setItems(items);<NEW_LINE>return describeDataAssetsResponse;<NEW_LINE>}
("DescribeDataAssetsResponse.Items[" + i + "].TotalCount"));
660,114
private void handleNonNormalizedNumberError(@NonNull String originalNumber, @NonNull String normalizedNumber, @NonNull Mode mode) {<NEW_LINE>try {<NEW_LINE>Phonenumber.PhoneNumber phoneNumber = PhoneNumberUtil.getInstance().parse(normalizedNumber, null);<NEW_LINE>new MaterialAlertDialogBuilder(requireContext()).setTitle(R.string.RegistrationActivity_non_standard_number_format).setMessage(getString(R.string.RegistrationActivity_the_number_you_entered_appears_to_be_a_non_standard, originalNumber, normalizedNumber)).setNegativeButton(android.R.string.no, (d, i) -> d.dismiss()).setNeutralButton(R.string.RegistrationActivity_contact_signal_support, (d, i) -> {<NEW_LINE>String subject = getString(R.string.RegistrationActivity_signal_android_phone_number_format);<NEW_LINE>String body = SupportEmailUtil.generateSupportEmailBody(requireContext(), R.string.RegistrationActivity_signal_android_phone_number_format, null, null);<NEW_LINE>CommunicationActions.openEmail(requireContext(), SupportEmailUtil.getSupportEmailAddress(requireContext()), subject, body);<NEW_LINE>d.dismiss();<NEW_LINE>}).setPositiveButton(R.string.yes, (d, i) -> {<NEW_LINE>countryCode.setText(String.valueOf(phoneNumber.getCountryCode()));<NEW_LINE>number.setText(String.valueOf<MASK><NEW_LINE>requestVerificationCode(mode);<NEW_LINE>d.dismiss();<NEW_LINE>}).show();<NEW_LINE>} catch (NumberParseException e) {<NEW_LINE>Log.w(TAG, "Failed to parse number!", e);<NEW_LINE>Dialogs.showAlertDialog(requireContext(), getString(R.string.RegistrationActivity_invalid_number), String.format(getString(R.string.RegistrationActivity_the_number_you_specified_s_is_invalid), viewModel.getNumber().getFullFormattedNumber()));<NEW_LINE>}<NEW_LINE>}
(phoneNumber.getNationalNumber()));
1,775,566
public void restoreMessage(SIMPMessage msgItem, boolean commit) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "restoreMessage", new Object[] { msgItem });<NEW_LINE>int priority = msgItem.getPriority();<NEW_LINE>Reliability reliability = msgItem.getReliability();<NEW_LINE>SIBUuid12 streamID = msgItem.getGuaranteedStreamUuid();<NEW_LINE>StreamSet streamSet = getStreamSet(streamID);<NEW_LINE>SourceStream sourceStream = null;<NEW_LINE>synchronized (streamSet) {<NEW_LINE>sourceStream = (SourceStream) streamSet.getStream(priority, reliability);<NEW_LINE>if (sourceStream == null && reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) > 0) {<NEW_LINE>sourceStream = createStream(streamSet, priority, reliability, streamSet.getPersistentData<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOTE: sourceStream should only be null for express qos<NEW_LINE>if (sourceStream != null) {<NEW_LINE>if (!commit)<NEW_LINE>sourceStream.restoreUncommitted(msgItem);<NEW_LINE>else<NEW_LINE>sourceStream.restoreValue(msgItem);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "restoreMessage");<NEW_LINE>}
(priority, reliability), true);
994,415
void sendHeartbeatSync(Node node) {<NEW_LINE>HeartbeatHandler heartbeatHandler = new HeartbeatHandler(localMember, node);<NEW_LINE>HeartBeatRequest req = new HeartBeatRequest();<NEW_LINE>req.setCommitLogTerm(request.commitLogTerm);<NEW_LINE>req.setCommitLogIndex(request.commitLogIndex);<NEW_LINE>req.setRegenerateIdentifier(request.regenerateIdentifier);<NEW_LINE>req.setRequireIdentifier(request.requireIdentifier);<NEW_LINE>req.setTerm(request.term);<NEW_LINE>req.setLeader(localMember.getThisNode());<NEW_LINE>if (request.isSetHeader()) {<NEW_LINE>req.setHeader(request.header);<NEW_LINE>}<NEW_LINE>if (request.isSetPartitionTableBytes()) {<NEW_LINE>req.partitionTableBytes = request.partitionTableBytes;<NEW_LINE>req.setPartitionTableBytesIsSet(true);<NEW_LINE>}<NEW_LINE>localMember.getSerialToParallelPool().submit(() -> {<NEW_LINE>Client client = localMember.getSyncHeartbeatClient(node);<NEW_LINE>if (client != null) {<NEW_LINE>try {<NEW_LINE>logger.debug("{}: Sending heartbeat to {}", memberName, node);<NEW_LINE>HeartBeatResponse heartBeatResponse = client.sendHeartbeat(req);<NEW_LINE>heartbeatHandler.onComplete(heartBeatResponse);<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>if (ClusterIoTDB.getInstance().shouldPrintClientConnectionErrorStack()) {<NEW_LINE>logger.warn(<MASK><NEW_LINE>} else {<NEW_LINE>logger.warn("{}: Cannot send heartbeat to node {} due to network", memberName, node);<NEW_LINE>}<NEW_LINE>client.getInputProtocol().getTransport().close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn(memberName + ": Cannot send heart beat to node " + node.toString(), e);<NEW_LINE>} finally {<NEW_LINE>localMember.returnSyncClient(client);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"{}: Cannot send heartbeat to node {} due to network", memberName, node, e);
337,804
public boolean onPreDraw() {<NEW_LINE>// rotation fix, if not set, originalTitleY = Na<NEW_LINE><MASK><NEW_LINE>ViewCompat.setTranslationX(mLogo, 0);<NEW_LINE>originalTitleY = ViewCompat.getY(mLogo);<NEW_LINE>originalTitleX = ViewCompat.getX(mLogo);<NEW_LINE>originalTitleHeight = mLogo.getHeight();<NEW_LINE>finalTitleHeight = dpToPx(21, context);<NEW_LINE>// the final scale of the logo<NEW_LINE>finalScale = finalTitleHeight / originalTitleHeight;<NEW_LINE>finalTitleY = (toolbar.getPaddingTop() + toolbar.getHeight()) / 2 - finalTitleHeight / 2 - (1 - finalScale) * finalTitleHeight;<NEW_LINE>// (mLogo.getWidth()/2) *(1-finalScale) is the margin left added by the scale() on the logo<NEW_LINE>// when logo scaledown, the content stay in center, so we have to anually remove the left padding<NEW_LINE>finalTitleX = dpToPx(52f, context) - (mLogo.getWidth() / 2) * (1 - finalScale);<NEW_LINE>toolbarLayout.getViewTreeObserver().removeOnPreDrawListener(this);<NEW_LINE>return false;<NEW_LINE>}
ViewCompat.setTranslationY(mLogo, 0);
962,399
static void deleteSourceIndexAndTransferAliases(Client client, IndexMetadata sourceIndex, String targetIndex, ActionListener<Void> listener) {<NEW_LINE>String sourceIndexName = sourceIndex.getIndex().getName();<NEW_LINE>IndicesAliasesRequest aliasesRequest = new IndicesAliasesRequest().masterNodeTimeout(TimeValue.MAX_VALUE).addAliasAction(IndicesAliasesRequest.AliasActions.removeIndex().index(sourceIndexName)).addAliasAction(IndicesAliasesRequest.AliasActions.add().index(targetIndex).alias(sourceIndexName));<NEW_LINE>// copy over other aliases from source index<NEW_LINE>sourceIndex.getAliases().values().forEach(aliasMetaDataToAdd -> {<NEW_LINE>// inherit all alias properties except `is_write_index`<NEW_LINE>aliasesRequest.addAliasAction(IndicesAliasesRequest.AliasActions.add().index(targetIndex).alias(aliasMetaDataToAdd.alias()).indexRouting(aliasMetaDataToAdd.indexRouting()).searchRouting(aliasMetaDataToAdd.searchRouting()).filter(aliasMetaDataToAdd.filter() == null ? null : aliasMetaDataToAdd.filter().string(<MASK><NEW_LINE>});<NEW_LINE>client.admin().indices().aliases(aliasesRequest, ActionListener.wrap(response -> {<NEW_LINE>if (response.isAcknowledged() == false) {<NEW_LINE>logger.warn("aliases swap from [{}] to [{}] response was not acknowledged", sourceIndexName, targetIndex);<NEW_LINE>}<NEW_LINE>listener.onResponse(null);<NEW_LINE>}, listener::onFailure));<NEW_LINE>}
)).writeIndex(null));
8,802
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>checkTableClass_result result = new checkTableClass_result();<NEW_LINE>if (e instanceof ThriftSecurityException) {<NEW_LINE>result.sec = (ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof ThriftTableOperationException) {<NEW_LINE>result.tope = (ThriftTableOperationException) e;<NEW_LINE>result.setTopeIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
_LOGGER.error("Exception inside handler", e);
489,796
private void startFloorFetch() throws IndexOutOfBoundsException {<NEW_LINE>BuildingModel building = mAnyplaceCache.getSelectedBuilding();<NEW_LINE>if (building != null) {<NEW_LINE>spinnerBuildings.setEnabled(false);<NEW_LINE>building.loadFloors(this, new FetchFloorsByBuidTask.FetchFloorsByBuidTaskListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@Nullable String result, @Nullable List<? extends FloorModel> floors) {<NEW_LINE>finishJob((List<FloorModel>) floors);<NEW_LINE>onFloorsLoaded(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorOrCancel(String result) {<NEW_LINE>finishJob(new ArrayList<FloorModel>());<NEW_LINE>Toast.makeText(getBaseContext(), result, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE><NEW_LINE>private void finishJob(List<FloorModel> floors) {<NEW_LINE>// UPDATE SPINNER FOR FLOORS<NEW_LINE>setFloorSpinner(floors);<NEW_LINE>spinnerBuildings.setEnabled(true);<NEW_LINE>isFloorsJobRunning = false;<NEW_LINE>}<NEW_LINE>}, true, true);<NEW_LINE>}<NEW_LINE>}
(List<FloorModel>) floors);
1,713,994
final UpdateApiResult executeUpdateApi(UpdateApiRequest updateApiRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateApiRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateApiRequest> request = null;<NEW_LINE>Response<UpdateApiResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateApiRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateApi");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateApiResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateApiResultJsonUnmarshaller());<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);
513,739
public static void bindEventFields(BoundStatement bound, IDeviceEvent event) throws SiteWhereException {<NEW_LINE>bound.setUUID(<MASK><NEW_LINE>bound.setUUID(FIELD_EVENT_ID, event.getId());<NEW_LINE>if (event.getAlternateId() != null) {<NEW_LINE>bound.setString(FIELD_ALTERNATE_ID, event.getAlternateId());<NEW_LINE>}<NEW_LINE>bound.setByte(FIELD_EVENT_TYPE, getIndicatorForEventType(event.getEventType()));<NEW_LINE>bound.setUUID(FIELD_ASSIGNMENT_ID, event.getDeviceAssignmentId());<NEW_LINE>if (event.getCustomerId() != null) {<NEW_LINE>bound.setUUID(FIELD_CUSTOMER_ID, event.getCustomerId());<NEW_LINE>}<NEW_LINE>if (event.getAreaId() != null) {<NEW_LINE>bound.setUUID(FIELD_AREA_ID, event.getAreaId());<NEW_LINE>}<NEW_LINE>if (event.getAssetId() != null) {<NEW_LINE>bound.setUUID(FIELD_ASSET_ID, event.getAssetId());<NEW_LINE>}<NEW_LINE>bound.setTimestamp(FIELD_EVENT_DATE, event.getEventDate());<NEW_LINE>bound.setTimestamp(FIELD_RECEIVED_DATE, event.getReceivedDate());<NEW_LINE>}
FIELD_DEVICE_ID, event.getDeviceId());
1,014,473
private Result queryDbRecord(@NonNull final HUTraceEventQuery huTraceEventQuery, @NonNull final EmptyResultSupplier emptyResultSupplier) {<NEW_LINE>final Result resultOut = emptyResultSupplier.newEmptyResult();<NEW_LINE>final IQueryBuilder<I_M_HU_Trace> queryBuilder = createQueryBuilderOrNull(huTraceEventQuery);<NEW_LINE>if (queryBuilder == null) {<NEW_LINE>return resultOut;<NEW_LINE>}<NEW_LINE>final Result noRecursiveResult = emptyResultSupplier.newEmptyResult();<NEW_LINE>final IQuery<I_M_HU_Trace> query = queryBuilder.orderBy().addColumn(I_M_HU_Trace.COLUMN_EventTime).endOrderBy().create();<NEW_LINE>noRecursiveResult.executeQueryAndAddAll(query);<NEW_LINE>// no matter which recursion mode, we can always add the records we already have<NEW_LINE>resultOut.addAll(noRecursiveResult);<NEW_LINE>switch(huTraceEventQuery.getRecursionMode()) {<NEW_LINE>case NONE:<NEW_LINE>break;<NEW_LINE>case FORWARD:<NEW_LINE>resultOut.addAll(recurseForwards(noRecursiveResult));<NEW_LINE>break;<NEW_LINE>case BACKWARD:<NEW_LINE>// recurse and add the records whose M_HU_IDs show up as M_HU_Source_IDs in the records we already loaded<NEW_LINE>resultOut.addAll(recurseBackwards(noRecursiveResult));<NEW_LINE>break;<NEW_LINE>case BOTH:<NEW_LINE>resultOut<MASK><NEW_LINE>resultOut.addAll(recurseBackwards(noRecursiveResult));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AdempiereException("Unexpected RecursionMode=" + huTraceEventQuery.getRecursionMode()).appendParametersToMessage().setParameter("HUTraceEventQuery", huTraceEventQuery);<NEW_LINE>}<NEW_LINE>return resultOut;<NEW_LINE>}
.addAll(recurseForwards(noRecursiveResult));
1,545,719
private List<ElementFilter> createTypeFilter(final EnclosingClass enclosingClass) {<NEW_LINE>List<ElementFilter> superTypeIndices = new ArrayList<>();<NEW_LINE>Expression superClass = enclosingClass.getSuperClass();<NEW_LINE>if (superClass != null) {<NEW_LINE>String superClsName = enclosingClass.extractUnqualifiedSuperClassName();<NEW_LINE>superTypeIndices.add(ElementFilter.forSuperClassName(<MASK><NEW_LINE>}<NEW_LINE>List<Expression> interfaces = enclosingClass.getInterfaces();<NEW_LINE>Set<QualifiedName> superIfaceNames = new HashSet<>();<NEW_LINE>for (Expression identifier : interfaces) {<NEW_LINE>String ifaceName = CodeUtils.extractUnqualifiedName(identifier);<NEW_LINE>if (ifaceName != null) {<NEW_LINE>superIfaceNames.add(QualifiedName.create(ifaceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!superIfaceNames.isEmpty()) {<NEW_LINE>superTypeIndices.add(ElementFilter.forSuperInterfaceNames(superIfaceNames));<NEW_LINE>}<NEW_LINE>return superTypeIndices;<NEW_LINE>}
QualifiedName.create(superClsName)));
464,876
public JanusGraphElement retrieve(Object elementId, JanusGraphTransaction tx) {<NEW_LINE>Preconditions.checkArgument(elementId != null, "Must provide elementId");<NEW_LINE>switch(this) {<NEW_LINE>case VERTEX:<NEW_LINE>Preconditions.checkArgument(elementId instanceof Long, "elementId [%s] must be of type Long", elementId);<NEW_LINE>return tx<MASK><NEW_LINE>case EDGE:<NEW_LINE>Preconditions.checkArgument(elementId instanceof RelationIdentifier, "elementId [%s] must be of type RelationIdentifier", elementId);<NEW_LINE>return RelationIdentifierUtils.findEdge(((RelationIdentifier) elementId), tx);<NEW_LINE>case PROPERTY:<NEW_LINE>Preconditions.checkArgument(elementId instanceof RelationIdentifier, "elementId [%s] must be of type RelationIdentifier", elementId);<NEW_LINE>return RelationIdentifierUtils.findProperty(((RelationIdentifier) elementId), tx);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}
.getVertex((Long) elementId);
1,351,788
private void start(ServerRequest req, ServerResponse res) {<NEW_LINE>long timeLimit = req.queryParams().first(TIME_LIMIT_PARAM_NAME).map(Long::valueOf).orElse(0L);<NEW_LINE>String parentLRA = req.queryParams().first(PARENT_LRA_PARAM_NAME).orElse("");<NEW_LINE>String lraUUID = UUID<MASK><NEW_LINE>URI lraId = coordinatorUriWithPath(lraUUID);<NEW_LINE>if (!parentLRA.isEmpty()) {<NEW_LINE>Lra parent = lraPersistentRegistry.get(parentLRA.replace(coordinatorURL.get().toASCIIString() + "/", ""));<NEW_LINE>if (parent != null) {<NEW_LINE>Lra childLra = new Lra(this, lraUUID, URI.create(parentLRA), this.config);<NEW_LINE>childLra.setupTimeout(timeLimit);<NEW_LINE>lraPersistentRegistry.put(lraUUID, childLra);<NEW_LINE>parent.addChild(childLra);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Lra newLra = new Lra(this, lraUUID, config);<NEW_LINE>newLra.setupTimeout(timeLimit);<NEW_LINE>lraPersistentRegistry.put(lraUUID, newLra);<NEW_LINE>}<NEW_LINE>res.headers().add(LRA_HTTP_CONTEXT_HEADER, lraId.toASCIIString());<NEW_LINE>res.status(201).send(lraId.toString());<NEW_LINE>}
.randomUUID().toString();
848,289
protected ConsoleReporter createInstance() {<NEW_LINE>final ConsoleReporter.Builder reporter = ConsoleReporter.forRegistry(getMetricRegistry());<NEW_LINE>if (hasProperty(DURATION_UNIT)) {<NEW_LINE>reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(RATE_UNIT)) {<NEW_LINE>reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>reporter.filter(getMetricFilter());<NEW_LINE>if (hasProperty(CLOCK_REF)) {<NEW_LINE>reporter.withClock(getPropertyRef<MASK><NEW_LINE>}<NEW_LINE>if (hasProperty(OUTPUT_REF)) {<NEW_LINE>reporter.outputTo(getPropertyRef(OUTPUT_REF, PrintStream.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(LOCALE)) {<NEW_LINE>reporter.formattedFor(parseLocale(getProperty(LOCALE)));<NEW_LINE>}<NEW_LINE>if (hasProperty(TIMEZONE)) {<NEW_LINE>reporter.formattedFor(TimeZone.getTimeZone(getProperty(TIMEZONE)));<NEW_LINE>}<NEW_LINE>return reporter.build();<NEW_LINE>}
(CLOCK_REF, Clock.class));
588,389
public boolean visit(MySqlDeclareHandlerStatement x) {<NEW_LINE>String handleType = x.getHandleType().name();<NEW_LINE>print0(ucase ? "DECLARE " : "declare ");<NEW_LINE>print0(ucase ? handleType : handleType.toLowerCase());<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < x.getConditionValues().size(); i++) {<NEW_LINE>ConditionValue cv = x.getConditionValues().get(i);<NEW_LINE>if (cv.getType() == ConditionType.SQLSTATE) {<NEW_LINE>print0(ucase ? " SQLSTATE " : " sqlstate ");<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.MYSQL_ERROR_CODE) {<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.SELF) {<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.SYSTEM) {<NEW_LINE>print0(ucase ? cv.getValue().toUpperCase() : cv.getValue().toLowerCase());<NEW_LINE>}<NEW_LINE>if (i != x.getConditionValues().size() - 1) {<NEW_LINE>print0(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.indentCount++;<NEW_LINE>println();<NEW_LINE>x.getSpStatement().accept(this);<NEW_LINE>this.indentCount--;<NEW_LINE>return false;<NEW_LINE>}
print0(ucase ? " HANDLER FOR " : " handler for ");
1,692,362
protected Object doInBackground() throws Exception {<NEW_LINE>downloadTaskRunning = true;<NEW_LINE>AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder);<NEW_LINE>FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create();<NEW_LINE>CustomSettings settings = new CustomSettings();<NEW_LINE>Downloader downloader = new LegacyDownloader(fop, settings);<NEW_LINE>RepoManager <MASK><NEW_LINE>mRepoManager.loadSynchronously(0, progress, downloader, settings);<NEW_LINE>List<RemotePackage> remotes = new ArrayList<>();<NEW_LINE>for (String path : settings.getPaths(mRepoManager)) {<NEW_LINE>RemotePackage p = mRepoManager.getPackages().getRemotePackages().get(path);<NEW_LINE>if (p == null) {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_finding_package", path));<NEW_LINE>progress.logWarning("Failed to find package " + path);<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>remotes.add(p);<NEW_LINE>}<NEW_LINE>remotes = InstallerUtil.computeRequiredPackages(remotes, mRepoManager.getPackages(), progress);<NEW_LINE>if (remotes != null) {<NEW_LINE>for (RemotePackage p : remotes) {<NEW_LINE>Installer installer = SdkInstallerUtil.findBestInstallerFactory(p, mHandler).createInstaller(p, mRepoManager, downloader, mHandler.getFileOp());<NEW_LINE>if (!(installer.prepare(progress) && installer.complete(progress))) {<NEW_LINE>// there was an error, abort.<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list"));<NEW_LINE>progress.logWarning("Unable to compute a complete list of dependencies.");<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
mRepoManager = mHandler.getSdkManager(progress);
373,450
private boolean checkSquasher(FunctionDefinition squasher, Definition definition, Sort sort) {<NEW_LINE>if (squasher == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ParametersLevel parametersLevel = UseTypechecking.typecheckLevel(null, squasher, definition, errorReporter);<NEW_LINE>if (parametersLevel == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (parametersLevel.parameters != null) {<NEW_LINE>errorReporter.report(new TypecheckingError("\\use \\level " + squasher.getName<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Level hLevel = new Level(parametersLevel.level);<NEW_LINE>if (!Level.compare(hLevel, sort.getHLevel(), CMP.LE, DummyEquations.getInstance(), null)) {<NEW_LINE>errorReporter.report(new TypecheckingError("The h-level " + sort.getHLevel() + " of '" + definition.getName() + "' does not fit into the h-level " + hLevel + " of \\use \\level " + squasher.getName(), null));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
() + " applies only to specific parameters", null));
1,218,601
final DescribeEndpointsResult executeDescribeEndpoints(DescribeEndpointsRequest describeEndpointsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEndpointsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEndpointsRequest> request = null;<NEW_LINE>Response<DescribeEndpointsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEndpointsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointsRequest));<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, "MediaConvert");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEndpoints");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEndpointsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointsResultJsonUnmarshaller());<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>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,278,751
// Create a bucket by using a S3Waiter object<NEW_LINE>public static void createBucket(S3Client s3Client, String bucketName, Region region) {<NEW_LINE>S3Waiter s3Waiter = s3Client.waiter();<NEW_LINE>try {<NEW_LINE>CreateBucketRequest bucketRequest = CreateBucketRequest.builder().bucket(bucketName).createBucketConfiguration(CreateBucketConfiguration.builder().locationConstraint(region.id()).build()).build();<NEW_LINE>s3Client.createBucket(bucketRequest);<NEW_LINE>HeadBucketRequest bucketRequestWait = HeadBucketRequest.builder().<MASK><NEW_LINE>// Wait until the bucket is created and print out the response<NEW_LINE>WaiterResponse<HeadBucketResponse> waiterResponse = s3Waiter.waitUntilBucketExists(bucketRequestWait);<NEW_LINE>waiterResponse.matched().response().ifPresent(System.out::println);<NEW_LINE>System.out.println(bucketName + " is ready");<NEW_LINE>} catch (S3Exception e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
bucket(bucketName).build();
954,167
public View render(RenderedAdaptiveCard renderedCard, Context context, FragmentManager fragmentManager, ViewGroup viewGroup, BaseCardElement baseCardElement, ICardActionHandler cardActionHandler, HostConfig hostConfig, RenderArgs renderArgs) throws Exception {<NEW_LINE>TextBlock textBlock = Util.castTo(baseCardElement, TextBlock.class);<NEW_LINE>if (textBlock.GetText().isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TextView textView = new TextView(context);<NEW_LINE>textView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>textView.setTag(new TagContent(textBlock));<NEW_LINE>DateTimeParser parser = new DateTimeParser(textBlock.GetLanguage());<NEW_LINE>String textWithFormattedDates = parser.GenerateString(textBlock.GetTextForDateParsing());<NEW_LINE>CharSequence text = RendererUtil.handleSpecialText(textWithFormattedDates);<NEW_LINE>textView.setText(text);<NEW_LINE>if (!textBlock.GetWrap()) {<NEW_LINE>textView.setMaxLines(1);<NEW_LINE>}<NEW_LINE>textView.setEllipsize(TextUtils.TruncateAt.END);<NEW_LINE>textView.setOnTouchListener(new TouchTextView(new SpannableString(text)));<NEW_LINE>textView.setHorizontallyScrolling(false);<NEW_LINE>applyTextFormat(textView, hostConfig, textBlock.GetStyle(), textBlock.GetFontType(), textBlock.GetTextWeight(), renderArgs);<NEW_LINE>applyTextSize(textView, hostConfig, textBlock.GetStyle(), textBlock.GetFontType(), textBlock.GetTextSize(), renderArgs);<NEW_LINE>applyTextColor(textView, hostConfig, textBlock.GetStyle(), textBlock.GetTextColor(), textBlock.GetIsSubtle(), renderArgs.getContainerStyle(), renderArgs);<NEW_LINE>applyHorizontalAlignment(textView, textBlock.GetHorizontalAlignment(), renderArgs);<NEW_LINE>applyAccessibilityHeading(<MASK><NEW_LINE>int maxLines = (int) textBlock.GetMaxLines();<NEW_LINE>if (maxLines > 0 && textBlock.GetWrap()) {<NEW_LINE>textView.setMaxLines(maxLines);<NEW_LINE>} else if (!textBlock.GetWrap()) {<NEW_LINE>textView.setMaxLines(1);<NEW_LINE>}<NEW_LINE>textView.setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>viewGroup.addView(textView);<NEW_LINE>return textView;<NEW_LINE>}
textView, textBlock.GetStyle());
1,239,213
public Long duration(Date start, Date current, UnitStub unitStub) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Task.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Date> cq = cb.createQuery(Date.class);<NEW_LINE>Root<Task> root = cq.from(Task.class);<NEW_LINE>Predicate p = cb.greaterThan(root.get(Task_.startTime), start);<NEW_LINE>p = cb.and(p, cb.equal(root.get(Task_.unit), unitStub.getValue()));<NEW_LINE>cq.select(root.get(Task_.startTime)).where(p);<NEW_LINE>List<Date> os = em.createQuery(cq).getResultList();<NEW_LINE>long duration = 0;<NEW_LINE>for (Date o : os) {<NEW_LINE>duration += current.getTime() - o.getTime();<NEW_LINE>}<NEW_LINE>duration <MASK><NEW_LINE>return duration;<NEW_LINE>}
= duration / (1000L * 60L);
1,212,662
private List<DataCheckEntity> computeAlertForRule(String domain, String type, String name, String monitor, List<Config> configs) {<NEW_LINE>List<DataCheckEntity> results = new ArrayList<DataCheckEntity>();<NEW_LINE>Pair<Integer, List<Condition>> conditionPair = m_ruleConfigManager.convertConditions(configs);<NEW_LINE>int minute = calAlreadyMinute();<NEW_LINE>Map<String, String> pars = new HashMap<String, String>();<NEW_LINE>pars.put("type", type);<NEW_LINE>pars.put("name", name);<NEW_LINE>if (conditionPair != null) {<NEW_LINE>int maxMinute = conditionPair.getKey();<NEW_LINE>List<Condition<MASK><NEW_LINE>if (StringUtils.isEmpty(name)) {<NEW_LINE>name = Constants.ALL;<NEW_LINE>}<NEW_LINE>if (minute >= maxMinute - 1) {<NEW_LINE>int start = minute + 1 - maxMinute;<NEW_LINE>int end = minute;<NEW_LINE>pars.put(MIN, String.valueOf(start));<NEW_LINE>pars.put(MAX, String.valueOf(end));<NEW_LINE>EventReport report = fetchEventReport(domain, ModelPeriod.CURRENT, pars);<NEW_LINE>if (report != null) {<NEW_LINE>double[] data = buildArrayData(start, end, type, name, monitor, report);<NEW_LINE>results.addAll(m_dataChecker.checkData(data, conditions));<NEW_LINE>}<NEW_LINE>} else if (minute < 0) {<NEW_LINE>int start = 60 + minute + 1 - (maxMinute);<NEW_LINE>int end = 60 + minute;<NEW_LINE>pars.put(MIN, String.valueOf(start));<NEW_LINE>pars.put(MAX, String.valueOf(end));<NEW_LINE>EventReport report = fetchEventReport(domain, ModelPeriod.LAST, pars);<NEW_LINE>if (report != null) {<NEW_LINE>double[] data = buildArrayData(start, end, type, name, monitor, report);<NEW_LINE>results.addAll(m_dataChecker.checkData(data, conditions));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int currentStart = 0, currentEnd = minute;<NEW_LINE>int lastStart = 60 + 1 - (maxMinute - minute);<NEW_LINE>int lastEnd = 59;<NEW_LINE>pars.put(MIN, String.valueOf(currentStart));<NEW_LINE>pars.put(MAX, String.valueOf(currentEnd));<NEW_LINE>EventReport currentReport = fetchEventReport(domain, ModelPeriod.CURRENT, pars);<NEW_LINE>pars.put(MIN, String.valueOf(lastStart));<NEW_LINE>pars.put(MAX, String.valueOf(lastEnd));<NEW_LINE>EventReport lastReport = fetchEventReport(domain, ModelPeriod.LAST, pars);<NEW_LINE>if (currentReport != null && lastReport != null) {<NEW_LINE>double[] currentValue = buildArrayData(currentStart, currentEnd, type, name, monitor, currentReport);<NEW_LINE>double[] lastValue = buildArrayData(lastStart, lastEnd, type, name, monitor, lastReport);<NEW_LINE>double[] data = mergerArray(lastValue, currentValue);<NEW_LINE>results.addAll(m_dataChecker.checkData(data, conditions));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
> conditions = conditionPair.getValue();
1,244,230
public Process restrictProcess(String application, String flag) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Process.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Process> cq = <MASK><NEW_LINE>Root<Process> root = cq.from(Process.class);<NEW_LINE>Predicate p = cb.equal(root.get(Process_.application), application);<NEW_LINE>p = cb.and(p, cb.or(cb.equal(root.get(Process_.id), flag), cb.equal(root.get(Process_.name), flag), cb.equal(root.get(Process_.alias), flag)));<NEW_LINE>cq.select(root).where(p).orderBy(cb.desc(root.get(Process_.editionNumber)));<NEW_LINE>List<Process> list = em.createQuery(cq).getResultList();<NEW_LINE>if (list != null && !list.isEmpty()) {<NEW_LINE>return list.get(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
cb.createQuery(Process.class);
288,125
private static boolean addJREPath(final File dir) {<NEW_LINE>if (dir != null && !dir.getPath().isEmpty() && FileUtils.canReadAndIsDir(dir)) {<NEW_LINE>final File[] dirFiles = dir.listFiles();<NEW_LINE>if (dirFiles != null) {<NEW_LINE>for (final File file : dirFiles) {<NEW_LINE>final <MASK><NEW_LINE>if (filePath.endsWith(".jar")) {<NEW_LINE>final String jarPathResolved = FastPathResolver.resolve(FileUtils.currDirPath(), filePath);<NEW_LINE>if (jarPathResolved.endsWith("/rt.jar")) {<NEW_LINE>RT_JARS.add(jarPathResolved);<NEW_LINE>} else {<NEW_LINE>JRE_LIB_OR_EXT_JARS.add(jarPathResolved);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final File canonicalFile = file.getCanonicalFile();<NEW_LINE>final String canonicalFilePath = canonicalFile.getPath();<NEW_LINE>if (!canonicalFilePath.equals(filePath)) {<NEW_LINE>final String canonicalJarPathResolved = FastPathResolver.resolve(FileUtils.currDirPath(), filePath);<NEW_LINE>JRE_LIB_OR_EXT_JARS.add(canonicalJarPathResolved);<NEW_LINE>}<NEW_LINE>} catch (IOException | SecurityException e) {<NEW_LINE>// Ignored<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
String filePath = file.getPath();
1,736,257
private static void trySelectWhereJoined4CoercionBack(RegressionEnvironment env, AtomicInteger milestone, String stmtText) {<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "A", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "B", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "C", 1, 10, 200, 3000);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -1, 11, 201, 0);<NEW_LINE>sendBean(env, "A", 2, 201, 0, 0);<NEW_LINE>sendBean(env, "B", 2, 0, 0, 201);<NEW_LINE>sendBean(env, "C", 2, 0, 11, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", -1);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -2, 12, 202, 0);<NEW_LINE>sendBean(env, "A", 3, 202, 0, 0);<NEW_LINE>sendBean(env, "B", 3, 0, 0, 202);<NEW_LINE>sendBean(env, "C", 3<MASK><NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -3, 13, 203, 0);<NEW_LINE>sendBean(env, "A", 4, 203, 0, 0);<NEW_LINE>sendBean(env, "B", 4, 0, 0, 203.0001);<NEW_LINE>sendBean(env, "C", 4, 0, 13, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -4, 14, 204, 0);<NEW_LINE>sendBean(env, "A", 5, 205, 0, 0);<NEW_LINE>sendBean(env, "B", 5, 0, 0, 204);<NEW_LINE>sendBean(env, "C", 5, 0, 14, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>env.undeployAll();<NEW_LINE>}
, 0, -1, 0);
64,901
private void onVideoFileSelected(String filepath) {<NEW_LINE>mShortVideoTranscoder = new PLShortVideoTranscoder(this, filepath, Config.TRANSCODE_FILE_PATH);<NEW_LINE>mMediaFile = new PLMediaFile(filepath);<NEW_LINE>int bitrateInKbps = mMediaFile.getVideoBitrate() / 1000;<NEW_LINE>int videoWidthRaw = mMediaFile.getVideoWidth();<NEW_LINE>int videoHeightRaw = mMediaFile.getVideoHeight();<NEW_LINE>int videoRotation = mMediaFile.getVideoRotation();<NEW_LINE>int videoWidthRotated = videoRotation == 0 || videoRotation == 180 ? mMediaFile.getVideoWidth() : mMediaFile.getVideoHeight();<NEW_LINE>int videoHeightRotated = videoRotation == 0 || videoRotation == 180 ? mMediaFile.getVideoHeight() : mMediaFile.getVideoWidth();<NEW_LINE><MASK><NEW_LINE>mVideoFilePathText.setText(new File(filepath).getName());<NEW_LINE>mVideoSizeText.setText(videoWidthRaw + " x " + videoHeightRaw);<NEW_LINE>mVideoRotationText.setText("" + videoRotation);<NEW_LINE>mVideoSizeRotatedText.setText(videoWidthRotated + " x " + videoHeightRotated);<NEW_LINE>mVideoBitrateText.setText(bitrateInKbps + " kbps");<NEW_LINE>mTranscodingWidthEditText.setText(String.valueOf(videoWidthRaw));<NEW_LINE>mTranscodingHeightEditText.setText(String.valueOf(videoHeightRaw));<NEW_LINE>mTranscodingMaxFPSEditText.setText(String.valueOf(videoFrameRate));<NEW_LINE>mTranscodingClipWidthText.setText(String.valueOf(videoWidthRotated));<NEW_LINE>mTranscodingClipHeightText.setText(String.valueOf(videoHeightRotated));<NEW_LINE>mTranscodingBitrateText.setText(String.valueOf(bitrateInKbps));<NEW_LINE>}
int videoFrameRate = mMediaFile.getVideoFrameRate();
1,147,334
public void onBlockPistonRetract(BlockPistonRetractEvent event) {<NEW_LINE>if (event.isSticky()) {<NEW_LINE>EventDebounce.Entry entry = pistonRetractDebounce.getIfNotPresent(new BlockPistonRetractKey(event), event);<NEW_LINE>if (entry != null) {<NEW_LINE>Block piston = event.getBlock();<NEW_LINE>Cause cause = create(piston);<NEW_LINE>BlockFace direction = event.getDirection();<NEW_LINE>ArrayList<Block> blocks = new ArrayList<>(event.getBlocks());<NEW_LINE>int originalSize = blocks.size();<NEW_LINE>Events.fireBulkEventToCancel(event, new BreakBlockEvent(event, cause, event.getBlock().getWorld(), blocks, Material.AIR));<NEW_LINE>if (originalSize != blocks.size()) {<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Block b : blocks) {<NEW_LINE>Location loc = b.getRelative(direction).getLocation();<NEW_LINE>Events.fireToCancel(event, new PlaceBlockEvent(event, cause, loc, b.getType()));<NEW_LINE>}<NEW_LINE>entry.<MASK><NEW_LINE>if (event.isCancelled()) {<NEW_LINE>playDenyEffect(piston.getLocation().add(0.5, 1, 0.5));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setCancelled(event.isCancelled());
1,066,018
public void acceptComment(final RequestContext context) {<NEW_LINE>context.renderJSON(StatusCodes.ERR);<NEW_LINE>final JSONObject requestJSONObject = context.requestJSON();<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final String commentId = requestJSONObject.optString(Comment.COMMENT_T_ID);<NEW_LINE>try {<NEW_LINE>final JSONObject comment = commentQueryService.getComment(commentId);<NEW_LINE>if (null == comment) {<NEW_LINE>context.renderMsg("Not found comment to accept");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String commentAuthorId = comment.optString(Comment.COMMENT_AUTHOR_ID);<NEW_LINE>if (StringUtils.equals(userId, commentAuthorId)) {<NEW_LINE>context.renderMsg(langPropsService.get("thankSelfLabel"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String articleId = comment.optString(Comment.COMMENT_ON_ARTICLE_ID);<NEW_LINE>final JSONObject article = articleQueryService.getArticle(articleId);<NEW_LINE>if (!StringUtils.equals(userId, article.optString(Article.ARTICLE_AUTHOR_ID))) {<NEW_LINE>context.renderMsg<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>commentMgmtService.acceptComment(commentId);<NEW_LINE>context.renderJSON(StatusCodes.SUCC);<NEW_LINE>} catch (final ServiceException e) {<NEW_LINE>context.renderMsg(e.getMessage());<NEW_LINE>}<NEW_LINE>}
(langPropsService.get("sc403Label"));
211,271
public static AccessControlList parseGetBucketAcl(InputStream responseBody) throws ResponseParseException {<NEW_LINE>try {<NEW_LINE>Element root = getXmlRootElement(responseBody);<NEW_LINE>AccessControlList acl = new AccessControlList();<NEW_LINE>String id = root.getChild("Owner").getChildText("ID");<NEW_LINE>String displayName = root.getChild("Owner").getChildText("DisplayName");<NEW_LINE>Owner owner = new Owner(id, displayName);<NEW_LINE>acl.setOwner(owner);<NEW_LINE>String aclString = root.getChild<MASK><NEW_LINE>CannedAccessControlList cacl = CannedAccessControlList.parse(aclString);<NEW_LINE>acl.setCannedACL(cacl);<NEW_LINE>switch(cacl) {<NEW_LINE>case PublicRead:<NEW_LINE>acl.grantPermission(GroupGrantee.AllUsers, Permission.Read);<NEW_LINE>break;<NEW_LINE>case PublicReadWrite:<NEW_LINE>acl.grantPermission(GroupGrantee.AllUsers, Permission.FullControl);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return acl;<NEW_LINE>} catch (JDOMParseException e) {<NEW_LINE>throw new ResponseParseException(e.getPartialDocument() + ": " + e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ResponseParseException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
("AccessControlList").getChildText("Grant");
1,378,960
final DisassociateEnvironmentOperationsRoleResult executeDisassociateEnvironmentOperationsRole(DisassociateEnvironmentOperationsRoleRequest disassociateEnvironmentOperationsRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateEnvironmentOperationsRoleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateEnvironmentOperationsRoleRequest> request = null;<NEW_LINE>Response<DisassociateEnvironmentOperationsRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateEnvironmentOperationsRoleRequestMarshaller().marshall(super.beforeMarshalling(disassociateEnvironmentOperationsRoleRequest));<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, "Elastic Beanstalk");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DisassociateEnvironmentOperationsRoleResult> responseHandler = new StaxResponseHandler<DisassociateEnvironmentOperationsRoleResult>(new DisassociateEnvironmentOperationsRoleResultStaxUnmarshaller());<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>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateEnvironmentOperationsRole");
1,524,814
private static PendingIntent createSnoozeIntent(Context context, long eventId, long startMillis, long endMillis, int notificationId) {<NEW_LINE>Intent intent = new Intent();<NEW_LINE>intent.putExtra(AlertUtils.EVENT_ID_KEY, eventId);<NEW_LINE>intent.putExtra(AlertUtils.EVENT_START_KEY, startMillis);<NEW_LINE>intent.putExtra(AlertUtils.EVENT_END_KEY, endMillis);<NEW_LINE>intent.putExtra(AlertUtils.NOTIFICATION_ID_KEY, notificationId);<NEW_LINE>Uri.Builder builder = Events.CONTENT_URI.buildUpon();<NEW_LINE>ContentUris.appendId(builder, eventId);<NEW_LINE><MASK><NEW_LINE>intent.setData(builder.build());<NEW_LINE>if (Utils.useCustomSnoozeDelay(context)) {<NEW_LINE>intent.setClass(context, SnoozeDelayActivity.class);<NEW_LINE>return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | Utils.PI_FLAG_IMMUTABLE);<NEW_LINE>} else {<NEW_LINE>intent.setClass(context, SnoozeAlarmsService.class);<NEW_LINE>return PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | Utils.PI_FLAG_IMMUTABLE);<NEW_LINE>}<NEW_LINE>}
ContentUris.appendId(builder, startMillis);
1,396,978
private void printLocations(ClasspathLocation[] newLocations, ClasspathLocation[] oldLocations) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println("JavaBuilder: New locations:");<NEW_LINE>for (// $NON-NLS-1$<NEW_LINE>int i = 0, length = newLocations.length; // $NON-NLS-1$<NEW_LINE>i < length; // $NON-NLS-1$<NEW_LINE>i++) System.out.println(" " + newLocations[i].debugPathString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println("JavaBuilder: Old locations:");<NEW_LINE>for (// $NON-NLS-1$<NEW_LINE>int i = 0, length = oldLocations.length; // $NON-NLS-1$<NEW_LINE>i < length; // $NON-NLS-1$<NEW_LINE>i++) System.out.println(" " + oldLocations<MASK><NEW_LINE>}
[i].debugPathString());
1,146,853
protected boolean isMandatory(Field field) {<NEW_LINE>OneToMany oneToManyAnnotation = field.getAnnotation(OneToMany.class);<NEW_LINE>ManyToMany manyToManyAnnotation = field.getAnnotation(ManyToMany.class);<NEW_LINE>if (oneToManyAnnotation != null || manyToManyAnnotation != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Column columnAnnotation = field.getAnnotation(Column.class);<NEW_LINE>OneToOne oneToOneAnnotation = field.getAnnotation(OneToOne.class);<NEW_LINE>ManyToOne manyToOneAnnotation = <MASK><NEW_LINE>com.haulmont.chile.core.annotations.MetaProperty metaPropertyAnnotation = field.getAnnotation(com.haulmont.chile.core.annotations.MetaProperty.class);<NEW_LINE>boolean superMandatory = (metaPropertyAnnotation != null && metaPropertyAnnotation.mandatory()) || (// @NotNull without groups<NEW_LINE>field.getAnnotation(NotNull.class) != null && isDefinedForDefaultValidationGroup(field.getAnnotation(NotNull.class)));<NEW_LINE>return (columnAnnotation != null && !columnAnnotation.nullable()) || (oneToOneAnnotation != null && !oneToOneAnnotation.optional()) || (manyToOneAnnotation != null && !manyToOneAnnotation.optional()) || superMandatory;<NEW_LINE>}
field.getAnnotation(ManyToOne.class);
935,616
/*<NEW_LINE>* @see com.sitewhere.grpc.service.DeviceEventManagementGrpc.<NEW_LINE>* DeviceEventManagementImplBase#addStateChanges(com.sitewhere.grpc.service.<NEW_LINE>* GAddStateChangesRequest, io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addStateChanges(GAddStateChangesRequest request, StreamObserver<GAddStateChangesResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceEventManagementGrpc.getAddStateChangesMethod());<NEW_LINE>List<? extends IDeviceStateChange> apiResult = getDeviceEventManagement().addDeviceStateChanges(EventModelConverter.asApiDeviceEventContext(request.getContext()), EventModelConverter.asApiDeviceStateChangeCreateRequests(request.getRequestsList()).toArray(new IDeviceStateChangeCreateRequest[0]));<NEW_LINE>GAddStateChangesResponse.Builder response = GAddStateChangesResponse.newBuilder();<NEW_LINE>if (apiResult != null) {<NEW_LINE>response.addAllStateChanges(EventModelConverter.asGrpcDeviceStateChanges(apiResult));<NEW_LINE>}<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceEventManagementGrpc.getAddStateChangesMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.<MASK><NEW_LINE>}<NEW_LINE>}
handleServerMethodExit(DeviceEventManagementGrpc.getAddStateChangesMethod());
1,294,192
protected Tuple3<Params, Iterable<String>, Iterable<Object>> serializeModel(TreeModelDataConverter modelData) {<NEW_LINE>List<String> serialized = new ArrayList<>();<NEW_LINE>int pStart = 0, pEnd = 0;<NEW_LINE>// toString partition of stringIndexerModel<NEW_LINE>if (modelData.stringIndexerModelSerialized != null) {<NEW_LINE>for (Row row : stringIndexerModelSerialized) {<NEW_LINE>Object[] objs = new Object[row.getArity()];<NEW_LINE>for (int i = 0; i < row.getArity(); ++i) {<NEW_LINE>objs[i] = row.getField(i);<NEW_LINE>}<NEW_LINE>serialized.add(JsonConverter.toJson(objs));<NEW_LINE>}<NEW_LINE>pEnd = serialized.size();<NEW_LINE>}<NEW_LINE>modelData.meta.set(STRING_INDEXER_MODEL_PARTITION, Partition.of(pStart, pEnd));<NEW_LINE>// toString partition of trees<NEW_LINE>Partitions treesPartition = new Partitions();<NEW_LINE>for (Node root : modelData.roots) {<NEW_LINE>List<String> localSerialize = serializeTree(root);<NEW_LINE>pStart = pEnd;<NEW_LINE>pEnd = pStart + localSerialize.size();<NEW_LINE>treesPartition.add(Partition<MASK><NEW_LINE>serialized.addAll(localSerialize);<NEW_LINE>}<NEW_LINE>modelData.meta.set(TREE_PARTITIONS, treesPartition);<NEW_LINE>return Tuple3.of(modelData.meta, serialized, modelData.labels == null ? null : Arrays.asList(modelData.labels));<NEW_LINE>}
.of(pStart, pEnd));
1,428,329
public ValueInstantiator constructValueInstantiator(DeserializationContext ctxt) throws JsonMappingException {<NEW_LINE>final DeserializationConfig config = ctxt.getConfig();<NEW_LINE>final JavaType delegateType = _computeDelegateType(ctxt, _creators[C_DELEGATE], _delegateArgs);<NEW_LINE>final JavaType arrayDelegateType = _computeDelegateType(ctxt, _creators[C_ARRAY_DELEGATE], _arrayDelegateArgs);<NEW_LINE>final JavaType type = _beanDesc.getType();<NEW_LINE>StdValueInstantiator inst = new StdValueInstantiator(config, type);<NEW_LINE>inst.configureFromObjectSettings(_creators[C_DEFAULT], _creators[C_DELEGATE], delegateType, _delegateArgs, _creators[C_PROPS], _propertyBasedArgs);<NEW_LINE>inst.configureFromArraySettings(_creators[C_ARRAY_DELEGATE], arrayDelegateType, _arrayDelegateArgs);<NEW_LINE>inst.configureFromStringCreator(_creators[C_STRING]);<NEW_LINE>inst.configureFromIntCreator(_creators[C_INT]);<NEW_LINE>inst.configureFromLongCreator(_creators[C_LONG]);<NEW_LINE>inst<MASK><NEW_LINE>inst.configureFromDoubleCreator(_creators[C_DOUBLE]);<NEW_LINE>inst.configureFromBigDecimalCreator(_creators[C_BIG_DECIMAL]);<NEW_LINE>inst.configureFromBooleanCreator(_creators[C_BOOLEAN]);<NEW_LINE>return inst;<NEW_LINE>}
.configureFromBigIntegerCreator(_creators[C_BIG_INTEGER]);
1,626,127
public String fireFactsValidate(MAcctSchema schema, List<Fact> facts, PO po) {<NEW_LINE>if (schema == null || facts == null || po == null || factsValidateListeners.size() == 0)<NEW_LINE>return null;<NEW_LINE>String propertyName = po.get_TableName() + "*";<NEW_LINE>List<FactsValidator> factsValidators = factsValidateListeners.get(propertyName);<NEW_LINE>if (factsValidators != null) {<NEW_LINE>String error = fireFactsValidate(schema, facts, po, factsValidators);<NEW_LINE>if (error != null && error.length() > 0)<NEW_LINE>return error;<NEW_LINE>}<NEW_LINE>propertyName = po.get_TableName<MASK><NEW_LINE>factsValidators = factsValidateListeners.get(propertyName);<NEW_LINE>if (factsValidators != null) {<NEW_LINE>// ad_client.modelvalidationclasses<NEW_LINE>String error = fireFactsValidate(schema, facts, po, factsValidators);<NEW_LINE>if (error != null && error.length() > 0)<NEW_LINE>return error;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
() + po.getAD_Client_ID();
270,917
public Request<PutMetricDataRequest> marshall(PutMetricDataRequest putMetricDataRequest) {<NEW_LINE>if (putMetricDataRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(PutMetricDataRequest)");<NEW_LINE>}<NEW_LINE>Request<PutMetricDataRequest> request = new DefaultRequest<PutMetricDataRequest>(putMetricDataRequest, "AmazonCloudWatch");<NEW_LINE>request.addParameter("Action", "PutMetricData");<NEW_LINE>request.addParameter("Version", "2010-08-01");<NEW_LINE>String prefix;<NEW_LINE>if (putMetricDataRequest.getNamespace() != null) {<NEW_LINE>prefix = "Namespace";<NEW_LINE>String namespace = putMetricDataRequest.getNamespace();<NEW_LINE>request.addParameter(prefix<MASK><NEW_LINE>}<NEW_LINE>if (putMetricDataRequest.getMetricData() != null) {<NEW_LINE>prefix = "MetricData";<NEW_LINE>java.util.List<MetricDatum> metricData = putMetricDataRequest.getMetricData();<NEW_LINE>int metricDataIndex = 1;<NEW_LINE>String metricDataPrefix = prefix;<NEW_LINE>for (MetricDatum metricDataItem : metricData) {<NEW_LINE>prefix = metricDataPrefix + ".member." + metricDataIndex;<NEW_LINE>if (metricDataItem != null) {<NEW_LINE>MetricDatumStaxMarshaller.getInstance().marshall(metricDataItem, request, prefix + ".");<NEW_LINE>}<NEW_LINE>metricDataIndex++;<NEW_LINE>}<NEW_LINE>prefix = metricDataPrefix;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
, StringUtils.fromString(namespace));
326,874
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>ThriftPluginConfig config = new <MASK><NEW_LINE>final boolean traceServiceArgs = config.traceThriftServiceArgs();<NEW_LINE>final boolean traceServiceResult = config.traceThriftServiceResult();<NEW_LINE>final InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>// TServiceClient.sendBase(String, TBase)<NEW_LINE>final InstrumentMethod sendBase = target.getDeclaredMethod("sendBase", "java.lang.String", "org.apache.thrift.TBase");<NEW_LINE>if (sendBase != null) {<NEW_LINE>InterceptorScope thriftClientScope = instrumentor.getInterceptorScope(ThriftScope.THRIFT_CLIENT_SCOPE);<NEW_LINE>sendBase.addScopedInterceptor(TServiceClientSendBaseInterceptor.class, va(traceServiceArgs), thriftClientScope, ExecutionPolicy.BOUNDARY);<NEW_LINE>}<NEW_LINE>// TServiceClient.receiveBase(TBase, String)<NEW_LINE>final InstrumentMethod receiveBase = target.getDeclaredMethod("receiveBase", "org.apache.thrift.TBase", "java.lang.String");<NEW_LINE>if (receiveBase != null) {<NEW_LINE>receiveBase.addInterceptor(TServiceClientReceiveBaseInterceptor.class, va(traceServiceResult));<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>}
ThriftPluginConfig(instrumentor.getProfilerConfig());
909,451
public void build() {<NEW_LINE>// row<NEW_LINE>String[] protocols = { "HTTP", "HTTPS", "UDP", "DHT" };<NEW_LINE>String[] descs = { "HTTP", "HTTPS (SSL)", "UDP", "Decentralised" };<NEW_LINE>StringListParameterImpl protocol = new StringListParameterImpl(SCFG_SHARING_PROTOCOL, "ConfigView.section.sharing.protocol", protocols, descs);<NEW_LINE>add(protocol);<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl private_torrent = new BooleanParameterImpl(BCFG_SHARING_TORRENT_PRIVATE, "ConfigView.section.sharing.privatetorrent");<NEW_LINE>add(private_torrent);<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl permit_dht_backup = new BooleanParameterImpl(BCFG_SHARING_PERMIT_DHT, "ConfigView.section.sharing.permitdht");<NEW_LINE>add(permit_dht_backup);<NEW_LINE>// Force "Permit DHT Tracking" off when "Private Torrent" is on<NEW_LINE>ParameterListener protocol_cl = p -> {<NEW_LINE>boolean not_dht = !protocol.getValue().equals("DHT");<NEW_LINE>private_torrent.setEnabled(not_dht);<NEW_LINE>permit_dht_backup.setEnabled(not_dht && !private_torrent.getValue());<NEW_LINE>if (private_torrent.getValue()) {<NEW_LINE>permit_dht_backup.setValue(false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>protocol_cl.parameterChanged(protocol);<NEW_LINE>protocol.addListener(protocol_cl);<NEW_LINE>private_torrent.addListener(protocol_cl);<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_ADD_HASHES, "wizard.createtorrent.extrahashes"));<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_DISABLE_RCM, "ConfigView.section.sharing.disable_rcm"));<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl rescan_enable = new BooleanParameterImpl(BCFG_SHARING_RESCAN_ENABLE, "ConfigView.section.sharing.rescanenable");<NEW_LINE>add(rescan_enable);<NEW_LINE>// row<NEW_LINE>IntParameterImpl rescan_period = new IntParameterImpl(ICFG_SHARING_RESCAN_PERIOD, "ConfigView.section.sharing.rescanperiod");<NEW_LINE>add(rescan_period);<NEW_LINE>rescan_period.setMinValue(1);<NEW_LINE>rescan_period.setIndent(1, true);<NEW_LINE>rescan_enable.addEnabledOnSelection(rescan_period);<NEW_LINE>// comment<NEW_LINE>StringParameterImpl torrent_comment <MASK><NEW_LINE>add(torrent_comment);<NEW_LINE>torrent_comment.setMultiLine(2);<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_IS_PERSISTENT, "ConfigView.section.sharing.persistentshares"));<NEW_LINE>// ///////////////////// NETWORKS GROUP ///////////////////<NEW_LINE>List<Parameter> listNetworks = new ArrayList<>();<NEW_LINE>BooleanParameterImpl network_global = new BooleanParameterImpl(BCFG_SHARING_NETWORK_SELECTION_GLOBAL, "label.use.global.defaults");<NEW_LINE>add(network_global, listNetworks);<NEW_LINE>List<BooleanParameterImpl> net_params = new ArrayList<>();<NEW_LINE>for (String net : AENetworkClassifier.AT_NETWORKS) {<NEW_LINE>String config_name = BCFG_PREFIX_SHARING_NETWORK_SELECTION_DEFAULT + net;<NEW_LINE>String msg_text = "ConfigView.section.connection.networks." + net;<NEW_LINE>BooleanParameterImpl network = new BooleanParameterImpl(config_name, msg_text);<NEW_LINE>add(network, listNetworks);<NEW_LINE>network.setIndent(1, false);<NEW_LINE>net_params.add(network);<NEW_LINE>}<NEW_LINE>network_global.addDisabledOnSelection(net_params.toArray(new Parameter[0]));<NEW_LINE>add(SECTION_ID + ".pgNetworks", new ParameterGroupImpl("ConfigView.section.connection.group.networks", listNetworks));<NEW_LINE>}
= new StringParameterImpl(SCFG_SHARING_TORRENT_COMMENT, "ConfigView.section.sharing.torrentcomment");
1,320,756
private AuthenticationInfo doAuthenticate(String username, HTTPHeaderAuthConfig config, String remoteAddr) {<NEW_LINE>LOG.debug("Attempting authentication for username <{}>", username);<NEW_LINE>try {<NEW_LINE>// Create already authenticated credentials to make sure the auth service backend doesn't try to<NEW_LINE>// authenticate the user again<NEW_LINE>final AuthServiceCredentials credentials = AuthServiceCredentials.createAuthenticated(username);<NEW_LINE>final AuthServiceResult result = authServiceAuthenticator.authenticate(credentials);<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>LOG.debug("Successfully authenticated username <{}> for user profile <{}> with backend <{}/{}/{}>", result.username(), result.userProfileId(), result.backendTitle(), result.backendType(), result.backendId());<NEW_LINE>// Setting this, will let the SessionResource know, that when a non-existing session is validated, it<NEW_LINE>// should in fact create a session.<NEW_LINE>ShiroSecurityContext.requestSessionCreation(true);<NEW_LINE>return toAuthenticationInfo(result);<NEW_LINE>} else {<NEW_LINE>LOG.warn("Failed to authenticate username <{}> from trusted HTTP header <{}> via proxy <{}>", result.username(), config.usernameHeader(), remoteAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (AuthServiceException e) {<NEW_LINE>LOG.error("Authentication service error", e);<NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
LOG.error("Unhandled authentication error", e);
1,781,678
private void enqueueFeedItems(@NonNull List<DownloadRequest> requests) {<NEW_LINE>List<FeedItem> feedItems = new ArrayList<>();<NEW_LINE>for (DownloadRequest request : requests) {<NEW_LINE>if (request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA) {<NEW_LINE>long mediaId = request.getFeedfileId();<NEW_LINE>FeedMedia media = DBReader.getFeedMedia(mediaId);<NEW_LINE>if (media == null) {<NEW_LINE>Log.w(TAG, "enqueueFeedItems() : FeedFile Id " + mediaId + " is not found. ignore it.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>feedItems.add(media.getItem());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<FeedItem<MASK><NEW_LINE>try {<NEW_LINE>actuallyEnqueued = DBTasks.enqueueFeedItemsToDownload(getApplicationContext(), feedItems);<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>for (DownloadRequest request : requests) {<NEW_LINE>if (request.getFeedfileType() != FeedMedia.FEEDFILETYPE_FEEDMEDIA) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final long mediaId = request.getFeedfileId();<NEW_LINE>for (FeedItem item : actuallyEnqueued) {<NEW_LINE>if (item.getMedia() != null && item.getMedia().getId() == mediaId) {<NEW_LINE>request.setMediaEnqueued(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> actuallyEnqueued = Collections.emptyList();
1,630,364
private void filterWhenSecurityEnabled(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain, UsernamePassword usernamePassword) throws IOException, ServletException {<NEW_LINE>if (usernamePassword == null) {<NEW_LINE>LOGGER.debug("Basic auth credentials are not provided in request.");<NEW_LINE>filterChain.doFilter(request, response);<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("authenticating user {} using basic auth credentials", usernamePassword.getUsername());<NEW_LINE>try {<NEW_LINE>final AuthenticationToken<UsernamePassword> authenticationToken = <MASK><NEW_LINE>if (authenticationToken == null) {<NEW_LINE>onAuthenticationFailure(request, response, BAD_CREDENTIALS_MSG);<NEW_LINE>} else {<NEW_LINE>SessionUtils.setAuthenticationTokenAfterRecreatingSession(authenticationToken, request);<NEW_LINE>filterChain.doFilter(request, response);<NEW_LINE>}<NEW_LINE>} catch (AuthenticationException e) {<NEW_LINE>LOGGER.debug("Failed to authenticate user.", e);<NEW_LINE>onAuthenticationFailure(request, response, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
authenticationProvider.authenticate(usernamePassword, null);
1,389,810
final UpdateBrokerStorageResult executeUpdateBrokerStorage(UpdateBrokerStorageRequest updateBrokerStorageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateBrokerStorageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateBrokerStorageRequest> request = null;<NEW_LINE>Response<UpdateBrokerStorageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateBrokerStorageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateBrokerStorageRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Kafka");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateBrokerStorage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateBrokerStorageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateBrokerStorageResultJsonUnmarshaller());<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>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
635,208
public static void load() {<NEW_LINE>String pkg = Scanner.cutOutLast(ServiceHandlingProxy.class.getName(), ".");<NEW_LINE>Set<String> classes = new Scanner(pkg).process(ServiceHandlingProxy.class.getClassLoader());<NEW_LINE>Set<String> custom = new Scanner(System.getProperty<MASK><NEW_LINE>classes.addAll(custom);<NEW_LINE>Iterator<String> itr = classes.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>try {<NEW_LINE>Class c = Class.forName(itr.next());<NEW_LINE>if (Modifier.isPublic(c.getModifiers()) == false) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method[] m = c.getDeclaredMethods();<NEW_LINE>for (int i = 0; i < m.length; i++) {<NEW_LINE>ServiceHandler mapAn = (ServiceHandler) m[i].getAnnotation(ServiceHandler.class);<NEW_LINE>if (mapAn == null)<NEW_LINE>continue;<NEW_LINE>String key = mapAn.value();<NEW_LINE>Invocation news = new Invocation(c.newInstance(), m[i]);<NEW_LINE>Invocation olds = handlers.get(key);<NEW_LINE>if (olds != null) {<NEW_LINE>Logger.println("Warning duplicated Handler key=" + key + " old=" + olds + " new=" + news);<NEW_LINE>} else {<NEW_LINE>if (Configure.getInstance().log_service_handler_list) {<NEW_LINE>Logger.println("ServiceHandler " + key + "=>" + news);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handlers.put(key, news);<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>x.printStackTrace();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
("scouter.handler")).process();
853,209
final DeleteQuickConnectResult executeDeleteQuickConnect(DeleteQuickConnectRequest deleteQuickConnectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteQuickConnectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteQuickConnectRequest> request = null;<NEW_LINE>Response<DeleteQuickConnectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteQuickConnectRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteQuickConnect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteQuickConnectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteQuickConnectResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(deleteQuickConnectRequest));
1,693,596
private void initTypes(BinaryMapDataObject object) {<NEW_LINE>if (mapIndexFields == null) {<NEW_LINE>mapIndexFields = new MapIndexFields();<NEW_LINE>// mapIndexFields.mapIndex = object.getMapIndex();<NEW_LINE>mapIndexFields.downloadNameType = object.getMapIndex().getRule(FIELD_DOWNLOAD_NAME, null);<NEW_LINE>mapIndexFields.nameType = object.getMapIndex().getRule(FIELD_NAME, null);<NEW_LINE>mapIndexFields.nameEnType = object.getMapIndex().getRule(FIELD_NAME_EN, null);<NEW_LINE>mapIndexFields.nameLocaleType = object.getMapIndex().getRule(FIELD_NAME + ":" + locale, null);<NEW_LINE>if (locale2 != null) {<NEW_LINE>mapIndexFields.nameLocale2Type = object.getMapIndex().getRule(<MASK><NEW_LINE>}<NEW_LINE>mapIndexFields.parentFullName = object.getMapIndex().getRule(FIELD_REGION_PARENT_NAME, null);<NEW_LINE>mapIndexFields.fullNameType = object.getMapIndex().getRule(FIELD_REGION_FULL_NAME, null);<NEW_LINE>mapIndexFields.langType = object.getMapIndex().getRule(FIELD_LANG, null);<NEW_LINE>mapIndexFields.metricType = object.getMapIndex().getRule(FIELD_METRIC, null);<NEW_LINE>mapIndexFields.leftHandDrivingType = object.getMapIndex().getRule(FIELD_LEFT_HAND_DRIVING, null);<NEW_LINE>mapIndexFields.roadSignsType = object.getMapIndex().getRule(FIELD_ROAD_SIGNS, null);<NEW_LINE>mapIndexFields.wikiLinkType = object.getMapIndex().getRule(FIELD_WIKI_LINK, null);<NEW_LINE>mapIndexFields.populationType = object.getMapIndex().getRule(FIELD_POPULATION, null);<NEW_LINE>}<NEW_LINE>}
FIELD_NAME + ":" + locale2, null);