content
stringlengths 40
137k
|
---|
"public JSocialKademliaStorageEntry get(GetParameter param) throws NoSuchElementException, IOException, ContentNotFoundException {\n if (this.dht.contains(param)) {\n JSocialKademliaStorageEntry e = this.dht.get(param);\n if (e.getContentMetadata().isCached()) {\n GetParameterFUC gpf = new GetParameterFUC(e.getContentMetadata());\n try {\n return this.decompressStorageEntry(this.getUpdated(gpf));\n } catch (UpToDateContentException ex) {\n return this.decompressStorageEntry(e);\n }\n } else {\n return this.decompressStorageEntry(e);\n }\n }\n long startTime = System.nanoTime();\n ContentLookupOperation clo = new ContentLookupOperation(server, this, param, this.config);\n clo.execute();\n long endTime = System.nanoTime();\n this.statistician.addContentLookup(endTime - startTime, clo.routeLength(), clo.isContentFound());\n return this.decompressStorageEntry(clo.getContentFound());\n}\n"
|
"public void generate(CoreChunk view, Random rand, int posX, int posY, int posZ) {\n Vector3f position = new Vector3f(0f, 0f, 0f);\n Matrix4f rotation = new Matrix4f(new AxisAngle4f(0f, 0f, 1f, (float) Math.PI / 2f));\n float angleOffset = rand.nextFloat(-MAX_ANGLE_OFFSET, MAX_ANGLE_OFFSET);\n recurse(view, rand, posX, posY, posZ, angleOffset, new CharSequenceIterator(initialAxiom), position, rotation, 0);\n}\n"
|
"protected int[] fromJHPL(int[] transformation) {\n int[] result = new int[transformation.length];\n for (int i = 0; i < result.length; i++) {\n result[i] = transformation[transformation.length - i - 1] + offsetIndices[transformation.length - i - 1];\n }\n return result;\n}\n"
|
"public void saveValue(ArrayList<String> keys, ArrayList<HasValueWidget> values) {\n if (values == null || values.size() < 1 || this.currentSelected == null) {\n clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR, \"String_Node_Str\", FooterView.DEFAULT_STATUS_CLEAR_DELAY);\n }\n LOG.log(Level.INFO, \"String_Node_Str\" + values);\n SearchResultRow result = new SearchResultRow();\n result.setExtraFieldDescs(this.currentSelected.getExtraFieldDescs());\n for (int i = 0; i < values.size(); i++) {\n result.addField(values.get(i).getValue());\n }\n this.clientFactory.getBackendService().setConfiguration(this.clientFactory.getLocalSession().getSession(), result, new AsyncCallback<Void>() {\n public void onFailure(Throwable cause) {\n LOG.log(Level.WARNING, \"String_Node_Str\", cause);\n }\n public void onSuccess(Void arg0) {\n clientFactory.getShellView().getDetailView().disableSave();\n reloadCurrentRange();\n }\n });\n}\n"
|
"public void update() {\n Throwable t = null;\n try {\n WSAttributeValue surname = new WSAttributeValue();\n surname.setName(\"String_Node_Str\");\n surname.setValues(Collections.singletonList(\"String_Node_Str\"));\n surname.setKey(true);\n WSAttributeValue name = new WSAttributeValue();\n name.setName(\"String_Node_Str\");\n name.setValue(\"String_Node_Str\");\n List<WSAttributeValue> attrs = new ArrayList<WSAttributeValue>();\n attrs.add(surname);\n attrs.add(name);\n String uid = provisioning.update(\"String_Node_Str\", attrs);\n assertNotNull(uid);\n assertEquals(\"String_Node_Str\", uid);\n } catch (Exception e) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\", e);\n }\n t = e;\n }\n assertNull(t);\n}\n"
|
"public int executeCommand(CommandContext context) {\n int pid = context.getArgumentAsInt(0);\n if (removePid(pid)) {\n return 0;\n }\n context.err.println(\"String_Node_Str\");\n return 1;\n}\n"
|
"private void createTempRootDir() {\n if (tempRootDirStr != null && new File(tempRootDirStr).exists() == true)\n return;\n File tempDtEDir = null;\n synchronized (cacheCounter1) {\n String tempDirStr = DataEngineContextExt.getInstance().getTmpdir();\n tempDtEDir = new File(tempDirStr, \"String_Node_Str\" + System.currentTimeMillis() + cacheCounter1);\n cacheCounter1 = new Integer(cacheCounter1.intValue() + 1);\n int x = 0;\n while (tempDtEDir.exists()) {\n x++;\n tempDtEDir = new File(tempDirStr, \"String_Node_Str\" + System.currentTimeMillis() + cacheCounter1 + \"String_Node_Str\" + x);\n }\n }\n try {\n tempRootDirStr = tempDtEDir.getCanonicalPath();\n } catch (IOException e) {\n }\n}\n"
|
"private void calcXValAverageLength() {\n if (mXVals.size() == 0) {\n mXValAverageLength = 1;\n return;\n }\n float sum = 0f;\n for (int i = 0; i < mXVals.size(); i++) {\n sum += mXVals.get(i).length();\n }\n mXValAverageLength = sum / mXVals.size();\n}\n"
|
"public void testWildcardMatcher() throws Exception {\n Object[][] v = new Object[][] { { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", false }, { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", true } };\n for (Object[] j : v) {\n assertEquals(j[0].toString(), j[3], JsseDefaultHostnameAuthorizer.isValidNameMatch((String) j[1], (String) j[2], null));\n }\n}\n"
|
"private void dumpObject(StringBuilder out, Object o, char separator, List<String> ignoredProps) {\n if (o == null) {\n out.append(\"String_Node_Str\");\n } else {\n Class oClass = o.getClass();\n JSONifier jsonifier;\n if (oClass.isPrimitive()) {\n out.append(o);\n } else if (Number.class.isAssignableFrom(oClass) || oClass.equals(Boolean.class) || oClass.equals(Character.class)) {\n out.append(o);\n } else if (o instanceof String) {\n quote(out, (String) o);\n } else if (o instanceof Collection) {\n out.append(\"String_Node_Str\");\n } else {\n Class oClass = o.getClass();\n JSONifier jsonifier;\n if (oClass.isPrimitive()) {\n out.append(o);\n } else if (Number.class.isAssignableFrom(oClass) || oClass.equals(Boolean.class) || oClass.equals(Character.class)) {\n out.append(o);\n } else if (o instanceof String) {\n quote(out, (String) o);\n } else if (o instanceof Collection) {\n out.append(\"String_Node_Str\");\n for (Iterator i = ((Collection) o).iterator(); i.hasNext(); ) {\n dumpObject(out, i.next(), i.hasNext() ? ',' : '\\0', ignoredProps);\n }\n out.append(\"String_Node_Str\");\n } else if (o.getClass().isArray()) {\n out.append(\"String_Node_Str\");\n int len = Array.getLength(o);\n for (int i = 0; i < len; i++) {\n dumpObject(out, Array.get(o, i), ((i < (len - 1)) ? ',' : '\\0'), ignoredProps);\n }\n out.append(\"String_Node_Str\");\n } else if (o instanceof Map) {\n out.append(\"String_Node_Str\");\n Map m = (Map) o;\n for (Iterator i = m.keySet().iterator(); i.hasNext(); ) {\n Object key = i.next();\n dumpObject(out, key.toString(), '\\0', ignoredProps);\n out.append(\"String_Node_Str\");\n dumpObject(out, m.get(key), i.hasNext() ? ',' : '\\0', ignoredProps);\n }\n out.append(\"String_Node_Str\");\n } else if ((jsonifier = jsonifiers.get(oClass)) != null) {\n out.append(jsonifier.toJSON(o));\n } else if (o instanceof JSONable) {\n out.append(((JSONable) o).toJSON());\n } else {\n BeanInfo info = Introspector.getBeanInfo(o.getClass());\n out.append(\"String_Node_Str\");\n boolean first = true;\n PropertyDescriptor[] pds = info.getPropertyDescriptors();\n for (int cp = 0; cp < pds.length; cp++) {\n PropertyDescriptor pd = pds[cp];\n Method method = pd.getReadMethod();\n Method writeMethod = pd.getWriteMethod();\n if (method != null) {\n Object value = method.invoke(o, (Object[]) null);\n String name = pd.getName();\n boolean ignore = (ignoredProps != null && ignoredProps.contains(name));\n if (!name.equals(\"String_Node_Str\") && !ignore) {\n JSONProperty jsonProperty = method.getAnnotation(JSONProperty.class);\n if (jsonProperty == null && writeMethod != null) {\n jsonProperty = writeMethod.getAnnotation(JSONProperty.class);\n }\n if (jsonProperty != null) {\n name = jsonProperty.value();\n ignore = jsonProperty.ignore() || (value == null && jsonProperty.ignoreIfNull());\n }\n if (!ignore) {\n if (!first) {\n out.append(',');\n }\n quote(out, name);\n out.append(':');\n dumpObject(out, value, '\\0', ignoredProps);\n first = false;\n }\n }\n }\n }\n if (o instanceof DynamicProperties) {\n DynamicProperties dynAttrs = (DynamicProperties) o;\n for (String name : dynAttrs.propertyNames()) {\n out.append(',');\n quote(out, name);\n out.append(':');\n dumpObject(out, dynAttrs.getProperty(name), '\\0', ignoredProps);\n }\n }\n out.append(\"String_Node_Str\");\n }\n }\n if (separator != '\\0') {\n out.append(separator);\n }\n } catch (IntrospectionException ie) {\n throw new RuntimeException(\"String_Node_Str\", ie);\n } catch (IllegalAccessException iae) {\n throw new RuntimeException(\"String_Node_Str\", iae);\n } catch (InvocationTargetException ite) {\n throw new RuntimeException(\"String_Node_Str\", ite);\n }\n}\n"
|
"public static Drawable getBorderDrawable(LayoutParser parser, Context context) {\n if (!parser.isObject() || parser.isNull()) {\n return null;\n }\n float cornerRadius = 0;\n int borderWidth = 0, borderColor = Color.TRANSPARENT, bgColor = Color.TRANSPARENT;\n parser = parser.peek();\n String value = parser.getString(ATTRIBUTE_BG_COLOR);\n if (value != null && !value.equals(\"String_Node_Str\")) {\n bgColor = ParseHelper.parseColor(value);\n }\n value = parser.getString(ATTRIBUTE_BORDER_COLOR);\n if (value != null) {\n borderColor = ParseHelper.parseColor(value);\n }\n value = parser.getString(ATTRIBUTE_BORDER_RADIUS);\n if (value != null) {\n cornerRadius = ParseHelper.parseDimension(value, context);\n }\n value = parser.getString(ATTRIBUTE_BORDER_WIDTH);\n if (value != null) {\n borderWidth = (int) ParseHelper.parseDimension(value, context);\n }\n GradientDrawable border = new GradientDrawable();\n border.setCornerRadius(cornerRadius);\n border.setShape(GradientDrawable.RECTANGLE);\n border.setStroke(borderWidth, borderColor);\n border.setColor(bgColor);\n return border;\n}\n"
|
"private void deleteOld() {\n File file = new File(format(pathname, index - maxRollingFileCount));\n boolean exist = file.exists();\n if (exist) {\n if (!file.delete()) {\n logger.warning(\"String_Node_Str\" + file.getAbsolutePath());\n }\n }\n}\n"
|
"public void addLinksWithoutGrabber(final Vector<DownloadLink> parameter) {\n if (parameter == null || parameter.size() == 0) {\n return;\n }\n Vector<DownloadLink> linkList = checkLinks(parameter);\n Vector<Vector<DownloadLink>> links = new Vector<Vector<DownloadLink>>();\n Vector<String> packages = new Vector<String>();\n SubConfiguration guiConfig = JDUtilities.getSubConfig(SimpleGUI.GUICONFIGNAME);\n for (int i = 0; i < linkList.size(); i++) {\n if (!guiConfig.getBooleanProperty(\"String_Node_Str\", true)) {\n packages.add(removeExtension(linkList.get(i).getName()));\n links.get(0).add(linkList.get(i));\n } else {\n int bestSim = 0;\n int bestIndex = -1;\n for (int j = 0; j < packages.size(); j++) {\n int sim = comparePackages(packages.get(j), removeExtension(linkList.get(i).getName()));\n if (sim > bestSim) {\n bestSim = sim;\n bestIndex = j;\n }\n }\n if (bestSim > guiConfig.getIntegerProperty(\"String_Node_Str\", 98) && bestIndex != -1) {\n links.get(bestIndex).add(linkList.get(i));\n } else {\n packages.add(removeExtension(linkList.get(i).getName()));\n Vector<DownloadLink> temp = new Vector<DownloadLink>();\n temp.add(linkList.get(i));\n links.add(temp);\n }\n }\n }\n for (int i = 0; i < packages.size(); i++) {\n int rand = (int) (Math.random() * 0xffffff);\n Color c = new Color(rand);\n c = c.brighter();\n FilePackage fp = new FilePackage();\n fp.setProperty(\"String_Node_Str\", c);\n fp.setName(packages.get(i));\n String downloadDir = JDUtilities.getConfiguration().getDefaultDownloadDirectory();\n if (JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_USE_PACKETNAME_AS_SUBFOLDER, false)) {\n File file = new File(new File(downloadDir), packages.get(i));\n if (JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_CREATE_SUBFOLDER_BEFORE_DOWNLOAD, false)) {\n if (!file.exists()) {\n file.mkdirs();\n }\n } else\n fp.setDownloadDirectory(file.getAbsolutePath());\n } else {\n fp.setDownloadDirectory(downloadDir);\n }\n fp.setDownloadLinks(links.get(i));\n for (int j = 0; j < links.get(i).size(); j++) {\n links.get(i).get(j).setFilePackage(fp);\n }\n JDUtilities.getGUI().fireUIEvent(new UIEvent(this, UIEvent.UI_PACKAGE_GRABBED, fp));\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n}\n"
|
"public static AbyssV134InputLibsArg parse(String libs) {\n AbyssV134InputLibsArg libsArg = new AbyssV134InputLibsArg();\n List<String> peLibs = getAbyssArgs(libs, \"String_Node_Str\");\n List<String> mpLibs = getAbyssArgs(libs, \"String_Node_Str\");\n List<String> seLibs = getAbyssArgs(libs, \"String_Node_Str\");\n List<Library> allLibs = new ArrayList<Library>();\n for (String peLib : peLibs) {\n List<String> peLibPaths = getAbyssArgs(libs, peLib);\n if (peLibPaths.size() == 2) {\n allLibs.add(createNewPELibrary(peLibPaths.get(0), peLibPaths.get(1), Library.Type.PE));\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n }\n for (String mpLib : mpLibs) {\n List<String> mpLibPaths = getAbyssArgs(libs, mpLib);\n if (mpLibPaths.size() == 2) {\n allLibs.add(createNewPELibrary(mpLibPaths.get(0), mpLibPaths.get(1), Library.Type.MP));\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n }\n for (String seLib : seLibs) {\n allLibs.add(createNewSELibrary(seLib));\n }\n libsArg.setLibs(allLibs);\n return libsArg;\n}\n"
|
"public void componentChanged(ComponentChangeEvent e) {\n if (e.getCode() == ComponentChangeEvent.Code.STRUCTURE_CHANGED || e.getCode() == ComponentChangeEvent.Code.DYNAMIC_ACTIVITY_CHANGED) {\n boolean invalidateWaypoints = false;\n RootModel root = getRootModel();\n if (root != null) {\n invalidateWaypoints = changeAffectsWaypoints(root, e);\n if (invalidateWaypoints) {\n root.getWayPoints().invalidateAfterTime(0);\n }\n }\n ModelComponent c = e.getComponent();\n if (myTimeline != null) {\n if (root != null && c == root.getWayPoints()) {\n myTimeline.requestUpdateWidgets();\n } else {\n myTimeline.requestUpdateDisplay();\n }\n }\n if (e.getCode() == ComponentChangeEvent.Code.STRUCTURE_CHANGED) {\n if (c != null && c instanceof CompositeComponent && myFrame != null) {\n myFrame.getNavPanel().updateStructure(c);\n if (root != null && (c == root.getInputProbes() || c == root.getOutputProbes())) {\n myTimeline.updateProbes();\n }\n }\n }\n if (invalidateWaypoints && !myScheduler.isPlaying()) {\n myScheduler.invalidateInitialState();\n }\n } else if (e.getCode() == ComponentChangeEvent.Code.NAME_CHANGED) {\n ModelComponent c = e.getComponent();\n if (myFrame != null) {\n if (c.getParent() != null) {\n myFrame.getNavPanel().updateStructure(c.getParent());\n } else {\n myFrame.getNavPanel().updateStructure(c);\n }\n }\n } else if (e.getCode() == ComponentChangeEvent.Code.PROPERTY_CHANGED) {\n PropertyChangeEvent pe = (PropertyChangeEvent) e;\n ModelComponent c = e.getComponent();\n if (c == getRootModel()) {\n if (pe.getPropertyName().equals(\"String_Node_Str\")) {\n doSetMaxStep(getRootModel().getMaxStepSize());\n } else if (pe.getPropertyName().equals(\"String_Node_Str\")) {\n if (myViewerManager != null) {\n myViewerManager.resetViewers(getRootModel().getDefaultViewOrientation());\n }\n }\n } else if (pe.getPropertyName().startsWith(\"String_Node_Str\")) {\n if (myFrame != null) {\n myFrame.getNavPanel().updateStructure(e.getComponent());\n }\n }\n } else if (e.getCode() == ComponentChangeEvent.Code.GEOMETRY_CHANGED) {\n if (!getScheduler().isPlaying()) {\n rerender();\n }\n }\n}\n"
|
"private void saveSPOTWorkspace() throws InPUTException {\n runCommand(\"String_Node_Str\" + studyId + \"String_Node_Str\" + File.separator + \"String_Node_Str\", false);\n saveSPOTHistory();\n}\n"
|
"private ArrayList<Integer> traverse(ArrayList<Integer> indexes, ClusterNode node) {\n if (tree.hasChildren(node) == false) {\n indexes.add(node.getClusterNr() + 1);\n } else {\n for (ClusterNode current : tree.getChildren(node)) {\n traverse(indexes, current);\n }\n }\n return indexes;\n}\n"
|
"private Entry scanForUpdates() {\n synchronized (warmer) {\n for (Entry ent : warmer.entries.values()) {\n if (ent.exception != null) {\n if (System.currentTimeMillis() - ent.exceptionTime < 60000)\n continue;\n ent.exception = null;\n }\n if (ent.newPath.exists() && (ent.pendingPath.exists() || ent.sparePath.exists())) {\n if (ent.pendingPath.exists())\n return ent;\n } else if (ent.curSearcher != null) {\n try {\n if (!ent.curSearcher.isUpToDate())\n return ent;\n } catch (IOException e) {\n ent.exception = e;\n Trace.error(String.format(\"String_Node_Str\", ent.indexPath, e.toString()));\n }\n }\n }\n return null;\n }\n}\n"
|
"private SlotHandle getDefaultSlotHandle(String insertType) {\n IStructuredSelection models = InsertInLayoutUtil.editPart2Model(getSelection());\n if (models.isEmpty()) {\n return null;\n }\n model = DNDUtil.unwrapToModel(models.getFirstElement());\n if (model instanceof LibRootModel) {\n model = ((LibRootModel) model).getModel();\n }\n if (model instanceof SlotHandle) {\n return (SlotHandle) model;\n } else if (model instanceof DesignElementHandle) {\n DesignElementHandle handle = (DesignElementHandle) model;\n if (handle.getDefn().isContainer()) {\n int slotId = DEUtil.getDefaultSlotID(handle);\n if (handle.canContain(slotId, insertType)) {\n return handle.getSlot(slotId);\n }\n }\n return handle.getContainerSlotHandle();\n }\n return null;\n}\n"
|
"public void createControl(Composite parent) {\n ChartUIUtil.bindHelp(parent, ChartHelpContextIds.SUBTASK_TITLE);\n init();\n cmpContent = new Composite(parent, SWT.NONE);\n {\n cmpContent.setLayout(new GridLayout());\n GridData gd = new GridData(GridData.FILL_BOTH);\n cmpContent.setLayoutData(gd);\n }\n Composite cmpBasic = new Composite(cmpContent, SWT.NONE);\n {\n cmpBasic.setLayout(new GridLayout(4, false));\n GridData gd = new GridData(GridData.FILL_BOTH);\n cmpBasic.setLayoutData(gd);\n }\n Label lblTitle = new Label(cmpBasic, SWT.NONE);\n {\n lblTitle.setText(Messages.getString(\"String_Node_Str\"));\n }\n Composite titleComp = new Composite(cmpBasic, SWT.NONE);\n GridLayout gl = new GridLayout();\n gl.numColumns = 2;\n gl.marginLeft = 0;\n gl.marginRight = 0;\n gl.marginTop = 0;\n gl.marginBottom = 0;\n titleComp.setLayout(gl);\n btnTitleContentAuto = new Button(titleComp, SWT.CHECK);\n btnTitleContentAuto.setSelection(getChart().getTitle().getLabel().getCaption().getValue() == null);\n btnTitleContentAuto.addSelectionListener(this);\n List<String> keys = null;\n if (getContext().getUIServiceProvider() != null) {\n keys = getContext().getUIServiceProvider().getRegisteredKeys();\n }\n txtTitle = new ExternalizedTextEditorComposite(cmpBasic, SWT.BORDER, -1, -1, keys, getContext().getUIServiceProvider(), getTitleText());\n {\n GridData gdTXTTitle = new GridData();\n gdTXTTitle.widthHint = 200;\n txtTitle.setLayoutData(gdTXTTitle);\n txtTitle.setEnabled(isTitleEnabled());\n txtTitle.addListener(this);\n }\n btnVisible = new TristateCheckbox(cmpBasic, SWT.NONE);\n btnVisible.setText(Messages.getString(\"String_Node_Str\"));\n GridData gd = new GridData();\n btnVisible.setLayoutData(gd);\n btnVisible.setSelectionState(getChart().getTitle().isSetVisible() ? (getChart().getTitle().isVisible() ? TristateCheckbox.STATE_SELECTED : TristateCheckbox.STATE_UNSELECTED) : TristateCheckbox.STATE_GRAYED);\n btnVisible.addSelectionListener(this);\n btnAutoTitle = new TristateCheckbox(cmpBasic, SWT.NONE);\n btnAutoTitle.setText(Messages.getString(\"String_Node_Str\"));\n gd = new GridData();\n btnAutoTitle.setLayoutData(gd);\n btnAutoTitle.setSelectionState(getChart().getTitle().isSetAuto() ? (getChart().getTitle().isAuto() ? TristateCheckbox.STATE_SELECTED : TristateCheckbox.STATE_UNSELECTED) : TristateCheckbox.STATE_GRAYED);\n btnAutoTitle.setEnabled(isAutoEnabled());\n boolean autoTitleVisible = getContext().getUIFactory().createUIHelper().isDefaultTitleSupported();\n btnAutoTitle.setVisible(autoTitleVisible);\n btnAutoTitle.addSelectionListener(this);\n Label lblFont = new Label(cmpBasic, SWT.NONE);\n lblFont.setText(Messages.getString(\"String_Node_Str\"));\n fdcFont = new FontDefinitionComposite(cmpBasic, SWT.NONE, getContext(), getChart().getTitle().getLabel().getCaption().getFont(), getChart().getTitle().getLabel().getCaption().getColor(), true);\n GridData gdFDCFont = new GridData();\n gdFDCFont.widthHint = 220;\n gdFDCFont.grabExcessVerticalSpace = false;\n fdcFont.setLayoutData(gdFDCFont);\n fdcFont.addListener(this);\n createButtonGroup(cmpContent);\n updateUIState(btnVisible.getSelectionState() == TristateCheckbox.STATE_SELECTED);\n}\n"
|
"private void synchronize(double height) {\n XlsContainer rowContainer = getCurrentContainer();\n ContainerSizeInfo rowSizeInfo = rowContainer.getSizeInfo();\n int startCoordinate = rowSizeInfo.getStartCoordinate();\n int endCoordinate = rowSizeInfo.getEndCoordinate();\n int startColumnIndex = axis.getColumnIndexByCoordinate(startCoordinate);\n int endColumnIndex = axis.getColumnIndexByCoordinate(endCoordinate);\n int maxRowIndex = 0;\n int[] rowIndexes = new int[endColumnIndex - startColumnIndex];\n for (int currentColumnIndex = startColumnIndex; currentColumnIndex < endColumnIndex; currentColumnIndex++) {\n int rowIndex = cache.getMaxRowIndex(currentColumnIndex);\n SheetData lastData = cache.getColumnLastData(currentColumnIndex);\n rowIndexes[currentColumnIndex - startColumnIndex] = rowIndex;\n int span = lastData != null ? lastData.getRowSpanInDesign() : 0;\n if (span == 0 || (span == 1 && !isInContainer(lastData, rowContainer))) {\n maxRowIndex = maxRowIndex > rowIndex ? maxRowIndex : rowIndex;\n }\n }\n int startRowIndex = rowContainer.getRowIndex();\n if (maxRowIndex == startRowIndex) {\n maxRowIndex++;\n }\n rowContainer.setRowIndex(maxRowIndex);\n double resize = height / (maxRowIndex - startRowIndex);\n for (int i = startRowIndex; i < maxRowIndex; i++) {\n cache.setRowHeight(i, resize);\n }\n for (int currentColumnIndex = startColumnIndex; currentColumnIndex < endColumnIndex; currentColumnIndex++) {\n int rowspan = maxRowIndex - rowIndexes[currentColumnIndex - startColumnIndex];\n SheetData upstair = cache.getColumnLastData(currentColumnIndex);\n if (rowspan > 0) {\n if (upstair != null && canSpan(upstair, rowContainer)) {\n Type blankType = Type.VERTICAL;\n if (upstair.isBlank()) {\n BlankData blankData = (BlankData) upstair;\n if (blankData.getType() == Type.VERTICAL) {\n upstair.setRowSpan(upstair.getRowSpan() + rowspan);\n }\n blankType = blankData.getType();\n } else {\n upstair.setRowSpan(upstair.getRowSpan() + rowspan);\n if (!isInContainer(upstair, rowContainer)) {\n upstair.decreasRowSpanInDesign();\n }\n }\n int rowIndex = upstair.getRowIndex();\n for (int p = 1; p <= rowspan; p++) {\n BlankData blank = new BlankData(upstair);\n blank.setRowIndex(rowIndex + p);\n blank.setType(blankType);\n cache.addData(currentColumnIndex, blank);\n }\n }\n } else if (upstair.getRowSpanInDesign() > 0 && !isInContainer(upstair, rowContainer)) {\n upstair.decreasRowSpanInDesign();\n }\n }\n}\n"
|
"private Serializable readObject() throws IOException {\n Serializable ret = null;\n try {\n ret = (Serializable) inputStream.readObject();\n } catch (ClassNotFoundException e) {\n dumpStack(\"String_Node_Str\", e);\n IOException except = new IOException(\"String_Node_Str\" + e.getMessage());\n except.setStackTrace(e.getStackTrace());\n throw except;\n }\n return ret;\n}\n"
|
"public void stop() {\n try {\n this.context.unregisterReceiver(broadcastReceiver);\n } catch (IllegalArgumentException e) {\n Timber.w(e, \"String_Node_Str\");\n }\n resetNetworkBindings((ConnectivityManager.NetworkCallback) netReqCb);\n}\n"
|
"public int getIterations() throws IllegalActionException {\n int iterationsValue = ((IntToken) (iterations.getToken())).intValue();\n if (iterationsValue > 0) {\n return iterationsValue;\n }\n if (!isEmbedded()) {\n if (iterations.getToken().equals(_auto)) {\n return 1;\n }\n }\n return 0;\n}\n"
|
"public void notify_event(Event e) {\n if (!visible) {\n return;\n }\n Object[] elem = children.toArray();\n for (int i = elem.length - 1; i >= 0; i--) {\n NE_GUI_Element __elem = (NE_GUI_Element) elem[i];\n __elem.notify_event(e);\n }\n if (e instanceof EMouseClick) {\n EMouseClick event = (EMouseClick) e;\n if (event.is_dispatched()) {\n e_on_mouse_out_click(event);\n return;\n }\n int mx = event.origin.getX();\n int my = WindowRender.get_window_h() - event.origin.getY();\n if (is_client_rect(mx, my)) {\n if (!solid) {\n return;\n }\n e.dispatch();\n e_on_mouse_click(event);\n drag_start = true;\n } else {\n e_on_mouse_out_click(event);\n }\n }\n if (e instanceof EMouseRelease && !e.is_dispatched()) {\n if (drag_start) {\n drop();\n }\n drag_start = false;\n }\n if (e instanceof EMouseDrag) {\n EMouseDrag event = (EMouseDrag) e;\n if (drag_start && dragable) {\n drag((int) event.dx, (int) event.dy);\n }\n }\n if (e instanceof EGUIDrop) {\n EGUIDrop event = (EGUIDrop) e;\n if (is_client_rect(event.coord.getX(), event.coord.getY())) {\n e_on_grab(event);\n }\n }\n if (e instanceof EKeyPress) {\n EKeyPress event = (EKeyPress) e;\n e_on_key_press(event);\n }\n}\n"
|
"public Object execute(ExecutionEvent event) throws ExecutionException {\n IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();\n if (window == null)\n return null;\n Shell shell = window.getShell();\n MessageBox confirmOperation = new MessageBox(shell, SWT.ICON_QUESTION | SWT.CANCEL | SWT.OK);\n confirmOperation.setText(Messages.DeleteDialog_Title);\n confirmOperation.setMessage(Messages.DeleteTraceHandler_Message);\n if (confirmOperation.open() != SWT.OK)\n return null;\n Iterator<Object> iterator = fSelection.iterator();\n while (iterator.hasNext()) {\n Object element = iterator.next();\n if (element instanceof TmfTraceElement) {\n TmfTraceElement trace = (TmfTraceElement) element;\n IResource resource = trace.getResource();\n try {\n IPath path = resource.getLocation();\n if (path != null && (trace.getParent() instanceof TmfTraceFolder)) {\n String location = path.toString();\n TmfExperimentFolder experimentFolder = trace.getProject().getExperimentsFolder();\n for (ITmfProjectModelElement experiment : experimentFolder.getChildren()) {\n List<ITmfProjectModelElement> toRemove = new LinkedList<ITmfProjectModelElement>();\n for (ITmfProjectModelElement child : experiment.getChildren()) {\n if (child.getResource().getLocation().toString().equals(location)) {\n toRemove.add(child);\n }\n }\n for (ITmfProjectModelElement child : toRemove) {\n experiment.removeChild(child);\n child.getResource().delete(true, null);\n }\n }\n }\n resource.delete(true, new NullProgressMonitor());\n trace.deleteSupplementaryFolder();\n trace.getProject().refresh();\n } catch (IOException e) {\n Activator.getDefault().logError(\"String_Node_Str\" + trace.getName(), e);\n } catch (CoreException e) {\n Activator.getDefault().logError(\"String_Node_Str\" + trace.getName(), e);\n }\n }\n }\n return null;\n}\n"
|
"void startHomeActivity(Intent intent, ActivityInfo aInfo) {\n moveHomeStackTaskToTop(HOME_ACTIVITY_TYPE);\n startActivityLocked(null, intent, null, aInfo, null, null, null, null, 0, 0, 0, null, 0, 0, 0, null, false, null, null, null);\n}\n"
|
"public void onChunkLoad(ChunkLoadEvent event) {\n for (NPCLocation tempLoc : toRespawn.keySet()) {\n if (tempLoc.getChunkX() == event.getChunk().getX() && tempLoc.getChunkZ() == event.getChunk().getZ()) {\n if (NPCManager.get(tempLoc.getUID()) != null)\n NPCManager.register(tempLoc.getUID(), tempLoc.getOwner());\n toRespawn.remove(tempLoc);\n }\n }\n}\n"
|
"private static void prepareLevels(QueryDefinition query, TabularHierarchyHandle hierHandle, List metaList, String dimName) throws AdapterException {\n try {\n List levels = hierHandle.getContents(TabularHierarchyHandle.LEVELS_PROP);\n for (int j = 0; j < levels.size(); j++) {\n TabularLevelHandle level = (TabularLevelHandle) levels.get(j);\n DataSetIterator.ColumnMeta temp = null;\n String exprString = ExpressionUtil.createJSDataSetRowExpression(level.getColumnName());\n int type = DataAdapterUtil.adaptModelDataType(level.getDataType());\n if (type == DataType.UNKNOWN_TYPE || type == DataType.ANY_TYPE)\n type = DataType.STRING_TYPE;\n if (level.getDateTimeLevelType() != null) {\n temp = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, level.getName()), new DataSetIterator.DataProcessorWrapper(GroupCalculatorFactory.getGroupCalculator(IGroupDefinition.NUMERIC_INTERVAL, DataType.INTEGER_TYPE, String.valueOf(DataSetIterator.getDefaultStartValue(level.getDateTimeLevelType(), level.getIntervalBase())), level.getIntervalRange())), DataSetIterator.ColumnMeta.LEVEL_KEY_TYPE);\n temp.setDataType(DataType.INTEGER_TYPE);\n exprString = DataSetIterator.createDateTransformerExpr(level.getDateTimeLevelType(), exprString);\n } else {\n IDataProcessor processor = null;\n if (DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals(level.getLevelType())) {\n int interval = GroupAdapter.intervalFromModel(level.getInterval());\n if (interval != IGroupDefinition.NO_INTERVAL)\n processor = new DataSetIterator.DataProcessorWrapper(GroupCalculatorFactory.getGroupCalculator(interval, type, level.getIntervalBase(), level.getIntervalRange()));\n } else if (DesignChoiceConstants.LEVEL_TYPE_MIRRORED.equals(level.getLevelType())) {\n Iterator it = level.staticValuesIterator();\n List dispExpr = new ArrayList();\n List filterExpr = new ArrayList();\n while (it.hasNext()) {\n RuleHandle o = (RuleHandle) it.next();\n dispExpr.add(o.getDisplayExpression());\n filterExpr.add(o.getRuleExpression());\n }\n exprString = \"String_Node_Str\";\n for (int i = 0; i < dispExpr.size(); i++) {\n String disp = \"String_Node_Str\" + JavascriptEvalUtil.transformToJsConstants(String.valueOf(dispExpr.get(i))) + \"String_Node_Str\";\n String filter = String.valueOf(filterExpr.get(i));\n exprString += \"String_Node_Str\" + filter + \"String_Node_Str\" + disp + \"String_Node_Str\";\n }\n }\n temp = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, level.getName()), processor, DataSetIterator.ColumnMeta.LEVEL_KEY_TYPE);\n temp.setDataType(type);\n }\n metaList.add(temp);\n Iterator it = level.attributesIterator();\n while (it.hasNext()) {\n LevelAttributeHandle levelAttr = (LevelAttributeHandle) it.next();\n IDataProcessor processor = null;\n String bindingExpr = null;\n if (level.getDateTimeLevelType() != null && DataSetIterator.DATE_TIME_ATTR_NAME.equals(levelAttr.getName())) {\n processor = new DataSetIterator.DateTimeAttributeProcessor(level.getDateTimeLevelType());\n bindingExpr = ExpressionUtil.createJSDataSetRowExpression(level.getColumnName());\n } else {\n bindingExpr = ExpressionUtil.createJSDataSetRowExpression(levelAttr.getName());\n }\n DataSetIterator.ColumnMeta meta = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, OlapExpressionUtil.getAttributeColumnName(level.getName(), levelAttr.getName())), processor, DataSetIterator.ColumnMeta.UNKNOWN_TYPE);\n meta.setDataType(DataAdapterUtil.adaptModelDataType(levelAttr.getDataType()));\n metaList.add(meta);\n query.addBinding(new Binding(meta.getName(), new ScriptExpression(bindingExpr)));\n }\n if (DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals(level.getLevelType()) && level.getDisplayColumnName() != null) {\n DataSetIterator.ColumnMeta meta = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, OlapExpressionUtil.getDisplayColumnName(level.getName())), null, DataSetIterator.ColumnMeta.UNKNOWN_TYPE);\n meta.setDataType(DataType.STRING_TYPE);\n metaList.add(meta);\n query.addBinding(new Binding(meta.getName(), new ScriptExpression(level.getDisplayColumnName())));\n }\n String levelName = DataSetIterator.createLevelName(dimName, level.getName());\n query.addBinding(new Binding(levelName, new ScriptExpression(exprString, type)));\n GroupDefinition gd = new GroupDefinition(String.valueOf(query.getGroups().size()));\n gd.setKeyExpression(ExpressionUtil.createJSRowExpression(levelName));\n if (level.getLevelType() != null && level.getDateTimeLevelType() == null) {\n gd.setIntervalRange(level.getIntervalRange());\n gd.setIntervalStart(level.getIntervalBase());\n gd.setInterval(GroupAdapter.intervalFromModel(level.getInterval()));\n }\n if (level.getDateTimeLevelType() != null) {\n gd.setIntervalRange(level.getIntervalRange() == 0 ? 1 : level.getIntervalRange());\n gd.setIntervalStart(String.valueOf(DataSetIterator.getDefaultStartValue(level.getDateTimeLevelType(), level.getIntervalBase())));\n gd.setInterval(IGroupDefinition.NUMERIC_INTERVAL);\n }\n query.addGroup(gd);\n }\n } catch (DataException e) {\n throw new AdapterException(e.getLocalizedMessage(), e);\n }\n}\n"
|
"public long decrementAndGet() {\n long value;\n return value;\n}\n"
|
"private static ConcurrentMap<String, ConcurrentMap<String, PluginType<?>>> decode(final ClassLoader classLoader) {\n Enumeration<URL> resources;\n try {\n resources = classLoader.getResources(PATH + FILENAME);\n } catch (final IOException ioe) {\n LOGGER.warn(\"String_Node_Str\", ioe);\n return null;\n }\n final ConcurrentMap<String, ConcurrentMap<String, PluginType<?>>> map = new ConcurrentHashMap<String, ConcurrentMap<String, PluginType<?>>>();\n while (resources.hasMoreElements()) {\n final URL url = resources.nextElement();\n LOGGER.debug(\"String_Node_Str\", url.toExternalForm());\n InputStream is;\n try {\n is = url.openStream();\n } catch (final IOException e) {\n LOGGER.warn(\"String_Node_Str\", url.toExternalForm(), e);\n continue;\n }\n final DataInputStream dis = new DataInputStream(new BufferedInputStream(is));\n try {\n final URL url = resources.nextElement();\n LOGGER.debug(\"String_Node_Str\", url.toExternalForm());\n final InputStream is = url.openStream();\n final BufferedInputStream bis = new BufferedInputStream(is);\n dis = new DataInputStream(bis);\n final int count = dis.readInt();\n for (int j = 0; j < count; ++j) {\n final String type = dis.readUTF();\n final int entries = dis.readInt();\n ConcurrentMap<String, PluginType<?>> types = map.get(type);\n if (types == null) {\n types = new ConcurrentHashMap<String, PluginType<?>>(count);\n }\n for (int i = 0; i < entries; ++i) {\n final String key = dis.readUTF();\n final String className = dis.readUTF();\n final String name = dis.readUTF();\n final boolean printable = dis.readBoolean();\n final boolean defer = dis.readBoolean();\n final Class<?> clazz = Class.forName(className);\n types.put(key, new PluginType(clazz, name, printable, defer));\n }\n map.putIfAbsent(type, types);\n }\n } catch (final Exception ex) {\n LOGGER.warn(\"String_Node_Str\", ex);\n return null;\n } finally {\n Closer.closeSilent(dis);\n }\n }\n return map.size() == 0 ? null : map;\n}\n"
|
"private NamedObj _createEntity(String className, String entityName, String source) throws Exception {\n if (_current != null && !(_current instanceof CompositeEntity)) {\n throw new XmlException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + _current + \"String_Node_Str\", _currentExternalEntity(), _parser.getLineNumber(), _parser.getColumnNumber());\n }\n CompositeEntity container = (CompositeEntity) _current;\n ComponentEntity previous = _searchForEntity(entityName, _current);\n Class newClass = null;\n ComponentEntity reference = null;\n if (className != null) {\n reference = searchForClass(className, source);\n if (reference == null && source == null) {\n reference = _searchForClassInContext(className, source);\n }\n if (reference == null) {\n try {\n newClass = Class.forName(className, true, _classLoader);\n } catch (Exception ex) {\n try {\n reference = _attemptToFindMoMLClass(className, source);\n } catch (Exception ex2) {\n throw new IllegalActionException(null, ex2, \"String_Node_Str\" + className);\n }\n } catch (Error error) {\n StringBuffer errorMessage = new StringBuffer();\n if (error instanceof ExceptionInInitializerError) {\n Throwable staticThrowable = ((ExceptionInInitializerError) error).getCause();\n errorMessage.append(\"String_Node_Str\" + \"String_Node_Str\" + KernelException.stackTraceToString(staticThrowable));\n } else {\n errorMessage.append(className + \"String_Node_Str\" + error.toString() + \"String_Node_Str\");\n }\n try {\n reference = _attemptToFindMoMLClass(className, source);\n } catch (XmlException ex2) {\n throw new Exception(\"String_Node_Str\" + errorMessage.toString() + className + \"String_Node_Str\" + ex2.getMessage());\n } catch (ClassFormatError ex3) {\n throw new Exception(\"String_Node_Str\" + errorMessage.toString() + className + \"String_Node_Str\" + \"String_Node_Str\" + ex3.getMessage());\n } catch (Exception ex4) {\n throw new Exception(\"String_Node_Str\" + errorMessage.toString() + className + \"String_Node_Str\" + ex4.getMessage());\n }\n }\n }\n }\n if (previous != null) {\n if (newClass != null) {\n _checkClass(previous, newClass, \"String_Node_Str\" + entityName + \"String_Node_Str\" + className);\n }\n return previous;\n }\n _checkForNull(className, \"String_Node_Str\");\n if (reference == null) {\n if (_current != null) {\n List derivedList = container.getDerivedList();\n Iterator derivedObjects = derivedList.iterator();\n while (derivedObjects.hasNext()) {\n CompositeEntity derived = (CompositeEntity) derivedObjects.next();\n if (derived.getEntity(entityName) != null) {\n throw new IllegalActionException(container, \"String_Node_Str\" + \"String_Node_Str\" + derived.getEntity(entityName).getFullName());\n }\n }\n _checkClass(_current, CompositeEntity.class, \"String_Node_Str\" + \"String_Node_Str\" + _current);\n Object[] arguments = new Object[2];\n arguments[0] = _current;\n arguments[1] = entityName;\n NamedObj newEntity = _createInstance(newClass, arguments);\n newEntity.propagateExistence();\n _loadIconForClass(className, newEntity);\n _addParamsToParamsToParse(newEntity);\n return newEntity;\n } else {\n Object[] arguments = new Object[1];\n arguments[0] = _workspace;\n NamedObj result = _createInstance(newClass, arguments);\n result.setName(entityName);\n _loadIconForClass(className, result);\n return result;\n }\n } else {\n if (!reference.isClassDefinition()) {\n throw new XmlException(\"String_Node_Str\" + \"String_Node_Str\" + reference.getFullName(), _currentExternalEntity(), _parser.getLineNumber(), _parser.getColumnNumber());\n }\n List derivedList = null;\n if (container != null) {\n derivedList = container.getDerivedList();\n Iterator derivedObjects = derivedList.iterator();\n while (derivedObjects.hasNext()) {\n CompositeEntity derived = (CompositeEntity) derivedObjects.next();\n if (derived.getEntity(entityName) != null) {\n throw new IllegalActionException(container, \"String_Node_Str\" + \"String_Node_Str\" + derived.getEntity(entityName).getFullName());\n }\n }\n }\n ComponentEntity newEntity = (ComponentEntity) reference.instantiate(container, entityName);\n if (_topObjectsCreated != null && container == _originalContext) {\n _topObjectsCreated.add(newEntity);\n }\n URIAttribute modelURI = (URIAttribute) newEntity.getAttribute(\"String_Node_Str\", URIAttribute.class);\n if (modelURI != null) {\n modelURI.setContainer(null);\n }\n _markParametersToParse(newEntity);\n newEntity.setClassName(className);\n Iterator propagatedInstances = newEntity.propagateExistence().iterator();\n while (propagatedInstances.hasNext()) {\n ComponentEntity propagatedEntity = (ComponentEntity) propagatedInstances.next();\n URIAttribute propagatedURI = (URIAttribute) propagatedEntity.getAttribute(\"String_Node_Str\", URIAttribute.class);\n if (propagatedURI != null) {\n propagatedURI.setContainer(null);\n }\n }\n return newEntity;\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n MageObject sourceObject = source.getSourceObject(game);\n if (controller != null && sourceObject != null) {\n if (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {\n Set<Card> sideboard = controller.getSideboard().getCards(filter, game);\n List<Card> exile = game.getExile().getAllCards(game);\n Cards filteredCards = new CardsImpl();\n Card card = null;\n for (Card sideboardCard : sideboard) {\n filteredCards.add(sideboardCard.getId());\n }\n for (Card exileCard : exile) {\n if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype(\"String_Node_Str\")) {\n filteredCards.add(exileCard);\n }\n }\n }\n Cards filteredCards = new CardsImpl();\n for (Card exileCard : game.getExile().getAllCards(game)) {\n if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype(\"String_Node_Str\")) {\n filteredCards.add(exileCard);\n }\n }\n if (filteredCards.isEmpty()) {\n game.informPlayer(controller, \"String_Node_Str\");\n } else {\n TargetCard target = new TargetCard(Zone.EXILED, filter);\n target.setNotTarget(true);\n if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {\n card = game.getCard(target.getFirstTarget());\n }\n }\n if (card != null) {\n card.moveToZone(Zone.HAND, source.getSourceId(), game, false);\n controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);\n }\n return true;\n }\n return false;\n}\n"
|
"public boolean next() throws IOException, InterruptedException {\n KeyValuePair<K, VP> pair = probePairSerialization.newInstance();\n while (currentProbePartitionReader.read(pair)) {\n K key = pair.getKey();\n if (hashMap.contains(key)) {\n currentKey = key;\n currentBuildValuesIterable = hashMap.get(currentKey);\n currentProbeValuesIterable.value = pair.getValue();\n return true;\n }\n }\n if (currentPartition >= numberOfPartitions - 1) {\n return false;\n }\n try {\n currentProbePartitionReader.close();\n currentPartition++;\n LOG.debug(\"String_Node_Str\" + currentPartition);\n hashMap.clear();\n currentBuildPartitionReader = ioManager.createChannelReader(buildPartitionIDs.get(currentPartition), freeSegments, false);\n KeyValuePair<K, VB> tmp = buildPairSerialization.newInstance();\n while (currentBuildPartitionReader.read(tmp)) {\n hashMap.put(tmp.getKey(), tmp.getValue());\n tmp = buildPairSerialization.newInstance();\n }\n currentBuildPartitionReader.close();\n currentProbePartitionReader = ioManager.createChannelReader(probePartitionIDs.get(currentPartition), freeSegments);\n return next();\n } catch (ServiceException e) {\n throw new IOException(e);\n } catch (Exception e) {\n throw new IOException(e);\n }\n}\n"
|
"public boolean updatePowerState(long instanceId, long powerHostId, VirtualMachine.PowerState powerState) {\n boolean needToUpdate = false;\n TransactionLegacy txn = TransactionLegacy.currentTxn();\n txn.start();\n VMInstanceVO instance = findById(instanceId);\n if (instance != null) {\n Long savedPowerHostId = instance.getPowerHostId();\n if (instance.getPowerState() != powerState || savedPowerHostId == null || savedPowerHostId.longValue() != powerHostId) {\n instance.setPowerState(powerState);\n instance.setPowerHostId(powerHostId);\n instance.setPowerStateUpdateCount(1);\n instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());\n needToUpdate = true;\n update(instanceId, instance);\n } else {\n if (instance.getPowerStateUpdateCount() < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT) {\n instance.setPowerStateUpdateCount(instance.getPowerStateUpdateCount() + 1);\n instance.setPowerStateUpdateTime(DateUtil.currentGMTTime());\n needToUpdate = true;\n update(instanceId, instance);\n }\n }\n });\n}\n"
|
"private boolean testTotalUploadLimit() {\n int max = SettingsManager.instance().getMaxUploads();\n int current = uploadsInProgress();\n if (current >= max)\n return false;\n return true;\n}\n"
|
"public void run(DenizenNPC denizen, Location location, Boolean lookClose, Float checkYaw) {\n denizen.lookClose(lookClose);\n denizen.getHandle().yaw = location.getYaw();\n denizen.getHandle().pitch = location.getPitch();\n denizen.getHandle().as = denizen.getHandle().yaw;\n}\n"
|
"public void run() {\n PsiManager manager = PsiManager.getInstance(myProject);\n DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject);\n synchronized (fileToEventClasses) {\n for (VirtualFile virtualFile : fileToEventClasses.keySet()) {\n PsiFile psiFile = manager.findFile(virtualFile);\n if (psiFile == null)\n continue;\n codeAnalyzer.restart(psiFile);\n }\n }\n}\n"
|
"private void fontAddChars(FontTag ft, Set<Integer> selChars, String selFont) {\n FontTag f = (FontTag) oldValue;\n String oldchars = f.getCharacters(swf.tags);\n for (int ic : selChars) {\n char c = (char) ic;\n if (oldchars.indexOf((int) c) == -1) {\n Font font = new Font(selFont, f.getFontStyle(), 1024);\n if (!font.canDisplay(c)) {\n View.showMessageDialog(null, translate(\"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\" + c), translate(\"String_Node_Str\"), JOptionPane.ERROR_MESSAGE);\n return;\n }\n }\n }\n String[] yesno = new String[] { translate(\"String_Node_Str\"), translate(\"String_Node_Str\"), translate(\"String_Node_Str\"), translate(\"String_Node_Str\") };\n boolean yestoall = false;\n boolean notoall = false;\n for (int ic : selChars) {\n char c = (char) ic;\n if (oldchars.indexOf((int) c) > -1) {\n int opt;\n if (!(yestoall || notoall)) {\n opt = View.showOptionDialog(null, translate(\"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\" + c), translate(\"String_Node_Str\"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, yesno, translate(\"String_Node_Str\"));\n if (opt == 2) {\n yestoall = true;\n }\n if (opt == 3) {\n notoall = true;\n }\n }\n if (yestoall) {\n opt = 0;\n } else if (notoall) {\n opt = 1;\n } else {\n opt = 1;\n }\n if (opt == 1) {\n continue;\n }\n }\n f.addCharacter(swf.tags, c, fontSelection.getSelectedItem().toString());\n oldchars += c;\n }\n}\n"
|
"protected MapperProcess internalMapPE(final File archiveIndexDir) throws IOException {\n final String bowtiePath;\n synchronized (SYNC) {\n bowtiePath = install(getMapperExecutableName());\n }\n final String index = getIndexArgument(archiveIndexDir);\n return new MapperProcess(this, true) {\n protected List<List<String>> createCommandLines() {\n final List<String> cmd = new ArrayList<>();\n cmd.addAll(createCommonArgs(bowtiePath, index));\n if (isMultipleInstancesEnabled()) {\n cmd.add(\"String_Node_Str\");\n }\n cmd.add(\"String_Node_Str\");\n cmd.add(getNamedPipeFile1().getAbsolutePath());\n cmd.add(\"String_Node_Str\");\n cmd.add(getNamedPipeFile2().getAbsolutePath());\n return Collections.singletonList(cmd);\n }\n protected File executionDirectory() {\n return archiveIndexDir;\n }\n };\n}\n"
|
"public void testGerritConnection(String sshKeyFile, String strHost, int port, String strUsername, String strProject, String phrase) throws RepositoryException {\n SshConnection sshConnection = null;\n File f = prepareSSHKeyFile(sshKeyFile, key);\n if (!f.isFile()) {\n throw new RepositoryException(textProvider.getText(\"String_Node_Str\"));\n }\n Authentication auth = new Authentication(f, strUsername, phrase);\n try {\n sshConnection = SshConnectionFactory.getConnection(strHost, port, auth);\n } catch (IOException e) {\n throw new RepositoryException(textProvider.getText(\"String_Node_Str\"));\n }\n if (!sshConnection.isConnected()) {\n throw new RepositoryException(textProvider.getText(\"String_Node_Str\"));\n } else {\n sshConnection.disconnect();\n }\n}\n"
|
"protected boolean handleAsExtension(Packet packet) {\n final Iterator i = packet.getExtensions();\n for (; i.hasNext(); ) {\n Object extension = i.next();\n if (extension instanceof XHTMLExtension) {\n XHTMLExtension xhtmlExtension = (XHTMLExtension) extension;\n deliverEvent(new MessageEvent((Message) packet, xhtmlExtension.getBodies()));\n return true;\n }\n if (packet instanceof Presence && extension instanceof MUCUser) {\n return true;\n }\n }\n return false;\n}\n"
|
"public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {\n List<SqlStatement> sql = new ArrayList<SqlStatement>();\n for (ColumnConfig aColumn : columns) {\n String schemaName = getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName();\n if (database instanceof SybaseDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + database.getColumnType(aColumn.getType(), false)));\n } else if (database instanceof MSSQLDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n } else if (database instanceof MySQLDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n } else if (database instanceof OracleDatabase || database instanceof MaxDBDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType() + \"String_Node_Str\"));\n } else if (database instanceof DerbyDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n } else if (database instanceof HsqlDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n } else if (database instanceof CacheDatabase) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n } else if (database instanceof DB2Database) {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n sql.add(new ReorganizeTableStatement(schemaName, getTableName()));\n } else {\n sql.add(new RawSqlStatement(\"String_Node_Str\" + database.escapeTableName(schemaName, getTableName()) + \"String_Node_Str\" + aColumn.getName() + \"String_Node_Str\" + aColumn.getType()));\n }\n }\n return sql.toArray(new SqlStatement[sql.size()]);\n}\n"
|
"public static List<Variable> listLocalVariables(StackFrame stackFrame) throws AbsentInformationException {\n List<Variable> res = new ArrayList<>();\n try {\n for (LocalVariable localVariable : stackFrame.visibleVariables()) {\n Variable var = new Variable(localVariable.name(), stackFrame.getValue(localVariable));\n var.local = localVariable;\n res.add(var);\n }\n } catch (AbsentInformationException ex) {\n int argId = 0;\n try {\n List<Value> arguments = stackFrame.getArgumentValues();\n if (arguments == null) {\n return res;\n }\n for (Value argValue : arguments) {\n Variable var = new Variable(\"String_Node_Str\" + argId, argValue);\n var.argumentIndex = argId++;\n res.add(var);\n }\n } catch (InternalException ex2) {\n if (ex2.errorCode() != 32) {\n throw ex;\n }\n }\n }\n return res;\n}\n"
|
"public void createCube(String name, String[][] factTableJointColumnNames, String[][] DimJointColumnNames, IDimension[] dimensions, IDatasetIterator factTable, String[] measureColumns, long cacheSize, StopSign stopSign, boolean suppressInvalidFacttableRow) throws IOException, BirtException {\n if (dimensions.length == 0) {\n throw new DataException(ResourceConstants.MISSING_DIMENSION_IN_CUBE, name);\n }\n Cube cube = new Cube(name, documentManager);\n cube.create(factTableJointColumnNames, DimJointColumnNames, dimensions, factTable, measureColumns, cacheSize, stopSign);\n cube.close();\n documentManager.flush();\n}\n"
|
"public void setHintText(String text) {\n if (text == null) {\n if (hintText == null) {\n return;\n }\n return;\n }\n if (hintText == null) {\n hintText = text;\n hintFocusHandler = addFocusHandler(new FocusHandler() {\n public void onFocus(FocusEvent event) {\n focusHint();\n }\n });\n hintBlurHandler = addBlurHandler(new BlurHandler() {\n public void onBlur(BlurEvent event) {\n blurHint();\n }\n });\n blurHint();\n return;\n }\n hintText = text;\n if (hintOn) {\n super.setText(text);\n }\n}\n"
|
"private void updateList(final Map<URI, URI> changeTable, final Map<URI, URI> conflictTable) {\n final URI xmlDitalist = job.tempDir.toURI().resolve(\"String_Node_Str\");\n final Set<URI> hrefTopics = new HashSet<>();\n for (final FileInfo f : job.getFileInfo()) {\n if (f.isNonConrefTarget) {\n hrefTopics.add(f.uri);\n }\n }\n for (final FileInfo f : job.getFileInfo()) {\n if (f.isSkipChunk) {\n final URI s = f.uri;\n if (s.getFragment() == null) {\n final Iterator<URI> hrefit = hrefTopics.iterator();\n while (hrefit.hasNext()) {\n final URI ent = hrefit.next();\n if (job.tempDir.toURI().resolve(ent).equals(job.tempDir.toURI().resolve(s))) {\n hrefit.remove();\n }\n }\n } else if (hrefTopics.contains(s)) {\n hrefTopics.remove(s);\n }\n }\n }\n final Set<URI> topicList = new LinkedHashSet<>(128);\n final Set<URI> oldTopicList = new HashSet<>();\n for (final FileInfo f : job.getFileInfo()) {\n if (ATTR_FORMAT_VALUE_DITA.equals(f.format)) {\n oldTopicList.add(f.uri);\n }\n }\n for (final URI hrefTopic : hrefTopics) {\n final URI t = getRelativePath(xmlDitalist, job.tempDir.toURI().resolve(stripFragment(hrefTopic.toString())));\n topicList.add(t);\n if (oldTopicList.contains(t)) {\n oldTopicList.remove(t);\n }\n }\n final Set<URI> chunkedTopicSet = new LinkedHashSet<>(128);\n final Set<URI> chunkedDitamapSet = new LinkedHashSet<>(128);\n final Set<URI> ditamapList = new HashSet<>();\n for (final FileInfo f : job.getFileInfo()) {\n if (ATTR_FORMAT_VALUE_DITAMAP.equals(f.format)) {\n ditamapList.add(f.uri);\n }\n }\n for (final Map.Entry<URI, URI> entry : changeTable.entrySet()) {\n final URI oldFile = entry.getKey();\n if (entry.getValue().equals(oldFile)) {\n URI newChunkedFile = entry.getValue();\n newChunkedFile = getRelativePath(xmlDitalist, newChunkedFile);\n final String extName = getExtension(newChunkedFile.getPath());\n if (extName != null && !extName.equalsIgnoreCase(ATTR_FORMAT_VALUE_DITAMAP)) {\n chunkedTopicSet.add(newChunkedFile);\n if (!topicList.contains(newChunkedFile)) {\n topicList.add(newChunkedFile);\n if (oldTopicList.contains(newChunkedFile)) {\n oldTopicList.remove(newChunkedFile);\n }\n }\n } else {\n if (!ditamapList.contains(newChunkedFile)) {\n ditamapList.add(newChunkedFile);\n if (oldTopicList.contains(newChunkedFile)) {\n oldTopicList.remove(newChunkedFile);\n }\n }\n chunkedDitamapSet.add(newChunkedFile);\n }\n }\n }\n for (final URI s : oldTopicList) {\n final File f = new File(job.tempDir.toURI().resolve(s));\n if (f.exists() && !f.delete()) {\n logger.error(\"String_Node_Str\" + f.getAbsolutePath());\n }\n }\n for (final Map.Entry<URI, URI> entry : changeTable.entrySet()) {\n final URI oldFile = entry.getKey();\n final URI from = entry.getValue();\n if (from.equals(oldFile)) {\n final URI targetPath = conflictTable.get(oldFile);\n if (targetPath != null) {\n final URI target = targetPath;\n if (!new File(target).exists()) {\n URI relativePath = getRelativePath(xmlDitalist, from);\n final URI relativeTargetPath = getRelativePath(xmlDitalist, target);\n if (relativeTargetPath.getPath().indexOf(URI_SEPARATOR) != -1) {\n relativePath2fix.put(relativeTargetPath.getPath(), relativeTargetPath.getPath().substring(0, relativeTargetPath.getPath().lastIndexOf(URI_SEPARATOR) + 1));\n }\n try {\n deleteQuietly(new File(target));\n moveFile(new File(from), new File(target));\n } catch (final IOException e) {\n logger.error(\"String_Node_Str\" + e.getMessage(), e);\n }\n if (topicList.contains(relativePath)) {\n topicList.remove(relativePath);\n }\n if (chunkedTopicSet.contains(relativePath)) {\n chunkedTopicSet.remove(relativePath);\n }\n relativePath = getRelativePath(xmlDitalist, target);\n topicList.add(relativePath);\n chunkedTopicSet.add(relativePath);\n } else {\n conflictTable.remove(oldFile);\n }\n }\n }\n }\n final Set<URI> all = new HashSet<>();\n all.addAll(topicList);\n all.addAll(ditamapList);\n all.addAll(chunkedDitamapSet);\n all.addAll(chunkedTopicSet);\n for (final URI file : oldTopicList) {\n if (!all.contains(file)) {\n job.remove(job.getOrCreateFileInfo(file));\n }\n }\n for (final URI file : topicList) {\n final FileInfo ff = job.getOrCreateFileInfo(file);\n ff.format = ATTR_FORMAT_VALUE_DITA;\n }\n for (final URI file : ditamapList) {\n final FileInfo ff = job.getOrCreateFileInfo(file);\n ff.format = ATTR_FORMAT_VALUE_DITAMAP;\n }\n for (final URI file : chunkedDitamapSet) {\n final FileInfo f = job.getOrCreateFileInfo(file);\n f.format = ATTR_FORMAT_VALUE_DITAMAP;\n f.isResourceOnly = false;\n }\n for (final URI file : chunkedTopicSet) {\n final FileInfo f = job.getOrCreateFileInfo(file);\n f.format = ATTR_FORMAT_VALUE_DITA;\n f.isResourceOnly = false;\n }\n try {\n job.write();\n } catch (final IOException ex) {\n logger.error(ex.getMessage(), ex);\n }\n}\n"
|
"public void run() {\n try {\n WorkbenchClipboard.getWorkbenchClipboard().conceptsReset();\n IStructuredSelection selection = (IStructuredSelection) page.getTreeViewer().getSelection();\n if (selection.getFirstElement() instanceof XSDElementDeclaration) {\n for (Iterator<XSDElementDeclaration> iter = selection.iterator(); iter.hasNext(); ) {\n XSDElementDeclaration concept = iter.next();\n if (concept instanceof XSDElementDeclaration)\n WorkbenchClipboard.getWorkbenchClipboard().add(concept);\n }\n } else if (selection.getFirstElement() instanceof XSDParticle) {\n for (Iterator<XSDParticle> iter = selection.iterator(); iter.hasNext(); ) {\n XSDParticle particle = iter.next();\n if (particle instanceof XSDParticle)\n WorkbenchClipboard.getWorkbenchClipboard().add(particle);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n MessageDialog.openError(page.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + e.getLocalizedMessage());\n }\n}\n"
|
"private JExpression checkAndReplaceJso(JExpression arg, JType targetType) {\n JType argType = arg.getType();\n if (argType == targetType) {\n return arg;\n }\n if (!(targetType instanceof JReferenceType)) {\n return arg;\n }\n if (!program.isJavaScriptObject(argType)) {\n return arg;\n }\n JCastOperation cast = new JCastOperation(program, arg.getSourceInfo(), argType, arg);\n return cast;\n}\n"
|
"private static String resizeFile(final int size, final String fileName) throws IOException {\n FileInputStream fileInputStream = new FileInputStream(fileName);\n Dimension imageSize = getImageSize(fileInputStream);\n if (size == ((int) imageSize.getWidth()) && size == ((int) imageSize.getHeight())) {\n return fileName;\n }\n File newFile = new File(TEMP_DIR, \"String_Node_Str\" + FileUtil.getExtension(fileName)).getAbsoluteFile();\n Image image;\n File iconTest = new File(fileName);\n if (iconTest.isFile() && iconTest.canRead()) {\n final String absolutePath = iconTest.getAbsolutePath();\n image = new ImageIcon(absolutePath).getImage().getScaledInstance(size, -1, Image.SCALE_SMOOTH);\n image.flush();\n } else {\n final URL systemResource = LocationResolver.getResource(fileName);\n image = new ImageIcon(systemResource).getImage().getScaledInstance(size, -1, Image.SCALE_SMOOTH);\n image.flush();\n }\n image = new ImageIcon(image).getImage();\n image.flush();\n newFile.getParentFile().mkdirs();\n newFile.delete();\n String extension = FileUtil.getExtension(fileName);\n if (extension.equals(\"String_Node_Str\")) {\n extension = \"String_Node_Str\";\n }\n BufferedImage bufferedImage = getBufferedImage(image);\n ImageIO.write(bufferedImage, extension, newFile);\n return newFile.getAbsolutePath();\n}\n"
|
"public void onChunkUnload() {\n super.onChunkUnload();\n if (node != null) {\n node.remove();\n}\n"
|
"private void handleNext(DirectionQuery query, Set<ContentKey> keys) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n fileSpokeStore.getNext(query.getChannelName(), query.getStartKey().toUrl(), query.getCount(), baos);\n String keyString = baos.toString();\n ContentKeyUtil.convertKeyStrings(keyString, keys);\n } catch (IOException e) {\n logger.warn(\"String_Node_Str\" + query, e);\n }\n}\n"
|
"public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {\n UnmarshalRecord childRecord = unmarshalRecord.getChildRecord();\n if (null != childRecord) {\n if (!xmlAnyCollectionMapping.usesXMLRoot()) {\n Object objectValue = childRecord.getCurrentObject();\n objectValue = xmlAnyCollectionMapping.convertDataValueToObjectValue(objectValue, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller());\n unmarshalRecord.addAttributeValue(this, objectValue);\n } else {\n Object childObject = childRecord.getCurrentObject();\n Descriptor workingDescriptor = childRecord.getDescriptor();\n if (workingDescriptor != null) {\n String prefix = xPathFragment.getPrefix();\n if ((prefix == null) && (xPathFragment.getNamespaceURI() != null)) {\n prefix = unmarshalRecord.resolveNamespaceUri(xPathFragment.getNamespaceURI());\n }\n childObject = workingDescriptor.wrapObjectInXMLRoot(childObject, xPathFragment.getNamespaceURI(), xPathFragment.getLocalName(), prefix, false, unmarshalRecord.isNamespaceAware(), unmarshalRecord.getUnmarshaller());\n childObject = xmlAnyCollectionMapping.convertDataValueToObjectValue(childObject, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller());\n unmarshalRecord.addAttributeValue(this, childObject);\n }\n }\n unmarshalRecord.setChildRecord(null);\n } else {\n SAXFragmentBuilder builder = unmarshalRecord.getFragmentBuilder();\n if (xmlAnyCollectionMapping.isMixedContent() && unmarshalRecord.getTextWrapperFragment() != null && unmarshalRecord.getTextWrapperFragment().equals(xPathFragment)) {\n endElementProcessText(unmarshalRecord, xmlAnyCollectionMapping, xPathFragment, null);\n return;\n }\n UnmarshalKeepAsElementPolicy keepAsElementPolicy = xmlAnyCollectionMapping.getKeepAsElementPolicy();\n if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepUnknownAsElement() || keepAsElementPolicy.isKeepAllAsElement()) && builder.getNodes().size() > 1) {\n setOrAddAttributeValueForKeepAsElement(builder, xmlAnyCollectionMapping, xmlAnyCollectionMapping, unmarshalRecord, true, collection);\n } else {\n if (xmlAnyCollectionMapping.isMixedContent()) {\n endElementProcessText(unmarshalRecord, xmlAnyCollectionMapping, xPathFragment, null);\n } else {\n unmarshalRecord.resetStringBuffer();\n }\n }\n }\n}\n"
|
"private Task fromPlan(EntityManager em, CreateTaskArg createArg, RouterObjectRef objectId) throws NotFoundException, CommsRouterException {\n Router router = getRouter(em, objectId);\n Task task = new Task(objectId);\n task.setRouter(router);\n task.setRequirements(app.entityMapper.attributes.fromDto(createArg.getRequirements()));\n if (createArg.getPlanRef() != null) {\n Plan plan = app.db.plan.get(em, RouterObjectRef.builder().setRef(createArg.getPlanRef()).setRouterRef(objectId.getRouterRef()).build());\n Route matchedRoute = null;\n List<Rule> rules = plan.getRules();\n for (Rule rule : rules) {\n evaluator = evaluator.changeExpression(rule.getPredicate());\n matchedRoute = getMatchedRoute(task.getRef(), task.getRequirements(), rule, evaluator);\n if (matchedRoute != null) {\n task.setRule(rule);\n break;\n }\n }\n if (matchedRoute == null) {\n matchedRoute = plan.getDefaultRoute();\n }\n if (matchedRoute == null) {\n throw new NotFoundException(\"String_Node_Str\" + createArg);\n }\n if (matchedRoute.getQueue() == null) {\n throw new NotFoundException(\"String_Node_Str\");\n }\n task.setQueue(matchedRoute.getQueue());\n task.setPriority(matchedRoute.getPriority());\n task.setQueuedTimeout(matchedRoute.getTimeout());\n if (task.getQueuedTimeout() > 0) {\n task.setExpirationDate(new Date(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(task.getQueuedTimeout())));\n }\n task.setCurrentRoute(matchedRoute);\n } else {\n Queue queue = app.db.queue.get(em, RouterObjectRef.builder().setRef(createArg.getQueueRef()).setRouterRef(objectId.getRouterRef()).build());\n task.setQueue(queue);\n }\n return task;\n}\n"
|
"protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException {\n if (node.getTag(AqpAdsabsAnalyzerProcessor.ANALYZED) != null) {\n List<List<List<QueryNode>>> queryStructure;\n AqpRequestParams req = getRequest();\n SolrParams params = req.getParams();\n final String unfieldedDefaultOperator = \"String_Node_Str\";\n if (params != null) {\n params.get(AqpAdsabsQueryParser.AQP_UNFIELDED_OPERATOR_PARAM, \"String_Node_Str\").toLowerCase();\n }\n if (child instanceof TokenizedPhraseQueryNode) {\n return child;\n } else if (child instanceof GroupQueryNode) {\n if (child.getChildren().size() > 0 && child.getChildren().get(0) instanceof BooleanQueryNode && ((BooleanQueryNode) child.getChildren().get(0)).getChildren().size() > 1) {\n queryStructure = extractQueries(child.getChildren().get(0));\n final int proximity = getDefaultProximityValue();\n return buildNewQueryNode(queryStructure, new QueryBuilder() {\n public QueryNode buildQuery(List<QueryNode> clauses) {\n if (unfieldedDefaultOperator.equals(\"String_Node_Str\")) {\n return new AqpNearQueryNode(clauses, proximity);\n } else if (unfieldedDefaultOperator.equals(\"String_Node_Str\")) {\n return new AqpAndQueryNode(clauses);\n } else if (unfieldedDefaultOperator.equals(\"String_Node_Str\")) {\n return new AqpNotQueryNode(clauses);\n } else {\n return new AqpOrQueryNode(clauses);\n }\n }\n });\n }\n } else if (child instanceof MultiPhraseQueryNode) {\n queryStructure = extractQueries(child);\n if (node.getParent() instanceof FuzzyQueryNode) {\n final FuzzyQueryNode parent = (FuzzyQueryNode) node.getParent();\n return buildNewQueryNode(queryStructure, new QueryBuilder() {\n public QueryNode buildQuery(List<QueryNode> clauses) {\n return new AqpNearQueryNode(clauses, parent.getPositionIncrement());\n }\n });\n } else {\n return buildNewQueryNode(queryStructure, new QueryBuilder() {\n public QueryNode buildQuery(List<QueryNode> clauses) {\n if (this.isMultiDimensional) {\n MultiPhraseQueryNode pq = new MultiPhraseQueryNode();\n for (QueryNode c : clauses) {\n if (c.isLeaf()) {\n pq.add(c);\n } else {\n for (QueryNode child : c.getChildren()) {\n pq.add(child);\n }\n }\n }\n return pq;\n } else {\n TokenizedPhraseQueryNode pq = new TokenizedPhraseQueryNode();\n pq.add(clauses);\n return pq;\n }\n }\n });\n }\n }\n return child;\n }\n return node;\n}\n"
|
"private static Byte parseData(String dropString) {\n String[] dropParts = dropString.split(\"String_Node_Str\");\n String[] itemParts = dropParts[0].split(\"String_Node_Str\");\n String[] itemSubParts = itemParts[0].split(\"String_Node_Str\");\n return itemSubParts.length > 1 && !itemSubParts[1].isEmpty() ? Byte.parseByte(itemSubParts[1]) : null;\n}\n"
|
"public boolean performFinish() {\n try {\n IndicatorParameters parameters = indicator.getParameters();\n if (parameters == null) {\n isDirty = true;\n parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();\n indicator.setParameters(parameters);\n }\n DateParameters dateParameters = parameters.getDateParameters();\n TextParameters textParameters = parameters.getTextParameter();\n for (AbstractIndicatorParameter formParam : AbstractIndicatorForm.getParameters()) {\n if (!ParamCompareFactory.compare(parameters, formParam)) {\n isDirty = true;\n switch(formParam.getFormEnum()) {\n case BinsDesignerForm:\n BinsDesignerParameter tempParam = (BinsDesignerParameter) formParam;\n int numOfShown = tempParam.getNumOfShown();\n Domain domain = tempParam.getUserDomian();\n if (domain.getRanges().size() == 0) {\n parameters.setBins(null);\n } else {\n parameters.setBins(domain);\n }\n parameters.setTopN(numOfShown);\n break;\n case TextParametersForm:\n if (textParameters == null) {\n textParameters = IndicatorsFactory.eINSTANCE.createTextParameters();\n parameters.setTextParameter(textParameters);\n }\n TextParameter textParam = (TextParameter) formParam;\n textParameters.setIgnoreCase(textParam.isIngoreCase());\n parameters.setTopN(textParam.getNumOfShown());\n break;\n case TextLengthForm:\n if (textParameters == null) {\n textParameters = IndicatorsFactory.eINSTANCE.createTextParameters();\n parameters.setTextParameter(textParameters);\n }\n TextLengthParameter lengthParam = (TextLengthParameter) formParam;\n textParameters.setUseBlank(lengthParam.isUseBlank());\n textParameters.setUseNulls(lengthParam.isUseNull());\n break;\n case DataThresholdsForm:\n DataThresholdsParameter dataParam = (DataThresholdsParameter) formParam;\n String min1 = dataParam.getMinThreshold();\n String max1 = dataParam.getMaxThreshold();\n if (\"String_Node_Str\".equals(min1) && \"String_Node_Str\".equals(max1)) {\n parameters.setDataValidDomain(null);\n } else {\n IndicatorHelper.setDataThreshold(indicator, min1, max1);\n IndicatorHelper.propagateDataThresholdsInChildren(indicator);\n }\n break;\n case IndicatorThresholdsForm:\n IndicatorThresholdsParameter indiParam = (IndicatorThresholdsParameter) formParam;\n String min2 = indiParam.getMinThreshold();\n String max2 = indiParam.getMaxThreshold();\n IndicatorHelper.setIndicatorThreshold(parameters, min2, max2);\n break;\n case TimeSlicesForm:\n TimeSlicesParameter timeParam = (TimeSlicesParameter) formParam;\n DateGrain dateGrain = DateGrain.get(timeParam.getDataUnit());\n dateParameters.setDateAggregationType(dateGrain);\n parameters.setTopN(timeParam.getNumOfShown());\n break;\n case NumbericNominalForm:\n NumbericNominalParameter numbParam = (NumbericNominalParameter) formParam;\n parameters.setTopN(numbParam.getNumberOfShown());\n break;\n case ExpectedValueForm:\n ExpectedValueParameter expectedParam = (ExpectedValueParameter) formParam;\n IndicatorHelper.setIndicatorExpectedValue(parameters, expectedParam.getExpectedValue());\n default:\n }\n }\n }\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n}\n"
|
"public void commandAction(Command command, Displayable displayable) {\n if (command == _cmdExit) {\n try {\n thread.interrupt();\n } catch (Exception e) {\n }\n _midlet.showMainForm();\n }\n}\n"
|
"private Ep createParamByType(Element element) throws XMLException {\n String att_name, att_var;\n NCLAttributes att = NCLAttributes.DEFAULT;\n att_name = NCLElementAttributes.NAME.toString();\n if ((att_var = element.getAttribute(att_name)).isEmpty())\n throw new NCLParsingException(\"String_Node_Str\" + att_name + \"String_Node_Str\");\n for (NCLAttributes a : NCLAttributes.values()) {\n if (a.toString().equals(att_var))\n att = a;\n }\n switch(att) {\n case TOP:\n return createRelativeDescriptorParam();\n case LEFT:\n return createDoubleDescriptorParam();\n case BOTTOM:\n return createDoubleDescriptorParam();\n case RIGHT:\n return createDoubleDescriptorParam();\n case WIDTH:\n return createDoubleDescriptorParam();\n case HEIGHT:\n return createDoubleDescriptorParam();\n case LOCATION:\n return createStringDescriptorParam();\n case SIZE:\n return createStringDescriptorParam();\n case BOUNDS:\n return createStringDescriptorParam();\n case BACKGROUND:\n return createColorDescriptorParam();\n case VISIBLE:\n return createBooleanDescriptorParam();\n case TRANSPARENCY:\n return createPercentDescriptorParam();\n case FIT:\n return createFitDescriptorParam();\n case SCROLL:\n return createScrollDescriptorParam();\n case STYLE:\n return createStringDescriptorParam();\n case SOUND_LEVEL:\n return createPercentDescriptorParam();\n case BALANCE_LEVEL:\n return createPercentDescriptorParam();\n case TREBLE_LEVEL:\n return createPercentDescriptorParam();\n case BASS_LEVEL:\n return createPercentDescriptorParam();\n case ZINDEX:\n return createDoubleDescriptorParam();\n case FONT_FAMILY:\n return createStringDescriptorParam();\n case FONT_SIZE:\n return createDoubleDescriptorParam();\n case FONT_VARIANT:\n return createFontVariantDescriptorParam();\n case FONT_WEIGHT:\n return createFontWeightDescriptorParam();\n case FONT_COLOR:\n return createColorDescriptorParam();\n case REUSE_PLAYER:\n return createBooleanDescriptorParam();\n case PLAYER_LIFE:\n return createPlayerLifeDescriptorParam();\n default:\n return createStringDescriptorParam();\n }\n}\n"
|
"public void testExpression6() {\n String expression = oldExpressions[6];\n try {\n List list = extractColumnExpression(new ScriptExpression(expression));\n assertTrue(list.size() == 1);\n } catch (BirtException e) {\n fail(\"String_Node_Str\");\n }\n}\n"
|
"public void performRequest(Request req) {\n if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {\n DirectEditRequest drequest = (DirectEditRequest) req;\n Point figureLocation = drequest.getLocation();\n IFigure findFigureAt = getFigure().findFigureAt(figureLocation.x, figureLocation.y);\n if (findFigureAt != null && findFigureAt instanceof IWidgetCell) {\n directEditManager = new PigMapNodeDirectEditManager(this, new PigMapNodeCellEditorLocator((Figure) findFigureAt));\n directEditManager.show();\n }\n }\n}\n"
|
"public void onHeldItemChanged(OnChangedComponent event, EntityRef character, CharacterHeldItemComponent heldItemComponent, CharacterComponent characterComponents) {\n if (localPlayer.getCharacterEntity().equals(character)) {\n EntityRef newItem = heldItemComponent.selectedItem;\n linkHeldItemLocationForLocalPlayer(newItem);\n }\n}\n"
|
"private Class<T> defineNewClass(ClassVisitor modifier) {\n ClassLoader sourceClassLoader = sourceClass.getClassLoader();\n final ClassLoader parentLoader = sourceClassLoader != null ? sourceClassLoader : ImplementationClass.class.getClassLoader();\n final byte[] modifiedClassfile = modifier.toByteArray();\n Class<T> generatedClass = (Class<T>) new ClassLoader(parentLoader) {\n protected Class<?> findClass(String name) {\n return defineClass(name, modifiedClassfile, 0, modifiedClassfile.length);\n }\n }.findClass(generatedClassName);\n generatedBytecode = modifiedClassfile;\n return generatedClass;\n}\n"
|
"public boolean locationIsAtHome(final Player player, boolean coop, Location loc) {\n Set<Location> islandTestLocations = new HashSet<Location>();\n if (plugin.getPlayers().hasIsland(player.getUniqueId())) {\n islandTestLocations.add(plugin.getPlayers().getIslandLocation(player.getUniqueId()));\n if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {\n islandTestLocations.add(netherIsland(plugin.getPlayers().getIslandLocation(player.getUniqueId())));\n }\n } else if (plugin.getPlayers().inTeam(player.getUniqueId())) {\n islandTestLocations.add(plugin.getPlayers().getTeamIslandLocation(player.getUniqueId()));\n if (Settings.createNether && Settings.newNether && ASkyBlock.getNetherWorld() != null) {\n islandTestLocations.add(netherIsland(plugin.getPlayers().getTeamIslandLocation(player.getUniqueId())));\n }\n }\n if (coop) {\n islandTestLocations.addAll(CoopPlay.getInstance().getCoopIslands(player));\n }\n if (islandTestLocations.isEmpty()) {\n return false;\n }\n for (Location islandTestLocation : islandTestLocations) {\n if (islandTestLocation != null && islandTestLocation.getWorld() != null && islandTestLocation.getWorld().equals(loc.getWorld())) {\n int protectionRange = Settings.islandProtectionRange;\n if (getIslandAt(islandTestLocation) != null) {\n Island island = getProtectedIslandAt(islandTestLocation);\n if (island != null) {\n protectionRange = island.getProtectionSize();\n }\n }\n if (loc.getX() > islandTestLocation.getX() - protectionRange / 2D && loc.getX() < islandTestLocation.getX() + protectionRange / 2D && loc.getZ() > islandTestLocation.getZ() - protectionRange / 2D && loc.getZ() < islandTestLocation.getZ() + protectionRange / 2D) {\n return true;\n }\n }\n }\n return false;\n}\n"
|
"public static boolean deployKubernetesGroup(KubernetesGroup kubernetesGroupBean) throws RestAPIException {\n AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient();\n if (autoscalerServiceClient != null) {\n org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup = PojoConverter.convertToASKubernetesGroupPojo(kubernetesGroupBean);\n try {\n return autoscalerServiceClient.deployKubernetesGroup(kubernetesGroup);\n } catch (RemoteException e) {\n log.error(e.getMessage(), e);\n throw new RestAPIException(e.getMessage(), e);\n } catch (AutoScalerServiceInvalidKubernetesGroupExceptionException e) {\n String message = e.getFaultMessage().getInvalidKubernetesGroupException().getMessage();\n log.error(message, e);\n throw new RestAPIException(message, e);\n }\n }\n return false;\n}\n"
|
"protected void getQueryString1(StringBuilder sbSelectFrom) {\n sbSelectFrom.append(\"String_Node_Str\");\n sbSelectFrom.append(entityType.getName()).append(' ');\n sbSelectFrom.append(entityAlias);\n sbSelectFrom.append(\"String_Node_Str\");\n for (Map.Entry<String, String> attributeEntry : setAttributes.entrySet()) {\n sbSelectFrom.append(attributeEntry.getKey());\n sbSelectFrom.append(\"String_Node_Str\");\n sbSelectFrom.append(attributeEntry.getValue());\n }\n appendWhereClause(sbSelectFrom);\n}\n"
|
"public boolean generate(World world, Random rand, int x, int y, int z) {\n final int veinSize = genVeinSize;\n final int branchSize = 1 + (veinSize / 30);\n final int subBranchSize = 1 + (branchSize / 5);\n boolean r = false;\n for (int blocksVein = 0; blocksVein <= veinSize; ) {\n int posX = x;\n int posY = y;\n int posZ = z;\n int directionChange = rand.nextInt(6);\n int directionX = -rand.nextInt(2);\n int directionY = -rand.nextInt(2);\n int directionZ = -rand.nextInt(2);\n {\n directionX += ~directionX >>> 31;\n directionX += ~directionY >>> 31;\n directionX += ~directionZ >>> 31;\n }\n for (int blocksBranch = 0; blocksBranch <= branchSize; ) {\n if (directionChange != 1) {\n posX += rand.nextInt(2) * directionX;\n }\n if (directionChange != 2) {\n posY += rand.nextInt(2) * directionY;\n }\n if (directionChange != 3) {\n posZ += rand.nextInt(2) * directionZ;\n }\n if (rand.nextInt(3) == 0) {\n int posX2 = posX;\n int posY2 = posY;\n int posZ2 = posZ;\n int directionChange2 = rand.nextInt(6);\n int directionX2 = -rand.nextInt(2);\n int directionY2 = -rand.nextInt(2);\n int directionZ2 = -rand.nextInt(2);\n {\n directionX2 += ~directionX2 >>> 31;\n directionX2 += ~directionY2 >>> 31;\n directionX2 += ~directionZ2 >>> 31;\n }\n for (int blocksSubBranch = 0; blocksSubBranch <= subBranchSize; ) {\n if (directionChange2 != 0) {\n posX2 += rand.nextInt(2) * directionX2;\n }\n if (directionChange2 != 1) {\n posY2 += rand.nextInt(2) * directionY2;\n }\n if (directionChange2 != 2) {\n posZ2 += rand.nextInt(2) * directionZ2;\n }\n r |= generateBlock(world, posX2, posY2, posZ2, genBlock, cluster);\n if (sparse) {\n blocksVein++;\n blocksBranch++;\n }\n blocksSubBranch++;\n }\n }\n r |= generateBlock(world, posX, posY, posZ, genBlock, cluster);\n blocksBranch++;\n }\n x = x + (rand.nextInt(3) - 1);\n y = y + (rand.nextInt(3) - 1);\n z = z + (rand.nextInt(3) - 1);\n blocksVein++;\n }\n return r;\n}\n"
|
"public void applyChanges(Revision rev, String path, boolean isNew, boolean isWritten, long oldWriteCount, long writeCountInc, ArrayList<String> added, ArrayList<String> removed) {\n if (!isWritten) {\n if (writeCountInc == 0) {\n writeCountIncrements.remove(path);\n } else {\n writeCountIncrements.put(path, writeCountInc);\n }\n } else {\n writeCountIncrements.remove(path);\n }\n long newWriteCount = oldWriteCount + writeCountInc;\n Children c = nodeChildrenCache.get(path + \"String_Node_Str\" + (newWriteCount - 1));\n if (isNew || (!isDelete && c != null)) {\n String id = path + \"String_Node_Str\" + newWriteCount;\n Children c2 = new Children(path, id, rev);\n TreeSet<String> set = new TreeSet<String>();\n if (c != null) {\n set.addAll(c.children);\n }\n set.removeAll(removed);\n set.addAll(added);\n c2.children.addAll(set);\n if (nodeChildrenCache.get(id) != null) {\n throw new AssertionError(\"String_Node_Str\");\n }\n nodeChildrenCache.put(id, c2);\n }\n}\n"
|
"private Collection<Filter> createDeleteFilter(Operations operations, Operator operator) {\n Collection<Filter> filters = new LinkedList<>();\n ColumnName name = new ColumnName(CATALOG, TABLE, COLUMN_PK);\n ColumnSelector primaryKey = new ColumnSelector(name);\n Selector rightTerm = new StringSelector(\"String_Node_Str\");\n Relation relation = new Relation(primaryKey, operator, rightTerm);\n filters.add(new Filter(operations, relation));\n return filters;\n}\n"
|
"public Class getWSObjectClass() {\n return WSStoredProcedure.class;\n}\n"
|
"private RankingFuture validatePeople(NotificationRecord record) {\n float affinity = NONE;\n Bundle extras = record.getNotification().extras;\n if (extras == null) {\n return null;\n }\n final String[] people = getExtraPeople(extras);\n if (people == null || people.length == 0) {\n return null;\n }\n if (INFO)\n Slog.i(TAG, \"String_Node_Str\" + record.sbn.getKey());\n final LinkedList<String> pendingLookups = new LinkedList<String>();\n for (int personIdx = 0; personIdx < people.length && personIdx < MAX_PEOPLE; personIdx++) {\n final String handle = people[personIdx];\n if (TextUtils.isEmpty(handle))\n continue;\n synchronized (mPeopleCache) {\n LookupResult lookupResult = mPeopleCache.get(handle);\n if (lookupResult == null || lookupResult.isExpired()) {\n pendingLookups.add(handle);\n } else {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + lookupResult.mId);\n }\n if (lookupResult != null) {\n affinity = Math.max(affinity, lookupResult.getAffinity());\n }\n }\n }\n record.setContactAffinity(affinity);\n if (pendingLookups.isEmpty()) {\n if (INFO)\n Slog.i(TAG, \"String_Node_Str\" + affinity);\n return null;\n }\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + record.sbn.getKey());\n return new RankingReconsideration(record.getKey()) {\n float mContactAffinity = NONE;\n\n public void work() {\n if (INFO)\n Slog.i(TAG, \"String_Node_Str\" + mRecord.sbn.getKey());\n float affinity = NONE;\n for (final String handle : pendingLookups) {\n LookupResult lookupResult = null;\n final Uri uri = Uri.parse(handle);\n if (\"String_Node_Str\".equals(uri.getScheme())) {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + handle);\n lookupResult = resolvePhoneContact(uri.getSchemeSpecificPart());\n } else if (\"String_Node_Str\".equals(uri.getScheme())) {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + handle);\n lookupResult = resolveEmailContact(uri.getSchemeSpecificPart());\n } else if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {\n if (DEBUG)\n Slog.d(TAG, \"String_Node_Str\" + handle);\n lookupResult = searchContacts(uri);\n } else {\n lookupResult = new LookupResult();\n Slog.w(TAG, \"String_Node_Str\" + handle);\n }\n if (lookupResult != null) {\n synchronized (mPeopleCache) {\n mPeopleCache.put(handle, lookupResult);\n }\n affinity = Math.max(affinity, lookupResult.getAffinity());\n }\n }\n float affinityBound = mRecord.getContactAffinity();\n affinity = Math.max(affinity, affinityBound);\n mRecord.setContactAffinity(affinity);\n if (INFO)\n Slog.i(TAG, \"String_Node_Str\" + affinity);\n }\n };\n}\n"
|
"private static CategoryDataset createPatternMatchDataset(List<IndicatorUnit> indicatorUnitList, boolean isCreate) {\n DefaultCategoryDataset dataset = new DefaultCategoryDataset();\n if (isCreate) {\n int i = 0;\n for (IndicatorUnit unit : indicatorUnitList) {\n IndicatorCommonUtil.compositeIndicatorMap(unit);\n String label = unit.getIndicatorName();\n if (unit.isExcuted()) {\n PatternMatchingExt patternExt = (PatternMatchingExt) unit.getValue();\n double notMathCount = patternExt.getNotMatchingValueCount();\n double machCount = patternExt.getMatchingValueCount();\n dataset.addValue(machCount, \"String_Node_Str\", label);\n dataset.addValue(notMathCount, \"String_Node_Str\", label);\n } else {\n dataset.addValue(0, \"String_Node_Str\", \"String_Node_Str\");\n dataset.addValue(0, \"String_Node_Str\", \"String_Node_Str\");\n }\n i++;\n }\n } else {\n dataset.addValue(0.23, \"String_Node_Str\", \"String_Node_Str\");\n dataset.addValue(0.77, \"String_Node_Str\", \"String_Node_Str\");\n }\n return dataset;\n}\n"
|
"public Source resolveSchema(String systemId) {\n if (!addSchemaToList(systemId)) {\n return null;\n }\n try {\n InputSource inputSource = schemaResolver.resolveEntity(publicId, systemId);\n if (inputSource != null) {\n return new SAXSource(inputSource);\n }\n } catch (Exception ex) {\n throw SDOException.errorResolvingSchema(ex);\n }\n return null;\n}\n"
|
"public boolean redo() {\n if (redoMoves.size() > 0) {\n if (players.other(myTurn()).type().equals(\"String_Node_Str\")) {\n move(redoMoves.removeLast(), myTurn());\n move(redoMoves.removeLast(), myTurn());\n display();\n System.out.println(\"String_Node_Str\" + myTurn().name + \"String_Node_Str\");\n return true;\n } else {\n move(redoMoves.removeLast(), myTurn());\n display();\n System.out.println(\"String_Node_Str\" + myTurn().name + \"String_Node_Str\");\n return true;\n }\n } else {\n System.out.println(\"String_Node_Str\");\n return false;\n }\n}\n"
|
"public boolean cast(SpellAbility ability, Game game, boolean noMana) {\n if (!ability.getSpellAbilityType().equals(SpellAbilityType.BASE)) {\n ability = chooseSpellAbilityForCast(ability, game, noMana);\n }\n Card card = game.getCard(ability.getSourceId());\n if (card != null) {\n if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId))) {\n int bookmark = game.bookmarkState();\n Zone fromZone = game.getState().getZone(card.getMainCard().getId());\n card.cast(game, fromZone, ability, playerId);\n Spell spell = game.getStack().getSpell(ability.getId());\n if (ability.getSourceId().equals(getCastSourceIdWithAlternateMana())) {\n ManaCosts alternateCosts = getCastSourceIdManaCosts();\n Ability spellAbility = spell.getSpellAbility();\n if (alternateCosts == null) {\n noMana = true;\n } else {\n spellAbility.getManaCosts().clear();\n spellAbility.getManaCosts().add(alternateCosts.copy());\n spellAbility.getManaCostsToPay().clear();\n spellAbility.getManaCostsToPay().add(alternateCosts.copy());\n }\n }\n setCastSourceIdWithAlternateMana(null, null);\n GameEvent event = GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, spell.getSpellAbility().getId(), spell.getSpellAbility().getSourceId(), playerId);\n game.fireEvent(event);\n if (spell.activate(game, noMana)) {\n event = GameEvent.getEvent(GameEvent.EventType.SPELL_CAST, spell.getSpellAbility().getId(), spell.getSpellAbility().getSourceId(), playerId);\n event.setZone(fromZone);\n game.fireEvent(event);\n if (!game.isSimulation()) {\n game.informPlayers(getLogName() + spell.getActivatedMessage(game));\n }\n game.removeBookmark(bookmark);\n resetStoredBookmark(game);\n return true;\n }\n restoreState(bookmark, ability.getRule(), game);\n }\n }\n return false;\n}\n"
|
"public static void initializeLookAndFeel() {\n synchronized (lookAndFeelInitializedLock) {\n if (lookAndFeelInitialized) {\n return;\n }\n }\n LookAndFeel selectedLaf = null;\n if (Platform.isWindows()) {\n selectedLaf = new WindowsLookAndFeel();\n } else if (System.getProperty(\"String_Node_Str\") == null && !Platform.isMac()) {\n selectedLaf = new PlasticLookAndFeel();\n } else {\n try {\n String systemClassName = UIManager.getSystemLookAndFeelClassName();\n try {\n String gtkLAF = \"String_Node_Str\";\n Class.forName(gtkLAF);\n if (systemClassName.equals(\"String_Node_Str\")) {\n systemClassName = gtkLAF;\n }\n } catch (ClassNotFoundException ce) {\n LOGGER.error(\"String_Node_Str\", ce);\n }\n LOGGER.trace(\"String_Node_Str\" + systemClassName);\n UIManager.setLookAndFeel(systemClassName);\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e1) {\n selectedLaf = new PlasticLookAndFeel();\n LOGGER.error(\"String_Node_Str\", e1);\n }\n }\n if (selectedLaf instanceof PlasticLookAndFeel) {\n PlasticLookAndFeel.setPlasticTheme(PlasticLookAndFeel.createMyDefaultTheme());\n PlasticLookAndFeel.setTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE);\n PlasticLookAndFeel.setHighContrastFocusColorsEnabled(false);\n } else if (selectedLaf != null && selectedLaf.getClass() == MetalLookAndFeel.class) {\n MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());\n }\n JRadioButton radio = new JRadioButton();\n radio.getUI().uninstallUI(radio);\n JCheckBox checkBox = new JCheckBox();\n checkBox.getUI().uninstallUI(checkBox);\n synchronized (lookAndFeelInitialized) {\n if (selectedLaf != null) {\n try {\n UIManager.setLookAndFeel(selectedLaf);\n } catch (UnsupportedLookAndFeelException e) {\n LOGGER.warn(\"String_Node_Str\", e);\n }\n }\n lookAndFeelInitialized = Boolean.valueOf(true);\n }\n}\n"
|
"public Object answer(InvocationOnMock invocation) throws Throwable {\n ItemStatus status = (ItemStatus) invocation.getArguments()[1];\n if (status.isNotLastItem()) {\n writer.write(\"String_Node_Str\");\n } else {\n writer.write(\"String_Node_Str\" + \"String_Node_Str\");\n }\n return null;\n}\n"
|
"public void addGesture(String entryName, Gesture gesture) {\n if (entryName == null || entryName.length() == 0) {\n return;\n }\n ArrayList<Gesture> gestures = mNamedGestures.get(entryName);\n if (gestures == null) {\n gestures = new ArrayList<Gesture>();\n mNamedGestures.put(entryName, gestures);\n }\n gestures.add(gesture);\n mClassifier.addInstance(Instance.createInstance(mSequenceType, mOrientationStyle, gesture, entryName));\n mChanged = true;\n}\n"
|
"void add(double confidence, boolean correct) {\n for (int i = 0; i < CONFIDENCE_THRESHOLDS.length; i++) {\n if (confidence >= CONFIDENCE_THRESHOLDS[i]) {\n falsePositive[i] += correct ? 0d : 1d;\n truePositive[i] += correct ? 1d : 0d;\n }\n }\n}\n"
|
"private void registerUser(final String username, final String email, String password) {\n if (!AppUtils.isNetworkConnected(this)) {\n showErrorDialog();\n } else {\n showProgressDialog();\n mAuthApi.getNonceId(\"String_Node_Str\", \"String_Node_Str\", new Callback<NonceIdResponse>() {\n\n public void success(RegisterResponse registerResponse, Response response) {\n if (registerResponse.getStatus().equals(\"String_Node_Str\")) {\n User user = new User(registerResponse.getUser_id(), username, email, username, true, registerResponse.getCookie());\n PreferenceUtil.writeUserToPreferences(getApplicationContext(), user);\n hideProgressDialog();\n startApp();\n } else {\n hideProgressDialog();\n showAuthError(R.id.error_text, registerResponse.getError());\n }\n }\n public void failure(RetrofitError error) {\n showAuthError(R.id.error_text, \"String_Node_Str\");\n }\n });\n }\n}\n"
|
"private void openDatabase(AndroidDatabase db) {\n if (db.isEncrypted()) {\n try {\n db.setSecureSqLiteDatabase(net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(db.getPath(), db.getPassword(), null));\n } catch (UnsatisfiedLinkError e) {\n throw new IllegalStateException(\"String_Node_Str\", e);\n }\n } else {\n db.setSqLiteDatabase(SQLiteDatabase.openOrCreateDatabase(db.getPath(), null));\n }\n}\n"
|
"public void setupProvisioning(Stack stack) {\n LOGGER.info(\"String_Node_Str\", ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT, stack.getId());\n Credential credential = stack.getCredential();\n String emailAsFolder = stack.getUser().emailAsFolder();\n String filePath = AzureCertificateService.getUserJksFileName(credential, emailAsFolder);\n File file = new File(filePath);\n AzureClient azureClient = new AzureClient(((AzureCredential) credential).getSubscriptionId(), file.getAbsolutePath(), ((AzureCredential) credential).getJks());\n if (!azureClient.isImageAvailable(IMAGE_NAME)) {\n String baseImageUri = \"String_Node_Str\";\n Map<String, String> params = new HashMap<>();\n params.put(AzureStackUtil.NAME, VM_COMMON_NAME);\n params.put(DESCRIPTION, VM_COMMON_NAME);\n params.put(LOCATION, \"String_Node_Str\");\n azureClient.createAffinityGroup(params);\n params = new HashMap<>();\n params.put(AzureStackUtil.NAME, VM_COMMON_NAME);\n params.put(DESCRIPTION, VM_COMMON_NAME);\n params.put(AFFINITYGROUP, VM_COMMON_NAME);\n HttpResponseDecorator response = (HttpResponseDecorator) azureClient.createStorageAccount(params);\n azureClient.waitUntilComplete((String) azureClient.getRequestId(response));\n try {\n Map<String, String> params = new HashMap<>();\n params.put(AzureStackUtil.NAME, VM_COMMON_NAME);\n String keyJson = (String) azureClient.getStorageAccountKeys(params);\n JsonNode actualObj = MAPPER.readValue(keyJson, JsonNode.class);\n String storageAccountKey = actualObj.get(\"String_Node_Str\").get(\"String_Node_Str\").get(\"String_Node_Str\").asText();\n AzureClientUtil.createBlobContainer(storageAccountKey, targetBlobContainerUri);\n AzureClientUtil.copyOsImage(storageAccountKey, baseImageUri, targetImageUri);\n AzureClientUtil.imageCopyProgress(storageAccountKey, targetImageUri);\n params = new HashMap<>();\n params.put(AzureStackUtil.NAME, IMAGE_NAME);\n params.put(OS, \"String_Node_Str\");\n params.put(MEDIALINK, targetImageUri);\n azureClient.addOsImage(params);\n } catch (IOException e) {\n throw new InternalServerException(\"String_Node_Str\");\n }\n }\n reactor.notify(ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT, Event.wrap(new ProvisionSetupComplete(getCloudPlatform(), stack.getId()).withSetupProperty(CREDENTIAL, stack.getCredential()).withSetupProperty(EMAILASFOLDER, stack.getUser().emailAsFolder())));\n}\n"
|
"public void run() {\n while (true) {\n int newTopic;\n try {\n newTopic = newTopics.take();\n } catch (InterruptedException e) {\n continue;\n }\n String lastMod = null;\n Topic oldTopic = topics.get(newTopic);\n if (oldTopic != null) {\n oldTopic.lock.readLock().lock();\n lastMod = oldTopic.getLastMod();\n oldTopic.lock.readLock().unlock();\n }\n long startTime = DateTime.now().getMillis();\n Topic topic;\n try {\n topic = sourceBoard.getThread(newTopic, lastMod);\n } catch (HttpGetException e) {\n if (e.getHttpStatus() == 304) {\n pingTopic(oldTopic);\n debug(TALK, newTopic + \"String_Node_Str\");\n continue;\n } else if (e.getHttpStatus() == 404) {\n if (oldTopic != null) {\n oldTopic.lock.writeLock().lock();\n if (oldTopic.getLastPage() < pageLimbo) {\n if (oldTopic.getAllPosts().size() > 1) {\n int op = oldTopic.getAllPosts().iterator().next();\n try {\n deletedPosts.put(op);\n } catch (InterruptedException e1) {\n }\n }\n topicUpdates.add(oldTopic);\n debug(TALK, newTopic + \"String_Node_Str\" + oldTopic.getLastPage() + \"String_Node_Str\");\n }\n topics.remove(newTopic);\n oldTopic.lock.writeLock().unlock();\n }\n continue;\n } else {\n pingTopic(oldTopic);\n debug(WARN, newTopic + \"String_Node_Str\" + e.getMessage());\n continue;\n }\n } catch (ContentGetException e) {\n pingTopic(oldTopic);\n debug(WARN, newTopic + \"String_Node_Str\" + e.getMessage());\n continue;\n } catch (ContentParseException e) {\n pingTopic(oldTopic);\n debug(ERROR, newTopic + \"String_Node_Str\" + e.getMessage());\n continue;\n }\n if (topic == null) {\n pingTopic(oldTopic);\n debug(WARN, newTopic + \"String_Node_Str\");\n continue;\n }\n topic.setLastHit(startTime);\n topic.lock.writeLock().lock();\n if (oldTopic != null) {\n oldTopic.lock.writeLock().lock();\n if (oldTopic.getLastHit() > startTime) {\n debug(ERROR, \"String_Node_Str\" + oldTopic.getNum());\n oldTopic.lock.writeLock().unlock();\n topic.lock.readLock().unlock();\n continue;\n }\n findDeleted(oldTopic, topic, true);\n topic.setLastPage(oldTopic.getLastPage());\n topic.setLastModTimestamp(oldTopic.getLastModTimestamp());\n topics.put(newTopic, topic);\n oldTopic.lock.writeLock().unlock();\n } else {\n topics.put(newTopic, topic);\n }\n topicUpdates.add(topic);\n topic.lock.writeLock().unlock();\n debug(TALK, newTopic + \"String_Node_Str\" + ((oldTopic != null && oldTopic.getLastMod() != null) ? \"String_Node_Str\" : \"String_Node_Str\"));\n }\n}\n"
|
"public void run() {\n if (Policy.TRACING_ACTIONS) {\n System.out.println(\"String_Node_Str\" + getSourceViewer());\n }\n if (isEnabled()) {\n DataSetHandle handle = (DataSetHandle) getSelectedObjects().getFirstElement();\n try {\n DataSetUIUtil.updateColumnCacheAfterCleanRs(handle);\n } catch (SemanticException e) {\n ExceptionHandler.handle(e);\n }\n getSourceViewer().refresh(handle);\n }\n}\n"
|
"private Collection<AnnotationData> getAnnotationSet(final List<TagAndLength> pTags) {\n Collection<AnnotationData> ret = null;\n if (pTags != null) {\n Map<ITag, AnnotationData> data = AnnotationUtils.getInstance().getMap().get(getClass().getName());\n ret = new ArrayList<AnnotationData>(data.size());\n for (TagAndLength tal : pTags) {\n AnnotationData ann = data.get(tal.getTag());\n if (ann != null) {\n ann.setSize(tal.getLength() * BitUtils.BYTE_SIZE);\n ret.add(ann);\n }\n }\n } else {\n ret = AnnotationUtils.getInstance().getMapSet().get(getClass().getName());\n }\n return ret;\n}\n"
|
"private List<BoundaryPart> getUpperSameRightPoint(int index, BoundaryPart orig) {\n Point point = orig.getConstraint().getPointRight();\n List<BoundaryPart> ret = new ArrayList<BoundaryPart>();\n BoundaryPart bp;\n for (int i = index + 1; i < boundary.size(); i++) {\n bp = boundary.get(i);\n if (bp.getConstraint().getPointRight().equals(point)) {\n ret.add(bp);\n } else {\n break;\n }\n }\n return ret;\n}\n"
|
"public void put(K key, V value) {\n long start = statisticsEnabled() ? System.nanoTime() : 0;\n checkStatusStarted();\n if (value == null) {\n throw new NullPointerException(\"String_Node_Str\" + key);\n }\n lockManager.lock(key);\n try {\n RIEntry<K, V> entry = new RIEntry<K, V>(key, value);\n writeCacheEntry(entry);\n RICacheEventEventDispatcher<K, V> dispatcher = new RICacheEventEventDispatcher<K, V>();\n long now = System.currentTimeMillis();\n Object internalKey = keyConverter.toInternal(key);\n Object internalValue = valueConverter.toInternal(value);\n RICachedValue cachedValue = entries.get(internalKey);\n boolean isExpired = cachedValue != null && cachedValue.isExpiredAt(now);\n if (cachedValue == null || isExpired) {\n if (isExpired) {\n V expiredValue = valueConverter.fromInternal(cachedValue.get());\n dispatcher.addEvent(CacheEntryExpiredListener.class, new RICacheEntryEvent<K, V>(this, key, expiredValue));\n }\n Duration duration;\n try {\n duration = expiryPolicy.getTTLForCreatedEntry(entry);\n } catch (Throwable t) {\n duration = getDefaultDuration();\n }\n long expiryTime = duration.getAdjustedTime(now);\n cachedValue = new RICachedValue(internalValue, now, expiryTime);\n entries.put(internalKey, cachedValue);\n dispatcher.addEvent(CacheEntryCreatedListener.class, new RICacheEntryEvent<K, V>(this, key, value));\n } else {\n Duration duration = expiryPolicy.getTTLForModifiedEntry(entry, new Duration(now, cachedValue.getExpiryTime()));\n long expiryTime = duration.getAdjustedTime(now);\n V oldValue = valueConverter.fromInternal(cachedValue.get());\n cachedValue.setInternalValue(internalValue, now);\n cachedValue.setExpiryTime(expiryTime);\n dispatcher.addEvent(CacheEntryUpdatedListener.class, new RICacheEntryEvent<K, V>(this, key, value, oldValue));\n }\n dispatcher.dispatch(cacheEntryListenerRegistrations.values());\n } finally {\n lockManager.unLock(key);\n }\n if (statisticsEnabled()) {\n statistics.increaseCachePuts(1);\n statistics.addPutTimeNano(System.nanoTime() - start);\n }\n}\n"
|
"private boolean acquireWorkspaceLock(Shell shell) {\n Location instanceLoc = Platform.getInstanceLocation();\n ConnectionUserPerReader perReader = ConnectionUserPerReader.getInstance();\n if (perReader.isHaveUserPer() && instanceLoc != null && !instanceLoc.isSet()) {\n try {\n String lastWorkSpacePath = perReader.readLastWorkSpace();\n if (!\"String_Node_Str\".equals(lastWorkSpacePath) && lastWorkSpacePath != null) {\n File file = new File(lastWorkSpacePath);\n boolean needSet = true;\n if (instanceLoc.isSet()) {\n File curWorkspace = URIUtil.toFile(URIUtil.toURI(instanceLoc.getURL()));\n if (file.equals(curWorkspace)) {\n needSet = false;\n }\n }\n if (needSet) {\n if (!file.exists()) {\n boolean mkdirs = file.mkdirs();\n if (!mkdirs) {\n MessageDialog.openError(shell, Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"));\n perReader.saveConnections(null);\n return true;\n }\n }\n instanceLoc.set(file.toURL(), false);\n }\n }\n } catch (MalformedURLException e) {\n ExceptionHandler.process(e);\n } catch (URISyntaxException e) {\n ExceptionHandler.process(e);\n } catch (IllegalStateException e) {\n ExceptionHandler.process(e);\n } catch (IOException e) {\n ExceptionHandler.process(e);\n }\n }\n if (instanceLoc == null || instanceLoc.getURL() == null) {\n return true;\n }\n if (!instanceLoc.isSet()) {\n try {\n if (instanceLoc.lock()) {\n return true;\n }\n } catch (Throwable t) {\n }\n }\n return false;\n}\n"
|
"public Collection<IClass> getAllImplementedInterfaces() {\n HashSet<IClass> result = HashSetFactory.make(2);\n IClass klass = loader.lookupClass(TypeReference.array_interfaces[0]);\n if (klass != null) {\n result.add(klass);\n }\n klass = loader.lookupClass(TypeReference.array_interfaces[1]);\n if (klass != null) {\n result.add(klass);\n }\n return result;\n}\n"
|
"public GadgetToken saveToken(BasicOAuthStoreTokenIndex tokenKey, TokenInfo tokenInfo) {\n Map<String, GadgetTokenEntry> tokens = getGadgetTokens();\n GadgetTokenEntry entry = null;\n for (GadgetTokenEntry item : tokens.values()) {\n BasicOAuthStoreTokenIndex key = item.getKey();\n if (tokenKey.equals(key)) {\n entry = item;\n }\n }\n if (entry == null) {\n entry = createGadgetToken();\n tokens.put(\"String_Node_Str\" + System.currentTimeMillis(), entry);\n }\n entry.setGadgetUri(tokenKey.getGadgetUri());\n entry.setModuleId(tokenKey.getModuleId());\n entry.setServiceName(tokenKey.getServiceName());\n entry.setTokenName(tokenKey.getTokenName());\n entry.setUserId(tokenKey.getUserId());\n entry.setAccessToken(tokenInfo.getAccessToken());\n entry.setTokenSecret(tokenInfo.getTokenSecret());\n entry.setSessionHandle(tokenInfo.getSessionHandle() == null ? \"String_Node_Str\" : tokenInfo.getSessionHandle());\n entry.setTokenExpireMillis(expirationTime);\n return entry.getToken();\n}\n"
|
"public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {\n Collection collection = submission.getCollection();\n String actionURL = IdentifierService.getURL(collection).toString() + \"String_Node_Str\" + knot.getId() + \"String_Node_Str\";\n BitstreamFormat currentFormat = bitstream.getFormat();\n BitstreamFormat guessedFormat = FormatIdentifier.guessFormat(context, bitstream);\n BitstreamFormat[] bitstreamFormats = BitstreamFormat.findNonInternal(context);\n int itemID = submissionInfo.getSubmissionItem().getItem().getID();\n String fileUrl = contextPath + \"String_Node_Str\" + itemID + \"String_Node_Str\" + bitstream.getName();\n String fileName = bitstream.getName();\n Division div = body.addInteractiveDivision(\"String_Node_Str\", actionURL, Division.METHOD_POST, \"String_Node_Str\");\n div.setHead(T_submission_head);\n addSubmissionProgressList(div);\n List edit = div.addList(\"String_Node_Str\", List.TYPE_FORM);\n edit.setHead(T_head);\n edit.addLabel(T_file);\n edit.addItem().addXref(fileUrl, fileName);\n Text description = edit.addItem().addText(\"String_Node_Str\");\n description.setLabel(T_description);\n description.setHelp(T_description_help);\n description.setValue(bitstream.getDescription());\n edit.addItem(T_info1);\n if (guessedFormat != null) {\n edit.addLabel(T_format_detected);\n edit.addItem(guessedFormat.getShortDescription());\n }\n Select format = edit.addItem().addSelect(\"String_Node_Str\");\n format.setLabel(T_format_selected);\n format.addOption(-1, T_format_default);\n for (BitstreamFormat bitstreamFormat : bitstreamFormats) {\n String supportLevel = \"String_Node_Str\";\n if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)\n supportLevel = \"String_Node_Str\";\n else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)\n supportLevel = \"String_Node_Str\";\n String name = bitstreamFormat.getShortDescription() + \"String_Node_Str\" + supportLevel + \"String_Node_Str\";\n int id = bitstreamFormat.getID();\n format.addOption(id, name);\n }\n if (currentFormat != null) {\n format.setOptionSelected(currentFormat.getID());\n } else if (guessedFormat != null) {\n format.setOptionSelected(guessedFormat.getID());\n } else {\n format.setOptionSelected(-1);\n }\n edit.addItem(T_info2);\n Text userFormat = edit.addItem().addText(\"String_Node_Str\");\n userFormat.setLabel(T_format_user);\n userFormat.setHelp(T_format_user_help);\n userFormat.setValue(bitstream.getUserFormatDescription());\n div.addHidden(\"String_Node_Str\").setValue(bitstream.getID());\n org.dspace.app.xmlui.wing.element.Item actions = edit.addItem();\n actions.addButton(\"String_Node_Str\").setValue(T_submit_save);\n actions.addButton(\"String_Node_Str\").setValue(T_submit_cancel);\n div.addHidden(\"String_Node_Str\").setValue(knot.getId());\n}\n"
|
"protected void okPressed() {\n try {\n String familyValue = getRawFontFamily();\n String sizeValue = getRawFontSize();\n int colorValue = DEUtil.getRGBInt(color.getRGB());\n int backColorValue = DEUtil.getRGBInt(backColor.getRGB());\n String italicValue = italic.getSelection() ? DesignChoiceConstants.FONT_STYLE_ITALIC : DesignChoiceConstants.FONT_STYLE_NORMAL;\n String weightValue = bold.getSelection() ? DesignChoiceConstants.FONT_WEIGHT_BOLD : DesignChoiceConstants.FONT_WEIGHT_NORMAL;\n String underlineValue = underline.getSelection() ? DesignChoiceConstants.TEXT_UNDERLINE_UNDERLINE : DesignChoiceConstants.TEXT_UNDERLINE_NONE;\n String lingthroughValue = linethrough.getSelection() ? DesignChoiceConstants.TEXT_LINE_THROUGH_LINE_THROUGH : DesignChoiceConstants.TEXT_LINE_THROUGH_NONE;\n if (handle == null) {\n HighlightRule rule = StructureFactory.createHighlightRule();\n rule.setProperty(HighlightRule.OPERATOR_MEMBER, DEUtil.resolveNull(getValueForOperator(operator.getText())));\n if (value1.isVisible()) {\n rule.setProperty(HighlightRule.VALUE1_MEMBER, DEUtil.resolveNull(value1.getText()));\n }\n if (value2.isVisible()) {\n rule.setProperty(HighlightRule.VALUE2_MEMBER, DEUtil.resolveNull(value2.getText()));\n }\n rule.setTestExpression(DEUtil.resolveNull(expression.getText()));\n if (!stylesChooser.getText().equals(NONE_DISPLAY_TEXT)) {\n rule.setStyle((StyleHandle) styles.get(stylesChooser.getText()));\n } else {\n if (color.getRGB() != null) {\n rule.setProperty(HighlightRule.COLOR_MEMBER, new Integer(colorValue));\n }\n if (backColor.getRGB() != null) {\n rule.setProperty(HighlightRule.BACKGROUND_COLOR_MEMBER, new Integer(backColorValue));\n }\n if (familyValue != null) {\n rule.setProperty(HighlightRule.FONT_FAMILY_MEMBER, familyValue);\n }\n if (sizeValue != null) {\n rule.setProperty(HighlightRule.FONT_SIZE_MEMBER, sizeValue);\n }\n if (isItalicChanged) {\n rule.setProperty(HighlightRule.FONT_STYLE_MEMBER, italicValue);\n }\n if (isBoldChanged) {\n rule.setProperty(HighlightRule.FONT_WEIGHT_MEMBER, weightValue);\n }\n if (isLinethroughChanged) {\n rule.setProperty(HighlightRule.TEXT_LINE_THROUGH_MEMBER, lingthroughValue);\n }\n if (isUnderlineChanged) {\n rule.setProperty(HighlightRule.TEXT_UNDERLINE_MEMBER, underlineValue);\n }\n }\n handle = provider.doAddItem(rule, handleCount);\n } else {\n handle.setTestExpression(DEUtil.resolveNull(expression.getText()));\n handle.setOperator(DEUtil.resolveNull(getValueForOperator(operator.getText())));\n handle.setValue1(DEUtil.resolveNull(value1.getText()));\n if (handle.getOperator().equals(DesignChoiceConstants.MAP_OPERATOR_BETWEEN) || handle.getOperator().equals(DesignChoiceConstants.MAP_OPERATOR_NOT_BETWEEN)) {\n handle.setValue2(DEUtil.resolveNull(value2.getText()));\n }\n if (!stylesChooser.getText().equals(NONE_DISPLAY_TEXT)) {\n if (handle.getStyle() == null) {\n handle.setStyle((StyleHandle) styles.get(stylesChooser.getText()));\n } else if (!stylesChooser.getText().equals(handle.getStyle().getName())) {\n handle.setStyle((StyleHandle) styles.get(stylesChooser.getText()));\n }\n removeLocalStyleProperties();\n } else {\n handle.setStyle(null);\n handle.getFontFamilyHandle().setStringValue(DEUtil.resolveNull(familyValue));\n handle.getFontSize().setStringValue(DEUtil.resolveNull(sizeValue));\n if (color.getRGB() != null) {\n handle.getColor().setRGB(colorValue);\n } else {\n handle.getColor().setValue(null);\n }\n if (backColor.getRGB() != null) {\n handle.getBackgroundColor().setRGB(backColorValue);\n } else {\n handle.getBackgroundColor().setValue(null);\n }\n if (isItalicChanged) {\n handle.setFontStyle(italicValue);\n }\n if (isBoldChanged) {\n handle.setFontWeight(weightValue);\n }\n if (isUnderlineChanged) {\n handle.setTextUnderline(underlineValue);\n }\n if (isLinethroughChanged) {\n handle.setTextLineThrough(lingthroughValue);\n }\n }\n }\n } catch (Exception e) {\n WidgetUtil.processError(getShell(), e);\n }\n super.okPressed();\n}\n"
|
"private static Object readValue(final byte tagType, final ByteBuffer byteBuffer) {\n switch(tagType) {\n case 'Z':\n return readNullTerminatedString(byteBuffer);\n case 'A':\n return (char) byteBuffer.get();\n case 'I':\n return byteBuffer.getInt() & 0xffffffffL;\n case 'i':\n return byteBuffer.getInt();\n case 's':\n return byteBuffer.getShort();\n case 'S':\n return byteBuffer.getShort() & 0xffff;\n case 'c':\n return byteBuffer.get();\n case 'C':\n return (short) ((int) byteBuffer.get() & 0xff);\n case 'f':\n return byteBuffer.getFloat();\n case 'H':\n final String hexRep = readNullTerminatedString(byteBuffer);\n return StringUtil.hexStringToBytes(hexRep);\n default:\n throw new SAMFormatException(\"String_Node_Str\" + (char) tagType);\n }\n}\n"
|
"private String getPathName() {\n AbstractMember localMember = (AbstractMember) hazelcastInstance.getCluster().getLocalMember();\n Address address = localMember.getAddress();\n String addressString = address.getHost().replace(\"String_Node_Str\", \"String_Node_Str\") + \"String_Node_Str\" + address.getPort();\n return \"String_Node_Str\" + addressString + \"String_Node_Str\" + currentTimeMillis() + \"String_Node_Str\";\n}\n"
|
"public CourseRatingDao getCourseRatingDao() {\n if (courseRatingDao == null) {\n courseRatingDao = new SQLCourseRatingDao(new SimpleRemoveBehavior<CourseRatingEntity>());\n }\n return courseRatingDao;\n}\n"
|
"private void resetLastTrack() {\n String lastTrack = tp.playlist.preferences.get(Keys.LAST_TRACK_PLAYED);\n Track restoredTrack = null;\n if (!Shorty.isVoid(lastTrack)) {\n restoredTrack = tp.playlist.getTrack(lastTrack);\n }\n if (restoredTrack == null) {\n tp.player.change(tp.playlist.getNext(playOrderStrategy, null));\n } else {\n tp.player.change(restoredTrack);\n if (tp.playlist.preferences.get(Keys.EXIT_PLAY_TIME) != null) {\n tp.player.goToMillis(tp.playlist.preferences.get(Keys.EXIT_PLAY_TIME));\n } else {\n tp.player.goToMillis(0);\n }\n }\n}\n"
|
"public void send(byte[] message) {\n if (connected) {\n if (sendQueue.remainingCapacity() == 0)\n Thread.yield();\n while (!sendQueue.offer(message)) {\n byte[] discarded = sendQueue.poll();\n logger.warn(\"String_Node_Str\", discarded, message);\n }\n } catch (InterruptedException e) {\n if (!closing) {\n throw new RuntimeException(\"String_Node_Str\", e);\n }\n }\n}\n"
|
"protected void updateHiveServerAndMakeSelection(int distributionIndex, int hiveVersionIndex) {\n boolean isSupportHiveServer2 = HiveConnUtils.isSupportHiveServer2(distributionIndex, hiveVersionIndex);\n if (isSupportHiveServer2) {\n DatabaseConnection conn = getConnection();\n String[] hiveServerDisplayNames = HiveServerVersionUtils.extractAvailableArrayDisplayNames(HiveConnUtils.getHiveVersionObj(distributionIndex, hiveVersionIndex));\n hiveServerVersionCombo.getCombo().setItems(hiveServerDisplayNames);\n String hiveServerKey = conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);\n int hiveServerIndex = 0;\n if (hiveServerDisplayNames != null && hiveServerKey != null) {\n for (hiveServerIndex = 0; hiveServerIndex < hiveServerDisplayNames.length; hiveServerIndex++) {\n if (hiveServerKey.equals(HiveServerVersionUtils.extractKey(HiveConnUtils.getIndexOfHiveServerByDisplayName(hiveServerDisplayNames[hiveServerIndex])))) {\n break;\n }\n }\n if (hiveServerDisplayNames.length <= hiveServerIndex) {\n hiveServerIndex = 0;\n }\n }\n hiveServerVersionCombo.select(hiveServerIndex);\n }\n int hiveServerIndex = getRealHiveServerIndex(distributionIndex, hiveVersionIndex, hiveServerVersionCombo.getSelectionIndex());\n int hiveModeIndex = hiveModeCombo.getSelectionIndex();\n updateHiveModeAndMakeSelection(distributionIndex, hiveVersionIndex, hiveModeIndex, hiveServerIndex);\n}\n"
|
"public java.util.Date convertStringToDate(String sourceString, QName schemaType) {\n XMLGregorianCalendar xmlGregorianCalender = convertStringToXMLGregorianCalendar(sourceString, schemaType);\n Calendar cal = toCalendar(xmlGregorianCalender);\n Date returnDate = cal.getTime();\n return returnDate;\n}\n"
|
"public int getTag() {\n return 2009120234;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.