content stringlengths 40 137k |
|---|
"private boolean doProcess(String idOfComponent, String appId, String instanceId) {\n ParentComponent component;\n Map<String, Group> groups;\n Map<String, ClusterDataHolder> clusterData;\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + \"String_Node_Str\" + idOfComponent + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + instanceId + \"String_Node_Str\");\n }\n try {\n ApplicationHolder.acquireWriteLock();\n Application application = ApplicationHolder.getApplications().getApplication(appId);\n component = application;\n if (!idOfComponent.equals(appId)) {\n component = application.getGroupRecursively(idOfComponent);\n }\n groups = component.getAliasToGroupMap();\n clusterData = component.getClusterDataMap();\n if (groups.isEmpty() && getAllClusterInSameState(clusterData, ClusterStatus.Active, instanceId) || clusterData.isEmpty() && getAllGroupInSameState(groups, GroupStatus.Active, instanceId) || getAllClusterInSameState(clusterData, ClusterStatus.Active, instanceId) && getAllGroupInSameState(groups, GroupStatus.Active, instanceId)) {\n if (component instanceof Application) {\n log.info(\"String_Node_Str\" + appId + \"String_Node_Str\" + instanceId);\n ApplicationBuilder.handleApplicationInstanceActivatedEvent(appId, instanceId);\n return true;\n } else if (component instanceof Group) {\n log.info(\"String_Node_Str\" + component.getUniqueIdentifier() + \"String_Node_Str\" + instanceId);\n ApplicationBuilder.handleGroupInstanceActivatedEvent(appId, component.getUniqueIdentifier(), instanceId);\n return true;\n }\n }\n } finally {\n ApplicationHolder.releaseWriteLock();\n }\n return false;\n}\n"
|
"public static void writeLogEntry(LogEntry entry, LogBuffer buffer) throws IOException {\n if (entry instanceof LogEntry.Command) {\n buffer.put(LogEntry.COMMAND).putInt(entry.getIdentifier());\n XaCommand command = ((LogEntry.Command) entry).getXaCommand();\n command.writeToFile(buffer);\n } else if (entry instanceof LogEntry.Start) {\n LogEntry.Start start = (LogEntry.Start) entry;\n Xid xid = start.getXid();\n byte[] globalId = xid.getGlobalTransactionId();\n byte[] branchId = xid.getBranchQualifier();\n int formatId = xid.getFormatId();\n int identifier = start.getIdentifier();\n buffer.put(LogEntry.TX_START).put((byte) globalId.length).put((byte) branchId.length).put(globalId).put(branchId).putInt(identifier).putInt(formatId);\n } else if (entry instanceof LogEntry.Done) {\n buffer.put(LogEntry.DONE).putInt(entry.getIdentifier());\n } else if (entry instanceof LogEntry.OnePhaseCommit) {\n buffer.put(LogEntry.TX_1P_COMMIT).putInt(entry.getIdentifier()).putLong(((LogEntry.Commit) entry).getTxId());\n } else if (entry instanceof LogEntry.Prepare) {\n buffer.put(LogEntry.TX_PREPARE).putInt(entry.getIdentifier());\n } else if (entry instanceof LogEntry.TwoPhaseCommit) {\n buffer.put(LogEntry.TX_2P_COMMIT).putInt(entry.getIdentifier()).putLong(((LogEntry.OnePhaseCommit) entry).getTxId());\n }\n}\n"
|
"private Control createDBMetaDataSelectionComposite(Composite parent) {\n boolean supportsSchema = JdbcMetaDataProvider.getInstance().isSupportSchema();\n boolean supportsProcedure = JdbcMetaDataProvider.getInstance().isSupportProcedure();\n tablescomposite = new Composite(sComposite, SWT.NONE);\n tablescomposite.setLayout(new GridLayout());\n GridData data = new GridData(GridData.FILL_BOTH);\n data.grabExcessVerticalSpace = true;\n tablescomposite.setLayoutData(data);\n Label dataSourceLabel = new Label(tablescomposite, SWT.LEFT);\n dataSourceLabel.setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n GridData labelData = new GridData();\n dataSourceLabel.setLayoutData(labelData);\n availableDbObjectsTree = new Tree(tablescomposite, SWT.BORDER | SWT.MULTI);\n GridData treeData = new GridData(GridData.FILL_BOTH);\n treeData.minimumHeight = 150;\n availableDbObjectsTree.setLayoutData(treeData);\n availableDbObjectsTree.addMenuDetectListener(new MenuDetectListener() {\n public void menuDetected(MenuDetectEvent e) {\n if (availableDbObjectsTree.getSelectionCount() > 0) {\n TreeItem item = availableDbObjectsTree.getSelection()[0];\n if (item.getParentItem() != null) {\n treeMenu.setLocation(e.x, e.y);\n return;\n }\n }\n e.doit = false;\n }\n });\n availableDbObjectsTree.addMouseListener(new MouseAdapter() {\n public void mouseDoubleClick(MouseEvent e) {\n insertTreeItemText();\n }\n });\n createObjectTreeMenu();\n createSchemaFilterComposite(supportsSchema, supportsProcedure, tablescomposite);\n createSQLOptionGroup(tablescomposite);\n addDragSupportToTree();\n addFetchDbObjectListener(metadataBidiFormatStr);\n return tablescomposite;\n}\n"
|
"public String isValid(String newText) {\n if (newText == null || newText.trim().length() == 0)\n return Messages.Common_nameCanNotBeEmpty;\n if (type.equals(IServerObjectRepositoryType.TYPE_TRANSFORMERV2) || type.equals(IServerObjectRepositoryType.TYPE_VIEW)) {\n if (!Pattern.matches(\"String_Node_Str\", newText)) {\n return Messages.Common_nameInvalid;\n }\n } else if (!Pattern.matches(\"String_Node_Str\", newText)) {\n return Messages.Common_nameInvalid;\n }\n if (RepositoryResourceUtil.isExistByName(parentItem.getRepObjType(), newText.trim())) {\n return Messages.Common_nameIsUsed;\n }\n return null;\n}\n"
|
"public void createTestData() throws ServiceException {\n MetricId metricId1 = new MetricId(SystemMetricDefs.OP_TIME_TOTAL.getMetricName(), srvcAdminName, opName);\n MetricValue metricValue1 = new AverageMetricValue(metricId1);\n MetricValueAggregatorTestImpl aggregator1 = new MetricValueAggregatorTestImpl(metricValue1, MetricCategory.Timing, MonitoringLevel.NORMAL);\n MetricClassifier metricClassifier1 = new MetricClassifier(consumerName, \"String_Node_Str\", \"String_Node_Str\");\n MetricClassifier metricClassifier2 = new MetricClassifier(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier2, 1L);\n List<MetricValueAggregator> aggregators = deepCopyAggregators(aggregator1, aggregator2);\n metricsStorageProvider.saveMetricSnapshot(sixMinutesAgo, aggregators);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier2, 1L);\n aggregators = deepCopyAggregators(aggregator1);\n metricsStorageProvider.saveMetricSnapshot(threeMinutesAgo, aggregators);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier2, 1L);\n aggregators = deepCopyAggregators(aggregator1);\n metricsStorageProvider.saveMetricSnapshot(twoMinutesAgo, aggregators);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier1, 1L);\n aggregator1.update(metricClassifier2, 1L);\n aggregators = deepCopyAggregators(aggregator1);\n metricsStorageProvider.saveMetricSnapshot(oneMinuteAgo, aggregators);\n}\n"
|
"private void replicateTxnLog() throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {\n if (skipBackupLogReplication()) {\n return;\n }\n OperationService operationService = nodeEngine.getOperationService();\n ClusterService clusterService = nodeEngine.getClusterService();\n List<Future> futures = new ArrayList<Future>(backupAddresses.length);\n for (Address backupAddress : backupAddresses) {\n if (clusterService.getMember(backupAddress) != null) {\n Operation op = createReplicateTxBackupLogOperation();\n Future f = operationService.invokeOnTarget(SERVICE_NAME, op, backupAddress);\n futures.add(f);\n }\n }\n waitWithDeadline(futures, timeoutMillis, MILLISECONDS, replicationTxExceptionHandler);\n}\n"
|
"public void setImage(InputImage image, DerivativeImage derivX, DerivativeImage derivY) {\n InputSanityCheck.checkSameShape(image, derivX, derivY);\n this.image = image;\n interpInput.setImage(image);\n this.derivX = derivX;\n this.derivY = derivY;\n interpPixelI.setImage(image);\n interpPixelDX.setImage(derivX);\n interpPixelDY.setImage(derivY);\n}\n"
|
"public void nextStep() {\n boolean stop = false;\n while (!isFinished() && !stop) {\n Action a = actions.get(ip);\n if (EngineLogger.debugMode())\n EngineLogger.debug(ip + \"String_Node_Str\" + a.getClass().getSimpleName());\n try {\n if (a.run(this))\n stop = true;\n else\n ip++;\n } catch (Exception e) {\n EngineLogger.error(\"String_Node_Str\" + a.getClass().getSimpleName() + \"String_Node_Str\" + e.getMessage(), e);\n ip++;\n }\n }\n if (ip == actions.size()) {\n EngineLogger.debug(\"String_Node_Str\" + id);\n if (cb != null) {\n ActionCallback cb2 = cb;\n cb = null;\n cb2.resume();\n }\n }\n}\n"
|
"public void setTimeFormat(java.text.DateFormat timeFormat) {\n this.timeFormat = timeFormat;\n initTimePickerDialog(getContext());\n final boolean moreTimeItems = isShowingMoreTimeItems();\n final boolean numbersInView = adapter.isShowingSecondaryTextInView();\n final Calendar selection = getSelectedTime();\n initAdapter(getContext());\n this.showMoreTimeItems = false;\n setShowMoreTimeItems(moreTimeItems);\n setShowNumbersInView(numbersInView);\n setSelectedTime(selection.get(Calendar.HOUR_OF_DAY), selection.get(Calendar.MINUTE));\n}\n"
|
"public void kill() {\n stop = true;\n this.npc.getTrader().setFree(true);\n sendLeaveMessage();\n int index = TraderManager.tasks.indexOf(taskID);\n if (index != -1) {\n TraderManager.tasks.remove(TraderManager.tasks.indexOf(taskID));\n }\n Bukkit.getServer().getScheduler().cancelTask(taskID);\n}\n"
|
"public void prevTurn() {\n setBlackMove(getWhiteRules().prevTurn(mIsPlayback));\n}\n"
|
"int processResults(Result result, List<JSModule> modules, B options) throws FlagUsageException, IOException {\n if (config.printPassGraph) {\n if (compiler.getRoot() == null) {\n return 1;\n } else {\n jsOutput.append(DotFormatter.toDot(compiler.getPassConfig().getPassGraph()));\n jsOutput.append('\\n');\n return 0;\n }\n }\n if (config.printAst) {\n if (compiler.getRoot() == null) {\n return 1;\n } else {\n ControlFlowGraph<Node> cfg = compiler.computeCFG();\n DotFormatter.appendDot(compiler.getRoot().getLastChild(), cfg, jsOutput);\n jsOutput.append('\\n');\n return 0;\n }\n }\n if (config.printTree) {\n if (compiler.getRoot() == null) {\n compiler.report(JSError.make(NO_TREE_GENERATED_ERROR));\n return 1;\n } else {\n compiler.getRoot().appendStringTree(jsOutput);\n jsOutput.append(\"String_Node_Str\");\n return 0;\n }\n }\n rootRelativePathsMap = constructRootRelativePathsMap();\n if (config.skipNormalOutputs) {\n outputManifest();\n outputBundle();\n outputModuleGraphJson();\n return 0;\n } else if (result.success) {\n outputModuleGraphJson();\n if (modules == null) {\n outputSingleBinary();\n outputSourceMap(options, config.jsOutputFile);\n } else {\n outputModuleBinaryAndSourceMaps(modules, options);\n }\n if (options.externExportsPath != null) {\n Writer eeOut = openExternExportsStream(options, config.jsOutputFile);\n eeOut.append(result.externExport);\n eeOut.close();\n }\n outputNameMaps();\n outputManifest();\n outputBundle();\n }\n return Math.min(result.errors.length, 0x7f);\n}\n"
|
"public int compare(final DataFile f1, final DataFile f2) {\n long size1;\n try {\n size1 = f1.getMetaData().getContentLength();\n } catch (IOException e) {\n size1 = -1;\n }\n long size2;\n try {\n size2 = f2.getMetaData().getContentLength();\n } catch (IOException e) {\n size2 = -1;\n }\n return Long.compare(size1, size2) * -1;\n}\n"
|
"void readFramebufferUpdateRectHdr() throws Exception {\n updateRectX = readU16();\n updateRectY = readU16();\n updateRectW = readU16();\n updateRectH = readU16();\n updateRectEncoding = readU32();\n if (updateRectEncoding == EncodingZlib || updateRectEncoding == EncodingZRLE || updateRectEncoding == EncodingTight)\n wereZlibUpdates = true;\n if (rec != null) {\n if (numUpdatesInSession > 1)\n rec.flush();\n rec.writeShortBE(updateRectX);\n rec.writeShortBE(updateRectY);\n rec.writeShortBE(updateRectW);\n rec.writeShortBE(updateRectH);\n if (((!isRealDecoderEncoding(updateRectEncoding))) && (rec != null)) {\n rec.writeIntBE(updateRectEncoding);\n }\n }\n if (updateRectEncoding < 0 || updateRectEncoding > MaxNormalEncoding)\n return;\n if (updateRectX + updateRectW > framebufferWidth || updateRectY + updateRectH > framebufferHeight) {\n throw new Exception(\"String_Node_Str\" + updateRectW + \"String_Node_Str\" + updateRectH + \"String_Node_Str\" + updateRectX + \"String_Node_Str\" + updateRectY + \"String_Node_Str\");\n }\n}\n"
|
"public Set<String> getWorlds() {\n ConfigurationSection worldsSection = this.node.getConfigurationSection(\"String_Node_Str\");\n if (worldsSection == null) {\n return Collections.emptySet();\n }\n return worldsSection.getKeys(false);\n}\n"
|
"private boolean doProcess(String clusterId, String instanceId) {\n ClusterMonitor monitor = AutoscalerContext.getInstance().getClusterMonitor(clusterId);\n boolean clusterActive = false;\n for (ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext : monitor.getNetworkPartitionCtxts()) {\n ClusterInstanceContext instanceContext = (ClusterInstanceContext) clusterLevelNetworkPartitionContext.getInstanceContext(instanceId);\n if (instanceContext != null) {\n if (instanceContext.getActiveMembers() >= instanceContext.getMinInstanceCount()) {\n clusterActive = true;\n break;\n } else {\n clusterActive = false;\n break;\n }\n } else {\n clusterActive = false;\n break;\n }\n }\n if (clusterActive) {\n if (log.isInfoEnabled()) {\n log.info(\"String_Node_Str\" + monitor.getAppId() + \"String_Node_Str\" + clusterId);\n }\n ClusterStatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(), monitor.getServiceId(), monitor.getClusterId(), instanceId);\n }\n return clusterActive;\n}\n"
|
"public void delete(Object k) {\n final NodeEngine nodeEngine = getNodeEngine();\n final Data key = getService().toData(k);\n deleteInternal(key);\n}\n"
|
"public void apply() throws Exception {\n validateTimePartitions(tpfs, 0L, MAX, Collections.<Long, String>emptyMap());\n Date date = DATE_FORMAT.parse(\"String_Node_Str\");\n long time = date.getTime();\n Map<String, String> allMetadata = Maps.newHashMap();\n Map<String, String> metadata = ImmutableMap.of(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n tpfs.addPartition(time, \"String_Node_Str\", metadata);\n allMetadata.putAll(metadata);\n TimePartitionDetail partitionByTime = tpfs.getPartitionByTime(time);\n Assert.assertNotNull(partitionByTime);\n Assert.assertEquals(metadata, partitionByTime.getMetadata().asMap());\n tpfs.addMetadata(time, \"String_Node_Str\", \"String_Node_Str\");\n allMetadata.put(\"String_Node_Str\", \"String_Node_Str\");\n tpfs.setMetadata(time, Collections.singletonMap(\"String_Node_Str\", \"String_Node_Str\"));\n allMetadata.put(\"String_Node_Str\", \"String_Node_Str\");\n Map<String, String> newMetadata = ImmutableMap.of(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n tpfs.addMetadata(time, newMetadata);\n allMetadata.putAll(newMetadata);\n partitionByTime = tpfs.getPartitionByTime(time);\n Assert.assertNotNull(partitionByTime);\n Assert.assertEquals(allMetadata, partitionByTime.getMetadata().asMap());\n tpfs.removeMetadata(time, ImmutableSet.of(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"));\n allMetadata.remove(\"String_Node_Str\");\n allMetadata.remove(\"String_Node_Str\");\n partitionByTime = tpfs.getPartitionByTime(time);\n Assert.assertNotNull(partitionByTime);\n Assert.assertEquals(allMetadata, partitionByTime.getMetadata().asMap());\n}\n"
|
"protected void paintInPanel(AffineTransform tran, Graphics2D g2) {\n DetectQrCodeControlPanel controls = (DetectQrCodeControlPanel) DetectQrCodeApp.this.controls;\n g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n synchronized (DetectQrCodeApp.this) {\n if (controls.bShowContour) {\n LinearContourLabelChang2004 contour = detector.getSquareDetector().getDetector().getContourFinder();\n List<Contour> contours = BinaryImageOps.convertContours(contour.getPackedPoints(), contour.getContours());\n g2.setStroke(new BasicStroke(1));\n VisualizeBinaryData.render(contours, null, Color.CYAN, scale, g2);\n }\n FastQueue<QrCode> detected = detector.getDetections();\n g2.setColor(new Color(0x50FF0000, true));\n for (int i = 0; i < detected.size; i++) {\n QrCode qr = detected.get(i);\n VisualizeShapes.fillPolygon(qr.bounds, scale, g2);\n }\n if (controls.bShowSquares) {\n List<Polygon2D_F64> polygons = detector.getSquareDetector().getPolygons(null);\n g2.setColor(Color.GREEN);\n g2.setStroke(new BasicStroke(3));\n for (Polygon2D_F64 p : polygons) {\n VisualizeShapes.drawPolygon(p, true, scale, g2);\n }\n }\n if (controls.bShowAlignmentPattern) {\n List<QrCode> codes = detector.getDetections().toList();\n g2.setColor(Color.BLUE);\n g2.setStroke(new BasicStroke(3));\n for (QrCode qr : codes) {\n double size = Math.sqrt(qr.ppCorner.areaSimple()) / 14.0;\n for (int i = 0; i < qr.alignment.size; i++) {\n QrCode.Alignment a = qr.alignment.get(i);\n VisualizeFeatures.drawCircle(g2, a.pixel.x * scale, a.pixel.y * scale, size * scale);\n }\n }\n }\n if (controls.bShowPositionPattern) {\n FastQueue<PositionPatternNode> nodes = detector.getDetectPositionPatterns().getPositionPatterns();\n g2.setColor(Color.ORANGE);\n g2.setStroke(new BasicStroke(3));\n List<SquareEdge> list = new ArrayList<>();\n for (int i = 0; i < nodes.size(); i++) {\n SquareNode n = nodes.get(i);\n VisualizeShapes.drawPolygon(n.square, true, scale, g2);\n for (int j = 0; j < 4; j++) {\n if (n.edges[j] != null) {\n if (!list.contains(n.edges[j])) {\n list.add(n.edges[j]);\n }\n }\n }\n }\n g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setColor(new Color(255, 150, 100));\n g2.setStroke(new BasicStroke(3));\n Line2D.Double l = new Line2D.Double();\n for (int i = 0; i < list.size(); i++) {\n SquareEdge e = list.get(i);\n Point2D_F64 a = e.a.center;\n Point2D_F64 b = e.b.center;\n l.setLine(scale * a.x, scale * a.y, scale * b.x, scale * b.y);\n g2.draw(l);\n }\n }\n }\n}\n"
|
"protected IAnswerData getWidgetValue() throws InvalidDataException {\n String s = textField().getString().trim();\n if (s == null || s.equals(\"String_Node_Str\")) {\n return null;\n }\n try {\n return template.cast(new UncastData(s.trim()));\n } catch (IllegalArgumentException iae) {\n String message;\n if (template instanceof LongData) {\n message = Localization.get(\"String_Node_Str\", new String[] { s });\n } else if (template instanceof IntegerData) {\n message = Localization.get(\"String_Node_Str\", new String[] { s });\n } else if (template instanceof DecimalData) {\n message = Localization.get(\"String_Node_Str\", new String[] { s });\n } else {\n message = Localization.get(\"String_Node_Str\", new String[] { s, template.getClass().getName() });\n }\n throw new InvalidDataException(message, new UncastData(s));\n }\n}\n"
|
"public void append0() {\n int i = size / 8;\n int ci = size / CACHE_WIDTH;\n prepareAppend(i, ci);\n size++;\n}\n"
|
"public List<ContactDuplicatedProperty> extractProperties(Contact newContact, Contact oldContact, Language language) {\n List<ContactDuplicatedProperty> properties = new ArrayList<>();\n for (LayoutGroup group : newContact.getContactModel().getDetails().getLayout().getGroups()) {\n if (group.getHasIterations()) {\n continue;\n }\n for (LayoutConstraint layoutConstraint : group.getConstraints()) {\n FlexibleElement element = layoutConstraint.getElement();\n String serializedNewValue = null;\n String serializedOldValue = null;\n String formattedNewValue = null;\n String formattedOldValue = null;\n ContactDuplicatedProperty.ValueType valueType = ContactDuplicatedProperty.ValueType.STRING;\n if (element instanceof DefaultContactFlexibleElement) {\n DefaultContactFlexibleElement defaultContactFlexibleElement = (DefaultContactFlexibleElement) element;\n serializedNewValue = defaultContactFlexibleElement.getSerializedValue(newContact);\n serializedOldValue = defaultContactFlexibleElement.getSerializedValue(oldContact);\n formattedNewValue = defaultContactFlexibleElement.getFormattedValue(newContact);\n formattedOldValue = defaultContactFlexibleElement.getFormattedValue(oldContact);\n if (((DefaultContactFlexibleElement) element).getType() == DefaultContactFlexibleElementType.PHOTO) {\n valueType = ContactDuplicatedProperty.ValueType.IMAGE;\n }\n } else {\n Value newValue = valueDAO.getValueByElementAndContainer(element.getId(), newContact.getId());\n Value oldValue = valueDAO.getValueByElementAndContainer(element.getId(), oldContact.getId());\n serializedNewValue = newValue.getValue();\n serializedOldValue = oldValue.getValue();\n formattedNewValue = modelPropertyService.getFormattedValue(element, newValue.getValue(), language);\n formattedOldValue = modelPropertyService.getFormattedValue(element, oldValue.getValue(), language);\n }\n if (serializedOldValue != null && serializedOldValue.isEmpty()) {\n serializedOldValue = null;\n }\n if (serializedNewValue != null && serializedNewValue.isEmpty()) {\n serializedNewValue = null;\n }\n if (Objects.equals(serializedNewValue, serializedOldValue)) {\n continue;\n }\n String propertyLabel = element.getLabel();\n if (propertyLabel == null && element instanceof DefaultContactFlexibleElement) {\n propertyLabel = modelPropertyService.getDefaultContactPropertyLabel(((DefaultContactFlexibleElement) element).getType(), language);\n }\n ContactDuplicatedProperty contactDuplicatedProperty = new ContactDuplicatedProperty();\n contactDuplicatedProperty.setPropertyLabel(propertyLabel);\n contactDuplicatedProperty.setSerializedNewValue(serializedNewValue);\n contactDuplicatedProperty.setSerializedOldValue(serializedOldValue);\n contactDuplicatedProperty.setFormattedNewValue(formattedNewValue);\n contactDuplicatedProperty.setFormattedOldValue(formattedOldValue);\n contactDuplicatedProperty.setFlexibleElementId(element.getId());\n contactDuplicatedProperty.setValueType(valueType);\n properties.add(contactDuplicatedProperty);\n }\n }\n return properties;\n}\n"
|
"private void traverse(IArea area) {\n if (area instanceof ContainerArea) {\n if (area instanceof TableArea) {\n tableIds.add(((TableArea) area).getContent().getInstanceID().toUniqueString());\n }\n ContainerArea container = (ContainerArea) area;\n if (container.content != null && !container.isDummy) {\n start(container);\n }\n if (!(container.content instanceof ForeignContent)) {\n for (Iterator<IArea> i = container.getChildren(); i.hasNext(); ) {\n IArea child = i.next();\n traverse(child);\n }\n }\n }\n String bookmark = area.getBookmark();\n if (bookmark != null) {\n context.addBookmarkMap(context.getPageNumber(), bookmark);\n }\n}\n"
|
"private void createChannel(final ExecutionVertex source, final OutputGate<? extends Record> outputGate, final ExecutionVertex target, final InputGate<? extends Record> inputGate, final ChannelType channelType, final CompressionLevel compressionLevel) throws GraphConversionException {\n AbstractOutputChannel<? extends Record> outputChannel;\n AbstractInputChannel<? extends Record> inputChannel;\n switch(channelType) {\n case NETWORK:\n outputChannel = outputGate.createNetworkOutputChannel((OutputGate) outputGate, null, compressionLevel);\n inputChannel = inputGate.createNetworkInputChannel((InputGate) inputGate, null, compressionLevel);\n break;\n case INMEMORY:\n outputChannel = outputGate.createInMemoryOutputChannel(null, compressionLevel);\n inputChannel = inputGate.createInMemoryInputChannel(null, compressionLevel);\n break;\n case FILE:\n outputChannel = outputGate.createFileOutputChannel(null, compressionLevel);\n inputChannel = inputGate.createFileInputChannel(null, compressionLevel);\n break;\n default:\n throw new GraphConversionException(\"String_Node_Str\");\n }\n inputChannel.setConnectedChannelID(outputChannel.getID());\n outputChannel.setConnectedChannelID(inputChannel.getID());\n this.outputChannelMap.put(outputChannel.getID(), outputChannel);\n this.inputChannelMap.put(inputChannel.getID(), inputChannel);\n this.channelToVertexMap.put(outputChannel.getID(), source);\n this.channelToVertexMap.put(inputChannel.getID(), target);\n}\n"
|
"public boolean allowNull() {\n return !isRequired();\n}\n"
|
"void appendExtensionSourceCode(StringBuilder buf, String code) {\n Assertion.on(\"String_Node_Str\").mustNotBeNull(buf);\n Assertion.on(\"String_Node_Str\").mustNotBeNull(code);\n String[] separatedListBySemicolon = code.split(StringValue.Semicolon);\n for (String separatedBySemicolon : separatedListBySemicolon) {\n if (separatedBySemicolon != null && separatedBySemicolon.trim().length() > 0) {\n separatedBySemicolon = separatedBySemicolon.trim().replaceAll(StringValue.CarriageReturn, StringValue.Empty);\n String[] lines = separatedBySemicolon.split(StringValue.LineFeed);\n for (int i = 0; i < (lines.length - 1); i++) {\n String line = lines[i];\n if (line != null && line.trim().length() > 0) {\n appendTabs(buf, 2);\n buf.append(line.trim());\n appendLineBreak(buf);\n }\n }\n String lastLine = lines[lines.length - 1];\n if (lastLine != null && lastLine.trim().length() > 0) {\n appendTabs(buf, 2);\n buf.append(lastLine.trim());\n if (!lastLine.endsWith(\"String_Node_Str\") && !lastLine.endsWith(\"String_Node_Str\")) {\n buf.append(StringValue.Semicolon);\n }\n appendLineBreak(buf);\n }\n }\n }\n}\n"
|
"public List<ItemStack> getSeedEntries() {\n return this.tile.getControlledSeeds();\n}\n"
|
"public static boolean areItemsEqual(Item itemA, Item itemB) {\n if (itemA == itemB) {\n return true;\n }\n if (itemA == null | itemB == null) {\n return false;\n }\n return itemA == itemB || itemA.equals(itemB);\n}\n"
|
"public String toString() {\n String leftString = left == null ? \"String_Node_Str\" : left.toString();\n String valueString = value instanceof IndexedTreeNode ? \"String_Node_Str\" + ((IndexedTreeNode) value).getIndex() : value.toString();\n int index = getIndex();\n return \"String_Node_Str\" + index + \"String_Node_Str\" + valueString;\n}\n"
|
"public void refreshBalanceIfNesessary() {\n lock.lock();\n try {\n long bestHeight = NulsContext.getInstance().getBestHeight();\n Set<String> set = new HashSet<>(balanceMap.keySet());\n for (String address : set) {\n BalanceCacheEntity entity = balanceMap.get(address);\n if (entity == null) {\n balanceMap.remove(address);\n continue;\n }\n if (entity.getEarlistLockTime() == 0L && entity.getLowestLockHeigh() == 0L) {\n continue;\n }\n if (entity.getLowestLockHeigh() > 0L && entity.getLowestLockHeigh() <= bestHeight) {\n balanceMap.remove(address);\n continue;\n }\n if (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis()) {\n balanceMap.remove(address);\n continue;\n }\n }\n } finally {\n lock.unlock();\n }\n}\n"
|
"public void confirmClicked() {\n log.info(\"String_Node_Str\", amountEdit.getText());\n Platform.runLater(() -> {\n if (Main.wallet.isEncrypted()) {\n log.info(\"String_Node_Str\");\n WalletPasswordController.requestPassword(this::tryMakePledge);\n } else {\n tryMakePledge(null);\n }\n });\n}\n"
|
"private void initProperty() {\n JobInfo jobInfo = new JobInfo(processItem, processItem.getProcess().getDefaultContext(), processItem.getProperty().getVersion());\n Project currentProject = ProjectManager.getInstance().getCurrentProject();\n setProperty(PROJECT_ID, String.valueOf(currentProject.getEmfProject().getId()));\n setProperty(PROJECT_NAME, currentProject.getTechnicalLabel());\n String branchKey = IProxyRepositoryFactory.BRANCH_SELECTION + UNDER_LINE_CHAR + currentProject.getTechnicalLabel();\n Context ctx = CoreRuntimePlugin.getInstance().getContext();\n RepositoryContext rc = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);\n if (rc.getFields().containsKey(branchKey) && rc.getFields().get(branchKey) != null) {\n String branchSelection = rc.getFields().get(branchKey);\n setProperty(BRANCH, branchSelection);\n }\n setProperty(JOB_ID, jobInfo.getJobId());\n setProperty(JOB_NAME, jobInfo.getJobName());\n String jobType = processItem.getProcess().getJobType();\n if (jobType == null) {\n jobType = \"String_Node_Str\";\n }\n setProperty(JOB_TYPE, jobType);\n setProperty(JOB_VERSION, jobInfo.getJobVersion());\n setProperty(CONTEXT_NAME, this.contextName);\n setProperty(DATE, DATAFORMAT.format(new Date()));\n setProperty(APPLY_CONTEXY_CHILDREN, String.valueOf(applyContextToChild));\n if (CommonsPlugin.isHeadless()) {\n setProperty(ADD_STATIC_CODE, String.valueOf(addStat));\n } else {\n setProperty(ADD_STATIC_CODE, Boolean.TRUE.toString());\n }\n setProperty(COMMANDLINE_VERSION, VersionUtils.getVersion());\n}\n"
|
"public List getConnection(String[] jarPath, String driverClassName, String url, String username, String password, String dbType, String dbVersion, String additionalParams) throws Exception {\n List list = new ArrayList();\n HotClassLoader loader;\n boolean flog = EDatabaseVersion4Drivers.containTypeAndVersion(dbType, dbVersion);\n if (flog) {\n loader = getHotClassLoaderFromCache(dbType, dbVersion);\n if (loader == null) {\n loader = new HotClassLoader();\n classLoadersMap.put(dbType, dbVersion, loader);\n }\n } else {\n loader = new HotClassLoader();\n }\n for (String element : jarPath) {\n if (element.contains(\"String_Node_Str\")) {\n String[] splittedPath = element.split(\"String_Node_Str\");\n for (String element2 : splittedPath) {\n loader.addPath(element2);\n }\n } else {\n loader.addPath(element);\n }\n }\n DriverShim wapperDriver = null;\n Connection connection = null;\n try {\n Class<?> driver = Class.forName(driverClassName, true, loader);\n wapperDriver = new DriverShim((Driver) (driver.newInstance()));\n Properties info = new Properties();\n username = username != null ? username : \"String_Node_Str\";\n password = password != null ? password : \"String_Node_Str\";\n info.put(\"String_Node_Str\", username);\n info.put(\"String_Node_Str\", password);\n if (dbType.equals(EDatabaseTypeName.ACCESS.getXmlName()) || dbType.equals(EDatabaseTypeName.GODBC.getXmlName())) {\n Charset systemCharset = CharsetToolkit.getInternalSystemCharset();\n if (systemCharset != null && systemCharset.displayName() != null) {\n info.put(\"String_Node_Str\", systemCharset.displayName());\n }\n }\n if (additionalParams != null && !\"String_Node_Str\".equals(additionalParams) && dbType.toUpperCase().contains(\"String_Node_Str\")) {\n additionalParams = additionalParams.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n info.load(new java.io.ByteArrayInputStream(additionalParams.getBytes()));\n connection = wapperDriver.connect(url, info);\n } else {\n url = ConnectionUtils.addShutDownForHSQLUrl(url, additionalParams);\n if (dbType != null && dbType.equalsIgnoreCase(EDatabaseTypeName.MSSQL.getDisplayName()) && \"String_Node_Str\".equals(username)) {\n ExtractMetaDataUtils.getInstance().setDriverCache(wapperDriver);\n }\n if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {\n Thread.currentThread().setContextClassLoader(loader);\n }\n connection = wapperDriver.connect(url, info);\n }\n list.add(connection);\n list.add(wapperDriver);\n return list;\n } catch (Throwable e) {\n throw new RuntimeException(e);\n }\n}\n"
|
"public synchronized void setMuted(String key, final Type type, final boolean muted) {\n final AudioEntry ve = getVolumeEntry(key, type);\n if (ve != null) {\n ShellUtil pacmd = new ShellUtil();\n try {\n pacmd.run(\"String_Node_Str\", \"String_Node_Str\" + type.cmd + \"String_Node_Str\", ve.getIndex() + \"String_Node_Str\", muted + \"String_Node_Str\");\n } catch (Exception e) {\n LOG.error(e.toString());\n }\n }\n}\n"
|
"public static boolean createServerDef(MDMServerDef serverDef) {\n IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();\n RepositoryContext context = factory.getRepositoryContext();\n MDMServerDefItem item = MdmpropertiesFactory.eINSTANCE.createMDMServerDefItem();\n item.setServerDef(serverDef);\n Property prop = PropertiesFactory.eINSTANCE.createProperty();\n item.setProperty(prop);\n try {\n String nextId = factory.getNextId();\n Property property = item.getProperty();\n property.setId(nextId);\n property.setVersion(VersionUtils.DEFAULT_VERSION);\n property.setAuthor(context.getUser());\n property.setLabel(item.getServerDef().getName());\n factory.create(item, new Path(\"String_Node_Str\"));\n return nextId;\n } catch (PersistenceException e) {\n log.error(e.getMessage(), e);\n }\n return false;\n}\n"
|
"public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {\n NBTTagCompound plateNBT = getPlateNBT(stack);\n if (plateNBT != null) {\n ItemStack plateStack = new ItemStack(plateNBT.getCompoundTag(\"String_Node_Str\"));\n if (!plateStack.isEmpty()) {\n tooltip.add(TextFormatting.BLUE + plateStack.getDisplayName());\n }\n }\n super.addInformation(stack, playerIn, tooltip, advanced);\n}\n"
|
"Object getExistingTestedInstanceIfApplicable(Object testClassInstance) {\n Object testedObject = null;\n if (!createAutomatically) {\n testedObject = getFieldValue(testedField, testClassInstance);\n if (testedObject == null || isNonInstantiableType(targetClass, testedObject)) {\n String providedValue = metadata.value();\n if (!providedValue.isEmpty()) {\n testedObject = Utilities.convertFromString(targetClass, providedValue);\n }\n createAutomatically = testedObject == null && !isFinal(testedField.getModifiers());\n }\n }\n return testedObject;\n}\n"
|
"public final int getInt(int index) {\n index = toInternal(index);\n int spins = 0;\n boolean interrupted = false;\n while (true) {\n if (spins++ > SPINS) {\n interrupted |= atomicWait(index);\n }\n int initialSequence = seqArray.get().get(index);\n if (initialSequence == DatatableSequenceNumber.UNSTABLE) {\n continue;\n }\n int value = intArray.get()[index];\n if (!seqArray.get().compareAndSet(index, initialSequence, initialSequence)) {\n continue;\n }\n if (interrupted) {\n Thread.currentThread().interrupt();\n }\n return value;\n }\n}\n"
|
"public void proposeTransaction(Set<Integer> participant_addrs, String request, String args) {\n if (!participant_addrs.contains(this.addr)) {\n writeOutput(\"String_Node_Str\" + addr + \"String_Node_Str\");\n participant_addrs.add(this.addr);\n }\n UUID txnID = UUID.randomUUID();\n TxnState txnState = new TxnState(txnID, participant_addrs, request, args);\n coordinatorTxns.put(txnID, txnState);\n for (int addr : coordinatorTxns.get(txnID).participants) {\n TxnPacket txnPkt = TxnPacket.getPropositionPacket(this, txnID, participant_addrs, request, args);\n Callback success = createCallback(\"String_Node_Str\", new String[] { Integer.class.getName(), Byte[].class.getName() }, null);\n Callback failure = createCallback(\"String_Node_Str\", new String[] { UUID.class.getName() }, new Object[] { txnID });\n this.makeRequest(Command.TXN, txnPkt.pack(), success, failure, addr, \"String_Node_Str\");\n writeOutput(\"String_Node_Str\" + txnState.txnID + \"String_Node_Str\" + addr);\n }\n txnLogger.logStart(txnState);\n Callback abortTimeout = createCallback(\"String_Node_Str\", new String[] { \"String_Node_Str\" }, new Object[] { txnID });\n addTimeout(abortTimeout, PROPOSAL_RESPONSE_TIMEOUT);\n}\n"
|
"private BasicDialog createDialog() {\n final BasicDialog newDialog = new BasicDialog((possibleParent != null) ? possibleParent : new Shell(SWT.SHELL_TRIM), true);\n newDialog.getShell().setBackgroundMode(SWT.INHERIT_DEFAULT);\n newDialog.getShell().addListener(SWT.Dispose, new Listener() {\n\n public void widgetDisposed(DisposeEvent arg0) {\n if (ignoreDisposeEvent == false) {\n hide();\n } else {\n ignoreDisposeEvent = false;\n }\n }\n });\n setAppicon(this.appIcon);\n return newDialog;\n}\n"
|
"public static void putValuetoJSONObject(JSONObject jsonObject, String key, Object value) {\n mandatory(\"String_Node_Str\", jsonObject);\n mandatoryString(\"String_Node_Str\", key);\n mandatory(\"String_Node_Str\", value);\n try {\n jsonObject.put(key, value);\n } catch (JSONException error) {\n throw new WebScriptException(Status.STATUS_BAD_REQUEST, \"String_Node_Str\" + key + \"String_Node_Str\" + value + \"String_Node_Str\", error);\n }\n}\n"
|
"protected void setStarted() {\n synchronized (this) {\n bSuspendAtStart = false;\n this.notify();\n }\n}\n"
|
"protected GitModelObject getModelObject(TreeWalk tw, int ancestorNth, int baseNth, int actualNth) throws IOException {\n String objName = tw.getNameString();\n ObjectId objBaseId;\n if (baseNth > -1)\n objBaseId = tw.getObjectId(baseNth);\n else\n objBaseId = ObjectId.zeroId();\n ObjectId objRemoteId = tw.getObjectId(actualNth);\n ObjectId objAncestorId;\n if (ancestorNth > -1)\n objAncestorId = tw.getObjectId(ancestorNth);\n else\n objAncestorId = ObjectId.zeroId();\n int objectType = tw.getFileMode(actualNth).getObjectType();\n if (objectType == Constants.OBJ_BLOB)\n return new GitModelBlob(this, getBaseCommit(), ancestorCommit, objAncestorId, objBaseId, objRemoteId, objName);\n else if (objectType == Constants.OBJ_TREE)\n return new GitModelTree(this, getBaseCommit(), objAncestorId, objBaseId, objRemoteId, objName);\n return null;\n}\n"
|
"public static void init(Context c) {\n if (LocationState.location == null) {\n LocationState.location = PreferenceValues.getLastKnownLocation();\n mListeners = new ArrayList<>();\n lastSource = -1;\n }\n}\n"
|
"public void displayRecipe() {\n if (myRecipe == null)\n return;\n dontUpdate = true;\n txtName.setText(myRecipe.getName());\n brewerNameText.setText(myRecipe.getBrewer());\n preBoilText.setText(SBStringUtils.format(myRecipe.getPreBoilVol(myRecipe.getVolUnits()), 2));\n lblSizeUnits.setText(myRecipe.getVolUnits());\n finalWortVolText.setValue(new Double(myRecipe.getFinalWortVol(myRecipe.getVolUnits())));\n boilMinText.setText(SBStringUtils.format(myRecipe.getBoilMinutes(), 0));\n evapText.setText(SBStringUtils.format(myRecipe.getEvap(), 1));\n spnEffic.setValue(new Double(myRecipe.getEfficiency()));\n spnAtten.setValue(new Double(myRecipe.getAttenuation()));\n spnOG.setValue(new Double(myRecipe.getEstOg()));\n spnFG.setValue(new Double(myRecipe.getEstFg()));\n txtComments.setText(myRecipe.getComments());\n lblIBUvalue.setText(SBStringUtils.format(myRecipe.getIbu(), 1));\n lblColourValue.setText(SBStringUtils.format(myRecipe.getColour(), 1));\n lblAlcValue.setText(SBStringUtils.format(myRecipe.getAlcohol(), 1));\n try {\n txtDate.setDate(myRecipe.getCreated().getTime());\n } catch (PropertyVetoException e) {\n e.printStackTrace();\n }\n Costs = SBStringUtils.myNF.format(myRecipe.getTotalMaltCost());\n tblMaltTotalsModel.setDataVector(new String[][] { { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + SBStringUtils.format(myRecipe.getTotalMalt(), 1), myRecipe.getMaltUnits(), \"String_Node_Str\" + SBStringUtils.format(myRecipe.getEstOg(), 3), \"String_Node_Str\" + SBStringUtils.format(myRecipe.getColour(), 1), Costs, \"String_Node_Str\" } }, new String[] { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" });\n Costs = SBStringUtils.myNF.format(myRecipe.getTotalHopsCost());\n tblHopsTotalsModel.setDataVector(new String[][] { { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + SBStringUtils.format(myRecipe.getTotalHops(), 1), myRecipe.getHopUnits(), \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + SBStringUtils.format(myRecipe.getIbu(), 1), Costs } }, new String[] { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" });\n String fileName = \"String_Node_Str\";\n if (currentFile != null) {\n fileName = currentFile.getName();\n }\n fileNameLabel.setText(\"String_Node_Str\" + fileName);\n ibuMethodLabel.setText(\"String_Node_Str\" + myRecipe.getIBUMethod());\n alcMethodLabel.setText(\"String_Node_Str\" + myRecipe.getAlcMethod());\n double colour = myRecipe.getColour(BrewCalcs.SRM);\n if (preferences.getProperty(\"String_Node_Str\").equals(\"String_Node_Str\"))\n colourPanel.setBackground(BrewCalcs.calcRGB(1, colour, preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\")));\n else\n colourPanel.setBackground(BrewCalcs.calcRGB(2, colour, preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\"), preferences.getIProperty(\"String_Node_Str\")));\n String title = \"String_Node_Str\" + version + \"String_Node_Str\" + edition;\n String file = \"String_Node_Str\";\n String dirty = \"String_Node_Str\";\n if (currentFile != null) {\n file = \"String_Node_Str\" + currentFile.getAbsolutePath();\n } else {\n file = \"String_Node_Str\";\n }\n if (myRecipe.getDirty()) {\n dirty = \"String_Node_Str\";\n } else {\n dirty = \"String_Node_Str\";\n }\n this.setTitle(title + file + dirty);\n dontUpdate = false;\n}\n"
|
"private void endTask() {\n synchronized (lock) {\n int numRunning = --runningTasks;\n if (numRunning == 0) {\n lock.notifyAll();\n }\n } finally {\n lock.unlock();\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n MageObject sourceObject = game.getObject(source.getSourceId());\n if (controller != null) {\n Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));\n if (targetPlayer != null) {\n if (targetPlayer.getHand().size() > 0) {\n Cards cards = new CardsImpl();\n Card card = targetPlayer.getHand().getRandom(game);\n cards.add(card);\n if (targetPlayer.getHand().size() > 1) {\n do {\n card = targetPlayer.getHand().getRandom(game);\n } while (cards.contains(card.getId()));\n cards.add(card);\n }\n targetPlayer.revealCards(sourceObject.getLogName(), cards, game);\n for (Card cardToDiscard : cards.getCards(game)) {\n if (!cardToDiscard.getCardType().contains(CardType.LAND)) {\n targetPlayer.discard(cardToDiscard, source, game);\n }\n }\n }\n }\n return true;\n }\n return false;\n}\n"
|
"public void refreshWidget(FormEntryPrompt fep, int changeFlags) {\n prompt.setText(WidgetUtil.getAppropriateTextForm(fep, fep.getTextID()));\n}\n"
|
"public String toString() {\n StringBuilder str = new StringBuilder();\n str.append(\"String_Node_Str\" + name + \"String_Node_Str\");\n str.append(\"String_Node_Str\" + secure + \"String_Node_Str\");\n str.append(\"String_Node_Str\" + ipHostName + \"String_Node_Str\");\n str.append(\"String_Node_Str\" + ipPort + \"String_Node_Str\");\n return str.toString();\n}\n"
|
"public CandidateProgram<TYPE> mutate(CandidateProgram<TYPE> program) {\n List<Node<TYPE>> syntax = model.getSyntax();\n int length = program.getProgramLength();\n for (int i = 0; i < length; i++) {\n if (Math.random() < pointProbability) {\n Node<TYPE> node = (Node<TYPE>) program.getNthNode(i);\n int arity = node.getArity();\n int rand = (int) Math.floor(Math.random() * syntax.size());\n for (int j = 0; j < syntax.size(); j++) {\n int index = (j + rand) % syntax.size();\n Node<TYPE> n = syntax.get(index);\n if ((n.getArity() == arity) && !nodesEqual(node, n)) {\n n = (Node<TYPE>) n.clone();\n for (int k = 0; k < arity; k++) {\n n.setChild(k, node.getChild(k));\n }\n program.setNthNode(i, n);\n break;\n }\n }\n }\n }\n return program;\n}\n"
|
"public void testFallback() throws IOException, GeoIp2Exception {\n WebServiceClient client = new WebServiceClient.Builder(42, \"String_Node_Str\").testTransport(this.transport).locales(Arrays.asList(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\")).build();\n CityIspOrgResponse cio = client.cityIspOrg(InetAddress.getByName(\"String_Node_Str\"));\n assertEquals(\"String_Node_Str\", cio.getContinent().getName(), \"String_Node_Str\");\n}\n"
|
"public PsiElement resolve() {\n return CSharpResolveUtil.findFirstValidElement(multiResolve(false));\n}\n"
|
"public void dispose() {\n if (isDisposed)\n return;\n isDisposed = true;\n pinEditorContributionItem.dispose();\n openFileAction = null;\n newReportAction = null;\n newLibraryAction = null;\n newReportTemplateAction = null;\n for (int i = 0; i < newActions.length; i++) {\n newActions[i] = null;\n }\n closeAction = null;\n closeAllAction = null;\n saveAction = null;\n saveAllAction = null;\n helpContentsAction = null;\n aboutAction = null;\n openPreferencesAction = null;\n saveAsAction = null;\n lockToolBarAction = null;\n backwardHistoryAction = null;\n forwardHistoryAction = null;\n undoAction = null;\n redoAction = null;\n cutAction = null;\n copyAction = null;\n pasteAction = null;\n deleteAction = null;\n selectAllAction = null;\n findAction = null;\n quitAction = null;\n pinEditorContributionItem = null;\n introAction = null;\n super.dispose();\n}\n"
|
"public boolean onCreateOptionsMenu(Menu menu) {\n boolean superResult = super.onCreateOptionsMenu(menu);\n menu.add(0, MENU_USE_CENTER, 0, R.string.locations_use_center).setIcon(R.drawable.location_center001a);\n menu.add(0, MENU_RESTORE_VALUES, 0, R.string.locations_restore_values).setIcon(R.drawable.restore001a);\n menu.add(0, MENU_ABOUT, 0, R.string.about).setIcon(R.drawable.about001a);\n return superResult;\n}\n"
|
"private Result filter(final Level level) {\n return level.isMoreSpecificThan(this.level) ? onMatch : onMismatch;\n}\n"
|
"private void readCollection(final Datastore datastore, final Mapper mapper, final Object entity, final EntityCache cache, final MappedField mf, final DBObject dbObject) {\n Collection values;\n final Object dbVal = mf.getDbObjectValue(dbObject);\n if (dbVal != null) {\n values = mf.isSet() ? mapper.getOptions().getObjectFactory().createSet(mf) : mapper.getOptions().getObjectFactory().createList(mf);\n final List dbValues;\n if (dbVal instanceof List) {\n dbValues = (List) dbVal;\n } else {\n dbValues = new BasicDBList();\n dbValues.add(dbVal);\n }\n EphemeralMappedField ephemeralMappedField = !mapper.isMapped(mf.getType()) && isMapOrCollection(mf) && (mf.getSubType() instanceof ParameterizedType) ? new EphemeralMappedField((ParameterizedType) mf.getSubType(), mf, mapper) : null;\n for (final Object o : dbValues) {\n Object newEntity = null;\n if (o != null) {\n if (mapper.getConverters().hasSimpleValueConverter(mf) || mapper.getConverters().hasSimpleValueConverter(mf.getSubClass())) {\n newEntity = mapper.getConverters().decode(mf.getSubClass(), o, mf);\n } else {\n newEntity = readMapOrCollectionOrEntity(datastore, mapper, cache, mf, ephemeralMappedField, (DBObject) o);\n }\n }\n values.add(newEntity);\n }\n if (!values.isEmpty() || mapper.getOptions().isStoreEmpties()) {\n if (mf.getType().isArray()) {\n mf.setFieldValue(entity, ReflectionUtils.convertToArray(mf.getSubClass(), ReflectionUtils.iterToList(values)));\n } else {\n mf.setFieldValue(entity, values);\n }\n }\n }\n}\n"
|
"public RrPolygonList hatch(RrHalfPlane hp, double gap, Attributes a) {\n if (gap <= 0)\n return new RrPolygonList();\n RrRectangle big = box().scale(1.1);\n double d = Math.sqrt(big.dSquared());\n Rr2Point orth = hp.normal();\n int quadPointing = (int) (2 + 2 * Math.atan2(orth.y(), orth.x()) / Math.PI);\n Rr2Point org = big.ne();\n switch(quadPointing) {\n case 1:\n org = big.nw();\n break;\n case 2:\n org = big.sw();\n break;\n case 3:\n org = big.se();\n break;\n case 0:\n default:\n break;\n }\n RrHalfPlane hatcher = new RrHalfPlane(org, Rr2Point.add(org, hp.pLine().direction()));\n List<RrHalfPlane> hatches = new ArrayList<RrHalfPlane>();\n iPolygonList iHatches = new iPolygonList();\n double g = 0;\n while (g < d) {\n iPolygon ip = hatch(hatcher);\n if (ip.size() > 0) {\n hatches.add(hatcher);\n iHatches.add(ip);\n }\n hatcher = hatcher.offset(gap);\n g += gap;\n }\n iPolygonList snakes = new iPolygonList();\n int segment;\n do {\n segment = -1;\n for (int i = 0; i < iHatches.size(); i++) {\n if ((iHatches.polygon(i)).size() > 0) {\n segment = i;\n break;\n }\n }\n if (segment >= 0) {\n snakes.add(snakeGrow(iHatches, hatches, segment, 0));\n }\n } while (segment >= 0);\n try {\n if (Preferences.loadGlobalBool(\"String_Node_Str\"))\n joinUpSnakes(snakes, hatches, gap);\n } catch (Exception e) {\n }\n resetVisited();\n RrPolygonList result = snakes.realPolygons(a).simplify(realResolution);\n pop();\n return result;\n}\n"
|
"private boolean hasHealthyQueen() {\n boolean hasQueen = true;\n EnumErrorCode housingErrorState = null;\n ItemStack queenStack = housing.getQueen();\n if (queenStack == null || !ForestryItem.beeQueenGE.isItemEqual(queenStack)) {\n housingErrorState = EnumErrorCode.NOQUEEN;\n hasQueen = false;\n queen = null;\n } else if (!isQueenAlive(queenStack)) {\n if (queen == null) {\n queen = BeeManager.beeRoot.getMember(queenStack);\n }\n killQueen();\n housingErrorState = EnumErrorCode.OK;\n hasQueen = false;\n queen = null;\n }\n if (housingSupportsMultipleErrorStates) {\n housing.setErrorCondition(!hasQueen, EnumErrorCode.NOQUEEN);\n } else {\n if (housingErrorState != null) {\n housing.setErrorState(housingErrorState);\n }\n }\n if (hasQueen && queen == null) {\n queen = BeeManager.beeRoot.getMember(queenStack);\n }\n return hasQueen;\n}\n"
|
"public void setVarArgs(Map<String, Object> args) {\n if (args.containsKey(IBlockoutManager.DURATION_PARAM)) {\n Number num = (Number) args.get(IBlockoutManager.DURATION_PARAM);\n this.duration = num.longValue();\n }\n}\n"
|
"private Optional<DataHubKey> findFirstDifferentResult(DataHubKey inputKey, QueryResult<OrderedRows<String, String, DataHubCompositeValue>> queryResult, final boolean reversed) {\n OrderedRows<String, String, DataHubCompositeValue> rows = queryResult.get();\n Iterable<Row<String, String, DataHubCompositeValue>> nonLatestRows = excludeLatestChannelItemRow(rows.getList());\n List<Row<String, String, DataHubCompositeValue>> sortedRows = getSortedRows(reversed, nonLatestRows);\n String inputKeyString = keyRenderer.keyToString(inputKey);\n for (Row<String, String, DataHubCompositeValue> row : sortedRows) {\n ColumnSlice<String, DataHubCompositeValue> columnSlice = row.getColumnSlice();\n Optional<DataHubKey> rowResult = findItemInRow(inputKeyString, columnSlice);\n if (rowResult.isPresent()) {\n return rowResult;\n }\n }\n return Optional.absent();\n}\n"
|
"public boolean read(ByteBuf buf, int id, EntityPlayer player, PacketType type) {\n if (!super.read(buf, id, player, type)) {\n if (isClient()) {\n if (id == 0) {\n NBTTagCompound tag = ByteBufUtils.readTag(buf);\n launcherData = new ArrayList();\n if (tag.hasKey(\"String_Node_Str\")) {\n NBTTagList list = tag.getTagList(\"String_Node_Str\", 10);\n for (int i = 0; i < list.tagCount(); i++) {\n launcherData.add(new LauncherData(list.getCompoundTagAt(i)));\n }\n }\n if (Minecraft.getMinecraft().currentScreen instanceof GuiLocalController) {\n ((GuiLocalController) Minecraft.getMinecraft().currentScreen).reloadData();\n }\n return true;\n }\n } else {\n if (id == 1) {\n removeLauncher(new Pos(buf));\n return true;\n } else if (id == 2) {\n int index = buf.readInt();\n if (index == -1) {\n fireAllLaunchers(player);\n else\n fireLauncher(index, player);\n return true;\n }\n }\n return false;\n }\n return true;\n}\n"
|
"protected IContent doCreateContent() {\n return report.createListContent();\n}\n"
|
"public void testQuery3() throws InterruptedException {\n log.info(\"String_Node_Str\");\n SiddhiManager siddhiManager = new SiddhiManager();\n String tables = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\";\n ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(tables);\n try {\n List<String> hciNames = new ArrayList<String>();\n for (HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {\n hciNames.add(hci.getName());\n }\n Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));\n } finally {\n executionPlanRuntime.shutdown();\n }\n Assert.assertTrue(hciNames.contains(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));\n executionPlanRuntime.shutdown();\n}\n"
|
"public static File getUserSettingsDir() {\n File settingsDir = null;\n if (CommonUtils.isWindows()) {\n settingsDir = CommonUtils.getCurrentDirectory();\n } else if (CommonUtils.isMacOSX()) {\n File userPrefsDir;\n try {\n short userDomainCode = -32763;\n userPrefsDir = MRJFileUtils.findFolder(userDomainCode, new MRJOSType(\"String_Node_Str\"));\n settingsDir = new File(userPrefsDir, \"String_Node_Str\");\n } catch (FileNotFoundException e) {\n } catch (NoSuchMethodError e) {\n settingsDir = CommonUtils.getCurrentDirectory();\n }\n } else {\n settingsDir = new File(CommonUtils.getUserHomeDir(), \"String_Node_Str\");\n }\n if (settingsDir == null) {\n settingsDir = new File(CommonUtils.getUserHomeDir(), \"String_Node_Str\");\n }\n if (!settingsDir.isDirectory()) {\n if (!settingsDir.mkdirs()) {\n String msg = \"String_Node_Str\" + settingsDir;\n throw new RuntimeException(msg);\n }\n }\n return settingsDir;\n}\n"
|
"public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) {\n EGLConfig closestConfig = null;\n int closestDistance = 1000;\n for (EGLConfig config : configs) {\n int r = findConfigAttrib(egl, display, config, EGL10.EGL_RED_SIZE, 0);\n int g = findConfigAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE, 0);\n int b = findConfigAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE, 0);\n int a = findConfigAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE, 0);\n int d = findConfigAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE, 0);\n int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);\n if (d >= mDepthSize && s >= mStencilSize) {\n int r = findConfigAttrib(egl, display, config, EGL10.EGL_RED_SIZE, 0);\n int g = findConfigAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE, 0);\n int b = findConfigAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE, 0);\n int a = findConfigAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE, 0);\n int distance = Math.abs(r - mRedSize) + Math.abs(g - mGreenSize) + Math.abs(b - mBlueSize) + Math.abs(a - mAlphaSize);\n if (distance < closestDistance) {\n closestDistance = distance;\n closestConfig = config;\n }\n }\n }\n return closestConfig;\n}\n"
|
"public int read(byte[] b, int off, int len) throws IOException {\n if (b == null) {\n throw new NullPointerException();\n }\n if ((off < 0) || (len < 0) || (off + len > b.length)) {\n throw new IndexOutOfBoundsException();\n }\n if (len == 0) {\n return 0;\n }\n long pos = readUntil(pointer + len);\n if (pos <= pointer) {\n return -1;\n }\n byte[] buf = (byte[]) data.elementAt((int) (pointer >> SECTOR_SHIFT));\n int nbytes = Math.min((int) (pos < pointer + len ? pos - pointer : len), SECTOR_SIZE - (int) (pointer & SECTOR_MASK));\n System.arraycopy(buf, (int) (pointer & SECTOR_MASK), b, off, nbytes);\n pointer += nbytes;\n return nbytes;\n}\n"
|
"public void createUser() {\n User newUser = new User.Builder(\"String_Node_Str\").build();\n toTestSpy.createUser(newUser);\n verify(connector, times(1)).createUser(same(newUser), same(accessToken));\n}\n"
|
"private Component mediaContent(List<MetaInfo> mediaList) {\n try {\n Object[] columnNames = { \"String_Node_Str\" };\n List<String[]> values = new ArrayList<String[]>();\n for (MetaInfo info : mediaList) {\n if (!Strings.isBlank(info.getName())) {\n values.add(new String[] { info.getName() });\n }\n }\n DefaultTableModel model = new DefaultTableModel(values.toArray(new Object[][] {}), columnNames);\n JTable jtable = new JTable(model);\n jtable.setPreferredScrollableViewportSize(jtable.getPreferredSize());\n jtable.setTableHeader(null);\n jtable.setShowGrid(false);\n jtable.setColumnSelectionAllowed(true);\n jtable.setCellSelectionEnabled(true);\n JPanel jPanelImg = new JPanel();\n ListSelectionModel cellSelectionModel = jtable.getSelectionModel();\n cellSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n cellSelectionModel.addListSelectionListener(new ListSelectionListener() {\n public void valueChanged(ListSelectionEvent e) {\n jPanelImg.removeAll();\n int[] selectedRow = jtable.getSelectedRows();\n int[] selectedColumns = jtable.getSelectedColumns();\n for (int i = 0; i < selectedRow.length; i++) {\n for (int j = 0; j < selectedColumns.length; j++) {\n String href = (String) jtable.getValueAt(selectedRow[i], selectedColumns[j]);\n jPanelImg.add(new JLabel(new ImageIcon(getImage(href))));\n jPanelImg.repaint();\n }\n }\n }\n });\n JPanel tablePanel = new JPanel();\n tablePanel.setLayout(new BoxLayout(tablePanel, BoxLayout.Y_AXIS));\n tablePanel.add(jtable);\n tablePanel.add(jPanelImg);\n return new JScrollPane(tablePanel);\n } catch (Exception e) {\n logger.error(\"String_Node_Str\", e);\n }\n return null;\n}\n"
|
"public void tearDown() throws TransactionFailure {\n org.glassfish.resources.admin.cli.DeleteCustomResource deleteCommand = habitat.getComponent(org.glassfish.resources.admin.cli.DeleteCustomResource.class);\n parameters = new ParameterMap();\n parameters.set(\"String_Node_Str\", \"String_Node_Str\");\n cr.getCommandInvocation(\"String_Node_Str\", context.getActionReport()).parameters(parameters).execute(deleteCommand);\n parameters = new ParameterMap();\n parameters.set(\"String_Node_Str\", \"String_Node_Str\");\n cr.getCommandInvocation(\"String_Node_Str\", context.getActionReport()).parameters(parameters).execute(deleteCommand);\n}\n"
|
"public void execute() {\n if (!skip(null))\n return executeBlock();\n return null;\n}\n"
|
"private void resyncFrameworksWithLiveApplications(Map<String, ApplicationReport> liveApplicationReports) throws Exception {\n String logScope = \"String_Node_Str\";\n CHANGE_AWARE_LOGGER.initializeScope(logScope, Level.INFO);\n CHANGE_AWARE_LOGGER.log(logScope, \"String_Node_Str\", liveApplicationReports.size());\n for (ApplicationReport applicationReport : liveApplicationReports.values()) {\n String applicationId = applicationReport.getApplicationId().toString();\n YarnApplicationState applicationState = applicationReport.getYarnApplicationState();\n FinalApplicationStatus applicationFinalStatus = applicationReport.getFinalApplicationStatus();\n String diagnostics = applicationReport.getDiagnostics();\n if (statusManager.isApplicationIdLiveAssociated(applicationId)) {\n FrameworkStatus frameworkStatus = statusManager.getFrameworkStatusWithLiveAssociatedApplicationId(applicationId);\n String frameworkName = frameworkStatus.getFrameworkName();\n FrameworkState frameworkState = frameworkStatus.getFrameworkState();\n if (frameworkState == FrameworkState.APPLICATION_CREATED) {\n continue;\n }\n statusManager.updateApplicationStatus(frameworkName, applicationReport);\n if (applicationFinalStatus == FinalApplicationStatus.UNDEFINED) {\n if (applicationState == YarnApplicationState.NEW || applicationState == YarnApplicationState.NEW_SAVING || applicationState == YarnApplicationState.SUBMITTED || applicationState == YarnApplicationState.ACCEPTED) {\n statusManager.transitionFrameworkState(frameworkName, FrameworkState.APPLICATION_WAITING);\n } else if (applicationState == YarnApplicationState.RUNNING) {\n statusManager.transitionFrameworkState(frameworkName, FrameworkState.APPLICATION_RUNNING);\n }\n } else if (applicationFinalStatus == FinalApplicationStatus.SUCCEEDED) {\n retrieveApplicationDiagnostics(applicationId, ExitStatusKey.SUCCEEDED.toInt(), diagnostics, false);\n } else if (applicationFinalStatus == FinalApplicationStatus.KILLED) {\n retrieveApplicationDiagnostics(applicationId, ExitStatusKey.AM_KILLED_BY_USER.toInt(), diagnostics, false);\n } else if (applicationFinalStatus == FinalApplicationStatus.FAILED) {\n retrieveApplicationDiagnostics(applicationId, null, diagnostics, false);\n }\n } else {\n }\n }\n List<String> liveAssociatedApplicationIds = statusManager.getLiveAssociatedApplicationIds();\n for (String applicationId : liveAssociatedApplicationIds) {\n if (!liveApplicationReports.containsKey(applicationId)) {\n FrameworkStatus frameworkStatus = statusManager.getFrameworkStatusWithLiveAssociatedApplicationId(applicationId);\n String frameworkName = frameworkStatus.getFrameworkName();\n FrameworkState frameworkState = frameworkStatus.getFrameworkState();\n if (frameworkState == FrameworkState.APPLICATION_CREATED) {\n return;\n }\n LOGGER.logWarning(\"String_Node_Str\" + \"String_Node_Str\", frameworkName, applicationId);\n retrieveApplicationDiagnostics(applicationId, ExitStatusKey.AM_RM_RESYNC_LOST.toInt(), \"String_Node_Str\", false);\n }\n }\n}\n"
|
"public void onMessage(Message message) {\n if (isDisabled()) {\n return;\n }\n lastMessage = message;\n if (!(message instanceof TextMessage)) {\n return;\n }\n final String text;\n try {\n text = ((TextMessage) message).getText();\n } catch (JMSException e) {\n e.printStackTrace();\n return;\n }\n if (MDKOptionsGroup.getMDKOptions().isLogJson()) {\n System.out.println(\"String_Node_Str\" + project.getPrimaryProject().getProjectID() + \"String_Node_Str\" + System.lineSeparator() + text);\n }\n JsonNode messageJsonNode;\n try {\n messageJsonNode = JacksonUtils.getObjectMapper().readTree(text);\n } catch (IOException e) {\n e.printStackTrace();\n return;\n }\n if (!messageJsonNode.isObject()) {\n return;\n }\n JsonNode workspaceJsonNode = messageJsonNode.get(\"String_Node_Str\");\n JsonNode syncedJsonNode;\n if (workspaceJsonNode != null && workspaceJsonNode.isObject()) {\n JsonNode sourceJsonNode = messageJsonNode.get(\"String_Node_Str\");\n if (sourceJsonNode != null && sourceJsonNode.isTextual() && sourceJsonNode.asText().equalsIgnoreCase(\"String_Node_Str\")) {\n return;\n }\n for (Map.Entry<String, Changelog.ChangeType> entry : CHANGE_MAPPING.entrySet()) {\n JsonNode changeJsonNode = workspaceJsonNode.get(entry.getKey());\n if (changeJsonNode == null || !changeJsonNode.isArray()) {\n continue;\n }\n for (JsonNode elementJsonNode : changeJsonNode) {\n if (elementJsonNode == null || !elementJsonNode.isObject()) {\n continue;\n }\n JsonNode sysmlIdJsonNode = elementJsonNode.get(MDKConstants.SYSML_ID_KEY);\n if (sysmlIdJsonNode == null || !sysmlIdJsonNode.isTextual()) {\n continue;\n }\n try {\n if (EMFImporter.PreProcessor.SYSML_ID_VALIDATION.getFunction().apply((ObjectNode) elementJsonNode, project, false, project.getModel()) == null) {\n continue;\n }\n } catch (ImportException | ReadOnlyElementException ignored) {\n continue;\n }\n inMemoryJMSChangelog.addChange(sysmlIdJsonNode.asText(), (ObjectNode) elementJsonNode, entry.getValue());\n }\n }\n SyncStatusConfigurator.getSyncStatusAction().update();\n } else if ((syncedJsonNode = messageJsonNode.get(\"String_Node_Str\")) != null && syncedJsonNode.isObject()) {\n JsonNode sourceJsonNode = messageJsonNode.get(\"String_Node_Str\");\n if (sourceJsonNode == null || !sourceJsonNode.isTextual() || !sourceJsonNode.asText().equals(\"String_Node_Str\")) {\n return;\n }\n JsonNode senderJsonNode = messageJsonNode.get(\"String_Node_Str\");\n if (senderJsonNode != null && senderJsonNode.isTextual() && senderJsonNode.asText().equals(TicketUtils.getUsername())) {\n return;\n }\n Changelog<String, Void> syncedChangelog = SyncElements.buildChangelog((ObjectNode) syncedJsonNode);\n if (syncedChangelog.isEmpty()) {\n return;\n }\n for (Changelog.ChangeType changeType : Changelog.ChangeType.values()) {\n Map<String, ObjectNode> inMemoryJMSChanges = inMemoryJMSChangelog.get(changeType);\n syncedChangelog.get(changeType).keySet().forEach(inMemoryJMSChanges::remove);\n }\n int size = syncedChangelog.flattenedSize();\n if (MDUtils.isDeveloperMode()) {\n Application.getInstance().getGUILog().log(\"String_Node_Str\" + project.getName() + \"String_Node_Str\" + size + \"String_Node_Str\" + (size != 1 ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\");\n }\n SyncStatusConfigurator.getSyncStatusAction().update();\n }\n}\n"
|
"private RawPacket[] reverseTransformSingle(RawPacket pkt, RawPacket[] pkts) {\n byte[] buf = pkt.getBuffer();\n int off = pkt.getOffset();\n int hdrLen = pkt.getHeaderLength();\n int idx = off + hdrLen;\n int pktCount = 1;\n while ((buf[idx] & 0x80) != 0) {\n pktCount++;\n idx += 4;\n }\n idx = off + hdrLen;\n if (pkts.length < pktCount)\n pkts = new RawPacket[pktCount];\n if (pktCount != 1 && logger.isInfoEnabled())\n logger.info(\"String_Node_Str\");\n int payloadOffset = idx + (pktCount - 1) * 4 + 1;\n for (int i = 1; i < pktCount; i++) {\n int blockLen = (buf[idx + 2] & 0x03) << 8 | (buf[idx + 3] & 0xFF);\n byte[] newBuf = new byte[hdrLen + blockLen];\n System.arraycopy(buf, payloadOffset, newBuf, 0, hdrLen + blockLen);\n if (pkts[i] == null)\n pkts[i] = new RawPacket();\n pkts[i].setBuffer(newBuf);\n pkts[i].setOffset(0);\n pkts[i].setLength(hdrLen + blockLen);\n pkts[i].setPayloadType((byte) (buf[idx] & 0xf7));\n idx += 4;\n payloadOffset += blockLen;\n }\n pkt.setPayloadType((byte) (buf[idx] & 0x7f));\n System.arraycopy(buf, off, buf, off + payloadOffset - hdrLen, hdrLen);\n pkt.setOffset(off + payloadOffset - hdrLen);\n pkt.setLength(pkt.getLength() - (payloadOffset - hdrLen));\n pkts[0] = pkt;\n return pkts;\n}\n"
|
"protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {\n String siteName = req.getParameter(ARG_SITE_NAME);\n if (StringUtils.isBlank(siteName)) {\n siteName = RmSiteType.DEFAULT_SITE_NAME;\n }\n NodeRef filePlan = siteService.getContainer(siteName, RmSiteType.COMPONENT_DOCUMENT_LIBRARY);\n String unloadedOnlyParam = req.getParameter(ARG_UNLOADED_ONLY);\n boolean unloadedOnly = false;\n if (StringUtils.isNotBlank(unloadedOnlyParam)) {\n unloadedOnly = Boolean.valueOf(unloadedOnlyParam).booleanValue();\n }\n Map<String, DataSet> dataSets = dataSetService.getDataSets(filePlan, unloadedOnly);\n List<Map<String, String>> dataSetList = new ArrayList<Map<String, String>>(dataSets.size());\n for (Map.Entry<String, DataSet> entry : dataSets.entrySet()) {\n Map<String, String> dataSet = new HashMap<String, String>(3);\n DataSet value = entry.getValue();\n String dataSetId = value.getId();\n String isLoaded = String.valueOf(dataSetService.isLoadedDataSet(filePlan, dataSetId));\n dataSet.put(\"String_Node_Str\", value.getLabel());\n dataSet.put(\"String_Node_Str\", dataSetId);\n dataSet.put(\"String_Node_Str\", isLoaded);\n dataSetList.add(dataSet);\n }\n Map<String, Object> model = new HashMap<String, Object>(1);\n model.put(\"String_Node_Str\", dataSetList);\n return model;\n}\n"
|
"protected Resource getRightResource() throws ReloadCompareException {\n List<Package> packages = new ArrayList<Package>();\n packages.addAll(DataProviderHelper.getTdCatalogs(tempReloadProvider));\n packages.addAll(DataProviderHelper.getTdSchema(tempReloadProvider));\n Resource reloadResource = null;\n reloadResource = tempReloadProvider.eResource();\n reloadResource.getContents().clear();\n for (TdCatalog catalog : tdCatalogs) {\n catalog.getDataManager().clear();\n reloadResource.getContents().add(catalog);\n }\n EMFSharedResources.getInstance().saveResource(reloadResource);\n return reloadResource;\n}\n"
|
"private void updateTargetProductMetadata() {\n final MetadataElement oriProdMetadata = AbstractMetadata.getOriginalProductMetadata(targetProduct);\n final MetadataElement finalMetadataElem = getParentMetadataElemForFlag(oriProdMetadata);\n if (removeNoise) {\n finalMetadataElem.setAttributeString(ANNOTATION_FLAG_NAME, \"String_Node_Str\");\n } else {\n finalMetadataElem.setAttributeString(ANNOTATION_FLAG_NAME, \"String_Node_Str\");\n }\n}\n"
|
"public void update(int timeout) throws IOException {\n updateThread = Thread.currentThread();\n synchronized (updateLock) {\n }\n long startTime = System.currentTimeMillis();\n int select = 0;\n if (timeout > 0) {\n select = selector.select(timeout);\n } else {\n select = selector.selectNow();\n }\n System.out.println(select);\n if (select == 0) {\n long elapsedTime = System.currentTimeMillis() - startTime;\n try {\n if (elapsedTime < 25)\n Thread.sleep(25 - elapsedTime);\n } catch (InterruptedException ex) {\n }\n } else {\n Set<SelectionKey> keys = selector.selectedKeys();\n synchronized (keys) {\n UdpConnection udp = this.udp;\n outer: for (Iterator<SelectionKey> iter = keys.iterator(); iter.hasNext(); ) {\n SelectionKey selectionKey = iter.next();\n iter.remove();\n try {\n int ops = selectionKey.readyOps();\n Connection fromConnection = (Connection) selectionKey.attachment();\n if (fromConnection != null) {\n if (udp != null && fromConnection.udpRemoteAddress == null) {\n fromConnection.close();\n continue;\n }\n if ((ops & SelectionKey.OP_READ) == SelectionKey.OP_READ) {\n try {\n while (true) {\n Object object = fromConnection.tcp.readObject(fromConnection);\n if (object == null)\n break;\n if (DEBUG) {\n String objectString = object == null ? \"String_Node_Str\" : object.getClass().getSimpleName();\n if (!(object instanceof FrameworkMessage)) {\n debug(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + objectString);\n } else if (TRACE) {\n trace(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + objectString);\n }\n }\n fromConnection.notifyReceived(object);\n }\n } catch (IOException ex) {\n if (TRACE) {\n trace(\"String_Node_Str\", \"String_Node_Str\" + fromConnection, ex);\n } else if (DEBUG) {\n debug(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + ex.getMessage());\n }\n fromConnection.close();\n } catch (KryoNetException ex) {\n if (ERROR)\n error(\"String_Node_Str\", \"String_Node_Str\" + fromConnection, ex);\n fromConnection.close();\n }\n }\n if ((ops & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE) {\n try {\n fromConnection.tcp.writeOperation();\n } catch (IOException ex) {\n if (TRACE) {\n trace(\"String_Node_Str\", \"String_Node_Str\" + fromConnection, ex);\n } else if (DEBUG) {\n debug(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + ex.getMessage());\n }\n fromConnection.close();\n }\n }\n continue;\n }\n if ((ops & SelectionKey.OP_ACCEPT) == SelectionKey.OP_ACCEPT) {\n ServerSocketChannel serverChannel = this.serverChannel;\n if (serverChannel == null)\n continue;\n try {\n SocketChannel socketChannel = serverChannel.accept();\n if (socketChannel != null)\n acceptOperation(socketChannel);\n } catch (IOException ex) {\n if (DEBUG)\n debug(\"String_Node_Str\", \"String_Node_Str\", ex);\n }\n continue;\n }\n if (udp == null) {\n selectionKey.channel().close();\n continue;\n InetSocketAddress fromAddress;\n try {\n fromAddress = udp.readFromAddress();\n } catch (IOException ex) {\n if (WARN)\n warn(\"String_Node_Str\", \"String_Node_Str\", ex);\n continue;\n }\n if (fromAddress == null)\n continue;\n Connection[] connections = this.connections;\n for (int i = 0, n = connections.length; i < n; i++) {\n Connection connection = connections[i];\n if (fromAddress.equals(connection.udpRemoteAddress)) {\n fromConnection = connection;\n break;\n }\n }\n Object object;\n try {\n object = udp.readObject(fromConnection);\n } catch (KryoNetException ex) {\n if (WARN) {\n if (fromConnection != null) {\n if (ERROR)\n error(\"String_Node_Str\", \"String_Node_Str\" + fromConnection, ex);\n } else\n warn(\"String_Node_Str\", \"String_Node_Str\" + fromAddress, ex);\n }\n continue;\n }\n if (object instanceof FrameworkMessage) {\n if (object instanceof RegisterUDP) {\n int fromConnectionID = ((RegisterUDP) object).connectionID;\n Connection connection = pendingConnections.remove(fromConnectionID);\n if (connection != null) {\n if (connection.udpRemoteAddress != null)\n continue outer;\n connection.udpRemoteAddress = fromAddress;\n addConnection(connection);\n connection.sendTCP(new RegisterUDP());\n if (DEBUG)\n debug(\"String_Node_Str\", \"String_Node_Str\" + udp.datagramChannel.socket().getLocalPort() + \"String_Node_Str\" + fromAddress);\n connection.notifyConnected();\n continue;\n }\n if (DEBUG)\n debug(\"String_Node_Str\", \"String_Node_Str\" + fromConnectionID);\n continue;\n }\n if (object instanceof DiscoverHost) {\n try {\n udp.datagramChannel.send(emptyBuffer, fromAddress);\n if (DEBUG)\n debug(\"String_Node_Str\", \"String_Node_Str\" + fromAddress);\n } catch (IOException ex) {\n if (WARN)\n warn(\"String_Node_Str\", \"String_Node_Str\" + fromAddress, ex);\n }\n continue;\n }\n }\n if (fromConnection != null) {\n if (DEBUG) {\n String objectString = object == null ? \"String_Node_Str\" : object.getClass().getSimpleName();\n if (object instanceof FrameworkMessage) {\n if (TRACE)\n trace(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + objectString);\n } else\n debug(\"String_Node_Str\", fromConnection + \"String_Node_Str\" + objectString);\n }\n fromConnection.notifyReceived(object);\n continue;\n }\n if (DEBUG)\n debug(\"String_Node_Str\", \"String_Node_Str\" + fromAddress);\n } catch (CancelledKeyException ignored) {\n }\n }\n }\n }\n long time = System.currentTimeMillis();\n Connection[] connections = this.connections;\n for (int i = 0, n = connections.length; i < n; i++) {\n Connection connection = connections[i];\n if (connection.tcp.isTimedOut(time)) {\n if (DEBUG)\n debug(\"String_Node_Str\", connection + \"String_Node_Str\");\n connection.close();\n } else {\n if (connection.tcp.needsKeepAlive(time))\n connection.sendTCP(FrameworkMessage.keepAlive);\n }\n if (connection.isIdle())\n connection.notifyIdle();\n }\n}\n"
|
"public void createPatients(LocalDate today, int numberOfPatients) {\n List<Clinic> clinics = allClinics.getAll();\n assertTrue(\"String_Node_Str\", clinics.size() > 0);\n LocalTime doseTime = new LocalTime(10, 0);\n MedicalHistory medicalHistory = MedicalHistoryBuilder.startRecording().withDefaults().build();\n for (int patientsCreated = 0; patientsCreated < numberOfPatients; patientsCreated++) {\n DateTime timeOfRegistration = DateUtil.newDateTime(today, 10, 0, 0);\n doseTime = getFreeSlotTime(doseTime, patientsCreated);\n Clinic clinic = clinics.get(patientsCreated % clinics.size());\n login(clinic);\n Patient patient = createActivePatient(medicalHistory, today);\n recordFirstClinicVisit(patient, today, doseTime, timeOfRegistration);\n log.info(\"String_Node_Str\" + patient.getPatientId() + \"String_Node_Str\" + clinic.getName() + \"String_Node_Str\" + doseTime);\n }\n}\n"
|
"private org.jivesoftware.smack.packet.IQ handleIQRequest(org.jivesoftware.smack.packet.IQ request) throws Exception {\n if (request instanceof org.jivesoftware.smackx.packet.Version) {\n return handleVersionIQ((org.jivesoftware.smackx.packet.Version) request);\n }\n Videobridge videobridge = getVideobridge();\n if (videobridge == null) {\n return IQUtils.createError(request, XMPPError.Condition.interna_server_error, \"String_Node_Str\");\n }\n org.jivesoftware.smack.packet.IQ response;\n if (request instanceof ColibriConferenceIQ) {\n response = videobridge.handleColibriConferenceIQ((ColibriConferenceIQ) request);\n } else if (request instanceof HealthCheckIQ) {\n response = videobridge.handleHealthCheckIQ((HealthCheckIQ) request);\n } else if (request instanceof ShutdownIQ) {\n response = videobridge.handleShutdownIQ((ShutdownIQ) request);\n } else {\n response = null;\n }\n return response;\n}\n"
|
"private void HandleExceptionMessages(Exception ex) {\n if (ex instanceof HttpHostConnectException)\n ShowToastLong(\"String_Node_Str\");\n else if (ex instanceof HttpResponseException) {\n HttpResponseException responseException = (HttpResponseException) ex;\n ShowToastLong(responseException.getLocalizedMessage());\n } else\n ShowToastLong(ex.getLocalizedMessage());\n ((NewsReaderListActivity) getActivity()).UpdateButtonLayout();\n}\n"
|
"private synchronized void updateLayout() {\n List<String> tableList = _clusterStatus.getTableList();\n HashMap<String, Map<String, String>> newLayout = new HashMap<String, Map<String, String>>();\n for (String table : tableList) {\n DistributedLayoutManager layoutManager = new DistributedLayoutManager();\n String cluster = _clusterStatus.getCluster(false, table);\n List<String> shardServerList = _clusterStatus.getShardServerList(cluster);\n List<String> offlineShardServers = _clusterStatus.getOfflineShardServers(cluster);\n List<String> shardList = getShardList(cluster, table);\n layoutManager.setNodes(shardServerList);\n layoutManager.setNodesOffline(offlineShardServers);\n layoutManager.setShards(shardList);\n layoutManager.init();\n Map<String, String> layout = layoutManager.getLayout();\n newLayout.put(table, layout);\n }\n _shardServerLayout.set(newLayout);\n}\n"
|
"public void syncSOHWithServer(User user) {\n List<CommoditySnapshot> sohSnapshotsToSync = new ArrayList<>();\n for (Commodity commodity : commodityService.sortedAll()) {\n try {\n int quantityOfYesterday = 0, quantityOfToday = 0;\n StockItemSnapshot sohOfYesterday = stohService.get(commodity, dateOfYesterday);\n StockItemSnapshot sohOfToday = stohService.get(commodity, dateOfToday);\n if (sohOfYesterday != null) {\n quantityOfYesterday = sohOfYesterday.getQuantity();\n }\n if (sohOfToday != null) {\n sohOfToday.setQuantity(sohOfToday.getQuantity() + quantityOfYesterday);\n quantityOfToday = sohOfToday.getQuantity();\n }\n sohOfToday = stohService.createOrUpdate(commodity, quantityOfToday, dateOfToday);\n if (sohOfToday != null && sohOfToday.getActivitiesValues() != null) {\n for (CommoditySnapshotValue value : sohOfToday.getActivitiesValues()) {\n sohSnapshotsToSync.add(new CommoditySnapshot(value));\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n continue;\n }\n }\n if (!isEmpty(sohSnapshotsToSync)) {\n i(\"String_Node_Str\", sohSnapshotsToSync.size() + \"String_Node_Str\");\n DataValueSet valueSet = toDataValueSet(sohSnapshotsToSync, user.getFacilityCode());\n try {\n DataValueSetPushResponse response = lmisServer.pushDataValueSet(valueSet, user);\n } catch (LmisException ex) {\n e(\"String_Node_Str\", sohSnapshotsToSync.size() + \"String_Node_Str\");\n }\n }\n}\n"
|
"protected void writeXsiTypeAttribute(XMLDescriptor xmlDescriptor, XMLRecord row, String typeValue, boolean addToNamespaceResolver) {\n XMLField xmlField = null;\n if (row.isNamespaceAware()) {\n String xsiPrefix = null;\n boolean generated = false;\n xsiPrefix = row.getNamespaceResolver().resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);\n if (xsiPrefix == null) {\n xsiPrefix = XMLConstants.SCHEMA_INSTANCE_PREFIX;\n generated = true;\n writeNamespace(row, xsiPrefix, XMLConstants.SCHEMA_INSTANCE_URL, addToNamespaceResolver);\n }\n xmlField = (XMLField) xmlDescriptor.buildField(XMLConstants.ATTRIBUTE + xsiPrefix + XMLConstants.COLON + XMLConstants.SCHEMA_TYPE_ATTRIBUTE);\n if (generated) {\n xmlField.getLastXPathFragment().setGeneratedPrefix(true);\n }\n } else {\n xmlField = (XMLField) xmlDescriptor.buildField(XMLConstants.ATTRIBUTE + XMLConstants.SCHEMA_TYPE_ATTRIBUTE);\n }\n xmlField.getLastXPathFragment().setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);\n row.add(xmlField, typeValue);\n}\n"
|
"private void waitForDeletion(final List<JSONObject> instances, long timeoutSeconds) {\n new Condition() {\n\n public boolean satisfied() {\n try {\n Client client = cloud.getClient();\n for (Iterator<JSONObject> iter = instances.iterator(); iter.hasNext(); ) {\n JSONObject instance = iter.next();\n try {\n client.getInstance(instance.getString(\"String_Node_Str\"));\n } catch (ClientException ex) {\n if (ex.getStatusCode() == HttpStatus.SC_NOT_FOUND) {\n iter.remove();\n objectsToDelete.remove(instance);\n } else {\n throw ex;\n }\n }\n }\n return instances.isEmpty();\n } catch (IOException ex) {\n LOGGER.log(Level.SEVERE, ex.getMessage(), ex);\n return false;\n }\n }\n }, TimeUnit.MINUTES.toSeconds(timeoutSeconds));\n}\n"
|
"public Map<String, Number> findGoodParameterValues() throws ExecutionException {\n int numProperties = parameterRanges.size();\n String[] propertyNames = new String[numProperties];\n Number[][] parameterValuesToTry = new Number[numProperties][];\n int index = 0;\n for (Map.Entry<String, ParameterRange> entry : parameterRanges.entrySet()) {\n propertyNames[index] = entry.getKey();\n parameterValuesToTry[index] = entry.getValue().buildSteps(numSteps);\n index++;\n }\n int numTests = 1;\n for (Number[] toTry : parameterValuesToTry) {\n numTests *= toTry.length;\n }\n List<Pair<Double, String>> testResultLinesByValue = Lists.newArrayListWithCapacity(numTests);\n Map<String, Number> bestParameterValues = Maps.newHashMap();\n double bestValue = minimize ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n for (int test = 0; test < numTests; test++) {\n StringBuilder testResultLine = new StringBuilder();\n for (int prop = 0; prop < numProperties; prop++) {\n String property = propertyNames[prop];\n Number parameterValue = getParameterValueToTry(parameterValuesToTry, test, prop);\n String propertyString = parameterValue.toString();\n log.info(\"String_Node_Str\", property, propertyString);\n System.setProperty(property, propertyString);\n testResultLine.append('[').append(property).append('=').append(propertyString).append(\"String_Node_Str\");\n }\n Number evaluatorResult;\n try {\n testValue = evaluator.call().doubleValue();\n } catch (Exception e) {\n throw new ExecutionException(e);\n }\n testResultLine.append(\"String_Node_Str\").append(testValue);\n testResultLinesByValue.add(new Pair<Double, String>(testValue, testResultLine.toString()));\n log.info(\"String_Node_Str\", testResultLine);\n if (minimize ? testValue < bestValue : testValue > bestValue) {\n log.info(\"String_Node_Str\", testValue);\n bestValue = testValue;\n for (int prop = 0; prop < numProperties; prop++) {\n String property = propertyNames[prop];\n Number parameterValue = getParameterValueToTry(parameterValuesToTry, test, prop);\n bestParameterValues.put(property, parameterValue);\n }\n }\n Collections.sort(testResultLinesByValue, new Comparator<Pair<Double, String>>() {\n public int compare(Pair<Double, String> a, Pair<Double, String> b) {\n if (a.getFirst() > b.getFirst()) {\n return -1;\n }\n if (a.getFirst() < b.getFirst()) {\n return 1;\n }\n return 0;\n }\n });\n for (Pair<Double, String> result : testResultLinesByValue) {\n log.info(\"String_Node_Str\", result.getSecond());\n }\n log.info(\"String_Node_Str\", bestParameterValues);\n }\n log.info(\"String_Node_Str\", bestParameterValues);\n return bestParameterValues;\n}\n"
|
"private void GenLabeledStmt(AST.LabeledStmt ast, String context) throws PcalTLAGenException {\n String actionName = ast.label;\n if (ParseAlgorithm.omitPC) {\n actionName = currentProcName;\n }\n StringBuffer sb = new StringBuffer(actionName);\n Changed c = new Changed(vars);\n if (mp && (context.equals(\"String_Node_Str\") || selfIsSelf)) {\n sb.append(\"String_Node_Str\");\n }\n sb.append(\"String_Node_Str\");\n int col = sb.length();\n kludgeToFixPCHandlingBug = col;\n sb.append(\"String_Node_Str\");\n kludgeToFixPCHandlingBug = kludgeToFixPCHandlingBug + 3;\n int defStartLine = tlacode.size();\n int colAfterAnd = sb.length();\n PCalLocation macroBeginLeft = null;\n PCalLocation macroEndRight = null;\n boolean nonNullNotFound = true;\n for (int i = 0; i < ast.stmts.size(); i++) {\n AST stmt = (AST) ast.stmts.elementAt(i);\n if (stmt.getOrigin() != null) {\n if (nonNullNotFound) {\n nonNullNotFound = false;\n macroBeginLeft = stmt.macroOriginBegin;\n }\n macroEndRight = stmt.macroOriginEnd;\n }\n }\n addLeftParenV(ast, macroBeginLeft);\n for (int i = 0; i < ast.stmts.size(); i++) {\n GenStmt((AST) ast.stmts.elementAt(i), c, context, sb.toString(), sb.length());\n sb = new StringBuffer(NSpaces(col));\n sb.append(\"String_Node_Str\");\n }\n Vector unc = c.Unchanged(wrapColumn - col - \"String_Node_Str\".length());\n if (c.NumUnchanged() > 1) {\n sb = new StringBuffer(NSpaces(col));\n sb.append(\"String_Node_Str\");\n int here = sb.length();\n sb.append((String) unc.elementAt(0));\n for (int i = 1; i < unc.size(); i++) {\n addOneLineOfTLA(sb.toString());\n sb = new StringBuffer(NSpaces(here));\n sb.append((String) unc.elementAt(i));\n }\n sb.append(\"String_Node_Str\");\n addOneTokenToTLA(sb.toString());\n } else if (c.NumUnchanged() == 1) {\n if (c.Unchanged().length() > 5) {\n addOneTokenToTLA(NSpaces(col) + \"String_Node_Str\" + c.Unchanged());\n } else {\n addOneTokenToTLA(NSpaces(col) + \"String_Node_Str\" + c.Unchanged() + \"String_Node_Str\" + c.Unchanged());\n }\n } else {\n if (ast.stmts.size() == 1) {\n for (int i = defStartLine; i < tlacode.size(); i++) {\n String line = (String) tlacode.elementAt(i);\n if (i == defStartLine) {\n tlacode.setElementAt(line.substring(0, colAfterAnd - 3) + line.substring(colAfterAnd, line.length()), i);\n shiftMappingVectorTokensLeft(i, colAfterAnd, 3);\n } else {\n if (line.length() > 3) {\n tlacode.setElementAt(line.substring(3, line.length()), i);\n shiftMappingVectorTokensLeft(i, colAfterAnd, 3);\n }\n }\n }\n }\n }\n addRightParen(ast.getOrigin());\n addOneLineOfTLA(\"String_Node_Str\");\n}\n"
|
"public String getReferencedType(final AttributeType attributeType, final CIString value) {\n final Set<ObjectType> references = attributeType.getReferences();\n switch(references.size()) {\n case 0:\n if (AttributeType.MEMBERS.equals(attributeType)) {\n if (AttributeType.AUT_NUM.isValidValue(ObjectType.AUT_NUM, value)) {\n return ObjectType.AUT_NUM.getName();\n }\n if (AttributeType.AS_SET.isValidValue(ObjectType.AS_SET, value)) {\n return ObjectType.AS_SET.getName();\n }\n if (AttributeType.ROUTE_SET.isValidValue(ObjectType.ROUTE_SET, value)) {\n return ObjectType.ROUTE_SET.getName();\n }\n if (AttributeType.RTR_SET.isValidValue(ObjectType.RTR_SET, value)) {\n return ObjectType.RTR_SET.getName();\n }\n }\n return null;\n case 1:\n if (AttributeType.AUTH.equals(attributeType)) {\n String authType = SPACE_SPLITTER.split(value).iterator().next().toUpperCase();\n if (authType.endsWith(\"String_Node_Str\") || authType.equals(\"String_Node_Str\")) {\n return null;\n }\n }\n if (AttributeType.MBRS_BY_REF.equals(attributeType)) {\n if (value.toLowerCase().equals(\"String_Node_Str\")) {\n return null;\n }\n }\n if (AttributeType.MNT_ROUTES.equals(attributeType)) {\n if (MNT_ROUTES_NO_REFERENCE.matcher(value).matches()) {\n return null;\n }\n }\n return references.iterator().next().getName();\n default:\n if (references.contains(ObjectType.PERSON) || references.contains(ObjectType.ROLE)) {\n for (ObjectType objectType : references) {\n if (attributeType.isValidValue(objectType, value)) {\n try {\n return rpslObjectDao.findByKey(objectType, value.toString()).getObjectType().getName();\n } catch (EmptyResultDataAccessException ignored) {\n }\n }\n }\n } else {\n for (ObjectType objectType : references) {\n for (AttributeType lookupAttribute : ObjectTemplate.getTemplate(objectType).getLookupAttributes()) {\n if (lookupAttribute.isValidValue(objectType, value)) {\n return objectType.getName();\n }\n }\n }\n }\n return null;\n }\n}\n"
|
"protected synchronized CtClass get0(String classname, boolean useCache) throws NotFoundException {\n CtClass clazz = null;\n if (useCache) {\n clazz = getCached(classname);\n if (clazz != null)\n return clazz;\n }\n if (!childFirstLookup && parent != null) {\n clazz = parent.get0(classname, useCache);\n if (clazz != null)\n return clazz;\n }\n clazz = createCtClass(classname, useCache);\n if (clazz != null) {\n if (useCache)\n cacheCtClass(clazz.getName(), clazz, false);\n return clazz;\n }\n if (childFirstLookup && parent != null)\n clazz = parent.get0(classname, useCache);\n return clazz;\n}\n"
|
"protected String singleJavaInputForTest() {\n return getTestName().substring(4) + \"String_Node_Str\";\n}\n"
|
"public void end() throws IOException, InterruptedException {\n for (String[] mst : masterRecords) {\n outputRow(StringUtilities.join(mst, columnDelimiter, escapeCharacter));\n }\n}\n"
|
"public void testGetResourceThroughSpringResourceAbstraction() throws Exception {\n Bundle[] bundles = bundleContext.getBundles();\n for (int i = 1; i < bundles.length; i++) {\n Bundle bundle = bundles[i];\n Resource res = new OsgiBundleResource(bundle, ResourceLoader.CLASSPATH_URL_PREFIX + LOCATION);\n if (!OsgiBundleUtils.isFragment(bundle))\n assertTrue(res.exists());\n }\n}\n"
|
"public void train(SentenceCollection sentences) {\n model = modelFactory.getInstance(sentences);\n for (int i = 0; i < iterations; i++) {\n C counts = eStep.getCounts(sentences, model);\n model = mStep.getModel(counts);\n }\n}\n"
|
"public static Object convertJavascriptValue(Object inputObj) {\n if (inputObj instanceof Undefined) {\n return null;\n }\n if (inputObj instanceof IdScriptableObject) {\n String jsClass = ((Scriptable) inputObj).getClassName();\n if (\"String_Node_Str\".equals(jsClass)) {\n return Context.toType(inputObj, Date.class);\n } else if (\"String_Node_Str\".equals(jsClass)) {\n return new Boolean(Context.toBoolean(inputObj));\n } else if (\"String_Node_Str\".equals(jsClass)) {\n return new Double(Context.toNumber(inputObj));\n } else if (\"String_Node_Str\".equals(jsClass)) {\n return inputObj.toString();\n } else if (\"String_Node_Str\".equals(jsClass)) {\n Object[] obj = new Object[(int) ((NativeArray) inputObj).getLength()];\n for (int i = 0; i < obj.length; i++) {\n obj[i] = convertJavascriptValue(((NativeArray) inputObj).get(i, null));\n }\n return obj;\n }\n } else if (inputObj instanceof Wrapper) {\n return ((Wrapper) inputObj).unwrap();\n }\n return inputObj;\n}\n"
|
"private void processLiteralCharacters() {\n if (literalCharactersBuffer.length() > 0) {\n literalCharacters += literalCharactersBuffer.length();\n String s = encodeLiteralCharacters(literalCharactersBuffer.toString());\n normalizedTemplate.append(s);\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (RESERVED_REGEX_CHARACTERS.contains(c)) {\n regex.append(\"String_Node_Str\");\n regex.append(c);\n }\n literalCharactersBuffer.setLength(0);\n }\n}\n"
|
"private void drawHeaderRowAndEvents(Canvas canvas) {\n mHeaderColumnWidth = mTimeTextWidth + mHeaderColumnPadding * 2;\n mWidthPerDay = getWidth() - mHeaderColumnWidth - mColumnGap * (mNumberOfVisibleDays - 1);\n mWidthPerDay = mWidthPerDay / mNumberOfVisibleDays;\n Calendar today = today();\n if (mAreDimensionsInvalid) {\n mEffectiveMinHourHeight = Math.max(mMinHourHeight, (int) ((getHeight() - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) / 24));\n mAreDimensionsInvalid = false;\n if (mScrollToDay != null)\n goToDate(mScrollToDay);\n mAreDimensionsInvalid = false;\n if (mScrollToHour >= 0)\n goToHour(mScrollToHour);\n mScrollToDay = null;\n mScrollToHour = -1;\n mAreDimensionsInvalid = false;\n }\n if (mIsFirstDraw) {\n mIsFirstDraw = false;\n if (mNumberOfVisibleDays >= 7 && today.get(Calendar.DAY_OF_WEEK) != mFirstDayOfWeek && mshowFirstDayOfWeekFirst) {\n int difference = (today.get(Calendar.DAY_OF_WEEK) - mFirstDayOfWeek);\n mCurrentOrigin.x += (mWidthPerDay + mColumnGap) * difference;\n }\n }\n if (mNewHourHeight > 0) {\n if (mNewHourHeight < mEffectiveMinHourHeight)\n mNewHourHeight = mEffectiveMinHourHeight;\n else if (mNewHourHeight > mMaxHourHeight)\n mNewHourHeight = mMaxHourHeight;\n mCurrentOrigin.y = (mCurrentOrigin.y / mHourHeight) * mNewHourHeight;\n mHourHeight = mNewHourHeight;\n mNewHourHeight = -1;\n }\n if (mCurrentOrigin.y < getHeight() - mHourHeight * 24 - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom - mTimeTextHeight / 2)\n mCurrentOrigin.y = getHeight() - mHourHeight * 24 - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom - mTimeTextHeight / 2;\n if (mCurrentOrigin.y > 0) {\n mCurrentOrigin.y = 0;\n }\n int leftDaysWithGaps = (int) -(Math.ceil(mCurrentOrigin.x / (mWidthPerDay + mColumnGap)));\n float startFromPixel = mCurrentOrigin.x + (mWidthPerDay + mColumnGap) * leftDaysWithGaps + mHeaderColumnWidth;\n float startPixel = startFromPixel;\n Calendar day = (Calendar) today.clone();\n day.add(Calendar.HOUR, 6);\n int lineCount = (int) ((getHeight() - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) / mHourHeight) + 1;\n lineCount = (lineCount) * (mNumberOfVisibleDays + 1);\n float[] hourLines = new float[lineCount * 4];\n if (mEventRects != null) {\n for (EventRect eventRect : mEventRects) {\n eventRect.rectF = null;\n }\n }\n canvas.clipRect(mHeaderColumnWidth, mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight / 2, getWidth(), getHeight(), Region.Op.REPLACE);\n Calendar oldFirstVisibleDay = mFirstVisibleDay;\n mFirstVisibleDay = (Calendar) today.clone();\n mFirstVisibleDay.add(Calendar.DATE, -(Math.round(mCurrentOrigin.x / (mWidthPerDay + mColumnGap))));\n if (!mFirstVisibleDay.equals(oldFirstVisibleDay) && mScrollListener != null) {\n mScrollListener.onFirstVisibleDayChanged(mFirstVisibleDay, oldFirstVisibleDay);\n }\n for (int dayNumber = leftDaysWithGaps + 1; dayNumber <= leftDaysWithGaps + mNumberOfVisibleDays + 1; dayNumber++) {\n day = (Calendar) today.clone();\n mLastVisibleDay = (Calendar) day.clone();\n day.add(Calendar.DATE, dayNumber - 1);\n mLastVisibleDay.add(Calendar.DATE, dayNumber - 2);\n boolean sameDay = isSameDay(day, today);\n if (mEventRects == null || mRefreshEvents || (dayNumber == leftDaysWithGaps + 1 && mFetchedPeriod != (int) mWeekViewLoader.toWeekViewPeriodIndex(day) && Math.abs(mFetchedPeriod - mWeekViewLoader.toWeekViewPeriodIndex(day)) > 0.5)) {\n getMoreEvents(day);\n mRefreshEvents = false;\n }\n float start = (startPixel < mHeaderColumnWidth ? mHeaderColumnWidth : startPixel);\n if (mWidthPerDay + startPixel - start > 0) {\n if (mShowDistinctPastFutureColor) {\n boolean isWeekend = day.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || day.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY;\n Paint pastPaint = isWeekend && mShowDistinctWeekendColor ? mPastWeekendBackgroundPaint : mPastBackgroundPaint;\n Paint futurePaint = isWeekend && mShowDistinctWeekendColor ? mFutureWeekendBackgroundPaint : mFutureBackgroundPaint;\n float startY = mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom + mCurrentOrigin.y;\n if (sameDay) {\n Calendar now = Calendar.getInstance();\n float beforeNow = (now.get(Calendar.HOUR_OF_DAY) + now.get(Calendar.MINUTE) / 60.0f) * mHourHeight;\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, startY + beforeNow, pastPaint);\n canvas.drawRect(start, startY + beforeNow, startPixel + mWidthPerDay, getHeight(), futurePaint);\n } else if (day.before(today)) {\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, getHeight(), pastPaint);\n } else {\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, getHeight(), futurePaint);\n }\n } else {\n canvas.drawRect(start, mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom, startPixel + mWidthPerDay, getHeight(), sameDay ? mTodayBackgroundPaint : mDayBackgroundPaint);\n }\n }\n int i = 0;\n for (int hourNumber = 0; hourNumber < 24; hourNumber++) {\n float top = mHeaderTextHeight + mHeaderRowPadding * 2 + mCurrentOrigin.y + mHourHeight * hourNumber + mTimeTextHeight / 2 + mHeaderMarginBottom;\n if (top > mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom - mHourSeparatorHeight && top < getHeight() && startPixel + mWidthPerDay - start > 0) {\n hourLines[i * 4] = start;\n hourLines[i * 4 + 1] = top;\n hourLines[i * 4 + 2] = startPixel + mWidthPerDay;\n hourLines[i * 4 + 3] = top;\n i++;\n }\n }\n canvas.drawLines(hourLines, mHourSeparatorPaint);\n drawEvents(day, startPixel, canvas);\n if (mShowNowLine && sameDay) {\n float startY = mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom + mCurrentOrigin.y;\n Calendar now = Calendar.getInstance();\n float beforeNow = (now.get(Calendar.HOUR_OF_DAY) + now.get(Calendar.MINUTE) / 60.0f) * mHourHeight;\n canvas.drawLine(start, startY + beforeNow, startPixel + mWidthPerDay, startY + beforeNow, mNowLinePaint);\n }\n startPixel += mWidthPerDay + mColumnGap;\n }\n canvas.clipRect(mHeaderColumnWidth, 0, getWidth(), mHeaderTextHeight + mHeaderRowPadding * 2, Region.Op.REPLACE);\n canvas.drawRect(0, 0, getWidth(), mHeaderTextHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint);\n startPixel = startFromPixel;\n for (int dayNumber = leftDaysWithGaps + 1; dayNumber <= leftDaysWithGaps + mNumberOfVisibleDays + 1; dayNumber++) {\n day = (Calendar) today.clone();\n day.add(Calendar.DATE, dayNumber - 1);\n boolean sameDay = isSameDay(day, today);\n String dayLabel = getDateTimeInterpreter().interpretDate(day);\n if (dayLabel == null)\n throw new IllegalStateException(\"String_Node_Str\");\n canvas.drawText(dayLabel, startPixel + mWidthPerDay / 2, mHeaderTextHeight + mHeaderRowPadding, sameDay ? mTodayHeaderTextPaint : mHeaderTextPaint);\n startPixel += mWidthPerDay + mColumnGap;\n }\n}\n"
|
"public static boolean equalsIgnoreStackSize(ItemStack itemStack1, ItemStack itemStack2) {\n if (itemStack1 != null && itemStack2 != null) {\n if (Item.getIdFromItem(itemStack1.getItem()) - Item.getIdFromItem(itemStack2.getItem()) == 0) {\n if (itemStack1.getItem() == itemStack2.getItem()) {\n if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) {\n if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) {\n if (ItemStack.areItemStackTagsEqual(itemStack1, itemStack2)) {\n return true;\n }\n } else {\n return true;\n }\n } else {\n return true;\n }\n }\n }\n }\n return false;\n}\n"
|
"public boolean isDisposed() {\n this.disposeLock.lock();\n try {\n return this.disposed;\n } finally {\n this.disposeLock.unlock();\n }\n}\n"
|
"public String getRequestTemplate() {\n JSONObject jsonRecord = JSONObject.fromObject(customRecord.getInMessage());\n String jsonString;\n if (customRecord.getInMessage().getMessageContent().isXMLContent()) {\n jsonString = jsonRecord.toString();\n } else {\n jsonString = jsonRecord.toString().replace(\"String_Node_Str\", \"String_Node_Str\");\n }\n return VELOCIMACRO_REQUEST_PREFIX + \"String_Node_Str\" + jsonString + \"String_Node_Str\" + VELOCIMACRO_SUFFIX;\n}\n"
|
"public void setShowProgress(boolean progress) {\n getDefaultLogger().setShowProgress(progress);\n for (Iterator iter = loggerStack.iterator(); iter.hasNext(); ) {\n MessageLogger l = (MessageLogger) iter.next();\n l.setShowProgress(progress);\n }\n}\n"
|
"public <T extends Serializable, S extends Individual<T, S>> S replace(Serializable from, T to, Class<? extends S> clazz) {\n S target = null;\n final Individual<?, ?> src = this.dataSet.individualOfId(from);\n if (src != null) {\n target = this.dataSet.individual(to, clazz);\n rename(src, target);\n }\n return target;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.