content
stringlengths 40
137k
|
---|
"public org.hl7.fhir.dstu2.model.Money convertMoney(org.hl7.fhir.dstu3.model.Money src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.Money tgt = new org.hl7.fhir.dstu2.model.Money();\n copyElement(src, tgt);\n tgt.setValue(src.getValue());\n tgt.setComparator(convertQuantityComparator(src.getComparator()));\n tgt.setUnit(src.getUnit());\n tgt.setSystem(src.getSystem());\n tgt.setCode(src.getCode());\n return tgt;\n}\n"
|
"public Result exitConsensus(WithdrawForm form) throws NulsException, IOException {\n AssertUtil.canNotEmpty(form);\n AssertUtil.canNotEmpty(form.getTxHash());\n AssertUtil.canNotEmpty(form.getAddress());\n if (!Address.validAddress(form.getAddress())) {\n return Result.getFailed(AccountErrorCode.ADDRESS_ERROR);\n }\n Account account = accountService.getAccount(form.getAddress()).getData();\n if (null == account) {\n return Result.getFailed(AccountErrorCode.ACCOUNT_NOT_EXIST);\n }\n if (account.isEncrypted() && account.isLocked()) {\n AssertUtil.canNotEmpty(form.getPassword());\n try {\n if (!account.decrypt(form.getPassword())) {\n return Result.getFailed(AccountErrorCode.PASSWORD_IS_WRONG);\n }\n } catch (NulsException e) {\n return Result.getFailed(AccountErrorCode.PASSWORD_IS_WRONG);\n }\n }\n CancelDepositTransaction tx = new CancelDepositTransaction();\n CancelDeposit cancelDeposit = new CancelDeposit();\n NulsDigestData hash = NulsDigestData.fromDigestHex(form.getTxHash());\n DepositTransaction depositTransaction = (DepositTransaction) ledgerService.getTx(hash);\n if (null == depositTransaction) {\n return Result.getFailed(\"String_Node_Str\");\n }\n cancelDeposit.setAddress(AddressTool.getAddress(form.getAddress()));\n cancelDeposit.setJoinTxHash(hash);\n tx.setTxData(cancelDeposit);\n CoinData coinData = new CoinData();\n List<Coin> toList = new ArrayList<>();\n toList.add(new Coin(cancelDeposit.getAddress(), depositTransaction.getTxData().getDeposit(), 0));\n coinData.setTo(toList);\n List<Coin> fromList = new ArrayList<>();\n for (int index = 0; index < depositTransaction.getCoinData().getTo().size(); index++) {\n Coin coin = depositTransaction.getCoinData().getTo().get(index);\n if (coin.getLockTime() == -1L && coin.getNa().equals(depositTransaction.getTxData().getDeposit())) {\n coin.setOwner(ArraysTool.joinintTogether(hash.serialize(), new VarInt(index).encode()));\n fromList.add(coin);\n break;\n }\n }\n if (fromList.isEmpty()) {\n return Result.getFailed(KernelErrorCode.DATA_ERROR);\n }\n coinData.setFrom(fromList);\n tx.setCoinData(coinData);\n Result result1 = this.txProcessing(tx, null, account, form.getPassword());\n if (result1.isFailed()) {\n return result1;\n }\n return Result.getSuccess().setData(tx.getHash().getDigestHex());\n}\n"
|
"private void initXmlTreeData(List schemaList, List<HL7FileNode> root, List<HL7TreeNode> list) {\n if (hl7ui != null) {\n if (hl7ui.gethl7Manager() instanceof HL7OutputManager) {\n ((HL7OutputManager) hl7ui.gethl7Manager()).getContents().clear();\n }\n }\n HL7TreeNode rootNode = null;\n for (String rowName : schemaList) {\n HL7TreeNode current = null;\n HL7TreeNode temp = null;\n HL7TreeNode mainNode = null;\n String mainPath = null;\n String currentPath = null;\n String defaultValue = null;\n int nodeOrder = 0;\n boolean haveOrder = true;\n String schemaId = hl7Util.getLabel(obj, true) + \"String_Node_Str\";\n if (hl7ui != null) {\n if (hl7ui.gethl7Manager() instanceof HL7OutputManager) {\n treeNodes = ((HL7OutputManager) hl7ui.gethl7Manager()).getTreeData(hl7Util.getLabel(obj, true));\n }\n }\n if (treeNodes == null) {\n treeNodes = new ArrayList<HL7TreeNode>();\n }\n for (int i = 0; i < root.size(); i++) {\n HL7FileNode node = (HL7FileNode) root.get(i);\n String newPath = node.getFilePath();\n defaultValue = node.getDefaultValue();\n String columnName = node.getRelatedColumn();\n String orderValue = String.valueOf(node.getOrder());\n if (orderValue == null || \"String_Node_Str\".equals(orderValue)) {\n haveOrder = false;\n }\n if (haveOrder) {\n nodeOrder = node.getOrder();\n }\n String flag = columnName + \"String_Node_Str\";\n if (columnName != null && columnName.length() > 0 && !flag.startsWith(schemaId)) {\n continue;\n }\n if (node.getAttribute().equals(\"String_Node_Str\")) {\n temp = new Attribute(newPath);\n temp.setDefaultValue(defaultValue);\n temp.setAttribute(true);\n current.addChild(temp);\n } else if (node.getAttribute().equals(\"String_Node_Str\")) {\n temp = new NameSpaceNode(newPath);\n temp.setDefaultValue(defaultValue);\n temp.setNameSpace(true);\n current.addChild(temp);\n } else {\n temp = this.addElement(current, currentPath, newPath, defaultValue);\n if (rootNode == null) {\n rootNode = temp;\n }\n if (node.getAttribute().equals(\"String_Node_Str\")) {\n temp.setMain(true);\n mainNode = temp;\n mainPath = newPath;\n }\n current = temp;\n currentPath = newPath;\n }\n if (haveOrder) {\n temp.setOrder(nodeOrder);\n }\n temp.setRow(hl7Util.getLabel(obj, true));\n if (columnName != null && columnName.length() > 0 && columnName.startsWith(schemaId)) {\n columnName = columnName.replace(schemaId, \"String_Node_Str\");\n }\n }\n current = mainNode;\n currentPath = mainPath;\n boolean isFirst = true;\n current = mainNode;\n currentPath = mainPath;\n isFirst = true;\n if (rootNode == null) {\n rootNode = new Element(\"String_Node_Str\");\n }\n if (haveOrder) {\n orderNode(rootNode);\n }\n list.add(rootNode);\n rootNode.setRow(hl7Util.getLabel(obj, true));\n treeNodes.clear();\n treeNodes.add(rootNode);\n if (hl7ui != null) {\n if (hl7ui.gethl7Manager() instanceof HL7OutputManager) {\n ((HL7OutputManager) hl7ui.gethl7Manager()).getContents().put(hl7Util.getLabel(obj, true), treeNodes);\n }\n } else if (form != null) {\n for (HL7TreeNode hl7Node : treeNodes) {\n form.getContents().put(hl7Util.getLabel(obj, true), hl7Node);\n }\n }\n }\n}\n"
|
"public UserVmData newUserVmData(UserVm userVm) {\n UserVmData userVmData = new UserVmData();\n userVmData.setId(userVm.getId());\n userVmData.setName(userVm.getHostName());\n userVmData.setCreated(userVm.getCreated());\n userVmData.setGuestOsId(userVm.getGuestOSId());\n userVmData.setHaEnable(userVm.isHaEnabled());\n if (userVm.getState() != null) {\n userVmData.setState(userVm.getState().toString());\n }\n if (userVm.getDisplayName() != null) {\n userVmData.setDisplayName(userVm.getDisplayName());\n } else {\n userVmData.setDisplayName(userVm.getHostName());\n }\n userVmData.setDomainId(userVm.getDomainId());\n if (userVm.getHypervisorType() != null) {\n userVmData.setHypervisor(userVm.getHypervisorType().toString());\n }\n if (userVm.getPassword() != null) {\n userVmData.setPassword(userVm.getPassword());\n }\n return userVmData;\n}\n"
|
"public void unparse(PrintWriter pw) {\n if (isMember) {\n pw.print(\"String_Node_Str\");\n if (mdxMember != null) {\n pw.print(mdxMember.getUniqueName());\n } else {\n pw.print(Util.quoteMdxIdentifier(names));\n }\n } else {\n pw.print(\"String_Node_Str\");\n pw.print(Util.quoteMdxIdentifier(names));\n }\n pw.print(\"String_Node_Str\");\n exp.unparse(pw);\n pw.print(\"String_Node_Str\");\n if (memberProperties != null) {\n for (int i = 0; i < memberProperties.length; i++) {\n pw.print(\"String_Node_Str\");\n memberProperties[i].unparse(pw);\n }\n }\n}\n"
|
"public void setDataDomain(ATableBasedDataDomain dataDomain) {\n if (dataDomain == this.dataDomain)\n return;\n this.dataDomain = dataDomain;\n ASerializedSingleTablePerspectiveBasedView dcSerializedView = (ASerializedSingleTablePerspectiveBasedView) serializedView;\n dcSerializedView.setDataDomainID(dataDomain.getDataDomainID());\n TablePerspective container = dataDomain.getDefaultTablePerspective();\n dcSerializedView.setTablePerspectiveKey(container.getTablePerspectiveKey());\n updateDataSetInfo();\n}\n"
|
"protected void setModel(ModuleHandle model) {\n super.setModel(model);\n if (model != null) {\n rulerComp.resetReportDesignHandle(model);\n }\n}\n"
|
"public void setValueIsAdjusting(boolean valueIsAdjusting) {\n this.valueIsAdjusting = valueIsAdjusting;\n if (!valueIsAdjusting) {\n if (fullChangeStart != -1 && fullChangeFinish != -1) {\n swingThreadSource.getReadWriteLock().writeLock().lock();\n try {\n fireSelectionChanged(fullChangeStart, fullChangeFinish);\n fullChangeStart = -1;\n fullChangeFinish = -1;\n } finally {\n swingThreadSource.getReadWriteLock().writeLock().unlock();\n }\n }\n }\n}\n"
|
"public void doWork(Work work, long startTimeout, ExecutionContext execContext, WorkListener workListener) throws WorkException {\n WorkContextHandlerImpl contextHandler = createWorkContextHandler();\n validateWork(work, WorkCoordinator.getExecutionContext(execContext, work), contextHandler);\n if (logger.isLoggable(Level.FINEST)) {\n String msg = \"String_Node_Str\" + work.toString() + \"String_Node_Str\";\n logger.log(Level.FINEST, debugMsg(msg));\n }\n WorkCoordinator wc = new WorkCoordinator(work, startTimeout, execContext, tp.getAnyWorkQueue(), workListener, this.probeProvider, runtime, raName, contextHandler);\n wc.submitWork(WorkCoordinator.WAIT_UNTIL_FINISH);\n wc.lock();\n WorkException we = wc.getException();\n if (we != null) {\n throw we;\n }\n if (logger.isLoggable(Level.FINEST)) {\n String msg = \"String_Node_Str\" + work.toString() + \"String_Node_Str\";\n logger.log(Level.FINEST, debugMsg(msg));\n }\n}\n"
|
"protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object obj, BindException errors) throws Exception {\n HttpSession httpSession = request.getSession();\n String view = getFormView();\n if (Context.isAuthenticated()) {\n String[] conceptClassList = request.getParameterValues(\"String_Node_Str\");\n AdministrationService as = Context.getAdministrationService();\n ConceptService cs = Context.getConceptService();\n String success = \"String_Node_Str\";\n String error = \"String_Node_Str\";\n MessageSourceAccessor msa = getMessageSourceAccessor();\n String deleted = msa.getMessage(\"String_Node_Str\");\n String notDeleted = msa.getMessage(\"String_Node_Str\");\n for (String cc : conceptClassList) {\n try {\n cs.purgeConceptClass(cs.getConceptClass(Integer.valueOf(cc)));\n if (!success.equals(\"String_Node_Str\"))\n success += \"String_Node_Str\";\n success += cc + \"String_Node_Str\" + deleted;\n } catch (APIException e) {\n log.warn(\"String_Node_Str\", e);\n if (!error.equals(\"String_Node_Str\"))\n error += \"String_Node_Str\";\n error += cc + \"String_Node_Str\" + notDeleted;\n }\n }\n view = getSuccessView();\n if (!success.equals(\"String_Node_Str\"))\n httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, success);\n if (!error.equals(\"String_Node_Str\"))\n httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, error);\n }\n return new ModelAndView(new RedirectView(view));\n}\n"
|
"public void leader() {\n LOG.info(\"String_Node_Str\");\n resourceCoordinator = new ResourceCoordinator(zkClient, discoveryServiceClient, new BalancedAssignmentStrategy());\n resourceCoordinator.startAndWait();\n resourceCoordinatorClient.modifyRequirement(Constants.Service.STREAMS, new ResourceModifier() {\n public ResourceRequirement apply(ResourceRequirement existingRequirement) {\n try {\n ResourceRequirement.Builder builder = ResourceRequirement.builder(Constants.Service.STREAMS);\n for (StreamSpecification spec : streamMetaStore.listStreams()) {\n LOG.debug(\"String_Node_Str\", spec.getName());\n builder.addPartition(new ResourceRequirement.Partition(spec.getName(), 1));\n }\n return builder.build();\n } catch (Throwable e) {\n LOG.error(\"String_Node_Str\", e);\n Throwables.propagate(e);\n return null;\n }\n }\n resourceCoordinatorClient.submitRequirement(builder.build()).get();\n } catch (Throwable e) {\n LOG.error(\"String_Node_Str\", e);\n Throwables.propagate(e);\n }\n}\n"
|
"public void onWindowResized(int width, int height) {\n if (width == windowWidth) {\n return;\n }\n windowWidth = width;\n onWindowResizedImpl(width);\n}\n"
|
"private void displayWelcomeMessage() {\n System.out.println(\"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\");\n}\n"
|
"public void onStart() {\n super.onStart();\n if (!hasPost()) {\n showPost();\n }\n}\n"
|
"private void addHeaders(HttpHeaders headers) {\n for (String name : headers.keySet()) {\n if (isDynamic(name) && outputStream != null) {\n continue;\n }\n if (name.equals(\"String_Node_Str\") && outputStream == null) {\n continue;\n }\n List<String> values = headers.get(name);\n for (String value : values) {\n builder.header(name, value);\n }\n }\n}\n"
|
"public void selectionChanged(SelectionChangedEvent event) {\n XSDElementDeclaration decl = (XSDElementDeclaration) ((IStructuredSelection) event.getSelection()).getFirstElement();\n refreshRoleView(BROWSE_ITEMS + decl.getName());\n UpdateComplexViewButton(true);\n}\n"
|
"public void datarank() throws IOException {\n final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer();\n frequencyAnalyzer.setWordFrequenciesToReturn(200);\n frequencyAnalyzer.setMinWordLength(2);\n frequencyAnalyzer.setStopWords(loadStopWords());\n final List<WordFrequency> wordFrequencies = frequencyAnalyzer.load(getInputStream(\"String_Node_Str\"));\n final Dimension dimension = new Dimension(990, 618);\n final LayeredWordCloud layeredWordCloud = new LayeredWordCloud(4, dimension, CollisionMode.PIXEL_PERFECT);\n layeredWordCloud.setBackgroundColor(new Color(0x000000FF, true));\n layeredWordCloud.setPadding(0, 1);\n layeredWordCloud.setPadding(1, 1);\n layeredWordCloud.setKumoFont(0, new KumoFont(\"String_Node_Str\", FontWeight.BOLD));\n layeredWordCloud.setKumoFont(1, new KumoFont(\"String_Node_Str\", FontWeight.BOLD));\n layeredWordCloud.setBackground(0, new PixelBoundryBackground(getInputStream(\"String_Node_Str\")));\n layeredWordCloud.setBackground(1, new PixelBoundryBackground(getInputStream(\"String_Node_Str\")));\n layeredWordCloud.setColorPalette(0, new ColorPalette(new Color(0x0891d1)));\n layeredWordCloud.setColorPalette(1, new ColorPalette(new Color(0x76beea)));\n layeredWordCloud.setFontScalar(0, new SqrtFontScalar(10, 60));\n layeredWordCloud.setFontScalar(1, new SqrtFontScalar(10, 60));\n final long startTime = System.currentTimeMillis();\n layeredWordCloud.build(0, wordFrequencies);\n layeredWordCloud.build(1, wordFrequencies);\n LOGGER.info(\"String_Node_Str\" + (System.currentTimeMillis() - startTime) + \"String_Node_Str\");\n layeredWordCloud.writeToFile(\"String_Node_Str\");\n}\n"
|
"public SimpleHttpResponse post(String url, Map<String, String> headerValues, Map<String, Object> postParameters, HttpRequest request) {\n HttpURLConnection connection = null;\n connectionPool.put(request, connection);\n try {\n URL u = new URL(url);\n if (u.getProtocol().toLowerCase().equals(\"String_Node_Str\")) {\n trustAllHosts();\n HttpsURLConnection https = (HttpsURLConnection) u.openConnection();\n https.setHostnameVerifier(DO_NOT_VERIFY);\n connection = https;\n } else {\n connection = (HttpURLConnection) u.openConnection();\n }\n connection.setRequestMethod(\"String_Node_Str\");\n connection.setDoOutput(true);\n connection.setDoInput(true);\n connection.setUseCaches(getUseCaches());\n connection.setConnectTimeout(getConnectionTimeout());\n connection.setReadTimeout(getReadTimeout());\n connectionPool.put(request, connection);\n } catch (Exception e) {\n Log.e(\"String_Node_Str\", e.toString());\n if (connection != null)\n disconnectConnection(request);\n return null;\n }\n if (headerValues != null)\n for (String key : headerValues.keySet()) connection.setRequestProperty(key, headerValues.get(key));\n if (postParameters != null) {\n boolean fileExists = false;\n for (String key : postParameters.keySet()) {\n if (postParameters.get(key).getClass() == (Object) File.class) {\n fileExists = true;\n break;\n }\n }\n try {\n DataOutputStream dos = null;\n if (fileExists) {\n String boundary = \"String_Node_Str\";\n String startBoundary = \"String_Node_Str\" + boundary + \"String_Node_Str\";\n String endBoundary = \"String_Node_Str\";\n String finalEndBoundary = \"String_Node_Str\" + boundary + \"String_Node_Str\";\n connection.setRequestProperty(\"String_Node_Str\", \"String_Node_Str\" + boundary);\n dos = new DataOutputStream(connection.getOutputStream());\n for (String key : postParameters.keySet()) {\n dos.writeBytes(startBoundary);\n Object value = postParameters.get(key);\n if (value.getClass() == File.class) {\n File file = (File) value;\n File compressedFile = ImageUtil.compressFile(file, 80);\n if (compressedFile != null) {\n file = compressedFile;\n }\n dos.writeBytes(\"String_Node_Str\" + key + \"String_Node_Str\" + file.getName() + \"String_Node_Str\");\n dos.writeBytes(\"String_Node_Str\" + getMimeType((File) value) + \"String_Node_Str\");\n dos.writeBytes(\"String_Node_Str\");\n FileInputStream fis = new FileInputStream(file);\n int totalSize = fis.available();\n byte[] buffer = new byte[FILE_BUFFER_SIZE];\n int bytesRead = 0;\n while ((bytesRead = fis.read(buffer, 0, FILE_BUFFER_SIZE)) > 0) {\n dos.write(buffer, 0, bytesRead);\n if (progressListener != null) {\n progressListener.onWritten(progressTag, totalSize, bytesRead);\n }\n }\n fis.close();\n } else {\n dos.writeBytes(\"String_Node_Str\" + key + \"String_Node_Str\");\n dos.writeBytes(value.toString());\n }\n dos.writeBytes(endBoundary);\n }\n dos.writeBytes(finalEndBoundary);\n } else {\n connection.setRequestProperty(\"String_Node_Str\", \"String_Node_Str\");\n dos = new DataOutputStream(connection.getOutputStream());\n StringBuffer buffer = new StringBuffer();\n for (String key : postParameters.keySet()) {\n if (buffer.length() > 0)\n buffer.append(\"String_Node_Str\");\n buffer.append(urlencode(key));\n buffer.append(\"String_Node_Str\");\n buffer.append(urlencode(postParameters.get(key).toString()));\n }\n dos.writeBytes(buffer.toString());\n }\n dos.flush();\n dos.close();\n } catch (Exception e) {\n Log.d(\"String_Node_Str\", \"String_Node_Str\" + e.toString());\n Log.e(\"String_Node_Str\", e.toString());\n disconnectConnection(request);\n return null;\n }\n } else {\n DataOutputStream dos = null;\n try {\n dos = new DataOutputStream(connection.getOutputStream());\n dos.flush();\n dos.close();\n } catch (Exception e) {\n Log.e(\"String_Node_Str\", e.toString());\n disconnectConnection(request);\n return null;\n }\n }\n try {\n InputStream is = connection.getInputStream();\n byte[] responseBody = readBytesFromInputStream(is);\n is.close();\n SimpleHttpResponse result = new SimpleHttpResponse(connection.getResponseCode(), responseBody, connection.getHeaderFields());\n disconnectConnection(request);\n return result;\n } catch (Exception e) {\n Log.e(\"String_Node_Str\", e.toString());\n try {\n int responseCode = connection.getResponseCode();\n if (responseCode != -1) {\n SimpleHttpResponse result = new SimpleHttpResponse(responseCode, connection.getResponseMessage());\n disconnectConnection(request);\n return result;\n }\n } catch (IOException ioe) {\n Log.e(\"String_Node_Str\", ioe.toString());\n }\n } finally {\n disconnectConnection(request);\n }\n return null;\n}\n"
|
"public void mouseClicked(MouseEvent m) {\n EvaluatedDescription eDescription = null;\n if (view.getSuggestClassPanel().getSuggestList().getSelectedValue() != null) {\n SuggestListItem item = (SuggestListItem) view.getSuggestClassPanel().getSuggestList().getSelectedValue();\n String desc = item.getValue();\n if (model.getEvaluatedDescriptionList() != null) {\n for (Iterator<EvaluatedDescription> i = model.getEvaluatedDescriptionList().iterator(); i.hasNext(); ) {\n eDescription = i.next();\n if (desc.equals(eDescription.getDescription().toManchesterSyntaxString(editorKit.getModelManager().getActiveOntology().getURI() + \"String_Node_Str\", null))) {\n evaluatedDescription = eDescription;\n break;\n }\n }\n }\n }\n if (m.getClickCount() == 2) {\n view.getMoreDetailForSuggestedConceptsPanel().renderDetailPanel(evaluatedDescription);\n }\n}\n"
|
"protected void prepare() throws CommandException, CommandValidationException {\n try {\n processProgramOptions();\n initializeAuth();\n initializeRemoteAdminCommand();\n if (responseFormatType != null) {\n rac.setResponseFormatType(responseFormatType);\n }\n if (userOut != null) {\n rac.setUserOut(userOut);\n }\n initializeCookieManager();\n if (programOpts.isHelp()) {\n CommandModelData cm = new CommandModelData(name);\n cm.add(new ParamModelData(\"String_Node_Str\", boolean.class, true, \"String_Node_Str\", \"String_Node_Str\"));\n this.commandModel = cm;\n rac.setCommandModel(cm);\n return;\n }\n commandModel = rac.getCommandModel();\n } catch (CommandException cex) {\n if (logger.isLoggable(Level.FINER))\n logger.finer(\"String_Node_Str\" + cex);\n throw cex;\n } catch (Exception e) {\n logger.finer(\"String_Node_Str\" + e);\n throw new CommandException(e.getMessage());\n }\n}\n"
|
"public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {\n if (!ModuleHelper.isEnabled(ForestryModuleUids.APICULTURE)) {\n return;\n }\n ItemRegistryApiculture items = ModuleApiculture.getItems();\n Preconditions.checkNotNull(items);\n ISubtypeRegistry.ISubtypeInterpreter beeSubtypeInterpreter = itemStack -> {\n IAlleleSpecies species = Genome.getSpeciesDirectly(BeeManager.beeRoot, itemStack);\n return species == null ? ISubtypeRegistry.ISubtypeInterpreter.NONE : species.getUID();\n };\n subtypeRegistry.registerSubtypeInterpreter(items.beeDroneGE, beeSubtypeInterpreter);\n subtypeRegistry.registerSubtypeInterpreter(items.beePrincessGE, beeSubtypeInterpreter);\n subtypeRegistry.registerSubtypeInterpreter(items.beeQueenGE, beeSubtypeInterpreter);\n}\n"
|
"protected void createSecurityPolicyFile(File directory) {\n ArgumentNotValid.checkNotNull(directory, \"String_Node_Str\");\n try {\n File secPolFile = new File(directory, \"String_Node_Str\");\n FileWriter secfw = new FileWriter(secPolFile);\n String prop = FileUtils.readFile(inheritedSecurityPolicyFile);\n String monitorRole = settings.getLeafValue(Constants.SETTINGS_JMX_NAME_LEAF);\n if (monitorRole != null) {\n prop = prop.replace(Constants.SECURITY_JMX_PRINCIPAL_NAME_TAG, monitorRole);\n }\n String ctd = settings.getLeafValue(Constants.SETTINGS_TEMPDIR_LEAF);\n if (ctd != null) {\n prop = prop.replace(Constants.SECURITY_COMMON_TEMP_DIR_TAG, ctd);\n }\n secfw.write(prop);\n List<String> dirs = new ArrayList<String>();\n for (Application app : applications) {\n String[] tmpDirs = app.getSettingsValues(Constants.SETTINGS_BITARCHIVE_FILEDIR_LEAF);\n if (tmpDirs != null && tmpDirs.length > 0) {\n for (String st : tmpDirs) {\n dirs.add(st);\n }\n }\n }\n if (dirs.size() > 0) {\n secfw.write(\"String_Node_Str\" + \"String_Node_Str\");\n for (String dir : dirs) {\n secfw.write(\"String_Node_Str\");\n secfw.write(changeFileDirPathForSecurity(dir));\n secfw.write(\"String_Node_Str\");\n secfw.write(\"String_Node_Str\" + \"String_Node_Str\");\n }\n secfw.write(\"String_Node_Str\");\n }\n secfw.close();\n } catch (IOException e) {\n log.warn(\"String_Node_Str\" + e);\n }\n}\n"
|
"public User[] awaitSelfUserFriends(String accessToken) {\n Uri.Builder uriBuilder = Uri.parse(getString(R.string.gf_api_base_url)).buildUpon().appendEncodedPath(getString(R.string.gf_api_users_path)).appendEncodedPath(getString(R.string.gf_api_users_self_path)).appendEncodedPath(getString(R.string.gf_api_users_friends_path));\n if (accessToken != null)\n uriBuilder.appendQueryParameter(\"String_Node_Str\", accessToken);\n return get(uriBuilder.build().toString(), User[].class);\n}\n"
|
"private void updateFormatEvaluation(HlsMediaChunk previous, long playbackPositionUs) {\n clearStaleBlacklistedVariants();\n if (!seenFirstExternalTrackSelection) {\n if (!enabledVariantBlacklistFlags[getEnabledVariantIndex(variants[0].format)]) {\n evaluation.format = variants[0].format;\n return;\n }\n adaptiveFormatEvaluator.evaluateFormat(bufferedDurationUs, enabledVariantBlacklistFlags, evaluation);\n } else {\n evaluation.format = enabledVariants[0].format;\n }\n}\n"
|
"private void relayoutTaskViews(AnimationProps animation, boolean ignoreTaskOverrides) {\n cancelDeferredTaskViewLayoutAnimation();\n bindVisibleTaskViews(mStackScroller.getStackScroll(), ignoreTaskOverrides);\n List<TaskView> taskViews = getTaskViews();\n int taskViewCount = taskViews.size();\n for (int i = 0; i < taskViewCount; i++) {\n TaskView tv = taskViews.get(i);\n int taskIndex = mStack.indexOfStackTask(tv.getTask());\n TaskViewTransform transform = mCurrentTaskTransforms.get(taskIndex);\n if (mIgnoreTasks.contains(tv.getTask().key)) {\n continue;\n }\n updateTaskViewToTransform(tv, transform, animation);\n }\n}\n"
|
"private void processAggregation(ProjectParsed queryData, ResultSet resultSet, SearchResponse response) throws ExecutionException {\n Map<Selector, String> alias = returnAlias(queryData);\n for (Aggregation aggregation : response.getAggregations()) {\n InternalTerms terms = (InternalTerms) aggregation;\n processTermAggregation(queryData, resultSet, alias, terms);\n }\n if (queryData.getOrderBy() != null && (queryData.getOrderBy().getIds().size() > 1 || (queryData.getSelect().isDistinct() && queryData.getSelect().getColumnMap().size() > 1) || (queryData.getGroupBy() != null && queryData.getGroupBy().getIds().size() > 1))) {\n List<OrderByClause> fields = queryData.getOrderBy().getIds();\n Collections.sort(resultSet.getRows(), new RowSorter(fields));\n }\n if (queryData.getLimit() != null) {\n int limit = queryData.getLimit().getLimit();\n if (resultSet.getRows().size() > limit) {\n List<Row> limitedResult = resultSet.getRows().subList(0, limit);\n resultSet.setRows(new ArrayList<>(limitedResult));\n }\n }\n}\n"
|
"private static HttpEntity executeMethod(DefaultHttpClient httpClient, HttpRequestBase req) throws Throwable {\n HttpResponse response = null;\n int redirects = 0;\n while (response == null || response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {\n if (response != null && response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\" + \"String_Node_Str\");\n URI uri = req.getURI();\n req.abort();\n req = req.getClass().newInstance();\n req.setURI(uri);\n httpClient.getCredentialsProvider().clear();\n response = httpClient.execute(req);\n } else\n response = httpClient.execute(req);\n if (!((HTTPCredentialsProvider) httpClient.getCredentialsProvider()).retry()) {\n if (logger.isDebugEnabled())\n logger.debug(\"String_Node_Str\");\n break;\n }\n Header locationHeader = response.getFirstHeader(\"String_Node_Str\");\n if (locationHeader != null && req instanceof HttpPost && (response.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_PERMANENTLY || response.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY || response.getStatusLine().getStatusCode() == HttpStatus.SC_SEE_OTHER) && redirects < MAX_REDIRECTS) {\n HttpRequestBase oldreq = req;\n oldreq.abort();\n String newLocation = locationHeader.getValue();\n HttpEntity en = ((HttpPost) oldreq).getEntity();\n if (en != null && en instanceof StringEntity) {\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n en.writeTo(out);\n newLocation += \"String_Node_Str\" + out.toString(\"String_Node_Str\");\n }\n req = new HttpGet(newLocation);\n req.setParams(oldreq.getParams());\n req.setHeaders(oldreq.getAllHeaders());\n redirects++;\n response = httpClient.execute(req);\n }\n }\n if (response != null && response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\n return response.getEntity();\n }\n return null;\n}\n"
|
"protected void doWriteObject(final Object original, final boolean unshared) throws IOException {\n final ClassExternalizerFactory classExternalizerFactory = this.classExternalizerFactory;\n final ObjectResolver objectResolver = this.objectResolver;\n Object obj = original;\n Class<?> objClass;\n int id;\n boolean isArray, isEnum;\n SerializableClass info;\n boolean unreplaced = true;\n final int configuredVersion = this.configuredVersion;\n try {\n for (; ; ) {\n if (obj == null) {\n write(ID_NULL);\n return;\n }\n final int rid;\n if (!unshared && (rid = instanceCache.get(obj, -1)) != -1) {\n if (configuredVersion >= 2) {\n final int diff = rid - instanceSeq;\n if (diff >= -256) {\n write(ID_REPEAT_OBJECT_NEAR);\n write(diff);\n } else if (diff >= -65536) {\n write(ID_REPEAT_OBJECT_NEARISH);\n writeShort(diff);\n }\n return;\n }\n write(ID_REPEAT_OBJECT_FAR);\n writeInt(rid);\n return;\n }\n final ObjectTable.Writer objectTableWriter;\n if (!unshared && (objectTableWriter = objectTable.getObjectWriter(obj)) != null) {\n write(ID_PREDEFINED_OBJECT);\n if (configuredVersion == 1) {\n objectTableWriter.writeObject(getBlockMarshaller(), obj);\n writeEndBlock();\n } else {\n objectTableWriter.writeObject(this, obj);\n }\n return;\n }\n objClass = obj.getClass();\n id = (configuredVersion >= 2 ? BASIC_CLASSES_V2 : BASIC_CLASSES).get(objClass, -1);\n if (id == ID_CLASS_CLASS) {\n final Class<?> classObj = (Class<?>) obj;\n if (configuredVersion >= 2) {\n final int cid = BASIC_CLASSES_V2.get(classObj, -1);\n switch(cid) {\n case -1:\n case ID_SINGLETON_MAP_OBJECT:\n case ID_SINGLETON_SET_OBJECT:\n case ID_SINGLETON_LIST_OBJECT:\n case ID_EMPTY_MAP_OBJECT:\n case ID_EMPTY_SET_OBJECT:\n case ID_EMPTY_LIST_OBJECT:\n {\n break;\n }\n default:\n {\n write(cid);\n return;\n }\n }\n }\n write(ID_NEW_OBJECT);\n write(ID_CLASS_CLASS);\n writeClassClass(classObj);\n instanceCache.put(classObj, instanceSeq++);\n return;\n }\n isEnum = obj instanceof Enum;\n isArray = objClass.isArray();\n info = isArray || isEnum || id != -1 ? null : registry.lookup(objClass);\n if (unreplaced) {\n if (info != null) {\n if (info.hasWriteReplace()) {\n obj = info.callWriteReplace(obj);\n }\n }\n obj = objectResolver.writeReplace(obj);\n if (obj != original) {\n unreplaced = false;\n continue;\n } else {\n break;\n }\n } else {\n break;\n }\n }\n if (isEnum) {\n final Enum<?> theEnum = (Enum<?>) obj;\n write(ID_NEW_OBJECT);\n writeEnumClass(theEnum.getDeclaringClass());\n writeString(theEnum.name());\n instanceCache.put(obj, instanceSeq++);\n return;\n }\n switch(id) {\n case ID_BYTE_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_BYTE_OBJECT);\n writeByte(((Byte) obj).byteValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_BYTE_CLASS);\n writeByte(((Byte) obj).byteValue());\n }\n return;\n }\n case ID_BOOLEAN_CLASS:\n {\n if (configuredVersion >= 2) {\n write(((Boolean) obj).booleanValue() ? ID_BOOLEAN_OBJECT_TRUE : ID_BOOLEAN_OBJECT_FALSE);\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_BOOLEAN_CLASS);\n writeBoolean(((Boolean) obj).booleanValue());\n }\n return;\n }\n case ID_CHARACTER_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_CHARACTER_OBJECT);\n writeChar(((Character) obj).charValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_CHARACTER_CLASS);\n writeChar(((Character) obj).charValue());\n }\n return;\n }\n case ID_DOUBLE_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_DOUBLE_OBJECT);\n writeDouble(((Double) obj).doubleValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_DOUBLE_CLASS);\n writeDouble(((Double) obj).doubleValue());\n }\n return;\n }\n case ID_FLOAT_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_FLOAT_OBJECT);\n writeFloat(((Float) obj).floatValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_FLOAT_CLASS);\n writeFloat(((Float) obj).floatValue());\n }\n return;\n }\n case ID_INTEGER_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_INTEGER_OBJECT);\n writeInt(((Integer) obj).intValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_INTEGER_CLASS);\n writeInt(((Integer) obj).intValue());\n }\n return;\n }\n case ID_LONG_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_LONG_OBJECT);\n writeLong(((Long) obj).longValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_LONG_CLASS);\n writeLong(((Long) obj).longValue());\n }\n return;\n }\n case ID_SHORT_CLASS:\n {\n if (configuredVersion >= 2) {\n write(ID_SHORT_OBJECT);\n writeShort(((Short) obj).shortValue());\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_SHORT_CLASS);\n writeShort(((Short) obj).shortValue());\n }\n return;\n }\n case ID_STRING_CLASS:\n {\n final String string = (String) obj;\n if (configuredVersion >= 2) {\n final int len = string.length();\n if (len == 0) {\n write(ID_STRING_EMPTY);\n return;\n } else if (len <= 256) {\n write(ID_STRING_SMALL);\n write(len);\n } else if (len <= 65336) {\n write(ID_STRING_MEDIUM);\n writeShort(len);\n } else {\n write(ID_STRING_LARGE);\n writeInt(len);\n }\n flush();\n UTFUtils.writeUTFBytes(byteOutput, string);\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_STRING_CLASS);\n writeString(string);\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n instanceSeq++;\n } else {\n instanceCache.put(obj, instanceSeq++);\n }\n return;\n }\n case ID_BYTE_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final byte[] bytes = (byte[]) obj;\n final int len = bytes.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_BYTE);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_BYTE);\n write(bytes, 0, len);\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_BYTE);\n write(bytes, 0, len);\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_BYTE);\n write(bytes, 0, len);\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_BYTE_ARRAY_CLASS);\n writeInt(len);\n write(bytes, 0, len);\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_BOOLEAN_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final boolean[] booleans = (boolean[]) obj;\n final int len = booleans.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_BOOLEAN);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_BOOLEAN);\n writeBooleanArray(booleans);\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_BOOLEAN);\n writeBooleanArray(booleans);\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_BOOLEAN);\n writeBooleanArray(booleans);\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_BOOLEAN_ARRAY_CLASS);\n writeInt(len);\n writeBooleanArray(booleans);\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_CHAR_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final char[] chars = (char[]) obj;\n final int len = chars.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_CHAR);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_CHAR);\n for (int i = 0; i < len; i++) {\n writeChar(chars[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_CHAR);\n for (int i = 0; i < len; i++) {\n writeChar(chars[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_CHAR);\n for (int i = 0; i < len; i++) {\n writeChar(chars[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_CHAR_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeChar(chars[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_SHORT_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final short[] shorts = (short[]) obj;\n final int len = shorts.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_SHORT);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_SHORT);\n for (int i = 0; i < len; i++) {\n writeShort(shorts[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_SHORT);\n for (int i = 0; i < len; i++) {\n writeShort(shorts[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_SHORT);\n for (int i = 0; i < len; i++) {\n writeShort(shorts[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_SHORT_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeShort(shorts[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_INT_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final int[] ints = (int[]) obj;\n final int len = ints.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_INT);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_INT);\n for (int i = 0; i < len; i++) {\n writeInt(ints[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_INT);\n for (int i = 0; i < len; i++) {\n writeInt(ints[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_INT);\n for (int i = 0; i < len; i++) {\n writeInt(ints[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_INT_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeInt(ints[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_LONG_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final long[] longs = (long[]) obj;\n final int len = longs.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_LONG);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_LONG);\n for (int i = 0; i < len; i++) {\n writeLong(longs[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_LONG);\n for (int i = 0; i < len; i++) {\n writeLong(longs[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_LONG);\n for (int i = 0; i < len; i++) {\n writeLong(longs[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_LONG_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeLong(longs[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_FLOAT_ARRAY_CLASS:\n {\n if (!unshared) {\n instanceCache.put(obj, instanceSeq++);\n }\n final float[] floats = (float[]) obj;\n final int len = floats.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_FLOAT);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_FLOAT);\n for (int i = 0; i < len; i++) {\n writeFloat(floats[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_FLOAT);\n for (int i = 0; i < len; i++) {\n writeFloat(floats[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_FLOAT);\n for (int i = 0; i < len; i++) {\n writeFloat(floats[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_FLOAT_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeFloat(floats[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_DOUBLE_ARRAY_CLASS:\n {\n instanceCache.put(obj, instanceSeq++);\n final double[] doubles = (double[]) obj;\n final int len = doubles.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n write(ID_PRIM_DOUBLE);\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n write(ID_PRIM_DOUBLE);\n for (int i = 0; i < len; i++) {\n writeDouble(doubles[i]);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n write(ID_PRIM_DOUBLE);\n for (int i = 0; i < len; i++) {\n writeDouble(doubles[i]);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n write(ID_PRIM_DOUBLE);\n for (int i = 0; i < len; i++) {\n writeDouble(doubles[i]);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n write(ID_DOUBLE_ARRAY_CLASS);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n writeDouble(doubles[i]);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_CC_HASH_SET:\n case ID_CC_LINKED_HASH_SET:\n case ID_CC_TREE_SET:\n case ID_CC_ARRAY_LIST:\n case ID_CC_LINKED_LIST:\n {\n instanceCache.put(obj, instanceSeq++);\n final Collection<?> collection = (Collection<?>) obj;\n final int len = collection.size();\n if (len == 0) {\n write(unshared ? ID_COLLECTION_EMPTY_UNSHARED : ID_COLLECTION_EMPTY);\n write(id);\n if (id == ID_CC_TREE_SET) {\n doWriteObject(((TreeSet) collection).comparator(), false);\n }\n } else if (len <= 256) {\n write(unshared ? ID_COLLECTION_SMALL_UNSHARED : ID_COLLECTION_SMALL);\n write(len);\n write(id);\n if (id == ID_CC_TREE_SET) {\n doWriteObject(((TreeSet) collection).comparator(), false);\n }\n for (Object o : collection) {\n doWriteObject(o, false);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_COLLECTION_MEDIUM_UNSHARED : ID_COLLECTION_MEDIUM);\n writeShort(len);\n write(id);\n if (id == ID_CC_TREE_SET) {\n doWriteObject(((TreeSet) collection).comparator(), false);\n }\n for (Object o : collection) {\n doWriteObject(o, false);\n }\n } else {\n write(unshared ? ID_COLLECTION_LARGE_UNSHARED : ID_COLLECTION_LARGE);\n writeInt(len);\n write(id);\n if (id == ID_CC_TREE_SET) {\n doWriteObject(((TreeSet) collection).comparator(), false);\n }\n for (Object o : collection) {\n doWriteObject(o, false);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_CC_HASH_MAP:\n case ID_CC_HASHTABLE:\n case ID_CC_IDENTITY_HASH_MAP:\n case ID_CC_LINKED_HASH_MAP:\n case ID_CC_TREE_MAP:\n {\n instanceCache.put(obj, instanceSeq++);\n final Map<?, ?> map = (Map<?, ?>) obj;\n final int len = map.size();\n if (len == 0) {\n write(unshared ? ID_COLLECTION_EMPTY_UNSHARED : ID_COLLECTION_EMPTY);\n write(id);\n if (id == ID_CC_TREE_MAP) {\n doWriteObject(((TreeMap) map).comparator(), false);\n }\n } else if (len <= 256) {\n write(unshared ? ID_COLLECTION_SMALL_UNSHARED : ID_COLLECTION_SMALL);\n write(len);\n write(id);\n if (id == ID_CC_TREE_MAP) {\n doWriteObject(((TreeMap) map).comparator(), false);\n }\n for (Map.Entry<?, ?> entry : map.entrySet()) {\n doWriteObject(entry.getKey(), false);\n doWriteObject(entry.getValue(), false);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_COLLECTION_MEDIUM_UNSHARED : ID_COLLECTION_MEDIUM);\n writeShort(len);\n write(id);\n if (id == ID_CC_TREE_MAP) {\n doWriteObject(((TreeMap) map).comparator(), false);\n }\n for (Map.Entry<?, ?> entry : map.entrySet()) {\n doWriteObject(entry.getKey(), false);\n doWriteObject(entry.getValue(), false);\n }\n } else {\n write(unshared ? ID_COLLECTION_LARGE_UNSHARED : ID_COLLECTION_LARGE);\n writeInt(len);\n write(id);\n if (id == ID_CC_TREE_MAP) {\n doWriteObject(((TreeMap) map).comparator(), false);\n }\n for (Map.Entry<?, ?> entry : map.entrySet()) {\n doWriteObject(entry.getKey(), false);\n doWriteObject(entry.getValue(), false);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_EMPTY_MAP_OBJECT:\n case ID_EMPTY_SET_OBJECT:\n case ID_EMPTY_LIST_OBJECT:\n {\n write(id);\n return;\n }\n case ID_SINGLETON_MAP_OBJECT:\n {\n instanceCache.put(obj, instanceSeq++);\n write(id);\n final Map.Entry entry = (Map.Entry) ((Map) obj).entrySet().iterator().next();\n doWriteObject(entry.getKey(), false);\n doWriteObject(entry.getValue(), false);\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case ID_SINGLETON_LIST_OBJECT:\n case ID_SINGLETON_SET_OBJECT:\n {\n instanceCache.put(obj, instanceSeq++);\n write(id);\n doWriteObject(((Collection) obj).iterator().next(), false);\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n case -1:\n break;\n default:\n throw new NotSerializableException(objClass.getName());\n }\n if (isArray) {\n instanceCache.put(obj, instanceSeq++);\n final Object[] objects = (Object[]) obj;\n final int len = objects.length;\n if (configuredVersion >= 2) {\n if (len == 0) {\n write(unshared ? ID_ARRAY_EMPTY_UNSHARED : ID_ARRAY_EMPTY);\n writeClass(objClass.getComponentType());\n } else if (len <= 256) {\n write(unshared ? ID_ARRAY_SMALL_UNSHARED : ID_ARRAY_SMALL);\n write(len);\n writeClass(objClass.getComponentType());\n for (int i = 0; i < len; i++) {\n doWriteObject(objects[i], unshared);\n }\n } else if (len <= 65536) {\n write(unshared ? ID_ARRAY_MEDIUM_UNSHARED : ID_ARRAY_MEDIUM);\n writeShort(len);\n writeClass(objClass.getComponentType());\n for (int i = 0; i < len; i++) {\n doWriteObject(objects[i], unshared);\n }\n } else {\n write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE);\n writeInt(len);\n writeClass(objClass.getComponentType());\n for (int i = 0; i < len; i++) {\n doWriteObject(objects[i], unshared);\n }\n }\n } else {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n writeObjectArrayClass(objClass);\n writeInt(len);\n for (int i = 0; i < len; i++) {\n doWriteObject(objects[i], unshared);\n }\n }\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n if (Proxy.isProxyClass(objClass)) {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n instanceCache.put(obj, instanceSeq++);\n writeProxyClass(objClass);\n doWriteObject(Proxy.getInvocationHandler(obj), false);\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n Externalizer externalizer;\n if (externalizers.containsKey(objClass)) {\n externalizer = externalizers.get(objClass);\n } else {\n externalizer = classExternalizerFactory.getExternalizer(objClass);\n externalizers.put(objClass, externalizer);\n }\n if (externalizer != null) {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n writeExternalizerClass(objClass, externalizer);\n instanceCache.put(obj, instanceSeq++);\n final ObjectOutput objectOutput;\n objectOutput = getObjectOutput();\n externalizer.writeExternal(obj, objectOutput);\n writeEndBlock();\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n if (obj instanceof Externalizable) {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n instanceCache.put(obj, instanceSeq++);\n final Externalizable ext = (Externalizable) obj;\n final ObjectOutput objectOutput = getObjectOutput();\n writeExternalizableClass(objClass);\n ext.writeExternal(objectOutput);\n writeEndBlock();\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n if (obj instanceof Serializable) {\n write(unshared ? ID_NEW_OBJECT_UNSHARED : ID_NEW_OBJECT);\n writeSerializableClass(objClass);\n instanceCache.put(obj, instanceSeq++);\n doWriteSerializableObject(info, obj, objClass);\n if (unshared) {\n instanceCache.put(obj, -1);\n }\n return;\n }\n throw new NotSerializableException(objClass.getName());\n } finally {\n if (!unreplaced && obj != original) {\n final int replId = instanceCache.get(obj, -1);\n if (replId != -1) {\n instanceCache.put(original, replId);\n }\n }\n }\n}\n"
|
"public void updateOnlineController(String controller, int zookeeperId, String blurVersion) {\n int updatedCount = this.jdbc.update(\"String_Node_Str\", blurVersion, controller, zookeeperId);\n if (updatedCount == 0) {\n this.jdbc.update(\"String_Node_Str\", controller, zookeeperId, blurVersion);\n }\n}\n"
|
"public Set<Tupel> query(URI u) {\n String sparql = sparqlQueryMaker.makeQueryUsingFilters(u.toString());\n String FromCache = cache.get(u.toString(), sparql);\n String xml = null;\n if (FromCache == null) {\n try {\n xml = sendAndReceiveSPARQL(sparql);\n } catch (IOException e) {\n e.printStackTrace();\n }\n this.Cache.put(u.toString(), xml, sparql);\n System.out.print(\"String_Node_Str\");\n } else {\n xml = FromCache;\n System.out.println(\"String_Node_Str\");\n }\n Set<Tupel> s = this.processResult(xml);\n try {\n System.out.println(\"String_Node_Str\" + s.size() + \"String_Node_Str\");\n } catch (Exception e) {\n }\n return s;\n}\n"
|
"public void editNoteRequest(NoteStruct note) {\n if (!note.isPainting()) {\n Intent intent = new Intent(activity, AddNoteActivity.class);\n intent.putExtra(AddNoteModel.FOLDER_ID, note.getFolderId());\n intent.putExtra(AddNoteModel.IS_EDITING, true);\n intent.putExtra(AddNoteModel.NOTE, note);\n activity.startActivity(intent);\n } else {\n Intent intent = new Intent(activity, AddDrawingActivity.class);\n intent.putExtra(AddDrawingModel.FOLDER_ID, note.getFolderId());\n intent.putExtra(AddDrawingModel.IS_EDITING, true);\n intent.putExtra(AddDrawingModel.NOTE, note);\n activity.startActivity(intent);\n }\n}\n"
|
"public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) throws FHIRFormatError {\n if (value != null && !(value instanceof Quantity || value instanceof Ratio))\n throw new FHIRFormatError(\"String_Node_Str\" + value.fhirType());\n this.rate = value;\n return this;\n}\n"
|
"private void startLocationPermissionRequest() {\n ActivityCompat.requestPermissions(MainActivity.this, new String[] { Manifest.permission.ACCESS_COARSE_LOCATION }, REQUEST_PERMISSIONS_REQUEST_CODE);\n}\n"
|
"public void unclassifiedDocumentPresentation() {\n openPage(documentLibrary, COLLAB_SITE_ID);\n Document document = documentLibrary.getDocument(UNCLASSIFIED_DOCUMENT);\n try {\n document.getBannerText(ContentBanner.CLASSIFICATION);\n fail(\"String_Node_Str\");\n } catch (TimeoutException e) {\n }\n}\n"
|
"public double computeScore(double[] target, Prediction[] prediction) {\n Map<Double, Double> counts = new HashMap<Double, Double>();\n for (int i = 0; i < target.length; i++) {\n if (!counts.containsKey(target[i])) {\n counts.put(target[i], 1.0);\n } else {\n counts.put(target[i], counts.get(target[i]) + 1);\n }\n }\n double f1 = 0, temp1 = 0, temp2 = 0;\n for (double label : counts.keySet()) {\n for (int i = 0; i < prediction.length; i++) {\n if ((prediction[i].getLabel() == label && target[i] == label)) {\n temp1 += 1;\n } else if ((prediction[i].getLabel() == label || target[i] == label)) {\n temp2 += 1;\n }\n }\n f1 += temp1 / temp2;\n temp1 = 0;\n temp2 = 0;\n }\n return f1 / ((double) counts.size());\n}\n"
|
"public static String getLocaleName(HttpSession session) {\n return (String) session.getAttribute(LOCALE_KEY);\n}\n"
|
"public boolean isThreadRunning(int id, int componentID, String option) throws ClientNotKnownException {\n ClientState state = getState(id);\n Component component = state.getComponent(componentID);\n if (option.equals(\"String_Node_Str\"))\n return ((SparqlKnowledgeSource) component).subjectThreadIsRunning();\n else if (option.equals(\"String_Node_Str\"))\n return ((SparqlEndpoint) component).triplesThreadIsRunning();\n else if (option.equals(\"String_Node_Str\"))\n return ((SparqlEndpoint) component).conceptThreadIsRunning();\n return true;\n}\n"
|
"public boolean hasNext() {\n return firstValidItem();\n}\n"
|
"public void startCall() {\n Log.d(CALL_INTEGRATION, \"String_Node_Str\");\n Runnable callTask = callTasksMap.get(START_CALL_TASK);\n executeCallTask(callTask);\n}\n"
|
"void chooseModel() {\n final ChooseFileDialog dlg = new ChooseFileDialog(DdlImporterUiI18n.CHOOSE_MODEL_FILE_DIALOG_TITLE, DdlImporterUiI18n.CHOOSE_MODEL_FILE_DIALOG_MSG, new ChooseFileDialogContentProvider() {\n boolean validFile(final IFile file) {\n return relationalModel(file);\n }\n });\n if (importer.modelFile() != null)\n dlg.setInitialSelection(importer.modelFile());\n final IResource choice = showChooseDialog(dlg);\n if (choice == null)\n return;\n ddlFileCombo.setText(choice.removeFileExtension().lastSegment());\n}\n"
|
"protected DataModel buildModel() throws IOException {\n FastByIDMap<Collection<Preference>> data = new FastByIDMap<Collection<Preference>>();\n FileLineIterator iterator = new FileLineIterator(getDataFile(), false);\n processFile(iterator, data, false);\n return new GenericDataModel(GenericDataModel.toDataMap(data, true));\n}\n"
|
"public static String urlEncode(String str) {\n if (StringUtils.isBlank(str)) {\n return str;\n }\n String result = str;\n try {\n UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(str).build();\n return uriComponents.encode().toUriString();\n } catch (Exception e) {\n LOGGER.error(e.getMessage());\n }\n return result;\n}\n"
|
"public static String getAudioCodecName(int audioEncoder) {\n if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB && audioEncoder != MediaRecorder.AudioEncoder.AMR_WB && audioEncoder != MediaRecorder.AudioEncoder.AAC && audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS && audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {\n throw new IllegalArgumentException(\"String_Node_Str\" + audioEncoder);\n }\n return audioEncoderMap.get(audioEncoder);\n}\n"
|
"private void buildRefElement(TypeBuilder.OCDType ocdType, List<TypeMember> xmlElements, ExtendedAttributeDefinition attributeDef, boolean requiredForThisAttribute, String baseId, OCDType ocdReference, boolean topLevel) {\n if (generateNested(attributeDef) && !!!ocdReference.isInternal() && (topLevel || (ocdReference.getExtendsAlias() != null)) && !(topLevel && !shouldAddAttribute(attributeDef))) {\n TypeMember refElement = new TypeMember(attributeDef);\n if (topLevel) {\n refElement.setID(baseId);\n } else {\n String extendsAlias = ocdReference.getExtendsAlias();\n if (extendsAlias.startsWith(\"String_Node_Str\")) {\n refElement.setID(extendsAlias.substring(1));\n } else {\n refElement.setID(baseId + \"String_Node_Str\" + extendsAlias);\n }\n }\n refElement.setType((Type) null);\n refElement.setCardinality(attributeDef.getCardinality() == 0 ? 1 : attributeDef.getCardinality());\n String typeName = refElement.getCardinality() == 1 ? ocdReference.getTypeName() : ocdReference.getTypeName() + \"String_Node_Str\";\n refElement.setType(typeName);\n refElement.setRequired(requiredForThisAttribute);\n xmlElements.add(refElement);\n processExtensions(ocdType, refElement, attributeDef);\n }\n for (OCDType extender : ocdReference.getExtensions()) {\n buildRefElement(ocdType, xmlElements, attributeDef, requiredForThisAttribute, baseId, extender, false);\n }\n}\n"
|
"private void finalizeMonitorServiceOnStrat(Commands cmds, DomainRouterVO router, Provider provider, long networkId) {\n NetworkVO network = _networkDao.findById(networkId);\n s_logger.debug(\"String_Node_Str\" + router + \"String_Node_Str\");\n List<MonitoringServiceVO> services = new ArrayList<MonitoringServiceVO>();\n if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, Provider.VirtualRouter) || _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dns, Provider.VirtualRouter)) {\n MonitoringServiceVO dhcpService = _monitorServiceDao.getServiceByName(MonitoringService.Service.Dhcp.toString());\n if (dhcpService != null) {\n services.add(dhcpService);\n }\n }\n if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Lb, Provider.VirtualRouter)) {\n MonitoringServiceVO lbService = _monitorServiceDao.getServiceByName(MonitoringService.Service.LoadBalancing.toString());\n if (lbService != null) {\n services.add(lbService);\n }\n }\n List<MonitoringServiceVO> defaultServices = _monitorServiceDao.listDefaultServices(true);\n services.addAll(defaultServices);\n List<MonitorServiceTO> servicesTO = new ArrayList<MonitorServiceTO>();\n for (MonitoringServiceVO service : services) {\n MonitorServiceTO serviceTO = new MonitorServiceTO(service.getService(), service.getProcessname(), service.getServiceName(), service.getServicePath(), service.getPidFile(), service.isDefaultService());\n servicesTO.add(serviceTO);\n }\n SetMonitorServiceCommand command = new SetMonitorServiceCommand(servicesTO);\n command.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));\n command.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(networkId, router.getId()));\n command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());\n cmds.addCommand(\"String_Node_Str\", command);\n}\n"
|
"public void emitTableInstance(SchemaContext sc, TableInstance tr, StringBuilder buf, TableInstanceContext context) {\n Table<?> tab = tr.getTable();\n if (tab == null) {\n buf.append(tr.getSpecifiedAs(sc).getSQL());\n } else if (tab instanceof PEAbstractTable) {\n PEAbstractTable<?> pet = (PEAbstractTable<?>) tab;\n Database<?> curDb = sc.getCurrentDatabase(false);\n Database<?> tblDb = pet.getDatabase(sc);\n if (context == TableInstanceContext.TABLE_FACTOR) {\n if ((curDb == null && tblDb != null) || ((curDb != null && tblDb != null) && (curDb.getId() != tblDb.getId()))) {\n if (getOptions() == null || !getOptions().isCatalog()) {\n int offset = buf.length();\n String toAdd = pet.getDatabase(sc).getName().getUnqualified().getSQL();\n buf.append(toAdd).append(\"String_Node_Str\");\n builder.withDBName(offset, toAdd);\n } else {\n buf.append(pet.getDatabase(sc).getName().getUnqualified().getSQL()).append(\"String_Node_Str\");\n }\n }\n }\n boolean prohibitAlias = false;\n if (pet.isTempTable()) {\n int offset = buf.length();\n String toAdd = pet.getName(sc).getSQL();\n buf.append(toAdd);\n builder.withTempTable(offset, toAdd, (TempTable) pet);\n prohibitAlias = true;\n } else {\n if ((context == TableInstanceContext.COLUMN || context == TableInstanceContext.NAKED) && tr.getAlias() != null) {\n buf.append(tr.getAlias().getSQL());\n } else {\n if (pet.getPEDatabase(sc).getMTMode() == MultitenantMode.ADAPTIVE) {\n buf.append(tr.getTable().getName(sc).getSQL());\n } else {\n buf.append(tr.getSpecifiedAs(sc).getQuotedName().getSQL());\n }\n }\n }\n if (context == TableInstanceContext.COLUMN || prohibitAlias || context == TableInstanceContext.NAKED) {\n } else if (tr.getAlias() != null) {\n buf.append(\"String_Node_Str\").append(tr.getAlias().getSQL());\n }\n } else if (tab instanceof InformationSchemaTable) {\n if (context == TableInstanceContext.COLUMN && tr.getAlias() != null) {\n buf.append(tr.getAlias().getSQL());\n } else {\n buf.append(tr.getTable().getName().getSQL());\n }\n if (context == TableInstanceContext.TABLE_FACTOR && tr.getAlias() != null)\n buf.append(\"String_Node_Str\").append(tr.getAlias().getSQL());\n } else {\n if (context == TableInstanceContext.COLUMN && tr.getAlias() != null) {\n buf.append(tr.getAlias().getSQL());\n } else {\n buf.append(tr.getTable().getName().getSQL());\n }\n if (context == TableInstanceContext.TABLE_FACTOR && tr.getAlias() != null)\n buf.append(\"String_Node_Str\").append(tr.getAlias().getSQL());\n }\n}\n"
|
"private boolean loadFromThreadId(long threadId) {\n Cursor c = mContext.getContentResolver().query(sAllThreadsUri, ALL_THREADS_PROJECTION, \"String_Node_Str\" + Long.toString(threadId), null, null);\n try {\n if (c.moveToFirst()) {\n fillFromCursor(mContext, this, c, true);\n } else {\n LogTag.error(\"String_Node_Str\" + threadId);\n return false;\n }\n } finally {\n c.close();\n }\n return true;\n}\n"
|
"public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent();\n copyElement(src, tgt);\n tgt.setKey(src.getKey());\n tgt.setRequirements(src.getRequirements());\n tgt.setSeverity(convertConstraintSeverity(src.getSeverity()));\n tgt.setHuman(src.getHuman());\n if (src.hasExpression())\n ToolingExtensions.addStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression());\n tgt.setXpath(src.getXpath());\n return tgt;\n}\n"
|
"public void rotateGate(ActivateEvent event, EntityRef screwdriver) {\n final EntityRef target = event.getTarget();\n if (target.hasComponent(SignalGateComponent.class)) {\n final Vector3i targetLocation = new Vector3i(event.getTargetLocation());\n final Block block = worldProvider.getBlock(targetLocation);\n final BlockFamily blockFamily = block.getBlockFamily();\n if (blockFamily instanceof OneCrucialSideFamily) {\n final OneCrucialSideFamily gateBlockFamily = (OneCrucialSideFamily) blockFamily;\n final Side currentSide = gateBlockFamily.getBlockSide(block);\n final Side newSide = sideOrder.get(currentSide);\n if (worldProvider.setBlock(targetLocation, gateBlockFamily.getBlockForSide(newSide), block)) {\n logger.info(\"String_Node_Str\");\n final EntityRef gateEntity = blockEntityRegistry.getBlockEntityAt(targetLocation);\n final SignalProducerComponent signalProducer = gateEntity.getComponent(SignalProducerComponent.class);\n gateEntity.removeComponent(SignalProducerComponent.class);\n final SignalConsumerComponent signalConsumer = gateEntity.getComponent(SignalConsumerComponent.class);\n signalConsumer.connectionSides = 0;\n gateEntity.saveComponent(signalConsumer);\n final byte newSideBit = SideBitFlag.getSide(newSide);\n signalProducer.connectionSides = newSideBit;\n signalConsumer.connectionSides = (byte) (63 - newSideBit);\n gateEntity.saveComponent(signalProducer);\n gateEntity.saveComponent(signalConsumer);\n if (newSide == Side.FRONT) {\n gateEntity.removeComponent(SignalGateRotatedComponent.class);\n } else {\n gateEntity.addComponent(new SignalGateRotatedComponent());\n }\n }\n }\n }\n}\n"
|
"public static InvocationMatching mapImplicitInvocation(CtClass ctClassMP, CtAbstractInvocation inv0) {\n if (inv0 instanceof CtInvocation) {\n CtInvocation invocation0 = (CtInvocation) inv0;\n CtExpression tpr = invocation0.getTarget();\n if (tpr instanceof CtThisAccess) {\n CtThisAccess<?> targetthis = (CtThisAccess) tpr;\n CtTypeReference tpref = targetthis.getType();\n if (ctClassMP.isSubtypeOf(tpref))\n return InvocationMatching.TARGET_SAME_TYPE;\n else if (chechSignatures(ctClassMP.getAllExecutables(), invocation0.getExecutable(), false)) {\n return InvocationMatching.SAME_SIGNATURE_DIFF_TYPE;\n } else {\n log.debug(\"String_Node_Str\" + invocation0.getExecutable().getSignature());\n log.debug(\"String_Node_Str\" + ctClassMP.getQualifiedName() + \"String_Node_Str\" + (tpref.getQualifiedName()));\n return InvocationMatching.TARGET_INCOMPATIBLE;\n }\n } else {\n log.debug(\"String_Node_Str\" + tpr);\n return InvocationMatching.TARGET_IS_VARIABLE;\n }\n } else {\n if (inv0 instanceof CtConstructorCall) {\n if (chechSignatures(ctClassMP.getConstructors(), inv0.getExecutable())) {\n return InvocationMatching.SAME_SIGNATURE_CONTRUCTOR;\n } else {\n return InvocationMatching.NO_MATCH;\n }\n }\n return InvocationMatching.OTHER;\n }\n}\n"
|
"public int getRelativeScrollYOffset() {\n if (!this.enableScrolling && this.parent instanceof Container) {\n Item walker = this.parent;\n int offset = 0;\n while (walker instanceof Container) {\n offset += walker.relativeY;\n walker = walker.getParent();\n }\n return ((Container) this.parent).getScrollYOffset() + this.relativeY + offset;\n }\n int offset = this.targetYOffset;\n if (!this.scrollSmooth) {\n offset = this.yOffset;\n }\n return offset;\n}\n"
|
"public void create() {\n UnitUtil uu = new UnitUtil();\n uu.enrichementMap.put(\"String_Node_Str\", \"String_Node_Str\");\n Map<String, String> config = uu.createTaskConfig();\n SplunkSinkConnectorConfig connectorConfig = new SplunkSinkConnectorConfig(config);\n Assert.assertEquals(uu.enrichementMap, connectorConfig.enrichments);\n Assert.assertEquals(1, connectorConfig.topicMetas.size());\n Assert.assertEquals(0, connectorConfig.topicMetas.get(\"String_Node_Str\").size());\n assertMeta(connectorConfig);\n commonAssert(connectorConfig);\n}\n"
|
"public void onResume() {\n super.onResume();\n mainColor = getResources().getColor(ThemeUtil.getTheme(getActivity()).getMainColorID());\n mainDarkColor = getResources().getColor(ThemeUtil.getTheme(getActivity()).getMainDarkColorID());\n mAddRecordBt.setColorNormal(mainColor);\n mAddRecordBt.setColorPressed(mainDarkColor);\n backGround.setBackground(new ColorDrawable(mainColor));\n resetFoot();\n}\n"
|
"private void synchronize() {\n XlsContainer rowContainer = getCurrentContainer();\n ContainerSizeInfo rowSizeInfo = rowContainer.getSizeInfo();\n int startCoordinate = rowSizeInfo.getStartCoordinate();\n int endCoordinate = rowSizeInfo.getEndCoordinate();\n int startColumnIndex = axis.getColumnIndexByCoordinate(startCoordinate);\n int endColumnIndex = axis.getColumnIndexByCoordinate(endCoordinate);\n int maxRowIndex = 0;\n int[] rowIndexes = new int[endColumnIndex - startColumnIndex];\n for (int currentColumnIndex = startColumnIndex; currentColumnIndex < endColumnIndex; currentColumnIndex++) {\n int rowIndex = cache.getMaxRowIndex(currentColumnIndex);\n rowIndexes[currentColumnIndex - startColumnIndex] = rowIndex;\n maxRowIndex = maxRowIndex > rowIndex ? maxRowIndex : rowIndex;\n }\n int startRowIndex = rowContainer.getRowIndex();\n if (maxRowIndex == startRowIndex) {\n maxRowIndex++;\n }\n rowContainer.setRowIndex(maxRowIndex);\n for (int currentColumnIndex = startColumnIndex; currentColumnIndex < endColumnIndex; currentColumnIndex++) {\n int rowspan = maxRowIndex - rowIndexes[currentColumnIndex - startColumnIndex];\n if (rowspan > 0) {\n SheetData upstair = cache.getColumnLastData(currentColumnIndex);\n if (upstair != null && canSpan(upstair, rowContainer)) {\n SheetData predata = upstair;\n int rs = predata.getRowSpan() + rowspan;\n predata.setRowSpan(rs);\n SheetData realData = getRealData(predata);\n BlankData blankData = new BlankData(realData);\n if (!isInContainer(predata, rowContainer)) {\n blankData.decreasRowSpanInDesign();\n }\n int rowIndex = predata.getRowIndex();\n for (int p = 1; p <= rowspan; p++) {\n BlankData blank = new BlankData(predata);\n blank.setRowIndex(rowIndex + p);\n cache.addData(currentColumnIndex, blank);\n }\n }\n }\n }\n}\n"
|
"private ArrayList addToEntries(ModifiedAttributeHASession modAttrSession, ArrayList entries, SessionAttributeMetadata.Operation op, ArrayList attrList) {\n String nextAttrName = null;\n Object nextAttrValue = null;\n byte[] nextValue = null;\n for (int i = 0; i < attrList.size(); i++) {\n nextAttrName = attrList.get(i);\n nextAttrValue = ((StandardSession) modAttrSession).getAttribute(nextAttrName);\n nextValue = null;\n try {\n nextValue = getByteArray(nextAttrValue);\n } catch (IOException ex) {\n }\n SessionAttributeMetadata nextAttrMetadata = new SessionAttributeMetadata(nextAttrName, op, nextValue);\n entries.add(nextAttrMetadata);\n }\n return entries;\n}\n"
|
"private ElementDefinition processPaths(String indent, StructureDefinitionSnapshotComponent result, StructureDefinitionSnapshotComponent base, StructureDefinitionDifferentialComponent differential, int baseCursor, int diffCursor, int baseLimit, int diffLimit, String url, String profileName, String contextPathSrc, String contextPathDst, boolean trimDifferential, String contextName, String resultPathBase, boolean slicingDone, ElementDefinition redirector) throws DefinitionException, FHIRException {\n if (DEBUG)\n System.out.println(indent + \"String_Node_Str\" + resultPathBase + \"String_Node_Str\" + baseCursor + \"String_Node_Str\" + baseLimit + \"String_Node_Str\" + diffCursor + \"String_Node_Str\" + diffLimit + \"String_Node_Str\" + slicingDone + \"String_Node_Str\");\n ElementDefinition res = null;\n while (baseCursor <= baseLimit) {\n ElementDefinition currentBase = base.getElement().get(baseCursor);\n String cpath = fixedPathSource(contextPathSrc, currentBase.getPath(), redirector);\n if (DEBUG)\n System.out.println(indent + \"String_Node_Str\" + cpath + \"String_Node_Str\" + baseCursor + \"String_Node_Str\" + baseLimit + \"String_Node_Str\" + diffCursor + \"String_Node_Str\" + diffLimit + \"String_Node_Str\" + slicingDone + \"String_Node_Str\");\n List<ElementDefinition> diffMatches = getDiffMatches(differential, cpath, diffCursor, diffLimit, profileName, url);\n if (!currentBase.hasSlicing()) {\n if (diffMatches.isEmpty()) {\n ElementDefinition outcome = updateURLs(url, currentBase.copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n updateFromBase(outcome, currentBase);\n markDerived(outcome);\n if (resultPathBase == null)\n resultPathBase = outcome.getPath();\n else if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n result.getElement().add(outcome);\n if (hasInnerDiffMatches(differential, cpath, diffCursor, diffLimit, base.getElement())) {\n if (outcome.getType().size() > 1) {\n for (TypeRefComponent t : outcome.getType()) {\n if (!t.getCode().equals(\"String_Node_Str\"))\n throw new DefinitionException(diffMatches.get(0).getPath() + \"String_Node_Str\" + differential.getElement().get(diffCursor).getPath() + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName);\n }\n }\n StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));\n if (dt == null)\n throw new DefinitionException(cpath + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName + \"String_Node_Str\");\n contextName = dt.getUrl();\n int start = diffCursor;\n while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), cpath + \"String_Node_Str\")) diffCursor++;\n processPaths(indent + \"String_Node_Str\", result, dt.getSnapshot(), differential, 1, start, dt.getSnapshot().getElement().size() - 1, diffCursor - 1, url, profileName, cpath, outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);\n }\n baseCursor++;\n } else if (diffMatches.size() == 1 && (slicingDone || !(diffMatches.get(0).hasSlicing() || (isExtension(diffMatches.get(0)) && diffMatches.get(0).hasSliceName())))) {\n ElementDefinition template = null;\n if (diffMatches.get(0).hasType() && diffMatches.get(0).getType().size() == 1 && diffMatches.get(0).getType().get(0).hasProfile() && !diffMatches.get(0).getType().get(0).getCode().equals(\"String_Node_Str\")) {\n String p = diffMatches.get(0).getType().get(0).getProfile();\n StructureDefinition sd = context.fetchResource(StructureDefinition.class, p);\n if (sd != null) {\n if (!sd.hasSnapshot()) {\n StructureDefinition sdb = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition());\n if (sdb == null)\n throw new DefinitionException(\"String_Node_Str\" + sd.getBaseDefinition());\n generateSnapshot(sdb, sd, sd.getUrl(), sd.getName());\n }\n template = sd.getSnapshot().getElement().get(0).copy().setPath(currentBase.getPath());\n template.setSliceName(null);\n if (!diffMatches.get(0).getType().get(0).getCode().equals(\"String_Node_Str\")) {\n template.setMin(currentBase.getMin());\n template.setMax(currentBase.getMax());\n }\n }\n }\n if (template == null)\n template = currentBase.copy();\n else\n template = overWriteWithCurrent(template, currentBase);\n ElementDefinition outcome = updateURLs(url, template);\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n res = outcome;\n updateFromBase(outcome, currentBase);\n if (diffMatches.get(0).hasSliceName())\n outcome.setSliceName(diffMatches.get(0).getSliceName());\n outcome.setSlicing(null);\n updateFromDefinition(outcome, diffMatches.get(0), profileName, trimDifferential, url);\n if (outcome.getPath().endsWith(\"String_Node_Str\") && outcome.getType().size() == 1 && !outcome.getType().get(0).getCode().equals(\"String_Node_Str\"))\n outcome.setPath(outcome.getPath().substring(0, outcome.getPath().length() - 3) + Utilities.capitalize(outcome.getType().get(0).getCode()));\n if (resultPathBase == null)\n resultPathBase = outcome.getPath();\n else if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n result.getElement().add(outcome);\n baseCursor++;\n diffCursor = differential.getElement().indexOf(diffMatches.get(0)) + 1;\n if (differential.getElement().size() > diffCursor && outcome.getPath().contains(\"String_Node_Str\") && (isDataType(outcome.getType()) || outcome.hasContentReference())) {\n if (pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath() + \"String_Node_Str\") && !baseWalksInto(base.getElement(), baseCursor)) {\n if (outcome.getType().size() > 1) {\n if (outcome.getPath().endsWith(\"String_Node_Str\") && !diffMatches.get(0).getPath().endsWith(\"String_Node_Str\")) {\n String en = tail(outcome.getPath());\n String tn = tail(diffMatches.get(0).getPath());\n String t = tn.substring(en.length() - 3);\n if (isPrimitive(Utilities.uncapitalize(t)))\n t = Utilities.uncapitalize(t);\n List<TypeRefComponent> ntr = getByTypeName(outcome.getType(), t);\n if (ntr.isEmpty())\n ntr.add(new TypeRefComponent().setCode(t));\n outcome.getType().clear();\n outcome.getType().addAll(ntr);\n }\n if (outcome.getType().size() > 1)\n for (TypeRefComponent t : outcome.getType()) {\n if (!t.getCode().equals(\"String_Node_Str\"))\n throw new DefinitionException(diffMatches.get(0).getPath() + \"String_Node_Str\" + differential.getElement().get(diffCursor).getPath() + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName);\n }\n }\n int start = diffCursor;\n while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath() + \"String_Node_Str\")) diffCursor++;\n if (outcome.hasContentReference()) {\n ElementDefinition tgt = getElementById(base.getElement(), outcome.getContentReference());\n if (tgt == null)\n throw new DefinitionException(\"String_Node_Str\" + outcome.getContentReference());\n replaceFromContentReference(outcome, tgt);\n int nbc = base.getElement().indexOf(tgt) + 1;\n int nbl = nbc;\n while (nbl < base.getElement().size() && base.getElement().get(nbl).getPath().startsWith(tgt.getPath() + \"String_Node_Str\")) nbl++;\n processPaths(indent + \"String_Node_Str\", result, base, differential, nbc, start - 1, nbl - 1, diffCursor - 1, url, profileName, tgt.getPath(), diffMatches.get(0).getPath(), trimDifferential, contextName, resultPathBase, false, outcome);\n } else {\n StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));\n if (dt == null)\n throw new DefinitionException(diffMatches.get(0).getPath() + \"String_Node_Str\" + differential.getElement().get(diffCursor).getPath() + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName + \"String_Node_Str\");\n contextName = dt.getUrl();\n processPaths(indent + \"String_Node_Str\", result, dt.getSnapshot(), differential, 1, start, dt.getSnapshot().getElement().size() - 1, diffCursor - 1, url, profileName + pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);\n }\n }\n }\n } else {\n if (!unbounded(currentBase) && !isSlicedToOneOnly(diffMatches.get(0)))\n throw new DefinitionException(\"String_Node_Str\" + currentBase.getPath() + \"String_Node_Str\" + currentBase.getSliceName() + \"String_Node_Str\" + contextName + \"String_Node_Str\" + url);\n if (!diffMatches.get(0).hasSlicing() && !isExtension(currentBase))\n throw new DefinitionException(\"String_Node_Str\" + currentBase.getPath() + \"String_Node_Str\" + url);\n int start = 0;\n int nbl = findEndOfElement(base, baseCursor);\n if (diffMatches.size() > 1 && diffMatches.get(0).hasSlicing() && (nbl > baseCursor || differential.getElement().indexOf(diffMatches.get(1)) > differential.getElement().indexOf(diffMatches.get(0)) + 1)) {\n int ndc = differential.getElement().indexOf(diffMatches.get(0));\n int ndl = findEndOfElement(differential, ndc);\n processPaths(indent + \"String_Node_Str\", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName + pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null).setSlicing(diffMatches.get(0).getSlicing());\n start++;\n } else {\n ElementDefinition outcome = updateURLs(url, currentBase.copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n updateFromBase(outcome, currentBase);\n if (!diffMatches.get(0).hasSlicing())\n outcome.setSlicing(makeExtensionSlicing());\n else\n outcome.setSlicing(diffMatches.get(0).getSlicing().copy());\n if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n result.getElement().add(outcome);\n if (!diffMatches.get(0).hasSliceName()) {\n updateFromDefinition(outcome, diffMatches.get(0), profileName, trimDifferential, url);\n if (!outcome.hasContentReference() && !outcome.hasType()) {\n throw new DefinitionException(\"String_Node_Str\");\n }\n start++;\n } else\n checkExtensionDoco(outcome);\n }\n int ndc = diffCursor;\n int ndl = diffCursor;\n for (int i = start; i < diffMatches.size(); i++) {\n ndc = differential.getElement().indexOf(diffMatches.get(i));\n ndl = findEndOfElement(differential, ndc);\n processPaths(indent + \"String_Node_Str\", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName + pathTail(diffMatches, i), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null);\n }\n baseCursor = nbl + 1;\n diffCursor = ndl + 1;\n }\n } else {\n String path = currentBase.getPath();\n ElementDefinition original = currentBase;\n if (diffMatches.isEmpty()) {\n while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path)) {\n ElementDefinition outcome = updateURLs(url, base.getElement().get(baseCursor).copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\" + profileName + \"String_Node_Str\" + outcome.getPath() + \"String_Node_Str\" + resultPathBase);\n result.getElement().add(outcome);\n baseCursor++;\n }\n } else {\n boolean closed = currentBase.getSlicing().getRules() == SlicingRules.CLOSED;\n int diffpos = 0;\n boolean isExtension = cpath.endsWith(\"String_Node_Str\") || cpath.endsWith(\"String_Node_Str\");\n if (diffMatches.get(0).hasSlicing()) {\n ElementDefinitionSlicingComponent dSlice = diffMatches.get(0).getSlicing();\n ElementDefinitionSlicingComponent bSlice = currentBase.getSlicing();\n if (dSlice.hasOrderedElement() && bSlice.hasOrderedElement() && !orderMatches(dSlice.getOrderedElement(), bSlice.getOrderedElement()))\n throw new DefinitionException(\"String_Node_Str\" + summarizeSlicing(dSlice) + \"String_Node_Str\" + summarizeSlicing(bSlice) + \"String_Node_Str\" + path + \"String_Node_Str\" + contextName + \"String_Node_Str\");\n if (!discriminatorMatches(dSlice.getDiscriminator(), bSlice.getDiscriminator()))\n throw new DefinitionException(\"String_Node_Str\" + summarizeSlicing(dSlice) + \"String_Node_Str\" + summarizeSlicing(bSlice) + \"String_Node_Str\" + path + \"String_Node_Str\" + contextName + \"String_Node_Str\");\n if (!ruleMatches(dSlice.getRules(), bSlice.getRules()))\n throw new DefinitionException(\"String_Node_Str\" + summarizeSlicing(dSlice) + \"String_Node_Str\" + summarizeSlicing(bSlice) + \"String_Node_Str\" + path + \"String_Node_Str\" + contextName + \"String_Node_Str\");\n }\n ElementDefinition outcome = updateURLs(url, currentBase.copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n updateFromBase(outcome, currentBase);\n if (diffMatches.get(0).hasSlicing() || !diffMatches.get(0).hasSliceName()) {\n updateFromSlicing(outcome.getSlicing(), diffMatches.get(0).getSlicing());\n updateFromDefinition(outcome, diffMatches.get(0), profileName, closed, url);\n } else if (!diffMatches.get(0).hasSliceName())\n diffMatches.get(0).setUserData(GENERATED_IN_SNAPSHOT, true);\n result.getElement().add(outcome);\n if (!diffMatches.get(0).hasSliceName()) {\n diffpos++;\n }\n if (diffMatches.size() > 1 && diffMatches.get(0).hasSlicing() && differential.getElement().indexOf(diffMatches.get(1)) > differential.getElement().indexOf(diffMatches.get(0)) + 1) {\n int nbl = findEndOfElement(base, baseCursor);\n int ndc = differential.getElement().indexOf(diffMatches.get(0));\n int ndl = findEndOfElement(differential, ndc);\n processPaths(indent + \"String_Node_Str\", result, base, differential, baseCursor + 1, ndc, nbl, ndl, url, profileName + pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null);\n }\n List<ElementDefinition> baseMatches = getSiblings(base.getElement(), currentBase);\n for (ElementDefinition baseItem : baseMatches) {\n baseCursor = base.getElement().indexOf(baseItem);\n outcome = updateURLs(url, baseItem.copy());\n updateFromBase(outcome, currentBase);\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n outcome.setSlicing(null);\n if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n if (diffpos < diffMatches.size() && diffMatches.get(diffpos).getSliceName().equals(outcome.getSliceName())) {\n int nbl = findEndOfElement(base, baseCursor);\n int ndc = differential.getElement().indexOf(diffMatches.get(diffpos));\n int ndl = findEndOfElement(differential, ndc);\n processPaths(indent + \"String_Node_Str\", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName + pathTail(diffMatches, diffpos), contextPathSrc, contextPathDst, closed, contextName, resultPathBase, true, null);\n baseCursor = nbl;\n diffCursor = ndl + 1;\n diffpos++;\n } else {\n result.getElement().add(outcome);\n baseCursor++;\n while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path) && !base.getElement().get(baseCursor).getPath().equals(path)) {\n outcome = updateURLs(url, base.getElement().get(baseCursor).copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n result.getElement().add(outcome);\n baseCursor++;\n }\n baseCursor--;\n }\n }\n if (closed && diffpos < diffMatches.size())\n throw new DefinitionException(\"String_Node_Str\" + profileName + \"String_Node_Str\" + path + \"String_Node_Str\" + cpath + \"String_Node_Str\");\n if (diffpos == diffMatches.size()) {\n } else {\n while (diffpos < diffMatches.size()) {\n ElementDefinition diffItem = diffMatches.get(diffpos);\n for (ElementDefinition baseItem : baseMatches) if (baseItem.getSliceName().equals(diffItem.getSliceName()))\n throw new DefinitionException(\"String_Node_Str\");\n outcome = updateURLs(url, currentBase.copy());\n outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));\n updateFromBase(outcome, currentBase);\n outcome.setSlicing(null);\n if (!outcome.getPath().startsWith(resultPathBase))\n throw new DefinitionException(\"String_Node_Str\");\n result.getElement().add(outcome);\n updateFromDefinition(outcome, diffItem, profileName, trimDifferential, url);\n diffCursor = differential.getElement().indexOf(diffItem) + 1;\n if (!outcome.getType().isEmpty() && (differential.getElement().size() > diffCursor) && outcome.getPath().contains(\"String_Node_Str\") && isDataType(outcome.getType())) {\n if (!baseWalksInto(base.getElement(), baseCursor)) {\n if (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath() + \"String_Node_Str\")) {\n if (outcome.getType().size() > 1)\n for (TypeRefComponent t : outcome.getType()) {\n if (!t.getCode().equals(\"String_Node_Str\"))\n throw new DefinitionException(diffMatches.get(0).getPath() + \"String_Node_Str\" + differential.getElement().get(diffCursor).getPath() + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName);\n }\n TypeRefComponent t = outcome.getType().get(0);\n if (t.getCode().equals(\"String_Node_Str\")) {\n int baseStart = base.getElement().indexOf(currentBase) + 1;\n int baseMax = baseStart + 1;\n while (baseMax < base.getElement().size() && base.getElement().get(baseMax).getPath().startsWith(currentBase.getPath() + \"String_Node_Str\")) baseMax++;\n int start = diffCursor;\n while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath() + \"String_Node_Str\")) diffCursor++;\n processPaths(indent + \"String_Node_Str\", result, base, differential, baseStart, start - 1, baseMax - 1, diffCursor - 1, url, profileName + pathTail(diffMatches, 0), base.getElement().get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);\n } else {\n StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));\n if (dt == null)\n throw new DefinitionException(diffMatches.get(0).getPath() + \"String_Node_Str\" + differential.getElement().get(diffCursor).getPath() + \"String_Node_Str\" + typeCode(outcome.getType()) + \"String_Node_Str\" + profileName + \"String_Node_Str\");\n contextName = dt.getUrl();\n int start = diffCursor;\n while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath() + \"String_Node_Str\")) diffCursor++;\n processPaths(indent + \"String_Node_Str\", result, dt.getSnapshot(), differential, 1, start - 1, dt.getSnapshot().getElement().size() - 1, diffCursor - 1, url, profileName + pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);\n }\n } else if (outcome.getType().get(0).getCode().equals(\"String_Node_Str\")) {\n StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));\n for (ElementDefinition extEd : dt.getSnapshot().getElement()) {\n if (extEd.getPath().contains(\"String_Node_Str\")) {\n ElementDefinition extUrlEd = updateURLs(url, extEd.copy());\n extUrlEd.setPath(fixedPathDest(outcome.getPath(), extUrlEd.getPath(), null));\n markDerived(extUrlEd);\n result.getElement().add(extUrlEd);\n }\n }\n }\n }\n }\n diffpos++;\n }\n }\n baseCursor++;\n }\n }\n }\n int i = 0;\n for (ElementDefinition e : result.getElement()) {\n i++;\n if (e.hasMinElement() && e.getMinElement().getValue() == null)\n throw new Error(\"String_Node_Str\");\n }\n return res;\n}\n"
|
"private String getBookmark(String url) {\n int start = url.indexOf(BOOKMARK_URL_PREFIX);\n int end = -1;\n if (start != -1) {\n start += BOOKMARK_URL_PREFIX.length();\n end = url.indexOf(\"String_Node_Str\", start);\n if (end == -1) {\n end = url.length();\n }\n return url.substring(start, end);\n } else if (url.startsWith(BOOKMARK_ANCHOR_PREFIX)) {\n start = BOOKMARK_ANCHOR_PREFIX.length();\n end = url.length();\n return url.substring(start, end);\n } else if (url.startsWith(BOOKMARK_JAVASCRIPT_PREFIX) && url.endsWith(\"String_Node_Str\")) {\n start = BOOKMARK_JAVASCRIPT_PREFIX.length();\n end = url.length() - 2;\n return url.substring(start, end);\n }\n return null;\n}\n"
|
"public void run() {\n while (!executorIsShutdown()) {\n final TmfExperiment experiment = TmfExperiment.getCurrentExperiment();\n if (experiment != null) {\n final TmfEventRequest request = new TmfEventRequest(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ExecutionType.FOREGROUND) {\n public void handleCompleted() {\n updateJniTrace();\n }\n };\n experiment.sendRequest(request);\n try {\n request.waitForCompletion();\n } catch (final InterruptedException e) {\n }\n } else\n updateJniTrace();\n try {\n Thread.sleep(LTTNG_STREAMING_INTERVAL);\n } catch (final InterruptedException e) {\n }\n }\n}\n"
|
"private void initPackedSlab() {\n packed = new byte[slabSize];\n packedPosition = 0;\n}\n"
|
"List<Redirect> generateRedirects(String key, List<String> registryUrls) {\n List<Redirect> redirects = new ArrayList<Redirect>();\n if (StringUtils.isBlank(key) || !removeEmptyUrlsAndValidate(registryUrls)) {\n logger.error(\"String_Node_Str\" + \"String_Node_Str\", key, registryUrls);\n return redirects;\n }\n key = StringUtils.trim(key);\n key = StringUtils.removeStart(key, \"String_Node_Str\");\n key = StringUtils.removeEnd(key, \"String_Node_Str\");\n String[] splits = StringUtils.split(key, AS_START_END_SEPARATOR);\n if (splits.length != 2) {\n LOGGER.error(\"String_Node_Str\", Arrays.toString(splits));\n return redirects;\n }\n Long startAsNumber = 0L;\n Long endAsNumber = 0L;\n try {\n startAsNumber = Long.parseLong(StringUtils.trim(splits[0]));\n endAsNumber = Long.parseLong(StringUtils.trim(splits[1]));\n } catch (Exception e) {\n LOGGER.error(\"String_Node_Str\", new Object[] { splits[0], splits[1], e });\n LOGGER.error(\"String_Node_Str\", key, registryUrls);\n return redirects;\n }\n AutnumRedirect autnumRedirect = new AutnumRedirect(startAsNumber, endAsNumber, registryUrls);\n redirects.add(autnumRedirect);\n return redirects;\n}\n"
|
"private static String generateDiffHtml(String diffSource, String backgroundColor, String skin, boolean wrap) {\n return \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + skin + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + backgroundColor + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + backgroundColor + \"String_Node_Str\" + \"String_Node_Str\" + (wrap ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + \"String_Node_Str\" + (wrap ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + parseDiffSource(formatCode(diffSource), wrap) + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n}\n"
|
"public boolean hasNonScalar() {\n return objs != null || EnumType.hasNonScalar(enums);\n}\n"
|
"static ObjectName createObjectName(final String domain, final PathAddress pathAddress) {\n if (pathAddress.size() == 0) {\n return ModelControllerMBeanHelper.createRootObjectName(domain);\n }\n final StringBuilder sb = new StringBuilder(domain);\n sb.append(\"String_Node_Str\");\n boolean first = true;\n for (PathElement element : pathAddress) {\n if (first) {\n first = false;\n } else {\n sb.append(\"String_Node_Str\");\n }\n escapeKey(ESCAPED_KEY_CHARACTERS, sb, element.getKey());\n sb.append(\"String_Node_Str\");\n escapeValue(sb, element.getValue());\n }\n try {\n return ObjectName.getInstance(sb.toString());\n } catch (MalformedObjectNameException e) {\n throw MESSAGES.cannotCreateObjectName(e, pathAddress, sb.toString());\n }\n}\n"
|
"protected void updateMask(BitSet todo, List<IRow> data, BitSet mask) {\n String regex = \"String_Node_Str\" + filter.replace(\"String_Node_Str\", \"String_Node_Str\") + \"String_Node_Str\";\n for (int i = todo.nextSetBit(0); i >= 0; i = todo.nextSetBit(i + 1)) {\n String v = this.data.apply(data.get(i));\n mask.set(i, Pattern.matches(regex, v));\n }\n}\n"
|
"private void updateWeightedNormaliser() {\n if (normaliser == null) {\n float[] normalisation = weights.clone();\n KernelFilter kf = new KernelFilter(kernel, kw, kh, scale);\n kf.convolve(normalisation, weightWidth, weightHeight);\n normaliser = new PerPixelNormaliser(normalisation);\n }\n}\n"
|
"public void testAddNaradowskyFeatures() {\n CoNLL09Sentence sent = getSpanishConll09Sentence1();\n Alphabet<String> alphabet = new Alphabet<String>();\n SentFeatureExtractorPrm prm = new SentFeatureExtractorPrm();\n prm.useGoldSyntax = true;\n CorpusStatistics cs = new CorpusStatistics(prm);\n cs.init(Utilities.getList(sent));\n SentFeatureExtractor fe = new SentFeatureExtractor(prm, sent, cs, alphabet);\n BinaryStrFVBuilder feats;\n BinaryStrFVBuilder allFeats = new BinaryStrFVBuilder(alphabet);\n for (int i = 0; i < sent.size(); i++) {\n for (int j = 0; j < sent.size(); j++) {\n fe.addNaradowskyPairFeatures(i, j, allFeats);\n }\n }\n for (String f : allFeats) {\n System.out.println(f);\n }\n}\n"
|
"private static void addClassPath(Job job, FileSystem fs, Path hdfsBase) throws IOException {\n HadoopFileUtils.create(job.getConfiguration(), hdfsBase);\n Configuration conf = job.getConfiguration();\n Set<String> existing = getClasspath(conf);\n String cpstr = System.getProperty(\"String_Node_Str\");\n for (String env : cpstr.split(\"String_Node_Str\")) {\n addFilesToClassPath(conf, existing, fs, hdfsBase, env);\n }\n}\n"
|
"public void testPublishAndUnpublishEvaluation() throws Exception {\n ______TS(\"String_Node_Str\");\n restoreTypicalDataInDatastore();\n String[] methodNames = new String[] { \"String_Node_Str\", \"String_Node_Str\" };\n Class<?>[] paramTypes = new Class<?>[] { String.class, String.class };\n Object[] params = new Object[] { \"String_Node_Str\", \"String_Node_Str\" };\n for (int i = 0; i < methodNames.length; i++) {\n verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN, methodNames[i], \"String_Node_Str\", paramTypes, params);\n verifyCannotAccess(USER_TYPE_UNREGISTERED, methodNames[i], \"String_Node_Str\", paramTypes, params);\n verifyCannotAccess(USER_TYPE_STUDENT, methodNames[i], \"String_Node_Str\", paramTypes, params);\n verifyCannotAccess(USER_TYPE_COORD, methodNames[i], \"String_Node_Str\", paramTypes, params);\n verifyCanAccess(USER_TYPE_COORD, methodNames[i], \"String_Node_Str\", paramTypes, params);\n }\n ______TS(\"String_Node_Str\");\n restoreTypicalDataInDatastore();\n loginAsAdmin(\"String_Node_Str\");\n EvaluationData eval1 = dataBundle.evaluations.get(\"String_Node_Str\");\n assertEquals(false, logic.getEvaluation(eval1.course, eval1.name).published);\n eval1.endTime = Common.getDateOffsetToCurrentTime(-1);\n assertEquals(EvalStatus.CLOSED, eval1.getStatus());\n BackDoorLogic backDoorLogic = new BackDoorLogic();\n backDoorLogic.editEvaluation(eval1);\n logic.publishEvaluation(eval1.course, eval1.name);\n assertEquals(true, logic.getEvaluation(eval1.course, eval1.name).published);\n logic.unpublishEvaluation(eval1.course, eval1.name);\n assertEquals(false, logic.getEvaluation(eval1.course, eval1.name).published);\n ______TS(\"String_Node_Str\");\n eval1.endTime = Common.getDateOffsetToCurrentTime(1);\n assertEquals(EvalStatus.OPEN, eval1.getStatus());\n logic.editEvaluation(eval1);\n try {\n logic.publishEvaluation(eval1.course, eval1.name);\n fail();\n } catch (InvalidParametersException e) {\n assertContains(Common.ERRORCODE_PUBLISHED_BEFORE_CLOSING, e.errorCode);\n }\n assertEquals(EvalStatus.OPEN, logic.getEvaluation(eval1.course, eval1.name).getStatus());\n ______TS(\"String_Node_Str\");\n try {\n logic.unpublishEvaluation(eval1.course, eval1.name);\n fail();\n } catch (InvalidParametersException e) {\n assertContains(Common.ERRORCODE_UNPUBLISHED_BEFORE_PUBLISHING, e.errorCode);\n }\n assertEquals(EvalStatus.OPEN, logic.getEvaluation(eval1.course, eval1.name).getStatus());\n ______TS(\"String_Node_Str\");\n try {\n logic.publishEvaluation(\"String_Node_Str\", \"String_Node_Str\");\n fail();\n } catch (EntityDoesNotExistException e) {\n }\n try {\n logic.unpublishEvaluation(\"String_Node_Str\", \"String_Node_Str\");\n fail();\n } catch (EntityDoesNotExistException e) {\n }\n ______TS(\"String_Node_Str\");\n try {\n logic.publishEvaluation(null, \"String_Node_Str\");\n fail();\n } catch (NullPointerException e) {\n assertContains(\"String_Node_Str\", e.getMessage());\n }\n try {\n logic.unpublishEvaluation(\"String_Node_Str\", null);\n fail();\n } catch (NullPointerException e) {\n assertContains(\"String_Node_Str\", e.getMessage().toLowerCase());\n }\n}\n"
|
"public void layout() {\n int orient = (orientation == Orient.VERTICAL) ? JSlider.VERTICAL : JSlider.HORIZONTAL;\n slider = new JSlider(orient, this.min, this.max, Math.max(min, this.value));\n this.managedObject = slider;\n slider.setMajorTickSpacing(this.pageIncrement);\n slider.setSnapToTicks(false);\n slider.setPaintTicks(true);\n slider.addChangeListener(new ChangeListener() {\n public void stateChanged(ChangeEvent arg0) {\n setValue(SwingScale.this.slider.getValue());\n }\n });\n}\n"
|
"private void initInternal(int secureMode) {\n display = eglGetDisplay(EGL_DEFAULT_DISPLAY);\n Assertions.checkState(display != null, \"String_Node_Str\");\n int[] version = new int[2];\n boolean eglInitialized = eglInitialize(display, version, 0, version, 1);\n Assertions.checkState(eglInitialized, \"String_Node_Str\");\n int[] eglAttributes = new int[] { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 0, EGL_CONFIG_CAVEAT, EGL_NONE, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE };\n EGLConfig[] configs = new EGLConfig[1];\n int[] numConfigs = new int[1];\n boolean eglChooseConfigSuccess = eglChooseConfig(display, eglAttributes, 0, configs, 0, 1, numConfigs, 0);\n Assertions.checkState(eglChooseConfigSuccess && numConfigs[0] > 0 && configs[0] != null, \"String_Node_Str\");\n EGLConfig config = configs[0];\n int[] glAttributes;\n if (secureMode == SECURE_MODE_NONE) {\n glAttributes = new int[] { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };\n } else {\n glAttributes = new int[] { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_PROTECTED_CONTENT_EXT, EGL_TRUE, EGL_NONE };\n }\n context = eglCreateContext(display, config, android.opengl.EGL14.EGL_NO_CONTEXT, glAttributes, 0);\n Assertions.checkState(context != null, \"String_Node_Str\");\n EGLSurface surface;\n if (secureMode == SECURE_MODE_SURFACELESS_CONTEXT) {\n surface = EGL14.EGL_NO_SURFACE;\n } else {\n int[] pbufferAttributes;\n if (secureMode == SECURE_MODE_PROTECTED_PBUFFER) {\n pbufferAttributes = new int[] { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_PROTECTED_CONTENT_EXT, EGL_TRUE, EGL_NONE };\n } else {\n pbufferAttributes = new int[] { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE };\n }\n pbuffer = eglCreatePbufferSurface(display, config, pbufferAttributes, 0);\n Assertions.checkState(pbuffer != null, \"String_Node_Str\");\n surface = pbuffer;\n }\n boolean eglMadeCurrent = eglMakeCurrent(display, surface, surface, context);\n Assertions.checkState(eglMadeCurrent, \"String_Node_Str\");\n glGenTextures(1, textureIdHolder, 0);\n surfaceTexture = new SurfaceTexture(textureIdHolder[0]);\n surfaceTexture.setOnFrameAvailableListener(this);\n this.surface = new DummySurface(this, surfaceTexture, secureMode != SECURE_MODE_NONE);\n}\n"
|
"public void storeTeams(ArrayList<Team> teams) {\n Semaphore dbSemaphore = null;\n try {\n dbSemaphore = getSemaphore();\n dbSemaphore.tryAcquire(10, TimeUnit.SECONDS);\n db.beginTransaction();\n for (Team team : teams) {\n try {\n if (!unsafeExists(team.getTeamKey())) {\n db.insert(TABLE_TEAMS, null, team.getParams());\n insertSearchItemTeam(team, false);\n }\n } catch (BasicModel.FieldNotDefinedException e) {\n Log.w(Constants.LOG_TAG, \"String_Node_Str\");\n }\n }\n db.setTransactionSuccessful();\n db.endTransaction();\n } catch (InterruptedException e) {\n Log.w(\"String_Node_Str\", \"String_Node_Str\");\n } finally {\n if (dbSemaphore != null) {\n dbSemaphore.release();\n }\n }\n}\n"
|
"public String getControllerServletUri() {\n return PREFIX + portletWindow.getPortletName();\n}\n"
|
"public double getDistanceTraveled() {\n if (!start.getWorld().equals(end.getWorld())) {\n return 0;\n }\n return start.distance(end);\n}\n"
|
"public static String[] getBranch(String version) {\n version = getMainVersion(version);\n if (versionMap.isEmpty()) {\n getVersionList();\n }\n Collection<String> branch = versionMap.getCollection(version);\n return branch == null ? null : branch.toArray(new String[branch.size()]);\n}\n"
|
"private final int broadcastIntentLocked(ProcessRecord callerApp, String callerPackage, Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle map, String requiredPermission, int appOp, boolean ordered, boolean sticky, int callingPid, int callingUid, int userId) {\n intent = new Intent(intent);\n intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);\n if (DEBUG_BROADCAST_LIGHT)\n Slog.v(TAG, (sticky ? \"String_Node_Str\" : \"String_Node_Str\") + intent + \"String_Node_Str\" + ordered + \"String_Node_Str\" + userId);\n if ((resultTo != null) && !ordered) {\n Slog.w(TAG, \"String_Node_Str\" + intent + \"String_Node_Str\");\n }\n userId = handleIncomingUser(callingPid, callingUid, userId, true, false, \"String_Node_Str\", callerPackage);\n if (userId != UserHandle.USER_ALL && mStartedUsers.get(userId) == null) {\n if (callingUid != Process.SYSTEM_UID || (intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) == 0) {\n Slog.w(TAG, \"String_Node_Str\" + intent + \"String_Node_Str\" + userId + \"String_Node_Str\");\n return ActivityManager.BROADCAST_SUCCESS;\n }\n }\n int callingAppId = UserHandle.getAppId(callingUid);\n if (callingAppId == Process.SYSTEM_UID || callingAppId == Process.PHONE_UID || callingAppId == Process.SHELL_UID || callingAppId == Process.BLUETOOTH_UID || callingUid == 0) {\n } else if (callerApp == null || !callerApp.persistent) {\n try {\n if (AppGlobals.getPackageManager().isProtectedBroadcast(intent.getAction())) {\n String msg = \"String_Node_Str\" + intent.getAction() + \"String_Node_Str\" + callingPid + \"String_Node_Str\" + callingUid;\n Slog.w(TAG, msg);\n throw new SecurityException(msg);\n } else if (AppWidgetManager.ACTION_APPWIDGET_CONFIGURE.equals(intent.getAction())) {\n if (callerApp == null) {\n String msg = \"String_Node_Str\" + intent.getAction() + \"String_Node_Str\";\n Slog.w(TAG, msg);\n throw new SecurityException(msg);\n } else if (intent.getComponent() != null) {\n if (!intent.getComponent().getPackageName().equals(callerApp.info.packageName)) {\n String msg = \"String_Node_Str\" + intent.getAction() + \"String_Node_Str\" + intent.getComponent().getPackageName() + \"String_Node_Str\" + callerApp.info.packageName;\n Slog.w(TAG, msg);\n throw new SecurityException(msg);\n }\n } else {\n intent.setPackage(callerApp.info.packageName);\n }\n }\n } catch (RemoteException e) {\n Slog.w(TAG, \"String_Node_Str\", e);\n return ActivityManager.BROADCAST_SUCCESS;\n }\n }\n final boolean uidRemoved = Intent.ACTION_UID_REMOVED.equals(intent.getAction());\n if (Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction()) || Intent.ACTION_PACKAGE_CHANGED.equals(intent.getAction()) || Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(intent.getAction()) || uidRemoved) {\n if (checkComponentPermission(android.Manifest.permission.BROADCAST_PACKAGE_REMOVED, callingPid, callingUid, -1, true) == PackageManager.PERMISSION_GRANTED) {\n if (uidRemoved) {\n final Bundle intentExtras = intent.getExtras();\n final int uid = intentExtras != null ? intentExtras.getInt(Intent.EXTRA_UID) : -1;\n if (uid >= 0) {\n BatteryStatsImpl bs = mBatteryStatsService.getActiveStatistics();\n synchronized (bs) {\n bs.removeUidStatsLocked(uid);\n }\n mAppOpsService.uidRemoved(uid);\n }\n } else {\n if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(intent.getAction())) {\n String[] list = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);\n if (list != null && (list.length > 0)) {\n for (String pkg : list) {\n forceStopPackageLocked(pkg, -1, false, true, true, false, false, userId, \"String_Node_Str\");\n }\n sendPackageBroadcastLocked(IApplicationThread.EXTERNAL_STORAGE_UNAVAILABLE, list, userId);\n }\n } else {\n Uri data = intent.getData();\n String ssp;\n if (data != null && (ssp = data.getSchemeSpecificPart()) != null) {\n boolean removed = Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction());\n if (!intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false)) {\n forceStopPackageLocked(ssp, UserHandle.getAppId(intent.getIntExtra(Intent.EXTRA_UID, -1)), false, true, true, false, userId, removed ? \"String_Node_Str\" : \"String_Node_Str\");\n }\n if (removed) {\n sendPackageBroadcastLocked(IApplicationThread.PACKAGE_REMOVED, new String[] { ssp }, userId);\n if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {\n mAppOpsService.packageRemoved(intent.getIntExtra(Intent.EXTRA_UID, -1), ssp);\n removeUriPermissionsForPackageLocked(ssp, userId, true);\n }\n }\n }\n }\n }\n } else {\n String msg = \"String_Node_Str\" + intent.getAction() + \"String_Node_Str\" + callerPackage + \"String_Node_Str\" + callingPid + \"String_Node_Str\" + callingUid + \"String_Node_Str\" + \"String_Node_Str\" + android.Manifest.permission.BROADCAST_PACKAGE_REMOVED;\n Slog.w(TAG, msg);\n throw new SecurityException(msg);\n }\n } else if (Intent.ACTION_PACKAGE_ADDED.equals(intent.getAction())) {\n Uri data = intent.getData();\n String ssp;\n if (data != null && (ssp = data.getSchemeSpecificPart()) != null) {\n mCompatModePackages.handlePackageAddedLocked(ssp, intent.getBooleanExtra(Intent.EXTRA_REPLACING, false));\n }\n }\n if (intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {\n mHandler.sendEmptyMessage(UPDATE_TIME_ZONE);\n }\n if (intent.ACTION_CLEAR_DNS_CACHE.equals(intent.getAction())) {\n mHandler.sendEmptyMessage(CLEAR_DNS_CACHE_MSG);\n }\n if (Proxy.PROXY_CHANGE_ACTION.equals(intent.getAction())) {\n ProxyProperties proxy = intent.getParcelableExtra(\"String_Node_Str\");\n mHandler.sendMessage(mHandler.obtainMessage(UPDATE_HTTP_PROXY_MSG, proxy));\n }\n if (sticky) {\n if (checkPermission(android.Manifest.permission.BROADCAST_STICKY, callingPid, callingUid) != PackageManager.PERMISSION_GRANTED) {\n String msg = \"String_Node_Str\" + callingPid + \"String_Node_Str\" + callingUid + \"String_Node_Str\" + android.Manifest.permission.BROADCAST_STICKY;\n Slog.w(TAG, msg);\n throw new SecurityException(msg);\n }\n if (requiredPermission != null) {\n Slog.w(TAG, \"String_Node_Str\" + intent + \"String_Node_Str\" + requiredPermission);\n return ActivityManager.BROADCAST_STICKY_CANT_HAVE_PERMISSION;\n }\n if (intent.getComponent() != null) {\n throw new SecurityException(\"String_Node_Str\");\n }\n if (userId != UserHandle.USER_ALL) {\n ArrayMap<String, ArrayList<Intent>> stickies = mStickyBroadcasts.get(UserHandle.USER_ALL);\n if (stickies != null) {\n ArrayList<Intent> list = stickies.get(intent.getAction());\n if (list != null) {\n int N = list.size();\n int i;\n for (i = 0; i < N; i++) {\n if (intent.filterEquals(list.get(i))) {\n throw new IllegalArgumentException(\"String_Node_Str\" + intent + \"String_Node_Str\" + userId + \"String_Node_Str\");\n }\n }\n }\n }\n }\n ArrayMap<String, ArrayList<Intent>> stickies = mStickyBroadcasts.get(userId);\n if (stickies == null) {\n stickies = new ArrayMap<String, ArrayList<Intent>>();\n mStickyBroadcasts.put(userId, stickies);\n }\n ArrayList<Intent> list = stickies.get(intent.getAction());\n if (list == null) {\n list = new ArrayList<Intent>();\n stickies.put(intent.getAction(), list);\n }\n int N = list.size();\n int i;\n for (i = 0; i < N; i++) {\n if (intent.filterEquals(list.get(i))) {\n list.set(i, new Intent(intent));\n break;\n }\n }\n if (i >= N) {\n list.add(new Intent(intent));\n }\n }\n int[] users;\n if (userId == UserHandle.USER_ALL) {\n users = mStartedUserArray;\n } else {\n users = new int[] { userId };\n }\n List receivers = null;\n List<BroadcastFilter> registeredReceivers = null;\n if ((intent.getFlags() & Intent.FLAG_RECEIVER_REGISTERED_ONLY) == 0) {\n receivers = collectReceiverComponents(intent, resolvedType, users);\n }\n if (intent.getComponent() == null) {\n registeredReceivers = mReceiverResolver.queryIntent(intent, resolvedType, false, userId);\n }\n final boolean replacePending = (intent.getFlags() & Intent.FLAG_RECEIVER_REPLACE_PENDING) != 0;\n if (DEBUG_BROADCAST)\n Slog.v(TAG, \"String_Node_Str\" + intent.getAction() + \"String_Node_Str\" + replacePending);\n int NR = registeredReceivers != null ? registeredReceivers.size() : 0;\n if (!ordered && NR > 0) {\n final BroadcastQueue queue = broadcastQueueForIntent(intent);\n BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp, callerPackage, callingPid, callingUid, resolvedType, requiredPermission, appOp, registeredReceivers, resultTo, resultCode, resultData, map, ordered, sticky, false, userId);\n if (DEBUG_BROADCAST)\n Slog.v(TAG, \"String_Node_Str\" + r);\n final boolean replaced = replacePending && queue.replaceParallelBroadcastLocked(r);\n if (!replaced) {\n queue.enqueueParallelBroadcastLocked(r);\n queue.scheduleBroadcastsLocked();\n }\n registeredReceivers = null;\n NR = 0;\n }\n int ir = 0;\n if (receivers != null) {\n String[] skipPackages = null;\n if (Intent.ACTION_PACKAGE_ADDED.equals(intent.getAction()) || Intent.ACTION_PACKAGE_RESTARTED.equals(intent.getAction()) || Intent.ACTION_PACKAGE_DATA_CLEARED.equals(intent.getAction())) {\n Uri data = intent.getData();\n if (data != null) {\n String pkgName = data.getSchemeSpecificPart();\n if (pkgName != null) {\n skipPackages = new String[] { pkgName };\n }\n }\n } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(intent.getAction())) {\n skipPackages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);\n }\n if (skipPackages != null && (skipPackages.length > 0)) {\n for (String skipPackage : skipPackages) {\n if (skipPackage != null) {\n int NT = receivers.size();\n for (int it = 0; it < NT; it++) {\n ResolveInfo curt = (ResolveInfo) receivers.get(it);\n if (curt.activityInfo.packageName.equals(skipPackage)) {\n receivers.remove(it);\n it--;\n NT--;\n }\n }\n }\n }\n }\n int NT = receivers != null ? receivers.size() : 0;\n int it = 0;\n ResolveInfo curt = null;\n BroadcastFilter curr = null;\n while (it < NT && ir < NR) {\n if (curt == null) {\n curt = (ResolveInfo) receivers.get(it);\n }\n if (curr == null) {\n curr = registeredReceivers.get(ir);\n }\n if (curr.getPriority() >= curt.priority) {\n receivers.add(it, curr);\n ir++;\n curr = null;\n it++;\n NT++;\n } else {\n it++;\n curt = null;\n }\n }\n }\n while (ir < NR) {\n if (receivers == null) {\n receivers = new ArrayList();\n }\n receivers.add(registeredReceivers.get(ir));\n ir++;\n }\n if ((receivers != null && receivers.size() > 0) || resultTo != null) {\n BroadcastQueue queue = broadcastQueueForIntent(intent);\n BroadcastRecord r = new BroadcastRecord(queue, intent, callerApp, callerPackage, callingPid, callingUid, resolvedType, requiredPermission, appOp, receivers, resultTo, resultCode, resultData, map, ordered, sticky, false, userId);\n if (DEBUG_BROADCAST)\n Slog.v(TAG, \"String_Node_Str\" + r + \"String_Node_Str\" + queue.mOrderedBroadcasts.size());\n if (DEBUG_BROADCAST) {\n int seq = r.intent.getIntExtra(\"String_Node_Str\", -1);\n Slog.i(TAG, \"String_Node_Str\" + r.intent.getAction() + \"String_Node_Str\" + seq);\n }\n boolean replaced = replacePending && queue.replaceOrderedBroadcastLocked(r);\n if (!replaced) {\n queue.enqueueOrderedBroadcastLocked(r);\n queue.scheduleBroadcastsLocked();\n }\n }\n return ActivityManager.BROADCAST_SUCCESS;\n}\n"
|
"public void run() {\n tree.setFocus();\n}\n"
|
"public int executeUpdate(SqlCompiledQuery aQuery, Consumer<Integer> onSuccess, Consumer<Exception> onFailure) throws Exception {\n Callable<Integer> doWork = () -> {\n int rowsAffected = 0;\n DataSource dataSource = obtainDataSource(aQuery.getDatasourceName());\n if (dataSource != null) {\n try (Connection connection = dataSource.getConnection()) {\n boolean autoCommit = connection.getAutoCommit();\n try {\n rowsAffected += stmt.executeUpdate();\n connection.commit();\n } catch (SQLException ex) {\n connection.rollback();\n throw ex;\n }\n }\n }\n return rowsAffected;\n };\n if (onSuccess != null) {\n Scripts.Space space = Scripts.getSpace();\n startJdbcTask(() -> {\n try {\n Integer affected = doWork.call();\n space.process(() -> {\n onSuccess.accept(affected);\n });\n } catch (Exception ex) {\n if (onFailure != null) {\n space.process(() -> {\n onFailure.accept(ex);\n });\n }\n }\n });\n return 0;\n } else {\n return doWork.call();\n }\n}\n"
|
"public void pickSuggestionManually(int index, CharSequence suggestion) {\n final boolean correcting = TextEntryState.isCorrecting();\n final InputConnection ic = getCurrentInputConnection();\n if (ic != null) {\n ic.beginBatchEdit();\n }\n try {\n if (mCompletionOn && mCompletions != null && index >= 0 && index < mCompletions.length) {\n CompletionInfo ci = mCompletions[index];\n if (ic != null) {\n ic.commitCompletion(ci);\n }\n mCommittedLength = suggestion.length();\n mCommittedWord = suggestion;\n if (mCandidateView != null) {\n mCandidateView.clear();\n }\n return;\n }\n pickSuggestion(suggestion, correcting);\n TextEntryState.acceptedSuggestion(mWord.getTypedWord(), suggestion);\n if (mAutoSpace && !correcting) {\n sendSpace();\n mJustAddedAutoSpace = true;\n }\n mJustAutoAddedWord = false;\n if (index == 0) {\n mJustAutoAddedWord = checkAddToDictionaryWithAutoDictionary(mWord, AutoDictionary.AdditionType.Picked);\n }\n final boolean showingAddToDictionaryHint = (!mJustAutoAddedWord) && index == 0 && (mQuickFixes || mShowSuggestions) && (!mSuggest.isValidWord(suggestion)) && (!mSuggest.isValidWord(suggestion.toString().toLowerCase(getCurrentKeyboard().getLocale())));\n if (showingAddToDictionaryHint) {\n TextEntryState.acceptedSuggestionAddedToDictionary();\n if (mCandidateView != null)\n mCandidateView.showAddToDictionaryHint(suggestion);\n } else if (!TextUtils.isEmpty(mCommittedWord) && !mJustAutoAddedWord) {\n setSuggestions(mSuggest.getNextSuggestions(mCommittedWord, mWord.isAllUpperCase()), false, false, false);\n mWord.setFirstCharCapitalized(false);\n }\n } finally {\n if (ic != null) {\n ic.endBatchEdit();\n }\n }\n}\n"
|
"private void applyStyles(Chart model, StyledComponent type, EObject component, IStyleProcessor externalProcessor) {\n if (component instanceof Block) {\n if (component.eContainer() instanceof Chart) {\n IStyle style = getMingledStyle(model, type, externalProcessor);\n ColorDefinition newBackcolor = style.getBackgroundColor();\n Image newBackimage = style.getBackgroundImage();\n Fill background = ((Block) component).getBackground();\n if (background == null) {\n if (newBackcolor != null) {\n ((Block) component).setBackground(newBackcolor);\n }\n if (newBackimage != null) {\n ((Block) component).setBackground(newBackimage);\n }\n }\n Insets ins = ((Block) component).getInsets();\n Insets padding = style.getPadding();\n if (padding != null) {\n if (ins == null) {\n ins = goFactory.createInsets(0, 0, 0, 0);\n ((Block) component).setInsets(ins);\n ins.setTop(padding.getTop());\n ins.setLeft(padding.getLeft());\n ins.setBottom(padding.getBottom());\n ins.setRight(padding.getRight());\n }\n }\n }\n } else if (component instanceof Text) {\n IStyle style = getMingledStyle(model, type, externalProcessor);\n Text text = (Text) component;\n if (text.getFont() == null) {\n text.setFont(style.getFont());\n } else {\n FontDefinition newFont = style.getFont();\n FontDefinition font = text.getFont();\n ChartUtil.mergeFont(font, newFont);\n }\n if (text.getColor() == null) {\n text.setColor(style.getColor());\n }\n } else if (component instanceof LineAttributes) {\n if (component.eContainer() instanceof Axis) {\n LineAttributes lia = (LineAttributes) component;\n if (lia.getColor() == null) {\n IStyle style = getMingledStyle(model, type, externalProcessor);\n lia.setColor(style.getColor());\n }\n }\n } else if (component instanceof Axis) {\n Axis axis = (Axis) component;\n if (axis.getFormatSpecifier() == null) {\n IStyle style = getMingledStyle(model, type, externalProcessor);\n switch(axis.getType()) {\n case DATE_TIME_LITERAL:\n axis.setFormatSpecifier(style.getDateTimeFormat());\n break;\n case LINEAR_LITERAL:\n case LOGARITHMIC_LITERAL:\n axis.setFormatSpecifier(style.getNumberFormat());\n break;\n case TEXT_LITERAL:\n axis.setFormatSpecifier(style.getStringFormat());\n break;\n }\n }\n }\n}\n"
|
"private final int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, String what, Object obj, ProcessRecord srcApp) {\n app.lastActivityTime = now;\n if (app.activities.size() > 0) {\n return index;\n }\n int lrui = mLruProcesses.lastIndexOf(app);\n if (lrui < 0) {\n Log.wtf(TAG, \"String_Node_Str\" + app + \"String_Node_Str\" + what + \"String_Node_Str\" + obj + \"String_Node_Str\" + srcApp);\n return index;\n }\n if (lrui >= mLruProcessActivityStart) {\n return index;\n }\n mLruProcesses.remove(lrui);\n if (index > 0) {\n index--;\n }\n mLruProcesses.add(index, app);\n return index;\n}\n"
|
"private static int collectSlavesToRemove(List<ElasticBoxSlave> slavesToRemove) throws IOException {\n ElasticBoxCloud cloud = ElasticBoxCloud.getInstance();\n Client ebClient = new Client(cloud.getEndpointUrl(), cloud.getUsername(), cloud.getPassword());\n int numOfInstances = 0;\n for (Node node : Jenkins.getInstance().getNodes()) {\n if (node instanceof ElasticBoxSlave && !isSlaveInQueue((ElasticBoxSlave) node, incomingQueue)) {\n final ElasticBoxSlave slave = (ElasticBoxSlave) node;\n if (slave.isSingleUse() && slave.canTerminate() && slave.getComputer() != null) {\n boolean remove = true;\n for (hudson.model.Queue.BuildableItem item : Jenkins.getInstance().getQueue().getBuildableItems(slave.getComputer())) {\n if (!item.getFuture().isCancelled()) {\n remove = false;\n break;\n }\n ;\n }\n if (remove) {\n slavesToRemove.add(slave);\n break;\n }\n }\n if (slave.getInstanceUrl() != null) {\n try {\n JSONObject instance = ebClient.getInstance(slave.getInstanceId());\n String state = instance.getString(\"String_Node_Str\");\n if (Client.InstanceState.DONE.equals(state) && Client.TERMINATE_OPERATIONS.contains(instance.getString(\"String_Node_Str\"))) {\n addToTerminatedQueue(slave);\n } else if (Client.InstanceState.UNAVAILABLE.equals(state) || (slave.canTerminate() && !isSlaveInQueue(slave, submittedQueue))) {\n Logger.getLogger(ElasticBoxSlaveHandler.class.getName()).log(Level.INFO, MessageFormat.format(\"String_Node_Str\", slave.getInstanceUrl()));\n slavesToRemove.add(slave);\n } else {\n numOfInstances++;\n }\n } catch (ClientException ex) {\n if (ex.getStatusCode() == HttpStatus.SC_NOT_FOUND) {\n slavesToRemove.add(slave);\n }\n }\n } else if (!slave.isInUse()) {\n slavesToRemove.add(slave);\n }\n }\n }\n return numOfInstances;\n}\n"
|
"private void handleClientMovement() {\n double d = calculateSpeed();\n handlePlatformMovement(d);\n if (bounds != null) {\n EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;\n AxisAlignedBB aabb = getAABBAboveElevator(d);\n boolean on = Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().intersectsWith(aabb);\n if (on) {\n player.setPosition(player.posX, movingY + 1, player.posZ);\n }\n }\n}\n"
|
"public static HazelcastInstance createInstance(final FilterConfig filterConfig, final Properties properties) throws ServletException {\n final String instanceName = properties.getProperty(INSTANCE_NAME);\n final String configLocation = properties.getProperty(CONFIG_LOCATION);\n final String useClientProp = properties.getProperty(USE_CLIENT);\n final String clientConfigLocation = properties.getProperty(CLIENT_CONFIG_LOCATION);\n final boolean useClient = !isEmpty(useClientProp) && Boolean.parseBoolean(useClientProp);\n URL configUrl = null;\n if (useClient && !isEmpty(clientConfigLocation)) {\n configUrl = getConfigURL(filterConfig, clientConfigLocation);\n } else if (!isEmpty(configLocation)) {\n configUrl = getConfigURL(filterConfig, configLocation);\n }\n if (useClient) {\n boolean isSticky = Boolean.valueOf(properties.getProperty(STICKY_SESSION_CONFIG));\n return createClientInstance(sessionService, instanceName, configUrl, isSticky);\n }\n Config config;\n if (configUrl == null) {\n config = new XmlConfigBuilder().build();\n } else {\n try {\n config = new UrlXmlConfig(configUrl);\n } catch (IOException e) {\n throw new ServletException(e);\n }\n }\n return createHazelcastInstance(instanceName, config);\n}\n"
|
"private static void findHelpers() {\n Class[] classes = { AppleCoreHelper.class, BluePowerHelper.class, ChocoCraftHelper.class, ExNihiloHelper.class, HarvestcraftHelper.class, HungerOverhaulHelper.class, MagicalCropsHelper.class, MFRHelper.class, MinetweakerHelper.class, NaturaHelper.class, PlantMegaPackHelper.class, PsychedelicraftHelper.class, ThaumcraftHelper.class, WailaHelper.class, WeeeFlowersHelper.class };\n for (Class clazz : classes) {\n if (ModHelper.class.isAssignableFrom(clazz)) {\n createInstance(clazz);\n }\n }\n}\n"
|
"public boolean isAssignableFrom(IType type, ITypeContext typeContext) {\n if (!Types.isSuperType(this.getSafeUpperBound().getConcreteType(typeContext), type)) {\n return false;\n }\n final IType lowerBound = this.getLowerBound();\n return lowerBound == null || Types.isSuperType(type, lowerBound.getConcreteType(typeContext));\n}\n"
|
"public void onMouseDown(Widget sender, int x, int y) {\n dragging = true;\n DOM.setCapture(getElement());\n dragStartX = x;\n dragStartY = y;\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n Player targetPlayer = game.getPlayer(source.getFirstTarget());\n MageObject sourceObject = game.getObject(source.getSourceId());\n Card card = null;\n if (controller != null && targetPlayer != null && sourceObject != null) {\n TargetCard targetCard = new TargetCard(Zone.HAND, new FilterCard());\n if (controller.choose(Outcome.Discard, targetPlayer.getHand(), targetCard, game)) {\n card = game.getCard(targetCard.getFirstTarget());\n }\n controller.controlPlayersTurn(game, targetPlayer.getId());\n while (controller != null && controller.canRespond()) {\n if (controller.chooseUse(Outcome.Benefit, \"String_Node_Str\" + sourceObject.getLogName() + \"String_Node_Str\" + (card != null ? \"String_Node_Str\" + card.getLogName() : \"String_Node_Str\") + '?', source, game)) {\n break;\n }\n }\n if (card != null) {\n RestrictionEffect effect = new WordOfCommandCantActivateEffect();\n effect.setTargetPointer(new FixedTarget(targetPlayer.getId()));\n game.addEffect(effect, source);\n ManaPool manaPool = targetPlayer.getManaPool();\n manaPool.setForcedToPay(true);\n int bookmark = game.bookmarkState();\n if ((card.isLand() && (!targetPlayer.canPlayLand() || !game.getActivePlayerId().equals(targetPlayer.getId()))) || !targetPlayer.playCard(card, game, false, true, new MageObjectReference(source.getSourceObject(game), game))) {\n game.informPlayers(targetPlayer.getLogName() + \"String_Node_Str\" + card.getLogName());\n }\n manaPool.setForcedToPay(false);\n manaPool = targetPlayer.getManaPool();\n manaPool.setForcedToPay(false);\n game.removeBookmark(bookmark);\n targetPlayer.resetStoredBookmark(game);\n for (RestrictionEffect eff : game.getContinuousEffects().getRestrictionEffects()) {\n if (eff instanceof WordOfCommandCantActivateEffect) {\n eff.discard();\n }\n }\n game.getContinuousEffects().removeInactiveEffects(game);\n Spell spell = game.getSpell(card.getId());\n if (spell != null) {\n spell.setCommandedBy(controller.getId());\n }\n }\n Spell wordOfCommand = game.getSpell(source.getSourceId());\n if (wordOfCommand != null) {\n wordOfCommand.setCommandedBy(controller.getId());\n } else {\n controller.resetOtherTurnsControlled();\n targetPlayer.setGameUnderYourControl(true);\n }\n return true;\n }\n return false;\n}\n"
|
"public static void scrollToPrecent(ScrollUtil.Direction direction, int precentRate) {\n AndroidDriver<AndroidElement> driver = DriverManger.getDriver();\n int width = ScreenUtil.getDeviceWidth() - 1;\n int height = ScreenUtil.getDeviceHeight() - 1;\n switch(direction) {\n case UP:\n driver.swipe(width / 2, height, width / 2, height * precentRate / 100, SCROLL_TIME);\n break;\n case DOWN:\n driver.swipe(width / 2, width * precentRate / 100, width / 2, 1, SCROLL_TIME);\n break;\n case LEFT:\n driver.swipe(width, height / 2, (int) (width * (1 - precentRate / 100.0)), height / 2, SCROLL_TIME);\n break;\n case RIGHT:\n driver.swipe(1, height / 2, width * precentRate / 100, height / 2, SCROLL_TIME);\n break;\n default:\n break;\n }\n}\n"
|
"protected boolean traverseChildren() {\n boolean hasNextPage = false;\n if (child != null) {\n hasNextPage = child.layout();\n if (hasNextPage) {\n if (currentChild.isFinished()) {\n currentChild = null;\n }\n return true;\n }\n }\n while (executor.hasNextChild()) {\n IReportItemExecutor childExecutor = executor.getNextChild();\n if (childExecutor != null) {\n if (layoutChildNode(childExecutor)) {\n return true;\n }\n }\n }\n return false;\n}\n"
|
"public void doSetInput() {\n List<CatalogIndicator> indicatorList = null;\n if (this.analysis.getResults().getIndicators().size() > 0) {\n indicatorList = getCatalogIndicators();\n if (indicatorList.size() == 0) {\n catalogTableViewer.setInput(getSchemaIndicators());\n } else {\n catalogTableViewer.setInput(indicatorList);\n }\n } else {\n indicatorList = new ArrayList<CatalogIndicator>();\n }\n}\n"
|
"public void onMatrixError(MatrixError e) {\n Log.e(LOG_TAG, \"String_Node_Str\" + userId + \"String_Node_Str\" + e.getMessage());\n}\n"
|
"void synchronizeModelEntry(final IProgressMonitor monitor) {\n final IFile workspaceFile = findFileInWorkspace();\n if (workspaceFile == null)\n return;\n clean();\n try {\n final Resource model = findModel();\n if (ModelUtil.isPhysical(model)) {\n final ModelResource mr = ModelerCore.getModelEditor().findModelResource(workspaceFile);\n final String translator = new ConnectionInfoHelper().getTranslatorName(mr);\n this.translator.set(translator == null ? EMPTY_STR : translator);\n }\n IPath indexPath = new Path(IndexUtil.INDEX_PATH + indexName);\n File indexFile = indexPath.toFile();\n long indexDate = -1;\n if (indexFile.exists()) {\n indexDate = indexFile.lastModified();\n }\n if (workspaceFile.getLocalTimeStamp() > indexDate) {\n getVdb().getBuilder().buildResources(monitor, Collections.singleton(workspaceFile), ModelerCore.getModelContainer(), false);\n }\n for (final IMarker marker : workspaceFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) {\n Object attr = marker.getAttribute(IMarker.SEVERITY);\n if (attr == null) {\n continue;\n }\n final int severity = ((Integer) attr).intValue();\n if (severity == IMarker.SEVERITY_ERROR || severity == IMarker.SEVERITY_WARNING) {\n problems.add(new Problem(marker));\n }\n }\n if (!getVdb().isPreview()) {\n Resource[] refs = getFinder().findReferencesFrom(model, true, false);\n if (refs != null) {\n for (final Resource importedModel : refs) {\n java.net.URI uri = URIUtil.fromString(importedModel.getURI().toString());\n IFile[] modelFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri);\n final IPath name = modelFiles[0].getFullPath();\n VdbModelEntry importedEntry = null;\n for (final VdbModelEntry entry : getVdb().getModelEntries()) {\n if (name.equals(entry.getName())) {\n importedEntry = entry;\n break;\n }\n }\n if (importedEntry == null)\n importedEntry = getVdb().addModelEntry(name, monitor);\n imports.add(importedEntry);\n importedEntry.importedBy.add(this);\n }\n }\n }\n final Index index = IndexUtil.getIndexFile(indexName, IndexUtil.INDEX_PATH + indexName, getName().lastSegment());\n FileUtils.copy(index.getIndexFile(), getIndexFile().getParentFile(), true);\n } catch (final Exception error) {\n throw CoreModelerPlugin.toRuntimeException(error);\n }\n}\n"
|
"public static MyPetMonsterExperience getMonsterExperience(EntityType type) {\n if (mobExp.containsKey(type)) {\n return mobExp.get(type);\n }\n return unknown;\n}\n"
|
"public EndpointState unfairTransform() {\n EndpointState init = this.clone();\n EndpointState term = ModelState.getTerminal(init);\n Set<EndpointState> seen = new HashSet<>();\n Set<EndpointState> todo = new LinkedHashSet<>();\n todo.add(init);\n while (!todo.isEmpty()) {\n Iterator<EndpointState> i = todo.iterator();\n EndpointState curr = i.next();\n i.remove();\n if (seen.contains(curr)) {\n continue;\n }\n seen.add(curr);\n if (curr.getStateKind() == Kind.OUTPUT && curr.getAllTakeable().size() > 1) {\n {\n Iterator<IOAction> as = curr.getAllTakeable().iterator();\n Iterator<EndpointState> ss = curr.getSuccessors().iterator();\n List<IOAction> cloneas = new LinkedList<>();\n List<EndpointState> cloness = new LinkedList<>();\n while (as.hasNext()) {\n IOAction a = as.next();\n EndpointState s = ss.next();\n if (!s.canReach(curr)) {\n todo.add(s);\n } else {\n EndpointState clone = curr.unfairClone(term, a, s);\n cloneas.add(a);\n cloness.add(clone);\n }\n }\n if (!cloneas.isEmpty()) {\n for (EndpointState s : toRemove.keySet()) {\n try {\n curr.removeEdge(toRemove.get(s), s);\n } catch (ScribbleException e) {\n throw new RuntimeException(e);\n }\n }\n Iterator<IOAction> icloneas = cloneas.iterator();\n Iterator<EndpointState> icloness = cloness.iterator();\n while (icloneas.hasNext()) {\n IOAction a = icloneas.next();\n EndpointState s = icloness.next();\n curr.addEdge(a, s);\n todo.add(s);\n }\n }\n }\n } else {\n todo.addAll(curr.getSuccessors());\n }\n }\n return init;\n}\n"
|
"public Transferable paste() throws IOException {\n QueryNode queryNode = (QueryNode) dropNode;\n FilterController filterController = Lookup.getDefault().lookup(FilterController.class);\n FilterLibrary library = filterController.getModel().getLibrary();\n library.saveQuery(queryNode.getQuery());\n return null;\n}\n"
|
"private void visitInNewContext(List<CssNode> nodes) {\n MergeRulesByContentVisitor v = new MergeRulesByContentVisitor();\n v.acceptWithInsertRemove(nodes);\n rulesInOrder.addAll(v.rulesInOrder);\n}\n"
|
"private ProfileDefn parseProfileSheet(Definitions definitions, ConformancePackage ap, String n, List<String> namedSheets, boolean published) throws Exception {\n Sheet sheet;\n ResourceDefn resource = new ResourceDefn();\n resource.setPublishedInProfile(published);\n sheet = loadSheet(n + \"String_Node_Str\");\n Map<String, Invariant> invariants = null;\n if (sheet != null) {\n invariants = readInvariants(sheet);\n } else {\n invariants = new HashMap<String, Invariant>();\n }\n sheet = loadSheet(n);\n if (sheet == null)\n throw new Exception(\"String_Node_Str\" + n + \"String_Node_Str\");\n for (int row = 0; row < sheet.rows.size(); row++) {\n ElementDefn e = processLine(resource, sheet, row, invariants, true);\n if (e != null)\n for (TypeRef t : e.getTypes()) {\n if (t.getProfile() != null && !t.getName().equals(\"String_Node_Str\") && t.getProfile().startsWith(\"String_Node_Str\")) {\n if (!namedSheets.contains(t.getProfile().substring(1)))\n namedSheets.add(t.getProfile().substring(1));\n }\n }\n }\n sheet = loadSheet(n + \"String_Node_Str\");\n if (sheet != null) {\n int row = 0;\n while (row < sheet.rows.size()) {\n if (sheet.getColumn(row, \"String_Node_Str\").startsWith(\"String_Node_Str\"))\n row++;\n else\n row = processExtension(resource.getRoot().getElementByName(\"String_Node_Str\"), sheet, row, definitions, ap.metadata(\"String_Node_Str\"), ap);\n }\n }\n sheet = loadSheet(n + \"String_Node_Str\");\n if (sheet != null) {\n readSearchParams(resource, sheet, true);\n }\n if (invariants != null) {\n for (Invariant inv : invariants.values()) {\n if (Utilities.noString(inv.getContext()))\n log.log(\"String_Node_Str\" + resource.getRoot().getName() + \"String_Node_Str\" + inv.getId() + \"String_Node_Str\", LogMessageType.Warning);\n else {\n ElementDefn ed = findContext(resource.getRoot(), inv.getContext(), \"String_Node_Str\" + resource.getRoot().getName() + \"String_Node_Str\" + inv.getId() + \"String_Node_Str\");\n if (ed.getName().endsWith(\"String_Node_Str\") && !inv.getContext().endsWith(\"String_Node_Str\"))\n inv.setFixedName(inv.getContext().substring(inv.getContext().lastIndexOf(\"String_Node_Str\") + 1));\n ed.getInvariants().put(inv.getId(), inv);\n if (Utilities.noString(inv.getXpath()))\n log.log(\"String_Node_Str\" + resource.getRoot().getName() + \"String_Node_Str\" + inv.getId() + \"String_Node_Str\" + inv.getEnglish() + \"String_Node_Str\", LogMessageType.Warning);\n else if (inv.getXpath().contains(\"String_Node_Str\"))\n log.log(\"String_Node_Str\" + resource.getRoot().getName() + \"String_Node_Str\" + inv.getId() + \"String_Node_Str\" + inv.getEnglish() + \"String_Node_Str\", LogMessageType.Warning);\n }\n }\n }\n resource.getRoot().setProfileName(n);\n ProfileDefn p = new ProfileDefn(ap.getName() + '-' + n, resource.getName(), resource);\n return p;\n}\n"
|
"public void print(StringBuffer toStringBuffer) {\n toStringBuffer.append(\"String_Node_Str\").append(getLocale()).append(\"String_Node_Str\").append(getEncoding());\n}\n"
|
"public boolean onLongClick(View arg0) {\n chooseAccount();\n return true;\n}\n"
|
"public boolean apply(Game game, Ability source) {\n int numberSpirits = 0;\n for (Cost cost : source.getCosts()) {\n if (cost instanceof SacrificeTargetCost) {\n numberSpirits += ((SacrificeTargetCost) cost).getPermanents().size();\n }\n }\n int amount = 2 + (numberSpirits * 2);\n Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));\n Player sourcePlayer = game.getPlayer(source.getControllerId());\n if (targetPlayer != null && sourcePlayer != null) {\n targetPlayer.loseLife(amount, game, false);\n sourcePlayer.gainLife(amount, game);\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.