content
stringlengths 40
137k
|
---|
"public static void waitUntilElementIsVisible(final String elementLocator) {\n logger.entering(elementLocator);\n Preconditions.checkState(Grid.driver() != null, INVALID_STATE_ERR_MSG);\n By by = HtmlElementUtils.resolveByType(elementLocator);\n ExpectedCondition<WebElement> condition = ExpectedConditions.visibilityOfElementLocated(by);\n waitForCondition(condition);\n logger.exiting();\n}\n"
|
"public boolean isLooping() {\n if (_state != RELEASED) {\n return _mediaPlayer.isLooping();\n }\n return false;\n}\n"
|
"private void displayDownloading(int size) {\n GeoImageViewerView view = ((GeoImageViewerView) SumoPlatform.getApplication().getMainView());\n if (currentSize != size) {\n if (size == 0) {\n SumoPlatform.getApplication().setMessageInfo(\"String_Node_Str\");\n } else {\n view.setInfo(new StringBuilder(\"String_Node_Str\").append(size).toString());\n }\n currentSize = size;\n }\n}\n"
|
"public Texture loadTexture(URL location) {\n if (logger.isLoggable(Level.INFO)) {\n logger.info(\"String_Node_Str\" + location.toExternalForm() + \"String_Node_Str\" + location.getProtocol());\n }\n String evolver = location.getFile();\n if (evolver.contains(\"String_Node_Str\") && location.getProtocol().equalsIgnoreCase(\"String_Node_Str\")) {\n System.err.println(\"String_Node_Str\" + evolver);\n evolver = evolver.substring(evolver.indexOf(\"String_Node_Str\"));\n evolver = evolver.substring(evolver.indexOf('/'));\n System.err.println(\"String_Node_Str\" + evolver);\n try {\n location = new URL(\"String_Node_Str\" + location.getHost() + \"String_Node_Str\" + location.getPort() + \"String_Node_Str\" + evolver);\n } catch (MalformedURLException ex) {\n Logger.getLogger(WonderlandAvatarCache.class.getName()).log(Level.SEVERE, null, ex);\n }\n System.err.println(\"String_Node_Str\" + location.toExternalForm());\n }\n String urlString = location.toExternalForm();\n if (location.getProtocol().equalsIgnoreCase(\"String_Node_Str\") == true) {\n int assetsIndex = urlString.indexOf(\"String_Node_Str\");\n if (assetsIndex != -1) {\n urlString = urlString.substring(assetsIndex);\n }\n URL localURL = null;\n try {\n localURL = new URL(baseURL + urlString);\n return TextureManager.loadTexture(localURL);\n } catch (MalformedURLException excp) {\n logger.log(Level.WARNING, \"String_Node_Str\" + baseURL + urlString, excp);\n return null;\n }\n }\n try {\n return TextureManager.loadTexture(location);\n } catch (Exception e) {\n logger.warning(\"String_Node_Str\" + location.toExternalForm());\n return null;\n }\n}\n"
|
"public void testSystemExitFromClientMain() throws Exception {\n String APP_NAME = \"String_Node_Str\";\n JavaArchive jar = ShrinkHelper.buildJavaArchive(APP_NAME + \"String_Node_Str\", \"String_Node_Str\");\n EnterpriseArchive app = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + \"String_Node_Str\").addAsModule(jar).addAsManifestResource(new File(\"String_Node_Str\" + APP_NAME + \"String_Node_Str\"));\n ShrinkHelper.exportAppToClient(client, app);\n client.startClient();\n assertAppMessage(\"String_Node_Str\");\n assertNotAppMessage(\"String_Node_Str\");\n assertAppMessage(\"String_Node_Str\");\n assertNotAppMessage(\"String_Node_Str\");\n}\n"
|
"private void createSimpleStatistics(final ScrolledForm form, final Composite composite, final ColumnSetMultiValueIndicator columnSetMultiValueIndicator) {\n DefaultCategoryDataset dataset = new DefaultCategoryDataset();\n dataset.addValue(columnSetMultiValueIndicator.getCount(), DefaultMessagesImpl.getString(\"String_Node_Str\"), \"String_Node_Str\");\n dataset.addValue(columnSetMultiValueIndicator.getDistinctCount(), DefaultMessagesImpl.getString(\"String_Node_Str\"), \"String_Node_Str\");\n dataset.addValue(columnSetMultiValueIndicator.getUniqueCount(), DefaultMessagesImpl.getString(\"String_Node_Str\"), \"String_Node_Str\");\n dataset.addValue(columnSetMultiValueIndicator.getDuplicateCount(), DefaultMessagesImpl.getString(\"String_Node_Str\"), \"String_Node_Str\");\n JFreeChart chart = TopChartFactory.createBarChart(DefaultMessagesImpl.getString(\"String_Node_Str\"), dataset, true);\n if (chart != null) {\n Plot plot = chart.getPlot();\n if (plot instanceof CategoryPlot) {\n ChartDecorator.decorateCategoryPlot(chart);\n ((CategoryPlot) plot).getRenderer().setSeriesPaint(0, ChartDecorator.IndiBindColor.INDICATOR_ROW_COUNT.getColor());\n ((CategoryPlot) plot).getRenderer().setSeriesPaint(1, ChartDecorator.IndiBindColor.INDICATOR_DISTINCT_COUNT.getColor());\n ((CategoryPlot) plot).getRenderer().setSeriesPaint(2, ChartDecorator.IndiBindColor.INDICATOR_UNIQUE_COUNT.getColor());\n ((CategoryPlot) plot).getRenderer().setSeriesPaint(3, ChartDecorator.IndiBindColor.INDICATOR_DUPLICATE_COUNT.getColor());\n }\n }\n ChartComposite chartComp = new ChartComposite(composite, SWT.NONE, chart);\n chartComp.setLayoutData(new GridData(GridData.FILL_BOTH));\n}\n"
|
"public static void tokenize(BraintreeFragment fragment, FullWallet wallet) {\n try {\n fragment.postCallback(AndroidPayCardNonce.fromFullWallet(wallet, cart));\n fragment.sendAnalyticsEvent(\"String_Node_Str\");\n } catch (JSONException e) {\n fragment.sendAnalyticsEvent(\"String_Node_Str\");\n try {\n fragment.postCallback(ErrorWithResponse.fromJson(wallet.getPaymentMethodToken().getToken()));\n } catch (JSONException e1) {\n fragment.postCallback(e1);\n }\n }\n}\n"
|
"private String createStateVar(final BPELPlanContext context, final String templateId) {\n final String stateVarName = ModelUtils.makeValidNCName(templateId) + \"String_Node_Str\" + context.getIdForNames();\n final QName stringTypeDeclId = context.importQName(new QName(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"));\n if (!context.addGlobalVariable(stateVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) {\n return null;\n }\n return stateVarName;\n}\n"
|
"public void checkFileSet(String fileSet, String browserId, PrintWriter writer) {\n Collection<FileInfo> clientFileSet = gson.fromJson(fileSet, new TypeToken<Collection<FileInfo>>() {\n }.getType());\n SlaveBrowser browser = capturedBrowsers.getBrowser(browserId);\n Set<FileInfo> browserFileSet = browser.getFileSet();\n Set<FileInfo> filesToRequest = new LinkedHashSet<FileInfo>();\n if (browserFileSet.isEmpty() || !clientFileSet.containsAll(browserFileSet)) {\n for (FileInfo info : clientFileSet) {\n filesToRequest.add(info);\n }\n } else {\n Set<FileInfo> diff = new LinkedHashSet<FileInfo>(clientFileSet);\n diff.removeAll(browserFileSet);\n for (FileInfo info : diff) {\n filesToRequest.add(info);\n }\n for (FileInfo browserFileInfo : browserFileSet) {\n for (FileInfo clientFileInfo : clientFileSet) {\n if (clientFileInfo.equals(browserFileInfo) && clientFileInfo.getTimestamp() > browserFileInfo.getTimestamp()) {\n filesToRequest.add(clientFileInfo);\n break;\n }\n }\n }\n }\n if (!filesToRequest.isEmpty()) {\n if (browser.getBrowserInfo().getName().contains(\"String_Node_Str\") || browser.getBrowserInfo().getName().contains(\"String_Node_Str\") || browser.getBrowserInfo().getName().contains(\"String_Node_Str\")) {\n filesToRequest.clear();\n for (FileInfo info : clientFileSet) {\n filesToRequest.add(info);\n }\n }\n Set<FileInfo> filteredFilesToRequest = filterServeOnlyFiles(clientFileSet, filesToRequest);\n writer.write(gson.toJson(filteredFilesToRequest));\n }\n writer.flush();\n}\n"
|
"private String replace(BufferedReader reader, BufferedWriter writer, String regex, String replacement) throws IOException {\n String currentLine;\n boolean foundFirstMatch = false;\n final Pattern pattern = Pattern.compile(regex + \"String_Node_Str\");\n EolBufferedReader eolReader = new EolBufferedReader(reader);\n while ((currentLine = eolReader.readLineKeepStartEOL()) != null) {\n if (!foundFirstMatch && pattern.matcher(removeEOL(currentLine)).matches()) {\n foundFirstMatch = true;\n currentLine = currentLine.replaceAll(\"String_Node_Str\", replacement);\n }\n if (!firstLine) {\n writer.write(System.lineSeparator());\n }\n writer.write(currentLine);\n firstLine = false;\n }\n return String.format(\"String_Node_Str\", propertyName, propertyValue, getRelativePath());\n}\n"
|
"public String format(Date date) {\n StringBuffer str = new StringBuffer();\n FieldPosition pos = new FieldPosition(DateFormat.DATE_FIELD);\n DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, locale);\n df.format(date, str, pos);\n int endIndex;\n if (pos.getEndIndex() >= str.length()) {\n endIndex = pos.getEndIndex();\n } else {\n endIndex = pos.getEndIndex() + (str.charAt(pos.getEndIndex()) == ',' ? 2 : 1);\n }\n if (endIndex >= str.length()) {\n return str.substring(0, pos.getBeginIndex());\n }\n return str.substring(0, pos.getBeginIndex()) + str.substring(endIndex);\n}\n"
|
"public void doSave(IProgressMonitor monitor) {\n this.saveInProgress = true;\n try {\n if (xmlEditor != null && this.getCurrentPage() == 1) {\n xmlEditor.doSave(monitor);\n ((AFormPage) (formPages.get(0))).refreshPage();\n return;\n }\n int numPages = formPages.size();\n monitor.beginTask(Messages.bind(Messages.XObjectEditor2_saving, this.getEditorInput().getName()), numPages + 1);\n for (int i = 0; i < numPages; i++) {\n if ((formPages.get(i)) instanceof AFormPage) {\n if (!((AFormPage) (formPages.get(i))).beforeDoSave())\n return;\n }\n (formPages.get(i)).doSave(monitor);\n monitor.worked(1);\n if (monitor.isCanceled()) {\n this.saveInProgress = false;\n return;\n }\n (formPages.get(i)).doSave(monitor);\n monitor.worked(1);\n if (monitor.isCanceled()) {\n this.saveInProgress = false;\n return;\n }\n }\n boolean saved = saveResourceToRepository();\n if (xmlEditor != null && saved) {\n xmlEditor.refresh();\n }\n monitor.done();\n}\n"
|
"public void testEarlyEndOfFile() throws Exception {\n Connection c = getConnection();\n try {\n doImportFromFile(c, \"String_Node_Str\", \"String_Node_Str\", null, null, \"String_Node_Str\", 0);\n } catch (SQLException e) {\n assertSQLState(\"String_Node_Str\", e);\n }\n}\n"
|
"public double loss(LabeledInstance<BinaryLabel> instance) {\n double inner = param.dot(instance.getVector());\n double label = instance.getLabel().getAsPlusMinus();\n double z = hypothesis * label;\n if (z <= this.threshold) {\n return this.threshold - z;\n } else {\n return 0.0;\n }\n}\n"
|
"protected View getView(Bundle bundle, Object... entityKeys) {\n if (entityKeys != null) {\n if (commentLayoutView == null) {\n commentLayoutView = container.getBean(\"String_Node_Str\", entityKeys);\n }\n return commentLayoutView;\n } else {\n Log.e(SocializeLogger.LOG_TAG, \"String_Node_Str\" + getClass().getSimpleName());\n return null;\n }\n}\n"
|
"public void onCreate() {\n super.onCreate();\n Log.v(TAG, \"String_Node_Str\");\n mAM = (ActivityManager) getSystemService(ACTIVITY_SERVICE);\n loadPreferences();\n startScheduler();\n mScreenReceiver = new ScreenReceiver();\n IntentFilter filter = new IntentFilter();\n filter.addAction(Intent.ACTION_SCREEN_ON);\n filter.addAction(Intent.ACTION_SCREEN_OFF);\n registerReceiver(mScreenReceiver, filter);\n if (mShowNotification) {\n Intent i = new Intent(this, MainActivity.class);\n PendingIntent.getActivity(this, 0, i, 0);\n PendingIntent pi = PendingIntent.getActivity(this, 0, i, 0);\n String title = getString(R.string.notification_title);\n String content = getString(R.string.notification_state_locked);\n NotificationCompat.Builder nb = new NotificationCompat.Builder(this);\n nb.setSmallIcon(R.drawable.ic_launcher);\n nb.setContentTitle(title);\n nb.setContentText(content);\n nb.setWhen(System.currentTimeMillis());\n nb.setContentIntent(pi);\n nb.setOngoing(true);\n startForeground(NOTIFICATION_ID, nb.build());\n } else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR1) {\n Notification n = new Notification(0, null, System.currentTimeMillis());\n n.flags |= Notification.FLAG_NO_CLEAR;\n startForeground(NOTIFICATION_ID, n);\n }\n}\n"
|
"IBackupAgent bindToAgentSynchronous(ApplicationInfo app, int mode) {\n IBackupAgent agent = null;\n synchronized (mAgentConnectLock) {\n mConnecting = true;\n mConnectedAgent = null;\n try {\n if (mActivityManager.bindBackupAgent(app.packageName, mode, UserHandle.USER_OWNER)) {\n Slog.d(TAG, \"String_Node_Str\" + app);\n long timeoutMark = System.currentTimeMillis() + TIMEOUT_INTERVAL;\n while (mConnecting && mConnectedAgent == null && (System.currentTimeMillis() < timeoutMark)) {\n try {\n mAgentConnectLock.wait(5000);\n } catch (InterruptedException e) {\n Slog.w(TAG, \"String_Node_Str\" + e);\n mConnecting = false;\n mConnectedAgent = null;\n }\n }\n if (mConnecting == true) {\n Slog.w(TAG, \"String_Node_Str\" + app);\n mActivityManager.clearPendingBackup();\n return null;\n }\n if (DEBUG)\n Slog.i(TAG, \"String_Node_Str\" + mConnectedAgent);\n agent = mConnectedAgent;\n }\n } catch (RemoteException e) {\n }\n }\n return agent;\n}\n"
|
"public void actionLocalRecoding() {\n final WorkerLocalRecode worker = new WorkerLocalRecode(model);\n main.showProgressDialog(Resources.getMessage(\"String_Node_Str\"), worker);\n if (worker.getError() != null) {\n Throwable t = worker.getError();\n if (worker.getError() instanceof InvocationTargetException) {\n t = worker.getError().getCause();\n }\n if (t instanceof RollbackRequiredException) {\n this.actionApplySelectedTransformation();\n } else if (t instanceof OutOfMemoryError) {\n main.showInfoDialog(main.getShell(), Resources.getMessage(\"String_Node_Str\"), Resources.getMessage(\"String_Node_Str\"));\n } else if (t instanceof NullPointerException) {\n main.showErrorDialog(main.getShell(), Resources.getMessage(\"String_Node_Str\"), t);\n } else {\n main.showInfoDialog(main.getShell(), Resources.getMessage(\"String_Node_Str\"), Resources.getMessage(\"String_Node_Str\") + t.getMessage());\n }\n return;\n }\n update(new ModelEvent(this, ModelPart.OUTPUT, model.getOutput()));\n if (model.getMaximalSizeForComplexOperations() == 0 || model.getInputConfig().getInput().getHandle().getNumRows() <= model.getMaximalSizeForComplexOperations()) {\n this.model.getViewConfig().setMode(Mode.GROUPED);\n this.updateViewConfig(true);\n } else {\n this.model.getViewConfig().setMode(Mode.UNSORTED);\n this.updateViewConfig(true);\n }\n this.update(new ModelEvent(this, ModelPart.SELECTED_VIEW_CONFIG, model.getOutput()));\n}\n"
|
"private final HashGroupifyEntry addInternal(final int[] key, final int line, final int value, final int hash, final int pvalue) {\n int index = hash & (buckets.length - 1);\n HashGroupifyEntry entry = findEntry(key, index, hash);\n if (entry == null) {\n if (++elementCount > threshold) {\n rehash();\n index = hash & (buckets.length - 1);\n }\n entry = createEntry(key, index, hash, representant);\n }\n entry.count += value;\n if (subset != null) {\n entry.pcount += pvalue;\n if (value > 0) {\n entry.representant = line;\n }\n }\n if (entry.count >= k) {\n if (!entry.isNotOutlier) {\n entry.isNotOutlier = true;\n currentOutliers -= (entry.count - value);\n }\n } else {\n currentOutliers += value;\n }\n return entry;\n}\n"
|
"public synchronized void readContents(DatabaseMetaData meta) throws SQLException {\n String prod = StringUtils.toLowerEnglish(meta.getDatabaseProductName());\n isSQLite = prod.indexOf(\"String_Node_Str\") >= 0;\n String url = meta.getURL();\n if (url != null) {\n isH2 = url.startsWith(\"String_Node_Str\");\n if (isH2) {\n PreparedStatement prep = meta.getConnection().prepareStatement(\"String_Node_Str\" + \"String_Node_Str\");\n prep.setString(1, \"String_Node_Str\");\n ResultSet rs = prep.executeQuery();\n rs.next();\n if (\"String_Node_Str\".equals(rs.getString(1))) {\n isH2ModeMySQL = true;\n }\n rs.close();\n prep.close();\n }\n rs.close();\n prep.close();\n }\n String defaultSchemaName = getDefaultSchemaName(meta);\n String[] schemaNames = getSchemaNames(meta);\n schemas = new DbSchema[schemaNames.length];\n for (int i = 0; i < schemaNames.length; i++) {\n String schemaName = schemaNames[i];\n boolean isDefault = defaultSchemaName == null || defaultSchemaName.equals(schemaName);\n DbSchema schema = new DbSchema(this, schemaName, isDefault);\n if (schema.isDefault) {\n defaultSchema = schema;\n }\n schemas[i] = schema;\n String[] tableTypes = { \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" };\n schema.readTables(meta, tableTypes);\n if (!isPostgreSQL) {\n schema.readProcedures(meta);\n }\n }\n if (defaultSchema == null) {\n String best = null;\n for (DbSchema schema : schemas) {\n if (\"String_Node_Str\".equals(schema.name)) {\n defaultSchema = schema;\n break;\n }\n if (defaultSchema == null || best == null || schema.name.length() < best.length()) {\n best = schema.name;\n defaultSchema = schema;\n }\n }\n }\n}\n"
|
"private ArrayList getAllSchemaList(ResultSet schemaRs) {\n if (schemaRs == null) {\n return null;\n }\n ArrayList allSchemas = new ArrayList();\n try {\n while (schemaRs.next()) {\n allSchemas.add(schemaRs.getString(\"String_Node_Str\"));\n }\n } catch (SQLException e) {\n logger.log(Level.FINE, e.getMessage(), e);\n }\n return allSchemas;\n}\n"
|
"public Angle getAngle() {\n return Angle.fromDegrees(fixDegrees(degrees));\n}\n"
|
"private DataSetViewData findDataSetViewData(String columnName, DataSetHandle handle) {\n if (columnName == null || columnName.trim().length() == 0) {\n return null;\n }\n try {\n DataSetViewData[] items = DataSetProvider.getCurrentInstance().getColumns(handle, false, true);\n for (int i = 0; i < items.length; i++) {\n if (columnName.equals(items[i].getName())) {\n return items[i];\n }\n }\n } catch (BirtException e) {\n DataSetExceptionHandler.handle(e);\n }\n return null;\n}\n"
|
"public void testImportsForPlainTypes() {\n Set<TypeMirror> types = ImmutableSet.of(typeUtil.getPrimitiveType(TypeKind.INT), typeMirrorOf(\"String_Node_Str\"), typeMirrorOf(\"String_Node_Str\"), typeMirrorOf(\"String_Node_Str\"), typeMirrorOf(\"String_Node_Str\"), typeMirrorOf(\"String_Node_Str\"));\n List<String> expectedImports = ImmutableList.of(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n TypeSimplifier typeSimplifier = new TypeSimplifier(typeUtil, \"String_Node_Str\", types, baseWithoutContainedTypes());\n assertEquals(expectedImports, ImmutableList.copyOf(typeSimplifier.typesToImport()));\n}\n"
|
"public void complete(CompleteOperation completeOperation) {\n ParameterInt param = context.getParser().getParameters().get(0);\n if (param.getName().startsWith(completeOperation.getBuffer()))\n completeOperation.addCompletionCandidate(param.getName());\n else if (param.getName().equals(completeOperation.getBuffer().trim())) {\n defaultCompletion(completeOperation);\n } else if (completeOperation.getBuffer().startsWith(param.getName())) {\n ParsedCompleteObject completeObject = null;\n try {\n completeObject = new CommandLineCompletionParser(context.getParser()).findCompleteObject(completeOperation.getBuffer());\n } catch (CommandLineParserException e) {\n logger.info(e.getMessage());\n return;\n }\n logger.info(\"String_Node_Str\" + completeObject);\n if (completeObject.doDisplayOptions()) {\n if (completeObject.getName() != null && completeObject.getName().length() > 0) {\n if (param.findPossibleLongNamesWitdDash(completeObject.getName()).size() > 0) {\n if (param.findPossibleLongNamesWitdDash(completeObject.getName()).size() == 1) {\n completeOperation.addCompletionCandidate(param.findPossibleLongNamesWitdDash(completeObject.getName()).get(0));\n completeOperation.setOffset(completeOperation.getCursor() - completeObject.getOffset());\n } else\n completeOperation.addCompletionCandidates(param.findPossibleLongNamesWitdDash(completeObject.getName()));\n }\n } else {\n if (param.getOptionLongNamesWithDash().size() > 1) {\n completeOperation.addCompletionCandidates(param.getOptionLongNamesWithDash());\n } else {\n completeOperation.addCompletionCandidates(param.getOptionLongNamesWithDash());\n completeOperation.setOffset(completeOperation.getCursor() - completeObject.getOffset());\n }\n }\n } else if (completeObject.isOption()) {\n InputComponent inputOption = context.findInput(completeObject.getName());\n if (inputOption != null && inputOption.getValueType() == File.class) {\n completeOperation.setOffset(completeOperation.getCursor());\n if (completeObject.getValue() == null)\n new FileLister(\"String_Node_Str\", new File(System.getProperty(\"String_Node_Str\"))).findMatchingDirectories(completeOperation);\n else\n new FileLister(completeObject.getValue(), new File(System.getProperty(\"String_Node_Str\"))).findMatchingDirectories(completeOperation);\n } else if (inputOption != null && inputOption.getValueType() == Boolean.class) {\n } else if (inputOption != null && inputOption.getValueType() == String.class) {\n if (inputOption instanceof UIInput) {\n if (completeObject.getValue() == null || ((((UIInput) inputOption).getValue() != null) && completeObject.getValue().startsWith(((UIInput) inputOption).getValue().toString()))) {\n completeOperation.addCompletionCandidate(((UIInput) inputOption).getValue().toString());\n }\n }\n }\n if (inputOption != null && inputOption instanceof UIInput) {\n Iterable<String> iter = ((UIInput) inputOption).getCompleter().getCompletionProposals(null, inputOption, completeObject.getValue());\n if (iter != null) {\n for (String s : iter) completeOperation.addCompletionCandidate(s);\n }\n if (completeOperation.getCompletionCandidates().size() == 1) {\n completeOperation.setOffset(completeOperation.getCursor() - completeObject.getOffset());\n }\n }\n } else if (completeObject.isArgument()) {\n InputComponent inputOption = context.findInput(\"String_Node_Str\");\n if (inputOption != null && inputOption.getValueType() == File.class) {\n completeOperation.setOffset(completeOperation.getCursor());\n if (completeObject.getValue() == null)\n new FileLister(\"String_Node_Str\", new File(System.getProperty(\"String_Node_Str\"))).findMatchingDirectories(completeOperation);\n else\n new FileLister(completeObject.getValue(), new File(System.getProperty(\"String_Node_Str\"))).findMatchingDirectories(completeOperation);\n } else if (inputOption != null && inputOption.getValueType() == Boolean.class) {\n } else if (command instanceof Completion) {\n ((Completion) command).complete(completeOperation);\n } else {\n if (inputOption != null && inputOption instanceof UIInputMany) {\n Iterable<String> iter = ((UIInputMany) inputOption).getCompleter().getCompletionProposals(null, inputOption, completeObject.getValue());\n if (iter != null) {\n for (String s : iter) {\n completeOperation.addCompletionCandidate(s);\n }\n }\n if (completeOperation.getCompletionCandidates().size() == 1) {\n completeOperation.setOffset(completeOperation.getCursor() - completeObject.getOffset());\n }\n }\n }\n }\n }\n}\n"
|
"boolean pre(Tree t) {\n Element e = pss.getTrees().getElement(getCurrentPath());\n if (e == null)\n return false;\n long endPos = sourcePositions.getEndPosition(cu, t);\n if (endPos < 0)\n return false;\n if (TreeUtil.OUTLINE_WORTHY_ELEMENT.contains(e.getKind())) {\n jw.startObject();\n writeOutlineNodeProperties(jw, e, cu, t);\n jw.key(\"String_Node_Str\").startArray();\n return true;\n }\n return false;\n}\n"
|
"public final void clearBelow(int iUnit, boolean always) {\n if (!always && isFullDateTime()) {\n return;\n }\n if (iUnit == YEAR) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n set(Calendar.MINUTE, 0);\n set(Calendar.HOUR, 0);\n set(Calendar.DATE, 1);\n set(Calendar.AM_PM, AM);\n set(Calendar.MONTH, 0);\n } else if (iUnit == MONTH || iUnit == QUARTER) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n set(Calendar.MINUTE, 0);\n set(Calendar.HOUR, 0);\n set(Calendar.AM_PM, AM);\n set(Calendar.DATE, 1);\n if (iUnit == QUARTER) {\n set(Calendar.MONTH, (getMonth() / 3) * 3);\n }\n } else if (iUnit == WEEK_OF_YEAR || iUnit == WEEK_OF_MONTH) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n set(Calendar.MINUTE, 0);\n set(Calendar.HOUR, 0);\n set(Calendar.AM_PM, AM);\n int weekDay = get(DAY_OF_WEEK);\n add(DATE, 1 - weekDay);\n } else if (iUnit == DATE) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n set(Calendar.MINUTE, 0);\n set(Calendar.HOUR, 0);\n set(Calendar.AM_PM, AM);\n } else if (iUnit == HOUR || iUnit == HOUR_OF_DAY) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n set(Calendar.MINUTE, 0);\n } else if (iUnit == MINUTE) {\n set(Calendar.MILLISECOND, 0);\n set(Calendar.SECOND, 0);\n } else if (iUnit == SECOND) {\n set(Calendar.MILLISECOND, 0);\n }\n}\n"
|
"public void tickEffects(long ticks) {\n Player me = this.getPlayer();\n if (me == null)\n return;\n if (me.isDead())\n return;\n Conf conf = Conf.get(me);\n if (me.getGameMode() == GameMode.CREATIVE)\n return;\n if (this.fxSmokeTicks > 0) {\n this.fxSmokeTicks -= ticks;\n double dcount = conf.fxSmokePerTick * ticks;\n long lcount = MUtil.probabilityRound(dcount);\n for (long i = lcount; i > 0; i--) FxUtil.smoke(me);\n }\n if (this.fxEnderTicks > 0) {\n this.fxEnderTicks -= ticks;\n double dcount = conf.fxEnderPerTick * ticks;\n long lcount = MUtil.probabilityRound(dcount);\n for (long i = lcount; i > 0; i--) FxUtil.ender(me, conf.fxEnderRandomMaxLen);\n }\n if (survival && this.isVampire()) {\n if (this.getTemp() > conf.sunNauseaTemp)\n FxUtil.ensure(PotionEffectType.CONFUSION, me, conf.sunNauseaTicks);\n if (this.getTemp() > conf.sunWeaknessTemp)\n FxUtil.ensure(PotionEffectType.WEAKNESS, me, conf.sunWeaknessTicks);\n if (this.getTemp() > conf.sunSlowTemp)\n FxUtil.ensure(PotionEffectType.SLOW, me, conf.sunSlowTicks);\n if (this.getTemp() > conf.sunBlindnessTemp)\n FxUtil.ensure(PotionEffectType.BLINDNESS, me, conf.sunBlindnessTicks);\n if (this.getTemp() > conf.sunBurnTemp)\n FxUtil.ensureBurn(me, conf.sunBurnTicks);\n double dsmokes = conf.sunSmokesPerTempAndTick * this.temp * ticks;\n long lsmokes = MUtil.probabilityRound(dsmokes);\n for (long i = lsmokes; i > 0; i--) FxUtil.smoke(me);\n double dflames = conf.sunFlamesPerTempAndTick * this.temp * ticks;\n long lflames = MUtil.probabilityRound(dflames);\n for (long i = lflames; i > 0; i--) FxUtil.flame(me);\n }\n}\n"
|
"protected synchronized void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n mSeekBarDrawable.draw(canvas);\n if (isEnabled())\n mRipple.draw(canvas);\n}\n"
|
"protected boolean checkFieldsValue() {\n if (lowerText.getText() == \"String_Node_Str\" || higherText.getText() == \"String_Node_Str\") {\n updateStatus(IStatus.ERROR, MSG_EMPTY);\n return false;\n }\n if (!CheckValueUtils.isNumberWithNegativeValue(lowerText.getText()) || !CheckValueUtils.isNumberWithNegativeValue(higherText.getText())) {\n updateStatus(IStatus.ERROR, MSG_ONLY_NUMBER);\n return false;\n }\n updateStatus(IStatus.OK, MSG_OK);\n return true;\n}\n"
|
"private void processDeclaration(ArrayList<Token> tokens, ComplexScope scope) throws Exception {\n Token declare = tokens.get(0);\n Token name = tokens.get(1);\n if (declare.getTokenType() == TokenType.GLOBAL_DECLARE) {\n declareVariable(name.getTokenValue().toString(), scope, false);\n } else if (declare.getTokenType() == TokenType.LOCAL_DECLARE) {\n declareVariable(name.toString(), scope, true);\n } else {\n throw new Exception(\"String_Node_Str\" + declare.getTokenType());\n }\n}\n"
|
"public void update() {\n int numHeaters = 0;\n for (EnumFacing dir2 : EnumFacing.VALUES) {\n BlockPos offsetPos = pos.offset(dir2);\n TileEntity tile = world.getTileEntity(offsetPos);\n if (tile instanceof TileEntitySteamHeater && ((TileEntitySteamHeater) tile).getSteamShare() > 2 && world.getBlockState(offsetPos).getValue(BlockSteamHeater.FACING) == dir2.getOpposite()) {\n numHeaters++;\n }\n }\n numHeaters = Math.min(4, numHeaters);\n if (numHeaters == 0) {\n TileEntitySteamHeater.replaceWith(this, new TileEntityFurnace());\n }\n int furnaceBurnTime = super.getField(FURNACE_BURN_TIME_ID);\n boolean flag = furnaceBurnTime > 0;\n boolean flag1 = false;\n if (furnaceBurnTime > 0) {\n super.setField(FURNACE_BURN_TIME_ID, furnaceBurnTime - 1);\n furnaceBurnTime--;\n }\n if (!world.isRemote) {\n if (furnaceBurnTime == 0 && canSmelt()) {\n ItemStack inSlot1 = getStackInSlot(1);\n int currentItemBurnTime = furnaceBurnTime = getItemBurnTime(inSlot1);\n super.setField(CURRENT_ITEM_BURN_TIME_ID, currentItemBurnTime);\n super.setField(FURNACE_BURN_TIME_ID, furnaceBurnTime);\n if (furnaceBurnTime > 0) {\n flag1 = true;\n if (inSlot1 != null) {\n ItemStack copy = inSlot1.copy();\n copy.shrink(1);\n setInventorySlotContents(1, copy);\n if (inSlot1.isEmpty()) {\n setInventorySlotContents(1, inSlot1.getItem().getContainerItem(inSlot1));\n }\n }\n }\n }\n int furnaceCookTime;\n if (isBurning() && canSmelt()) {\n furnaceCookTime = super.getField(COOK_TIME_ID);\n ++furnaceCookTime;\n super.setField(COOK_TIME_ID, furnaceCookTime);\n if (furnaceCookTime == 200) {\n furnaceCookTime = 0;\n smeltItem();\n super.setField(COOK_TIME_ID, furnaceCookTime);\n flag1 = true;\n }\n } else {\n furnaceCookTime = 0;\n super.setField(COOK_TIME_ID, furnaceCookTime);\n }\n if (flag != furnaceBurnTime > 0) {\n flag1 = true;\n BlockFurnace.setState(furnaceBurnTime > 0, world, pos);\n }\n }\n if (flag1) {\n markDirty();\n }\n}\n"
|
"public void testRuleFilteringExcludeTag3() throws Exception {\n setupAndRun(null, Collections.singleton(\"String_Node_Str\"), Collections.singleton(\"String_Node_Str\"), Collections.singleton(\"String_Node_Str\"));\n Assert.assertFalse(this.tag1SourceGlassfishRuleProvider.executed);\n Assert.assertTrue(this.tag1SourceGlassfishTargetFooRuleProvider.executed);\n Assert.assertTrue(this.tag2SourceGlassfishTargetJBossRuleProvider.executed);\n Assert.assertFalse(this.tag3SourceOrionServerRuleProvider.executed);\n}\n"
|
"public String toJavaCodeAsToken(String type, boolean is_token) {\n String code = name;\n TypeSymbol ts = null;\n try {\n ts = SymbolTable.getTypeSymbol(type);\n } catch (SalsaNotFoundException snfe) {\n CompilerErrors.printErrorMessage(\"String_Node_Str\" + type + \"String_Node_Str\", this);\n throw new RuntimeException(snfe);\n }\n if (expression != null) {\n if (ts.canMatch(expression.getType()) < 0) {\n CompilerErrors.printErrorMessage(\"String_Node_Str\" + expression.getType().getLongSignature() + \"String_Node_Str\" + ts.getLongSignature() + \"String_Node_Str\", expression);\n }\n if (is_token && expression.isToken()) {\n CompilerErrors.printErrorMessage(\"String_Node_Str\", expression);\n }\n if (expression.isToken()) {\n code += \"String_Node_Str\" + expression.toJavaCode();\n } else {\n code += \"String_Node_Str\" + expression.toJavaCode() + \"String_Node_Str\";\n }\n }\n return code;\n}\n"
|
"public void setBitmap(Bitmap bitmap) {\n if (isHardwareAccelerated()) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n if (bitmap == null) {\n safeCanvasSwap(initRaster(0), false);\n mDensity = Bitmap.DENSITY_NONE;\n } else {\n if (!bitmap.isMutable()) {\n throw new IllegalStateException();\n }\n throwIfRecycled(bitmap);\n safeCanvasSwap(initRaster(bitmap.ni()));\n mDensity = bitmap.mDensity;\n }\n mBitmap = bitmap;\n}\n"
|
"private void updateKnownOSDs() {\n RPCResponse<ServiceSet> r = null;\n try {\n r = dirClient.xtreemfs_service_get_by_type(null, ServiceType.SERVICE_TYPE_OSD);\n knownOSDs = r.get();\n String ownUUID = master.getConfig().getUUID().toString();\n ServiceSet newOSDs = new ServiceSet();\n for (Service osd : knownOSDs) {\n if (!ownUUID.equals(osd.getUuid()) && osd.getLast_updated_s() != 0) {\n newOSDs.add(osd);\n }\n }\n knownOSDs = newOSDs;\n if (Logging.isDebug()) {\n Logging.logMessage(Logging.LEVEL_DEBUG, this, \"String_Node_Str\" + knownOSDs.size() + \"String_Node_Str\");\n }\n } catch (Exception exc) {\n Logging.logMessage(Logging.LEVEL_ERROR, this, \"String_Node_Str\" + exc);\n knownOSDs = new ServiceSet();\n } finally {\n if (r != null) {\n r.freeBuffers();\n }\n sentRequests.clear();\n sentRetries.clear();\n }\n}\n"
|
"public void writeStatement(MethodWriter writer) {\n for (int i = 0; i < this.instructionCount; i++) {\n if (i < this.labels.length) {\n Label l = this.labels[i];\n if (l != null) {\n writer.writeLabel(l.target);\n }\n }\n this.instructions[i].write(writer);\n }\n}\n"
|
"public void actionPerformed(ActionEvent e) {\n String cycledCommand = \"String_Node_Str\";\n if (key.equals(\"String_Node_Str\")) {\n cycledCommand = commandManager.getPreviousCommand(prevCommand);\n } else if (key.equals(\"String_Node_Str\")) {\n cycledCommand = commandManager.getNextCommand(getLastLine());\n }\n JTextArea component = (JTextArea) e.getSource();\n component.select(component.getText().lastIndexOf(prompt) + prompt.length(), component.getText().length());\n component.replaceSelection(cycledCommand);\n}\n"
|
"public void apply() throws Exception {\n SearchResults searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, SortInfo.DEFAULT, 0, 3, 1, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry, dsEntry, dsEntry, appEntry, appEntry, appEntry, appEntry), searchResults.getResults());\n SortInfo nameAsc = new SortInfo(AbstractSystemMetadataWriter.ENTITY_NAME_KEY, SortInfo.SortOrder.ASC);\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 0, 2, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry), searchResults.getResults());\n Assert.assertEquals(2, searchResults.getAllResults().size());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 1, 2, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(dsEntry, appEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry, appEntry), searchResults.getAllResults());\n SortInfo nameDesc = new SortInfo(AbstractSystemMetadataWriter.ENTITY_NAME_KEY, SortInfo.SortOrder.DESC);\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameDesc, 0, 2, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(appEntry, dsEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(appEntry, dsEntry, flowEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameDesc, 2, 1, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(flowEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(appEntry, dsEntry, flowEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 2, 0, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertTrue(searchResults.getResults().isEmpty());\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry, appEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameDesc, 1, 0, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertTrue(searchResults.getResults().isEmpty());\n Assert.assertEquals(ImmutableList.of(appEntry, dsEntry, flowEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 4, 0, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertTrue(searchResults.getResults().isEmpty());\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry, appEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameDesc, 100, 0, 0, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertTrue(searchResults.getResults().isEmpty());\n Assert.assertEquals(ImmutableList.of(appEntry, dsEntry, flowEntry), searchResults.getAllResults());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 0, 1, 3, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(flowEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(dsName, appName), searchResults.getCursors());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 0, 1, 3, searchResults.getCursors().get(0), false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(dsEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(appName), searchResults.getCursors());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 0, 1, 3, searchResults.getCursors().get(0), false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(appEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(), searchResults.getCursors());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 0, 2, 3, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(flowEntry, dsEntry), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(appName), searchResults.getCursors());\n searchResults = dataset.search(namespaceId, \"String_Node_Str\", targets, nameAsc, 3, 1, 2, null, false, EnumSet.allOf(EntityScope.class));\n Assert.assertEquals(ImmutableList.of(), searchResults.getResults());\n Assert.assertEquals(ImmutableList.of(), searchResults.getCursors());\n}\n"
|
"private boolean mayBeNullFieldAccess(VisitorState state, ExpressionTree expr, Symbol exprSymbol) {\n if (exprSymbol != null && (fromUnannotatedPackage(exprSymbol) || !Nullness.hasNullableAnnotation(exprSymbol))) {\n return false;\n }\n return nullnessFromDataflow(state, expr);\n}\n"
|
"void setup() {\n resetTmpDir();\n}\n"
|
"public Boolean apply(Pair<List<E>, List<E>> xxx) {\n List<E> A = xxx.first;\n List<E> B = xxx.second;\n if (A.size() != B.size()) {\n throw new RuntimeException();\n }\n if (s.isVar) {\n return false;\n }\n E a = A.get(0);\n E b = B.get(0);\n if (gt.apply(new Pair<>(b, a))) {\n return true;\n } else if (gt.apply(new Pair<>(a, b))) {\n return false;\n } else if (a.equals(b)) {\n return apply(new Pair<>(A.subList(1, A.size()), B.subList(1, B.size())));\n }\n return false;\n}\n"
|
"public float calculateCorrectDiskRotation(PoincareNode currentNode) {\n if (currentNode != null) {\n if (currentNode.iComparableValue != 1) {\n float[] currentPosition = new float[2];\n currentPosition = currentNode.getPosition().clone();\n float[] parentPosition;\n parentPosition = currentNode.getParent().getPosition().clone();\n float[] relativePosition = new float[2];\n relativePosition[0] = -currentPosition[0];\n relativePosition[1] = -currentPosition[1];\n currentPosition[0] = 0;\n currentPosition[1] = 0;\n ComplexNumber moebiusTransformation = new ComplexNumber();\n ComplexNumber complexParentPosition = new ComplexNumber();\n moebiusTransformation.setValue((double) relativePosition[0], (double) relativePosition[1]);\n complexParentPosition.setValue((double) parentPosition[0], (double) parentPosition[1]);\n complexParentPosition = this.moebiusTransformation(complexParentPosition, moebiusTransformation);\n relativePosition[0] = (float) complexParentPosition.getRealPart();\n relativePosition[1] = (float) complexParentPosition.getImaginaryPart();\n float[] eV = getEV(relativePosition);\n float angle = (float) Math.atan2(eV[1], eV[0]);\n if (Math.abs(-angle + Math.PI) < Math.PI) {\n return -angle + (float) Math.PI;\n } else {\n return -angle - (float) Math.PI;\n }\n } else {\n float[] currentPosition = new float[2];\n currentPosition = currentNode.getPosition().clone();\n float[] childPosition;\n if (currentNode.getNrLeaves() != 0) {\n childPosition = currentNode.getChildren().get(0).getPosition();\n float[] relativePosition = new float[2];\n relativePosition[0] = -currentPosition[0];\n relativePosition[1] = -currentPosition[1];\n currentPosition[0] = 0;\n currentPosition[1] = 0;\n ComplexNumber moebiusTransformation = new ComplexNumber();\n ComplexNumber complexParentPosition = new ComplexNumber();\n moebiusTransformation.setValue((double) relativePosition[0], (double) relativePosition[1]);\n complexParentPosition.setValue((double) childPosition[0], (double) childPosition[1]);\n complexParentPosition = this.moebiusTransformation(complexParentPosition, moebiusTransformation);\n relativePosition[0] = (float) complexParentPosition.getRealPart();\n relativePosition[1] = (float) complexParentPosition.getImaginaryPart();\n float[] eV = getEV(relativePosition);\n float angle = (float) Math.atan2(eV[1], eV[0]);\n float angleOffset = ((float) Math.PI / (float) currentNode.getChildren().size()) / 2;\n angle = angle + angleOffset + (float) Math.PI / 2;\n if (Math.abs(-angle + Math.PI) < Math.PI) {\n return -angle + (float) Math.PI;\n } else {\n return -angle - (float) Math.PI;\n }\n }\n }\n } else {\n }\n return 0;\n}\n"
|
"public T get(int index) {\n return data.get(size() - index - 1);\n}\n"
|
"public IStatus doAction() {\n try {\n int index = 0;\n IStructuredSelection selection = (IStructuredSelection) page.getTreeViewer().getSelection();\n if (selection.getFirstElement() instanceof XSDIdentityConstraintDefinition) {\n icd = (XSDIdentityConstraintDefinition) selection.getFirstElement();\n } else if (selection.getFirstElement() instanceof XSDXPathDefinition) {\n XSDXPathDefinition xpath = (XSDXPathDefinition) selection.getFirstElement();\n icd = (XSDIdentityConstraintDefinition) xpath.getContainer();\n if (xpath.getVariety().equals(XSDXPathVariety.FIELD_LITERAL))\n index = icd.getFields().indexOf(xpath) + 1;\n else\n index = 0;\n } else {\n MessageDialog.openError(this.page.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + selection.getFirstElement().getClass().getName());\n return Status.CANCEL_STATUS;\n }\n List<String> childNames = Util.getChildElementNames(\"String_Node_Str\", (XSDElementDeclaration) icd.getContainer());\n SelectFieldDialog id = new SelectFieldDialog(page.getSite().getShell(), \"String_Node_Str\", childNames, null);\n id.create();\n id.setBlockOnOpen(true);\n int ret = id.open();\n if (ret == Dialog.CANCEL) {\n return Status.CANCEL_STATUS;\n }\n String field = id.getField();\n if (field.length() == 0)\n return Status.CANCEL_STATUS;\n ;\n XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();\n XSDXPathDefinition xpath = factory.createXSDXPathDefinition();\n xpath.setValue(field);\n xpath.setVariety(XSDXPathVariety.FIELD_LITERAL);\n icd.getFields().add(index, xpath);\n icd.updateElement();\n page.refresh();\n page.getTreeViewer().setSelection(new StructuredSelection(xpath), true);\n page.markDirty();\n } catch (Exception e) {\n e.printStackTrace();\n MessageDialog.openError(page.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + e.getLocalizedMessage());\n return Status.CANCEL_STATUS;\n }\n return Status.OK_STATUS;\n}\n"
|
"public void attributeChanged(Attribute attribute) throws IllegalActionException {\n if (attribute == mappingFileName) {\n StringToken mappingFileNameToken = (StringToken) mappingFileName.getToken();\n if (mappingFileNameToken == null || mappingFileNameToken.stringValue().equals(\"String_Node_Str\")) {\n mappingFileName = null;\n } else {\n File file = mappingFileName.asFile();\n if (file != null) {\n String filename = file.getAbsolutePath();\n if (!filename.equals(\"String_Node_Str\")) {\n try {\n System.out.println(filename);\n _mappingConstraintSolver.readMapping(filename);\n } catch (IOException ex) {\n throw new IllegalActionException(this, ex, \"String_Node_Str\" + filename + \"String_Node_Str\");\n }\n if (_debugging) {\n _debug(_mappingConstraintSolver.toString());\n }\n }\n }\n }\n } else if (attribute == printDebug) {\n if (((BooleanToken) printDebug.getToken()).booleanValue()) {\n _mappingConstraintSolver.turnOnDebugging();\n _timeScheduler.turnOnDebugging();\n _debugger.turnOnDebugging();\n } else {\n _mappingConstraintSolver.turnOffDebugging();\n _timeScheduler.turnOffDebugging();\n _debugger.turnOffDebugging();\n }\n } else {\n super.attributeChanged(attribute);\n }\n}\n"
|
"public void gatherMetric() {\n if (rootNode != null) {\n TreeNode activeSessionsNode = rootNode.getNode(WEB_REQUEST_PROCESSINGTIME);\n if (activeSessionsNode != null) {\n Object value = activeSessionsNode.getValue();\n if (value != null) {\n if (value instanceof CountStatistic) {\n CountStatistic statisticObject = (CountStatistic) value;\n table.add(System.currentTimeMillis(), new ProcessingTimeStat(statisticObject.getLastSampleTime(), statisticObject.getDescription(), statisticObject.getUnit(), statisticObject.getName(), statisticObject.getStartTime(), statisticObject.getCount()));\n }\n }\n }\n }\n}\n"
|
"public ManagementVertex getEnd() {\n return pathVertices.getLast();\n}\n"
|
"private void readUserListLocked() {\n if (!mUserListFile.exists()) {\n fallbackToSingleUserLocked();\n return;\n }\n FileInputStream fis = null;\n AtomicFile userListFile = new AtomicFile(mUserListFile);\n try {\n fis = userListFile.openRead();\n XmlPullParser parser = Xml.newPullParser();\n parser.setInput(fis, null);\n int type;\n while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) {\n ;\n }\n if (type != XmlPullParser.START_TAG) {\n Slog.e(LOG_TAG, \"String_Node_Str\");\n fallbackToSingleUserLocked();\n return;\n }\n mNextSerialNumber = -1;\n if (parser.getName().equals(TAG_USERS)) {\n String lastSerialNumber = parser.getAttributeValue(null, ATTR_NEXT_SERIAL_NO);\n if (lastSerialNumber != null) {\n mNextSerialNumber = Integer.parseInt(lastSerialNumber);\n }\n String versionNumber = parser.getAttributeValue(null, ATTR_USER_VERSION);\n if (versionNumber != null) {\n mUserVersion = Integer.parseInt(versionNumber);\n }\n }\n while ((type = parser.next()) != XmlPullParser.END_DOCUMENT) {\n if (type == XmlPullParser.START_TAG) {\n final String name = parser.getName();\n if (name.equals(TAG_USER)) {\n String id = parser.getAttributeValue(null, ATTR_ID);\n UserInfo user = readUserLocked(Integer.parseInt(id));\n if (user != null) {\n mUsers.put(user.id, user);\n if (mNextSerialNumber < 0 || mNextSerialNumber <= user.id) {\n mNextSerialNumber = user.id + 1;\n }\n }\n } else if (name.equals(TAG_GUEST_RESTRICTIONS)) {\n while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.END_TAG) {\n if (type == XmlPullParser.START_TAG) {\n if (parser.getName().equals(TAG_RESTRICTIONS)) {\n readRestrictionsLocked(parser, mGuestRestrictions);\n }\n break;\n }\n }\n }\n }\n }\n updateUserIdsLocked();\n upgradeIfNecessaryLocked();\n } catch (IOException ioe) {\n fallbackToSingleUserLocked();\n } catch (XmlPullParserException pe) {\n fallbackToSingleUserLocked();\n } finally {\n if (fis != null) {\n try {\n fis.close();\n } catch (IOException e) {\n }\n }\n }\n}\n"
|
"public INDArray permute(int... rearrange) {\n if (rearrange.length != rank())\n return dup();\n boolean alreadyInOrder = true;\n for (int i = 0; i < Shape.rank(shapeInfo()); i++) {\n if (rearrange[i] != i) {\n alreadyInOrder = false;\n break;\n }\n }\n if (alreadyInOrder)\n return this;\n checkArrangeArray(rearrange);\n int[] newShape = doPermuteSwap(Shape.shapeOf(shapeInformation), rearrange);\n int[] newStride = doPermuteSwap(Shape.stride(shapeInformation), rearrange);\n char newOrder = Shape.getOrder(newShape, newStride, elementStride());\n INDArray value = create(data(), newShape, newStride, offset(), newOrder);\n return value;\n}\n"
|
"public void handleDrop(Transferable transferable, DataFlavor dataFlavor, Point dropLocation) {\n URL url = null;\n try {\n url = (URL) transferable.getTransferData(dataFlavor);\n } catch (java.io.IOException excp) {\n logger.log(Level.WARNING, \"String_Node_Str\", excp);\n } catch (UnsupportedFlavorException excp) {\n logger.log(Level.WARNING, \"String_Node_Str\", excp);\n }\n URLDataFlavorHandler.launchCellFromURL(url);\n}\n"
|
"public List<BatchPart> parse(final InputStream in) throws BatchException {\n Scanner scanner = new Scanner(in, \"String_Node_Str\").useDelimiter(LF);\n baseUri = getBaseUri();\n List<BatchPart> requestList;\n try {\n requestList = parseBatchRequest(scanner);\n } finally {\n scanner.close();\n try {\n in.close();\n } catch (IOException e) {\n throw new ODataRuntimeException(e);\n }\n }\n return requestList;\n}\n"
|
"public Configuration configuration() {\n if (configuration == null) {\n configuration = ThucydidesJBehave.defaultConfiguration(getSystemConfiguration());\n }\n return configuration;\n}\n"
|
"public static void main(String[] args) {\n OptionFactory optFactory = OptionFactory.getInstance();\n Options options = KafkaConsumer.getOptions();\n options.addOption(optFactory.create(\"String_Node_Str\", \"String_Node_Str\", true, \"String_Node_Str\"));\n options.addOption(optFactory.create(\"String_Node_Str\", \"String_Node_Str\", true, \"String_Node_Str\"));\n options.addOption(optFactory.create(\"String_Node_Str\", \"String_Node_Str\", true, \"String_Node_Str\"));\n options.addOption(optFactory.create(\"String_Node_Str\", \"String_Node_Str\", false, \"String_Node_Str\"));\n CommandLineParser parser = new GnuParser();\n ShutdownHook sh = ShutdownHook.getInstance();\n try {\n CommandLine cmd = parser.parse(options, args);\n final KafkaConsumer consumer = KafkaConsumer.fromOptions(cmd);\n sh.addFirst(consumer);\n SinkConfiguration sinkConfig = new SinkConfiguration();\n sinkConfig.setString(\"String_Node_Str\", cmd.getOptionValue(\"String_Node_Str\", \"String_Node_Str\"));\n sinkConfig.setString(\"String_Node_Str\", cmd.getOptionValue(\"String_Node_Str\", \"String_Node_Str\"));\n sinkConfig.setLong(\"String_Node_Str\", Long.parseLong(cmd.getOptionValue(\"String_Node_Str\", \"String_Node_Str\")));\n sinkConfig.setBoolean(\"String_Node_Str\", cmd.hasOption(\"String_Node_Str\"));\n KeyValueSinkFactory sinkFactory = KeyValueSinkFactory.getInstance(SequenceFileSink.class, sinkConfig);\n sh.addLast(sinkFactory);\n consumer.setSinkFactory(sinkFactory);\n MetricsManager.getInstance();\n consumer.poll();\n } catch (ParseException e) {\n LOG.error(\"String_Node_Str\", e);\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp(KafkaSequenceFileConsumer.class.getName(), options);\n } catch (NumberFormatException e) {\n LOG.error(\"String_Node_Str\", e);\n }\n}\n"
|
"protected APISession initialValue() {\n APISession api = APISession.create(integrityConfig);\n if (null != api) {\n sessions.add(api);\n return api;\n } else {\n return null;\n }\n}\n"
|
"private void populateLists() {\n NameSet nameSet = LiteralHelper.legendBehaviorTypeSet;\n List<String> names = new ArrayList<String>(Arrays.asList(nameSet.getDisplayNames()));\n names.add(0, ChartUIExtensionUtil.getAutoMessage());\n if (getContext().getOutputFormat().equalsIgnoreCase(\"String_Node_Str\")) {\n cmbLegendBehavior.setItems(names.toArray(new String[] {}));\n if (!getChart().getInteractivity().isSetLegendBehavior()) {\n cmbLegendBehavior.select(0);\n } else {\n cmbLegendBehavior.select(nameSet.getSafeNameIndex(getChart().getInteractivity().getLegendBehavior().getName()) + 1);\n }\n } else {\n cmbLegendBehavior.select(nameSet.getSafeNameIndex(getChart().getInteractivity().getLegendBehavior().getName()) + 1);\n }\n}\n"
|
"public int getTypeIndex(final boolean includeAmendments) {\n if (getParentAmendableWidget() != null) {\n final Iterator<AmendableWidget> iterator = getParentAmendableWidget().getChildAmendableWidgets().iterator();\n int count = 0;\n while (iterator.hasNext()) {\n final AmendableWidget aw = iterator.next();\n if (aw != null) {\n if (aw == this) {\n break;\n }\n if (aw.getType().equalsIgnoreCase(getType())) {\n if (includeAmendments) {\n count++;\n } else {\n if (!aw.isIntroducedByAnAmendment()) {\n count++;\n }\n }\n }\n }\n }\n return count;\n }\n return 0;\n}\n"
|
"public static PieceType getRookPieceType() {\n Map<Direction, Integer> movements = Maps.newHashMap();\n for (Direction direction : Direction.ADJACENT_DIRECTIONS) {\n movements.put(direction, UNLIMITED);\n }\n return new PieceType(\"String_Node_Str\", movements, null);\n}\n"
|
"protected Node objectToXMLNode(Object object, Node rootNode, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {\n AbstractSession session = xmlContext.getSession(descriptor);\n DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session);\n if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {\n XMLRecord xmlRow = null;\n if (!isXMLRoot) {\n xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session));\n xmlRow.setMarshaller(this);\n if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {\n addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);\n }\n }\n Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot);\n if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {\n return xmlRow.getDOM();\n } else {\n return doc;\n }\n }\n MarshalRecord marshalRecord = new NodeRecord();\n marshalRecord.setMarshaller(this);\n marshalRecord.getNamespaceResolver().setDOM(rootNode);\n marshal(object, marshalRecord, descriptor, isXMLRoot);\n return marshalRecord.getDocument();\n}\n"
|
"public void testFiletoMultipleTPFS() throws Exception {\n String filePath = \"String_Node_Str\";\n String testData = \"String_Node_Str\";\n Path textFile = new Path(filePath);\n Configuration conf = new Configuration();\n FileSystem fs = FileSystem.get(conf);\n FSDataOutputStream writeData = fs.create(textFile);\n writeData.write(testData.getBytes());\n writeData.flush();\n writeData.close();\n ETLStage source = new ETLStage(\"String_Node_Str\", ImmutableMap.<String, String>builder().put(Properties.File.FILESYSTEM, \"String_Node_Str\").put(Properties.File.PATH, filePath).build());\n ETLStage sink1 = new ETLStage(\"String_Node_Str\", ImmutableMap.of(Properties.TimePartitionedFileSetDataset.SCHEMA, FileBatchSource.DEFAULT_SCHEMA.toString(), Properties.TimePartitionedFileSetDataset.TPFS_NAME, \"String_Node_Str\"));\n ETLStage sink2 = new ETLStage(\"String_Node_Str\", ImmutableMap.of(Properties.TimePartitionedFileSetDataset.SCHEMA, FileBatchSource.DEFAULT_SCHEMA.toString(), Properties.TimePartitionedFileSetDataset.TPFS_NAME, \"String_Node_Str\"));\n ETLBatchConfig etlConfig = new ETLBatchConfig(\"String_Node_Str\", source, Lists.newArrayList(sink1, sink2), Lists.<ETLStage>newArrayList(), new Resources(), Lists.<ETLStage>newArrayList());\n AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(ETLBATCH_ARTIFACT, etlConfig);\n Id.Application appId = Id.Application.from(Id.Namespace.DEFAULT, \"String_Node_Str\");\n ApplicationManager appManager = deployApplication(appId, appRequest);\n MapReduceManager mrManager = appManager.getMapReduceManager(ETLMapReduce.NAME);\n mrManager.start();\n mrManager.waitForFinish(2, TimeUnit.MINUTES);\n for (String sinkName : new String[] { \"String_Node_Str\", \"String_Node_Str\" }) {\n DataSetManager<TimePartitionedFileSet> fileSetManager = getDataset(sinkName);\n try (TimePartitionedFileSet fileSet = fileSetManager.get()) {\n List<GenericRecord> records = readOutput(fileSet, FileBatchSource.DEFAULT_SCHEMA);\n Assert.assertEquals(1, records.size());\n Assert.assertEquals(testData, records.get(0).get(\"String_Node_Str\").toString());\n }\n }\n}\n"
|
"public void allReceived() {\n _interactionAlarm.cancel();\n synchronized (this) {\n process();\n }\n}\n"
|
"private static void fetchHumanTaskFormData(final KieProcessFormQueryResult form, final JSONObject data, Map<String, Object> result) throws Throwable {\n if (null == form || null == data) {\n return;\n }\n if (null != form.getNestedForms() && !form.getNestedForms().isEmpty()) {\n for (KieProcessFormQueryResult subForm : form.getNestedForms()) {\n getHumanTaskFormData(subForm, data, result);\n }\n }\n if (null == form.getFields() || form.getFields().isEmpty()) {\n return;\n }\n KieDataHolder dataModeler = BpmToFormHelper.getFormDataModelerEntry(form);\n if (dataModeler != null) {\n Object obj = JsonHelper.findKey(data, dataModeler.getValue());\n if (null == obj || !(obj instanceof JSONObject)) {\n throw new RuntimeException(\"String_Node_Str\" + dataModeler.getValue());\n }\n }\n for (String name : JSONObject.getNames(section)) {\n final String key = generateFieldNameForOutput(name, sectionName);\n final Object value = section.get(name);\n if (value instanceof JSONObject) {\n continue;\n }\n if (JSONObject.NULL == value) {\n result.put(key, null);\n } else {\n result.put(key, value);\n }\n }\n JsonHelper.replaceKey(data, dataModeler.getValue(), \"String_Node_Str\");\n}\n"
|
"public List<String> syncSetParam(String clusterName, Integer activeComputeNodeNum, Integer minComputeNodeNum, Boolean enableAuto, Priority ioPriority) throws Exception {\n ClusterEntity cluster = clusterEntityMgr.findByName(clusterName);\n ClusterRead clusterRead = getClusterByName(clusterName, false);\n if (cluster == null) {\n logger.error(\"String_Node_Str\" + clusterName + \"String_Node_Str\");\n throw BddException.NOT_FOUND(\"String_Node_Str\", clusterName);\n }\n if (ioPriority != null) {\n prioritizeCluster(clusterName, ioPriority);\n }\n cluster = clusterEntityMgr.findByName(clusterName);\n if (enableAuto != null && enableAuto != cluster.getAutomationEnable()) {\n cluster.setAutomationEnable(enableAuto);\n }\n if (minComputeNodeNum != null && minComputeNodeNum != cluster.getVhmMinNum()) {\n cluster.setVhmMinNum(minComputeNodeNum);\n }\n List<String> nodeGroupNames = new ArrayList<String>();\n if ((enableAuto != null || minComputeNodeNum != null || activeComputeNodeNum != null) && !clusterRead.validateSetManualElasticity(nodeGroupNames)) {\n throw BddException.INVALID_PARAMETER(\"String_Node_Str\", clusterName);\n }\n if (activeComputeNodeNum != null) {\n if (!activeComputeNodeNum.equals(cluster.getVhmTargetNum())) {\n cluster.setVhmTargetNum(activeComputeNodeNum);\n }\n }\n if ((enableAuto != null) && !ClusterStatus.RUNNING.equals(cluster.getStatus())) {\n logger.error(\"String_Node_Str\" + clusterName + \"String_Node_Str\" + cluster.getStatus() + \"String_Node_Str\");\n throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName, \"String_Node_Str\");\n }\n if (!ClusterStatus.RUNNING.equals(cluster.getStatus()) && !ClusterStatus.STOPPED.equals(cluster.getStatus())) {\n logger.error(\"String_Node_Str\" + clusterName + \"String_Node_Str\" + cluster.getStatus() + \"String_Node_Str\");\n throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName, \"String_Node_Str\");\n }\n clusterEntityMgr.update(cluster);\n if (enableAuto != null || minComputeNodeNum != null) {\n boolean success = clusteringService.setAutoElasticity(clusterName);\n if (!success) {\n throw ClusterManagerException.SET_AUTO_ELASTICITY_NOT_ALLOWED_ERROR(clusterName, \"String_Node_Str\");\n }\n }\n if (enableAuto != null && !enableAuto && cluster.getVhmTargetNum() == null) {\n JobUtils.waitForManual(clusterName, executionService);\n }\n return nodeGroupNames;\n}\n"
|
"public int hashCode() {\n return Objects.hash(super.hashCode(), batchIntervalMillis, extraJavaOpts);\n}\n"
|
"private void repropCallArg(PointerKeyAndState src, PointerKeyAndState dst, IFlowLabel dstToSrcLabel) {\n for (PointerKeyAndState srcToHandle : matchingPToQueried(dst, src.getPointerKey(), dstToSrcLabel)) {\n handleCopy(srcToHandle, dst, dstToSrcLabel.bar());\n }\n IntSet trackedSet = find(pkToTrackedSet, dst);\n if (!trackedSet.isEmpty()) {\n if (findOrCreate(pkToTrackedSet, src).addAll(trackedSet)) {\n addToTrackedPToWorklist(src);\n }\n }\n}\n"
|
"public Receiver createFilteredReceiver(Transformer trans, HttpServletRequest req, HttpServletResponse res) throws XPathException, IOException {\n StreamResult stream = new StreamResult(res.getOutputStream());\n Receiver target = ResultWrapper.getReceiver(stream, ((Controller) trans).makePipelineConfiguration(), trans.getOutputProperties());\n if (getConfig().trackSessions)\n return new SessionURLRewriter(target, req, res);\n else\n return target;\n}\n"
|
"public static int rules(Player player, String[] args) {\n if (!vMinecraftSettings.getInstance().cmdRules() && vMinecraftSettings.getInstance().getRules().length > 0 && !vMinecraftSettings.getInstance().getRules()[0].isEmpty()) {\n return EXIT_FAIL;\n }\n String[] rules = vMinecraftChat.applyColors(vMinecraftSettings.getInstance().getRules());\n for (String str : rules) {\n if (!str.isEmpty())\n player.sendMessage(Colors.Blue + str);\n else\n player.sendMessage(Colors.Blue + \"String_Node_Str\");\n }\n return EXIT_SUCCESS;\n}\n"
|
"private Object transformValue(int sqlColumnType, Object original) throws SQLException {\n if (original != null) {\n switch(sqlColumnType) {\n case Types.NUMERIC:\n case Types.DECIMAL:\n return ((BigDecimal) original).doubleValue();\n case Types.DATE:\n return ((Date) original).getTime();\n case Types.TIME:\n return ((Time) original).getTime();\n case Types.TIMESTAMP:\n return ((Timestamp) original).getTime();\n case Types.BLOB:\n Object toReturn;\n Blob blob = (Blob) original;\n try {\n toReturn = blob.getBytes(1, (int) blob.length());\n } finally {\n blob.free();\n }\n return toReturn;\n case Types.CLOB:\n String s;\n StringBuilder sbf = new StringBuilder();\n Clob clob = (Clob) original;\n try {\n BufferedReader br = new BufferedReader(clob.getCharacterStream(1, (int) clob.length()));\n try {\n while ((s = br.readLine()) != null) {\n sbf.append(s);\n sbf.append(System.getProperty(\"String_Node_Str\"));\n }\n } finally {\n br.close();\n }\n } catch (IOException e) {\n throw new SQLException(e);\n } finally {\n clob.free();\n }\n return sbf.toString();\n }\n }\n return original;\n}\n"
|
"protected View onCreateView(ViewGroup parent) {\n View layout = super.onCreateView(parent);\n mCheckBox = (CheckBox) layout.findViewById(R.id.addon_checkbox);\n mCheckBox.setOnCheckedChangeListener(this);\n mName = (TextView) layout.findViewById(R.id.addon_title);\n mDescription = (TextView) layout.findViewById(R.id.addon_description);\n mAddOnIcon = (ImageView) layout.findViewById(R.id.addon_image);\n mIconOverlay = layout.findViewById(R.id.addon_image_more_overlay);\n populateViews();\n return layout;\n}\n"
|
"public Token next() throws IOException {\n int i = _pos % _size;\n Token result = _lookAhead[i];\n _currentPos = _lookAheadPos[i];\n _currentToken = _lookAhead[i];\n _lookAhead[_pos % _size] = _lexer.next();\n _pos += 1;\n if (_pos >= _size)\n _pos = 0;\n return result;\n}\n"
|
"public Figure render(Object n) {\n Locatable location = (Locatable) n;\n final NamedObj object = location.getContainer();\n Figure result = null;\n try {\n List iconList = object.attributeList(EditorIcon.class);\n if (iconList.size() == 0) {\n XMLIcon alreadyCreated = (XMLIcon) _iconsPendingContainer.get(object);\n if (alreadyCreated != null) {\n iconList.add(alreadyCreated);\n }\n }\n if (iconList.size() == 0) {\n final EditorIcon icon = XMLIcon.getXMLIcon(object.workspace(), \"String_Node_Str\");\n icon.setContainerToBe(object);\n icon.setPersistent(false);\n result = icon.createFigure();\n _iconsPendingContainer.put(object, icon);\n GraphController controller = IconController.this.getController();\n GraphModel graphModel = controller.getGraphModel();\n ChangeRequest request = new ChangeRequest(graphModel, \"String_Node_Str\") {\n protected void _execute() throws KernelException {\n _iconsPendingContainer.remove(object);\n if (icon.getContainer() != null) {\n return;\n }\n if (object.getAttribute(\"String_Node_Str\") != null) {\n return;\n }\n icon.setContainer(object);\n }\n };\n request.setPersistent(false);\n object.requestChange(request);\n } else if (iconList.size() >= 1) {\n EditorIcon icon = (EditorIcon) iconList.get(iconList.size() - 1);\n result = icon.createFigure();\n }\n } catch (KernelException ex) {\n throw new InternalErrorException(null, ex, \"String_Node_Str\" + \"String_Node_Str\" + object + \"String_Node_Str\" + \"String_Node_Str\");\n }\n if (result == null) {\n throw new InternalErrorException(\"String_Node_Str\");\n } else {\n result.setToolTipText(object.getClassName());\n }\n try {\n StringAttribute colorAttr = (StringAttribute) object.getAttribute(\"String_Node_Str\", StringAttribute.class);\n if (colorAttr != null) {\n String color = colorAttr.getExpression();\n AnimationRenderer animationRenderer = new AnimationRenderer(SVGUtilities.getColor(color));\n animationRenderer.renderSelected(result);\n }\n } catch (IllegalActionException e) {\n }\n AttributeController.renderHighlight(object, result);\n try {\n Attribute highlightColor = object.getAttribute(\"String_Node_Str\");\n if (highlightColor != null) {\n object.removeAttribute(highlightColor);\n object.validateSettables();\n }\n List<Decorator> decorators = new ArrayList();\n decorators.addAll(object.decorators());\n for (Decorator decorator : decorators) {\n DecoratorAttributes decoratorAttributes = object.getDecoratorAttributes(decorator);\n if (decoratorAttributes instanceof ResourceAttributes) {\n if (decoratorAttributes.getDecorator() != null && ((ResourceAttributes) decoratorAttributes).enabled()) {\n try {\n if (object.getAttribute(\"String_Node_Str\") == null) {\n highlightColor = new ColorAttribute(object, \"String_Node_Str\");\n Attribute attribute = ((NamedObj) decorator).getAttribute(\"String_Node_Str\");\n String colorExpression = \"String_Node_Str\";\n if (attribute != null) {\n colorExpression = (((ColorAttribute) attribute).getToken()).toString();\n }\n ((ColorAttribute) highlightColor).setExpression(colorExpression);\n }\n } catch (NameDuplicationException e) {\n }\n }\n }\n }\n } catch (IllegalActionException e1) {\n e1.printStackTrace();\n }\n AttributeController.renderDecoratorHighlight(object, result);\n try {\n ColorAttribute shadowAttribute = (ColorAttribute) object.getAttribute(\"String_Node_Str\", ColorAttribute.class);\n if (shadowAttribute != null) {\n if (!shadowAttribute.getExpression().trim().equals(\"String_Node_Str\")) {\n Color color = shadowAttribute.asColor();\n ShadowRenderer animationRenderer = new ShadowRenderer(color);\n animationRenderer.renderSelected(result);\n }\n } else if (object instanceof Entity) {\n NamedObj container = object.getContainer();\n if (container != null) {\n shadowAttribute = (ColorAttribute) container.getAttribute(\"String_Node_Str\", ColorAttribute.class);\n if (shadowAttribute != null && !shadowAttribute.getExpression().trim().equals(\"String_Node_Str\")) {\n Color color = shadowAttribute.asColor();\n ShadowRenderer animationRenderer = new ShadowRenderer(color);\n animationRenderer.renderSelected(result);\n }\n }\n }\n } catch (IllegalActionException e) {\n }\n try {\n StringAttribute explanationAttribute = (StringAttribute) object.getAttribute(\"String_Node_Str\", StringAttribute.class);\n if (explanationAttribute != null) {\n result.setToolTipText(explanationAttribute.getExpression());\n }\n } catch (IllegalActionException e) {\n }\n return result;\n}\n"
|
"public void onSuccess(Void result) {\n System.out.println(\"String_Node_Str\");\n History.newItem(ReviewOfRequirementsByAcquisitionPilot.generateNavigationId(ReviewOfRequirementsByAcquisitionPilot.PageId.start));\n}\n"
|
"public synchronized void run() {\n boolean running = true;\n int savedelay = 0;\n while (running) {\n if (newgravellist.size() == 0) {\n if (debug) {\n System.out.println(\"String_Node_Str\");\n }\n if (savefarm) {\n saveBlocks();\n savedelay = 0;\n }\n try {\n wait();\n } catch (InterruptedException e) {\n }\n }\n try {\n wait(10000);\n } catch (InterruptedException e) {\n }\n Iterator<Entry<String, ClayDelay>> listing = newgravellist.entrySet().iterator();\n while (listing.hasNext()) {\n ClayDelay blockupdate = (ClayDelay) listing.next().getValue();\n boolean isloaded = blockupdate.getBlock().getWorld().isChunkLoaded(blockupdate.getBlock().getChunk());\n if (isloaded) {\n if (blockupdate.getBlock().getTypeId() == GRAVEL && (mcmmomode || blockupdate.getBlock().getRelative(BlockFace.DOWN).getTypeId() == activateblock)) {\n boolean alreadyupdated = false;\n if (waterenabled && lavaenabled) {\n if (hasBlockNextTo(blockupdate.getBlock(), FLOWINGWATER, WATER, FLOWINGLAVA, LAVA)) {\n blockupdate.upDelay(generator.nextInt(2));\n if (debug) {\n System.out.println(\"String_Node_Str\" + blockupdate.getDelay());\n }\n alreadyupdated = true;\n }\n } else if (waterenabled) {\n if (hasBlockNextTo(blockupdate.getBlock(), FLOWINGWATER, WATER)) {\n blockupdate.upDelay(generator.nextInt(2));\n if (debug) {\n System.out.println(\"String_Node_Str\" + blockupdate.getDelay());\n }\n alreadyupdated = true;\n }\n } else if (lavaenabled) {\n if (hasBlockNextTo(blockupdate.getBlock(), FLOWINGLAVA, LAVA)) {\n blockupdate.upDelay(generator.nextInt(2));\n if (debug) {\n System.out.println(\"String_Node_Str\" + blockupdate.getDelay());\n }\n alreadyupdated = true;\n }\n }\n if (alreadyupdated == false) {\n if (debug) {\n System.out.println(\"String_Node_Str\");\n }\n listing.remove();\n } else if (blockupdate.getDelay() >= farmdelay || (blockupdate.getInTime() + (10000 * maxfarmdelay)) <= System.currentTimeMillis()) {\n listing.remove();\n int rand = generator.nextInt(10000);\n if (graveltoclaychance == 100.0) {\n doneblocks.add(blockupdate.getBlock());\n if (customdrops) {\n blockupdate.resetTimeIn();\n clayblocks.put(compileBlockString(blockupdate.getBlock()), blockupdate);\n saveClayBlocks();\n }\n } else if (rand >= (10000.0 - (graveltoclaychance * 100.0))) {\n doneblocks.add(blockupdate.getBlock());\n if (customdrops) {\n blockupdate.resetTimeIn();\n clayblocks.put(compileBlockString(blockupdate.getBlock()), blockupdate);\n saveClayBlocks();\n }\n }\n if (debug) {\n System.out.println(\"String_Node_Str\" + newgravellist.size() + \"String_Node_Str\");\n }\n }\n } else {\n listing.remove();\n if (debug) {\n System.out.println(\"String_Node_Str\" + newgravellist.size() + \"String_Node_Str\");\n }\n }\n } else if (loadchunks) {\n blockupdate.getBlock().getWorld().loadChunk(blockupdate.getBlock().getChunk());\n }\n }\n savedelay++;\n if (savefarm && savedelay >= 10) {\n saveBlocks();\n savedelay = 0;\n }\n }\n}\n"
|
"public void testListInstance() throws ScriptException {\n ListContent listContent = (ListContent) reportContent.createListContent();\n new ListInstance(listContent, null, null);\n}\n"
|
"public void setFilePaths() {\n DatabaseAccessor db = null;\n try {\n db = initDB();\n filepaths = db.processRawToProfile(expid);\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n } finally {\n db.close();\n }\n}\n"
|
"public void handle(GetCommand getCommand) {\n String key = getCommand.getKey();\n String mapName = \"String_Node_Str\";\n int index = key.indexOf(':');\n if (index != -1) {\n mapName = key.substring(0, index);\n key = key.substring(index + 1);\n }\n Object value = textCommandService.get(mapName, key);\n MemcacheEntry entry = null;\n if (value != null) {\n if (value instanceof MemcacheEntry) {\n entry = (MemcacheEntry) value;\n } else {\n try {\n entry = new MemcacheEntry(key, IOUtil.serializeToBytes(value), 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n textCommandService.incrementGetCount();\n if (valueBytes != null) {\n textCommandService.incrementHitCount();\n }\n getCommand.setValue(valueBytes, single);\n textCommandService.sendResponse(getCommand);\n}\n"
|
"public UserTO executeAction(HttpServletResponse response, UserTO userTO, String actionName) throws WorkflowException, NotFoundException {\n return userDataBinder.getUserTO(doExecuteAction(actionName, userTO.getId(), null), userWorkflow);\n}\n"
|
"private int getIndex(IndexedTreeNode child) {\n if (child == left) {\n if (parent != null)\n return parent.getIndex(this);\n return 0;\n }\n if (child == null) {\n if (parent != null)\n return parent.getIndex(this) + leftSize;\n return leftSize;\n }\n if (child == right) {\n if (parent != null)\n return parent.getIndex(this) + leftSize + rootSize;\n return leftSize + rootSize;\n }\n throw new IndexOutOfBoundsException(this + \"String_Node_Str\");\n}\n"
|
"public Task createTask(SalesOrderLine salesOrderLine) throws AxelorException {\n Task task = new Task();\n SalesOrder salesOrder = salesOrderLine.getSalesOrder();\n Project project = salesOrder.getProject();\n task.setProject(project);\n task.setSalesOrderLine(salesOrderLine);\n task.setProduct(salesOrderLine.getProduct());\n task.setQty(salesOrderLine.getQty());\n task.setPrice(this.computeDiscount(salesOrderLine));\n task.setName(salesOrderLine.getProductName());\n task.setDescription(salesOrderLine.getDescription());\n task.setStartDateT(todayTime);\n task.setIsTimesheetAffected(true);\n task.setIsToInvoice(salesOrderLine.getIsToInvoice());\n task.setInvoicingDate(salesOrderLine.getInvoicingDate());\n task.setStatusSelect(ITask.STATUS_DRAFT);\n task.setAmountToInvoice(currencyService.getAmountCurrencyConverted(salesOrder.getCurrency(), project.getCompany().getCurrency(), salesOrderLine.getAmountRemainingToBeInvoiced(), todayTime.toLocalDate()));\n task.setEstimatedAmount(salesOrderLine.getCompanyExTaxTotal());\n return task;\n}\n"
|
"public void addTag(String tag, Method method) {\n if (tagMap.containsKey(tag)) {\n logger.warn(String.format(\"String_Node_Str\", cid, tag));\n }\n Class<?> cls = method.getDeclaringClass();\n final Tag t = new Tag();\n t.setInvokeCls(cls);\n t.setMethodName(method.getName());\n Reconsume mReconsume = method.getAnnotation(Reconsume.class);\n if (null != mReconsume) {\n t.setReconsume(mReconsume.value());\n } else {\n Reconsume cReconsume = cls.getAnnotation(Reconsume.class);\n if (null != cReconsume) {\n t.setReconsume(cReconsume.value());\n }\n }\n MethodAccess methodAccess = check.get(cls);\n if (null == methodAccess) {\n methodAccess = MethodAccess.get(cls);\n check.put(cls, methodAccess);\n }\n t.setMethodAccess(methodAccess);\n t.setArgumentExtractors(ArgumentExtractors.getArgumentExtractor(method, method.getParameterTypes(), beanFactory));\n Stream.of(tag.split(\"String_Node_Str\")).forEach(tag_ -> tagMap.put(tag_.trim(), t));\n}\n"
|
"public String create(AEntityBean bean) throws MetadataException {\n ClassType type = TypeSystem.getInstance().getDataType(ClassType.class, bean.getClass().getSimpleName());\n ITypedReferenceableInstance refBean = null;\n try {\n refBean = type.convert(this.convertToReferencable(bean), Multiplicity.REQUIRED);\n String id = repo.createEntity(refBean);\n return id;\n } catch (IllegalArgumentException | IllegalAccessException e) {\n e.printStackTrace();\n }\n throw new MetadataException(\"String_Node_Str\");\n}\n"
|
"private void insertBatches() throws DaoException, SQLException, InterruptedException {\n Connection cnx = ds.getConnection();\n try {\n String[] names = new String[fields.length];\n String[] questions = new String[fields.length];\n for (int i = 0; i < fields.length; i++) {\n names[i] = fields[i].getName();\n questions[i] = \"String_Node_Str\";\n }\n String sql = \"String_Node_Str\" + table.getName() + \"String_Node_Str\" + StringUtils.join(names, \"String_Node_Str\") + \"String_Node_Str\" + \"String_Node_Str\" + StringUtils.join(questions, \"String_Node_Str\") + \"String_Node_Str\";\n PreparedStatement statement = cnx.prepareStatement(sql);\n while (!(rowBuffer.isEmpty() && finished)) {\n int batchSize = 0;\n while (batchSize < BATCH_SIZE) {\n Object[] row = rowBuffer.poll(100, TimeUnit.MILLISECONDS);\n if (row == null && finished) {\n break;\n }\n if (row != null) {\n batchSize++;\n for (int i = 0; i < row.length; i++) {\n statement.setObject(i + 1, row[i]);\n }\n statement.addBatch();\n }\n }\n try {\n statement.executeBatch();\n } catch (SQLException e) {\n LOG.log(Level.SEVERE, \"String_Node_Str\", e);\n }\n statement.clearBatch();\n }\n cnx.commit();\n } finally {\n AbstractSqlDao.quietlyCloseConn(cnx);\n }\n}\n"
|
"final public static Term make(final Term term1, final Term term2, final int temporalOrder, final boolean spatial) {\n if (temporalOrder == TemporalRules.ORDER_FORWARD) {\n final Term[] components;\n if ((term1 instanceof Conjunction) && (term1.getTemporalOrder() == TemporalRules.ORDER_FORWARD)) {\n final CompoundTerm cterm1 = (CompoundTerm) term1;\n final List<Term> list = new ArrayList<>(cterm1.size());\n cterm1.addTermsTo(list);\n if ((term2 instanceof Conjunction) && cterm1.getIsSpatial() == term2.getIsSpatial() && term2.getTemporalOrder() == TemporalRules.ORDER_FORWARD) {\n ((CompoundTerm) term2).addTermsTo(list);\n } else {\n list.add(term2);\n }\n components = list.toArray(new Term[0]);\n } else if ((term2 instanceof Conjunction) && (term2.getTemporalOrder() == TemporalRules.ORDER_FORWARD)) {\n final CompoundTerm cterm2 = (CompoundTerm) term2;\n components = new Term[((CompoundTerm) term2).size() + 1];\n components[0] = term1;\n arraycopy(cterm2.term, 0, components, 1, cterm2.size());\n } else {\n components = new Term[] { term1, term2 };\n }\n return make(components, temporalOrder, spatial);\n } else {\n final List<Term> set = new ArrayList();\n if (term1 instanceof Conjunction) {\n ((CompoundTerm) term1).addTermsTo(set);\n if (term2 instanceof Conjunction) {\n ((CompoundTerm) term2).addTermsTo(set);\n } else {\n set.add(term2);\n }\n } else if (term2 instanceof Conjunction) {\n ((CompoundTerm) term2).addTermsTo(set);\n set.add(term1);\n } else {\n set.add(term1);\n set.add(term2);\n }\n return make(set, temporalOrder, spatial);\n }\n}\n"
|
"public synchronized void buildStack(Stack stack, String userData, Map<String, Object> setupProperties) {\n AwsTemplate awsTemplate = (AwsTemplate) stack.getTemplate();\n AwsCredential awsCredential = (AwsCredential) stack.getCredential();\n AmazonCloudFormationClient client = awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(), awsCredential);\n String stackName = String.format(\"String_Node_Str\", stack.getName(), stack.getId());\n CreateStackRequest createStackRequest = createStackRequest().withStackName(stackName).withTemplateBody(cfTemplate.getBody()).withNotificationARNs((String) setupProperties.get(SnsTopicManager.NOTIFICATION_TOPIC_ARN_KEY)).withParameters(new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(awsTemplate.getSshLocation()), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(userData), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(stackName), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(stack.getNodeCount().toString()), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(awsTemplate.getInstanceType().toString()), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(awsTemplate.getKeyName()), new Parameter().withParameterKey(\"String_Node_Str\").withParameterValue(awsTemplate.getAmiId()));\n CreateStackResult createStackResult = client.createStack(createStackRequest);\n Set<Resource> resources = new HashSet<>();\n resources.add(new Resource(ResourceType.CLOUDFORMATION_STACK, stackName, stack));\n Stack updatedStack = stackUpdater.updateStackResources(stack.getId(), resources);\n LOGGER.info(\"String_Node_Str\", stackName, updatedStack.getId());\n}\n"
|
"public String get(MetadataColumnExt bean) {\n if (bean.getFunction() != null) {\n if (getTable() != null) {\n generatorUI.updateFunParameter(getTable());\n }\n String[] arrayFunctions = bean.getArrayFunctions();\n functComboBox.setItems(arrayFunctions);\n String selectedFunction = FunctionManagerExt.getFunctionLable(bean.getFunction());\n int index = Arrays.asList(arrayFunctions).indexOf(selectedFunction);\n functComboBox.setValue(index);\n return selectedFunction;\n }\n return \"String_Node_Str\";\n}\n"
|
"private ScanBuilder configureRangeScan(ScanBuilder scan, byte[] startRow, byte[] stopRow, FuzzyRowFilter filter) {\n scan.setCaching(1000);\n if (startRow != null) {\n scan.setStartRow(startRow);\n }\n if (stopRow != null) {\n scan.setStopRow(stopRow);\n }\n scan.addFamily(columnFamily);\n if (filter != null) {\n List<Pair<byte[], byte[]>> fuzzyPairs = Lists.newArrayListWithExpectedSize(filter.getFuzzyKeysData().size());\n for (ImmutablePair<byte[], byte[]> pair : filter.getFuzzyKeysData()) {\n if (rowKeyDistributor != null) {\n fuzzyPairs.addAll(rowKeyDistributor.getDistributedFilterPairs(pair));\n } else {\n fuzzyPairs.add(Pair.newPair(Arrays.copyOf(pair.getFirst(), pair.getFirst().length), Arrays.copyOf(pair.getSecond(), pair.getSecond().length)));\n }\n }\n scan.setFilter(new org.apache.hadoop.hbase.filter.FuzzyRowFilter(fuzzyPairs));\n }\n return scan;\n}\n"
|
"public void startModule(IModule[] modules, IProgressMonitor monitor) throws CoreException {\n BehaviourOperation operation = getDeployStartApplicationOperation(modules, false);\n operation.run(monitor);\n}\n"
|
"public synchronized void init(Context context, Options options) {\n if (mInitStatus == INIT_NOT_STARTED || mInitStatus == INIT_ERROR) {\n mInitStatus = INIT_IN_PROGRESS;\n mOptions = options;\n PushProvider provider = getNextCandidate(null);\n if (provider != null) {\n provider.register();\n }\n } else {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n}\n"
|
"public int generatePreviousValue(int reference) throws NoSuchValueException {\n Between between = (Between) expression;\n int candidate = new EveryFieldValueGenerator(between.getEvery()).generatePreviousValue(reference);\n if (candidate < between.getFrom()) {\n throw new NoSuchValueException();\n }\n return candidate;\n}\n"
|
"public void setOption(String option, String world, String value) {\n if (option == null || option.isEmpty()) {\n return;\n }\n Boolean newOption = true;\n if (this.commonOptions == null) {\n this.fetchPermissions();\n }\n if (!world.isEmpty() && worldsOptions.containsKey(world) && worldsOptions.get(world).containsKey(option)) {\n newOption = false;\n }\n if (newOption && this.commonOptions.containsKey(option)) {\n newOption = false;\n }\n if (value == null) {\n value = \"String_Node_Str\";\n }\n if (world == null) {\n world = \"String_Node_Str\";\n }\n if (newOption) {\n this.db.updateQuery(\"String_Node_Str\", this.getName(), option, value, world, this.type.ordinal());\n } else {\n this.db.updateQuery(\"String_Node_Str\", value, this.getName(), this.type.ordinal(), option);\n }\n if (this.isVirtual()) {\n this.save();\n }\n this.fetchPermissions();\n}\n"
|
"private void initializeMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.radar_actions, menu);\n addFavorite = menu.findItem(R.id.action_add_favorite);\n removeFavorite = menu.findItem(R.id.action_remove_favorite);\n MenuItem refresh = menu.findItem(R.id.action_refresh);\n List<Favorite> favorites = settingsDB.favoriteDao().findByData(source, location, type, loop, enhanced, distance);\n if (favorites.size() > 0) {\n addFavorite.setVisible(false);\n if (!needKey)\n currentFavorite = favorites.get(0).getUid();\n } else {\n removeFavorite.setVisible(false);\n }\n if (needKey)\n refresh.setVisible(false);\n}\n"
|
"private List<NodeEntity> findNodesToEnableLdap(ChunkContext chunkContext) throws TaskException {\n List<NodeEntity> foundNodeList = null;\n if ((managementOperation == ManagementOperation.CREATE) || (managementOperation == ManagementOperation.RESUME)) {\n foundNodeList = getClusterEntityMgr().findAllNodes(clusterName);\n return foundNodeList;\n } else if (managementOperation == ManagementOperation.RESIZE) {\n String groupName = getJobParameters(chunkContext).getString(JobConstants.GROUP_NAME_JOB_PARAM);\n List<NodeEntity> nodesInGroup = clusterEntityMgr.findAllNodes(clusterName, groupName);\n long oldInstanceNum = getJobParameters(chunkContext).getLong(JobConstants.GROUP_INSTANCE_OLD_NUMBER_JOB_PARAM);\n for (NodeEntity node : nodesInGroup) {\n long index = CommonUtil.getVmIndex(node.getVmName());\n if (index < oldInstanceNum) {\n continue;\n }\n if (node.getStatus().ordinal() >= NodeStatus.VM_READY.ordinal()) {\n if (foundNodeList == null) {\n foundNodeList = new ArrayList<>();\n }\n foundNodeList.add(node);\n }\n }\n return foundNodeList;\n } else {\n throw TaskException.EXECUTION_FAILED(\"String_Node_Str\");\n }\n}\n"
|
"public <T extends Trajectory> SimulatedDataBlock<T> simulate(AdaptiveStepConfiguration configuration, DataBlock<T> data) {\n SimulationEngine simulationEngine = simulationEngineFactory.simulationEngine(configuration.getMaxNumberOfIterations(), configuration.getPrecisionConfiguration().getMaxRelativeError());\n try {\n List<T> trajectories = new ArrayList<>(data.size());\n Status[] statuses = new Status[data.size()];\n for (int i = 0; i < data.size(); i++) {\n Trajectory simulated = simulationEngine.simulate(data.getTrajectory(i).getLastPoint(), configuration.getOdeSystem(), configuration.getSpace().getMaxBounds().getTime(), configuration.getPrecisionConfiguration());\n LinkedTrajectory trajectory = data.getTrajectory(i) instanceof LinkedTrajectory ? (LinkedTrajectory) data.getTrajectory(i) : (data.getTrajectory(i) instanceof TrajectoryWithNeighborhood ? LinkedTrajectory.createAndUpdateReferenceWithNeighborhood((TrajectoryWithNeighborhood) data.getTrajectory(i)) : LinkedTrajectory.createAndUpdateReference(data.getTrajectory(i)));\n trajectory.append(simulated);\n trajectories.add((T) trajectory);\n if (simulated.getLastPoint().getTime() < configuration.getSpace().getMaxBounds().getTime()) {\n statuses[i] = Status.TIMEOUT;\n } else {\n statuses[i] = Status.OK;\n }\n }\n return new ArraySimulatedDataBlock<>(new ListDataBlock<>(trajectories), statuses);\n } finally {\n simulationEngine.close();\n }\n}\n"
|
"private SignResponse performSignature(CryptoMarkerType cryptoMarker, byte[] keyReference, byte[] algorithmIdentifier, byte[] message, byte[] slotHandle, byte[] hashRef, HashGenerationInfoType hashInfo) throws TLVException, IncorrectParameterException, APDUException, WSHelper.WSException {\n SignResponse response = WSHelper.makeResponse(SignResponse.class, WSHelper.makeResultOK());\n TLV tagAlgorithmIdentifier = new TLV();\n tagAlgorithmIdentifier.setTagNumWithClass(CARD_ALG_REF);\n tagAlgorithmIdentifier.setValue(algorithmIdentifier);\n TLV tagKeyReference = new TLV();\n tagKeyReference.setTagNumWithClass(KEY_REFERENCE_PRIVATE_KEY);\n tagKeyReference.setValue(keyReference);\n CardCommandAPDU cmdAPDU = null;\n CardResponseAPDU responseAPDU = null;\n String[] signatureGenerationInfo = cryptoMarker.getSignatureGenerationInfo();\n for (String command : signatureGenerationInfo) {\n HashSet<String> signGenInfo = new HashSet<String>(java.util.Arrays.asList(signatureGenerationInfo));\n if (command.equals(\"String_Node_Str\")) {\n byte[] mseData = tagKeyReference.toBER();\n if (signGenInfo.contains(\"String_Node_Str\")) {\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.DST, mseData);\n } else if (signGenInfo.contains(\"String_Node_Str\") && !signGenInfo.contains(\"String_Node_Str\")) {\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.AT, mseData);\n } else {\n String msg = \"String_Node_Str\";\n logger.error(msg);\n throw new IncorrectParameterException(msg);\n }\n } else if (command.equals(\"String_Node_Str\")) {\n cmdAPDU = new PSOComputeDigitalSignature(message, BLOCKSIZE);\n } else if (command.equals(\"String_Node_Str\")) {\n cmdAPDU = new InternalAuthenticate(message, BLOCKSIZE);\n } else if (command.equals(\"String_Node_Str\")) {\n cmdAPDU = new ManageSecurityEnvironment.Restore(ManageSecurityEnvironment.DST);\n } else if (command.equals(\"String_Node_Str\")) {\n cmdAPDU = new ManageSecurityEnvironment.Set(SET_COMPUTATION, ManageSecurityEnvironment.HT);\n TLV mseDataTLV = new TLV();\n mseDataTLV.setTagNumWithClass((byte) 0x80);\n mseDataTLV.setValue(hashRef);\n cmdAPDU.setData(mseDataTLV.toBER());\n } else if (command.equals(\"String_Node_Str\")) {\n if (hashInfo.value().equals(HashGenerationInfoType.LAST_ROUND_ON_CARD.value()) || hashInfo.value().equals(HashGenerationInfoType.NOT_ON_CARD.value())) {\n cmdAPDU = new PSOHash(PSOHash.P2_SET_HASH_OR_PART, message);\n } else {\n cmdAPDU = new PSOHash(PSOHash.P2_HASH_MESSAGE, message);\n }\n } else if (command.equals(\"String_Node_Str\")) {\n byte[] mseData = tagAlgorithmIdentifier.toBER();\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.DST, mseData);\n } else if (command.equals(\"String_Node_Str\")) {\n byte[] mseData = ByteUtils.concatenate(tagKeyReference.toBER(), tagAlgorithmIdentifier.toBER());\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.DST, mseData);\n } else if (command.equals(\"String_Node_Str\")) {\n byte[] mseData = tagKeyReference.toBER();\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.AT, mseData);\n } else if (command.equals(\"String_Node_Str\")) {\n byte[] mseData = ByteUtils.concatenate(tagKeyReference.toBER(), tagAlgorithmIdentifier.toBER());\n cmdAPDU = new ManageSecurityEnvironment(SET_COMPUTATION, ManageSecurityEnvironment.AT, mseData);\n } else {\n String msg = \"String_Node_Str\" + command + \"String_Node_Str\";\n throw new IncorrectParameterException(msg);\n }\n responseAPDU = cmdAPDU.transmit(dispatcher, slotHandle, Collections.<byte[]>emptyList());\n }\n byte[] signedMessage = responseAPDU.getData();\n while (responseAPDU.getTrailer()[0] == (byte) 0x61) {\n GetResponse getResponseData = new GetResponse();\n responseAPDU = getResponseData.transmit(dispatcher, slotHandle, Collections.<byte[]>emptyList());\n signedMessage = Arrays.concatenate(signedMessage, responseAPDU.getData());\n }\n if (!Arrays.areEqual(responseAPDU.getTrailer(), new byte[] { (byte) 0x90, (byte) 0x00 })) {\n TransmitResponse tr = new TransmitResponse();\n tr.getOutputAPDU().add(responseAPDU.toByteArray());\n WSHelper.checkResult(response);\n }\n response.setSignature(signedMessage);\n return response;\n}\n"
|
"public int executeCommand(final CommandContext context) {\n String regExp = context.getArgument(0);\n MapEntry[] entries = context.getMapTable().getEntries(regExp);\n for (int i = 0; i < entries.length; i++) {\n MapEntry mapEntry = entries[i];\n int address = mapEntry.getAddress();\n context.out.println(\"String_Node_Str\" + mapEntry.getName() + \"String_Node_Str\" + Utils.hex16(address) + \"String_Node_Str\" + Utils.hex8(cpu.memory[address]) + \"String_Node_Str\" + Utils.hex8(cpu.memory[address + 1]) + \"String_Node_Str\");\n }\n return 0;\n}\n"
|
"public CollectionEntity setCollectionProperties(String database, String name, Boolean newWaitForSync, Long journalSize) throws ArangoException {\n validateCollectionName(name);\n HttpResponseEntity res = httpManager.doPut(createEndpointUrl(database, API_COLLECTION, name, \"String_Node_Str\"), null, EntityFactory.toJsonString(new MapBuilder().put(\"String_Node_Str\", newWaitForSync).put(\"String_Node_Str\", journalSize).get()));\n return createEntity(res, CollectionEntity.class);\n}\n"
|
"public void update() {\n dataDomains = new HashSet<>(representedView.getDataDomains());\n recalculateNodeSize();\n}\n"
|
"public <T> T invokeEntryProcessor(K key, EntryProcessor<K, V, T> entryProcessor, Object... arguments) {\n checkStatusStarted();\n if (key == null) {\n throw new NullPointerException();\n }\n if (entryProcessor == null) {\n throw new NullPointerException();\n }\n long start = statisticsEnabled() ? System.nanoTime() : 0;\n T result = null;\n lockManager.lock(key);\n try {\n long now = System.currentTimeMillis();\n RICacheEventEventDispatcher<K, V> dispatcher = new RICacheEventEventDispatcher<K, V>();\n Object internalKey = keyConverter.toInternal(key);\n RICachedValue cachedValue = entries.get(internalKey);\n if (statisticsEnabled()) {\n if (cachedValue == null) {\n statistics.increaseCacheMisses(1);\n } else {\n statistics.increaseCacheHits(1);\n }\n }\n if (statisticsEnabled()) {\n statistics.addGetTimeNano(System.nanoTime() - start);\n }\n start = statisticsEnabled() ? System.nanoTime() : 0;\n EntryProcessorEntry entry = new EntryProcessorEntry(key, cachedValue, now, dispatcher);\n try {\n result = entryProcessor.process(entry, arguments);\n } catch (Throwable t) {\n throw new CacheException(t);\n }\n Duration duration;\n long expiryTime;\n switch(entry.operation) {\n case NONE:\n break;\n case CREATE:\n RIEntry<K, V> e = new RIEntry<K, V>(key, entry.value);\n writeCacheEntry(e);\n try {\n duration = expiryPolicy.getTTLForCreatedEntry(e);\n } catch (Throwable t) {\n duration = getDefaultDuration();\n }\n expiryTime = duration.getAdjustedTime(now);\n cachedValue = new RICachedValue(valueConverter.toInternal(entry.value), now, expiryTime);\n if (cachedValue.isExpiredAt(now)) {\n V previousValue = valueConverter.fromInternal(cachedValue.get());\n dispatcher.addEvent(CacheEntryExpiredListener.class, new RICacheEntryEvent<K, V>(this, key, previousValue));\n }\n entries.put(internalKey, cachedValue);\n dispatcher.addEvent(CacheEntryCreatedListener.class, new RICacheEntryEvent<K, V>(this, key, entry.value));\n if (statisticsEnabled()) {\n statistics.increaseCachePuts(1);\n statistics.addPutTimeNano(System.nanoTime() - start);\n }\n break;\n case UPDATE:\n e = new RIEntry<K, V>(key, entry.value);\n writeCacheEntry(e);\n duration = expiryPolicy.getTTLForModifiedEntry(e, new Duration(now, cachedValue.getExpiryTime()));\n expiryTime = duration.getAdjustedTime(now);\n V previousValue = valueConverter.fromInternal(cachedValue.get());\n cachedValue.setInternalValue(valueConverter.toInternal(entry.value), now);\n cachedValue.setExpiryTime(expiryTime);\n dispatcher.addEvent(CacheEntryUpdatedListener.class, new RICacheEntryEvent<K, V>(this, key, entry.value, previousValue));\n if (statisticsEnabled()) {\n statistics.increaseCachePuts(1);\n statistics.addPutTimeNano(System.nanoTime() - start);\n }\n break;\n case REMOVE:\n deleteCacheEntry(key);\n previousValue = valueConverter.fromInternal(cachedValue.get());\n entries.remove(internalKey);\n dispatcher.addEvent(CacheEntryRemovedListener.class, new RICacheEntryEvent<K, V>(this, key, previousValue));\n if (statisticsEnabled()) {\n statistics.increaseCacheRemovals(1);\n statistics.addRemoveTimeNano(System.nanoTime() - start);\n }\n break;\n default:\n break;\n }\n dispatcher.dispatch(cacheEntryListenerRegistrations.values());\n } finally {\n lockManager.unLock(key);\n }\n return result;\n}\n"
|
"private void groupAttachments(JLayeredPane jLayeredPane, JLayeredPane jPanel, Map<UUID, MagePermanent> permanents, PermanentView permanent) {\n MagePermanent perm = permanents.get(permanent.getId());\n if (perm == null) {\n return;\n }\n int position = jLayeredPane.getPosition(perm);\n perm.getLinks().clear();\n Rectangle r = perm.getBounds();\n if (!Plugins.getInstance().isCardPluginLoaded()) {\n for (UUID attachmentId : permanent.getAttachments()) {\n MagePermanent link = permanents.get(attachmentId);\n if (link != null) {\n perm.getLinks().add(link);\n r.translate(20, 20);\n link.setBounds(r);\n jLayeredPane.setPosition(link, ++position);\n }\n }\n } else {\n int index = permanent.getAttachments().size();\n for (UUID attachmentId : permanent.getAttachments()) {\n MagePermanent link = permanents.get(attachmentId);\n if (link != null) {\n link.setBounds(r);\n perm.getLinks().add(link);\n if (index == 1) {\n r.translate(ATTACHMENTS_DX_OFFSET, ATTACHMENT_DY_OFFSET);\n } else {\n r.translate(ATTACHMENT_DX_OFFSET, ATTACHMENT_DY_OFFSET);\n }\n perm.setBounds(r);\n jLayeredPane.moveToFront(link);\n jLayeredPane.moveToFront(perm);\n jPanel.setComponentZOrder(link, index);\n index--;\n }\n }\n jPanel.setComponentZOrder(perm, index);\n }\n}\n"
|
"public Collection<V> values(Predicate predicate) {\n PagingPredicate pagingPredicate = null;\n if (predicate instanceof PagingPredicate) {\n pagingPredicate = (PagingPredicate) predicate;\n pagingPredicate.setIterationType(IterationType.VALUE);\n if (pagingPredicate.getPage() > 0 && pagingPredicate.getAnchor() == null) {\n pagingPredicate.previousPage();\n values(pagingPredicate);\n pagingPredicate.nextPage();\n }\n }\n MapQueryRequest request = new MapQueryRequest(name, predicate, IterationType.VALUE);\n QueryResultSet result = invoke(request);\n if (pagingPredicate == null) {\n final ArrayList<V> values = new ArrayList<V>(result.size());\n for (Object data : result) {\n V value = toObject(data);\n values.add(value);\n }\n PagingPredicateAccessor.setPagingPredicateAnchor(pagingPredicate, new AbstractMap.SimpleImmutableEntry(null, anchor));\n }\n return values;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.