content stringlengths 40 137k |
|---|
"public static Collection<String> findLiterals(String query) {\n Collection<String> ret = new HashSet<String>();\n String regex = \"String_Node_Str\";\n String q = query;\n q = q.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n Pattern p = Pattern.compile(regex, Pattern.UNICODE_CHARACTER_CLASS);\n Matcher m = p.matcher(q);\n while (m.find()) {\n String literal = m.group();\n int index = literal.indexOf(\"String_Node_Str\", 3) + 3;\n if (literal.length() > index) {\n if (literal.charAt(index + 1) == '@') {\n index = literal.substring(index + 1).indexOf(\"String_Node_Str\");\n } else if (literal.substring(index + 1, index + 3) == \"String_Node_Str\") {\n index = literal.substring(index + 1).indexOf(\"String_Node_Str\") + 1;\n }\n }\n literal = literal.substring(0, index);\n ret.add(literal);\n q = q.replace(literal, \"String_Node_Str\");\n m = p.matcher(q);\n }\n regex = \"String_Node_Str\";\n p = Pattern.compile(regex, Pattern.UNICODE_CHARACTER_CLASS);\n m = p.matcher(q);\n while (m.find()) {\n String literal = m.group();\n literal = literal.substring(0, literal.length() - 1);\n ret.add(literal);\n q = q.replace(literal, \"String_Node_Str\");\n }\n regex = \"String_Node_Str\";\n p = Pattern.compile(regex, Pattern.UNICODE_CHARACTER_CLASS);\n m = p.matcher(q.replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n while (m.find()) {\n String literal = m.group();\n literal = literal.substring(0, literal.length() - 1);\n ret.add(literal);\n }\n return ret;\n}\n"
|
"public void start() {\n dc.start();\n if (isPresent())\n storeTailer.index = RollingChronicleQueue.index(storeTailer.cycle, toSequenceNumber(storeTailer.index) + 1);\n}\n"
|
"private void updateDatabase() {\n MainFactory mainFactory = new MainFactory(configuration);\n DbMaintainer dbMaintainer = mainFactory.createDbMaintainer();\n return dbMaintainer.updateDatabase(false);\n}\n"
|
"public void actionPerformed(ActionEvent e) {\n if (!isBlank(destinationField.getText())) {\n File currentDir = new File(destinationField.getText());\n while (!currentDir.exists() && !currentDir.isDirectory()) {\n if (currentDir.getParentFile() == null) {\n break;\n }\n currentDir = currentDir.getParentFile();\n }\n fileChooser.setCurrentDirectory(currentDir);\n } else {\n fileChooser.setCurrentDirectory(Settings.get().getLastUsedLocation());\n }\n fileChooser.showOpenDialog(RenderDialog.this);\n if (fileChooser.getSelectedFile() == null) {\n return;\n }\n destinationField.setText(fileChooser.getSelectedFile().getAbsolutePath());\n}\n"
|
"private void updateClipping(StackScrollState resultState, StackScrollAlgorithmState algorithmState) {\n float previousNotificationEnd = 0;\n float previousNotificationStart = 0;\n boolean previousNotificationIsSwiped = false;\n int childCount = algorithmState.visibleChildren.size();\n for (int i = 0; i < childCount; i++) {\n ExpandableView child = algorithmState.visibleChildren.get(i);\n StackScrollState.ViewState state = resultState.getViewStateForView(child);\n float newYTranslation = state.yTranslation + state.height * (1f - state.scale) / 2f;\n float newHeight = state.height * state.scale;\n float newNotificationEnd = newYTranslation + newHeight;\n float clipHeight;\n if (previousNotificationIsSwiped) {\n clipHeight = newHeight;\n } else {\n clipHeight = newNotificationEnd - previousNotificationEnd;\n clipHeight = Math.max(0.0f, clipHeight);\n if (clipHeight != 0.0f) {\n float clippingCorrection = state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;\n clipHeight += clippingCorrection;\n }\n }\n updateChildClippingAndBackground(state, newHeight, clipHeight, newHeight - (previousNotificationStart - newYTranslation));\n if (!child.isTransparent()) {\n previousNotificationStart = newYTranslation + state.clipTopAmount * state.scale;\n previousNotificationEnd = newNotificationEnd;\n previousNotificationIsSwiped = child.getTranslationX() != 0;\n }\n }\n}\n"
|
"public static void setupReplacers() {\n boolean test = false;\n listFoliageReplacers.clear();\n if (!test) {\n HashMap<Comparable, String> lookup = new HashMap<>();\n lookup.clear();\n lookup.put(BlockPlanks.EnumType.OAK, \"String_Node_Str\");\n lookup.put(BlockPlanks.EnumType.SPRUCE, \"String_Node_Str\");\n lookup.put(BlockPlanks.EnumType.BIRCH, \"String_Node_Str\");\n lookup.put(BlockPlanks.EnumType.JUNGLE, \"String_Node_Str\");\n lookup.put(BlockPlanks.EnumType.ACACIA, \"String_Node_Str\");\n lookup.put(BlockPlanks.EnumType.DARK_OAK, \"String_Node_Str\");\n for (Map.Entry<Comparable, String> entrySet : lookup.entrySet()) {\n boolean colorize = false;\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.SAPLING.getDefaultState()).setSprite(getMeshAndSetupSprite(entrySet.getValue())).setStateSensitive(true).setBiomeColorize(colorize).addComparable(BlockSapling.TYPE, entrySet.getKey()));\n }\n lookup.clear();\n lookup.put(BlockTallGrass.EnumType.DEAD_BUSH, \"String_Node_Str\");\n lookup.put(BlockTallGrass.EnumType.GRASS, \"String_Node_Str\");\n lookup.put(BlockTallGrass.EnumType.FERN, \"String_Node_Str\");\n for (Map.Entry<Comparable, String> entrySet : lookup.entrySet()) {\n boolean colorize = entrySet.getKey() == BlockTallGrass.EnumType.DEAD_BUSH ? false : true;\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(entrySet.getValue())).setStateSensitive(true).setBiomeColorize(colorize).addComparable(BlockTallGrass.TYPE, entrySet.getKey()));\n }\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.YELLOW_FLOWER.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBiomeColorize(false));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.RED_FLOWER.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBiomeColorize(false).setStateSensitive(true).addComparable(Blocks.RED_FLOWER.getTypeProperty(), BlockFlower.EnumFlowerType.ALLIUM));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.RED_FLOWER.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBiomeColorize(false).setStateSensitive(true).addComparable(Blocks.RED_FLOWER.getTypeProperty(), BlockFlower.EnumFlowerType.BLUE_ORCHID));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.RED_FLOWER.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBiomeColorize(false).setStateSensitive(true).addComparable(Blocks.RED_FLOWER.getTypeProperty(), BlockFlower.EnumFlowerType.POPPY));\n List<TextureAtlasSprite> sprites = new ArrayList<>();\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.DOUBLE_PLANT.getDefaultState(), 2).setSprites(sprites).setStateSensitive(true).addComparable(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.GRASS));\n sprites = new ArrayList<>();\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.DOUBLE_PLANT.getDefaultState(), 2).setSprites(sprites).setBiomeColorize(false).setStateSensitive(true).addComparable(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.ROSE));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.REEDS.getDefaultState(), -1).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBaseMaterial(Material.SAND).setBiomeColorize(true).setRandomizeCoord(false).setLooseness(0.3F));\n for (int i = 0; i < 8; i++) {\n int temp = i;\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.WHEAT.getDefaultState()).setBaseMaterial(Material.GROUND).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + temp)).setRandomizeCoord(false).setStateSensitive(true).addComparable(BlockCrops.AGE, i));\n }\n HashMap<Integer, Integer> lookupStateToModel = new HashMap<>();\n lookupStateToModel.put(0, 0);\n lookupStateToModel.put(1, 0);\n lookupStateToModel.put(2, 1);\n lookupStateToModel.put(3, 1);\n lookupStateToModel.put(4, 2);\n lookupStateToModel.put(5, 2);\n lookupStateToModel.put(6, 2);\n lookupStateToModel.put(7, 3);\n for (Map.Entry<Integer, Integer> entrySet : lookupStateToModel.entrySet()) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.CARROTS.getDefaultState()).setBaseMaterial(Material.GROUND).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + entrySet.getValue())).setRandomizeCoord(false).setStateSensitive(true).addComparable(BlockCrops.AGE, entrySet.getKey()));\n }\n for (Map.Entry<Integer, Integer> entrySet : lookupStateToModel.entrySet()) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.POTATOES.getDefaultState()).setBaseMaterial(Material.GROUND).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + entrySet.getValue())).setRandomizeCoord(false).setStateSensitive(true).addComparable(BlockCrops.AGE, entrySet.getKey()));\n }\n } else {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")));\n if (true)\n return;\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.YELLOW_FLOWER.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBiomeColorize(false));\n List<TextureAtlasSprite> sprites = new ArrayList<>();\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n sprites.add(getMeshAndSetupSprite(\"String_Node_Str\"));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.DOUBLE_PLANT.getDefaultState(), 2).setSprites(sprites));\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.REEDS.getDefaultState(), -1).setSprite(getMeshAndSetupSprite(\"String_Node_Str\")).setBaseMaterial(Material.SAND).setBiomeColorize(true).setRandomizeCoord(false));\n for (int i = 0; i < 8; i++) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + i)).setRandomizeCoord(false));\n }\n for (int i = 0; i < 4; i++) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + i)).setRandomizeCoord(false));\n }\n HashMap<Integer, Integer> lookupStateToModel = new HashMap<>();\n lookupStateToModel.put(0, 0);\n lookupStateToModel.put(1, 0);\n lookupStateToModel.put(2, 1);\n lookupStateToModel.put(3, 1);\n lookupStateToModel.put(4, 2);\n lookupStateToModel.put(5, 2);\n lookupStateToModel.put(6, 2);\n lookupStateToModel.put(7, 3);\n for (Map.Entry<Integer, Integer> entrySet : lookupStateToModel.entrySet()) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + entrySet.getValue())));\n }\n for (Map.Entry<Integer, Integer> entrySet : lookupStateToModel.entrySet()) {\n listFoliageReplacers.add(new FoliageReplacerCross(Blocks.TALLGRASS.getDefaultState()).setSprite(getMeshAndSetupSprite(\"String_Node_Str\" + entrySet.getValue())));\n }\n }\n}\n"
|
"public String getException() {\n if (this.t != null) {\n return this.t.getMessage();\n }\n}\n"
|
"public String cachedXPathGetString(String xpath, String prefixMappings) throws Docx4JException {\n if (cachedXPathAPI == null) {\n cachedXPathAPI = new CachedXPathAPI();\n cachedXPathAPI.getXPathContext().setNamespaceContext(getNamespaceContext());\n }\n if (cachedPrefixMappings == null && prefixMappings != null) {\n cachedPrefixMappings = prefixMappings;\n getNamespaceContext().registerPrefixMappings(prefixMappings);\n }\n if (prefixMappings != null && !prefixMappings.equals(cachedPrefixMappings)) {\n getNamespaceContext().registerPrefixMappings(prefixMappings);\n }\n try {\n if (xpath.contains(\"String_Node_Str\") || xpath.trim().startsWith(\"String_Node_Str\")) {\n XObject xo = cachedXPathAPI.eval(doc, xpath);\n if (xo.bool(cachedXPathAPI.getXPathContext())) {\n return \"String_Node_Str\";\n } else {\n return \"String_Node_Str\";\n }\n }\n try {\n Node result = cachedXPathAPI.selectSingleNode(doc, xpath);\n return result.getTextContent();\n } catch (org.apache.xpath.XPathException e) {\n if (e.getMessage().contains(\"String_Node_Str\")) {\n log.debug(\"String_Node_Str\" + xpath);\n XObject xo = cachedXPathAPI.eval(doc, xpath);\n if (xo.bool(cachedXPathAPI.getXPathContext())) {\n return \"String_Node_Str\";\n } else {\n return \"String_Node_Str\";\n }\n } else {\n log.warn(\"String_Node_Str\" + xpath);\n throw e;\n }\n }\n } catch (TransformerException e) {\n throw new Docx4JException(\"String_Node_Str\" + xpath, e);\n }\n}\n"
|
"public void fire() throws IllegalActionException {\n super.fire();\n for (int channel = 0; channel < input.getWidth(); channel++) {\n if (input.hasToken(channel)) {\n input.get(channel);\n }\n long time = (long) (_director.getModelTime().getDoubleValue() / _director.localClock.getTimeResolution()) + _director.getRealStartTimeMillis();\n output.send(0, new DateToken(time));\n }\n}\n"
|
"public void addAccount(ProtocolProviderService protocolProvider) {\n StatusSelectorBox protocolStatusCombo;\n int providerIndex = this.mainFrame.getProviderIndex(protocolProvider);\n if (mainFrame.getProtocolPresenceOpSet(protocolProvider) != null) {\n protocolStatusCombo = new PresenceStatusSelectorBox(this.mainFrame, protocolProvider, providerIndex);\n } else {\n protocolStatusCombo = new SimpleStatusSelectorBox(this.mainFrame, protocolProvider, providerIndex);\n }\n protocolStatusCombo.addComponentListener(this);\n boolean isHidden = protocolProvider.getAccountID().getAccountProperties().get(\"String_Node_Str\") != null;\n if (isHidden)\n hiddenProviders++;\n if (protocolStatusCombos.size() - hiddenProviders == 1 && !isHidden) {\n this.globalStatusBox = new GlobalStatusSelectorBox(mainFrame);\n Icon statusSeparatorIcon = new ImageIcon(ImageLoader.getImage(ImageLoader.STATUS_SEPARATOR_ICON));\n this.add(new JLabel(statusSeparatorIcon), FlowLayout.LEFT);\n this.add(globalStatusBox, FlowLayout.LEFT);\n }\n this.protocolStatusCombos.put(protocolProvider, protocolStatusCombo);\n if (!isHidden) {\n this.add(protocolStatusCombo);\n this.getParent().validate();\n }\n}\n"
|
"protected void internalPutProperty(String key, String value) {\n if (key.equals(HOST_NAME) || key.equals(HOST)) {\n if (value == null || value.length() == 0) {\n return;\n }\n if (isEnableHostLookUp) {\n try {\n InetAddress address = java.net.InetAddress.getByName(value);\n String hostName = address.getHostName();\n sessionProperties.put(HOST_NAME, hostName);\n sessionProperties.put(HOST, value);\n } catch (UnknownHostException uhe) {\n debug.error(\"String_Node_Str\" + \"String_Node_Str\" + value + \"String_Node_Str\", uhe);\n }\n } else {\n sessionProperties.put(HOST_NAME, value);\n sessionProperties.put(HOST, value);\n }\n } else if (key.equals(AM_MAX_IDLE_TIME)) {\n setMaxIdleTime(Long.parseLong(value));\n } else {\n sessionProperties.put(key, value);\n }\n if (sessionState == Session.VALID && SessionService.isSendPropertyNotification(key)) {\n SessionService.getSessionService().sendEvent(this, SessionEvent.PROPERTY_CHANGED);\n SessionService.getSessionService().logEvent(this, SessionEvent.PROPERTY_CHANGED);\n }\n updateForFailover();\n}\n"
|
"public boolean equals(JobLauncher otherLauncher) {\n boolean retVal;\n if (this == otherLauncher) {\n return true;\n }\n if (otherLauncher == null || !(otherLauncher instanceof Item) || !super.equals(otherLauncher)) {\n return false;\n }\n JobLauncher launcher = (JobLauncher) otherLauncher;\n retVal = (this.allowedActions.equals(launcher.allowedActions)) && (this.form.equals(launcher.form)) && (this.itemType == launcher.itemType) && (this.status.equals(launcher.status)) && (this.mpiEnabled == launcher.mpiEnabled) && (this.openMPEnabled == launcher.openMPEnabled) && (this.tbbEnabled == launcher.tbbEnabled) && (this.hostsTable.equals(launcher.hostsTable)) && (this.hosts.equals(launcher.hosts));\n if (remoteDownloadDir != null) {\n retVal &= (this.remoteDownloadDir.equals(otherLauncher.remoteDownloadDir));\n }\n if (this.project != null && otherLauncher.project != null && (!(this.project.equals(otherLauncher.project)))) {\n return false;\n }\n if (this.project == null && otherLauncher.project != null || this.project != null && otherLauncher.project == null) {\n return false;\n }\n if (this.executableCommandName != null && otherLauncher.executableCommandName != null && !(this.executableCommandName.equals(otherLauncher.executableCommandName))) {\n return false;\n }\n if (this.actionDataMap != null && otherLauncher.actionDataMap != null && (!(this.actionDataMap.equals(otherLauncher.actionDataMap)))) {\n return false;\n }\n return retVal;\n}\n"
|
"public synchronized GpuAllocation selectCandidateRequestNode(ResourceDescriptor request, String nodeLabel, String nodeGpuType) {\n LOGGER.logDebug(\"String_Node_Str\", request, nodeLabel, nodeGpuType);\n ClusterConfiguration clusterConfiguration = am.getClusterConfiguration();\n Map<String, NodeConfiguration> nodes = clusterConfiguration.getNodes();\n Long requestGpu = request.getGpuAttribute();\n if (requestGpu > 0 && Long.bitCount(requestGpu) != request.getGpuNumber()) {\n LOGGER.logError(\"String_Node_Str\", request.getGpuNumber(), Long.toBinaryString(requestGpu));\n return null;\n }\n GpuAllocation gpuAllocation = null;\n List gpuTypeList = null;\n if (nodeGpuType != null && !nodeGpuType.trim().isEmpty()) {\n gpuTypeList = Arrays.asList(nodeGpuType.split(\"String_Node_Str\"));\n }\n for (Map.Entry<String, Node> entry : candidateRequestNodes.entrySet()) {\n LOGGER.logDebug(\"String_Node_Str\" + entry.getValue().toString());\n if (nodeLabel != null) {\n Set<String> nodeLabels = entry.getValue().getNodeLabels();\n if (nodeLabels != null && nodeLabels.size() > 0 && !nodeLabels.contains(nodeLabel)) {\n LOGGER.logDebug(\"String_Node_Str\", entry.getValue().getHostName(), CommonExtensions.toString(nodeLabels), nodeLabel);\n continue;\n }\n }\n if (gpuTypeList != null) {\n if (nodes.size() > 0) {\n if (!nodes.containsKey(entry.getValue().getHostName())) {\n LOGGER.logWarning(\"String_Node_Str\", entry.getValue().getHostName());\n continue;\n }\n String gpuType = (nodes.get(entry.getValue().getHostName())).getGpuType();\n if (!gpuTypeList.contains(gpuType)) {\n LOGGER.logDebug(\"String_Node_Str\", entry.getValue().getHostName(), gpuType, nodeGpuType);\n continue;\n }\n }\n }\n if (request.getMemoryMB() <= entry.getValue().getAvailableMemory() && request.getCpuNumber() <= entry.getValue().getAvailableCpu() && request.getGpuNumber() <= entry.getValue().getAvailableNumGpus()) {\n if (request.getGpuNumber() > 0) {\n if (candidateGpu > 0) {\n if ((candidateGpu & entry.getValue().getNodeGpuStatus()) != candidateGpu)\n continue;\n } else {\n candidateGpu = selectCandidateGpu(entry.getValue(), request.getGpuNumber());\n if (Long.bitCount(candidateGpu) != request.getGpuNumber()) {\n continue;\n }\n }\n gpuAllocation = new GpuAllocation();\n gpuAllocation.setNodeName(entry.getValue().getHostName());\n gpuAllocation.setGpuBitmap(candidateGpu);\n break;\n }\n }\n }\n if (gpuAllocation != null) {\n LOGGER.logInfo(\"String_Node_Str\" + gpuAllocation.getNodeName() + \"String_Node_Str\" + Long.toBinaryString(gpuAllocation.getGpuBitmap()));\n } else {\n LOGGER.logInfo(\"String_Node_Str\");\n }\n return gpuAllocation;\n}\n"
|
"public static byte[] getFormattedContent(Element formattedItemElement) throws XMLStreamException {\n ByteArrayOutputStream data = new ByteArrayOutputStream((int) Math.pow(2, 10));\n XMLStreamWriter xmlWriter = null;\n try {\n xmlWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(data, \"String_Node_Str\");\n for (Element e : Jaxp.getChildDirects(formattedItemElement)) {\n Jaxp.writeNode(xmlWriter, e, false);\n }\n } finally {\n if (xmlWriter != null) {\n xmlWriter.flush();\n xmlWriter.close();\n }\n }\n return data.toByteArray();\n}\n"
|
"public void onPlayerEnterOnIsland(IslandEnterEvent e) {\n Player player = plugin.getServer().getPlayer(e.getPlayer());\n if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + \"String_Node_Str\") && plugin.getGrid().playerIsOnIsland(player)) {\n player.setAllowFlight(true);\n player.setFlying(true);\n }\n}\n"
|
"private X509Certificate importCertificateFromAppPrivateDir(String packageName) {\n File[] certMatchingFiles = certificateFolder.listFiles(new CertFileFilter(packageName));\n X509Certificate verifiedCertificate = null;\n if (certMatchingFiles != null && certMatchingFiles.length != 0) {\n InputStream inStream = null;\n try {\n inStream = new FileInputStream(certMatchingFiles[0]);\n CertificateFactory cf = CertificateFactory.getInstance(\"String_Node_Str\");\n verifiedCertificate = (X509Certificate) cf.generateCertificate(inStream);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (CertificateException e) {\n e.printStackTrace();\n } finally {\n if (inStream != null) {\n try {\n inStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n if (verifiedCertificate != null) {\n try {\n verifiedCertificate.checkValidity();\n if (verifiedCertificate.getKeyUsage() != null) {\n int keyCertSignIndex = 5;\n if (!verifiedCertificate.getKeyUsage()[keyCertSignIndex])\n throw new CertificateExpiredException(\"String_Node_Str\");\n Log.i(TAG_SECURE_DEX_CLASS_LOADER, verifiedCertificate.getKeyUsage().toString());\n }\n String androidDebugModeDN = \"String_Node_Str\";\n X500Principal androidDebugModePrincipal = new X500Principal(androidDebugModeDN);\n if (verifiedCertificate.getIssuerX500Principal().equals(androidDebugModePrincipal) || verifiedCertificate.getSubjectX500Principal().equals(androidDebugModePrincipal))\n throw new CertificateExpiredException(\"String_Node_Str\");\n } catch (CertificateExpiredException | CertificateNotYetValidException e) {\n verifiedCertificate = null;\n String certFileToErase = certMatchingFiles[0].getName();\n if (certMatchingFiles[0].delete()) {\n Log.i(TAG_SECURE_DEX_CLASS_LOADER, \"String_Node_Str\" + certFileToErase + \"String_Node_Str\");\n } else {\n Log.w(TAG_SECURE_DEX_CLASS_LOADER, \"String_Node_Str\" + certFileToErase + \"String_Node_Str\");\n }\n }\n }\n }\n return verifiedCertificate;\n}\n"
|
"public void handleWeeklyFallingAdherence(MotechEvent motechEvent) {\n String patientDocId = motechEvent.getParameters().get(PATIENT_DOC_ID_KEY).toString();\n Patient patient = allPatients.get(patientDocId);\n TreatmentAdvice treatmentAdvice = allTreatmentAdvices.currentTreatmentAdvice(patient.getId());\n if (fourDayRecallService.isAdherenceCapturedForCurrentWeek(patientDocId, treatmentAdvice.getId()) || isLastRetryDay(motechEvent)) {\n if (fourDayRecallService.hasAdherenceFallingAlertBeenRaisedForCurrentWeek(patientDocId))\n return;\n fourDayRecallService.raiseAdherenceFallingAlert(patientDocId);\n }\n}\n"
|
"public boolean act() {\n charge--;\n if (charge <= 0) {\n detach();\n GLog.w(\"String_Node_Str\");\n }\n exp += 10 + ((Hero) target).lvl;\n if (exp >= level * 50 && level < 26) {\n exp -= level * 50;\n GLog.p(\"String_Node_Str\");\n level++;\n chargeCap++;\n }\n spend(TICK);\n return true;\n}\n"
|
"public boolean isUp() {\n if (State.READY.equals(getState()))\n return true;\n if (getIpAddress() == null)\n return false;\n try {\n ping();\n } catch (Exception e) {\n RuntimeContext.logger.log(Level.SEVERE, \"String_Node_Str\" + config.getName() + \"String_Node_Str\" + e.getMessage());\n RuntimeContext.logger.log(Level.FINE, \"String_Node_Str\" + config.getName(), e);\n return false;\n }\n try {\n connection();\n } catch (VirtException e) {\n RuntimeContext.logger.log(Level.SEVERE, \"String_Node_Str\" + config.getName() + \"String_Node_Str\" + serverPool.getConfig().getUser().getName(), e);\n return false;\n }\n return true;\n}\n"
|
"public boolean isOptimizable(DataHandle handle) {\n if (!(handle instanceof DataHandleOutput)) {\n return false;\n }\n DataHandleOutput output = (DataHandleOutput) handle;\n if (output.getInputBuffer() == null || !output.getInputBuffer().equals(this.manager.getDataGeneralized().getArray())) {\n return false;\n }\n for (PrivacyCriterion c : config.getPrivacyModels()) {\n if (!c.isLocalRecodingSupported()) {\n return false;\n }\n }\n int outliers = 0;\n for (int row = 0; row < output.getNumRows(); row++) {\n if (output.isOutlier(row) && (baselineRowSet == null || baselineRowSet.contains(row))) {\n outliers++;\n }\n }\n if (config.getMinimalGroupSize() != Integer.MAX_VALUE && outliers < config.getMinimalGroupSize()) {\n return false;\n }\n if (outliers == 0) {\n return false;\n }\n return true;\n}\n"
|
"private final void checkAndRethrow() {\n final Throwable t = this.ex.getAndSet(null);\n if (t != null) {\n if (t instanceof Error)\n throw (Error) t;\n if (t instanceof RuntimeException)\n throw (RuntimeException) t;\n else\n throw new RuntimeException(t);\n }\n}\n"
|
"private void runUserCodeInTx(TransactionExecutor.Procedure<MapReduceContext> userCode) {\n TransactionContext txContext = new TransactionContext(txClient, context.getDatasetInstantiator().getTransactionAware());\n DynamicBasicMapReduceContext mapReduceContextWithTX = null;\n try {\n txContext.start();\n mapReduceContextWithTX = new DynamicBasicMapReduceContext(context, datasetFramework, txContext, cConf);\n userCode.apply(mapReduceContextWithTX);\n txContext.finish();\n } catch (TransactionFailureException e) {\n abortTransaction(e, \"String_Node_Str\" + methodName + \"String_Node_Str\", txContext);\n } catch (Throwable t) {\n abortTransaction(t, \"String_Node_Str\", txContext);\n } finally {\n if (mapReduceContextWithTX != null) {\n mapReduceContextWithTX.close();\n }\n }\n}\n"
|
"protected static double computeLoudestFreq(FrequenciesState fs, int maxFrequency) {\n double max = 0;\n double freq = 0;\n for (int i = 0; i < maxFrequency / 2; i++) {\n double val = fs.getState()[i].abs();\n freq = (max < val ? i : freq);\n max = (max < val ? val : max);\n }\n return freq;\n}\n"
|
"public boolean loadComments(boolean refresh, boolean loadMore) {\n refreshOnly = refresh;\n String author, postID, comment, dateCreatedFormatted, status, authorEmail, authorURL, postTitle;\n int commentID;\n List<Map<String, Object>> loadedComments = WordPress.wpDB.loadComments(WordPress.currentBlog.getId());\n if (loadedComments != null) {\n numRecords = loadedComments.size();\n if (refreshOnly) {\n if (model != null) {\n model.clear();\n }\n } else {\n model = new ArrayList<Comment>();\n }\n checkedComments = new Vector<String>();\n for (int i = 0; i < loadedPosts.size(); i++) {\n checkedComments.add(i, \"String_Node_Str\");\n Map<String, Object> contentHash = loadedPosts.get(i);\n allComments.put((Integer) contentHash.get(\"String_Node_Str\"), contentHash);\n author = EscapeUtils.unescapeHtml(contentHash.get(\"String_Node_Str\").toString());\n commentID = (Integer) contentHash.get(\"String_Node_Str\");\n postID = contentHash.get(\"String_Node_Str\").toString();\n comment = EscapeUtils.unescapeHtml(contentHash.get(\"String_Node_Str\").toString());\n dateCreatedFormatted = contentHash.get(\"String_Node_Str\").toString();\n status = contentHash.get(\"String_Node_Str\").toString();\n authorEmail = EscapeUtils.unescapeHtml(contentHash.get(\"String_Node_Str\").toString());\n authorURL = EscapeUtils.unescapeHtml(contentHash.get(\"String_Node_Str\").toString());\n postTitle = EscapeUtils.unescapeHtml(contentHash.get(\"String_Node_Str\").toString());\n if (model == null) {\n model = new ArrayList<Comment>();\n }\n model.add(new Comment(postID, commentID, i, author, dateCreatedFormatted, comment, status, postTitle, authorURL, authorEmail, URI.create(\"String_Node_Str\" + StringUtils.getMd5Hash(authorEmail.trim()) + \"String_Node_Str\")));\n }\n if (!refreshOnly) {\n ListView listView = this.getListView();\n listView.removeFooterView(switcher);\n if (loadedPosts.size() % 30 == 0) {\n listView.addFooterView(switcher);\n }\n setListAdapter(new CommentAdapter());\n listView.setOnItemClickListener(new OnItemClickListener() {\n public void onItemClick(AdapterView<?> arg0, View view, int position, long id) {\n selectedPosition = position;\n Comment comment = model.get((int) id);\n onCommentSelectedListener.onCommentSelected(comment);\n getListView().invalidateViews();\n }\n });\n listView.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {\n AdapterView.AdapterContextMenuInfo info;\n try {\n info = (AdapterView.AdapterContextMenuInfo) menuInfo;\n } catch (ClassCastException e) {\n return;\n }\n WordPress.currentComment = model.get(info.position);\n menu.setHeaderTitle(getResources().getText(R.string.comment_actions));\n menu.add(0, 0, 0, getResources().getText(R.string.mark_approved));\n menu.add(0, 1, 0, getResources().getText(R.string.mark_unapproved));\n menu.add(0, 2, 0, getResources().getText(R.string.mark_spam));\n menu.add(0, 3, 0, getResources().getText(R.string.reply));\n menu.add(0, 4, 0, getResources().getText(R.string.delete));\n menu.add(0, 5, 0, getResources().getText(R.string.edit));\n }\n });\n } else {\n getListView().invalidateViews();\n }\n if (this.shouldSelectAfterLoad) {\n if (model != null) {\n if (model.size() > 0) {\n selectedPosition = 0;\n Comment aComment = model.get((int) 0);\n onCommentSelectedListener.onCommentSelected(aComment);\n getListView().setItemChecked(0, true);\n }\n }\n shouldSelectAfterLoad = false;\n }\n if (loadMore && scrollPosition > 0) {\n ListView listView = this.getListView();\n try {\n listView.setSelectionFromTop(scrollPosition, scrollPositionTop);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return true;\n } else {\n return false;\n }\n}\n"
|
"public void clearItems() {\n if (ITEMS != null) {\n ITEMS.clear();\n }\n return;\n}\n"
|
"private int getOffsetLoc(Chunk c) {\n return IntMath.mod(c.getX(), 32) + IntMath.mod(c.getZ(), 32) * 32;\n}\n"
|
"public void handleException(Exception ex) {\n if (ex != null) {\n logger.fatal(\"String_Node_Str\");\n ex.printStackTrace();\n } else {\n logger.fatal(\"String_Node_Str\");\n }\n}\n"
|
"public Boolean call() throws Exception {\n HostConfig hostConfig = new HostConfig();\n hostConfig.setNetworkMode(\"String_Node_Str\");\n hostConfig.setPrivileged(true);\n hostConfig.setRestartPolicy(RestartPolicy.alwaysRestart());\n Ports ports = new Ports();\n ports.add(new PortBinding(new Ports.Binding(PORT), new ExposedPort(PORT)));\n hostConfig.setPortBindings(ports);\n try {\n String containerId = DockerClientUtil.createContainer(docker, docker.createContainerCmd(imageName).withHostConfig(hostConfig).withExposedPorts(new ExposedPort(PORT)).withEnv(String.format(\"String_Node_Str\", node), String.format(\"String_Node_Str\"), String.format(\"String_Node_Str\", cloudPlatform), String.format(\"String_Node_Str\", \"String_Node_Str\")).withName(AMBARI_SERVER.getName()).withCmd(\"String_Node_Str\"));\n DockerClientUtil.startContainer(docker, docker.startContainerCmd(containerId).withPortBindings(new PortBinding(new Ports.Binding(\"String_Node_Str\", PORT), new ExposedPort(PORT))).withNetworkMode(\"String_Node_Str\").withRestartPolicy(RestartPolicy.alwaysRestart()).withPrivileged(true));\n LOGGER.info(\"String_Node_Str\");\n } catch (ConflictException ex) {\n LOGGER.warn(\"String_Node_Str\", ex.getMessage());\n }\n return true;\n}\n"
|
"public boolean matches(E item) {\n filterComparables.clear();\n if (filterator == null)\n filterComparables.add((D) item);\n else\n filterator.getFilterValues(filterComparables, item);\n for (int c = 0; c < filterComparables.size(); c++) {\n D filterComparable = filterComparables.get(c);\n if (filterComparable != null) {\n if (start != null && start.compareTo(filterComparable) > 0)\n continue;\n if (end != null && end.compareTo(filterComparable) == -1)\n continue;\n }\n return true;\n }\n return false;\n}\n"
|
"private static void toXML(StringBuffer sb, String tagName, Class type, Object obj) {\n Class<?> clazz = obj.getClass();\n if (clazz.isArray()) {\n if (obj.getClass() == INT_ARRAY_CLASS) {\n int[] objs = (int[]) obj;\n for (int i = 0; i < objs.length; i++) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n sb.append(objs[i]);\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n }\n } else if (obj.getClass() == BYTE_ARRAY_CLASS) {\n byte[] objs = (byte[]) obj;\n for (int i = 0; i < objs.length; i++) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n sb.append(objs[i]);\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n }\n } else {\n Object[] objs = (Object[]) obj;\n for (int i = 0; i < objs.length; i++) {\n toXML(sb, tagName, type.getComponentType(), objs[i]);\n }\n }\n } else if (clazz == ManagedObjectReference.class) {\n ManagedObjectReference mor = (ManagedObjectReference) obj;\n sb.append(\"String_Node_Str\" + tagName);\n if (clazz != type) {\n sb.append(\"String_Node_Str\" + mor.type + \"String_Node_Str\");\n }\n sb.append(\"String_Node_Str\" + mor.type + \"String_Node_Str\");\n sb.append(mor.val);\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n } else if (clazz.getCanonicalName().startsWith(\"String_Node_Str\")) {\n if (clazz != type) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\" + getXSIType(obj) + \"String_Node_Str\");\n } else {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n }\n sb.append(obj);\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n } else if (clazz.isEnum()) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\" + obj + \"String_Node_Str\" + tagName + \"String_Node_Str\");\n } else if (obj instanceof Calendar) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\" + DatatypeConverter.printDateTime((Calendar) obj) + \"String_Node_Str\" + tagName + \"String_Node_Str\");\n } else {\n if (clazz == type) {\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n } else {\n String nameSpaceType = clazz.getSimpleName();\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\" + nameSpaceType + \"String_Node_Str\");\n }\n Field[] fields = getAllFields(clazz);\n for (int i = 0; i < fields.length; i++) {\n Field f = fields[i];\n String fName = f.getName();\n Object value = null;\n try {\n value = f.get(obj);\n } catch (IllegalAccessException iae) {\n iae.printStackTrace();\n }\n if (value == null) {\n continue;\n }\n Class<?> fType = f.getType();\n toXML(sb, fName, fType, value);\n }\n sb.append(\"String_Node_Str\" + tagName + \"String_Node_Str\");\n }\n}\n"
|
"FunctionTypeBuilder inferInheritance(JSDocInfo info) {\n if (info != null) {\n isConstructor = info.isConstructor();\n makesStructs = info.makesStructs();\n makesDicts = info.makesDicts();\n isInterface = info.isInterface();\n if (makesStructs && !isConstructor) {\n reportWarning(CONSTRUCTOR_REQUIRED, \"String_Node_Str\", fnName);\n } else if (makesDicts && !isConstructor) {\n reportWarning(CONSTRUCTOR_REQUIRED, \"String_Node_Str\", fnName);\n }\n if (info.hasBaseType()) {\n if (isConstructor) {\n JSType maybeBaseType = info.getBaseType().evaluate(scope, typeRegistry);\n if (maybeBaseType != null && maybeBaseType.setValidator(new ExtendedTypeValidator())) {\n baseType = (ObjectType) maybeBaseType;\n }\n } else {\n reportWarning(EXTENDS_WITHOUT_TYPEDEF, fnName);\n }\n }\n if (info.getImplementedInterfaceCount() > 0) {\n if (isConstructor) {\n implementedInterfaces = Lists.newArrayList();\n for (JSTypeExpression t : info.getImplementedInterfaces()) {\n JSType maybeInterType = t.evaluate(scope, typeRegistry);\n if (maybeInterType != null && maybeInterType.setValidator(new ImplementedTypeValidator())) {\n implementedInterfaces.add((ObjectType) maybeInterType);\n }\n }\n }\n } else if (info.getImplementedInterfaceCount() > 0) {\n reportWarning(CONSTRUCTOR_REQUIRED, \"String_Node_Str\", fnName);\n }\n if (isInterface) {\n extendedInterfaces = Lists.newArrayList();\n for (JSTypeExpression t : info.getExtendedInterfaces()) {\n JSType maybeInterfaceType = t.evaluate(scope, typeRegistry);\n if (maybeInterfaceType != null && maybeInterfaceType.setValidator(new ExtendedTypeValidator())) {\n extendedInterfaces.add((ObjectType) maybeInterfaceType);\n }\n }\n }\n }\n return this;\n}\n"
|
"public Dimension getMinimumSize() {\n Dimension dimension = new Dimension();\n dimension.width = 2 * (ITEM_WIDTH + MARGIN) + MIN_SPACE_BETWEEN_COLUMNS;\n dimension.height = Math.min(HEADER_HEIGHT + HEADER_TOP_MARGIN + Math.max(sourceComponents.size(), cdmComponents.size()) * (ITEM_HEIGHT + MARGIN), maxHeight);\n return dimension;\n}\n"
|
"public void removeOpenContentProperty(Property property) {\n if (isLogging()) {\n getChangeSummary().setUnsetOCProperty(this, property);\n }\n _getOpenContentProperties().remove(property);\n _getOpenContentPropertiesAttributes().remove(property);\n getInstanceProperties().remove(property);\n for (int i = 0, size = ((SDOProperty) property).getAliasNames().size(); i < size; i++) {\n _getOpenContentAliasNamesMap().remove(((SDOProperty) property).getAliasNames().get(i));\n }\n}\n"
|
"public boolean set(Data dataKey, Object value, long ttl) {\n checkIfLoaded();\n earlyWriteCleanup();\n Record record = records.get(key);\n boolean newRecord = false;\n if (record == null) {\n value = mapService.interceptPut(name, null, value);\n value = mapStoreWrite(dataKey, value, null);\n record = mapService.createRecord(name, dataKey, value, ttl);\n records.put(dataKey, record);\n updateSizeEstimator(calculateRecordSize(record));\n newRecord = true;\n } else {\n value = mapService.interceptPut(name, record.getValue(), value);\n value = mapStoreWrite(dataKey, value, record);\n updateSizeEstimator(-calculateRecordSize(record));\n setRecordValue(record, value);\n updateSizeEstimator(calculateRecordSize(record));\n updateTtl(record, ttl);\n }\n saveIndex(record);\n return newRecord;\n}\n"
|
"public void memberAdded(MembershipEvent membershipEvent) {\n try {\n Member member = membershipEvent.getMember();\n if (member != null && instance.node.isMaster() && urlChanged) {\n ManagementCenterConfigOperation operation = new ManagementCenterConfigOperation(webServerUrl);\n callOnMember(member, operation);\n }\n } catch (Exception e) {\n logger.warning(\"String_Node_Str\", e);\n }\n}\n"
|
"private ContentElementInfo getEventTarget() {\n IContainerDefn tmpContainerDefn = focus.getContainerDefn();\n if (tmpContainerDefn instanceof SlotDefn)\n return null;\n DesignElement tmpElement = focus.getElement();\n PropertyDefn tmpPropDefn = (PropertyDefn) tmpContainerDefn;\n ContentElementInfo retTarget = new ContentElementInfo(true);\n while (tmpElement != null && tmpPropDefn != null) {\n retTarget.pushStep(tmpPropDefn, -1);\n if (tmpPropDefn.getTypeCode() == IPropertyType.CONTENT_ELEMENT_TYPE && !(tmpElement instanceof ContentElement)) {\n retTarget.setTopElement(tmpElement);\n return retTarget;\n }\n ContainerContext context = tmpElement.getContainerInfo();\n if (context == null)\n break;\n tmpElement = tmpElement.getContainer();\n tmpPropDefn = tmpElement.getPropertyDefn(context.getPropertyName());\n }\n return null;\n}\n"
|
"public void commitTransaction() throws TransactionException {\n transaction.commit(true);\n}\n"
|
"String getString(String cacheName, String propertyName) {\n try {\n startSuperTenantFlow();\n Cache<String, String> cache = getCacheManager().getCache(cacheName);\n String value = cache.get(propertyName);\n if (log.isDebugEnabled()) {\n log.debug(String.format(\"String_Node_Str\", cacheName, propertyName, value));\n }\n return value;\n } finally {\n endSuperTenantFlow();\n }\n}\n"
|
"protected void renderImpl(GLGraphics g, float w, float h) {\n g.color(Color.RED).fillRect(10, 10, 500, 18);\n g.drawText(\"String_Node_Str\", 10, 10, 500, 18);\n}\n"
|
"protected <V> ListenableScheduledFuture<V> schedule(Callable<V> callable, long delayInMillis) {\n ListenableRunnableFuture<V> taskFuture = new ListenableFutureTask<V>(false, callable);\n OneTimeTaskWrapper ottw = new OneTimeTaskWrapper(taskFuture, delayInMillis);\n if (delayInMillis == 0) {\n pScheduler.addToExecuteQueue(ottw);\n } else {\n pScheduler.addToScheduleQueue(ottw);\n }\n return new ScheduledFutureDelegate<V>(taskFuture, ottw);\n}\n"
|
"public void testForget() {\n final int numVertices = 1500;\n final int numEdges = 3000;\n final int targetVertices = numVertices / 2;\n final int targetEdges = numEdges / 2;\n OCMind m = new OCMind();\n printMemory(\"String_Node_Str\");\n new RandomGraphGenerator(m, numVertices, numEdges);\n assertEquals(m.getVertexCount(), numVertices);\n assertEquals(m.getEdgeCount(), numEdges);\n printMemory(\"String_Node_Str\");\n m.cycle();\n RandomStimulation rs = new RandomStimulation(0, (short) 0, numVertices * 10) {\n public short getBoost() {\n return (short) RandomNumber.getInt(0, 127);\n }\n };\n m.addAgent(rs);\n m.cycle();\n m.cycle();\n printGraphSize(m);\n Forget f = new Forget(0, targetVertices, targetEdges) {\n public void run(OCMind mind) {\n super.run(mind);\n System.out.println(\"String_Node_Str\" + mind.getVertexCount() + \"String_Node_Str\" + mind.getEdgeCount());\n System.out.println(mind.attention.size() + \"String_Node_Str\" + IteratorUtils.toList(mind.iterateAtomsByIncreasingSTI()).size() + \"String_Node_Str\" + mind.getAtoms().size());\n }\n };\n m.addAgent(f);\n int cyclesToFinish = 0;\n while ((targetVertices < m.getVertexCount()) || (targetEdges < m.getEdgeCount())) {\n m.cycle();\n cyclesToFinish++;\n }\n System.out.println(\"String_Node_Str\" + cyclesToFinish + \"String_Node_Str\");\n printGraphSize(m);\n}\n"
|
"public void optimizeLayout() throws NullPointerException {\n try {\n if (mDevice.isRecoverySupported() || mDevice.isKernelSupported()) {\n if (getIntent().getAction().equals(Intent.ACTION_VIEW)) {\n setContentView(R.layout.flash_as);\n RelativeLayout FlashAsLayout = (RelativeLayout) findViewById(R.layout.flash_as);\n String path;\n if ((path = getIntent().getData().getPath()) != null) {\n final File IMG = new File(path);\n if (IMG.exists()) {\n TextView tvFlashAs = (TextView) findViewById(R.id.tvFlashAs);\n tvFlashAs.setText(String.format(getString(R.string.flash_as), IMG.getName()));\n } else {\n exit();\n }\n RadioButton optAsRecovery = (RadioButton) findViewById(R.id.optAsRecovery);\n RadioButton optAsKernel = (RadioButton) findViewById(R.id.optAsKernel);\n if (!mDevice.isRecoverySupported()) {\n FlashAsLayout.removeView(optAsRecovery);\n optAsKernel.setChecked(true);\n }\n if (!mDevice.isKernelSupported()) {\n FlashAsLayout.removeView((optAsKernel));\n }\n } else {\n exit();\n }\n } else {\n setContentView(R.layout.recovery_tools);\n mRecoveryToolsLayout = (DrawerLayout) findViewById(R.id.RecoveryToolsLayout);\n LayoutInflater layoutInflater = getLayoutInflater();\n DrawerLayout mMenuDrawer = (DrawerLayout) layoutInflater.inflate(R.layout.menu_drawer, mRecoveryToolsLayout, true);\n DrawerLayout mBackupDrawer = (DrawerLayout) layoutInflater.inflate(R.layout.backup_drawer, mRecoveryToolsLayout, true);\n mRecoveryToolsLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);\n ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(mActivity, mRecoveryToolsLayout, R.drawable.ic_drawer, R.string.settings, R.string.app_name);\n mRecoveryToolsLayout.setDrawerListener(mDrawerToggle);\n mDrawerToggle.syncState();\n mDrawerToggle.setDrawerIndicatorEnabled(true);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n getSupportActionBar().setHomeButtonEnabled(true);\n String[] Styles = getResources().getStringArray(R.array.styles);\n if (mMenuDrawer != null) {\n Spinner spStyle = (Spinner) mMenuDrawer.findViewById(R.id.spStyle);\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(mActivity, R.layout.custom_list_item, Styles);\n adapter.setDropDownViewResource(R.layout.custom_list_item);\n spStyle.setAdapter(adapter);\n spStyle.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n switch(position) {\n case 1:\n Common.setIntegerPref(mContext, PREF_NAME, PREF_STYLE, APPCOMPAT_LIGHT_DARK_BAR);\n restartActivity();\n break;\n case 2:\n Common.setIntegerPref(mContext, PREF_NAME, PREF_STYLE, APPCOMPAT_LIGHT);\n restartActivity();\n break;\n case 3:\n Common.setIntegerPref(mContext, PREF_NAME, PREF_STYLE, APPCOMPAT_DARK);\n restartActivity();\n break;\n }\n }\n public void onNothingSelected(AdapterView<?> parent) {\n }\n });\n CheckBox cbShowAds = (CheckBox) mMenuDrawer.findViewById(R.id.cbShowAds);\n CheckBox cbLog = (CheckBox) mMenuDrawer.findViewById(R.id.cbLog);\n cbShowAds.setChecked(Common.getBooleanPref(mContext, PREF_NAME, PREF_KEY_ADS));\n cbLog.setChecked(Common.getBooleanPref(mContext, Shell.PREF_NAME, Shell.PREF_LOG));\n if (cbLog.isChecked()) {\n findViewById(R.id.bShowLogs).setVisibility(View.VISIBLE);\n } else {\n findViewById(R.id.bShowLogs).setVisibility(View.INVISIBLE);\n }\n cbShowAds.setChecked(Common.getBooleanPref(mContext, PREF_NAME, PREF_KEY_ADS));\n }\n final TextView RecoveryVersion = (TextView) findViewById(R.id.tvVersion);\n RecoveryVersion.setText(mDevice.getRecoveryVersion() + \"String_Node_Str\" + mDevice.getKernelVersion());\n loadBackupDrawer();\n if (!Common.getBooleanPref(mContext, PREF_NAME, PREF_KEY_ADS)) {\n if (adView != null && MainParent != null) {\n MainParent.removeView(adView);\n }\n }\n if (!mDevice.isKernelSupported()) {\n mRecoveryToolsLayout.removeView((mRecoveryToolsLayout.findViewById(R.id.bFlashKernel)));\n if (mBackupDrawer != null) {\n mBackupDrawer.removeView(mBackupDrawer.findViewById(R.id.bCreateKernelBackup));\n mBackupDrawer.removeView(mBackupDrawer.findViewById(R.id.lvKernelBackups));\n }\n }\n if (!mDevice.isRecoverySupported()) {\n mRecoveryToolsLayout.removeView(findViewById(R.id.bFlashRecovery));\n if (mBackupDrawer != null) {\n mBackupDrawer.removeView(findViewById(R.id.bCreateRecoveryBackup));\n mBackupDrawer.removeView(findViewById(R.id.lvRecoveryBackups));\n }\n }\n }\n }\n } catch (NullPointerException e) {\n throw new NullPointerException(\"String_Node_Str\" + e.getMessage());\n }\n}\n"
|
"public Boolean call() throws Exception {\n try {\n getDSFramework().getInstances(NamespaceId.SYSTEM);\n return true;\n } catch (ServiceUnavailableException sue) {\n return false;\n }\n}\n"
|
"public void setParent(Shape parent) {\n List<AbstractController> parentList = model.getEntitiesByCategory(\"String_Node_Str\");\n if (!parentList.isEmpty()) {\n ((Group) parentList.get(0).getRepresentation()).getChildren().remove(view.getRepresentation());\n }\n String operator = parent.getProperty(\"String_Node_Str\");\n if (operator != null && OperatorType.valueOf(parent.getProperty(\"String_Node_Str\")) == OperatorType.Union) {\n ((Group) parent.getRepresentation()).getChildren().add((Group) view.getRepresentation());\n }\n super.setParent(parent);\n}\n"
|
"public static void main(String[] args) throws Exception {\n Options options = new Options();\n options.addOption(new Option(HELP_OPTION, \"String_Node_Str\"));\n options.addOption(new Option(JSON_OPTION, \"String_Node_Str\"));\n options.addOption(new Option(TSV_OPTION, \"String_Node_Str\"));\n options.addOption(OptionBuilder.withArgName(\"String_Node_Str\").hasArg().withDescription(\"String_Node_Str\").create(COLLECTION_OPTION));\n options.addOption(OptionBuilder.withArgName(\"String_Node_Str\").hasArg().withDescription(\"String_Node_Str\").create(INDEX_OPTION));\n CommandLine cmdline = null;\n CommandLineParser parser = new GnuParser();\n try {\n cmdline = parser.parse(options, args);\n } catch (ParseException exp) {\n System.err.println(\"String_Node_Str\" + exp.getMessage());\n System.exit(-1);\n }\n if (cmdline.hasOption(HELP_OPTION) || !cmdline.hasOption(COLLECTION_OPTION) || !cmdline.hasOption(INDEX_OPTION)) {\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp(IndexStatuses.class.getName(), options);\n System.exit(-1);\n }\n String collectionPath = cmdline.getOptionValue(COLLECTION_OPTION);\n String indexPath = cmdline.getOptionValue(INDEX_OPTION);\n long startTime = System.currentTimeMillis();\n StatusStream stream;\n File file = new File(collectionPath);\n if (!file.exists()) {\n System.err.println(\"String_Node_Str\" + file + \"String_Node_Str\");\n System.exit(-1);\n }\n if (cmdline.hasOption(TSV_OPTION)) {\n stream = new TSVStatusCorpusReader(file);\n } else {\n stream = new JsonStatusCorpusReader(file);\n }\n Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_41);\n Directory dir = FSDirectory.open(new File(indexPath));\n IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_41, analyzer);\n config.setOpenMode(OpenMode.CREATE);\n LOG.info(\"String_Node_Str\" + collectionPath);\n LOG.info(\"String_Node_Str\" + indexPath);\n IndexWriter writer = new IndexWriter(dir, config);\n int cnt = 0;\n Status status;\n try {\n while ((status = stream.next()) != null) {\n if (status.getText() == null) {\n continue;\n }\n cnt++;\n Document doc = new Document();\n doc.add(new LongField(StatusField.ID.name, status.getId(), Field.Store.YES));\n doc.add(new LongField(StatusField.EPOCH.name, status.getEpoch(), Field.Store.YES));\n doc.add(new TextField(StatusField.SCREEN_NAME.name, status.getScreenname(), Store.YES));\n doc.add(new TextField(StatusField.TEXT.name, status.getText(), Store.YES));\n doc.add(new IntField(StatusField.FRIENDS_COUNT.name, status.getFollowersCount(), Store.YES));\n doc.add(new IntField(StatusField.FOLLOWERS_COUNT.name, status.getFriendsCount(), Store.YES));\n doc.add(new IntField(StatusField.STATUSES_COUNT.name, status.getStatusesCount(), Store.YES));\n long inReplyToStatusId = status.getInReplyToStatusId();\n if (inReplyToStatusId > 0) {\n doc.add(new LongField(StatusField.IN_REPLY_TO_STATUS_ID.name, inReplyToStatusId, Field.Store.YES));\n doc.add(new LongField(StatusField.IN_REPLY_TO_USER_ID.name, status.getInReplyToUserId(), Field.Store.YES));\n }\n String lang = status.getLang();\n if (!lang.equals(\"String_Node_Str\")) {\n doc.add(new TextField(StatusField.LANG.name, status.getLang(), Store.YES));\n }\n long retweetStatusId = status.getRetweetedStatusId();\n if (retweetStatusId > 0) {\n doc.add(new LongField(StatusField.RETWEETED_STATUS_ID.name, retweetStatusId, Field.Store.YES));\n doc.add(new LongField(StatusField.RETWEETED_USER_ID.name, status.getRetweetedUserId(), Field.Store.YES));\n }\n doc.add(new IntField(StatusField.FRIENDS_COUNT.name, status.getFollowersCount(), Store.YES));\n doc.add(new IntField(StatusField.FOLLOWERS_COUNT.name, status.getFriendsCount(), Store.YES));\n doc.add(new IntField(StatusField.STATUSES_COUNT.name, status.getStatusesCount(), Store.YES));\n writer.addDocument(doc);\n if (cnt % 100000 == 0) {\n LOG.info(cnt + \"String_Node_Str\");\n }\n }\n LOG.info(String.format(\"String_Node_Str\", cnt));\n LOG.info(\"String_Node_Str\");\n writer.forceMerge(1);\n LOG.info(\"String_Node_Str\");\n LOG.info(\"String_Node_Str\" + (System.currentTimeMillis() - startTime) + \"String_Node_Str\");\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n writer.close();\n dir.close();\n stream.close();\n }\n}\n"
|
"public Response<T> send() {\n Response<T> response = doOnlineRequest(onlineRequest, cleanStorageOnSuccessDownload, saveDownloadedDataToStorage);\n afterRequests(onlineRequest);\n return response;\n}\n"
|
"protected String buildDrillAction(IAction action, Object context) {\n String baseURL = null;\n if (context != null) {\n if (context instanceof HTMLRenderContext) {\n baseURL = ((HTMLRenderContext) context).getBaseURL();\n }\n if (context instanceof PDFRenderContext) {\n baseURL = ((PDFRenderContext) context).getBaseURL();\n }\n }\n if (baseURL == null) {\n baseURL = \"String_Node_Str\";\n }\n StringBuffer link = new StringBuffer();\n String reportName = action.getReportName();\n if (reportName != null && !reportName.equals(\"String_Node_Str\")) {\n String format = action.getFormat();\n if (!\"String_Node_Str\".equalsIgnoreCase(format)) {\n link.append(baseURL.replaceFirst(\"String_Node_Str\", \"String_Node_Str\"));\n } else {\n link.append(baseURL);\n }\n link.append(reportName.toLowerCase().endsWith(\"String_Node_Str\") ? \"String_Node_Str\" : \"String_Node_Str\");\n try {\n link.append(URLEncoder.encode(reportName, \"String_Node_Str\"));\n } catch (UnsupportedEncodingException e1) {\n }\n if (format != null && format.length() > 0) {\n link.append(\"String_Node_Str\" + format);\n }\n if (action.getParameterBindings() != null) {\n Iterator paramsIte = action.getParameterBindings().entrySet().iterator();\n while (paramsIte.hasNext()) {\n Map.Entry entry = (Map.Entry) paramsIte.next();\n try {\n String key = (String) entry.getKey();\n Object valueObj = entry.getValue();\n if (valueObj != null) {\n String value = ParameterValidationUtil.getDisplayValue(valueObj);\n link.append(\"String_Node_Str\" + URLEncoder.encode(key, \"String_Node_Str\") + \"String_Node_Str\" + URLEncoder.encode(value, \"String_Node_Str\"));\n }\n } catch (UnsupportedEncodingException e) {\n }\n }\n }\n link.append(\"String_Node_Str\");\n if (action.getBookmark() != null) {\n try {\n if (baseURL.lastIndexOf(\"String_Node_Str\") > 0) {\n link.append(\"String_Node_Str\");\n } else {\n link.append(\"String_Node_Str\");\n }\n link.append(URLEncoder.encode(action.getBookmark(), \"String_Node_Str\"));\n } catch (UnsupportedEncodingException e) {\n }\n }\n }\n return link.toString();\n}\n"
|
"public static List loadSorts(InputStream inputStream, int version) throws IOException {\n DataInputStream dis = new DataInputStream(inputStream);\n List sortList = new ArrayList();\n int size = IOUtil.readInt(dis);\n for (int i = 0; i < size; i++) {\n String sortKeyColumn = IOUtil.readString(dis);\n IScriptExpression sortKeyExpr = (IScriptExpression) ExprUtil.loadBaseExpr(dis);\n int direction = IOUtil.readInt(dis);\n SortDefinition sortDefn = new SortDefinition();\n if (sortKeyColumn != null)\n sortDefn.setColumn(sortKeyColumn);\n else\n sortDefn.setExpression(sortKeyExpr);\n sortDefn.setSortDirection(direction);\n if (version >= VersionManager.VERSION_2_3_1)\n sortDefn.setSortStrength(IOUtil.readInt(dis));\n if (version >= VersionManager.VERSION_2_5_0_1) {\n String locale = IOUtil.readString(dis);\n if (locale != null)\n sortDefn.setSortLocale(new ULocale(locale));\n }\n sortList.add(sortDefn);\n }\n return sortList;\n}\n"
|
"private void fillLocalPullDown(IMenuManager manager) {\n setStatusMenu = new MenuManager(Messages.MultiRosterView_SetStatusAs, null);\n setStatusMenu.add(setAvailableAction);\n setStatusMenu.add(setAwayAction);\n setStatusMenu.add(setDNDAction);\n setStatusMenu.add(setInvisibleAction);\n setStatusMenu.add(setOfflineAction);\n setStatusMenu.setVisible(false);\n manager.add(setStatusMenu);\n manager.add(new Separator());\n manager.add(showOfflineAction);\n manager.add(showEmptyGroupsAction);\n manager.add(new Separator());\n manager.add(new Action(Messages.MultiRosterView_AddContact, SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)) {\n public void run() {\n AddContactDialog dialog = new AddContactDialog(treeViewer.getControl().getShell());\n dialog.setInput(rosterAccounts);\n if (Window.OK == dialog.open()) {\n IPresenceContainerAdapter ipca = dialog.getSelection();\n IRosterSubscriptionSender sender = ipca.getRosterManager().getRosterSubscriptionSender();\n try {\n sender.sendRosterAdd(dialog.getAccountID(), dialog.getAlias(), null);\n } catch (ECFException e) {\n e.printStackTrace();\n }\n }\n }\n });\n manager.add(new Separator());\n manager.add(openChatRoomAction);\n manager.add(new Separator());\n manager.add(disconnectAllAccountsAction);\n}\n"
|
"public CloseableIterator<LeagueList> getManyLeagueList(final Map<String, Object> query, final PipelineContext context) {\n final Platform platform = (Platform) query.get(\"String_Node_Str\");\n Utilities.checkNotNull(platform, \"String_Node_Str\");\n final Tier tier = (Tier) query.get(\"String_Node_Str\");\n final Iterable<Queue> queues = (Iterable<Queue>) query.get(\"String_Node_Str\");\n final Iterable<String> leagueIds = (Iterable<String>) query.get(\"String_Node_Str\");\n if (leagueIds == null) {\n if (tier == null || queues == null) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n } else if (!LEAGUE_LIST_ENDPOINTS.containsKey(tier)) {\n return CloseableIterators.empty();\n }\n }\n final Iterator<?> iterator = leagueIds == null ? queues.iterator() : leagueIds.iterator();\n return CloseableIterators.from(new Iterator<LeagueList>() {\n public boolean hasNext() {\n return iterator.hasNext();\n }\n public LeagueList next() {\n LeagueList data;\n if (leagueIds == null) {\n final Queue queue = (Queue) iterator.next();\n if (!Queue.RANKED.contains(queue)) {\n return null;\n }\n final String endpoint = LEAGUE_LIST_ENDPOINTS.get(tier) + queue;\n data = get(LeagueList.class, endpoint, platform, LEAGUE_LIST_ENDPOINTS.get(tier) + \"String_Node_Str\");\n } else {\n final String leagueId = (String) iterator.next();\n final String endpoint = \"String_Node_Str\" + leagueId;\n data = get(LeagueList.class, endpoint, platform, \"String_Node_Str\");\n }\n data.setPlatform(platform.getTag());\n return data;\n }\n public void remove() {\n throw new UnsupportedOperationException();\n }\n });\n}\n"
|
"private static TreeSet<Gateway> importGateways(Set<URL> gatewayURLs) throws IntrospectionException {\n logger.finer(\"String_Node_Str\" + gatewayURLs.size() + \"String_Node_Str\");\n TreeSet<Gateway> gateways = new TreeSet<Gateway>();\n for (URL gatewayURL : gatewayURLs) {\n try {\n Gateway gateway = new Gateway(gatewayURL);\n if (Config.compareProgramVersions(Config.getLatestVersion(), gateway.getMinProgramVersion()) < 0) {\n logger.log(Level.INFO, \"String_Node_Str\", new Object[] { gateway.getName(), gateway.getMinProgramVersion() });\n continue;\n }\n if (gateways.contains(gateway)) {\n for (Iterator<Gateway> it = gateways.iterator(); it.hasNext(); ) {\n Gateway op = it.next();\n if (op.equals(gateway) && op.getVersion().compareTo(gateway.getVersion()) < 0) {\n it.remove();\n }\n }\n }\n gateways.add(gateway);\n } catch (IOException ex) {\n logger.log(Level.WARNING, \"String_Node_Str\" + gatewayURL.toExternalForm(), ex);\n } catch (IntrospectionException ex) {\n throw ex;\n } catch (Exception ex) {\n logger.log(Level.WARNING, \"String_Node_Str\" + gatewayURL.toExternalForm(), ex);\n }\n }\n logger.finer(\"String_Node_Str\" + gateways.size() + \"String_Node_Str\");\n return gateways;\n}\n"
|
"public void createNewUser(String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n doingWork = true;\n String[] paramTypes = { \"String_Node_Str\", byte[].class.getName(), \"String_Node_Str\" };\n Method createFiles = Callback.getMethod(\"String_Node_Str\", this, paramTypes);\n Object[] params = { null, userName };\n Callback userNoExistCallback = new Callback(createFiles, this, params);\n String[] noParamTypes = {};\n Object[] noParams = {};\n Method showWarning = Callback.getMethod(\"String_Node_Str\", this, noParamTypes);\n Callback userExistsCallback = new Callback(showWarning, this, noParams);\n userExists(null, userName, userExistsCallback, userNoExistCallback);\n}\n"
|
"private void initialize() {\n AbstractMethodDeclaration methodObject1 = this.mapper.getPDG1().getMethod();\n AbstractMethodDeclaration methodObject2 = this.mapper.getPDG2().getMethod();\n MethodDeclaration methodDeclaration1 = methodObject1.getMethodDeclaration();\n MethodDeclaration methodDeclaration2 = methodObject2.getMethodDeclaration();\n this.sourceCompilationUnits = new ArrayList<CompilationUnit>();\n this.sourceTypeDeclarations = new ArrayList<TypeDeclaration>();\n this.sourceMethodDeclarations = new ArrayList<MethodDeclaration>();\n this.removableStatements = new ArrayList<TreeSet<PDGNode>>();\n removableStatements.add(this.mapper.getRemovableNodesG1());\n removableStatements.add(this.mapper.getRemovableNodesG2());\n this.remainingStatementsMovableBefore = new ArrayList<TreeSet<PDGNode>>();\n remainingStatementsMovableBefore.add(this.mapper.getNonMappedPDGNodesG1MovableBefore());\n remainingStatementsMovableBefore.add(this.mapper.getNonMappedPDGNodesG2MovableBefore());\n this.remainingStatementsMovableAfter = new ArrayList<TreeSet<PDGNode>>();\n remainingStatementsMovableAfter.add(this.mapper.getNonMappedPDGNodesG1MovableAfter());\n remainingStatementsMovableAfter.add(this.mapper.getNonMappedPDGNodesG2MovableAfter());\n this.returnedVariables = new ArrayList<ArrayList<VariableDeclaration>>();\n returnedVariables.add(new ArrayList<VariableDeclaration>(this.mapper.getVariablesToBeReturnedG1()));\n returnedVariables.add(new ArrayList<VariableDeclaration>(this.mapper.getVariablesToBeReturnedG2()));\n this.fieldDeclarationsToBePulledUp = new ArrayList<Set<VariableDeclaration>>();\n this.fieldDeclarationsToBeParameterized = new ArrayList<Set<VariableDeclaration>>();\n this.methodDeclarationsToBePulledUp = new ArrayList<Set<MethodDeclaration>>();\n this.labeledStatementsToBeRemoved = new ArrayList<Set<LabeledStatement>>();\n for (int i = 0; i < 2; i++) {\n fieldDeclarationsToBePulledUp.add(new LinkedHashSet<VariableDeclaration>());\n fieldDeclarationsToBeParameterized.add(new LinkedHashSet<VariableDeclaration>());\n methodDeclarationsToBePulledUp.add(new LinkedHashSet<MethodDeclaration>());\n labeledStatementsToBeRemoved.add(new LinkedHashSet<LabeledStatement>());\n }\n this.compilationUnitChanges = new LinkedHashMap<ICompilationUnit, CompilationUnitChange>();\n this.createCompilationUnitChanges = new LinkedHashMap<ICompilationUnit, CreateCompilationUnitChange>();\n this.javaElementsToOpenInEditor = new LinkedHashSet<IJavaElement>();\n this.sourceMethodDeclarations.add(methodDeclaration1);\n this.sourceMethodDeclarations.add(methodDeclaration2);\n this.sourceTypeDeclarations.add((TypeDeclaration) methodDeclaration1.getParent());\n this.sourceTypeDeclarations.add((TypeDeclaration) methodDeclaration2.getParent());\n this.sourceCompilationUnits.add((CompilationUnit) methodDeclaration1.getRoot());\n this.sourceCompilationUnits.add((CompilationUnit) methodDeclaration2.getRoot());\n this.originalPassedParameters = new LinkedHashMap<VariableBindingKeyPair, ArrayList<VariableDeclaration>>();\n this.parameterizedDifferenceMap = new LinkedHashMap<BindingSignaturePair, ASTNodeDifference>();\n this.sortedNodeMappings = new TreeSet<PDGNodeMapping>(this.mapper.getMaximumStateWithMinimumDifferences().getNodeMappings());\n for (PDGNodeMapping pdgNodeMapping : sortedNodeMappings) {\n PDGNode pdgNode = pdgNodeMapping.getNodeG1();\n CFGNode cfgNode = pdgNode.getCFGNode();\n if (cfgNode instanceof CFGBranchDoLoopNode) {\n CFGBranchDoLoopNode cfgDoLoopNode = (CFGBranchDoLoopNode) cfgNode;\n doLoopNodes.add(cfgDoLoopNode);\n }\n }\n for (CompilationUnit sourceCompilationUnit : sourceCompilationUnits) {\n ICompilationUnit sourceICompilationUnit = (ICompilationUnit) sourceCompilationUnit.getJavaElement();\n MultiTextEdit sourceMultiTextEdit = new MultiTextEdit();\n CompilationUnitChange sourceCompilationUnitChange = new CompilationUnitChange(\"String_Node_Str\", sourceICompilationUnit);\n sourceCompilationUnitChange.setEdit(sourceMultiTextEdit);\n compilationUnitChanges.put(sourceICompilationUnit, sourceCompilationUnitChange);\n }\n this.cloneInfo = null;\n}\n"
|
"public void close() throws IOException {\n List<IOException> exs = new ArrayList<IOException>(2);\n try {\n if (primaryOpen)\n primary.close();\n } catch (IOException ex) {\n exs.add(ex);\n }\n try {\n if (backupOpen)\n backup.close();\n } catch (IOException ex) {\n exs.add(ex);\n }\n if (exs.size() != 0) {\n throw MultipleIOException.createIOException(exs);\n return;\n}\n"
|
"public String getValue(String key) throws Exception {\n Object val = null;\n for (ObjectName oname : hadoopObjectNames) {\n try {\n val = mbsc.getAttribute(oname, key);\n } catch (AttributeNotFoundException anfe) {\n continue;\n } catch (ReflectionException re) {\n if (re.getCause() instanceof NoSuchMethodException) {\n continue;\n }\n }\n err(\"String_Node_Str\" + key + \"String_Node_Str\" + (val == null ? \"String_Node_Str\" : val.getClass()) + \"String_Node_Str\" + val);\n break;\n }\n return (val == null) ? \"String_Node_Str\" : val.toString();\n}\n"
|
"protected KeyValueQuery<?> prepareQuery(Object[] parameters) {\n PartTree tree = null;\n if (this.queryMethod.getParameters().getNumberOfParameters() > 0) {\n tree = new PartTree(getQueryMethod().getName(), getQueryMethod().getEntityInformation().getJavaType());\n this.isCount = tree.isCountProjection();\n this.isDelete = tree.isDelete();\n this.isDistinct = tree.isDistinct();\n } else {\n this.isCount = false;\n this.isDelete = false;\n this.isDistinct = false;\n }\n ParametersParameterAccessor accessor = this.prepareAccessor(parameters, tree);\n KeyValueQuery<?> query = createQuery(accessor);\n if (accessor.getPageable() != Pageable.unpaged()) {\n query.setOffset(accessor.getPageable().getOffset());\n query.setRows(accessor.getPageable().getPageSize());\n } else {\n query.setOffset(-1);\n query.setRows(-1);\n }\n if (accessor.getSort() != null) {\n query.setSort(accessor.getSort());\n }\n return query;\n}\n"
|
"public void start(IReportContent report) {\n logger.log(Level.FINE, \"String_Node_Str\");\n this.report = report;\n writer.open(out, \"String_Node_Str\");\n ReportDesignHandle designHandle = null;\n Report reportDesign = null;\n if (report != null) {\n reportDesign = report.getDesign();\n designHandle = reportDesign.getReportDesign();\n Map appContext = reportContext.getAppContext();\n if (appContext != null) {\n Object tmp = appContext.get(EngineConstants.APPCONTEXT_CHART_RESOLUTION);\n if (tmp != null && tmp instanceof Number) {\n imageDpi = ((Number) tmp).intValue();\n }\n }\n if (imageDpi <= 0) {\n imageDpi = designHandle.getImageDPI();\n }\n if (imageDpi <= 0) {\n imageDpi = 96;\n }\n }\n retrieveRtLFlag();\n if (null == layoutPreference) {\n if (designHandle != null) {\n String reportLayoutPreference = designHandle.getLayoutPreference();\n if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {\n layoutPreference = HTMLRenderOption.LAYOUT_PREFERENCE_FIXED;\n fixedReport = true;\n } else if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {\n layoutPreference = HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;\n fixedReport = false;\n }\n }\n } else {\n fixedReport = HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference);\n }\n if (enableAgentStyleEngine) {\n htmlEmitter = new HTMLPerformanceOptimize(this, writer, fixedReport, enableInlineStyle, browserVersion);\n } else {\n htmlEmitter = new HTMLVisionOptimize(this, writer, fixedReport, enableInlineStyle, htmlRtLFlag, browserVersion);\n }\n if (isEmbeddable) {\n outputCSSStyles(reportDesign, designHandle);\n if (needFixTransparentPNG) {\n fixTransparentPNG();\n }\n fixRedirect();\n openRootTag();\n writeBidiFlag();\n if (report != null) {\n String defaultStyleName = report.getDesign().getRootStyleName();\n if (defaultStyleName != null) {\n if (enableInlineStyle) {\n StringBuffer defaultStyleBuffer = new StringBuffer();\n IStyle defaultStyle = report.findStyle(defaultStyleName);\n htmlEmitter.buildDefaultStyle(defaultStyleBuffer, defaultStyle);\n if (defaultStyleBuffer.length() > 0) {\n writer.attribute(HTMLTags.ATTR_STYLE, defaultStyleBuffer.toString());\n }\n } else {\n if (htmlIDNamespace != null) {\n writer.attribute(HTMLTags.ATTR_CLASS, htmlIDNamespace + defaultStyleName);\n } else {\n writer.attribute(HTMLTags.ATTR_CLASS, defaultStyleName);\n }\n }\n }\n }\n outputClientScript(report);\n return;\n }\n openRootTag();\n writeBidiFlag();\n writer.openTag(HTMLTags.TAG_HEAD);\n outputReportTitle(report);\n writer.openTag(HTMLTags.TAG_META);\n writer.attribute(HTMLTags.ATTR_HTTP_EQUIV, \"String_Node_Str\");\n writer.attribute(HTMLTags.ATTR_CONTENT, \"String_Node_Str\");\n if (!OUTPUT_FORMAT_HTML.equals(getOutputFormat())) {\n writer.closeTag(HTMLTags.TAG_META);\n }\n outputCSSStyles(reportDesign, designHandle);\n if (needFixTransparentPNG) {\n fixTransparentPNG();\n }\n fixRedirect();\n writer.closeTag(HTMLTags.TAG_HEAD);\n writer.openTag(HTMLTags.TAG_BODY);\n StringBuffer defaultStyleBuffer = new StringBuffer();\n if (report != null) {\n String defaultStyleName = report.getDesign().getRootStyleName();\n if (defaultStyleName != null) {\n if (enableInlineStyle) {\n IStyle defaultStyle = report.findStyle(defaultStyleName);\n htmlEmitter.buildDefaultStyle(defaultStyleBuffer, defaultStyle);\n } else {\n if (htmlIDNamespace != null) {\n writer.attribute(HTMLTags.ATTR_CLASS, htmlIDNamespace + defaultStyleName);\n } else {\n writer.attribute(HTMLTags.ATTR_CLASS, defaultStyleName);\n }\n }\n }\n }\n if (outputMasterPageContent) {\n defaultStyleBuffer.append(\"String_Node_Str\");\n }\n if (defaultStyleBuffer.length() > 0) {\n writer.attribute(HTMLTags.ATTR_STYLE, defaultStyleBuffer.toString());\n }\n outputClientScript(report);\n}\n"
|
"private List<Class> breakDownClassesGroupTreeLeaves(Class[] groupsGiven) {\n final List<Class> groupsToCheck = new ArrayList<Class>();\n if (groupsGiven.length > 0) {\n for (Class groupGiven : groupsGiven) {\n addLeavesToList(groupGiven, groupsToCheck);\n }\n }\n return groupsToCheck;\n}\n"
|
"protected void setupHexesGUI() {\n hexes = new ArrayList<GUIHex>();\n hexArray = mapManager.getHexes();\n MapHex mh;\n h = new GUIHex[hexArray.length][hexArray[0].length];\n for (int i = minX; i < hexArray.length; i++) {\n for (int j = minY; j < hexArray[0].length; j++) {\n mh = hexArray[i][j];\n if (mh != null) {\n GUIHex hex = new GUIHex(this, calcXCoordinates(mh.getColumn(), tileXOffset), calcYCoordinates(mh.getRow(), tileYOffset), scale, i - minX + 1, j - minY + 1);\n hex.setHexModel(mh);\n hex.originalTileId = hex.currentTileId;\n hexesByName.put(mh.getId(), hex);\n h[i][j] = hex;\n hexes.add(hex);\n }\n }\n }\n}\n"
|
"public javax.portlet.PortletRequestDispatcher getRequestDispatcher(String path) {\n try {\n RequestDispatcher rd = servletContext.getRequestDispatcher(path);\n return rd == null ? null : new PortletRequestDispatcherImpl(rd, parms);\n } catch (Exception e) {\n return null;\n }\n}\n"
|
"private void withdrawConsentOld(String healthCode, StudyConsent studyConsent) {\n DynamoUserConsent consentToDelete = new DynamoUserConsent(healthCode, studyConsent);\n consentToDelete.setWithdraw(NOT_WITHDRAW_YET);\n consentToDelete = mapperOld.load(consentToDelete);\n mapperOld.delete(consentToDelete);\n DynamoUserConsent consentToWithdraw = new DynamoUserConsent(consentToDelete);\n consentToWithdraw.setWithdraw(DateTime.now(DateTimeZone.UTC).getMillis());\n consentToWithdraw.setVersion(null);\n mapper.save(consentToWithdraw);\n}\n"
|
"public void setupImageLayout(View layout, final String source) {\n ImageView iv = (ImageView) layout;\n Bitmap b;\n if (!source.equals(\"String_Node_Str\")) {\n try {\n b = BitmapFactory.decodeStream(ReferenceManager._().DeriveReference(source).getStream());\n if (b == null) {\n iv.setImageDrawable(getResources().getDrawable(R.drawable.ic_menu_archive));\n } else {\n iv.setImageBitmap(b);\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n iv.setImageDrawable(getResources().getDrawable(R.drawable.ic_menu_archive));\n } catch (InvalidReferenceException ex) {\n ex.printStackTrace();\n iv.setImageDrawable(getResources().getDrawable(R.drawable.ic_menu_archive));\n }\n } else {\n iv.setImageDrawable(getResources().getDrawable(R.drawable.white));\n }\n}\n"
|
"public void handleVolumeSync(DataStore store) {\n if (store == null) {\n s_logger.warn(\"String_Node_Str\");\n return;\n }\n long storeId = store.getId();\n String lockString = \"String_Node_Str\" + storeId;\n GlobalLock syncLock = GlobalLock.getInternLock(lockString);\n try {\n if (syncLock.lock(3)) {\n try {\n Map<Long, TemplateProp> volumeInfos = listVolume(store);\n if (volumeInfos == null) {\n return;\n }\n List<VolumeDataStoreVO> dbVolumes = _volumeStoreDao.listByStoreId(storeId);\n List<VolumeDataStoreVO> toBeDownloaded = new ArrayList<VolumeDataStoreVO>(dbVolumes);\n for (VolumeDataStoreVO volumeStore : dbVolumes) {\n VolumeVO volume = _volumeDao.findById(volumeStore.getVolumeId());\n if (volume == null) {\n s_logger.warn(\"String_Node_Str\" + volumeStore.getVolumeId() + \"String_Node_Str\" + storeId + \"String_Node_Str\");\n volumeStore.setDestroyed(true);\n _volumeStoreDao.update(volumeStore.getId(), volumeStore);\n continue;\n }\n if (volumeInfos.containsKey(volume.getId())) {\n TemplateProp volInfo = volumeInfos.remove(volume.getId());\n toBeDownloaded.remove(volumeStore);\n s_logger.info(\"String_Node_Str\" + volume.getUuid() + \"String_Node_Str\");\n if (volumeStore.getDownloadState() != Status.DOWNLOADED) {\n volumeStore.setErrorString(\"String_Node_Str\");\n }\n if (volInfo.isCorrupted()) {\n volumeStore.setDownloadState(Status.DOWNLOAD_ERROR);\n String msg = \"String_Node_Str\" + volume.getUuid() + \"String_Node_Str\";\n volumeStore.setErrorString(msg);\n s_logger.info(\"String_Node_Str\");\n if (volumeStore.getDownloadUrl() == null) {\n msg = \"String_Node_Str\" + volume.getUuid() + \"String_Node_Str\" + volInfo.getInstallPath() + \"String_Node_Str\" + volumeStore.getDataStoreId();\n s_logger.warn(msg);\n } else {\n s_logger.info(\"String_Node_Str\" + volume.getName());\n _volumeStoreDao.remove(volumeStore.getId());\n toBeDownloaded.add(volumeStore);\n }\n } else {\n volumeStore.setDownloadPercent(100);\n volumeStore.setDownloadState(Status.DOWNLOADED);\n volumeStore.setState(ObjectInDataStoreStateMachine.State.Ready);\n volumeStore.setInstallPath(volInfo.getInstallPath());\n volumeStore.setSize(volInfo.getSize());\n volumeStore.setPhysicalSize(volInfo.getPhysicalSize());\n volumeStore.setLastUpdated(new Date());\n _volumeStoreDao.update(volumeStore.getId(), volumeStore);\n if (volume.getSize() == 0) {\n volume.setSize(volInfo.getSize());\n _volumeDao.update(volumeStore.getVolumeId(), volume);\n }\n if (volInfo.getSize() > 0) {\n try {\n _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(volume.getAccountId()), com.cloud.configuration.Resource.ResourceType.secondary_storage, volInfo.getSize() - volInfo.getPhysicalSize());\n } catch (ResourceAllocationException e) {\n s_logger.warn(e.getMessage());\n _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED, volume.getDataCenterId(), volume.getPodId(), e.getMessage(), e.getMessage());\n } finally {\n _resourceLimitMgr.recalculateResourceCount(volume.getAccountId(), volume.getDomainId(), com.cloud.configuration.Resource.ResourceType.secondary_storage.getOrdinal());\n }\n }\n }\n continue;\n }\n if (volumeStore.getDownloadState() != Status.DOWNLOADED) {\n s_logger.info(\"String_Node_Str\" + volume.getName() + \"String_Node_Str\" + storeId + \"String_Node_Str\");\n toBeDownloaded.add(volumeStore);\n }\n }\n if (toBeDownloaded.size() > 0) {\n for (VolumeDataStoreVO volumeHost : toBeDownloaded) {\n if (volumeHost.getDownloadUrl() == null) {\n s_logger.info(\"String_Node_Str\" + volumeHost.getVolumeId() + \"String_Node_Str\");\n continue;\n }\n if (store.getScope().getScopeType() == ScopeType.REGION) {\n if (volumeHost.getDownloadState() == VMTemplateStorageResourceAssoc.Status.DOWNLOADED && volumeHost.getInstallPath() == null) {\n s_logger.info(\"String_Node_Str\");\n continue;\n }\n }\n s_logger.debug(\"String_Node_Str\" + volumeHost.getVolumeId() + \"String_Node_Str\" + store.getName());\n VolumeInfo vol = volFactory.getVolume(volumeHost.getVolumeId());\n createVolumeAsync(vol, store);\n }\n }\n for (Map.Entry<Long, TemplateProp> entry : volumeInfos.entrySet()) {\n Long uniqueName = entry.getKey();\n TemplateProp tInfo = entry.getValue();\n VolumeObjectTO tmplTO = new VolumeObjectTO();\n tmplTO.setDataStore(store.getTO());\n tmplTO.setPath(tInfo.getInstallPath());\n tmplTO.setId(tInfo.getId());\n DeleteCommand dtCommand = new DeleteCommand(tmplTO);\n EndPoint ep = _epSelector.select(store);\n Answer answer = null;\n if (ep == null) {\n String errMsg = \"String_Node_Str\";\n s_logger.error(errMsg);\n answer = new Answer(dtCommand, false, errMsg);\n } else {\n answer = ep.sendMessage(dtCommand);\n }\n if (answer == null || !answer.getResult()) {\n s_logger.info(\"String_Node_Str\" + store.getName());\n } else {\n String description = \"String_Node_Str\" + tInfo.getTemplateName() + \"String_Node_Str\" + storeId;\n s_logger.info(description);\n }\n }\n } finally {\n syncLock.unlock();\n }\n } else {\n s_logger.info(\"String_Node_Str\" + lockString + \"String_Node_Str\" + storeId + \"String_Node_Str\");\n }\n } finally {\n syncLock.releaseRef();\n }\n}\n"
|
"protected void createLogPropertyFiles(File directory) {\n ArgumentNotValid.checkNotNull(directory, \"String_Node_Str\");\n for (Application app : applications) {\n try {\n PrintWriter logPrinter = new PrintWriter(logProp);\n try {\n logfw.write(prop);\n } finally {\n if (logfw != null) {\n logfw.close();\n }\n }\n } catch (IOException e) {\n String errMsg = \"String_Node_Str\";\n log.warn(errMsg, e);\n throw new IOFailure(errMsg, e);\n }\n }\n}\n"
|
"public void onPause() {\n String serverAddress = serverAddressView.getText().toString().trim();\n Object selectedRoomName = roomNameView.getSelectedItem();\n String roomName = \"String_Node_Str\";\n if (selectedRoomName != null) {\n roomName = selectedRoomName.toString().trim();\n }\n editor.putString(getString(R.string.PREFERENCES_SERVER_ADDRESS), serverAddress);\n editor.putString(getString(R.string.PREFERENCES_ROOM_NAME), roomName);\n editor.commit();\n proxy.setServer(serverAddress);\n super.onPause();\n}\n"
|
"public void put(String key, DataSet dataSet) {\n File file = resolveKey(key);\n File parentDir = file.getParentFile();\n if (!parentDir.exists()) {\n if (!parentDir.mkdirs()) {\n throw new IllegalStateException(\"String_Node_Str\" + parentDir);\n }\n dataSet.save(file);\n }\n}\n"
|
"protected void actionPerformed(GuiButton button) {\n if (tileEntity.getTurret() != null) {\n switch(button.id) {\n case 0:\n {\n this.entityPlayer.openGui(ZhuYaoGangShao.instance, CommonProxy.GUI_PLATFORM_TERMINAL_ID, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord);\n break;\n }\n case 1:\n {\n this.entityPlayer.openGui(ZhuYaoGangShao.instance, CommonProxy.GUI_PLATFORM_ACCESS_ID, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord);\n break;\n }\n case 2:\n {\n this.entityPlayer.openGui(ZhuYaoGangShao.instance, CommonProxy.GUI_PLATFORM_ID, this.tileEntity.worldObj, this.tileEntity.xCoord, this.tileEntity.yCoord, this.tileEntity.zCoord);\n break;\n }\n case 3:\n {\n }\n }\n }\n}\n"
|
"public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {\n String schemaName = getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName();\n CreateTableStatement statement = new CreateTableStatement(schemaName, getTableName());\n for (ColumnConfig column : getColumns()) {\n ConstraintsConfig constraints = column.getConstraints();\n boolean isAutoIncrement = column.isAutoIncrement() != null && column.isAutoIncrement();\n if (constraints != null && constraints.isPrimaryKey() != null && constraints.isPrimaryKey()) {\n statement.addPrimaryKeyColumn(column.getName(), database.getColumnType(column.getType(), isAutoIncrement), constraints.getPrimaryKeyName());\n } else {\n String defaultValue = null;\n if (column.hasDefaultValue()) {\n defaultValue = StringUtils.trimToNull(column.getDefaultColumnValue(database));\n }\n statement.addColumn(column.getName(), database.getColumnType(column.getType(), column.isAutoIncrement()), defaultValue);\n }\n if (constraints != null) {\n if (constraints.isNullable() != null && !constraints.isNullable()) {\n statement.addColumnConstraint(new NotNullConstraint(column.getName()));\n }\n if (constraints.getReferences() != null) {\n if (StringUtils.trimToNull(constraints.getForeignKeyName()) == null) {\n throw new UnsupportedChangeException(\"String_Node_Str\");\n }\n ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint(constraints.getForeignKeyName(), constraints.getReferences());\n fkConstraint.setColumn(column.getName());\n fkConstraint.setDeleteCascade(constraints.isDeleteCascade() != null && constraints.isDeleteCascade());\n fkConstraint.setInitiallyDeferred(constraints.isInitiallyDeferred() != null && constraints.isInitiallyDeferred());\n fkConstraint.setDeferrable(constraints.isDeferrable() != null && constraints.isDeferrable());\n statement.addColumnConstraint(fkConstraint);\n }\n if (constraints.isUnique() != null && constraints.isUnique()) {\n statement.addColumnConstraint(new UniqueConstraint(constraints.getUniqueConstraintName()).addColumns(column.getName()));\n }\n }\n if (isAutoIncrement) {\n statement.addColumnConstraint(new AutoIncrementConstraint(column.getName()));\n }\n }\n statement.setTablespace(StringUtils.trimToNull(getTablespace()));\n List<SqlStatement> statements = new ArrayList<SqlStatement>();\n statements.add(statement);\n return statements.toArray(new SqlStatement[statements.size()]);\n}\n"
|
"protected DatabaseConnection fillCatalogSchema(IMetadataConnection newMetadataConn) {\n MetadataFillFactory instance = MetadataFillFactory.getDBInstance();\n ReturnCode rc = instance.checkConnection(newMetadataConn);\n DatabaseConnection dbConn = null;\n if (rc.isOk()) {\n dbConn = (DatabaseConnection) instance.fillUIConnParams(newMetadataConn, null);\n DatabaseMetaData dbMetadata = null;\n java.sql.Connection sqlConn = null;\n try {\n if (rc instanceof TypedReturnCode) {\n Object sqlConnObject = ((TypedReturnCode) rc).getObject();\n if (sqlConnObject instanceof java.sql.Connection) {\n sqlConn = (java.sql.Connection) sqlConnObject;\n dbMetadata = ExtractMetaDataUtils.getInstance().getConnectionMetadata(sqlConn);\n }\n }\n List<String> packageFilterCatalog = MetadataConnectionUtils.getPackageFilter(dbConn, dbMetadata, true);\n instance.fillCatalogs(dbConn, dbMetadata, packageFilterCatalog);\n List<String> packageFilterSchema = MetadataConnectionUtils.getPackageFilter(dbConn, dbMetadata, false);\n instance.fillSchemas(dbConn, dbMetadata, packageFilterSchema);\n } catch (SQLException e) {\n log.error(e, e);\n } finally {\n if (sqlConn != null) {\n ConnectionUtils.closeConnection(sqlConn);\n }\n }\n } else {\n log.error(rc.getMessage());\n }\n return dbConn;\n}\n"
|
"public static void claimChunk(final CommandContext args, final MyResidence plugin, final Nation nation, final Player player, final Session session) throws MyResidenceException {\n final Town selectedTown = session.getSelectedTown();\n final Chunk playerChunk = player.getLocation().getBlock().getChunk();\n final Vector2D chunkVector = new Vector2D(playerChunk.getX(), playerChunk.getZ());\n final World chunkWorld = playerChunk.getWorld();\n if (!session.hasMajorRights(selectedTown)) {\n throw new PermissionsDeniedException(\"String_Node_Str\");\n }\n if (args.hasFlag('i') && !nation.getPermissionsResolver().isAdmin(player)) {\n throw new PermissionsDeniedException(\"String_Node_Str\");\n }\n Town chunkOwner = nation.getChunkManager().getChunkOwner(chunkWorld, chunkVector);\n if (chunkOwner != null) {\n if (chunkOwner.equals(selectedTown)) {\n throw new MyResidenceException(\"String_Node_Str\");\n } else if (!args.hasFlag('i')) {\n throw new MyResidenceException(\"String_Node_Str\");\n }\n }\n double chunkCost = plugin.getConfiguration(player.getWorld()).getChunkCost();\n double townMoney = selectedTown.getMoney();\n if (townMoney < chunkCost) {\n throw new NotEnoughMoneyException(chunkCost);\n } else {\n selectedTown.subtractMoney(chunkCost);\n }\n nation.getChunkManager().addChunk(selectedTown, chunkWorld, chunkVector);\n player.sendMessage(ChatColor.DARK_GREEN + \"String_Node_Str\" + ChatColor.GREEN + plugin.format(chunkCost) + ChatColor.DARK_GREEN + \"String_Node_Str\");\n}\n"
|
"public String getToolTip() {\n if (toolTip != null)\n return toolTip;\n else\n return getDefaultToolTip();\n}\n"
|
"private static void appendWhereStatement(JoinedFlatTableDesc intermediateTableDesc, StringBuilder sql) {\n boolean hasCondition = false;\n StringBuilder whereBuilder = new StringBuilder();\n whereBuilder.append(\"String_Node_Str\");\n CubeDesc cubeDesc = intermediateTableDesc.getCubeDesc();\n if (cubeDesc.getFilterCondition() != null && cubeDesc.getFilterCondition().equals(\"String_Node_Str\") == false) {\n whereBuilder.append(\"String_Node_Str\").append(cubeDesc.getFilterCondition()).append(\"String_Node_Str\");\n hasCondition = true;\n }\n CubeSegment cubeSegment = intermediateTableDesc.getCubeSegment();\n if (null != cubeSegment) {\n long dateStart = cubeSegment.getDateRangeStart();\n long dateEnd = cubeSegment.getDateRangeEnd();\n if (cubeSegment.getCubeInstance().needMergeImmediatelyAfterBuild(cubeSegment)) {\n dateStart = cubeSegment.getCubeInstance().getDateRange()[1];\n }\n if (!(dateStart == 0 && dateEnd == 0)) {\n String partitionColumnName = cubeDesc.getCubePartitionDesc().getPartitionDateColumn();\n whereBuilder.append(hasCondition ? \"String_Node_Str\" : \"String_Node_Str\");\n if (dateStart > 0) {\n whereBuilder.append(partitionColumnName + \"String_Node_Str\" + formatDateTimeInWhereClause(dateStart) + \"String_Node_Str\");\n whereBuilder.append(\"String_Node_Str\");\n }\n whereBuilder.append(partitionColumnName + \"String_Node_Str\" + formatDateTimeInWhereClause(dateEnd) + \"String_Node_Str\");\n whereBuilder.append(\"String_Node_Str\");\n hasCondition = true;\n }\n }\n if (hasCondition) {\n sql.append(whereBuilder.toString());\n }\n}\n"
|
"public ArrayList<String> getIssueUsersExceptMe() {\n if (timeline == null)\n return null;\n ArrayList<String> users = new ArrayList<String>();\n for (IssueEvent event : timeline) {\n String userLoginId = event.getUser() == null ? event.getActor().getLogin() : event.getUser().getLogin();\n if (!AppData.INSTANCE.getLoggedUser().getLogin().equals(userLoginId) && !users.contains(userLoginId)) {\n users.add(userLoginId);\n }\n }\n return users;\n}\n"
|
"private void addToHttpQueue(String json, String endPoint, String httpMethod) {\n LQQueue queuedEvent = new LQQueue(endPoint, httpMethod, json);\n mHttpQueue.add(queuedEvent);\n if (mHttpQueue.size() > LIQUID_QUEUE_SIZE_LIMIT) {\n mHttpQueue.remove(0);\n }\n LQQueue.saveQueue(mContext, mHttpQueue, mApiToken);\n}\n"
|
"public void testDeprecatedStaticFlip() {\n RoaringBitmap rb1 = RoaringBitmap.flip(new RoaringBitmap(), 300000, 500000);\n RoaringBitmap rb2 = RoaringBitmap.flip(new RoaringBitmap(), 300000L, 500000L);\n assertTrue(rb1.equals(rb2));\n RoaringBitmap.flip(rb1, Integer.MAX_VALUE + 300000, Integer.MAX_VALUE + 500000);\n RoaringBitmap.flip(rb2, Integer.MAX_VALUE + 300000L, Integer.MAX_VALUE + 500000L);\n assertTrue(rb1.equals(rb2));\n}\n"
|
"public void processLineOut(final String line) {\n if (DownloadInfo.isProgress(line)) {\n final DownloadInfo dinf = new DownloadInfo(line);\n final double c = dinf.progress / 100.0;\n double base = (double) (current - 1) / (double) total;\n base += c / total;\n StepDownload.this.reportProgress(base);\n }\n if (line.contains(\"String_Node_Str\")) {\n final String[] p = line.split(\"String_Node_Str\")[1].split(\"String_Node_Str\");\n current = Integer.parseInt(p[0]);\n total = Integer.parseInt(p[1]);\n }\n if (line.contains(\"String_Node_Str\") && line.contains(\"String_Node_Str\")) {\n String p = line.split(\"String_Node_Str\")[1].trim();\n p = p.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n StepDownload.this.entry.addDownloadTempFile(new File(p));\n }\n if (line.contains(\"String_Node_Str\") && line.contains(\"String_Node_Str\")) {\n String p = line.split(\"String_Node_Str\")[1].substring(2);\n p = p.split(\"String_Node_Str\")[0].trim();\n StepDownload.this.entry.addDownloadTempFile(new File(p));\n }\n}\n"
|
"private void processSequence(ShortKmer startKmer) {\n int value = hm.get(startKmer.toLong());\n StringBuilder sequenceSB = new StringBuilder(startKmer.toString());\n long seqWeight = value;\n int minWeight = value, maxWeight = value;\n ShortKmer kmer = new ShortKmer(startKmer);\n while (true) {\n byte rightNuc = HashMapOperations.getRightNucleotide(hm, kmer, freqThreshold);\n if (rightNuc < 0) {\n break;\n }\n kmer.shiftRight(rightNuc);\n byte leftNuc = HashMapOperations.getLeftNucleotide(hm, kmer, freqThreshold);\n if (leftNuc < 0) {\n break;\n }\n sequenceSB.append(DnaTools.toChar(rightNuc));\n value = hm.get(kmer.toLong());\n seqWeight += value;\n minWeight = Math.min(minWeight, value);\n maxWeight = Math.max(maxWeight, value);\n }\n if (sequenceSB.length() >= lenThreshold) {\n sequenceList.add(new Sequence(sequenceSB.toString(), seqWeight, minWeight, maxWeight));\n }\n}\n"
|
"private String getFinalAccessStatement(CodeBlock.Builder codeBuilder, boolean isModelContainerAdapter, String statement) {\n String finalAccessStatement = statement;\n if (columnAccess instanceof TypeConverterAccess || isModelContainerAdapter) {\n finalAccessStatement = getRefName();\n TypeName typeName;\n if (columnAccess instanceof TypeConverterAccess) {\n typeName = ((TypeConverterAccess) columnAccess).typeConverterDefinition.getDbTypeName();\n } else {\n typeName = ModelUtils.getModelContainerType(manager, elementTypeName);\n statement = ModelUtils.getVariable(isModelContainerAdapter) + \"String_Node_Str\" + statement + \"String_Node_Str\" + referencedTableClassName + \"String_Node_Str\";\n }\n codeBuilder.addStatement(\"String_Node_Str\", typeName, finalAccessStatement, statement);\n }\n return finalAccessStatement;\n}\n"
|
"public boolean isFertile() {\n return GrowthRequirements.getGrowthRequirement(this.seed, this.seedMeta).canGrow(this.worldObj, this.xCoord, this.yCoord, this.zCoord);\n}\n"
|
"public AbstractRecord buildRowFromPrimaryKeyValues(Vector key, AbstractSession session) {\n AbstractRecord databaseRow = createRecord(key.size(), session);\n int keySize = key.size();\n for (int index = 0; index < keySize; index++) {\n DatabaseField field = this.descriptor.getPrimaryKeyFields().get(index);\n Object value = key.elementAt(index);\n value = session.getPlatform(this.descriptor.getJavaClass()).getConversionManager().convertObject(value, field.getType());\n databaseRow.put(field, value);\n }\n return databaseRow;\n}\n"
|
"public void manifestBasedCacheHit() throws Exception {\n DefaultDependencyFileRuleKeyFactory depFilefactory = new DefaultDependencyFileRuleKeyFactory(FIELD_LOADER, fileHashCache, pathResolver, ruleFinder);\n BuildTarget target = BuildTargetFactory.newInstance(\"String_Node_Str\");\n BuildRuleParams params = new FakeBuildRuleParamsBuilder(target).setProjectFilesystem(filesystem).build();\n final SourcePath input = new PathSourcePath(filesystem, filesystem.getRootPath().getFileSystem().getPath(\"String_Node_Str\"));\n filesystem.touch(pathResolver.getRelativePath(input));\n final Path output = Paths.get(\"String_Node_Str\");\n DepFileBuildRule rule = new DepFileBuildRule(params) {\n private final SourcePath path = input;\n public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {\n return ImmutableList.of(new WriteFileStep(filesystem, \"String_Node_Str\", output, false));\n }\n public Predicate<SourcePath> getCoveredByDepFilePredicate() {\n return (SourcePath path) -> true;\n }\n public Predicate<SourcePath> getExistenceOfInterestPredicate() {\n return (SourcePath path) -> false;\n }\n public ImmutableList<SourcePath> getInputsAfterBuildingLocally(BuildContext context) {\n return ImmutableList.of(input);\n }\n public SourcePath getSourcePathToOutput() {\n return new ExplicitBuildTargetSourcePath(getBuildTarget(), output);\n }\n };\n CachingBuildEngine cachingBuildEngine = cachingBuildEngineFactory().setDepFiles(CachingBuildEngine.DepFiles.CACHE).setRuleKeyFactories(RuleKeyFactories.of(defaultRuleKeyFactory, inputBasedRuleKeyFactory, depFilefactory)).build();\n RuleKey ruleKey = defaultRuleKeyFactory.build(rule);\n RuleKeyAndInputs depFileKey = depFilefactory.build(rule, ImmutableList.of(DependencyFileEntry.fromSourcePath(input, pathResolver)));\n Manifest manifest = new Manifest(depFilefactory.buildManifestKey(rule).getRuleKey());\n manifest.addEntry(fileHashCache, depFileKey.getRuleKey(), pathResolver, ImmutableSet.of(input), ImmutableSet.of(input));\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n try (GZIPOutputStream outputStream = new GZIPOutputStream(byteArrayOutputStream)) {\n manifest.serialize(outputStream);\n }\n cache.store(ArtifactInfo.builder().addRuleKeys(cachingBuildEngine.getManifestRuleKey(rule, buildContext.getEventBus()).get()).build(), byteArrayOutputStream.toByteArray());\n Path artifact = tmp.newFile(\"String_Node_Str\");\n writeEntriesToZip(artifact, ImmutableMap.of(BuildInfo.getPathToMetadataDirectory(target, filesystem).resolve(BuildInfo.MetadataKey.RECORDED_PATHS), ObjectMappers.WRITER.writeValueAsString(ImmutableList.of(output.toString())), output, \"String_Node_Str\"));\n cache.store(ArtifactInfo.builder().addRuleKeys(depFileKey.getRuleKey()).putMetadata(BuildInfo.MetadataKey.ORIGIN_BUILD_ID, buildContext.getBuildId().toString()).putMetadata(BuildInfo.MetadataKey.DEP_FILE_RULE_KEY, depFileKey.getRuleKey().toString()).putMetadata(BuildInfo.MetadataKey.DEP_FILE, ObjectMappers.WRITER.writeValueAsString(depFileKey.getInputs().stream().map(pathResolver::getRelativePath).collect(MoreCollectors.toImmutableList()))).build(), BorrowablePath.notBorrowablePath(artifact));\n BuildResult result = cachingBuildEngine.build(buildContext, TestExecutionContext.newInstance(), rule).get();\n assertThat(getSuccess(result), equalTo(BuildRuleSuccessType.FETCHED_FROM_CACHE_MANIFEST_BASED));\n for (RuleKey key : ImmutableSet.of(ruleKey, depFileKey.getRuleKey())) {\n LazyPath fetchedArtifact = LazyPath.ofInstance(tmp.newFile(\"String_Node_Str\"));\n CacheResult cacheResult = cache.fetch(key, fetchedArtifact);\n assertThat(cacheResult.getType(), equalTo(CacheResultType.HIT));\n assertThat(cacheResult.getMetadata().get(BuildInfo.MetadataKey.RULE_KEY), equalTo(ruleKey.toString()));\n assertThat(cacheResult.getMetadata().get(BuildInfo.MetadataKey.DEP_FILE_RULE_KEY), equalTo(depFileKey.getRuleKey().toString()));\n assertThat(cacheResult.getMetadata().get(BuildInfo.MetadataKey.DEP_FILE), equalTo(ObjectMappers.WRITER.writeValueAsString(depFileKey.getInputs().stream().map(pathResolver::getRelativePath).collect(MoreCollectors.toImmutableList()))));\n Files.delete(fetchedArtifact.get());\n }\n}\n"
|
"public Method getAuditedMethod(HandlerMethod controllerMethod) {\n RequestMapping methodMapping = AnnotationUtils.findAnnotation(controllerMethod.getMethod(), RequestMapping.class);\n RequestMapping controllerMapping = AnnotationUtils.findAnnotation(controllerMethod.getMethod().getDeclaringClass(), RequestMapping.class);\n String contextPath = null;\n String httpMethod = null;\n if (controllerMapping != null) {\n contextPath = getRequestMappingPath(controllerMapping);\n httpMethod = getRequestMappingMethod(controllerMapping);\n if (methodMapping != null) {\n String methodContextPath = getRequestMappingPath(methodMapping);\n String methodHttpMethod = getRequestMappingMethod(methodMapping);\n if (contextPath == null) {\n contextPath = methodContextPath;\n } else if (methodContextPath != null) {\n contextPath += methodContextPath;\n }\n if (httpMethod == null) {\n httpMethod = methodHttpMethod;\n }\n }\n } else if (methodMapping != null) {\n contextPath = getRequestMappingPath(methodMapping);\n httpMethod = getRequestMappingMethod(methodMapping);\n }\n if (httpMethod == null) {\n return null;\n }\n Audit audit = getAuditAnnotation(controllerMethod);\n return new Method(contextPath, httpMethod, getAuditCategoryName(controllerMethod, audit), getAuditActionName(controllerMethod, audit));\n}\n"
|
"public void testBasic4() throws Exception {\n ICubeQueryDefinition cqd = new CubeQueryDefinition(cubeName);\n IEdgeDefinition columnEdge = cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);\n IEdgeDefinition rowEdge = cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);\n IDimensionDefinition dim1 = columnEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition hier1 = dim1.createHierarchy(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n hier1.createLevel(\"String_Node_Str\");\n IDimensionDefinition dim2 = rowEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition hier2 = dim2.createHierarchy(\"String_Node_Str\");\n hier2.createLevel(\"String_Node_Str\");\n cqd.createMeasure(\"String_Node_Str\");\n IBinding binding1 = new Binding(\"String_Node_Str\");\n binding1.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding1);\n IBinding binding2 = new Binding(\"String_Node_Str\");\n binding2.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding2);\n IBinding binding3 = new Binding(\"String_Node_Str\");\n binding3.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding3);\n IBinding binding4 = new Binding(\"String_Node_Str\");\n binding4.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding4);\n IBinding binding5 = new Binding(\"String_Node_Str\");\n binding5.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding5);\n IBinding binding6 = new Binding(\"String_Node_Str\");\n binding6.setExpression(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding6);\n IBinding binding7 = new Binding(\"String_Node_Str\");\n binding7.setExpression(new ScriptExpression(\"String_Node_Str\"));\n binding7.setAggrFunction(IBuildInAggregation.TOTAL_WEIGHTEDAVE_FUNC);\n binding7.addAggregateOn(\"String_Node_Str\");\n binding7.addArgument(new ScriptExpression(\"String_Node_Str\"));\n cqd.addBinding(binding7);\n DataEngineImpl engine = (DataEngineImpl) DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION, null, null, null));\n this.createCube(engine);\n IPreparedCubeQuery pcq = engine.prepare(cqd, null);\n ICubeQueryResults queryResults = pcq.execute(null);\n CubeCursor cursor = queryResults.getCubeCursor();\n List columnEdgeBindingNames = new ArrayList();\n columnEdgeBindingNames.add(\"String_Node_Str\");\n columnEdgeBindingNames.add(\"String_Node_Str\");\n columnEdgeBindingNames.add(\"String_Node_Str\");\n this.printCube(cursor, columnEdgeBindingNames, \"String_Node_Str\", \"String_Node_Str\", null, \"String_Node_Str\", null);\n}\n"
|
"public void widgetSelected(SelectionEvent e) {\n testButton.setEnabled(false);\n try {\n if (testConnection()) {\n MessageDialog.openInformation(getShell(), JdbcPlugin.getResourceString(\"String_Node_Str\"), JdbcPlugin.getResourceString(\"String_Node_Str\"));\n } else {\n ExceptionHandler.showException(getShell(), JdbcPlugin.getResourceString(\"String_Node_Str\"), JdbcPlugin.getResourceString(\"String_Node_Str\"), null);\n }\n } catch (OdaException e1) {\n MessageDialog.openError(getShell(), JdbcPlugin.getResourceString(\"String_Node_Str\"), e1.getLocalizedMessage());\n }\n testButton.setEnabled(true);\n}\n"
|
"public float getGroupExpandFraction() {\n int visibleChildrenExpandedHeight = getVisibleChildrenExpandHeight();\n int minExpandHeight = getCollapsedHeight();\n float factor = (mActualHeight - minExpandHeight) / (float) (visibleChildrenExpandedHeight - minExpandHeight);\n return Math.max(0.0f, Math.min(1.0f, factor));\n}\n"
|
"public void testBindingFormatList() throws Exception {\n List<Object> inputFiles = new ArrayList<Object>();\n inputFiles.add(new File(FILE_OXM_XML));\n inputFiles.add(new InputSource(new FileInputStream(INPUT_SRC_OXM_XML)));\n inputFiles.add(new FileInputStream(INPUT_STRM_OXM_XML));\n inputFiles.add(new InputStreamReader(new FileInputStream(READER_OXM_XML)));\n inputFiles.add(new StreamSource(ClassLoader.getSystemResourceAsStream(SOURCE_OXM_XML)));\n Map<String, Object> properties = new HashMap<String, Object>();\n properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY, inputFiles);\n Class[] listClasses = new Class[] { org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.bindingformat.file.Foo.class, org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.bindingformat.inputsource.Foo.class, org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.bindingformat.inputstream.Foo.class, org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.bindingformat.reader.Foo.class, org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.bindingformat.source.Foo.class };\n JAXBContext jCtx = (JAXBContext) JAXBContextFactory.createContext(listClasses, properties, loader);\n doTestFile(jCtx);\n doTestInputSrc(jCtx);\n doTestInputStrm(jCtx);\n doTestReader(jCtx);\n doTestSource(jCtx);\n}\n"
|
"protected boolean playAbility(ActivatedAbility ability, Game game) {\n if (ability.isUsesStack()) {\n if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) {\n int bookmark = game.bookmarkState();\n ability.newId();\n game.getStack().push(new StackAbility(ability, playerId));\n if (ability.activate(game, false)) {\n game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY, ability.getId(), ability.getSourceId(), playerId));\n if (!game.isSimulation()) {\n game.informPlayers(getLogName() + ability.getGameLogMessage(game));\n }\n game.removeBookmark(bookmark);\n resetStoredBookmark(game);\n return true;\n }\n restoreState(bookmark, ability.getRule(), game);\n }\n } else {\n int bookmark = game.bookmarkState();\n if (ability.activate(game, false)) {\n ability.resolve(game);\n game.removeBookmark(bookmark);\n resetStoredBookmark(game);\n return true;\n }\n game.restoreState(bookmark, ability.getRule());\n }\n return false;\n}\n"
|
"public ItemStack decrStackSize(ItemStack me, int slot, int size) {\n NBTTagCompound plateNBT = getPlateNBT(me);\n if (plateNBT != null) {\n ItemStack toBeRemoved = new ItemStack(plateNBT.getCompoundTag(\"String_Node_Str\"));\n me.getTagCompound().removeTag(\"String_Node_Str\");\n return toBeRemoved;\n }\n return ItemStack.EMPTY;\n}\n"
|
"public String toString() {\n StringBuilder sb = new StringBuilder(64);\n for (int i = 0, n = list.size(); i < n; i++) {\n Pair<String, String> pair = list.get(i);\n if (i > 0) {\n sb.append(\"String_Node_Str\");\n }\n sb.append(pair.left);\n sb.append('=');\n final String right = pair.right;\n if (right == null) {\n sb.append(\"String_Node_Str\");\n } else {\n final int needsQuote = right.indexOf(';');\n if (needsQuote >= 0) {\n if (right.charAt(0) != '\\'') {\n sb.append(\"String_Node_Str\");\n }\n sb.append(replace(right, \"String_Node_Str\", \"String_Node_Str\"));\n if (right.charAt(right.length() - 1) != '\\'') {\n sb.append(\"String_Node_Str\");\n }\n } else {\n sb.append(right);\n }\n }\n }\n return sb.toString();\n}\n"
|
"public boolean cancel(String uuid, boolean interrupt) {\n final CallableProcessor processor = submittedTasks.remove(uuid);\n if (processor != null && processor.cancel(interrupt)) {\n processor.sendResponse(new CancellationException());\n getLocalExecutorStats(processor.name).cancelExecution();\n return true;\n }\n return false;\n}\n"
|
"public void addClassFile(UnwovenClassFile classFile) {\n addedClasses.add(classFile);\n if (null != sourceJavaClasses.put(classFile.getClassName(), classFile)) {\n }\n world.addSourceObjectType(classFile.getJavaClass());\n}\n"
|
"public static List<File> exportNodeAS(List<Tag> allTags, AbortRetryIgnoreHandler handler, List<TagNode> nodeList, String outdir, ExportMode exportMode, AtomicInteger index, int count, EventListener ev) throws IOException {\n File dir = new File(outdir);\n List<File> ret = new ArrayList<>();\n if (!outdir.endsWith(File.separator)) {\n outdir = outdir + File.separator;\n }\n List<String> existingNames = new ArrayList<>();\n for (TagNode node : nodeList) {\n String name = \"String_Node_Str\";\n if (node.tag instanceof Exportable) {\n name = ((Exportable) node.tag).getExportFileName(allTags);\n } else {\n name = Helper.makeFileName(node.tag.toString());\n }\n int i = 1;\n String baseName = name;\n while (existingNames.contains(name)) {\n i++;\n name = baseName + \"String_Node_Str\" + i;\n }\n existingNames.add(name);\n if (node.subItems.isEmpty()) {\n if ((node.tag instanceof ASMSource) && (node.export)) {\n if (!dir.exists()) {\n if (!dir.mkdirs()) {\n if (!dir.exists()) {\n continue;\n }\n }\n }\n boolean retry;\n do {\n retry = false;\n try {\n long startTime = System.currentTimeMillis();\n String f = outdir + name + \"String_Node_Str\";\n File file = new File(f);\n String res;\n ASMSource asm = ((ASMSource) node.tag);\n if (exportMode == ExportMode.HEX) {\n HilightedTextWriter writer = new HilightedTextWriter(false);\n asm.getActionSourcePrefix(writer);\n asm.getActionBytesAsHex(writer);\n res = asm.getActionSourcePrefix() + writer.toString() + asm.getActionSourceSuffix();\n } else if (exportMode != ExportMode.SOURCE) {\n HilightedTextWriter writer = new HilightedTextWriter(false, asm.getActionSourceIndent());\n asm.getASMSource(SWF.DEFAULT_VERSION, exportMode, writer, null);\n String str = writer.toString();\n res = asm.getActionSourcePrefix() + str + asm.getActionSourceSuffix();\n } else {\n List<Action> as = asm.getActions(SWF.DEFAULT_VERSION);\n Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION);\n res = asm.getActionSourcePrefix() + Action.actionsToSource(as, SWF.DEFAULT_VERSION, \"String_Node_Str\", false, asm.getActionSourceIndent()) + asm.getActionSourceSuffix();\n }\n try (FileOutputStream fos = new FileOutputStream(f)) {\n fos.write(res.getBytes(\"String_Node_Str\"));\n }\n long stopTime = System.currentTimeMillis();\n if (ev != null) {\n long time = stopTime - startTime;\n ev.handleEvent(\"String_Node_Str\", \"String_Node_Str\" + index.getAndIncrement() + \"String_Node_Str\" + count + \"String_Node_Str\" + f + \"String_Node_Str\" + Helper.formatTimeSec(time));\n }\n ret.add(file);\n } catch (Exception | OutOfMemoryError | StackOverflowError ex) {\n Logger.getLogger(TagNode.class.getName()).log(Level.SEVERE, \"String_Node_Str\", ex);\n if (handler != null) {\n int action = handler.getNewInstance().handle(ex);\n switch(action) {\n case AbortRetryIgnoreHandler.ABORT:\n throw ex;\n case AbortRetryIgnoreHandler.RETRY:\n retry = true;\n break;\n case AbortRetryIgnoreHandler.IGNORE:\n retry = false;\n break;\n }\n }\n }\n } while (retry);\n }\n } else {\n ret.addAll(exportNodeAS(allTags, handler, node.subItems, outdir + name, exportMode, index, count, ev));\n }\n }\n return ret;\n}\n"
|
"public void testTimedFlushConsumerStateWhenAutoCommitIsDisabled() throws InterruptedException {\n final SidelineConsumerConfig config = getDefaultSidelineConsumerConfig(topicName);\n config.setConsumerStateAutoCommit(false);\n config.setConsumerStateAutoCommitIntervalMs(1000);\n PersistenceManager mockPersistenceManager = mock(PersistenceManager.class);\n Instant instant = Clock.systemUTC().instant();\n Clock mockClock = Clock.fixed(instant, ZoneId.systemDefault());\n SidelineConsumer sidelineConsumer = new SidelineConsumer(config, mockPersistenceManager);\n sidelineConsumer.setClock(mockClock);\n sidelineConsumer.timedFlushConsumerState();\n verify(mockPersistenceManager, never()).persistConsumerState(anyString(), anyObject());\n Thread.sleep(1500);\n sidelineConsumer.timedFlushConsumerState();\n verify(mockPersistenceManager, never()).persistConsumerState(anyString(), anyObject());\n instant = instant.plus(2000, ChronoUnit.MILLIS);\n mockClock = Clock.fixed(instant, ZoneId.systemDefault());\n sidelineConsumer.setClock(mockClock);\n sidelineConsumer.timedFlushConsumerState();\n verify(mockPersistenceManager, never()).persistConsumerState(anyString(), anyObject());\n sidelineConsumer.timedFlushConsumerState();\n verify(mockPersistenceManager, never()).persistConsumerState(anyString(), anyObject());\n instant = instant.plus(1500, ChronoUnit.MILLIS);\n mockClock = Clock.fixed(instant, ZoneId.systemDefault());\n sidelineConsumer.setClock(mockClock);\n sidelineConsumer.timedFlushConsumerState();\n verify(mockPersistenceManager, never()).persistConsumerState(anyString(), anyObject());\n}\n"
|
"public static String toString(Model model) {\n String result = \"String_Node_Str\";\n for (final StmtIterator i = model.listStatements(); i.hasNext(); ) {\n final Statement stmt = i.nextStatement();\n result += PrintUtil.print(stmt) + Parser.NL;\n }\n return result;\n}\n"
|
"void sendRequestMessage(Request mes, Contact to, Message message) {\n CallIdHeader call = (CallIdHeader) mes.getHeader(CallIdHeader.NAME);\n String callid = call.getCallId();\n AuthorizationHeader authorization = sipProvider.getSipSecurityManager().getCachedAuthorizationHeader(callid);\n if (authorization != null)\n mes.addHeader(authorization);\n ClientTransaction messageTransaction;\n SipProvider jainSipProvider = this.sipProvider.getDefaultJainSipProvider();\n messageTransaction = jainSipProvider.getNewClientTransaction(mes);\n messageTransaction.sendRequest();\n String key = ((CallIdHeader) mes.getHeader(CallIdHeader.NAME)).getCallId();\n this.sentMsg.put(key, message);\n}\n"
|
"public void updateSerializer(SSerializerPluginConfiguration serializer) throws ServerException, UserException {\n requireRealUserAuthentication();\n DatabaseSession session = getBimServer().getDatabase().createSession();\n try {\n SerializerPluginConfiguration convert = session.get(serializer.getOid(), OldQuery.getDefault());\n getBimServer().getSConverter().convertFromSObject(serializer, convert, session);\n session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session, getInternalAccessMethod(), convert));\n } catch (Exception e) {\n handleException(e);\n } finally {\n session.close();\n }\n}\n"
|
"private void populateAggregationSort(CubeQueryExecutor executor, CubeQueryExecutorHelper cubeQueryExcutorHelper, int type) throws DataException {\n List columnSort;\n switch(type) {\n case ICubeQueryDefinition.COLUMN_EDGE:\n columnSort = executor.getColumnEdgeSort();\n break;\n case ICubeQueryDefinition.ROW_EDGE:\n columnSort = executor.getRowEdgeSort();\n break;\n case ICubeQueryDefinition.PAGE_EDGE:\n columnSort = executor.getPageEdgeSort();\n default:\n return;\n }\n for (int i = 0; i < columnSort.size(); i++) {\n ICubeSortDefinition cubeSort = (ICubeSortDefinition) columnSort.get(i);\n ICubeQueryDefinition queryDefn = executor.getCubeQueryDefinition();\n String expr = cubeSort.getExpression().getText();\n ITargetSort targetSort = null;\n if ((cubeSort.getAxisQualifierLevels().length == 0 && (OlapExpressionUtil.isComplexDimensionExpr(expr) || OlapExpressionUtil.isReferenceToAttribute(cubeSort.getExpression(), queryDefn.getBindings()))) || (!OlapExpressionUtil.isDirectRerenrence(cubeSort.getExpression(), executor.getCubeQueryDefinition().getBindings()))) {\n Scriptable scope = executor.getSession().getSharedScope();\n targetSort = new DimensionSortEvalHelper(executor.getOuterResults(), scope, queryDefn, cubeSort, executor.getSession().getEngineContext().getScriptContext());\n } else {\n String bindingName = OlapExpressionUtil.getBindingName(expr);\n if (bindingName == null)\n continue;\n List bindings = queryDefn.getBindings();\n List aggrOns = null;\n IBinding binding = null;\n for (int j = 0; j < bindings.size(); j++) {\n binding = (IBinding) bindings.get(j);\n if (binding.getBindingName().equals(bindingName)) {\n aggrOns = binding.getAggregatOns();\n break;\n }\n }\n DimLevel[] aggrOnLevels = null;\n if (aggrOns == null || aggrOns.size() == 0) {\n if (binding == null)\n continue;\n String measureName = OlapExpressionCompiler.getReferencedScriptObject(binding.getExpression(), ScriptConstants.MEASURE_SCRIPTABLE);\n if (measureName == null) {\n IBinding referBinding = OlapExpressionUtil.getDirectMeasureBinding(binding, bindings);\n if (referBinding != null) {\n measureName = OlapExpressionUtil.getMeasure(referBinding.getExpression());\n bindingName = referBinding.getBindingName();\n }\n }\n if (aggrOns != null && aggrOns.size() > 0) {\n aggrOnLevels = new DimLevel[aggrOns.size()];\n for (int j = 0; j < aggrOnLevels.length; j++) {\n aggrOnLevels[j] = OlapExpressionUtil.getTargetDimLevel(aggrOns.get(j).toString());\n }\n } else if (measureName != null) {\n List measureAggrOns = CubeQueryDefinitionUtil.populateMeasureAggrOns(queryDefn);\n aggrOnLevels = new DimLevel[measureAggrOns.size()];\n for (int k = 0; k < measureAggrOns.size(); k++) {\n aggrOnLevels[k] = (DimLevel) measureAggrOns.get(k);\n }\n }\n } else {\n aggrOnLevels = new DimLevel[aggrOns.size()];\n for (int j = 0; j < aggrOnLevels.length; j++) {\n aggrOnLevels[j] = OlapExpressionUtil.getTargetDimLevel(aggrOns.get(j).toString());\n }\n }\n DimLevel[] axisLevels = new DimLevel[cubeSort.getAxisQualifierLevels().length];\n for (int k = 0; k < axisLevels.length; k++) {\n axisLevels[k] = new DimLevel(cubeSort.getAxisQualifierLevels()[k]);\n }\n targetSort = new AggrSortDefinition(aggrOnLevels, bindingName, axisLevels, cubeSort.getAxisQualifierValues(), new DimLevel(cubeSort.getTargetLevel()), cubeSort.getSortDirection());\n }\n switch(type) {\n case ICubeQueryDefinition.COLUMN_EDGE:\n cubeQueryExcutorHelper.addColumnSort(targetSort);\n break;\n case ICubeQueryDefinition.ROW_EDGE:\n cubeQueryExcutorHelper.addRowSort(targetSort);\n break;\n case ICubeQueryDefinition.PAGE_EDGE:\n cubeQueryExcutorHelper.addPageSort(targetSort);\n }\n }\n}\n"
|
"public Dimension getPreferredSize(int wHint, int hHint) {\n Dimension dimension = new Dimension(0, CONTROL_SIZE.height);\n List list = getChildren();\n for (int i = 0; i < list.size(); i++) {\n Figure figure = (Figure) list.get(i);\n dimension.width = dimension.width + figure.getSize().width;\n }\n return dimension;\n}\n"
|
"public final void writeTo(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {\n try {\n Class<?> domainClass = getDomainClass(genericType);\n JAXBContext jaxbContext = getJAXBContext(domainClass, annotations, mediaType, httpHeaders);\n Marshaller marshaller = jaxbContext.createMarshaller();\n marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);\n marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);\n marshaller.setProperty(MarshallerProperties.JSON_ATTRIBUTE_PREFIX, attributePrefix);\n marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, includeRoot);\n marshaller.setProperty(MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS, marshalEmptyCollections);\n marshaller.setProperty(MarshallerProperties.JSON_NAMESPACE_SEPARATOR, namespaceSeperator);\n if (null != valueWrapper) {\n marshaller.setProperty(MarshallerProperties.JSON_VALUE_WRAPPER, valueWrapper);\n }\n marshaller.setProperty(MarshallerProperties.NAMESPACE_PREFIX_MAPPER, namespacePrefixMapper);\n Map<String, String> mediaTypeParameters = mediaType.getParameters();\n if (mediaTypeParameters.containsKey(CHARSET)) {\n String charSet = mediaTypeParameters.get(CHARSET);\n marshaller.setProperty(Marshaller.JAXB_ENCODING, charSet);\n }\n preWriteTo(object, type, genericType, annotations, mediaType, httpHeaders, marshaller);\n marshaller.marshal(object, entityStream);\n } catch (JAXBException jaxbException) {\n throw new WebApplicationException(jaxbException);\n }\n}\n"
|
"protected final void renderFittingCurve(IPrimitiveRenderer ipr, Location[] points, CurveFitting curve, boolean bShowAsTape, boolean bDeferred) throws ChartException {\n if (!curve.getLineAttributes().isSetVisible()) {\n throw new ChartException(ChartEnginePlugin.ID, ChartException.RENDERING, \"String_Node_Str\", Messages.getResourceBundle(getRunTimeContext().getULocale()));\n }\n boolean isTransposed = ((ChartWithAxes) getModel()).isTransposed();\n if (curve.getLineAttributes().isVisible()) {\n ScriptHandler.callFunction(getRunTimeContext().getScriptHandler(), ScriptHandler.BEFORE_DRAW_FITTING_CURVE, curve, getRunTimeContext().getScriptContext());\n getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_FITTING_CURVE, curve);\n double[] xArray = new double[points.length];\n double[] yArray = new double[points.length];\n for (int i = 0; i < xArray.length; i++) {\n xArray[i] = points[i].getX();\n yArray[i] = points[i].getY();\n }\n sort(xArray, yArray, !isTransposed);\n double[] baseArray = xArray, orthogonalArray = yArray;\n if (isTransposed) {\n baseArray = yArray;\n orthogonalArray = xArray;\n }\n FittingCalculator fc = new FittingCalculator(baseArray, orthogonalArray, 0.33);\n double[] fitYarray = fc.getFittedValue();\n orthogonalArray = fitYarray;\n if (isTransposed) {\n baseArray = fitYarray;\n orthogonalArray = yArray;\n sort(baseArray, orthogonalArray, false);\n }\n if (curve.getLineAttributes().getColor() != null) {\n CurveRenderer crdr = new CurveRenderer((ChartWithAxes) getModel(), this, curve.getLineAttributes(), goFactory.createLocations(baseArray, orthogonalArray), bShowAsTape, -1, bDeferred, false, null, false, true);\n crdr.draw(ipr);\n }\n if (curve.getLabel().isVisible()) {\n Label lb = goFactory.copyOf(curve.getLabel());\n final String sPreviousValue = lb.getCaption().getValue();\n lb.getCaption().setValue(getRunTimeContext().externalizedMessage(sPreviousValue));\n BoundingBox bb = cComp.computeBox(getXServer(), IConstants.LEFT, lb, 0, 0);\n Anchor lbAnchor = curve.getLabelAnchor();\n if (lbAnchor == null) {\n lbAnchor = Anchor.NORTH_LITERAL;\n }\n int horizontal = IConstants.CENTER;\n int vertical = IConstants.ABOVE;\n switch(lbAnchor.getValue()) {\n case Anchor.WEST:\n case Anchor.NORTH_WEST:\n case Anchor.SOUTH_WEST:\n horizontal = IConstants.LEFT;\n break;\n case Anchor.NORTH:\n case Anchor.SOUTH:\n horizontal = IConstants.CENTER;\n break;\n case Anchor.EAST:\n case Anchor.NORTH_EAST:\n case Anchor.SOUTH_EAST:\n horizontal = IConstants.RIGHT;\n break;\n }\n switch(lbAnchor.getValue()) {\n case Anchor.NORTH:\n case Anchor.NORTH_WEST:\n case Anchor.NORTH_EAST:\n case Anchor.WEST:\n case Anchor.EAST:\n vertical = IConstants.ABOVE;\n break;\n case Anchor.SOUTH:\n case Anchor.SOUTH_WEST:\n case Anchor.SOUTH_EAST:\n vertical = IConstants.BELOW;\n break;\n }\n double xs, ys;\n if (isTransposed) {\n if (horizontal == IConstants.LEFT) {\n ys = orthogonalArray[orthogonalArray.length - 1] - bb.getHeight();\n horizontal = IConstants.RIGHT;\n } else if (horizontal == IConstants.RIGHT) {\n ys = orthogonalArray[0];\n horizontal = IConstants.LEFT;\n } else {\n ys = orthogonalArray[0] + (orthogonalArray[orthogonalArray.length - 1] - orthogonalArray[0]) / 2d - bb.getHeight() / 2d;\n }\n xs = getFitYPosition(orthogonalArray, baseArray, horizontal, bb.getHeight(), bb.getWidth(), vertical == IConstants.BELOW);\n } else {\n if (horizontal == IConstants.LEFT) {\n xs = xArray[0];\n } else if (horizontal == IConstants.RIGHT) {\n xs = xArray[xArray.length - 1] - bb.getWidth();\n } else {\n xs = xArray[0] + (xArray[xArray.length - 1] - xArray[0]) / 2d - bb.getWidth() / 2d;\n }\n ys = getFitYPosition(xArray, fitYarray, horizontal, bb.getWidth(), bb.getHeight(), vertical == IConstants.ABOVE);\n }\n bb.setLeft(xs);\n bb.setTop(ys);\n renderLabel(StructureSource.createSeries(getSeries()), TextRenderEvent.RENDER_TEXT_IN_BLOCK, lb, Position.RIGHT_LITERAL, goFactory.createLocation(bb.getLeft(), bb.getTop()), goFactory.createBounds(bb.getLeft(), bb.getTop(), bb.getWidth(), bb.getHeight()), fDeferredCacheManager.getLastDeferredCache());\n }\n ScriptHandler.callFunction(getRunTimeContext().getScriptHandler(), ScriptHandler.AFTER_DRAW_FITTING_CURVE, curve, getRunTimeContext().getScriptContext());\n getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_FITTING_CURVE, curve);\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.