content
stringlengths 40
137k
|
---|
"public Object poll(final String name, long timeout) throws InterruptedException {\n if (timeout == -1) {\n timeout = Long.MAX_VALUE;\n }\n Object removedItem = null;\n long start = Clock.currentTimeMillis();\n while (removedItem == null && timeout >= 0) {\n Data key = takeKey(name, timeout);\n if (key == null) {\n return null;\n }\n IMap imap = getStorageMap(name);\n try {\n removedItem = imap.tryRemove(key, 0, TimeUnit.MILLISECONDS);\n if (removedItem != null) {\n ThreadContext threadContext = ThreadContext.get();\n TransactionImpl txn = threadContext.getCallContext().getTransaction();\n final Data removedItemData = toData(removedItem);\n if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {\n txn.attachRemoveOp(name, key, removedItemData, true);\n }\n fireQueueEvent(name, EntryEventType.REMOVED, removedItemData);\n }\n } catch (TimeoutException e) {\n throw new OperationTimeoutException(e);\n }\n long now = Clock.currentTimeMillis();\n timeout -= (now - start);\n start = now;\n }\n return removedItem;\n}\n"
|
"protected void drawHighlights() {\n if (mHighlightEnabled && valuesToHighlight()) {\n float offsetY = mDeltaY * 0.04f;\n for (int i = 0; i < mIndicesToHightlight.length; i++) {\n int index = mIndicesToHightlight[i];\n if (index < mYVals.size() && index >= 0) {\n mHighlightPaint.setAlpha(120);\n float y = mYVals.get(index).getVal();\n float left = index + mBarSpace / 2f;\n float right = index + 1f - mBarSpace / 2f;\n float top = y >= 0 ? y : 0;\n float bottom = y <= 0 ? y : 0;\n RectF highlight = new RectF(left, top, right, bottom);\n transformRect(highlight);\n mDrawCanvas.drawRect(highlight, mHighlightPaint);\n if (mDrawHighlightArrow) {\n mHighlightPaint.setAlpha(200);\n Path arrow = new Path();\n arrow.moveTo(index + 0.5f, y + offsetY * 0.3f);\n arrow.lineTo(index + 0.2f, y + offsetY);\n arrow.lineTo(index + 0.8f, y + offsetY);\n transformPath(arrow);\n mDrawCanvas.drawPath(arrow, mHighlightPaint);\n }\n }\n }\n }\n}\n"
|
"private void createButtonComposite() {\n Composite composite = new Composite(mainControl, SWT.NONE);\n GridData gd = new GridData();\n gd.verticalIndent = -5;\n gd.verticalAlignment = SWT.BEGINNING;\n composite.setLayoutData(gd);\n composite.setLayout(new GridLayout());\n SelectionAdapter listener = new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n doButtonSelected(e);\n }\n };\n if (buttonLabels != null) {\n buttonArray = new Button[buttonLabels.length];\n for (int i = 0; i < buttonLabels.length; i++) {\n String currLabel = buttonLabels[i];\n if (currLabel != null) {\n buttonArray[i] = createButton(composite, currLabel, listener);\n } else {\n buttonArray[i] = null;\n createSeparator(composite);\n }\n }\n }\n}\n"
|
"public void widgetSelected(SelectionEvent e) {\n WebArtifactUtil.setContextParamValue(properties, BIRT_OVERWRITE_DOCUMENT_SETTING, BLANK_STRING + ((Button) e.getSource()).getSelection());\n}\n"
|
"private String getCompatDistinguishSalt(String previousSalt) {\n String saltMd5 = SoterCoreUtil.getMessageDigest(previousSalt.getBytes(Charset.forName(\"String_Node_Str\")));\n if (!SoterCoreUtil.isNullOrNil(saltMd5) && saltMd5.length() >= MAX_SALT_STR_LEN) {\n return saltMd5.substring(0, MAX_SALT_STR_LEN);\n }\n Log.e(TAG, \"String_Node_Str\");\n return null;\n}\n"
|
"public void moveViewToY(float yValue, AxisDependency axis) {\n float valsInView = getDeltaY(axis) / mViewPortHandler.getScaleY();\n Runnable job = new MoveViewJob(mViewPortHandler, 0f, yValue + valsInView / 2f, getTransformer(axis), this);\n if (mViewPortHandler.hasChartDimens()) {\n post(job);\n } else {\n mJobs.add(job);\n }\n}\n"
|
"private void createChoicePart(Composite parent) {\n Composite composite = new Composite(parent, SWT.NONE);\n composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n composite.setLayout(new GridLayout(2, true));\n Label dataSetModeLabel = new Label(composite, SWT.NONE);\n dataSetModeLabel.setText(LABEL_SELECT_DATA_SET_MODE);\n GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);\n gd.verticalSpan = 2;\n dataSetModeLabel.setLayoutData(gd);\n singleDataSet = new Button(composite, SWT.RADIO);\n singleDataSet.setText(RADIO_SINGLE);\n singleDataSet.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n refreshValueTable();\n updateButtons();\n }\n });\n multiDataSet = new Button(composite, SWT.RADIO);\n multiDataSet.setText(RADIO_MULTIPLE);\n multiDataSet.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n refreshValueTable();\n updateButtons();\n }\n });\n}\n"
|
"protected void okPressed() {\n ProgressMonitorDialog pmd = new ProgressMonitorDialog(getShell());\n IRunnableWithProgress rwp = new IRunnableWithProgress() {\n public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {\n IProxyRepositoryFactory prf = CorePlugin.getDefault().getProxyRepositoryFactory();\n try {\n prf.saveProject(project);\n ShowStandardAction.getInstance().doRun();\n if (needCodeGen) {\n Job refreshTemplates = CorePlugin.getDefault().getCodeGeneratorService().refreshTemplates();\n refreshTemplates.addJobChangeListener(new JobChangeAdapter() {\n\n public void done(IJobChangeEvent event) {\n CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();\n }\n });\n }\n } catch (Exception ex) {\n ExceptionHandler.process(ex);\n }\n}\n"
|
"public void onDisconnect() {\n couldNotOpenConnection = true;\n selfDestroyService();\n}\n"
|
"public List<String> selectList(String text) {\n List<String> results = new ArrayList<String>();\n try {\n HtmlCleaner htmlCleaner = new HtmlCleaner();\n TagNode tagNode = htmlCleaner.clean(text);\n Document document = new DomSerializer(new CleanerProperties()).createDOM(tagNode);\n Object result;\n try {\n result = xPathExpression.evaluate(document, XPathConstants.NODESET);\n } catch (XPathExpressionException e) {\n result = xPathExpression.evaluate(document, XPathConstants.STRING);\n }\n if (result instanceof NodeList) {\n NodeList nodeList = (NodeList) result;\n Transformer transformer = TransformerFactory.newInstance().newTransformer();\n StreamResult xmlOutput = new StreamResult();\n transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"String_Node_Str\");\n for (int i = 0; i < nodeList.getLength(); i++) {\n Node item = nodeList.item(i);\n if (item.getNodeType() == Node.ATTRIBUTE_NODE || item.getNodeType() == Node.TEXT_NODE) {\n results.add(item.getTextContent());\n } else {\n xmlOutput.setWriter(new StringWriter());\n transformer.transform(new DOMSource(item), xmlOutput);\n results.add(xmlOutput.getWriter().toString());\n }\n }\n } else {\n results.add(result.toString());\n }\n } catch (Exception e) {\n logger.error(\"String_Node_Str\" + xpathStr, e);\n }\n return results;\n}\n"
|
"public void tearDown() {\n listenableStorage.removeListeners();\n}\n"
|
"private void foreachArray(Context context, ForeachLoop loop) throws UserException, UndefinedTypeException {\n Var arrayVar = exprWalker.eval(context, loop.getArrayVarTree(), loop.findArrayType(context), true, null);\n ArrayList<Var> usedVariables = new ArrayList<Var>();\n ArrayList<Var> keepOpenVars = new ArrayList<Var>();\n VariableUsageInfo bodyVU = loop.getBody().checkedGetVariableUsage();\n summariseBranchVariableUsage(context, Arrays.asList(bodyVU), usedVariables, keepOpenVars);\n for (Var v : keepOpenVars) {\n if (v.name().equals(arrayVar.name())) {\n throw new STCRuntimeError(\"String_Node_Str\" + v.name() + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n }\n FunctionContext fc = context.getFunctionContext();\n int loopNum = fc.getCounterVal(\"String_Node_Str\");\n Var realArray;\n Context outsideLoopContext;\n ArrayList<Var> arrRefWaitUsedVars = null;\n if (Types.isArrayRef(arrayVar.type())) {\n arrRefWaitUsedVars = new ArrayList<Var>(usedVariables);\n arrRefWaitUsedVars.add(arrayVar);\n backend.startWaitStatement(fc.getFunctionName() + \"String_Node_Str\" + loopNum, Arrays.asList(arrayVar), arrRefWaitUsedVars, keepOpenVars, null, WaitMode.DATA_ONLY, false, TaskMode.LOCAL_CONTROL);\n outsideLoopContext = new LocalContext(context);\n realArray = varCreator.createTmp(outsideLoopContext, arrayVar.type().memberType(), false, true);\n backend.retrieveRef(realArray, arrayVar);\n } else {\n realArray = arrayVar;\n outsideLoopContext = context;\n }\n ArrayList<Var> waitUsedVars = new ArrayList<Var>(usedVariables);\n waitUsedVars.add(realArray);\n backend.startWaitStatement(fc.getFunctionName() + \"String_Node_Str\" + loopNum, Arrays.asList(realArray), waitUsedVars, keepOpenVars, WaitMode.DATA_ONLY, false, TaskMode.LOCAL_CONTROL);\n loop.setupLoopBodyContext(outsideLoopContext);\n Context loopBodyContext = loop.getBodyContext();\n backend.startForeachLoop(fc.getFunctionName() + \"String_Node_Str\" + loopNum, realArray, loop.getMemberVar(), loop.getLoopCountVal(), loop.getSplitDegree(), true, usedVariables, keepOpenVars);\n ArrayList<Var> iterUsedVars = null;\n if (!loop.isSyncLoop()) {\n iterUsedVars = new ArrayList<Var>(usedVariables);\n if (loop.getLoopCountVal() != null)\n iterUsedVars.add(loop.getLoopCountVal());\n backend.startWaitStatement(fc.getFunctionName() + \"String_Node_Str\" + loopNum, Collections.<Var>emptyList(), iterUsedVars, keepOpenVars, WaitMode.TASK_DISPATCH, false, TaskMode.CONTROL);\n }\n if (loop.getCountVarName() != null) {\n Var loopCountVar = varCreator.createVariable(loop.getBodyContext(), Types.F_INT, loop.getCountVarName(), VarStorage.STACK, DefType.LOCAL_USER, null);\n backend.assignInt(loopCountVar, Arg.createVar(loop.getLoopCountVal()));\n }\n Set<Var> noRefcount = Collections.singleton(loop.getMemberVar());\n block(loopBodyContext, loop.getBody(), noRefcount);\n if (!loop.isSyncLoop()) {\n backend.endWaitStatement(iterUsedVars, keepOpenVars);\n }\n backend.endForeachLoop(loop.getSplitDegree(), true, usedVariables, keepOpenVars);\n backend.endWaitStatement(waitUsedVars, keepOpenVars);\n if (Types.isArrayRef(arrayVar.type())) {\n backend.endWaitStatement(arrRefWaitUsedVars, keepOpenVars);\n }\n}\n"
|
"public void setButtonType(int type) {\n addFriendBtn.setTag(R.id.button_type, type);\n switch(type) {\n case 1:\n shrinkButton.setText(mRes.getString(R.string.sendMessage));\n break;\n case 2:\n shrinkButton.setText(mRes.getString(R.string.add_friend));\n break;\n case 3:\n shrinkButton.setText(mRes.getString(R.string.wait_for_verfiy));\n break;\n }\n}\n"
|
"public void add(ObjectName resource) {\n String knowledgeSessionId = String.valueOf(resource.getKeyProperty(\"String_Node_Str\").replace(\"String_Node_Str\", \"String_Node_Str\"));\n String knowledgeBaseId;\n try {\n knowledgeBaseId = (String) connector.getConnection().getAttribute(resource, \"String_Node_Str\");\n } catch (Exception e1) {\n logger.error(\"String_Node_Str\" + agentId);\n return;\n }\n String scannerId = knowledgeBaseId.concat(knowledgeSessionId);\n synchronized (resourceScanners) {\n if (!resourceScanners.containsKey(scannerId)) {\n KnowledgeSessionInfo ksessionInfo = new KnowledgeSessionInfo();\n ksessionInfo.setKnowledgeSessionId(Integer.valueOf(knowledgeSessionId));\n ksessionInfo.setAgentId(agentId);\n ksessionInfo.setKnowledgeBaseId(knowledgeBaseId);\n synchronized (knowledgeSessionInfos) {\n knowledgeSessionInfos.add(ksessionInfo);\n }\n KnowledgeSessionScanner scanner = new KnowledgeSessionScanner(agentId, resource, connector);\n resourceScanners.put(scannerId, scanner);\n logger.info(\"String_Node_Str\" + resource.getCanonicalName());\n discover = true;\n }\n }\n}\n"
|
"public void caseAssignStmt(AssignStmt stmt) {\n Value lhs = stmt.getLeftOp();\n Value rhs = stmt.getRightOp();\n Type tlhs = null;\n if (lhs instanceof Local)\n tlhs = this.tg.get((Local) lhs);\n else if (lhs instanceof ArrayRef) {\n ArrayRef aref = (ArrayRef) lhs;\n Local base = (Local) aref.getBase();\n ArrayType at = null;\n Type tgType = this.tg.get(base);\n if (tgType instanceof ArrayType)\n at = (ArrayType) tgType;\n else {\n if (tgType == Scene.v().getObjectType() && rhs instanceof Local) {\n Type rhsType = this.tg.get((Local) rhs);\n if (rhsType instanceof PrimType) {\n if (defs == null) {\n defs = LocalDefs.Factory.newLocalDefs(jb);\n uses = LocalUses.Factory.newLocalUses(jb, defs);\n }\n for (Unit defU : defs.getDefsOfAt(base, stmt)) {\n if (defU instanceof AssignStmt) {\n AssignStmt defUas = (AssignStmt) defU;\n if (defUas.getRightOp() instanceof NewArrayExpr) {\n at = (ArrayType) defUas.getRightOp().getType();\n break;\n }\n }\n }\n }\n }\n if (at == null)\n at = tgType.makeArrayType();\n }\n tlhs = ((ArrayType) at).getElementType();\n this.handleArrayRef(aref, stmt);\n aref.setBase((Local) this.uv.visit(aref.getBase(), at, stmt));\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n stmt.setLeftOp(this.uv.visit(lhs, tlhs, stmt));\n } else if (lhs instanceof FieldRef) {\n tlhs = ((FieldRef) lhs).getFieldRef().type();\n if (lhs instanceof InstanceFieldRef)\n this.handleInstanceFieldRef((InstanceFieldRef) lhs, stmt);\n }\n lhs = stmt.getLeftOp();\n rhs = stmt.getRightOp();\n if (rhs instanceof Local)\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n else if (rhs instanceof ArrayRef) {\n ArrayRef aref = (ArrayRef) rhs;\n Local base = (Local) aref.getBase();\n ArrayType at;\n Type et = null;\n if (this.tg.get(base) instanceof ArrayType)\n at = (ArrayType) this.tg.get(base);\n else {\n Type bt = this.tg.get(base);\n at = bt.makeArrayType();\n if (bt instanceof RefType) {\n RefType rt = (RefType) bt;\n if (rt.getSootClass().getName().equals(\"String_Node_Str\") || rt.getSootClass().getName().equals(\"String_Node_Str\") || rt.getSootClass().getName().equals(\"String_Node_Str\")) {\n if (defs == null) {\n defs = LocalDefs.Factory.newLocalDefs(jb);\n uses = LocalUses.Factory.newLocalUses(jb, defs);\n }\n outer: for (UnitValueBoxPair usePair : uses.getUsesOf(stmt)) {\n Stmt useStmt = (Stmt) usePair.getUnit();\n if (useStmt.containsInvokeExpr())\n for (int i = 0; i < useStmt.getInvokeExpr().getArgCount(); i++) if (useStmt.getInvokeExpr().getArg(i) == usePair.getValueBox().getValue()) {\n et = useStmt.getInvokeExpr().getMethod().getParameterType(i);\n at = et.makeArrayType();\n break outer;\n }\n }\n }\n }\n }\n Type trhs = ((ArrayType) at).getElementType();\n this.handleArrayRef(aref, stmt);\n aref.setBase((Local) this.uv.visit(aref.getBase(), at, stmt));\n stmt.setRightOp(this.uv.visit(rhs, trhs, stmt));\n } else if (rhs instanceof InstanceFieldRef) {\n this.handleInstanceFieldRef((InstanceFieldRef) rhs, stmt);\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof BinopExpr)\n this.handleBinopExpr((BinopExpr) rhs, stmt, tlhs);\n else if (rhs instanceof InvokeExpr) {\n this.handleInvokeExpr((InvokeExpr) rhs, stmt);\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof CastExpr)\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n else if (rhs instanceof InstanceOfExpr) {\n InstanceOfExpr ioe = (InstanceOfExpr) rhs;\n ioe.setOp(this.uv.visit(ioe.getOp(), RefType.v(\"String_Node_Str\"), stmt));\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof NewArrayExpr) {\n NewArrayExpr nae = (NewArrayExpr) rhs;\n nae.setSize(this.uv.visit(nae.getSize(), IntType.v(), stmt));\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof NewMultiArrayExpr) {\n NewMultiArrayExpr nmae = (NewMultiArrayExpr) rhs;\n for (int i = 0; i < nmae.getSizeCount(); i++) nmae.setSize(i, this.uv.visit(nmae.getSize(i), IntType.v(), stmt));\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof LengthExpr) {\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n } else if (rhs instanceof NegExpr) {\n ((NegExpr) rhs).setOp(this.uv.visit(((NegExpr) rhs).getOp(), tlhs, stmt));\n } else if (rhs instanceof Constant)\n if (!(rhs instanceof NullConstant))\n stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt));\n}\n"
|
"protected void sendUnregister(RemoteServiceRegistrationImpl serviceRegistration) {\n Trace.entering(Activator.PLUGIN_ID, IRemoteServiceProviderDebugOptions.METHODS_ENTERING, this.getClass(), \"String_Node_Str\", new Object[] { serviceRegistration });\n synchronized (localRegistry) {\n localRegistry.unpublishService(serviceRegistration);\n final ID containerID = serviceRegistration.getContainerID();\n final Long serviceId = new Long(serviceRegistration.getServiceId());\n ID[] targetIds = getTargetsFromProperties(serviceRegistration.properties);\n if (targetIds == null) {\n try {\n this.sendSharedObjectMsgTo(null, SharedObjectMsg.createMsg(UNREGISTER, new Object[] { containerID, serviceId }));\n } catch (final IOException e) {\n log(UNREGISTER_ERROR_CODE, UNREGISTER_ERROR_MESSAGE, e);\n }\n } else\n for (int i = 0; i < targetIds.length; i++) {\n try {\n this.sendSharedObjectMsgTo(targetIds[i], SharedObjectMsg.createMsg(UNREGISTER, new Object[] { containerID, serviceId }));\n } catch (final IOException e) {\n log(UNREGISTER_ERROR_CODE, UNREGISTER_ERROR_MESSAGE, e);\n }\n }\n }\n fireRemoteServiceListeners(createUnregisteredEvent(serviceRegistration));\n Trace.exiting(Activator.PLUGIN_ID, IRemoteServiceProviderDebugOptions.METHODS_EXITING, this.getClass(), \"String_Node_Str\");\n}\n"
|
"public static void computeXTextSize(XText xText) {\n if (Widgets.isAccessible(xText.getStyledText())) {\n int lineCount = xText.getStyledText().getLineCount();\n int lineLimit = Integer.valueOf(OseeInfo.getCachedValue(ATTR_FORM_PART_LINE_LIMIT));\n lineCount = lineCount > lineLimit ? lineLimit : lineCount;\n int height = lineCount * xText.getStyledText().getLineHeight();\n GridData formTextGd = new GridData(SWT.FILL, SWT.FILL, true, true);\n if (xText.isFillVertically() && height < 60) {\n formTextGd.heightHint = 60;\n } else {\n formTextGd.heightHint = height;\n }\n formTextGd.widthHint = 200;\n xText.getStyledText().setLayoutData(formTextGd);\n }\n}\n"
|
"public void initialize() throws IllegalActionException {\n super.initialize();\n Runnable doInitialize = new Runnable() {\n public void run() {\n if (shell == null) {\n Effigy containerEffigy = Configuration.findEffigy(toplevel());\n if (containerEffigy == null) {\n MessageHandler.error(\"String_Node_Str\" + toplevel().getFullName());\n return;\n }\n try {\n ExpressionShellEffigy shellEffigy = new ExpressionShellEffigy(containerEffigy, containerEffigy.uniqueName(\"String_Node_Str\"));\n shellEffigy.identifier.setExpression(getFullName());\n _tableau = new ShellTableau(shellEffigy, \"String_Node_Str\");\n _frame = _tableau.frame;\n shell = _tableau.shell;\n shell.setInterpreter(InteractiveShell.this);\n shell.setEditable(false);\n } catch (Exception ex) {\n MessageHandler.error(\"String_Node_Str\" + InteractiveShell.this.getFullName(), ex);\n return;\n }\n _windowProperties.setProperties(_frame);\n _frame.pack();\n } else {\n shell.clearJTextArea();\n }\n if (_frame != null) {\n _frame.show();\n _frame.toFront();\n }\n }\n try {\n ExpressionShellEffigy shellEffigy = new ExpressionShellEffigy(containerEffigy, containerEffigy.uniqueName(\"String_Node_Str\"));\n shellEffigy.identifier.setExpression(getFullName());\n _tableau = new ShellTableau(shellEffigy, \"String_Node_Str\");\n _frame = _tableau.frame;\n shell = _tableau.shell;\n shell.setInterpreter(this);\n shell.setEditable(false);\n } catch (Exception ex) {\n throw new IllegalActionException(this, null, ex, \"String_Node_Str\");\n }\n _windowProperties.setProperties(_frame);\n _frame.pack();\n } else {\n shell.clearJTextArea();\n }\n if (_frame != null) {\n _frame.show();\n _frame.toFront();\n }\n _firstTime = true;\n _returnFalseInPostfire = false;\n}\n"
|
"public void veryHardShouldProduceCertainAmountOfSoldiersWithin85Minutes() throws MapLoadException {\n PlayerSetting[] playerSettings = getDefaultPlayerSettings(12);\n playerSettings[0] = new PlayerSetting(EPlayerType.AI_VERY_HARD, ECivilisation.ROMAN, (byte) 0);\n JSettlersGame.GameRunner startingGame = createStartingGame(playerSettings);\n IStartedGame startedGame = ReplayUtils.waitForGameStartup(startingGame);\n MatchConstants.clock().fastForwardTo(86 * MINUTES);\n ReplayUtils.awaitShutdown(startedGame);\n short expectedMinimalProducedSoldiers = 1000;\n short producedSoldiers = startingGame.getMainGrid().getPartitionsGrid().getPlayer(0).getEndgameStatistic().getAmountOfProducedSoldiers();\n if (producedSoldiers < expectedMinimalProducedSoldiers) {\n fail(\"String_Node_Str\" + expectedMinimalProducedSoldiers + \"String_Node_Str\" + producedSoldiers + \"String_Node_Str\" + \"String_Node_Str\");\n }\n ensureRuntimePerformance(\"String_Node_Str\", startingGame.getAiExecutor().getApplyRulesStopWatch(), 200, 2500);\n ensureRuntimePerformance(\"String_Node_Str\", startingGame.getAiExecutor().getUpdateStatisticsStopWatch(), 100, 2500);\n}\n"
|
"protected String doInBackground(Void... u) {\n OSClient osc = OSClient.getInstance(U);\n try {\n jsonBufQuota = osc.listQuotas();\n Command cmd = Command.commandFactory(Command.commandType.LISTSERVERS, U);\n if (cmd != null)\n cmd.execute();\n else {\n hasError = true;\n errorMessage = \"String_Node_Str\";\n return null;\n }\n jsonBuf = cmd.getRESTResponse();\n jsonBufFIPs = osc.listFloatingIPs();\n jsonBufSecgs = osc.listSecGroups();\n jsonBufferFlavor = osc.listFlavors();\n jsonBufferVolumes = osc.listVolumes();\n jsonBufferQuotaVols = osc.listVolQuotas();\n } catch (Exception e) {\n errorMessage = e.getMessage();\n hasError = true;\n return \"String_Node_Str\";\n }\n return jsonBuf;\n}\n"
|
"public void writeByte(int value) {\n throw new UnsupportedOperationException(getClass().getName());\n}\n"
|
"private void buildModel(IloCplex cplex, DmvSolution initFeasSol) throws IloException {\n this.bounds = new CptBounds(this.idm);\n mp = new LpProblem();\n mp.origMatrix = cplex.LPMatrix(\"String_Node_Str\");\n sto.init(cplex, mp.origMatrix, idm, bounds);\n int numConds = idm.getNumConds();\n sto.createModelParamVars();\n sto.addModelParamConstraints();\n DmvParseLpBuilder builder = new DmvParseLpBuilder(prm.parsePrm, cplex);\n mp.pp = builder.buildDmvTreeProgram(corpus);\n builder.addConsToMatrix(mp.pp, mp.origMatrix);\n DimReducer dr = new DimReducer(prm.drPrm);\n mp.drMatrix = cplex.LPMatrix(\"String_Node_Str\");\n dr.reduceDimensionality(mp.origMatrix, mp.drMatrix);\n if (mp.drMatrix.getNrows() == 0) {\n mp.drMatrix = null;\n }\n RltPrm rltPrm = prm.rltPrm;\n if (prm.objVarFilter) {\n if (rltPrm.rowAdder != null && rltPrm.factorFilter != null) {\n log.warn(\"String_Node_Str\");\n }\n rltPrm.factorFilter = new VarRltFactorFilter(getObjVarCols());\n rltPrm.rowAdder = new VarRltRowAdder(getObjVarPairs(), false);\n } else {\n rltPrm.rowAdder = new UnionRltRowAdder(new VarRltRowAdder(getObjVarPairs()), rltPrm.rowAdder);\n }\n if (mp.drMatrix == null) {\n log.info(\"String_Node_Str\");\n mp.rlt = new Rlt(cplex, mp.origMatrix, rltPrm);\n IloLPMatrix rltMat = mp.rlt.getRltMatrix();\n cplex.add(mp.origMatrix);\n cplex.add(rltMat);\n } else {\n log.info(\"String_Node_Str\");\n mp.rlt = new Rlt(cplex, mp.drMatrix, rltPrm);\n IloLPMatrix rltMat = mp.rlt.getRltMatrix();\n cplex.add(mp.origMatrix);\n cplex.add(mp.drMatrix);\n cplex.add(rltMat);\n }\n mp.objective = cplex.addMinimize();\n mp.objVars = new IloNumVar[numConds][];\n for (int c = 0; c < numConds; c++) {\n int numParams = idm.getNumParams(c);\n mp.objVars[c] = new IloNumVar[numParams];\n for (int m = 0; m < numParams; m++) {\n mp.objVars[c][m] = mp.rlt.getRltVar(sto.modelParamVars[c][m], mp.pp.featCountVars[c][m]);\n cplex.setLinearCoef(mp.objective, -1.0, mp.objVars[c][m]);\n }\n }\n log.info(CplexUtils.getMatrixStats(mp.origMatrix));\n if (mp.drMatrix != null) {\n log.info(CplexUtils.getMatrixStats(mp.drMatrix));\n }\n log.info(CplexUtils.getMatrixStats(mp.rlt.getRltMatrix()));\n}\n"
|
"private boolean isNodeDefaultColumn(String id) {\n for (NodeColumnsGDF c : defaultNodeColumnsGDFs) {\n if (c.title.equalsIgnoreCase(id)) {\n return true;\n }\n }\n return false;\n}\n"
|
"public String getValue(final int row, final int col) {\n checkRegistry();\n checkColumn(col);\n checkRow(row, outputGeneralized.getDataLength());\n return internalGetValue(row, col);\n}\n"
|
"protected void println(final LogLevel level, final Throwable t, final String format, final Object... args) {\n if (this.level.includes(level) && (t != null || format != null)) {\n String message = null;\n if (format != null && format.length() > 0) {\n message = (args != null && args.length > 0) ? String.format(format, args) : format;\n }\n if (t != null) {\n message = message != null ? message + \"String_Node_Str\" + Log.getStackTraceString(t) : Log.getStackTraceString(t);\n }\n if (thread) {\n final StringBuilder sb = new StringBuilder();\n sb.append(\"String_Node_Str\").append(Thread.currentThread().getName()).append(\"String_Node_Str\").append(tag);\n Log.println(level.intValue(), sb.toString(), message);\n } else {\n Log.println(level.intValue(), tag, message);\n }\n }\n}\n"
|
"public void read(PortableReader reader) throws IOException {\n threadId = reader.readInt(\"String_Node_Str\");\n super.read(reader);\n final ObjectDataInput in = reader.getRawDataInput();\n value = new Data();\n value.readData(in);\n}\n"
|
"public void paint(Graphics g) {\n super.paint(g);\n if (points.size() > 4) {\n Random random = new Random(0);\n for (VectorXYZ p : points) {\n g.setColor(new Color(0.5f + random.nextFloat() / 2, 0.5f + random.nextFloat() / 2, 0.5f + random.nextFloat() / 2));\n for (TriangleXZ t : triangulation.getVoronoiParts(p)) {\n fill(g, t);\n }\n }\n g.setColor(Color.GREEN);\n for (DelaunayTriangle t : triangulation.getIncidentTriangles(p)) {\n VectorXZ center = t.getCircumcircleCenter();\n draw(g, center);\n drawCircle(g, center, t.p0.distanceToXZ(center));\n }\n }\n g.setColor(Color.RED);\n for (DelaunayTriangle triangle : triangulation.triangles) {\n draw(g, triangle.asTriangleXZ());\n }\n g.setColor(Color.BLACK);\n for (VectorXYZ p : points) {\n draw(g, p.xz());\n }\n}\n"
|
"public List<ServiceOfferingVO> searchForServiceOfferings(ListServiceOfferingsCmd cmd) {\n Filter searchFilter = new Filter(ServiceOfferingVO.class, \"String_Node_Str\", false, cmd.getStartIndex(), cmd.getPageSizeVal());\n SearchCriteria<ServiceOfferingVO> sc = _offeringsDao.createSearchCriteria();\n Account caller = UserContext.current().getCaller();\n Object name = cmd.getServiceOfferingName();\n Object id = cmd.getId();\n Object keyword = cmd.getKeyword();\n Long vmId = cmd.getVirtualMachineId();\n Long domainId = cmd.getDomainId();\n Boolean issystem = cmd.getIsSystem();\n String vm_type_str = cmd.getSystemVmType();\n if (domainId != null) {\n if (account.getType() == Account.ACCOUNT_TYPE_ADMIN) {\n if (account.getDomainId() != 1 && issystem) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n return _offeringsDao.findSystemOffering(domainId, issystem, vm_type_str);\n } else {\n if (issystem) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n if (isPermissible(account.getDomainId(), domainId)) {\n return _offeringsDao.findSystemOffering(domainId, false, vm_type_str);\n } else {\n throw new PermissionDeniedException(\"String_Node_Str\" + account.getAccountName() + \"String_Node_Str\");\n }\n }\n }\n if ((account.getType() == Account.ACCOUNT_TYPE_NORMAL || account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || account.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) {\n if (issystem) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n return searchServiceOfferingsInternal(account, name, id, vmId, keyword, searchFilter);\n }\n if (account.getDomainId() != 1 && issystem) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n if (keyword != null) {\n SearchCriteria<ServiceOfferingVO> ssc = _offeringsDao.createSearchCriteria();\n ssc.addOr(\"String_Node_Str\", SearchCriteria.Op.LIKE, \"String_Node_Str\" + keyword + \"String_Node_Str\");\n ssc.addOr(\"String_Node_Str\", SearchCriteria.Op.LIKE, \"String_Node_Str\" + keyword + \"String_Node_Str\");\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.SC, ssc);\n } else if (vmId != null) {\n UserVmVO vmInstance = _userVmDao.findById(vmId);\n if ((vmInstance == null) || (vmInstance.getRemoved() != null)) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + vmId);\n }\n if ((account != null) && !isAdmin(account.getType())) {\n if (account.getId() != vmInstance.getAccountId()) {\n throw new PermissionDeniedException(\"String_Node_Str\" + vmId + \"String_Node_Str\");\n }\n }\n ServiceOfferingVO offering = _offeringsDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId());\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.NEQ, offering.getId());\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, offering.getUseLocalStorage());\n }\n if (id != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, id);\n }\n if (name != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.LIKE, \"String_Node_Str\" + name + \"String_Node_Str\");\n }\n if (vm_type_str != null) {\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, vm_type_str);\n }\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, issystem);\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.NULL);\n return _offeringsDao.search(sc, searchFilter);\n}\n"
|
"public boolean parse(Parser parser, int flags) {\n this.parser = parser;\n this.hasSyntaxErrors = false;\n this.reportErrors = (flags & REPORT_ERRORS) != 0;\n IToken token = null;\n while (true) {\n if (this.reparse) {\n this.reparse = false;\n } else {\n if (!this.tokens.hasNext()) {\n break;\n }\n token = this.tokens.next();\n }\n if (this.skip > 0) {\n this.skip--;\n continue;\n }\n if (this.parser == null) {\n if ((flags & EXIT_ON_ROOT) != 0) {\n return this.success(markers);\n }\n this.reportUnparsed(token);\n continue;\n }\n if (!this.reportErrors && this.parser.reportErrors()) {\n if (this.hasSyntaxErrors) {\n return false;\n }\n this.reportErrors = true;\n }\n try {\n this.parser.parse(this, token);\n } catch (Exception ex) {\n this.reportError(token, ex);\n return this.success();\n }\n if (!this.success()) {\n return false;\n }\n }\n this.parseRemaining(token);\n return this.success();\n}\n"
|
"public void testSimpleGenAidlRule() throws IOException {\n BuildContext context = null;\n String pathToAidl = \"String_Node_Str\";\n String importPath = \"String_Node_Str\";\n BuildRuleResolver ruleResolver = new BuildRuleResolver();\n GenAidlRule genAidlRule = ruleResolver.buildAndAddToIndex(GenAidlRule.newGenAidlRuleBuilder(new FakeAbstractBuildRuleBuilderParams()).setBuildTarget(BuildTargetFactory.newInstance(\"String_Node_Str\")).setAidl(pathToAidl).setImportPath(importPath));\n assertEquals(BuildRuleType.GEN_AIDL, genAidlRule.getType());\n assertTrue(genAidlRule.isAndroidRule());\n assertEquals(ImmutableList.of(pathToAidl), genAidlRule.getInputsToCompareToOutput());\n List<Step> steps = genAidlRule.buildInternal(context);\n final String pathToAidlExecutable = \"String_Node_Str\";\n final String pathToFrameworkAidl = \"String_Node_Str\";\n AndroidPlatformTarget androidPlatformTarget = createMock(AndroidPlatformTarget.class);\n File aidlExecutable = createMock(File.class);\n expect(aidlExecutable.getAbsolutePath()).andReturn(pathToAidlExecutable);\n expect(androidPlatformTarget.getAidlExecutable()).andReturn(aidlExecutable);\n File frameworkIdlFile = createMock(File.class);\n expect(frameworkIdlFile.getAbsolutePath()).andReturn(pathToFrameworkAidl);\n expect(androidPlatformTarget.getAndroidFrameworkIdlFile()).andReturn(frameworkIdlFile);\n ExecutionContext executionContext = createMock(ExecutionContext.class);\n expect(executionContext.getAndroidPlatformTarget()).andReturn(androidPlatformTarget);\n expect(executionContext.getProjectFilesystem()).andReturn(new ProjectFilesystem(new File(\"String_Node_Str\")) {\n public Function<String, String> getPathRelativizer() {\n return Functions.identity();\n }\n });\n replay(androidPlatformTarget, aidlExecutable, frameworkIdlFile, executionContext);\n String outputDirectory = String.format(\"String_Node_Str\", BuckConstant.GEN_DIR, importPath);\n MkdirStep mkdirStep = (MkdirStep) steps.get(0);\n assertEquals(\"String_Node_Str\" + outputDirectory, mkdirStep.getPath(executionContext), outputDirectory);\n ShellStep aidlStep = (ShellStep) steps.get(1);\n assertEquals(\"String_Node_Str\", String.format(\"String_Node_Str\", pathToAidlExecutable, pathToFrameworkAidl, importPath, outputDirectory, pathToAidl), aidlStep.getDescription(executionContext));\n assertEquals(2, steps.size());\n verify(androidPlatformTarget, aidlExecutable, frameworkIdlFile, executionContext);\n}\n"
|
"private static void setOnClickListener(Object classObj, View contentView, Method method) {\n OnClick onclick = method.getAnnotation(OnClick.class);\n int[] ids = onclick.value();\n if (ids != null) {\n for (int id : ids) {\n View view = viewFinder.findViewById(id);\n view.setOnClickListener(new EventListener(classObj, method.getName()));\n }\n }\n}\n"
|
"private Object getHadoopClusterRepositoryValue(HadoopClusterConnection hcConnection, String value, IMetadataTable table) {\n if (EHDFSRepositoryToComponent.DISTRIBUTION.getRepositoryValue().equals(value)) {\n return hcConnection.getDistribution();\n } else if (EHDFSRepositoryToComponent.DB_VERSION.getRepositoryValue().equals(value)) {\n return hcConnection.getDfVersion();\n } else if (EHDFSRepositoryToComponent.HADOOP_CUSTOM_JARS.getRepositoryValue().equals(value)) {\n return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection, ECustomVersionGroup.MAP_REDUCE);\n } else if (EHDFSRepositoryToComponent.HADOOP_CUSTOM_JARS_FOR_SPARK.getRepositoryValue().equals(value)) {\n return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection, ECustomVersionGroup.SPARK);\n } else if (EHDFSRepositoryToComponent.HADOOP_CUSTOM_JARS_FOR_SPARKSTREAMING.getRepositoryValue().equals(value)) {\n return HCVersionUtil.getCompCustomJarsParamFromRep(hcConnection, ECustomVersionGroup.SPARK_STREAMING);\n } else if (EHDFSRepositoryToComponent.USE_YARN.getRepositoryValue().equals(value)) {\n return hcConnection.isUseYarn();\n } else if (EHDFSRepositoryToComponent.AUTHENTICATION_MODE.getRepositoryValue().equals(value)) {\n return hcConnection.getAuthMode();\n } else if (EHDFSRepositoryToComponent.FS_DEFAULT_NAME.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getNameNodeURI()));\n } else if (EHDFSRepositoryToComponent.USE_KRB.getRepositoryValue().equals(value)) {\n return hcConnection.isEnableKerberos();\n } else if (EHDFSRepositoryToComponent.NAMENODE_PRINCIPAL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getPrincipal()));\n } else if (EHDFSRepositoryToComponent.JOBTRACKER_PRINCIPAL.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.RESOURCEMANAGER_PRINCIPAL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getJtOrRmPrincipal()));\n } else if (EHDFSRepositoryToComponent.JOBHISTORY_PRINCIPAL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getJobHistoryPrincipal()));\n } else if (EHDFSRepositoryToComponent.GROUP.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getGroup()));\n } else if (EHDFSRepositoryToComponent.USE_MAPRTICKET.getRepositoryValue().equals(value)) {\n return hcConnection.isEnableMaprT();\n } else if (EHDFSRepositoryToComponent.MAPRTICKET_PASSWORD.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getMaprTPassword()));\n } else if (EHDFSRepositoryToComponent.MAPRTICKET_CLUSTER.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getMaprTCluster()));\n } else if (EHDFSRepositoryToComponent.MAPRTICKET_DURATION.getRepositoryValue().equals(value)) {\n return hcConnection.getMaprTDuration();\n } else if (EHDFSRepositoryToComponent.LOCAL.getRepositoryValue().equals(value)) {\n return false;\n } else if (EHDFSRepositoryToComponent.MAPREDUCE.getRepositoryValue().equals(value)) {\n return true;\n } else if (EHDFSRepositoryToComponent.PIG_VERSION.getRepositoryValue().equals(value)) {\n return hcConnection.getDfVersion();\n } else if (EHDFSRepositoryToComponent.MAPRED_JOB_TRACKER.getRepositoryValue().equals(value) || EHDFSRepositoryToComponent.MAPRED_RESOURCE_MANAGER.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getJobTrackerURI());\n } else if (EHDFSRepositoryToComponent.USERNAME.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getUserName()));\n } else if (EHDFSRepositoryToComponent.USE_KEYTAB.getRepositoryValue().equals(value)) {\n return hcConnection.isUseKeytab();\n } else if (EHDFSRepositoryToComponent.KEYTAB_PRINCIPAL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getKeytabPrincipal()));\n } else if (EHDFSRepositoryToComponent.KEYTAB_PATH.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getKeytab()));\n } else if (EParameterNameForComponent.PARA_NAME_WEBHCAT_HOST.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_WEB_HCAT_HOSTNAME));\n } else if (EParameterNameForComponent.PARA_NAME_WEBHCAT_PORT.getName().equals(value)) {\n return hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_WEB_HCAT_PORT);\n } else if (EParameterNameForComponent.PARA_NAME_WEBHCAT_USERNAME.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_WEB_HCAT_USERNAME));\n } else if (EParameterNameForComponent.PARA_NAME_STATUSDIR.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_WEB_HCAT_JOB_RESULT_FOLDER));\n } else if (EParameterNameForComponent.PARA_NAME_HDINSIGHT_USERNAME.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HDI_USERNAME));\n } else if (EParameterNameForComponent.PARA_NAME_HDINSIGHT_PASSWORD.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HDI_PASSWORD));\n } else if (EParameterNameForComponent.PARA_NAME_WASB_HOST.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_AZURE_HOSTNAME));\n } else if (EParameterNameForComponent.PARA_NAME_WASB_CONTAINER.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_AZURE_CONTAINER));\n } else if (EParameterNameForComponent.PARA_NAME_WASB_USERNAME.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_AZURE_USERNAME));\n } else if (EParameterNameForComponent.PARA_NAME_WASB_PASSWORD.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_AZURE_PASSWORD));\n } else if (EParameterNameForComponent.PARA_NAME_REMOTE_FOLDER.getName().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, hcConnection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_AZURE_DEPLOY_BLOB));\n } else if (EHDFSRepositoryToComponent.HADOOP_ADVANCED_PROPERTIES.getRepositoryValue().equals(value)) {\n return HadoopRepositoryUtil.getHadoopPropertiesFullList(hcConnection, hcConnection.getHadoopProperties(), true);\n } else if (EHDFSRepositoryToComponent.SET_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {\n return true;\n } else if (EHDFSRepositoryToComponent.RESOURCEMANAGER_SCHEDULER_ADDRESS.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getRmScheduler()));\n } else if (EHDFSRepositoryToComponent.SET_JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {\n return true;\n } else if (EHDFSRepositoryToComponent.JOBHISTORY_ADDRESS.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getJobHistory()));\n } else if (EHDFSRepositoryToComponent.SET_STAGING_DIRECTORY.getRepositoryValue().equals(value)) {\n return true;\n } else if (EHDFSRepositoryToComponent.STAGING_DIRECTORY.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getStagingDirectory()));\n } else if (EHDFSRepositoryToComponent.USE_DATANODE_HOSTNAME.getRepositoryValue().equals(value)) {\n return hcConnection.isUseDNHost();\n } else if (EHDFSRepositoryToComponent.USE_CLOUDERA_NAVIGATOR.getRepositoryValue().equals(value)) {\n return hcConnection.isUseClouderaNavi();\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_USERNAME.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getClouderaNaviUserName()));\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_PASSWORD.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getClouderaNaviPassword()));\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_URL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getClouderaNaviUrl()));\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_METADATA_URL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getClouderaNaviMetadataUrl()));\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_CLIENT_URL.getRepositoryValue().equals(value)) {\n return getRepositoryValueOfStringType(hcConnection, StringUtils.trimToNull(hcConnection.getClouderaNaviClientUrl()));\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_AUTOCOMMIT.getRepositoryValue().equals(value)) {\n return hcConnection.isClouderaAutoCommit();\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_DISABLE_SSL_VALIDATION.getRepositoryValue().equals(value)) {\n return hcConnection.isClouderaDisableSSL();\n } else if (EHDFSRepositoryToComponent.CLOUDERA_NAVIGATOR_DIE_ON_ERROR.getRepositoryValue().equals(value)) {\n return hcConnection.isClouderaDieNoError();\n }\n return null;\n}\n"
|
"public void removeContactTab(int index) {\n String title = chatTabbedPane.getTitleAt(index);\n if (title != null) {\n if (chatTabbedPane.getTabCount() > 1)\n this.contactTabsTable.remove(title);\n Enumeration contactTabs = this.contactTabsTable.elements();\n while (contactTabs.hasMoreElements()) {\n ChatPanel chatPanel = (ChatPanel) contactTabs.nextElement();\n int tabIndex = chatPanel.getTabIndex();\n if (tabIndex > index) {\n chatPanel.setTabIndex(tabIndex - 1);\n }\n }\n int selectedIndex = chatTabbedPane.getSelectedIndex();\n if (selectedIndex > index) {\n chatTabbedPane.setSelectedIndex(selectedIndex - 1);\n }\n if (chatTabbedPane.getTabCount() > 1)\n chatTabbedPane.remove(index);\n if (chatTabbedPane.getTabCount() == 1) {\n String onlyTabtitle = chatTabbedPane.getTitleAt(0);\n this.getContentPane().remove(chatTabbedPane);\n this.chatTabbedPane.removeAll();\n ChatPanel chatPanel = (ChatPanel) this.contactTabsTable.get(onlyTabtitle);\n this.getContentPane().add(chatPanel, BorderLayout.CENTER);\n this.setCurrentChatPanel(chatPanel);\n this.setTitle(onlyTabtitle);\n }\n }\n int selectedIndex = chatTabbedPane.getSelectedIndex();\n if (selectedIndex > index) {\n chatTabbedPane.setSelectedIndex(selectedIndex - 1);\n }\n if (chatTabbedPane.getTabCount() > 1)\n chatTabbedPane.remove(index);\n if (chatTabbedPane.getTabCount() == 1) {\n String onlyTabtitle = chatTabbedPane.getTitleAt(0);\n this.getContentPane().remove(chatTabbedPane);\n this.chatTabbedPane.removeAll();\n ChatPanel chatPanel = (ChatPanel) this.contactTabsTable.get(onlyTabtitle);\n this.getContentPane().add(chatPanel, BorderLayout.CENTER);\n this.setCurrentChatPanel(chatPanel);\n this.setTitle(onlyTabtitle);\n }\n}\n"
|
"private int addTable(PrintStream out, int offset, String name, StringBuffer tableContent) {\n int result = 0;\n try {\n int[] tableLocation = getTableLocation(name);\n if (tableLocation != null) {\n byte[] tableMetadata = (byte[]) metadataTables.get(name);\n Util.putInt32(tableMetadata, 8, offset);\n result = offset + getEvenLength(tableLocation[1]);\n out.println(Util.toHexString(tableMetadata));\n result = offset + getEvenLength(tableLocation[1]);\n List<byte[]> datas = readTable(name);\n for (byte[] data : datas) {\n tableContent.append(\"String_Node_Str\" + toPSDataString(Util.toHexString(data)));\n }\n }\n } catch (Exception e) {\n logger.log(Level.WARNING, \"String_Node_Str\" + name);\n }\n return result;\n}\n"
|
"public boolean apply(Game game, Ability source) {\n boolean result = false;\n for (UUID targetId : getTargetPointer().getTargets(game, source)) {\n Card card = game.getCard(targetId);\n if (card != null) {\n Player player = game.getPlayer(source.getControllerId());\n if (player != null) {\n if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), tapped)) {\n Permanent permanent = game.getPermanent(source.getSourceId());\n if (permanent != null) {\n permanent.changeControllerId(source.getControllerId(), game);\n result = true;\n }\n }\n }\n }\n }\n return result;\n}\n"
|
"protected void closeFirstN(int size) {\n for (int i = 0; i < size; i++) {\n closeLayout(contextList.removeFirst(), i, rowSize, i, false);\n }\n setCurrentContext(0);\n if (parent != null) {\n parent.closeFirstN(size);\n }\n}\n"
|
"public void payAllInvoices(final UUID accountId, final boolean externalPayment, final BigDecimal paymentAmount, final String createdBy, final String reason, final String comment) throws KillBillClientException {\n final String uri = JaxrsResource.ACCOUNTS_PATH + \"String_Node_Str\" + accountId + \"String_Node_Str\" + JaxrsResource.PAYMENTS;\n final Map<String, String> params = new HashMap<String, String>();\n params.put(JaxrsResource.QUERY_PAYMENT_EXTERNAL, String.valueOf(externalPayment));\n if (paymentAmount != null) {\n params.put(\"String_Node_Str\", String.valueOf(paymentAmount));\n }\n final Map<String, String> queryParams = paramsWithAudit(params, createdBy, reason, comment);\n httpClient.doPost(uri, null, queryParams);\n}\n"
|
"public static void handleOnCreate(CellContent content, IRowData rowData, ExecutionContext context) {\n try {\n ReportItemDesign cellDesign = (ReportItemDesign) content.getGenerateBy();\n ICellInstance cell = new CellInstance(content, context);\n if (handleJS(cell, cellDesign.getOnCreate(), context).didRun())\n return;\n CellHandle handle = (CellHandle) cellDesign.getHandle();\n if (handle != null) {\n ICellEventHandler eh = (ICellEventHandler) getInstance((CellHandle) cellDesign.getHandle());\n if (eh != null)\n eh.onCreate(cell, rowData, context.getReportContext());\n }\n } catch (Exception e) {\n log.log(Level.WARNING, e.getMessage(), e);\n }\n}\n"
|
"private static PropertiesConfigSource configSource(String identifier) throws Exception {\n boolean hocon = isHoconPath(identifier);\n if (!hocon && !identifier.startsWith(\"String_Node_Str\"))\n throw new IllegalArgumentException(String.format(\"String_Node_Str\", identifier));\n if (hocon) {\n try {\n return (PropertiesConfigSource) Class.forName(HOCON_CFG_SRC_CNAME).newInstance();\n } catch (ClassNotFoundException e) {\n int sfx_index = identifier.lastIndexOf('#');\n String resourcePath = sfx_index > 0 ? identifier.substring(HOCON_PFX_LEN, sfx_index) : identifier.substring(HOCON_PFX_LEN);\n if (BasicMultiPropertiesConfig.class.getResource(resourcePath) == null)\n throw new FileNotFoundException(String.format(\"String_Node_Str\", resourcePath, identifier));\n else\n throw new Exception(String.format(\"String_Node_Str\", identifier), e);\n }\n } else if (\"String_Node_Str\".equals(identifier))\n return new SystemPropertiesConfigSource();\n else\n return new BasicPropertiesConfigSource();\n}\n"
|
"private void initHeaderQos(IoBuffer buff, int messageID, QOSType... qoss) throws IllegalAccessException {\n buff.clear().put((byte) (AbstractMessage.SUBACK << 4)).put(Utils.encodeRemainingLength(2 + qoss.length));\n Utils.writeWord(buff, messageID);\n for (QOSType qos : qoss) {\n buff.put((byte) qos.ordinal());\n }\n}\n"
|
"protected void agents() {\n Random randomGenerator = new Random();\n for (int i = 0; i < 50; i++) {\n addAgent(new LoansAgent(20, 2, AgentType.AC, randomGenerator.nextDouble(), randomGenerator.nextDouble()));\n }\n}\n"
|
"public Optional<ObjectId> resolveIndexedTree(IndexInfo index, ObjectId treeId) {\n ObjectId indexTreeLookupId = computeIndexTreeLookupId(index.getId(), treeId);\n byte[] indexTreeBytes;\n try (RocksDBReference dbRef = dbhandle.getReference()) {\n indexTreeBytes = dbRef.db().get(indexMappingsColumn, indexTreeLookupId.getRawValue());\n } catch (RocksDBException e) {\n throw Throwables.propagate(e);\n }\n if (indexTreeBytes != null) {\n return Optional.of(ObjectId.createNoClone(indexTreeBytes));\n }\n return Optional.absent();\n}\n"
|
"public void notifyConnections(IndicatorLink link, boolean hasOpened) {\n if (hasOpened && mylink == null) {\n this.mylink = link;\n this.mylink.initConnection(this.dataSource, false);\n } else if (!hasOpened && link == this.mylink) {\n this.close();\n this.dispose();\n }\n}\n"
|
"public void execute(SmtpConnection conn, SmtpState state, SmtpManager manager, String commandLine) {\n Matcher m = param.matcher(commandLine);\n try {\n if (m.matches()) {\n String from = m.group(1);\n if (!from.isEmpty()) {\n MailAddress fromAddr = new MailAddress(from);\n String err = manager.checkSender(state, fromAddr);\n if (err != null) {\n conn.send(err);\n return;\n }\n state.clearMessage();\n state.getMessage().setReturnPath(fromAddr);\n conn.send(\"String_Node_Str\");\n } else {\n state.clearMessage();\n state.getMessage();\n conn.send(\"String_Node_Str\");\n }\n state.clearMessage();\n state.getMessage().setReturnPath(fromAddr);\n conn.send(\"String_Node_Str\");\n } else {\n conn.send(\"String_Node_Str\");\n }\n } catch (AddressException e) {\n conn.send(\"String_Node_Str\");\n }\n}\n"
|
"public boolean checkTrigger(GameEvent event, Game game) {\n if (!onlyCombat || ((DamagedPlayerEvent) event).isCombatDamage()) {\n Permanent permanent = game.getPermanent(event.getSourceId());\n if (permanent != null) {\n if (filter.match(permanent, getSourceId(), getControllerId(), game)) {\n for (Effect effect : this.getEffects()) {\n effect.setValue(\"String_Node_Str\", event.getAmount());\n switch(setTargetPointer) {\n case PLAYER:\n effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));\n break;\n case PERMANENT:\n effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game)));\n break;\n }\n }\n return true;\n }\n }\n }\n return false;\n}\n"
|
"public Object xmlToObject(DOMRecord xmlRow, Class referenceClass) throws XMLMarshalException {\n String xmlEncoding = \"String_Node_Str\";\n String xmlVersion = \"String_Node_Str\";\n try {\n Method getEncoding = PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(), \"String_Node_Str\", new Class[] {}, true);\n Method getVersion = PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(), \"String_Node_Str\", new Class[] {}, true);\n xmlEncoding = (String) PrivilegedAccessHelper.invokeMethod(getEncoding, xmlRow.getDocument(), new Object[] {});\n xmlVersion = (String) PrivilegedAccessHelper.invokeMethod(getVersion, xmlRow.getDocument(), new Object[] {});\n } catch (Exception ex) {\n }\n XMLContext xmlContext = xmlUnmarshaller.getXMLContext();\n if (XMLConversionManager.getDefaultJavaTypes().get(referenceClass) != null || ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(referenceClass) || ClassConstants.DURATION.isAssignableFrom(referenceClass)) {\n Object nodeVal;\n try {\n Text rootTxt = (Text) xmlRow.getDOM().getFirstChild();\n nodeVal = rootTxt.getNodeValue();\n } catch (Exception ex) {\n nodeVal = null;\n }\n Object obj = ((XMLConversionManager) xmlContext.getSession(0).getDatasourcePlatform().getConversionManager()).convertObject(nodeVal, referenceClass);\n XMLRoot xmlRoot = new XMLRoot();\n xmlRoot.setObject(obj);\n String lName = xmlRow.getDOM().getLocalName();\n if (lName == null) {\n lName = xmlRow.getDOM().getNodeName();\n }\n xmlRoot.setLocalName(lName);\n xmlRoot.setNamespaceURI(xmlRow.getDOM().getNamespaceURI());\n xmlRoot.setEncoding(xmlEncoding);\n xmlRoot.setVersion(xmlVersion);\n return xmlRoot;\n }\n AbstractSession readSession = xmlContext.getReadSession(referenceClass);\n XMLDescriptor descriptor = (XMLDescriptor) readSession.getDescriptor(referenceClass);\n if (descriptor == null) {\n throw XMLMarshalException.descriptorNotFoundInProject(referenceClass.getName());\n }\n Object object = null;\n if (null == xmlRow.getDOM().getAttributes().getNamedItemNS(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_NIL_ATTRIBUTE)) {\n xmlRow.setUnmarshaller(xmlUnmarshaller);\n xmlRow.setDocPresPolicy(xmlContext.getDocumentPreservationPolicy(readSession));\n XMLObjectBuilder objectBuilder = (XMLObjectBuilder) descriptor.getObjectBuilder();\n ReadObjectQuery query = new ReadObjectQuery();\n query.setReferenceClass(referenceClass);\n query.setSession(readSession);\n object = objectBuilder.buildObject(query, xmlRow, null);\n xmlUnmarshaller.resolveReferences(readSession);\n }\n String elementNamespaceUri = xmlRow.getDOM().getNamespaceURI();\n String elementLocalName = xmlRow.getDOM().getLocalName();\n if (elementLocalName == null) {\n elementLocalName = xmlRow.getDOM().getNodeName();\n }\n String elementPrefix = xmlRow.getDOM().getPrefix();\n return descriptor.wrapObjectInXMLRoot(object, elementNamespaceUri, elementLocalName, elementPrefix, xmlEncoding, xmlVersion, this.isResultAlwaysXMLRoot, xmlUnmarshaller.isNamespaceAware());\n}\n"
|
"private String getTableComment(String tableName, ResultSet tablesSet) throws SQLException {\n String tableComment = tablesSet.getString(GetTable.REMARKS.name());\n if (StringUtils.isBlank(tableComment)) {\n String selectRemarkOnTable = dbms.getSelectRemarkOnTable(tableName);\n if (selectRemarkOnTable != null) {\n tableComment = executeGetCommentStatement(selectRemarkOnTable);\n }\n }\n return tableComment;\n}\n"
|
"Composite createCustomControl(Composite parent) {\n ScrolledComposite scrollContent = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);\n scrollContent.setAlwaysShowScrollBars(false);\n scrollContent.setExpandHorizontal(true);\n scrollContent.setLayout(new FillLayout());\n Composite content = new Composite(scrollContent, SWT.NONE);\n GridLayout layout = new GridLayout();\n layout.numColumns = 4;\n layout.verticalSpacing = 10;\n layout.marginBottom = 300;\n content.setLayout(layout);\n GridData gridData;\n new Label(content, SWT.RIGHT).setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n driverChooserCombo = new ComboViewer(content, SWT.DROP_DOWN);\n gridData = new GridData(GridData.FILL_HORIZONTAL);\n gridData.horizontalSpan = 3;\n driverChooserCombo.getControl().setLayoutData(gridData);\n List driverListTmp1 = JdbcToolKit.getJdbcDriversFromODADir(JDBC_EXTENSION_ID);\n JDBCDriverInformation[] driverListTmp2 = JDBCDriverInfoManager.getDrivers();\n List driverList = new ArrayList();\n for (Object driverInfo : driverListTmp1) {\n if (needCheckHide(driverListTmp2, (JDBCDriverInformation) driverInfo)) {\n if (!((JDBCDriverInformation) driverInfo).getHide()) {\n driverList.add(driverInfo);\n }\n } else {\n driverList.add(driverInfo);\n }\n }\n driverChooserCombo.setContentProvider(new IStructuredContentProvider() {\n public Object[] getElements(Object inputElement) {\n if (inputElement != null) {\n return ((ArrayList) inputElement).toArray();\n }\n return new JDBCDriverInformation[] {};\n }\n public void dispose() {\n }\n public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {\n }\n });\n driverChooserCombo.setLabelProvider(new LabelProvider() {\n public String getText(Object inputElement) {\n JDBCDriverInformation info = (JDBCDriverInformation) inputElement;\n return info.getDisplayString();\n }\n });\n driverChooserCombo.setInput(sortDriverList(driverList));\n driverChooserCombo.addSelectionChangedListener(new ISelectionChangedListener() {\n private String driverClassName;\n public void selectionChanged(SelectionChangedEvent event) {\n StructuredSelection selection = (StructuredSelection) event.getSelection();\n final JDBCDriverInformation info = (JDBCDriverInformation) selection.getFirstElement();\n String className = (info != null) ? info.getDriverClassName() : EMPTY_STRING;\n if (className.equalsIgnoreCase(driverClassName) == true)\n return;\n driverClassName = className;\n if (info != null) {\n if (info.getUrlFormat() != null) {\n jdbcUrl.setText(info.getUrlFormat());\n } else {\n jdbcUrl.setText(EMPTY_STRING);\n }\n ((GridData) porpertyGroupComposite.getLayoutData()).exclude = true;\n porpertyGroupComposite.setVisible(false);\n porpertyGroupComposite.getParent().layout();\n Control[] children = porpertyGroupComposite.getChildren();\n for (int i = 0; i < children.length; i++) {\n children[i].dispose();\n }\n if (info.hasProperty()) {\n drawPropertyGroups(info);\n }\n porpertyGroupComposite.getParent().layout();\n }\n jndiName.setText(EMPTY_STRING);\n userName.setText(EMPTY_STRING);\n password.setText(EMPTY_STRING);\n updateTestButton();\n }\n private void drawPropertyGroups(final JDBCDriverInformation info) {\n ((GridData) porpertyGroupComposite.getLayoutData()).exclude = false;\n porpertyGroupComposite.setVisible(true);\n ((GridData) porpertyGroupComposite.getLayoutData()).heightHint = SWT.DEFAULT;\n databaseProperties.clear();\n List<PropertyGroup> propertyGroups = info.getPropertyGroup();\n for (Iterator it = propertyGroups.iterator(); it.hasNext(); ) {\n PropertyGroup group = (PropertyGroup) (it.next());\n String propertyGroupName = group.getName();\n List<PropertyElement> propertyList = group.getProperties();\n Group propertyGroup = drawPropertyGroup(propertyGroupName == null ? EMPTY_STRING : propertyGroupName);\n for (int i = 0; i < propertyList.size(); i++) {\n final String propertyName = propertyList.get(i).getAttribute(Constants.DRIVER_INFO_PROPERTY_NAME);\n Label propertyParam = new Label(propertyGroup, SWT.NONE);\n String propertyParamDisplayName = propertyList.get(i).getAttribute(Constants.DRIVER_INFO_PROPERTY_DISPLAYNAME);\n if (propertyParamDisplayName == null) {\n propertyParamDisplayName = propertyName;\n }\n propertyParam.setText(propertyParamDisplayName);\n propertyParam.setToolTipText(propertyList.get(i).getAttribute(Constants.DRIVER_INFO_PROPERTY_DEC));\n GridData gd = new GridData();\n gd.horizontalSpan = 2;\n propertyParam.setLayoutData(gd);\n String propertyContent = null;\n if (profileProperties != null && !profileProperties.isEmpty()) {\n propertyContent = getProfileproperty(propertyName);\n }\n if (Constants.DRIVER_INFO_PROPERTY_TYPE_BOOLEN.equalsIgnoreCase(propertyList.get(i).getAttribute(Constants.DRIVER_INFO_PROPERTY_TYPE))) {\n drawPropertyCombo(propertyGroup, propertyName, propertyContent);\n } else {\n if (Boolean.valueOf(propertyList.get(i).getAttribute(Constants.DRIVER_INFO_PROPERTY_ENCRYPT))) {\n drawPropertyText(propertyGroup, propertyName, propertyContent, true);\n } else\n drawPropertyText(propertyGroup, propertyName, propertyContent, false);\n }\n }\n propertyGroup.getParent().layout();\n }\n }\n private void drawPropertyText(Group propertyGroup, final String propertyName, String propertyContent, boolean encrypt) {\n GridData gd;\n final Text propertyText;\n if (encrypt) {\n propertyText = new Text(propertyGroup, SWT.BORDER | SWT.PASSWORD);\n } else {\n propertyText = new Text(propertyGroup, SWT.BORDER);\n }\n boolean isEncryptionMethod = Constants.DRIVER_INFO_PROPERTY_ENCRYPTION_METHOD.equals(propertyName);\n if (propertyContent != null) {\n propertyText.setText(propertyContent);\n databaseProperties.put(propertyName, propertyContent);\n } else if (isEncryptionMethod) {\n propertyText.setText(ENCRYTPION_METHOD_DEFAULT_VALUE);\n }\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 3;\n propertyText.setLayoutData(gd);\n if (isEncryptionMethod) {\n Label blankLabel = new Label(propertyGroup, SWT.NONE);\n GridData blankLabelGd = new GridData();\n blankLabelGd.horizontalSpan = 2;\n blankLabel.setLayoutData(blankLabelGd);\n Label prompLabel = new Label(propertyGroup, SWT.NONE);\n prompLabel.setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n GridData labelGd = new GridData(GridData.FILL_HORIZONTAL);\n labelGd.horizontalSpan = 3;\n prompLabel.setLayoutData(labelGd);\n }\n propertyText.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent e) {\n databaseProperties.put(propertyName, propertyText.getText());\n }\n });\n propertyText.getParent().layout();\n }\n private void drawPropertyCombo(Group propertyGroup, final String propertyName, String propertyContent) {\n GridData gd;\n final Combo propertyField = new Combo(propertyGroup, SWT.BORDER | SWT.READ_ONLY);\n propertyField.setItems(new String[] { EMPTY_STRING, \"String_Node_Str\", \"String_Node_Str\" });\n if (propertyContent != null) {\n propertyField.setText(propertyContent);\n databaseProperties.put(propertyName, propertyContent);\n } else\n propertyField.setText(EMPTY_STRING);\n propertyField.addSelectionListener(new SelectionListener() {\n public void widgetSelected(SelectionEvent arg0) {\n if (propertyField.getSelectionIndex() == 1) {\n databaseProperties.put(propertyName, \"String_Node_Str\");\n } else if (propertyField.getSelectionIndex() == 2) {\n databaseProperties.put(propertyName, \"String_Node_Str\");\n } else {\n databaseProperties.put(propertyName, EMPTY_STRING);\n }\n }\n public void widgetDefaultSelected(SelectionEvent arg0) {\n databaseProperties.put(propertyName, EMPTY_STRING);\n }\n });\n gd = new GridData(GridData.FILL_HORIZONTAL);\n gd.horizontalSpan = 3;\n gd.horizontalAlignment = SWT.FILL;\n propertyField.setLayoutData(gd);\n propertyField.getParent().layout();\n }\n private Group drawPropertyGroup(String propertyGroupName) {\n GridData gridData;\n Group propertyGroup = new Group(porpertyGroupComposite, SWT.NONE);\n gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);\n gridData.horizontalSpan = 4;\n gridData.horizontalAlignment = SWT.FILL;\n propertyGroup.setText(propertyGroupName);\n propertyGroup.setLayoutData(gridData);\n GridLayout layout = new GridLayout();\n layout.marginWidth = layout.marginHeight = 0;\n layout.numColumns = 5;\n Layout parentLayout = porpertyGroupComposite.getParent().getLayout();\n if (parentLayout instanceof GridLayout)\n layout.horizontalSpacing = ((GridLayout) parentLayout).horizontalSpacing;\n propertyGroup.setLayout(layout);\n return propertyGroup;\n }\n private String getProfileproperty(String propertyName) {\n return profileProperties.getProperty(propertyName);\n }\n });\n new Label(content, SWT.RIGHT).setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n jdbcUrl = new Text(content, SWT.BORDER);\n gridData = new GridData();\n gridData.horizontalSpan = 3;\n gridData.horizontalAlignment = SWT.FILL;\n gridData.grabExcessHorizontalSpace = true;\n jdbcUrl.setLayoutData(gridData);\n new Label(content, SWT.RIGHT).setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n userName = new Text(content, SWT.BORDER);\n gridData = new GridData();\n gridData.horizontalSpan = 3;\n gridData.horizontalAlignment = SWT.FILL;\n userName.setLayoutData(gridData);\n new Label(content, SWT.RIGHT).setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n password = new Text(content, SWT.BORDER | SWT.PASSWORD);\n gridData = new GridData();\n gridData.horizontalSpan = 3;\n gridData.horizontalAlignment = SWT.FILL;\n password.setLayoutData(gridData);\n String jndiLabel = JdbcPlugin.getResourceString(\"String_Node_Str\");\n new Label(content, SWT.RIGHT).setText(jndiLabel);\n jndiName = new Text(content, SWT.BORDER);\n gridData = new GridData();\n gridData.horizontalSpan = 3;\n gridData.horizontalAlignment = SWT.FILL;\n jndiName.setLayoutData(gridData);\n createPropertiesComposite(content);\n manageButton = new Button(content, SWT.PUSH);\n manageButton.setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n testButton = new Button(content, SWT.PUSH);\n testButton.setText(JdbcPlugin.getResourceString(\"String_Node_Str\"));\n testButton.setLayoutData(new GridData(GridData.CENTER));\n Point size = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);\n content.setSize(size.x, size.y);\n scrollContent.setMinWidth(size.x + 10);\n scrollContent.setContent(content);\n addControlListeners();\n updateTestButton();\n verifyJDBCProperties();\n Utility.setSystemHelp(getControl(), IHelpConstants.CONEXT_ID_DATASOURCE_JDBC);\n return content;\n}\n"
|
"private void appendStartTag(LineSegmentData segmentData) {\n line.append(\"String_Node_Str\").append(lineNumber).append('s').append(segmentIndex).append(\"String_Node_Str\");\n appendTooltipWithExecutionCounts(segmentData);\n if (segmentData.isCovered()) {\n if (segmentData.containsCallPoints()) {\n formattedLine.append(\"String_Node_Str\").append(segmentIndex).append(\"String_Node_Str\");\n } else {\n line.append(\"String_Node_Str\");\n }\n } else {\n line.append(\"String_Node_Str\");\n }\n}\n"
|
"private static ArrayList<Integer> readFeaturesFromFile(File file, Alphabet dataAlphabet) {\n ArrayList<Integer> features = new ArrayList<Integer>();\n try {\n BufferedReader reader = new BufferedReader(new FileReader(file));\n String line = reader.readLine();\n while (line != null) {\n int featureIndex = dataAlphabet.lookupIndex(line, false);\n features.add(featureIndex);\n line = reader.readLine().trim();\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(1);\n }\n return features;\n}\n"
|
"public void setTargetResourceUrl(IIdType theTargetResourceUrl) {\n Validate.isTrue(theTargetResourceUrl.hasBaseUrl());\n Validate.isTrue(theTargetResourceUrl.hasResourceType());\n if (theTargetResourceUrl.hasIdPart()) {\n } else {\n }\n myTargetResourceType = theTargetResourceUrl.getResourceType();\n myTargetResourceUrl = theTargetResourceUrl.getValue();\n}\n"
|
"protected void copyFromHost(MapHost host) throws IOException {\n List<InputAttemptIdentifier> srcAttempts = scheduler.getMapsForHost(host);\n if (srcAttempts.size() == 0) {\n return;\n }\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + id + \"String_Node_Str\" + host + \"String_Node_Str\" + srcAttempts + \"String_Node_Str\" + currentPartition);\n }\n remaining = new LinkedHashSet<InputAttemptIdentifier>(srcAttempts);\n DataInputStream input;\n boolean connectSucceeded = false;\n try {\n URL url = getMapOutputURL(host, srcAttempts);\n HttpURLConnection connection = openConnection(url);\n String msgToEncode = SecureShuffleUtils.buildMsgFrom(url);\n String encHash = SecureShuffleUtils.hashFromString(msgToEncode, jobTokenSecret);\n connection.addRequestProperty(SecureShuffleUtils.HTTP_HEADER_URL_HASH, encHash);\n connection.setReadTimeout(readTimeout);\n connection.addRequestProperty(ShuffleHeader.HTTP_HEADER_NAME, ShuffleHeader.DEFAULT_HTTP_HEADER_NAME);\n connection.addRequestProperty(ShuffleHeader.HTTP_HEADER_VERSION, ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION);\n connect(connection, connectionTimeout);\n connectSucceeded = true;\n input = new DataInputStream(new BufferedInputStream(connection.getInputStream(), bufferSize));\n int rc = connection.getResponseCode();\n if (rc != HttpURLConnection.HTTP_OK) {\n throw new IOException(\"String_Node_Str\" + rc + \"String_Node_Str\" + url + \"String_Node_Str\" + connection.getResponseMessage());\n }\n if (!ShuffleHeader.DEFAULT_HTTP_HEADER_NAME.equals(connection.getHeaderField(ShuffleHeader.HTTP_HEADER_NAME)) || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(connection.getHeaderField(ShuffleHeader.HTTP_HEADER_VERSION))) {\n throw new IOException(\"String_Node_Str\");\n }\n String replyHash = connection.getHeaderField(SecureShuffleUtils.HTTP_HEADER_REPLY_URL_HASH);\n if (replyHash == null) {\n throw new IOException(\"String_Node_Str\");\n }\n LOG.debug(\"String_Node_Str\" + msgToEncode + \"String_Node_Str\" + encHash + \"String_Node_Str\" + replyHash);\n SecureShuffleUtils.verifyReply(replyHash, encHash, jobTokenSecret);\n LOG.info(\"String_Node_Str\" + msgToEncode + \"String_Node_Str\");\n } catch (IOException ie) {\n ioErrs.increment(1);\n LOG.warn(\"String_Node_Str\" + host + \"String_Node_Str\" + remaining.size() + \"String_Node_Str\", ie);\n if (!connectSucceeded) {\n for (InputAttemptIdentifier left : remaining) {\n scheduler.copyFailed(left, host, connectSucceeded);\n }\n remaining.clear();\n } else {\n InputAttemptIdentifier firstMap = srcAttempts.get(0);\n scheduler.copyFailed(firstMap, host, connectSucceeded);\n remaining.remove(firstMap);\n }\n for (InputAttemptIdentifier left : remaining) {\n scheduler.putBackKnownMapOutput(host, left);\n }\n return;\n }\n try {\n InputAttemptIdentifier[] failedTasks = null;\n while (!remaining.isEmpty() && failedTasks == null) {\n failedTasks = copyMapOutput(host, input);\n }\n if (failedTasks != null && failedTasks.length > 0) {\n LOG.warn(\"String_Node_Str\" + Arrays.toString(failedTasks));\n for (InputAttemptIdentifier left : failedTasks) {\n scheduler.copyFailed(left, host, true);\n remaining.remove(left);\n }\n }\n IOUtils.cleanup(LOG, input);\n if (failedTasks == null && !remaining.isEmpty()) {\n throw new IOException(\"String_Node_Str\" + remaining.size() + \"String_Node_Str\");\n }\n } finally {\n for (InputAttemptIdentifier left : remaining) {\n scheduler.putBackKnownMapOutput(host, left);\n }\n }\n}\n"
|
"public String doProcess(ResolverContext context) throws ProcessorException {\n IDDBService app = (IDDBService) context.getServletContext().getAttribute(\"String_Node_Str\");\n HttpServletRequest req = context.getRequest();\n String id = context.getParameter(\"String_Node_Str\");\n log.debug(\"String_Node_Str\", id);\n Player player;\n try {\n player = app.getPlayer(id);\n } catch (Exception e) {\n StringWriter w = new StringWriter();\n e.printStackTrace(new PrintWriter(w));\n log.error(w.getBuffer().toString());\n throw new HttpError(HttpServletResponse.SC_NOT_FOUND);\n }\n Server server;\n try {\n server = app.getServer(player.getServer(), true);\n } catch (EntityDoesNotExistsException e) {\n StringWriter w = new StringWriter();\n e.printStackTrace(new PrintWriter(w));\n log.error(w.getBuffer().toString());\n throw new ProcessorException(e);\n }\n Integer minLevel = server.getAdminLevel();\n Boolean hasAdmin = UserServiceFactory.getUserService().hasAnyServer(minLevel);\n Boolean hasServerAdmin = UserServiceFactory.getUserService().hasPermission(server.getKey());\n Boolean canApplyAction = Boolean.FALSE;\n Player currentPlayer = UserServiceFactory.getUserService().getSubjectPlayer(server.getKey());\n if (currentPlayer != null && (currentPlayer.getLevel() > player.getLevel())) {\n canApplyAction = true;\n }\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\", UserServiceFactory.getUserService().getCurrentUser().getLoginId());\n log.debug(\"String_Node_Str\", currentPlayer);\n log.debug(\"String_Node_Str\", minLevel);\n log.debug(\"String_Node_Str\", hasAdmin);\n log.debug(\"String_Node_Str\", hasServerAdmin);\n log.debug(\"String_Node_Str\", canApplyAction);\n }\n List<NoticeViewBean> notices = null;\n List<PenaltyEventViewBean> events = null;\n PlayerViewBean infoView = new PlayerViewBean();\n infoView.setKey(player.getKey().toString());\n infoView.setName(player.getNickname());\n if (hasAdmin) {\n infoView.setGuid(player.getGuid());\n infoView.setIp(player.getIp());\n } else {\n infoView.setIp(Functions.maskIpAddress(player.getIp()));\n }\n infoView.setUpdated(player.getUpdated());\n infoView.setServer(server);\n if (hasAdmin) {\n getLastPlayerPenalty(app, player, infoView);\n notices = getPlayerNotices(app, player);\n events = listPlayerEvents(app, player, server);\n } else {\n if (player.getBanInfo() != null) {\n infoView.setBanInfo(new PenaltyViewBean(true));\n }\n }\n infoView.setAliases(new ArrayList<AliasResult>());\n infoView.setClientId(player.getClientId() != null ? \"String_Node_Str\" + player.getClientId().toString() : \"String_Node_Str\");\n infoView.setPlaying(player.isConnected());\n if (hasAdmin && player.getLevel() != null) {\n infoView.setLevel(player.getLevel().toString());\n } else {\n infoView.setLevel(\"String_Node_Str\");\n }\n req.setAttribute(\"String_Node_Str\", infoView);\n req.setAttribute(\"String_Node_Str\", events);\n req.setAttribute(\"String_Node_Str\", server);\n req.setAttribute(\"String_Node_Str\", notices);\n req.setAttribute(\"String_Node_Str\", hasAdmin);\n req.setAttribute(\"String_Node_Str\", hasServerAdmin);\n req.setAttribute(\"String_Node_Str\", server.getRemotePermission());\n req.setAttribute(\"String_Node_Str\", canApplyAction);\n return null;\n}\n"
|
"private float getContentHeight(IContent content) {\n return ExcelUtil.convertDimensionType(content.getHeight(), 0, reportDpi) / 1000;\n}\n"
|
"public boolean hasNext() {\n if (methods == null && clazz == null)\n return false;\n if (methods == null || !methods.hasNext()) {\n if (clazz == null || (scanWhile != null && !scanWhile.apply(clazz)))\n return false;\n methods = Arrays.asList(clazz.getDeclaredMethods()).iterator();\n clazz = clazz.getSuperclass();\n }\n return methods.hasNext();\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player player = game.getPlayer(source.getControllerId());\n Permanent hellcarverDemon = game.getPermanent(source.getSourceId());\n for (Permanent permanent : game.getBattlefield().getActivePermanents(filterPermanents, source.getControllerId(), game)) {\n if (!Objects.equals(permanent, hellcarverDemon)) {\n permanent.sacrifice(source.getSourceId(), game);\n }\n }\n if (player != null && !player.getHand().isEmpty()) {\n int cardsInHand = player.getHand().size();\n player.discard(cardsInHand, source, game);\n }\n for (int i = 0; i < 6; i++) {\n if (player != null && player.getLibrary().size() > 0) {\n Card topCard = player.getLibrary().getFromTop(game);\n topCard.moveToExile(source.getSourceId(), \"String_Node_Str\", source.getSourceId(), game);\n }\n }\n while (player != null && player.canRespond() && player.chooseUse(Outcome.PlayForFree, \"String_Node_Str\", source, game)) {\n TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());\n while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(source.getSourceId()), target, game)) {\n Card card = game.getCard(target.getFirstTarget());\n if (card != null) {\n game.getExile().removeCard(card, game);\n player.cast(card.getSpellAbility(), game, true);\n }\n target.clearChosen();\n }\n return true;\n }\n return false;\n}\n"
|
"private void verifyUpScale(String clusterName, int scalingAdjustment) {\n if (isUpScale(scalingAdjustment)) {\n verify(MOCK_ROOT + \"String_Node_Str\", \"String_Node_Str\").exactTimes(1).verify();\n verify(MOCK_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\", scalingAdjustment).exactTimes(1).verify();\n verify(SALT_BOOT_ROOT + \"String_Node_Str\", \"String_Node_Str\").atLeast(1).verify();\n verify(SALT_BOOT_ROOT + \"String_Node_Str\", \"String_Node_Str\").atLeast(1).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").exactTimes(1).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").exactTimes(2).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").atLeast(2).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").atLeast(1).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").atLeast(1).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").exactTimes(1).verify();\n verify(SALT_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").exactTimes(0).verify();\n verify(SALT_BOOT_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyRegexp(\"String_Node_Str\" + scalingAdjustment + \"String_Node_Str\").exactTimes(1).verify();\n verify(SALT_BOOT_ROOT + \"String_Node_Str\", \"String_Node_Str\").bodyContains(\"String_Node_Str\").exactTimes(1).verify();\n verify(AMBARI_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").atLeast(1).verify();\n verify(AMBARI_API_ROOT + \"String_Node_Str\", \"String_Node_Str\").exactTimes(1).verify();\n verify(AMBARI_API_ROOT + \"String_Node_Str\" + clusterName, \"String_Node_Str\").atLeast(1).verify();\n }\n}\n"
|
"public String desc() {\n return \"String_Node_Str\";\n}\n"
|
"private Serializable getConfig(String key, Serializable defaultValue) {\n Serializable result = config != null ? config.get(key) : null;\n return result != null ? result : defaultValue;\n}\n"
|
"public boolean onUserEventsSelected() {\n String user = new StoreCredentials(this).getUserName();\n if (user != null) {\n setFragment(EventsListFragment.newInstance(user), false);\n }\n return true;\n}\n"
|
"public Set<Class<?>> scan(String[] packages) {\n this.classes = new HashSet<Class<?>>();\n for (String p : packages) {\n try {\n String fileP = p.replace('.', '/');\n Enumeration<URL> urls = classloader.getResources(fileP);\n while (urls.hasMoreElements()) {\n URL url = urls.nextElement();\n try {\n URI uri = getURI(url);\n index(uri, fileP);\n } catch (URISyntaxException e) {\n LOGGER.warning(\"String_Node_Str\" + url + \"String_Node_Str\");\n }\n }\n } catch (IOException ex) {\n String s = \"String_Node_Str\" + p + \"String_Node_Str\";\n LOGGER.severe(s);\n throw new RuntimeException(s, ex);\n }\n }\n return classes;\n}\n"
|
"public static int sendPendingMax(Config cfg) {\n return cfg.getIntegerValue(SEND_PENDING_MAX, 16);\n}\n"
|
"public int compare(MapEntry o1, MapEntry o2) {\n int result = comparator.compare(o1, o2);\n if (result == 0) {\n Record r1 = (Record) o1;\n Record r2 = (Record) o2;\n return r1.getId().compareTo(r2.getId());\n } else {\n return result;\n }\n}\n"
|
"public ItemStack transferStackInSlot(EntityPlayer p, int idx) {\n if (Platform.isClient())\n return null;\n boolean hasMETiles = false;\n for (Object is : this.inventorySlots) {\n if (is instanceof InternalSlotME) {\n hasMETiles = true;\n break;\n }\n }\n if (hasMETiles && Platform.isClient()) {\n return null;\n }\n ItemStack tis = null;\n AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx);\n if (clickSlot instanceof SlotDisabled || clickSlot instanceof SlotInaccessable)\n return null;\n if (clickSlot != null && clickSlot.getHasStack()) {\n tis = clickSlot.getStack();\n if (tis == null)\n return null;\n List<Slot> selectedSlots = new ArrayList<Slot>();\n if (clickSlot.isPlayerSide()) {\n tis = shiftStoreItem(tis);\n for (int x = 0; x < this.inventorySlots.size(); x++) {\n AppEngSlot cs = (AppEngSlot) this.inventorySlots.get(x);\n if (!(cs.isPlayerSide()) && !(cs instanceof SlotFake) && !(cs instanceof SlotCraftingMatrix)) {\n if (cs.isItemValid(tis))\n selectedSlots.add(cs);\n }\n }\n } else {\n for (int x = 0; x < this.inventorySlots.size(); x++) {\n AppEngSlot cs = (AppEngSlot) this.inventorySlots.get(x);\n if ((cs.isPlayerSide()) && !(cs instanceof SlotFake) && !(cs instanceof SlotCraftingMatrix)) {\n if (cs.isItemValid(tis))\n selectedSlots.add(cs);\n }\n }\n }\n if (selectedSlots.isEmpty() && clickSlot.isPlayerSide()) {\n if (tis != null) {\n for (int x = 0; x < this.inventorySlots.size(); x++) {\n AppEngSlot cs = (AppEngSlot) this.inventorySlots.get(x);\n ItemStack dest = cs.getStack();\n if (!(cs.isPlayerSide()) && cs instanceof SlotFake) {\n if (Platform.isSameItemPrecise(dest, tis))\n return null;\n else if (dest == null) {\n cs.putStack(tis != null ? tis.copy() : null);\n cs.onSlotChanged();\n updateSlot(cs);\n return null;\n }\n }\n }\n }\n }\n if (tis != null) {\n for (Slot d : selectedSlots) {\n if (d instanceof SlotDisabled || d instanceof SlotME)\n continue;\n if (d.isItemValid(tis) && tis != null) {\n if (d.getHasStack()) {\n ItemStack t = d.getStack();\n if (tis != null && Platform.isSameItem(tis, t)) {\n int maxSize = t.getMaxStackSize();\n if (maxSize > d.getSlotStackLimit())\n maxSize = d.getSlotStackLimit();\n int placeAble = maxSize - t.stackSize;\n if (tis.stackSize < placeAble) {\n placeAble = tis.stackSize;\n }\n t.stackSize += placeAble;\n tis.stackSize -= placeAble;\n if (tis.stackSize <= 0) {\n clickSlot.putStack(null);\n d.onSlotChanged();\n updateSlot(clickSlot);\n updateSlot(d);\n return null;\n } else\n updateSlot(d);\n }\n }\n }\n }\n for (Slot d : selectedSlots) {\n if (d instanceof SlotDisabled || d instanceof SlotME)\n continue;\n if (d.isItemValid(tis) && tis != null) {\n if (d.getHasStack()) {\n ItemStack t = d.getStack();\n if (tis != null && Platform.isSameItem(t, tis)) {\n int maxSize = t.getMaxStackSize();\n if (d.getSlotStackLimit() < maxSize)\n maxSize = d.getSlotStackLimit();\n int placeAble = maxSize - t.stackSize;\n if (tis.stackSize < placeAble) {\n placeAble = tis.stackSize;\n }\n t.stackSize += placeAble;\n tis.stackSize -= placeAble;\n if (tis.stackSize <= 0) {\n clickSlot.putStack(null);\n d.onSlotChanged();\n updateSlot(clickSlot);\n updateSlot(d);\n return null;\n } else\n updateSlot(d);\n }\n } else {\n int maxSize = tis.getMaxStackSize();\n if (maxSize > d.getSlotStackLimit())\n maxSize = d.getSlotStackLimit();\n ItemStack tmp = tis.copy();\n if (tmp.stackSize > maxSize)\n tmp.stackSize = maxSize;\n tis.stackSize -= tmp.stackSize;\n d.putStack(tmp);\n if (tis.stackSize <= 0) {\n clickSlot.putStack(null);\n d.onSlotChanged();\n updateSlot(clickSlot);\n updateSlot(d);\n return null;\n } else\n updateSlot(d);\n }\n }\n }\n }\n clickSlot.putStack(tis != null ? tis.copy() : null);\n }\n updateSlot(clickSlot);\n return null;\n}\n"
|
"private List<EvaluatedAxiom<OWLAxiom>> applyCELOE(SparqlEndpointKS ks, OWLClass nc, boolean equivalence, boolean reuseKnowledgeSource) throws ComponentInitException {\n System.out.print(\"String_Node_Str\");\n long startTime = System.currentTimeMillis();\n SortedSet<OWLIndividual> posExamples = reasoner.getIndividuals(nc, maxNrOfPositiveExamples);\n long runTime = System.currentTimeMillis() - startTime;\n if (posExamples.isEmpty()) {\n System.out.println(\"String_Node_Str\" + nc.toString() + \"String_Node_Str\");\n return Collections.emptyList();\n }\n SortedSet<String> posExStr = Helper.getStringSet(posExamples);\n System.out.println(\"String_Node_Str\" + posExStr.size() + \"String_Node_Str\" + runTime + \"String_Node_Str\");\n System.out.print(\"String_Node_Str\");\n startTime = System.currentTimeMillis();\n AutomaticNegativeExampleFinderSPARQL2 finder = new AutomaticNegativeExampleFinderSPARQL2(ks.getEndpoint(), reasoner);\n SortedSet<OWLIndividual> negExamples = finder.getNegativeExamples(nc, posExamples, maxNrOfNegativeExamples);\n SortedSetTuple<OWLIndividual> examples = new SortedSetTuple<OWLIndividual>(posExamples, negExamples);\n runTime = System.currentTimeMillis() - startTime;\n System.out.println(\"String_Node_Str\" + negExamples.size() + \"String_Node_Str\" + runTime + \"String_Node_Str\");\n AbstractReasonerComponent rc;\n KnowledgeSource ksFragment;\n if (reuseKnowledgeSource) {\n ksFragment = ksCached;\n rc = rcCached;\n } else {\n System.out.print(\"String_Node_Str\");\n startTime = System.currentTimeMillis();\n Model model;\n if (ks.isRemote()) {\n model = getFragment(ks, Sets.union(posExamples, negExamples));\n } else {\n model = ((LocalModelBasedSparqlEndpointKS) ks).getModel();\n }\n filter(model);\n filterByNamespaces(model);\n OWLEntityTypeAdder.addEntityTypes(model);\n runTime = System.currentTimeMillis() - startTime;\n System.out.println(\"String_Node_Str\" + model.size() + \"String_Node_Str\" + runTime + \"String_Node_Str\");\n OWLOntology ontology = asOWLOntology(model);\n if (reasoner.getClassHierarchy() != null) {\n ontology.getOWLOntologyManager().addAxioms(ontology, reasoner.getClassHierarchy().toOWLAxioms());\n }\n ksFragment = new OWLAPIOntology(ontology);\n try {\n OWLManager.createOWLOntologyManager().saveOntology(ontology, new TurtleOntologyFormat(), new FileOutputStream(\"String_Node_Str\"));\n } catch (OWLOntologyStorageException | FileNotFoundException e) {\n e.printStackTrace();\n }\n System.out.println(\"String_Node_Str\");\n rc = new ClosedWorldReasoner(ksFragment);\n rc.init();\n System.out.println(\"String_Node_Str\");\n ksCached = ksFragment;\n rcCached = rc;\n }\n ClassLearningProblem lp = new ClassLearningProblem(rc);\n lp.setClassToDescribe(nc);\n lp.setEquivalence(equivalence);\n lp.setAccuracyMethod(HeuristicType.FMEASURE);\n lp.setUseApproximations(false);\n lp.setMaxExecutionTimeInSeconds(10);\n lp.init();\n CELOE la = new CELOE(lp, rc);\n la.setMaxExecutionTimeInSeconds(10);\n la.setNoisePercentage(25);\n la.setMaxNrOfResults(100);\n la.init();\n startTime = System.currentTimeMillis();\n System.out.print(\"String_Node_Str\" + (equivalence ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\");\n la.start();\n runTime = System.currentTimeMillis() - startTime;\n System.out.println(\"String_Node_Str\" + runTime + \"String_Node_Str\");\n List<? extends EvaluatedDescription<? extends Score>> learnedDescriptions = la.getCurrentlyBestEvaluatedDescriptions(threshold);\n List<EvaluatedAxiom<OWLAxiom>> learnedAxioms = new LinkedList<EvaluatedAxiom<OWLAxiom>>();\n for (EvaluatedDescription<? extends Score> learnedDescription : learnedDescriptions) {\n OWLAxiom axiom;\n if (equivalence) {\n axiom = dataFactory.getOWLEquivalentClassesAxiom(nc, learnedDescription.getDescription());\n } else {\n axiom = dataFactory.getOWLSubClassOfAxiom(nc, learnedDescription.getDescription());\n }\n Score score = lp.computeScore(learnedDescription.getDescription());\n learnedAxioms.add(new EvaluatedAxiom<OWLAxiom>(axiom, new AxiomScore(score.getAccuracy())));\n }\n System.out.println(prettyPrint(learnedAxioms));\n learnedEvaluatedAxioms.addAll(learnedAxioms);\n algorithmRuns.add(new AlgorithmRun(CELOE.class, learnedAxioms, ConfigHelper.getConfigOptionValues(la)));\n return learnedAxioms;\n}\n"
|
"public void characters(char[] ch, int start, int length) throws SAXException {\n try {\n if (null != selfRecords) {\n int selfRecordsSize = selfRecords.size();\n for (int x = 0; x < selfRecordsSize; x++) {\n UnmarshalRecord selfRecord = ((UnmarshalRecord) selfRecords.get(x));\n if (selfRecord != null) {\n selfRecord.characters(ch, start, length);\n }\n }\n }\n XPathNode textNode = xPathNode.getTextNode();\n if (null == textNode && xPathNode.getNonAttributeChildrenMap() != null) {\n textNode = (XPathNode) xPathNode.getNonAttributeChildrenMap().get(XPathFragment.ANY_FRAGMENT);\n if (textNode != null) {\n if (0 == length) {\n return;\n }\n String tmpString = new String(ch, start, length);\n if (EMPTY_STRING.equals(tmpString.trim()) && !textNode.isWhitespaceAware()) {\n return;\n }\n }\n }\n if (null != textNode) {\n xPathNode = textNode;\n unmarshalContext.characters(this);\n }\n if (null != xPathNode.getUnmarshalNodeValue()) {\n stringBuffer.append(ch, start, length);\n }\n } catch (EclipseLinkException e) {\n if (null == xmlReader.getErrorHandler()) {\n throw e;\n } else {\n SAXParseException saxParseException = new SAXParseException(null, null, null, 0, 0, e);\n xmlReader.getErrorHandler().error(saxParseException);\n }\n }\n}\n"
|
"protected List<TdView> getColumnSets(TdCatalog catalog, TdSchema schema) {\n if (catalog != null) {\n return CatalogHelper.getViews(catalog);\n }\n if (schema != null) {\n String viewFilter = TaggedValueHelper.getValue(TaggedValueHelper.VIEW_FILTER, schema.getTaggedValue());\n return filterColumnSets(CatalogHelper.getViews(catalog), viewFilter);\n }\n return Collections.emptyList();\n}\n"
|
"private ClassVisitor createClassVisitorsForClassesInInputs(ClassLoader loader, ClassReaderFactory classpathReader, ClassReaderFactory bootclasspathReader, Builder<String> interfaceLambdaMethodCollector, UnprefixingClassWriter writer) {\n ClassVisitor visitor = checkNotNull(writer);\n if (!options.onlyDesugarJavac9ForLint) {\n if (outputJava7) {\n visitor = new Java7Compatibility(visitor, classpathReader);\n if (options.desugarTryWithResourcesIfNeeded) {\n visitor = new TryWithResourcesRewriter(visitor, loader, visitedExceptionTypes, numOfTryWithResourcesInvoked);\n }\n if (options.desugarInterfaceMethodBodiesIfNeeded) {\n visitor = new DefaultMethodClassFixer(visitor, classpathReader, bootclasspathReader, loader);\n visitor = new InterfaceDesugaring(visitor, bootclasspathReader, store);\n }\n }\n visitor = new LambdaDesugaring(visitor, loader, lambdas, interfaceLambdaMethodCollector, allowDefaultMethods);\n }\n if (!allowCallsToObjectsNonNull) {\n visitor = new ObjectsRequireNonNullMethodRewriter(visitor);\n }\n if (options.enableRewritingOfLongCompare) {\n visitor = new LongCompareMethodRewriter(visitor);\n }\n return visitor;\n}\n"
|
"public static void merge(OpenAPIDefinition from, OpenAPI to, boolean override) {\n if (isAnnotationNull(from)) {\n return;\n }\n if (!isAnnotationNull(from.info())) {\n if (to.getInfo() == null) {\n to.setInfo(new InfoImpl());\n }\n InfoImpl.merge(from.info(), to.getInfo(), override);\n }\n if (from.servers() != null) {\n for (org.eclipse.microprofile.openapi.annotations.servers.Server server : from.servers()) {\n if (!isAnnotationNull(server)) {\n Server newServer = new ServerImpl();\n ServerImpl.merge(server, newServer, true);\n if (!to.getServers().contains(newServer)) {\n to.addServer(newServer);\n }\n }\n }\n }\n if (!isAnnotationNull(from.externalDocs())) {\n if (to.getExternalDocs() == null) {\n to.setExternalDocs(new ExternalDocumentationImpl());\n }\n ExternalDocumentationImpl.merge(from.externalDocs(), to.getExternalDocs(), override);\n }\n if (from.security() != null) {\n for (org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement requirement : from.security()) {\n if (!isAnnotationNull(requirement)) {\n SecurityRequirement newRequirement = new SecurityRequirementImpl();\n SecurityRequirementImpl.merge(requirement, newRequirement);\n if (!to.getSecurity().contains(newRequirement)) {\n to.addSecurityRequirement(newRequirement);\n }\n }\n }\n }\n if (from.tags() != null) {\n for (org.eclipse.microprofile.openapi.annotations.tags.Tag tag : from.tags()) {\n if (!isAnnotationNull(tag)) {\n if (to.getTags() == null) {\n to.setTags(new ArrayList<>());\n }\n Tag newTag = new TagImpl();\n TagImpl.merge(tag, newTag, override);\n to.addTag(newTag);\n }\n }\n }\n ComponentsImpl.merge(from.components(), to.getComponents(), override, null);\n}\n"
|
"public void initialize(Q request) throws Exception {\n if (Logs.isExtrrreeeme()) {\n Logs.exhaust().debug(cb.getClass().getCanonicalName() + \"String_Node_Str\" + request);\n }\n try {\n cb.initialize(request);\n } catch (Exception ex) {\n Logs.extreme().error(ex, ex);\n AsyncRequest.this.result.setException(ex);\n AsyncRequest.this.callbackSequence.fireException(ex);\n }\n}\n"
|
"protected void subscribeActual(SingleObserver<? super T> observer) {\n AtomicBoolean disposed = new AtomicBoolean();\n observer.onSubscribe(new Disposable() {\n public void dispose() {\n disposed.set(true);\n }\n public boolean isDisposed() {\n return disposed.get();\n }\n });\n if (!disposed.get()) {\n method.handle(ar -> {\n if (!disposed.getAndSet(true)) {\n if (ar.succeeded()) {\n try {\n observer.onSuccess(ar.result());\n } catch (Throwable ignore) {\n }\n } else if (ar.failed()) {\n try {\n observer.onError(ar.cause());\n } catch (Throwable ignore) {\n }\n }\n }\n });\n }\n}\n"
|
"public void run() {\n if (mainHUD == null) {\n mainHUD = HUDManagerFactory.getHUDManager().getHUD(\"String_Node_Str\");\n }\n for (String name : buttonMap.keySet()) {\n HUDButton button = buttonMap.get(name);\n mainHUD.removeComponent(button);\n }\n buttonMap.clear();\n gestureMap.clear();\n if (avatar == null) {\n return;\n }\n for (String action : avatar.getAnimationNames()) {\n String name = action;\n if (action.startsWith(\"String_Node_Str\") == true) {\n name = name.substring(5);\n } else if (action.startsWith(\"String_Node_Str\") == true) {\n name = name.substring(7);\n }\n gestureMap.put(bundle.getString(name), action);\n }\n if (avatar.getCharacterParams().isAnimatingFace()) {\n gestureMap.put(\"String_Node_Str\", \"String_Node_Str\");\n gestureMap.put(\"String_Node_Str\", \"String_Node_Str\");\n }\n for (String name : gestureMap.keySet()) {\n int row = 0;\n int column = 0;\n for (String[] gesture : gestures) {\n if (gesture[0].equals(name)) {\n column = Integer.valueOf(gesture[1]);\n row = Integer.valueOf(gesture[2]);\n HUDButton button = mainHUD.createButton(name);\n button.setDecoratable(false);\n button.setPreferredTransparency(0.2f);\n button.setLocation(leftMargin + column * columnWidth, bottomMargin + row * rowHeight);\n mainHUD.addComponent(button);\n buttonMap.put(name, button);\n button.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n String action = gestureMap.get(event.getActionCommand());\n logger.info(\"String_Node_Str\" + event.getActionCommand());\n if (action.equals(\"String_Node_Str\") == true) {\n doSitGesture(avatar);\n } else if (action.equals(\"String_Node_Str\") == true) {\n CharacterEyes eyes = avatar.getEyes();\n eyes.wink(false);\n } else {\n avatar.playAnimation(action);\n }\n }\n });\n break;\n }\n }\n }\n setVisible(true);\n}\n"
|
"public static String downloadFile(String fileURL, String folderPath) {\n URL u;\n InputStream is = null;\n DataInputStream dis;\n String fullFileName = \"String_Node_Str\";\n FileOutputStream output = null;\n try {\n int lastSlashPos = fileURL.lastIndexOf(\"String_Node_Str\");\n if (lastSlashPos < 0)\n return \"String_Node_Str\";\n fullFileName = fileURL.substring(lastSlashPos + 1);\n File parentFolder = new File(folderPath);\n if (parentFolder != null)\n parentFolder.mkdirs();\n fullFileName = folderPath + fullFileName;\n u = new URL(fileURL);\n is = u.openStream();\n dis = new DataInputStream(new BufferedInputStream(is));\n output = new FileOutputStream(fullFileName);\n byte[] fileContents = new byte[dis.available()];\n while (dis.available() != 0) {\n output.write(dis.readByte());\n }\n logger.debug(\"String_Node_Str\" + fileURL + \"String_Node_Str\");\n } catch (MalformedURLException mue) {\n fullFileName = \"String_Node_Str\";\n } catch (IOException ioe) {\n fullFileName = \"String_Node_Str\";\n } finally {\n try {\n if (is != null)\n is.close();\n if (output != null) {\n output.flush();\n output.close();\n }\n } catch (IOException ioe) {\n }\n }\n return fullFileName;\n}\n"
|
"private void createFullSourcePom(List<Dependency> newDependencies) throws MojoFailureException {\n Set<String> projectProperties = new TreeSet<String>();\n for (Dependency dep : newDependencies) {\n if (dep.getArtifactId().equals(\"String_Node_Str\") || dep.getArtifactId().contains(\"String_Node_Str\") || dep.getArtifactId().equals(\"String_Node_Str\") || dep.getArtifactId().equals(\"String_Node_Str\")) {\n dep.setOptional(true);\n dep.setScope(null);\n }\n String version = dep.getVersion();\n if (version.startsWith(\"String_Node_Str\")) {\n version = version.substring(2);\n }\n if (version.endsWith(\"String_Node_Str\")) {\n version = version.substring(0, version.length() - 1);\n }\n projectProperties.add(version);\n }\n if (project.getPackaging().equals(\"String_Node_Str\") && project.hasParent()) {\n Dependency core = new Dependency();\n core.setGroupId(\"String_Node_Str\");\n core.setArtifactId(\"String_Node_Str\");\n core.setVersion(\"String_Node_Str\");\n newDependencies.add(core);\n if (project.getProperties().getProperty(\"String_Node_Str\").equals(\"String_Node_Str\")) {\n Dependency jsp21 = new Dependency();\n jsp21.setGroupId(\"String_Node_Str\");\n jsp21.setArtifactId(\"String_Node_Str\");\n jsp21.setVersion(\"String_Node_Str\");\n jsp21.setScope(\"String_Node_Str\");\n newDependencies.add(jsp21);\n project.getOriginalModel().getProperties().setProperty(\"String_Node_Str\", \"String_Node_Str\");\n }\n }\n Collections.sort(newDependencies, new BeanComparator(\"String_Node_Str\"));\n project.getOriginalModel().setDependencies(newDependencies);\n Properties currentProperties = project.getOriginalModel().getProperties();\n Set<String> currentKeys = new LinkedHashSet<String>();\n for (Object key : currentProperties.keySet()) {\n currentKeys.add((String) key);\n }\n StringBuffer sortedProperties = new StringBuffer();\n Properties appfuseProperties = getAppFuseProperties();\n Map<String, String> propertiesForPom = new LinkedHashMap<String, String>();\n for (String key : projectProperties) {\n if (!currentKeys.contains(key)) {\n String value = appfuseProperties.getProperty(key);\n if (value == null) {\n continue;\n }\n if (\"String_Node_Str\".equals(project.getProperties().getProperty(\"String_Node_Str\")) && key.equals(\"String_Node_Str\")) {\n value = \"String_Node_Str\";\n }\n if (value.contains(\"String_Node_Str\")) {\n value = \"String_Node_Str\" + value + \"String_Node_Str\";\n }\n sortedProperties.append(\"String_Node_Str\").append(key).append(\"String_Node_Str\").append(value).append(\"String_Node_Str\").append(key).append(\"String_Node_Str\" + \"String_Node_Str\");\n propertiesForPom.put(key, value);\n }\n }\n if (project.getPackaging().equals(\"String_Node_Str\") || project.hasParent()) {\n Map<String, String> properties = new LinkedHashMap<String, String>();\n if (propertiesContextHolder.get() != null) {\n properties = (LinkedHashMap) propertiesContextHolder.get();\n }\n for (String key : propertiesForPom.keySet()) {\n if (!properties.containsKey(key)) {\n properties.put(key, propertiesForPom.get(key));\n }\n }\n propertiesContextHolder.set(properties);\n }\n StringWriter writer = new StringWriter();\n try {\n project.writeOriginalModel(writer);\n File pom = new File(\"String_Node_Str\");\n if (pom.exists()) {\n pom.delete();\n }\n FileWriter fw = new FileWriter(pom);\n fw.write(writer.toString());\n fw.flush();\n fw.close();\n } catch (IOException ex) {\n getLog().error(\"String_Node_Str\" + ex.getMessage(), ex);\n throw new MojoFailureException(ex.getMessage());\n }\n log(\"String_Node_Str\");\n String pomXml = writer.toString();\n int startTag = pomXml.indexOf(\"String_Node_Str\");\n String dependencyXml = pomXml.substring(startTag, pomXml.indexOf(\"String_Node_Str\", startTag));\n dependencyXml = dependencyXml.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n dependencyXml = \"String_Node_Str\" + dependencyXml;\n try {\n String packaging = project.getPackaging();\n String pathToPom = \"String_Node_Str\";\n if (project.hasParent()) {\n if (packaging.equals(\"String_Node_Str\")) {\n pathToPom = \"String_Node_Str\" + pathToPom;\n } else if (packaging.equals(\"String_Node_Str\")) {\n pathToPom = \"String_Node_Str\" + pathToPom;\n }\n }\n String originalPom = FileUtils.readFileToString(new File(pathToPom), \"String_Node_Str\");\n originalPom = originalPom.replace(\"String_Node_Str\", \"String_Node_Str\");\n startTag = originalPom.indexOf(\"String_Node_Str\");\n StringBuffer sb = new StringBuffer();\n sb.append(originalPom.substring(0, startTag));\n sb.append(dependencyXml);\n sb.append(originalPom.substring(originalPom.indexOf(\"String_Node_Str\", startTag)));\n String adjustedPom = sb.toString();\n if (!project.getPackaging().equals(\"String_Node_Str\") && !project.hasParent()) {\n adjustedPom = addPropertiesToPom(adjustedPom, sortedProperties);\n }\n adjustedPom = adjustLineEndingsForOS(adjustedPom);\n FileUtils.writeStringToFile(new File(pathToPom), adjustedPom);\n } catch (IOException ex) {\n getLog().error(\"String_Node_Str\" + ex.getMessage(), ex);\n throw new MojoFailureException(ex.getMessage());\n }\n boolean renamePackages = true;\n if (System.getProperty(\"String_Node_Str\") != null) {\n renamePackages = Boolean.valueOf(System.getProperty(\"String_Node_Str\"));\n }\n if (renamePackages && !project.getPackaging().equals(\"String_Node_Str\")) {\n log(\"String_Node_Str\" + project.getGroupId() + \"String_Node_Str\");\n RenamePackages renamePackagesTool = new RenamePackages(project.getGroupId());\n if (project.hasParent()) {\n if (project.getPackaging().equals(\"String_Node_Str\")) {\n renamePackagesTool.setBaseDir(\"String_Node_Str\");\n } else {\n renamePackagesTool.setBaseDir(\"String_Node_Str\");\n }\n }\n renamePackagesTool.execute();\n }\n if (project.getPackaging().equals(\"String_Node_Str\") && project.hasParent()) {\n Map properties = propertiesContextHolder.get();\n Set<String> propertiesToAdd = new TreeSet<String>(properties.keySet());\n StringBuffer calculatedProperties = new StringBuffer();\n for (String key : propertiesToAdd) {\n Set<Object> keysInProject = project.getParent().getOriginalModel().getProperties().keySet();\n if (!keysInProject.contains(key)) {\n String value = getAppFuseProperties().getProperty(key);\n if (value.contains(\"String_Node_Str\")) {\n value = \"String_Node_Str\" + value + \"String_Node_Str\";\n }\n calculatedProperties.append(\"String_Node_Str\");\n calculatedProperties.append(key);\n calculatedProperties.append(\"String_Node_Str\");\n calculatedProperties.append(value);\n calculatedProperties.append(\"String_Node_Str\");\n calculatedProperties.append(key);\n calculatedProperties.append(\"String_Node_Str\");\n calculatedProperties.append(\"String_Node_Str\");\n }\n }\n try {\n String originalPom = FileUtils.readFileToString(new File(\"String_Node_Str\"));\n originalPom = originalPom.replace(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\");\n originalPom = originalPom.replace(\"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n String pomWithProperties = addPropertiesToPom(originalPom, calculatedProperties);\n FileUtils.writeStringToFile(new File(\"String_Node_Str\"), pomWithProperties);\n } catch (IOException ex) {\n getLog().error(\"String_Node_Str\" + ex.getMessage(), ex);\n throw new MojoFailureException(ex.getMessage());\n }\n }\n File pom = new File(\"String_Node_Str\");\n if (pom.exists()) {\n pom.delete();\n }\n}\n"
|
"public void getResourceResponse(JSONObject response) {\n try {\n final String responseUser = response.getString(\"String_Node_Str\");\n final String resourcePath = response.getString(\"String_Node_Str\");\n final long timestamp = response.getLong(\"String_Node_Str\");\n final String content = response.getString(\"String_Node_Str\");\n if (this.username.equals(responseUser)) {\n IFile file = project.getFile(resourcePath);\n if (!file.exists()) {\n file.create(new ByteArrayInputStream(content.getBytes()), true, null);\n } else {\n file.setContents(new ByteArrayInputStream(content.getBytes()), true, false, null);\n }\n file.setLocalTimeStamp(timestamp);\n this.requestedProjectFiles.remove(resourcePath);\n if (this.requestedProjectFiles.isEmpty()) {\n this.messagingConnector.removeMessageHandler(projectResponseHandler);\n this.messagingConnector.removeMessageHandler(resourceResponseHandler);\n finish();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n this.messagingConnector.removeMessageHandler(projectResponseHandler);\n this.messagingConnector.removeMessageHandler(resourceResponseHandler);\n this.completionCallback.downloadFailed();\n }\n}\n"
|
"public synchronized void pauseDeployment(final String deployment, ServerActivityListener listener) {\n final List<ControlPoint> eps = new ArrayList<ControlPoint>();\n for (ControlPoint ep : entryPoints.values()) {\n if (ep.getDeployment().equals(deployment)) {\n if (!ep.isPaused()) {\n eps.add(ep);\n }\n }\n }\n CountingRequestCountListener realListener = new CountingRequestCountListener(eps.size(), listener);\n for (ControlPoint ep : eps) {\n ep.pause(realListener);\n }\n}\n"
|
"public Response updateMetadata(String channelName, String json) throws Exception {\n if (noSuchChannel(channelName)) {\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n ChannelConfiguration oldConfig = channelService.getChannelConfiguration(channelName);\n ChannelConfiguration.Builder builder = ChannelConfiguration.builder().withChannelConfiguration(oldConfig);\n JsonNode rootNode = mapper.readTree(json);\n if (rootNode.has(\"String_Node_Str\")) {\n builder.withDescription(rootNode.get(\"String_Node_Str\").asText());\n }\n if (rootNode.has(\"String_Node_Str\")) {\n builder.withTtlDays(rootNode.get(\"String_Node_Str\").asLong());\n } else if (rootNode.has(\"String_Node_Str\")) {\n builder.withTtlMillis(rootNode.get(\"String_Node_Str\").asLong());\n }\n if (rootNode.has(\"String_Node_Str\")) {\n builder.withContentKiloBytes(rootNode.get(\"String_Node_Str\").asInt());\n }\n if (rootNode.has(\"String_Node_Str\")) {\n builder.withPeakRequestRate(rootNode.get(\"String_Node_Str\").asInt());\n }\n if (rootNode.has(\"String_Node_Str\")) {\n Set<String> tags = new HashSet<>();\n JsonNode tagsNode = rootNode.get(\"String_Node_Str\");\n for (JsonNode tagNode : tagsNode) {\n tags.add(tagNode.asText());\n }\n builder.withTags(tags);\n }\n ChannelConfiguration newConfig = builder.build();\n newConfig = channelService.updateChannel(newConfig);\n URI channelUri = linkBuilder.buildChannelUri(newConfig, uriInfo);\n Linked<ChannelConfiguration> linked = linkBuilder.buildChannelLinks(newConfig, channelUri);\n return Response.ok(channelUri).entity(linked).build();\n}\n"
|
"public String getSqlQueryFromJPA(EntityMetadata entityMetadata, List<String> relations, Set<String> primaryKeys) {\n ApplicationMetadata appMetadata = KunderaMetadata.INSTANCE.getApplicationMetadata();\n Metamodel metaModel = appMetadata.getMetamodel(entityMetadata.getPersistenceUnit());\n if (appMetadata.isNative(jpaQuery)) {\n return appMetadata.getQuery(jpaQuery);\n }\n String aliasName = \"String_Node_Str\" + entityMetadata.getTableName();\n StringBuilder queryBuilder = new StringBuilder(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName());\n EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());\n Set<Attribute> attributes = entityType.getAttributes();\n for (Attribute field : attributes) {\n if (!field.isAssociation() && !field.isCollection() && !((Field) field.getJavaMember()).isAnnotationPresent(ManyToMany.class) && !((AbstractAttribute) field).getJPAColumnName().equals(((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName()) && !((MetamodelImpl) metaModel).isEmbeddable(((AbstractAttribute) field).getBindableJavaType())) {\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(((AbstractAttribute) field).getJPAColumnName());\n }\n }\n Map<String, EmbeddableType> embeddedColumns = ((MetamodelImpl) metaModel).getEmbeddables(entityMetadata.getEntityClazz());\n for (EmbeddableType embeddedCol : embeddedColumns.values()) {\n Set<Attribute> embeddedAttributes = embeddedCol.getAttributes();\n for (Attribute column : embeddedAttributes) {\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(((AbstractAttribute) column).getJPAColumnName());\n }\n }\n if (relations != null) {\n for (String relation : relations) {\n Relation rel = entityMetadata.getRelation(entityMetadata.getFieldName(relation));\n String r = MetadataUtils.getMappedName(entityMetadata, rel);\n if (!((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName().equalsIgnoreCase(r != null ? r : relation) && rel != null && !rel.getProperty().isAnnotationPresent(ManyToMany.class) && !rel.getProperty().isAnnotationPresent(OneToMany.class) && (rel.getProperty().isAnnotationPresent(OneToOne.class) && StringUtils.isBlank(rel.getMappedBy()) || rel.getProperty().isAnnotationPresent(ManyToOne.class))) {\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(r != null ? r : relation);\n }\n }\n }\n for (Relation r : entityMetadata.getRelations()) {\n if (!r.getType().equals(ForeignKey.MANY_TO_MANY) && (r.getProperty().isAnnotationPresent(OneToOne.class) && StringUtils.isBlank(r.getMappedBy()) || r.getProperty().isAnnotationPresent(ManyToOne.class))) {\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(r.getJoinColumnName());\n }\n }\n queryBuilder.append(\"String_Node_Str\");\n if (entityMetadata.getSchema() != null && !entityMetadata.getSchema().isEmpty()) {\n queryBuilder.append(entityMetadata.getSchema() + \"String_Node_Str\");\n }\n queryBuilder.append(entityMetadata.getTableName());\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(aliasName);\n if (filter != null) {\n queryBuilder.append(\"String_Node_Str\");\n }\n if (primaryKeys == null) {\n for (Object o : conditions) {\n if (o instanceof FilterClause) {\n FilterClause clause = ((FilterClause) o);\n String fieldName = clause.getProperty();\n boolean isString = isStringProperty(entityType, fieldName, entityMetadata);\n queryBuilder.append(StringUtils.replace(clause.getProperty(), aliasName, aliasName));\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(clause.getCondition());\n if (clause.getCondition().equalsIgnoreCase(\"String_Node_Str\")) {\n queryBuilder.append(\"String_Node_Str\");\n }\n queryBuilder.append(\"String_Node_Str\");\n if (clause.getCondition().equalsIgnoreCase(\"String_Node_Str\")) {\n buildINClause(queryBuilder, clause, isString);\n } else {\n appendStringPrefix(queryBuilder, isString);\n queryBuilder.append(clause.getValue());\n appendStringPrefix(queryBuilder, isString);\n }\n } else {\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(o);\n queryBuilder.append(\"String_Node_Str\");\n }\n }\n } else {\n queryBuilder.append(aliasName);\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName());\n queryBuilder.append(\"String_Node_Str\");\n queryBuilder.append(\"String_Node_Str\");\n int count = 0;\n Attribute col = entityMetadata.getIdAttribute();\n boolean isString = col.getJavaType().isAssignableFrom(String.class);\n for (String key : primaryKeys) {\n appendStringPrefix(queryBuilder, isString);\n queryBuilder.append(key);\n appendStringPrefix(queryBuilder, isString);\n if (++count != primaryKeys.size()) {\n queryBuilder.append(\"String_Node_Str\");\n } else {\n queryBuilder.append(\"String_Node_Str\");\n }\n }\n }\n return queryBuilder.toString();\n}\n"
|
"public void parse(IParserManager pm, IToken token) throws SyntaxError {\n int type = token.type();\n if (this.mode == 0) {\n if (this.value != null) {\n this.field.setValue(this.value);\n }\n pm.popParser(true);\n return;\n }\n switch(type) {\n case Symbols.SEMICOLON:\n case Symbols.COMMA:\n case Tokens.STRING_PART:\n case Tokens.STRING_END:\n if (this.value != null) {\n this.field.setValue(this.value);\n }\n pm.popParser(true);\n return;\n }\n switch(this.mode) {\n case VALUE:\n if (type == Symbols.OPEN_PARENTHESIS) {\n int nextType = token.next().type();\n if (nextType == Symbols.CLOSE_PARENTHESIS) {\n this.value = new VoidValue(token.to(token.next()));\n pm.skip();\n this.mode = 0;\n return;\n }\n pm.pushParser(new LambdaOrTupleParser(this), true);\n this.mode = ACCESS;\n return;\n }\n if (type == Symbols.OPEN_SQUARE_BRACKET) {\n this.mode = ARRAY_END;\n Array vl = new Array(token);\n this.value = vl;\n int nextType = token.next().type();\n if (nextType != Symbols.CLOSE_SQUARE_BRACKET) {\n pm.pushParser(new ExpressionListParser(vl));\n }\n return;\n }\n if (type == Symbols.OPEN_CURLY_BRACKET) {\n this.mode = LIST_END;\n StatementList sl = new StatementList(token);\n this.value = sl;\n int nextType = token.next().type();\n if (nextType != Symbols.CLOSE_CURLY_BRACKET) {\n pm.pushParser(new StatementListParser(sl));\n }\n return;\n }\n if (type == Tokens.SYMBOL_IDENTIFIER) {\n if (token.nameValue() == Name.at && token.next().type() == Symbols.OPEN_CURLY_BRACKET) {\n Bytecode bc = new Bytecode(token);\n pm.skip();\n pm.pushParser(new BytecodeParser(bc));\n this.mode = BYTECODE_END;\n this.value = bc;\n return;\n }\n this.getAccess(pm, token.nameValue(), token, type);\n return;\n }\n if ((type & Tokens.IDENTIFIER) != 0) {\n this.getAccess(pm, token.nameValue(), token, type);\n return;\n }\n if (this.parseKeyword(pm, token, type)) {\n return;\n }\n this.mode = ACCESS;\n pm.reparse();\n return;\n case PATTERN_IF:\n this.mode = PATTERN_END;\n if (type == Keywords.IF) {\n pm.pushParser(new ExpressionParser(this));\n return;\n }\n case PATTERN_END:\n if (type == Symbols.COLON) {\n this.mode = 0;\n if (token.next().type() != Keywords.CASE) {\n pm.pushParser(new ExpressionParser((IValued) this.value));\n }\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\");\n case ARRAY_END:\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_SQUARE_BRACKET) {\n this.mode = ACCESS;\n return;\n }\n this.field.setValue(this.value);\n pm.popParser();\n throw new SyntaxError(token, \"String_Node_Str\");\n case LIST_END:\n this.field.setValue(this.value);\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_CURLY_BRACKET) {\n if (token.next().type() == Symbols.DOT) {\n this.mode = ACCESS_2;\n this.dotless = false;\n pm.skip();\n return;\n }\n pm.popParser();\n return;\n }\n pm.popParser(true);\n throw new SyntaxError(token, \"String_Node_Str\");\n case PARAMETERS_END:\n this.mode = ACCESS;\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_PARENTHESIS) {\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\", true);\n case SUBSCRIPT_END:\n this.mode = ACCESS;\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_SQUARE_BRACKET) {\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\", true);\n case CONSTRUCTOR:\n {\n ConstructorCall cc = (ConstructorCall) this.value;\n if (type == Symbols.OPEN_CURLY_BRACKET) {\n this.createBody(cc.toClassConstructor(), pm);\n return;\n }\n if (type == Symbols.OPEN_PARENTHESIS) {\n ArgumentList list = new ArgumentList();\n cc.arguments = list;\n pm.pushParser(new ExpressionListParser(list));\n this.mode = CONSTRUCTOR_END;\n return;\n }\n if (ParserUtil.isTerminator2(type)) {\n this.mode = ACCESS;\n pm.reparse();\n return;\n }\n SingleArgument sa = new SingleArgument();\n cc.arguments = sa;\n pm.pushParser(new ExpressionParser(sa), true);\n this.mode = 0;\n return;\n }\n case CONSTRUCTOR_END:\n this.mode = ACCESS;\n if (token.next().type() == Symbols.OPEN_CURLY_BRACKET) {\n this.createBody(((ConstructorCall) this.value).toClassConstructor(), pm);\n return;\n }\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_PARENTHESIS) {\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\", true);\n case BYTECODE_END:\n this.field.setValue(this.value);\n pm.popParser();\n this.value.expandPosition(token);\n if (type == Symbols.CLOSE_CURLY_BRACKET) {\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\", true);\n case TYPE_ARGUMENTS_END:\n MethodCall mc = (MethodCall) this.value;\n IToken next = token.next();\n if (next.type() == Symbols.OPEN_PARENTHESIS) {\n pm.skip();\n mc.arguments = this.getArguments(pm, next.next());\n } else {\n mc.arguments = EmptyArguments.INSTANCE;\n }\n this.mode = ACCESS;\n if (type == Symbols.CLOSE_SQUARE_BRACKET) {\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\");\n }\n if (ParserUtil.isCloseBracket(type)) {\n if (this.value != null) {\n this.field.setValue(this.value);\n }\n pm.popParser(true);\n return;\n }\n if (this.mode == ACCESS) {\n if (type == Symbols.DOT) {\n this.mode = ACCESS_2;\n this.dotless = false;\n return;\n }\n this.dotless = true;\n this.mode = ACCESS_2;\n if (type == Keywords.ELSE) {\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n }\n if (type == Symbols.EQUALS) {\n this.getAssign(pm, token);\n return;\n }\n if (type == Keywords.AS) {\n CastOperator co = new CastOperator(token.raw(), this.value);\n pm.pushParser(new TypeParser(co));\n this.value = co;\n return;\n }\n if (type == Keywords.IS) {\n InstanceOfOperator io = new InstanceOfOperator(token.raw(), this.value);\n pm.pushParser(new TypeParser(io));\n this.value = io;\n return;\n }\n if (type == Symbols.OPEN_SQUARE_BRACKET) {\n SubscriptGetter getter = new SubscriptGetter(token, this.value);\n this.value = getter;\n this.mode = SUBSCRIPT_END;\n pm.pushParser(new ExpressionListParser(getter.getArguments()));\n return;\n }\n if (type == Symbols.OPEN_PARENTHESIS) {\n IToken prev = token.prev();\n IToken next = token.next();\n IArguments args;\n args = this.getArguments(pm, next);\n int prevType = prev.type();\n if (ParserUtil.isIdentifier(prevType)) {\n MethodCall mc = new MethodCall(prev, null, prev.nameValue());\n mc.arguments = args;\n this.value = mc;\n } else if (prevType == Symbols.CLOSE_SQUARE_BRACKET) {\n AbstractCall mc;\n if (this.value.valueTag() == IValue.FIELD_ACCESS) {\n mc = ((FieldAccess) this.value).toMethodCall(null);\n } else {\n mc = (MethodCall) this.value;\n }\n mc.arguments = args;\n this.value = mc;\n } else {\n ApplyMethodCall amc = new ApplyMethodCall(this.value.getPosition());\n amc.instance = this.value;\n amc.arguments = args;\n this.value = amc;\n }\n this.mode = PARAMETERS_END;\n return;\n }\n }\n if (this.mode == ACCESS_2) {\n if (ParserUtil.isIdentifier(type)) {\n Name name = token.nameValue();\n if (this.prefix) {\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n }\n if (this.dotless && this.operator != null) {\n Operator operator = pm.getOperator(name);\n int p;\n if (operator == null || (p = this.operator.precedence) > operator.precedence) {\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n }\n if (p == operator.precedence) {\n switch(operator.type) {\n case Operator.INFIX_LEFT:\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n case Operator.INFIX_NONE:\n throw new SyntaxError(token, \"String_Node_Str\" + name + \"String_Node_Str\");\n case Operator.INFIX_RIGHT:\n }\n }\n }\n this.getAccess(pm, name, token, type);\n return;\n }\n if (ParserUtil.isTerminator(type)) {\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n }\n IToken prev = token.prev();\n if (ParserUtil.isIdentifier(prev.type())) {\n this.value = null;\n pm.reparse();\n this.getAccess(pm, prev.nameValue(), prev, type);\n return;\n }\n if (this.value != null) {\n ApplyMethodCall call = new ApplyMethodCall(token.raw());\n call.instance = this.value;\n SingleArgument sa = new SingleArgument();\n call.arguments = sa;\n this.value = call;\n this.mode = 0;\n pm.pushParser(new ExpressionParser(sa), true);\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\" + token);\n }\n if (this.value != null) {\n this.value.expandPosition(token);\n this.field.setValue(this.value);\n pm.popParser(true);\n return;\n }\n throw new SyntaxError(token, \"String_Node_Str\" + token);\n}\n"
|
"public static final List<CommonTree> getRoleInstantiationChildren(CommonTree ct) {\n return ScribParserUtil.toCommonTreeList(ct.getChildren());\n}\n"
|
"public boolean doPickUp(Hero hero) {\n if (super.doPickUp(hero)) {\n if (!Statistics.amuletObtained) {\n Statistics.amuletObtained = true;\n Badges.validateVictory();\n hero.spend(-TIME_TO_PICK_UP);\n Actor.addDelayed(new Actor() {\n protected boolean act() {\n Actor.remove(this);\n showAmuletScene(true);\n return false;\n }\n }, -5);\n }\n return true;\n } else {\n return false;\n }\n}\n"
|
"public boolean processInteract(EntityPlayer player, EnumHand hand) {\n if (!this.world.isRemote) {\n if (hand == EnumHand.MAIN_HAND) {\n ItemStack stack = player.getHeldItemMainhand();\n if (stack.getItem() == ModItems.GEM_STAFF) {\n if (this.isTamed()) {\n if (player.isSneaking()) {\n if (this.isOwnedBy(player)) {\n this.setSelected(!this.isSelected());\n }\n this.alternateInteract(player);\n this.playObeySound();\n } else {\n if (this.isOwner(player)) {\n this.setSitting(player);\n this.playObeySound();\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n } else {\n this.setOwnerId(player.getUniqueID());\n this.setLeader(player);\n this.setServitude(EntityGem.SERVE_HUMAN);\n this.navigator.clearPathEntity();\n this.setAttackTarget(null);\n this.setHealth(this.getMaxHealth());\n this.playTameEffect();\n this.world.setEntityState(this, (byte) 7);\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n } else if (stack.getItem() == ModItems.CRACKED_BLUE_DIAMOND_GEM || stack.getItem() == ModItems.CRACKED_YELLOW_DIAMOND_GEM || stack.getItem() == ModItems.BLUE_DIAMOND_GEM || stack.getItem() == ModItems.YELLOW_DIAMOND_GEM) {\n if (this.getServitude() != EntityGem.SERVE_HUMAN) {\n this.setOwnerId(player.getUniqueID());\n this.setLeader(player);\n this.setServitude(EntityGem.SERVE_HUMAN);\n this.navigator.clearPathEntity();\n this.setAttackTarget(null);\n this.setHealth(this.getMaxHealth());\n this.playTameEffect();\n this.world.setEntityState(this, (byte) 7);\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n } else if (stack.getItem() == ModItems.TRANSFER_CONTRACT) {\n if (this.isTamed()) {\n if (this.isOwner(player)) {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n } else {\n ItemTransferContract contract = (ItemTransferContract) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n if (contract.getOwner(stack).equals(this.getOwnerId())) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } else {\n for (UUID ownerId : this.jointOwners) {\n if (contract.getOwner(stack).equals(ownerId)) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n try {\n this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n ownerId = EntityPlayer.getUUID(player.getGameProfile());\n }\n }\n }\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n this.setOwnerId(EntityPlayer.getUUID(player.getGameProfile()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n }\n } else if (stack.getItem() == ModItems.JOINT_CONTRACT) {\n if (this.isTamed()) {\n if (this.isOwner(player)) {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n } else {\n ItemJointContract contract = (ItemJointContract) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n for (UUID ownerId : this.jointOwners) {\n try {\n this.world.getPlayerEntityByUUID(ownerId).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n }\n this.jointOwners.add(EntityPlayer.getUUID(player.getGameProfile()));\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n }\n } else if (stack.getItem() == ModItems.LIBERATION_CONTRACT) {\n if (this.isTamed()) {\n ItemLiberationContract contract = (ItemLiberationContract) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n if (contract.getOwner(stack).equals(this.getOwnerId())) {\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } else {\n for (UUID ownerId : this.jointOwners) {\n if (contract.getOwner(stack).equals(ownerId)) {\n try {\n this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n ownerId = EntityPlayer.getUUID(player.getGameProfile());\n }\n }\n }\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n this.setServitude(EntityGem.SERVE_NONE);\n this.setOwnerId((UUID) null);\n this.setLeader((UUID) null);\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n } else if (stack.getItem() == ModItems.AUTONOMY_CONTRACT) {\n if (this.isTamed()) {\n ItemAutonomyContract contract = (ItemAutonomyContract) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n if (contract.getOwner(stack).equals(this.getOwnerId())) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } else {\n for (UUID ownerId : this.jointOwners) {\n if (contract.getOwner(stack).equals(ownerId)) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n try {\n this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n ownerId = EntityPlayer.getUUID(player.getGameProfile());\n }\n }\n }\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n this.setOwnerId((UUID) null);\n this.setLeader((UUID) null);\n this.setServitude(EntityGem.SERVE_ITSELF);\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n } else if (stack.getItem() == ModItems.WAR_DECLARATION) {\n if (this.isTamed()) {\n ItemWarDeclaration contract = (ItemWarDeclaration) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n if (contract.getOwner(stack).equals(this.getOwnerId())) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } else {\n for (UUID ownerId : this.jointOwners) {\n if (contract.getOwner(stack).equals(ownerId)) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n try {\n this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n ownerId = EntityPlayer.getUUID(player.getGameProfile());\n }\n }\n }\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n this.setKillsPlayers(true);\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n } else if (stack.getItem() == ModItems.PEACE_TREATY) {\n if (this.isTamed()) {\n ItemPeaceTreaty contract = (ItemPeaceTreaty) stack.getItem();\n if (this.isOwnerId(contract.getOwner(stack))) {\n if (contract.getOwner(stack).equals(this.getOwnerId())) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n this.getOwner().sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } else {\n for (UUID ownerId : this.jointOwners) {\n if (contract.getOwner(stack).equals(ownerId)) {\n if (this.leader.equals(this.getOwnerId())) {\n this.setLeader(player);\n }\n try {\n this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName(), player.getName()));\n } catch (Exception e) {\n }\n ownerId = EntityPlayer.getUUID(player.getGameProfile());\n }\n }\n }\n this.playObeySound();\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n if (!player.capabilities.isCreativeMode) {\n stack.shrink(1);\n }\n this.setKillsPlayers(false);\n return true;\n } else {\n player.sendMessage(new TextComponentTranslation(\"String_Node_Str\", this.getName()));\n return true;\n }\n }\n } else if (DyeUtils.isDye(stack) && this.canChangeUniformColorByDefault() && player.isSneaking()) {\n if (this.isTamed() && this.isOwner(player)) {\n this.setUniformColor(15 - stack.getItemDamage());\n return true;\n }\n } else if (stack.getItem() == Items.DYE && this.canChangeInsigniaColorByDefault()) {\n if (this.isTamed()) {\n if (this.isOwner(player)) {\n this.setInsigniaColor(15 - stack.getItemDamage());\n return true;\n }\n }\n } else if (this.isSoldier) {\n return super.processInteract(player, hand) || this.setAttackWeapon(player, hand, stack);\n }\n }\n }\n return super.processInteract(player, hand);\n}\n"
|
"public void addAddress(MacAddress macAddress, IpAddress ipAddress, NodeConnectorRef nodeConnectorRef) {\n if (macAddress == null || ipAddress == null || nodeConnectorRef == null) {\n return;\n }\n NodeConnectorLock nodeConnectorLock;\n synchronized (this) {\n nodeConnectorLock = lockMap.get(nodeConnectorRef);\n if (nodeConnectorLock == null) {\n nodeConnectorLock = new NodeConnectorLock();\n lockMap.put(nodeConnectorRef, nodeConnectorLock);\n }\n }\n synchronized (nodeConnectorLock) {\n CheckedFuture<Void, TransactionCommitFailedException> future = futureMap.get(nodeConnectorLock);\n if (future != null) {\n try {\n future.get();\n } catch (InterruptedException | ExecutionException e) {\n LOG.error(\"String_Node_Str\", e);\n }\n }\n long now = new Date().getTime();\n final AddressCapableNodeConnectorBuilder acncBuilder = new AddressCapableNodeConnectorBuilder();\n final AddressesBuilder addressBuilder = new AddressesBuilder().setIp(ipAddress).setMac(macAddress).setFirstSeen(now).setLastSeen(now);\n List<Addresses> addresses = null;\n ReadOnlyTransaction readTransaction = dataService.newReadOnlyTransaction();\n NodeConnector nc = null;\n try {\n Optional<NodeConnector> dataObjectOptional = readTransaction.read(LogicalDatastoreType.OPERATIONAL, (InstanceIdentifier<NodeConnector>) nodeConnectorRef.getValue()).get();\n if (dataObjectOptional.isPresent())\n nc = (NodeConnector) dataObjectOptional.get();\n } catch (Exception e) {\n _logger.error(\"String_Node_Str\", nodeConnectorRef.getValue());\n readTransaction.close();\n throw new RuntimeException(\"String_Node_Str\" + nodeConnectorRef, e);\n }\n readTransaction.close();\n if (nc == null) {\n return;\n }\n AddressCapableNodeConnector acnc = (AddressCapableNodeConnector) nc.getAugmentation(AddressCapableNodeConnector.class);\n if (acnc != null && acnc.getAddresses() != null) {\n addresses = acnc.getAddresses();\n for (int i = 0; i < addresses.size(); i++) {\n if (addresses.get(i).getIp().equals(ipAddress) && addresses.get(i).getMac().equals(macAddress)) {\n if ((now - addresses.get(i).getLastSeen()) > timestampUpdateInterval) {\n addressBuilder.setFirstSeen(addresses.get(i).getFirstSeen()).setKey(addresses.get(i).getKey());\n addresses.remove(i);\n break;\n } else {\n return;\n }\n }\n }\n } else {\n addresses = new ArrayList<>();\n }\n if (addressBuilder.getKey() == null) {\n addressBuilder.setKey(new AddressesKey(BigInteger.valueOf(addressKey.getAndIncrement())));\n }\n addresses.add(addressBuilder.build());\n acncBuilder.setAddresses(addresses);\n InstanceIdentifier<AddressCapableNodeConnector> addressCapableNcInstanceId = ((InstanceIdentifier<NodeConnector>) nodeConnectorRef.getValue()).augmentation(AddressCapableNodeConnector.class);\n final WriteTransaction writeTransaction = dataService.newWriteOnlyTransaction();\n writeTransaction.merge(LogicalDatastoreType.OPERATIONAL, addressCapableNcInstanceId, acncBuilder.build());\n final CheckedFuture writeTxResultFuture = writeTransaction.submit();\n Futures.addCallback(writeTxResultFuture, new FutureCallback() {\n public void onSuccess(Object o) {\n _logger.debug(\"String_Node_Str\", writeTransaction.getIdentifier());\n }\n public void onFailure(Throwable throwable) {\n _logger.error(\"String_Node_Str\", writeTransaction.getIdentifier(), throwable.getCause());\n }\n });\n futureMap.put(nodeConnectorLock, writeTxResultFuture);\n }\n}\n"
|
"public void mouseDragged(MouseEvent e) {\n if (active < 0)\n return;\n float x = (float) (e.getX() / scale);\n float y = (float) (e.getY() / scale);\n synchronized (pointsUndistorted) {\n Point2D_F32 u;\n if (selectedUndist) {\n u = pointsUndistorted.get(active);\n } else {\n u = pointsDistorted.get(active);\n }\n u.set(x, y);\n }\n controlPointsModified(true);\n}\n"
|
"public void testMarshalToInvalidResult() throws Exception {\n boolean caughtException = false;\n Document document = parser.newDocument();\n DOMResult result = new DOMResult(document.createAttribute(\"String_Node_Str\"));\n try {\n marshaller.marshal(getControlObject(), result);\n } catch (IllegalArgumentException e) {\n caughtException = false;\n } catch (JAXBException e) {\n caughtException = true;\n }\n assertTrue(\"String_Node_Str\", caughtException);\n}\n"
|
"protected Control createDialogArea(final Composite parent) {\n parent.setLayout(new GridLayout());\n final GridLayout l = new GridLayout();\n l.numColumns = 2;\n parent.setLayout(l);\n table = new Table(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);\n GridData d = SWTUtil.createFillGridData();\n d.horizontalSpan = 2;\n d.grabExcessHorizontalSpace = true;\n d.grabExcessVerticalSpace = true;\n table.setLayoutData(d);\n table.setHeaderVisible(true);\n table.setLinesVisible(true);\n try {\n detect(file);\n read(file);\n } catch (final Exception e) {\n controller.actionShowErrorDialog(Resources.getMessage(\"String_Node_Str\"), Resources.getMessage(\"String_Node_Str\"), e);\n close();\n }\n final Combo combo = new Combo(parent, SWT.NONE);\n d = SWTUtil.createFillHorizontallyGridData();\n d.horizontalSpan = 2;\n combo.setLayoutData(d);\n for (final String s : labels) {\n combo.add(s);\n }\n combo.select(selection);\n combo.pack();\n combo.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(final SelectionEvent arg0) {\n try {\n if (combo.getSelectionIndex() == -1) {\n return;\n }\n selection = combo.getSelectionIndex();\n read(file);\n } catch (final Exception e) {\n controller.actionShowErrorDialog(Resources.getMessage(\"String_Node_Str\"), Resources.getMessage(\"String_Node_Str\") + e.getMessage());\n close();\n }\n }\n });\n return parent;\n}\n"
|
"private void setDpPathShare(int pidx, int aidx, ZhaoObject zhaoPred, ZhaoObject zhaoArg) {\n List<Pair<Integer, Dir>> argRootPath = zhaoArg.getRootPath();\n List<Pair<Integer, Dir>> predRootPath = zhaoPred.getRootPath();\n int i = argRootPath.size() - 1;\n int j = predRootPath.size() - 1;\n Pair<Integer, DepTree.Dir> argP = argRootPath.get(i);\n Pair<Integer, DepTree.Dir> predP = predRootPath.get(j);\n while (argP.equals(predP) && i > -1 && j > -1) {\n this.dpPathShare.add(argP);\n argP = argRootPath.get(i);\n predP = predRootPath.get(j);\n i--;\n j--;\n }\n Collections.reverse(this.dpPathShare);\n int r;\n if (this.dpPathShare.isEmpty()) {\n r = -1;\n this.dpPathPred = new ArrayList<Pair<Integer, Dir>>();\n this.dpPathArg = new ArrayList<Pair<Integer, Dir>>();\n } else {\n r = this.dpPathShare.get(0).get1();\n this.dpPathPred = DepTree.getDependencyPath(pidx, r, parents);\n this.dpPathArg = DepTree.getDependencyPath(aidx, r, parents);\n }\n}\n"
|
"public void fire() throws IllegalActionException {\n super.fire();\n DateToken dateToken = null;\n int datePrecision = DateToken.PRECISION_MILLISECOND;\n if (timeAsLong.connectedPortList().size() > 0 && timeAsLong.hasToken(0)) {\n long timeAsLongValue = 1l;\n timeAsLongValue = ((LongToken) timeAsLong.get(0)).longValue();\n String precisionValue = \"String_Node_Str\";\n precisionValue = ((StringToken) precision.getToken()).stringValue();\n if (precisionValue.equals(\"String_Node_Str\")) {\n datePrecision = DateToken.PRECISION_SECOND;\n }\n if (precisionValue.equals(\"String_Node_Str\")) {\n datePrecision = DateToken.PRECISION_MILLISECOND;\n }\n if (precisionValue.equals(\"String_Node_Str\")) {\n datePrecision = DateToken.PRECISION_MICROSECOND;\n }\n if (precisionValue.equals(\"String_Node_Str\")) {\n datePrecision = DateToken.PRECISION_NANOSECOND;\n } else {\n datePrecision = DateToken.PRECISION_MILLISECOND;\n }\n String timeZoneValue = TimeZone.getDefault().getID();\n if ((timeZone.connectedPortList().size() > 0) && timeZone.hasToken(0)) {\n timeZoneValue = ((StringToken) timeZone.get(0)).stringValue();\n }\n dateToken = new DateToken(timeAsLongValue, datePrecision, TimeZone.getTimeZone(timeZoneValue));\n } else {\n int yearValue = 1970;\n if (year.connectedPortList().size() > 0 && year.hasToken(0)) {\n yearValue = ((IntToken) year.get(0)).intValue();\n }\n int monthValue = 1;\n if (month.connectedPortList().size() > 0 && month.hasToken(0)) {\n monthValue = ((IntToken) month.get(0)).intValue();\n }\n int dayValue = 1;\n if (day.connectedPortList().size() > 0 && day.hasToken(0)) {\n dayValue = ((IntToken) day.get(0)).intValue();\n }\n int hourValue = 0;\n if (hour.connectedPortList().size() > 0 && hour.hasToken(0)) {\n hourValue = ((IntToken) hour.get(0)).intValue();\n }\n int minuteValue = 0;\n if (minute.connectedPortList().size() > 0 && minute.hasToken(0)) {\n minuteValue = ((IntToken) minute.get(0)).intValue();\n }\n int secondValue = 0;\n if (second.connectedPortList().size() > 0 && second.hasToken(0)) {\n secondValue = ((IntToken) second.get(0)).intValue();\n datePrecision = DateToken.PRECISION_SECOND;\n }\n int millisecondValue = 0;\n if (millisecond.connectedPortList().size() > 0 && millisecond.hasToken(0)) {\n millisecondValue = ((IntToken) millisecond.get(0)).intValue();\n datePrecision = DateToken.PRECISION_MILLISECOND;\n }\n int microsecondValue = 0;\n if (microsecond.connectedPortList().size() > 0 && microsecond.hasToken(0)) {\n microsecondValue = ((IntToken) microsecond.get(0)).intValue();\n datePrecision = DateToken.PRECISION_MICROSECOND;\n }\n int nanosecondValue = 0;\n if (nanosecond.connectedPortList().size() > 0 && nanosecond.hasToken(0)) {\n nanosecondValue = ((IntToken) nanosecond.get(0)).intValue();\n datePrecision = DateToken.PRECISION_NANOSECOND;\n }\n String timeZoneValue = TimeZone.getDefault().getID();\n if ((timeZone.connectedPortList().size() > 0) && timeZone.hasToken(0)) {\n timeZoneValue = ((StringToken) timeZone.get(0)).stringValue();\n }\n dateToken = new DateToken();\n dateToken.getCalendarInstance().setTimeZone(TimeZone.getTimeZone(timeZoneValue));\n dateToken.getCalendarInstance().set(Calendar.YEAR, yearValue);\n dateToken.getCalendarInstance().set(Calendar.MONTH, monthValue);\n dateToken.getCalendarInstance().set(Calendar.DAY_OF_MONTH, dayValue);\n dateToken.getCalendarInstance().set(Calendar.HOUR, hourValue);\n dateToken.getCalendarInstance().set(Calendar.MINUTE, minuteValue);\n dateToken.getCalendarInstance().set(Calendar.SECOND, secondValue);\n dateToken.getCalendarInstance().set(Calendar.MILLISECOND, millisecondValue);\n dateToken.addMicroseconds(microsecondValue);\n dateToken.addNanoseconds(nanosecondValue);\n }\n output.send(0, dateToken);\n}\n"
|
"private void slerpView(final GL gl, SlerpAction slerpAction) {\n int iViewId = slerpAction.getElementId();\n SlerpMod slerpMod = new SlerpMod();\n if ((iSlerpFactor == 0)) {\n slerpMod.playSlerpSound();\n }\n Transform transform = slerpMod.interpolate(slerpAction.getOriginHierarchyLayer().getTransformByPositionIndex(slerpAction.getOriginPosIndex()), slerpAction.getDestinationHierarchyLayer().getTransformByPositionIndex(slerpAction.getDestinationPosIndex()), (float) iSlerpFactor / SLERP_RANGE);\n gl.glPushMatrix();\n slerpMod.applySlerp(gl, transform);\n ((AGLCanvasUser) generalManager.getSingelton().getViewGLCanvasManager().getItem(iViewId)).displayRemote(gl);\n gl.glPopMatrix();\n if (iSlerpFactor >= SLERP_RANGE) {\n arSlerpActions.remove(slerpAction);\n slerpAction.getDestinationHierarchyLayer().setElementVisibilityById(true, iViewId);\n iSlerpFactor = 0;\n }\n if (arSlerpActions.isEmpty()) {\n glConnectionLineRenderer.enableRendering(true);\n}\n"
|
"int addRowTry(Row row) throws SQLException {\n index.getPageStore().logUndo(this, data);\n int keyOffsetPairLen = 4 + data.getVarLongLen(row.getKey());\n while (true) {\n int x = find(row.getKey());\n PageData page = index.getPage(childPageIds[x], getPos());\n int splitPoint = page.addRowTry(row);\n if (splitPoint == -1) {\n break;\n }\n if (length + keyOffsetPairLen > index.getPageStore().getPageSize()) {\n return entryCount / 2;\n }\n long pivot = splitPoint == 0 ? row.getKey() : page.getKey(splitPoint - 1);\n PageData page2 = page.split(splitPoint);\n index.getPageStore().update(page);\n index.getPageStore().update(page2);\n addChild(x, page2.getPos(), pivot);\n index.getPageStore().updateRecord(this);\n }\n updateRowCount(1);\n return -1;\n}\n"
|
"private Synapse minPermanenceSynapse(DistalDendrite dd) {\n List<Synapse> synapses = unDestroyedSynapsesForSegment(dd);\n Synapse min = null;\n double minPermanence = Double.MAX_VALUE;\n for (Synapse synapse : synapses) {\n if (!synapse.destroyed() && synapse.getPermanence() < minPermanence - EPSILON) {\n min = synapse;\n minPermanence = synapse.getPermanence();\n }\n }\n return min;\n}\n"
|
"public void onClick(View v) {\n if (v.getId() == R.id.character_button) {\n Intent c = new Intent(HomeScreenController.this, CharacterController.class);\n c.putExtra(\"String_Node_Str\", p);\n c.putExtra(\"String_Node_Str\", character);\n startActivity(c);\n } else if (v.getId() == R.id.items_button) {\n Intent b = new Intent(HomeScreenController.this, ItemController.class);\n b.putExtra(\"String_Node_Str\", p);\n b.putExtra(\"String_Node_Str\", c);\n startActivity(b);\n } else if (v.getId() == R.id.battle_button) {\n Intent a = new Intent(HomeScreenController.this, PreBattleController.class);\n a.putExtra(\"String_Node_Str\", p);\n a.putExtra(\"String_Node_Str\", c);\n startActivity(a);\n } else if (v.getId() == R.id.logout_button) {\n Intent d = new Intent(HomeScreenController.this, StartScreenController.class);\n startActivity(d);\n }\n}\n"
|
"public void dbdirect() {\n final CollectionDAO collectionDAO = new CollectionDAO();\n DBCollection dbcoll = collectionDAO.getCollection(db, coll);\n Deque<String> _filter;\n if (filter == null) {\n _filter = null;\n } else {\n _filter = new ArrayDeque<>();\n _filter.add(filter);\n }\n ArrayList<DBObject> data;\n try {\n data = CollectionDAO.getCollectionData(dbcoll, page, pagesize, null, _filter, DBCursorPool.EAGER_CURSOR_ALLOCATION_POLICY.NONE);\n } catch (Exception e) {\n System.out.println(\"String_Node_Str\" + e.getMessage());\n return;\n }\n assertNotNull(data);\n assertFalse(data.isEmpty());\n if (printData) {\n System.out.println(data);\n }\n}\n"
|
"private void showSettings() {\n startActivityForResult(new Intent(this, SettingsPreferences.class), 1);\n}\n"
|
"private static void expandPrimitiveSpecialisedClass(final String className) throws IOException {\n final Path path = Paths.get(SOURCE_DIRECTORY, PACKAGE, className + SUFFIX);\n String contents = new String(Files.readAllBytes(path), UTF_8);\n for (Substitution substitution : SUBSTITUTIONS) {\n contents = substitution.substitute(contents);\n }\n System.out.println(contents);\n}\n"
|
"public List<Annotation> getAnnotations() {\n return new ArrayList<Annotation>(annotations.values());\n}\n"
|
"private void initTmfTrace(String path, Class<T> eventType, int cacheSize, boolean indexTrace) throws FileNotFoundException {\n fPath = path;\n if (fTraceName == null) {\n fTraceName = \"String_Node_Str\";\n if (path != null) {\n int sep = path.lastIndexOf(Path.SEPARATOR);\n fTraceName = (sep >= 0) ? path.substring(sep + 1) : path;\n }\n }\n super.init(fTraceName, eventType);\n fIndexPageSize = (cacheSize > 0) ? cacheSize : DEFAULT_INDEX_PAGE_SIZE;\n if (indexTrace)\n indexTrace(false);\n}\n"
|
"public static String getBASE64(final String dirName, final String fileName) {\n final DITAOTJavaLogger logger = new DITAOTJavaLogger();\n final URI imgInputURI = toURI(fileName);\n final File imgInput = imgInputURI.isAbsolute() ? new File(imgInputURI) : new File(dirName, toFile(imgInputURI).getPath());\n final Base64 encoder = new Base64();\n final byte[] buff = new byte[(int) imgInput.length()];\n FileInputStream file = null;\n try {\n file = new FileInputStream(imgInput);\n file.read(buff);\n return encoder.encodeToString(buff);\n } catch (final FileNotFoundException e) {\n logger.error(MessageUtils.getInstance().getMessage(\"String_Node_Str\").toString());\n logger.error(e.getMessage(), e);\n return null;\n } catch (final IOException e) {\n logger.error(MessageUtils.getInstance().getMessage(\"String_Node_Str\").toString());\n logger.error(e.getMessage(), e);\n return null;\n } finally {\n if (file != null) {\n try {\n file.close();\n } catch (final IOException ioe) {\n logger.error(ioe.getMessage(), ioe);\n }\n }\n }\n}\n"
|
"private void startNetworkingRequest() {\n if (mExecutor != null) {\n final NetworkingPrioritizable<T> prioritizable = new NetworkingPrioritizable<T>(this);\n final NetworkingRequest<T> request = new NetworkingRequest<T>(prioritizable, mPriority.ordinal(), this);\n mExecutor.executeNetworkingRequest(request);\n } else {\n notifyFailure(new ServiceError(Messages.NO_EXECUTOR));\n }\n}\n"
|
"public void handleEvent(Event event) {\n if (event.widget.equals(txtTitle)) {\n if (txtTitle.getText() == null || txtTitle.getText().trim().length() == 0) {\n getChart().getTitle().getLabel().getCaption().setValue(null);\n } else {\n getChart().getTitle().getLabel().getCaption().setValue(txtTitle.getText());\n }\n } else if (event.widget.equals(fdcFont)) {\n if (event.type == FontDefinitionComposite.FONT_CHANTED_EVENT) {\n getChart().getTitle().getLabel().getCaption().setFont((FontDefinition) ((Object[]) event.data)[0]);\n getChart().getTitle().getLabel().getCaption().setColor((ColorDefinition) ((Object[]) event.data)[1]);\n }\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.