content stringlengths 40 137k |
|---|
"public BinaryRatingDao<SubjectRatingEntity> getSubjectRatingDao() {\n if (subjectRatingDao == null) {\n subjectRatingDao = new SqlSubjectRatingDao();\n }\n return subjectRatingDao;\n}\n"
|
"private void placeComponents() {\n GridLayout glContent = new GridLayout(3, true);\n glContent.marginHeight = 2;\n glContent.marginWidth = 2;\n this.setLayout(glContent);\n grpAccLine = new Group(this, SWT.NONE);\n GridData gdGRPAccLine = new GridData(GridData.FILL_HORIZONTAL);\n GridLayout glGRPAccline = new GridLayout(2, false);\n glGRPAccline.verticalSpacing = 0;\n grpAccLine.setLayout(glGRPAccline);\n grpAccLine.setLayoutData(gdGRPAccLine);\n grpAccLine.setText(Messages.getString(\"String_Node_Str\"));\n liacAccLine = new LineAttributesComposite(grpAccLine, SWT.NONE, context, ((BubbleSeries) series).getAccLineAttributes(), true, true, true, true, true);\n GridData gdLIACAccLine = new GridData(GridData.FILL_BOTH);\n gdLIACAccLine.horizontalSpan = 2;\n liacAccLine.setLayoutData(gdLIACAccLine);\n liacAccLine.addListener(this);\n Composite cmpOrientation = new Composite(grpAccLine, SWT.NONE);\n {\n GridLayout gl = new GridLayout(2, false);\n gl.marginHeight = 0;\n gl.marginBottom = 0;\n gl.verticalSpacing = 0;\n cmpOrientation.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 2;\n cmpOrientation.setLayoutData(gd);\n }\n lblOrientation = new Label(cmpOrientation, SWT.NONE);\n lblOrientation.setText(Messages.getString(\"String_Node_Str\"));\n cmbOrientation = new Combo(cmpOrientation, SWT.DROP_DOWN | SWT.READ_ONLY);\n GridData gdCMBOrientation = new GridData(GridData.FILL_HORIZONTAL);\n cmbOrientation.setLayoutData(gdCMBOrientation);\n cmbOrientation.addSelectionListener(this);\n grpLine = new Group(this, SWT.NONE);\n GridData gdGRPLine = new GridData(GridData.FILL_HORIZONTAL);\n gdGRPLine.horizontalSpan = 2;\n grpLine.setLayoutData(gdGRPLine);\n GridLayout glLine = new GridLayout(2, false);\n glLine.horizontalSpacing = 0;\n grpLine.setLayout(glLine);\n grpLine.setText(Messages.getString(\"String_Node_Str\"));\n Composite cmpLine = new Composite(grpLine, SWT.NONE);\n {\n GridLayout gl = new GridLayout(2, false);\n gl.marginHeight = 0;\n gl.marginWidth = 0;\n gl.horizontalSpacing = 0;\n gl.verticalSpacing = 0;\n cmpLine.setLayout(gl);\n cmpLine.setLayoutData(new GridData(GridData.FILL_BOTH));\n }\n liacLine = new LineAttributesComposite(cmpLine, SWT.NONE, context, ((BubbleSeries) series).getLineAttributes(), true, true, true);\n GridData gdLIACLine = new GridData(GridData.FILL_HORIZONTAL);\n gdLIACLine.horizontalSpan = 2;\n liacLine.setLayoutData(gdLIACLine);\n liacLine.addListener(this);\n Composite cmpShadow = new Composite(cmpLine, SWT.NONE);\n {\n GridLayout gl = new GridLayout(2, false);\n gl.marginHeight = 0;\n gl.marginBottom = 0;\n gl.verticalSpacing = 0;\n cmpShadow.setLayout(gl);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 2;\n cmpShadow.setLayoutData(gd);\n }\n lblShadow = new Label(cmpShadow, SWT.NONE);\n lblShadow.setText(Messages.getString(\"String_Node_Str\"));\n int iFillOption = FillChooserComposite.DISABLE_PATTERN_FILL | FillChooserComposite.ENABLE_TRANSPARENT | FillChooserComposite.ENABLE_TRANSPARENT_SLIDER;\n fccShadow = new FillChooserComposite(cmpShadow, SWT.DROP_DOWN | SWT.READ_ONLY, iFillOption, context, ((BubbleSeries) series).getShadowColor());\n GridData gdFCCShadow = new GridData(GridData.FILL_HORIZONTAL);\n fccShadow.setLayoutData(gdFCCShadow);\n fccShadow.addListener(this);\n Composite cmp = new Composite(grpLine, SWT.NONE);\n cmp.setLayout(new GridLayout());\n btnPalette = new Button(cmp, SWT.CHECK);\n {\n btnPalette.setText(Messages.getString(\"String_Node_Str\"));\n btnPalette.setSelection(((BubbleSeries) series).isPaletteLineColor());\n btnPalette.addSelectionListener(this);\n }\n btnCurve = new Button(cmp, SWT.CHECK);\n {\n btnCurve.setText(Messages.getString(\"String_Node_Str\"));\n btnCurve.setSelection(((BubbleSeries) series).isCurve());\n btnCurve.addSelectionListener(this);\n }\n enableLineSettings(((BubbleSeries) series).getLineAttributes().isVisible());\n enableAccLineSettings(((BubbleSeries) series).getAccLineAttributes().isVisible());\n populateLists();\n}\n"
|
"public TezRawKeyValueIterator getIterator() throws IOException, InterruptedException {\n if (this.numInputs == 0) {\n return new TezRawKeyValueIterator() {\n public DataInputBuffer getKey() throws IOException {\n throw new RuntimeException(\"String_Node_Str\");\n }\n public DataInputBuffer getValue() throws IOException {\n throw new RuntimeException(\"String_Node_Str\");\n }\n public boolean next() throws IOException {\n return false;\n }\n public void close() throws IOException {\n }\n public Progress getProgress() {\n progress.complete();\n return progress;\n }\n };\n }\n }\n waitForInputReady();\n return rawIter;\n}\n"
|
"public void computeScroll() {\n super.computeScroll();\n if (mScroller.isFinished()) {\n if (mCurrentFlingDirection != Direction.NONE) {\n goToNearestOrigin();\n }\n } else {\n if (mCurrentFlingDirection != Direction.NONE && forceFinishScroll()) {\n goToNearestOrigin();\n } else if (mScroller.computeScrollOffset()) {\n mCurrentOrigin.y = mScroller.getCurrY();\n mCurrentOrigin.x = mScroller.getCurrX();\n ViewCompat.postInvalidateOnAnimation(this);\n }\n }\n}\n"
|
"private void writePropertyValue(final ServiceMetadata metadata, final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final String xml10InvalidCharReplacement, final XMLStreamWriter writer) throws XMLStreamException, SerializerException {\n try {\n if (edmProperty.isPrimitive() || edmProperty.getType().getKind() == EdmTypeKind.ENUM || edmProperty.getType().getKind() == EdmTypeKind.DEFINITION) {\n if (edmProperty.isCollection()) {\n writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE, edmProperty.isPrimitive() ? \"String_Node_Str\" + edmProperty.getType().getName() + \"String_Node_Str\" : collectionType(edmProperty.getType()));\n writePrimitiveCollection((EdmPrimitiveType) edmProperty.getType(), property, edmProperty.isNullable(), edmProperty.getMaxLength(), edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(), xml10InvalidCharReplacement, writer);\n } else {\n writePrimitive((EdmPrimitiveType) edmProperty.getType(), property, edmProperty.isNullable(), edmProperty.getMaxLength(), edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(), xml10InvalidCharReplacement, writer);\n }\n } else if (property.isComplex()) {\n if (edmProperty.isCollection()) {\n writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE, collectionType(edmProperty.getType()));\n writeComplexCollection(metadata, (EdmComplexType) edmProperty.getType(), property, selectedPaths, xml10InvalidCharReplacement, writer);\n } else {\n writeComplex(metadata, edmProperty, property, selectedPaths, xml10InvalidCharReplacement, writer);\n }\n } else {\n throw new SerializerException(\"String_Node_Str\", SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, edmProperty.getName());\n }\n } catch (final EdmPrimitiveTypeException e) {\n throw new SerializerException(\"String_Node_Str\", e, SerializerException.MessageKeys.WRONG_PROPERTY_VALUE, edmProperty.getName(), property.getValue().toString());\n }\n}\n"
|
"public void refresh() {\n for (TreeObject obj : checkItems) {\n if (obj instanceof TreeParent) {\n repositoryNodes.addAll(Util.getChildrenObj((TreeParent) obj));\n else\n repositoryNodes.add(obj);\n }\n ((CheckboxTreeViewer) viewer).setCheckedElements(repositoryNodes.toArray());\n}\n"
|
"public void gdVerifyValueInRow(final String row, final String rowOperator, final String value, final String operator, final String searchType, boolean exists) throws StepExecutionException {\n final int implRow = getRowFromString(row, rowOperator);\n Boolean valueExists = Boolean.TRUE;\n if (implRow == -1) {\n valueExists = (Boolean) getEventThreadQueuer().invokeAndWait(\"String_Node_Str\", new IRunnable() {\n public Object run() throws StepExecutionException {\n for (int k = getStartingColIndex(searchType); k < m_table.getColumnCount(); ++k) {\n String header = m_table.getColumnName(k);\n if (MatchUtil.getInstance().match(header, value, operator)) {\n return new Boolean(true);\n }\n }\n return new Boolean(false);\n }\n });\n } else {\n valueExists = (Boolean) getEventThreadQueuer().invokeAndWait(\"String_Node_Str\", new IRunnable() {\n public Object run() throws StepExecutionException {\n for (int i = getStartingColIndex(searchType); i < m_table.getColumnCount(); ++i) {\n if (MatchUtil.getInstance().match(m_table.getValueAt(implRow, i).toString(), value, operator)) {\n return new Boolean(true);\n }\n }\n return new Boolean(false);\n }\n });\n }\n Verifier.equals(exists, valueExists.booleanValue());\n}\n"
|
"public List<ReplicaAccounting> getReplicaAccountings(long requestId) {\n return replicaAccountings.containsKey(requestId) ? new LinkedList<ReplicaAccounting>(replicaAccountings.get(requestId)) : new LinkedList<ReplicaAccounting>();\n}\n"
|
"public static FormInstance loadFixtureForUser(String refId, String userId) {\n IStorageUtilityIndexed storage = (IStorageUtilityIndexed) StorageManager.getStorage(FormInstance.STORAGE_KEY);\n FormInstance fixture = null;\n Vector<Integer> relevantFixtures = storage.getIDsForValue(FormInstance.META_ID, refId);\n if (relevantFixtures.size() == 1) {\n fixture = (FormInstance) storage.read(relevantFixtures.elementAt(0).intValue());\n } else if (relevantFixtures.size() > 1) {\n Vector<Integer> relevantUserFixtures = storage.getIDsForValue(FormInstance.META_XMLNS, userId);\n if (relevantUserFixtures.size() != 0) {\n Integer userFixture = ArrayUtilities.intersectSingle(relevantFixtures, relevantUserFixtures);\n if (userFixture != null) {\n fixture = (FormInstance) storage.read(userFixture.intValue());\n }\n }\n if (fixture == null) {\n Integer globalFixture = ArrayUtilities.intersectSingle(storage.getIDsForValue(FormInstance.META_XMLNS, \"String_Node_Str\"), relevantFixtures);\n if (globalFixture == null) {\n return null;\n }\n fixture = (FormInstance) storage.read(globalFixture.intValue());\n }\n } else {\n return null;\n }\n return fixture;\n}\n"
|
"public Object convertFromString(Map ctx, String[] value, Class arg2) {\n if (value[0] == null || value[0].trim().equals(\"String_Node_Str\")) {\n return null;\n }\n try {\n return DateUtil.convertStringToDate(value[0]);\n } catch (ParseException pe) {\n pe.printStackTrace();\n throw new TypeConversionException(pe.getMessage());\n }\n return null;\n}\n"
|
"private Boundary getExampleBoundary() {\n List<BoundaryPart> bpl = new ArrayList<BoundaryPart>();\n BoundaryPart bp;\n Edge cstr;\n List<Edge> boundaryEdges;\n Boundary bound = new Boundary();\n cstr = null;\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(0, 1, 0, 3, 2, 0));\n bp = new BoundaryPart(boundaryEdges);\n bpl.add(bp);\n cstr = new Edge(3, 2, 0, 9, 0, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(3, 2, 0, 5, 3, 0));\n boundaryEdges.add(new Edge(5, 3, 0, 6, 5, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n cstr = new Edge(6, 5, 0, 10, 5, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(6, 5, 0, 7, 7, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n cstr = new Edge(7, 7, 0, 10, 7, 0);\n boundaryEdges = new ArrayList<Edge>();\n bp = new BoundaryPart(cstr);\n bpl.add(bp);\n cstr = new Edge(7, 7, 0, 10, 9, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(7, 7, 0, 6, 10, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n cstr = new Edge(6, 10, 0, 9, 12, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(6, 10, 0, 5, 11, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n cstr = new Edge(5, 11, 0, 9, 12, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(5, 11, 0, 3, 12, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n cstr = new Edge(3, 12, 0, 9, 12, 0);\n boundaryEdges = new ArrayList<Edge>();\n boundaryEdges.add(new Edge(3, 12, 0, 0, 13, 0));\n bp = new BoundaryPart(boundaryEdges, cstr);\n bpl.add(bp);\n bound.setBoundary(bpl);\n return bound;\n}\n"
|
"public static void awaitSync() {\n boolean b = canProceed();\n if (b)\n return;\n try {\n if (!latch.await(200, TimeUnit.MILLISECONDS)) {\n TridentLogger.get().warn(\"String_Node_Str\" + complete.sum() + \"String_Node_Str\" + expected.sum() + \"String_Node_Str\" + b);\n if (DEBUG) {\n TridentLogger.get().warn(\"String_Node_Str\");\n TridentLogger.get().warn(\"String_Node_Str\");\n completed.forEach(s -> TridentLogger.get().warn(s));\n TridentLogger.get().warn(\"String_Node_Str\");\n TridentLogger.get().warn(\"String_Node_Str\");\n TridentLogger.get().warn(\"String_Node_Str\");\n expect.forEach(TridentLogger::warn);\n TridentLogger.get().warn(\"String_Node_Str\");\n TridentLogger.get().warn(\"String_Node_Str\" + TridentServer.instance().mainThread().getAverageTickLength() + \"String_Node_Str\");\n } else {\n TridentLogger.get().warn(\"String_Node_Str\");\n }\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n}\n"
|
"public static String getBodyForUpdateChatNotificationMessage(Context context, QBMessage chatMessage) {\n String occupantsIds = chatMessage.getProperty(PROPERTY_OCCUPANTS_IDS);\n String dialogName = chatMessage.getProperty(PROPERTY_ROOM_NAME);\n String photoUrl = chatMessage.getProperty(PROPERTY_ROOM_PHOTO);\n String leave = chatMessage.getProperty(PROPERTY_ROOM_LEAVE);\n String notificationType = chatMessage.getProperty(PROPERTY_NOTIFICATION_TYPE);\n Resources resources = context.getResources();\n String resultMessage = resources.getString(R.string.cht_notification_message);\n QBUser user = AppSession.getSession().getUser();\n boolean ownMessage = user.getId().equals(chatMessage.getSenderId());\n if (notificationType.equals(PROPERTY_TYPE_TO_GROUP_CHAT__GROUP_CHAT_CREATE)) {\n String fullNames;\n if (ownMessage) {\n fullNames = ChatUtils.getFullNamesFromOpponentId(context, user, occupantsIds);\n resultMessage = resources.getString(R.string.cht_update_group_added_message, user.getFullName(), fullNames);\n } else {\n fullNames = ChatUtils.getFullNamesFromOpponentIds(context, occupantsIds);\n resultMessage = resources.getString(R.string.cht_update_group_added_message, ChatUtils.getFullNameById(context, chatMessage.getSenderId()), fullNames);\n }\n return resultMessage;\n }\n if (!TextUtils.isEmpty(occupantsIds)) {\n String fullNames = ChatUtils.getFullNamesFromOpponentIds(context, occupantsIds);\n resultMessage = ownMessage ? resources.getString(R.string.cht_update_group_added_message, user.getFullName(), fullNames) : resources.getString(R.string.cht_update_group_added_message, ChatUtils.getFullNameById(context, chatMessage.getSenderId()), fullNames);\n }\n if (!TextUtils.isEmpty(dialogName)) {\n resultMessage = ownMessage ? resources.getString(R.string.cht_update_group_name_message, user.getFullName(), dialogName) : resources.getString(R.string.cht_update_group_name_message, ChatUtils.getFullNameById(context, chatMessage.getSenderId()), dialogName);\n }\n if (!TextUtils.isEmpty(photoUrl)) {\n resultMessage = ownMessage ? resources.getString(R.string.cht_update_group_photo_message, user.getFullName()) : resources.getString(R.string.cht_update_group_photo_message, ChatUtils.getFullNameById(context, chatMessage.getSenderId()));\n }\n if (!TextUtils.isEmpty(leave)) {\n resultMessage = ownMessage ? resources.getString(R.string.cht_update_group_leave_message, user.getFullName()) : resources.getString(R.string.cht_update_group_leave_message, ChatUtils.getFullNameById(context, chatMessage.getSenderId()));\n }\n return resultMessage;\n}\n"
|
"public void closePage(IContent[] contentList, IContentEmitter emitter) {\n int length = contentList.length;\n if (length > 0) {\n for (int i = 0; i < length; i++) {\n AbstractNode node = (AbstractNode) nodeList[i];\n endContainer(node.content, false, node.emitter, true);\n }\n }\n finished = true;\n}\n"
|
"private Time _fireContainerAt(Time time) throws IllegalActionException {\n Actor container = (Actor) _director.getContainer();\n if (container != null) {\n Director director = container.getExecutiveDirector();\n if (director != null) {\n Time result = director.fireAt(container, time);\n if (!result.equals(time)) {\n throw new IllegalActionException(_director, director.getName() + \"String_Node_Str\" + container.getName() + \"String_Node_Str\" + time + \"String_Node_Str\" + result);\n }\n return result;\n }\n }\n return new Time((Director) _director, Double.NEGATIVE_INFINITY);\n}\n"
|
"private void initialiseHeader() throws IOException {\n if (casMagicOffset(UNINITIALISED, BUILDING)) {\n buildHeader();\n }\n readHeader();\n}\n"
|
"public static soot.Local getThis(soot.Type sootType, soot.Body body, HashMap getThisMap, LocalGenerator lg) {\n if (InitialResolver.v().hierarchy() == null) {\n InitialResolver.v().hierarchy(new soot.FastHierarchy());\n }\n soot.FastHierarchy fh = InitialResolver.v().hierarchy();\n if (getThisMap.containsKey(sootType)) {\n return (soot.Local) getThisMap.get(sootType);\n }\n soot.Local specialThisLocal = body.getThisLocal();\n if (specialThisLocal.getType().equals(sootType)) {\n getThisMap.put(sootType, specialThisLocal);\n return specialThisLocal;\n }\n if (bodyHasLocal(body, sootType)) {\n soot.Local l = getLocalOfType(body, sootType);\n getThisMap.put(sootType, l);\n return l;\n }\n soot.SootClass classToInvoke = ((soot.RefType) specialThisLocal.getType()).getSootClass();\n soot.SootField outerThisField = classToInvoke.getFieldByName(\"String_Node_Str\");\n soot.Local t1 = lg.generateLocal(outerThisField.getType());\n soot.jimple.FieldRef fieldRef = soot.jimple.Jimple.v().newInstanceFieldRef(specialThisLocal, outerThisField);\n soot.jimple.AssignStmt fieldAssignStmt = soot.jimple.Jimple.v().newAssignStmt(t1, fieldRef);\n body.getUnits().add(fieldAssignStmt);\n if (fh.canStoreType(t1.getType(), sootType)) {\n getThisMap.put(sootType, t1);\n return t1;\n }\n soot.Local t2 = t1;\n return getThisGivenOuter(sootType, getThisMap, body, lg, t2);\n}\n"
|
"private void setStreamVolumeInt(int streamType, int index, boolean force) {\n VolumeStreamState streamState = mStreamStates[streamType];\n if (streamState.setIndex(index, lastAudible) || force) {\n if (streamState.muteCount() == 0) {\n sendMsg(mAudioHandler, MSG_SET_SYSTEM_VOLUME, streamType, SENDMSG_NOOP, 0, 0, streamState, 0);\n }\n }\n}\n"
|
"public int getPagePosition(String path) {\n return mPageAdapter.getPositionForTag(path);\n}\n"
|
"protected void runInternal(final String[] args, final List<IngestTypePluginProviderSpi<?, ?>> pluginProviders) {\n final Map<String, LocalFileIngestPlugin<?>> localFileIngestPlugins = new HashMap<String, LocalFileIngestPlugin<?>>();\n final List<WritableDataAdapter<?>> adapters = new ArrayList<WritableDataAdapter<?>>();\n for (final IngestTypePluginProviderSpi<?, ?> pluginProvider : pluginProviders) {\n LocalFileIngestPlugin<?> localFileIngestPlugin = null;\n try {\n localFileIngestPlugin = pluginProvider.getLocalFileIngestPlugin();\n if (localFileIngestPlugin == null) {\n LOGGER.warn(\"String_Node_Str\" + pluginProvider.getIngestTypeName() + \"String_Node_Str\");\n continue;\n }\n } catch (final UnsupportedOperationException e) {\n LOGGER.warn(\"String_Node_Str\" + pluginProvider.getIngestTypeName() + \"String_Node_Str\", e);\n continue;\n }\n final Index[] supportedIndices = localFileIngestPlugin.getSupportedIndices();\n final Index selectedIndex = accumulo.getPrimaryIndex();\n boolean indexSupported = false;\n for (final Index i : supportedIndices) {\n if (i.getId().equals(selectedIndex.getId())) {\n indexSupported = true;\n break;\n }\n }\n if (!indexSupported) {\n LOGGER.warn(\"String_Node_Str\" + pluginProvider.getIngestTypeName() + \"String_Node_Str\" + StringUtils.stringFromBinary(selectedIndex.getId().getBytes()) + \"String_Node_Str\");\n continue;\n }\n localFileIngestPlugins.put(pluginProvider.getIngestTypeName(), localFileIngestPlugin);\n adapters.addAll(Arrays.asList(localFileIngestPlugin.getDataAdapters(accumulo.getVisibility())));\n }\n final AccumuloOperations operations = accumulo.getAccumuloOperations();\n if (localFileIngestPlugins.isEmpty()) {\n LOGGER.fatal(\"String_Node_Str\");\n return;\n }\n final DataStore dataStore = new AccumuloDataStore(operations);\n try (IndexWriter indexWriter = dataStore.createIndexWriter(accumulo.getPrimaryIndex())) {\n processInput(localFileIngestPlugins, new IngestRunData(indexWriter, adapters));\n } catch (final IOException e) {\n LOGGER.fatal(\"String_Node_Str\", e);\n } finally {\n if (indexWriter != null) {\n indexWriter.close();\n }\n }\n}\n"
|
"private void testMin(Method m) throws InvocationTargetException, IllegalAccessException {\n Class[] paramTypes = m.getParameterTypes();\n ImageBase input = GeneralizedImageOps.createImage(paramTypes[0], width, height, numBands);\n if (input.getImageType().getDataType().isSigned()) {\n GImageMiscOps.fillUniform(input, rand, -20, -5);\n GeneralizedImageOps.setB(input, 0, 3, 0, -30);\n Number o = (Number) m.invoke(null, input);\n assertEquals(-30, o.doubleValue(), 1e-8);\n } else {\n double maxValue = input.getImageType().getDataType().getMaxValue();\n GImageMiscOps.fillUniform(input, rand, 100, maxValue);\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n double before = GeneralizedImageOps.get(input, x, y, 0);\n GeneralizedImageOps.setB(input, x, y, 0, 5);\n Number o = (Number) m.invoke(null, input);\n assertEquals(5, o.doubleValue(), 1e-8);\n GeneralizedImageOps.setB(input, x, y, 0, before);\n }\n }\n }\n}\n"
|
"private void insertBrInEmptyParagraphs(Node node) {\n if (node == null || !Element.is(node)) {\n return;\n }\n if (node.getNodeName().equalsIgnoreCase(\"String_Node_Str\") && node.getChildCount() == 0) {\n node.appendChild(Document.get().createBRElement());\n }\n NodeList children = node.getChildNodes();\n for (int i = 0; i < children.getLength(); i++) {\n insertBrInEmptyParagraphs(children.getItem(i));\n }\n}\n"
|
"private void buildRowLimitAndOffset(StringBuffer queryBuf, List params) {\n if (limit > 0 || offset > 0) {\n queryBuf.insert(0, \"String_Node_Str\");\n queryBuf.append(\"String_Node_Str\");\n }\n if (limit > 0) {\n queryBuf.append(\"String_Node_Str\");\n if (offset > 0)\n params.add(new Integer(limit + offset));\n else\n params.add(new Integer(limit));\n }\n if (offset > 0) {\n queryBuf.insert(0, \"String_Node_Str\");\n queryBuf.append(\"String_Node_Str\");\n params.add(new Integer(offset));\n }\n}\n"
|
"public byte[] readRecord(byte[] reusable, byte[] bytes, int offset, int numBytes) throws IOException {\n if (reusable != null && reusable.length == this.recordLength) {\n System.arraycopy(bytes, readOffset, reusable, 0, numBytes);\n return reusable;\n } else {\n byte[] tmp = new byte[this.recordLength];\n System.arraycopy(bytes, offset, tmp, 0, numBytes);\n return tmp;\n }\n}\n"
|
"public void drawBackgroundColor(Color color, float x, float y, float width, float height) {\n if (color != null) {\n writer.fillRect(convertToPoint(x), convertToPoint(y), convertToPoint(width), convertToPoint(height), color);\n }\n}\n"
|
"protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {\n if (!c.isEnabled()) {\n return;\n }\n boolean leftToRight = c.getComponentOrientation().isLeftToRight();\n g.translate(thumbBounds.x, thumbBounds.y);\n int imgWidth;\n int imgHeight;\n int indentWidth = 10;\n if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {\n if (!isFreeStanding) {\n thumbBounds.width += 2;\n if (!leftToRight) {\n g.translate(-1, 0);\n }\n }\n imgWidth = verticalThumb.getWidth();\n imgHeight = verticalThumb.getHeight();\n Image topImage = verticalThumb.getSubimage(0, 0, imgWidth, indentWidth);\n Image middleImage = verticalThumb.getSubimage(0, indentWidth, imgWidth, imgHeight - 2 * indentWidth);\n Image bottomImage = verticalThumb.getSubimage(0, imgHeight - indentWidth, imgWidth, indentWidth);\n g.drawImage(topImage, 0, 0, thumbBounds.width - 2, indentWidth, null);\n g.drawImage(middleImage, thumbBounds.x, indentWidth, thumbBounds.width - 2, thumbBounds.height - indentWidth, null);\n g.drawImage(bottomImage, thumbBounds.x, thumbBounds.height - indentWidth, thumbBounds.width - 2, indentWidth, null);\n g.drawImage(verticalThumbHandle, thumbBounds.width / 2 - verticalThumbHandle.getWidth() / 2, thumbBounds.height / 2 - verticalThumbHandle.getHeight() / 2, verticalThumbHandle.getWidth(), verticalThumbHandle.getHeight(), null);\n if (!isFreeStanding) {\n thumbBounds.width -= 2;\n if (!leftToRight) {\n g.translate(1, 0);\n }\n }\n } else {\n if (!isFreeStanding) {\n thumbBounds.height += 2;\n }\n imgWidth = horizontalThumb.getWidth();\n imgHeight = horizontalThumb.getHeight();\n Image leftImage = horizontalThumb.getSubimage(0, 0, indentWidth, imgHeight);\n Image middleImage = horizontalThumb.getSubimage(indentWidth, 0, imgWidth - 2 * indentWidth, imgHeight);\n Image rightImage = horizontalThumb.getSubimage(imgWidth - indentWidth, 0, indentWidth, imgHeight);\n g.drawImage(leftImage, 0, 0, indentWidth, thumbBounds.height - 2, null);\n g.drawImage(middleImage, indentWidth, thumbBounds.y, thumbBounds.width - indentWidth, thumbBounds.height - 2, null);\n g.drawImage(rightImage, thumbBounds.width - indentWidth, thumbBounds.y, indentWidth, thumbBounds.height - 2, null);\n g.drawImage(horizontalThumbHandle, thumbBounds.width / 2 - horizontalThumbHandle.getWidth() / 2, thumbBounds.height / 2 - horizontalThumbHandle.getHeight() / 2, horizontalThumbHandle.getWidth(), horizontalThumbHandle.getHeight(), null);\n if (!isFreeStanding) {\n thumbBounds.height -= 2;\n }\n }\n g.translate(-thumbBounds.x, -thumbBounds.y);\n}\n"
|
"public File generateFile(TemplateMaker maker, String name, String modelPath, String format, List<BirtTemplateParameter> birtTemplateParameterList) throws AxelorException {\n if (modelPath == null || modelPath.isEmpty()) {\n return null;\n }\n ReportSettings reportSettings = new ReportSettings(modelPath, format);\n for (BirtTemplateParameter birtTemplateParameter : birtTemplateParameterList) {\n maker.setTemplate(birtTemplateParameter.getValue());\n reportSettings.addParam(birtTemplateParameter.getName(), maker.make());\n }\n String url = reportSettings.getUrl();\n log.debug(\"String_Node_Str\", url);\n String urlNotExist = URLService.notExist(url.toString());\n if (urlNotExist != null) {\n throw new AxelorException(String.format(I18n.get(IExceptionMessage.TEMPLATE_MESSAGE_BASE_1)), IException.CONFIGURATION_ERROR);\n }\n final int random = new Random().nextInt();\n String fileName = name + \"String_Node_Str\" + random + \"String_Node_Str\" + format;\n try {\n return URLService.fileDownload(url, UPLOAD_PATH, fileName);\n } catch (IOException e) {\n throw new AxelorException(String.format(I18n.get(IExceptionMessage.TEMPLATE_MESSAGE_BASE_2), e), IException.CONFIGURATION_ERROR);\n }\n}\n"
|
"public void testEnumLiteral() {\n LiteralExpression result = (LiteralExpression) parse(\"String_Node_Str\");\n assertEquals(new LiteralExpression(\"String_Node_Str\", \"String_Node_Str\"), result);\n}\n"
|
"private void mayAddPropToPrototype(RawNominalType rawType, String pname, Node defSite, Node initializer) {\n NTIScope methodScope = null;\n DeclaredFunctionType methodType = null;\n JSType propDeclType = null;\n JSDocInfo jsdoc = NodeUtil.getBestJSDocInfo(defSite);\n if (initializer != null && initializer.isFunction()) {\n methodScope = visitFunctionLate(initializer, rawType);\n methodType = methodScope.getDeclaredFunctionType();\n if (defSite.isGetterDef()) {\n pname = getCommonTypes().createGetterPropName(pname);\n } else if (defSite.isSetterDef()) {\n pname = getCommonTypes().createSetterPropName(pname);\n }\n } else if (jsdoc != null && jsdoc.containsFunctionDeclaration() && !defSite.isStringKey()) {\n methodType = computeFnDeclaredType(jsdoc, pname, defSite, rawType, currentScope);\n }\n if (jsdoc != null && jsdoc.hasType()) {\n propDeclType = getTypeParser().getDeclaredTypeOfNode(jsdoc, rawType, currentScope);\n } else if (methodType != null) {\n propDeclType = getCommonTypes().fromFunctionType(methodType.toFunctionType());\n }\n if (defSite.isGetterDef() && propDeclType != null) {\n FunctionType ft = propDeclType.getFunTypeIfSingletonObj();\n if (ft != null) {\n propDeclType = ft.getReturnType();\n }\n }\n PropertyDef def = new PropertyDef(defSite, methodType, methodScope);\n propertyDefs.put(rawType, pname, def);\n if (methodType != null && methodType.isAbstract() && !rawType.isAbstractClass()) {\n if (rawType.isClass()) {\n warnings.add(JSError.make(defSite, ABSTRACT_METHOD_IN_CONCRETE_CLASS, rawType.getName()));\n } else if (rawType.isInterface()) {\n warnings.add(JSError.make(defSite, ABSTRACT_METHOD_IN_INTERFACE));\n }\n }\n boolean isConst = isConst(defSite);\n if (propDeclType != null || isConst) {\n if (mayWarnAboutExistingProp(rawType, pname, defSite, propDeclType)) {\n return;\n }\n if (propDeclType == null) {\n propDeclType = mayInferFromRhsIfConst(defSite);\n }\n rawType.addProtoProperty(pname, defSite, propDeclType, isConst);\n if (defSite.isGetProp()) {\n defSite.putBooleanProp(Node.ANALYZED_DURING_GTI, true);\n if (isConst) {\n defSite.putBooleanProp(Node.CONSTANT_PROPERTY_DEF, true);\n }\n }\n } else {\n JSType inferredType = null;\n if (initializer != null) {\n inferredType = simpleInferExpr(initializer, this.currentScope);\n }\n if (inferredType == null) {\n inferredType = getCommonTypes().UNKNOWN;\n }\n rawType.addUndeclaredProtoProperty(pname, defSite, inferredType);\n }\n}\n"
|
"public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, CoreAbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {\n if (null == value) {\n return false;\n }\n boolean wasXMLRoot = false;\n XPathFragment xmlRootFragment = null;\n Object originalValue = value;\n Descriptor descriptor;\n TreeObjectBuilder objectBuilder;\n CoreAbstractSession childSession;\n XMLMarshaller marshaller = marshalRecord.getMarshaller();\n XPathFragment rootFragment;\n if (xmlAnyCollectionMapping.usesXMLRoot() && (value instanceof XMLRoot)) {\n xmlRootFragment = new XPathFragment();\n xmlRootFragment.setNamespaceAware(marshalRecord.isNamespaceAware());\n wasXMLRoot = true;\n value = ((XMLRoot) value).getObject();\n if (null == value) {\n return false;\n }\n }\n UnmarshalKeepAsElementPolicy keepAsElementPolicy = xmlAnyCollectionMapping.getKeepAsElementPolicy();\n if (value instanceof String) {\n marshalSimpleValue(xmlRootFragment, marshalRecord, originalValue, object, value, session, namespaceResolver);\n } else if (((keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) && value instanceof org.w3c.dom.Node) {\n marshalRecord.node((org.w3c.dom.Node) value, marshalRecord.getNamespaceResolver());\n } else {\n try {\n childSession = marshaller.getXMLContext().getSession(value);\n } catch (XMLMarshalException e) {\n marshalSimpleValue(xmlRootFragment, marshalRecord, originalValue, object, value, session, namespaceResolver);\n return true;\n }\n descriptor = (XMLDescriptor) childSession.getDescriptor(value);\n objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder();\n List extraNamespaces = objectBuilder.addExtraNamespacesToNamespaceResolver(descriptor, marshalRecord, session, true, true);\n if (wasXMLRoot) {\n Namespace generatedNamespace = setupFragment(((XMLRoot) originalValue), xmlRootFragment, marshalRecord);\n if (generatedNamespace != null) {\n if (extraNamespaces == null) {\n extraNamespaces = new java.util.ArrayList();\n }\n extraNamespaces.add(generatedNamespace);\n }\n }\n String defaultRootElementString = descriptor.getDefaultRootElement();\n if (!wasXMLRoot && (defaultRootElementString == null)) {\n AbstractSessionLog.getLog().log(SessionLog.WARNING, \"String_Node_Str\", new Object[] { Helper.getShortClassName(this.getClass()), descriptor });\n } else {\n marshalRecord.beforeContainmentMarshal(value);\n if (xmlRootFragment != null) {\n rootFragment = xmlRootFragment;\n } else {\n rootFragment = new XPathFragment(defaultRootElementString);\n if (rootFragment.getNamespaceURI() == null) {\n String uri = descriptor.getNonNullNamespaceResolver().resolveNamespacePrefix(rootFragment.getPrefix());\n rootFragment.setNamespaceURI(uri);\n }\n }\n if (!wasXMLRoot) {\n marshalRecord.setLeafElementType(descriptor.getDefaultRootElementType());\n }\n getXPathNode().startElement(marshalRecord, rootFragment, object, childSession, marshalRecord.getNamespaceResolver(), objectBuilder, value);\n writeExtraNamespaces(extraNamespaces, marshalRecord, session);\n objectBuilder.addXsiTypeAndClassIndicatorIfRequired(marshalRecord, descriptor, descriptor, (XMLField) xmlAnyCollectionMapping.getField(), originalValue, value, wasXMLRoot, false);\n objectBuilder.buildRow(marshalRecord, value, session, marshaller, null, WriteType.UNDEFINED);\n marshalRecord.afterContainmentMarshal(object, value);\n marshalRecord.endElement(rootFragment, namespaceResolver);\n objectBuilder.removeExtraNamespacesFromNamespaceResolver(marshalRecord, extraNamespaces, session);\n }\n }\n return true;\n}\n"
|
"public void testQuery17() throws InterruptedException {\n log.info(\"String_Node_Str\");\n String clusterName = \"String_Node_Str\";\n SiddhiManager siddhiManager = new SiddhiManager();\n String tables = \"String_Node_Str\" + \"String_Node_Str\" + clusterName + \"String_Node_Str\" + \"String_Node_Str\";\n ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(tables);\n try {\n Map<String, HazelcastInstance> instanceMap = new HashMap<String, HazelcastInstance>();\n for (HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {\n instanceMap.put(hci.getName(), hci);\n }\n Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));\n HazelcastInstance instance = instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());\n Assert.assertEquals(clusterName, instance.getConfig().getGroupConfig().getName());\n } finally {\n executionPlanRuntime.shutdown();\n }\n Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));\n HazelcastInstance instance = instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());\n Assert.assertEquals(clusterName, instance.getConfig().getGroupConfig().getName());\n executionPlanRuntime.shutdown();\n}\n"
|
"public void handle(Message inputMessage, ISendMessageCallback callback, boolean unitOfWorkBoundaryReached) {\n if ((PER_UNIT_OF_WORK.equals(runWhen) && inputMessage instanceof ControlMessage) || (!PER_UNIT_OF_WORK.equals(runWhen) && !(inputMessage instanceof ControlMessage))) {\n IDirectory streamable = getResourceReference();\n Map<String, Serializable> outputMessageHeaders = new HashMap<String, Serializable>();\n httpHeaders = getHttpHeaderConfigEntries(inputMessage);\n httpParameters = getHttpParameterConfigEntries(inputMessage);\n assembleRelativePathPlusParameters();\n ArrayList<String> outputPayload = new ArrayList<String>();\n ArrayList<String> inputPayload = new ArrayList<String>();\n if (bodyFrom.equals(\"String_Node_Str\") && inputMessage instanceof TextMessage) {\n inputPayload = ((TextMessage) inputMessage).getPayload();\n } else {\n inputPayload.add(bodyText);\n }\n if (inputPayload != null) {\n try {\n String path = resolveParamsAndHeaders(relativePath, inputMessage);\n for (String requestContent : inputPayload) {\n getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);\n if (parameterReplacement) {\n resolveHttpHeaderVars(httpHeaders, inputMessage);\n requestContent = resolveParamsAndHeaders(requestContent, inputMessage);\n }\n if (isNotBlank(requestContent)) {\n info(\"String_Node_Str\", path);\n OutputStream os = streamable.getOutputStream(path, false, false, false, httpHeaders, httpParameters);\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, DEFAULT_CHARSET));\n try {\n writer.write(requestContent);\n } finally {\n writer.close();\n if (os instanceof IOutputStreamWithResponse) {\n String response = ((IOutputStreamWithResponse) os).getResponse();\n if (response != null) {\n outputPayload.add(response);\n }\n }\n }\n } else {\n info(\"String_Node_Str\", path);\n HttpInputStream is = (HttpInputStream) streamable.getInputStream(path, false, false, httpHeaders, httpParameters);\n Map<String, List<String>> responseHdrs = is.getHttpConnection().getHeaderFields();\n outputMessageHeaders.putAll(convertResponseHdrsToMsgHeaders(responseHdrs));\n try {\n String response = IOUtils.toString(is);\n if (response != null) {\n outputPayload.add(response);\n }\n } finally {\n IOUtils.closeQuietly(is);\n }\n }\n }\n if (outputPayload.size() > 0) {\n callback.sendTextMessage(outputMessageHeaders, outputPayload);\n }\n } catch (IOException e) {\n throw new IoException(String.format(\"String_Node_Str\", streamable), e);\n }\n }\n } else if (context.getManipulatedFlow().findStartSteps().contains(context.getFlowStep()) && !PER_UNIT_OF_WORK.equals(runWhen)) {\n warn(\"String_Node_Str\", runWhen, PER_UNIT_OF_WORK);\n }\n}\n"
|
"public void testEraseFileEvenInstructionValidOffset() throws Exception {\n ProcessingData processingData = new ProcessingData();\n byte[] apduBytes = new byte[] { 0x00, (byte) 0x0E, 0x00, 0x02 };\n processingData.updateCommandApdu(this, \"String_Node_Str\", CommandApduFactory.createCommandApdu(apduBytes));\n secStatus.updateMechanisms(new SecStatusMechanismUpdatePropagation(SecContext.GLOBAL, new CurrentFileSecMechanism(elementaryFileUnderMf)));\n fileProtocol.process(processingData);\n assertEquals(\"String_Node_Str\", processingData.getResponseApdu().getStatusWord(), Iso7816.SW_9000_NO_ERROR);\n assertArrayEquals(new byte[] { 1, 2, 0, 0, 0, 0 }, elementaryFileContent);\n}\n"
|
"public static <T> T merge(final T newObject) throws ConstraintViolationException, TransactionException, NoSuchElementException {\n if (!isPersistent(newObject)) {\n try {\n return uniqueResult(newObject);\n } catch (Exception ex) {\n LOG.error(ex, ex);\n throw new RuntimeException(ex);\n }\n } else {\n try {\n T persistedObject = getTransaction(newObject).getTxState().getEntityManager().merge(newObject);\n return persistedObject == newObject ? newObject : persistedObject;\n } catch (final RuntimeException ex) {\n PersistenceExceptions.throwFiltered(ex);\n throw ex;\n }\n }\n}\n"
|
"public void restrictedSetPipeline(Pipeline pl) {\n synchronized (this) {\n pl.setBasic(new StandardContextValve());\n pipeline = pl;\n hasCustomPipeline = true;\n }\n}\n"
|
"private void pdb_HEADER_Handler(String line) {\n String classification = null;\n String deposition_date = null;\n String pdbCode = null;\n int len = line.trim().length();\n if (len > 10) {\n classification = line.substring(10, min(len, 50)).trim();\n pdbHeader.setClassification(classification);\n }\n if (len > 50) {\n deposition_date = line.substring(50, max(len, 59)).trim();\n try {\n Date dep = dateFormat.parse(deposition_date);\n pdbHeader.setDepDate(dep);\n } catch (ParseException e) {\n logger.fine(\"String_Node_Str\" + deposition_date + \"String_Node_Str\");\n }\n }\n if (len > 62) {\n pdbCode = line.substring(62, max(len, 66)).trim();\n pdbId = pdbCode;\n if (DEBUG) {\n System.out.println(\"String_Node_Str\" + pdbId);\n }\n structure.setPDBCode(pdbCode);\n pdbHeader.setIdCode(pdbCode);\n }\n if (len > 66) {\n if (pdbId.equals(line.substring(72, 76))) {\n isLegacyFormat = true;\n System.out.println(pdbId + \"String_Node_Str\");\n }\n }\n}\n"
|
"public void fireEvent(final ClockTick event) {\n if (Bootstrap.isFinished() && Topology.isEnabledLocally(LoadBalancing.class) && Topology.isEnabled(Eucalyptus.class)) {\n final EntityTransaction db = Entities.get(LoadBalancerServoInstance.class);\n final LoadBalancerServoInstance sample = LoadBalancerServoInstance.withState(LoadBalancerServoInstance.STATE.Pending.name());\n List<LoadBalancerServoInstance> instances = null;\n try {\n instances = Entities.query(sample);\n db.commit();\n } catch (NoSuchElementException ex) {\n db.rollback();\n } catch (Exception ex) {\n db.rollback();\n LOG.warn(\"String_Node_Str\");\n }\n if (instances == null || instances.size() == 0)\n return;\n final List<String> param = Lists.newArrayList();\n final Map<String, String> latestState = Maps.newHashMap();\n final Map<String, String> addressMap = Maps.newHashMap();\n for (final LoadBalancerServoInstance instance : instances) {\n String instanceId = instance.getInstanceId();\n if (instanceId == null || !instanceId.startsWith(\"String_Node_Str\"))\n continue;\n param.clear();\n param.add(instanceId);\n String instanceState = null;\n String address = null;\n try {\n final List<RunningInstancesItemType> result = EucalyptusActivityTasks.getInstance().describeSystemInstances(param);\n if (result.isEmpty())\n throw new Exception(\"String_Node_Str\");\n instanceState = result.get(0).getStateName();\n address = result.get(0).getIpAddress();\n } catch (final Exception ex) {\n LOG.warn(\"String_Node_Str\", ex);\n continue;\n }\n if (instanceState.equals(\"String_Node_Str\")) {\n latestState.put(instanceId, LoadBalancerServoInstance.STATE.InService.name());\n if (address != null)\n addressMap.put(instanceId, address);\n } else if (instanceState.equals(\"String_Node_Str\")) {\n latestState.put(instanceId, LoadBalancerServoInstance.STATE.Pending.name());\n } else {\n latestState.put(instanceId, LoadBalancerServoInstance.STATE.Error.name());\n }\n }\n List<LoadBalancerServoInstance> newInServiceInstances = Lists.newArrayList();\n for (final String instanceId : latestState.keySet()) {\n String nextState = latestState.get(instanceId);\n if (nextState == \"String_Node_Str\")\n continue;\n final EntityTransaction dbUpdate = Entities.get(LoadBalancerServoInstance.class);\n try {\n final LoadBalancerServoInstance instance = Entities.uniqueResult(LoadBalancerServoInstance.named(instanceId));\n instance.setState(Enum.valueOf(LoadBalancerServoInstance.STATE.class, nextState));\n if (addressMap.containsKey(instanceId))\n instance.setAddress(addressMap.get(instanceId));\n Entities.persist(instance);\n dbUpdate.commit();\n if (nextState.equals(LoadBalancerServoInstance.STATE.InService.name()))\n newInServiceInstances.add(instance);\n } catch (NoSuchElementException ex) {\n dbUpdate.rollback();\n LOG.error(\"String_Node_Str\" + instanceId, ex);\n } catch (Exception ex) {\n dbUpdate.rollback();\n LOG.error(\"String_Node_Str\" + instanceId + \"String_Node_Str\", ex);\n }\n }\n for (LoadBalancerServoInstance servo : newInServiceInstances) {\n final LoadBalancer lb = servo.getAvailabilityZone().getLoadbalancer();\n final LoadBalancerDnsRecord dns = lb.getDns();\n try {\n EucalyptusActivityTasks.getInstance().addARecord(dns.getZone(), dns.getName(), servo.getAddress());\n } catch (Exception ex) {\n LOG.error(\"String_Node_Str\", ex);\n continue;\n }\n final EntityTransaction db2 = Entities.get(LoadBalancerServoInstance.class);\n try {\n LoadBalancerServoInstance update = Entities.uniqueResult(servo);\n update.setDns(dns);\n Entities.persist(update);\n db2.commit();\n } catch (Exception ex) {\n db2.rollback();\n LOG.error(\"String_Node_Str\");\n }\n }\n }\n}\n"
|
"public void widgetSelected(SelectionEvent e) {\n if (((TabItem) e.item) == generalDataUseCaseTab) {\n useCaseMode = EUseCaseMode.UNSPECIFIED_DATA;\n Application.bLoadPathwayData = false;\n } else if (((TabItem) e.item) == geneticDataUseCaseTab)\n useCaseMode = EUseCaseMode.GENETIC_DATA;\n else\n throw new IllegalStateException(\"String_Node_Str\");\n}\n"
|
"private void copyElementParametersValue(IElement sourceElement, IElement targetElement) {\n for (IElementParameter sourceParam : sourceElement.getElementParameters()) {\n IElementParameter targetParam = targetElement.getElementParameter(sourceParam.getName());\n if (targetParam != null) {\n if (sourceParam.getName().equals(EParameterName.DB_TYPE.getName()) && sourceParam.getValue().toString().matches(\"String_Node_Str\")) {\n sourceElement.getElementParameter(EParameterName.DBNAME.getName()).setValue(sourceElement.getElementParameter(EParameterName.DBFILE.getName()).getValue());\n }\n targetParam.setContextMode(sourceParam.isContextMode());\n targetParam.setValue(sourceParam.getValue());\n if (sourceParam.getValue() instanceof List) {\n List sourceList = (List) sourceParam.getValue();\n List targetList = new ArrayList();\n for (Object map : sourceList) {\n if (map instanceof HashMap) {\n HashMap oldMap = (HashMap) map;\n targetList.add(oldMap.clone());\n }\n }\n if (targetList.size() > 0) {\n targetParam.setValue(targetList);\n } else {\n targetParam.setValue(new ArrayList(sourceList));\n }\n }\n if (targetParam.getFieldType() == EParameterFieldType.TABLE) {\n targetParam.setListItemsValue(ArrayUtils.clone(sourceParam.getListItemsValue()));\n targetParam.setListItemsDisplayCodeName(sourceParam.getListItemsDisplayCodeName());\n }\n for (String name : targetParam.getChildParameters().keySet()) {\n IElementParameter targetChildParam = targetParam.getChildParameters().get(name);\n if (sourceParam.getChildParameters() == null) {\n continue;\n }\n IElementParameter sourceChildParam = sourceParam.getChildParameters().get(name);\n targetChildParam.setValue(sourceChildParam.getValue());\n if (targetChildParam.getFieldType() == EParameterFieldType.TABLE) {\n targetChildParam.setListItemsValue(sourceChildParam.getListItemsValue());\n targetChildParam.setListItemsDisplayCodeName(sourceChildParam.getListItemsDisplayCodeName());\n }\n }\n } else {\n ElementParameter newParam = (ElementParameter) sourceParam.getClone();\n List<IElementParameter> listParam = (List<IElementParameter>) targetElement.getElementParameters();\n listParam.add(newParam);\n }\n }\n}\n"
|
"public void selectAttackers(Game game, UUID attackingPlayerId) {\n updateGameStatePriority(\"String_Node_Str\", game);\n FilterCreatureForCombat filter = filterCreatureForCombat.copy();\n filter.add(new ControllerIdPredicate(attackingPlayerId));\n while (!abort) {\n if (passedAllTurns || (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedUntilEndOfTurn || passedUntilNextMain))) {\n return;\n }\n Map<String, Serializable> options = new HashMap<>();\n List<UUID> possibleAttackers = new ArrayList<>();\n for (Permanent possibleAttacker : game.getBattlefield().getActivePermanents(filter, attackingPlayerId, game)) {\n if (possibleAttacker.canAttack(game)) {\n possibleAttackers.add(possibleAttacker.getId());\n }\n }\n options.put(Constants.Option.POSSIBLE_ATTACKERS, (Serializable) possibleAttackers);\n if (possibleAttackers.size() > 0) {\n options.put(Constants.Option.SPECIAL_BUTTON, (Serializable) \"String_Node_Str\");\n }\n game.fireSelectEvent(playerId, \"String_Node_Str\", options);\n waitForResponse(game);\n if (response.getString() != null && response.getString().equals(\"String_Node_Str\")) {\n setStoredBookmark(game.bookmarkState());\n UUID attackedDefender = null;\n if (game.getCombat().getDefenders().size() > 1) {\n attackedDefender = selectDefenderForAllAttack(game.getCombat().getDefenders(), game);\n } else if (game.getCombat().getDefenders().size() == 1) {\n attackedDefender = game.getCombat().getDefenders().iterator().next();\n }\n for (Permanent attacker : game.getBattlefield().getAllActivePermanents(filterCreatureForCombat, getId(), game)) {\n if (game.getContinuousEffects().checkIfThereArePayCostToAttackBlockEffects(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, attackedDefender, attacker.getId(), attacker.getControllerId()), game)) {\n continue;\n }\n declareAttacker(attacker.getId(), attackedDefender, game, false);\n }\n } else if (response.getBoolean() != null) {\n if (!game.getCombat().getCreaturesForcedToAttack().isEmpty()) {\n if (!game.getCombat().getAttackers().containsAll(game.getCombat().getCreaturesForcedToAttack().keySet())) {\n int forcedAttackers = 0;\n StringBuilder sb = new StringBuilder();\n for (UUID creatureId : game.getCombat().getCreaturesForcedToAttack().keySet()) {\n boolean validForcedAttacker = false;\n if (game.getCombat().getAttackers().contains(creatureId)) {\n Set<UUID> possibleDefender = game.getCombat().getCreaturesForcedToAttack().get(creatureId);\n if (possibleDefender.isEmpty() || possibleDefender.contains(game.getCombat().getDefenderId(creatureId))) {\n validForcedAttacker = true;\n }\n }\n if (validForcedAttacker) {\n forcedAttackers++;\n } else {\n Permanent creature = game.getPermanent(creatureId);\n if (creature != null) {\n sb.append(creature.getIdName()).append(\"String_Node_Str\");\n }\n }\n }\n if (game.getCombat().getMaxAttackers() > forcedAttackers) {\n game.informPlayer(this, sb.insert(0, \"String_Node_Str\").insert(0, Math.min(game.getCombat().getMaxAttackers() - forcedAttackers, game.getCombat().getCreaturesForcedToAttack().size() - forcedAttackers)).insert(0, \"String_Node_Str\").toString());\n continue;\n }\n }\n }\n return;\n } else if (response.getInteger() != null) {\n return;\n } else if (response.getUUID() != null) {\n Permanent attacker = game.getPermanent(response.getUUID());\n if (attacker != null) {\n if (filterCreatureForCombat.match(attacker, null, playerId, game)) {\n selectDefender(game.getCombat().getDefenders(), attacker.getId(), game);\n } else if (filterAttack.match(attacker, null, playerId, game) && game.getStack().isEmpty()) {\n removeAttackerIfPossible(game, attacker);\n }\n }\n }\n }\n}\n"
|
"public void run() {\n NodeEntry state = Preconditions.checkNotNull(graph.get(skyKey), skyKey);\n Preconditions.checkState(state.isReady(), \"String_Node_Str\", skyKey, state);\n if (maybeHandleDirtyNode(state) == DirtyOutcome.ALREADY_PROCESSED) {\n return;\n }\n Set<SkyKey> oldDeps = state.getAllRemainingDirtyDirectDeps();\n SkyFunctionEnvironment env = new SkyFunctionEnvironment(skyKey, state.getTemporaryDirectDeps(), oldDeps, visitor);\n SkyFunctionName functionName = skyKey.functionName();\n SkyFunction factory = skyFunctions.get(functionName);\n Preconditions.checkState(factory != null, \"String_Node_Str\", functionName, skyKey, state);\n SkyValue value = null;\n long startTime = BlazeClock.instance().nanoTime();\n try {\n value = factory.compute(skyKey, env);\n } catch (final SkyFunctionException builderException) {\n ReifiedSkyFunctionException reifiedBuilderException = new ReifiedSkyFunctionException(builderException, skyKey);\n if (reifiedBuilderException.getRootCauseSkyKey().equals(skyKey)) {\n boolean shouldFailFast = !keepGoing || builderException.isCatastrophic();\n if (shouldFailFast) {\n if (!visitor.preventNewEvaluations()) {\n return;\n }\n }\n Map<SkyKey, NodeEntry> newlyRequestedDeps = graph.getBatch(env.newlyRequestedDeps);\n boolean isTransitivelyTransient = reifiedBuilderException.isTransient();\n for (NodeEntry depEntry : Iterables.concat(env.directDeps.values(), newlyRequestedDeps.values())) {\n if (!isDoneForBuild(depEntry)) {\n continue;\n }\n ErrorInfo depError = depEntry.getErrorInfo();\n if (depError != null) {\n isTransitivelyTransient |= depError.isTransient();\n }\n }\n ErrorInfo errorInfo = ErrorInfo.fromException(reifiedBuilderException, isTransitivelyTransient);\n registerNewlyDiscoveredDepsForDoneEntry(skyKey, state, newlyRequestedDeps, oldDeps, env);\n env.setError(errorInfo, reifiedBuilderException.isTransient());\n env.commit(keepGoing);\n if (!shouldFailFast) {\n return;\n }\n throw SchedulerException.ofError(errorInfo, skyKey);\n }\n } catch (InterruptedException ie) {\n throw SchedulerException.ofInterruption(ie, skyKey);\n } catch (RuntimeException re) {\n String msg = prepareCrashMessage(skyKey, state.getInProgressReverseDeps());\n RuntimeException ex = new RuntimeException(msg, re);\n visitor.noteCrash(ex);\n throw ex;\n } finally {\n env.doneBuilding();\n long elapsedTimeNanos = BlazeClock.instance().nanoTime() - startTime;\n if (elapsedTimeNanos > 0) {\n if (progressReceiver != null) {\n progressReceiver.computed(skyKey, elapsedTimeNanos);\n }\n Profiler.instance().logSimpleTaskDuration(startTime, elapsedTimeNanos, ProfilerTask.SKYFUNCTION, skyKey);\n }\n }\n GroupedListHelper<SkyKey> newDirectDeps = env.newlyRequestedDeps;\n if (value != null) {\n Preconditions.checkState(!env.valuesMissing(), \"String_Node_Str\" + \"String_Node_Str\", skyKey, newDirectDeps, state);\n env.setValue(value);\n registerNewlyDiscoveredDepsForDoneEntry(skyKey, state, graph.getBatch(env.newlyRequestedDeps), oldDeps, env);\n env.commit(true);\n return;\n }\n if (env.getDepErrorKey() != null) {\n Preconditions.checkState(!keepGoing, \"String_Node_Str\", skyKey, state, env.getDepErrorKey());\n SkyKey childErrorKey = env.getDepErrorKey();\n NodeEntry childErrorEntry = Preconditions.checkNotNull(graph.get(childErrorKey), \"String_Node_Str\", skyKey, state, childErrorKey);\n Preconditions.checkState(!state.getTemporaryDirectDeps().expensiveContains(childErrorKey), \"String_Node_Str\", skyKey, state, childErrorKey, childErrorEntry);\n Preconditions.checkState(newDirectDeps.contains(childErrorKey), \"String_Node_Str\", state, childErrorKey, newDirectDeps);\n state.addTemporaryDirectDeps(GroupedListHelper.create(ImmutableList.of(childErrorKey)));\n DependencyState childErrorState;\n if (oldDeps.contains(childErrorKey)) {\n childErrorState = childErrorEntry.checkIfDoneForDirtyReverseDep(skyKey);\n } else {\n childErrorState = childErrorEntry.addReverseDepAndCheckIfDone(skyKey);\n }\n Preconditions.checkState(childErrorState == DependencyState.DONE, \"String_Node_Str\", skyKey, state, childErrorKey, childErrorEntry);\n ErrorInfo childErrorInfo = Preconditions.checkNotNull(childErrorEntry.getErrorInfo());\n visitor.preventNewEvaluations();\n throw SchedulerException.ofError(childErrorInfo, childErrorKey);\n }\n state.addTemporaryDirectDeps(newDirectDeps);\n if (newDirectDeps.isEmpty()) {\n Preconditions.checkState(!env.childErrorInfos.isEmpty(), \"String_Node_Str\", skyKey, state);\n Preconditions.checkState(keepGoing, \"String_Node_Str\", skyKey, state, env.childErrorInfos);\n env.commit(true);\n return;\n }\n for (Map.Entry<SkyKey, NodeEntry> e : graph.createIfAbsentBatch(newDirectDeps).entrySet()) {\n SkyKey newDirectDep = e.getKey();\n NodeEntry newDirectDepEntry = e.getValue();\n enqueueChild(skyKey, state, newDirectDep, newDirectDepEntry, oldDeps.contains(newDirectDep));\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);\n Player defender = game.getPlayer(defenderId);\n if (defender != null) {\n Cards cards = new CardsImpl();\n Card card = defender.getLibrary().getFromTop(game);\n if (card != null) {\n cards.add(card);\n defender.revealCards(\"String_Node_Str\", cards, game);\n if (card.getCardType().contains(CardType.LAND)) {\n defender.getLibrary().removeFromTop(game);\n defender.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);\n }\n }\n return true;\n }\n return false;\n}\n"
|
"protected String registerCacheableMapper(UserRequest ureq, String cacheableMapperID, Mapper m) {\n if (mappers == null) {\n mappers = new ArrayList<Mapper>(2);\n }\n String mapperBaseURL;\n if (cacheableMapperID == null) {\n mapperBaseURL = CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(), m);\n } else {\n mapperBaseURL = CoreSpringFactory.getImpl(MapperService.class).register(cacheableMapperID, m);\n }\n mappers.add(m);\n return mapperBaseURL;\n}\n"
|
"protected final void emit_checkcast_resolvedClass(RVMClass type) {\n int LHSDepth = type.getTypeDepth();\n int LHSId = type.getId();\n peekAddr(T0, 0);\n asm.emitCMPAddrI(T0, 0);\n ForwardReference isNull = asm.emitForwardBC(EQ);\n ObjectModel.baselineEmitLoadTIB(asm, T0, T0);\n asm.emitLAddr(T0, TIB_SUPERCLASS_IDS_INDEX << LOG_BYTES_IN_ADDRESS, T0);\n if (DynamicTypeCheck.MIN_SUPERCLASS_IDS_SIZE <= LHSDepth) {\n asm.emitLIntOffset(T1, T0, ObjectModel.getArrayLengthOffset());\n asm.emitLVAL(T2, LHSDepth);\n asm.emitCMPL(T2, T1);\n ForwardReference fr1 = asm.emitForwardBC(LT);\n asm.emitTWI(31, 12, TrapConstants.CHECKCAST_TRAP);\n fr1.resolve(asm);\n }\n asm.emitLHZ(T0, LHSDepth << LOG_BYTES_IN_CHAR, T0);\n if (Assembler.fits(LHSId, 16)) {\n asm.emitCMPI(T0, LHSId);\n } else {\n asm.emitLVAL(T1, LHSId);\n asm.emitCMP(T0, T1);\n }\n ForwardReference fr2 = asm.emitForwardBC(EQ);\n asm.emitTWI(31, 12, TrapConstants.CHECKCAST_TRAP);\n fr2.resolve(asm);\n isNull.resolve(asm);\n}\n"
|
"protected void setUp() throws Exception {\n super.setUp();\n ApplicationContextMock appctx = new ApplicationContextMock();\n application.addComponentInstantiationListener(new SpringComponentInjector(application, appctx, true));\n}\n"
|
"public Set<String> getAllValidatorClasses() {\n Set<String> validators = null;\n try {\n validators = Arrays.asList(restTemplate.getForObject(baseURL + \"String_Node_Str\", String[].class));\n } catch (SyncopeClientCompositeErrorException e) {\n LOG.error(\"String_Node_Str\", e);\n }\n return validators;\n}\n"
|
"public static FilteringPipeline getPipeline() {\n return gPipeline;\n}\n"
|
"public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n setHasOptionsMenu(true);\n checkActionBar();\n boolean adapterAlreadyExists = hasPostAdapter();\n mListView.setAdapter(getPostAdapter());\n if (!adapterAlreadyExists) {\n boolean isRecreated = (savedInstanceState != null);\n switch(getPostListType()) {\n case TAG_FOLLOWED:\n case TAG_PREVIEW:\n getPostAdapter().setCurrentTag(mCurrentTag);\n if (!isRecreated && ReaderTagTable.shouldAutoUpdateTag(mCurrentTag)) {\n updatePostsWithTag(getCurrentTag(), RequestDataAction.LOAD_NEWER, RefreshType.AUTOMATIC);\n }\n break;\n case BLOG_PREVIEW:\n getPostAdapter().setCurrentBlog(mCurrentBlogId);\n if (!isRecreated) {\n updatePostsInCurrentBlog(RequestDataAction.LOAD_NEWER);\n }\n break;\n }\n }\n switch(getPostListType()) {\n case BLOG_PREVIEW:\n loadBlogInfoIfNotLoaded();\n break;\n case TAG_PREVIEW:\n updateTagPreviewHeader();\n break;\n }\n getPostAdapter().setOnTagSelectedListener(mOnTagSelectedListener);\n}\n"
|
"public void init() throws IOException {\n this.lock = new ReentrantLock();\n try {\n this.serverMap = ConfigLoader.loadServerMap(ConfigLoader.buidCfgAbsPathFor(\"String_Node_Str\"));\n this.poolCfgMap = ConfigLoader.loadPoolMap(ConfigLoader.buidCfgAbsPathFor(\"String_Node_Str\"));\n this.userMap = ConfigLoader.loadUserMap(poolCfgMap, ConfigLoader.buidCfgAbsPathFor(\"String_Node_Str\"));\n this.mailProperty = ConfigLoader.loadMailProperties(ConfigLoader.buidCfgAbsPathFor(\"String_Node_Str\"));\n this.kafkaMap = KafkaConfigLoader.loadKafkaMap(poolCfgMap, ConfigLoader.buidCfgAbsPathFor(\"String_Node_Str\"));\n } catch (Exception e) {\n }\n String portString = this.serverMap.get(\"String_Node_Str\");\n String reactorSizeString = this.serverMap.get(\"String_Node_Str\");\n String minBufferSizeString = this.serverMap.get(\"String_Node_Str\");\n String maxBufferSizeString = this.serverMap.get(\"String_Node_Str\");\n String decomposeBufferSizeString = this.serverMap.get(\"String_Node_Str\");\n String minChunkSizeString = this.serverMap.get(\"String_Node_Str\");\n String incrementString = this.serverMap.get(\"String_Node_Str\");\n String maxChunkSizeString = this.serverMap.get(\"String_Node_Str\");\n String bufferLocalPercentString = this.serverMap.get(\"String_Node_Str\");\n String bossSizeString = this.serverMap.get(\"String_Node_Str\");\n String timerSizeString = this.serverMap.get(\"String_Node_Str\");\n String networkFlowLimitSizeString = this.serverMap.get(\"String_Node_Str\");\n int processors = Runtime.getRuntime().availableProcessors();\n int port = portString == null ? 8066 : Integer.parseInt(portString);\n int reactorSize = reactorSizeString == null ? processors : Integer.parseInt(reactorSizeString);\n long minBufferSize = minBufferSizeString == null ? 16384 * 1000 : Long.parseLong(minBufferSizeString);\n long maxBufferSize = maxBufferSizeString == null ? 16384 * 10000 : Long.parseLong(maxBufferSizeString);\n int decomposeBufferSize = decomposeBufferSizeString == null ? 64 * 1024 : Integer.parseInt(decomposeBufferSizeString);\n int minChunkSize = minChunkSizeString == null ? 0 : Integer.parseInt(minChunkSizeString);\n long networkFlowLimitSize = networkFlowLimitSizeString == null ? -1 : Long.parseLong(networkFlowLimitSizeString);\n this.flowMonitor = new NetFlowMonitor(networkFlowLimitSize);\n int[] increments = null;\n if (incrementString == null) {\n increments = new int[] { 1024 };\n } else {\n String[] incrementStrings = incrementString.split(\"String_Node_Str\");\n if (incrementStrings == null || incrementStrings.length == 0) {\n increments = new int[] { 1024 };\n } else {\n increments = new int[incrementStrings.length];\n for (int i = 0; i < incrementStrings.length; i++) {\n increments[i] = Integer.parseInt(incrementStrings[i]);\n }\n }\n }\n int maxChunkSize = maxChunkSizeString == null ? 64 * 1024 : Integer.parseInt(maxChunkSizeString);\n int bufferLocalPercent = bufferLocalPercentString == null ? 100 : Integer.parseInt(bufferLocalPercentString);\n int threadLocalPercent = bufferLocalPercent / reactorSize;\n int bossSize = bossSizeString == null ? 10 : Integer.parseInt(bossSizeString);\n int timerSize = timerSizeString == null ? 6 : Integer.parseInt(timerSizeString);\n this.bufferPool = new BucketBufferPool(minBufferSize, maxBufferSize, decomposeBufferSize, minChunkSize, increments, maxChunkSize, threadLocalPercent);\n this.virtualMemoryService = new VirtualMemoryService();\n this.virtualMemoryService.start();\n new NetSystem(bufferPool, ExecutorUtil.create(\"String_Node_Str\", bossSize), ExecutorUtil.create(\"String_Node_Str\", timerSize));\n String frontIdleTimeoutString = this.serverMap.get(\"String_Node_Str\");\n String backendIdleTimeoutString = this.serverMap.get(\"String_Node_Str\");\n int frontIdleTimeout = frontIdleTimeoutString == null ? 5 * 60 * 1000 : Integer.parseInt(frontIdleTimeoutString);\n int backendIdleTimeout = backendIdleTimeoutString == null ? 30 * 60 * 1000 : Integer.parseInt(backendIdleTimeoutString);\n SystemConfig systemConfig = new SystemConfig();\n systemConfig.setFrontIdleTimeout(frontIdleTimeout);\n systemConfig.setBackendIdleTimeout(backendIdleTimeout);\n NetSystem.getInstance().setNetConfig(systemConfig);\n System.out.println(String.format(\"String_Node_Str\", processors, reactorSize, bossSize, timerSize, frontIdleTimeout, backendIdleTimeout));\n NIOReactorPool reactorPool = new NIOReactorPool(BufferPool.LOCAL_BUF_THREAD_PREX + \"String_Node_Str\", reactorSize);\n NIOReactor[] reactors = reactorPool.getAllReactors();\n for (NIOReactor r : reactors) {\n this.reactorMap.put(r.getName(), r);\n }\n NIOConnector connector = new NIOConnector(\"String_Node_Str\", reactorPool);\n connector.start();\n NetSystem.getInstance().setConnector(connector);\n this.poolMap = new HashMap<Integer, AbstractPool>(poolCfgMap.size());\n for (final PoolCfg poolCfg : poolCfgMap.values()) {\n AbstractPool pool = PoolFactory.createPoolByCfg(poolCfg);\n pool.startup();\n this.poolMap.put(pool.getId(), pool);\n }\n NIOAcceptor acceptor = new NIOAcceptor(\"String_Node_Str\", \"String_Node_Str\", port, new RedisFrontendConnectionFactory(), reactorPool);\n acceptor.start();\n LOGGER.info(acceptor.getName() + \"String_Node_Str\", acceptor.getPort());\n Iterator<String> it = userMap.keySet().iterator();\n String authString = it.hasNext() ? it.next() : \"String_Node_Str\";\n KeepAlived.check(port, authString);\n if (kafkaMap != null && kafkaMap.isEmpty()) {\n KafkaLoad.instance().load(kafkaMap);\n OffsetAdmin.getInstance().startUp();\n }\n Runtime.getRuntime().addShutdownHook(new Thread() {\n public void run() {\n OffsetAdmin.getInstance().close();\n }\n });\n}\n"
|
"private void moveTo(int x, int y) {\n mPositionX = x - TextView.this.mScrollX;\n mPositionY = y - TextView.this.mScrollY;\n if (isPositionVisible()) {\n int[] coords = null;\n if (mContainer.isShowing()) {\n final int[] coords = mTempCoords;\n TextView.this.getLocationInWindow(coords);\n coords[0] += mPositionX;\n coords[1] += mPositionY;\n mContainer.update(coords[0], coords[1], mRight - mLeft, mBottom - mTop);\n } else {\n show();\n }\n } else {\n hide();\n }\n}\n"
|
"public void useCflow(String name) throws CannotCompileException {\n CtClass cc = declaringClass;\n cc.checkModify();\n ClassPool pool = cc.getClassPool();\n String fname;\n int i = 0;\n while (true) {\n fname = \"String_Node_Str\" + i++;\n try {\n cc.getDeclaredField(fname);\n } catch (NotFoundException e) {\n break;\n }\n }\n pool.recordCflow(name, declaringClass.getName(), fname);\n try {\n CtClass type = pool.get(\"String_Node_Str\");\n CtField field = new CtField(type, fname, cc);\n field.setModifiers(Modifier.PUBLIC | Modifier.STATIC);\n cc.addField(field, CtField.Initializer.byNew(type));\n insertBefore(fname + \"String_Node_Str\", false);\n String src = fname + \"String_Node_Str\";\n insertAfter(src, true);\n } catch (NotFoundException e) {\n throw new CannotCompileException(e);\n }\n}\n"
|
"private StreamReader getMetaManager(StreamID id, int sType) throws DataException {\n if (sType == DataEngineContext.DATASET_DATA_STREAM || sType == DataEngineContext.DATASET_META_STREAM) {\n if (this.dataMetaManagers.get(id) == null)\n this.dataMetaManagers.put(id, new DataStreamReader(this.context, id));\n return this.dataMetaManagers.get(id);\n }\n if (this.metaManagers.get(id) == null) {\n this.metaManagers.put(id, new MetaStreamReader(this.context, id));\n }\n return (StreamReader) this.metaManagers.get(id);\n}\n"
|
"private void calcAngles() {\n mDrawAngles = new float[mCurrentData.getYValCount()];\n mAbsoluteAngles = new float[mCurrentData.getYValCount()];\n ArrayList<PieDataSet> dataSets = mCurrentData.getDataSets();\n int cnt = 0;\n for (int i = 0; i < mCurrentData.getDataSetCount(); i++) {\n PieDataSet set = dataSets.get(i);\n ArrayList<Entry> entries = set.getYVals();\n for (int j = 0; j < entries.size(); j++) {\n mDrawAngles[cnt] = calcAngle(Math.abs(entries.get(j).getVal()));\n if (cnt == 0) {\n mAbsoluteAngles[cnt] = mDrawAngles[cnt];\n } else {\n mAbsoluteAngles[cnt] = mAbsoluteAngles[cnt - 1] + mDrawAngles[cnt];\n }\n cnt++;\n }\n }\n}\n"
|
"public static String getWebContext() {\n String moduleBaseURL = GWT.getModuleBaseURL();\n String moduleName = GWT.getModuleName();\n String webContext = moduleBaseURL.split(\"String_Node_Str\")[3];\n if (webContext.equals(moduleName)) {\n return null;\n } else {\n return webContext;\n }\n}\n"
|
"public void render(final Component owner, final Object data, final int index, final int size, final boolean isListModel) {\n final Template tm = resolveTemplate(owner, owner, data, index, size, \"String_Node_Str\");\n if (tm == null) {\n Label l = new Label(data == null ? \"String_Node_Str\" : data.toString());\n l.setParent(owner);\n return;\n }\n final ForEachStatus iterStatus = new ChildrenBindingForEachStatus(index, data, size);\n final String var = (String) tm.getParameters().get(\"String_Node_Str\");\n final String varnm = var == null ? EACH_VAR : var;\n final String itervar = (String) tm.getParameters().get(STATUS_ATTR);\n final String itervarnm = itervar == null ? (var == null ? EACH_STATUS_VAR : varnm + STATUS_POST_VAR) : itervar;\n Object oldVar = owner.getAttribute(varnm);\n Object oldIter = owner.getAttribute(itervarnm);\n owner.setAttribute(varnm, data);\n owner.setAttribute(itervarnm, iterStatus);\n Component insertBefore = null;\n List<Component[]> cbrCompsList = (List<Component[]>) owner.getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS);\n if (cbrCompsList != null) {\n int newIndex = 0;\n int steps = 0;\n for (Component[] cmps : cbrCompsList) {\n if (steps++ >= index)\n break;\n newIndex += cmps.length;\n }\n if (owner.getChildren().size() > newIndex) {\n insertBefore = owner.getChildren().get(newIndex);\n }\n }\n final Component[] items = ShadowElementsCtrl.filterOutShadows(tm.create(owner, insertBefore, null, null));\n if (oldVar != null) {\n owner.setAttribute(varnm, oldVar);\n } else {\n owner.removeAttribute(varnm);\n }\n if (oldIter != null) {\n owner.setAttribute(itervarnm, oldIter);\n } else {\n owner.removeAttribute(itervarnm);\n }\n boolean templateTracked = false;\n if (isListModel) {\n cbrCompsList = (List<Component[]>) owner.getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS);\n if (cbrCompsList == null)\n cbrCompsList = new LinkedList<Component[]>();\n cbrCompsList.add(items);\n owner.setAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS, cbrCompsList);\n } else {\n recordRenderedIndex(owner, items.length);\n }\n for (final Component comp : items) {\n comp.setAttribute(BinderCtrl.VAR, varnm);\n comp.setAttribute(AbstractRenderer.IS_TEMPLATE_MODEL_ENABLED_ATTR, true);\n comp.setAttribute(AbstractRenderer.CURRENT_INDEX_RESOLVER_ATTR, new IndirectBinding() {\n public Binder getBinder() {\n return BinderUtil.getBinder(comp, true);\n }\n public Component getComponent() {\n return comp;\n }\n public void setValue(BindELContext ctx, Object value) {\n int index = BindChildRenderer.this.getRenderedIndex(owner, comp.getParent().getChildren().indexOf(comp));\n Collection<?> collection = (Collection<?>) owner.getAttribute(BindELContext.getModelName(owner));\n if (collection instanceof List<?>) {\n List<Object> list = (List<Object>) collection;\n try {\n list.set(index, value);\n } catch (UnsupportedOperationException e) {\n throw new PropertyNotWritableException(e);\n } catch (IndexOutOfBoundsException e) {\n throw new PropertyNotFoundException(e);\n }\n }\n }\n public Object getValue(BindELContext ctx) {\n final int index = BindChildRenderer.this.getRenderedIndex(owner, comp.getParent().getChildren().indexOf(comp));\n Collection<Object> collection = (Collection<Object>) owner.getAttribute(BindELContext.getModelName(owner));\n if (collection != null) {\n if (collection instanceof List<?>) {\n return ((List<Object>) collection).get(index);\n } else {\n int i = -1;\n for (Object o : collection) {\n i++;\n if (i == index)\n return o;\n }\n }\n }\n return null;\n }\n });\n addItemReference(owner, comp, index, varnm);\n comp.setAttribute(itervarnm, iterStatus);\n if (!templateTracked) {\n comp.setAttribute(TemplateResolver.TEMPLATE_OBJECT, owner.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));\n addTemplateTracking(owner, comp, data, index, size);\n templateTracked = true;\n }\n Events.sendEvent(new Event(BinderCtrl.ON_BIND_INIT, comp));\n }\n}\n"
|
"public void handleDescriptionPacket(PacketUpdate packet) throws IOException {\n if (packet.payload instanceof PacketPayloadArrays) {\n descriptionPacket.fromPayload(this, (PacketPayloadArrays) packet.payload);\n}\n"
|
"protected void initPage() {\n createContextMenus();\n treeViewer.setSorter(new ViewerSorter() {\n public int category(Object element) {\n if (element instanceof LibraryHandle) {\n return 1;\n }\n return super.category(element);\n }\n });\n treeViewer.getTree().addMouseTrackListener(new MouseTrackAdapter() {\n public void mouseHover(MouseEvent event) {\n Widget widget = event.widget;\n if (widget == treeViewer.getTree()) {\n Point pt = new Point(event.x, event.y);\n TreeItem item = treeViewer.getTree().getItem(pt);\n treeViewer.getTree().setToolTipText(getTooltip(item));\n }\n }\n });\n IEclipsePreferences rootNode = (IEclipsePreferences) Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE);\n final String reportName = ReportPlugin.getDefault().getBundle().getSymbolicName();\n try {\n if (rootNode.nodeExists(reportName)) {\n reportPreferenceNode = (IEclipsePreferences) rootNode.node(reportName);\n reportPreferenceNode.addPreferenceChangeListener(this);\n }\n } catch (BackingStoreException e) {\n ExceptionHandler.handle(e);\n }\n}\n"
|
"private String extractStachelhausSignature() {\n String s2 = extractCharacters(a_topline, a_downline, \"String_Node_Str\", new int[] { 9, 10, 13 });\n String s3 = extractCharacters(a_topline, a_downline, \"String_Node_Str\", new int[] { 4 });\n String s4 = extractCharacters(a_topline, a_downline, \"String_Node_Str\", new int[] { 4, 6 });\n String s5 = extractCharacters(a_topline, a_downline, \"String_Node_Str\", new int[] { 3, 11, 12 });\n String s6 = \"String_Node_Str\";\n if (!lys_topline.equals(\"String_Node_Str\"))\n s6 = extractCharacters(lys_topline, lys_downline, \"String_Node_Str\", new int[] { 13 });\n return s2 + s3 + s4 + s5 + s6;\n}\n"
|
"public void onGetTopicListSucceed(List<Topic> topicList) {\n if (getContext() == null) {\n return;\n }\n mLoadable = topicList.isHasMore();\n mAdapter.setData(topicList.getTopics());\n}\n"
|
"private void _initSequencedActors(List<SequenceAttribute> independentList) {\n if (independentList != null) {\n Iterator sequenceAttributes = independentList.iterator();\n while (sequenceAttributes.hasNext()) {\n SequenceAttribute attribute = (SequenceAttribute) sequenceAttributes.next();\n int sequenceNumber = attribute.getSequenceNumber();\n _SequenceInfo info = new _SequenceInfo(sequenceNumber, true, false);\n info.original = sequenceNumber;\n Actor actor = (Actor) attribute.getContainer();\n _sequenceInfos.put(actor, info);\n _unsettled.add(actor);\n }\n }\n}\n"
|
"private void startEIP() {\n activeGateway = selectGateway();\n Intent intent = new Intent(this, LaunchVPN.class);\n intent.setAction(Intent.ACTION_MAIN);\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.putExtra(LaunchVPN.EXTRA_KEY, activeGateway.mVpnProfile.getUUID().toString());\n intent.putExtra(LaunchVPN.EXTRA_NAME, activeGateway.mVpnProfile.getName());\n intent.putExtra(RECEIVER_TAG, mReceiver);\n startActivity(intent);\n mPending = ACTION_START_EIP;\n}\n"
|
"public void guiTestSetValueAt_SortedList() {\n final EventList<JLabel> labels = new BasicEventList<JLabel>();\n labels.add(new JLabel(\"String_Node_Str\"));\n labels.add(new JLabel(\"String_Node_Str\"));\n labels.add(new JLabel(\"String_Node_Str\"));\n final ObservableElementList<JLabel> observedLabels = new ObservableElementList<JLabel>(labels, GlazedLists.beanConnector(JLabel.class));\n final SortedList<JLabel> sortedLabels = new SortedList<JLabel>(observedLabels, GlazedLists.beanPropertyComparator(JLabel.class, \"String_Node_Str\", new String[0]));\n final EventTableModel<JLabel> tableModel = new EventTableModel<JLabel>(sortedLabels, new LabelTableFormat());\n assertEquals(3, tableModel.getRowCount());\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(0, 0));\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(1, 0));\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(2, 0));\n tableModel.setValueAt(\"String_Node_Str\", 1, 0);\n assertEquals(3, tableModel.getRowCount());\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(0, 0));\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(1, 0));\n assertEquals(\"String_Node_Str\", tableModel.getValueAt(2, 0));\n}\n"
|
"protected void handleEntryTag() {\n int iEntryId = 0;\n String sName = \"String_Node_Str\";\n String sType = \"String_Node_Str\";\n String sExternalLink = \"String_Node_Str\";\n String sReactionId = \"String_Node_Str\";\n for (int iAttributeIndex = 0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {\n sAttributeName = attributes.getLocalName(iAttributeIndex);\n if (\"String_Node_Str\".equals(sAttributeName)) {\n sAttributeName = attributes.getQName(iAttributeIndex);\n }\n if (sAttributeName.equals(\"String_Node_Str\")) {\n iEntryId = Integer.valueOf(attributes.getValue(iAttributeIndex)).intValue();\n } else if (sAttributeName.equals(\"String_Node_Str\")) {\n sName = attributes.getValue(iAttributeIndex);\n } else if (sAttributeName.equals(\"String_Node_Str\")) {\n sType = attributes.getValue(iAttributeIndex);\n } else if (sAttributeName.equals(\"String_Node_Str\")) {\n sExternalLink = attributes.getValue(iAttributeIndex);\n } else if (sAttributeName.equals(\"String_Node_Str\")) {\n sReactionId = attributes.getValue(iAttributeIndex);\n }\n }\n iCurrentEntryId = iEntryId;\n alCurrentVertex.clear();\n if (sType.equals(\"String_Node_Str\")) {\n StringTokenizer sTokenText = new StringTokenizer(sName, \"String_Node_Str\");\n Integer iDavidId = -1;\n String sTmpVertexName = \"String_Node_Str\";\n while (sTokenText.hasMoreTokens()) {\n sTmpVertexName = sTokenText.nextToken();\n if (sTmpVertexName.substring(4).equals(\"String_Node_Str\")) {\n continue;\n }\n iDavidId = generalManager.getIDMappingManager().getID(EMappingType.ENTREZ_GENE_ID_2_DAVID, Integer.valueOf(sTmpVertexName.substring(4)));\n if (iDavidId == null) {\n continue;\n }\n iSetDavidID.add(iDavidId);\n }\n } else {\n currentVertex = pathwayItemManager.createVertex(sName, sType, sExternalLink, sReactionId);\n alCurrentVertex.add(currentVertex);\n }\n}\n"
|
"private PositionStreamEvent nextStreamEvent(ReadFilter filter) throws IOException {\n while (!eof && !(streamEventBuffer.hasEvent() && acceptTimestamp(filter, timestamp))) {\n readDataBlock(filter);\n }\n if (eof) {\n return null;\n }\n PositionStreamEvent event = streamEventBuffer.nextEvent(timestamp, eventTemplate.getHeaders(), filter);\n position = streamEventBuffer.getPosition();\n return event;\n}\n"
|
"private VariableFunction parse(ConfigurationSection input, String key, VariableFunction defaultValue, boolean throwException) throws Exception {\n String start = key + \"String_Node_Str\";\n String end = key + \"String_Node_Str\";\n Object root = input.get(key);\n SampleRange result = null;\n if (root instanceof Double) {\n result = new SampleRange((Double) root);\n } else if (root instanceof Integer) {\n result = new SampleRange((Integer) root);\n } else if (root instanceof List) {\n List attempt = (List) root;\n try {\n if (attempt != null && attempt.size() == 2)\n result = new SampleRange(tryParse(attempt.get(0)), tryParse(attempt.get(1)));\n else if (attempt != null && attempt.size() == 1)\n result = new SampleRange(tryParse(attempt.get(0)));\n else if (!throwException)\n return defaultValue;\n else\n throw new ParsingException(\"String_Node_Str\");\n } catch (Exception e) {\n if (throwException)\n throw e;\n else\n return defaultValue;\n }\n } else if (root instanceof String) {\n try {\n return textParser.parse((String) root, defaultValue);\n } catch (Exception e) {\n if (throwException)\n throw e;\n else\n return defaultValue;\n }\n } else {\n if (input.contains(start) && input.contains(end)) {\n result = new SampleRange(input.getDouble(start), input.getDouble(end));\n } else {\n return defaultValue;\n }\n }\n return VariableFunction.fromRange(result);\n}\n"
|
"void readGroupsFromStream(InputStream inputStream) throws IOException {\n int size = IOUtil.readInt(inputStream);\n this.groups = new CachedList[size];\n for (int i = 0; i < size; i++) {\n List list = new CachedList(tempDir, DataEngineSession.getCurrentClassLoader(), GroupInfo.getCreator());\n ;\n int asize = IOUtil.readInt(inputStream);\n for (int j = 0; j < asize; j++) {\n GroupInfo groupInfo = new GroupInfo();\n groupInfo.parent = IOUtil.readInt(inputStream);\n groupInfo.firstChild = IOUtil.readInt(inputStream);\n list.add(groupInfo);\n }\n this.groups[i] = list;\n }\n}\n"
|
"protected Checkmark getNewestComputed() {\n if (list.isEmpty())\n return null;\n return list.getFirst();\n}\n"
|
"public void testMount() {\n MainTest.gameSample();\n State s = new State();\n Move m = new Mount(Position.at(1, 0, 1), Position.at(2, 2, 0));\n s = m.doMove(s);\n}\n"
|
"public static String bitcoinValueToFriendlyString(BigInteger value) {\n boolean negative = value.compareTo(BigInteger.ZERO) < 0;\n if (negative)\n value = value.negate();\n BigDecimal bd = new BigDecimal(value, 8);\n String formatted = bd.toPlainString();\n int toDelete = 0;\n for (int i = formatted.length() - 1; i > decimalPoint + 2; i--) {\n if (formatted.charAt(i) == '0')\n toDelete++;\n else\n break;\n }\n return (negative ? \"String_Node_Str\" : \"String_Node_Str\") + formatted.substring(0, formatted.length() - toDelete);\n}\n"
|
"private void prepareCurrentRow() throws DataException {\n clear();\n this.rdSaveHelper.doSaveBasic();\n if (needCache() && !this.isEmpty()) {\n bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap, true);\n try {\n saveCurrentRow();\n } catch (IOException e) {\n try {\n saveCurrentRow();\n } catch (IOException e) {\n try {\n this.metaOutputStream.close();\n this.rowOutputStream.close();\n } catch (IOException ce) {\n }\n throw new DataException(ResourceConstants.WRITE_CACHE_TEMPFILE_ERROR, e);\n } catch (BirtException e) {\n throw DataException.wrap(e);\n }\n } else {\n if (this.getRdSaveHelper().isSummaryQuery())\n bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap, true);\n else\n bindingColumnsEvalUtil.getColumnsValue(boundColumnValueMap, false);\n }\n }\n}\n"
|
"public void testInsertsDeletesInterleaved() {\n root.insertAt(0, \"String_Node_Str\", REPLICA_ID);\n root.insertAt(1, \"String_Node_Str\", REPLICA_ID);\n root.insertAt(1, \"String_Node_Str\", REPLICA_ID);\n root.deleteAt(1);\n root.insertAt(1, \"String_Node_Str\");\n root.deleteAt(0);\n root.insertAt(0, \"String_Node_Str\");\n root.deleteAt(2);\n root.insertAt(2, \"String_Node_Str\");\n assertEquals(\"String_Node_Str\", root.getContent());\n}\n"
|
"public void test() {\n ReadAllQuery readQuery = new ReadAllQuery(Employee.class);\n DatabaseCall call;\n SQLCall sqlCall;\n StoredProcedureCall spCall;\n boolean useInOut = getSession().getPlatform().isSybase();\n if (useCustomSQL) {\n String prefix;\n if (useInOut) {\n prefix = \"String_Node_Str\";\n } else {\n prefix = \"String_Node_Str\";\n }\n sqlCall = new SQLCall(\"String_Node_Str\" + prefix + \"String_Node_Str\" + getSession().getPlatform().getOutputProcedureToken());\n sqlCall.setCustomSQLArgumentType(\"String_Node_Str\", BigDecimal.class);\n call = sqlCall;\n } else {\n spCall = new StoredProcedureCall();\n spCall.setProcedureName(\"String_Node_Str\");\n spCall.addNamedArgument(\"String_Node_Str\", \"String_Node_Str\");\n if (useInOut) {\n spCall.addNamedInOutputArgumentValue(\"String_Node_Str\", new Long(0), \"String_Node_Str\", java.math.BigDecimal.class);\n } else {\n spCall.addNamedOutputArgument(\"String_Node_Str\", \"String_Node_Str\", BigDecimal.class);\n }\n call = spCall;\n }\n call.setReturnsResultSet(true);\n readQuery.setCall(call);\n readQuery.addArgument(\"String_Node_Str\");\n if (useCustomSQL && useInOut) {\n readQuery.addArgument(\"String_Node_Str\");\n }\n getSession().removeQuery(\"String_Node_Str\");\n getSession().addQuery(\"String_Node_Str\", readQuery);\n Vector args = new Vector(2);\n args.addElement(new Integer(1));\n if (useCustomSQL && useInOut) {\n args.addElement(new Long(0));\n }\n try {\n Vector vResult = (Vector) getSession().executeQuery(\"String_Node_Str\", args);\n } catch (ClassCastException e) {\n throw new TestErrorException(\"String_Node_Str\");\n }\n readQuery = new ReadAllQuery(Employee.class);\n if (useCustomSQL) {\n return;\n } else {\n spCall = new StoredProcedureCall();\n spCall.setProcedureName(\"String_Node_Str\");\n spCall.addNamedArgumentValue(\"String_Node_Str\", new Integer(1));\n if (useInOut) {\n spCall.addNamedInOutputArgumentValue(\"String_Node_Str\", new Long(0), \"String_Node_Str\", java.math.BigDecimal.class);\n } else {\n spCall.addNamedOutputArgument(\"String_Node_Str\", \"String_Node_Str\", BigDecimal.class);\n }\n call = spCall;\n }\n call.setReturnsResultSet(true);\n readQuery.setCall(call);\n try {\n Vector vResult = (Vector) getSession().executeQuery(readQuery);\n } catch (ClassCastException e) {\n throw new TestErrorException(\"String_Node_Str\");\n }\n}\n"
|
"public void setUp() throws Exception {\n final Context context = Robolectric.getShadowApplication().getApplicationContext();\n ConnectionParameter connParams = new ConnectionParameter(0, new Bundle(), null);\n mavlinkApi = new MockMavLinkServiceAPI();\n DroneInterfaces.Clock clock = new DroneInterfaces.Clock() {\n public long elapsedRealtime() {\n return SystemClock.elapsedRealtime();\n }\n };\n DroidPlannerPrefs dpPrefs = new DroidPlannerPrefs(context);\n MAVLinkClient mavClient = new MAVLinkClient(context, inputStreamListener, connParams, mavlinkApi);\n drone = new DroneImpl(mavClient, clock, dpHandler, dpPrefs, new AndroidApWarningParser(context), new LogMessageListener() {\n public void onMessageLogged(int mavSeverity, String message) {\n }\n });\n}\n"
|
"private String capitalize(String text) {\n boolean capitalizeNextChar = true;\n char[] array = text.toCharArray();\n int index = 0;\n while (index < array.length) {\n Character c = new Character(text.charAt(index));\n while (splitChar.contains(c)) {\n index++;\n if (index == array.length)\n return new String(array);\n c = new Character(text.charAt(index));\n }\n array[index] = Character.toUpperCase(array[index]);\n while (!splitChar.contains(c)) {\n index++;\n if (index == array.length)\n break;\n c = new Character(text.charAt(index));\n }\n }\n return new String(array);\n}\n"
|
"public Object visitForeign(IForeignContent foreign, Object value) {\n if (IForeignContent.HTML_TYPE.equals(foreign.getRawType())) {\n HTML2Content.html2Content(foreign);\n executor = new DOMReportItemExecutor(foreign);\n executor.execute();\n return visitContent(foreign, value);\n }\n LabelContent label = new LabelContent(foreign);\n return handleText(label);\n}\n"
|
"public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {\n if (evt instanceof IdleStateEvent) {\n IdleState e = ((IdleStateEvent) evt).state();\n if (e == IdleState.READER_IDLE) {\n LOG.info(\"String_Node_Str\", NettyUtils.clientID(ctx.channel()));\n ctx.fireChannelInactive();\n ctx.close().addListener(CLOSE_ON_FAILURE);\n }\n } else {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\", NettyUtils.clientID(ctx.channel()), evt.getClass().getName());\n }\n super.userEventTriggered(ctx, evt);\n }\n}\n"
|
"public long remainingCapacity() throws IOException {\n return Math.max(0, journalSize.get() - fileChannel.position());\n}\n"
|
"public void noInternetConnection() {\n if (_automaticallyConnecting) {\n if (_catcher != null && (_catcher.getNumHosts() < 50)) {\n _catcher.recoverHosts();\n }\n return;\n }\n if (SystemUtils.supportsIdleTime() && SystemUtils.getIdleTime() < 30 * 1000 && !QuestionsHandler.NO_INTERNET.getValue()) {\n MessageService.showError(\"String_Node_Str\", QuestionsHandler.NO_INTERNET);\n } else {\n MessageService.showError(\"String_Node_Str\", QuestionsHandler.NO_INTERNET);\n RouterService.schedule(new Runnable() {\n public void run() {\n if (_automaticConnectTime < _disconnectTime) {\n return;\n }\n ConnectionManager cm = RouterService.getConnectionManager();\n if (!cm.isConnected()) {\n cm.connect();\n }\n }\n }, 10 * 1000, 60 * 1000);\n _automaticConnectTime = System.currentTimeMillis();\n _automaticallyConnecting = true;\n }\n _noInternetConnection = true;\n disconnect();\n if (_catcher != null) {\n _catcher.recoverHosts();\n }\n}\n"
|
"public void clean(boolean forRemove) throws StandardException {\n boolean gapClosed = false;\n try {\n if (_sequenceGenerator == null) {\n gapClosed = true;\n } else {\n gapClosed = updateCurrentValueOnDisk(null, peekAtCurrentValue());\n }\n } catch (StandardException se) {\n if (!SQLState.LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE.equals(se.getMessageId())) {\n throw se;\n }\n } finally {\n if (!gapClosed) {\n String errorMessage = MessageService.getTextMessage(SQLState.LANG_CANT_FLUSH_PREALLOCATOR, _sequenceGenerator.getSchemaName(), _sequenceGenerator.getName());\n Monitor.getStream().println(errorMessage);\n }\n }\n _uuidString = null;\n _sequenceGenerator = null;\n}\n"
|
"public void addDependency(SchemaId field) {\n RecordContext ctx = contexts.peek();\n try {\n if (!ctx.dep.vprops.isEmpty() || !ctx.dep.id.equals(recordId)) {\n dependencies.get(DerefMapUtil.newEntry(ctx.dep.id, ctx.dep.vprops)).add(field);\n }\n } catch (ExecutionException ee) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n}\n"
|
"public void after(Object target, Object[] args, Object result, Throwable throwable) {\n if (isDebug) {\n logger.afterInterceptor(target, args, result, throwable);\n }\n if (args.length != 4) {\n Object iprot = args[1];\n if (validateInputProtocol(iprot)) {\n ((ServerMarkerFlagFieldAccessor) iprot)._$PINPOINT$_setServerMarkerFlag(false);\n }\n }\n}\n"
|
"public boolean isDone() {\n synchronized (lock) {\n return done || canceled;\n }\n}\n"
|
"public void maximizeWindow() {\n mainStage.setMaximized(true);\n Rectangle dimensions = getDimensions();\n mainStage.setWidth(dimensions.getWidth());\n mainStage.setHeight(dimensions.getHeight());\n mainStage.setX(0);\n mainStage.setY(0);\n}\n"
|
"public String getTableName() {\n return this.getClass().getSimpleName().toLowerCase();\n}\n"
|
"private synchronized static ITmfTrace<LttngEvent>[] setupTrace(String path) {\n if (fTraces == null) {\n fTraces = new ITmfTrace[1];\n try {\n URL location = FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(), new Path(path), null);\n File testfile = new File(FileLocator.toFileURL(location).toURI());\n LTTngTrace trace = new LTTngTrace(testfile.getName(), testfile.getPath(), false);\n fTraces[0] = trace;\n } catch (URISyntaxException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return fTraces;\n}\n"
|
"public double getDoubleSetting(final String settingName) throws EoulsanException {\n if (settingName == null)\n throw new EoulsanException(\"String_Node_Str\");\n final String value = getSetting(settingName);\n if (value == null)\n throw new EoulsanException(\"String_Node_Str\" + settingName + \"String_Node_Str\");\n try {\n return Double.parseDouble(value);\n } catch (NumberFormatException e) {\n throw new EoulsanException(\"String_Node_Str\" + settingName + \"String_Node_Str\" + value);\n }\n}\n"
|
"public void readValues(DataRead dr) throws BasicException {\n c_ID = dr.getString(1);\n}\n"
|
"public void process(CtStatement element) {\n if (!(element instanceof CtBlock || element instanceof CtClass || element instanceof CtMethod || element instanceof CtTry || element instanceof CtCatch) && ((element.getParent() instanceof CtBlock) || (element.getParent() instanceof CtCase) || (element.getParent() instanceof CtIf) || (element.getParent() instanceof CtWhile))) {\n add(element);\n }\n}\n"
|
"public void setCsrcList(long[] newCsrcList) {\n int newCsrcCount = newCsrcList.length;\n byte[] csrcBuff = new byte[newCsrcCount * 4];\n int csrcOffset = 0;\n for (long csrc : newCsrcList) {\n csrcBuff[csrcOffset] = (byte) (csrc >> 24);\n csrcBuff[csrcOffset + 1] = (byte) (csrc >> 16);\n csrcBuff[csrcOffset + 2] = (byte) (csrc >> 8);\n csrcBuff[csrcOffset + 3] = (byte) csrc;\n csrcOffset += 4;\n }\n int oldCsrcCount = getCsrcCount();\n byte[] oldBuffer = this.getBuffer();\n byte[] newBuffer = new byte[oldBuffer.length + csrcBuff.length - oldCsrcCount * 4];\n System.arraycopy(oldBuffer, 0, newBuffer, 0, offset + FIXED_HEADER_SIZE);\n System.arraycopy(csrcBuff, 0, newBuffer, offset + FIXED_HEADER_SIZE, csrcBuff.length);\n int payloadOffsetForOldBuff = offset + FIXED_HEADER_SIZE + oldCsrcCount * 4;\n int payloadOffsetForNewBuff = offset + FIXED_HEADER_SIZE + newCsrcCount * 4;\n System.arraycopy(oldBuffer, payloadOffsetForOldBuff, newBuffer, payloadOffsetForNewBuff, oldBuffer.length - payloadOffsetForOldBuff);\n newBuffer[offset] = (byte) ((newBuffer[offset] & 0xF0) | newCsrcCount);\n this.buffer = newBuffer;\n this.length = newBuffer.length;\n}\n"
|
"public void run() {\n if (Thread.currentThread().isInterrupted()) {\n return;\n }\n boolean transactionCommitted = false;\n final Exception[] exception = new Exception[1];\n final Realm bgRealm = Realm.getInstance(realmConfiguration);\n bgRealm.beginTransaction();\n try {\n transaction.execute(bgRealm);\n if (!Thread.currentThread().isInterrupted()) {\n bgRealm.commitTransaction(new Runnable() {\n\n public void run() {\n callback.onSuccess();\n }\n });\n }\n } else {\n if (bgRealm.isInTransaction()) {\n bgRealm.cancelTransaction();\n } else {\n RealmLog.w(\"String_Node_Str\");\n }\n }\n } catch (final Exception e) {\n if (bgRealm.isInTransaction()) {\n bgRealm.cancelTransaction();\n } else {\n RealmLog.w(\"String_Node_Str\");\n }\n if (callback != null && handler != null && !Thread.currentThread().isInterrupted() && handler.getLooper().getThread().isAlive()) {\n bgRealm.close();\n handler.post(new Runnable() {\n public void run() {\n callback.onError(e);\n }\n });\n }\n } finally {\n if (!bgRealm.isClosed()) {\n bgRealm.close();\n }\n }\n }\n}\n"
|
"CommonDataSource createIfDataSourceDefinitionAvailable(TestedClass testedClass) {\n TestedClass testedClassWithDataSource = testedClass.parent;\n if (testedClassWithDataSource == null || dsName == null) {\n return null;\n }\n TestedClass testedClassToBeSearched = testedClass;\n do {\n createFromTestedClassOrASuperclass(testedClassToBeSearched);\n if (ds != null) {\n return ds;\n }\n testedClassToBeSearched = testedClassToBeSearched.parent;\n } while (testedClassToBeSearched != null);\n throw new IllegalStateException(\"String_Node_Str\" + dsName + \"String_Node_Str\" + testedClass.nameOfTestedClass + \"String_Node_Str\");\n}\n"
|
"public INDArray vectorAlongDimension(int index, int dimension) {\n if (dimension < 0)\n dimension = Shape.rank(shapeInformation) + dimension;\n if (dimension == Shape.rank(shapeInformation) - 1 && size(dimension) == 1 && rank() > 2 || rank() > 2 && dimension == 0 && size(dimension) == 1) {\n return this;\n }\n INDArray ret = tensorAlongDimension(index, dimension);\n if (isMatrix() && ret.isVector() && dimension == 1 && !ret.isRowVector())\n return ret.reshape(ArrayUtil.reverseCopy(ret.shape()));\n else if (isMatrix() && ret.isVector() && dimension == 0 && !ret.isColumnVector())\n return ret.reshape(ArrayUtil.reverseCopy(ret.shape()));\n return ret;\n}\n"
|
"public synchronized void drawPlot(Graphics graphics, boolean clearfirst) {\n if (_debug > 7)\n System.out.println(\"String_Node_Str\" + graphics);\n if (graphics == null) {\n System.out.println(\"String_Node_Str\" + \"String_Node_Str\");\n return;\n }\n Rectangle drawRect = bounds();\n if (_debug > 15) {\n System.out.println(\"String_Node_Str\" + drawRect.width + \"String_Node_Str\" + drawRect.height);\n graphics.drawRect(0, 0, drawRect.width, drawRect.height);\n }\n graphics.setPaintMode();\n if (clearfirst) {\n graphics.clearRect(0, 0, drawRect.width - 1, drawRect.height - 1);\n }\n if (_debug > 8) {\n System.out.println(\"String_Node_Str\" + drawRect.width + \"String_Node_Str\" + drawRect.height + \"String_Node_Str\" + drawRect.x + \"String_Node_Str\" + drawRect.y);\n graphics.drawRect(0, 0, drawRect.width - 1, drawRect.height - 1);\n }\n if (_errorMsg != null) {\n int fheight = _labelFontMetrics.getHeight() + 2;\n int msgy = fheight;\n graphics.setColor(Color.black);\n for (int i = 0; i < _errorMsg.length; i++) {\n graphics.drawString(_errorMsg[i], 10, msgy);\n msgy += fheight;\n }\n return;\n }\n if (!_xRangeGiven) {\n if (_xBottom > _xTop) {\n _setXRange(0, 0);\n } else {\n _setXRange(_xBottom, _xTop);\n }\n }\n if (!_yRangeGiven) {\n if (_yBottom > _yTop) {\n _setYRange(0, 0);\n } else {\n _setYRange(_yBottom, _yTop);\n }\n }\n int titley = 0;\n int titlefontheight = _titleFontMetrics.getHeight();\n if (_title != null || _yExp != 0) {\n titley = titlefontheight + _topPadding;\n }\n graphics.setFont(_labelfont);\n int labelheight = _labelFontMetrics.getHeight();\n int halflabelheight = labelheight / 2;\n int ySPos = drawRect.height - 5;\n if (_xExp != 0 && _xticks == null) {\n int xSPos = drawRect.x + drawRect.width - _rightPadding;\n String superscript = Integer.toString(_xExp);\n xSPos -= _superscriptFontMetrics.stringWidth(superscript);\n graphics.setFont(_superscriptfont);\n graphics.drawString(superscript, xSPos, ySPos - halflabelheight);\n xSPos -= _labelFontMetrics.stringWidth(\"String_Node_Str\");\n graphics.setFont(_labelfont);\n graphics.drawString(\"String_Node_Str\", xSPos, ySPos);\n _bottomPadding = (3 * labelheight) / 2 + 5;\n }\n if (_xlabel != null && _bottomPadding < labelheight + 5) {\n _bottomPadding = titlefontheight + 5;\n }\n _uly = drawRect.y + titley + 5;\n _lry = drawRect.height - labelheight - _bottomPadding - 3;\n int height = _lry - _uly;\n _yscale = height / (_yMax - _yMin);\n _ytickscale = height / (_ytickMax - _ytickMin);\n int ny = 2 + height / (labelheight + 10);\n double yStep = _roundUp((_ytickMax - _ytickMin) / (double) ny);\n double yStart = yStep * Math.ceil(_ytickMin / yStep);\n int widesty = 0;\n String[] ylabels = new String[ny];\n int[] ylabwidth = new int[ny];\n int ind = 0;\n if (_yticks == null) {\n int numfracdigits = _numFracDigits(yStep);\n for (double ypos = yStart; ypos <= _ytickMax; ypos += yStep) {\n if (ind >= ny)\n break;\n String yl = _formatNum(ypos, numfracdigits);\n ylabels[ind] = yl;\n int lw = _labelFontMetrics.stringWidth(yl);\n ylabwidth[ind++] = lw;\n if (lw > widesty) {\n widesty = lw;\n }\n }\n } else {\n Enumeration nl = _yticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n int lw = _labelFontMetrics.stringWidth(label);\n if (lw > widesty) {\n widesty = lw;\n }\n }\n }\n if (_ylabel != null) {\n _ulx = drawRect.x + widesty + _labelFontMetrics.stringWidth(\"String_Node_Str\") + _leftPadding;\n } else {\n _ulx = drawRect.x + widesty + _leftPadding;\n }\n int legendwidth = _drawLegend(graphics, drawRect.width - _rightPadding, _uly);\n _lrx = drawRect.width - legendwidth - _rightPadding;\n int width = _lrx - _ulx;\n _xscale = width / (_xMax - _xMin);\n _xtickscale = width / (_xtickMax - _xtickMin);\n graphics.setColor(_background);\n graphics.fillRect(_ulx, _uly, width, height);\n graphics.setColor(_foreground);\n graphics.drawRect(_ulx, _uly, width, height);\n int tickLength = 5;\n int xCoord1 = _ulx + tickLength;\n int xCoord2 = _lrx - tickLength;\n if (_yticks == null) {\n ind = 0;\n for (double ypos = yStart; ypos <= _ytickMax; ypos += yStep) {\n if (ind >= ny)\n break;\n int yCoord1 = _lry - (int) ((ypos - _ytickMin) * _ytickscale);\n int offset = 0;\n if (ind > 0)\n offset = halflabelheight;\n graphics.drawLine(_ulx, yCoord1, xCoord1, yCoord1);\n graphics.drawLine(_lrx, yCoord1, xCoord2, yCoord1);\n if (_grid && yCoord1 != _uly && yCoord1 != _lry) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord2, yCoord1);\n graphics.setColor(_foreground);\n }\n graphics.drawString(ylabels[ind], _ulx - ylabwidth[ind++] - 4, yCoord1 + offset);\n }\n if (_yExp != 0) {\n graphics.drawString(\"String_Node_Str\", 2, titley);\n graphics.setFont(_superscriptfont);\n graphics.drawString(Integer.toString(_yExp), _labelFontMetrics.stringWidth(\"String_Node_Str\") + 2, titley - halflabelheight);\n graphics.setFont(_labelfont);\n }\n } else {\n Enumeration nt = _yticks.elements();\n Enumeration nl = _yticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n double ypos = ((Double) (nt.nextElement())).doubleValue();\n if (ypos > _yMax || ypos < _yMin)\n continue;\n int yCoord1 = _lry - (int) ((ypos - _yMin) * _ytickscale);\n int offset = 0;\n if (ypos < _lry - labelheight)\n offset = halflabelheight;\n graphics.drawLine(_ulx, yCoord1, xCoord1, yCoord1);\n graphics.drawLine(_lrx, yCoord1, xCoord2, yCoord1);\n if (_grid && yCoord1 != _uly && yCoord1 != _lry) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord2, yCoord1);\n graphics.setColor(_foreground);\n }\n graphics.drawString(label, _ulx - _labelFontMetrics.stringWidth(label) - 3, yCoord1 + offset);\n }\n }\n int yCoord1 = _uly + tickLength;\n int yCoord2 = _lry - tickLength;\n if (_xticks == null) {\n int nx = 10;\n double xStep = 0.0;\n int numfracdigits = 0;\n int charwidth = _labelFontMetrics.stringWidth(\"String_Node_Str\");\n int count = 0;\n while (count++ <= 10) {\n xStep = _roundUp((_xtickMax - _xtickMin) / (double) nx);\n numfracdigits = _numFracDigits(xStep);\n int intdigits = _numIntDigits(_xtickMax);\n int inttemp = _numIntDigits(_xtickMin);\n if (intdigits < inttemp) {\n intdigits = inttemp;\n }\n int maxlabelwidth = charwidth * (numfracdigits + 2 + intdigits);\n int savenx = nx;\n nx = 2 + width / (maxlabelwidth + 10);\n if (nx - savenx <= 1 || savenx - nx <= 1)\n break;\n }\n xStep = _roundUp((_xtickMax - _xtickMin) / (double) nx);\n numfracdigits = _numFracDigits(xStep);\n double xStart = xStep * Math.ceil(_xtickMin / xStep);\n for (double xpos = xStart; xpos <= _xtickMax; xpos += xStep) {\n String xticklabel = _formatNum(xpos, numfracdigits);\n xCoord1 = _ulx + (int) ((xpos - _xtickMin) * _xtickscale);\n graphics.drawLine(xCoord1, _uly, xCoord1, yCoord1);\n graphics.drawLine(xCoord1, _lry, xCoord1, yCoord2);\n if (_grid && xCoord1 != _ulx && xCoord1 != _lrx) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord1, yCoord2);\n graphics.setColor(_foreground);\n }\n int labxpos = xCoord1 - _labelFontMetrics.stringWidth(xticklabel) / 2;\n graphics.drawString(xticklabel, labxpos, _lry + 3 + labelheight);\n }\n } else {\n Enumeration nt = _xticks.elements();\n Enumeration nl = _xticklabels.elements();\n while (nl.hasMoreElements()) {\n String label = (String) nl.nextElement();\n double xpos = ((Double) (nt.nextElement())).doubleValue();\n if (xpos > _xMax || xpos < _xMin)\n continue;\n xCoord1 = _ulx + (int) ((xpos - _xtickMin) * _xtickscale);\n graphics.drawLine(xCoord1, _uly, xCoord1, yCoord1);\n graphics.drawLine(xCoord1, _lry, xCoord1, yCoord2);\n if (_grid && xCoord1 != _ulx && xCoord1 != _lrx) {\n graphics.setColor(Color.lightGray);\n graphics.drawLine(xCoord1, yCoord1, xCoord1, yCoord2);\n graphics.setColor(_foreground);\n }\n int labxpos = xCoord1 - _labelFontMetrics.stringWidth(label) / 2;\n graphics.drawString(label, labxpos, _lry + 3 + labelheight);\n }\n }\n graphics.setColor(_foreground);\n if (_title != null) {\n graphics.setFont(_titlefont);\n int titlex = _ulx + (width - _titleFontMetrics.stringWidth(_title)) / 2;\n graphics.drawString(_title, titlex, titley);\n }\n graphics.setFont(_labelfont);\n if (_xlabel != null) {\n int labelx = _ulx + (width - _labelFontMetrics.stringWidth(_xlabel)) / 2;\n graphics.drawString(_xlabel, labelx, ySPos);\n }\n int charcenter = 2 + _labelFontMetrics.stringWidth(\"String_Node_Str\") / 2;\n int charheight = labelheight;\n if (_ylabel != null) {\n int yl = _ylabel.length();\n int starty = _uly + (_lry - _uly) / 2 - yl * charheight / 2 + charheight;\n for (int i = 0; i < yl; i++) {\n String nchar = _ylabel.substring(i, i + 1);\n int cwidth = _labelFontMetrics.stringWidth(nchar);\n graphics.drawString(nchar, charcenter - cwidth / 2, starty);\n starty += charheight;\n }\n }\n}\n"
|
"public void testGetCerts() {\n consumerResource.bind(consumer.getUuid(), pool.getId(), null, null, 1, null, null);\n List<EntitlementCertificate> serials = consumerResource.getEntitlementCertificates(consumer.getUuid(), null);\n assertEquals(1, serials.size());\n}\n"
|
"private void handlePullRequestEvent(String payload) throws IOException {\n GitHub gitHub = createGitHub(payload);\n if (gitHub == null) {\n return;\n }\n GHEventPayload.PullRequest pullRequest = gitHub.parseEventPayload(new StringReader(payload), GHEventPayload.PullRequest.class);\n if (SUPPORTED_EVENTS.contains(pullRequest.getAction())) {\n Authentication old = SecurityContextHolder.getContext().getAuthentication();\n SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);\n try {\n for (AbstractProject<?, ?> job : Jenkins.getInstance().getAllItems(AbstractProject.class)) {\n PullRequestBuildTrigger trigger = job.getTrigger(PullRequestBuildTrigger.class);\n if (trigger != null && trigger.getBuildHandler() instanceof PullRequestBuildHandler) {\n ((PullRequestBuildHandler) trigger.getBuildHandler()).handle(pullRequest, gitHub);\n }\n }\n } finally {\n SecurityContextHolder.getContext().setAuthentication(old);\n }\n } else {\n LOGGER.warning(MessageFormat.format(\"String_Node_Str\", pullRequest.getAction()));\n }\n}\n"
|
"public List<RepositoryFileDto> doGetGeneratedContentForSchedule(String lineageId) throws FileNotFoundException {\n return getFileService().searchGeneratedContent(getSessionResource().doGetCurrentUserDir(), lineageId, QuartzScheduler.RESERVEDMAPKEY_LINEAGE_ID);\n}\n"
|
"private boolean importExists(java.util.List imports, String schemaName) {\n for (int i = 0; i < imports.size(); i++) {\n Include nextImport = (Include) imports.get(i);\n if (nextImport.getSchemaLocation() != null && nextImport.getSchemaLocation().equals(schemaName)) {\n return true;\n }\n }\n return false;\n}\n"
|
"public Future<ConnectionState> connect() {\n Future<ConnectionState> retVal;\n connectionLock.lock();\n try {\n if (state == ConnectionState.Connected) {\n retVal = createInstantFuture(state);\n } else if (state == ConnectionState.Connecting) {\n retVal = hookIntoConnectThread();\n } else {\n retVal = startConnectThread();\n }\n } finally {\n connectionLock.unlock();\n }\n return retVal;\n}\n"
|
"Element getImageElement() {\n return statusImage.getElement();\n}\n"
|
"public BinRange[] getNormalizedRanges(final NumericData range) {\n final Calendar startEpoch = Calendar.getInstance(TimeZone.getTimeZone(timezone));\n final long binSizeMillis = getBinSizeMillis();\n startEpoch.setTimeInMillis((long) range.getMin());\n setToEpoch(startEpoch);\n final long startEpochMillis = startEpoch.getTimeInMillis();\n long epochIterator = startEpochMillis;\n final List<BinRange> bins = new ArrayList<BinRange>();\n boolean firstBin = ((long) range.getMin() != startEpochMillis);\n boolean lastBin = false;\n do {\n final Calendar nextEpochCal = Calendar.getInstance(TimeZone.getTimeZone(timezone));\n nextEpochCal.setTimeInMillis(epochIterator + (long) (binSizeMillis * 1.5));\n setToEpoch(nextEpochCal);\n final long nextEpoch = nextEpochCal.getTimeInMillis();\n final long maxOfBin = nextEpoch - 1;\n final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(timezone));\n cal.setTimeInMillis(epochIterator);\n long startMillis, endMillis;\n boolean fullExtent;\n if ((long) range.getMax() <= maxOfBin) {\n lastBin = true;\n endMillis = (long) range.getMax();\n fullExtent = range.getMax() == maxOfBin;\n } else {\n endMillis = maxOfBin;\n fullExtent = !firstBin;\n }\n if (firstBin) {\n startMillis = (long) range.getMin();\n firstBin = false;\n } else {\n startMillis = epochIterator;\n }\n bins.add(new BinRange(getBinId(cal), startMillis - epochIterator, endMillis - epochIterator, fullExtent));\n epochIterator = nextEpoch;\n } while (!lastBin);\n return bins.toArray(new BinRange[bins.size()]);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.