content stringlengths 40 137k |
|---|
"protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n String responseStr;\n String resourcePath = (String) request.getAttribute(\"String_Node_Str\");\n String userId = processUserId(this.getXRdHeader(request, Constants.XRD_HEADER_USER_ID));\n String messageId = processMessageId(this.getXRdHeader(request, Constants.XRD_HEADER_MESSAGE_ID));\n String namespace = this.getXRdHeader(request, Constants.XRD_HEADER_NAMESPACE_SERIALIZE);\n String prefix = this.getXRdHeader(request, Constants.XRD_HEADER_NAMESPACE_PREFIX_SERIALIZE);\n String contentType = request.getHeader(Constants.HTTP_HEADER_CONTENT_TYPE);\n String acceptHeader = this.getXRdHeader(request, Constants.HTTP_HEADER_ACCEPT) == null ? Constants.TEXT_XML : this.getXRdHeader(request, Constants.HTTP_HEADER_ACCEPT);\n logger.info(\"String_Node_Str\", request.getMethod(), resourcePath);\n String accept = processAcceptHeader(acceptHeader);\n response.setContentType(accept);\n boolean omitNamespace = accept.startsWith(Constants.APPLICATION_JSON);\n response.addHeader(Constants.XRD_HEADER_USER_ID, userId);\n response.addHeader(Constants.XRD_HEADER_MESSAGE_ID, messageId);\n if (resourcePath == null) {\n responseStr = this.generateError(Constants.ERROR_404, accept);\n response.setStatus(404);\n this.writeResponse(response, responseStr);\n return;\n }\n String serviceId = request.getMethod() + \"String_Node_Str\" + resourcePath;\n logger.debug(\"String_Node_Str\", serviceId);\n ConsumerEndpoint endpoint = ConsumerGatewayUtil.findMatch(serviceId, endpoints);\n if (endpoint == null) {\n if (this.serviceCallsByXRdServiceId) {\n logger.info(\"String_Node_Str\", resourcePath);\n endpoint = ConsumerGatewayUtil.createUnconfiguredEndpoint(this.props, resourcePath);\n } else {\n logger.info(\"String_Node_Str\");\n }\n }\n if (endpoint == null) {\n responseStr = this.generateError(Constants.ERROR_404, accept);\n response.setStatus(404);\n this.writeResponse(response, responseStr);\n return;\n }\n processNamespaceAndPrefix(endpoint, namespace, prefix);\n logger.info(\"String_Node_Str\", serviceId, endpoint.getServiceId(), messageId);\n try {\n ServiceRequest<Map<String, String[]>> serviceRequest = new ServiceRequest<>(endpoint.getConsumer(), endpoint.getProducer(), messageId);\n serviceRequest.setUserId(userId);\n serviceRequest.setRequestData(this.filterRequestParameters(request.getParameterMap()));\n if (endpoint.isProcessingWrappers() != null) {\n serviceRequest.setProcessingWrappers(endpoint.isProcessingWrappers());\n }\n String requestBody = this.readRequestBody(request);\n ServiceRequestSerializer serializer;\n if (endpoint.isRequestEncrypted()) {\n logger.debug(\"String_Node_Str\");\n Encrypter asymmetricEncrypter = RESTGatewayUtil.getEncrypter(this.publicKeyFile, this.publicKeyFilePassword, endpoint.getProducer().toString());\n if (asymmetricEncrypter == null) {\n throw new XRd4JException(\"String_Node_Str\");\n }\n serializer = new EncryptingRequestSerializer(endpoint.getResourceId(), requestBody, contentType, asymmetricEncrypter, this.keyLength);\n } else {\n serializer = new RequestSerializer(endpoint.getResourceId(), requestBody, contentType);\n }\n ServiceResponseDeserializer deserializer;\n if (endpoint.isResponseEncrypted()) {\n if (this.asymmetricDecrypter == null) {\n throw new Exception(\"String_Node_Str\");\n }\n deserializer = new EncryptingResponseDeserializer(omitNamespace, this.asymmetricDecrypter);\n } else {\n deserializer = new ResponseDeserializer(omitNamespace);\n }\n SOAPClient client = new SOAPClientImpl();\n logger.info(\"String_Node_Str\", messageId, props.getProperty(Constants.CONSUMER_PROPS_SECURITY_SERVER_URL));\n ServiceResponse serviceResponse = client.send(serviceRequest, props.getProperty(Constants.CONSUMER_PROPS_SECURITY_SERVER_URL), serializer, deserializer);\n logger.info(\"String_Node_Str\", messageId);\n if (endpoint.isProcessingWrappers() != null) {\n serviceResponse.setProcessingWrappers(endpoint.isProcessingWrappers());\n }\n responseStr = handleResponse(response, serviceResponse);\n if (endpoint.isModifyUrl()) {\n String servletUrl = this.getServletUrl(request);\n responseStr = ConsumerGatewayUtil.rewriteUrl(servletUrl, resourcePath, responseStr);\n }\n logger.info(\"String_Node_Str\", serviceId, endpoint.getServiceId(), messageId);\n } catch (Exception ex) {\n logger.error(ex.getMessage(), ex);\n logger.error(\"String_Node_Str\", serviceId, endpoint.getServiceId(), messageId);\n responseStr = this.generateError(Constants.ERROR_500, accept);\n response.setStatus(500);\n }\n this.writeResponse(response, responseStr);\n}\n"
|
"private void populatePLSDataSetData(IEventHandler eventHandler, StreamManager manager) throws DataException, IOException {\n org.eclipse.birt.data.engine.impl.document.ResultIterator docIt;\n if (!queryDefn.isSummaryQuery()) {\n docIt = new org.eclipse.birt.data.engine.impl.document.ResultIterator(engine.getSession().getTempDir(), getEngineContext(), null, queryDefn.getQueryResultsID(), queryDefn);\n } else {\n docIt = new org.eclipse.birt.data.engine.impl.document.ResultIterator2(engine.getSession().getTempDir(), getEngineContext(), null, queryDefn.getQueryResultsID(), queryDefn.getGroups().size(), queryDefn.isSummaryQuery(), queryDefn);\n }\n PLSEnabledDataSetPopulator populator = new PLSEnabledDataSetPopulator(queryDefn, queryDefn.getQueryExecutionHints().getTargetGroupInstances(), docIt);\n ResultClass processedRC = (ResultClass) populateResultClass(populator.getResultClass());\n SmartCache cache = new SmartCache(new CacheRequest(0, new ArrayList(), null, eventHandler), new OdiAdapter(populator), processedRC, engine.getSession());\n manager.dropStream1(DataEngineContext.DATASET_DATA_STREAM);\n manager.dropStream1(DataEngineContext.DATASET_DATA_LEN_STREAM);\n cleanUpOldRD();\n OutputStream resultClassStream = manager.getOutStream(DataEngineContext.DATASET_META_STREAM, StreamManager.ROOT_STREAM, StreamManager.SELF_SCOPE);\n processedRC.doSave(resultClassStream, new ArrayList(queryDefn.getBindings().values()), manager.getVersion());\n resultClassStream.close();\n DataOutputStream dataSetDataStream = new DataOutputStream(manager.getOutStream(DataEngineContext.DATASET_DATA_STREAM, StreamManager.ROOT_STREAM, StreamManager.SELF_SCOPE));\n DataOutputStream rowLensStream = new DataOutputStream(manager.getOutStream(DataEngineContext.DATASET_DATA_LEN_STREAM, StreamManager.ROOT_STREAM, StreamManager.SELF_SCOPE));\n cache.doSave(dataSetDataStream, rowLensStream, null, new HashMap(), eventHandler.getAllColumnBindings());\n dataSetDataStream.flush();\n cache.close();\n DataOutputStream plsGroupLevelStream = new DataOutputStream(manager.getOutStream(DataEngineContext.PLS_GROUPLEVEL_STREAM, StreamManager.ROOT_STREAM, StreamManager.SELF_SCOPE));\n IOUtil.writeInt(plsGroupLevelStream, PLSUtil.getOutmostPlsGroupLevel(queryDefn));\n plsGroupLevelStream.close();\n}\n"
|
"protected void delegateSeek(long pos) throws IOException {\n if (delegate == null) {\n if (pos > memoryDelegate.length && !pureMemory) {\n createRandomAccessFile();\n } else {\n pointer = (int) pos;\n return;\n }\n }\n delegate.seek(pos);\n}\n"
|
"private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long templateId, String name, String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Long pageSize, Long startIndex, Long zoneId, HypervisorType hyperType, boolean showDomr, boolean onlyReady, List<Account> permittedAccounts, Account caller, ListProjectResourcesCriteria listProjectResourcesCriteria, Map<String, String> tags) {\n List<HypervisorType> hypers = null;\n if (!isIso) {\n hypers = _resourceMgr.listAvailHypervisorInZone(null, null);\n if (hypers == null || hypers.isEmpty()) {\n return new Pair<List<TemplateJoinVO>, Integer>(new ArrayList<TemplateJoinVO>(), 0);\n }\n }\n VMTemplateVO template = null;\n Boolean isAscending = Boolean.parseBoolean(_configDao.getValue(\"String_Node_Str\"));\n isAscending = (isAscending == null ? true : isAscending);\n Filter searchFilter = new Filter(TemplateJoinVO.class, \"String_Node_Str\", isAscending, startIndex, pageSize);\n SearchBuilder<TemplateJoinVO> sb = _templateJoinDao.createSearchBuilder();\n sb.select(null, Func.DISTINCT, sb.entity().getTempZonePair());\n SearchCriteria<TemplateJoinVO> sc = sb.create();\n if (templateId != null) {\n template = _templateDao.findById(templateId);\n if (template == null) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n if (isIso && template.getFormat() != ImageFormat.ISO) {\n s_logger.error(\"String_Node_Str\" + templateId + \"String_Node_Str\");\n InvalidParameterValueException ex = new InvalidParameterValueException(\"String_Node_Str\");\n ex.addProxyObject(template.getUuid(), \"String_Node_Str\");\n throw ex;\n }\n if (!isIso && template.getFormat() == ImageFormat.ISO) {\n s_logger.error(\"String_Node_Str\" + templateId);\n InvalidParameterValueException ex = new InvalidParameterValueException(\"String_Node_Str\" + template.getFormat() + \"String_Node_Str\");\n ex.addProxyObject(template.getUuid(), \"String_Node_Str\");\n throw ex;\n }\n if (!template.isPublicTemplate() && !_accountMgr.isRootAdmin(caller.getId())) {\n Account owner = _accountMgr.getAccount(template.getAccountId());\n _accountMgr.checkAccess(caller, null, true, owner);\n }\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, templateId);\n } else {\n DomainVO domain = null;\n if (!permittedAccounts.isEmpty()) {\n domain = _domainDao.findById(permittedAccounts.get(0).getDomainId());\n } else {\n domain = _domainDao.findById(DomainVO.ROOT_DOMAIN);\n }\n if (listProjectResourcesCriteria == ListProjectResourcesCriteria.SkipProjectResources) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.NEQ, Account.ACCOUNT_TYPE_PROJECT);\n } else if (listProjectResourcesCriteria == ListProjectResourcesCriteria.ListProjectResourcesOnly) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, Account.ACCOUNT_TYPE_PROJECT);\n }\n if ((templateFilter == TemplateFilter.self || templateFilter == TemplateFilter.selfexecutable) && (_accountMgr.isDomainAdmin(caller.getId()) || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN)) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.LIKE, domain.getPath() + \"String_Node_Str\");\n }\n List<Long> relatedDomainIds = new ArrayList<Long>();\n List<Long> permittedAccountIds = new ArrayList<Long>();\n if (!permittedAccounts.isEmpty()) {\n for (Account account : permittedAccounts) {\n permittedAccountIds.add(account.getId());\n DomainVO accountDomain = _domainDao.findById(account.getDomainId());\n DomainVO domainTreeNode = accountDomain;\n relatedDomainIds.add(domainTreeNode.getId());\n while (domainTreeNode.getParent() != null) {\n domainTreeNode = _domainDao.findById(domainTreeNode.getParent());\n relatedDomainIds.add(domainTreeNode.getId());\n }\n if (_accountMgr.isAdmin(account.getType()) || (templateFilter == TemplateFilter.featured || templateFilter == TemplateFilter.community)) {\n List<DomainVO> allChildDomains = _domainDao.findAllChildren(accountDomain.getPath(), accountDomain.getId());\n for (DomainVO childDomain : allChildDomains) {\n relatedDomainIds.add(childDomain.getId());\n }\n }\n }\n }\n if (!isIso) {\n if (hypers != null && !hypers.isEmpty()) {\n String[] relatedHypers = new String[hypers.size()];\n for (int i = 0; i < hypers.size(); i++) {\n relatedHypers[i] = hypers.get(i).toString();\n }\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.IN, relatedHypers);\n }\n }\n if (templateFilter == TemplateFilter.featured || templateFilter == TemplateFilter.community) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, true);\n if (templateFilter == TemplateFilter.featured) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, true);\n } else {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, false);\n }\n List<Long> domainTree = new ArrayList<Long>();\n DomainVO domainTreeNode = callerDomain;\n domainTree.add(domainTreeNode.getId());\n while (domainTreeNode.getParent() != null) {\n domainTreeNode = _domainDao.findById(domainTreeNode.getParent());\n domainTree.add(domainTreeNode.getId());\n }\n } else if (templateFilter == TemplateFilter.self || templateFilter == TemplateFilter.selfexecutable) {\n if (!permittedAccounts.isEmpty()) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.IN, permittedAccountIds.toArray());\n }\n } else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) {\n SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();\n scc.addOr(\"String_Node_Str\", SearchCriteria.Op.IN, permittedAccountIds.toArray());\n scc.addOr(\"String_Node_Str\", SearchCriteria.Op.IN, permittedAccountIds.toArray());\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, scc);\n } else if (templateFilter == TemplateFilter.executable) {\n SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();\n scc.addOr(\"String_Node_Str\", SearchCriteria.Op.EQ, true);\n if (!permittedAccounts.isEmpty()) {\n scc.addOr(\"String_Node_Str\", SearchCriteria.Op.IN, permittedAccountIds.toArray());\n }\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, scc);\n }\n if (tags != null && !tags.isEmpty()) {\n SearchCriteria<TemplateJoinVO> scc = _templateJoinDao.createSearchCriteria();\n int count = 0;\n for (String key : tags.keySet()) {\n SearchCriteria<TemplateJoinVO> scTag = _templateJoinDao.createSearchCriteria();\n scTag.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, key);\n scTag.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, tags.get(key));\n if (isIso) {\n scTag.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, ResourceObjectType.ISO);\n } else {\n scTag.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, ResourceObjectType.Template);\n }\n scc.addOr(\"String_Node_Str\", SearchCriteria.Op.SC, scTag);\n count++;\n }\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, scc);\n }\n if (keyword != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.LIKE, \"String_Node_Str\" + keyword + \"String_Node_Str\");\n } else if (name != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, name);\n }\n if (isIso) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, \"String_Node_Str\");\n } else {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.NEQ, \"String_Node_Str\");\n }\n if (!hyperType.equals(HypervisorType.None)) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, hyperType);\n }\n if (bootable != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, bootable);\n }\n if (onlyReady) {\n SearchCriteria<TemplateJoinVO> readySc = _templateJoinDao.createSearchCriteria();\n readySc.addOr(\"String_Node_Str\", SearchCriteria.Op.EQ, TemplateState.Ready);\n readySc.addOr(\"String_Node_Str\", SearchCriteria.Op.EQ, ImageFormat.BAREMETAL);\n SearchCriteria<TemplateJoinVO> isoPerhostSc = _templateJoinDao.createSearchCriteria();\n isoPerhostSc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, ImageFormat.ISO);\n isoPerhostSc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, TemplateType.PERHOST);\n readySc.addOr(\"String_Node_Str\", SearchCriteria.Op.SC, isoPerhostSc);\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, readySc);\n }\n if (!showDomr) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.NEQ, Storage.TemplateType.SYSTEM);\n }\n }\n if (zoneId != null) {\n SearchCriteria<TemplateJoinVO> zoneSc = _templateJoinDao.createSearchCriteria();\n zoneSc.addOr(\"String_Node_Str\", SearchCriteria.Op.EQ, zoneId);\n zoneSc.addOr(\"String_Node_Str\", SearchCriteria.Op.EQ, ScopeType.REGION);\n SearchCriteria<TemplateJoinVO> isoPerhostSc = _templateJoinDao.createSearchCriteria();\n isoPerhostSc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, ImageFormat.ISO);\n isoPerhostSc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, TemplateType.PERHOST);\n zoneSc.addOr(\"String_Node_Str\", SearchCriteria.Op.SC, isoPerhostSc);\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, zoneSc);\n }\n Pair<List<TemplateJoinVO>, Integer> uniqueTmplPair = _templateJoinDao.searchAndCount(sc, searchFilter);\n Integer count = uniqueTmplPair.second();\n if (count.intValue() == 0) {\n return uniqueTmplPair;\n }\n List<TemplateJoinVO> uniqueTmpls = uniqueTmplPair.first();\n String[] tzIds = new String[uniqueTmpls.size()];\n int i = 0;\n for (TemplateJoinVO v : uniqueTmpls) {\n tzIds[i++] = v.getTempZonePair();\n }\n List<TemplateJoinVO> vrs = _templateJoinDao.searchByTemplateZonePair(tzIds);\n return new Pair<List<TemplateJoinVO>, Integer>(vrs, count);\n}\n"
|
"public Optional<Webhook> upsert(Webhook webhook) {\n webhook = webhook.withDefaults(true);\n logger.info(\"String_Node_Str\" + webhook);\n webhookValidator.validate(webhook);\n String name = webhook.getName();\n Optional<Webhook> webhookOptional = get(name);\n if (webhookOptional.isPresent()) {\n Webhook existing = webhookOptional.get();\n if (existing.equals(webhook)) {\n return webhookOptional;\n } else if (!existing.allowedToChange(webhook)) {\n throw new ConflictException(\"String_Node_Str\");\n }\n }\n ContentPath existing = lastContentPath.getOrNull(name, WEBHOOK_LAST_COMPLETED);\n logger.info(\"String_Node_Str\", name, existing, webhook.getStartingKey());\n webhook = upsertHistorical(webhook, name);\n if (existing == null || webhook.getStartingKey() != null) {\n logger.info(\"String_Node_Str\", name, webhook.getStartingKey());\n lastContentPath.initialize(name, webhook.getStartingKey(), WEBHOOK_LAST_COMPLETED);\n }\n webhookDao.upsert(webhook);\n webhookManager.notifyWatchers();\n return webhookOptional;\n}\n"
|
"public void run() {\n try {\n Thread.sleep(timeout);\n if (!ended.get()) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + context + \"String_Node_Str\" + Strings.join(cmd, \"String_Node_Str\"));\n proc.destroy();\n killed.set(true);\n }\n }\n } catch (Exception e) {\n }\n}\n"
|
"private void updateListView() {\n mLogItems = getLogLines();\n Parcelable state = mLogListView.onSaveInstanceState();\n mLogListView = new ListView(this);\n mLogListView = (ListView) findViewById(android.R.id.list);\n mLogAdapter = new LogAdapter(mLogItems);\n mLogListView.setAdapter(mLogAdapter);\n mLogListView.onRestoreInstanceState(state);\n try {\n if (mLogListView.getLastVisiblePosition() == mLogListView.getAdapter().getCount() - 1 && mLogListView.getChildAt(mLogListView.getChildCount() - 1).getBottom() <= mLogListView.getHeight()) {\n scrollMyListViewToBottom();\n }\n } catch (Exception e) {\n Log.e(TAG, \"String_Node_Str\" + e.getMessage());\n }\n}\n"
|
"protected RestResult handleRequest(RestRequest restRequest) {\n RestResult result = null;\n if (restRequest != null) {\n PodioFilter filter = restRequest.getFilter();\n if (filter != null) {\n RestOperation operation = restRequest.getOperation();\n Object item = restRequest.getContent();\n ItemParser<?> parser = restRequest.getItemParser();\n result = queryNetwork(operation, uri, item, parser);\n }\n }\n return result != null ? result : new RestResult(false, null, null);\n}\n"
|
"public void postValidate() {\n if (DesignChoiceConstants.DISPLAY_BLOCK.equals(display) || DesignChoiceConstants.DISPLAY_INLINE.equals(display)) {\n List list = getFragments();\n FlowBox box;\n int left = Integer.MAX_VALUE, top = left;\n int bottom = Integer.MIN_VALUE;\n for (int i = 0; i < list.size(); i++) {\n box = (FlowBox) list.get(i);\n left = Math.min(left, box.getX());\n top = Math.min(top, box.getBaseline() - box.getAscent());\n bottom = Math.max(bottom, box.getBaseline() + box.getDescent());\n }\n int width = LabelFigure.this.getClientArea().width;\n if (isFixLayout) {\n int maxWidth = calcMaxSegment() - getInsets().getWidth();\n width = Math.max(width, maxWidth);\n }\n setBounds(new Rectangle(left, top, width, Math.max(LabelFigure.this.getClientArea().height, bottom - top)));\n if (isFixLayout()) {\n Figure child = (Figure) getParent();\n Rectangle rect = child.getBounds();\n child.setBounds(new Rectangle(rect.x, rect.y, width, rect.height));\n }\n list = getChildren();\n for (int i = 0; i < list.size(); i++) {\n ((FlowFigure) list.get(i)).postValidate();\n }\n } else {\n super.postValidate();\n }\n}\n"
|
"private String parseGetStyle(List<String> content) {\n String line = content.get(propertyIndex).trim();\n Matcher matcher = GETTER_PATTERN.matcher(line);\n if (matcher.matches()) {\n return matcher.group(1);\n }\n return \"String_Node_Str\";\n}\n"
|
"private File getInputFile() throws IOException {\n String copyName = String.format(\"String_Node_Str\", Lib.getDateTimeString());\n File outfile = tempFolder.newFile(copyName);\n URL url = UtfReadingRuleTest.class.getResource(FILE_INPUT);\n InputStream inputStream = null;\n try {\n inputStream = new BufferedInputStream(url.openStream());\n Lib.inputStreamToFile(inputStream, outfile);\n } finally {\n Lib.close(inputStream);\n }\n return outfile;\n}\n"
|
"private Node findChild(Node parent, int value, ChildNotFoundPolicy childNotFoundPolicy) {\n Relationship firstRelationship = parent.getSingleRelationship(FIRST, OUTGOING);\n if (firstRelationship == null) {\n return null;\n }\n Node existingChild = firstRelationship.getEndNode();\n while (getInt(existingChild, VALUE_PROPERTY) < value && parent(existingChild).equals(parent)) {\n Relationship nextRelationship = existingChild.getSingleRelationship(NEXT, OUTGOING);\n if (nextRelationship == null) {\n switch(childNotFoundPolicy) {\n case RETURN_NULL:\n return null;\n case RETURN_NEXT:\n return null;\n case RETURN_PREVIOUS:\n return existingChild;\n }\n }\n if (!parent(nextRelationship.getEndNode()).equals(parent)) {\n switch(childNotFoundPolicy) {\n case RETURN_NULL:\n return null;\n case RETURN_NEXT:\n return nextRelationship.getEndNode();\n case RETURN_PREVIOUS:\n return existingChild;\n }\n }\n existingChild = nextRelationship.getEndNode();\n }\n if (getInt(existingChild, VALUE_PROPERTY) == value) {\n return existingChild;\n }\n switch(childNotFoundPolicy) {\n case RETURN_NULL:\n return null;\n case RETURN_NEXT:\n return existingChild;\n case RETURN_PREVIOUS:\n return existingChild.getSingleRelationship(NEXT, INCOMING) == null ? null : existingChild.getSingleRelationship(NEXT, INCOMING).getStartNode();\n default:\n throw new IllegalStateException(\"String_Node_Str\" + childNotFoundPolicy);\n }\n}\n"
|
"public boolean getNextPermutation() throws StandardException {\n if (numOptimizables < 1) {\n if (optimizerTrace) {\n trace(NO_TABLES, 0, 0, 0.0, null);\n }\n endOfRoundCleanup();\n return false;\n }\n optimizableList.initAccessPaths(this);\n if ((!timeExceeded) && (numTablesInQuery > 6) && (!noTimeout)) {\n currentTime = System.currentTimeMillis();\n timeExceeded = (currentTime - timeOptimizationStarted) > timeLimit;\n if (optimizerTrace && timeExceeded) {\n trace(TIME_EXCEEDED, 0, 0, 0.0, null);\n }\n }\n if (bestCost.isUninitialized() && foundABestPlan && ((!usingPredsPushedFromAbove && !bestJoinOrderUsedPredsFromAbove) || timeExceeded)) {\n if (permuteState != JUMPING) {\n if (firstLookOrder == null)\n firstLookOrder = new int[numOptimizables];\n for (int i = 0; i < numOptimizables; i++) firstLookOrder[i] = bestJoinOrder[i];\n permuteState = JUMPING;\n if (joinPosition >= 0) {\n rewindJoinOrder();\n joinPosition = -1;\n }\n }\n timeExceeded = false;\n }\n boolean joinPosAdvanced = false;\n boolean alreadyCostsMore = !bestCost.isUninitialized() && (currentCost.compare(bestCost) > 0) && ((requiredRowOrdering == null) || (currentSortAvoidanceCost.compare(bestCost) > 0));\n if ((joinPosition < (numOptimizables - 1)) && !alreadyCostsMore && (!timeExceeded)) {\n if ((joinPosition < 0) || optimizableList.getOptimizable(proposedJoinOrder[joinPosition]).getBestAccessPath().getCostEstimate() != null) {\n joinPosition++;\n joinPosAdvanced = true;\n bestRowOrdering.copy(currentRowOrdering);\n }\n } else {\n if (optimizerTrace) {\n if (joinPosition < (numOptimizables - 1)) {\n trace(SHORT_CIRCUITING, 0, 0, 0.0, null);\n }\n }\n if (joinPosition < (numOptimizables - 1))\n reloadBestPlan = true;\n }\n if (permuteState == JUMPING && !joinPosAdvanced && joinPosition >= 0) {\n reloadBestPlan = true;\n rewindJoinOrder();\n permuteState = NO_JUMP;\n }\n while (joinPosition >= 0) {\n int nextOptimizable = 0;\n if (desiredJoinOrderFound || timeExceeded) {\n nextOptimizable = numOptimizables;\n } else if (permuteState == JUMPING) {\n int idealOptimizable = firstLookOrder[joinPosition];\n nextOptimizable = idealOptimizable;\n int lookPos = numOptimizables;\n int lastSwappedOpt = -1;\n Optimizable nextOpt;\n for (nextOpt = optimizableList.getOptimizable(nextOptimizable); !(nextOpt.legalJoinOrder(assignedTableMap)); nextOpt = optimizableList.getOptimizable(nextOptimizable)) {\n if (lastSwappedOpt >= 0) {\n firstLookOrder[joinPosition] = idealOptimizable;\n firstLookOrder[lookPos] = lastSwappedOpt;\n }\n if (lookPos > joinPosition + 1) {\n lastSwappedOpt = firstLookOrder[--lookPos];\n firstLookOrder[joinPosition] = lastSwappedOpt;\n firstLookOrder[lookPos] = idealOptimizable;\n nextOptimizable = lastSwappedOpt;\n } else {\n if (joinPosition > 0) {\n joinPosition--;\n reloadBestPlan = true;\n rewindJoinOrder();\n }\n permuteState = NO_JUMP;\n break;\n }\n }\n if (permuteState == NO_JUMP)\n continue;\n if (joinPosition == numOptimizables - 1) {\n permuteState = WALK_HIGH;\n }\n } else {\n nextOptimizable = proposedJoinOrder[joinPosition] + 1;\n for (; nextOptimizable < numOptimizables; nextOptimizable++) {\n boolean found = false;\n for (int posn = 0; posn < joinPosition; posn++) {\n if (proposedJoinOrder[posn] == nextOptimizable) {\n found = true;\n break;\n }\n }\n if (nextOptimizable < numOptimizables) {\n Optimizable nextOpt = optimizableList.getOptimizable(nextOptimizable);\n if (!(nextOpt.legalJoinOrder(assignedTableMap))) {\n if (optimizerTrace) {\n trace(SKIPPING_JOIN_ORDER, nextOptimizable, 0, 0.0, null);\n }\n if (!optimizableList.optimizeJoinOrder()) {\n if (optimizerTrace) {\n trace(ILLEGAL_USER_JOIN_ORDER, 0, 0, 0.0, null);\n }\n throw StandardException.newException(SQLState.LANG_ILLEGAL_FORCED_JOIN_ORDER);\n }\n continue;\n }\n }\n if (!found) {\n break;\n }\n }\n }\n if (proposedJoinOrder[joinPosition] >= 0) {\n Optimizable pullMe = optimizableList.getOptimizable(proposedJoinOrder[joinPosition]);\n double prevRowCount;\n double prevSingleScanRowCount;\n int prevPosition = 0;\n if (joinPosition == 0) {\n prevRowCount = outermostCostEstimate.rowCount();\n prevSingleScanRowCount = outermostCostEstimate.singleScanRowCount();\n } else {\n prevPosition = proposedJoinOrder[joinPosition - 1];\n CostEstimate localCE = optimizableList.getOptimizable(prevPosition).getBestAccessPath().getCostEstimate();\n prevRowCount = localCE.rowCount();\n prevSingleScanRowCount = localCE.singleScanRowCount();\n }\n double newCost = currentCost.getEstimatedCost();\n double pullCost = 0.0;\n CostEstimate pullCostEstimate = pullMe.getBestAccessPath().getCostEstimate();\n if (pullCostEstimate != null) {\n pullCost = pullCostEstimate.getEstimatedCost();\n newCost -= pullCost;\n if (newCost <= 0.0) {\n if (joinPosition == 0)\n newCost = 0.0;\n else\n newCost = recoverCostFromProposedJoinOrder(false);\n }\n }\n if (joinPosition == 0) {\n if (outermostCostEstimate != null) {\n newCost = outermostCostEstimate.getEstimatedCost();\n } else {\n newCost = 0.0;\n }\n }\n currentCost.setCost(newCost, prevRowCount, prevSingleScanRowCount);\n if (requiredRowOrdering != null) {\n if (pullMe.considerSortAvoidancePath()) {\n AccessPath ap = pullMe.getBestSortAvoidancePath();\n double prevEstimatedCost = 0.0d;\n if (joinPosition == 0) {\n prevRowCount = outermostCostEstimate.rowCount();\n prevSingleScanRowCount = outermostCostEstimate.singleScanRowCount();\n prevEstimatedCost = outermostCostEstimate.getEstimatedCost();\n } else {\n CostEstimate localCE = optimizableList.getOptimizable(prevPosition).getBestSortAvoidancePath().getCostEstimate();\n prevRowCount = localCE.rowCount();\n prevSingleScanRowCount = localCE.singleScanRowCount();\n prevEstimatedCost = currentSortAvoidanceCost.getEstimatedCost() - ap.getCostEstimate().getEstimatedCost();\n }\n if (prevEstimatedCost <= 0.0) {\n if (joinPosition == 0)\n prevEstimatedCost = 0.0;\n else {\n prevEstimatedCost = recoverCostFromProposedJoinOrder();\n }\n }\n currentSortAvoidanceCost.setCost(prevEstimatedCost, prevRowCount, prevSingleScanRowCount);\n bestRowOrdering.removeOptimizable(pullMe.getTableNumber());\n bestRowOrdering.copy(currentRowOrdering);\n }\n }\n pullMe.pullOptPredicates(predicateList);\n if (reloadBestPlan)\n pullMe.updateBestPlanMap(FromTable.LOAD_PLAN, this);\n proposedJoinOrder[joinPosition] = -1;\n }\n if (nextOptimizable >= numOptimizables) {\n if (!optimizableList.optimizeJoinOrder()) {\n if (!optimizableList.legalJoinOrder(numTablesInQuery)) {\n if (optimizerTrace) {\n trace(ILLEGAL_USER_JOIN_ORDER, 0, 0, 0.0, null);\n }\n throw StandardException.newException(SQLState.LANG_ILLEGAL_FORCED_JOIN_ORDER);\n }\n if (optimizerTrace) {\n trace(USER_JOIN_ORDER_OPTIMIZED, 0, 0, 0.0, null);\n }\n desiredJoinOrderFound = true;\n }\n if (permuteState == READY_TO_JUMP && joinPosition > 0 && joinPosition == numOptimizables - 1) {\n permuteState = JUMPING;\n double[] rc = new double[numOptimizables];\n for (int i = 0; i < numOptimizables; i++) {\n firstLookOrder[i] = i;\n CostEstimate ce = optimizableList.getOptimizable(i).getBestAccessPath().getCostEstimate();\n if (ce == null) {\n permuteState = READY_TO_JUMP;\n break;\n }\n rc[i] = ce.singleScanRowCount();\n }\n if (permuteState == JUMPING) {\n boolean doIt = false;\n int temp;\n for (int i = 0; i < numOptimizables; i++) {\n int k = i;\n for (int j = i + 1; j < numOptimizables; j++) if (rc[j] < rc[k])\n k = j;\n if (k != i) {\n rc[k] = rc[i];\n temp = firstLookOrder[i];\n firstLookOrder[i] = firstLookOrder[k];\n firstLookOrder[k] = temp;\n doIt = true;\n }\n }\n if (doIt) {\n joinPosition--;\n rewindJoinOrder();\n continue;\n } else\n permuteState = NO_JUMP;\n }\n }\n joinPosition--;\n if (joinPosition >= 0) {\n Optimizable pullMe = optimizableList.getOptimizable(proposedJoinOrder[joinPosition]);\n assignedTableMap.xor(pullMe.getReferencedTableMap());\n }\n if (joinPosition < 0 && permuteState == WALK_HIGH) {\n joinPosition = 0;\n permuteState = WALK_LOW;\n }\n continue;\n }\n proposedJoinOrder[joinPosition] = nextOptimizable;\n if (permuteState == WALK_LOW) {\n boolean finishedCycle = true;\n for (int i = 0; i < numOptimizables; i++) {\n if (proposedJoinOrder[i] < firstLookOrder[i]) {\n finishedCycle = false;\n break;\n } else if (proposedJoinOrder[i] > firstLookOrder[i])\n break;\n }\n if (finishedCycle) {\n proposedJoinOrder[joinPosition] = -1;\n joinPosition--;\n if (joinPosition >= 0) {\n reloadBestPlan = true;\n rewindJoinOrder();\n joinPosition = -1;\n }\n permuteState = READY_TO_JUMP;\n endOfRoundCleanup();\n return false;\n }\n }\n optimizableList.getOptimizable(nextOptimizable).getBestAccessPath().setCostEstimate((CostEstimate) null);\n assignedTableMap.clearAll();\n for (int index = 0; index <= joinPosition; index++) {\n assignedTableMap.or(optimizableList.getOptimizable(proposedJoinOrder[index]).getReferencedTableMap());\n }\n if (optimizerTrace) {\n trace(CONSIDERING_JOIN_ORDER, 0, 0, 0.0, null);\n }\n Optimizable nextOpt = optimizableList.getOptimizable(nextOptimizable);\n nextOpt.startOptimizing(this, currentRowOrdering);\n pushPredicates(optimizableList.getOptimizable(nextOptimizable), assignedTableMap);\n return true;\n }\n endOfRoundCleanup();\n return false;\n}\n"
|
"public void index(Record record) {\n final Long recordId = record.getId();\n if (record.isActive()) {\n final Record anotherRecord = records.putIfAbsent(recordId, record);\n if (anotherRecord != null) {\n record = anotherRecord;\n } else {\n size.incrementAndGet();\n }\n } else {\n remove(record);\n }\n if (indexValue != null) {\n Long newValueIndex = -1L;\n if (record.isActive() && record.hasValueData()) {\n newValueIndex = (long) record.getValueData().hashCode();\n }\n indexValue.index(newValueIndex, record);\n }\n Long[] indexValues = record.getIndexes();\n if (indexValues != null && hasIndexedAttributes) {\n byte[] indexTypes = record.getIndexTypes();\n if (indexTypes == null || indexValues.length != indexTypes.length) {\n throw new IllegalArgumentException(\"String_Node_Str\" + Arrays.toString(indexTypes));\n }\n Collection<Index> indexes = mapIndexes.values();\n for (Index index : indexes) {\n if (indexValues.length > index.getAttributeIndex()) {\n Long newValue = indexValues[index.getAttributeIndex()];\n index.index(newValue, record);\n }\n }\n }\n}\n"
|
"public void setColumnString(String columnString) {\n realmSetter$columnString(columnString);\n}\n"
|
"public String[] commandLang1(File out, boolean step) {\n String libsdir = new File(\"String_Node_Str\").getAbsolutePath();\n String dep = libsdir + File.separator + \"String_Node_Str\" + File.pathSeparator + libsdir + File.separator + \"String_Node_Str\" + File.pathSeparator + File.separator + libsdir + File.separator + \"String_Node_Str\" + File.pathSeparator + File.separator + libsdir + File.separator + \"String_Node_Str\";\n String[] args = new String[] { \"String_Node_Str\", dep, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", new File(\"String_Node_Str\").getAbsolutePath(), \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", out.getAbsolutePath(), \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", (step) ? \"String_Node_Str\" : \"String_Node_Str\" };\n return args;\n}\n"
|
"public int read(byte[] data, int pos, int len) {\n long offset = Long.MAX_VALUE;\n long bytesToSkip = logicalPosition;\n int extIndex;\n long currentExtentLength;\n for (extIndex = 0; extIndex < extentDescriptors.length; ++extIndex) {\n CommonHFSExtentDescriptor cur = extentDescriptors[extIndex];\n currentExtentLength = cur.getBlockCount() * allocationBlockSize;\n if (bytesToSkip >= currentExtentLength) {\n if (extIndex < extentDescriptors.length - 1)\n bytesToSkip -= currentExtentLength;\n else {\n return -1;\n }\n } else {\n offset = fsOffset + firstBlockByteOffset + (cur.getStartBlock() * allocationBlockSize) + bytesToSkip;\n break;\n }\n }\n if (logicalPosition != lastLogicalPos) {\n sourceFile.seek(offset);\n } else if (sourceFile.getFilePointer() != lastPhysicalPos) {\n sourceFile.seek(lastPhysicalPos);\n }\n long bytesLeftInStream = forkLength - logicalPosition;\n int totalBytesToRead = bytesLeftInStream < len ? (int) bytesLeftInStream : len;\n int bytesLeftToRead = totalBytesToRead;\n for (; extIndex < extentDescriptors.length; ++extIndex) {\n CommonHFSExtentDescriptor cur = extentDescriptors[extIndex];\n long bytesInExtent = cur.getBlockCount() * allocationBlockSize - bytesToSkip;\n int bytesToReadFromExtent = (bytesInExtent < bytesLeftToRead) ? (int) bytesInExtent : bytesLeftToRead;\n int bytesReadFromExtent = 0;\n while (bytesReadFromExtent < bytesToReadFromExtent) {\n int bytesToRead = bytesToReadFromExtent - bytesReadFromExtent;\n int positionInArray = pos + (totalBytesToRead - bytesLeftToRead) + bytesReadFromExtent;\n int bytesRead = sourceFile.read(data, positionInArray, bytesToRead);\n if (bytesRead > 0)\n bytesReadFromExtent += bytesRead;\n else {\n lastPhysicalPos = sourceFile.getFilePointer();\n int totalBytesRead = positionInArray - pos;\n logicalPosition += totalBytesRead;\n return totalBytesRead;\n }\n }\n bytesLeftToRead -= bytesReadFromExtent;\n bytesToSkip = 0;\n if (bytesLeftToRead == 0)\n break;\n }\n lastPhysicalPos = sourceFile.getFilePointer();\n logicalPosition += totalBytesToRead - bytesLeftToRead;\n if (bytesLeftToRead < totalBytesToRead) {\n int bytesRead = totalBytesToRead - bytesLeftToRead;\n return bytesRead;\n } else\n return -1;\n}\n"
|
"public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {\n if (CreativeCommons.isEnabled() && ccLicenseStep != null) {\n ccLicenseStep.addBody(body);\n return;\n }\n Collection collection = submission.getCollection();\n String actionURL = contextPath + \"String_Node_Str\" + collection.getHandle() + \"String_Node_Str\" + knot.getId() + \"String_Node_Str\";\n String licenseText = collection.getLicense();\n Division div = body.addInteractiveDivision(\"String_Node_Str\", actionURL, Division.METHOD_POST, \"String_Node_Str\");\n div.setHead(T_submission_head);\n addSubmissionProgressList(div);\n Division inner = div.addDivision(\"String_Node_Str\");\n inner.setHead(T_head);\n inner.addPara(T_info1);\n inner.addPara(T_info2);\n Division displayLicense = inner.addDivision(\"String_Node_Str\", \"String_Node_Str\");\n displayLicense.addSimpleHTMLFragment(true, licenseText);\n inner.addPara(T_info3);\n List controls = inner.addList(\"String_Node_Str\", List.TYPE_FORM);\n CheckBox decision = controls.addItem().addCheckBox(\"String_Node_Str\");\n decision.setLabel(T_decision_label);\n decision.addOption(\"String_Node_Str\", T_decision_checkbox);\n if (this.errorFlag == org.dspace.submit.step.LicenseStep.STATUS_LICENSE_REJECTED) {\n log.info(LogManager.getHeader(context, \"String_Node_Str\", submissionInfo.getSubmissionLogInfo()));\n decision.addError(T_decision_error);\n }\n addControlButtons(controls);\n div.addHidden(\"String_Node_Str\").setValue(knot.getId());\n}\n"
|
"public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {\n classExtendsCapturedType = false;\n if (capturedTypeDesc.equals(superName)) {\n classExtendsCapturedType = true;\n throw VisitInterruptedException.INSTANCE;\n }\n boolean haveInterfaces = interfaces != null && interfaces.length > 0;\n if (haveInterfaces) {\n for (String implementedInterface : interfaces) {\n if (capturedTypeDesc.equals(implementedInterface)) {\n classExtendsCapturedType = true;\n break;\n }\n }\n }\n if (superName != null && !classExtendsCapturedType && !\"String_Node_Str\".contains(superName)) {\n ClassReader cr = ClassFile.createClassFileReader(loader, superName);\n cr.accept(this, SKIP_DEBUG);\n }\n throw VisitInterruptedException.INSTANCE;\n}\n"
|
"private void getInitialTransportState() {\n DisplayClientState dcs = KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();\n mTransportState = (dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));\n mPlaybackState = dcs.playbackState;\n if (DEBUG)\n Log.v(TAG, \"String_Node_Str\" + mTransportState + \"String_Node_Str\" + dcs.playbackState);\n}\n"
|
"public boolean allowConnection(HandshakeResponse hr, boolean leaf) {\n if (!ConnectionSettings.PREFERENCING_ACTIVE.getValue())\n return true;\n if (!ConnectionSettings.IGNORE_KEEP_ALIVE.getValue() && _keepAlive <= 0) {\n return false;\n } else if (RouterService.isShieldedLeaf()) {\n if (hr.isGoodUltrapeer() && _shieldedConnections < PREFERRED_CONNECTIONS_FOR_LEAF) {\n return true;\n } else {\n return false;\n }\n } else if (hr.isLeaf() || leaf) {\n if (!allowUltrapeer2LeafConnection(hr)) {\n return false;\n }\n int leaves = getNumInitializedClientConnections();\n int nonLimeWireLeaves = _nonLimeWireLeaves;\n if (!hr.isLimeWire()) {\n if (leaves < UltrapeerSettings.MAX_LEAVES.getValue() && nonLimeWireLeaves < RESERVED_NON_LIMEWIRE_LEAVES) {\n return true;\n } else {\n return false;\n }\n }\n if (hr.isGoodLeaf()) {\n return (leaves + Math.max(0, RESERVED_NON_LIMEWIRE_LEAVES - nonLimeWireLeaves)) < UltrapeerSettings.MAX_LEAVES.getValue();\n }\n return leaves < (UltrapeerSettings.MAX_LEAVES.getValue() - RESERVED_GOOD_LEAF_CONNECTIONS);\n } else if (hr.isUltrapeer()) {\n int peers = getNumInitializedConnections();\n int nonLimeWirePeers = _nonLimeWirePeers;\n int locale_num = 0;\n if (!allowUltrapeer2UltrapeerConnection(hr)) {\n return false;\n }\n if (ConnectionSettings.USE_LOCALE_PREF.getValue()) {\n if (checkLocale(hr.getLocalePref()) && _localeMatchingPeers < ConnectionSettings.NUM_LOCALE_PREF.getValue()) {\n return true;\n }\n locale_num = getNumLimeWireLocalePrefSlots();\n }\n if (!hr.isLimeWire()) {\n if (peers < ULTRAPEER_CONNECTIONS && nonLimeWirePeers < RESERVED_NON_LIMEWIRE_PEERS) {\n return true;\n }\n }\n return (peers + RESERVED_NON_LIMEWIRE_PEERS - nonLimeWirePeers + locale_num) < ULTRAPEER_CONNECTIONS;\n }\n return false;\n}\n"
|
"private final void serializeObjectNoSCO(Object v, ZooFieldDef def) {\n if (v == null) {\n writeClassInfo(null, null);\n out.skipWrite(def.getLength() - 1);\n if (def.isString()) {\n scos.add(null);\n return;\n }\n return;\n }\n Class<? extends Object> cls = v.getClass();\n writeClassInfo(cls, v);\n if (isPersistentCapable(cls)) {\n serializeOid(v);\n return;\n } else if (String.class == cls) {\n scos.add(v);\n String s = (String) v;\n out.writeLong(BitTools.toSortableLong(s));\n return;\n } else if (Date.class == cls) {\n out.writeLong(((Date) v).getTime());\n return;\n }\n throw new IllegalArgumentException(\"String_Node_Str\" + cls);\n}\n"
|
"public void performPublishDeleteCheck() throws XPathExpressionException, IOException, JMSException, NamingException, AndesClientException, AndesClientConfigurationException {\n String queueName = \"String_Node_Str\";\n driver.get(getLoginURL());\n LoginPage loginPage = new LoginPage(driver);\n HomePage homePage = loginPage.loginAs(getCurrentUserName(), getCurrentPassword());\n QueueAddPage queueAddPage = homePage.getQueueAddPage();\n Assert.assertEquals(queueAddPage.addQueue(queueName), true);\n AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(getAMQPPort(), ExchangeType.QUEUE, queueName);\n publisherConfig.setNumberOfMessagesToSend(1000);\n publisherConfig.setPrintsPerMessageCount(100L);\n AndesClient publisherClient = new AndesClient(publisherConfig, true);\n publisherClient.startClient();\n AndesClientUtils.sleepForInterval(3000);\n QueuesBrowsePage queuesBrowsePage = homePage.getQueuesBrowsePage();\n queuesBrowsePage.deleteQueue(queueName);\n queuesBrowsePage = homePage.getQueuesBrowsePage();\n Assert.assertTrue(!queuesBrowsePage.isQueuePresent(queueName));\n logout();\n}\n"
|
"public static List getMethods(IClassInfo classInfo, Comparator comp) {\n List methods = classInfo.getMethods();\n Collections.sort(methods, comp);\n return methods;\n}\n"
|
"public void free(final R entry) {\n if (!pool.add(entry))\n LOG.warn(\"String_Node_Str\" + this + \"String_Node_Str\" + entry + \"String_Node_Str\" + pool.size() + \"String_Node_Str\");\n}\n"
|
"public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || !(o instanceof ConfigDir)) {\n return false;\n }\n Config that = (Config) o;\n return sharedRoot() == that.sharedRoot();\n}\n"
|
"private Map<String, ARXNode> readLattice(final ZipFile zip) throws IOException, ClassNotFoundException, SAXException {\n ZipEntry entry = zip.getEntry(\"String_Node_Str\");\n if (entry == null) {\n return null;\n }\n final Map<Integer, InformationLoss> max;\n final Map<Integer, InformationLoss> min;\n ObjectInputStream oos = new ObjectInputStream(zip.getInputStream(entry));\n min = (Map<Integer, InformationLoss>) oos.readObject();\n max = (Map<Integer, InformationLoss>) oos.readObject();\n oos.close();\n entry = zip.getEntry(\"String_Node_Str\");\n if (entry == null) {\n throw new IOException(Resources.getMessage(\"String_Node_Str\"));\n }\n final Map<Integer, Map<Integer, Object>> attrs;\n oos = new ObjectInputStream(zip.getInputStream(entry));\n attrs = (Map<Integer, Map<Integer, Object>>) oos.readObject();\n oos.close();\n entry = zip.getEntry(\"String_Node_Str\");\n if (entry == null) {\n throw new IOException(Resources.getMessage(\"String_Node_Str\"));\n }\n oos = new ObjectInputStream(zip.getInputStream(entry));\n lattice = (ARXLattice) oos.readObject();\n final Map<String, Integer> headermap = (Map<String, Integer>) oos.readObject();\n oos.close();\n final Map<Integer, List<ARXNode>> levels = new HashMap<Integer, List<ARXNode>>();\n entry = zip.getEntry(\"String_Node_Str\");\n if (entry == null) {\n throw new IOException(Resources.getMessage(\"String_Node_Str\"));\n }\n final Map<Integer, ARXNode> map = new HashMap<Integer, ARXNode>();\n XMLReader xmlReader = XMLReaderFactory.createXMLReader();\n InputSource inputSource = new InputSource(zip.getInputStream(entry));\n xmlReader.setContentHandler(new XMLHandler() {\n private int level = 0;\n private int id = 0;\n private int[] transformation;\n private Anonymity anonymity;\n private boolean checked;\n protected boolean end(final String uri, final String localName, final String qName) throws SAXException {\n if (vocabulary.isLattice(localName) || vocabulary.isLevel(localName) || vocabulary.isPredecessors(localName) || vocabulary.isSuccessors(localName) || vocabulary.isInfoloss(localName) || vocabulary.isMax2(localName) || vocabulary.isMin2(localName)) {\n return true;\n } else if (vocabulary.isNode2(localName)) {\n final ARXNode node = lattice.new ARXNode();\n node.access().setAnonymity(anonymity);\n node.access().setChecked(checked);\n node.access().setTransformation(transformation);\n node.access().setMaximumInformationLoss(max.get(id));\n node.access().setMinimumInformationLoss(min.get(id));\n node.access().setAttributes(attrs.get(id));\n node.access().setHeadermap(headermap);\n levels.get(level).add(node);\n map.put(id, node);\n return true;\n } else if (vocabulary.isTransformation(localName)) {\n transformation = readTransformation(payload);\n return true;\n } else if (vocabulary.isAnonymity(localName)) {\n anonymity = Anonymity.valueOf(payload);\n return true;\n } else if (vocabulary.isChecked(localName)) {\n checked = Boolean.valueOf(payload);\n return true;\n } else {\n return false;\n }\n }\n protected boolean start(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {\n if (vocabulary.isLattice(localName)) {\n return true;\n } else if (vocabulary.isLevel(localName)) {\n level = Integer.valueOf(attributes.getValue(vocabulary.getDepth()));\n if (!levels.containsKey(level)) {\n levels.put(level, new ArrayList<ARXNode>());\n }\n return true;\n } else if (vocabulary.isNode2(localName)) {\n id = Integer.valueOf(attributes.getValue(vocabulary.getId()));\n return true;\n } else if (vocabulary.isTransformation(localName) || vocabulary.isAnonymity(localName) || vocabulary.isChecked(localName) || vocabulary.isPredecessors(localName) || vocabulary.isSuccessors(localName) || vocabulary.isInfoloss(localName) || vocabulary.isMax2(localName) || vocabulary.isMin2(localName)) {\n return true;\n } else {\n return false;\n }\n }\n });\n xmlReader.parse(inputSource);\n entry = zip.getEntry(\"String_Node_Str\");\n xmlReader = XMLReaderFactory.createXMLReader();\n inputSource = new InputSource(zip.getInputStream(entry));\n xmlReader.setContentHandler(new XMLHandler() {\n private int id;\n private final List<ARXNode> predecessors = new ArrayList<ARXNode>();\n private final List<ARXNode> successors = new ArrayList<ARXNode>();\n protected boolean end(final String uri, final String localName, final String qName) throws SAXException {\n if (vocabulary.isLattice(localName)) {\n return true;\n } else if (vocabulary.isLevel(localName)) {\n return true;\n } else if (vocabulary.isNode2(localName)) {\n map.get(id).access().setPredecessors(predecessors.toArray(new ARXNode[predecessors.size()]));\n map.get(id).access().setSuccessors(successors.toArray(new ARXNode[successors.size()]));\n return true;\n } else if (vocabulary.isTransformation(localName) || vocabulary.isAnonymity(localName) || vocabulary.isChecked(localName) || vocabulary.isInfoloss(localName) || vocabulary.isMax2(localName) || vocabulary.isMin2(localName)) {\n return true;\n } else if (vocabulary.isPredecessors(localName)) {\n final String[] a = payload.trim().split(\"String_Node_Str\");\n for (final String s : a) {\n final String b = s.trim();\n if (!b.equals(\"String_Node_Str\")) {\n predecessors.add(map.get(Integer.valueOf(b)));\n }\n }\n return true;\n } else if (vocabulary.isSuccessors(localName)) {\n final String[] a = payload.trim().split(\"String_Node_Str\");\n for (final String s : a) {\n final String b = s.trim();\n if (!b.equals(\"String_Node_Str\")) {\n successors.add(map.get(Integer.valueOf(b)));\n }\n }\n return true;\n } else if (vocabulary.isAttribute(localName)) {\n return true;\n } else {\n return false;\n }\n }\n protected boolean start(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException {\n if (vocabulary.isNode2(localName)) {\n id = Integer.valueOf(attributes.getValue(vocabulary.getId()));\n successors.clear();\n predecessors.clear();\n return true;\n } else if (vocabulary.isTransformation(localName) || vocabulary.isLattice(localName) || vocabulary.isLevel(localName) || vocabulary.isAnonymity(localName) || vocabulary.isChecked(localName) || vocabulary.isPredecessors(localName) || vocabulary.isSuccessors(localName) || vocabulary.isAttribute(localName) || vocabulary.isInfoloss(localName) || vocabulary.isMax2(localName) || vocabulary.isMin2(localName)) {\n return true;\n } else {\n return false;\n }\n }\n });\n xmlReader.parse(inputSource);\n final ARXNode[][] llevels = new ARXNode[levels.size()][];\n for (final Entry<Integer, List<ARXNode>> e : levels.entrySet()) {\n llevels[e.getKey()] = e.getValue().toArray(new ARXNode[] {});\n }\n lattice.access().setLevels(llevels);\n lattice.access().setBottom(llevels[bottomLevel][0]);\n lattice.access().setTop(llevels[llevels.length - 1][0]);\n final Map<String, ARXNode> result = new HashMap<String, ARXNode>();\n for (final List<ARXNode> e : levels.values()) {\n for (final ARXNode node : e) {\n result.put(Arrays.toString(node.getTransformation()), node);\n }\n }\n return result;\n}\n"
|
"private void resetAndRefreshLocal(final String[] names) {\n resetModulesNeeded();\n Project currentProject = ProjectManager.getInstance().getCurrentProject();\n final String projectLabel = currentProject.getTechnicalLabel();\n IWorkspace workspace = ResourcesPlugin.getWorkspace();\n final IProject eclipseProject = workspace.getRoot().getProject(projectLabel);\n try {\n for (String name : names) {\n String path = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();\n path = path + File.separatorChar + projectLabel + File.separatorChar + ERepositoryObjectType.getFolderName(ERepositoryObjectType.LIBS) + File.separatorChar + name;\n File libsTargetFile = new File(path);\n File source = new File(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA) + File.separatorChar + name);\n synJavaLibs(source);\n }\n } catch (IOException e) {\n CommonExceptionHandler.process(e);\n }\n if (PluginChecker.isSVNProviderPluginLoaded()) {\n ISVNProviderServiceInCoreRuntime service = (ISVNProviderServiceInCoreRuntime) GlobalServiceRegister.getDefault().getService(ISVNProviderServiceInCoreRuntime.class);\n if (service != null) {\n File libFile = new File(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA));\n boolean localConnectionProvider = true;\n IProxyRepositoryFactory proxyRepositoryFactory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();\n if (proxyRepositoryFactory != null) {\n try {\n localConnectionProvider = proxyRepositoryFactory.isLocalConnectionProvider();\n } catch (PersistenceException e) {\n }\n }\n if (!localConnectionProvider && service.isSvnLibSetupOnTAC() && service.isInSvn(libFile.getAbsolutePath()) && !getRepositoryContext().isOffline()) {\n List jars = new ArrayList();\n for (String name : names) {\n jars.add(libFile.getAbsolutePath() + File.separatorChar + name);\n }\n service.deployNewJar(jars);\n return;\n }\n }\n }\n if (PluginChecker.isSVNProviderPluginLoaded()) {\n final RepositoryWorkUnit repositoryWorkUnit = new RepositoryWorkUnit(currentProject, \"String_Node_Str\") {\n public void run() throws PersistenceException {\n try {\n for (String name : names) {\n String path = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();\n path = path + File.separatorChar + projectLabel + File.separatorChar + ERepositoryObjectType.getFolderName(ERepositoryObjectType.LIBS) + File.separatorChar + name;\n File libsTargetFile = new File(path);\n File source = new File(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA) + File.separatorChar + name);\n FilesUtils.copyFile(source, libsTargetFile);\n }\n eclipseProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());\n } catch (IOException e) {\n CommonExceptionHandler.process(e);\n } catch (CoreException e) {\n CommonExceptionHandler.process(e);\n }\n }\n };\n repositoryWorkUnit.setAvoidUnloadResources(true);\n if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {\n new Thread() {\n public void run() {\n IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);\n service.getProxyRepositoryFactory().executeRepositoryWorkUnit(repositoryWorkUnit);\n }\n }.start();\n }\n }\n}\n"
|
"private void processMapType(Object obj) throws IllegalArgumentException, IllegalAccessException {\n ParameterizedType paramType = (ParameterizedType) field.getGenericType();\n Type[] types = paramType.getActualTypeArguments();\n boolean isArray = false;\n boolean isCollection = false;\n boolean isPrimitive = false;\n Class vType = null;\n Class elementType = null;\n if (types[1] instanceof GenericArrayType) {\n isArray = true;\n GenericArrayType g = (GenericArrayType) types[1];\n elementType = (Class) g.getGenericComponentType();\n } else if (types[1] instanceof ParameterizedType) {\n isCollection = true;\n ParameterizedType p = (ParameterizedType) types[1];\n vType = (Class) p.getRawType();\n elementType = (Class) p.getActualTypeArguments()[0];\n } else {\n Class<?> actualType = FieldUtil.getClassOfType(types[1]);\n if (actualType.isArray()) {\n isArray = true;\n elementType = actualType.getComponentType();\n } else {\n isPrimitive = true;\n }\n }\n if (isArray) {\n Map src = (Map) value;\n Map map = new HashMap();\n Set<Entry> entrySet = src.entrySet();\n for (Entry entry : entrySet) {\n Object k = entry.getKey();\n List v = (ArrayList) entry.getValue();\n Object arr = convertToArrayValue(elementType, v);\n map.put(k, arr);\n }\n field.set(obj, map);\n } else if (isCollection) {\n if (DataType.isListType(vType)) {\n Map src = (Map) value;\n Map map = new HashMap();\n Set<Entry> entrySet = src.entrySet();\n for (Entry entry : entrySet) {\n Object k = entry.getKey();\n List v = (ArrayList) entry.getValue();\n List list = new ArrayList();\n moveCollectionElement(elementType, v, list);\n map.put(k, list);\n }\n field.set(obj, map);\n } else if (DataType.isSetType(vType)) {\n Map src = (Map) value;\n Map map = new HashMap();\n Set<Entry> entrySet = src.entrySet();\n for (Entry entry : entrySet) {\n Object k = entry.getKey();\n List v = (ArrayList) entry.getValue();\n Set set = new HashSet();\n moveCollectionElement(elementType, v, set);\n map.put(k, set);\n }\n field.set(obj, map);\n } else if (DataType.isQueueType(vType)) {\n Map src = (Map) value;\n Map map = new HashMap();\n Set<Entry> entrySet = src.entrySet();\n for (Entry entry : entrySet) {\n Object k = entry.getKey();\n List v = (ArrayList) entry.getValue();\n Queue queue = new LinkedList();\n moveCollectionElement(elementType, v, queue);\n map.put(k, queue);\n }\n field.set(obj, map);\n }\n } else if (isPrimitive) {\n field.set(obj, value);\n }\n}\n"
|
"public MachineInfo[] getDisconnectedSlaves() {\n Collection<MachineInfo> infos = new ArrayList<MachineInfo>();\n for (Map.Entry<Integer, String> entry : haServers.entrySet()) {\n infos.add(new MachineInfo(entry.getKey(), -1, -1, entry.getValue()));\n }\n infos.removeAll(getAllMachines().values());\n return infos.toArray(new MachineInfo[infos.size()]);\n}\n"
|
"public void end(IType type) {\n IClass iclass = type.getTheClass();\n if (iclass != null) {\n iclass.writeInnerClassInfo(this.cw);\n }\n if (!this.hasReturn) {\n int opcode = type.getReturnOpcode();\n if (opcode == RETURN || this.frame.actualStackCount > 0) {\n this.insnCallback();\n this.mv.visitInsn(opcode);\n }\n }\n this.mv.visitMaxs(this.frame.maxStack, this.frame.maxLocals);\n this.mv.visitEnd();\n}\n"
|
"public double calculate(final double[] position1, final int pos1, final double[] position2, final int pos2, final int length) {\n double sum = 0;\n for (int i = 0; i < length; i++) {\n final double d = Math.abs(position1[pos1 + i] - position2[pos1 + i]);\n sum += d;\n }\n return sum;\n}\n"
|
"static void appendMove(OPT_Register r, OPT_Operand src, OPT_Instruction store) {\n VM_TypeReference type = src.getType();\n OPT_RegisterOperand rop = new OPT_RegisterOperand(r, type);\n store.insertAfter(Move.create(OPT_IRTools.getMoveOp(type), rop, src.copy()));\n}\n"
|
"protected void set(String value) {\n EventPublisher.trigger(new SetValueEvent(value).to(GLSpinner.this));\n}\n"
|
"private boolean canStop() {\n return this.validationGainContinueNegCount >= MAGIC_NUMBER || this.trainGainContinueLowerCount >= MAGIC_NUMBER;\n}\n"
|
"private String[] getOthersVMArguments(ILaunchConfiguration configuration) throws CoreException {\n String path = configuration.getAttribute(IMPORTPROJECT, \"String_Node_Str\");\n String append = \"String_Node_Str\" + PROJECT_NAMES_KEY + \"String_Node_Str\" + path;\n String projectClassPaths = finder.getClassPath();\n String classPath = \"String_Node_Str\";\n if (projectClassPaths != null && projectClassPaths.length() != 0) {\n classPath = \"String_Node_Str\" + PROJECT_CLASSPATH_KEY + \"String_Node_Str\" + projectClassPaths;\n }\n String openFiles = \"String_Node_Str\" + PROJECT_OPENFILES_KEY + \"String_Node_Str\" + configuration.getAttribute(OPENFILENAMES, \"String_Node_Str\");\n String mode = \"String_Node_Str\" + WebViewer.REPORT_DEBUT_MODE + \"String_Node_Str\" + \"String_Node_Str\";\n return new String[] { append, classPath, openFiles, mode };\n}\n"
|
"protected void createTable(TableItem tableItem) {\n String tableString = tableItem.getText(0);\n boolean checkConnectionIsDone = managerConnection.check(getIMetadataConnection(), true);\n if (!checkConnectionIsDone) {\n updateStatus(IStatus.WARNING, Messages.getString(\"String_Node_Str\"));\n new ErrorDialogWidthDetailArea(getShell(), PID, Messages.getString(\"String_Node_Str\"), managerConnection.getMessageException());\n } else {\n if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_TABLE.getName())) {\n dbtable = RelationalFactory.eINSTANCE.createTdTable();\n } else if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_VIEW.getName())) {\n dbtable = RelationalFactory.eINSTANCE.createTdView();\n } else {\n dbtable = RelationalFactory.eINSTANCE.createTdTable();\n }\n dbtable.getTaggedValue().add(CoreFactory.eINSTANCE.createTaggedValue());\n List<TdColumn> metadataColumns = new ArrayList<TdColumn>();\n metadataColumns = ExtractMetaDataFromDataBase.returnMetadataColumnsFormTable(iMetadataConnection, tableItem.getText(0));\n tableItem.setText(2, \"String_Node_Str\" + metadataColumns.size());\n tableItem.setText(3, Messages.getString(\"String_Node_Str\"));\n synchronized (countSuccess) {\n countSuccess++;\n }\n IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();\n initExistingNames();\n String labelName = IndiceHelper.getIndexedLabel(tableString, existingNames);\n if (forTemplate) {\n labelName = MetadataToolHelper.validateValue(labelName);\n }\n dbtable.setLabel(labelName);\n dbtable.setSourceName(tableItem.getText(0));\n dbtable.setId(factory.getNextId());\n dbtable.setTableType(ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString));\n List<MetadataColumn> metadataColumnsValid = new ArrayList<MetadataColumn>();\n Iterator iterate = metadataColumns.iterator();\n while (iterate.hasNext()) {\n MetadataColumn metadataColumn = (MetadataColumn) iterate.next();\n metadataColumnsValid.add(metadataColumn);\n dbtable.getColumns().add(metadataColumn);\n }\n if (!ConnectionHelper.getTables(getConnection()).contains(dbtable) && !limitTemplateTable(dbtable)) {\n }\n }\n}\n"
|
"public void destroyCache(String cacheName) {\n removeCache(cacheName, true);\n}\n"
|
"public void link() {\n List<Runnable> currentRunnables = new ArrayList<Runnable>(runnables);\n runnables.clear();\n for (Runnable runnable : currentRunnables) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n XcorePlugin.INSTANCE.log(throwable);\n }\n }\n for (Runnable runnable : runnables) {\n runnable.run();\n }\n}\n"
|
"public void initBalls() {\n for (Ball ball : Model.board.balls) {\n ball.graphics.create(this);\n balls.attachChild(ball.graphics);\n }\n board.drawBalls();\n}\n"
|
"private int parseInteger(int bufferIndex, Context context) {\n boolean neg = (byteBuffer[bufferIndex] == '-');\n if (neg) {\n ++bufferIndex;\n }\n int limit = bufferLimit;\n long part = 0;\n outer1: while (true) {\n try {\n for (final byte[] buffer = byteBuffer; bufferIndex < limit; bufferIndex++) {\n final int b = buffer[bufferIndex];\n if (b >= '0' && b <= '9') {\n part = part * 10 + (b - '0');\n } else {\n break outer1;\n }\n }\n } finally {\n if (bufferIndex == limit && ((bufferIndex = fillBuffer()) == -1)) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n }\n }\n if (neg) {\n part *= -1;\n }\n context.longHolder = part;\n return bufferIndex;\n}\n"
|
"public int getKeyIndexAndNearbyCodes(int x, int y, int[] allKeys) {\n final Key[] keys = getKeys();\n final int touchX = getTouchX(x);\n final int touchY = getTouchY(y);\n int closestKeyIndex = LatinKeyboardBaseView.NOT_A_KEY;\n int closestKeyDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;\n final int keyCount = keys.length;\n for (int i = 0; i < keyCount; i++) {\n final Key key = keys[i];\n int dist = key.squaredDistanceFrom(touchX, touchY);\n if (dist < closestKeyDist) {\n closestKey = i;\n closestKeyDist = dist;\n }\n }\n if (allKeys != null && closestKey != LatinKeyboardBaseView.NOT_A_KEY)\n allKeys[0] = closestKey;\n return closestKey;\n}\n"
|
"protected void dropSourceElementHandle(DesignElementHandle handle) throws SemanticException {\n if (handle.getContainer() != null) {\n if (DesignerConstants.TRACING_COMMANDS) {\n System.out.println(\"String_Node_Str\" + DEUtil.getDisplayLabel(handle));\n }\n if (handle instanceof ExtendedItemHandle && isExtendedCell((ExtendedItemHandle) handle)) {\n ExtendedItemHandle extendedHandle = (ExtendedItemHandle) handle;\n List list = extendedHandle.getContents(DEUtil.getDefaultContentName(handle));\n for (int i = 0; i < list.size(); i++) {\n dropSourceElementHandle((DesignElementHandle) list.get(i));\n }\n } else if (handle instanceof CellHandle) {\n dropSourceSlotHandle(((CellHandle) handle).getContent());\n } else if (handle instanceof RowHandle) {\n new DeleteRowCommand(handle).execute();\n } else if (handle instanceof ColumnHandle) {\n new DeleteColumnCommand(handle).execute();\n } else {\n handle.dropAndClear();\n }\n }\n}\n"
|
"public boolean next() {\n if (currentBlock == null || rowIndex == currentBlock.getEndIndex()) {\n return nextBlock();\n } else {\n rowIndex++;\n return true;\n }\n}\n"
|
"protected Integer registerCompletionLatch(int count) {\n if (!syncListenerRegistrations.isEmpty()) {\n final int id = completionIdCounter.incrementAndGet();\n int size = syncListenerRegistrations.size();\n CountDownLatch countDownLatch = new CountDownLatch(count * size);\n syncLocks.put(countDownLatchId, countDownLatch);\n return countDownLatchId;\n }\n return MutableOperation.IGNORE_COMPLETION;\n}\n"
|
"public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {\n CreateTableStatement statement = new CreateTableStatement(tableName);\n for (ColumnConfig column : getColumns()) {\n ConstraintsConfig constraints = column.getConstraints();\n if (constraints != null && constraints.isPrimaryKey() != null && constraints.isPrimaryKey()) {\n statement.addPrimaryKeyColumn(column.getName(), database.getColumnType(column.getType(), isAutoIncrement));\n } else {\n String defaultValue = null;\n if (column.hasDefaultValue()) {\n defaultValue = StringUtils.trimToNull(column.getDefaultColumnValue(database));\n }\n statement.addColumn(column.getName(), database.getColumnType(column.getType(), column.isAutoIncrement()), defaultValue);\n }\n if (constraints != null) {\n if (constraints.isNullable() != null && !constraints.isNullable()) {\n statement.addColumnConstraint(new NotNullConstraint(column.getName()));\n }\n if (constraints.getReferences() != null) {\n ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint(constraints.getForeignKeyName(), constraints.getReferences());\n fkConstraint.setColumn(column.getName());\n fkConstraint.setDeleteCascade(constraints.isDeleteCascade() != null && constraints.isDeleteCascade());\n fkConstraint.setInitiallyDeferred(constraints.isInitiallyDeferred() != null && constraints.isInitiallyDeferred());\n fkConstraint.setDeferrable(constraints.isDeferrable() != null && constraints.isDeferrable());\n statement.addColumnConstraint(fkConstraint);\n }\n if (constraints.isUnique() != null && constraints.isUnique()) {\n statement.addColumnConstraint(new UniqueConstraint().addColumns(column.getName()));\n }\n }\n }\n statement.setTablespace(StringUtils.trimToNull(getTablespace()));\n List<SqlStatement> statements = new ArrayList<SqlStatement>();\n statements.add(statement);\n return statements.toArray(new SqlStatement[statements.size()]);\n}\n"
|
"public static void updateEventDef(EventDefinitionCRFBean edcBean, EventDefinitionCRFDAO edcDao, ArrayList versionList, int crfVIdToLock) {\n ArrayList<Integer> idList = new ArrayList<Integer>();\n CRFVersionBean temp = null;\n if ((null != versionList) && (versionList.size() > 0)) {\n temp = (CRFVersionBean) versionList.get(0);\n }\n if (StringUtil.isBlank(edcBean.getSelectedVersionIds())) {\n if ((null != temp) && (temp.getId() == crfVIdToLock)) {\n CRFVersionBean temp2 = (CRFVersionBean) versionList.get(1);\n edcBean.setDefaultVersionId(temp2.getId());\n } else {\n edcBean.setDefaultVersionId(temp.getId());\n }\n edcDao.update(edcBean);\n } else {\n String sversionIds = edcBean.getSelectedVersionIds();\n String[] ids = sversionIds.split(\"String_Node_Str\");\n for (String id : ids) {\n idList.add(Integer.valueOf(id));\n }\n for (int i = 0; i < versionList.size(); i++) {\n CRFVersionBean versionBean = (CRFVersionBean) versionList.get(i);\n if (idList.contains(versionBean.getId())) {\n edcBean.setDefaultVersionId(versionBean.getId());\n edcDao.update(edcBean);\n break;\n }\n }\n }\n}\n"
|
"private void initEntityClass() {\n String[] fromArray = from.split(\"String_Node_Str\");\n if (fromArray.length != 2) {\n throw new PersistenceException(\"String_Node_Str\" + from);\n }\n StringTokenizer tokenizer = new StringTokenizer(getResult(), \"String_Node_Str\");\n while (tokenizer.hasMoreTokens()) {\n String token = tokenizer.nextToken();\n if (!token.startsWith(fromArray[1]) || !token.startsWith(fromArray[1] + \"String_Node_Str\")) {\n throw new RuntimeException(\"String_Node_Str\" + token);\n }\n }\n this.entityName = fromArray[0];\n this.entityAlias = fromArray[1];\n entityClass = metadataManager.getEntityClassByName(entityName);\n if (null == entityClass) {\n throw new PersistenceException(\"String_Node_Str\" + entityName);\n }\n EntityMetadata metadata = metadataManager.getEntityMetadata(entityClass);\n if (!metadata.isIndexable()) {\n throw new PersistenceException(entityClass + \"String_Node_Str\");\n }\n}\n"
|
"public void testClientConfigDir() throws Exception {\n ShrinkHelper.exportAppToClient(client, earHAC);\n client.startClient();\n assertAppMessage(\"String_Node_Str\");\n}\n"
|
"private void init(ServletRequest servletRequest, ServletResponse servletResponse, boolean isStartAsyncWithZeroArg) {\n this.servletRequest = servletRequest;\n this.servletResponse = servletResponse;\n this.isOriginalRequestAndResponse = ((servletRequest instanceof RequestFacade || servletRequest instanceof ApplicationHttpRequest) && (servletResponse instanceof ResponseFacade || servletResponse instanceof ApplicationHttpResponse));\n this.isStartAsyncWithZeroArg = isStartAsyncWithZeroArg;\n}\n"
|
"private boolean shouldForceHide(WindowState win) {\n final WindowState imeTarget = mService.mInputMethodTarget;\n final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() && ((imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0 || !mPolicy.canBeForceHidden(imeTarget, imeTarget.mAttrs));\n final WindowState winShowWhenLocked = getWinShowWhenLockedOrAnimating();\n final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? null : winShowWhenLocked.mAppToken;\n boolean allowWhenLocked = false;\n allowWhenLocked |= (win.mIsImWindow || imeTarget == win) && showImeOverKeyguard;\n allowWhenLocked |= (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0;\n allowWhenLocked |= win.mAttachedWindow != null && (win.mAttachedWindow.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0;\n if (appShowWhenLocked != null) {\n allowWhenLocked |= appShowWhenLocked == win.mAppToken || (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0;\n }\n allowWhenLocked |= (win.mAttrs.flags & FLAG_DISMISS_KEYGUARD) != 0 && mPolicy.canShowDismissingWindowWhileLockedLw();\n boolean keyguardOn = mPolicy.isKeyguardShowingOrOccluded() && mForceHiding != KEYGUARD_ANIMATING_OUT;\n boolean hideDockDivider = win.mAttrs.type == TYPE_DOCK_DIVIDER && win.getDisplayContent().getDockedStackLocked() == null;\n return keyguardOn && !allowWhenLocked && (win.getDisplayId() == Display.DEFAULT_DISPLAY) || hideDockDivider;\n}\n"
|
"private String resolveClassname(String sourceClassname) {\n if (!StringUtils.contains(sourceClassname, \"String_Node_Str\")) {\n if (classNameLookedUp.contains(sourceClassname)) {\n String qualifiedName = classNameToFQCN.get(sourceClassname);\n if (qualifiedName != null) {\n return qualifiedName;\n } else {\n return sourceClassname;\n }\n } else {\n classNameLookedUp.add(sourceClassname);\n for (String wildcardImport : wildcardImports) {\n String candidateQualifiedName = wildcardImport + \"String_Node_Str\" + sourceClassname;\n Iterable<JavaClassModel> models = javaClassService.findAllByProperty(JavaClassModel.PROPERTY_QUALIFIED_NAME, candidateQualifiedName);\n if (models.iterator().hasNext()) {\n classNameToFQCN.put(sourceClassname, candidateQualifiedName);\n return candidateQualifiedName;\n } else {\n javaClassDao.getOrCreate(candidateQualifiedName);\n }\n }\n return sourceClassname;\n }\n } else {\n return sourceClassname;\n }\n}\n"
|
"public static String formatDate(Object date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"String_Node_Str\");\n return dateFormat.format((Date) data);\n}\n"
|
"public Query<Map.Entry<K, V>> query() {\n return new RemoteQuery<>((subscriber, filter, contextOperations) -> {\n mapView.registerSubscriber((Subscriber) subscriber, (Filter) filter, contextOperations);\n });\n}\n"
|
"public int getRestoreData(int token, PackageInfo packageInfo, ParcelFileDescriptor output) throws android.os.RemoteException {\n if (token != 0)\n return -1;\n File packageDir = new File(mDataDir, packageInfo.packageName);\n File[] blobs = packageDir.listFiles();\n int err = 0;\n if (blobs != null && blobs.length > 0) {\n for (File f : blobs) {\n err = copyFileToFD(f, output);\n if (err != 0)\n break;\n }\n }\n return err;\n}\n"
|
"private void ensureConsumerWhenNeeded() {\n Long nextRunNs = nonPersistentJobQueue.getNextJobDelayUntilNs();\n if (nextRunNs != null && nextRunNs <= System.nanoTime()) {\n addConsumer();\n return;\n }\n Long persistedJobRunNs = persistentJobQueue.getNextJobDelayUntilNs(hasNetwork);\n if (persistedJobRunNs != null) {\n if (nextRunNs == null) {\n nextRunNs = persistedJobRunNs;\n } else if (persistedJobRunNs < nextRunNs) {\n nextRunNs = persistedJobRunNs;\n }\n }\n if (nextRunNs != null) {\n long waitNs = nextRunNs - System.nanoTime();\n if (waitNs <= 0) {\n addConsumer();\n } else {\n ensureConsumerOnTime(waitNs);\n }\n }\n}\n"
|
"public static void main(String... args) throws Throwable {\n Lang lang = new Lang();\n Grule A = lang.newGrule();\n lang.defineGrule(A, CC.EOF);\n Grule B = lang.newGrule();\n A.define(B, \"String_Node_Str\").alt(CC.ks(\"String_Node_Str\"), \"String_Node_Str\").alt(CC.ks(\"String_Node_Str\"), \"String_Node_Str\");\n B.define(CC.kc(\"String_Node_Str\"), B);\n genImages(lang);\n}\n"
|
"public static String getLocalV4Ip() {\n try {\n InetAddress localHost = InetAddress.getLocalHost();\n String localIp = localHost.getHostAddress();\n if (validationIpV4FormatAddress(localIp)) {\n return localIp;\n }\n } catch (UnknownHostException ignore) {\n }\n return LOOPBACK_ADDRESS_V4;\n}\n"
|
"public boolean wake() {\n final int state = waiting.get();\n final boolean res = state != 0 && waiting.compareAndSet(state, 0);\n LockSupport.unpark(thread.get());\n return res;\n}\n"
|
"public static File getOutFile(String subdir, String name) {\n return new File(getOutDir(subdir), MiscUtils.sanitizeFileName(name));\n}\n"
|
"public boolean checkTerminationConditions() {\n if (currentIteration > 0) {\n pointChange = currentPoint.subtract(previousPoint).getNorm();\n pointConverged = pointChange <= pointChangeTolerance;\n objectiveChange = Math.abs((previousObjectiveValue - currentObjectiveValue) / previousObjectiveValue);\n objectiveConverged = objectiveChange <= objectiveChangeTolerance;\n if (this instanceof NonlinearConjugateGradientSolver) {\n gradientNorm = Math.abs(currentGradient.getMaxValue()) / (1 + Math.abs(currentObjectiveValue));\n gradientConverged = gradientNorm <= gradientTolerance;\n } else {\n gradientNorm = currentGradient.getNorm();\n gradientConverged = gradientNorm <= gradientTolerance;\n }\n return (checkForPointConvergence && pointConverged) || (checkForObjectiveConvergence && objectiveConverged) || (checkForGradientConvergence && gradientConverged);\n } else {\n return false;\n }\n}\n"
|
"public InputSupplier<InputStream> getBlob(String objectIdString) {\n if (repository == null) {\n return null;\n }\n File file = newFile(localRepository, objectIdString);\n if (!file.canRead()) {\n return null;\n }\n if (!repository.hasObject(objectId)) {\n return null;\n }\n return new InputSupplier<InputStream>() {\n public InputStream getInput() throws IOException {\n ObjectLoader objectLoader = repository.open(objectId);\n return objectLoader.openStream();\n }\n };\n}\n"
|
"public Pair<double[], double[]> oneEval(Genotype<T> individual, int num) {\n PinBall p = new PinBall(\"String_Node_Str\" + Parameters.parameters.stringParameter(\"String_Node_Str\"));\n if (CommonConstants.watch) {\n if (view != null) {\n view.dispose();\n view = null;\n }\n view = new PinballViewer(p);\n view.setVisible(true);\n view.setAlwaysOnTop(true);\n }\n Network n = individual.getPhenotype();\n double fitness = 0;\n int timeLimit = 1000;\n do {\n State s = p.getState();\n double[] sensors = s.getDescriptor();\n double[] outputs = n.process(sensors);\n int action = StatisticsUtilities.argmax(outputs);\n double rew = p.step(action);\n if (view != null) {\n view.repaint();\n try {\n Thread.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n if (Parameters.parameters.booleanParameter(\"String_Node_Str\")) {\n System.out.print(\"String_Node_Str\");\n MiscUtil.waitForReadStringAndEnterKeyPress();\n }\n }\n fitness += rew;\n timeLimit--;\n } while (!p.episodeEnd() && timeLimit > 0);\n Double distance = p.getBall().getCenter().distanceTo(p.getTarget().getCenter());\n Pair<double[], double[]> evalResults = new Pair<double[], double[]>(new double[] { fitness }, new double[0]);\n if (Parameters.parameters.booleanParameter(\"String_Node_Str\")) {\n evalResults = new Pair<double[], double[]>(new double[] { fitness, -distance }, new double[0]);\n } else {\n evalResults = new Pair<double[], double[]>(new double[] { fitness }, new double[0]);\n }\n return evalResults;\n}\n"
|
"public void setProperty(String name, String value) {\n if (name == null || properties == null)\n throw new NullPointerException();\n properties.setProperty(name, value);\n}\n"
|
"public List<QuantityManager> getQuantityManagers() throws IllegalActionException {\n if (_qmList == null) {\n _qmList = new ArrayList<QuantityManager>();\n }\n List<ResourceAttributes> list = this.attributeList(ResourceAttributes.class);\n for (ResourceAttributes attribute : list) {\n if (attribute.enabled()) {\n if ((QuantityManager) attribute.getDecorator() != null) {\n _qmList.add((QuantityManager) attribute.getDecorator());\n attribute.validateSettables();\n }\n }\n }\n _qmListValid = true;\n return _qmList;\n}\n"
|
"public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> c, Type t, Annotation[] as, MediaType mediaType) {\n MessageBodyWriter p = null;\n if (!customWriterProviders.isEmpty())\n p = _getMessageBodyWriter(c, t, as, mediaType, customWriterProviders);\n if (p != null)\n return p;\n p = _getMessageBodyWriter(c, t, as, mediaType, writerProviders);\n return p;\n}\n"
|
"protected void startUp() throws Exception {\n LOG.info(\"String_Node_Str\", serviceName, bindAddress);\n bootStrap(execThreadPoolSize, execThreadKeepAliveSecs);\n Channel channel = bootstrap.bind(bindAddress);\n channelGroup.add(channel);\n bindAddress = ((InetSocketAddress) channel.getLocalAddress());\n LOG.debug(\"String_Node_Str\", serviceName, bindAddress);\n}\n"
|
"public void onPlayerMove(PlayerMoveEvent e) {\n final Player player = e.getPlayer();\n if (player.isDead()) {\n return;\n }\n if (!player.getWorld().getName().equalsIgnoreCase(Settings.worldName)) {\n return;\n }\n if (player.isOp()) {\n if (!Settings.damageOps) {\n return;\n }\n } else if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + \"String_Node_Str\") || VaultHelper.checkPerm(player, Settings.PERMPREFIX + \"String_Node_Str\")) {\n return;\n }\n if (player.getGameMode().equals(GameMode.CREATIVE)) {\n return;\n }\n final Location playerLoc = player.getLocation();\n final Block block = playerLoc.getBlock();\n if (Settings.rainDamage > 0D && isRaining) {\n boolean hitByRain = true;\n for (int y = playerLoc.getBlockY() + 2; y < playerLoc.getWorld().getMaxHeight(); y++) {\n if (!playerLoc.getWorld().getBlockAt(playerLoc.getBlockX(), y, playerLoc.getBlockZ()).getType().equals(Material.AIR)) {\n hitByRain = false;\n break;\n }\n }\n if (!hitByRain) {\n wetPlayers.remove(player);\n } else {\n boolean acidPotion = false;\n Collection<PotionEffect> activePotions = player.getActivePotionEffects();\n for (PotionEffect s : activePotions) {\n if (s.getType().equals(PotionEffectType.WATER_BREATHING)) {\n acidPotion = true;\n }\n }\n if (acidPotion) {\n wetPlayers.remove(player);\n } else {\n if (!wetPlayers.contains(player)) {\n wetPlayers.add(player);\n new BukkitRunnable() {\n public void run() {\n if (!isRaining || player.isDead()) {\n wetPlayers.remove(player);\n this.cancel();\n } else if (player.getLocation().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {\n Collection<PotionEffect> activePotions = player.getActivePotionEffects();\n for (PotionEffect s : activePotions) {\n if (s.getType().equals(PotionEffectType.WATER_BREATHING)) {\n wetPlayers.remove(player);\n this.cancel();\n return;\n }\n }\n for (int y = player.getLocation().getBlockY() + 2; y < player.getLocation().getWorld().getMaxHeight(); y++) {\n if (!player.getLocation().getWorld().getBlockAt(player.getLocation().getBlockX(), y, player.getLocation().getBlockZ()).getType().equals(Material.AIR)) {\n wetPlayers.remove(player);\n this.cancel();\n return;\n }\n }\n if (Settings.rainDamage > 0D) {\n double health = player.getHealth() - (Settings.rainDamage - Settings.rainDamage * getDamageReduced(player));\n if (health < 0D) {\n health = 0D;\n } else if (health > 20D) {\n health = 20D;\n }\n player.setHealth(health);\n player.getWorld().playSound(playerLoc, Sound.FIZZ, 3F, 3F);\n }\n } else {\n wetPlayers.remove(player);\n this.cancel();\n }\n }\n }.runTaskTimer(plugin, 0L, 20L);\n }\n }\n }\n }\n if (!block.isLiquid()) {\n return;\n }\n if (playerLoc.getBlockY() < 1) {\n final Vector v = new Vector(player.getVelocity().getX(), 1D, player.getVelocity().getZ());\n player.setVelocity(v);\n }\n if (burningPlayers.contains(player)) {\n return;\n }\n if (Settings.allowSpawnNoAcidWater) {\n if (playerLoc.getBlockY() > Settings.sea_level) {\n if (plugin.getGrid().isAtSpawn(playerLoc)) {\n return;\n }\n }\n }\n if (block.getType().equals(Material.STATIONARY_WATER) || block.getType().equals(Material.WATER)) {\n Entity playersVehicle = player.getVehicle();\n if (playersVehicle != null) {\n if (playersVehicle.getType().equals(EntityType.BOAT)) {\n return;\n }\n }\n Collection<PotionEffect> activePotions = player.getActivePotionEffects();\n for (PotionEffect s : activePotions) {\n if (s.getType().equals(PotionEffectType.WATER_BREATHING)) {\n return;\n }\n }\n burningPlayers.add(player);\n new BukkitRunnable() {\n public void run() {\n if (player.isDead()) {\n burningPlayers.remove(player);\n this.cancel();\n } else if (player.getLocation().getBlock().isLiquid() && player.getLocation().getWorld().getName().equalsIgnoreCase(Settings.worldName)) {\n if (!Settings.acidDamageType.isEmpty()) {\n for (PotionEffectType t : Settings.acidDamageType) {\n if (t.equals(PotionEffectType.BLINDNESS) || t.equals(PotionEffectType.CONFUSION) || t.equals(PotionEffectType.HUNGER) || t.equals(PotionEffectType.SLOW) || t.equals(PotionEffectType.SLOW_DIGGING) || t.equals(PotionEffectType.WEAKNESS)) {\n player.addPotionEffect(new PotionEffect(t, 600, 1));\n } else {\n player.addPotionEffect(new PotionEffect(t, 200, 1));\n }\n }\n }\n if (Settings.acidDamage > 0D) {\n double health = player.getHealth() - (Settings.acidDamage - Settings.acidDamage * getDamageReduced(player));\n if (health < 0D) {\n health = 0D;\n } else if (health > 20D) {\n health = 20D;\n }\n player.setHealth(health);\n player.getWorld().playSound(playerLoc, Sound.FIZZ, 2F, 2F);\n }\n } else {\n burningPlayers.remove(player);\n this.cancel();\n }\n }\n }.runTaskTimer(plugin, 0L, 20L);\n }\n}\n"
|
"private List<ServiceHealth> getHealthyServices(final String serviceName) {\n Consul consul = consul();\n try {\n String tag = tags.length > 1 ? tags[0] : null;\n final ConsulResponse<List<ServiceHealth>> consulResponse = consul.health().getHealthyServices(serviceName, datacenter, tag, buildRequestOptions());\n this.lastIndex.set(consulResponse.getIndex());\n final List<ServiceHealth> healthyServices = consulResponse.getResponse();\n return healthyServices;\n } catch (HttpClientClosedConnectionException ex) {\n handleConsulRecovery(consul, ex);\n return Collections.emptyList();\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n if (controller != null) {\n int xSum = 0;\n xSum += playerPaysXGenericMana(controller, source, game);\n for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {\n if (!Objects.equals(playerId, controller.getId())) {\n Player player = game.getPlayer(playerId);\n if (player != null) {\n xSum += playerPaysXGenericMana(player, source, game);\n }\n }\n }\n for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {\n Player player = game.getPlayer(playerId);\n if (player != null) {\n TargetCardInLibrary target = new TargetCardInLibrary(0, xSum, StaticFilters.FILTER_CARD_BASIC_LAND);\n if (player.searchLibrary(target, game)) {\n player.moveCards(new CardsImpl(target.getTargets()).getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null);\n player.shuffleLibrary(source, game);\n }\n }\n }\n controller.resetStoredBookmark(game);\n return true;\n }\n return false;\n}\n"
|
"public long previousClearLong(long fromLongIndex) {\n if (fromLongIndex < 0) {\n if (fromLongIndex == NOT_FOUND)\n return NOT_FOUND;\n throw new IndexOutOfBoundsException();\n }\n if (fromLongIndex >= longLength)\n fromLongIndex = longLength - 1;\n if (bytes.readVolatileLong(fromLongIndex << 3) != ~0L)\n return fromLongIndex;\n for (long i = fromLongIndex - 1; i >= 0; i--) {\n if (bytes.readLong(i << 3) != ~0)\n return i;\n }\n return NOT_FOUND;\n}\n"
|
"public void testBigIntegerConvert_whenPassedLongValue_thenConvertToBigInteger() throws Exception {\n Long longValue = 3141593L;\n Comparable expectedBigIntValue = BigInteger.valueOf(longValue);\n Comparable comparable = TypeConverters.BIG_INTEGER_CONVERTER.convert(longValue);\n assertThat(comparable, allOf(is(instanceOf(BigInteger.class)), is(equalTo(expectedBigIntValue))));\n}\n"
|
"public static void parseAndAdd(OrderedHashtable locale, String line, int curline) {\n line = line.trim();\n int i = 0;\n int dec = line.length();\n while ((i = LocalizationUtils.lastIndexOf(line.substring(0, dec), \"String_Node_Str\")) != -1) {\n if ((i == 0) || !(line.charAt(i - 1) == '\\\\')) {\n line = line.substring(0, i);\n dec = line.length();\n } else {\n dec = i;\n }\n }\n if (line.indexOf('=') == -1) {\n if (line.trim().equals(\"String_Node_Str\")) {\n } else {\n System.out.println(\"String_Node_Str\" + curline + \"String_Node_Str\" + line);\n }\n } else {\n if (line.indexOf('=') != line.length() - 1) {\n String value = line.substring(line.indexOf('=') + 1, line.length());\n locale.put(line.substring(0, line.indexOf('=')), parseValue(value));\n } else {\n System.out.println(\"String_Node_Str\" + curline + \"String_Node_Str\" + line + \"String_Node_Str\");\n }\n }\n}\n"
|
"public String toString() {\n String returnstring = \"String_Node_Str\" + id + \"String_Node_Str\" + name + \"String_Node_Str\" + forced + \"String_Node_Str\";\n if (values != null) {\n for (int i = 0; i < values.size(); i++) {\n returnstring = returnstring + \"String_Node_Str\" + values.get(i) + \"String_Node_Str\";\n }\n }\n return returnstring;\n}\n"
|
"public void testRevertInsertionInTriangle() throws DelaunayError {\n ConstrainedMesh mesh = new ConstrainedMesh();\n DPoint pt1 = new DPoint(0, 0, 0);\n mesh.addPoint(pt1);\n DPoint pt2 = new DPoint(6, 0, 0);\n mesh.addPoint(pt2);\n DPoint pt3 = new DPoint(3, 5, 0);\n mesh.addPoint(pt3);\n mesh.processDelaunay();\n DTriangle tri = mesh.getTriangleList().get(0);\n DEdge e1 = mesh.getEdges().get(0);\n DEdge e2 = mesh.getEdges().get(1);\n DEdge e3 = mesh.getEdges().get(2);\n mesh.initPointInTriangle(new DPoint(3, 2, 0), tri, new LinkedList<DEdge>());\n DPoint pt;\n if (!tri.belongsTo(pt1)) {\n pt = pt1;\n } else if (!tri.belongsTo(pt2)) {\n pt = pt2;\n } else {\n pt = pt3;\n }\n mesh.revertPointInTriangleInsertion(tri, new DPoint(3, 2, 0), pt, e1, e3);\n List<DTriangle> tris = mesh.getTriangleList();\n assertTrue(tris.size() == 1);\n assertEquals(new DTriangle(new DEdge(0, 0, 0, 6, 0, 0), new DEdge(6, 0, 0, 3, 5, 0), new DEdge(3, 5, 0, 0, 0, 0)), tris.get(0));\n assertTrue(mesh.getPoints().size() == 3);\n assertTrue(mesh.getPoints().contains(new DPoint(0, 0, 0)));\n assertTrue(mesh.getPoints().contains(new DPoint(6, 0, 0)));\n assertTrue(mesh.getPoints().contains(new DPoint(3, 5, 0)));\n assertTrue(mesh.getEdges().size() == 3);\n assertTrue(mesh.getEdges().contains(new DEdge(0, 0, 0, 6, 0, 0)));\n assertTrue(mesh.getEdges().contains(new DEdge(3, 5, 0, 6, 0, 0)));\n assertTrue(mesh.getEdges().contains(new DEdge(0, 0, 0, 3, 5, 0)));\n assertTrue(mesh.getPoints().get(0) == pt1);\n assertTrue(mesh.getPoints().get(1) == pt3);\n assertTrue(mesh.getPoints().get(2) == pt2);\n assertCoherence(mesh);\n DTriangle dt = mesh.getTriangleList().get(0);\n DEdge ed = dt.getEdge(0);\n assertTrue(ed.getLeft() == dt || ed.getRight() == dt);\n ed = dt.getEdge(2);\n assertTrue(ed.getLeft() == dt || ed.getRight() == dt);\n ed = dt.getEdge(1);\n assertTrue(ed.getLeft() == dt || ed.getRight() == dt);\n}\n"
|
"public void openIndicatorSelectDialog(Shell shell) {\n final IndicatorSelectDialog dialog = new IndicatorSelectDialog(shell, \"String_Node_Str\", columnIndicators);\n dialog.create();\n dialog.getShell().addShellListener(new ShellAdapter() {\n public void shellActivated(ShellEvent e) {\n Point point = e.widget.getDisplay().getCursorLocation();\n IContext context = HelpSystem.getContext(HelpPlugin.PLUGIN_ID + HelpPlugin.INDICATOR_SELECTOR_HELP_ID);\n PlatformUI.getWorkbench().getHelpSystem().displayContext(context, point.x + 15, point.y);\n }\n });\n if (dialog.open() == Window.OK) {\n ColumnIndicator[] result = dialog.getResult();\n for (ColumnIndicator columnIndicator : result) {\n columnIndicator.storeTempIndicator();\n }\n this.setElements(result);\n return;\n }\n}\n"
|
"public final void save(final URLRequestMapper urlRequestMapper) {\n final Properties result = new Properties();\n long i = 0;\n if (urlRequestMapper instanceof ChainedURLRequestMapper) {\n final ChainedURLRequestMapper c = (ChainedURLRequestMapper) urlRequestMapper;\n final URLRequestMapper[] mappers = c.getChain();\n for (final URLRequestMapper mapper : mappers) {\n result.put(Long.toString(i++), mapper.toString());\n }\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\" + urlRequestMapper.getClass().getName());\n }\n persister.save(result);\n}\n"
|
"public void parameter(String name, Map options) throws IllegalActionException, NameDuplicationException {\n if (name == null) {\n throw new IllegalActionException(this, \"String_Node_Str\");\n }\n Attribute parameter = getAttribute(name);\n if (parameter == null) {\n parameter = new Parameter(this, name);\n } else {\n if (parameter == script) {\n throw new NameDuplicationException(this, \"String_Node_Str\" + name);\n } else if (!(parameter instanceof Parameter)) {\n throw new NameDuplicationException(this, \"String_Node_Str\" + name);\n }\n }\n if (options != null) {\n Type ptType = null;\n Object type = options.get(\"String_Node_Str\");\n if (type instanceof String) {\n ptType = _typeAccessorToPtolemy((String) type, parameter);\n } else if (type != null) {\n throw new IllegalActionException(this, \"String_Node_Str\" + type);\n }\n if (ptType != null) {\n ((Parameter) parameter).setTypeEquals(ptType);\n _setOptionsForSelect(parameter, options);\n }\n Token previousValue = ((Parameter) parameter).getToken();\n if (previousValue == null || ((ptType == BaseType.STRING) && ((Parameter) parameter).isStringMode() && (((StringToken) previousValue).stringValue().equals(\"String_Node_Str\")))) {\n Object value = options.get(\"String_Node_Str\");\n if (value != null) {\n Object token;\n try {\n token = ((Invocable) _engine).invokeFunction(\"String_Node_Str\", value);\n } catch (Exception e) {\n throw new IllegalActionException(this, e, \"String_Node_Str\" + value);\n }\n if (token instanceof Token) {\n ((Parameter) parameter).setToken((Token) token);\n } else {\n throw new IllegalActionException(this, \"String_Node_Str\" + value);\n }\n }\n }\n Object description = options.get(\"String_Node_Str\");\n if (description != null) {\n _setPortDescription(parameter, description.toString());\n }\n }\n if (_proxies.get(parameter) == null) {\n PortOrParameterProxy proxy = new PortOrParameterProxy(parameter);\n _proxies.put(parameter, proxy);\n _proxiesByName.put(parameter.getName(), proxy);\n }\n}\n"
|
"private Object getGenericRepositoryValue(GenericConnection connection, List<ComponentProperties> componentProperties, String value, IMetadataTable table) {\n if (componentProperties != null && value != null) {\n for (ComponentProperties compPro : componentProperties) {\n Property<?> property = compPro.getValuedProperty(value);\n if (property != null) {\n Object paramValue = property.getStoredValue();\n if (GenericTypeUtils.isStringType(property) || Boolean.valueOf(String.valueOf(property.getTaggedValue(IGenericConstants.DND_ADD_QUOTES)))) {\n if (paramValue != null) {\n return getRepositoryValueOfStringType(connection, paramValue.toString());\n } else {\n return TalendQuoteUtils.addQuotes(\"String_Node_Str\");\n }\n } else if (GenericTypeUtils.isEnumType(property) && paramValue != null) {\n return paramValue.toString();\n }\n return paramValue;\n }\n }\n if (value.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {\n return getGenericRepositoryValue(connection, componentProperties, value.substring(value.indexOf(IGenericConstants.EXP_SEPARATOR) + 1), table);\n }\n }\n return null;\n}\n"
|
"public ExecutionPlan schedule(Config cfg, DataFlowTaskGraph taskGraph, TaskSchedulePlan taskSchedule) {\n noOfThreads = ExecutorContext.threadsPerContainer(cfg);\n TaskPlan taskPlan = TaskPlanBuilder.build(resourcePlan, taskSchedule, taskIdGenerator);\n ParallelOperationFactory opFactory = new ParallelOperationFactory(cfg, network.getChannel(), taskPlan, edgeGenerator);\n Map<Integer, TaskSchedulePlan.ContainerPlan> containersMap = taskSchedule.getContainersMap();\n TaskSchedulePlan.ContainerPlan conPlan = containersMap.get(workerId);\n if (conPlan == null) {\n LOG.log(Level.INFO, \"String_Node_Str\" + workerId);\n return null;\n }\n ExecutionPlan execution = new ExecutionPlan();\n Set<TaskSchedulePlan.TaskInstancePlan> instancePlan = conPlan.getTaskInstances();\n for (TaskSchedulePlan.TaskInstancePlan ip : instancePlan) {\n Vertex v = taskGraph.vertex(ip.getTaskName());\n if (v == null) {\n throw new RuntimeException(\"String_Node_Str\" + ip.getTaskName());\n }\n INode node = v.getTask();\n if (node instanceof ITask || node instanceof ISource) {\n Set<Edge> edges = taskGraph.outEdges(v);\n for (Edge e : edges) {\n Vertex child = taskGraph.childOfTask(v, e.getName());\n Set<Integer> srcTasks = taskIdGenerator.getTaskIds(v.getName(), ip.getTaskId(), taskGraph);\n Set<Integer> tarTasks = taskIdGenerator.getTaskIds(child.getName(), getTaskIdOfTask(child.getName(), taskSchedule), taskGraph);\n if (!parOpTable.contains(v.getName(), e.getName())) {\n parOpTable.put(v.getName(), e.getName(), new Communication(e, v.getName(), child.getName(), srcTasks, tarTasks));\n sendTable.put(v.getName(), e.getName(), new Communication(e, v.getName(), child.getName(), srcTasks, tarTasks));\n }\n }\n }\n if (node instanceof ITask || node instanceof ISink) {\n Set<Edge> parentEdges = taskGraph.inEdges(v);\n for (Edge e : parentEdges) {\n Vertex parent = taskGraph.getParentOfTask(v, e.getName());\n Set<Integer> srcTasks = taskIdGenerator.getTaskIds(parent.getName(), getTaskIdOfTask(parent.getName(), taskSchedule), taskGraph);\n Set<Integer> tarTasks = taskIdGenerator.getTaskIds(v.getName(), ip.getTaskId(), taskGraph);\n if (!parOpTable.contains(parent.getName(), e.getName())) {\n parOpTable.put(parent.getName(), e.getName(), new Communication(e, parent.getName(), v.getName(), srcTasks, tarTasks));\n recvTable.put(parent.getName(), e.getName(), new Communication(e, parent.getName(), v.getName(), srcTasks, tarTasks));\n }\n }\n }\n INodeInstance iNodeInstance = createInstances(cfg, ip, v);\n execution.addNodes(taskIdGenerator.generateGlobalTaskId(v.getName(), ip.getTaskId(), ip.getTaskIndex()), iNodeInstance);\n }\n for (Table.Cell<String, String, Communication> cell : parOpTable.cellSet()) {\n Communication c = cell.getValue();\n IParallelOperation op = opFactory.build(c.getEdge(), c.getSourceTasks(), c.getTargetTasks());\n Set<Integer> sourcesOfThisWorker = intersectionOfTasks(conPlan, c.getSourceTasks());\n Set<Integer> targetsOfThisWorker = intersectionOfTasks(conPlan, c.getTargetTasks());\n for (Integer i : sourcesOfThisWorker) {\n if (taskInstances.contains(c.getSourceTask(), i)) {\n TaskInstance taskInstance = taskInstances.get(c.getSourceTask(), i);\n taskInstance.registerOutParallelOperation(c.getEdge().getName(), op);\n } else if (sourceInstances.contains(c.getSourceTask(), i)) {\n SourceInstance sourceInstance = sourceInstances.get(c.getSourceTask(), i);\n sourceInstance.registerOutParallelOperation(c.getEdge().getName(), op);\n } else {\n throw new RuntimeException(\"String_Node_Str\" + c.getSourceTask());\n }\n }\n for (Integer i : targetsOfThisWorker) {\n if (taskInstances.contains(c.getTargetTask(), i)) {\n TaskInstance taskInstance = taskInstances.get(c.getTargetTask(), i);\n op.register(i, taskInstance.getInQueue());\n } else if (sinkInstances.contains(c.getTargetTask(), i)) {\n SinkInstance sourceInstance = sinkInstances.get(c.getTargetTask(), i);\n op.register(i, sourceInstance.getInQueue());\n } else {\n throw new RuntimeException(\"String_Node_Str\" + c.getTargetTask());\n }\n }\n execution.addOps(op);\n }\n ThreadSharingExecutor threadSharingExecutor = new ThreadSharingExecutor(noOfThreads);\n threadSharingExecutor.execute(execution);\n return execution;\n}\n"
|
"public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, String> requestedIps, String defaultIp) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException {\n Account caller = UserContext.current().getCaller();\n List<NetworkVO> networkList = new ArrayList<NetworkVO>();\n _accountMgr.checkAccess(caller, owner);\n Network defaultNetwork = _networkMgr.getSystemNetworkByZoneAndTrafficType(zone.getId(), TrafficType.Guest);\n if (defaultNetwork == null) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n } else {\n networkList.add(_networkDao.findById(defaultNetwork.getId()));\n }\n boolean isVmWare = (template.getHypervisorType() == HypervisorType.VMware || (hypervisor != null && hypervisor == HypervisorType.VMware));\n if (securityGroupIdList != null && isVmWare) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n } else if (!isVmWare) {\n if (securityGroupIdList == null) {\n securityGroupIdList = new ArrayList<Long>();\n }\n SecurityGroup defaultGroup = _securityGroupMgr.getDefaultSecurityGroup(owner.getId());\n if (defaultGroup != null) {\n boolean defaultGroupPresent = false;\n for (Long securityGroupId : securityGroupIdList) {\n if (securityGroupId.longValue() == defaultGroup.getId()) {\n defaultGroupPresent = true;\n break;\n }\n }\n if (!defaultGroupPresent) {\n securityGroupIdList.add(defaultGroup.getId());\n }\n } else {\n if (s_logger.isDebugEnabled()) {\n s_logger.debug(\"String_Node_Str\" + owner + \"String_Node_Str\");\n }\n defaultGroup = _securityGroupMgr.createSecurityGroup(SecurityGroupManager.DEFAULT_GROUP_NAME, SecurityGroupManager.DEFAULT_GROUP_DESCRIPTION, owner.getDomainId(), owner.getId(), owner.getAccountName());\n securityGroupIdList.add(defaultGroup.getId());\n }\n }\n return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, securityGroupIdList, group, userData, sshKeyPair, hypervisor, caller, requestedIps, defaultIp, keyboard);\n}\n"
|
"private void initializeBuildingLists() {\n for (EBuildingType buildingType : EBuildingType.values()) {\n buildingNeeds.put(buildingType, new ArrayList<BuildingCount>());\n buildingIsNeededBy.put(buildingType, new ArrayList<EBuildingType>());\n }\n buildingNeeds.get(SAWMILL).add(new BuildingCount(LUMBERJACK, 3));\n buildingNeeds.get(TEMPLE).add(new BuildingCount(WINEGROWER, 1));\n buildingNeeds.get(WATERWORKS).add(new BuildingCount(FARM, 2));\n buildingNeeds.get(MILL).add(new BuildingCount(FARM, 1));\n buildingNeeds.get(BAKER).add(new BuildingCount(MILL, (float) 1 / 3));\n buildingNeeds.get(PIG_FARM).add(new BuildingCount(FARM, 1));\n buildingNeeds.get(SLAUGHTERHOUSE).add(new BuildingCount(PIG_FARM, 1 / 3));\n buildingNeeds.get(IRONMELT).add(new BuildingCount(COALMINE, 1));\n buildingNeeds.get(IRONMELT).add(new BuildingCount(IRONMINE, 1));\n buildingNeeds.get(WEAPONSMITH).add(new BuildingCount(COALMINE, 1));\n buildingNeeds.get(WEAPONSMITH).add(new BuildingCount(IRONMELT, 1));\n buildingNeeds.get(GOLDMELT).add(new BuildingCount(GOLDMINE, 1));\n buildingNeeds.get(BARRACK).add(new BuildingCount(WEAPONSMITH, 4));\n buildingNeeds.get(IRONMINE).add(new BuildingCount(COALMINE, 2));\n for (Map.Entry<EBuildingType, List<BuildingCount>> buildingNeedsEntry : buildingNeeds.entrySet()) {\n for (BuildingCount neededBuildingCount : buildingNeedsEntry.getValue()) {\n buildingIsNeededBy.get(neededBuildingCount.buildingType).add(buildingNeedsEntry.getKey());\n }\n }\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(SAWMILL);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(FORESTER);\n buildingsToBuild.add(STONECUTTER);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(FORESTER);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(SAWMILL);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(FORESTER);\n buildingsToBuild.add(STONECUTTER);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(LUMBERJACK);\n buildingsToBuild.add(SAWMILL);\n buildingsToBuild.add(FORESTER);\n buildingsToBuild.add(STONECUTTER);\n buildingsToBuild.add(STONECUTTER);\n buildingsToBuild.add(STONECUTTER);\n buildingsToBuild.add(WINEGROWER);\n buildingsToBuild.add(WINEGROWER);\n buildingsToBuild.add(WINEGROWER);\n buildingsToBuild.add(WINEGROWER);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(TEMPLE);\n buildingsToBuild.add(TEMPLE);\n buildingsToBuild.add(TEMPLE);\n buildingsToBuild.add(TEMPLE);\n buildingsToBuild.add(WATERWORKS);\n buildingsToBuild.add(MILL);\n buildingsToBuild.add(BAKER);\n buildingsToBuild.add(BAKER);\n buildingsToBuild.add(PIG_FARM);\n buildingsToBuild.add(SLAUGHTERHOUSE);\n buildingsToBuild.add(WATERWORKS);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(BARRACK);\n buildingsToBuild.add(BIG_TEMPLE);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(FISHER);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(GOLDMINE);\n buildingsToBuild.add(GOLDMELT);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(FARM);\n buildingsToBuild.add(WATERWORKS);\n buildingsToBuild.add(MILL);\n buildingsToBuild.add(BAKER);\n buildingsToBuild.add(BAKER);\n buildingsToBuild.add(PIG_FARM);\n buildingsToBuild.add(WATERWORKS);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(IRONMINE);\n buildingsToBuild.add(IRONMELT);\n buildingsToBuild.add(COALMINE);\n buildingsToBuild.add(WEAPONSMITH);\n buildingsToBuild.add(BARRACK);\n}\n"
|
"public void onEnable() {\n new File(propDir).mkdirs();\n if (!mainProp.exists()) {\n try {\n mainProp.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!itemAlias.exists()) {\n try {\n itemAlias.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!unlDisp.exists()) {\n try {\n unlDisp.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!dispChests.exists()) {\n try {\n dispChests.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!lotFile.exists()) {\n try {\n lotFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!kitFile.exists()) {\n try {\n kitFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!proFile.exists()) {\n try {\n proFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!chatFile.exists()) {\n try {\n chatFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!ticketFile.exists()) {\n try {\n ticketFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n if (!pricesFile.exists()) {\n try {\n ticketFile.createNewFile();\n } catch (IOException e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n }\n perm = new MainPermissions(this);\n warps = new WarpList(this);\n homes = new HomeWarps(this);\n checkpoints = new PreWarp(this);\n blockCheck = new BlockChecker(this);\n mainProperties = new PluginProperties(propDir + \"String_Node_Str\");\n mainProperties.loadFile();\n itemAliases = new PluginProperties(propDir + \"String_Node_Str\");\n itemAliases.loadFile();\n chatListen = new ChatPlayerListener(this);\n jail = new Jail(this);\n dispensers = new UnlimitedDisp(propDir + \"String_Node_Str\");\n chests = new DispChest(propDir + \"String_Node_Str\");\n lots = new LotFile(this);\n kits = new KitList(this);\n creeperListen = new CreeperListener(this);\n inv = new Invisibility(this);\n protectFile = new ProtectFile(this, propDir + \"String_Node_Str\");\n channels = new ChatChannelController(propDir + \"String_Node_Str\", this);\n maxPlayers = new MaxPlayers(this, mainProperties.getInteger(\"String_Node_Str\", 10), mainProperties.getInteger(\"String_Node_Str\", 4), mainProperties.getBoolean(\"String_Node_Str\", true), mainProperties.getBoolean(\"String_Node_Str\", true));\n reports = new ReportFile(this);\n flyDetect = new FlyDetect(this);\n strikeBind = new WeatherBinding(this);\n prices = new PriceFile(this, propDir + \"String_Node_Str\");\n kicked = new KickList(this);\n if (!sanityCheck()) {\n this.getServer().getPluginManager().disablePlugin(this);\n return;\n }\n for (Player player : this.getServer().getOnlinePlayers()) {\n User user;\n JoinType jt = maxPlayers.join(user = new User(this, player));\n if (jt == JoinType.NO_SLOT_NORMAL || jt == JoinType.NO_SLOT_RESERVED) {\n user.Kick(\"String_Node_Str\");\n }\n }\n PluginManager pm = getServer().getPluginManager();\n pm.registerEvent(Event.Type.PLAYER_JOIN, this.chatListen, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_LOGIN, this.permLoginListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_CHAT, this.chatListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.BLOCK_PLACE, this.blockCheck, Event.Priority.High, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, this.blockCheck, Event.Priority.High, this);\n pm.registerEvent(Event.Type.BLOCK_BURN, this.blockCheck, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.BLOCK_IGNITE, this.blockCheck, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, this.invPlayerListen, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, this.invBlockListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.ENTITY_DEATH, this.death, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.ENTITY_DAMAGE, this.death, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, this.lotListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.REDSTONE_CHANGE, this.invBlockListen, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, this.lotBListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_PLACE, this.lotBListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, this.permLoginListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, this.permLoginListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_TARGET, this.creeperListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, this.pbListen, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, this.ppListen, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_BUCKET_EMPTY, this.lotListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_BUCKET_FILL, this.lotListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, this.chatListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.PLAYER_QUIT, this.chatListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.PLAYER_KICK, this.chatListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.EXPLOSION_PRIME, this.entListen, Event.Priority.Highest, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, this.wpListen, Event.Priority.Highest, this);\n PluginDescriptionFile pdfFile = this.getDescription();\n FreezeTimer.schedule(new TimeFreeze(this), 0, 100);\n log.info(pdfFile.getName() + \"String_Node_Str\" + pdfFile.getVersion() + \"String_Node_Str\");\n if (mainProperties.getBoolean(\"String_Node_Str\", false)) {\n log.warning(\"String_Node_Str\");\n }\n}\n"
|
"private boolean jj_3_6() {\n if (jj_scan_token(17))\n return true;\n if (jj_scan_token(30))\n return true;\n return false;\n}\n"
|
"public void attach(String parent, String cladeRoot, String prefix) {\n if (target == null) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n if (source == null) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n final File taxonUnitsFile = new File(source.getAbsolutePath() + '/' + TAXONUNITSFILENAME);\n final File synonymLinksFile = new File(source.getAbsolutePath() + '/' + SYNONYMLINKSFILENAME);\n List<PBDBItem> itemList = null;\n try {\n itemList = buildPBDBList(taxonUnitsFile);\n } catch (IOException e) {\n logger.error(\"String_Node_Str\" + taxonUnitsFile);\n e.printStackTrace();\n }\n Map<Integer, Integer> synonymMap;\n try {\n synonymMap = buildSynonymLinks(synonymLinksFile);\n } catch (IOException e) {\n logger.error(\"String_Node_Str\" + synonymLinksFile);\n }\n Map<String, String> taxonTree = buildTree(itemList);\n Map<String, Term> termDictionary = new HashMap<String, Term>();\n for (Term t : target.getTerms()) {\n termDictionary.put(t.getLabel(), t);\n }\n for (String tName : taxonTree.keySet()) {\n System.out.println(\"String_Node_Str\" + tName);\n if (!termDictionary.containsKey(tName)) {\n Term newTerm = target.addTerm(tName);\n termDictionary.put(tName, newTerm);\n }\n }\n for (String tName : taxonTree.keySet()) {\n Term child = termDictionary.get(tName);\n Term parent = termDictionary.get(taxonTree.get(tName));\n if (parent == null) {\n parent = defaultParentTaxon;\n }\n if (!parent.getChildren().contains(child)) {\n target.attachParent(child, parent);\n }\n }\n for (PBDBItem item : itemList) {\n if (item.isValid()) {\n } else {\n }\n }\n}\n"
|
"public PublicWSDefinition discover(int operation) {\n if (operation == PublicWSProvider2.GET) {\n return new PublicWSDefinition() {\n public List getParameters() {\n return null;\n }\n public String getReturnType() {\n return \"String_Node_Str\";\n }\n };\n }\n return null;\n}\n"
|
"public static String getTableName(ModelElement analyzedColumn, DbmsLanguage dbmsLanguage) {\n ModelElement columnSetOwner = findColumnSetOwner(analyzedColumn);\n String tableName = columnSetOwner.getName();\n String schemaName = getQuotedSchemaName(columnSetOwner, dbmsLanguage);\n String catalogName = getQuotedCatalogName(columnSetOwner, dbmsLanguage);\n if (catalogName == null && schemaName != null) {\n final Schema parentSchema = SchemaHelper.getParentSchema(columnSetOwner);\n final Catalog parentCatalog = CatalogHelper.getParentCatalog(parentSchema);\n catalogName = parentCatalog != null ? parentCatalog.getName() : null;\n }\n if (ConnectionUtils.isSybaseeDBProducts(dbmsLanguage.getDbmsName())) {\n schemaName = ColumnSetHelper.getTableOwner(columnSetOwner);\n }\n DatabaseConnection dbConn = ConnectionHelper.getTdDataProvider(SwitchHelpers.COLUMN_SWITCH.doSwitch(analyzedColumn));\n if (dbConn != null && dbConn.isContextMode()) {\n return getTableNameFromContext(dbConn, catalogName, schemaName, tableName, dbmsLanguage);\n } else {\n return dbmsLanguage.toQualifiedName(catalogName, schemaName, tableName);\n }\n}\n"
|
"private Tree createTree(Composite parent) {\n final Tree newTree = new Tree(parent, SWT.MULTI | SWT.BORDER);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(newTree);\n newTree.setHeaderVisible(false);\n TreeColumn column1 = new TreeColumn(newTree, SWT.CENTER);\n column1.setWidth(190);\n TreeColumn column2 = new TreeColumn(newTree, SWT.CENTER);\n column2.setWidth(80);\n TreeColumn column3 = new TreeColumn(newTree, SWT.CENTER);\n column3.setWidth(120);\n TreeColumn column4 = new TreeColumn(newTree, SWT.CENTER);\n column4.setWidth(120);\n parent.layout();\n menu = new Menu(newTree);\n MenuItem deleteMenuItem = new MenuItem(menu, SWT.CASCADE);\n deleteMenuItem.setText(\"String_Node_Str\");\n deleteMenuItem.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION));\n deleteMenuItem.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n removeSelectedElements(newTree);\n }\n });\n newTree.setMenu(menu);\n AbstractAnalysisActionHandler actionHandler = new AbstractAnalysisActionHandler(parent) {\n protected void handleRemove() {\n removeSelectedElements(newTree);\n }\n };\n parent.setData(AbstractMetadataFormPage.ACTION_HANDLER, actionHandler);\n ColumnViewerDND.installDND(newTree);\n this.addTreeListener(newTree);\n return newTree;\n}\n"
|
"public void deleteFlowQueues(HttpRequest request, HttpResponder responder, String appId, String flowId) {\n programLifecycleHttpHandler.deleteFlowQueues(RESTMigrationUtils.rewriteV2RequestToV3(request), responder, Constants.DEFAULT_NAMESPACE, appId, flowId);\n}\n"
|
"public LabelPickerState updateMatchedLabels(Set<String> repoLabels, String query) {\n List<String> newMatchedLabels = convertToList(repoLabels);\n newMatchedLabels = filterByName(newMatchedLabels, getName(query));\n newMatchedLabels = filterByGroup(newMatchedLabels, getGroup(query));\n OptionalInt newSuggestionIndex;\n if (newMatchedLabels.isEmpty()) {\n newSuggestionIndex = currentSuggestionIndex;\n } else {\n newSuggestionIndex = OptionalInt.of(0);\n }\n return new LabelPickerState(initialLabels, addedLabels, removedLabels, newMatchedLabels, newSuggestionIndex);\n}\n"
|
"private void waitTillEqual(final int timeOutMs) throws InterruptedException {\n Map map1UnChanged = new HashMap();\n Map map2UnChanged = new HashMap();\n int numberOfTimesTheSame = 0;\n long startTime = System.currentTimeMillis();\n for (int t = 0; t < timeOutMs + 100; t++) {\n if (difference(map1, map2).areEqual()) {\n if (difference(map1, map1UnChanged).areEqual() && difference(map2, map2UnChanged).areEqual()) {\n numberOfTimesTheSame++;\n } else {\n numberOfTimesTheSame = 0;\n map1UnChanged = new HashMap(map1);\n map2UnChanged = new HashMap(map2);\n }\n Thread.sleep(1);\n if (numberOfTimesTheSame == 10) {\n System.out.println(\"String_Node_Str\");\n break;\n }\n }\n Thread.sleep(1);\n if (System.currentTimeMillis() - startTime > timeOutMs)\n break;\n }\n}\n"
|
"public void setInventorySlotContents(IInventory inventory, int slotId, ItemStack stack) {\n if (entity.worldObj.isRemote) {\n return;\n }\n if (stack == null) {\n ISkinType skinType = getSkinTypeForSlot(slotId);\n equipmentData.removeEquipment(skinType, 0);\n } else {\n SkinPointer skinData = SkinNBTHelper.getSkinPointerFromStack(stack);\n equipmentData.addEquipment(skinData.skinType, 0, skinData);\n }\n sendEquipmentDataToPlayerToAllPlayersAround();\n}\n"
|
"public void onNext(ResponseObject<Post> result) {\n if (isFinishing()) {\n return;\n }\n if (result.ok) {\n progressBar.setVisibility(View.VISIBLE);\n floatingActionsMenu.setVisibility(View.VISIBLE);\n loadingView.onSuccess();\n result.result.setFeatured(post != null && post.isFeatured());\n post = result.result;\n post.setDesc(loadDesc);\n adapter.clear();\n adapter.add(post);\n adapter.notifyDataSetChanged();\n loadReplies(0);\n } else {\n if (result.statusCode == 404) {\n toastSingleton(R.string.post_404);\n finish();\n } else {\n loadingView.onFailed();\n toastSingleton(getString(R.string.load_failed));\n progressBar.setVisibility(View.GONE);\n }\n }\n setMenuVisibility();\n}\n"
|
"public void testValid() throws NotFoundException, InvalidRequestException, TException, IOException {\n getEntityManagerFactory(\"String_Node_Str\");\n Properties properties = new Properties();\n InputStream inStream = ClassLoader.getSystemResourceAsStream(KUNDERA_CASSANDRA_PROPERTIES);\n try {\n properties.load(inStream);\n String expected_replication = properties.getProperty(\"String_Node_Str\");\n String expected_strategyClass = properties.getProperty(\"String_Node_Str\");\n KsDef ksDef = client.describe_keyspace(keyspace);\n Assert.assertEquals(Integer.parseInt(expected_replication), ksDef.getReplication_factor());\n Assert.assertEquals(expected_strategyClass, ksDef.getStrategy_class());\n } catch (NullPointerException e) {\n log.warn(\"String_Node_Str\");\n }\n}\n"
|
"public boolean isRecoveryTokenValid(final User user, final String token) {\n if (user != null && token != null) {\n final String expirationTimeStamp = getTimestamp(token);\n final String tokenWithoutTimestamp = getTokenWithoutTimestamp(token);\n final String tokenSource = expirationTimeStamp + getTokenSource(user);\n final Date expirationTime = parseTimestamp(expirationTimeStamp);\n return expirationTime != null && expirationTime.after(new Date()) && passwordTokenEncoder.matches(tokenSource, tokenWithoutTimestamp);\n }\n return false;\n}\n"
|
"public MediaResource getAsyncMediaResource(UserRequest ureq) {\n String moduleURI = ureq.getModuleURI();\n MediaResource mr = null;\n if (moduleURI != null) {\n if (moduleURI.startsWith(OLAT_CMD_PREFIX)) {\n String cmdAndSub = moduleURI.substring(OLAT_CMD_PREFIX.length());\n int slpos = cmdAndSub.indexOf('/');\n if (slpos != -1) {\n String cmd = cmdAndSub.substring(0, slpos);\n String subcmd = cmdAndSub.substring(slpos + 1);\n OlatCmdEvent aev = new OlatCmdEvent(cmd, subcmd);\n fireEvent(ureq, aev);\n if (aev.isAccepted())\n return null;\n }\n }\n VFSItem sourceItem = rootContainer.resolve(moduleURI);\n if (sourceItem == null || (sourceItem instanceof VFSContainer)) {\n return new NotFoundMediaResource(moduleURI);\n }\n boolean checkRegular = true;\n if ((ureq.getParameter(\"String_Node_Str\") != null) || ((moduleURI.endsWith(\"String_Node_Str\") || moduleURI.endsWith(\"String_Node_Str\")) && (ureq.getParameter(\"String_Node_Str\") != null))) {\n Tracing.logDebug(\"String_Node_Str\" + moduleURI, HtmlStaticPageComponent.class);\n ExternalSiteEvent ese = new ExternalSiteEvent(moduleURI);\n fireEvent(ureq, ese);\n if (ese.isAccepted()) {\n mr = ese.getResultingMediaResource();\n Tracing.logDebug(\"String_Node_Str\", HtmlStaticPageComponent.class);\n checkRegular = false;\n } else {\n Mapper mapper = createMapper(rootContainer);\n String amapPath;\n String mapperID = VFSManager.getRealPath(rootContainer);\n if (mapperID == null) {\n amapPath = CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(), mapper);\n } else {\n mapperID = this.getClass().getSimpleName() + \"String_Node_Str\" + mapperID;\n amapPath = CoreSpringFactory.getImpl(MapperService.class).register(mapperID, mapper);\n }\n ese.setResultingMediaResource(new RedirectMediaResource(amapPath + \"String_Node_Str\" + moduleURI));\n Tracing.logDebug(\"String_Node_Str\" + amapPath + \"String_Node_Str\" + moduleURI, HtmlStaticPageComponent.class);\n ese.accept();\n mr = ese.getResultingMediaResource();\n checkRegular = false;\n }\n }\n if (checkRegular) {\n if ((moduleURI.endsWith(\"String_Node_Str\") || moduleURI.endsWith(\"String_Node_Str\")) && (ureq.getParameter(\"String_Node_Str\") == null)) {\n currentURI = moduleURI;\n getFileContent((VFSLeaf) sourceItem);\n fireEvent(ureq, new NewInlineUriEvent(currentURI));\n } else {\n mr = new VFSMediaResource((VFSLeaf) sourceItem);\n }\n }\n }\n return mr;\n}\n"
|
"public static Piece createKnight(boolean isBlack, Square square, Board board) throws IOException {\n Map<Character, Integer> knightMovement = Maps.newHashMap();\n knightMovement.put(PieceBuilder.KNIGHT_ONE, 1);\n knightMovement.put(PieceBuilder.KNIGHT_TWO, 2);\n return new Piece(Messages.getString(\"String_Node_Str\"), isBlack, square, board, knightMovement);\n}\n"
|
"private static double maxEntropyOneQuestion(Question question) {\n double retval = 0.0;\n int numOptions = question.options.size();\n if (numOptions != 0) {\n retval += log2((double) numOptions);\n }\n return retval;\n}\n"
|
"private void init() {\n if (!isInEditMode())\n Iconify.addIcons(this);\n else\n this.setText(this.getText());\n}\n"
|
"public boolean isConference() {\n if (call.isConferenceFocus())\n return true;\n Iterator<? extends CallPeer> callPeers = call.getCallPeers();\n while (callPeers.hasNext()) {\n CallPeer callPeer = callPeers.next();\n if (callPeer.isConferenceFocus())\n return true;\n }\n return false;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.