content
stringlengths 40
137k
|
---|
"public float getLineWidth(int line) {\n float margin = getParagraphLeadingMargin(line);\n float signedExtent = getLineExtent(line, true);\n return margin + (signedExtent >= 0 ? signedExtent : -signedExtent);\n}\n"
|
"public void addShape(ICEShape newShape) {\n if (newShape.isComplex()) {\n if (newShape.getOperatorType() == OperatorType.Union) {\n Node node = new Node();\n spatial = node;\n }\n } else {\n Mesh mesh = new Box(1.0f, 1.0f, 1.0f);\n spatial = new Geometry(newShape.getName(), mesh);\n }\n}\n"
|
"public void run() {\n try {\n ResultSet maxquery = BungeeWeb.getDatabase().createStatement().executeQuery(\"String_Node_Str\" + table + \"String_Node_Str\" + min + \"String_Node_Str\");\n if (maxquery.next()) {\n int max = maxquery.getInt(\"String_Node_Str\");\n BungeeWeb.getDatabase().createStatement().executeUpdate(\"String_Node_Str\" + table + \"String_Node_Str\" + min + \"String_Node_Str\" + max + \"String_Node_Str\" + ((System.currentTimeMillis() / 1000) - time));\n min = max;\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n}\n"
|
"private void rebuildOrderedListOfTemplates() {\n this.orderedTemplateCollection.clear();\n for (WebHookTemplate payloadTemplate : springTemplates.values()) {\n combinedTemplates.put(payloadTemplate.getTemplateShortName(), payloadTemplate);\n }\n for (WebHookTemplate payloadTemplate : xmlConfigTemplates.values()) {\n this.orderedTemplateCollection.add(payloadTemplate);\n }\n Collections.sort(this.orderedTemplateCollection, rankComparator);\n}\n"
|
"private IFile getNewRAMLFile(IProject project) {\n container = project.getFolder(new Path(\"String_Node_Str\"));\n InputDialog inputDialog = new RAMLConfigurationDialog(shell, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", null);\n int open = inputDialog.open();\n if (open == Dialog.OK) {\n return container.getFile(new Path(inputDialog.getValue()));\n }\n return null;\n}\n"
|
"public String getTextContent() throws DOMException {\n StringBuffer sb = new StringBuffer();\n synchronized (this.getTreeLock()) {\n ArrayList<Node> nl = this.nodeList;\n if (nl != null) {\n Iterator<Node> i = nl.iterator();\n while (i.hasNext()) {\n Node node = i.next();\n short type = node.getNodeType();\n switch(type) {\n case Node.CDATA_SECTION_NODE:\n case Node.TEXT_NODE:\n case Node.ELEMENT_NODE:\n String textContent = node.getTextContent();\n if (textContent != null) {\n sb.append(textContent);\n }\n break;\n default:\n break;\n }\n }\n }\n }\n return sb.toString().trim();\n}\n"
|
"public void startCubeMappedContainer(BeforeStart event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry, CubeConfiguration cubeConfiguration) {\n Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer());\n if (container == null) {\n return;\n }\n Cube cube = cubeRegistry.getCube(container.getName());\n if (cube == null) {\n return;\n }\n ConnectionMode connectionMode = cubeConfiguration.getConnectionMode();\n if (connectionMode.isAllowReconnect() && isCubeRunning(cube)) {\n controlEvent.fire(new PreRunningCube(cube));\n return;\n }\n controlEvent.fire(new CreateCube(cube));\n controlEvent.fire(new StartCube(cube));\n}\n"
|
"private void allocateAddressChecked(long length) {\n if (length > pageCapacity) {\n throw new JournalRuntimeException(\"String_Node_Str\", length, pageCapacity);\n }\n allocateAddress(index);\n}\n"
|
"public void run() {\n LOG.info(String.format(\"String_Node_Str\", config.getStreamName()));\n DateTime lastShardCapacityRefreshTime = new DateTime(System.currentTimeMillis());\n StreamMetrics streamMaxCapacity;\n try {\n streamMaxCapacity = getStreamMaxCapacity();\n } catch (Exception e) {\n this.exception = e;\n return;\n }\n int cwSampleDuration = Math.max(config.getScaleUp().getScaleAfterMins(), config.getScaleDown().getScaleAfterMins());\n List<GetMetricStatisticsRequest> cwRequests = getCloudwatchRequests(config.getScaleOnOperation());\n try {\n ScalingOperationReport report = null;\n do {\n DateTime now = new DateTime(System.currentTimeMillis());\n DateTime metricEndTime = new DateTime(System.currentTimeMillis());\n DateTime metricStartTime = metricEndTime.minusMinutes(cwSampleDuration);\n Map<StreamMetric, Map<Datapoint, Double>> metricsMap = new HashMap<StreamMetric, Map<Datapoint, Double>>();\n for (StreamMetric m : StreamMetric.values()) {\n metricsMap.put(m, new HashMap<Datapoint, Double>());\n }\n for (GetMetricStatisticsRequest req : cwRequests) {\n double sampleMetric = 0D;\n req.withStartTime(metricStartTime.toDate()).withEndTime(metricEndTime.toDate());\n LOG.debug(String.format(\"String_Node_Str\", cwSampleDuration, req.getMetricName()));\n GetMetricStatisticsResult cloudWatchMetrics = cloudWatchClient.getMetricStatistics(req);\n for (Datapoint d : cloudWatchMetrics.getDatapoints()) {\n StreamMetric metric = StreamMetric.fromUnit(d.getUnit());\n Map<Datapoint, Double> metrics = metricsMap.get(metric);\n if (metrics.containsKey(d)) {\n sampleMetric = metrics.get(d);\n } else {\n sampleMetric = 0d;\n }\n sampleMetric += (d.getSum() / CLOUDWATCH_PERIOD);\n metrics.put(d, sampleMetric);\n }\n }\n report = processCloudwatchMetrics(metricsMap, streamMaxCapacity, cwSampleDuration, now);\n if (report != null) {\n streamMaxCapacity = getStreamMaxCapacity();\n lastShardCapacityRefreshTime = now;\n }\n if (report != null) {\n if (this.config.getScalingOperationReportListener() != null) {\n this.config.getScalingOperationReportListener().onReport(report);\n }\n LOG.info(report.toString());\n report = null;\n }\n if (now.minusMinutes(this.config.getRefreshShardsNumberAfterMin()).isAfter(lastShardCapacityRefreshTime)) {\n streamMaxCapacity = getStreamMaxCapacity();\n lastShardCapacityRefreshTime = now;\n }\n try {\n LOG.debug(\"String_Node_Str\");\n Thread.sleep(TIMEOUT_SECONDS * 1000);\n } catch (InterruptedException e) {\n LOG.error(e);\n break;\n }\n } while (keepRunning);\n LOG.info(String.format(\"String_Node_Str\", this.config.getStreamName(), this.config.getRegion()));\n } catch (Exception e) {\n this.exception = e;\n }\n}\n"
|
"protected static String _getPackageName(OntologySolverBase solver) throws IllegalActionException {\n Ontology ontology = solver.getOntology();\n if (ontology == null) {\n throw new IllegalActionException(solver, \"String_Node_Str\");\n }\n return solver.getClass().getPackage().getName() + \"String_Node_Str\" + ontology.getName();\n}\n"
|
"void connectMAVConnection(ConnectionParameter connParams, String listenerTag, MavLinkConnectionListener listener) {\n AndroidMavLinkConnection conn = mavConnections.get(connParams.getUniqueId());\n final int connectionType = connParams.getConnectionType();\n final Bundle paramsBundle = connParams.getParamsBundle();\n if (conn == null) {\n switch(connectionType) {\n case ConnectionType.TYPE_USB:\n final int baudRate = paramsBundle.getInt(ConnectionType.EXTRA_USB_BAUD_RATE, ConnectionType.DEFAULT_USB_BAUD_RATE);\n conn = new UsbConnection(getApplicationContext(), baudRate);\n Log.d(TAG, \"String_Node_Str\");\n break;\n case ConnectionType.TYPE_BLUETOOTH:\n final String bluetoothAddress = paramsBundle.getString(ConnectionType.EXTRA_BLUETOOTH_ADDRESS);\n conn = new BluetoothConnection(getApplicationContext(), bluetoothAddress);\n Log.d(TAG, \"String_Node_Str\");\n break;\n case ConnectionType.TYPE_TCP:\n final String tcpServerIp = paramsBundle.getString(ConnectionType.EXTRA_TCP_SERVER_IP);\n final int tcpServerPort = paramsBundle.getInt(ConnectionType.EXTRA_TCP_SERVER_PORT, ConnectionType.DEFAULT_TCP_SERVER_PORT);\n conn = new AndroidTcpConnection(getApplicationContext(), tcpServerIp, tcpServerPort);\n Log.d(TAG, \"String_Node_Str\");\n break;\n case ConnectionType.TYPE_UDP:\n final int udpServerPort = paramsBundle.getInt(ConnectionType.EXTRA_UDP_SERVER_PORT, ConnectionType.DEFAULT_UDP_SERVER_PORT);\n conn = new AndroidUdpConnection(getApplicationContext(), udpServerPort);\n Log.d(TAG, \"String_Node_Str\");\n break;\n default:\n Log.e(TAG, \"String_Node_Str\" + connectionType);\n return;\n }\n mavConnections.put(connParams.getUniqueId(), conn);\n }\n if (connectionType == ConnectionType.TYPE_UDP) {\n final String pingIpAddress = paramsBundle.getString(ConnectionType.EXTRA_UDP_PING_RECEIVER_IP);\n if (!TextUtils.isEmpty(pingIpAddress)) {\n try {\n final InetAddress resolvedAddress = InetAddress.getByName(pingIpAddress);\n final int pingPort = paramsBundle.getInt(ConnectionType.EXTRA_UDP_PING_RECEIVER_PORT);\n final long pingPeriod = paramsBundle.getLong(ConnectionType.EXTRA_UDP_PING_PERIOD, ConnectionType.DEFAULT_UDP_PING_PERIOD);\n final byte[] pingPayload = paramsBundle.getByteArray(ConnectionType.EXTRA_UDP_PING_PAYLOAD);\n ((AndroidUdpConnection) conn).addPingTarget(resolvedAddress, pingPort, pingPeriod, pingPayload);\n } catch (UnknownHostException e) {\n Log.e(TAG, \"String_Node_Str\", e);\n }\n }\n }\n conn.addMavLinkConnectionListener(listenerTag, listener);\n if (conn.getConnectionStatus() == MavLinkConnection.MAVLINK_DISCONNECTED) {\n conn.connect();\n GAUtils.sendEvent(new HitBuilders.EventBuilder().setCategory(GAUtils.Category.MAVLINK_CONNECTION).setAction(\"String_Node_Str\").setLabel(connParams.toString()));\n }\n}\n"
|
"public void setProcessContext(RunProcessContext processContext) {\n IPreferenceStore preferenceStore = DesignerPlugin.getDefault().getPreferenceStore();\n String languagePrefix = LanguageManager.getCurrentLanguage().toString() + \"String_Node_Str\";\n if (this.processContext != null) {\n this.processContext.removePropertyChangeListener(pcl);\n }\n this.processContext = processContext;\n if (processContext != null) {\n processContext.addPropertyChangeListener(pcl);\n }\n boolean disableAll = false;\n if (processContext != null) {\n disableAll = processContext.getProcess().disableRunJobView();\n }\n if (processContext != null) {\n boolean isJavaDebuging = false;\n org.eclipse.debug.core.model.IProcess debugProcess = processContext.getDebugProcess();\n if (debugProcess != null) {\n try {\n debugProcess.getExitValue();\n } catch (DebugException e) {\n isJavaDebuging = true;\n }\n }\n if (isJavaDebuging == false) {\n processContext.setMonitorTrace(true);\n addTrace(ProcessView.TRACEDEBUG_ID);\n }\n }\n setRunnable(processContext != null && !processContext.isRunning() && !disableAll);\n killBtn.setEnabled(processContext != null && processContext.isRunning() && !disableAll);\n fillConsole(processContext != null ? processContext.getMessages() : new ArrayList<IProcessMessage>());\n if (processContext == null) {\n manager.setBooleanTrace(false);\n itemDropDown.setText(\"String_Node_Str\" + Messages.getString(\"String_Node_Str\"));\n itemDropDown.setData(ProcessView.DEBUG_ID);\n itemDropDown.setToolTipText(Messages.getString(\"String_Node_Str\"));\n itemDropDown.setImage(ImageProvider.getImage(ERunprocessImages.DEBUG_PROCESS_ACTION));\n }\n}\n"
|
"public void windowsMoveFile(File fromFile, File toFile) {\n Kernel32.INSTANCE.MoveFileExA(fromFile.getAbsolutePath(), toFile.getAbsolutePath(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);\n}\n"
|
"protected void executeCommand(CommandEvent event) {\n if (!(event.getClient().getOwnerId().equals(String.valueOf(Const.ARTUTO_ID)))) {\n event.replyError(\"String_Node_Str\");\n return;\n }\n if (event.getArgs().isEmpty()) {\n event.replyWarning(\"String_Node_Str\");\n return;\n }\n User user;\n List<Member> list = FinderUtil.findMembers(event.getArgs(), event.getGuild());\n if (list.isEmpty()) {\n event.getJDA().retrieveUserById(event.getArgs()).queue(s -> {\n if (!(bot.ddm.hasDonated(s))) {\n bot.ddm.setDonation(s.getIdLong(), null);\n event.replyError(\"String_Node_Str\");\n } else {\n bot.ddm.setDonation(s, null);\n event.replySuccess(String.format(\"String_Node_Str\", s));\n }\n }, e -> event.replyError(\"String_Node_Str\"));\n } else if (list.size() > 1)\n event.replyWarning(FormatUtil.listOfMembers(list, event.getArgs()));\n else {\n user = list.get(0).getUser();\n if (!(bot.ddm.hasDonated(user))) {\n bot.ddm.setDonation(user, null);\n event.replyError(\"String_Node_Str\");\n } else {\n bot.ddm.setDonation(user, null);\n event.replySuccess(String.format(\"String_Node_Str\", user));\n }\n }\n}\n"
|
"public void listCommands() {\n for (PluginMetadata pluginMetaData : registry.getPlugins().values()) {\n for (CommandMetadata commandMetadata : pluginMetaData.getCommands()) {\n shell.print(commandMetadata.getName());\n shell.print(\"String_Node_Str\");\n }\n }\n shell.println();\n}\n"
|
"public void testGrandTotal() 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 ILevelDefinition level11 = hier1.createLevel(\"String_Node_Str\");\n ILevelDefinition level12 = hier1.createLevel(\"String_Node_Str\");\n IDimensionDefinition dim2 = rowEdge.createDimension(\"String_Node_Str\");\n IHierarchyDefinition hier2 = dim2.createHierarchy(\"String_Node_Str\");\n ILevelDefinition level21 = 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 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 binding6.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);\n binding6.addAggregateOn(\"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_SUM_FUNC);\n binding7.addAggregateOn(\"String_Node_Str\");\n binding7.addAggregateOn(\"String_Node_Str\");\n cqd.addBinding(binding7);\n IBinding binding8 = new Binding(\"String_Node_Str\");\n binding8.setExpression(new ScriptExpression(\"String_Node_Str\"));\n binding8.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);\n cqd.addBinding(binding8);\n CubeSortDefinition sorter1 = new CubeSortDefinition();\n sorter1.setExpression(\"String_Node_Str\");\n sorter1.setSortDirection(ISortDefinition.SORT_DESC);\n sorter1.setTargetLevel(level21);\n CubeSortDefinition sorter2 = new CubeSortDefinition();\n sorter2.setExpression(\"String_Node_Str\");\n sorter2.setSortDirection(ISortDefinition.SORT_DESC);\n sorter2.setTargetLevel(level11);\n CubeSortDefinition sorter3 = new CubeSortDefinition();\n sorter3.setExpression(\"String_Node_Str\");\n sorter3.setSortDirection(ISortDefinition.SORT_DESC);\n sorter3.setTargetLevel(level12);\n cqd.addSort(sorter1);\n cqd.addSort(sorter2);\n cqd.addSort(sorter3);\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 this.printCube(cursor, columnEdgeBindingNames, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n}\n"
|
"public void open(String homePath, IndexInfo idxInfo, boolean clean) throws IOException {\n fileQueue = new LinkedList();\n try {\n this.indexInfo = idxInfo;\n this.xtfHomePath = homePath;\n indexPath = getIndexPath();\n if (indexInfo.stopWords != null)\n stopSet = NgramStopFilter.makeStopSet(indexInfo.stopWords);\n if (clean) {\n Path.createPath(indexPath);\n createIndex(indexPath);\n } else {\n Path.createPath(indexPath);\n FSDirectory idxDir = FSDirectory.getDirectory(indexPath, false);\n if (!IndexReader.indexExists(idxDir))\n createIndex(indexPath);\n }\n openIdxForReading();\n Hits match = indexSearcher.search(new TermQuery(new Term(\"String_Node_Str\", \"String_Node_Str\")));\n if (match.length() == 0)\n throw new RuntimeException(\"String_Node_Str\");\n Document doc = match.doc(0);\n if (Integer.parseInt(doc.get(\"String_Node_Str\")) != indexInfo.getChunkSize()) {\n throw new RuntimeException(\"String_Node_Str\" + doc.get(\"String_Node_Str\") + \"String_Node_Str\" + indexInfo.getChunkSize() + \"String_Node_Str\");\n }\n if (Integer.parseInt(doc.get(\"String_Node_Str\")) != indexInfo.getChunkOvlp()) {\n throw new RuntimeException(\"String_Node_Str\" + doc.get(\"String_Node_Str\") + \"String_Node_Str\" + indexInfo.getChunkOvlp() + \"String_Node_Str\");\n }\n String stopWords = indexInfo.stopWords;\n if (stopWords == null)\n stopWords = \"String_Node_Str\";\n if (!doc.get(\"String_Node_Str\").equals(stopWords)) {\n throw new RuntimeException(\"String_Node_Str\" + doc.get(\"String_Node_Str\") + \"String_Node_Str\" + indexInfo.stopWords + \"String_Node_Str\");\n }\n } catch (IOException e) {\n Trace.tab();\n Trace.error(\"String_Node_Str\" + e);\n Trace.untab();\n close();\n throw e;\n }\n}\n"
|
"public void increaseMana(int mana) {\n this.setMana(this.getMana() + mana);\n if (this.mana > this.maxMana)\n this.mana = this.maxMana;\n}\n"
|
"protected void executeEcq(ErrorCorrector errorCorrector, String jobName, boolean runInParallel, File outputDir, ExecutionContext executionContext) throws ProcessExecutionException, InterruptedException {\n ExecutionContext executionContextCopy = executionContext.copy();\n errorCorrector.configure(this.getConanProcessService());\n if (executionContext.usingScheduler()) {\n SchedulerArgs schedulerArgs = executionContextCopy.getScheduler().getArgs();\n ErrorCorrectorArgs ecArgs = errorCorrector.getArgs();\n schedulerArgs.setJobName(jobName);\n schedulerArgs.setMonitorFile(new File(outputDir, jobName + \"String_Node_Str\"));\n schedulerArgs.setThreads(ecArgs.getThreads());\n schedulerArgs.setMemoryMB(ecArgs.getMemoryGb() * 1000);\n executionContextCopy.setForegroundJob(!runInParallel);\n }\n this.conanProcessService.execute(errorCorrector, executionContextCopy);\n}\n"
|
"protected void getColumnGroupField(FieldBean fieldBean, BaseExcelVo excelVo, Row rowData, int row, int index, DataBean dataBean, GroupConfig group) throws AdapterException, ColumnErrorException {\n DataBean childDataBean = dataBean.getChildDataBean(fieldBean.getField().getName());\n List<BaseExcelVo> childVo = (List<BaseExcelVo>) dataBean.getFieldValue(fieldBean.getField().getName(), excelVo);\n if (childVo == null) {\n return;\n }\n int size = group.getFieldNames().size();\n if (ObjectHelper.isNotEmpty(childVo)) {\n for (int r = 0; r < childVo.size(); r++) {\n BaseExcelVo baseExcelVo = childVo.get(r);\n if (baseExcelVo != null) {\n for (int i = 0; i < size; i++) {\n FieldBean childFieldBean = childDataBean.getFiledBeanList().get(i);\n if (childFieldBean.getFieldType() == FieldType.BASIC) {\n getSimpleField(childFieldBean, baseExcelVo, rowData, row, index + r * size + i, childDataBean);\n } else if (childFieldBean.getFieldType() == FieldType.BAS_ARRAY) {\n GroupConfig childGroup = groupConfig.get(childFieldBean.getField().getName());\n getBasArrayField(childFieldBean, baseExcelVo, rowData, row, index + r * size, childDataBean, childGroup);\n } else if (childFieldBean.getFieldType() == FieldType.ColumnGroup_ARRAY) {\n GroupConfig childGroup = groupConfig.get(childFieldBean.getField().getName());\n getColumnGroupField(childFieldBean, baseExcelVo, rowData, row, index + r * size, childDataBean, childGroup);\n }\n }\n }\n }\n }\n}\n"
|
"public IStructure createInstance(Object[] fields) {\n Object[][] objectArrays = ObjectArrayUtil.convert(fields);\n Row4Aggregation result = new Row4Aggregation();\n result.setLevelMembers(new Member[objectArrays.length - 2]);\n for (int i = 0; i < result.getLevelMembers().length; i++) {\n result.getLevelMembers()[i] = (Member) levelMemberCreator.createInstance(objectArrays[i]);\n }\n result.setMeasures(objectArrays[objectArrays.length - 2]);\n result.setParameterValues(objectArrays[objectArrays.length - 1]);\n return result;\n}\n"
|
"private CoordinateSystemAxis parseAxis(final int mode, final Element parent, final String csType, final Unit<?> defaultUnit) throws ParseException {\n final Element element = parent.pullElement(mode, WKTKeywords.Axis);\n if (element == null) {\n return null;\n }\n String name = element.pullString(\"String_Node_Str\");\n final Element orientation = element.pullVoidElement(\"String_Node_Str\");\n Unit<?> unit = parseUnit(element);\n if (unit == null) {\n if (defaultUnit == null) {\n throw element.missingComponent(WKTKeywords.Unit);\n }\n unit = defaultUnit;\n }\n AxisDirection direction = Types.forCodeName(AxisDirection.class, orientation.keyword, true);\n final Element meridian = element.pullElement(OPTIONAL, WKTKeywords.Meridian);\n if (meridian != null) {\n double angle = meridian.pullDouble(\"String_Node_Str\");\n final Unit<Angle> m = parseScaledUnit(meridian, WKTKeywords.AngleUnit, SI.RADIAN);\n meridian.close(ignoredElements);\n if (m != null) {\n angle = m.getConverterTo(NonSI.DEGREE_ANGLE).convert(angle);\n }\n direction = referencing.directionAlongMeridian(direction, angle);\n }\n String abbreviation;\n int start, end = name.length() - 1;\n if (end > 1 && name.charAt(end) == ')' && (start = name.lastIndexOf('(', end - 1)) >= 0) {\n abbreviation = CharSequences.trimWhitespaces(name.substring(start + 1, end));\n name = CharSequences.trimWhitespaces(name.substring(0, start));\n if (name.isEmpty()) {\n name = abbreviation;\n }\n } else {\n abbreviation = AxisDirections.suggestAbbreviation(name, direction, unit);\n }\n name = transliterator.toLongAxisName(csType, direction, name);\n abbreviation = transliterator.toUnicodeAbbreviation(csType, direction, abbreviation);\n final Element order = element.pullElement(OPTIONAL, WKTKeywords.Order);\n Integer n = null;\n if (order != null) {\n n = order.pullInteger(\"String_Node_Str\");\n order.close(ignoredElements);\n }\n final CoordinateSystemAxis axis;\n try {\n axis = csFactory.createCoordinateSystemAxis(parseMetadataAndClose(element, name, null), abbreviation, direction, unit);\n } catch (FactoryException exception) {\n throw element.parseFailed(exception);\n }\n if (axisOrder.put(axis, n) != null) {\n throw new LocalizedParseException(errorLocale, Errors.Keys.DuplicatedElement_1, new Object[] { WKTKeywords.Axis + \"String_Node_Str\" + name + \"String_Node_Str\" }, element.offset);\n }\n return axis;\n}\n"
|
"private static String adjustDirSymbol(String str, char replace) {\n StringBuilder result = new StringBuilder();\n for (int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if (ch == File.pathSeparatorChar)\n ch = replace;\n result.append(ch);\n }\n return result.toString();\n}\n"
|
"public static List<CssNode> getSections(String css, String[] nodes, String[] states) {\n if (states == null) {\n states = new String[0];\n }\n List<CssNode> sections = new ArrayList<CssNode>();\n for (String node : nodes) {\n int i = 0;\n while (i != -1) {\n i = css.indexOf(node, i);\n if (i > -1) {\n int endOfNodeLabels = css.indexOf(\"String_Node_Str\", i);\n int endOfSection = css.indexOf(\"String_Node_Str\", endOfNodeLabels + 1) + 1;\n int endOfSectionTest = css.indexOf(\"String_Node_Str\", i) + 1;\n if (endOfSection != endOfSectionTest) {\n i = endOfSection;\n continue;\n }\n String nodeLabel = css.substring(i, endOfNodeLabels);\n List<CssAttribute> attributes = new ArrayList<CssAttribute>();\n String nodeSection = css.substring(endOfNodeLabels, endOfSection);\n int sectionStart = nodeSection.indexOf('{') + 1;\n int sectionEnd = nodeSection.indexOf('}');\n while (sectionStart != -1) {\n int end = nodeSection.indexOf(';', sectionStart);\n if (end != -1) {\n int separator = nodeSection.indexOf(':', start);\n if (separator < end) {\n String key = nodeSection.substring(start, separator);\n String value = nodeSection.substring(separator + 1, end);\n if (value.contains(\"String_Node_Str\") || value.contains(\"String_Node_Str\")) {\n end = nodeSection.indexOf(')', end);\n end = nodeSection.indexOf(';', end);\n value = nodeSection.substring(separator + 1, end);\n }\n attributes.add(new CssAttribute(key, value));\n }\n start = end + 1;\n } else {\n break;\n }\n }\n int multiIndex = nodeLabel.indexOf(',');\n if (multiIndex != -1) {\n multiIndex = 0;\n while (multiIndex != -1) {\n int multiEndIndex = nodeLabel.indexOf(',', multiIndex);\n if (multiEndIndex != -1) {\n String newLabel = nodeLabel.substring(multiIndex, multiEndIndex);\n sections.add(new CssNode(newLabel, attributes));\n multiIndex = multiEndIndex + 1;\n } else {\n String newLabel = nodeLabel.substring(multiIndex);\n sections.add(new CssNode(newLabel, attributes));\n multiIndex = -1;\n }\n }\n } else {\n sections.add(new CssNode(nodeLabel, attributes));\n }\n i = endOfSection;\n }\n }\n }\n for (Iterator<CssNode> iterator = sections.iterator(); iterator.hasNext(); ) {\n final CssNode section = iterator.next();\n String label = section.label;\n boolean canSave = false;\n if (!section.attributes.isEmpty()) {\n main: for (String node : nodes) {\n if (label.equals(node)) {\n canSave = true;\n break;\n }\n if (label.length() > node.length() && label.startsWith(node)) {\n int index = node.length();\n label = trim(label.substring(index));\n if (label.charAt(0) == '>') {\n label = label.substring(1);\n }\n for (String n : nodes) {\n if (n != node && label.startsWith(n)) {\n canSave = true;\n break main;\n }\n }\n }\n }\n if (canSave) {\n int stateIndex = label.lastIndexOf(':');\n if (stateIndex != -1) {\n String stateValue = label.substring(stateIndex + 1);\n boolean saveState = false;\n for (String state : states) {\n if (stateValue.equals(state)) {\n saveState = true;\n break;\n }\n }\n if (!saveState) {\n canSave = false;\n }\n }\n }\n }\n if (!canSave) {\n iterator.remove();\n }\n }\n for (Iterator<CssNode> iterator = sections.iterator(); iterator.hasNext(); ) {\n final CssNode section = iterator.next();\n if (section != null) {\n String label = section.label;\n for (int i = 0; i < sections.size(); i++) {\n final CssNode section2 = sections.get(i);\n if (section != section2 && section2 != null && label.equals(section2.label)) {\n sections.set(i, null);\n for (CssAttribute attribute : section.attributes) {\n for (Iterator<CssAttribute> iterator2 = section2.attributes.iterator(); iterator2.hasNext(); ) {\n final CssAttribute attribute2 = iterator2.next();\n if (attribute.equals(attribute2)) {\n iterator2.remove();\n }\n }\n }\n section.attributes.addAll(section2.attributes);\n }\n }\n } else {\n iterator.remove();\n }\n }\n for (Iterator<CssNode> iterator = sections.iterator(); iterator.hasNext(); ) {\n final CssNode section = iterator.next();\n if (section.attributes.isEmpty()) {\n iterator.remove();\n } else {\n for (Iterator<CssAttribute> iterator1 = section.attributes.iterator(); iterator1.hasNext(); ) {\n final CssAttribute attribute = iterator1.next();\n if (attribute == null) {\n iterator1.remove();\n }\n }\n }\n }\n if (DEBUG_NODES) {\n for (CssNode section : sections) {\n System.err.println(\"String_Node_Str\");\n System.err.println(section);\n System.err.println(\"String_Node_Str\");\n }\n }\n return sections;\n}\n"
|
"public Object visitIntervalSelector(cqlParser.IntervalSelectorContext ctx) {\n Interval result = of.createInterval().withLow(parseExpression(ctx.expression(0))).withLowClosed(ctx.getChild(1).getText().equals(\"String_Node_Str\")).withHigh(parseExpression(ctx.expression(1))).withHighClosed(ctx.getChild(5).getText().equals(\"String_Node_Str\"));\n DataType lowType = result.getLow().getResultType();\n DataType highType = result.getHigh().getResultType();\n if ((lowType != null) && (highType != null)) {\n DataTypes.verifyType(highType, lowType);\n }\n DataType pointType = lowType != null ? lowType : highType;\n if (pointType != null) {\n IntervalType resultType = new IntervalType(pointType);\n result.setResultType(resultType);\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n return result;\n}\n"
|
"private void getSchemaFromSPSSFile() {\n try {\n List<IMetadataTable> metadataList = getMetadataList();\n MetadataTable metaTable = (MetadataTable) metadataList.get(0);\n metaTable.getListColumns().clear();\n MetadataTableEditor tableEditor = new MetadataTableEditor(metaTable, \"String_Node_Str\");\n spss spssIn = new spss();\n spssfile spssFile = spssIn.openFile(strFileName, spssfile.SPSS_READ);\n String strComponentName = this.getComponent().getName();\n spssvariables spssVars = spssFile.getVariables();\n spssvariable spssVar;\n for (int i = 0; i < spssVars.getNumberOfVariables(); i++) {\n spssVar = spssVars.getVariabelAtPos(i);\n IMetadataColumn column = tableEditor.createNewMetadataColumn();\n String lableName = MetadataToolHelper.validateColumnName(spssVar.getName(), i);\n column.setLabel(lableName);\n column.setOriginalDbColumnName(spssVar.getName());\n if (spssVar.hasLabels() && strTranslateLabels.toLowerCase().equals(\"String_Node_Str\")) {\n column.setLength(spssVar.getMaxLengthByLableTranslation());\n column.setPrecision(0);\n column.setTalendType(\"String_Node_Str\");\n } else {\n switch(spssVar.getJAVAType()) {\n case spssvariable.JAVA_TYPE_DOUBLE:\n column.setTalendType(\"String_Node_Str\");\n break;\n case spssvariable.JAVA_TYPE_STRING:\n column.setTalendType(\"String_Node_Str\");\n break;\n case spssvariable.JAVA_TYPE_DATE:\n column.setTalendType(\"String_Node_Str\");\n break;\n }\n column.setLength(spssVar.getDecimals());\n column.setPrecision(spssVar.getPrecision());\n }\n String strLabel = spssVar.getLabel();\n if (null != strLabel && strLabel.length() > 0)\n column.setComment(strLabel);\n else\n column.setComment(\"String_Node_Str\");\n if (null == strComponentName || strComponentName.toLowerCase().equals(\"String_Node_Str\"))\n column.setReadOnly(true);\n else\n column.setReadOnly(false);\n metaTable.getListColumns().add(column);\n }\n spssFile.close();\n } catch (Exception e) {\n log.error(\"String_Node_Str\", e);\n }\n}\n"
|
"private Work replaceWithOldAndNew(Bytes reader, TcpReplicator.TcpSocketChannelEntryWriter writer, final long sizeLocation, long timestamp, byte id) {\n try {\n writer.ensureBufferSize(1L);\n writer.in().writeBoolean(bytesMap.replace(reader, reader, reader));\n } catch (Throwable e) {\n return sendException(writer, sizeLocation, e);\n }\n writeSizeAndFlags(sizeLocation, false, writer.in());\n return null;\n}\n"
|
"public void interpolate(final ScreenTransform start, final ScreenTransform end, final double ratio) {\n this.minX = (1 - ratio) * start.minX + ratio * end.minX;\n this.maxX = (1 - ratio) * start.maxX + ratio * end.maxX;\n this.minY = (1 - ratio) * start.minY + ratio * end.minY;\n this.maxY = (1 - ratio) * start.maxY + ratio * end.maxY;\n this.screenWidth = (int) Math.round(((1 - ratio) * start.screenWidth + ratio * end.screenWidth));\n this.screenHeight = (int) Math.round(((1 - ratio) * start.screenHeight + ratio * end.screenHeight));\n update();\n}\n"
|
"private Map decodeMap() {\n ParameterizedType paramType = (ParameterizedType) field.getGenericType();\n Type[] types = paramType.getActualTypeArguments();\n boolean isArray = false;\n boolean isCollection = false;\n boolean isSingle = false;\n Class vType = null;\n Class elementType = null;\n if (types[1] instanceof GenericArrayType) {\n isArray = true;\n GenericArrayType g = (GenericArrayType) types[1];\n elementType = (Class) g.getGenericComponentType();\n } else if (types[1] instanceof ParameterizedType) {\n isCollection = true;\n ParameterizedType p = (ParameterizedType) types[1];\n vType = (Class) p.getRawType();\n elementType = (Class) p.getActualTypeArguments()[0];\n } else {\n Class<?> actualType = FieldUtil.getClassOfType(types[1]);\n if (actualType.isArray()) {\n isArray = true;\n elementType = actualType.getComponentType();\n } else {\n isSingle = true;\n }\n }\n Map map = (Map) value;\n Map result = new HashMap();\n boolean cascadeRead = false;\n Class<?> cls = null;\n InternalDao dao = null;\n if (isSingle) {\n cls = FieldUtil.getRealType((Class) types[1], field);\n cascadeRead = (refList.cascade().toUpperCase().indexOf(Default.CASCADE_READ) != -1);\n if (!withoutCascade && cascadeRead) {\n dao = DaoCache.getInstance().get(cls);\n }\n }\n for (Object key : map.keySet()) {\n Object entryValue = map.get(key);\n if (entryValue == null) {\n result.put(key, null);\n continue;\n }\n if (isSingle) {\n String refId = ReferenceUtil.fromDbReference(refList, entryValue);\n BuguEntity refObj = null;\n if (cascadeRead) {\n refObj = (BuguEntity) dao.findOneLazily(refId);\n } else {\n refObj = (BuguEntity) ConstructorCache.getInstance().create(cls);\n refObj.setId(refId);\n }\n result.put(key, refObj);\n } else if (isArray) {\n Object arr = decodeArray(entryValue, elementType);\n result.put(key, arr);\n } else if (isCollection) {\n List list = decodeCollection(entryValue, elementType);\n if (DataType.isListType(vType) || DataType.isCollectionType(vType)) {\n result.put(key, list);\n } else if (DataType.isSetType(vType)) {\n result.put(key, new HashSet(list));\n } else if (DataType.isQueueType(vType)) {\n result.put(key, new LinkedList(list));\n }\n }\n }\n return result;\n}\n"
|
"public void clearAlarm(String faultFamily, String faultMember, int faultCode) {\n if (!enabled) {\n return;\n }\n if (queuing) {\n synchronized (queue) {\n queue.add(faultFamily, faultMember, faultCode, null, false);\n }\n return;\n }\n String id = buildAlarmID(faultFamily, faultMember, faultCode);\n alarmsToClean.putIfAbsent(id, System.currentTimeMillis());\n}\n"
|
"public int size() {\n return (int) new jedd.internal.RelationContainer(new jedd.Attribute[] { stmt.v(), srcm.v(), tgtc.v(), tgtm.v(), srcc.v(), kind.v() }, new jedd.PhysicalDomain[] { ST.v(), T1.v(), V2.v(), T2.v(), V1.v(), FD.v() }, (\"String_Node_Str\" + \"String_Node_Str\"), edges).size();\n}\n"
|
"public static OseeCoverageUnitFileContentsProvider getInstance(IOseeBranch branch) {\n if (instance == null || !instance.getBranch().equals(branch)) {\n instance = new OseeCoverageUnitFileContentsProvider(branch);\n }\n return instance;\n}\n"
|
"private void placeComponents() {\n GridLayout glContent = new GridLayout(2, false);\n glContent.marginHeight = 2;\n glContent.marginWidth = 2;\n glContent.horizontalSpacing = 0;\n this.setLayout(glContent);\n Composite cmpMarker = new Composite(this, SWT.NONE);\n {\n cmpMarker.setLayout(new GridLayout());\n cmpMarker.setLayoutData(new GridData(GridData.FILL_BOTH));\n }\n Group grpMarker = new Group(cmpMarker, SWT.NONE);\n grpMarker.setText(Messages.getString(\"String_Node_Str\"));\n grpMarker.setLayout(new GridLayout(2, false));\n grpMarker.setLayoutData(new GridData(GridData.FILL_BOTH));\n Label lblStart = new Label(grpMarker, SWT.NONE);\n lblStart.setText(Messages.getString(\"String_Node_Str\"));\n new MarkerEditorComposite(grpMarker, createMarker(series.getStartMarker()));\n Label lblEnd = new Label(grpMarker, SWT.NONE);\n lblEnd.setText(Messages.getString(\"String_Node_Str\"));\n new MarkerEditorComposite(grpMarker, createMarker(series.getEndMarker()));\n Composite cmpGroup = new Composite(this, SWT.NONE);\n {\n GridLayout glGroup = new GridLayout(2, true);\n glGroup.marginWidth = 0;\n glGroup.horizontalSpacing = 6;\n cmpGroup.setLayout(glGroup);\n cmpGroup.setLayoutData(new GridData(GridData.FILL_BOTH));\n }\n grpLine = new Group(cmpGroup, SWT.NONE);\n GridData gdGRPLine = new GridData(GridData.FILL_BOTH);\n grpLine.setLayout(new GridLayout());\n grpLine.setLayoutData(gdGRPLine);\n grpLine.setText(Messages.getString(\"String_Node_Str\"));\n gliacGantt = new GanttLineAttributesComposite(grpLine, context, SWT.NONE, series.getConnectionLine(), true, true, true);\n gliacGantt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n gliacGantt.addListener(this);\n btnPalette = new Button(grpLine, SWT.CHECK);\n {\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalIndent = 4;\n btnPalette.setLayoutData(gd);\n btnPalette.setText(Messages.getString(\"String_Node_Str\"));\n btnPalette.setSelection(series.isPaletteLineColor());\n btnPalette.addSelectionListener(this);\n }\n grpOutline = new Group(cmpGroup, SWT.NONE);\n GridData gdGRPOutline = new GridData(GridData.FILL_BOTH);\n grpOutline.setLayout(new FillLayout());\n grpOutline.setLayoutData(gdGRPOutline);\n grpOutline.setText(Messages.getString(\"String_Node_Str\"));\n oliacGantt = new LineAttributesComposite(grpOutline, SWT.NONE, context, series.getOutline(), true, true, true, true, true);\n oliacGantt.addListener(this);\n}\n"
|
"public void put(String whereSql, ShardingDBResource db, List data) {\n if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {\n return;\n }\n ShardedJedis redisClient = null;\n try {\n redisClient = jedisPool.getResource();\n String cacheKey = _buildShardingCacheKey(whereKey, db);\n redisClient.set(cacheKey.getBytes(), IOUtil.getBytes(data));\n redisClient.expire(cacheKey.getBytes(), expire);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + cacheKey);\n }\n } catch (Exception e) {\n LOG.warn(\"String_Node_Str\");\n } finally {\n if (redisClient != null)\n redisClient.close();\n }\n}\n"
|
"public Response getHyperParameters(long analysisId) {\n PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();\n int tenantId = carbonContext.getTenantId();\n String userName = carbonContext.getUsername();\n try {\n List<MLHyperParameter> responseVariable = mlAnalysisHandler.getHyperParameters(analysisId, algorithmName);\n return Response.ok(responseVariable).build();\n } catch (MLAnalysisHandlerException e) {\n logger.error(String.format(\"String_Node_Str\", analysisId, tenantId, userName, e.getMessage()));\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();\n }\n}\n"
|
"public long getPageNumberByBookmark(String docName, String bookmark, InputOptions options) throws ReportServiceException {\n IReportDocument doc = ReportEngineService.getInstance().openReportDocument(getReportDesignName(options), docName);\n long pageNumber = doc.getPageNumber(bookmark);\n doc.close();\n return pageNumber;\n}\n"
|
"private MethodNode findMethodNode(IMethod method) {\n ClassNode clazz = findClassWithName(createName(method.getDeclaringType()));\n try {\n if (method.isConstructor()) {\n List<ConstructorNode> constructors = clazz.getDeclaredConstructors();\n for (ConstructorNode constructorNode : constructors) {\n String[] jdtParamTypes = method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();\n Parameter[] groovyParams = constructorNode.getParameters() == null ? new Parameter[0] : constructorNode.getParameters();\n if (groovyParams != null && groovyParams.length > 0 && groovyParams[0].getName().startsWith(\"String_Node_Str\")) {\n Parameter[] newGroovyParams = new Parameter[groovyParams.length - 1];\n System.arraycopy(groovyParams, 1, newGroovyParams, 0, newGroovyParams.length);\n groovyParams = newGroovyParams;\n }\n if (groovyParams.length != jdtParamTypes.length) {\n continue;\n }\n for (int i = 0; i < groovyParams.length; i++) {\n String groovyClassType = groovyParams[i].getType().getName();\n if (!groovyClassType.startsWith(\"String_Node_Str\")) {\n groovyClassType = Signature.createTypeSignature(groovyClassType, false);\n }\n if (!groovyClassType.equals(jdtParamTypes[i])) {\n continue;\n }\n }\n return constructorNode;\n }\n } else {\n List<MethodNode> methods = clazz.getMethods(method.getElementName());\n for (MethodNode methodNode : methods) {\n String[] jdtParamTypes = method.getParameterTypes() == null ? new String[0] : method.getParameterTypes();\n Parameter[] groovyParams = methodNode.getParameters() == null ? new Parameter[0] : methodNode.getParameters();\n if (groovyParams.length != jdtParamTypes.length) {\n continue;\n }\n for (int i = 0; i < groovyParams.length; i++) {\n String groovyClassType = groovyParams[i].getType().getName();\n if (!groovyClassType.startsWith(\"String_Node_Str\")) {\n groovyClassType = Signature.createTypeSignature(groovyClassType, false);\n }\n if (!groovyClassType.equals(jdtParamTypes[i])) {\n continue;\n }\n }\n return methodNode;\n }\n }\n } catch (JavaModelException e) {\n Util.log(e, \"String_Node_Str\" + method.getElementName() + \"String_Node_Str\" + clazz.getName());\n }\n return null;\n}\n"
|
"public List getFilesToCompile(boolean firstPass) {\n List thisTime = new ArrayList();\n if (firstPass) {\n Collection modifiedFiles = getModifiedFiles();\n sourceFiles.addAll(modifiedFiles);\n sourceFiles.addAll(addedFiles);\n deleteClassFiles();\n addAffectedSourceFiles(sourceFiles);\n } else {\n addAffectedSourceFiles(sourceFiles);\n }\n return sourceFiles;\n}\n"
|
"public Account getAccount() {\n String pass = new String(txtPassword.getPassword());\n if (account == null)\n return null;\n if (!account.getUser().equals(txtUsername.getText()) || !account.getPass().equals(pass)) {\n account.setUser(txtUsername.getText());\n account.setPass(pass);\n account.getProperties().clear();\n }\n account.setEnabled(chkEnable.isSelected());\n return account;\n}\n"
|
"private boolean doProcess(ApplicationClustersRemovedEvent event, Topology topology) {\n Set<ClusterDataHolder> clusterData = event.getClusterData();\n if (clusterData != null) {\n for (ClusterDataHolder aClusterData : clusterData) {\n String serviceType = aClusterData.getServiceType();\n TopologyUpdater.acquireWriteLockForService(serviceType);\n try {\n Service aService = topology.getService(aClusterData.getServiceType());\n if (aService != null) {\n if (aService.clusterExists(aClusterData.getClusterId())) {\n aService.removeCluster(aClusterData.getClusterId());\n log.info(\"String_Node_Str\" + aClusterData.getClusterId() + \"String_Node_Str\" + event.getAppId());\n } else {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + aClusterData.getClusterId() + \"String_Node_Str\" + event.getAppId() + \"String_Node_Str\");\n }\n }\n } else {\n log.warn(\"String_Node_Str\" + aClusterData.getServiceType() + \"String_Node_Str\" + aClusterData.getClusterId());\n }\n } finally {\n TopologyUpdater.releaseWriteLockForService(aClusterData.getServiceType());\n }\n }\n } else {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + event.getAppId() + \"String_Node_Str\");\n }\n }\n notifyEventListeners(event);\n return true;\n}\n"
|
"public Cursor query(final Uri uri, final String[] projection, final String selection, final String[] selectionArgs, final String sortOrder) {\n final long now = System.currentTimeMillis();\n if (exchangeRates == null || now - lastUpdated > UPDATE_FREQ_MS) {\n Map<String, ExchangeRate> newExchangeRates = getBitcoinCharts();\n if (exchangeRates == null && newExchangeRates == null)\n newExchangeRates = getBlockchainInfo();\n if (newExchangeRates != null) {\n exchangeRates = newExchangeRates;\n lastUpdated = now;\n }\n }\n if (exchangeRates == null)\n return null;\n final MatrixCursor cursor = new MatrixCursor(new String[] { BaseColumns._ID, KEY_CURRENCY_CODE, KEY_RATE, KEY_SOURCE });\n if (selection == null) {\n for (final Map.Entry<String, ExchangeRate> entry : exchangeRates.entrySet()) {\n final ExchangeRate rate = entry.getValue();\n cursor.newRow().add(entry.getKey().hashCode()).add(rate.currencyCode).add(rate.rate.longValue()).add(rate.source);\n }\n } else if (selection.equals(KEY_CURRENCY_CODE)) {\n final String code = selectionArgs[0];\n final ExchangeRate rate = exchangeRates.get(code);\n cursor.newRow().add(code.hashCode()).add(rate.currencyCode).add(rate.rate).add(rate.source);\n }\n return cursor;\n}\n"
|
"public void updateChatContactStatus(MetaContact metaContact) {\n ContactListModel listModel = (ContactListModel) this.getContactList().getModel();\n if (!Constants.TABBED_CHAT_WINDOW) {\n if (contactMsgWindows.containsKey(metaContact)) {\n ChatWindow msgWindow = (ChatWindow) contactMsgWindows.get(metaContact);\n msgWindow.getCurrentChatPanel().updateContactStatus(listModel.getMetaContactStatus(metaContact));\n }\n } else if (tabbedChatWindow != null) {\n Hashtable contactTabsTable = tabbedChatWindow.getContactTabsTable();\n ChatPanel chatPanel = (ChatPanel) contactTabsTable.get(metaContact.getMetaUID());\n if (chatPanel != null) {\n tabbedChatWindow.setTabIcon(metaContact, listModel.getMetaContactStatusIcon(metaContact));\n chatPanel.updateContactStatus(listModel.getMetaContactStatus(metaContact));\n }\n }\n}\n"
|
"protected void makeActive(QueueEnqueue queue) {\n isActive = true;\n this.context = container.makeNewSharedObjectContext(this, queue);\n}\n"
|
"private void transformColumnExpressions(ColumnDesign column) {\n IBaseQueryDefinition query = getParentQuery();\n if (query == null) {\n return;\n }\n List expressions = new ArrayList();\n VisibilityDesign visibilities = column.getVisibility();\n if (visibilities != null) {\n for (int i = 0; i < visibilities.count(); i++) {\n expressions.add(visibilities.getRule(i).getExpression());\n }\n }\n HighlightDesign highlights = column.getHighlight();\n if (highlights != null) {\n for (int i = 0; i < highlights.getRuleCount(); i++) {\n expressions.add(createConditionalExpression(highlights.getRule(i)));\n }\n }\n ITotalExprBindings totalExpressionBindings = expressionUtil.prepareTotalExpressions(expressions, getCurrentGroupName());\n addNewColumnBindings(query, totalExpressionBindings);\n int expressionIndex = 0;\n List newExpressions = totalExpressionBindings.getNewExpression();\n if (visibilities != null) {\n for (int i = 0; i < visibilities.count(); i++) {\n visibilities.getRule(i).setExpression((String) newExpressions.get(expressionIndex++));\n }\n }\n if (highlights != null) {\n for (int i = 0; i < highlights.getRuleCount(); i++) {\n highlights.getRule(i).setConditionExpr((String) newExpressions.get(expressionIndex++));\n }\n }\n}\n"
|
"private boolean checkForLeavingTouchModeAndConsume(KeyEvent event) {\n final int action = event.getAction();\n if (action != KeyEvent.ACTION_DOWN && action != KeyEvent.ACTION_MULTIPLE) {\n return false;\n }\n if ((event.getFlags() & KeyEvent.FLAG_KEEP_TOUCH_MODE) != 0) {\n return false;\n }\n if (!mAttachInfo.mInTouchMode) {\n return false;\n }\n if (isKeyboardKey(event) && mView != null && mView.hasFocus()) {\n mFocusedView = mView.findFocus();\n if ((mFocusedView instanceof ViewGroup) && ((ViewGroup) mFocusedView).getDescendantFocusability() == ViewGroup.FOCUS_AFTER_DESCENDANTS) {\n return false;\n }\n if (ensureTouchMode(false)) {\n throw new IllegalStateException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n return false;\n }\n if (isDirectional(event.getKeyCode())) {\n return ensureTouchMode(false);\n }\n return false;\n}\n"
|
"public synchronized void close() throws IOException {\n if (_closed) {\n return;\n }\n _closed = true;\n for (ZooKeeperPersistentEphemeralNode node : _nodes.values()) {\n closeNode(node);\n }\n _nodes.clear();\n}\n"
|
"public Time fireAtCurrentTime(Actor actor) throws IllegalActionException {\n if (_synchronizeToRealTime) {\n long elapsedTime = System.currentTimeMillis() - _realStartTime;\n Time modelTimeForCurrentRealTime = new Time(this, (double) elapsedTime / 1000);\n return fireAt(actor, modelTimeForCurrentRealTime);\n } else {\n return super.fireAtCurrentTime(actor);\n }\n}\n"
|
"private Collection<VCastStatementCoverage> getStatementCoverageLinesWithBranch(VCastFunction function) {\n Collection<VCastStatementCoverage> toReturn = new ArrayList<>();\n JdbcStatement stmt = getStatement();\n try {\n String query = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n stmt.runPreparedQuery(query, function.getId(), function.getId());\n while (stmt.next()) {\n Integer id = stmt.getInt(\"String_Node_Str\");\n Integer line = stmt.getInt(\"String_Node_Str\");\n Integer hit_count = stmt.getInt(\"String_Node_Str\");\n Integer max_hit_count = stmt.getInt(\"String_Node_Str\");\n Integer num_conditions = stmt.getInt(\"String_Node_Str\");\n toReturn.add(new VCastStatementCoverage(id, function.getId(), line, hit_count, max_hit_count, false, \"String_Node_Str\", \"String_Node_Str\", num_conditions));\n }\n } catch (Exception ex) {\n System.out.println(ex);\n } finally {\n stmt.close();\n }\n return toReturn;\n}\n"
|
"private QueryDefinition newGenIVReportQuery() {\n QueryDefinition qd = newReportQuery();\n IBaseExpression[] rowBeArray = getRowExpr();\n IBinding[] totalBeArray = getAggrExpr();\n for (int i = 0; i < rowBeArray.length; i++) qd.addResultSetExpression(this.rowExprName[i], rowBeArray[i]);\n if (this.GEN_use_invalid_column)\n qd.addResultSetExpression(\"String_Node_Str\", new ScriptExpression(\"String_Node_Str\"));\n if (!this.notIncludeAggr) {\n for (int i = 0; i < totalBeArray.length; i++) qd.addResultSetExpression(this.totalExprName[i], totalBeArray[i]);\n }\n if (this.GEN_add_filter == true) {\n ConditionalExpression filterExpr = new ConditionalExpression(\"String_Node_Str\", IConditionalExpression.OP_GT, \"String_Node_Str\");\n FilterDefinition filterDefn = new FilterDefinition(filterExpr);\n qd.addFilter(filterDefn);\n this.GEN_filterDefn.add(filterDefn);\n }\n if (this.TEST_ISEMPTY) {\n ConditionalExpression filterExpr = new ConditionalExpression(\"String_Node_Str\", IConditionalExpression.OP_GT, \"String_Node_Str\");\n FilterDefinition filterDefn = new FilterDefinition(filterExpr);\n qd.addFilter(filterDefn);\n this.GEN_filterDefn.add(filterDefn);\n }\n if (this.GEN_add_sort) {\n SortDefinition sortDefn = new SortDefinition();\n sortDefn.setColumn(\"String_Node_Str\");\n qd.addSort(sortDefn);\n }\n if (this.GEN_add_group == true) {\n GroupDefinition gd = new GroupDefinition();\n gd.setKeyColumn(\"String_Node_Str\");\n qd.addGroup(gd);\n if (this.GEN_add_subquery == true) {\n SubqueryDefinition subqueryDefn = getSubQueryDefn(qd);\n gd.addSubquery(subqueryDefn);\n }\n }\n if (this.GEN_add_group1 == true) {\n GroupDefinition gd = new GroupDefinition();\n gd.setKeyColumn(\"String_Node_Str\");\n qd.addGroup(gd);\n gd = new GroupDefinition();\n gd.setKeyColumn(\"String_Node_Str\");\n qd.addGroup(gd);\n }\n if (add_subquery_on_query) {\n qd.addSubquery(getSubQueryDefn(qd));\n }\n return qd;\n}\n"
|
"protected void _regressionTest(NamedObj namedObj, Property property) throws PropertyResolutionException {\n Property previousProperty = getPreviousProperty(namedObj);\n if (previousProperty != null) {\n try {\n PropertyAttribute attribute = _getPropertyAttribute(namedObj);\n _updatePropertyAttribute(attribute, previousProperty);\n } catch (IllegalActionException ex) {\n throw new PropertyResolutionException(this, ex);\n }\n }\n if ((previousProperty == null && property != null) || (previousProperty != null && !previousProperty.toString().equals(property.toString()))) {\n addErrors(_eol + \"String_Node_Str\" + getUseCaseName() + \"String_Node_Str\" + namedObj.getFullName() + \"String_Node_Str\" + _eol + \"String_Node_Str\" + previousProperty + \"String_Node_Str\" + property + \"String_Node_Str\");\n }\n}\n"
|
"public static void write(LoadFlowResult result, Path jsonFile) {\n Objects.requireNonNull(result);\n Objects.requireNonNull(jsonFile);\n try (OutputStream os = Files.newOutputStream(jsonFile)) {\n ObjectMapper objectMapper = JsonUtil.createObjectMapper();\n SimpleModule module = new SimpleModule();\n module.addSerializer(LoadFlowResult.class, new LoadFlowResultSerializer());\n objectMapper.registerModule(module);\n ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter();\n writer.writeValue(os, result);\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n}\n"
|
"public List<TdColumn> returnColumns(IMetadataConnection metadataConnection, TableNode tableNode, boolean... dontCreateClose) {\n if (metadataConnection == null || tableNode == null || tableNode.getType() != TableNode.TABLE) {\n return Collections.emptyList();\n }\n NamedColumnSet table = tableNode.getTable();\n if (table == null) {\n table = tableNode.getView();\n }\n if (table == null) {\n return Collections.emptyList();\n }\n List<TdColumn> metadataColumns = new ArrayList<TdColumn>();\n boolean needCreateAndClose = dontCreateClose.length == 0 || !dontCreateClose[0];\n DriverShim wapperDriver = null;\n String dbType = \"String_Node_Str\";\n ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();\n try {\n dbType = metadataConnection.getDbType();\n DatabaseMetaData dbMetaData = null;\n if (EDatabaseTypeName.HIVE.getXmlName().equalsIgnoreCase(dbType)) {\n dbMetaData = HiveConnectionManager.getInstance().extractDatabaseMetaData(metadataConnection);\n } else {\n if (needCreateAndClose || extractMeta.getConn() == null || extractMeta.getConn().isClosed()) {\n List list = extractMeta.getConnection(metadataConnection.getDbType(), metadataConnection.getUrl(), metadataConnection.getUsername(), metadataConnection.getPassword(), metadataConnection.getDatabase(), metadataConnection.getSchema(), metadataConnection.getDriverClass(), metadataConnection.getDriverJarPath(), metadataConnection.getDbVersionString(), metadataConnection.getAdditionalParams());\n if (list != null && list.size() > 0) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i) instanceof DriverShim) {\n wapperDriver = (DriverShim) list.get(i);\n }\n }\n }\n }\n dbMetaData = extractMeta.getDatabaseMetaData(extractMeta.getConn(), dbType, metadataConnection.isSqlMode(), metadataConnection.getDatabase());\n }\n String tableLabel = tableNode.getValue();\n TableNode newNode = tableNode;\n String name = newNode.getItemType();\n if (name != null && StringUtils.trimToEmpty(name).equals(ETableTypes.TABLETYPE_SYNONYM.getName())) {\n String tableName = getTableNameBySynonyms(extractMeta.getConn(), newNode.getValue());\n if (tableName != null && tableName.contains(\"String_Node_Str\")) {\n tableName = tableName.replace(\"String_Node_Str\", \"String_Node_Str\");\n }\n fillSynonyms(metadataConnection, metadataColumns, table, tableName, dbMetaData);\n } else {\n if (tableLabel.contains(\"String_Node_Str\")) {\n tableLabel = tableLabel.replace(\"String_Node_Str\", \"String_Node_Str\");\n }\n newNode.setValue(tableLabel);\n metadataColumns = MetadataFillFactory.getDBInstance().fillColumns(table, metadataConnection, dbMetaData, null);\n }\n ColumnSetHelper.addColumns(table, metadataColumns);\n if (needCreateAndClose) {\n extractMeta.closeConnection();\n }\n } catch (Exception e) {\n ExceptionHandler.process(e);\n log.error(e);\n } finally {\n if (extractMeta.getConn() != null) {\n ConnectionUtils.closeConnection(extractMeta.getConn());\n }\n }\n return metadataColumns;\n}\n"
|
"private String calculateWorkDirectory(final TheRRunConfigurationParams runConfigurationParams) {\n final String workingDirectory = runConfigurationParams.getWorkingDirectory();\n final String defaultValue = new File(runConfigurationParams.getScriptPath()).getParent();\n return !StringUtil.isEmptyOrSpaces(specifiedValue) ? specifiedValue : defaultValue;\n}\n"
|
"public SplitResult split(int height, boolean force) throws BirtException {\n SplitResult result = super.split(height, force);\n if (result.getResult() != null) {\n TableArea tableResult = (TableArea) result.getResult();\n unresolvedRow = tableResult.getLastRow();\n int h = tableResult.layout.resolveAll(unresolvedRow);\n if (h > 0) {\n tableResult.setHeight(tableResult.getHeight() + h);\n }\n tableResult.resolveBottomBorder();\n layout.setUnresolvedRow(unresolvedRow);\n if (context.isFixedLayout()) {\n FixedLayoutPageHintGenerator pageHintGenerator = context.getPageHintGenerator();\n if (pageHintGenerator != null && unresolvedRow != null) {\n pageHintGenerator.addUnresolvedRowHint(unresolvedRow.getTableArea().getContent().getInstanceID().toUniqueString(), convertRowToHint(unresolvedRow));\n }\n }\n }\n relayoutChildren();\n return result;\n}\n"
|
"private static int readGeneric(String desc, int start, IGeneric generic) {\n int index = desc.indexOf(':', start);\n Name name = Name.getQualified(desc.substring(start, index));\n TypeVariable typeVar = new TypeVariable(generic, name);\n if (desc.charAt(index + 1) == ':') {\n index++;\n typeVar.addUpperBound(Types.OBJECT);\n }\n while (desc.charAt(index) == ':') {\n index = readTyped(desc, index + 1, typeVar::addUpperBound);\n }\n generic.addTypeVariable(typeVar);\n return index;\n}\n"
|
"public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1) {\n if (op1.getPosition() == path.get(0)) {\n int d = 0;\n if (splitLeft) {\n d++;\n }\n if (sr) {\n d++;\n }\n return new TreeMergeParagraph(op1.getSiteId(), op1.getPosition(), op1.leftSiblingChildrenNr, op1.rightSiblingChildrenNr + d);\n }\n if (op1.getPosition() == path.get(0) + 1) {\n int d = 0;\n if (splitLeft) {\n d++;\n }\n if (sr) {\n d++;\n }\n return new TreeMergeParagraph(op1.getPosition(), op1.leftSiblingChildrenNr + d, op1.rightSiblingChildrenNr);\n }\n return op1;\n}\n"
|
"public boolean select(Viewer viewer, Object parentElement, Object element) {\n if (m_searchString == null || m_searchString.length() == 0 || !(element instanceof IDataSetPO)) {\n return true;\n }\n for (String value : ((IDataSetPO) element).getColumnStringValues()) {\n if (value != null && value.matches(m_searchString)) {\n return true;\n }\n }\n return false;\n}\n"
|
"public void testAllocationDeallocation() {\n final String configDir = getConfigDir();\n if (configDir == null) {\n fail(\"String_Node_Str\");\n }\n GlobalConfiguration.loadConfiguration(configDir);\n final TestInstanceListener testInstanceListener = new TestInstanceListener();\n final ClusterManager cm = new ClusterManager();\n cm.setInstanceListener(testInstanceListener);\n try {\n final String ipAddress = \"String_Node_Str\";\n final InstanceConnectionInfo instanceConnectionInfo = new InstanceConnectionInfo(InetAddress.getByName(ipAddress), ipAddress, null, 1234, 1235);\n final HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(8, 8L * 1024L * 1024L * 1024L, 8L * 1024L * 1024L * 1024L);\n cm.reportHeartBeat(instanceConnectionInfo, hardwareDescription);\n final JobID jobID = new JobID();\n final Configuration conf = new Configuration();\n final InstanceRequestMap instanceRequestMap = new InstanceRequestMap();\n instanceRequestMap.setNumberOfInstances(cm.getInstanceTypeByName(SMALL_INSTANCE_TYPE_NAME), 2);\n instanceRequestMap.setNumberOfInstances(cm.getInstanceTypeByName(MEDIUM_INSTANCE_TYPE_NAME), 1);\n try {\n cm.requestInstance(jobID, conf, instanceRequestMap, null);\n } catch (InstanceException ie) {\n fail(ie.getMessage());\n }\n ClusterManagerTestUtils.waitForInstances(jobID, testInstanceListener, 3, MAX_WAIT_TIME);\n final List<AllocatedResource> allocatedResources = testInstanceListener.getAllocatedResourcesForJob(jobID);\n assertEquals(3, allocatedResources.size());\n Iterator<AllocatedResource> it = allocatedResources.iterator();\n final Set<AllocationID> allocationIDs = new HashSet<AllocationID>();\n while (it.hasNext()) {\n final AllocatedResource allocatedResource = it.next();\n if (!LARGE_INSTANCE_TYPE_NAME.equals(allocatedResource.getInstance().getType().getIdentifier())) {\n fail(\"String_Node_Str\" + allocatedResource.getInstance().getType().getIdentifier());\n }\n if (allocationIDs.contains(allocatedResource.getAllocationID())) {\n fail(\"String_Node_Str\" + allocatedResource.getAllocationID() + \"String_Node_Str\");\n } else {\n allocationIDs.add(allocatedResource.getAllocationID());\n }\n }\n try {\n InstanceRequestMap instancem = new InstanceRequestMap();\n instancem.setNumberOfInstances(cm.getInstanceTypeByName(MEDIUM_INSTANCE_TYPE_NAME), 1);\n cm.requestInstance(jobID, conf, instancem, null);\n fail(\"String_Node_Str\");\n } catch (InstanceException ie) {\n }\n it = allocatedResources.iterator();\n try {\n while (it.hasNext()) {\n final AllocatedResource allocatedResource = it.next();\n cm.releaseAllocatedResource(jobID, conf, allocatedResource);\n }\n } catch (InstanceException ie) {\n fail(ie.getMessage());\n }\n try {\n InstanceRequestMap instancem = new InstanceRequestMap();\n instancem.setNumberOfInstances(cm.getInstanceTypeByName(LARGE_INSTANCE_TYPE_NAME), 1);\n cm.requestInstance(jobID, conf, instancem, null);\n } catch (InstanceException ie) {\n fail(ie.getMessage());\n }\n } catch (UnknownHostException e) {\n fail(e.getMessage());\n } finally {\n if (cm != null) {\n cm.shutdown();\n }\n }\n}\n"
|
"public void actualAsyncLog(final RingBufferLogEvent event) {\n final List<Property> properties = privateConfig.loggerConfig.getPropertyList();\n if (properties != null) {\n MutableContextData contextData = (MutableContextData) event.getContextData();\n for (final Map.Entry<Property, Boolean> entry : properties.entrySet()) {\n final Property prop = entry.getKey();\n if (contextData.getValue(prop.getName()) != null) {\n continue;\n }\n final String value = entry.getValue() ? privateConfig.config.getStrSubstitutor().replace(event, prop.getValue()) : prop.getValue();\n contextData.putValue(prop.getName(), prop.getValue());\n }\n }\n final ReliabilityStrategy strategy = privateConfig.loggerConfig.getReliabilityStrategy();\n strategy.log(this, event);\n}\n"
|
"private static OArchitectOClass convertOClassFromJson(JSONObject jsonObject) {\n OArchitectOClass oClass = new OArchitectOClass(jsonObject.getString(NAME));\n if (!jsonObject.isNull(SUPER_CLASSES_NAMES)) {\n oClass.setSuperClassesNames(getSuperClasses(jsonObject.getJSONArray(SUPER_CLASSES_NAMES)));\n }\n if (!jsonObject.isNull(PROPERTIES)) {\n oClass.setProperties(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES)));\n }\n if (!jsonObject.isNull(PROPERTIES_FOR_DELETE)) {\n oClass.setPropertiesForDelete(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES_FOR_DELETE)));\n }\n return oClass;\n}\n"
|
"private ProgramState executeInitializedBinding(InitializedBindingElementTree initializedBindingElementTree, ProgramState programState) {\n ProgramState newProgramState = programState;\n if (((JavaScriptTree) initializedBindingElementTree).getParent().is(Kind.OBJECT_BINDING_PATTERN, Kind.ARRAY_BINDING_PATTERN, Kind.BINDING_PROPERTY)) {\n newProgramState = programState.removeLastValue();\n } else {\n BindingElementTree variable = initializedBindingElementTree.left();\n if (variable.is(Kind.BINDING_IDENTIFIER)) {\n newProgramState = assignment(programState, variable);\n }\n newProgramState = newProgramState.clearStack(initializedBindingElementTree);\n }\n return newProgramState;\n}\n"
|
"public String getName() {\n if (Machine.merge_mode.isMerge()) {\n if (merge == null) {\n if (isCollisionMode() && parent.isClone()) {\n return parent.name + \"String_Node_Str\" + name;\n } else\n return merge;\n }\n return name;\n}\n"
|
"private void handleGalleryImageUploadedLegacyEditor(Long galleryId, String localId, String remoteId) {\n SpannableStringBuilder postContent;\n if (mEditorFragment.getSpannedContent() != null) {\n postContent = new SpannableStringBuilder(mEditorFragment.getSpannedContent());\n } else {\n try {\n postContent = new SpannableStringBuilder(StringUtils.notNullStr((String) mEditorFragment.getContent()));\n } catch (IllegalEditorStateException e) {\n AppLog.e(T.EDITOR, \"String_Node_Str\");\n return;\n }\n }\n int selectionStart = 0;\n int selectionEnd = postContent.length();\n MediaGalleryImageSpan[] gallerySpans = postContent.getSpans(selectionStart, selectionEnd, MediaGalleryImageSpan.class);\n if (gallerySpans.length != 0) {\n for (MediaGalleryImageSpan gallerySpan : gallerySpans) {\n MediaGallery gallery = gallerySpan.getMediaGallery();\n if (gallery.getUniqueId() == galleryId) {\n ArrayList<String> galleryIds = gallery.getIds();\n galleryIds.add(remoteId);\n gallery.setIds(galleryIds);\n gallerySpan.setMediaGallery(gallery);\n int spanStart = postContent.getSpanStart(gallerySpan);\n int spanEnd = postContent.getSpanEnd(gallerySpan);\n postContent.setSpan(gallerySpan, spanStart, spanEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);\n }\n }\n }\n}\n"
|
"public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {\n renderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);\n setBorder(new CompoundBorder(new MatteBorder(0, 1, 1, 1, Color.WHITE), new EmptyBorder(new Insets(5, 5, 5, 5))));\n setVerticalAlignment(NORTH);\n setForeground(renderer.getForeground());\n setBackground(renderer.getBackground());\n setFont(renderer.getFont());\n if (value instanceof Severity) {\n setText(paginaEPUBChecker.l10n.getString(((Severity) value).toString()));\n setIcon(iconForLogLevel((Severity) value));\n }\n return this;\n}\n"
|
"public static void createSubset(Product sourceProduct, Rectangle bounds) {\n if (MultiSizeIssue.isMultiSize(sourceProduct)) {\n final Product resampledProduct = MultiSizeIssue.maybeResample(sourceProduct);\n if (resampledProduct != null) {\n sourceProduct = resampledProduct;\n } else {\n return;\n }\n }\n final String subsetName = \"String_Node_Str\" + CreateSubsetAction.subsetNumber + \"String_Node_Str\" + sourceProduct.getName();\n final ProductSubsetDef initSubset = new ProductSubsetDef();\n initSubset.setRegion(bounds);\n initSubset.setNodeNames(sourceProduct.getBandNames());\n initSubset.addNodeNames(sourceProduct.getTiePointGridNames());\n initSubset.setIgnoreMetadata(false);\n final ProductSubsetDialog subsetDialog = new ProductSubsetDialog(SnapApp.getDefault().getMainFrame(), sourceProduct, initSubset);\n if (subsetDialog.show() != ProductSubsetDialog.ID_OK) {\n return;\n }\n final ProductSubsetDef subsetDef = subsetDialog.getProductSubsetDef();\n if (subsetDef == null) {\n Dialogs.showInformation(Bundle.CTL_CreateSubsetFromViewAction_Title(), \"String_Node_Str\", null);\n return;\n }\n try {\n final Product subset = sourceProduct.createSubset(subsetDef, subsetName, sourceProduct.getDescription());\n SnapApp.getDefault().getProductManager().addProduct(subset);\n CreateSubsetAction.subsetNumber++;\n } catch (Exception e) {\n final String msg = \"String_Node_Str\" + e.getMessage();\n SnapApp.getDefault().handleError(msg, e);\n }\n}\n"
|
"public boolean hasCurrentEvent() {\n try {\n CTSchedule schedule = (CTSchedule) getScheduler().getSchedule();\n Iterator eventGenerators = schedule.get(CTSchedule.EVENT_GENERATORS).actorIterator();\n boolean hasDiscreteEvents = false;\n while (eventGenerators.hasNext()) {\n CTEventGenerator generator = (CTEventGenerator) eventGenerators.next();\n if (generator.hasCurrentEvent()) {\n hasDiscreteEvents = true;\n }\n }\n hasDiscreteEvents |= _processBreakpoints();\n return hasDiscreteEvents;\n } catch (IllegalActionException ex) {\n throw new InternalErrorException(\"String_Node_Str\" + ex.getMessage());\n }\n}\n"
|
"private void refreshNodeStatus(NodeEntity node, boolean inSession) {\n String mobId = node.getMoId();\n if (mobId == null) {\n setNotExist(node);\n return;\n }\n VcVirtualMachine vcVm = VcCache.getIgnoreMissing(mobId);\n if (vcVm == null) {\n setNotExist(node);\n return;\n }\n if (!vcVm.isPoweredOn()) {\n node.setStatus(NodeStatus.POWERED_OFF);\n node.resetIps();\n } else {\n node.setStatus(NodeStatus.POWERED_ON);\n }\n if (vcVm.isPoweredOn()) {\n for (String portGroup : node.fetchAllPortGroups()) {\n String ip = VcVmUtil.getIpAddressOfPortGroup(vcVm, portGroup, inSession);\n node.updateIpAddressOfPortGroup(portGroup, ip);\n }\n if (node.ipsReady()) {\n node.setStatus(NodeStatus.VM_READY);\n if (node.getAction() != null && (node.getAction().equals(Constants.NODE_ACTION_WAITING_IP) || node.getAction().equals(Constants.NODE_ACTION_RECONFIGURE))) {\n node.setAction(null);\n }\n }\n String guestHostName = VcVmUtil.getGuestHostName(vcVm, inSession);\n if (guestHostName != null) {\n node.setGuestHostName(guestHostName);\n }\n }\n node.setHostName(vcVm.getHost().getName());\n update(node);\n}\n"
|
"public boolean contains(Key key) {\n checkActive();\n try {\n DataPolice.setKey(key);\n return null != find(key);\n } catch (IOException e) {\n return false;\n } finally {\n DataPolice.setKey(null);\n }\n}\n"
|
"public Plan makeDiscoveryPlan() {\n Plan result = new Plan();\n for (DiscoveryNode subject : pollQueue) {\n Node node = new Node(subject.getSwitchId(), subject.getPortId());\n if (subject.forlorn()) {\n continue;\n } else if (subject.isStale(consecutiveLostTillFail) && subject.timeToCheck()) {\n result.discoveryFailure.add(node);\n subject.resetTickCounter();\n continue;\n } else if (subject.isStale(consecutiveLostTillFail) && !subject.timeToCheck()) {\n subject.logTick();\n continue;\n }\n if (filter.isMatch(subject)) {\n logger.debug(\"String_Node_Str\", subject);\n subject.renew();\n subject.resetTickCounter();\n continue;\n }\n if (subject.forlorn()) {\n continue;\n }\n Node node = new Node(subject.getSwitchId(), subject.getPortId());\n if (subject.maxAttempts(consecutiveLostTillFail)) {\n if (subject.isFoundIsl() && subject.getConsecutiveFailure() == 0) {\n result.discoveryFailure.add(node);\n logger.info(\"String_Node_Str\", subject);\n }\n subject.incConsecutiveFailure();\n }\n if (subject.timeToCheck()) {\n subject.incAttempts();\n subject.resetTickCounter();\n result.needDiscovery.add(node);\n } else {\n subject.logTick();\n }\n }\n return result;\n}\n"
|
"public void resetStorage() {\n objectStorage = new HashMap<String, Object>();\n storageIds = new HashMap<String, Integer>();\n}\n"
|
"public static Map getDatabaseProperties() {\n if (propertiesMap == null) {\n String dbDriver = System.getProperty(DB_DRIVER_KEY);\n String dbUrl = System.getProperty(DB_URL_KEY);\n String dbUser = System.getProperty(DB_USER_KEY);\n String dbPwd = System.getProperty(DB_PWD_KEY);\n String platform = System.getProperty(DB_PLATFORM_KEY);\n String logLevel = System.getProperty(LOGGING_LEVEL_KEY);\n if ((dbDriver == null) || (dbUrl == null) || (dbUser == null) || (dbPwd == null) || (platform == null) || (logLevel == null)) {\n Properties properties = new Properties();\n File testPropertiesFile = new File(System.getProperty(TEST_PROPERTIES_FILE_KEY, TEST_PROPERTIES_FILE_DEFAULT));\n URL url = null;\n if (testPropertiesFile.exists()) {\n try {\n url = testPropertiesFile.toURL();\n } catch (MalformedURLException exception) {\n throw new RuntimeException(\"String_Node_Str\" + testPropertiesFile.getName() + \"String_Node_Str\", exception);\n }\n }\n if (url != null) {\n try {\n properties.load(url.openStream());\n } catch (java.io.IOException exception) {\n throw new RuntimeException(\"String_Node_Str\" + testPropertiesFile.getName() + \"String_Node_Str\", exception);\n }\n }\n if (dbDriver == null) {\n dbDriver = (String) properties.get(\"String_Node_Str\");\n }\n if (dbUrl == null) {\n dbUrl = (String) properties.get(\"String_Node_Str\");\n }\n if (dbUser == null) {\n dbUser = (String) properties.get(\"String_Node_Str\");\n }\n if (dbPwd == null) {\n dbPwd = (String) properties.get(\"String_Node_Str\");\n }\n if (platform == null) {\n platform = (String) properties.get(\"String_Node_Str\");\n }\n if (logLevel == null) {\n logLevel = (String) properties.get(\"String_Node_Str\");\n }\n }\n propertiesMap = new HashMap();\n if (dbDriver != null) {\n propertiesMap.put(\"String_Node_Str\", dbDriver);\n }\n if (dbUrl != null) {\n propertiesMap.put(PersistenceUnitProperties.JDBC_URL, dbUrl);\n }\n if (dbUser != null) {\n propertiesMap.put(PersistenceUnitProperties.JDBC_USER, dbUser);\n }\n if (dbPwd != null) {\n propertiesMap.put(PersistenceUnitProperties.JDBC_PASSWORD, dbPwd);\n }\n if (logLevel != null) {\n propertiesMap.put(PersistenceUnitProperties.LOGGING_LEVEL, logLevel);\n }\n if (platform != null) {\n propertiesMap.put(PersistenceUnitProperties.TARGET_DATABASE, platform);\n }\n propertiesMap.putAll(persistencePropertiesTestMap);\n }\n return propertiesMap;\n}\n"
|
"public static org.hl7.fhir.dstu2016may.model.Distance convertDistance(org.hl7.fhir.dstu3.model.Distance src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2016may.model.Distance tgt = new org.hl7.fhir.dstu2016may.model.Distance();\n copyElement(src, tgt);\n tgt.setValue(src.getValue());\n tgt.setComparator(convertQuantityComparator(src.getComparator()));\n tgt.setUnit(src.getUnit());\n tgt.setSystem(src.getSystem());\n tgt.setCode(src.getCode());\n return tgt;\n}\n"
|
"private final void realStartServiceLocked(ServiceRecord r, ProcessRecord app) throws RemoteException {\n if (app.thread == null) {\n throw new RemoteException();\n }\n r.app = app;\n r.restartTime = r.lastActivity = SystemClock.uptimeMillis();\n app.services.add(r);\n bumpServiceExecutingLocked(r);\n updateLruProcessLocked(app, true, true);\n boolean created = false;\n try {\n if (DEBUG_SERVICE)\n Slog.v(TAG, \"String_Node_Str\" + r.name + \"String_Node_Str\" + r.intent);\n mStringBuilder.setLength(0);\n r.intent.getIntent().toShortString(mStringBuilder, false, true);\n EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE, System.identityHashCode(r), r.shortName, mStringBuilder.toString(), r.app.pid);\n synchronized (r.stats.getBatteryStats()) {\n r.stats.startLaunchedLocked();\n }\n ensurePackageDexOpt(r.serviceInfo.packageName);\n app.thread.scheduleCreateService(r, r.serviceInfo);\n r.postNotification();\n created = true;\n } finally {\n if (!created) {\n app.services.remove(r);\n scheduleServiceRestartLocked(r, false);\n }\n }\n requestServiceBindingsLocked(r);\n if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {\n r.lastStartId++;\n if (r.lastStartId < 1) {\n r.lastStartId = 1;\n }\n r.pendingStarts.add(new ServiceRecord.StartItem(r, r.lastStartId, null, -1));\n }\n sendServiceArgsLocked(r, true);\n}\n"
|
"public void setHabit(Habit habit) {\n if (this.habit != null)\n detachFromHabit();\n this.habit = habit;\n checkmarkPanel.setHabit(habit);\n postInvalidate();\n}\n"
|
"protected ColumnMetadata getColumn(String loggingCtx) {\n if (m_column == null) {\n Object column = getAnnotation(Column.class);\n return new ColumnMetadata(column, getAttributeName());\n } else {\n return m_column;\n }\n}\n"
|
"private OutputStream getOutputStream(IStreamableResource conn) {\n return conn.getOutputStream(relativePathAndFile, mustExist);\n}\n"
|
"public Map<String, KitInstance> loadKits() {\n final Map<String, KitInstance> result = new LinkedHashMap<String, KitInstance>();\n final List<MaterialContainer> items = new ArrayList<MaterialContainer>();\n final ExtendedConfiguration kits = getYml(\"String_Node_Str\");\n final Map<String, List<String>> kitParents = new HashMap<String, List<String>>();\n final Map<ArmorPart, MaterialContainer> armor = new EnumMap<Type.ArmorPart, MaterialContainer>(ArmorPart.class);\n final ConfigurationSection kitNodes = kits.getConfigurationSection(\"String_Node_Str\");\n if (kitNodes == null) {\n ACLogger.severe(\"String_Node_Str\");\n return result;\n }\n for (final String kitName : kitNodes.getKeys(false)) {\n int delay = 0;\n final ConfigurationSection kitNode = kitNodes.getConfigurationSection(kitName);\n ConfigurationSection kitItems = null;\n ConfigurationSection armorItems = null;\n List<String> parents = null;\n try {\n kitItems = kitNode.getConfigurationSection(\"String_Node_Str\");\n armorItems = kitNode.getConfigurationSection(\"String_Node_Str\");\n parents = kitNode.getStringList(\"String_Node_Str\");\n } catch (final NullPointerException e) {\n DebugLog.INSTANCE.warning(\"String_Node_Str\" + kitName);\n continue;\n }\n if (kitItems != null)\n for (final String item : kitItems.getKeys(false)) {\n try {\n final MaterialContainer m = Utils.checkMaterial(item);\n m.setAmount(kitItems.getInt(item, 1));\n if (!m.isNull())\n items.add(m);\n } catch (final InvalidInputException e) {\n DebugLog.INSTANCE.log(Level.WARNING, \"String_Node_Str\" + item, e);\n }\n }\n delay = kitNode.getInt(\"String_Node_Str\", 0);\n if (armorItems != null) {\n for (final ArmorPart part : ArmorPart.values()) {\n final String partId = armorItems.getString(part.toString());\n if (partId == null)\n continue;\n final MaterialContainer m = Utils.checkMaterial(partId);\n if (!m.isNull())\n armor.put(part, m);\n }\n result.put(kitName, new ArmoredKitInstance(kitName, delay, new ArrayList<MaterialContainer>(items), new EnumMap<Type.ArmorPart, MaterialContainer>(armor)));\n } else\n result.put(kitName, new KitInstance(kitName, delay, new ArrayList<MaterialContainer>(items)));\n if (parents != null)\n kitParents.put(kitName, parents);\n else\n ACLogger.info(kitName + \"String_Node_Str\");\n items.clear();\n armor.clear();\n }\n for (final Entry<String, List<String>> entry : kitParents.entrySet()) {\n KitInstance kit = result.get(entry.getKey());\n for (final String parent : entry.getValue()) {\n final KitInstance parentKit = result.get(parent);\n if (parentKit == null)\n continue;\n if (parentKit instanceof ArmoredKitInstance && !(kit instanceof ArmoredKitInstance)) {\n kit = new ArmoredKitInstance(kit);\n result.put(kit.getName(), kit);\n }\n kit.addParent(parentKit);\n }\n }\n return result;\n}\n"
|
"private String getElementID(final String relativePath) {\n String elementID = null;\n String topicWithelement = null;\n final String fragment = getFragment(relativePath);\n if (fragment != null) {\n if (fragment.lastIndexOf(SLASH) != -1) {\n return fragment.substring(fragment.lastIndexOf(SLASH) + 1);\n } else {\n elementID = topicWithelement;\n }\n }\n return elementID;\n}\n"
|
"protected void registerTimerMonitorableComponent() {\n if (isTimedObject()) {\n String invokerId = EjbMonitoringUtils.getInvokerId(containerInfo.appName, containerInfo.modName, containerInfo.ejbName);\n try {\n ProbeProviderFactory probeFactory = ejbContainerUtilImpl.getProbeProviderFactory();\n timerProbeNotifier = probeFactory.getProbeProvider(EjbTimedObjectProbeProvider.class, invokerId);\n if (_logger.isLoggable(Level.FINE)) {\n _logger.log(Level.FINE, \"String_Node_Str\" + timerProbeNotifier.getClass().getName());\n }\n } catch (Exception ex) {\n timerProbeNotifier = new EjbTimedObjectProbeProvider();\n if (_logger.isLoggable(Level.FINE)) {\n _logger.log(Level.FINE, \"String_Node_Str\");\n }\n }\n timerProbeListener = new EjbTimedObjectStatsProvider(containerInfo.appName, containerInfo.modName, containerInfo.ejbName);\n timerProbeListener.register();\n }\n _logger.log(Level.FINE, \"String_Node_Str\");\n}\n"
|
"public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException {\n if (args.length != 1) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n final Logger logger = LoggerFactory.getLogger(ExampleClientRPC.class);\n final HostAndPort nodeAddress = HostAndPort.fromString(args[0]);\n final CordaRPCClient client = new CordaRPCClient(nodeAddress, ConfigUtilities.configureTestSSL(), null);\n client.start(\"String_Node_Str\", \"String_Node_Str\");\n final CordaRPCOps proxy = client.proxy();\n final Pair<List<SignedTransaction>, Observable<SignedTransaction>> txsAndFutureTxs = proxy.verifiedTransactions();\n final List<SignedTransaction> txs = txsAndFutureTxs.getFirst();\n final Observable<SignedTransaction> futureTxs = txsAndFutureTxs.getSecond();\n futureTxs.startWith(txs).toBlocking().subscribe(transaction -> transaction.getTx().getOutputs().forEach(output -> {\n final PurchaseOrderState poState = (PurchaseOrderState) output.getData();\n logger.info(poState.getPurchaseOrder().toString());\n }));\n}\n"
|
"private int retrieveTissueTypeSampleAccession(Integer parentSampleAcc, SampleInfo barcode) throws Exception {\n int tissueTypeSampleAcc = 0;\n String name = barcode.getParentSample() + \"String_Node_Str\" + barcode.getTissueOrigin() + \"String_Node_Str\" + barcode.getTissueType();\n List<Sample> children = metadata.getChildSamplesFrom(parentSampleAcc);\n if (children != null) {\n for (Sample s : children) {\n if (s.getTitle().equals(name)) {\n tissueTypeSampleAcc = s.getSwAccession();\n }\n }\n }\n if (tissueTypeSampleAcc == 0) {\n tissueTypeSampleAcc = createSample(name, \"String_Node_Str\", 0, parentSampleAcc, barcode.getOrganismId(), false);\n }\n names.put(tissueTypeSampleAcc, name);\n recordEdge(\"String_Node_Str\", parentSampleAcc, \"String_Node_Str\", tissueTypeSampleAcc);\n return tissueTypeSampleAcc;\n}\n"
|
"private void setDelays(RecordInfo recordInfo, int extraDelay, MapContainer mapContainer, Data key) {\n long deleteDelay = -1;\n long writeDelay = -1;\n if (mapContainer.getMapStoreScheduler() != null) {\n final ScheduledEntry scheduledEntry = mapContainer.getMapStoreScheduler().get(key);\n if (scheduledEntry != null) {\n if (scheduledEntry.getValue() == null) {\n deleteDelay = extraDelay + findDelayMillis(scheduledEntry);\n } else {\n writeDelay = extraDelay + findDelayMillis(scheduledEntry);\n }\n }\n }\n idleDelay = getDelay(mapContainer.getIdleEvictionScheduler(), key, extraDelay);\n ttlDelay = getDelay(mapContainer.getTtlEvictionScheduler(), key, extraDelay);\n info.setMapStoreDeleteDelayMillis(deleteDelay);\n info.setMapStoreWriteDelayMillis(writeDelay);\n info.setIdleDelayMillis(idleDelay);\n info.setTtlDelayMillis(ttlDelay);\n}\n"
|
"public void finishOp(int op) {\n finishOp(op, Process.myUid(), mContext.getOpPackageName());\n}\n"
|
"public void testExternsReferencesToGoogModuleTypesAreRewritten() {\n CompilerOptions options = createCompilerOptions();\n options.setClosurePass(true);\n options.setCheckTypes(true);\n test(options, new String[] { LINE_JOINER.join(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"), LINE_JOINER.join(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\") }, (String[]) null);\n}\n"
|
"public static void beforeClass() {\n predicate = new BlacklistTriplePredicate(GraphConfig.config());\n invalidSubject = Triple.fromStringUris(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n invalidObject = Triple.fromStringUris(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n validTriple = Triple.fromStringUris(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n}\n"
|
"public static TableContext create(TableDescriptor tableDescriptor) {\n if (tableDescriptor == null) {\n throw new NullPointerException(\"String_Node_Str\");\n }\n String name = tableDescriptor.getName();\n if (name == null) {\n throw new NullPointerException(\"String_Node_Str\");\n }\n TableContext tableContext = cache.get(name);\n if (tableContext != null) {\n return tableContext;\n }\n LOG.info(\"String_Node_Str\", name);\n Configuration configuration = new Configuration();\n Map<String, String> tableProperties = tableDescriptor.getTableProperties();\n if (tableProperties != null) {\n for (Entry<String, String> prop : tableProperties.entrySet()) {\n configuration.set(prop.getKey(), prop.getValue());\n }\n }\n tableContext = new TableContext();\n tableContext.configuration = configuration;\n tableContext.tablePath = new Path(tableDescriptor.getTableUri());\n tableContext.walTablePath = new Path(tableContext.tablePath, LOGS);\n tableContext.defaultFieldName = SUPER;\n tableContext.table = name;\n tableContext.descriptor = tableDescriptor;\n tableContext.timeBetweenCommits = configuration.getLong(BLUR_SHARD_TIME_BETWEEN_COMMITS, 60000);\n tableContext.timeBetweenRefreshs = configuration.getLong(BLUR_SHARD_TIME_BETWEEN_REFRESHS, 5000);\n tableContext.defaultPrimeDocTerm = new Term(\"String_Node_Str\", \"String_Node_Str\");\n tableContext.defaultScoreType = ScoreType.SUPER;\n boolean strict = tableDescriptor.isStrictTypes();\n String defaultMissingFieldType = tableDescriptor.getDefaultMissingFieldType();\n boolean defaultMissingFieldLessIndexing = tableDescriptor.isDefaultMissingFieldLessIndexing();\n Map<String, String> defaultMissingFieldProps = emptyIfNull(tableDescriptor.getDefaultMissingFieldProps());\n Path storagePath = new Path(tableContext.tablePath, TYPES);\n try {\n HdfsFieldManager hdfsFieldManager = new HdfsFieldManager(SUPER, new NoStopWordStandardAnalyzer(), storagePath, configuration, strict, defaultMissingFieldType, defaultMissingFieldLessIndexing, defaultMissingFieldProps);\n hdfsFieldManager.load();\n tableContext.fieldManager = hdfsFieldManager;\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n Class<?> c1 = configuration.getClass(BLUR_SHARD_INDEX_DELETION_POLICY_MAXAGE, KeepOnlyLastCommitDeletionPolicy.class);\n tableContext.indexDeletionPolicy = (IndexDeletionPolicy) configure(ReflectionUtils.newInstance(c1, configuration), tableContext);\n Class<?> c2 = configuration.getClass(BLUR_SAHRD_INDEX_SIMILARITY, DefaultSimilarity.class);\n tableContext.similarity = (Similarity) configure(ReflectionUtils.newInstance(c2, configuration), tableContext);\n cache.put(name, tableContext);\n return tableContext;\n}\n"
|
"public void showDebugInfo(boolean show) {\n this.config.set(show, KEYS[11]);\n}\n"
|
"public Component.State lookupState() {\n if (!this.lookupComponent().hasService(this)) {\n return Component.State.NONE;\n } else {\n try {\n return this.lookupService().getStateMachine().getState();\n } catch (NoSuchServiceException ex) {\n return Component.State.NONE;\n }\n }\n}\n"
|
"public List<Milestone> getMilestones(int projectId, ApiFilterValue... isCompleted) {\n return getEntityList(Milestone.class, TestRailCommand.GET_MILESTONES.getCommand(), Integer.toString(projectId) + (isCompleted.length > 0 ? isCompleted[0].append() : null));\n}\n"
|
"private synchronized ResourceBundle getResourceBundle(String loggerName) {\n if (loggerName == null) {\n return null;\n }\n ResourceBundle rb = loggerResourceBundleTable.get(loggerName);\n if (rb == null && logManager.getLogger(loggerName) != null) {\n rb = logManager.getLogger(loggerName).getResourceBundle();\n loggerResourceBundleTable.put(loggerName, rb);\n }\n return rb;\n}\n"
|
"private List<ApplicationChildContext> traverseGraphByLevel(List<ApplicationChildContext> contexts, ParentComponentMonitor parentMonitor, String instanceId) {\n for (ApplicationChildContext context : contexts) {\n Monitor monitor = parentMonitor.getMonitor(context.getId());\n if (monitor.getInstance(instanceId) == null || monitor.getInstancesByParentInstanceId(instanceId).isEmpty()) {\n return contexts;\n }\n }\n for (ApplicationChildContext context : contexts) {\n List<ApplicationChildContext> contexts1 = traverseGraphByLevel(context.getApplicationChildContextList(), parentMonitor, instanceId);\n if (contexts1 != null && !contexts1.isEmpty()) {\n return contexts1;\n }\n }\n return null;\n}\n"
|
"public String[] getStringArray(Class clazz, String name) {\n if (name == null) {\n return null;\n }\n String key = getKey(clazz, name);\n String toTok = null;\n try {\n toTok = _resources.getString(key);\n } catch (MissingResourceException ex) {\n }\n if (toTok == null) {\n return _resources.getStringArray(key);\n } else {\n StringTokenizer tok = new StringTokenizer(toTok, \"String_Node_Str\");\n String[] retval = new String[tok.countTokens()];\n for (int i = 0; i < retval.length; i++) {\n retval[i] = tok.nextToken();\n }\n return retval;\n }\n}\n"
|
"public ApiBootstrap createBootstrap(ApiBootstrap bootstrap) throws AmbariApiException {\n logger.info(\"String_Node_Str\");\n logger.info(ApiUtils.objectToJson(bootstrap.getHosts()));\n Response response = null;\n try {\n response = apiResourceRootV1.getBootstrapResource().createBootstrap(ApiUtils.objectToJson(bootstrap));\n } catch (Exception e) {\n throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);\n }\n String bootstrapJson = handleAmbariResponse(response);\n logger.debug(\"String_Node_Str\");\n logger.debug(bootstrapJson);\n ApiBootstrap apiBootstrap = ApiUtils.jsonToObject(ApiBootstrap.class, bootstrapJson);\n return apiBootstrap;\n}\n"
|
"public void testQueryIterableCrud() throws DocumentClientException {\n DocumentClient client = new DocumentClient(HOST, MASTER_KEY, ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);\n List<Document> documents = client.readDocuments(this.collectionForTest.getSelfLink(), null).getQueryIterable().toList();\n int beforeCreateDocumentsCount = documents.size();\n int noOfDocuments = 10;\n for (int i = 0; i < noOfDocuments; ++i) {\n Document documentDefinition = new Document(\"String_Node_Str\");\n client.createDocument(this.collectionForTest.getSelfLink(), documentDefinition, null, false);\n }\n FeedOptions fo = new FeedOptions();\n fo.setPageSize(1);\n documents = client.readDocuments(this.collectionForTest.getSelfLink(), null).getQueryIterable().toList();\n Assert.assertEquals(beforeCreateDocumentsCount + 20, documents.size());\n}\n"
|
"private byte getClassEid(final Class<?> clazz) {\n final Byte res = classesToIdx.get(clazz);\n if (res == null)\n throw new IllegalArgumentException(\"String_Node_Str\" + clazz.getTypeName() + \"String_Node_Str\");\n return res;\n}\n"
|
"public ItemStack removeStackFromSlot(int index) {\n version++;\n if (isStorageAvailableRemotely(index)) {\n index -= ModularStorageContainer.SLOT_STORAGE;\n RemoteStorageTileEntity storageTileEntity = getRemoteStorage(remoteId);\n if (storageTileEntity == null) {\n return null;\n }\n int si = storageTileEntity.findRemoteIndex(remoteId);\n if (si == -1) {\n return null;\n }\n return storageTileEntity.removeStackFromSlotRemote(si, index);\n } else {\n return inventoryHelper.removeStackFromSlot(index);\n }\n}\n"
|
"public InputStream getInputStream() throws IOException {\n is = new ByteArrayInputStream(source.getReferenceBytes());\n return is;\n}\n"
|
"public void testSimpleCheckBox() {\n new TestSimpleCheckBox();\n if (!GWT.isScript()) {\n try {\n new BrokenSimpleCheckBox();\n throw new Error(ASSERTION_ERROR);\n } catch (AssertionError e) {\n }\n }\n}\n"
|
"public boolean runOnce() {\n TcpChannelHub hub = ReplicationHub.this.hub;\n hub.outBytesLock().lock();\n try {\n mi.forEach(e -> {\n sendEventAsyncWithoutLock(replicationEvent, (Consumer<ValueOut>) (v -> v.typedMarshallable(e)));\n });\n } catch (InterruptedException e) {\n throw Jvm.rethrow(e);\n } finally {\n hub.outBytesLock().unlock();\n }\n return !isClosed.get();\n}\n"
|
"public void clear() {\n synchronized (lock) {\n if (StringUtils.isNotEmpty(cartId)) {\n cartRepository.clear(cartId);\n logger.info(\"String_Node_Str\");\n }\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.