content stringlengths 40 137k |
|---|
"public void saveToSharedPreferences(SharedPreferences sharedPreferences) {\n String prefix = \"String_Node_Str\";\n SharedPreferences.Editor editor = sharedPreferences.edit();\n if (this.preferenceSpot >= 0) {\n prefix += this.preferenceSpot + \"String_Node_Str\";\n } else {\n int count = sharedPreferences.getInt(\"String_Node_Str\", 0);\n editor.putInt(\"String_Node_Str\", count + 1);\n prefix += count + \"String_Node_Str\";\n }\n editor.putString(prefix + \"String_Node_Str\", this.getName());\n editor.putInt(prefix + \"String_Node_Str\", this.nicknames.size());\n for (int i = 0; i < this.nicknames.size(); i++) {\n editor.putString(prefix + \"String_Node_Str\" + i, this.nicknames.get(i));\n }\n editor.putString(prefix + \"String_Node_Str\", this.getUsername());\n editor.putString(prefix + \"String_Node_Str\", this.getRealname());\n editor.putString(prefix + \"String_Node_Str\", this.host.getHostname());\n editor.putInt(prefix + \"String_Node_Str\", this.host.getPort());\n editor.putBoolean(prefix + \"String_Node_Str\", this.host.isSSL());\n editor.putBoolean(prefix + \"String_Node_Str\", this.host.verifySSL());\n editor.putString(prefix + \"String_Node_Str\", this.host.getPassword());\n editor.putInt(prefix + \"String_Node_Str\", this.autoChannels.size());\n for (int i = 0; i < this.autoChannels.size(); i++) {\n editor.putString(prefix + \"String_Node_Str\" + i, this.autoChannels.get(i));\n }\n editor.putInt(prefix + \"String_Node_Str\", this.autoCommands.size());\n for (int i = 0; i < this.autoCommands.size(); i++) {\n editor.putString(prefix + \"String_Node_Str\" + i, this.autoCommands.get(i));\n }\n editor.putBoolean(prefix + \"String_Node_Str\", this.isAutoConnected());\n editor.putBoolean(prefix + \"String_Node_Str\", this.isLogged());\n editor.commit();\n}\n"
|
"protected void loadStandardMappingFiles(String ormXMLFile) {\n PersistenceUnitInfo puInfo = m_project.getPersistenceUnitInfo();\n Collection<URL> rootUrls = new HashSet<URL>(puInfo.getJarFileUrls());\n rootUrls.add(puInfo.getPersistenceUnitRootUrl());\n for (URL rootURL : rootUrls) {\n getSessionLog().log(SessionLog.FINER, SessionLog.METADATA, \"String_Node_Str\", new Object[] { ormXMLFile, rootURL }, true);\n URL ormURL = null;\n Archive par = null;\n try {\n par = PersistenceUnitProcessor.getArchiveFactory(m_loader).createArchive(rootURL, null);\n if (par != null) {\n ormURL = par.getEntryAsURL(ormXMLFile);\n if (ormURL != null) {\n logMessage(\"String_Node_Str\" + ormURL + \"String_Node_Str\" + rootURL);\n XMLEntityMappings entityMappings = XMLEntityMappingsReader.read(ormURL, m_loader, m_project.getPersistenceUnitInfo().getProperties());\n entityMappings.setIsEclipseLinkORMFile(ormXMLFile.equals(MetadataHelper.ECLIPSELINK_ORM_FILE));\n m_project.addEntityMappings(entityMappings);\n }\n }\n } catch (IOException e) {\n throw new RuntimeException(e);\n } catch (URISyntaxException e) {\n throw new RuntimeException(e);\n } finally {\n if (par != null) {\n par.close();\n }\n }\n }\n}\n"
|
"public void testBasicProbeMechanicsFromLeaf() throws Exception {\n drainAll();\n QueryRequest request = QueryRequest.createQuery(\"String_Node_Str\");\n request.hop();\n request.setTTL((byte) 1);\n assertTrue((request.getHops() == 1));\n ULTRAPEER_2.send(request);\n ULTRAPEER_2.flush();\n QueryRequest reqRecvd = (QueryRequest) LEAF.receive(TIMEOUT);\n assertTrue(reqRecvd.getQuery().equals(\"String_Node_Str\"));\n assertTrue(Arrays.equals(request.getGUID(), reqRecvd.getGUID()));\n try {\n ULTRAPEER_1.receive(TIMEOUT);\n assertTrue(false);\n } catch (InterruptedIOException expected) {\n }\n Response response1 = new Response(0L, 0L, \"String_Node_Str\");\n byte[] guid1 = GUID.makeGuid();\n QueryReply reply1 = new QueryReply(request.getGUID(), (byte) 2, 6346, new byte[4], 56, new Response[] { response1 }, guid1, false);\n drain(ULTRAPEER_2);\n LEAF.send(reply1);\n LEAF.flush();\n QueryReply qRep = getFirstQueryReply(ULTRAPEER_2);\n assertTrue(qRep != null);\n assertEquals(new GUID(guid1), new GUID(qRep.getClientGUID()));\n Thread.sleep(2 * 1000);\n request.setTTL((byte) 2);\n ULTRAPEER_2.send(request);\n ULTRAPEER_2.flush();\n try {\n LEAF.receive(TIMEOUT);\n assertTrue(false);\n } catch (InterruptedIOException expected) {\n }\n reqRecvd = (QueryRequest) ULTRAPEER_1.receive(TIMEOUT);\n assertTrue(reqRecvd.getQuery().equals(\"String_Node_Str\"));\n assertTrue(Arrays.equals(request.getGUID(), reqRecvd.getGUID()));\n assertEquals(reqRecvd.getHops(), (byte) 2);\n}\n"
|
"public Calendar getEndTime() {\n Calendar ret = (Calendar) currentDay.clone();\n ret.set(Calendar.HOUR_OF_DAY, currentTimeEnd / 60);\n ret.set(Calendar.MINUTE, currentTimeEnd % 60);\n ret.set(Calendar.SECOND, 0);\n ret.set(Calendar.MILLISECOND, 0);\n return ret;\n}\n"
|
"public InputStream getInputStream(Object obj) throws IOException {\n if (obj instanceof ZipEntry) {\n return ((ZipFile) zipFiles.get(obj)).getInputStream((ZipEntry) obj);\n } else {\n return new BufferedInputStream(new FileInputStream((File) obj));\n }\n}\n"
|
"public static void readFully(FileChannel file, long pos, ByteBuffer dst) {\n try {\n do {\n int len = file.read(dst, pos);\n if (len < 0) {\n throw new EOFException();\n }\n pos += len;\n } while (dst.remaining() > 0);\n dst.rewind();\n } catch (IOException e) {\n throw newIllegalStateException(ERROR_READING_FAILED, \"String_Node_Str\", file, dst.remaining(), pos, e);\n }\n}\n"
|
"final public MrGeoRaster reduce(final int xfactor, final int yfactor, Aggregator aggregator, double[] nodatas) throws MrGeoRasterException {\n MrGeoRaster child = createCompatibleRaster(width / xfactor, height / yfactor);\n final int subsize = xfactor * yfactor;\n final int[] intsamples = new int[subsize];\n final float[] floatsamples = new float[subsize];\n final double[] doublesamples = new double[subsize];\n int ndx;\n for (int b = 0; b < bands; b++) {\n for (int y = 0; y < height; y += yfactor) {\n for (int x = 0; x < width; x += xfactor) {\n switch(datatype) {\n case DataBuffer.TYPE_BYTE:\n case DataBuffer.TYPE_INT:\n case DataBuffer.TYPE_SHORT:\n case DataBuffer.TYPE_USHORT:\n ndx = 0;\n for (int yy = y; yy < y + yfactor; yy++) {\n for (int xx = x; xx < x + xfactor; xx++) {\n intsamples[ndx++] = getPixelInt(xx, yy, b);\n }\n }\n int intSample = aggregator.aggregate(intsamples, (int) nodatas[b]);\n child.setPixel(x / xfactor, y / yfactor, b, intSample);\n break;\n case DataBuffer.TYPE_FLOAT:\n ndx = 0;\n for (int yy = y; yy < y + yfactor; yy++) {\n for (int xx = x; xx < x + xfactor; xx++) {\n floatsamples[ndx++] = getPixelFloat(xx, yy, b);\n }\n }\n float floatsample = aggregator.aggregate(floatsamples, (float) nodatas[b]);\n child.setPixel(x / xfactor, y / yfactor, b, floatsample);\n break;\n case DataBuffer.TYPE_DOUBLE:\n ndx = 0;\n for (int yy = y; yy < y + yfactor; yy++) {\n for (int xx = x; xx < x + xfactor; xx++) {\n doublesamples[ndx++] = getPixelInt(xx, yy, b);\n }\n }\n double doublesample = aggregator.aggregate(doublesamples, nodatas[b]);\n child.setPixel(x / xfactor, y / yfactor, b, doublesample);\n break;\n default:\n throw new RasterWritable.RasterWritableException(\"String_Node_Str\");\n }\n }\n }\n }\n return child;\n}\n"
|
"public boolean canBeAppliedToPoint(ModificationPoint point) {\n if (!(point.getCodeElement() instanceof CtStatement))\n return false;\n if (point.getCodeElement() instanceof CtLocalVariable) {\n return false;\n }\n return true;\n}\n"
|
"private RemoteIdentity remote(final Urn iname, final String secret) throws IOException {\n RemoteIdentity remote;\n URL entry;\n try {\n entry = this.resolver.authority(iname);\n } catch (com.netbout.spi.UnreachableUrnException ex) {\n throw new IOException(ex);\n }\n final URI uri = UriBuilder.fromUri(entry.toString()).queryParam(\"String_Node_Str\", \"String_Node_Str\").queryParam(\"String_Node_Str\", \"String_Node_Str\").build(iname, secret);\n try {\n remote = this.load(uri);\n } catch (IOException ex) {\n throw new IOException(String.format(\"String_Node_Str\", iname, uri), ex);\n }\n if (!remote.name().equals(iname) && !iname.nss().isEmpty()) {\n throw new IOException(String.format(\"String_Node_Str\", remote.name(), uri, iname));\n }\n return remote;\n}\n"
|
"private void advance() {\n try {\n while (walker.hasNext()) {\n ColumnEvent ev = walker.next();\n switch(currentChangeType) {\n case ColumnEvent.ROW_EDGE_CHANGE:\n case ColumnEvent.MEASURE_HEADER_CHANGE:\n if (blankStarted && ev.type != ColumnEvent.ROW_EDGE_CHANGE && ev.type != ColumnEvent.MEASURE_HEADER_CHANGE) {\n nextExecutor = new CrosstabCellExecutor(this, null, rowSpan, colSpan, currentColIndex - colSpan + 1);\n blankStarted = false;\n hasLast = false;\n }\n break;\n case ColumnEvent.COLUMN_EDGE_CHANGE:\n case ColumnEvent.COLUMN_TOTAL_CHANGE:\n if (edgeStarted && isMeetEdgeEnd(ev)) {\n nextExecutor = new CrosstabCellExecutor(this, levelView.getCell(), rowSpan, colSpan, currentColIndex - colSpan + 1);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n ((CrosstabCellExecutor) nextExecutor).setForceEmpty(isForceEmpty());\n edgeStarted = false;\n hasLast = false;\n } else if (subTotalStarted && (ev.type != currentChangeType || ev.dimensionIndex != subTotalDimensionIndex || ev.levelIndex != subTotalLevelIndex)) {\n nextExecutor = new CrosstabCellExecutor(this, crosstabItem.getDimension(COLUMN_AXIS_TYPE, subTotalDimensionIndex).getLevel(subTotalLevelIndex).getAggregationHeader(), rowSpan, colSpan, currentColIndex - colSpan + 1);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n subTotalStarted = false;\n hasLast = false;\n }\n break;\n case ColumnEvent.GRAND_TOTAL_CHANGE:\n if (grandTotalStarted && ev.type != currentChangeType) {\n nextExecutor = new CrosstabCellExecutor(this, crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE), rowSpan, colSpan, currentColIndex - colSpan + 1);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n grandTotalStarted = false;\n hasLast = false;\n }\n break;\n }\n if (isSubTotalNeedStart(ev)) {\n subTotalStarted = true;\n rowSpan = GroupUtil.computeGroupSpan(columnGroups, subTotalDimensionIndex, subTotalLevelIndex);\n if (isLayoutDownThenOver) {\n rowSpan++;\n }\n colSpan = 0;\n hasLast = true;\n } else if (isGrandTotalNeedStart(ev)) {\n grandTotalStarted = true;\n rowSpan = GroupUtil.computeGroupSpan(columnGroups, currentDimensionIndex, currentLevelIndex) + 1;\n colSpan = 0;\n hasLast = true;\n } else if (isEdgeNeedStart(ev)) {\n edgeStarted = true;\n rowSpan = 1;\n colSpan = 0;\n hasLast = true;\n } else if (isBlankNeedStart(ev)) {\n blankStarted = true;\n rowSpan = GroupUtil.computeGroupSpan(columnGroups, currentDimensionIndex, currentLevelIndex) + 1;\n if (GroupUtil.hasMeasureHeader(crosstabItem, COLUMN_AXIS_TYPE)) {\n rowSpan++;\n }\n hasLast = true;\n }\n currentEdgePosition = ev.dataPosition;\n currentChangeType = ev.type;\n colSpan++;\n currentColIndex++;\n if (nextExecutor != null) {\n return;\n }\n }\n } catch (OLAPException e) {\n logger.log(Level.SEVERE, Messages.getString(\"String_Node_Str\"), e);\n }\n if (hasLast) {\n hasLast = false;\n if (blankStarted) {\n nextExecutor = new CrosstabCellExecutor(this, null, rowSpan, colSpan, currentColIndex - colSpan + 1);\n } else if (edgeStarted) {\n nextExecutor = new CrosstabCellExecutor(this, levelView.getCell(), rowSpan, colSpan, currentColIndex - colSpan + 1);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n ((CrosstabCellExecutor) nextExecutor).setForceEmpty(isForceEmpty());\n edgeStarted = false;\n } else if (subTotalStarted) {\n nextExecutor = new CrosstabCellExecutor(this, crosstabItem.getDimension(COLUMN_AXIS_TYPE, subTotalDimensionIndex).getLevel(subTotalLevelIndex).getAggregationHeader(), rowSpan, colSpan, currentColIndex);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n subTotalStarted = false;\n } else if (grandTotalStarted) {\n nextExecutor = new CrosstabCellExecutor(this, crosstabItem.getGrandTotal(COLUMN_AXIS_TYPE), rowSpan, colSpan, currentColIndex - colSpan + 1);\n ((CrosstabCellExecutor) nextExecutor).setPosition(currentEdgePosition);\n grandTotalStarted = false;\n }\n }\n}\n"
|
"public static TdCatalog getParentCatalog(ModelElement element) {\n Namespace namespace = element.getNamespace();\n if (element == null || namespace == null) {\n return null;\n }\n return SwitchHelpers.CATALOG_SWITCH.doSwitch(element.getNamespace());\n}\n"
|
"public String chipinfo() {\n return \"String_Node_Str\" + on + \"String_Node_Str\" + ((status & STATUS_XOSC16M_STABLE) > 0) + \"String_Node_Str\" + ((status & STATUS_RSSI_VALID) > 0) + \"String_Node_Str\" + cca + \"String_Node_Str\";\n}\n"
|
"private InputSplitAssigner loadInputSplitAssigner(final Class<? extends InputSplit> inputSplitType, JobID jid) {\n final String typeClassName = inputSplitType.getSimpleName();\n final String assignerKey = INPUT_SPLIT_CONFIG_KEY_PREFIX + typeClassName;\n LOG.info(\"String_Node_Str\" + typeClassName);\n String assignerClassName = GlobalConfiguration.getString(assignerKey, null);\n if (assignerClassName == null) {\n if (FileInputSplit.class.getSimpleName().equals(typeClassName)) {\n assignerClassName = FileInputSplitAssigner.class.getName();\n } else {\n return null;\n }\n }\n try {\n final Class<? extends InputSplitAssigner> assignerClass = (Class<? extends InputSplitAssigner>) Class.forName(assignerClassName);\n return assignerClass.newInstance();\n } catch (Exception e) {\n LOG.error(StringUtils.stringifyException(e));\n }\n return null;\n}\n"
|
"private boolean isHealthy(Service osd) {\n String smartTestResult = KeyValuePairs.getValue(osd.getData().getDataList(), \"String_Node_Str\");\n if (smartTestResult == null) {\n return true;\n }\n return Integer.valueOf(smartTestResult) != SmartTestResult.SMART_TEST_RESULT_FAILED_VALUE;\n}\n"
|
"public void transform(NodeType node) {\n ElementParameterType dbVersion = ComponentUtilities.getNodeProperty(node, \"String_Node_Str\");\n if (dbVersion != null) {\n String jarValue = dbVersion.getValue();\n if (\"String_Node_Str\".equalsIgnoreCase(jarValue)) {\n dbVersion.setValue(\"String_Node_Str\");\n } else if (\"String_Node_Str\".equalsIgnoreCase(jarValue)) {\n dbVersion.setValue(\"String_Node_Str\");\n } else if (\"String_Node_Str\".equalsIgnoreCase(jarValue)) {\n dbVersion.setValue(\"String_Node_Str\");\n } else if (\"String_Node_Str\".equalsIgnoreCase(jarValue)) {\n } else if (\"String_Node_Str\".equalsIgnoreCase(jarValue)) {\n dbVersion.setValue(\"String_Node_Str\");\n }\n }\n}\n"
|
"public void setExternal() {\n external = true;\n for (MethodWrapper method : getMethods()) {\n method.setLocked(true);\n }\n}\n"
|
"private void appendRequestBodyPart(final String method, final String uri, final String body, final Map<String, String> headers, final String contentId) {\n boolean isContentLengthPresent = false;\n writer.append(HttpHeaders.CONTENT_TYPE).append(COLON).append(SP).append(HttpContentType.APPLICATION_HTTP).append(CRLF);\n writer.append(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP).append(BatchHelper.BINARY_ENCODING).append(CRLF);\n if (contentId != null) {\n writer.append(BatchHelper.HTTP_CONTENT_ID).append(COLON).append(SP).append(contentId).append(LF);\n }\n String contentLength = getHeaderValue(headers, HttpHeaders.CONTENT_LENGTH);\n if (contentLength != null && !contentLength.isEmpty()) {\n isContentLengthPresent = true;\n }\n writer.append(LF);\n writer.append(method).append(SP).append(uri).append(SP).append(HTTP_1_1);\n writer.append(LF);\n if (!isContentLengthPresent && body != null && !body.isEmpty()) {\n writer.append(HttpHeaders.CONTENT_LENGTH).append(COLON).append(SP).append(BatchHelper.getBytes(body).length).append(LF);\n }\n appendHeader(headers);\n if (body != null && !body.isEmpty()) {\n writer.append(LF);\n writer.append(body);\n }\n}\n"
|
"View createUnlockScreenFor(UnlockMode unlockMode) {\n if (unlockMode == UnlockMode.Pattern) {\n UnlockScreen view = new UnlockScreen(mContext, mLockPatternUtils, mUpdateMonitor, mKeyguardScreenCallback, mUpdateMonitor.getFailedAttempts());\n view.setEnableFallback(mEnableFallback);\n return view;\n } else if (unlockMode == UnlockMode.SimPin) {\n return new SimUnlockScreen(mContext, mUpdateMonitor, mKeyguardScreenCallback);\n } else if (unlockMode == UnlockMode.Account) {\n try {\n return new AccountUnlockScreen(mContext, mKeyguardScreenCallback, mLockPatternUtils);\n } catch (IllegalStateException e) {\n Log.i(TAG, \"String_Node_Str\" + \"String_Node_Str\");\n return createUnlockScreenFor(UnlockMode.Pattern);\n }\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\" + unlockMode);\n }\n}\n"
|
"public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {\n ActivityCompat.invalidateOptionsMenu(getActivity());\n if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddCoinapultAccountActivity.RESULT_COINAPULT) {\n UUID accountId = (UUID) intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);\n CoinapultAccount account = (CoinapultAccount) _mbwManager.getWalletManager(false).getAccount(accountId);\n _mbwManager.setSelectedAccount(accountId);\n accountListAdapter.setFocusedAccount(account);\n updateIncludingMenus();\n } else if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == Activity.RESULT_OK) {\n UUID accountid = (UUID) intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);\n WalletManager walletManager = _mbwManager.getWalletManager(false);\n WalletAccount account = walletManager.getAccount(accountid);\n if (account.isActive()) {\n _mbwManager.setSelectedAccount(accountid);\n }\n accountListAdapter.setFocusedAccount(account);\n update();\n if (!(account instanceof ColuAccount)) {\n setNameForNewAccount(account);\n }\n } else if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddAdvancedAccountActivity.RESULT_MSG) {\n new AlertDialog.Builder(getActivity()).setMessage(intent.getStringExtra(AddAccountActivity.RESULT_MSG)).setPositiveButton(R.string.button_ok, null).create().show();\n } else {\n super.onActivityResult(requestCode, resultCode, intent);\n }\n}\n"
|
"private void switchToDynamic() {\n Composite composite = new Composite(valueArea, SWT.NONE);\n GridData gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 2;\n composite.setLayoutData(gd);\n composite.setLayout(UIUtil.createGridLayoutWithoutMargin(3, false));\n createLabel(composite, LABEL_SELECT_DATA_SET);\n dataSetChooser = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);\n dataSetChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n dataSetChooser.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n refreshColumns(false);\n }\n });\n createDataSet = new Button(composite, SWT.PUSH);\n createDataSet.setText(BUTTON_CREATE_DATA_SET);\n setButtonLayoutData(createDataSet);\n createDataSet.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n new NewDataSetAction().run();\n refreshDataSets();\n }\n });\n createLabel(composite, LABEL_SELECT_VALUE_COLUMN, maxStrLengthProperty);\n columnChooser = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);\n columnChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n columnChooser.addSelectionListener(new SelectionAdapter() {\n public void widgetDefaultSelected(SelectionEvent e) {\n updateButtons();\n }\n });\n createLabel(composite, null, maxStrLengthProperty);\n createLabel(composite, LABEL_SELECT_DISPLAY_TEXT, maxStrLengthProperty);\n displayTextChooser = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);\n displayTextChooser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n createLabel(composite, null, maxStrLengthProperty);\n createDefaultEditor();\n listLimit.setEditable(true);\n}\n"
|
"public WorkflowModel updateACLForWorkflow(String pWorkspaceId, String workflowModelId, Map<String, String> userEntries, Map<String, String> groupEntries) throws WorkflowNotFoundException, UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkflowModelNotFoundException, AccessRightException {\n User user = userManager.checkWorkspaceReadAccess(pWorkspaceId);\n WorkflowModelKey workflowModelKey = new WorkflowModelKey(pWorkspaceId, workflowModelId);\n WorkflowModel workflowModel = new WorkflowModelDAO(new Locale(user.getLanguage()), em).loadWorkflowModel(workflowModelKey);\n checkWorkflowWriteAccess(workflowModel, user);\n ACLFactory aclFactory = new ACLFactory(em);\n if (workflowModel.getAcl() == null) {\n ACL acl = aclFactory.createACL(pWorkspaceId, userEntries, groupEntries);\n workflowModel.setAcl(acl);\n } else {\n aclFactory.updateACL(pWorkspaceId, workflowModel.getAcl(), userEntries, groupEntries);\n }\n return workflowModel;\n}\n"
|
"public static void handleOnCreate(RowContent content, IRowData rowData, ExecutionContext context) {\n try {\n ReportItemDesign rowDesign = (ReportItemDesign) content.getGenerateBy();\n IRowInstance row = new RowInstance(content, context);\n if (handleJS(row, rowDesign.getOnCreate(), context).didRun())\n return;\n IRowEventHandler eh = (IRowEventHandler) getInstance((RowHandle) rowDesign.getHandle());\n if (eh != null)\n eh.onCreate(row, rowData, context.getReportContext());\n } catch (Exception e) {\n log.log(Level.WARNING, e.getMessage(), e);\n }\n}\n"
|
"IDataSetCacheObject getSavedCacheObject(DataSourceAndDataSet dsAndDs) {\n synchronized (cacheMap) {\n return tempDataSetCacheMap.get(dsAndDs);\n }\n}\n"
|
"public boolean isRedoable() {\n return oldTexts == null && isSheetAvailable() && !isRangeProtected();\n}\n"
|
"private Integer doSend() throws Exception {\n if (message == null) {\n return 0;\n }\n if (message.getClients() == null || message.getClients().size() == 0) {\n logger.error(\"String_Node_Str\", message);\n message.setStatusId(PayloadStatus.Failed);\n message.setTotalUsers(0);\n PayloadServiceImpl.instance.add(message);\n return 0;\n }\n if (message.getStatusId().intValue() == PayloadStatus.Pending0) {\n message.setStatusId(PayloadStatus.Pending);\n message.setTotalUsers(0);\n PayloadServiceImpl.instance.add(message);\n }\n for (String client : message.getClients()) {\n Client cc = ClientServiceImpl.instance.findByUserId(client);\n if (cc == null) {\n logger.error(\"String_Node_Str\" + client);\n if (message.getOfflineMode().intValue() == PBAPNSMessage.OfflineModes.SendAfterOnline_VALUE) {\n message.setStatus(client, new PushStatus(PushStatus.NoClient));\n }\n continue;\n }\n message.setBadge(cc.getBadge() + 1);\n Connection c = ConnectionKeeper.get(product.getAppKey(), client);\n if (c != null) {\n c.send(message);\n } else {\n if (!cc.isDevice(ClientType.iOS)) {\n logger.error(\"String_Node_Str\" + client);\n message.setStatus(cc.getUserId(), new PushStatus(PushStatus.NoConnections));\n continue;\n }\n if (StringUtils.isBlank(cc.getDeviceToken()) || \"String_Node_Str\".equalsIgnoreCase(cc.getDeviceToken())) {\n logger.error(\"String_Node_Str\" + client);\n if (message.getOfflineMode().intValue() == PBAPNSMessage.OfflineModes.SendAfterOnline_VALUE) {\n message.setStatus(cc.getUserId(), new PushStatus(PushStatus.NO_DEVICE_TOKEN));\n } else {\n message.setStatus(cc.getUserId(), new PushStatus(PushStatus.Ignore));\n }\n continue;\n }\n if (0 == message.getToMode()) {\n if (message.getOfflineMode().intValue() == PBAPNSMessage.OfflineModes.APNS_VALUE) {\n APNSKeeper.instance.push(this.product, cc, message);\n } else if (message.getOfflineMode().intValue() == PBAPNSMessage.OfflineModes.SendAfterOnline_VALUE) {\n message.setStatus(cc.getUserId(), new PushStatus(PushStatus.WaitOnline));\n }\n } else {\n message.setStatus(cc.getUserId(), new PushStatus(PushStatus.Ignore));\n }\n }\n }\n PayloadServiceImpl.instance.updateSendStatus(message);\n return message.getClients().size();\n}\n"
|
"private boolean isNonNegative(long[][] in) {\n for (int i = 0; i < in.length; i++) {\n for (int j = 0; j < in[i].length; j++) {\n if (in[i][j] < 0) {\n return false;\n }\n }\n }\n return true;\n}\n"
|
"private void save(Collection<SourceCode> squidSourceFiles) {\n for (SourceCode squidSourceFile : squidSourceFiles) {\n SourceFile squidFile = (SourceFile) squidSourceFile;\n File sonarFile = context.getResource(File.create(pathResolver.relativePath(fileSystem.baseDir(), new java.io.File(squidFile.getKey()))));\n if (sonarFile != null) {\n noSonarFilter.addResource(sonarFile, squidFile.getNoSonarTagLines());\n saveClassComplexity(sonarFile, squidFile);\n saveFilesComplexityDistribution(sonarFile, squidFile);\n saveFunctionsComplexityAndDistribution(sonarFile, squidFile);\n saveMeasures(sonarFile, squidFile);\n saveIssues(sonarFile, squidFile);\n } else {\n LOG.warn(\"String_Node_Str\", squidFile.getKey());\n }\n }\n}\n"
|
"private SearchResults searchByDefaultIndex(String namespaceId, String searchQuery, Set<MetadataSearchTargetType> types) {\n List<MetadataEntry> results = new ArrayList<>();\n for (String searchTerm : getSearchTerms(namespaceId, searchQuery)) {\n Scanner scanner;\n if (searchTerm.endsWith(\"String_Node_Str\")) {\n byte[] startKey = Bytes.toBytes(searchTerm.substring(0, searchTerm.lastIndexOf(\"String_Node_Str\")));\n byte[] stopKey = Bytes.stopKeyForPrefix(startKey);\n scanner = indexedTable.scanByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN), startKey, stopKey);\n } else {\n byte[] value = Bytes.toBytes(searchTerm);\n scanner = indexedTable.readByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN), value);\n }\n try {\n Row next;\n while ((next = scanner.next()) != null) {\n Optional<MetadataEntry> metadataEntry = parseRow(next, DEFAULT_INDEX_COLUMN, types);\n if (metadataEntry.isPresent()) {\n results.add(metadataEntry.get());\n }\n }\n } finally {\n scanner.close();\n }\n }\n return new SearchResults(results, Collections.<String>emptyList());\n}\n"
|
"public static Integer waitFor(Process p, long maxWait) {\n long startTime = System.currentTimeMillis();\n Timer timer = new Timer(true);\n final Thread waitThread = Thread.currentThread();\n boolean wakeupScheduled = false;\n while (System.currentTimeMillis() < startTime + maxWait) {\n try {\n if (!wakeupScheduled) {\n synchronized (waitThread) {\n timer.schedule(new TimerTask() {\n public void run() {\n synchronized (waitThread) {\n waitThread.interrupt();\n }\n }\n }, maxWait);\n wakeupScheduled = true;\n return p.waitFor();\n }\n } else {\n return p.waitFor();\n }\n } catch (InterruptedException e) {\n }\n }\n synchronized (waitThread) {\n timer.cancel();\n doneWaiting.set(true);\n Thread.interrupted();\n }\n try {\n return p.exitValue();\n } catch (IllegalThreadStateException e) {\n log.warn(\"String_Node_Str\" + p + \"String_Node_Str\" + (System.currentTimeMillis() - startTime) + \"String_Node_Str\");\n return null;\n }\n}\n"
|
"public List<InvoiceLine> createInvoiceLine(Invoice invoice, ProjectTask projectTask) throws AxelorException {\n Product product = projectTask.getProduct();\n if (product == null) {\n throw new AxelorException(String.format(I18n.get(IExceptionMessage.INVOICING_FOLDER_PROJECT_TASK_PRODUCT), projectTask.getFullName()), IException.CONFIGURATION_ERROR);\n }\n InvoiceLineGenerator invoiceLineGenerator = new InvoiceLineGenerator(invoice, product, projectTask.getName(), projectTask.getPrice(), null, projectTask.getQty(), projectTask.getUnit(), InvoiceLineGenerator.DEFAULT_SEQUENCE, BigDecimal.ZERO, IPriceListLine.AMOUNT_TYPE_NONE, projectTask.getPrice().multiply(projectTask.getQty()), null, false) {\n\n public List<InvoiceLine> creates() throws AxelorException {\n InvoiceLine invoiceLine = this.createInvoiceLine();\n List<InvoiceLine> invoiceLines = new ArrayList<InvoiceLine>();\n invoiceLines.add(invoiceLine);\n return invoiceLines;\n }\n };\n return invoiceLineGenerator.creates();\n}\n"
|
"public org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent();\n copyElement(src, tgt);\n tgt.setAction(convertCodeableConcept(src.getAction()));\n tgt.setDate(src.getDate());\n tgt.setAuthor(convertReference(src.getAuthor()));\n return tgt;\n}\n"
|
"public void shouldFetch_withVariantItemAttributeQueryOnParentIndex() throws Exception {\n final AttributeQuery query = mock(AttributeQuery.class);\n final Condition mockCondition = mock(Condition.class);\n when(mockCondition.getComparisonOperator()).thenReturn(Operators.EQUALS);\n final String itemId = randomId();\n final String stringProperty = randomString(10);\n final Set<String> stringPropertyValues = new HashSet<>(Arrays.asList(stringProperty));\n when(mockCondition.getValues()).thenReturn(stringPropertyValues);\n when(mockCondition.hasMissingComparisonValues()).thenReturn(false);\n when(query.getAttributeName()).thenReturn(\"String_Node_Str\");\n when(query.getCondition()).thenReturn(mockCondition);\n final ParentItemConfiguration parentItemConfiguration = new ParentItemConfiguration(StubItem.class, tableName);\n parentItemConfiguration.registerIndexes(Arrays.asList(new IndexDefinition(\"String_Node_Str\")));\n final VariantItemConfiguration variantItemConfiguration = new VariantItemConfiguration(parentItemConfiguration, StubVariantItem.class, \"String_Node_Str\");\n final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(parentItemConfiguration, variantItemConfiguration);\n when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations);\n final DynamoDbTemplate dynamoDbTemplate = new DynamoDbTemplate(mockDatabaseSchemaHolder);\n final QueryResult mockQueryResult = mock(QueryResult.class);\n final Map<String, AttributeValue> mockItem = new HashMap<>();\n mockItem.put(\"String_Node_Str\", new AttributeValue(itemId));\n mockItem.put(\"String_Node_Str\", new AttributeValue(stringProperty));\n mockItem.put(\"String_Node_Str\", new AttributeValue(\"String_Node_Str\"));\n final List<Map<String, AttributeValue>> mockItems = Arrays.asList(mockItem);\n when(mockQueryResult.getItems()).thenReturn(mockItems);\n when(mockQueryResult.getLastEvaluatedKey()).thenReturn(null);\n when(mockAmazonDynamoDbClient.query(any(QueryRequest.class))).thenReturn(mockQueryResult);\n dynamoDbTemplate.initialize(mockAmazonDynamoDbClient);\n final Collection<StubVariantItem> returnedItems = dynamoDbTemplate.fetch(query, StubVariantItem.class);\n final ArgumentCaptor<QueryRequest> queryRequestArgumentCaptor = ArgumentCaptor.forClass(QueryRequest.class);\n verify(mockAmazonDynamoDbClient).query(queryRequestArgumentCaptor.capture());\n final QueryRequest queryRequest = queryRequestArgumentCaptor.getValue();\n assertEquals(schemaName + \"String_Node_Str\" + tableName, queryRequest.getTableName());\n assertEquals(\"String_Node_Str\", queryRequest.getIndexName());\n assertEquals(1, queryRequest.getKeyConditions().size());\n assertEquals(\"String_Node_Str\", queryRequest.getKeyConditions().get(\"String_Node_Str\").getComparisonOperator());\n assertEquals(1, queryRequest.getKeyConditions().get(\"String_Node_Str\").getAttributeValueList().size());\n assertEquals(new AttributeValue(stringProperty), queryRequest.getKeyConditions().get(\"String_Node_Str\").getAttributeValueList().get(0));\n assertNotNull(returnedItems);\n assertEquals(1, returnedItems.size());\n}\n"
|
"public long size() {\n return persistentStore1.size();\n}\n"
|
"public boolean isDone() {\n return responseAvailable(response);\n}\n"
|
"private boolean isProjectOwner(GitlabProject project, User user) {\n GitlabUser owner = project.getOwner();\n if (owner == null) {\n return false;\n }\n return owner.getId().toString().equals(user.getExternalId()) || owner.getName().equals(user.getUserName());\n}\n"
|
"public String gdReadValue(String variable) {\n return getComboBoxHelper().getText();\n}\n"
|
"public void stopListening() {\n try {\n mContext.unregisterReceiver(this);\n } catch (IllegalArgumentException e) {\n mRemoteLogger.w(\"String_Node_Str\");\n }\n}\n"
|
"public void overrideSettings(final String... keyvalues) {\n super.overrideSettings(keyvalues);\n if (((mPopup1 == null) && (mPopup2 == null)) || mPopupStatus != POPUP_FIRST_LEVEL) {\n mPopupStatus = POPUP_FIRST_LEVEL;\n initializePopup();\n }\n ((MoreSettingPopup) mPopup).overrideSettings(keyvalues);\n}\n"
|
"public byte[] getStrong() {\n return (byte[]) strong.clone();\n}\n"
|
"public PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo) {\n PoolInfo poolInfo = null;\n JdbcResource jdbcResource = null;\n ResourceInfo actualResourceInfo = resourceInfo;\n String jndiName = resourceInfo.getName();\n ResourceInfo actualResourceInfo = new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());\n ConnectorRuntime runtime = ConnectorRuntime.getRuntime();\n jdbcResource = (JdbcResource) ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo), JdbcResource.class, actualResourceInfo.getName());\n if (jdbcResource == null) {\n String suffix = ConnectorsUtil.getValidSuffix(jndiName);\n if (suffix != null) {\n jndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix));\n actualResourceInfo = new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());\n }\n }\n jdbcResource = (JdbcResource) ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo), JdbcResource.class, actualResourceInfo.getName());\n if (jdbcResource != null) {\n if (logger.isLoggable(Level.FINE)) {\n logger.fine(\"String_Node_Str\" + jdbcResource.getJndiName());\n logger.fine(\"String_Node_Str\" + jdbcResource.getPoolName());\n }\n }\n if (jdbcResource != null) {\n poolInfo = new PoolInfo(jdbcResource.getPoolName(), actualResourceInfo.getApplicationName(), actualResourceInfo.getModuleName());\n }\n return poolInfo;\n}\n"
|
"private void buildHeader(StringBuffer html, String packageName) {\n logger.entering(\"String_Node_Str\", \"String_Node_Str\", html);\n String relPath = \"String_Node_Str\";\n if (currentPackageName != null) {\n String[] folders = currentPackageName.split(\"String_Node_Str\");\n for (String folder : folders) {\n relPath = relPath + \"String_Node_Str\";\n }\n }\n html.append(HtmlUtils.getAnchorTag(null, str + \"String_Node_Str\", null, \"String_Node_Str\") + Constants.NBSP_TWICE);\n html.append(HtmlUtils.getAnchorTag(null, \"String_Node_Str\", null, \"String_Node_Str\") + Constants.NBSP_TWICE);\n html.append(HtmlUtils.getAnchorTag(null, \"String_Node_Str\", null, \"String_Node_Str\"));\n html.append(Constants.HTML_HR);\n html.append(HtmlUtils.getAnchorTag(\"String_Node_Str\", null, null, null));\n html.append(getTableTagWithStyle(\"String_Node_Str\"));\n html.append(getTableRowTagWithStyle(\"String_Node_Str\"));\n html.append(getTableDataTagWithStyle(\"String_Node_Str\"));\n html.append(\"String_Node_Str\");\n html.append(HtmlUtils.getAnchorTag(null, \"String_Node_Str\" + Constants.OPERATION_SUMMARY_HREF, Constants.OPERATIONS_LABEL, Constants.OPERATIONS_LABEL));\n html.append(Constants.HTML_TABLE_TD_END);\n html.append(getTableDataTagWithStyle(\"String_Node_Str\"));\n html.append(\"String_Node_Str\");\n html.append(HtmlUtils.getAnchorTag(null, \"String_Node_Str\" + Constants.OPERATIONS_DETAIL_HREF, Constants.OPERATIONS_LABEL, Constants.OPERATIONS_LABEL));\n html.append(Constants.HTML_TABLE_TD_END);\n html.append(Constants.HTML_TABLE_TR_END);\n html.append(Constants.HTML_TABLE_END);\n html.append(Constants.HTML_HR);\n logger.exiting(\"String_Node_Str\", \"String_Node_Str\", html);\n}\n"
|
"void close() {\n if (query != null) {\n try {\n this.resultset.close();\n } catch (SQLException e) {\n logger.log(Level.FINER, e.getMessage(), e);\n this.resultset = null;\n }\n }\n if (this.statement != null) {\n try {\n this.statement.close();\n } catch (SQLException e) {\n logger.log(Level.FINER, e.getMessage(), e);\n this.statement = null;\n }\n }\n}\n"
|
"public static void cleanUpArray() {\n try {\n synchronized (detectableEntities) {\n Iterator<TileEntity> it = detectableTileEntities.iterator();\n while (it.hasNext()) {\n TileEntity tileEntity = it.next();\n if (tileEntity == null) {\n it.remove();\n } else if (tileEntity.isInvalid()) {\n it.remove();\n } else if (tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) != tileEntity) {\n it.remove();\n }\n }\n }\n Iterator<Entity> it2 = detectableEntities.iterator();\n while (it2.hasNext()) {\n Entity entity = it2.next();\n if (entity == null) {\n it2.remove();\n } else if (entity.isDead) {\n it2.remove();\n }\n }\n } catch (Exception e) {\n System.out.println(\"String_Node_Str\");\n e.printStackTrace();\n }\n}\n"
|
"private void fireProjectile(World world, EntityPlayer player, ItemStack stack, NBTTagCompound nbt, Vec3d look) {\n if (Rune.getRune(nbt) == Rune.FIREBALL) {\n EntityFireball fireball = new EntityFireball(world, look.x, look.y, look.z, 1F, 0F, player, stack, 2);\n fireball.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(fireball);\n } else if (Rune.getRune(nbt) == Rune.ICEBOLT) {\n EntityIcebolt icebolt = new EntityIcebolt(world, look.x, look.y, look.z, 1F, 0F, player, stack, 2);\n icebolt.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(icebolt);\n } else if (Rune.getRune(nbt) == Rune.LIGHTNING) {\n EntityLightning lightning = new EntityLightning(world, look.x, look.y, look.z, 1F, 0F, player, stack, 2);\n lightning.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(lightning);\n } else if (Rune.getRune(nbt) == Rune.FIRESTORM) {\n for (int i = 0; i < 4; i++) {\n EntityFireball fireball = new EntityFireball(world, look.x, look.y, look.z, 1F, 15F, player, stack, 2);\n fireball.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(fireball);\n }\n } else if (Rune.getRune(nbt) == Rune.BLIZZARD) {\n for (int i = 0; i < 4; i++) {\n EntityIcebolt icebolt = new EntityIcebolt(world, look.x, look.y, look.z, 1F, 15F, player, stack, 2);\n icebolt.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(icebolt);\n }\n } else if (Rune.getRune(nbt) == Rune.DISCHARGE) {\n for (int i = 0; i < 4; i++) {\n EntityLightning lightning = new EntityLightning(world, look.x, look.y, look.z, 1F, 0F, player, stack, 2);\n lightning.setPosition(player.posX + look.x, player.posY + look.y + 1.5, player.posZ + look.z);\n world.spawnEntity(lightning);\n }\n }\n}\n"
|
"public void testSlowSinkRoll() throws IOException, InterruptedException {\n final File f = FileUtil.mktempdir();\n RollSink snk = new RollSink(new Context(), \"String_Node_Str\", 2000, 250) {\n protected EventSink newSink(Context ctx) throws IOException {\n return new EscapedCustomDfsSink(ctx, \"String_Node_Str\" + f.getPath(), \"String_Node_Str\") {\n public void append(final Event e) throws IOException, InterruptedException {\n super.append(e);\n Clock.sleep(1500);\n }\n };\n }\n };\n DummySource source = new DummySource(4);\n DirectDriver driver = new DirectDriver(source, snk);\n driver.start();\n Clock.sleep(6000);\n driver.stop();\n assertTrue(snk.getMetrics().getLongMetric(RollSink.A_ROLL_ABORTED_APPENDS) > Long.valueOf(0));\n}\n"
|
"public void onPlayerInteract(PlayerInteractEvent event) {\n if (event.getAction() == Action.LEFT_CLICK_BLOCK) {\n Player p = event.getPlayer();\n ItemStack item = p.getItemInHand();\n if (item.getType() == Material.BOW) {\n Material id = event.getClickedBlock().getType();\n Material id2 = event.getClickedBlock().getRelative(0, 1, 0).getType();\n EnumBowMaterial bm = null;\n if (id == Material.WOOD || id == Material.LOG) {\n bm = EnumBowMaterial.STANDARD;\n }\n if (id == Material.SNOW || id == Material.ICE) {\n bm = EnumBowMaterial.ICE;\n }\n if (id2 == Material.FIRE) {\n bm = EnumBowMaterial.FIRE;\n }\n if (id == Material.TNT) {\n bm = EnumBowMaterial.TNT;\n }\n if (id == Material.REDSTONE_ORE) {\n bm = EnumBowMaterial.THUNDER;\n }\n if (id == Material.MOB_SPAWNER) {\n bm = EnumBowMaterial.MONSTER;\n }\n if (id == Material.DISPENSER) {\n bm = EnumBowMaterial.THRICE;\n }\n if (id == Material.LAPIS_BLOCK) {\n bm = EnumBowMaterial.ZOMBIE;\n }\n if (bm != null) {\n if (bm.getDataValue() == EnumBowMaterial.fromData(item.getDurability()).getDataValue()) {\n return;\n }\n item.setDurability(bm.getDataValue());\n p.sendMessage(ChatColor.DARK_GREEN + \"String_Node_Str\" + ChatColor.YELLOW + bm.getName() + ChatColor.DARK_GREEN + \"String_Node_Str\");\n }\n }\n }\n if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {\n Player p = event.getPlayer();\n ItemStack item = p.getItemInHand();\n if (item.getType() == Material.BOW) {\n event.setUseInteractedBlock(Result.DENY);\n event.setCancelled(true);\n EnumBowMaterial material = EnumBowMaterial.fromData(item.getDurability());\n if (!Archers.Permissions.has(p, \"String_Node_Str\" + material.getName().toLowerCase())) {\n return;\n }\n int has = 0;\n for (ItemStack stack : Properties.ArrowAmmo.get(material.getDataValue())) {\n int amount = 0;\n for (int i = 0; i < p.getInventory().getContents().length; i++) {\n if (p.getInventory().getContents()[i] == null) {\n continue;\n }\n if (p.getInventory().getContents()[i].getTypeId() == stack.getTypeId()) {\n amount += p.getInventory().getContents()[i].getAmount();\n }\n if (amount >= stack.getAmount()) {\n ++has;\n break;\n }\n }\n }\n if (has != Properties.ArrowAmmo.get(material.getDataValue()).size())\n return;\n Arrow arrow = new Arrow(p.getWorld(), p, material);\n ArrowHandler.onArrowCreate(p, arrow);\n for (ItemStack stack : Properties.ArrowAmmo.get(material.getDataValue())) {\n CraftUpdate.removeItem(p, stack);\n }\n }\n }\n}\n"
|
"public void listChanged(ListEvent<E> listChanges) {\n final Barcode toDoList = new Barcode();\n toDoList.addWhite(0, barcode.size());\n final LinkedList removedValues = new LinkedList();\n int lastFakedUniqueChangeIndex = -1;\n while (listChanges.next()) {\n final int changeIndex = listChanges.getIndex();\n final int changeType = listChanges.getType();\n if (changeType == ListEvent.INSERT) {\n barcode.add(changeIndex, UNIQUE, 1);\n toDoList.add(changeIndex, TODO, 1);\n } else if (changeType == ListEvent.UPDATE) {\n if (barcode.get(changeIndex) == UNIQUE) {\n if (changeIndex + 1 < barcode.size() && barcode.get(changeIndex + 1) == DUPLICATE && (changeIndex == 0 || !uniqueElementAddedToLeftInSameGroup(toDoList, changeIndex))) {\n if (changeIndex != lastFakedUniqueChangeIndex) {\n barcode.set(changeIndex, UNIQUE, 2);\n toDoList.set(changeIndex, TODO, 1);\n lastFakedUniqueChangeIndex = changeIndex + 1;\n }\n }\n }\n } else if (changeType == ListEvent.DELETE) {\n Object deleted = barcode.get(changeIndex);\n barcode.remove(changeIndex, 1);\n toDoList.remove(changeIndex, 1);\n if (deleted == UNIQUE) {\n if (changeIndex < barcode.size() && barcode.get(changeIndex) == DUPLICATE) {\n barcode.set(changeIndex, UNIQUE, 1);\n deleted = UNIQUE_WITH_DUPLICATE;\n }\n }\n removedValues.addLast(deleted);\n }\n }\n TryJoinResult<E> tryJoinResult = new TryJoinResult<E>();\n listChanges.reset();\n while (listChanges.next()) {\n final int changeIndex = listChanges.getIndex();\n final int changeType = listChanges.getType();\n E newValue = listChanges.getNewValue();\n E oldValue = listChanges.getOldValue();\n if (changeType == ListEvent.INSERT) {\n tryJoinExistingGroup(changeIndex, toDoList, tryJoinResult);\n if (tryJoinResult.group == NO_GROUP) {\n client.groupChanged(changeIndex, tryJoinResult.groupIndex, ListEvent.INSERT, true, changeType, ListEvent.<E>unknownValue(), tryJoinResult.newFirstInGroup);\n } else {\n client.groupChanged(changeIndex, tryJoinResult.groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n }\n } else if (changeType == ListEvent.UPDATE) {\n int oldGroup = 0;\n if (toDoList.get(changeIndex) == TODO) {\n if (changeIndex + 1 < barcode.size()) {\n oldGroup = RIGHT_GROUP;\n } else {\n oldGroup = NO_GROUP;\n }\n } else if (barcode.get(changeIndex) == DUPLICATE)\n oldGroup = LEFT_GROUP;\n else if (barcode.get(changeIndex) == UNIQUE)\n oldGroup = NO_GROUP;\n tryJoinExistingGroup(changeIndex, toDoList, tryJoinResult);\n int successor = changeIndex + 1;\n if (tryJoinResult.group == LEFT_GROUP) {\n if (successor < barcode.size() && barcode.get(successor) == UNIQUE && toDoList.get(successor) == DONE && groupTogether(changeIndex, successor)) {\n barcode.set(successor, DUPLICATE, 1);\n oldGroup = NO_GROUP;\n }\n } else if (tryJoinResult.group == NO_GROUP) {\n if (successor < barcode.size() && barcode.get(successor) == DUPLICATE) {\n barcode.set(successor, UNIQUE, 1);\n oldGroup = RIGHT_GROUP;\n }\n }\n int groupIndex = tryJoinResult.groupIndex;\n if (tryJoinResult.group == NO_GROUP) {\n if (oldGroup == NO_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, oldValue, tryJoinResult.newFirstInGroup);\n } else if (oldGroup == LEFT_GROUP) {\n E firstFromPreviousGroup = sortedList.get(barcode.getIndex(groupIndex - 1, UNIQUE));\n client.groupChanged(changeIndex, groupIndex - 1, ListEvent.UPDATE, false, changeType, firstFromPreviousGroup, firstFromPreviousGroup);\n client.groupChanged(changeIndex, groupIndex, ListEvent.INSERT, true, changeType, ListEvent.<E>unknownValue(), tryJoinResult.newFirstInGroup);\n } else if (oldGroup == RIGHT_GROUP) {\n E firstFromNextGroup = sortedList.get(barcode.getIndex(groupIndex + 1, UNIQUE));\n client.groupChanged(changeIndex, groupIndex, ListEvent.INSERT, true, changeType, ListEvent.<E>unknownValue(), tryJoinResult.newFirstInGroup);\n client.groupChanged(changeIndex, groupIndex + 1, ListEvent.UPDATE, false, changeType, oldValue, firstFromNextGroup);\n }\n } else if (tryJoinResult.group == LEFT_GROUP) {\n if (oldGroup == NO_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n client.groupChanged(changeIndex, groupIndex + 1, ListEvent.DELETE, false, changeType, oldValue, ListEvent.<E>unknownValue());\n } else if (oldGroup == LEFT_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n } else if (oldGroup == RIGHT_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n if (groupIndex + 1 < barcode.blackSize()) {\n E firstFromNextGroup = sortedList.get(barcode.getIndex(groupIndex + 1, UNIQUE));\n client.groupChanged(changeIndex, groupIndex + 1, ListEvent.UPDATE, false, changeType, oldValue, firstFromNextGroup);\n }\n }\n } else if (tryJoinResult.group == RIGHT_GROUP) {\n if (oldGroup == NO_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.DELETE, false, changeType, oldValue, ListEvent.<E>unknownValue());\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n } else if (oldGroup == LEFT_GROUP) {\n if (groupIndex - 1 >= 0) {\n E firstFromPreviousGroup = sortedList.get(barcode.getIndex(groupIndex - 1, UNIQUE));\n client.groupChanged(changeIndex, groupIndex - 1, ListEvent.UPDATE, false, changeType, firstFromPreviousGroup, firstFromPreviousGroup);\n }\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n } else if (oldGroup == RIGHT_GROUP) {\n client.groupChanged(changeIndex, groupIndex, ListEvent.UPDATE, true, changeType, tryJoinResult.oldFirstInGroup, tryJoinResult.newFirstInGroup);\n }\n }\n } else if (changeType == ListEvent.DELETE) {\n final Object deleted = removedValues.removeFirst();\n final int sourceDeletedIndex = deleted == DUPLICATE ? changeIndex - 1 : changeIndex;\n final int groupDeletedIndex = sourceDeletedIndex < barcode.size() ? barcode.getBlackIndex(sourceDeletedIndex, true) : barcode.blackSize();\n if (deleted == UNIQUE) {\n if (changeIndex == lastFakedUniqueChangeIndex) {\n } else {\n client.groupChanged(changeIndex, groupDeletedIndex, ListEvent.DELETE, true, changeType, oldValue, ListEvent.<E>unknownValue());\n }\n } else {\n E oldValueInGroup;\n E newValueInGroup;\n if (groupDeletedIndex < barcode.blackSize()) {\n int firstInGroupIndex = barcode.getIndex(groupDeletedIndex, UNIQUE);\n newValueInGroup = sortedList.get(firstInGroupIndex);\n } else {\n newValueInGroup = ListEvent.<E>unknownValue();\n }\n if (deleted == UNIQUE_WITH_DUPLICATE) {\n oldValueInGroup = oldValue;\n } else {\n oldValueInGroup = newValueInGroup;\n }\n client.groupChanged(changeIndex, groupDeletedIndex, ListEvent.UPDATE, true, changeType, oldValueInGroup, newValueInGroup);\n }\n }\n }\n}\n"
|
"public int startOp(int op) {\n return startOp(op, Process.myUid(), mContext.getOpPackageName());\n}\n"
|
"public Set<ActionSpec> getModuleActions() {\n Set<ActionSpec> actions = new HashSet<ActionSpec>();\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\"));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\", true));\n actions.add(new ActionSpec(\"String_Node_Str\"));\n return actions;\n}\n"
|
"public String getCountSql() {\n return countSql + \"String_Node_Str\" + getFilterCriteria(countSql);\n}\n"
|
"public void endTransaction(String databaseName, boolean success) {\n if (success) {\n getWritableDatabase(databaseName).setTransactionSuccessful();\n }\n getWritableDatabase(databaseName).endTransaction();\n postEndTransactionEvent(success, getDatabaseName(), tableNameChanges);\n}\n"
|
"protected void onDestroy() {\n mCalled = true;\n if (mManagedDialogs != null) {\n final int numDialogs = mManagedDialogs.size();\n for (int i = 0; i < numDialogs; i++) {\n final ManagedDialog md = mManagedDialogs.valueAt(i);\n if (md.mDialog.isShowing()) {\n md.mDialog.dismiss();\n }\n }\n mManagedDialogs = null;\n }\n synchronized (mManagedCursors) {\n int numCursors = mManagedCursors.size();\n for (int i = 0; i < numCursors; i++) {\n ManagedCursor c = mManagedCursors.get(i);\n if (c != null) {\n c.mCursor.close();\n }\n }\n }\n mManagedCursors.clear();\n}\n"
|
"public ODataContentWriteErrorCallback getODataContentWriteErrorCallback() {\n return odataContentWriteErrorCallback;\n}\n"
|
"public void resume() {\n ScanResponse localResp;\n int localNumberOfCompleteRows;\n synchronized (this) {\n if (state == ScanResumerState.INITIALIZED) {\n state = ScanResumerState.RESUMED;\n return;\n }\n if (state == ScanResumerState.RESUMED) {\n return;\n }\n state = ScanResumerState.RESUMED;\n if (leaseRenewer != null) {\n leaseRenewer.cancel();\n }\n localResp = this.resp;\n localNumberOfIndividualRows = this.numberOfIndividualRows;\n }\n completeOrNext(localResp, localNumberOfIndividualRows);\n}\n"
|
"public List<Music> searchSimilarTitle(String title) {\n return entityManager.createQuery(\"String_Node_Str\", Music.class).setParameter(\"String_Node_Str\", \"String_Node_Str\" + title + \"String_Node_Str\").getResultList();\n}\n"
|
"protected void drawPrimaryLineAsPath(XYItemRendererState state, Graphics2D g2, XYPlot plot, XYDataset dataset, int pass, int series, int item, ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea) {\n RectangleEdge xAxisLocation = plot.getDomainAxisEdge();\n RectangleEdge yAxisLocation = plot.getRangeAxisEdge();\n double x1 = dataset.getXValue(series, item);\n double y1 = dataset.getYValue(series, item);\n double transX1 = domainAxis.valueToJava2D(x1, dataArea, xAxisLocation);\n double transY1 = rangeAxis.valueToJava2D(y1, dataArea, yAxisLocation);\n if (!Double.isNaN(transX1) && !Double.isNaN(transY1)) {\n ControlPoint p = new ControlPoint(plot.getOrientation() == PlotOrientation.HORIZONTAL ? (float) transY1 : (float) transX1, plot.getOrientation() == PlotOrientation.HORIZONTAL ? (float) transX1 : (float) transY1);\n if (!this.points.contains(p)) {\n this.points.add(p);\n }\n }\n if (item == dataset.getItemCount(series) - 1) {\n State s = (State) state;\n if (this.points.size() > 1) {\n ControlPoint cp0 = this.points.get(0);\n s.seriesPath.moveTo(cp0.x, cp0.y);\n if (this.points.size() == 2) {\n ControlPoint cp1 = (ControlPoint) this.points.get(1);\n s.seriesPath.lineTo(cp1.x, cp1.y);\n } else {\n int np = this.points.size();\n float[] d = new float[np];\n float[] x = new float[np];\n float y;\n float t;\n float oldy = 0;\n float oldt = 0;\n float[] a = new float[np];\n float t1;\n float t2;\n float[] h = new float[np];\n for (int i = 0; i < np; i++) {\n ControlPoint cpi = (ControlPoint) this.points.get(i);\n x[i] = cpi.x;\n d[i] = cpi.y;\n }\n for (int i = 1; i <= np - 1; i++) {\n h[i] = x[i] - x[i - 1];\n }\n float[] sub = new float[np - 1];\n float[] diag = new float[np - 1];\n float[] sup = new float[np - 1];\n for (int i = 1; i <= np - 2; i++) {\n diag[i] = (h[i] + h[i + 1]) / 3;\n sup[i] = h[i + 1] / 6;\n sub[i] = h[i] / 6;\n a[i] = (d[i + 1] - d[i]) / h[i + 1] - (d[i] - d[i - 1]) / h[i];\n }\n solveTridiag(sub, diag, sup, a, np - 2);\n oldt = x[0];\n oldy = d[0];\n s.seriesPath.moveTo(oldt, oldy);\n for (int i = 1; i <= np - 1; i++) {\n for (int j = 1; j <= this.precision; j++) {\n t1 = (h[i] * j) / this.precision;\n t2 = h[i] - t1;\n y = ((-a[i - 1] / 6 * (t2 + h[i]) * t1 + d[i - 1]) * t2 + (-a[i] / 6 * (t1 + h[i]) * t2 + d[i]) * t1) / h[i];\n t = x[i - 1] + t1;\n s.seriesPath.lineTo(t, y);\n }\n }\n }\n drawFirstPassShape(g2, pass, series, item, s.seriesPath);\n }\n this.points = new Vector();\n }\n}\n"
|
"public boolean act() {\n if (Dungeon.level.map[target.pos] == Terrain.GRASS) {\n Dungeon.level.set(target.pos, Terrain.EMBERS);\n GameScene.updateMap(target.pos);\n }\n spend(TICK);\n left -= TICK;\n if (left <= 0) {\n detach();\n }\n return true;\n}\n"
|
"private double asRelativeValue(final InformationLoss infoLoss) {\n double min = result.getLattice().getBottom().getMinimumInformationLoss().getValue();\n double max = result.getLattice().getTop().getMaximumInformationLoss().getValue();\n return ((infoLoss.getValue() - min) / (max - min)) * 100d;\n}\n"
|
"public void onParserDone(List<Network> networkList) {\n for (Network network : networkList) {\n if (DBG) {\n Log.v(TAG, \"String_Node_Str\" + network.getSsid());\n Log.v(TAG, \"String_Node_Str\" + network.getPassword());\n }\n if (network.getSsid().equals(ssid)) {\n getDialog(context, ssid, network.getPassword()).show();\n break;\n }\n }\n}\n"
|
"private void notifyScreenshotError() {\n final ComponentName errorComponent = new ComponentName(SYSUI_PACKAGE, SYSUI_SCREENSHOT_ERROR_RECEIVER);\n Intent errorIntent = new Intent(Intent.ACTION_USER_PRESENT);\n errorIntent.setComponent(errorComponent);\n errorIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);\n mContext.sendBroadcastAsUser(errorIntent, UserHandle.CURRENT);\n}\n"
|
"protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException {\n final ServiceRegistry serviceRegistry = context.getServiceRegistry(false);\n final ServiceController<Logger> controller = (ServiceController<Logger>) serviceRegistry.getService(LogServices.ROOT_LOGGER);\n final ModelNode level = LEVEL.validateResolvedOperation(model.get(ROOT_LOGGER));\n if (controller != null && level.isDefined()) {\n controller.getValue().setLevel(Level.parse(level.asString()));\n }\n}\n"
|
"public void controllerUpdate(ControllerEvent event) {\n controllerUpdateForPreview(event, videoContainer, locator, listener);\n}\n"
|
"public Response removeCartridge(String cartridgeType) throws RestAPIException {\n try {\n StratosApiV41Utils.removeCartridge(cartridgeType);\n return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS, String.format(\"String_Node_Str\", cartridgeType))).build();\n } catch (Exception e) {\n return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean(ResponseMessageBean.ERROR, e.getMessage())).build();\n }\n}\n"
|
"public void setDynamicProperty(String name, Object value) throws WrongValueException {\n if (name == null)\n throw new WrongValueException(\"String_Node_Str\");\n if (!hasDynamicProperty(name))\n throw new WrongValueException(\"String_Node_Str\" + name + \"String_Node_Str\");\n String sval = Objects.toString(value);\n if (\"String_Node_Str\".equals(name)) {\n sval = filterStyle(sval);\n setDynaProp(name, sval);\n } else if (\"String_Node_Str\".equals(name)) {\n EncodedURL url = new EncodedURL(sval);\n setDynaProp(name, url);\n smartUpdate(\"String_Node_Str\", new Object[] { name, url }, true);\n return;\n } else if (\"String_Node_Str\".equals(name)) {\n setDynaProp(name, sval);\n if (!getChildren().isEmpty())\n invalidate();\n } else\n setDynaProp(name, value);\n smartUpdate(\"String_Node_Str\", new String[] { name, sval }, true);\n}\n"
|
"public void onValueChange(ValueChangeEvent<IndexedAIP> event) {\n final IndexedAIP parentAIP = event.getValue();\n final String parentId = (parentAIP != null) ? parentAIP.getId() : null;\n Dialogs.showPromptDialog(messages.outcomeDetailTitle(), null, null, messages.outcomeDetailPlaceholder(), RegExp.compile(\"String_Node_Str\"), messages.cancelButton(), messages.confirmButton(), false, new AsyncCallback<String>() {\n\n public void onFailure(Throwable caught) {\n }\n public void onSuccess(String details) {\n BrowserService.Util.getInstance().moveAIPInHierarchy(selected, parentId, details, new LoadingAsyncCallback<IndexedAIP>() {\n public void onSuccessImpl(IndexedAIP result) {\n Toast.showInfo(messages.runningInBackgroundTitle(), messages.runningInBackgroundDescription());\n if (result != null) {\n HistoryUtils.newHistory(BrowseAIP.RESOLVER, result.getId());\n } else {\n HistoryUtils.newHistory(BrowseAIP.RESOLVER);\n }\n callback.onSuccess(ActionImpact.UPDATED);\n }\n public void onFailureImpl(Throwable caught) {\n if (caught instanceof NotFoundException) {\n Toast.showError(messages.moveNoSuchObject(caught.getMessage()));\n } else {\n callback.onFailure(caught);\n }\n }\n });\n }\n });\n}\n"
|
"public void doTask() {\n if (x == z) {\n if (x.allocationMode() == DataBuffer.AllocationMode.HEAP) {\n Nd4j.getBlasWrapper().level1().axpy(n, 1.0, y, offsetY, incrY, x, offsetX, incrX);\n } else {\n ByteBuf nbbx = x.asNetty();\n ByteBuf nbby = y.asNetty();\n if (x.dataType() == DataBuffer.Type.FLOAT) {\n int byteOffsetX = 4 * offsetX;\n int byteOffsetY = 4 * offsetY;\n if (incrX == 1 && incrY == 1 && incrZ == 1) {\n for (int i = 0; i < 4 * n; i += 4) {\n int ox = byteOffsetX + i;\n nbbx.setFloat(ox, nbbx.getFloat(ox) + nbby.getFloat(byteOffsetY + i));\n }\n } else {\n for (int i = 0; i < 4 * n; i += 4) {\n int ox = byteOffsetX + i * incrX;\n nbbx.setFloat(ox, nbbx.getFloat(ox) + nbby.getFloat(byteOffsetY + i * incrY));\n }\n }\n } else {\n int byteOffsetX = 8 * offsetX;\n int byteOffsetY = 8 * offsetY;\n if (incrX == 1 && incrY == 1) {\n for (int i = 0; i < 8 * n; i += 8) {\n int ox = byteOffsetX + i;\n nbbx.setDouble(ox, nbbx.getDouble(ox) + nbby.getDouble(byteOffsetY + i));\n }\n } else {\n for (int i = 0; i < 8 * n; i += 8) {\n int ox = byteOffsetX + i * incrX;\n nbbx.setDouble(ox, nbbx.getDouble(ox) + nbby.getDouble(byteOffsetY + i * incrY));\n }\n }\n }\n }\n } else {\n if (x.allocationMode() == DataBuffer.AllocationMode.HEAP) {\n if (x.dataType() == DataBuffer.Type.FLOAT) {\n float[] xf = (float[]) x.array();\n float[] yf = (float[]) y.array();\n float[] zf = (float[]) z.array();\n if (incrX == 1 && incrY == 1 && incrZ == 1) {\n for (int i = 0; i < n; i++) {\n zf[offsetZ + i] = xf[offsetX + i] + yf[offsetY + i];\n }\n } else {\n for (int i = 0; i < n; i++) {\n zf[offsetZ + i * incrZ] = xf[offsetX + i * incrX] + yf[offsetY + i * incrY];\n }\n }\n } else {\n double[] xd = (double[]) x.array();\n double[] yd = (double[]) y.array();\n double[] zd = (double[]) z.array();\n if (incrX == 1 && incrY == 1 && incrZ == 1) {\n for (int i = 0; i < n; i++) {\n zd[offsetZ + i] = xd[offsetX + i] + yd[offsetY + i];\n }\n } else {\n for (int i = 0; i < n; i++) {\n zd[offsetZ + i * incrZ] = xd[offsetX + i * incrX] + yd[offsetY + i * incrY];\n }\n }\n }\n } else {\n ByteBuf nbbx = x.asNetty();\n ByteBuf nbby = y.asNetty();\n ByteBuf nbbz = z.asNetty();\n if (x.dataType() == DataBuffer.Type.FLOAT) {\n int byteOffsetX = 4 * offsetX;\n int byteOffsetY = 4 * offsetY;\n int byteOffsetZ = 4 * offsetZ;\n if (incrX == 1 && incrY == 1 && incrZ == 1) {\n for (int i = 0; i < 4 * n; i += 4) {\n nbbz.setFloat(byteOffsetZ + i, nbbx.getFloat(byteOffsetX + i) + nbby.getFloat(byteOffsetY + i));\n }\n } else {\n for (int i = 0; i < 4 * n; i += 4) {\n nbbz.setFloat(byteOffsetZ + i * incrZ, x.getFloat(byteOffsetX + i * incrX) + y.getFloat(byteOffsetY + i * incrY));\n }\n }\n } else {\n int byteOffsetX = 8 * offsetX;\n int byteOffsetY = 8 * offsetY;\n int byteOffsetZ = 8 * offsetZ;\n if (incrX == 1 && incrY == 1 && incrZ == 1) {\n for (int i = 0; i < 8 * n; i += 8) {\n nbbz.setDouble(byteOffsetZ + i, nbbx.getDouble(byteOffsetX + i) + nbby.getDouble(byteOffsetY + i));\n }\n } else {\n for (int i = 0; i < 8 * n; i += 8) {\n nbbz.setDouble(byteOffsetZ + i * incrZ, nbbx.getDouble(byteOffsetX + i * incrX) + nbby.getDouble(byteOffsetY + i * incrY));\n }\n }\n }\n }\n }\n}\n"
|
"public void indexObject(String key, String type, JSONObject jo) throws Exception {\n Document doc = new Document();\n doc.add(new Field(TYPE_FIELD, type, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));\n doc.add(new Field(KEY_FIELD, key, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));\n if (null != jo && null != JSONObject.getNames(jo)) {\n for (String k : JSONObject.getNames(jo)) {\n doc.add(new Field(k, jo.getString(k), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));\n }\n }\n indexWriter.updateDocument(new Term(KEY_FIELD, key), doc);\n refreshGraphIndex();\n}\n"
|
"public CompletableFuture<List<String>> redefineClasses() {\n return CompletableFuture.supplyAsync(() -> {\n List<String> classNames = new ArrayList<>();\n synchronized (this) {\n classNames.addAll(deltaClassNames);\n doHotCodeReplace(deltaResources, deltaClassNames);\n deltaResources.clear();\n deltaClassNames.clear();\n }\n return classNames;\n });\n}\n"
|
"private ClassWriter.Element[] makeMethodAttributes(int m, ClassWriter w, CodeReader oldCode, Compiler.Output output, MethodData md) throws InvalidClassFileException {\n CodeWriter code = makeNewCode(w, output);\n int codeAttrCount = 0;\n LineNumberTableWriter lines = null;\n LocalVariableTableWriter locals = null;\n StackMapTableWriter stacks = null;\n if (oldCode != null) {\n lines = makeNewLines(w, oldCode, output);\n if (lines != null) {\n codeAttrCount++;\n }\n locals = makeNewLocals(w, oldCode, output);\n if (locals != null) {\n codeAttrCount++;\n }\n if (oldCode.getClassReader().getMajorVersion() > 50) {\n try {\n List<StackMapFrame> sm = StackMapTableReader.readStackMap(oldCode);\n String[][] varTypes = null;\n int[] newToOld = output.getNewBytecodesToOldBytecodes();\n int[][] vars = LocalVariableTableReader.makeVarMap(oldCode);\n if (vars != null) {\n varTypes = new String[newToOld.length][];\n for (int i = 0; i < newToOld.length; i++) {\n int idx = newToOld[i];\n if (idx != -1 && vars[idx] != null) {\n varTypes[i] = new String[vars[idx].length / 2];\n for (int j = 1; j < vars[idx].length; j += 2) {\n int type = vars[idx][j];\n varTypes[i][j / 2] = type == 0 ? null : oldCode.getClassReader().getCP().getCPUtf8(type);\n }\n }\n }\n }\n stacks = new StackMapTableWriter(w, md, output, cha, varTypes);\n codeAttrCount++;\n } catch (IOException | FailureException e) {\n e.printStackTrace();\n }\n }\n }\n ClassWriter.Element[] codeAttributes = new ClassWriter.Element[codeAttrCount];\n int codeAttrIndex = 0;\n if (lines != null) {\n codeAttributes[codeAttrIndex++] = lines;\n }\n if (locals != null) {\n codeAttributes[codeAttrIndex++] = locals;\n }\n if (stacks != null) {\n codeAttributes[codeAttrIndex++] = stacks;\n }\n code.setAttributes(codeAttributes);\n ClassReader.AttrIterator iter = new ClassReader.AttrIterator();\n cr.initMethodAttributeIterator(m, iter);\n int methodAttrCount = iter.getRemainingAttributesCount();\n if (oldCode == null) {\n methodAttrCount++;\n }\n ClassWriter.Element[] methodAttributes = new ClassWriter.Element[methodAttrCount];\n for (int i = 0; iter.isValid(); iter.advance()) {\n if (iter.getName().equals(\"String_Node_Str\")) {\n methodAttributes[i] = code;\n code = null;\n if (oldCode == null) {\n throw new Error(\"String_Node_Str\");\n }\n } else {\n methodAttributes[i] = new ClassWriter.RawElement(cr.getBytes(), iter.getRawOffset(), iter.getRawSize());\n }\n i++;\n }\n if (oldCode == null) {\n if (code == null) {\n throw new Error(\"String_Node_Str\");\n }\n methodAttributes[methodAttrCount - 1] = code;\n }\n return methodAttributes;\n}\n"
|
"public String getSigningProfile() {\n if (model.getProfiles() != null && model.getProfiles().getProfile() != null) {\n for (Profile profile : model.getProfiles().getProfile()) {\n List<Plugin> plugin = profile.getBuild().getPlugins().getPlugin();\n for (Plugin plugin2 : plugin) {\n List<PluginExecution> execution = plugin2.getExecutions().getExecution();\n return getSigningProfilePlugin(profile, execution);\n }\n }\n }\n return \"String_Node_Str\";\n}\n"
|
"protected void doPrepareQuery(Report report, Map appContext) {\n this.appContext = appContext;\n List queries = report.getQueries();\n int queriesSize = queries.size();\n IDataQueryDefinition[] queryArray = new IDataQueryDefinition[queriesSize];\n for (int index = 0; index < queriesSize; index++) {\n queryArray[index] = (IDataQueryDefinition) queries.get(index);\n }\n try {\n this.dteSession.registerQueries(queryArray);\n } catch (AdapterException ae) {\n logger.log(Level.SEVERE, ae.getMessage(), ae);\n context.addException(report.getReportDesign(), ae);\n }\n for (int index = 0; index < queriesSize; index++) {\n try {\n IBasePreparedQuery preparedQuery = dteSession.prepare(query, appContext);\n queryMap.put(query, preparedQuery);\n } catch (BirtException e) {\n logger.log(Level.SEVERE, e.getMessage(), e);\n context.addException(report.getReportDesign(), e);\n }\n }\n}\n"
|
"public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || this.getClass() != o.getClass()) {\n return false;\n }\n MapMessage that = (MapMessage) o;\n return this.data.equals(that.data);\n}\n"
|
"public void run() {\n _native.deleteShortcut();\n _native.setEnabled(false);\n if (callback != null) {\n _native.removeActionListener(callback);\n callback = null;\n }\n parent._native.remove(_native);\n _native.removeNotify();\n}\n"
|
"public void onPlayerQuit(PlayerEvent event) {\n Player player = event.getPlayer();\n Messages.SendMessage(\"String_Node_Str\", player, null);\n try {\n if (this.plugin.IdleTask(\"String_Node_Str\", player, \"String_Node_Str\")) {\n int TaskID = Integer.parseInt(this.plugin.IdleGetTaskID(player));\n if (Config.debug_enable)\n Util.Debug(player.getName() + \"String_Node_Str\" + TaskID);\n if (this.plugin.IdleTask(\"String_Node_Str\", player, \"String_Node_Str\")) {\n if (Config.debug_enable)\n Util.Debug(player.getName() + \"String_Node_Str\");\n plugin.getServer().getScheduler().cancelTask(TaskID);\n } else {\n if (Config.debug_enable)\n Util.Debug(\"String_Node_Str\" + player.getName() + \"String_Node_Str\");\n }\n } else {\n if (Config.debug_enable)\n Util.Debug(\"String_Node_Str\" + player.getName() + \"String_Node_Str\");\n }\n this.plugin.updateDb();\n } catch (IOException e) {\n if (Config.debug_enable)\n Util.Debug(\"String_Node_Str\");\n e.printStackTrace();\n }\n this.plugin.unauthorize(player.getEntityId());\n}\n"
|
"private void sendEclipseHelp(ID roomID, String target, String searchString) {\n searchString = searchString.replace(' ', '+');\n sendMessage(roomID, (target != null ? target + \"String_Node_Str\" : \"String_Node_Str\") + NLS.bind(CustomMessages.getString(CustomMessages.EclipseHelp), searchString));\n}\n"
|
"public void requestCallBack(int tag, ArrayList<MatjiData> data) {\n switch(tag) {\n case HttpRequestManager.AUTHORIZE:\n Me me = (Me) data.get(0);\n saveMe(me);\n if (mLoginableRef != null && mLoginableRef.get() != null) {\n mLoginableRef.get().loginCompleted();\n postLogin();\n break;\n }\n}\n"
|
"public void bulkInstall(ActionRequest request, ActionResponse response) {\n Context context = request.getContext();\n Set<Map<String, Object>> apps = new HashSet<Map<String, Object>>();\n Collection<Map<String, Object>> appsSet = (Collection<Map<String, Object>>) context.get(\"String_Node_Str\");\n if (appsSet != null) {\n apps.addAll(appsSet);\n }\n Boolean importDemo = (Boolean) context.get(\"String_Node_Str\");\n String language = (String) context.get(\"String_Node_Str\");\n List<App> appList = new ArrayList<App>();\n for (Map<String, Object> appData : apps) {\n App app = appRepo.find(Long.parseLong(appData.get(\"String_Node_Str\").toString()));\n app = appService.updateLanguage(app, language);\n appList.add(app);\n }\n appService.bulkInstall(appList, importDemo, language);\n response.setFlash(I18n.get(IAppExceptionMessages.BULK_INSTALL_SUCCESS));\n response.setSignal(\"String_Node_Str\", true);\n}\n"
|
"public IndexableGraph get(String path) {\n String fullPath = path(path);\n File f = new File(fullPath);\n return new TinkerGraph(f.getAbsolutePath());\n}\n"
|
"public boolean attackEntityFrom(DamageSource damagesource, int i) {\n if (null != damagesource) {\n Entity entity = damagesource.getEntity();\n if (entity != null && entity == this.riddenByEntity) {\n return false;\n } else {\n return super.attackEntityFrom(damagesource, i);\n }\n } else {\n return super.attackEntityFrom(damagesource, i);\n }\n}\n"
|
"protected void okPressed() {\n try {\n if (handle == null) {\n MapRule rule = StructureFactory.createMapRule();\n rule.setProperty(HighlightRule.OPERATOR_MEMBER, DEUtil.resolveNull(getValueForOperator(operator.getText())));\n if (value1.isVisible()) {\n rule.setProperty(HighlightRule.VALUE1_MEMBER, DEUtil.resolveNull(value1.getText()));\n }\n if (value2.isVisible()) {\n rule.setProperty(HighlightRule.VALUE2_MEMBER, DEUtil.resolveNull(value2.getText()));\n }\n rule.setProperty(MapRule.DISPLAY_MEMBER, DEUtil.resolveNull(display.getText()));\n rule.setTestExpression(DEUtil.resolveNull(expression.getText()));\n handle = provider.doAddItem(rule, handleCount);\n } else {\n handle.setOperator(DEUtil.resolveNull(getValueForOperator(operator.getText())));\n handle.setValue1(DEUtil.resolveNull(value1.getText()));\n handle.setValue2(DEUtil.resolveNull(value2.getText()));\n handle.setDisplay(DEUtil.resolveNull(display.getText()));\n handle.setTestExpression(DEUtil.resolveNull(expression.getText()));\n }\n } catch (Exception e) {\n WidgetUtil.processError(getShell(), e);\n }\n super.okPressed();\n}\n"
|
"private boolean weaveAndDefineConceteAspects() {\n if (trace.isTraceEnabled())\n trace.enter(\"String_Node_Str\", this, concreteAspects);\n boolean success = true;\n for (Iterator iterator = concreteAspects.iterator(); iterator.hasNext(); ) {\n ConcreteAspectCodeGen gen = (ConcreteAspectCodeGen) iterator.next();\n String name = gen.getClassName();\n byte[] bytes = gen.getBytes();\n try {\n byte[] newBytes = weaveClass(name, bytes, true);\n this.generatedClassHandler.acceptClass(name, newBytes);\n } catch (IOException ex) {\n trace.error(\"String_Node_Str\", ex);\n error(\"String_Node_Str\" + name + \"String_Node_Str\", ex);\n }\n }\n if (trace.isTraceEnabled())\n trace.exit(\"String_Node_Str\", success);\n return success;\n}\n"
|
"private static <T extends EmpyreanMessage> T sendEmpyreanRequest(final ServiceConfiguration parent, final EmpyreanMessage msg) throws Throwable {\n ServiceConfiguration config = ServiceConfigurations.createEphemeral(Empyrean.INSTANCE, parent.getInetAddress());\n LOG.debug(\"String_Node_Str\" + msg.getClass().getSimpleName() + \"String_Node_Str\" + parent.getFullName());\n Throwable lastEx = null;\n try {\n T reply = (T) AsyncRequests.sendSync(config, msg);\n return reply;\n } catch (Throwable ex) {\n LOG.error(ex, ex);\n throw ex;\n }\n throw new ServiceRegistrationException(\"String_Node_Str\" + lastEx + \"String_Node_Str\" + BOOTSTRAP_REMOTE_RETRIES + \"String_Node_Str\" + config.getUri() + \"String_Node_Str\" + msg, lastEx);\n}\n"
|
"private String createToolTipText(INodePO node) {\n StringBuilder toolTip = new StringBuilder();\n final WorkingLanguageBP workLangBP = WorkingLanguageBP.getInstance();\n Locale locale = workLangBP.getWorkingLanguage();\n ITestSuitePO testSuite = UINodeBP.getTestSuiteOfNode(node);\n if (node != null && isNodeActive(node)) {\n if (testSuite != null) {\n IAUTMainPO aut = testSuite.getAut();\n if (node instanceof ITestSuitePO) {\n if (testSuite.getAut() != null && !workLangBP.isTestSuiteLanguage(locale, testSuite)) {\n toolTip.append(Constants.BULLET).append(Messages.TestDataDecoratorUnsupportedAUTLanguage);\n } else {\n checkNode(testSuite, aut, locale, toolTip);\n }\n } else if (node instanceof IExecTestCasePO) {\n checkNode((IExecTestCasePO) node, aut, locale, toolTip);\n } else if (node instanceof ICapPO) {\n ICapPO cap = (ICapPO) node;\n IExecTestCasePO execTC = (IExecTestCasePO) node.getParentNode().getParentNode();\n boolean overWrittenName = false;\n for (ICompNamesPairPO pair : execTC.getCompNamesPairs()) {\n if (pair.getFirstName().equals(cap.getComponentName()) && pair.getSecondName() != null && !pair.getSecondName().equals(cap.getComponentName())) {\n overWrittenName = true;\n break;\n }\n }\n checkNode(aut, locale, cap, toolTip, overWrittenName);\n }\n }\n if (node instanceof ITestJobPO) {\n if (!isTestJobGuiValid((ITestJobPO) node)) {\n addMessage(toolTip, Messages.TestDataDecoratorTestJobIncompl);\n }\n } else if (node instanceof IRefTestSuitePO) {\n if (!isRefTestSuiteGuiValid((IRefTestSuitePO) node)) {\n addMessage(toolTip, Messages.TestDataDecoratorRefTsIncompl);\n }\n }\n if (toolTip.length() == 0) {\n return super.getToolTipText(node);\n }\n }\n return toolTip.length() > 0 ? toolTip.toString() : null;\n}\n"
|
"private void createCube(TabularCubeHandle cubeHandle, CubeMaterializer cubeMaterializer, Map appContext) throws IOException, BirtException, DataException {\n boolean doPerfTuning = this.needCachedDataSetToEnhancePerformance(cubeHandle) && (appContext == null || (appContext != null && appContext.get(DataEngine.DATA_SET_CACHE_ROW_LIMIT) == null && appContext.get(DataEngine.MEMORY_DATA_SET_CACHE) == null));\n Map candidateAppContext = new HashMap();\n if (appContext != null)\n candidateAppContext.putAll(appContext);\n if (doPerfTuning) {\n candidateAppContext.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT, new Integer(-1));\n }\n List measureNames = new ArrayList();\n List measureGroups = cubeHandle.getContents(CubeHandle.MEASURE_GROUPS_PROP);\n for (int i = 0; i < measureGroups.size(); i++) {\n MeasureGroupHandle mgh = (MeasureGroupHandle) measureGroups.get(i);\n List measures = mgh.getContents(MeasureGroupHandle.MEASURES_PROP);\n for (int j = 0; j < measures.size(); j++) {\n MeasureHandle measure = (MeasureHandle) measures.get(j);\n measureNames.add(measure.getName());\n }\n }\n IDimension[] dimensions = populateDimensions(cubeMaterializer, cubeHandle, candidateAppContext);\n String[][] factTableKey = new String[dimensions.length][];\n String[][] dimensionKey = new String[dimensions.length][];\n for (int i = 0; i < dimensions.length; i++) {\n TabularDimensionHandle dim = (TabularDimensionHandle) cubeHandle.getDimension(dimensions[i].getName());\n TabularHierarchyHandle hier = (TabularHierarchyHandle) dim.getDefaultHierarchy();\n if (cubeHandle.getDataSet().equals(hier.getDataSet())) {\n String[] keyNames = dimensions[i].getHierarchy().getLevels()[dimensions[i].getHierarchy().getLevels().length - 1].getKeyNames();\n for (int j = 0; j < keyNames.length; j++) {\n keyNames[j] = dimensions[i].getName() + \"String_Node_Str\" + keyNames[j];\n }\n factTableKey[i] = keyNames;\n dimensionKey[i] = factTableKey[i];\n } else {\n Iterator it = cubeHandle.joinConditionsIterator();\n if (!it.hasNext())\n throw new AdapterException(ResourceConstants.MISSING_JOIN_CONDITION, dim.getName());\n boolean foundJoinCondition = false;\n while (it.hasNext()) {\n DimensionConditionHandle dimCondHandle = (DimensionConditionHandle) it.next();\n if (dimCondHandle.getHierarchy().equals(hier)) {\n Iterator conditionIt = dimCondHandle.getJoinConditions().iterator();\n List dimensionKeys = new ArrayList();\n List factTableKeys = new ArrayList();\n while (conditionIt.hasNext()) {\n foundJoinCondition = true;\n DimensionJoinConditionHandle joinCondition = (DimensionJoinConditionHandle) conditionIt.next();\n String levelName = joinCondition.getLevelName();\n if (levelName != null && isAttribute(dimensions[i], levelName, joinCondition.getHierarchyKey())) {\n dimensionKeys.add(OlapExpressionUtil.getAttributeColumnName(getLevelName(dimensions[i], levelName), joinCondition.getHierarchyKey()));\n } else {\n dimensionKeys.add(joinCondition.getHierarchyKey());\n }\n factTableKeys.add(OlapExpressionUtil.getQualifiedLevelName(dimensions[i].getName(), joinCondition.getCubeKey()));\n }\n factTableKey[i] = new String[factTableKeys.size()];\n dimensionKey[i] = new String[dimensionKeys.size()];\n for (int j = 0; j < dimensionKeys.size(); j++) {\n factTableKey[i][j] = factTableKeys.get(j).toString();\n dimensionKey[i][j] = dimensionKeys.get(j).toString();\n }\n }\n }\n if (!foundJoinCondition)\n throw new AdapterException(ResourceConstants.MISSING_JOIN_CONDITION, dim.getName());\n }\n }\n cubeMaterializer.createCube(cubeHandle.getQualifiedName(), factTableKey, dimensionKey, dimensions, new DataSetIterator(this, cubeHandle, candidateAppContext), this.toStringArray(measureNames), null);\n}\n"
|
"public void dragOver(DropTargetEvent event) {\n super.dragOver(event);\n doDropValidation(event, commonViewer);\n}\n"
|
"public void run() {\n if (CloudFoundryPlugin.getCallback() != null) {\n CloudFoundryPlugin.getCallback().stopApplicationConsole(appModule, server);\n CloudFoundryPlugin.getCallback().startApplicationConsole(server, appModule, instanceIndex);\n } else {\n CloudFoundryPlugin.logError(\"String_Node_Str\");\n }\n}\n"
|
"private void registerEvents() {\n registerEvent(new com.Acrobot.ChestShop.Plugins.ChestShop());\n registerPreShopCreationEvents();\n registerPreTransactionEvents();\n registerPostShopCreationEvents();\n registerPostTransactionEvents();\n registerEvent(new SignBreak());\n registerEvent(new SignCreate());\n registerEvent(new ChestBreak());\n registerEvent(new BlockPlace());\n registerEvent(new PlayerConnect());\n registerEvent(new PlayerInteract());\n registerEvent(new PlayerInventory());\n registerEvent(new ItemInfoListener());\n registerEvent(new RestrictedSign());\n registerEvent(new ShopRefundListener());\n registerEvent(new ShortNameSaver());\n if (!Properties.TURN_OFF_CRAFTBUKKIT_TELEPORTATION_BUGFIX) {\n registerEvent(new TeleportFixListener());\n }\n}\n"
|
"private void getAvailableComputedList(List refernceNameList, List dataSetCCList, List result) throws DataException {\n try {\n for (int i = 0; i < dataSetCCList.size(); i++) {\n IComputedColumn column = (IComputedColumn) dataSetCCList.get(i);\n if (!refernceNameList.contains(column.getName())) {\n continue;\n }\n if (ExpressionCompilerUtil.hasAggregationInExpr(column.getExpression()) || column.getAggregateFunction() != null) {\n continue;\n } else {\n List referedList = ExpressionUtil.extractColumnExpressions(((IScriptExpression) column.getExpression()).getText());\n if (referedList.size() == 0) {\n result.add(column);\n } else {\n List newList = new ArrayList();\n for (int j = 0; j < referedList.size(); j++) {\n IColumnBinding binding = (IColumnBinding) referedList.get(j);\n String name = binding.getResultSetColumnName();\n newList.add(name);\n }\n if (!hasAggregation(newList, dataSetCCList)) {\n result.add(column);\n }\n }\n }\n }\n } catch (BirtException e) {\n throw DataException.wrap(e);\n }\n}\n"
|
"private boolean collectProjectFilesFromProvider(Collection files, Object entry, int level) {\n List children = structureProvider.getChildren(entry);\n if (children == null) {\n children = new ArrayList(1);\n }\n boolean isContainsFile = false;\n Iterator childrenEnum = children.iterator();\n for (int i = 0; i < children.size(); i++) {\n Object child = children.get(i);\n if (!structureProvider.isFolder(child)) {\n String elementLabel = structureProvider.getLabel(child);\n if (elementLabel.equals(TALEND_PROJECT)) {\n isContainsFile = true;\n }\n }\n }\n while (childrenEnum.hasNext()) {\n Object child = childrenEnum.next();\n if (structureProvider.isFolder(child)) {\n collectProjectFilesFromProvider(files, child, level + 1);\n }\n String elementLabel = structureProvider.getLabel(child);\n if (elementLabel.equals(\"String_Node_Str\") && isContainsFile) {\n files.add(new TalendProjectRecord(child, entry, level));\n }\n }\n return true;\n}\n"
|
"public Page<JobSearchResult> findJobs(final String id, final String jobName, final String user, final Set<JobStatus> statuses, final Set<String> tags, final String clusterName, final String clusterId, final String commandName, final String commandId, final Date minStarted, final Date maxStarted, final Date minFinished, final Date maxFinished, final Pageable page) {\n log.debug(\"String_Node_Str\");\n final CriteriaBuilder cb = this.entityManager.getCriteriaBuilder();\n final CriteriaQuery<Long> countQuery = cb.createQuery(Long.class);\n final Root<JobEntity> root = countQuery.from(JobEntity.class);\n final Predicate whereClause = JpaJobSpecs.getFindPredicate(root, cb, id, jobName, user, statuses, tags, clusterName, clusterId == null ? null : this.clusterRepository.findOne(clusterId), commandName, commandId == null ? null : this.commandRepository.findOne(commandId), minStarted, maxStarted, minFinished, maxFinished);\n countQuery.select(cb.count(root)).where(whereClause);\n final Long count = this.entityManager.createQuery(countQuery).getSingleResult();\n if (count > 0) {\n final CriteriaQuery<JobSearchResult> contentQuery = cb.createQuery(JobSearchResult.class);\n contentQuery.from(JobEntity.class);\n contentQuery.multiselect(root.get(JobEntity_.id), root.get(JobEntity_.name), root.get(JobEntity_.user), root.get(JobEntity_.status), root.get(JobEntity_.started), root.get(JobEntity_.finished), root.get(JobEntity_.clusterName), root.get(JobEntity_.commandName));\n contentQuery.where(whereClause);\n final Sort sort = page.getSort();\n final List<Order> orders = new ArrayList<>();\n sort.iterator().forEachRemaining(order -> {\n if (order.isAscending()) {\n orders.add(cb.asc(root.get(order.getProperty())));\n } else {\n orders.add(cb.desc(root.get(order.getProperty())));\n }\n });\n contentQuery.orderBy(orders);\n final List<JobSearchResult> results = this.entityManager.createQuery(contentQuery).setFirstResult(page.getOffset()).setMaxResults(page.getPageSize()).getResultList();\n return new PageImpl<>(results, page, count);\n } else {\n return new PageImpl<>(Lists.newArrayList());\n }\n}\n"
|
"public void stopServer() {\n if (server == null) {\n Digester digester = createStopDigester();\n digester.setClassLoader(Thread.currentThread().getContextClassLoader());\n File file = configFile();\n try {\n InputSource is = new InputSource(\"String_Node_Str\" + file.getAbsolutePath());\n fis = new FileInputStream(file);\n is.setByteStream(fis);\n digester.push(this);\n digester.parse(is);\n fis.close();\n } catch (Exception e) {\n log.log(Level.SEVERE, \"String_Node_Str\", e);\n System.exit(1);\n }\n }\n try {\n Socket socket = new Socket(\"String_Node_Str\", server.getPort());\n OutputStream stream = socket.getOutputStream();\n String shutdown = server.getShutdown();\n for (int i = 0; i < shutdown.length(); i++) stream.write(shutdown.charAt(i));\n stream.flush();\n stream.close();\n socket.close();\n } catch (IOException e) {\n log.log(Level.SEVERE, \"String_Node_Str\", e);\n System.exit(1);\n }\n}\n"
|
"public SqlBackendConfig apply(String t) {\n SqlBackendConfig result = nameToConfig.get(t.toLowerCase());\n return result;\n}\n"
|
"private void calculatePriceSellTax() {\n if (!reportlock) {\n reportlock = true;\n Double dPriceSell = (Double) pricesell;\n if (dPriceSell == null) {\n m_jPriceSellTax.setText(null);\n } else {\n double dTaxRate = taxeslogic.getTaxRate((TaxCategoryInfo) taxcatmodel.getSelectedItem());\n m_jPriceSellTax.setText(Formats.CURRENCY.formatValue(new Double(dPriceSell.doubleValue() * (1.0 + dTaxRate))));\n }\n reportlock = false;\n }\n}\n"
|
"public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent();\n copyElement(src, tgt);\n for (org.hl7.fhir.dstu3.model.StringType t : src.getDiscriminator()) tgt.addDiscriminator(t.getValue());\n tgt.setDescription(src.getDescription());\n tgt.setOrdered(src.getOrdered());\n tgt.setRules(convertSlicingRules(src.getRules()));\n return tgt;\n}\n"
|
"public void showError(Error error, String status) {\n replaceFragment(ErrorFragment.newInstance(error, status), true);\n}\n"
|
"protected MPerspectiveStack getMPerspectiveStack() {\n if (fPerspectiveStack != null) {\n return fPerspectiveStack;\n }\n MUIElement baseElement = fWindow;\n if (fWindow == null) {\n baseElement = fApp;\n }\n if (baseElement != null) {\n if (fPerspectiveStack == null) {\n List<MPerspectiveStack> perspStackList = fModelService.findElements(fWindow, null, MPerspectiveStack.class, null);\n if (perspStackList.size() > 0) {\n fPerspectiveStack = perspStackList.get(0);\n return fPerspectiveStack;\n }\n }\n for (MWindowElement child : fWindow.getChildren()) {\n if (child instanceof MPerspectiveStack) {\n fPerspectiveStack = (MPerspectiveStack) child;\n return fPerspectiveStack;\n }\n }\n }\n return null;\n}\n"
|
"protected void setUp() throws Exception {\n super.setUp();\n resetCounters();\n ivy = Ivy.newInstance();\n ivy.configure(PublishEventsTest.class.getResource(\"String_Node_Str\"));\n ivy.pushContext();\n publishEngine = ivy.getPublishEngine();\n ivyFile = new File(\"String_Node_Str\");\n assertTrue(\"String_Node_Str\", ivyFile.exists());\n dataFile = File.createTempFile(\"String_Node_Str\", \"String_Node_Str\");\n dataFile.deleteOnExit();\n publishModule = XmlModuleDescriptorParser.getInstance().parseDescriptor(ivy.getSettings(), ivyFile.toURI().toURL(), false);\n publishSources = Collections.singleton(dataFile.getAbsolutePath());\n publishOptions = new PublishOptions();\n publishOptions.setSrcIvyPattern(ivyFile.getAbsolutePath());\n dataArtifact = publishModule.getAllArtifacts()[0];\n assertEquals(\"String_Node_Str\", \"String_Node_Str\", dataArtifact.getName());\n ivyArtifact = MDArtifact.newIvyArtifact(publishModule);\n expectedPublications = new HashMap();\n expectedPublications.put(dataArtifact.getId(), new PublishTestCase(dataArtifact, dataFile, true));\n expectedPublications.put(ivyArtifact.getId(), new PublishTestCase(ivyArtifact, ivyFile, true));\n assertEquals(\"String_Node_Str\", 2, expectedPublications.size());\n IvyContext.getContext().push(PublishEventsTest.class.getName(), this);\n}\n"
|
"private Field findField(final AdminCommand command, final String fieldName) throws NoSuchFieldException {\n Field result = null;\n for (Class c = command.getClass(); c != null && result == null; c = c.getSuperclass()) {\n try {\n result = c.getDeclaredField(fieldName);\n return result;\n } catch (NoSuchFieldException ex) {\n continue;\n }\n }\n return result;\n}\n"
|
"public Series getSingleChoice(Item item) {\n List<StatisticChoiceOption> statisticResponses = qtiStatisticsManager.getNumOfAnswersPerSingleChoiceAnswerOption(item, resourceResult.getSearchParams());\n String mediaBaseURL = resourceResult.getMediaBaseURL();\n boolean survey = QTIType.survey.equals(resourceResult.getType());\n int numOfParticipants = resourceResult.getQTIStatisticAssessment().getNumOfParticipants();\n int i = 0;\n BarSeries d1 = new BarSeries();\n List<ResponseInfos> responseInfos = new ArrayList<>();\n for (StatisticChoiceOption statisticResponse : statisticResponses) {\n Response response = statisticResponse.getResponse();\n double ans_count = statisticResponse.getCount();\n Float points;\n String cssColor;\n if (survey) {\n points = null;\n cssColor = \"String_Node_Str\";\n } else {\n points = response.getPoints();\n cssColor = response.isCorrect() ? \"String_Node_Str\" : \"String_Node_Str\";\n }\n String label = Integer.toString(++i);\n d1.add(ans_count, label, cssColor);\n String text = response.getContent().renderAsHtml(mediaBaseURL);\n responseInfos.add(new ResponseInfos(label, text, points, response.isCorrect(), survey));\n }\n List<BarSeries> serieList = Collections.singletonList(d1);\n Series series = new Series(serieList, responseInfos, numOfParticipants);\n series.setChartType(BAR_CORRECT);\n series.setItemCss(getCssClass(item));\n return series;\n}\n"
|
"public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException {\n ObjectType objectType = null;\n String id = null;\n Item item = null;\n int qty = 1;\n LivingEntity entity = null;\n for (String arg : scriptEntry.getArguments()) {\n if (aH.matchesArg(\"String_Node_Str\", arg)) {\n objectType = ObjectType.valueOf(arg.toUpperCase());\n dB.echoDebug(\"String_Node_Str\", arg.toUpperCase());\n } else if (aH.matchesValueArg(\"String_Node_Str\", arg, ArgumentType.String)) {\n id = aH.getStringFrom(arg);\n dB.echoDebug(\"String_Node_Str\", id);\n } else if (aH.matchesItem(arg)) {\n item = aH.getItemFrom(arg);\n dB.echoDebug(\"String_Node_Str\", aH.getStringFrom(arg));\n } else if (aH.matchesQuantity(arg)) {\n qty = aH.getIntegerFrom(arg);\n dB.echoDebug(Messages.DEBUG_SET_QUANTITY, String.valueOf(qty));\n } else {\n }\n }\n if (objectType == null)\n throw new InvalidArgumentsException(\"String_Node_Str\");\n if (id == null)\n throw new InvalidArgumentsException(\"String_Node_Str\");\n scriptEntry.addObject(\"String_Node_Str\", objectType);\n scriptEntry.addObject(\"String_Node_Str\", id);\n if (objectType == ObjectType.ITEMSTACK) {\n if (item == null)\n throw new InvalidArgumentsException(\"String_Node_Str\");\n item.getItemStack().setAmount(qty);\n scriptEntry.addObject(\"String_Node_Str\", item);\n } else if (objectType == ObjectType.ENTITY) {\n if (entity == null)\n throw new InvalidArgumentsException(\"String_Node_Str\");\n scriptEntry.addObject(\"String_Node_Str\", entity);\n } else if (objectType == ObjectType.NPC) {\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.