idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
980,567
private void checkSQLServerTables() throws SQLException {<NEW_LINE>LOGGER.entering(CLASSNAME, "checkSQLServerTables");<NEW_LINE>setCreateSQLServerStringsMap();<NEW_LINE>createTableIfNotExists(tableNames.get(CHECKPOINT_TABLE_KEY), SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_CHECKPOINTDATA));<NEW_LINE>createTableIfNotExists(tableNames.get(JOB_INSTANCE_TABLE_KEY)<MASK><NEW_LINE>createTableIfNotExists(tableNames.get(EXECUTION_INSTANCE_TABLE_KEY), SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_EXECUTIONINSTANCEDATA));<NEW_LINE>createTableIfNotExists(tableNames.get(STEP_EXECUTION_INSTANCE_TABLE_KEY), SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_STEPINSTANCEDATA));<NEW_LINE>createTableIfNotExists(tableNames.get(JOB_STATUS_TABLE_KEY), SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_JOBSTATUS));<NEW_LINE>createTableIfNotExists(tableNames.get(STEP_STATUS_TABLE_KEY), SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_STEPSTATUS));<NEW_LINE>LOGGER.exiting(CLASSNAME, "checkSQLServerTables");<NEW_LINE>}
, SQLServerCreateStrings.get(SQLSERVER_CREATE_TABLE_JOBINSTANCEDATA));
1,204,591
/*<NEW_LINE>An endpoint uses the following algorithm to decompress a message.<NEW_LINE>1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the<NEW_LINE>payload of the message.<NEW_LINE>2. Decompress the resulting data using DEFLATE.<NEW_LINE>See, https://tools.ietf.org/html/rfc7692#section-7.2.2<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void decodeFrame(Framedata inputFrame) throws InvalidDataException {<NEW_LINE>// Only DataFrames can be decompressed.<NEW_LINE>if (!(inputFrame instanceof DataFrame)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// RSV1 bit must be set only for the first frame.<NEW_LINE>if (inputFrame.getOpcode() == Opcode.CONTINUOUS && inputFrame.isRSV1()) {<NEW_LINE>throw new InvalidDataException(CloseFrame.POLICY_VALIDATION, "RSV1 bit can only be set for the first frame.");<NEW_LINE>}<NEW_LINE>// If rsv1 is not set, we dont have a compressed message<NEW_LINE>if (!inputFrame.isRSV1()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Decompressed output buffer.<NEW_LINE>ByteArrayOutputStream output = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>decompress(inputFrame.getPayloadData(<MASK><NEW_LINE>if (inflater.getRemaining() > 0) {<NEW_LINE>inflater = new Inflater(true);<NEW_LINE>decompress(inputFrame.getPayloadData().array(), output);<NEW_LINE>}<NEW_LINE>if (inputFrame.isFin()) {<NEW_LINE>decompress(TAIL_BYTES, output);<NEW_LINE>// If context takeover is disabled, inflater can be reset.<NEW_LINE>if (clientNoContextTakeover) {<NEW_LINE>inflater = new Inflater(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>throw new InvalidDataException(CloseFrame.POLICY_VALIDATION, e.getMessage());<NEW_LINE>}<NEW_LINE>// RSV1 bit must be cleared after decoding, so that other extensions don't throw an exception.<NEW_LINE>if (inputFrame.isRSV1()) {<NEW_LINE>((DataFrame) inputFrame).setRSV1(false);<NEW_LINE>}<NEW_LINE>// Set frames payload to the new decompressed data.<NEW_LINE>((FramedataImpl1) inputFrame).setPayload(ByteBuffer.wrap(output.toByteArray(), 0, output.size()));<NEW_LINE>}
).array(), output);
548,104
public I_C_Print_Job_Instructions createPrintJobInstructions(@Nullable final UserId userToPrintId, final boolean createWithSpecificHostKey, @NonNull final I_C_Print_Job_Line firstLine, @NonNull final I_C_Print_Job_Line lastLine, final int copies) {<NEW_LINE>Check.assume(firstLine.getSeqNo() <= lastLine.getSeqNo(), "First line's sequence({}) <= Last line's sequence({})", firstLine.getSeqNo(), lastLine.getSeqNo());<NEW_LINE>final I_C_Print_Job printJob = firstLine.getC_Print_Job();<NEW_LINE>final I_C_Print_Job_Instructions instructions = InterfaceWrapperHelper.newInstance(I_C_Print_Job_Instructions.class, printJob);<NEW_LINE>instructions.setC_Print_Job(printJob);<NEW_LINE>instructions.setAD_Org_ID(printJob.getAD_Org_ID());<NEW_LINE>// initial status<NEW_LINE>instructions.setStatus(X_C_Print_Job_Instructions.STATUS_Pending);<NEW_LINE>instructions.setC_PrintJob_Line_From(firstLine);<NEW_LINE>instructions.setC_PrintJob_Line_To(lastLine);<NEW_LINE>instructions.setCopies(copies);<NEW_LINE>final Properties <MASK><NEW_LINE>final String hostKey = printClientsBL.getHostKeyOrNull(ctx);<NEW_LINE>if (createWithSpecificHostKey) {<NEW_LINE>final String hostKeyToUse;<NEW_LINE>final UserId userToPrintIdToUse;<NEW_LINE>final I_AD_Printer_Config printerConfig = printingDAO.retrievePrinterConfig(hostKey, userToPrintId);<NEW_LINE>Check.errorIf(printerConfig == null, "Missing AD_Printer_Config record for hostKey={}, userToPrintId={}", hostKey, UserId.toRepoId(userToPrintId));<NEW_LINE>if (printerConfig.getAD_Printer_Config_Shared_ID() > 0) {<NEW_LINE>final I_AD_Printer_Config ad_Printer_Config_Shared = printerConfig.getAD_Printer_Config_Shared();<NEW_LINE>hostKeyToUse = ad_Printer_Config_Shared.getConfigHostKey();<NEW_LINE>userToPrintIdToUse = UserId.ofRepoId(ad_Printer_Config_Shared.getAD_User_PrinterMatchingConfig_ID());<NEW_LINE>} else {<NEW_LINE>hostKeyToUse = hostKey;<NEW_LINE>userToPrintIdToUse = userToPrintId;<NEW_LINE>}<NEW_LINE>// note that hostkey is not mandatory here<NEW_LINE>instructions.setHostKey(hostKeyToUse);<NEW_LINE>instructions.setAD_User_ToPrint_ID(UserId.toRepoId(userToPrintIdToUse));<NEW_LINE>// task 09028: workaround: don't set the hostkey.<NEW_LINE>// therefore the next print client of the given user will be able to print this<NEW_LINE>} else {<NEW_LINE>instructions.setAD_User_ToPrint_ID(UserId.toRepoId(userToPrintId));<NEW_LINE>}<NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(instructions);<NEW_LINE>instructions.setAD_PrinterHW(printingDAO.retrieveAttachToPrintPackagePrinter(ctx, hostKey, trxName));<NEW_LINE>InterfaceWrapperHelper.save(instructions);<NEW_LINE>return instructions;<NEW_LINE>}
ctx = InterfaceWrapperHelper.getCtx(instructions);
1,750,023
public void visitJDT(final IMethod method, final ITypeRequestor requestor) {<NEW_LINE>MethodNode methodNode = findMethodNode(method);<NEW_LINE>if (methodNode == null) {<NEW_LINE>// probably some sort of AST transformation is making this node invisible<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.requestor = requestor;<NEW_LINE>IJavaElement enclosingElement0 = enclosingElement;<NEW_LINE>enclosingElement = method;<NEW_LINE>try {<NEW_LINE>visitMethodInternal(methodNode);<NEW_LINE>// visit relocated @Transactional, et al. method bodies<NEW_LINE>Optional<List<MethodNode>> decorated = Optional.ofNullable(methodNode.getNodeMetaData("$DECORATED"));<NEW_LINE>decorated.ifPresent(decoratedMethodNodes -> decoratedMethodNodes.forEach(this::visitMethodInternal));<NEW_LINE>} catch (VisitCompleted | CancellationException e) {<NEW_LINE>// propagate<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log(e, "Error visiting method %s in class %s", method.getElementName(), method.<MASK><NEW_LINE>} finally {<NEW_LINE>enclosingElement = enclosingElement0;<NEW_LINE>}<NEW_LINE>}
getParent().getElementName());
1,054,373
// ===================================================================================<NEW_LINE>// Basic Override<NEW_LINE>// ==============<NEW_LINE>@Override<NEW_LINE>protected String doBuildColumnString(String dm) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(dm).append(businessCategory);<NEW_LINE>sb.append(dm).append(carLicense);<NEW_LINE>sb.append(dm).append(city);<NEW_LINE>sb.append(dm).append(departmentNumber);<NEW_LINE>sb.append(dm).append(description);<NEW_LINE>sb.append(dm).append(destinationIndicator);<NEW_LINE>sb.append(dm).append(displayName);<NEW_LINE>sb.append(dm).append(employeeNumber);<NEW_LINE>sb.append(dm).append(employeeType);<NEW_LINE>sb.append(dm).append(facsimileTelephoneNumber);<NEW_LINE>sb.append(dm).append(gidNumber);<NEW_LINE>sb.append(dm).append(givenName);<NEW_LINE>sb.append(dm).append(groups);<NEW_LINE>sb.append(dm).append(homeDirectory);<NEW_LINE>sb.append(dm).append(homePhone);<NEW_LINE>sb.append(dm).append(homePostalAddress);<NEW_LINE>sb.append(dm).append(initials);<NEW_LINE>sb.append(dm).append(internationaliSDNNumber);<NEW_LINE>sb.append(dm).append(labeledURI);<NEW_LINE>sb.append(dm).append(mail);<NEW_LINE>sb.append(dm).append(mobile);<NEW_LINE>sb.append(dm).append(name);<NEW_LINE>sb.append(dm).append(pager);<NEW_LINE>sb.append(dm).append(password);<NEW_LINE>sb.append(dm).append(physicalDeliveryOfficeName);<NEW_LINE>sb.append(dm).append(postOfficeBox);<NEW_LINE>sb.append(dm).append(postalAddress);<NEW_LINE>sb.append(dm).append(postalCode);<NEW_LINE>sb.append(dm).append(preferredLanguage);<NEW_LINE>sb.append(dm).append(registeredAddress);<NEW_LINE>sb.append(dm).append(roles);<NEW_LINE>sb.append(dm).append(roomNumber);<NEW_LINE>sb.append(dm).append(state);<NEW_LINE>sb.append(dm).append(street);<NEW_LINE>sb.append(dm).append(surname);<NEW_LINE>sb.append(dm).append(telephoneNumber);<NEW_LINE>sb.append(dm).append(teletexTerminalIdentifier);<NEW_LINE>sb.append(dm).append(title);<NEW_LINE>sb.append(dm).append(uidNumber);<NEW_LINE>sb.append(dm).append(x121Address);<NEW_LINE>if (sb.length() > dm.length()) {<NEW_LINE>sb.delete(<MASK><NEW_LINE>}<NEW_LINE>sb.insert(0, "{").append("}");<NEW_LINE>return sb.toString();<NEW_LINE>}
0, dm.length());
244,086
public static QueryTaskInfoHistoryResponse unmarshall(QueryTaskInfoHistoryResponse queryTaskInfoHistoryResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryTaskInfoHistoryResponse.setRequestId(_ctx.stringValue("QueryTaskInfoHistoryResponse.RequestId"));<NEW_LINE>queryTaskInfoHistoryResponse.setPageSize(_ctx.integerValue("QueryTaskInfoHistoryResponse.PageSize"));<NEW_LINE>CurrentPageCursor currentPageCursor = new CurrentPageCursor();<NEW_LINE>currentPageCursor.setTaskType(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskType"));<NEW_LINE>currentPageCursor.setTaskNum(_ctx.integerValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskNum"));<NEW_LINE>currentPageCursor.setTaskStatus(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskStatus"));<NEW_LINE>currentPageCursor.setCreateTime(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.CreateTime"));<NEW_LINE>currentPageCursor.setClientip(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.Clientip"));<NEW_LINE>currentPageCursor.setTaskNo(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskNo"));<NEW_LINE>currentPageCursor.setCreateTimeLong(_ctx.longValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.CreateTimeLong"));<NEW_LINE>currentPageCursor.setTaskStatusCode(_ctx.integerValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskStatusCode"));<NEW_LINE>currentPageCursor.setTaskTypeDescription(_ctx.stringValue("QueryTaskInfoHistoryResponse.CurrentPageCursor.TaskTypeDescription"));<NEW_LINE>queryTaskInfoHistoryResponse.setCurrentPageCursor(currentPageCursor);<NEW_LINE>NextPageCursor nextPageCursor = new NextPageCursor();<NEW_LINE>nextPageCursor.setTaskType(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskType"));<NEW_LINE>nextPageCursor.setTaskNum(_ctx.integerValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskNum"));<NEW_LINE>nextPageCursor.setTaskStatus(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskStatus"));<NEW_LINE>nextPageCursor.setCreateTime(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.CreateTime"));<NEW_LINE>nextPageCursor.setClientip(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.Clientip"));<NEW_LINE>nextPageCursor.setTaskNo(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskNo"));<NEW_LINE>nextPageCursor.setCreateTimeLong(_ctx.longValue("QueryTaskInfoHistoryResponse.NextPageCursor.CreateTimeLong"));<NEW_LINE>nextPageCursor.setTaskStatusCode(_ctx.integerValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskStatusCode"));<NEW_LINE>nextPageCursor.setTaskTypeDescription(_ctx.stringValue("QueryTaskInfoHistoryResponse.NextPageCursor.TaskTypeDescription"));<NEW_LINE>queryTaskInfoHistoryResponse.setNextPageCursor(nextPageCursor);<NEW_LINE>PrePageCursor prePageCursor = new PrePageCursor();<NEW_LINE>prePageCursor.setTaskType(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskType"));<NEW_LINE>prePageCursor.setTaskNum(_ctx.integerValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskNum"));<NEW_LINE>prePageCursor.setTaskStatus(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskStatus"));<NEW_LINE>prePageCursor.setCreateTime(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.CreateTime"));<NEW_LINE>prePageCursor.setClientip(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.Clientip"));<NEW_LINE>prePageCursor.setTaskNo(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskNo"));<NEW_LINE>prePageCursor.setCreateTimeLong<MASK><NEW_LINE>prePageCursor.setTaskStatusCode(_ctx.integerValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskStatusCode"));<NEW_LINE>prePageCursor.setTaskTypeDescription(_ctx.stringValue("QueryTaskInfoHistoryResponse.PrePageCursor.TaskTypeDescription"));<NEW_LINE>queryTaskInfoHistoryResponse.setPrePageCursor(prePageCursor);<NEW_LINE>List<TaskInfoHistory> objects = new ArrayList<TaskInfoHistory>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryTaskInfoHistoryResponse.Objects.Length"); i++) {<NEW_LINE>TaskInfoHistory taskInfoHistory = new TaskInfoHistory();<NEW_LINE>taskInfoHistory.setTaskType(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskType"));<NEW_LINE>taskInfoHistory.setTaskNum(_ctx.integerValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskNum"));<NEW_LINE>taskInfoHistory.setTaskStatus(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskStatus"));<NEW_LINE>taskInfoHistory.setCreateTime(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].CreateTime"));<NEW_LINE>taskInfoHistory.setClientip(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].Clientip"));<NEW_LINE>taskInfoHistory.setTaskNo(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskNo"));<NEW_LINE>taskInfoHistory.setCreateTimeLong(_ctx.longValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].CreateTimeLong"));<NEW_LINE>taskInfoHistory.setTaskStatusCode(_ctx.integerValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskStatusCode"));<NEW_LINE>taskInfoHistory.setTaskTypeDescription(_ctx.stringValue("QueryTaskInfoHistoryResponse.Objects[" + i + "].TaskTypeDescription"));<NEW_LINE>objects.add(taskInfoHistory);<NEW_LINE>}<NEW_LINE>queryTaskInfoHistoryResponse.setObjects(objects);<NEW_LINE>return queryTaskInfoHistoryResponse;<NEW_LINE>}
(_ctx.longValue("QueryTaskInfoHistoryResponse.PrePageCursor.CreateTimeLong"));
1,829,949
final DeleteTrafficMirrorFilterRuleResult executeDeleteTrafficMirrorFilterRule(DeleteTrafficMirrorFilterRuleRequest deleteTrafficMirrorFilterRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTrafficMirrorFilterRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTrafficMirrorFilterRuleRequest> request = null;<NEW_LINE>Response<DeleteTrafficMirrorFilterRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTrafficMirrorFilterRuleRequestMarshaller().marshall(super.beforeMarshalling(deleteTrafficMirrorFilterRuleRequest));<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, "EC2");<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<DeleteTrafficMirrorFilterRuleResult> responseHandler = new StaxResponseHandler<DeleteTrafficMirrorFilterRuleResult>(new DeleteTrafficMirrorFilterRuleResultStaxUnmarshaller());<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, "DeleteTrafficMirrorFilterRule");
1,636,692
public void activate(Context context) {<NEW_LINE>ArrayList<AuthUI.IdpConfig> idps = getProviders(config.providers);<NEW_LINE>AuthUI.SignInIntentBuilder builder = authUI().createSignInIntentBuilder().setLogo(ChatSDK.config().logoDrawableResourceID).setTheme(UIModule.config().theme).setIsSmartLockEnabled(false).setAvailableProviders(idps);<NEW_LINE>if (UIModule.config().theme != 0) {<NEW_LINE>builder.setTheme(<MASK><NEW_LINE>}<NEW_LINE>Intent authUILoginIntent = builder.build();<NEW_LINE>ChatSDK.ui().setLoginIntent(authUILoginIntent);<NEW_LINE>// dm.add(ChatSDK.events().source()<NEW_LINE>// .filter(NetworkEvent.filterType(EventType.Logout))<NEW_LINE>// .subscribe(networkEvent -> authUI().signOut(context)));<NEW_LINE>ChatSDK.hook().addHook(Hook.async(data -> Completable.create(emitter -> {<NEW_LINE>authUI().signOut(ChatSDK.ctx()).addOnSuccessListener(aVoid -> emitter.onComplete()).addOnFailureListener(emitter::onError);<NEW_LINE>})), HookEvent.DidLogout);<NEW_LINE>}
UIModule.config().theme);
1,444,938
final ListFiltersResult executeListFilters(ListFiltersRequest listFiltersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFiltersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListFiltersRequest> request = null;<NEW_LINE>Response<ListFiltersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFiltersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFiltersRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFilters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFiltersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFiltersResultJsonUnmarshaller());<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);
285,123
public org.apache.submarine.server.api.proto.TritonModelConfig.ModelOptimizationPolicy buildPartial() {<NEW_LINE>org.apache.submarine.server.api.proto.TritonModelConfig.ModelOptimizationPolicy result = new org.apache.submarine.server.api.<MASK><NEW_LINE>if (graphBuilder_ == null) {<NEW_LINE>result.graph_ = graph_;<NEW_LINE>} else {<NEW_LINE>result.graph_ = graphBuilder_.build();<NEW_LINE>}<NEW_LINE>result.priority_ = priority_;<NEW_LINE>if (cudaBuilder_ == null) {<NEW_LINE>result.cuda_ = cuda_;<NEW_LINE>} else {<NEW_LINE>result.cuda_ = cudaBuilder_.build();<NEW_LINE>}<NEW_LINE>if (executionAcceleratorsBuilder_ == null) {<NEW_LINE>result.executionAccelerators_ = executionAccelerators_;<NEW_LINE>} else {<NEW_LINE>result.executionAccelerators_ = executionAcceleratorsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (inputPinnedMemoryBuilder_ == null) {<NEW_LINE>result.inputPinnedMemory_ = inputPinnedMemory_;<NEW_LINE>} else {<NEW_LINE>result.inputPinnedMemory_ = inputPinnedMemoryBuilder_.build();<NEW_LINE>}<NEW_LINE>if (outputPinnedMemoryBuilder_ == null) {<NEW_LINE>result.outputPinnedMemory_ = outputPinnedMemory_;<NEW_LINE>} else {<NEW_LINE>result.outputPinnedMemory_ = outputPinnedMemoryBuilder_.build();<NEW_LINE>}<NEW_LINE>result.gatherKernelBufferThreshold_ = gatherKernelBufferThreshold_;<NEW_LINE>result.eagerBatching_ = eagerBatching_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.TritonModelConfig.ModelOptimizationPolicy(this);
1,591,962
public Expression visitPi(PiExpression expr, Expression expectedType) {<NEW_LINE>checkSort(expr.getResultSort(), expr);<NEW_LINE>UniverseExpression type = new UniverseExpression(expr.getResultSort());<NEW_LINE>Sort sort1 = checkDependentLinkWithResult(expr.getParameters(), expr.getResultSort().isProp() ? null : new UniverseExpression(new Sort(expr.getResultSort().getPLevel(), Level.INFINITY)), expr);<NEW_LINE>Sort sort2 = expr.getCodomain().accept(this, type).toSort();<NEW_LINE>freeDependentLink(expr.getParameters());<NEW_LINE>Expression actualType;<NEW_LINE>if (sort1 != null && sort1.isProp() || sort2 != null && sort2.isProp()) {<NEW_LINE>actualType = new UniverseExpression(sort2);<NEW_LINE>} else {<NEW_LINE>Level maxPLevel = sort1 == null || sort2 == null ? null : sort1.getPLevel().<MASK><NEW_LINE>actualType = maxPLevel == null ? type : new UniverseExpression(new Sort(maxPLevel, sort2.getHLevel()));<NEW_LINE>}<NEW_LINE>return check(expectedType, actualType, expr);<NEW_LINE>}
max(sort2.getPLevel());
1,810,519
protected void fillJobInfo(Job job) {<NEW_LINE>job.setCode(jobProps.get(LinkisJobTypeConf.COMMAND));<NEW_LINE>Map<String, Object> params = new HashMap<>();<NEW_LINE>if (jobProps.containsKey("run_date")) {<NEW_LINE>params.put("run_date", jobProps.get("run_date"));<NEW_LINE>}<NEW_LINE>job.setParams(params);<NEW_LINE>Map<String, Object> runtimeMap = new HashMap<>();<NEW_LINE>if (null != job.getRuntimeParams()) {<NEW_LINE>runtimeMap = job.getRuntimeParams();<NEW_LINE>}<NEW_LINE>// update by peaceWong add contextID to runtimeMap<NEW_LINE>if (jobProps.containsKey(LinkisJobExecutionConfiguration.FLOW_CONTEXTID)) {<NEW_LINE>runtimeMap.put("contextID", jobProps.get(LinkisJobExecutionConfiguration.FLOW_CONTEXTID).replace("/", "\\"));<NEW_LINE>}<NEW_LINE>runtimeMap.put("nodeName", jobProps<MASK><NEW_LINE>runtimeMap.put(LinkisJobTypeConf.DSS_LABELS_KEY, jobProps.get(LinkisJobTypeConf.DSS_LABELS_KEY));<NEW_LINE>// to put a workspace for linkis job<NEW_LINE>String workspace = "";<NEW_LINE>try {<NEW_LINE>workspace = getWorkspace(job.getUser(), job);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to get workspace", e);<NEW_LINE>}<NEW_LINE>runtimeMap.put("workspace", workspace);<NEW_LINE>job.setRuntimeParams(runtimeMap);<NEW_LINE>}
.get(LinkisJobTypeConf.JOB_ID));
716,972
public FTPFile parseFTPEntry(final String line) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Parse %s", line));<NEW_LINE>}<NEW_LINE>if (current != null) {<NEW_LINE>final FTPFile <MASK><NEW_LINE>if (null != parsed) {<NEW_LINE>return parsed;<NEW_LINE>}<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Switching parser implementation because %s failed", current));<NEW_LINE>}<NEW_LINE>current = null;<NEW_LINE>}<NEW_LINE>for (FTPFileEntryParser parser : parsers) {<NEW_LINE>final FTPFile matched = parser.parseFTPEntry(line);<NEW_LINE>if (matched != null) {<NEW_LINE>current = parser;<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Caching %s parser implementation", current));<NEW_LINE>}<NEW_LINE>return matched;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.warn(String.format("Failure parsing line %s", line));<NEW_LINE>return null;<NEW_LINE>}
parsed = current.parseFTPEntry(line);
1,148,288
public void run() {<NEW_LINE>List<MemoryPoolMXBean> memoryPoolMXBeans = ManagementFactory.getMemoryPoolMXBeans();<NEW_LINE>for (MemoryPoolMXBean memoryPoolMXBean : memoryPoolMXBeans) {<NEW_LINE>String poolName = memoryPoolMXBean.getName();<NEW_LINE>if (memoryPoolMXBean.getType() == MemoryType.HEAP && poolName.equals(heapMemoryPool)) {<NEW_LINE>GarbageCollectionEvent latest = heapEvents.latest();<NEW_LINE><MASK><NEW_LINE>// There has been a GC event<NEW_LINE>if (latest == null || latest.getCount() != currentCount) {<NEW_LINE>heapEvents.slideAndInsert(new GarbageCollectionEvent(clock.getCurrentTime(), memoryPoolMXBean.getCollectionUsage(), currentCount));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (memoryPoolMXBean.getType() == MemoryType.NON_HEAP && poolName.equals(nonHeapMemoryPool)) {<NEW_LINE>nonHeapEvents.slideAndInsert(new GarbageCollectionEvent(clock.getCurrentTime(), memoryPoolMXBean.getUsage(), -1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
long currentCount = garbageCollectorMXBean.getCollectionCount();
444,847
public static QuerySecCheckLatestSummaryResponse unmarshall(QuerySecCheckLatestSummaryResponse querySecCheckLatestSummaryResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySecCheckLatestSummaryResponse.setRequestId(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.RequestId"));<NEW_LINE>querySecCheckLatestSummaryResponse.setSuccess(_ctx.booleanValue("QuerySecCheckLatestSummaryResponse.Success"));<NEW_LINE>querySecCheckLatestSummaryResponse.setCode(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.Code"));<NEW_LINE>querySecCheckLatestSummaryResponse.setMessage(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("QuerySecCheckLatestSummaryResponse.Data.PageInfo.CurrentPage"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("QuerySecCheckLatestSummaryResponse.Data.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotal(_ctx.integerValue("QuerySecCheckLatestSummaryResponse.Data.PageInfo.Total"));<NEW_LINE>data.setPageInfo(pageInfo);<NEW_LINE>List<OmniSecCheckLatestSummaryDTO> list = new ArrayList<OmniSecCheckLatestSummaryDTO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySecCheckLatestSummaryResponse.Data.List.Length"); i++) {<NEW_LINE>OmniSecCheckLatestSummaryDTO omniSecCheckLatestSummaryDTO = new OmniSecCheckLatestSummaryDTO();<NEW_LINE>omniSecCheckLatestSummaryDTO.setId(_ctx.longValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].Id"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setConfType(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].ConfType"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setCheckType(_ctx.stringValue<MASK><NEW_LINE>omniSecCheckLatestSummaryDTO.setCheckTarget(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].CheckTarget"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setUrlCnt(_ctx.longValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].UrlCnt"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setRiskCnt(_ctx.longValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].RiskCnt"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setCheckTime(_ctx.stringValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].CheckTime"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setGmtCheckStart(_ctx.longValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].GmtCheckStart"));<NEW_LINE>omniSecCheckLatestSummaryDTO.setGmtCheckEnd(_ctx.longValue("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].GmtCheckEnd"));<NEW_LINE>list.add(omniSecCheckLatestSummaryDTO);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>querySecCheckLatestSummaryResponse.setData(data);<NEW_LINE>return querySecCheckLatestSummaryResponse;<NEW_LINE>}
("QuerySecCheckLatestSummaryResponse.Data.List[" + i + "].CheckType"));
1,609,509
public static void main(String[] args) {<NEW_LINE>Options options = createCommandLineOptions();<NEW_LINE>CommandLine cmd;<NEW_LINE>try {<NEW_LINE>CommandLineParser parser = new DefaultParser();<NEW_LINE>cmd = parser.parse(options, args);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.out.println("ERROR: " + e.getMessage());<NEW_LINE>HelpFormatter formatter = new HelpFormatter();<NEW_LINE>formatter.setOptionComparator(null);<NEW_LINE>formatter.printHelp(" java -jar spoon-dataflow.jar", null, options, null, true);<NEW_LINE>System.exit(1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] sources = cmd.getOptionValues("sources");<NEW_LINE>String[] classpath = cmd.getOptionValues("classpath");<NEW_LINE>Launcher launcher = new Launcher();<NEW_LINE>// launcher.getEnvironment().setNoClasspath(false);<NEW_LINE>launcher.getEnvironment().setCommentEnabled(false);<NEW_LINE>launcher.getEnvironment().setComplianceLevel(10);<NEW_LINE>Arrays.stream(sources<MASK><NEW_LINE>if (classpath != null) {<NEW_LINE>launcher.getEnvironment().setSourceClasspath(classpath);<NEW_LINE>}<NEW_LINE>CtModel ctModel = launcher.buildModel();<NEW_LINE>CheckersScanner scanner = new CheckersScanner(launcher.getFactory());<NEW_LINE>ctModel.getAllTypes().forEach(scanner::scan);<NEW_LINE>scanner.getWarnings().forEach(w -> System.out.println("WARNING: " + w));<NEW_LINE>}
).forEach(launcher::addInputResource);
1,286,605
private long insertTaskEntryForExecution(HttpServletRequest request, String name) throws Exception {<NEW_LINE>InputStream input = request.getServletContext().getResourceAsStream("/WEB-INF/serialized/" + name + ".ser");<NEW_LINE>ObjectInputStream objectInput = new ObjectInputStream(input);<NEW_LINE>LinkedHashMap<String, Object> map;<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>LinkedHashMap<String, Object> m = (LinkedHashMap<String, Object>) objectInput.readObject();<NEW_LINE>map = m;<NEW_LINE>} finally {<NEW_LINE>objectInput.close();<NEW_LINE>}<NEW_LINE>if (executorPartitionId == -1) {<NEW_LINE>Method getPartitionId = executor.<MASK><NEW_LINE>getPartitionId.setAccessible(true);<NEW_LINE>executorPartitionId = (Long) getPartitionId.invoke(executor);<NEW_LINE>}<NEW_LINE>map.put("PARTN", executorPartitionId);<NEW_LINE>String insert = "INSERT INTO EXECTASK VALUES(DEFAULT";<NEW_LINE>for (int i = map.size(); i >= 1; i--) insert += ",?";<NEW_LINE>insert += ')';<NEW_LINE>System.out.println("Insert command for " + name + ": " + insert + " Params: " + map);<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>Connection con = dataSource.getConnection();<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = con.prepareStatement(insert);<NEW_LINE>int i = 0;<NEW_LINE>for (Object value : map.values()) pstmt.setObject(++i, value);<NEW_LINE>pstmt.executeUpdate();<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = con.prepareStatement("VALUES IDENTITY_VAL_LOCAL()");<NEW_LINE>ResultSet result = pstmt.executeQuery();<NEW_LINE>result.next();<NEW_LINE>return result.getLong(1);<NEW_LINE>} finally {<NEW_LINE>con.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>}
getClass().getDeclaredMethod("getPartitionId");
99,113
protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) {<NEW_LINE>if (expressionResult != null) {<NEW_LINE>final String resultStr = expressionResult.toString();<NEW_LINE>if (VALUE_ALL.equalsIgnoreCase(resultStr)) {<NEW_LINE>structureHandler.removeElement();<NEW_LINE>} else if (VALUE_TAG.equalsIgnoreCase(resultStr) || VALUE_TAGS.equalsIgnoreCase(resultStr)) {<NEW_LINE>structureHandler.removeTags();<NEW_LINE>} else if (VALUE_ALL_BUT_FIRST.equalsIgnoreCase(resultStr)) {<NEW_LINE>structureHandler.removeAllButFirstChild();<NEW_LINE>} else if (VALUE_BODY.equalsIgnoreCase(resultStr)) {<NEW_LINE>structureHandler.removeBody();<NEW_LINE>} else if (!VALUE_NONE.equalsIgnoreCase(resultStr)) {<NEW_LINE>throw new TemplateProcessingException("Invalid value specified for \"" + attributeName + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"\": only 'all', 'tag', 'body', 'none' " + "and 'all-but-first' are allowed, but \"" + attributeValue + "\" was specified.");
1,342,036
public List<VMInstanceVO> listByHostOrLastHostOrHostPod(long hostId, long podId) {<NEW_LINE>SearchBuilder<VMInstanceVO> sb = createSearchBuilder();<NEW_LINE>sb.or().op("hostId", sb.entity().getHostId(), Op.EQ);<NEW_LINE>sb.or("lastHostId", sb.entity().getLastHostId(), Op.EQ);<NEW_LINE>sb.and().op("hostIdNull", sb.entity().getHostId(<MASK><NEW_LINE>sb.and("lastHostIdNull", sb.entity().getHostId(), SearchCriteria.Op.NULL);<NEW_LINE>sb.and("podId", sb.entity().getPodIdToDeployIn(), Op.EQ);<NEW_LINE>sb.cp();<NEW_LINE>sb.cp();<NEW_LINE>sb.done();<NEW_LINE>SearchCriteria<VMInstanceVO> sc = sb.create();<NEW_LINE>sc.setParameters("hostId", String.valueOf(hostId));<NEW_LINE>sc.setParameters("lastHostId", String.valueOf(hostId));<NEW_LINE>sc.setParameters("podId", String.valueOf(podId));<NEW_LINE>return listBy(sc);<NEW_LINE>}
), SearchCriteria.Op.NULL);
1,611,312
private ArrayKey mkKey(final IHUTransactionAttribute trx) {<NEW_LINE>final AttributeId attributeId = trx.getAttributeId();<NEW_LINE>final HUTransactionAttributeOperation operation = trx.getOperation();<NEW_LINE>final Object referencedObject = trx.getReferencedObject();<NEW_LINE>final String referencedObjectTableName;<NEW_LINE>final int referencedObjectId;<NEW_LINE>final int uniqueDiscriminant;<NEW_LINE>if (referencedObject == null) {<NEW_LINE>referencedObjectTableName = null;<NEW_LINE>referencedObjectId = -1;<NEW_LINE>// we want to have a unique discriminant<NEW_LINE>uniqueDiscriminant = uniqueKeyIndex++;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>referencedObjectId = InterfaceWrapperHelper.getId(referencedObject);<NEW_LINE>// nop, we don't want to have a unique discriminant<NEW_LINE>uniqueDiscriminant = 0;<NEW_LINE>}<NEW_LINE>return Util.mkKey(uniqueDiscriminant, attributeId, operation, referencedObjectTableName, referencedObjectId);<NEW_LINE>}
referencedObjectTableName = InterfaceWrapperHelper.getModelTableName(referencedObject);
1,752,864
public static Object compressStringRawBytes(@Nonnull CharSequence string) {<NEW_LINE>int length = string.length();<NEW_LINE>if (length < STRING_COMPRESSION_THRESHOLD) {<NEW_LINE>if (string instanceof CharBuffer && ((CharBuffer) string).capacity() > STRING_COMPRESSION_THRESHOLD) {<NEW_LINE>// shrink to size<NEW_LINE>string = string.toString();<NEW_LINE>}<NEW_LINE>return string;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>BufferExposingByteArrayOutputStream bytes = new BufferExposingByteArrayOutputStream(length);<NEW_LINE>@Nonnull<NEW_LINE>DataOutput out = new DataOutputStream(bytes);<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>char <MASK><NEW_LINE>DataInputOutputUtil.writeINT(out, c);<NEW_LINE>}<NEW_LINE>LZ4Compressor compressor = compressor();<NEW_LINE>int bytesWritten = bytes.size();<NEW_LINE>ByteBuffer dest = ByteBuffer.wrap(spareBufferLocal.getBuffer(compressor.maxCompressedLength(bytesWritten) + 10));<NEW_LINE>DataInputOutputUtil.writeINT(dest, length);<NEW_LINE>DataInputOutputUtil.writeINT(dest, bytesWritten - length);<NEW_LINE>compressor.compress(ByteBuffer.wrap(bytes.getInternalBuffer(), 0, bytesWritten), dest);<NEW_LINE>return dest.position() < length * 2 ? Arrays.copyOf(dest.array(), dest.position()) : string;<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return string;<NEW_LINE>}<NEW_LINE>}
c = string.charAt(i);
309,712
protected static Boolean withValidAccessModifiers(Symbol symbol, Package currentPackage, ModuleId currentModule, HoverContext context) {<NEW_LINE>Optional<Project> project = context.workspace().project(context.filePath());<NEW_LINE>Optional<ModuleSymbol> typeSymbolModule = symbol.getModule();<NEW_LINE>if (project.isEmpty() || typeSymbolModule.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean isResource = false;<NEW_LINE>boolean isPrivate = false;<NEW_LINE>boolean isPublic = false;<NEW_LINE>boolean isRemote = false;<NEW_LINE>if (symbol instanceof Qualifiable) {<NEW_LINE>Qualifiable qSymbol = (Qualifiable) symbol;<NEW_LINE>isPrivate = qSymbol.qualifiers().contains(Qualifier.PRIVATE);<NEW_LINE>isPublic = qSymbol.qualifiers().contains(Qualifier.PUBLIC);<NEW_LINE>isResource = qSymbol.qualifiers(<MASK><NEW_LINE>isRemote = qSymbol.qualifiers().contains(Qualifier.REMOTE);<NEW_LINE>}<NEW_LINE>if (isResource || isRemote || isPublic) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ModuleID objModuleId = typeSymbolModule.get().id();<NEW_LINE>return (!isPrivate && objModuleId.moduleName().equals(currentModule.moduleName()) && objModuleId.orgName().equals(currentPackage.packageOrg().value()));<NEW_LINE>}
).contains(Qualifier.RESOURCE);
1,086,971
private PartialPath mergeSamePathFilter(QueryFilter filter) throws StatementAnalyzeException {<NEW_LINE>if (filter.isLeaf()) {<NEW_LINE>return filter.getSinglePath();<NEW_LINE>}<NEW_LINE>List<QueryFilter> children = filter.getChildren();<NEW_LINE>checkInnerFilterLen(children);<NEW_LINE>PartialPath childPath = mergeSamePathFilter(children.get(0));<NEW_LINE>PartialPath tempPath;<NEW_LINE>for (int i = 1; i < children.size(); i++) {<NEW_LINE>tempPath = mergeSamePathFilter<MASK><NEW_LINE>// if one of children differs from others or is not single node(seriesPath = null), filter's<NEW_LINE>// seriesPath is null<NEW_LINE>if (tempPath == null || !tempPath.equals(childPath)) {<NEW_LINE>childPath = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (childPath != null) {<NEW_LINE>filter.setIsSingle(true);<NEW_LINE>filter.setSinglePath(childPath);<NEW_LINE>return childPath;<NEW_LINE>}<NEW_LINE>// sort paths of BasicFunction by their single seriesPath. We don't sort children on non-leaf<NEW_LINE>// layer.<NEW_LINE>if (!children.isEmpty() && allIsBasic(children)) {<NEW_LINE>children.sort(Comparator.comparing(o -> o.getSinglePath().getFullPath()));<NEW_LINE>}<NEW_LINE>List<QueryFilter> ret = new ArrayList<>();<NEW_LINE>int firstNonSingleIndex = mergeSingleFilters(ret, filter);<NEW_LINE>// add last null child<NEW_LINE>return addLastNullChild(ret, filter, firstNonSingleIndex, childPath);<NEW_LINE>}
(children.get(i));
333,924
public void union(FlowSet<T> otherFlow, FlowSet<T> destFlow) {<NEW_LINE>if (sameType(otherFlow) && sameType(destFlow)) {<NEW_LINE>DavaFlowSet<T> other = (DavaFlowSet<T>) otherFlow;<NEW_LINE>DavaFlowSet<T> dest = (DavaFlowSet<T>) destFlow;<NEW_LINE>// For the special case that dest == other<NEW_LINE>if (dest == other) {<NEW_LINE>for (int i = 0; i < this.numElements; i++) {<NEW_LINE>dest.add(this.elements[i]);<NEW_LINE>}<NEW_LINE>} else // Else, force that dest starts with contents of this<NEW_LINE>{<NEW_LINE>if (this != dest) {<NEW_LINE>copy(dest);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < other.numElements; i++) {<NEW_LINE>dest.add(other.elements[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
super.union(otherFlow, destFlow);
840,839
private void initIDEbefore() {<NEW_LINE>log(lvl, "initIDEbefore: entering");<NEW_LINE>optionsIDE = Preferences.userNodeForPackage(Sikulix.class);<NEW_LINE>if (jreVersion.startsWith("1.6")) {<NEW_LINE>String jyversion = "";<NEW_LINE>Properties prop = new Properties();<NEW_LINE>String fp = "org/python/version.properties";<NEW_LINE>InputStream ifp = null;<NEW_LINE>try {<NEW_LINE>ifp = classLoader.getResourceAsStream(fp);<NEW_LINE>if (ifp != null) {<NEW_LINE>prop.load(ifp);<NEW_LINE>ifp.close();<NEW_LINE>jyversion = prop.getProperty("jython.version");<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>if (!jyversion.isEmpty() && !jyversion.startsWith("2.5")) {<NEW_LINE>Sikulix.popError(String.format("The bundled Jython %s\n" + "cannot be used on Java 6!\n" + "Run setup again in this environment.\n" + "Click OK to terminate now", jyversion));<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Settings.isRunningIDE = true;<NEW_LINE>if (runningMac) {<NEW_LINE><MASK><NEW_LINE>if (!runningMacApp && !runningInProject) {<NEW_LINE>if (!Sikulix.popAsk("This use of SikuliX is not supported\n" + "and might lead to misbehavior!\n" + "Click YES to continue (you should be sure)\n" + "Click NO to terminate and check the situation.")) {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log(lvl, "initIDEbefore: leaving");<NEW_LINE>}
System.setProperty("apple.laf.useScreenMenuBar", "true");
1,581,846
public boolean configure(FeatureContext context) {<NEW_LINE>if (oAuth1Provider != null) {<NEW_LINE>context.register(oAuth1Provider);<NEW_LINE>}<NEW_LINE>context.register(OAuth1ServerFilter.class);<NEW_LINE>if (!context.getConfiguration().isRegistered(OAuth1SignatureFeature.class)) {<NEW_LINE>context.register(OAuth1SignatureFeature.class);<NEW_LINE>}<NEW_LINE>final Map<String, Object> properties = context.getConfiguration().getProperties();<NEW_LINE>final Boolean propertyResourceEnabled = OAuth1ServerProperties.getValue(properties, OAuth1ServerProperties.ENABLE_TOKEN_RESOURCES, null, Boolean.class);<NEW_LINE>boolean registerResources = propertyResourceEnabled != null ? propertyResourceEnabled : requestTokenUri != null & accessTokenUri != null;<NEW_LINE>if (registerResources) {<NEW_LINE>String requestUri = OAuth1ServerProperties.getValue(properties, OAuth1ServerProperties.REQUEST_TOKEN_URI, null, String.class);<NEW_LINE>if (requestUri == null) {<NEW_LINE>requestUri = requestTokenUri == null ? "requestToken" : requestTokenUri;<NEW_LINE>}<NEW_LINE>String accessUri = OAuth1ServerProperties.getValue(properties, OAuth1ServerProperties.ACCESS_TOKEN_URI, null, String.class);<NEW_LINE>if (accessUri == null) {<NEW_LINE>accessUri = accessTokenUri == null ? "accessToken" : accessTokenUri;<NEW_LINE>}<NEW_LINE>final Resource requestResource = Resource.builder(RequestTokenResource.class).path(requestUri).build();<NEW_LINE>final Resource accessResource = Resource.builder(AccessTokenResource.class).<MASK><NEW_LINE>context.register(new OAuthModelProcessor(requestResource, accessResource));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
path(accessUri).build();
1,654,186
protected void destroyBitmap() {<NEW_LINE>if (this.bitmap != null) {<NEW_LINE>// bitmap can be null if there is an error creating it<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>final int tileSize = this.getHeight();<NEW_LINE>synchronized (reusableTileBitmaps) {<NEW_LINE>int hash = composeHash(tileSize, this.bitmap.hasAlpha());<NEW_LINE>if (!reusableTileBitmaps.containsKey(hash)) {<NEW_LINE>// if the set specific to the tile size does not exist, create it. It will<NEW_LINE>// never be destroyed, but the contained bitmaps will be recycled if memory<NEW_LINE>// gets tight.<NEW_LINE>reusableTileBitmaps.put(hash, new HashSet<SoftReference<Bitmap>>());<NEW_LINE>}<NEW_LINE>Set<SoftReference<Bitmap>> sizeSpecificSet = reusableTileBitmaps.get(hash);<NEW_LINE>sizeSpecificSet.add(new SoftReference<<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.bitmap.recycle();<NEW_LINE>}<NEW_LINE>this.bitmap = null;<NEW_LINE>}<NEW_LINE>}
Bitmap>(this.bitmap));
471,751
private void syncBPartnerToCandidate(@NonNull final NewManualInvoiceCandidateBuilder candidate, @NonNull final OrgId orgId, @NonNull final JsonCreateInvoiceCandidatesRequestItem item) {<NEW_LINE>final boolean noBPartnerIdentifier = isEmpty(item.getBillPartnerIdentifier(), true);<NEW_LINE>final <MASK><NEW_LINE>if (noBPartnerIdentifier) {<NEW_LINE>throw new MissingPropertyException("billPartnerIdentifier", item);<NEW_LINE>}<NEW_LINE>final IdentifierString bpartnerIdentifier = IdentifierString.of(item.getBillPartnerIdentifier());<NEW_LINE>final BPartnerCompositeLookupKey bpartnerIdLookupKey = BPartnerCompositeLookupKey.ofIdentifierString(bpartnerIdentifier);<NEW_LINE>final BPartnerQuery query = bPartnerQueryService.createQueryFailIfNotExists(bpartnerIdLookupKey, orgId);<NEW_LINE>final BPartnerComposite bpartnerComposite;<NEW_LINE>try {<NEW_LINE>bpartnerComposite = bpartnerCompositeRepository.getSingleByQuery(query).get();<NEW_LINE>} catch (final AdempiereException e) {<NEW_LINE>throw MissingResourceException.builder().resourceName("billPartner").resourceIdentifier(bpartnerIdentifier.toJson()).parentResource(item).cause(e).build();<NEW_LINE>}<NEW_LINE>bpartnerInfo.bpartnerId(bpartnerComposite.getBpartner().getId());<NEW_LINE>final IdentifierString billLocationIdentifier = IdentifierString.ofOrNull(item.getBillLocationIdentifier());<NEW_LINE>if (billLocationIdentifier == null) {<NEW_LINE>final BPartnerLocation location = bpartnerComposite.extractBillToLocation().orElseThrow(() -> MissingResourceException.builder().resourceName("billLocation").parentResource(item).build());<NEW_LINE>bpartnerInfo.bpartnerLocationId(location.getId());<NEW_LINE>} else {<NEW_LINE>final BPartnerLocation location = bpartnerComposite.extractLocation(BPartnerCompositeRestUtils.createLocationFilterFor(billLocationIdentifier)).orElseThrow(() -> MissingResourceException.builder().resourceName("billLocation").resourceIdentifier(billLocationIdentifier.toJson()).parentResource(item).build());<NEW_LINE>bpartnerInfo.bpartnerLocationId(location.getId());<NEW_LINE>}<NEW_LINE>final IdentifierString billContactIdentifier = IdentifierString.ofOrNull(item.getBillContactIdentifier());<NEW_LINE>if (billContactIdentifier == null) {<NEW_LINE>// that's OK, because the contact is not mandatory in C_Invoice_Candidate<NEW_LINE>bpartnerInfo.contactId(null);<NEW_LINE>} else {<NEW_LINE>// extract the composite's location that has the given billContactIdentifier<NEW_LINE>final BPartnerContact contact = bpartnerComposite.extractContact(BPartnerCompositeRestUtils.createContactFilterFor(billContactIdentifier)).orElseThrow(() -> MissingResourceException.builder().resourceName("billContact").resourceIdentifier(billContactIdentifier.toJson()).parentResource(item).build());<NEW_LINE>bpartnerInfo.contactId(contact.getId());<NEW_LINE>}<NEW_LINE>candidate.billPartnerInfo(bpartnerInfo.build());<NEW_LINE>}
BPartnerInfoBuilder bpartnerInfo = BPartnerInfo.builder();
1,658,066
private ScanNode genScanNode() throws UserException {<NEW_LINE>ScanNode scanNode = null;<NEW_LINE>switch(exportTable.getType()) {<NEW_LINE>case OLAP:<NEW_LINE>scanNode = new OlapScanNode(new PlanNodeId(0), exportTupleDesc, "OlapScanNodeForExport");<NEW_LINE>scanNode.setColumnFilters(Maps.newHashMap());<NEW_LINE>((OlapScanNode) scanNode).setIsPreAggregation(false, "This an export operation");<NEW_LINE>((OlapScanNode) scanNode).setCanTurnOnPreAggr(false);<NEW_LINE>scanNode.init(analyzer);<NEW_LINE>((OlapScanNode) scanNode).selectBestRollupByRollupSelector(analyzer);<NEW_LINE>break;<NEW_LINE>case MYSQL:<NEW_LINE>scanNode = new MysqlScanNode(new PlanNodeId(0), exportTupleDesc, (MysqlTable) this.exportTable);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UserException(<MASK><NEW_LINE>}<NEW_LINE>scanNode.finalizeStats(analyzer);<NEW_LINE>return scanNode;<NEW_LINE>}
"Unsupported table type: " + exportTable.getType());
664,522
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (controller.getLibrary().hasCards()) {<NEW_LINE>Card card = controller.<MASK><NEW_LINE>Cards cards = new CardsImpl(card);<NEW_LINE>controller.revealCards(sourceObject.getIdName(), cards, game);<NEW_LINE>if (card != null) {<NEW_LINE>if (card.isCreature(game)) {<NEW_LINE>controller.moveCards(card, Zone.BATTLEFIELD, source, game);<NEW_LINE>} else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) {<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getLibrary().getFromTop(game);
1,813,660
public int doStartTag() throws JspException {<NEW_LINE>boolean getSize = ServletRequestUtils.getBooleanParameter(pageContext.getRequest(), param, false);<NEW_LINE>StringBuilder query = new StringBuilder();<NEW_LINE>query.append(param).append("=").append(!getSize);<NEW_LINE>String encoding = pageContext.getResponse().getCharacterEncoding();<NEW_LINE>for (String name : Collections.list(pageContext.getRequest().getParameterNames())) {<NEW_LINE>if (!param.equals(name)) {<NEW_LINE>try {<NEW_LINE>String value = ServletRequestUtils.getStringParameter(pageContext.getRequest(), name, "");<NEW_LINE>String encodedValue = URLEncoder.encode(value, encoding);<NEW_LINE>query.append("&").append(name).append("=").append(encodedValue);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new JspException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>pageContext.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("Exception printing query string to JspWriter", e);<NEW_LINE>throw new JspException(e);<NEW_LINE>}<NEW_LINE>return EVAL_BODY_INCLUDE;<NEW_LINE>}
getOut().print(query);
1,671,792
private void writeNodeForBinarySearch(FSTCompiler<T> fstCompiler, FSTCompiler.UnCompiledNode<T> nodeIn, long startAddress, int maxBytesPerArc) {<NEW_LINE>// Build the header in a buffer.<NEW_LINE>// It is a false/special arc which is in fact a node header with node flags followed by node<NEW_LINE>// metadata.<NEW_LINE>fstCompiler.fixedLengthArcsBuffer.resetPosition().writeByte(ARCS_FOR_BINARY_SEARCH).writeVInt(nodeIn.numArcs).writeVInt(maxBytesPerArc);<NEW_LINE>int headerLen = fstCompiler.fixedLengthArcsBuffer.getPosition();<NEW_LINE>// Expand the arcs in place, backwards.<NEW_LINE>long srcPos = fstCompiler.bytes.getPosition();<NEW_LINE>long destPos = startAddress + headerLen + nodeIn.numArcs * maxBytesPerArc;<NEW_LINE>assert destPos >= srcPos;<NEW_LINE>if (destPos > srcPos) {<NEW_LINE>fstCompiler.bytes.skipBytes((int) (destPos - srcPos));<NEW_LINE>for (int arcIdx = nodeIn.numArcs - 1; arcIdx >= 0; arcIdx--) {<NEW_LINE>destPos -= maxBytesPerArc;<NEW_LINE>int arcLen = fstCompiler.numBytesPerArc[arcIdx];<NEW_LINE>srcPos -= arcLen;<NEW_LINE>if (srcPos != destPos) {<NEW_LINE>assert destPos > srcPos : "destPos=" + destPos + " srcPos=" + srcPos + " arcIdx=" + arcIdx + " maxBytesPerArc=" + maxBytesPerArc + " arcLen=" + arcLen + " nodeIn.numArcs=" + nodeIn.numArcs;<NEW_LINE>fstCompiler.bytes.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write the header.<NEW_LINE>fstCompiler.bytes.writeBytes(startAddress, fstCompiler.fixedLengthArcsBuffer.getBytes(), 0, headerLen);<NEW_LINE>}
copyBytes(srcPos, destPos, arcLen);
1,440,833
public Consumer<? super EmbedCreateSpec> build() {<NEW_LINE>if (this.doesExceedCharacterLimit()) {<NEW_LINE>throw new IllegalArgumentException("Embed exceeds character limit of " + TOTAL_MAX_CHAR + " (has " + <MASK><NEW_LINE>}<NEW_LINE>return (EmbedCreateSpec t) -> {<NEW_LINE>if (!title.isEmpty()) {<NEW_LINE>t.setTitle(title.substring(0, Math.min(TITLE_MAX_CHAR, title.length())));<NEW_LINE>}<NEW_LINE>if (!url.isEmpty()) {<NEW_LINE>t.setUrl(url);<NEW_LINE>}<NEW_LINE>if (color != null) {<NEW_LINE>t.setColor(color);<NEW_LINE>}<NEW_LINE>if (timestamp != null) {<NEW_LINE>t.setTimestamp(timestamp);<NEW_LINE>}<NEW_LINE>if (!footerTxt.isEmpty()) {<NEW_LINE>t.setFooter(footerTxt.substring(0, Math.min(FOOTER_MAX_CHAR, footerTxt.length())), footerIcon);<NEW_LINE>}<NEW_LINE>if (!authorName.isEmpty()) {<NEW_LINE>t.setAuthor(authorName.substring(0, Math.min(AUTHOR_NAME_MAX_CHAR, authorName.length())), authorUrl, authorIcon);<NEW_LINE>}<NEW_LINE>if (!description.isEmpty()) {<NEW_LINE>t.setDescription(description.substring(0, Math.min(DESC_MAX_CHAR, description.length())));<NEW_LINE>}<NEW_LINE>if (!image.isEmpty()) {<NEW_LINE>t.setImage(image);<NEW_LINE>}<NEW_LINE>if (!thumbnail.isEmpty()) {<NEW_LINE>t.setThumbnail(thumbnail);<NEW_LINE>}<NEW_LINE>if (!appendedFields.isEmpty()) {<NEW_LINE>appendedFields.forEach((af) -> {<NEW_LINE>t.addField(af.name.substring(0, Math.min(FIELD_TITLE_MAX_CHAR, af.name.length())), af.value.substring(0, Math.min(FIELD_CONTENT_MAX_CHAR, af.value.length())), af.inline);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
this.getTotalVisibleCharacters() + " chars)");
959,964
public static ListVpcEndpointConnectionsResponse unmarshall(ListVpcEndpointConnectionsResponse listVpcEndpointConnectionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listVpcEndpointConnectionsResponse.setRequestId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.RequestId"));<NEW_LINE>listVpcEndpointConnectionsResponse.setNextToken(_ctx.stringValue("ListVpcEndpointConnectionsResponse.NextToken"));<NEW_LINE>listVpcEndpointConnectionsResponse.setMaxResults(_ctx.stringValue("ListVpcEndpointConnectionsResponse.MaxResults"));<NEW_LINE>List<Connection> connections = new ArrayList<Connection>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListVpcEndpointConnectionsResponse.Connections.Length"); i++) {<NEW_LINE>Connection connection = new Connection();<NEW_LINE>connection.setResourceOwner(_ctx.booleanValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].ResourceOwner"));<NEW_LINE>connection.setModifiedTime(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].ModifiedTime"));<NEW_LINE>connection.setBandwidth(_ctx.integerValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Bandwidth"));<NEW_LINE>connection.setEndpointOwnerId(_ctx.longValue<MASK><NEW_LINE>connection.setServiceId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].ServiceId"));<NEW_LINE>connection.setConnectionStatus(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].ConnectionStatus"));<NEW_LINE>connection.setEndpointId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].EndpointId"));<NEW_LINE>connection.setEndpointVpcId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].EndpointVpcId"));<NEW_LINE>List<Zone> zones = new ArrayList<Zone>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones.Length"); j++) {<NEW_LINE>Zone zone = new Zone();<NEW_LINE>zone.setVSwitchId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].VSwitchId"));<NEW_LINE>zone.setZoneId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ZoneId"));<NEW_LINE>zone.setResourceId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ResourceId"));<NEW_LINE>zone.setEniId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].EniId"));<NEW_LINE>zone.setZoneDomain(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ZoneDomain"));<NEW_LINE>zone.setZoneStatus(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ZoneStatus"));<NEW_LINE>zone.setReplacedResourceId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ReplacedResourceId"));<NEW_LINE>zone.setReplacedEniId(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].ReplacedEniId"));<NEW_LINE>zone.setStatusInfo(_ctx.stringValue("ListVpcEndpointConnectionsResponse.Connections[" + i + "].Zones[" + j + "].StatusInfo"));<NEW_LINE>zones.add(zone);<NEW_LINE>}<NEW_LINE>connection.setZones(zones);<NEW_LINE>connections.add(connection);<NEW_LINE>}<NEW_LINE>listVpcEndpointConnectionsResponse.setConnections(connections);<NEW_LINE>return listVpcEndpointConnectionsResponse;<NEW_LINE>}
("ListVpcEndpointConnectionsResponse.Connections[" + i + "].EndpointOwnerId"));
1,751,253
Proximity2DResult multiPathGetNearestCoordinate(MultiPath geom, Point2D inputPoint, boolean bTestPolygonInterior, boolean bCalculateLeftRightSide) {<NEW_LINE>if (geom.getType() == Geometry.Type.Polygon && bTestPolygonInterior) {<NEW_LINE>Envelope2D env = new Envelope2D();<NEW_LINE>geom.queryEnvelope2D(env);<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(null, env, false);<NEW_LINE>PolygonUtils.PiPResult pipResult;<NEW_LINE>if (bCalculateLeftRightSide)<NEW_LINE>pipResult = PolygonUtils.isPointInPolygon2D((Polygon) geom, inputPoint, 0.0);<NEW_LINE>else<NEW_LINE>pipResult = PolygonUtils.isPointInPolygon2D((Polygon) geom, inputPoint, tolerance);<NEW_LINE>if (pipResult != PolygonUtils.PiPResult.PiPOutside) {<NEW_LINE>Proximity2DResult result = new Proximity2DResult(inputPoint, 0, 0.0);<NEW_LINE>if (bCalculateLeftRightSide)<NEW_LINE>result.setRightSide(true);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SegmentIterator segIter = geom.querySegmentIterator();<NEW_LINE>Point2D closest = new Point2D();<NEW_LINE>int closestVertexIndex = -1;<NEW_LINE>int closestPathIndex = -1;<NEW_LINE>double closestDistanceSq = NumberUtils.doubleMax();<NEW_LINE>boolean bRight = false;<NEW_LINE>int num_candidates = 0;<NEW_LINE>while (segIter.nextPath()) {<NEW_LINE>while (segIter.hasNextSegment()) {<NEW_LINE>Segment segment = segIter.nextSegment();<NEW_LINE>double t = segment.getClosestCoordinate(inputPoint, false);<NEW_LINE>Point2D point = segment.getCoord2D(t);<NEW_LINE>double distanceSq = Point2D.sqrDistance(point, inputPoint);<NEW_LINE>if (distanceSq < closestDistanceSq) {<NEW_LINE>num_candidates = 1;<NEW_LINE>closest = point;<NEW_LINE>closestVertexIndex = segIter.getStartPointIndex();<NEW_LINE>closestPathIndex = segIter.getPathIndex();<NEW_LINE>closestDistanceSq = distanceSq;<NEW_LINE>} else if (distanceSq == closestDistanceSq) {<NEW_LINE>num_candidates++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Proximity2DResult result = new Proximity2DResult(closest, closestVertexIndex, Math.sqrt(closestDistanceSq));<NEW_LINE>if (bCalculateLeftRightSide) {<NEW_LINE>segIter.resetToVertex(closestVertexIndex, closestPathIndex);<NEW_LINE>Segment segment = segIter.nextSegment();<NEW_LINE>bRight = (Point2D.orientationRobust(inputPoint, segment.getStartXY(), segment<MASK><NEW_LINE>if (num_candidates > 1) {<NEW_LINE>Side_helper sideHelper = new Side_helper();<NEW_LINE>sideHelper.reset();<NEW_LINE>bRight = sideHelper.calc_side(inputPoint, bRight, geom, closestVertexIndex, closestPathIndex);<NEW_LINE>}<NEW_LINE>result.setRightSide(bRight);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.getEndXY()) < 0);
416,749
private BatchFinderSchema createBatchFinderSchema(ResourceMethodDescriptor resourceMethodDescriptor) {<NEW_LINE>BatchFinderSchema batchFinder = new BatchFinderSchema();<NEW_LINE>batchFinder.setName(resourceMethodDescriptor.getBatchFinderName());<NEW_LINE>String doc = _docsProvider.<MASK><NEW_LINE>if (doc != null) {<NEW_LINE>batchFinder.setDoc(doc);<NEW_LINE>}<NEW_LINE>ParameterSchemaArray parameters = createParameters(resourceMethodDescriptor);<NEW_LINE>if (parameters.size() > 0) {<NEW_LINE>batchFinder.setParameters(parameters);<NEW_LINE>}<NEW_LINE>StringArray assocKeys = createAssocKeyParameters(resourceMethodDescriptor);<NEW_LINE>if (assocKeys.size() > 0) {<NEW_LINE>batchFinder.setAssocKeys(assocKeys);<NEW_LINE>}<NEW_LINE>if (resourceMethodDescriptor.getCollectionCustomMetadataType() != null) {<NEW_LINE>batchFinder.setMetadata(createMetadataSchema(resourceMethodDescriptor));<NEW_LINE>}<NEW_LINE>final DataMap customAnnotation = resourceMethodDescriptor.getCustomAnnotationData();<NEW_LINE>String deprecatedDoc = _docsProvider.getMethodDeprecatedTag(resourceMethodDescriptor.getMethod());<NEW_LINE>if (deprecatedDoc != null) {<NEW_LINE>customAnnotation.put(DEPRECATED_ANNOTATION_NAME, deprecateDocToAnnotationMap(deprecatedDoc));<NEW_LINE>}<NEW_LINE>if (!customAnnotation.isEmpty()) {<NEW_LINE>batchFinder.setAnnotations(new CustomAnnotationContentSchemaMap(customAnnotation));<NEW_LINE>}<NEW_LINE>if (resourceMethodDescriptor.isPagingSupported()) {<NEW_LINE>batchFinder.setPagingSupported(true);<NEW_LINE>}<NEW_LINE>MaxBatchSizeSchema maxBatchSize = resourceMethodDescriptor.getMaxBatchSize();<NEW_LINE>if (maxBatchSize != null) {<NEW_LINE>batchFinder.setMaxBatchSize(maxBatchSize);<NEW_LINE>}<NEW_LINE>appendServiceErrors(batchFinder, resourceMethodDescriptor.getServiceErrors());<NEW_LINE>appendSuccessStatuses(batchFinder, resourceMethodDescriptor.getSuccessStatuses());<NEW_LINE>BatchFinder batchFinderAnnotation = resourceMethodDescriptor.getMethod().getAnnotation(BatchFinder.class);<NEW_LINE>batchFinder.setBatchParam(batchFinderAnnotation.batchParam());<NEW_LINE>return batchFinder;<NEW_LINE>}
getMethodDoc(resourceMethodDescriptor.getMethod());
1,630,275
public void testAsyncBulkheadTimeout() throws Exception {<NEW_LINE>syntheticTaskManager.runTest(() -> {<NEW_LINE>// runTaskWithTimeout has a timeout of 2s<NEW_LINE>// These tasks should run in parallel but should time out after 2s<NEW_LINE>SyntheticTask<Void> task1 = syntheticTaskManager.newTask();<NEW_LINE>task1.onInterruption(RETURN);<NEW_LINE>SyntheticTask<Void> task2 = syntheticTaskManager.newTask();<NEW_LINE>task2.onInterruption(RETURN);<NEW_LINE>Future<Void> future1 = bean1.runTaskWithTimeout(task1);<NEW_LINE>Future<Void> future2 = bean1.runTaskWithTimeout(task2);<NEW_LINE>// Check both tasks start<NEW_LINE>task1.assertStarts();<NEW_LINE>task2.assertStarts();<NEW_LINE>// Check they're running in parallel<NEW_LINE>assertFalse(future1.isDone());<NEW_LINE><MASK><NEW_LINE>// Check they eventually time out<NEW_LINE>assertFutureThrowsException(future1, org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class);<NEW_LINE>assertFutureThrowsException(future2, org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class);<NEW_LINE>SyntheticTask<Void> task3 = syntheticTaskManager.newTask();<NEW_LINE>Future<Void> future3 = bean1.runTaskWithTimeout(task3);<NEW_LINE>task3.complete();<NEW_LINE>assertFutureHasResult(future3, null);<NEW_LINE>});<NEW_LINE>}
assertFalse(future2.isDone());
699,495
private Collection<? extends Permissionable> findFolderAssetContainers(final User user, final String hostId, final String orderByParam, final boolean includeArchived, final Optional<String> contentTypeId, final Collection<Object> filterByNameCollection) {<NEW_LINE>try {<NEW_LINE>final Host host = this.hostAPI.find(hostId, user, false);<NEW_LINE>final List<Folder> subFolders = this.findContainersAssetsByHost(host, user, includeArchived);<NEW_LINE>List<Container> containers = this.getFolderContainers(host, user, subFolders, false);<NEW_LINE>if (contentTypeId.isPresent() && UtilMethods.isSet(contentTypeId.get())) {<NEW_LINE>containers = this.filterFileAssetContainersByContentType(containers, <MASK><NEW_LINE>}<NEW_LINE>if (UtilMethods.isSet(filterByNameCollection)) {<NEW_LINE>containers = containers.stream().filter(container -> {<NEW_LINE>for (final Object name : filterByNameCollection) {<NEW_LINE>if (container.getName().toLowerCase().contains(name.toString())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>if (UtilMethods.isSet(orderByParam)) {<NEW_LINE>switch(orderByParam.toLowerCase()) {<NEW_LINE>case "title asc":<NEW_LINE>containers.sort(Comparator.comparing(Container::getTitle));<NEW_LINE>break;<NEW_LINE>case "title desc":<NEW_LINE>containers.sort(Comparator.comparing(Container::getTitle).reversed());<NEW_LINE>break;<NEW_LINE>case "moddate asc":<NEW_LINE>containers.sort(Comparator.comparing(Container::getModDate));<NEW_LINE>break;<NEW_LINE>case "moddate desc":<NEW_LINE>containers.sort(Comparator.comparing(Container::getModDate).reversed());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return containers;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>}
contentTypeId.get(), user);
1,067,987
public String visitDeclared(DeclaredType type, Void v) {<NEW_LINE>String simpleName = simpleNameForType(type);<NEW_LINE>if (type.getTypeArguments().isEmpty()) {<NEW_LINE>return simpleName;<NEW_LINE>}<NEW_LINE>ImmutableList<String> typeArgumentNames = type.getTypeArguments().stream().map(t -> simpleNameForType(t)).collect(toImmutableList());<NEW_LINE>if (isMapOrMultimap(type) && typeArgumentNames.size() == 2) {<NEW_LINE>return String.format("%sOf%sTo%s", simpleName, typeArgumentNames.get(0)<MASK><NEW_LINE>}<NEW_LINE>List<String> parts = new ArrayList<>();<NEW_LINE>parts.add(simpleName);<NEW_LINE>parts.add("Of");<NEW_LINE>parts.addAll(typeArgumentNames.subList(0, typeArgumentNames.size() - 1));<NEW_LINE>if (typeArgumentNames.size() > 1) {<NEW_LINE>parts.add("And");<NEW_LINE>}<NEW_LINE>parts.add(getLast(typeArgumentNames));<NEW_LINE>return String.join("", parts);<NEW_LINE>}
, typeArgumentNames.get(1));
1,512,105
static <K> KStreamHolder<K> build(final KStreamHolder<K> stream, final StreamSelectKey<K> selectKey, final RuntimeBuildContext buildContext, final PartitionByParamsBuilder paramsBuilder) {<NEW_LINE>final LogicalSchema sourceSchema = stream.getSchema();<NEW_LINE>final QueryContext queryContext = selectKey.getProperties().getQueryContext();<NEW_LINE>final ProcessingLogger logger = buildContext.getProcessingLogger(queryContext);<NEW_LINE>final PartitionByParams<K> params = paramsBuilder.build(sourceSchema, stream.getExecutionKeyFactory(), selectKey.getKeyExpressions(), buildContext.getKsqlConfig(), buildContext.getFunctionRegistry(), logger);<NEW_LINE>final Mapper<K<MASK><NEW_LINE>final KStream<K, GenericRow> kStream = stream.getStream();<NEW_LINE>final KStream<K, GenericRow> reKeyed = kStream.map(mapper, Named.as(queryContext.formatContext() + "-SelectKey"));<NEW_LINE>return new KStreamHolder<>(reKeyed, params.getSchema(), stream.getExecutionKeyFactory().withQueryBuilder(buildContext));<NEW_LINE>}
> mapper = params.getMapper();
1,256,788
protected void sortArcs() {<NEW_LINE>int size = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>p[i] = i;<NEW_LINE>rank[i] = 0;<NEW_LINE>ccTp[i] = i;<NEW_LINE>Tree.getNeighborsOf(i).clear();<NEW_LINE>ccTree.removeNode(i);<NEW_LINE>ccTree.addNode(i);<NEW_LINE>size += g.getNeighborsOf(i).size();<NEW_LINE>}<NEW_LINE>assert size % 2 == 0;<NEW_LINE>size /= 2;<NEW_LINE>ISet nei;<NEW_LINE>int idx = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE><MASK><NEW_LINE>for (int j : nei) {<NEW_LINE>if (i < j) {<NEW_LINE>sortedArcs[idx] = i * n + j;<NEW_LINE>costs[i * n + j] = distMatrix[i][j];<NEW_LINE>idx++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = n; i < ccN; i++) {<NEW_LINE>ccTree.removeNode(i);<NEW_LINE>}<NEW_LINE>sorter.sort(sortedArcs, size, comparator);<NEW_LINE>int v;<NEW_LINE>activeArcs.clear();<NEW_LINE>activeArcs.set(0, size);<NEW_LINE>for (idx = 0; idx < size; idx++) {<NEW_LINE>v = sortedArcs[idx];<NEW_LINE>indexOfArc[v / n][v % n] = idx;<NEW_LINE>}<NEW_LINE>}
nei = g.getNeighborsOf(i);
25,847
private void renderStatus(MolecularAssemblerBlockEntity molecularAssembler, PoseStack ms, MultiBufferSource bufferIn, int combinedLightIn, AssemblerAnimationStatus status) {<NEW_LINE>double centerX = molecularAssembler.getBlockPos().getX() + 0.5f;<NEW_LINE>double centerY = molecularAssembler.getBlockPos().getY() + 0.5f;<NEW_LINE>double centerZ = molecularAssembler.getBlockPos().getZ() + 0.5f;<NEW_LINE>// Spawn crafting FX that fly towards the block's center<NEW_LINE><MASK><NEW_LINE>if (status.getTicksUntilParticles() <= 0) {<NEW_LINE>status.setTicksUntilParticles(4);<NEW_LINE>if (AppEngClient.instance().shouldAddParticles(particleRandom)) {<NEW_LINE>for (int x = 0; x < (int) Math.ceil(status.getSpeed() / 5.0); x++) {<NEW_LINE>minecraft.particleEngine.createParticle(ParticleTypes.CRAFTING, centerX, centerY, centerZ, 0, 0, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ItemStack is = status.getIs();<NEW_LINE>ItemRenderer itemRenderer = minecraft.getItemRenderer();<NEW_LINE>ms.pushPose();<NEW_LINE>// Translate to center of block<NEW_LINE>ms.translate(0.5, 0.5, 0.5);<NEW_LINE>if (!(is.getItem() instanceof BlockItem)) {<NEW_LINE>ms.translate(0, -0.3f, 0);<NEW_LINE>} else {<NEW_LINE>ms.translate(0, -0.2f, 0);<NEW_LINE>}<NEW_LINE>itemRenderer.renderStatic(is, TransformType.GROUND, combinedLightIn, OverlayTexture.NO_OVERLAY, ms, bufferIn, 0);<NEW_LINE>ms.popPose();<NEW_LINE>}
Minecraft minecraft = Minecraft.getInstance();
443,253
private void runExecutableNode(final ExecutableNode node) throws IOException {<NEW_LINE>// Collect output props from the job's dependencies.<NEW_LINE>prepareJobProperties(node);<NEW_LINE>node.setStatus(Status.QUEUED);<NEW_LINE>// Attach Ramp Props if there is any desired properties<NEW_LINE>final String jobId = node.getId();<NEW_LINE>final String jobType = Optional.ofNullable(node.getInputProps()).map(props -> props.getString("type")).orElse(null);<NEW_LINE>if (jobType != null && jobId != null) {<NEW_LINE>final Props rampProps = this.flow.getRampPropsForJob(jobId, jobType);<NEW_LINE>if (rampProps != null) {<NEW_LINE>this.flowIsRamping = true;<NEW_LINE>this.logger.info(String.format("RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s, job.id = %s, job.type = %s, props = %s)", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName(), jobId, jobType, rampProps.toString()));<NEW_LINE>node.setRampProps(rampProps);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.logger.warn(String.format("RAMP_FLOW_ATTACH_PROPS_FOR_JOB : (flow.ExecId = %d, flow.Id = %s, flow.flowName = %s) does not have Job Type or Id", this.flow.getExecutionId(), this.flow.getId(), this.flow.getFlowName()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>this.logger.info("Submitting job '" + node.getNestedId() + "' to run.");<NEW_LINE>try {<NEW_LINE>// Job starts to queue<NEW_LINE>runner.setTimeInQueue(System.currentTimeMillis());<NEW_LINE>this.executorService.submit(runner);<NEW_LINE>this.activeJobRunners.add(runner);<NEW_LINE>} catch (final RejectedExecutionException e) {<NEW_LINE>this.logger.error(e);<NEW_LINE>}<NEW_LINE>}
final JobRunner runner = createJobRunner(node);
991,691
private void generateHeaderFile(Hashtable headerHashtable, File nlsFile, String headerPath, HeaderBuffer headerBuffer) throws IOException, FileNotFoundException {<NEW_LINE>if (!headerHashtable.containsKey(headerBuffer.getHeaderName())) {<NEW_LINE>StringBuffer buffer = new StringBuffer();<NEW_LINE>buffer.append(headerBuffer.toString());<NEW_LINE>if (differentFromCopyOnDisk(headerPath + headerBuffer.getHeaderName(), buffer)) {<NEW_LINE>File headerFile = new File(headerPath + headerBuffer.getHeaderName());<NEW_LINE>FileWriter headerFileWriter = new FileWriter(headerFile);<NEW_LINE>headerFileWriter.write(headerBuffer.toString());<NEW_LINE>headerHashtable.put(headerPath + headerBuffer.getHeaderName(), headerBuffer);<NEW_LINE>headerFileWriter.close();<NEW_LINE>dp("** Generated " + headerFile.getPath());<NEW_LINE>totalHeaderFilesCreated++;<NEW_LINE>} else {<NEW_LINE>totalHeaderFilesSkipped++;<NEW_LINE>dp("** Skipped writing [same as on file system]: " + <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>HeaderBuffer oldBuffer = (HeaderBuffer) headerHashtable.get(headerBuffer.getHeaderName());<NEW_LINE>if (!oldBuffer.equals(headerBuffer))<NEW_LINE>failure("Header files generated from " + oldBuffer.getNLSFileName() + " and " + nlsFile.getName() + " do not match");<NEW_LINE>headerBuffer.clear();<NEW_LINE>}<NEW_LINE>}
headerPath + headerBuffer.getHeaderName());
543,258
public void encode(FacesContext context, DataTableRenderer renderer, DataTable table) throws IOException {<NEW_LINE>Map<String, String> params = context.getExternalContext().getRequestParameterMap();<NEW_LINE>String <MASK><NEW_LINE>String[] cellInfo = params.get(clientId + "_cellInfo").split(",");<NEW_LINE>int rowIndex = Integer.parseInt(cellInfo[0]);<NEW_LINE>int cellIndex = Integer.parseInt(cellInfo[1]);<NEW_LINE>int i = -1;<NEW_LINE>UIColumn column = null;<NEW_LINE>for (UIColumn col : table.getColumns()) {<NEW_LINE>if (col.isRendered()) {<NEW_LINE>i++;<NEW_LINE>if (i == cellIndex) {<NEW_LINE>column = col;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (column == null) {<NEW_LINE>throw new FacesException("No column found for cellIndex: " + cellIndex);<NEW_LINE>}<NEW_LINE>table.setRowIndex(rowIndex);<NEW_LINE>if (column.isDynamic()) {<NEW_LINE>DynamicColumn dynamicColumn = (DynamicColumn) column;<NEW_LINE>dynamicColumn.applyStatelessModel();<NEW_LINE>}<NEW_LINE>if (table.isCellEditCancelRequest(context) || table.isCellEditInitRequest(context)) {<NEW_LINE>column.getCellEditor().getFacet("input").encodeAll(context);<NEW_LINE>} else {<NEW_LINE>column.getCellEditor().getFacet("output").encodeAll(context);<NEW_LINE>}<NEW_LINE>if (column.isDynamic()) {<NEW_LINE>((DynamicColumn) column).cleanStatelessModel();<NEW_LINE>}<NEW_LINE>}
clientId = table.getClientId(context);
82,620
public void recreate(int S_Resource_ID, Timestamp date) {<NEW_LINE>// Calculate Start Day<NEW_LINE>GregorianCalendar cal = new GregorianCalendar();<NEW_LINE>cal.setTime(date);<NEW_LINE>cal.set(Calendar.HOUR, 0);<NEW_LINE>cal.set(Calendar.MINUTE, 0);<NEW_LINE>cal.set(Calendar.SECOND, 0);<NEW_LINE>cal.<MASK><NEW_LINE>if (m_type == TYPE_WEEK)<NEW_LINE>cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());<NEW_LINE>else if (m_type == TYPE_MONTH)<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, 1);<NEW_LINE>m_startDate = new Timestamp(cal.getTimeInMillis());<NEW_LINE>// Calculate End Date<NEW_LINE>cal.add(m_type, 1);<NEW_LINE>m_endDate = new Timestamp(cal.getTimeInMillis());<NEW_LINE>//<NEW_LINE>log.config("(" + m_type + ") Resource_ID=" + S_Resource_ID + ": " + m_startDate + "->" + m_endDate);<NEW_LINE>// Create Slots<NEW_LINE>MAssignmentSlot[] mas = m_model.getAssignmentSlots(S_Resource_ID, m_startDate, m_endDate, null, true, null);<NEW_LINE>MAssignmentSlot[] mts = m_model.getDayTimeSlots();<NEW_LINE>// Set Panels<NEW_LINE>timePanel.setTimeSlots(mts);<NEW_LINE>schedulePanel.setAssignmentSlots(mas, S_Resource_ID, m_startDate, m_endDate);<NEW_LINE>// Set Height<NEW_LINE>schedulePanel.setHeight(timePanel.getPreferredSize().height);<NEW_LINE>// repaint();<NEW_LINE>}
set(Calendar.MILLISECOND, 0);
1,478,133
private boolean attachVolumeToVM(Long zoneId, String restoredVolumeLocation, List<Backup.VolumeInfo> backedUpVolumes, String volumeUuid, VMInstanceVO vm, String datastoreUuid, Backup backup) throws Exception {<NEW_LINE>HypervisorGuru guru = hypervisorGuruManager.getGuru(vm.getHypervisorType());<NEW_LINE>Backup.VolumeInfo volumeInfo = getVolumeInfo(backedUpVolumes, volumeUuid);<NEW_LINE>if (volumeInfo == null) {<NEW_LINE>throw new CloudRuntimeException("Failed to find volume in the backedup volumes of ID " + volumeUuid);<NEW_LINE>}<NEW_LINE>volumeInfo.setType(Volume.Type.DATADISK);<NEW_LINE>LOG.debug("Attaching the restored volume to VM " + vm.getId());<NEW_LINE>StoragePoolVO pool = primaryDataStoreDao.findByUuid(datastoreUuid);<NEW_LINE>try {<NEW_LINE>return guru.attachRestoredVolumeToVirtualMachine(zoneId, restoredVolumeLocation, volumeInfo, vm, <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CloudRuntimeException("Error attach restored volume to VM " + vm.getUuid() + " due to: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
pool.getId(), backup);
1,566,781
protected void internalRemoveOffloadPolicies(AsyncResponse asyncResponse) {<NEW_LINE>validateNamespacePolicyOperation(namespaceName, PolicyName.OFFLOAD, PolicyOperation.WRITE);<NEW_LINE>validatePoliciesReadOnlyAccess();<NEW_LINE>try {<NEW_LINE>namespaceResources().setPoliciesAsync(namespaceName, (policies) -> {<NEW_LINE>policies.offload_policies = null;<NEW_LINE>return policies;<NEW_LINE>}).thenApply(r -> {<NEW_LINE>log.info("[{}] Successfully remove offload configuration: namespace={}", clientAppId(), namespaceName);<NEW_LINE>asyncResponse.resume(Response.noContent().build());<NEW_LINE>return null;<NEW_LINE>}).exceptionally(e -> {<NEW_LINE>log.error("[{}] Failed to remove offload configuration for namespace {}", clientAppId(), namespaceName, e);<NEW_LINE>asyncResponse.resume(e.getCause() instanceof NotFoundException ? new RestException(Status.CONFLICT, "Concurrent modification") : new RestException(e));<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("[{}] Failed to remove offload configuration for namespace {}", <MASK><NEW_LINE>asyncResponse.resume(new RestException(e));<NEW_LINE>}<NEW_LINE>}
clientAppId(), namespaceName, e);
123,397
private void addGroupingToPanel(JPanel destPanel) {<NEW_LINE>DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();<NEW_LINE>// Note: position of these elements in the menu *must* match the<NEW_LINE>// corresponding ProxyControl.GROUPING_* values.<NEW_LINE>// $NON-NLS-1$<NEW_LINE>m.addElement(JMeterUtils.getResString("grouping_no_groups"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>m.addElement(JMeterUtils.getResString("grouping_add_separators"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>m.addElement(JMeterUtils.getResString("grouping_in_controllers"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>m.addElement(JMeterUtils.getResString("grouping_store_first_only"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers"));<NEW_LINE>groupingMode = new JComboBox<>(m);<NEW_LINE>groupingMode.setSelectedIndex(0);<NEW_LINE>groupingMode.addItemListener(this);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JLabel label2 = new JLabel<MASK><NEW_LINE>label2.setLabelFor(groupingMode);<NEW_LINE>destPanel.add(label2);<NEW_LINE>destPanel.add(groupingMode, "growx, span");<NEW_LINE>}
(JMeterUtils.getResString("grouping_mode"));
824,091
public void loadQueryPrerequisites() throws Exception {<NEW_LINE>if (QUERY_PREREQUISITES_CONFIG.exists()) {<NEW_LINE>Map<String, String> properties = new HashMap<>(loadProperties(QUERY_PREREQUISITES_CONFIG));<NEW_LINE>String factoryName = properties.remove(QUERY_PREREQUISITES_PROPERTY_NAME);<NEW_LINE>checkArgument(!isNullOrEmpty(factoryName), "Query Prerequisites configuration %s does not contain %s", QUERY_PREREQUISITES_CONFIG.getAbsoluteFile(), QUERY_PREREQUISITES_PROPERTY_NAME);<NEW_LINE>log.info("-- Loading query prerequisites factory --");<NEW_LINE>QueryPrerequisitesFactory <MASK><NEW_LINE>checkState(queryPrerequisitesFactory != null, "Query prerequisites factory %s is not registered", factoryName);<NEW_LINE>QueryPrerequisites queryPrerequisites = queryPrerequisitesFactory.create(properties);<NEW_LINE>checkState(this.queryPrerequisites.compareAndSet(defaultQueryPrerequisites, queryPrerequisites), "Query prerequisites has already been set");<NEW_LINE>log.info("-- Loaded query prerequisites %s --", factoryName);<NEW_LINE>}<NEW_LINE>}
queryPrerequisitesFactory = queryPrerequisitesFactories.get(factoryName);
753,201
public static void main(String[] args) {<NEW_LINE>final String resultsFolder = "target" + File.separatorChar + "results";<NEW_LINE>final String reportsFolder = "target" + File.separatorChar + "reports";<NEW_LINE>String longTermBenchmarkResultFilename = System.getProperty("longTermBenchmarkResultFile");<NEW_LINE>if (longTermBenchmarkResultFilename != null) {<NEW_LINE>File longTermBenchmarkResultFile = new File(longTermBenchmarkResultFilename);<NEW_LINE>longTermBenchmarkResultFile.getParentFile().mkdirs();<NEW_LINE>if (longTermBenchmarkResultFile.exists()) {<NEW_LINE>// Do nothing, append current results later<NEW_LINE>} else {<NEW_LINE>FileUtil.appendStringToFile("name;" + "number of runs;" + "database;" + "history level;" + "starttime;" + "platform;" + <MASK><NEW_LINE>}<NEW_LINE>TabularResultSet longTermResultTable = new BenchmarkLongtermAggregator(resultsFolder).execute();<NEW_LINE>FileUtil.appendStringToFile(CsvUtil.resultSetAsCsv(longTermResultTable), longTermBenchmarkResultFilename);<NEW_LINE>}<NEW_LINE>writeReport(resultsFolder, reportsFolder, "benchmark", new BenchmarkAggregator(resultsFolder), "Benchmark Duration Report");<NEW_LINE>}
"number of threads;" + "duration;" + "throughput", longTermBenchmarkResultFilename);
1,426,132
public Node serialize(Map value, Set<Object> serializedObjects, NodeMapper mapper) {<NEW_LINE>Map<StringNode, Node> mappings = new LinkedHashMap<>();<NEW_LINE>Set<Map.Entry<Object, Object>> entries = (Set<Map.Entry<Object, Object>>) value.entrySet();<NEW_LINE>// Iterate over the map entries and populate map entries for an ObjectNode.<NEW_LINE>for (Map.Entry<Object, Object> entry : entries) {<NEW_LINE>// Serialize the key and require that it is serialized as a StringNode.<NEW_LINE>Node key = mapper.serialize(entry.getKey(), serializedObjects);<NEW_LINE>if (key instanceof StringNode) {<NEW_LINE>mappings.put((StringNode) key, mapper.serialize(entry.getValue(), serializedObjects));<NEW_LINE>} else {<NEW_LINE>throw new NodeSerializationException("Unable to write Map key because it was not serialized as a string: " + entry.getKey() + " -> " + Node.printJson(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
ObjectNode(mappings, SourceLocation.NONE);
652,650
private void tryAutoInitParaApp() {<NEW_LINE>String rootSecret = null;<NEW_LINE>String confFile = System.getProperty("config.file", "application.conf");<NEW_LINE>if (!CONF.autoInitWithRootAppSecretKey().isBlank()) {<NEW_LINE>rootSecret = CONF.autoInitWithRootAppSecretKey().trim();<NEW_LINE>} else if (!CONF.autoInitWithParaConfigFile().isBlank()) {<NEW_LINE>com.typesafe.config.Config paraConfig = ConfigFactory.parseFile(new File<MASK><NEW_LINE>if (paraConfig.hasPath("para.root_secret_key")) {<NEW_LINE>rootSecret = paraConfig.getString("para.root_secret_key");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rootSecret != null) {<NEW_LINE>ParaClient pcRoot = new ParaClient(App.id(Config.PARA), rootSecret);<NEW_LINE>pcRoot.setEndpoint(CONF.paraEndpoint());<NEW_LINE>String childApp = CONF.paraAccessKey();<NEW_LINE>boolean connectionOk = pcRoot.getTimestamp() > 0;<NEW_LINE>if (connectionOk && (pcRoot.getCount("app") == 1 || pcRoot.read(childApp) == null)) {<NEW_LINE>Map<String, Object> credentials = pcRoot.invokeGet("_setup/" + Utils.urlEncode(App.identifier(childApp)), null, Map.class);<NEW_LINE>if (credentials.containsKey("accessKey") && credentials.containsKey("secretKey")) {<NEW_LINE>String acceessKey = (String) credentials.get("accessKey");<NEW_LINE>System.setProperty("scoold.para_access_key", acceessKey);<NEW_LINE>System.setProperty("scoold.para_secret_key", (String) credentials.get("secretKey"));<NEW_LINE>if (StringUtils.isBlank(CONF.appSecretKey())) {<NEW_LINE>System.setProperty("scoold.app_secret_key", Utils.generateSecurityToken(32));<NEW_LINE>}<NEW_LINE>logger.info("Auto-init succeeded - created new app '{}' and saved keys to {}.", acceessKey, confFile);<NEW_LINE>CONF.store();<NEW_LINE>}<NEW_LINE>} else if (!connectionOk) {<NEW_LINE>logger.error("Failed to auto-initialize {} - try updating your app's credentials manually.", childApp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!Files.exists(Paths.get(confFile).toAbsolutePath())) {<NEW_LINE>System.setProperty("scoold.app_name", CONF.appName());<NEW_LINE>logger.info("No configuration file found - configuration saved in {}.", confFile);<NEW_LINE>CONF.store();<NEW_LINE>}<NEW_LINE>}
(CONF.autoInitWithParaConfigFile()));
912,004
public Tag toTag(boolean force) {<NEW_LINE>int argSize = items.size();<NEW_LINE>if (argSize == 0)<NEW_LINE>return new ListTag();<NEW_LINE>ListTag tag = new ListTag();<NEW_LINE>if (argSize == 1) {<NEW_LINE>tag.add(items.get(0).toTag(force));<NEW_LINE>return tag;<NEW_LINE>}<NEW_LINE>// figuring out the types<NEW_LINE>List<Tag> tags = new ArrayList<>();<NEW_LINE>items.forEach(v -> tags.add(v.toTag(force)));<NEW_LINE>Set<TagTypeCompat> cases = EnumSet.noneOf(TagTypeCompat.class);<NEW_LINE>tags.forEach(t -> cases.add(TagTypeCompat.getType(t)));<NEW_LINE>if (// well, one type of items<NEW_LINE>cases.size() == 1) {<NEW_LINE>tag.addAll(tags);<NEW_LINE>return tag;<NEW_LINE>}<NEW_LINE>if (// incompatible types<NEW_LINE>cases.contains(TagTypeCompat.LIST) || cases.contains(TagTypeCompat.MAP) || cases.contains(TagTypeCompat.STRING)) {<NEW_LINE>if (!force)<NEW_LINE>throw new NBTSerializableValue.IncompatibleTypeException(this);<NEW_LINE>tags.forEach(t -> tag.add(StringTag.valueOf(t.getAsString())));<NEW_LINE>return tag;<NEW_LINE>}<NEW_LINE>// only numbers / mixed types<NEW_LINE>if (cases.contains(TagTypeCompat.DBL)) {<NEW_LINE>tags.forEach(t -> tag.add(DoubleTag.valueOf(((NumericTag) t<MASK><NEW_LINE>} else {<NEW_LINE>tags.forEach(t -> tag.add(LongTag.valueOf(((NumericTag) t).getAsLong())));<NEW_LINE>}<NEW_LINE>return tag;<NEW_LINE>}
).getAsDouble())));
1,147,726
protected List<I_M_PriceList_Version> retrieveCustomPLVsToMutate(@NonNull final PriceListId basePriceListId) {<NEW_LINE>final String maxValidFromTypedFilter = I_M_PriceList_Version.Table_Name + "." + I_M_PriceList_Version.COLUMNNAME_ValidFrom + " = ( SELECT max (v." + I_M_PriceList_Version.COLUMNNAME_ValidFrom + ") FROM " + I_M_PriceList_Version.Table_Name + " v " + " WHERE " + I_M_PriceList_Version.Table_Name + "." + I_M_PriceList_Version.COLUMNNAME_M_PriceList_ID + " = v." + I_M_PriceList_Version.COLUMNNAME_M_PriceList_ID + ") ";<NEW_LINE>final IQueryFilter<I_M_PriceList_Version> maxValidFromFilter = TypedSqlQueryFilter.of(maxValidFromTypedFilter);<NEW_LINE>final IQuery<I_C_BPartner> customerQuery = queryBL.createQueryBuilder(I_C_BPartner.class).addOnlyActiveRecordsFilter().addEqualsFilter(I_C_BPartner.COLUMNNAME_IsCustomer, true).addEqualsFilter(I_C_BPartner.COLUMNNAME_IsAllowPriceMutation, true).create();<NEW_LINE>final I_M_PriceList basePriceList = getById(basePriceListId);<NEW_LINE>return queryBL.createQueryBuilder(I_M_PriceList.class).addEqualsFilter(I_M_PriceList.COLUMN_BasePriceList_ID, basePriceListId).addEqualsFilter(I_M_PriceList.COLUMNNAME_C_Country_ID, basePriceList.getC_Country_ID()).addEqualsFilter(I_M_PriceList.COLUMNNAME_C_Currency_ID, basePriceList.getC_Currency_ID()).addInSubQueryFilter().matchingColumnNames(I_M_PriceList.COLUMNNAME_M_PricingSystem_ID, I_C_BPartner.COLUMNNAME_M_PricingSystem_ID).subQuery(customerQuery).end().andCollectChildren(I_M_PriceList_Version.COLUMN_M_PriceList_ID).addOnlyActiveRecordsFilter().addNotEqualsFilter(I_M_PriceList_Version.COLUMNNAME_M_PriceList_ID, basePriceListId).filter(maxValidFromFilter).create(<MASK><NEW_LINE>}
).list(I_M_PriceList_Version.class);
899,490
final DeleteEndpointResult executeDeleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEndpointRequest> request = null;<NEW_LINE>Response<DeleteEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteEndpointRequest));<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, "Comprehend");<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>HttpResponseHandler<AmazonWebServiceResponse<DeleteEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEndpointResultJsonUnmarshaller());<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, "DeleteEndpoint");
1,479,321
public PutAssetPropertyValueEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PutAssetPropertyValueEntry putAssetPropertyValueEntry = new PutAssetPropertyValueEntry();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("entryId")) {<NEW_LINE>putAssetPropertyValueEntry.setEntryId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("assetId")) {<NEW_LINE>putAssetPropertyValueEntry.setAssetId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("propertyId")) {<NEW_LINE>putAssetPropertyValueEntry.setPropertyId(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("propertyAlias")) {<NEW_LINE>putAssetPropertyValueEntry.setPropertyAlias(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("propertyValues")) {<NEW_LINE>putAssetPropertyValueEntry.setPropertyValues(new ListUnmarshaller<AssetPropertyValue>(AssetPropertyValueJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return putAssetPropertyValueEntry;<NEW_LINE>}
().unmarshall(context));
959,793
public static void performMigration(final Context ctx, final Geocache cache, final Waypoint w, final Runnable actionAfterMigration) {<NEW_LINE>if (!needsMigration(w)) {<NEW_LINE>actionAfterMigration.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final CalculatedCoordinateMigrator mig = new CalculatedCoordinateMigrator(cache, w);<NEW_LINE>SimpleDialog.ofContext(ctx).setTitle(TextParam.id(R.string.calccoord_migrate_title)).setMessage(TextParam.text(mig.getMigrationInformationMarkup()).setMarkdown(true)).setPositiveButton(TextParam.id(R.string.calccoord_migrate_migrate)).setNegativeButton(TextParam.id(R.string.calccoord_migrate_cancel)).setNeutralButton(TextParam.id(R.string.calccoord_migrate_dismiss)).show((v, i) -> {<NEW_LINE>w.setUserNote(w.getUserNote() + "\n" + LocalizationUtils.getString(R.string.calccoord_migrate_migrate_usernote_praefix) + ":" + mig.getMigrationData().getMigrationNotes());<NEW_LINE>for (Map.Entry<String, String> newVar : mig.getNewCacheVariables().entrySet()) {<NEW_LINE>cache.getVariables().addVariable(newVar.getKey(), newVar.getValue());<NEW_LINE>}<NEW_LINE>cache.getVariables().saveState();<NEW_LINE><MASK><NEW_LINE>cc.setType(mig.getMigrationData().getType());<NEW_LINE>cc.setLatitudePattern(mig.getMigrationData().getLatPattern());<NEW_LINE>cc.setLongitudePattern(mig.getMigrationData().getLonPattern());<NEW_LINE>w.setCalcStateConfig(cc.toConfig());<NEW_LINE>cache.addOrChangeWaypoint(w, true);<NEW_LINE>actionAfterMigration.run();<NEW_LINE>}, (v, i) -> {<NEW_LINE>actionAfterMigration.run();<NEW_LINE>}, (v, i) -> {<NEW_LINE>// dismiss calculated coordinate data<NEW_LINE>w.setUserNote(w.getUserNote() + "\n" + LocalizationUtils.getString(R.string.calccoord_migrate_dismiss_usernote_praefix) + ":" + mig.getMigrationData().getMigrationNotes());<NEW_LINE>w.setCalcStateConfig(null);<NEW_LINE>cache.addOrChangeWaypoint(w, true);<NEW_LINE>actionAfterMigration.run();<NEW_LINE>});<NEW_LINE>}
final CalculatedCoordinate cc = new CalculatedCoordinate();
1,571,922
public void init(IFilterConfig filterConfig) throws ServletException {<NEW_LINE>try {<NEW_LINE>// init the filter instance<NEW_LINE>_filterState = FILTER_STATE_INITIALIZING;<NEW_LINE>// LIDB-3598: begin<NEW_LINE>this._filterConfig = filterConfig;<NEW_LINE>if (_eventSource != null && _eventSource.hasFilterListeners()) {<NEW_LINE>_eventSource.onFilterStartInit(getFilterEvent());<NEW_LINE>// LIDB-3598: end<NEW_LINE>_filterInstance.init(filterConfig);<NEW_LINE>// LIDB-3598: begin<NEW_LINE>_eventSource.onFilterFinishInit(getFilterEvent());<NEW_LINE>// LIDB-3598: end<NEW_LINE>} else {<NEW_LINE>_filterInstance.init(filterConfig);<NEW_LINE>}<NEW_LINE>_filterState = FILTER_STATE_AVAILABLE;<NEW_LINE>} catch (Throwable th) {<NEW_LINE>if (_eventSource != null && _eventSource.hasFilterErrorListeners()) {<NEW_LINE>FilterErrorEvent errorEvent = getFilterErrorEvent(th);<NEW_LINE>_eventSource.onFilterInitError(errorEvent);<NEW_LINE>}<NEW_LINE>com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init", "111", this);<NEW_LINE>_filterState = FILTER_STATE_UNAVAILABLE;<NEW_LINE>throw new ServletException(MessageFormat.format("Filter [{0}]: could not be initialized", new Object[<MASK><NEW_LINE>}<NEW_LINE>}
] { _filterName }), th);
809,778
public <E> void visitCtCase(CtCase<E> caseStatement) {<NEW_LINE>enterCtStatement(caseStatement);<NEW_LINE>if (caseStatement.getCaseExpression() != null) {<NEW_LINE>printer.writeKeyword("case").writeSpace();<NEW_LINE>List<CtExpression<E>> caseExpressions = caseStatement.getCaseExpressions();<NEW_LINE>for (int i = 0; i < caseExpressions.size(); i++) {<NEW_LINE>CtExpression<E> caseExpression = caseExpressions.get(i);<NEW_LINE>// writing enum case expression<NEW_LINE>if (caseExpression instanceof CtFieldAccess) {<NEW_LINE>final CtFieldReference variable = ((CtFieldAccess) caseExpression).getVariable();<NEW_LINE>// In noclasspath mode, we don't have always the type of the declaring type.<NEW_LINE>if (variable.getType() != null && variable.getDeclaringType() != null && variable.getType().getQualifiedName().equals(variable.getDeclaringType().getQualifiedName())) {<NEW_LINE>printer.writeIdentifier(variable.getSimpleName());<NEW_LINE>} else {<NEW_LINE>scan(caseExpression);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>scan(caseExpression);<NEW_LINE>}<NEW_LINE>if (i != caseExpressions.size() - 1) {<NEW_LINE>printer.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>printer.writeKeyword("default");<NEW_LINE>}<NEW_LINE>String separator = caseStatement.getCaseKind() == CaseKind.ARROW ? "->" : ":";<NEW_LINE>printer.writeSpace().writeSeparator(separator).incTab();<NEW_LINE>for (CtStatement statement : caseStatement.getStatements()) {<NEW_LINE>printer.writeln();<NEW_LINE>elementPrinterHelper.writeStatement(statement);<NEW_LINE>}<NEW_LINE>printer.decTab();<NEW_LINE>exitCtStatement(caseStatement);<NEW_LINE>}
writeSeparator(",").writeSpace();
358,242
private static AttributedStringBuilder _highlightSyntax(String syntax, StyleResolver resolver, boolean subcommand) {<NEW_LINE>StringBuilder indent = new StringBuilder();<NEW_LINE>for (char c : syntax.toCharArray()) {<NEW_LINE>if (c != ' ') {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>indent.append(c);<NEW_LINE>}<NEW_LINE>AttributedStringBuilder asyntax = new AttributedStringBuilder().append(syntax.substring<MASK><NEW_LINE>// command<NEW_LINE>asyntax.styleMatches(Pattern.compile("(?:^)([a-z]+[a-zA-Z0-9-]*)\\b"), Collections.singletonList(resolver.resolve(".co")));<NEW_LINE>if (!subcommand) {<NEW_LINE>// argument<NEW_LINE>asyntax.styleMatches(Pattern.compile("(?:<|\\[|\\s|=)([A-Za-z]+[A-Za-z_-]*)\\b"), Collections.singletonList(resolver.resolve(".ar")));<NEW_LINE>// option<NEW_LINE>asyntax.styleMatches(Pattern.compile("(?:^|\\s|\\[)(-\\$|-\\?|[-]{1,2}[A-Za-z-]+\\b)"), Collections.singletonList(resolver.resolve(".op")));<NEW_LINE>}<NEW_LINE>return new AttributedStringBuilder().append(indent).append(asyntax);<NEW_LINE>}
(indent.length()));
1,722,017
private String mapToMetaCustomModelFields(List<String> fields, String modelName, String searchOperator, boolean multiple, String resultVar) throws ClassNotFoundException {<NEW_LINE>StringBuilder scriptBuilder = new StringBuilder();<NEW_LINE>scriptBuilder.append("def _query = null\n");<NEW_LINE>String varName = Beans.get(WkfCommonService<MASK><NEW_LINE>List<MetaJsonField> metaJsonFields = Beans.get(MetaJsonFieldRepository.class).all().filter("self.name in (?1) and self.jsonModel.name = ?2", fields, modelName).fetch();<NEW_LINE>log.debug("Json fields founds: {}", metaJsonFields);<NEW_LINE>for (MetaJsonField field : metaJsonFields) {<NEW_LINE>addJsonField(searchOperator, multiple, resultVar, scriptBuilder, varName, field);<NEW_LINE>scriptBuilder.append("\n");<NEW_LINE>}<NEW_LINE>return scriptBuilder.toString();<NEW_LINE>}
.class).getVarName(modelName);
575,174
public boolean isStringFieldEqual(int ordinal, int fieldIndex, String testValue) {<NEW_LINE>HollowObjectTypeDataElements currentData;<NEW_LINE>boolean result;<NEW_LINE>do {<NEW_LINE>int numBitsForField;<NEW_LINE>long endByte;<NEW_LINE>long startByte;<NEW_LINE>do {<NEW_LINE>currentData = this.currentDataVolatile;<NEW_LINE>numBitsForField = currentData.bitsPerField[fieldIndex];<NEW_LINE>long currentBitOffset = fieldOffset(currentData, ordinal, fieldIndex);<NEW_LINE>endByte = currentData.fixedLengthData.getElementValue(currentBitOffset, numBitsForField);<NEW_LINE>startByte = ordinal != 0 ? currentData.fixedLengthData.getElementValue(currentBitOffset - currentData.bitsPerRecord, numBitsForField) : 0;<NEW_LINE>} while (readWasUnsafe(currentData));<NEW_LINE>if ((endByte & (1L << numBitsForField - 1)) != 0)<NEW_LINE>return testValue == null;<NEW_LINE>if (testValue == null)<NEW_LINE>return false;<NEW_LINE>startByte &= (<MASK><NEW_LINE>int length = (int) (endByte - startByte);<NEW_LINE>result = testStringEquality(currentData.varLengthData[fieldIndex], startByte, length, testValue);<NEW_LINE>} while (readWasUnsafe(currentData));<NEW_LINE>return result;<NEW_LINE>}
1L << numBitsForField - 1) - 1;
1,223,688
public Regressor transformToOutput(List<OnnxValue> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) {<NEW_LINE>float[]<MASK><NEW_LINE>if (predictions.length != 1) {<NEW_LINE>throw new IllegalArgumentException("Supplied tensor has too many results, predictions.length = " + predictions.length);<NEW_LINE>} else if (predictions[0].length != outputIDInfo.size()) {<NEW_LINE>throw new IllegalArgumentException("Supplied tensor has an incorrect number of dimensions, predictions[0].length = " + predictions[0].length + ", expected " + outputIDInfo.size());<NEW_LINE>}<NEW_LINE>// Note this inserts in an ordering which is not necessarily the natural one,<NEW_LINE>// but the Regressor constructor sorts it to maintain the natural ordering.<NEW_LINE>// The names and the values still line up, so this code is valid.<NEW_LINE>String[] names = new String[outputIDInfo.size()];<NEW_LINE>double[] values = new double[outputIDInfo.size()];<NEW_LINE>for (Pair<Integer, Regressor> p : outputIDInfo) {<NEW_LINE>int id = p.getA();<NEW_LINE>names[id] = p.getB().getNames()[0];<NEW_LINE>values[id] = predictions[0][id];<NEW_LINE>}<NEW_LINE>return new Regressor(names, values);<NEW_LINE>}
[] predictions = getBatchPredictions(tensor);
221,134
public double[] denoise(double[] data, int mixNumber) {<NEW_LINE>if (mixNumber <= 2) {<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>int number = data.length;<NEW_LINE>double[] result = new double[number];<NEW_LINE>boolean first = true;<NEW_LINE>boolean last = false;<NEW_LINE>for (int i = 0; i < number - mixNumber; i++) {<NEW_LINE>if (i == number - mixNumber - 1) {<NEW_LINE>last = true;<NEW_LINE>}<NEW_LINE>List<Double> mixNumbers = new ArrayList<Double>();<NEW_LINE>for (int j = 0; j < mixNumber; j++) {<NEW_LINE>int position = i + j;<NEW_LINE>mixNumbers<MASK><NEW_LINE>}<NEW_LINE>double avg = computeAvg(mixNumbers);<NEW_LINE>result[i + mixNumber / 2] = avg;<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>for (int k = 0; k < mixNumber / 2; k++) {<NEW_LINE>result[k] = avg;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (last) {<NEW_LINE>for (int k = i + mixNumber / 2 + 1; k < number; k++) {<NEW_LINE>result[k] = avg;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.add(data[position]);
498,784
public static int[] parse(String param) {<NEW_LINE>Matcher matcher = pattern.matcher(param);<NEW_LINE>if (matcher.matches() == false) {<NEW_LINE>throw new IllegalArgumentException("Invalid mvt formatter parameter [" + param + "]. Must have the form \"zoom/x/y\" or \"zoom/x/y@extent\" or \"zoom/x/y@extent:buffer\" or \"zoom/x/y:buffer\".");<NEW_LINE>}<NEW_LINE>final int z = GeoTileUtils.checkPrecisionRange(Integer.parseInt(matcher.group(1)));<NEW_LINE>final int tiles = 1 << z;<NEW_LINE>final int x = Integer.parseInt(matcher.group(2));<NEW_LINE>final int y = Integer.parseInt(matcher.group(3));<NEW_LINE>if (x < 0 || y < 0 || x >= tiles || y >= tiles) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "Zoom/X/Y combination is not valid: %d/%d/%d", z, x, y));<NEW_LINE>}<NEW_LINE>final int extent = matcher.group(4) == null ? DEFAULT_EXTENT : Integer.parseInt(matcher.group(<MASK><NEW_LINE>if (extent <= 0) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "Extent is not valid: %d is not > 0", extent));<NEW_LINE>}<NEW_LINE>final int bufferPixels = matcher.group(5) == null ? DEFAULT_BUFFER_PIXELS : Integer.parseInt(matcher.group(5).substring(1));<NEW_LINE>return new int[] { z, x, y, extent, bufferPixels };<NEW_LINE>}
4).substring(1));
533,951
public static boolean hasSetter(CompilationInfo info, TypeElement typeElement, VariableElement field, Map<String, List<ExecutableElement>> methods, CodeStyle cs) {<NEW_LINE>CharSequence name = field.getSimpleName();<NEW_LINE>assert name.length() > 0;<NEW_LINE>TypeMirror type = field.asType();<NEW_LINE>boolean isStatic = field.getModifiers().contains(Modifier.STATIC);<NEW_LINE>String setterName = CodeStyleUtils.<MASK><NEW_LINE>Types types = info.getTypes();<NEW_LINE>List<ExecutableElement> candidates = methods.get(setterName);<NEW_LINE>if (candidates != null) {<NEW_LINE>for (ExecutableElement candidate : candidates) {<NEW_LINE>if ((!candidate.getModifiers().contains(Modifier.ABSTRACT) || candidate.getEnclosingElement() == typeElement) && candidate.getReturnType().getKind() == TypeKind.VOID && candidate.getParameters().size() == 1 && types.isSameType(candidate.getParameters().get(0).asType(), type))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
computeSetterName(name, isStatic, cs);
120,591
public boolean isMethodConstrained(Method method, BeanDescriptor beanDescriptor, ClassLoader moduleClassLoader, String moduleUri) {<NEW_LINE>setupGlobalValidationSettings(moduleClassLoader);<NEW_LINE>if (!isExecutableValidationEnabled) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Method> overriddenAndImplementedMethods = InheritedMethodsHelper.getAllMethods(method.getDeclaringClass());<NEW_LINE>Optional<String> correspondingProperty = getProperty(new ConstrainableMethod(method));<NEW_LINE>// obtain @ValidateOnExecution from the top-most method in the hierarchy<NEW_LINE>Method methodForExecutableTypeRetrieval = replaceWithOverriddenOrInterfaceMethod(method, overriddenAndImplementedMethods);<NEW_LINE>EnumSet<ExecutableType> classLevelExecutableTypes = executableTypesDefinedOnType(methodForExecutableTypeRetrieval.getDeclaringClass());<NEW_LINE>EnumSet<ExecutableType> memberLevelExecutableType = executableTypesDefinedOnMethod(methodForExecutableTypeRetrieval, correspondingProperty.isPresent());<NEW_LINE>ExecutableType currentExecutableType = correspondingProperty.isPresent() ? ExecutableType.GETTER_METHODS : ExecutableType.NON_GETTER_METHODS;<NEW_LINE>// validation is enabled per default, so explicit configuration can just veto whether<NEW_LINE>// validation occurs<NEW_LINE>if (veto(classLevelExecutableTypes, memberLevelExecutableType, currentExecutableType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean needsValidation;<NEW_LINE>if (correspondingProperty.isPresent()) {<NEW_LINE>needsValidation = isGetterConstrained(beanDescriptor, <MASK><NEW_LINE>} else {<NEW_LINE>needsValidation = isNonGetterConstrained(beanDescriptor, method);<NEW_LINE>}<NEW_LINE>return needsValidation;<NEW_LINE>}
method, correspondingProperty.get());
1,201,012
public void intercept(Invocation inv) {<NEW_LINE>Parameter[] parameters = inv.getMethod().getParameters();<NEW_LINE>for (int index = 0; index < parameters.length; index++) {<NEW_LINE>Size size = parameters[index<MASK><NEW_LINE>if (size != null) {<NEW_LINE>Object validObject = inv.getArg(index);<NEW_LINE>if (validObject == null) {<NEW_LINE>String reason = parameters[index].getName() + " need size is " + size.min() + " ~ " + size.max() + ", but current value is null at method: " + ClassUtil.buildMethodString(inv.getMethod());<NEW_LINE>Ret paras = Ret.by("max", size.max()).set("min", size.min());<NEW_LINE>ValidUtil.throwValidException(parameters[index].getName(), size.message(), paras, reason);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int len = getObjectLen(validObject);<NEW_LINE>if (len < size.min() || len > size.max()) {<NEW_LINE>String reason = parameters[index].getName() + " need size is " + size.min() + " ~ " + size.max() + ", but current value size (or length) is " + len + " at method: " + ClassUtil.buildMethodString(inv.getMethod());<NEW_LINE>Ret paras = Ret.by("max", size.max()).set("min", size.min());<NEW_LINE>ValidUtil.throwValidException(parameters[index].getName(), size.message(), paras, reason);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inv.invoke();<NEW_LINE>}
].getAnnotation(Size.class);
236,588
private void paintString(Graphics2D g, int x, int y, int w, int h, int fillStart, int amountFull) {<NEW_LINE>String progressString = progressBar.getString();<NEW_LINE>g.<MASK><NEW_LINE>Point renderLocation = getStringPlacement(g, progressString, x, y, w, h);<NEW_LINE>Rectangle oldClip = g.getClipBounds();<NEW_LINE>if (progressBar.getOrientation() == SwingConstants.HORIZONTAL) {<NEW_LINE>g.setColor(getSelectionBackground());<NEW_LINE>BasicGraphicsUtils.drawString(progressBar, g, progressString, renderLocation.x, renderLocation.y);<NEW_LINE>g.setColor(getSelectionForeground());<NEW_LINE>g.clipRect(fillStart, y, amountFull, h);<NEW_LINE>BasicGraphicsUtils.drawString(progressBar, g, progressString, renderLocation.x, renderLocation.y);<NEW_LINE>} else {<NEW_LINE>// VERTICAL<NEW_LINE>g.setColor(getSelectionBackground());<NEW_LINE>AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2);<NEW_LINE>g.setFont(progressBar.getFont().deriveFont(rotate));<NEW_LINE>renderLocation = getStringPlacement(g, progressString, x, y, w, h);<NEW_LINE>BasicGraphicsUtils.drawString(progressBar, g, progressString, renderLocation.x, renderLocation.y);<NEW_LINE>g.setColor(getSelectionForeground());<NEW_LINE>g.clipRect(x, fillStart, w, amountFull);<NEW_LINE>BasicGraphicsUtils.drawString(progressBar, g, progressString, renderLocation.x, renderLocation.y);<NEW_LINE>}<NEW_LINE>g.setClip(oldClip);<NEW_LINE>}
setFont(progressBar.getFont());
719,986
public void writeComplete(int rc, long ledgerId, long entryId, BookieId addr, Object ctx) {<NEW_LINE>if (rc != BKException.Code.OK) {<NEW_LINE>LOG.error("BK error writing entry for ledgerId: {}, entryId: {}, bookie: {}", ledgerId, entryId, addr, BKException.create(rc));<NEW_LINE>if (completed.compareAndSet(false, true)) {<NEW_LINE>ledgerFragmentEntryMcb.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>numEntriesWritten.inc();<NEW_LINE>if (ctx instanceof Long) {<NEW_LINE>numBytesWritten.registerSuccessfulValue((Long) ctx);<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Success writing ledger id {}, entry id {} to a new bookie {}!", ledgerId, entryId, addr);<NEW_LINE>}<NEW_LINE>if (numCompleted.incrementAndGet() == newBookies.size() && completed.compareAndSet(false, true)) {<NEW_LINE>ledgerFragmentEntryMcb.processResult(rc, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
processResult(rc, null, null);
122,206
// Get join two collection<NEW_LINE>private static void testUnion() {<NEW_LINE>Set<String> set1 = <MASK><NEW_LINE>Set<String> set2 = Sets.newHashSet("a4");<NEW_LINE>MutableSet<String> mutableSet1 = UnifiedSet.newSetWith("a1", "a2");<NEW_LINE>MutableSet<String> mutableSet2 = UnifiedSet.newSetWith("a4");<NEW_LINE>Collection<String> collection1 = set1;<NEW_LINE>Collection<String> collection2 = set2;<NEW_LINE>// Get join two collection<NEW_LINE>// using JDK<NEW_LINE>Set<String> jdk = new HashSet<>(set1);<NEW_LINE>jdk.addAll(set2);<NEW_LINE>// using guava<NEW_LINE>Set<String> guava = Sets.union(set1, set2);<NEW_LINE>// using Apache<NEW_LINE>Collection<String> apache = CollectionUtils.union(collection1, collection2);<NEW_LINE>// using GS<NEW_LINE>Set<String> gs = mutableSet1.union(mutableSet2);<NEW_LINE>// print union = [a1, a2, a4]:[a1, a2, a4]:[a1, a2, a4]:[a1, a2, a4]<NEW_LINE>System.out.println("union = " + jdk + ":" + guava + ":" + apache + ":" + gs);<NEW_LINE>}
Sets.newHashSet("a1", "a2");
794,768
final ListDeploymentTargetsResult executeListDeploymentTargets(ListDeploymentTargetsRequest listDeploymentTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDeploymentTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDeploymentTargetsRequest> request = null;<NEW_LINE>Response<ListDeploymentTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDeploymentTargetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeploymentTargetsRequest));<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, "CodeDeploy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeploymentTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDeploymentTargetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeploymentTargetsResultJsonUnmarshaller());<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);
1,731,913
public static List<CompressedXContent> collectMappings(final ComposableIndexTemplate template, final Map<String, ComponentTemplate> componentTemplates, final String indexName) throws Exception {<NEW_LINE><MASK><NEW_LINE>List<CompressedXContent> mappings = template.composedOf().stream().map(componentTemplates::get).filter(Objects::nonNull).map(ComponentTemplate::template).map(Template::mappings).filter(Objects::nonNull).collect(Collectors.toCollection(LinkedList::new));<NEW_LINE>// Add the actual index template's mappings, since it takes the highest precedence<NEW_LINE>Optional.ofNullable(template.template()).map(Template::mappings).ifPresent(mappings::add);<NEW_LINE>if (template.getDataStreamTemplate() != null && indexName.startsWith(DataStream.BACKING_INDEX_PREFIX)) {<NEW_LINE>// add a default mapping for the `@timestamp` field, at the lowest precedence, to make bootstrapping data streams more<NEW_LINE>// straightforward as all backing indices are required to have a timestamp field<NEW_LINE>if (template.getDataStreamTemplate().isAllowCustomRouting()) {<NEW_LINE>mappings.add(0, DEFAULT_TIMESTAMP_MAPPING_WITH_ROUTING);<NEW_LINE>} else {<NEW_LINE>mappings.add(0, DEFAULT_TIMESTAMP_MAPPING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Only include _timestamp mapping snippet if creating backing index.<NEW_LINE>if (indexName.startsWith(DataStream.BACKING_INDEX_PREFIX)) {<NEW_LINE>// Only if template has data stream definition this should be added and<NEW_LINE>// adding this template last, since _timestamp field should have highest precedence:<NEW_LINE>if (template.getDataStreamTemplate() != null) {<NEW_LINE>mappings.add(ComposableIndexTemplate.DataStreamTemplate.DATA_STREAM_MAPPING_SNIPPET);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(mappings);<NEW_LINE>}
Objects.requireNonNull(template, "Composable index template must be provided");
549,859
static // and insert would never happen<NEW_LINE>void postRollup(String agentRollupId, long captureTime, Set<String> keys, Set<UUID> uniquenessKeysForDeletion, @Nullable Long nextRollupIntervalMillis, @Nullable PreparedStatement insertNeedsRollup, PreparedStatement deleteNeedsRollup, int needsRollupAdjustedTTL, Session session) throws Exception {<NEW_LINE>if (nextRollupIntervalMillis != null) {<NEW_LINE>checkNotNull(insertNeedsRollup);<NEW_LINE>long rollupCaptureTime = CaptureTimes.getRollup(captureTime, nextRollupIntervalMillis);<NEW_LINE>BoundStatement boundStatement = insertNeedsRollup.bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement.setTimestamp(i++, new Date(rollupCaptureTime));<NEW_LINE>boundStatement.setUUID(i++, UUIDs.timeBased());<NEW_LINE>boundStatement<MASK><NEW_LINE>boundStatement.setInt(i++, needsRollupAdjustedTTL);<NEW_LINE>// intentionally not async, see method-level comment<NEW_LINE>session.write(boundStatement);<NEW_LINE>}<NEW_LINE>List<Future<?>> futures = new ArrayList<>();<NEW_LINE>for (UUID uniqueness : uniquenessKeysForDeletion) {<NEW_LINE>BoundStatement boundStatement = deleteNeedsRollup.bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement.setTimestamp(i++, new Date(captureTime));<NEW_LINE>boundStatement.setUUID(i++, uniqueness);<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>}<NEW_LINE>MoreFutures.waitForAll(futures);<NEW_LINE>}
.setSet(i++, keys);
1,378,087
public static List<Class> fromInfos(List<PainlessContextClassInfo> infos, Map<String, String> javaNamesToDisplayNames, JavadocExtractor extractor) throws IOException {<NEW_LINE>List<Class> classes = new ArrayList<>(infos.size());<NEW_LINE>for (PainlessContextClassInfo info : infos) {<NEW_LINE>JavadocExtractor.ParsedJavaClass parsedClass = extractor.<MASK><NEW_LINE>Class cls = new Class(javaNamesToDisplayNames.get(info.getName()), info.isImported(), Constructor.fromInfos(info.getConstructors(), javaNamesToDisplayNames, parsedClass, extractor, info.getName()), Method.fromInfos(info.getStaticMethods(), javaNamesToDisplayNames, parsedClass, extractor, info.getName()), Method.fromInfos(info.getMethods(), javaNamesToDisplayNames, parsedClass, extractor, info.getName()), Field.fromInfos(info.getStaticFields(), javaNamesToDisplayNames, parsedClass), Field.fromInfos(info.getFields(), javaNamesToDisplayNames, parsedClass));<NEW_LINE>classes.add(cls);<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>}
parseClass(info.getName());
890,904
final DeleteRemoteAccessSessionResult executeDeleteRemoteAccessSession(DeleteRemoteAccessSessionRequest deleteRemoteAccessSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRemoteAccessSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRemoteAccessSessionRequest> request = null;<NEW_LINE>Response<DeleteRemoteAccessSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRemoteAccessSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRemoteAccessSessionRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRemoteAccessSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRemoteAccessSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRemoteAccessSessionResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,608,394
private static Pair<List<String>, List<String>> splitCommandline(Artifact paramFile, List<String> args, LinkTargetType linkTargetType) {<NEW_LINE>Preconditions.checkNotNull(paramFile);<NEW_LINE>if (linkTargetType.linkerOrArchiver() == LinkerOrArchiver.ARCHIVER) {<NEW_LINE>// Ar link commands can also generate huge command lines.<NEW_LINE>List<String> <MASK><NEW_LINE>List<String> commandlineArgs = new ArrayList<>();<NEW_LINE>extractArgumentsForStaticLinkParamFile(args, commandlineArgs, paramFileArgs);<NEW_LINE>return Pair.of(commandlineArgs, paramFileArgs);<NEW_LINE>} else {<NEW_LINE>// Gcc link commands tend to generate humongous commandlines for some targets, which may<NEW_LINE>// not fit on some remote execution machines. To work around this we will employ the help of<NEW_LINE>// a parameter file and pass any linker options through it.<NEW_LINE>List<String> paramFileArgs = new ArrayList<>();<NEW_LINE>List<String> commandlineArgs = new ArrayList<>();<NEW_LINE>extractArgumentsForDynamicLinkParamFile(args, commandlineArgs, paramFileArgs);<NEW_LINE>return Pair.of(commandlineArgs, paramFileArgs);<NEW_LINE>}<NEW_LINE>}
paramFileArgs = new ArrayList<>();
1,799,802
public void handle(final org.mortbay.jetty.HttpConnection connection) throws IOException, ServletException {<NEW_LINE>final Request request = connection.getRequest();<NEW_LINE>if (request.getMethod().equals("CONNECT")) {<NEW_LINE>final String uri = request<MASK><NEW_LINE>final int c = uri.indexOf(':');<NEW_LINE>final String port = uri.substring(c + 1);<NEW_LINE>final String host = uri.substring(0, c);<NEW_LINE>final InetSocketAddress inetAddress = new InetSocketAddress(host, Integer.parseInt(port));<NEW_LINE>final Socket clientSocket = connection.getEndPoint().getTransport() instanceof Socket ? (Socket) connection.getEndPoint().getTransport() : ((SocketChannel) connection.getEndPoint().getTransport()).socket();<NEW_LINE>final InputStream in = clientSocket.getInputStream();<NEW_LINE>final OutputStream out = clientSocket.getOutputStream();<NEW_LINE>final SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket(inetAddress.getAddress(), inetAddress.getPort());<NEW_LINE>final Response response = connection.getResponse();<NEW_LINE>response.setStatus(200);<NEW_LINE>// response.setHeader("Connection", "close");<NEW_LINE>response.flushBuffer();<NEW_LINE>IO.copyThread(socket.getInputStream(), out);<NEW_LINE>IO.copyThread(in, socket.getOutputStream());<NEW_LINE>} else {<NEW_LINE>super.handle(connection);<NEW_LINE>}<NEW_LINE>}
.getUri().toString();
1,822,107
private UserFunctionDescriptor userFunctionDescriptor(Node node) {<NEW_LINE>String statement = (String) node.getProperty(SystemPropertyKeys.statement.name());<NEW_LINE>String name = (String) node.getProperty(<MASK><NEW_LINE>String description = (String) node.getProperty(SystemPropertyKeys.description.name(), null);<NEW_LINE>String[] prefix = (String[]) node.getProperty(SystemPropertyKeys.prefix.name(), new String[] { PREFIX });<NEW_LINE>String property = (String) node.getProperty(SystemPropertyKeys.inputs.name());<NEW_LINE>List<FieldSignature> inputs = deserializeSignatures(property);<NEW_LINE>boolean forceSingle = (boolean) node.getProperty(SystemPropertyKeys.forceSingle.name(), false);<NEW_LINE>return new UserFunctionDescriptor(new UserFunctionSignature(new QualifiedName(prefix, name), inputs, typeof((String) node.getProperty(SystemPropertyKeys.output.name())), null, new String[0], description, "apoc.custom", false), statement, forceSingle);<NEW_LINE>}
SystemPropertyKeys.name.name());
1,623,073
public BankOrder mergeBankOrders(Collection<BankOrder> bankOrders) throws AxelorException {<NEW_LINE>if (bankOrders == null || bankOrders.size() <= 1) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, IExceptionMessage.BANK_ORDER_MERGE_AT_LEAST_TWO_BANK_ORDERS);<NEW_LINE>}<NEW_LINE>this.checkSameElements(bankOrders);<NEW_LINE>BankOrder bankOrder = bankOrders.iterator().next();<NEW_LINE>bankOrders.remove(bankOrder);<NEW_LINE>bankOrder.setSenderLabel(null);<NEW_LINE>bankOrder.setSenderReference(null);<NEW_LINE>bankOrder.setBankOrderDate(Beans.get(AppBaseService.class).getTodayDate(bankOrder.getSenderCompany()));<NEW_LINE>bankOrder.setSignatoryUser(null);<NEW_LINE>bankOrder.setSignatoryEbicsUser(null);<NEW_LINE>PaymentMode paymentMode = bankOrder.getPaymentMode();<NEW_LINE>for (BankOrderLine bankOrderLine : this.getAllBankOrderLineList(bankOrders)) {<NEW_LINE>bankOrder.addBankOrderLineListItem(bankOrderLine);<NEW_LINE>}<NEW_LINE>bankOrderRepo.save(bankOrder);<NEW_LINE>for (BankOrder bankOrderToRemove : bankOrders) {<NEW_LINE>bankOrderToRemove = bankOrderRepo.find(bankOrderToRemove.getId());<NEW_LINE>List<InvoicePayment> invoicePaymentList = invoicePaymentRepo.<MASK><NEW_LINE>for (InvoicePayment invoicePayment : invoicePaymentList) {<NEW_LINE>invoicePayment.setBankOrder(bankOrder);<NEW_LINE>}<NEW_LINE>bankOrderRepo.remove(bankOrderToRemove);<NEW_LINE>}<NEW_LINE>if (paymentMode.getConsoBankOrderLinePerPartner()) {<NEW_LINE>consolidatePerPartner(bankOrder);<NEW_LINE>}<NEW_LINE>bankOrderService.updateTotalAmounts(bankOrder);<NEW_LINE>return bankOrderRepo.save(bankOrder);<NEW_LINE>}
findByBankOrder(bankOrderToRemove).fetch();
1,595,118
public Optional<LineageVerticesAndEdges> ultimateDestination(String guid) {<NEW_LINE>Vertex queriedVertex = graphHelper.getResult(this::getQueriedVertex, guid, this::handleGetQueriedVertexException);<NEW_LINE>String label = queriedVertex.label();<NEW_LINE>Optional<List<String>> edgeLabelsOptional = getEdgeLabelsForDataFlow(label);<NEW_LINE>if (edgeLabelsOptional.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>List<String> edgeLabels = edgeLabelsOptional.get();<NEW_LINE>List<Vertex> destinationsList = graphHelper.getResult(this::queryDestinations, guid, edgeLabels, this::handleLineageNotFoundException);<NEW_LINE>Set<LineageVertex> lineageVertices = <MASK><NEW_LINE>return Optional.of(getCondensedLineage(queriedVertex, lineageVertices, DESTINATION_CONDENSATION));<NEW_LINE>}
this.lineageGraphQueryHelper.getLineageVertices(destinationsList);
36,408
public void paint(Graphics2D g, double xStart, double xEnd, double y) {<NEW_LINE>Shape clip = g.getClip();<NEW_LINE>final Rectangle2D rectangle = new Rectangle2D.Double(xStart, y - 3, xEnd - xStart, 3);<NEW_LINE>final Rectangle2D waveClip = clip != null ? clip.getBounds2D().createIntersection(rectangle) : rectangle;<NEW_LINE>if (waveClip.isEmpty())<NEW_LINE>return;<NEW_LINE>Graphics2D g2d = (Graphics2D) g.create();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>g2d.setClip(waveClip);<NEW_LINE>xStart -= xStart % 4;<NEW_LINE>g2d.translate(xStart, y - 3);<NEW_LINE>UIUtil.drawImage(g2d, myImage, 0, 0, null);<NEW_LINE>} finally {<NEW_LINE>g2d.dispose();<NEW_LINE>}<NEW_LINE>}
g2d.setComposite(AlphaComposite.SrcOver);
1,003,373
static public void main(String[] args) {<NEW_LINE>FastReader rd = new FastReader();<NEW_LINE>int N = rd.nextInt();<NEW_LINE>Stack<String> stack = new Stack<>();<NEW_LINE>StringBuilder out = new StringBuilder();<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>String[] Line = rd.nextLine().split(" ");<NEW_LINE>String cmd = Line[0];<NEW_LINE>if (cmd.equals("push")) {<NEW_LINE>stack.push(Line[1]);<NEW_LINE>} else if (cmd.equals("pop")) {<NEW_LINE>if (stack.empty()) {<NEW_LINE>out.append("-1");<NEW_LINE>} else {<NEW_LINE>out.append(stack.peek());<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>out.append("\n");<NEW_LINE>} else if (cmd.equals("size")) {<NEW_LINE>out.append(stack.size() + "\n");<NEW_LINE>} else if (cmd.equals("empty")) {<NEW_LINE>out.append(stack.empty() ? "1" : "0");<NEW_LINE>out.append("\n");<NEW_LINE>} else if (cmd.equals("top")) {<NEW_LINE>if (stack.empty()) {<NEW_LINE>out.append("-1\n");<NEW_LINE>} else {<NEW_LINE>out.append(stack.peek() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
System.out.print(out);
882,586
public static void rotateCCW(GrayI8 image) {<NEW_LINE>if (image.width != image.height)<NEW_LINE>throw new IllegalArgumentException("Image must be square");<NEW_LINE>int w = image.height / 2 + image.height % 2;<NEW_LINE>int h = image.height / 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, h, y0->{<NEW_LINE>for (int y0 = 0; y0 < h; y0++) {<NEW_LINE>int y1 = image.height - y0 - 1;<NEW_LINE>for (int x0 = 0; x0 < w; x0++) {<NEW_LINE>int x1 = image.width - x0 - 1;<NEW_LINE>int index0 = image.startIndex + y0 * image.stride + x0;<NEW_LINE>int index1 = image.startIndex + x0 * image.stride + y1;<NEW_LINE>int index2 = image.startIndex + y1 * image.stride + x1;<NEW_LINE>int index3 = image.startIndex + x1 * image.stride + y0;<NEW_LINE>int tmp0 = image.data[index0];<NEW_LINE>image.data[index0] = image.data[index1];<NEW_LINE>image.data[index1] = image.data[index2];<NEW_LINE>image.data[index2] = image.data[index3];<NEW_LINE>image.data<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
[index3] = (byte) tmp0;
463,682
private NameEnvironmentAnswer[] askForTypeFromModules(ModuleBinding clientModule, ModuleBinding[] otherModules, Function<ModuleBinding, NameEnvironmentAnswer> oracle) {<NEW_LINE>if (clientModule != null && clientModule.nameForLookup().length == 0) {<NEW_LINE>NameEnvironmentAnswer answer = oracle.apply(clientModule);<NEW_LINE>if (answer != null)<NEW_LINE>answer.moduleBinding = this.root.getModuleFromAnswer(answer);<NEW_LINE>return new NameEnvironmentAnswer[] { answer };<NEW_LINE>} else {<NEW_LINE>boolean found = false;<NEW_LINE>NameEnvironmentAnswer[] answers = null;<NEW_LINE>if (clientModule != null) {<NEW_LINE>answers = new <MASK><NEW_LINE>NameEnvironmentAnswer answer = oracle.apply(clientModule);<NEW_LINE>if (answer != null) {<NEW_LINE>answer.moduleBinding = clientModule;<NEW_LINE>answers[answers.length - 1] = answer;<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>answers = new NameEnvironmentAnswer[otherModules.length];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < otherModules.length; i++) {<NEW_LINE>NameEnvironmentAnswer answer = oracle.apply(otherModules[i]);<NEW_LINE>if (answer != null) {<NEW_LINE>if (answer.moduleBinding == null) {<NEW_LINE>char[] nameFromAnswer = answer.moduleName();<NEW_LINE>if (CharOperation.equals(nameFromAnswer, otherModules[i].moduleName)) {<NEW_LINE>answer.moduleBinding = otherModules[i];<NEW_LINE>} else {<NEW_LINE>answer.moduleBinding = getModule(nameFromAnswer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>answers[i] = answer;<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return found ? answers : null;<NEW_LINE>}<NEW_LINE>}
NameEnvironmentAnswer[otherModules.length + 1];
1,199,570
private void addMessageConfig(Log log, WsdlRequest modelItem) throws MalformedURLException {<NEW_LINE>HttpMessageEntry requestMessage = HttpMessageEntry.Factory.newInstance();<NEW_LINE>requestMessage.addNewMessageContent().setStringValue(modelItem.getRequestContent());<NEW_LINE>requestMessage.setConversationID("1");<NEW_LINE>requestMessage.setTimestamp(Calendar.getInstance());<NEW_LINE>requestMessage.setID("1");<NEW_LINE>URL endpoint = new URL(modelItem.getEndpoint());<NEW_LINE>requestMessage.setSenderHostAndPort("localhost");<NEW_LINE>if (endpoint.getPort() > 0) {<NEW_LINE>requestMessage.setReceiverHostAndPort(endpoint.getHost() + ":" + endpoint.getPort());<NEW_LINE>} else {<NEW_LINE>requestMessage.setReceiverHostAndPort(endpoint.getHost());<NEW_LINE>}<NEW_LINE>requestMessage.setType(TcpMessageType.REQUEST);<NEW_LINE>Response response = modelItem.getResponse();<NEW_LINE>HttpMessageEntry responseMessage = HttpMessageEntry.Factory.newInstance();<NEW_LINE>responseMessage.addNewMessageContent().setStringValue(response.getContentAsString());<NEW_LINE>responseMessage.setConversationID("1");<NEW_LINE>responseMessage.setType(TcpMessageType.RESPONSE);<NEW_LINE>responseMessage.setTimestamp(Calendar.getInstance());<NEW_LINE>responseMessage.setID("2");<NEW_LINE>responseMessage.<MASK><NEW_LINE>responseMessage.setReceiverHostAndPort(requestMessage.getSenderHostAndPort());<NEW_LINE>String requestHeaders = buildHttpHeadersString(response.getRequestHeaders());<NEW_LINE>requestMessage.setHttpHeaders("POST " + endpoint.getPath() + " HTTP/1.1\r\n" + requestHeaders);<NEW_LINE>responseMessage.setHttpHeaders(buildHttpHeadersString(response.getResponseHeaders()));<NEW_LINE>log.setMessageEntryArray(new MessageEntry[] { requestMessage, responseMessage });<NEW_LINE>}
setSenderHostAndPort(requestMessage.getReceiverHostAndPort());
1,492,471
public void execute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext) {<NEW_LINE>ProcessEngineConfigurationImpl engineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);<NEW_LINE>ManagementService managementService = engineConfiguration.getManagementService();<NEW_LINE>Batch batch = managementService.createBatchQuery().batchId(configuration).singleResult();<NEW_LINE>if (batch == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("There is no batch with the id " + configuration);<NEW_LINE>}<NEW_LINE>long totalBatchParts = createStatusQuery(batch, managementService).count();<NEW_LINE>long totalCompleted = createStatusQuery(batch, managementService).completed().count();<NEW_LINE>if (totalBatchParts == totalCompleted) {<NEW_LINE>List<BatchPart> failedParts = createStatusQuery(batch, managementService).status(<MASK><NEW_LINE>long totalFailed = failedParts.size();<NEW_LINE>if (totalFailed == 0) {<NEW_LINE>completeBatch(batch, DeleteProcessInstanceBatchConstants.STATUS_COMPLETED, engineConfiguration);<NEW_LINE>} else {<NEW_LINE>completeBatchFail(batch, failedParts, engineConfiguration);<NEW_LINE>}<NEW_LINE>job.setRepeat(null);<NEW_LINE>} else if (totalBatchParts == 0) {<NEW_LINE>completeBatch(batch, DeleteProcessInstanceBatchConstants.STATUS_COMPLETED, engineConfiguration);<NEW_LINE>job.setRepeat(null);<NEW_LINE>}<NEW_LINE>}
DeleteProcessInstanceBatchConstants.STATUS_FAILED).list();
790,192
private void applyConventions(Project project, TaskContainer tasks, ObjectFactory objects, ProjectLayout layout, GradleDocumentationExtension extension) {<NEW_LINE>TaskProvider<Sync> stageDocs = tasks.register("stageDocs", Sync.class, task -> {<NEW_LINE>// release notes goes in the root of the docs<NEW_LINE>task.from(extension.getReleaseNotes().getRenderedDocumentation());<NEW_LINE>// DSL reference goes into dsl/<NEW_LINE>task.from(extension.getDslReference().getRenderedDocumentation(), sub -> sub.into("dsl"));<NEW_LINE>// Javadocs reference goes into javadoc/<NEW_LINE>task.from(extension.getJavadocs().getRenderedDocumentation(), sub -> sub.into("javadoc"));<NEW_LINE>// User manual goes into userguide/ (for historical reasons)<NEW_LINE>task.from(extension.getUserManual().getRenderedDocumentation(), sub -> sub.into("userguide"));<NEW_LINE>task.into(extension.getDocumentationRenderedRoot());<NEW_LINE>});<NEW_LINE>extension.getSourceRoot().convention(layout.getProjectDirectory().dir("src/docs"));<NEW_LINE>extension.getDocumentationRenderedRoot().convention(layout.getBuildDirectory().dir("docs"));<NEW_LINE>extension.getStagingRoot().convention(layout.getBuildDirectory().dir("working"));<NEW_LINE>ConfigurableFileTree css = objects.fileTree();<NEW_LINE>css.from(extension.getSourceRoot().dir("css"));<NEW_LINE>css.include("*.css");<NEW_LINE>extension.getCssFiles().from(css);<NEW_LINE>extension.getRenderedDocumentation().from(stageDocs);<NEW_LINE>Configuration runtimeClasspath = project.getConfigurations().getByName("runtimeClasspath");<NEW_LINE>Configuration sourcesPath = project.getConfigurations().create("sourcesPath");<NEW_LINE>sourcesPath.attributes(a -> {<NEW_LINE>a.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME));<NEW_LINE>a.attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category<MASK><NEW_LINE>a.attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.class, "gradle-source-folders"));<NEW_LINE>});<NEW_LINE>sourcesPath.setCanBeConsumed(false);<NEW_LINE>sourcesPath.setCanBeResolved(true);<NEW_LINE>sourcesPath.setVisible(false);<NEW_LINE>sourcesPath.extendsFrom(runtimeClasspath);<NEW_LINE>extension.getClasspath().from(runtimeClasspath);<NEW_LINE>extension.getDocumentedSource().from(sourcesPath.getIncoming().artifactView(v -> v.lenient(true)).getFiles().getAsFileTree().matching(f -> {<NEW_LINE>// Filter out any non-public APIs<NEW_LINE>f.include(PublicApi.INSTANCE.getIncludes());<NEW_LINE>f.exclude(PublicApi.INSTANCE.getExcludes());<NEW_LINE>}));<NEW_LINE>}
.class, Category.DOCUMENTATION));
1,176,349
public void onPrepareOptionsMenu(final Menu menu) {<NEW_LINE>final MenuItem scanAction = menu.findItem(R.id.send_coins_options_scan);<NEW_LINE>final PackageManager pm = activity.getPackageManager();<NEW_LINE>scanAction.setVisible(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) || pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT));<NEW_LINE>scanAction.setEnabled(viewModel.state == SendCoinsViewModel.State.INPUT);<NEW_LINE>final MenuItem emptyAction = menu.findItem(R.id.send_coins_options_empty);<NEW_LINE>emptyAction.setEnabled(viewModel.state == SendCoinsViewModel.State.INPUT && viewModel.paymentIntent.mayEditAmount() && viewModel.<MASK><NEW_LINE>final MenuItem feeCategoryAction = menu.findItem(R.id.send_coins_options_fee_category);<NEW_LINE>feeCategoryAction.setEnabled(viewModel.state == SendCoinsViewModel.State.INPUT);<NEW_LINE>if (viewModel.feeCategory == FeeCategory.ECONOMIC)<NEW_LINE>menu.findItem(R.id.send_coins_options_fee_category_economic).setChecked(true);<NEW_LINE>else if (viewModel.feeCategory == FeeCategory.NORMAL)<NEW_LINE>menu.findItem(R.id.send_coins_options_fee_category_normal).setChecked(true);<NEW_LINE>else if (viewModel.feeCategory == FeeCategory.PRIORITY)<NEW_LINE>menu.findItem(R.id.send_coins_options_fee_category_priority).setChecked(true);<NEW_LINE>super.onPrepareOptionsMenu(menu);<NEW_LINE>}
balance.getValue() != null);
666,396
public void translateLuceneOperator() {<NEW_LINE>if (operator instanceof OLuceneOperator) {<NEW_LINE>OExpression newLeft = new OExpression(-1);<NEW_LINE>newLeft.mathExpression = new OBaseExpression(-1);<NEW_LINE>OBaseIdentifier identifirer = new OBaseIdentifier(-1);<NEW_LINE>((OBaseExpression) newLeft.mathExpression).identifier = identifirer;<NEW_LINE>identifirer.levelZero = new OLevelZeroIdentifier(-1);<NEW_LINE>OFunctionCall function = new OFunctionCall(-1);<NEW_LINE>identifirer.levelZero.functionCall = function;<NEW_LINE>function.name = new OIdentifier("search_fields");<NEW_LINE>function.params = new ArrayList<>();<NEW_LINE>function.params.add(fieldNamesToStrings(left));<NEW_LINE>function.params.add(right);<NEW_LINE>left = newLeft;<NEW_LINE>operator = new OEqualsCompareOperator(-1);<NEW_LINE><MASK><NEW_LINE>right.booleanValue = true;<NEW_LINE>}<NEW_LINE>}
right = new OExpression(-1);
1,818,372
public void marshall(Vocabulary vocabulary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (vocabulary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(vocabulary.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getLanguageCode(), LANGUAGECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getContent(), CONTENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(vocabulary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
vocabulary.getName(), NAME_BINDING);
348,857
private static void updateShipmentScheduleFromOrder(@NonNull final I_M_ShipmentSchedule shipmentSchedule, @NonNull final I_C_Order order) {<NEW_LINE>shipmentSchedule.setPriorityRule(order.getPriorityRule());<NEW_LINE>final BPartnerLocationAndCaptureId billToLocationId = orderBL.getBillToLocationId(order);<NEW_LINE>BPartnerContactId billToContactId;<NEW_LINE>if (orderBL.hasBillToContactId(order)) {<NEW_LINE><MASK><NEW_LINE>} else if (shipmentSchedule.getBill_BPartner_ID() == billToLocationId.getBpartnerId().getRepoId()) {<NEW_LINE>billToContactId = BPartnerContactId.ofRepoIdOrNull(billToLocationId.getBpartnerId(), shipmentSchedule.getBill_User_ID());<NEW_LINE>} else {<NEW_LINE>billToContactId = null;<NEW_LINE>}<NEW_LINE>ShipmentScheduleDocumentLocationAdapterFactory.billLocationAdapter(shipmentSchedule).setFrom(DocumentLocation.builder().bpartnerId(billToLocationId.getBpartnerId()).bpartnerLocationId(billToLocationId.getBpartnerLocationId()).locationId(billToLocationId.getLocationCaptureId()).contactId(billToContactId).build());<NEW_LINE>shipmentSchedule.setDeliveryRule(order.getDeliveryRule());<NEW_LINE>shipmentSchedule.setDeliveryViaRule(order.getDeliveryViaRule());<NEW_LINE>shipmentSchedule.setM_Tour_ID(order.getM_Tour_ID());<NEW_LINE>final DocTypeId orderDocTypeId = DocTypeId.ofRepoId(order.getC_DocType_ID());<NEW_LINE>final DocBaseAndSubType orderDocBaseTypeAndSubType = Services.get(IDocTypeDAO.class).getDocBaseAndSubTypeById(orderDocTypeId);<NEW_LINE>shipmentSchedule.setC_DocType_ID(orderDocTypeId.getRepoId());<NEW_LINE>shipmentSchedule.setDocSubType(orderDocBaseTypeAndSubType.getDocSubType());<NEW_LINE>shipmentSchedule.setC_Async_Batch_ID(order.getC_Async_Batch_ID());<NEW_LINE>}
billToContactId = orderBL.getBillToContactId(order);
1,221,438
final DescribeContainerInstancesResult executeDescribeContainerInstances(DescribeContainerInstancesRequest describeContainerInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeContainerInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeContainerInstancesRequest> request = null;<NEW_LINE>Response<DescribeContainerInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeContainerInstancesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeContainerInstancesRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeContainerInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeContainerInstancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeContainerInstancesResultJsonUnmarshaller());<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>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
545,167
public ListTagsForResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListTagsForResourceResult listTagsForResourceResult = new ListTagsForResourceResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 listTagsForResourceResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listTagsForResourceResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("tags", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listTagsForResourceResult.setTags(new ListUnmarshaller<TagRef>(TagRefJsonUnmarshaller.getInstance()).unmarshall(context));<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 listTagsForResourceResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,684,463
public Collection<Diagnosis> diagnose(Collection<Symptom> symptoms) {<NEW_LINE>Collection<Diagnosis> diagnoses = new ArrayList<>();<NEW_LINE>SymptomsTable symptomsTable = SymptomsTable.of(symptoms);<NEW_LINE>SymptomsTable bp = symptomsTable.<MASK><NEW_LINE>if (bp.size() > 1) {<NEW_LINE>// TODO handle cases where multiple detectors create back pressure symptom<NEW_LINE>throw new IllegalStateException("Multiple back-pressure symptoms case");<NEW_LINE>}<NEW_LINE>if (bp.size() == 0) {<NEW_LINE>return diagnoses;<NEW_LINE>}<NEW_LINE>String bpComponent = bp.first().assignments().iterator().next();<NEW_LINE>SymptomsTable processingRateSkew = symptomsTable.type(SYMPTOM_PROCESSING_RATE_SKEW.text());<NEW_LINE>SymptomsTable waitQSkew = symptomsTable.type(SYMPTOM_WAIT_Q_SIZE_SKEW.text());<NEW_LINE>if (waitQSkew.assignment(bpComponent).size() != 0 || processingRateSkew.assignment(bpComponent).size() != 0) {<NEW_LINE>return diagnoses;<NEW_LINE>}<NEW_LINE>Collection<String> assignments = Collections.singletonList(bpComponent);<NEW_LINE>LOG.info(String.format("UNDER_PROVISIONING: %s back-pressure and similar processing rates " + "and wait queue sizes", bpComponent));<NEW_LINE>diagnoses.add(new Diagnosis(DIAGNOSIS_UNDER_PROVISIONING.text(), context.checkpoint(), assignments));<NEW_LINE>// TODO verify large wait queue for all instances<NEW_LINE>return diagnoses;<NEW_LINE>}
type(SYMPTOM_COMP_BACK_PRESSURE.text());
792,726
private synchronized boolean isTrue(int x, int y, int z, @NotNull World world) {<NEW_LINE>CoordinateKey chunkKey = blockCoordinateToChunkKey(world.getUID(<MASK><NEW_LINE>// Get chunk, load from file if necessary<NEW_LINE>// Get/Load/Create chunkstore<NEW_LINE>ChunkStore check = chunkMap.computeIfAbsent(chunkKey, k -> {<NEW_LINE>// Load from file<NEW_LINE>ChunkStore loaded = loadChunk(chunkKey.x, chunkKey.z, world);<NEW_LINE>if (loaded == null)<NEW_LINE>return null;<NEW_LINE>// Mark chunk in-use for region tracking<NEW_LINE>chunkUsageMap.computeIfAbsent(toRegionKey(chunkKey.worldID, chunkKey.x, chunkKey.z), j -> new HashSet<>()).add(chunkKey);<NEW_LINE>return loaded;<NEW_LINE>});<NEW_LINE>// No chunk, return false<NEW_LINE>if (check == null)<NEW_LINE>return false;<NEW_LINE>int ix = Math.abs(x) % 16;<NEW_LINE>int iz = Math.abs(z) % 16;<NEW_LINE>return check.isTrue(ix, y, iz);<NEW_LINE>}
), x, y, z);
672
public void testUCPAndLibertyConnPool() throws Exception {<NEW_LINE>// first get a UCP connection<NEW_LINE>Connection ucpCon = ucpDS.getConnection();<NEW_LINE>Connection con1 = oracleDS.getConnection();<NEW_LINE>try {<NEW_LINE>// Need to request the second connection async since the getConnection request should hang<NEW_LINE>// until there is room in the pool<NEW_LINE>Future<Boolean> future = executor.submit(() -> {<NEW_LINE>try (Connection con2 = oracleDS.getConnection()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Wait 10 seconds, assume that would normally would obtain a connection in that amount of time<NEW_LINE>try {<NEW_LINE>fail("The task should not have completed, instead returned " + future.get<MASK><NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>// expected<NEW_LINE>} catch (ExecutionException ee) {<NEW_LINE>checkForConnectionWaitTimeoutException(ee, "jdbc/oracleDS");<NEW_LINE>}<NEW_LINE>// Now try to close one of the connections, which should allow the other task to complete<NEW_LINE>con1.close();<NEW_LINE>assertTrue(future.get(5, TimeUnit.MINUTES));<NEW_LINE>} finally {<NEW_LINE>con1.close();<NEW_LINE>ucpCon.close();<NEW_LINE>}<NEW_LINE>}
(10, TimeUnit.SECONDS));
1,632,097
private void dbgShrcWriteCacheByAreas(PrintStream out, J9SharedClassConfigPointer sharedClassConfig, String cacheDir, String cacheName) throws CorruptDataException {<NEW_LINE>CacheFileOutputStream fout = createDbgShrcCacheFile(out, sharedClassConfig, cacheDir, cacheName);<NEW_LINE>ShrcConfig config = dbgShrcReadConfig(sharedClassConfig, out);<NEW_LINE>J9SharedCacheHeaderPointer[] header = config.getCacheStartAddress();<NEW_LINE>for (J9SharedCacheHeaderPointer headerIter : header) {<NEW_LINE>J9SharedCacheHeaderInfo helper = new J9SharedCacheHeaderInfo(headerIter);<NEW_LINE>try {<NEW_LINE>dbgShrcWriteCacheArea(fout, helper.getRomClassesEnd(), helper.getMetaDataEnd(), true);<NEW_LINE>dbgShrcWriteCacheArea(fout, helper.getLineNumberAreaStart(), <MASK><NEW_LINE>dbgShrcWriteCacheArea(fout, helper.getLocalVariableAreaEnd(), helper.getLocalVariableAreaStart(), false);<NEW_LINE>CommandUtils.dbgPrint(out, "Cache successfully written to %s\n", fout.getFileName());<NEW_LINE>} catch (IOException e) {<NEW_LINE>CommandUtils.dbgPrint(out, "Error writing %s: %s\n", fout.getFileName(), e.getMessage());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>fout.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
helper.getLineNumberAreaEnd(), false);
656,991
void shutdown() {<NEW_LINE>if (starter != null && starter instanceof RMIConnectorStarter) {<NEW_LINE>((RMIConnectorStarter) starter).stopAndUnexport();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (connObjectName != null) {<NEW_LINE>mMBeanServer.unregisterMBean(connObjectName);<NEW_LINE>connObjectName = null;<NEW_LINE>}<NEW_LINE>} catch (MBeanRegistrationException ex) {<NEW_LINE>JMX_LOGGER.log(Level.SEVERE, JMX_MBEAN_REG_EXCEPTION, ex);<NEW_LINE>} catch (InstanceNotFoundException ex) {<NEW_LINE>JMX_LOGGER.log(<MASK><NEW_LINE>}<NEW_LINE>synchronized (service.lock) {<NEW_LINE>for (final JMXConnectorServer connector : mConnectorServers) {<NEW_LINE>try {<NEW_LINE>final JMXServiceURL address = connector.getAddress();<NEW_LINE>connector.stop();<NEW_LINE>JMX_LOGGER.log(Level.INFO, JMX_STARTUPSERVICE_STOPPED_JMX_CONNECTOR, address);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>JMX_LOGGER.log(Level.SEVERE, null, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>service.jmxConnectorstatus = JMXConnectorStatus.STOPPED;<NEW_LINE>}<NEW_LINE>mConnectorServers.clear();<NEW_LINE>}
Level.SEVERE, JMX_INSTANCE_NOT_FOUND_EXCEPTION, ex);