content stringlengths 40 137k |
|---|
"public String getConnectOptions() {\n if (serviceContext.supportsConnects()) {\n ConnectOptionsContext context = serviceContext.getConnectOptionsContext();\n JSONObject jsonOptions = new JSONObject();\n try {\n if (context != null) {\n Map<String, Object> connectOptions = context.asOptionsMap();\n String[] sslCiphersArray = (String[]) connectOptions.remove(\"String_Node_Str\");\n if (sslCiphersArray != null) {\n List<String> sslCiphers = Arrays.asList(sslCiphersArray);\n if (sslCiphers.size() > 0) {\n jsonOptions.put(\"String_Node_Str\", sslCiphers);\n }\n }\n String[] sslProtocolsArray = (String[]) connectOptions.remove(\"String_Node_Str\");\n if (sslProtocolsArray != null) {\n List<String> sslProtocols = Arrays.asList(sslProtocolsArray);\n if (sslProtocols.size() > 0) {\n jsonOptions.put(\"String_Node_Str\", sslProtocols);\n }\n }\n connectOptions.remove(WS_PROTOCOL_VERSION);\n String wsVersion = (String) connectOptions.remove(\"String_Node_Str\");\n if (wsVersion != null) {\n jsonOptions.put(\"String_Node_Str\", wsVersion);\n }\n String pipeTransport = (String) connectOptions.remove(\"String_Node_Str\");\n if (pipeTransport != null) {\n jsonOptions.put(\"String_Node_Str\", pipeTransport.toString());\n }\n URI tcpTransport = (URI) connectOptions.remove(\"String_Node_Str\");\n if (tcpTransport != null) {\n jsonOptions.put(\"String_Node_Str\", tcpTransport.toString());\n }\n URI sslTransport = (URI) connectOptions.remove(\"String_Node_Str\");\n if (sslTransport != null) {\n jsonOptions.put(\"String_Node_Str\", sslTransport.toString());\n }\n URI httpTransport = (URI) connectOptions.remove(\"String_Node_Str\");\n if (httpTransport != null) {\n jsonOptions.put(\"String_Node_Str\", httpTransport.toString());\n }\n Long inactivityTimeout = (Long) connectOptions.remove(INACTIVITY_TIMEOUT);\n if (inactivityTimeout != null) {\n jsonOptions.put(\"String_Node_Str\", inactivityTimeout);\n }\n Boolean sslEncryptionEnabled = (Boolean) connectOptions.remove(SSL_ENCRYPTION_ENABLED);\n if ((sslEncryptionEnabled != null) && Boolean.FALSE.equals(sslEncryptionEnabled)) {\n jsonOptions.put(\"String_Node_Str\", \"String_Node_Str\");\n } else {\n jsonOptions.put(\"String_Node_Str\", \"String_Node_Str\");\n }\n String udpInterface = (String) connectOptions.remove(\"String_Node_Str\");\n if (udpInterface != null) {\n jsonOptions.put(\"String_Node_Str\", udpInterface);\n }\n Integer httpKeepaliveTimeout = (Integer) connectOptions.remove(HTTP_KEEP_ALIVE_TIMEOUT_KEY);\n if (httpKeepaliveTimeout != null) {\n jsonOptions.put(\"String_Node_Str\", httpKeepaliveTimeout);\n }\n Boolean httpKeepalive = (Boolean) connectOptions.remove(HTTP_KEEP_ALIVE);\n if (httpKeepalive != null) {\n if (Boolean.FALSE.equals(httpKeepalive)) {\n jsonOptions.put(\"String_Node_Str\", \"String_Node_Str\");\n } else {\n jsonOptions.put(\"String_Node_Str\", \"String_Node_Str\");\n }\n }\n for (Entry<String, Object> entry : connectOptions.entrySet()) {\n String key = entry.getKey();\n Object value = entry.getValue();\n if (value instanceof String[]) {\n jsonOptions.put(key, Utils.asCommaSeparatedString(asList((String[]) value)));\n } else {\n jsonOptions.put(key, value);\n }\n }\n }\n } catch (Exception ex) {\n }\n return jsonOptions.toString();\n } else {\n return null;\n }\n}\n"
|
"private void onConnect(final SelectionKey key) throws IOException {\n SocketChannel channel = null;\n try {\n channel = (SocketChannel) key.channel();\n } finally {\n closeables.add(channel);\n }\n final Attached attached = (Attached) key.attachment();\n try {\n if (!channel.finishConnect()) {\n return;\n }\n channel.configureBlocking(false);\n channel.socket().setTcpNoDelay(true);\n channel.socket().setSoTimeout(0);\n channel.socket().setSoLinger(false, 0);\n } catch (IOException e) {\n quietClose(key, e);\n attached.connector.connectLater();\n throw e;\n }\n attached.connector.setSuccessfullyConnected();\n if (LOG.isDebugEnabled())\n LOG.debug(\"String_Node_Str\", channel.socket().getInetAddress(), localIdentifier);\n channel.configureBlocking(false);\n channel.socket().setTcpNoDelay(true);\n channel.socket().setSoTimeout(0);\n channel.socket().setSoLinger(false, 0);\n attached.entryReader = new TcpSocketChannelEntryReader();\n attached.entryWriter = new TcpSocketChannelEntryWriter();\n key.interestOps(OP_WRITE | OP_READ);\n throttle(channel);\n attached.entryWriter.identifierToBuffer(localIdentifier);\n}\n"
|
"public ENSObject parseJSON(JSONObject JSON) {\n try {\n this.setBetreff(JSON.getString(\"String_Node_Str\"));\n this.setTime(JSON.getString(\"String_Node_Str\"));\n if (JSON.has(\"String_Node_Str\"))\n this.setText(JSON.getString(\"String_Node_Str\"));\n UserObject von = new UserObject();\n if (!JSON.isNull(\"String_Node_Str\"))\n von.ParseJSON(JSON.getJSONObject(\"String_Node_Str\"));\n this.setVon(von);\n if (JSON.has(\"String_Node_Str\"))\n for (int z = 0; z < JSON.getJSONArray(\"String_Node_Str\").length(); z++) {\n UserObject an = new UserObject();\n an.ParseJSON(JSON.getJSONArray(\"String_Node_Str\").getJSONObject(z));\n this.addAnUser(an);\n }\n if (JSON.has(\"String_Node_Str\")) {\n this.setFlags(JSON.getInt(\"String_Node_Str\"));\n } else {\n this.setFlags(JSON.getInt(\"String_Node_Str\"));\n }\n this.setENS_id(JSON.getLong(\"String_Node_Str\"));\n this.setTyp(JSON.getInt(\"String_Node_Str\"));\n if (JSON.has(\"String_Node_Str\")) {\n this.setOrdner(JSON.getInt(\"String_Node_Str\"));\n this.setAnVon(\"String_Node_Str\");\n } else {\n this.setOrdner(JSON.getInt(\"String_Node_Str\"));\n this.setAnVon(\"String_Node_Str\");\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return this;\n}\n"
|
"public void fire() throws IllegalActionException {\n for (int i = 0; i < publish.getWidth(); i++) {\n if (publish.hasToken(i)) {\n StringToken token = (StringToken) publish.get(i);\n String tokenString = token.stringValue();\n JsonObject msg = new JsonObject().putString(\"String_Node_Str\", \"String_Node_Str\").putString(\"String_Node_Str\", _address).putString(\"String_Node_Str\", tokenString);\n _sendTextFrame(msg);\n }\n }\n if (_buffer != null && _buffer.size() > 0) {\n List<StringToken> _bufferCopy = new ArrayList<StringToken>();\n synchronized (_buffer) {\n _bufferCopy.addAll(_buffer);\n _buffer.clear();\n }\n for (int i = 0; i < _bufferCopy.size(); i++) {\n subscribe.send(0, _bufferCopy.get(i));\n }\n }\n}\n"
|
"public SnsHttpDelegate produceDelegateFor(PushNotificationServiceConfig config, String realm, MessageDispatcher messageDispatcher) throws PushNotificationException {\n AmazonSNSClient service = new SnsClientFactory().produce(config);\n return new SnsHttpDelegate(service, config, router, snsMessageResource, pushMessageConverter, realm, messageDispatcher);\n}\n"
|
"public ArrayList<Integer> getExecutableAddresses() {\n ArrayList<Integer> executableAddresses = new ArrayList<Integer>();\n for (LineData data : lineInfo) {\n for (LineEntry entry : data.lineEntries) {\n executableAddresses.add(entry.address);\n }\n }\n return executableAddresses;\n}\n"
|
"public void setUp() {\n cacheFactoryMock = PowerMock.createMock(WBCacheFactory.class);\n freeMarkerFactoryMock = PowerMock.createMock(WBFreeMarkerFactory.class);\n configurationMock = PowerMock.createMock(Configuration.class);\n templateLoaderMock = PowerMock.createMock(WBFreeMarkerTemplateLoader.class);\n moduleDirectiveMock = PowerMock.createMock(WBFreeMarkerModuleDirective.class);\n imageDirectiveMock = PowerMock.createMock(WBFreeMarkerImageDirective.class);\n articleDirectiveMock = PowerMock.createMock(WBFreeMarkerArticleDirective.class);\n cloudStorageMock = PowerMock.createMock(WBCloudFileStorage.class);\n messageCacheMock = PowerMock.createMock(WBMessagesCache.class);\n cacheInstancesMock = PowerMock.createMock(WBCacheInstances.class);\n Logger loggerMock = PowerMock.createMock(Logger.class);\n Whitebox.setInternalState(WBFreeMarkerTemplateEngine.class, loggerMock);\n}\n"
|
"protected int doWork() {\n IoUtil.assertFileIsReadable(INPUT);\n if (SEQUENCE_DICTIONARY != null)\n IoUtil.assertFileIsReadable(SEQUENCE_DICTIONARY);\n IoUtil.assertFileIsWritable(OUTPUT);\n final VCFFileReader reader = new VCFFileReader(INPUT);\n final VCFHeader header = new VCFHeader(reader.getFileHeader());\n final SAMSequenceDictionary sequenceDictionary = SEQUENCE_DICTIONARY != null ? SAMFileReader.getSequenceDictionary(SEQUENCE_DICTIONARY) : header.getSequenceDictionary();\n if (CREATE_INDEX && sequenceDictionary == null) {\n throw new PicardException(\"String_Node_Str\");\n }\n final EnumSet<Options> options = CREATE_INDEX ? EnumSet.of(Options.INDEX_ON_THE_FLY) : EnumSet.noneOf(Options.class);\n final VariantContextWriter writer = VariantContextWriterFactory.create(OUTPUT, sequenceDictionary, options);\n writer.writeHeader(header);\n final ProgressLogger progress = new ProgressLogger(Log.getInstance(MakeSitesOnlyVcf.class), 10000);\n final CloseableIterator<VariantContext> iterator = reader.iterator();\n while (iterator.hasNext()) {\n final VariantContext context = iterator.next();\n writer.add(context.subContextFromSamples(NO_SAMPLES, false));\n progress.record(context.getChr(), context.getStart());\n }\n CloserUtil.close(iterator);\n CloserUtil.close(reader);\n writer.close();\n return 0;\n}\n"
|
"public static PoreBlock of(BlockLoc handle) {\n return converter.apply(handle);\n}\n"
|
"public List<ActivityTest> findAll(ActivityID activity) {\n if (activity == null) {\n return null;\n }\n ActivityPK key = ObjectFactory.getActivityPK(activity);\n Query query = getSession().getNamedQuery(\"String_Node_Str\");\n query.setParameter(\"String_Node_Str\", key.getSemester());\n query.setParameter(\"String_Node_Str\", key.getSubject());\n query.setParameter(\"String_Node_Str\", key.getActivityIndex());\n List<edu.uoc.pelp.model.vo.ActivityTest> list = query.list();\n List<ActivityTest> listActivity = null;\n listActivity = getActivityTestList(list);\n getSession().close();\n return listActivity;\n}\n"
|
"public void run() {\n final ITmfTrace[] traces = new ITmfTrace[tl.size()];\n final TmfExperimentElement exp = uiexperiment.get(0);\n for (int i = 0; i < tl.size(); i++) {\n ITmfTrace trace = tl.get(i).instantiateTrace();\n ITmfEvent traceEvent = tl.get(i).instantiateEvent();\n if (trace == null) {\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_WrongType + tl.get(i).getName());\n for (int j = 0; j < i; j++) {\n traces[j].dispose();\n }\n return;\n }\n try {\n trace.initTrace(tl.get(i).getResource(), tl.get(i).getLocation().getPath(), traceEvent.getClass());\n } catch (TmfTraceException e) {\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_InitError + CR + CR + e);\n trace.dispose();\n for (int j = 0; j < i; j++) {\n traces[j].dispose();\n }\n return;\n }\n return;\n }\n exp.refreshSupplementaryFolder();\n final TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, exp.getName(), traces, exp.getResource());\n try {\n final SynchronizationAlgorithm syncAlgo = experiment.synchronizeTraces(true);\n Display.getDefault().asyncExec(new Runnable() {\n public void run() {\n for (int i = 0; i < tl.size(); i++) {\n TmfTraceElement traceel = tl.get(i);\n ITmfTrace expTrace = null;\n for (ITmfTrace t : experiment.getTraces()) {\n if (t.getResource().equals(traceel.getResource())) {\n expTrace = t;\n break;\n }\n }\n try {\n if ((expTrace != null) && syncAlgo.isTraceSynced(expTrace.getHostId())) {\n TmfTraceElement origtrace = traceel.getElementUnderTraceFolder();\n if (origtrace != null) {\n String newname = traceel.getName();\n IContainer parentFolder = origtrace.getResource().getParent();\n boolean traceexists;\n do {\n traceexists = false;\n newname += \"String_Node_Str\";\n if (parentFolder.findMember(newname) != null) {\n traceexists = true;\n }\n } while (traceexists);\n TmfTraceElement newtrace = origtrace.copy(newname);\n if (newtrace != null) {\n ITmfTrace trace = newtrace.instantiateTrace();\n ITmfEvent traceEvent = newtrace.instantiateEvent();\n trace.initTrace(newtrace.getResource(), newtrace.getLocation().getPath(), traceEvent.getClass());\n trace.setTimestampTransform(syncAlgo.getTimestampTransform(trace));\n exp.addTrace(newtrace);\n exp.removeTrace(traceel);\n } else {\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_Error + CR + CR + String.format(Messages.SynchronizeTracesHandler_CopyProblem, origtrace.getName()));\n }\n }\n }\n } catch (CoreException e) {\n Activator.getDefault().logError(String.format(Messages.SynchronizeTracesHandler_ErrorSynchingForTrace, exp.getName(), traceel.getName()), e);\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_Error + CR + CR + e.getMessage());\n } catch (TmfTraceException e) {\n Activator.getDefault().logError(String.format(Messages.SynchronizeTracesHandler_ErrorSynchingForTrace, exp.getName(), traceel.getName()), e);\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_Error + CR + CR + e.getMessage());\n }\n }\n }\n });\n } catch (TmfTraceException e) {\n Activator.getDefault().logError(String.format(Messages.SynchronizeTracesHandler_ErrorSynchingExperiment, exp.getName()), e);\n TraceUtils.displayErrorMsg(Messages.SynchronizeTracesHandler_Title, Messages.SynchronizeTracesHandler_Error + CR + CR + e.getMessage());\n }\n}\n"
|
"public int getDroppedExp() {\n return this.getHandle().getExp();\n}\n"
|
"public boolean disassociateIpAddress(long ipAddressId) {\n Long userId = UserContext.current().getCallerUserId();\n Account caller = UserContext.current().getCaller();\n IPAddressVO ipVO = _ipAddressDao.findById(ipAddressId);\n if (ipVO == null) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + ipAddressId);\n }\n if (ipVO.getAllocatedTime() == null) {\n s_logger.debug(\"String_Node_Str\" + ipAddressId + \"String_Node_Str\");\n return true;\n }\n if (ipVO.getAllocatedToAccountId() != null) {\n _accountMgr.checkAccess(caller, null, ipVO);\n }\n Network associatedNetwork = getNetwork(ipVO.getAssociatedWithNetworkId());\n if (ipVO.isSourceNat() && areServicesSupportedInNetwork(associatedNetwork.getId(), Service.SourceNat)) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n VlanVO vlan = _vlanDao.findById(ipVO.getVlanId());\n if (!vlan.getVlanType().equals(VlanType.VirtualNetwork)) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n if (_accountVlanMapDao.findAccountVlanMap(ipVO.getAccountId(), ipVO.getVlanId()) != null) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + ipAddressId + \"String_Node_Str\");\n }\n return releasePublicIpAddress(ipAddressId, userId, caller);\n}\n"
|
"protected void refreshData() {\n try {\n if (this.comitting)\n return;\n this.refreshing = true;\n WSUniverse wsUniverse = (WSUniverse) (getXObject().getWsObject());\n universe = new Universe(\"String_Node_Str\");\n universe.setName(wsUniverse.getName());\n universe.setDefaultReversionID(wsUniverse.getDefaultItemsRevisionID());\n universe.setDescription(wsUniverse.getDescription() == null ? \"String_Node_Str\" : wsUniverse.getDescription());\n universe.setDefaultReversionID(wsUniverse.getDefaultItemsRevisionID());\n universe.getXtentisObjectsList().clear();\n for (WSUniverseXtentisObjectsRevisionIDs xtentisObjects : wsUniverse.getXtentisObjectsRevisionIDs()) {\n String name = xtentisObjects.getXtentisObjectName();\n if (EXtentisObjects.Transformer.getName().equals(name)) {\n name = EXtentisObjects.Transformer.getDisplayName();\n }\n universe.getXtentisObjectsList().add(new KeyValue(name, xtentisObjects.getRevisionID()));\n }\n for (WSUniverseItemsRevisionIDs item : wsUniverse.getItemsRevisionIDs()) {\n universe.getItemsList().add(new Line(columns, new String[] { item.getConceptPattern(), item.getRevisionID() }));\n }\n XtentisPort port = Util.getPort(getXObject());\n String[] objects = port.getObjectsForRoles(null).getStrings();\n Arrays.sort(objects);\n descriptionText.setText(universe.getDescription() == null ? \"String_Node_Str\" : universe.getDescription());\n defaultReversionIDText.getText().setText(universe.getDefaultReversionID() == null ? \"String_Node_Str\" : universe.getDefaultReversionID());\n for (KeyValue line : universe.getXtentisObjectsList()) {\n LabelText labelText = xtentisObjectsLabelTexts.get(line.key);\n if (labelText != null) {\n labelText.getText().setText(line.value);\n }\n }\n instancesViewer.setInput(universe.getItemsList());\n this.refreshing = false;\n } catch (Exception e) {\n e.printStackTrace();\n MessageDialog.openError(this.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + e.getLocalizedMessage());\n }\n}\n"
|
"private final boolean bringUpServiceLocked(ServiceRecord r, int intentFlags, boolean whileRestarting) {\n if (r.app != null && r.app.thread != null) {\n sendServiceArgsLocked(r, false);\n return true;\n }\n if (!whileRestarting && r.restartDelay > 0) {\n return true;\n }\n if (DEBUG_SERVICE)\n Log.v(TAG, \"String_Node_Str\" + r.name + \"String_Node_Str\" + r.intent);\n mRestartingServices.remove(r);\n final String appName = r.processName;\n ProcessRecord app = getProcessRecordLocked(appName, r.appInfo.uid);\n if (app != null && app.thread != null) {\n try {\n realStartServiceLocked(r, app);\n return true;\n } catch (RemoteException e) {\n Log.w(TAG, \"String_Node_Str\" + r.shortName, e);\n }\n }\n if (!mPendingServices.contains(r)) {\n if (startProcessLocked(appName, r.appInfo, true, intentFlags, \"String_Node_Str\", r.name, false) == null) {\n Log.w(TAG, \"String_Node_Str\" + r.appInfo.packageName + \"String_Node_Str\" + r.appInfo.uid + \"String_Node_Str\" + r.intent.getIntent() + \"String_Node_Str\");\n bringDownServiceLocked(r, true);\n return false;\n }\n mPendingServices.add(r);\n }\n return true;\n}\n"
|
"public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {\n ValidationUtil.isNotNull(unit, \"String_Node_Str\");\n long deadline = timeout == 0L ? -1 : Clock.currentTimeMillis() + unit.toMillis(timeout);\n for (; ; ) {\n Thread.sleep(100);\n if (isDone()) {\n break;\n }\n long delta = deadline - Clock.currentTimeMillis();\n if (delta <= 0L) {\n throw new TimeoutException(\"String_Node_Str\");\n }\n }\n return getResult();\n}\n"
|
"private void updateSegmentTreeRangeLazy(int[] segmentTree, int[] lazy, int startRange, int endRange, int delta, int low, int high, int pos) {\n if (low > high) {\n return;\n }\n if (lazy[pos] != 0) {\n if (low != high) {\n segmentTree[2 * pos + 1] += lazy[pos];\n segmentTree[2 * pos + 2] += lazy[pos];\n }\n lazy[pos] = 0;\n }\n if (startRange <= low && endRange >= high) {\n segmentTree[pos] += delta;\n if (low != high) {\n lazy[2 * pos + 1] += delta;\n lazy[2 * pos + 2] += delta;\n }\n return;\n }\n int mid = (low + high) / 2;\n updateSegmentTreeRangeLazy(segmentTree, lazy, startRange, endRange, delta, low, mid, 2 * pos + 1);\n updateSegmentTreeRangeLazy(segmentTree, lazy, startRange, endRange, delta, mid + 1, high, 2 * pos + 1);\n segmentTree[pos] = Math.min(segmentTree[2 * pos + 1], segmentTree[2 * pos + 2]);\n}\n"
|
"public List<IGraphItem> getSearchResult() {\n if (iSearchDepth < 1) {\n return new ArrayList<IGraphItem>(0);\n }\n List<IGraphItem> resultList = new ArrayList<IGraphItem>();\n List<IGraphItem> tmpList = this.itemSource.getAllItemsByProp(prop);\n Iterator<IGraphItem> iterTmpGraphItems = tmpList.iterator();\n while (iterTmpGraphItems.hasNext()) {\n resultList.add(iterTmpGraphItems.next());\n }\n if (iSearchDepth == 1) {\n depthSortedList.set(0, resultList);\n return resultList;\n }\n List<IGraphItem> currentSourceList = new ArrayList<IGraphItem>(resultList);\n depthSortedList.add(0, currentSourceList);\n for (int iCurrentDepthIndex = 1; iCurrentDepthIndex < this.iSearchDepth; iCurrentDepthIndex++) {\n List<IGraphItem> currentLevel = new ArrayList<IGraphItem>();\n Iterator<IGraphItem> iter = currentSourceList.iterator();\n while (iter.hasNext()) {\n Iterator<IGraphItem> iterInner = iter.next().getAllItemsByProp(prop).iterator();\n while (iterInner.hasNext()) {\n IGraphItem item = iterInner.next();\n if (!resultList.contains(item)) {\n resultList.add(item);\n currentLevel.add(item);\n }\n }\n }\n depthSortedList.add(iCurrentDepthIndex, currentLevel);\n currentSourceList = currentLevel;\n }\n return resultList;\n}\n"
|
"public IBinder onBind(Intent intent) {\n _torInstance = this;\n initTorPaths();\n new Thread() {\n public void run() {\n findExistingProc();\n }\n }.start();\n if (ITorService.class.getName().equals(intent.getAction())) {\n return mBinder;\n } else\n return null;\n}\n"
|
"public void onComplete(Task<AnnotatedData<LeaderboardScore>> task) {\n if (task.isSuccessful()) {\n AnnotatedData<LeaderboardScore> result = task.getResult();\n LeaderboardScore leaderboardScore = result.get();\n long score = -1;\n long rank = -1;\n if (leaderboardScore != null) {\n score = leaderboardScore.getRawScore();\n rank = leaderboardScore.getRank();\n }\n GodotLib.calldeferred(instance_id, \"String_Node_Str\", new Object[] { String.valueOf(score), String.valueOf(rank) });\n } else {\n Log.e(TAG, \"String_Node_Str\" + task.getException());\n GodotLib.calldeferred(instance_id, \"String_Node_Str\", new Object[] { task.getException().getMessage() });\n }\n}\n"
|
"private void serveChangesFeed(RestServiceRequest rsr, long since, long maxDurationSeconds) throws IOException, CoreException {\n if (!rsr.request.isAsyncSupported())\n throw new IllegalStateException(\"String_Node_Str\");\n if (since < -1)\n throw new IllegalArgumentException(\"String_Node_Str\");\n if (rsr.request.getAttribute(\"String_Node_Str\") == null) {\n if (RestServices.LOGPUBLISH.isDebugEnabled())\n RestServices.LOGPUBLISH.debug(\"String_Node_Str\" + rsr.request.getPathInfo());\n rsr.response.getOutputStream().write(RestServices.END_OF_HTTPHEADER.getBytes(RestServices.UTF8));\n if (since != -1) {\n lastWrittenChange = writeChanges(rsr, Core.createSystemContext(), since);\n if (lastWrittenChange != null && maxDurationSeconds < 0) {\n rsr.endDoc();\n return;\n }\n }\n rsr.response.flushBuffer();\n AsyncContext asyncContext = rsr.request.startAsync();\n synchronized (this) {\n ChangeFeedSubscriber lpsession = new ChangeFeedSubscriber(asyncContext, maxDurationSeconds < 0, this);\n longPollSessions.add(lpsession);\n rsr.request.setAttribute(\"String_Node_Str\", lpsession);\n }\n if (maxDurationSeconds != 0L)\n asyncContext.setTimeout(Math.abs(maxDurationSeconds) * 1000);\n } else {\n ChangeFeedSubscriber lpsession = (ChangeFeedSubscriber) rsr.request.getAttribute(\"String_Node_Str\");\n unregisterListener(lpsession);\n }\n}\n"
|
"private void incrementPredecessor() {\n if (predecessor.siblingAfter != null && predecessor.siblingAfter != current) {\n nodesToAttach.queueOutOfOrderNodeForAttaching(predecessor.siblingAfter);\n predecessor.siblingAfter.siblingBefore = null;\n predecessor.siblingAfter = null;\n }\n predecessorAtOurHeight = predecessor;\n predecessor = predecessor.parent;\n}\n"
|
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Resources res = getResources();\n ColorDrawable plum = new ColorDrawable(getResources().getColor(R.color.plum));\n int shadowPlum = res.getColor(R.color.shadow_plum);\n ActionBar actionBar = getActionBar();\n if (actionBar != null)\n actionBar.setBackgroundDrawable(plum);\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n window.setStatusBarColor(shadowPlum);\n }\n}\n"
|
"public OutputStream putNextEntry(String name) throws java.io.IOException {\n name = name.replace('/', File.separatorChar);\n File newFile = new File(archive, name);\n if (newFile.exists()) {\n if (!deleteEntry(name, false) && uri != null) {\n deplLogger.log(Level.FINE, \"String_Node_Str\", new Object[] { name, uri.toASCIIString() });\n }\n }\n if (name.lastIndexOf(File.separatorChar) != -1) {\n String dirs = name.substring(0, name.lastIndexOf(File.separatorChar));\n File dirsFile = new File(archive, dirs);\n if (!dirsFile.exists() && !dirsFile.mkdirs()) {\n throw new IOException(\"String_Node_Str\" + dirsFile.getAbsolutePath());\n }\n }\n staleFileManager().recordValidEntry(newFile);\n os = new BufferedOutputStream(new FileOutputStream(newFile));\n return os;\n}\n"
|
"public static int[] toPrimitive(Integer[] integers) {\n int[] ints = new int[integers.length];\n int i = 0;\n for (Integer n : integers) {\n ints[i++] = n;\n }\n return ints;\n}\n"
|
"public void removeOpenPaths(int[][] paths) {\n int newPathLength = paths != null ? paths.length : 0;\n if (newPathLength > 0 && !_opens.isEmpty()) {\n for (TreeNode<E> e : getNodesByPath(paths)) {\n if (_opens.containsKey(e)) {\n _opens.remove(e);\n fireOpenChanged(e);\n }\n }\n }\n}\n"
|
"public NamedComponent<JongoCollection> customize(NamedComponent<JongoCollection> namedComponent) {\n if (namedComponent.getName().getName().equals(given.getCollection())) {\n Mapper mapper = satisfiedBOM.getOne(mapperQuery).get().getComponent();\n return new NamedComponent<>(namedComponent.getName(), new SequencedJongoCollection(namedComponent.getComponent(), mapper, mapper.getObjectIdUpdater(), iteratingSequence));\n } else {\n return namedComponent;\n }\n}\n"
|
"private ScannerFields getScannerFields(MetricsScanQuery query, boolean shouldMatchAllTags) {\n int startTimeBase = getTimeBase(query.getStartTime());\n int endTimeBase = getTimeBase(query.getEndTime());\n byte[][] columns = null;\n if (startTimeBase == endTimeBase) {\n int startCol = (int) (query.getStartTime() - startTimeBase) / resolution;\n int endCol = (int) (query.getEndTime() - endTimeBase) / resolution;\n columns = new byte[endCol - startCol + 1][];\n for (int i = 0; i < columns.length; i++) {\n columns[i] = Bytes.toBytes((short) (startCol + i));\n }\n }\n String tagPrefix = query.getTagPrefix();\n if (!shouldMatchAllTags && tagPrefix == null) {\n tagPrefix = MetricsConstants.EMPTY_TAG;\n }\n byte[] startRow = entityCodec.paddedEncode(query.getContextPrefix(), query.getMetricPrefix(), tagPrefix, startTimeBase, query.getRunId(), 0);\n byte[] endRow = entityCodec.paddedEncode(query.getContextPrefix(), query.getMetricPrefix(), tagPrefix, endTimeBase + 1, query.getRunId(), 0xff);\n FuzzyRowFilter filter = getFilter(query, startTimeBase, endTimeBase, shouldMatchAllTags);\n return new ScannerFields(startRow, endRow, columns, filter);\n}\n"
|
"private void pauseTimer() {\n status = Status.PAUSED;\n this.pauseTime = System.currentTimeMillis();\n handler.removeCallbacks(Countdown);\n}\n"
|
"public Dosage setRate(Type value) throws FHIRFormatError {\n if (value != null && !(value instanceof Ratio || value instanceof Range || value instanceof Quantity))\n throw new FHIRFormatError(\"String_Node_Str\" + value.fhirType());\n this.rate = value;\n return this;\n}\n"
|
"private void checkAfterEncoding(final ARXConfiguration config, final DataManager manager) {\n if (config.isPrivacyModelSpecified(KAnonymity.class)) {\n KAnonymity c = config.getPrivacyModel(KAnonymity.class);\n if ((c.getK() > numberOfOutputRecords) || (c.getK() < 1)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + c.getK() + \"String_Node_Str\" + manager.getDataGeneralized().getDataLength() + \"String_Node_Str\");\n }\n }\n if (config.isPrivacyModelSpecified(LDiversity.class)) {\n for (LDiversity c : config.getPrivacyModels(LDiversity.class)) {\n if ((c.getL() > manager.getDataGeneralized().getDataLength()) || (c.getL() < 1)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + c.getL() + \"String_Node_Str\" + manager.getDataGeneralized().getDataLength() + \"String_Node_Str\");\n }\n }\n }\n if (config.isPrivacyModelSpecified(DDisclosurePrivacy.class)) {\n for (DDisclosurePrivacy c : config.getPrivacyModels(DDisclosurePrivacy.class)) {\n if (c.getD() <= 0) {\n throw new IllegalArgumentException(\"String_Node_Str\" + c.getD() + \"String_Node_Str\");\n }\n }\n }\n if (config.isPrivacyModelSpecified(BasicBLikeness.class)) {\n for (BasicBLikeness c : config.getPrivacyModels(BasicBLikeness.class)) {\n if (c.getB() <= 0) {\n throw new IllegalArgumentException(\"String_Node_Str\" + c.getB() + \"String_Node_Str\");\n }\n }\n }\n if (config.isPrivacyModelSpecified(EnhancedBLikeness.class)) {\n for (EnhancedBLikeness c : config.getPrivacyModels(EnhancedBLikeness.class)) {\n if (c.getB() <= 0) {\n throw new IllegalArgumentException(\"String_Node_Str\" + c.getB() + \"String_Node_Str\");\n }\n }\n }\n for (final GeneralizationHierarchy hierarchy : manager.getHierarchies()) {\n hierarchy.checkMonotonicity(manager);\n }\n final int[] hierarchyHeights = manager.getHierachiesHeights();\n final int[] minLevels = manager.getHierarchiesMinLevels();\n final int[] maxLevels = manager.getHierarchiesMaxLevels();\n for (int i = 0; i < hierarchyHeights.length; i++) {\n if (minLevels[i] > (hierarchyHeights[i] - 1)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + manager.getHierarchies()[i].getName() + \"String_Node_Str\" + minLevels[i] + \"String_Node_Str\" + (hierarchyHeights[i] - 1));\n }\n if (minLevels[i] < 0) {\n throw new IllegalArgumentException(\"String_Node_Str\" + manager.getHierarchies()[i].getName() + \"String_Node_Str\");\n }\n if (maxLevels[i] > (hierarchyHeights[i] - 1)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + manager.getHierarchies()[i].getName() + \"String_Node_Str\" + maxLevels[i] + \"String_Node_Str\" + (hierarchyHeights[i] - 1));\n }\n if (maxLevels[i] < minLevels[i]) {\n throw new IllegalArgumentException(\"String_Node_Str\" + manager.getHierarchies()[i].getName() + \"String_Node_Str\");\n }\n }\n}\n"
|
"protected String writeString(List<String> items) {\n int size = items.size();\n StringBuffer buf = new StringBuffer(size * 50);\n buf.append(\"String_Node_Str\");\n for (int i = 0; i < size; i++) {\n buf.append(items.get(i));\n if (i != size - 1) {\n String trim = ARG_DELIMITER.trim();\n if (!items.get(i + 1).trim().startsWith(trim)) {\n buf.append(ARG_DELIMITER);\n } else {\n buf.append(\"String_Node_Str\");\n }\n }\n }\n return buf.toString();\n}\n"
|
"private IntentFieldBinding getIntentFieldBinding(Element element) throws InvalidTypeException {\n TypeMirror type = element.asType();\n if (type instanceof TypeVariable) {\n type = ((TypeVariable) type).getUpperBound();\n }\n String name = element.getSimpleName().toString();\n String intentType = typeUtil.getIntentType(type);\n boolean arrayList = isIntentArrayList(intentType);\n KeySpec key = getKey(element, EXTRA_KEY_PREFIX);\n return new IntentFieldBinding(name, type, intentType, key, arrayList);\n}\n"
|
"public void updateDeserializer(SDeserializerPluginConfiguration deserializer) throws ServerException, UserException {\n requireRealUserAuthentication();\n DatabaseSession session = getBimServer().getDatabase().createSession();\n try {\n DeserializerPluginConfiguration convert = session.get(deserializer.getOid(), OldQuery.getDefault());\n getBimServer().getSConverter().convertFromSObject(deserializer, convert, session);\n session.executeAndCommitAction(new UpdateDeserializerDatabaseAction(session, getInternalAccessMethod(), convert));\n } catch (Exception e) {\n handleException(e);\n } finally {\n session.close();\n }\n}\n"
|
"private void verifyValues(ContentValues values) {\n if (!values.containsKey(FinchVideo.SimpleVideos.TITLE_NAME)) {\n Resources r = Resources.getSystem();\n values.put(FinchVideo.SimpleVideos.TITLE_NAME, r.getString(android.R.string.untitled));\n }\n if (!values.containsKey(FinchVideo.SimpleVideos.DESCRIPTION_NAME)) {\n values.put(FinchVideo.SimpleVideos.URI_NAME, \"String_Node_Str\");\n }\n if (!values.containsKey(FinchVideo.SimpleVideos.URI_NAME)) {\n values.put(FinchVideo.SimpleVideos.URI_NAME, \"String_Node_Str\");\n }\n}\n"
|
"public String saveCassandraStart(final String streamName) {\n try {\n ssaw.api().saveToCassandra(streamName);\n return \"String_Node_Str\".concat(streamName).concat(\"String_Node_Str\");\n } catch (StratioStreamingException e) {\n throw new StreamingShellException(e);\n }\n}\n"
|
"public void testInvalidKeyset() throws Exception {\n KeyFormat format = KeyFormat.newBuilder().setTypeUrl(macTypeUrl).build();\n KeysetManager manager = new KeysetManager.Builder().setKeyFormat(format).build();\n manager.rotate();\n Keyset keyset = manager.getKeysetHandle().getKeyset();\n KeyData echoAeadKey = Registry.INSTANCE.newKey(KeyFormat.newBuilder().setTypeUrl(echoAeadTypeUrl).build());\n EchoAead echoAead = Registry.INSTANCE.getPrimitive(echoAeadKey);\n KeysetHandle keysetHandle = manager.getKeysetHandle(echoAead);\n assertNotNull(keysetHandle.getEncryptedKeyset());\n KmsEncryptedKeyset encryptedKeyset = KmsEncryptedKeyset.newBuilder().setEncryptedKeyset(ByteString.copyFrom(keysetHandle.getEncryptedKeyset())).setKmsKey(echoAeadKey).setKeysetInfo(keysetHandle.getKeysetInfo()).build();\n byte[] proto = encryptedKeyset.toByteArray();\n proto[0] = (byte) ~proto[0];\n try {\n KeysetHandle unused = KmsEncryptedKeysetHandle.fromBinaryFormat(proto);\n fail(\"String_Node_Str\");\n } catch (GeneralSecurityException e) {\n assertTrue(e.toString().contains(\"String_Node_Str\"));\n }\n String str = TextFormat.printToUnicodeString(encryptedKeyset);\n try {\n KeysetHandle handle = KmsEncryptedKeysetHandle.fromTextFormat(str + \"String_Node_Str\");\n fail(\"String_Node_Str\");\n } catch (GeneralSecurityException e) {\n assertTrue(e.toString().contains(\"String_Node_Str\"));\n }\n KmsEncryptedKeyset encryptedKeySet2 = encryptedKeyset.toBuilder().clearEncryptedKeyset().build();\n try {\n KeysetHandle handle = KmsEncryptedKeysetHandle.fromBinaryFormat(proto);\n fail(\"String_Node_Str\");\n } catch (GeneralSecurityException e) {\n assertTrue(e.toString().contains(\"String_Node_Str\"));\n }\n KmsEncryptedKeyset encryptedKeySet3 = encryptedKeyset.toBuilder().clearKmsKey().build();\n try {\n KeysetHandle handle = KmsEncryptedKeysetHandle.fromBinaryFormat(proto);\n fail(\"String_Node_Str\");\n } catch (GeneralSecurityException e) {\n assertTrue(e.toString().contains(\"String_Node_Str\"));\n }\n}\n"
|
"protected void createColumnDefinitions(TypeElement typeElement) {\n List<? extends Element> elements = ElementUtility.getAllElements(typeElement, manager);\n ColumnValidator columnValidator = new ColumnValidator();\n OneToManyValidator oneToManyValidator = new OneToManyValidator();\n for (Element element : elements) {\n boolean isValidColumn = (allFields && (element.getKind().isField() && !element.getModifiers().contains(Modifier.STATIC) && !element.getModifiers().contains(Modifier.PRIVATE) && !element.getModifiers().contains(Modifier.FINAL)));\n boolean isPackagePrivate = ElementUtility.isPackagePrivate(element);\n boolean isPackagePrivateNotInSamePackage = isPackagePrivate && !ElementUtility.isInSamePackage(manager, element, this.element);\n boolean isForeign = element.getAnnotation(ForeignKey.class) != null;\n boolean isPrimary = element.getAnnotation(PrimaryKey.class) != null;\n if (element.getAnnotation(Column.class) != null || isForeign || isPrimary || isValidColumn) {\n ColumnDefinition columnDefinition;\n if (isForeign) {\n columnDefinition = new ForeignKeyColumnDefinition(manager, this, element, isPackagePrivateNotInSamePackage);\n } else {\n columnDefinition = new ColumnDefinition(manager, element, this, isPackagePrivateNotInSamePackage);\n }\n if (columnValidator.validate(manager, columnDefinition)) {\n columnDefinitions.add(columnDefinition);\n mColumnMap.put(columnDefinition.columnName, columnDefinition);\n if (columnDefinition.isPrimaryKey) {\n primaryColumnDefinitions.add(columnDefinition);\n } else if (columnDefinition.isPrimaryKeyAutoIncrement) {\n autoIncrementDefinition = columnDefinition;\n hasAutoIncrement = true;\n }\n if (columnDefinition instanceof ForeignKeyColumnDefinition) {\n foreignKeyDefinitions.add((ForeignKeyColumnDefinition) columnDefinition);\n }\n if (!columnDefinition.uniqueGroups.isEmpty()) {\n List<Integer> groups = columnDefinition.uniqueGroups;\n for (int group : groups) {\n List<ColumnDefinition> groupList = columnUniqueMap.get(group);\n if (groupList == null) {\n groupList = new ArrayList<>();\n columnUniqueMap.put(group, groupList);\n }\n if (!groupList.contains(columnDefinition)) {\n groupList.add(columnDefinition);\n }\n }\n }\n if (isPackagePrivate) {\n packagePrivateList.add(columnDefinition);\n }\n }\n } else if (element.getAnnotation(OneToMany.class) != null) {\n OneToManyDefinition oneToManyDefinition = new OneToManyDefinition((ExecutableElement) element, manager);\n if (oneToManyValidator.validate(manager, oneToManyDefinition)) {\n oneToManyDefinitions.add(oneToManyDefinition);\n }\n } else if (element.getAnnotation(ContainerKey.class) != null) {\n ContainerKeyDefinition containerKeyDefinition = new ContainerKeyDefinition(element, manager, this, isPackagePrivateNotInSamePackage);\n containerKeyDefinitions.add(containerKeyDefinition);\n } else if (element.getAnnotation(ModelCacheField.class) != null) {\n if (!element.getModifiers().contains(Modifier.PUBLIC)) {\n manager.logError(\"String_Node_Str\");\n }\n if (!element.getModifiers().contains(Modifier.STATIC)) {\n manager.logError(\"String_Node_Str\");\n }\n if (!StringUtils.isNullOrEmpty(customCacheFieldName)) {\n manager.logError(\"String_Node_Str\");\n } else {\n customCacheFieldName = element.getSimpleName().toString();\n }\n } else if (element.getAnnotation(MultiCacheField.class) != null) {\n customMultiCacheFieldName = element.getSimpleName().toString();\n }\n }\n}\n"
|
"public CustomProgressDialog generateProgressDialog(int taskId) {\n String title, message;\n switch(taskId) {\n case ModernHttpTask.SIMPLE_HTTP_TASK_ID:\n title = Localization.get(\"String_Node_Str\");\n message = Localization.get(\"String_Node_Str\");\n break;\n default:\n Log.w(TAG, \"String_Node_Str\" + \"String_Node_Str\");\n return null;\n }\n return CustomProgressDialog.newInstance(title, message, taskId);\n}\n"
|
"public static DASInfo getStorageInfo() {\n DASInfo conf = null;\n TransactionResource tran = Entities.transactionFor(DASInfo.class);\n try {\n conf = Transactions.find(new DASInfo());\n } catch (Exception e) {\n LOG.warn(\"String_Node_Str\" + StorageProperties.NAME + \"String_Node_Str\");\n conf = new DASInfo(StorageProperties.NAME, StorageProperties.DAS_DEVICE);\n Entities.persist(conf);\n tran.commit();\n } catch (Exception t) {\n LOG.error(\"String_Node_Str\" + StorageProperties.NAME);\n tran.rollback();\n return new DASInfo(StorageProperties.NAME, StorageProperties.DAS_DEVICE);\n }\n return conf;\n}\n"
|
"protected List<SearchResultItem> pickSearchResultItemsFromDuplicateGroups(SearchResult searchResult) {\n List<TreeSet<SearchResultItem>> duplicateGroups = searchResult.getDuplicateDetectionResult().getDuplicateGroups();\n return duplicateGroups.stream().map(x -> {\n return x.stream().sorted(Comparator.comparingInt(SearchResultItem::getIndexerScore).reversed().thenComparing(Comparator.comparingLong((SearchResultItem y) -> y.getPubDate().getEpochSecond()).reversed())).iterator().next();\n }).sorted(Comparator.comparingLong((SearchResultItem x) -> x.getPubDate().getEpochSecond()).reversed()).collect(Collectors.toList());\n}\n"
|
"private Long getAppIDForSession(int sessionId, boolean shouldAssertNewSession) {\n synchronized (SESSION_LOCK) {\n if (sessionMap == null) {\n Log.w(TAG, \"String_Node_Str\");\n sessionMap = new SparseArray<String>();\n }\n Long appId = sessionMap.get(sessionId);\n if (appId == null && shouldAssertNewSession) {\n int pos;\n synchronized (REGISTERED_APPS_LOCK) {\n for (RegisteredApp app : registeredApps.values()) {\n pos = app.containsSessionId(-1);\n if (pos != -1) {\n app.setSessionId(pos, sessionId);\n appId = app.getAppId();\n sessionMap.put(sessionId, appId);\n break;\n }\n }\n }\n }\n return appId;\n }\n}\n"
|
"protected void doSave() {\n String s = writeString(list);\n if (s != null && getJobProcess() != null) {\n executeCommand(new PropertyChangeCommand(getJobProcess(), EParameterName.JOB_RUN_VM_ARGUMENTS.getName(), s));\n }\n}\n"
|
"private void doImport(final String pluginId, final String zipPath, final String jobName) {\n synchronized (isAlreadyExecuteOpenJob) {\n if (isAlreadyExecuteOpenJob) {\n return;\n }\n isAlreadyExecuteOpenJob = true;\n }\n if (pluginId == null || pluginId.isEmpty() || zipPath == null || zipPath.isEmpty() || jobName == null || jobName.isEmpty()) {\n return;\n }\n OnBoardingResourceUtil.getPreferenceStore().setValue(OnBoardingResourceConstants.PREFERENCE_ALREADY_IMPORT_DEMO_JOB, true);\n OnBoardingResourceUtil.savePreferenceStore();\n new Thread(new Runnable() {\n public void run() {\n try {\n Bundle bundle = Platform.getBundle(pluginId);\n URL resourceURL = bundle.getEntry(zipPath);\n try {\n String demoZipPath = FileLocator.toFileURL(resourceURL).getPath();\n TalendImportUtil.importItems(demoZipPath, new NullProgressMonitor(), false, true, false);\n TalendImportUtil.openJob(jobName);\n } catch (Throwable e) {\n CommonExceptionHandler.process(e);\n }\n } catch (Throwable e) {\n CommonExceptionHandler.process(e);\n }\n }\n }).start();\n}\n"
|
"protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {\n AntialiasingManager.activateAntialiasing(g);\n super.paintBackground(g, menuItem, bgColor);\n boolean isToolBarExtended = new Boolean(GuiActivator.getResources().getSettingsString(\"String_Node_Str\")).booleanValue();\n if (!isToolBarExtended) {\n g = g.create();\n try {\n AntialiasingManager.activateAntialiasing(g);\n int menuWidth = menuItem.getWidth();\n int menuHeight = menuItem.getHeight();\n g.drawImage(menuBgImage, 0, 0, menuWidth, menuHeight, null);\n } finally {\n g.dispose();\n }\n }\n}\n"
|
"public int onStartCommand(Intent intent, int flags, int startId) {\n startForeground(notifMgr.getForegroundNotificationId(), notifMgr.getForegroundNotification());\n if (intent.getExtras() != null && intent.getExtras().containsKey(\"String_Node_Str\") && ((Boolean) intent.getExtras().get(\"String_Node_Str\")))\n startServices();\n return super.onStartCommand(intent, flags, startId);\n}\n"
|
"public static Optional<String> readResource(String packagePath) {\n ClassLoader classLoader = UI.class.getClassLoader();\n File file = new File(classLoader.getResource(packagePath).getFile());\n BufferedReader reader;\n StringBuilder sb = new StringBuilder();\n try {\n reader = new BufferedReader(new InputStreamReader(inputStream));\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n sb.append(\"String_Node_Str\");\n }\n reader.close();\n return Optional.of(sb.toString());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return Optional.empty();\n}\n"
|
"public void run() {\n boolean synthAvailable = false;\n String utteranceId = \"String_Node_Str\";\n Log.i(\"String_Node_Str\", \"String_Node_Str\" + speechItem.mFilename);\n try {\n synthAvailable = synthesizerLock.tryLock();\n if (!synthAvailable) {\n Thread.sleep(100);\n Thread synth = (new Thread(new SynthThread()));\n synth.setPriority(Thread.MIN_PRIORITY);\n synth.start();\n return;\n }\n if (speechItem.mParams != null) {\n String language = \"String_Node_Str\";\n String country = \"String_Node_Str\";\n String variant = \"String_Node_Str\";\n for (int i = 0; i < speechItem.mParams.size() - 1; i = i + 2) {\n String param = speechItem.mParams.get(i);\n if (param != null) {\n if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_RATE)) {\n setSpeechRate(\"String_Node_Str\", Integer.parseInt(speechItem.mParams.get(i + 1)));\n } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_LANGUAGE)) {\n language = speechItem.mParams.get(i + 1);\n } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_COUNTRY)) {\n country = speechItem.mParams.get(i + 1);\n } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_VARIANT)) {\n variant = speechItem.mParams.get(i + 1);\n } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_UTTERANCE_ID)) {\n utteranceId = speechItem.mParams.get(i + 1);\n }\n }\n }\n if (language.length() > 0) {\n setLanguage(\"String_Node_Str\", language, country, variant);\n }\n }\n nativeSynth.synthesizeToFile(speechItem.mText, speechItem.mFilename);\n } catch (InterruptedException e) {\n Log.e(\"String_Node_Str\", \"String_Node_Str\");\n e.printStackTrace();\n } finally {\n if (synthAvailable) {\n synthesizerLock.unlock();\n }\n if (utteranceId.length() > 0) {\n dispatchUtteranceCompletedCallback(utteranceId, speechItem.mCallingApp);\n }\n if (synthAvailable) {\n synthesizerLock.unlock();\n }\n processSpeechQueue();\n }\n}\n"
|
"public void run() {\n TreeNode treeNode = null;\n boolean needWarning = false;\n if (input) {\n treeNode = XmlmapFactory.eINSTANCE.createTreeNode();\n if (!parent.getOutgoingConnections().isEmpty()) {\n needWarning = true;\n }\n } else {\n treeNode = XmlmapFactory.eINSTANCE.createOutputTreeNode();\n OutputTreeNode outputTreeNode = (OutputTreeNode) treeNode;\n EList<Connection> incomingConnections = parent.getIncomingConnections();\n if (!incomingConnections.isEmpty()) {\n needWarning = true;\n }\n }\n boolean canContinue = true;\n if (needWarning) {\n canContinue = MessageDialog.openConfirm(null, \"String_Node_Str\", \"String_Node_Str\");\n }\n if (canContinue) {\n IInputValidator validataor = new IInputValidator() {\n public String isValid(String newText) {\n String xpath = XmlMapUtil.getXPath(parent.getXpath(), newText, NodeType.ELEMENT);\n EList<TreeNode> children = parent.getChildren();\n boolean exist = false;\n for (TreeNode child : children) {\n if (child.getXpath() != null && child.getXpath().equals(xpath)) {\n exist = true;\n break;\n }\n }\n if (exist) {\n return \"String_Node_Str\" + newText + \"String_Node_Str\";\n } else {\n return null;\n }\n }\n };\n InputDialog dialog = new InputDialog(null, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", validataor);\n int open = -1;\n String label = \"String_Node_Str\";\n while (!StringUtil.validateLabelForXML(label)) {\n open = dialog.open();\n if (open == InputDialog.OK) {\n label = dialog.getValue().trim();\n }\n if (open == InputDialog.CANCEL) {\n return;\n }\n }\n if (open == Window.OK) {\n XmlMapUtil.detachNodeConnections(parent, mapperManager.getCopyOfMapData(), false);\n treeNode.setName(dialog.getValue());\n treeNode.setNodeType(NodeType.ELEMENT);\n treeNode.setXpath(XmlMapUtil.getXPath(this.parent.getXpath(), treeNode.getName(), treeNode.getNodeType()));\n treeNode.setType(XmlMapUtil.DEFAULT_DATA_TYPE);\n parent.getChildren().add(treeNode);\n parent.setExpression(\"String_Node_Str\");\n if (!input) {\n OutputTreeNode output = (OutputTreeNode) parent;\n if (!XmlMapUtil.isExpressionEditable(output) && output.isAggregate()) {\n output.setAggregate(false);\n }\n }\n if (parent.eContainer() instanceof TreeNode && XmlMapUtil.DOCUMENT.equals(((TreeNode) parent.eContainer()).getType())) {\n if (parent.isLoop()) {\n parent.setLoop(false);\n }\n }\n }\n if (open == Window.OK && mapperManager != null) {\n TreeNode docRoot = XmlMapUtil.getTreeNodeRoot(parent);\n if (input) {\n if (docRoot != null && docRoot.eContainer() instanceof InputXmlTree) {\n mapperManager.refreshInputTreeSchemaEditor((InputXmlTree) docRoot.eContainer());\n }\n } else {\n if (docRoot != null && docRoot.eContainer() instanceof OutputXmlTree) {\n mapperManager.refreshOutputTreeSchemaEditor((OutputXmlTree) docRoot.eContainer());\n }\n }\n }\n }\n}\n"
|
"private void unsetJavaBreakpointUpdater() {\n try {\n ISourceViewer viewer = getSourceViewer();\n if (viewer != null) {\n IAnnotationModel model = viewer.getAnnotationModel();\n if (model instanceof AbstractMarkerAnnotationModel) {\n ReflectionUtils.executePrivateMethod(AbstractMarkerAnnotationModel.class, \"String_Node_Str\", new Class[] {}, model, new Object[] {});\n List<IConfigurationElement> updaterSpecs = (List<IConfigurationElement>) ReflectionUtils.getPrivateField(AbstractMarkerAnnotationModel.class, \"String_Node_Str\", model);\n for (Iterator<IConfigurationElement> specIter = updaterSpecs.iterator(); specIter.hasNext(); ) {\n IConfigurationElement spec = specIter.next();\n if (spec.getAttribute(\"String_Node_Str\").equals(BreakpointMarkerUpdater.class.getCanonicalName())) {\n specIter.remove();\n break;\n }\n }\n }\n }\n } catch (Exception e) {\n GroovyPlugin.getDefault().logException(\"String_Node_Str\", e);\n }\n}\n"
|
"public Map<String, Object> next() {\n if (!rowIt.hasNext() && wideRowCounterIt.hasNext()) {\n this.currentWideRowCounter = wideRowCounterIt.next();\n try {\n resetRowIt();\n } catch (RhombusException re) {\n re.printStackTrace();\n return null;\n }\n }\n if (rowIt.hasNext()) {\n FakeIdRange.IdInRange lastIdInRange = rowIt.next();\n return makeObject(lastIdInRange.getCounterValue(), lastIdInRange);\n } else {\n return null;\n }\n}\n"
|
"public static void main(String[] args) throws Exception {\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (UnsupportedLookAndFeelException e) {\n }\n SlippyTileExample slippy = new SlippyTileExample();\n Example example = Example.showWithSwing(slippy);\n SwingUtilities.invokeLater(() -> {\n example.getFrame().setJMenuBar(slippy.mapToolBar);\n example.getFrame().validate();\n });\n}\n"
|
"private boolean execute(MapCorrectionAction action) {\n if (action.getStep() == ActionStep.FINISHED) {\n action.setNextStep(ActionStep.FINISHED);\n } else if (action.getNextStep() == ActionStep.CANCELLED) {\n activeTileAction = null;\n return true;\n }\n MapHex hex = action.getLocation();\n Tile chosenTile = action.getChosenTile();\n TileManager tmgr = getParent().getTileManager();\n Tile preprintedTile = tmgr.getTile(hex.getPreprintedTileId());\n String errMsg = null;\n while (true) {\n if (chosenTile != null && rails.util.Util.hasValue(chosenTile.getExternalId()) && chosenTile != hex.getCurrentTile() && chosenTile.countFreeTiles() == 0) {\n errMsg = LocalText.getText(\"String_Node_Str\", chosenTile.getExternalId());\n action.selectHex(hex);\n break;\n }\n List<BaseToken> baseTokens = hex.getBaseTokens();\n if (chosenTile != null && baseTokens != null && !baseTokens.isEmpty()) {\n List<Station> stations = chosenTile.getStations();\n int nbSlots = 0;\n if (stations != null) {\n for (Station station : stations) {\n nbSlots += station.getBaseSlots();\n }\n }\n if (baseTokens.size() > nbSlots) {\n errMsg = LocalText.getText(\"String_Node_Str\", chosenTile.getExternalId());\n action.selectHex(hex);\n break;\n }\n if (chosenTile.getNumStations() >= 2 && hex.getCurrentTile().getColourNumber() >= chosenTile.getColourNumber() || hex.getCurrentTile().relayBaseTokensOnUpgrade()) {\n errMsg = LocalText.getText(\"String_Node_Str\", chosenTile.getExternalId());\n action.selectHex(hex);\n break;\n }\n }\n break;\n }\n if (errMsg != null) {\n DisplayBuffer.add(LocalText.getText(\"String_Node_Str\", chosenTile.getExternalId(), hex.getId(), errMsg));\n ;\n }\n ActionStep nextStep;\n if (action.getStep() != ActionStep.FINISHED)\n nextStep = action.getNextStep();\n else\n nextStep = ActionStep.FINISHED;\n switch(nextStep) {\n case SELECT_TILE:\n List<Tile> possibleTiles = tmgr.getAllUpgrades(preprintedTile, hex);\n if (preprintedTile == hex.getCurrentTile())\n possibleTiles.remove(hex.getCurrentTile());\n action.setTiles(possibleTiles);\n break;\n case SELECT_ORIENTATION:\n if (preprintedTile == chosenTile) {\n action.selectOrientation(hex.getPreprintedTileRotation());\n action.setNextStep(ActionStep.CONFIRM);\n break;\n } else if (chosenTile.getFixedOrientation() != -1) {\n action.selectOrientation(chosenTile.getFixedOrientation());\n action.setNextStep(ActionStep.CONFIRM);\n break;\n } else {\n break;\n }\n case RELAY_BASETOKENS:\n if (chosenTile.getNumStations() >= 2 && hex.getCurrentTile().getColourNumber() >= chosenTile.getColourNumber() || hex.getCurrentTile().relayBaseTokensOnUpgrade()) {\n ImmutableList.Builder<BaseToken> tokens = ImmutableList.builder();\n for (Stop oldStop : hex.getStops()) {\n tokens.addAll(oldStop.getBaseTokens());\n }\n action.setTokensToRelay(tokens.build());\n action.setPossibleStations(chosenTile.getStations());\n break;\n } else {\n action.selectRelayBaseTokens(null);\n return execute(action);\n }\n case FINISHED:\n getRoot().getChangeStack().newChangeSet(action);\n int orientation = action.getOrientation();\n hex.upgrade(chosenTile, orientation, new HashMap<String, Integer>());\n String msg = LocalText.getText(\"String_Node_Str\", chosenTile.getExternalId(), hex.getId(), hex.getOrientationName(orientation));\n ReportBuffer.add(msg);\n getParent().addToNextPlayerMessages(msg, true);\n activeTileAction = null;\n break;\n case CANCELLED:\n activeTileAction = null;\n }\n if (action.getStep() != ActionStep.FINISHED) {\n action.moveToNextStep();\n }\n return true;\n}\n"
|
"protected KeyboardAddOnAndBuilder createConcreteAddOn(Context askContext, Context context, String prefId, int nameId, String description, int sortIndex, AttributeSet attrs) {\n final int layoutResId = attrs.getAttributeResourceValue(null, XML_LAYOUT_RES_ID_ATTRIBUTE, AddOn.INVALID_RES_ID);\n final int landscapeLayoutResId = attrs.getAttributeResourceValue(null, XML_LANDSCAPE_LAYOUT_RES_ID_ATTRIBUTE, AddOn.INVALID_RES_ID);\n final int iconResId = attrs.getAttributeResourceValue(null, XML_ICON_RES_ID_ATTRIBUTE, R.drawable.sym_keyboard_notification_icon);\n final String defaultDictionary = attrs.getAttributeValue(null, XML_DICTIONARY_NAME_ATTRIBUTE);\n final String additionalIsLetterExceptions = attrs.getAttributeValue(null, XML_ADDITIONAL_IS_LETTER_EXCEPTIONS_ATTRIBUTE);\n String sentenceSeparators = attrs.getAttributeValue(null, XML_SENTENCE_SEPARATOR_CHARACTERS_ATTRIBUTE);\n if (TextUtils.isEmpty(sentenceSeparators))\n sentenceSeparators = DEFAULT_SENTENCE_SEPARATORS;\n final int physicalTranslationResId = attrs.getAttributeResourceValue(null, XML_PHYSICAL_TRANSLATION_RES_ID_ATTRIBUTE, AddOn.INVALID_RES_ID);\n final boolean keyboardDefault = attrs.getAttributeBooleanValue(null, XML_DEFAULT_ATTRIBUTE, sortIndex == 1);\n final int screenshotResId = attrs.getAttributeResourceValue(null, XML_SCREENSHOT_RES_ID_ATTRIBUTE, AddOn.INVALID_RES_ID);\n if ((prefId == null) || (nameId == AddOn.INVALID_RES_ID) || (layoutResId == AddOn.INVALID_RES_ID)) {\n Log.e(TAG, \"String_Node_Str\");\n return null;\n } else {\n if (BuildConfig.DEBUG) {\n Log.d(TAG, \"String_Node_Str\" + prefId + \"String_Node_Str\" + nameId + \"String_Node_Str\" + layoutResId + \"String_Node_Str\" + landscapeLayoutResId + \"String_Node_Str\" + iconResId + \"String_Node_Str\" + defaultDictionary);\n }\n return new KeyboardAddOnAndBuilder(askContext, context, prefId, nameId, layoutResId, landscapeLayoutResId, defaultDictionary, iconResId, physicalTranslationResId, additionalIsLetterExceptions, sentenceSeparators, description, sortIndex, keyboardDefault, screenshotResId);\n }\n}\n"
|
"default public <T> void batchUpdate(String query, int batchSize, Collection<T> params, Function<T, ?>... paramMappers) {\n PreparedStatement stmt = null;\n try {\n stmt = this.prepare(query);\n this.setAutoCommit(false);\n Iterator<T> itr = params.iterator();\n for (int i = 1; itr.hasNext(); i++) {\n T val = itr.next();\n for (int w = 0; w < paramMappers.length; w++) {\n stmt.setObject(w + 1, paramMappers[w].apply(val));\n }\n stmt.addBatch();\n if (i >= batchSize) {\n stmt.executeBatch();\n this.commit();\n i = 1;\n }\n }\n stmt.executeBatch();\n this.commit();\n this.setAutoCommit(true);\n } catch (SQLException ex) {\n if (this.isSendingErrorOutput()) {\n Debugger.error(ex, \"String_Node_Str\", Databases.simpleErrorOutput(ex));\n }\n } finally {\n if (stmt != null) {\n Databases.close(stmt);\n }\n }\n}\n"
|
"public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {\n if (unmarshalRecord.isNil() && xmlCompositeObjectMapping.getNullPolicy().isNullRepresentedByXsiNil()) {\n unmarshalRecord.resetStringBuffer();\n return;\n }\n if (null == unmarshalRecord.getChildRecord()) {\n SAXFragmentBuilder builder = unmarshalRecord.getFragmentBuilder();\n UnmarshalKeepAsElementPolicy keepAsElementPolicy = xmlCompositeObjectMapping.getKeepAsElementPolicy();\n if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepUnknownAsElement() || keepAsElementPolicy.isKeepAllAsElement()) && builder.getNodes().size() != 0) {\n if (unmarshalRecord.getTypeQName() != null) {\n Class theClass = unmarshalRecord.getConversionManager().javaType(unmarshalRecord.getTypeQName());\n if (theClass != null) {\n endElementProcessText(unmarshalRecord, xmlCompositeObjectMapping, xPathFragment, null);\n return;\n }\n }\n if (builder.getDocument() != null) {\n setOrAddAttributeValueForKeepAsElement(builder, xmlCompositeObjectMapping, xmlCompositeObjectMapping, unmarshalRecord, false, null);\n return;\n }\n } else {\n endElementProcessText(unmarshalRecord, xmlCompositeObjectMapping, xPathFragment, null);\n return;\n }\n } else {\n Object object = unmarshalRecord.getChildRecord().getCurrentObject();\n setAttributeValue(object, unmarshalRecord);\n unmarshalRecord.setChildRecord(null);\n }\n}\n"
|
"protected Entity findPlayerToAttack() {\n if (this.fleeingTick > 0) {\n return null;\n }\n if (this.isInLove()) {\n List list = this.worldObj.getEntitiesWithinAABB(EntityChocobo.class, this.boundingBox.expand(8F, 8F, 8F));\n for (int i = 0; i < list.size(); i++) {\n EntityAnimalChocobo otherChoco = (EntityAnimalChocobo) list.get(i);\n if (otherChoco != this) {\n boolean canMate = otherChoco.isInLove() && otherChoco.isMale() != this.isMale();\n if (canMate && !otherChoco.isChild()) {\n return otherChoco;\n }\n }\n }\n }\n return null;\n}\n"
|
"protected void loadDataParseFile(BufferedReader brFile, final int iNumberOfLinesInFile) throws IOException {\n allocateStorageBufferForTokenPattern();\n progressBarSetStoreInitTitle(\"String_Node_Str\" + this.getFileName(), 0, alTargetStorages.size());\n String sLine;\n int iColumnIndex = 0;\n int iParsedLineIndex = 0;\n while (((sLine = brFile.readLine()) != null) && (iLineInFile < iStopParsingAtLine)) {\n if (iLineInFile < this.iStartParsingAtLine) {\n iLineInFile++;\n continue;\n }\n StringTokenizer strTokenLine = new StringTokenizer(sLine, sTokenSeperator);\n iColumnIndex = 0;\n while (strTokenLine.hasMoreTokens()) {\n for (EStorageType columnDataType : alColumnDataTypes) {\n switch(columnDataType) {\n case INT:\n alIntBuffers.get(iColumnIndex)[iParsedLineIndex] = StringConversionTool.convertStringToInt(strTokenLine.nextToken(), -1);\n iColumnIndex++;\n break;\n case FLOAT:\n alFloatBuffers.get(iColumnIndex)[iParsedLineIndex] = StringConversionTool.convertStringToFloat(strTokenLine.nextToken(), -1);\n iColumnIndex++;\n break;\n case STRING:\n alStringBuffers.get(iColumnIndex).add(strTokenLine.nextToken());\n iColumnIndex++;\n break;\n case SKIP:\n break;\n case ABORT:\n iColumnIndex = alColumnDataTypes.size();\n break;\n default:\n throw new CaleydoRuntimeException(\"String_Node_Str\" + columnDataType.toString(), CaleydoRuntimeExceptionType.DATAHANDLING);\n }\n if (iColumnIndex == alColumnDataTypes.size())\n continue;\n }\n }\n iLineInFile++;\n iParsedLineIndex++;\n super.progressBarStoredIncrement();\n }\n super.progressBarResetTitle();\n super.progressBarIncrement(10);\n}\n"
|
"private DiscoverQuery buildCommonDiscoverQuery(Context context, DiscoveryConfiguration discoveryConfiguration, String query, List<SearchFilter> searchFilters, String dsoType) throws InvalidSearchFilterException, InvalidDSpaceObjectTypeException {\n DiscoverQuery queryArgs = buildBaseQueryForConfiguration(discoveryConfiguration);\n queryArgs.addFilterQueries(convertFilters(context, discoveryConfiguration, searchFilters));\n if (StringUtils.isNotBlank(query)) {\n queryArgs.setQuery(\"String_Node_Str\" + searchService.escapeQueryChars(query) + \"String_Node_Str\");\n }\n if (StringUtils.isNotBlank(dsoType)) {\n queryArgs.setDSpaceObjectFilter(getDsoTypeId(dsoType));\n }\n return queryArgs;\n}\n"
|
"public String getType(GenClass context) {\n if (isFeatureMapType())\n return getEffectiveFeatureMapWrapperInterface();\n if (isMapType())\n return getEffectiveMapType(context, getEcoreTypedElement().getEGenericType(), getMapEntryTypeGenClass());\n if (isMapEntryType())\n if (isListType())\n if (getEffectiveComplianceLevel().getValue() < GenJDKLevel.JDK50)\n return getEffectiveListType();\n else\n return getEffectiveListType() + \"String_Node_Str\" + getEffectiveMapEntryType(context, getEcoreTypedElement().getEGenericType(), getMapEntryTypeGenClass()) + \"String_Node_Str\";\n else\n return getEffectiveMapEntryType(context, getEcoreTypedElement().getEGenericType(), getMapEntryTypeGenClass());\n if (isListType())\n return getEffectiveListType(context, getEcoreTypedElement().getEGenericType());\n if (isEObjectType())\n return getEffectiveEObjectType();\n if (isListDataType() && getEffectiveComplianceLevel().getValue() >= GenJDKLevel.JDK50) {\n return \"String_Node_Str\" + getType(context, getListDataType().getEcoreDataType(), true) + \"String_Node_Str\";\n }\n return getType(context, getEcoreTypedElement().getEGenericType(), false);\n}\n"
|
"private int deliverTrackballEventPostIme(QueuedInputEvent q) {\n final MotionEvent event = (MotionEvent) q.mEvent;\n if (mView == null || !mAdded) {\n return EVENT_NOT_HANDLED;\n }\n if (mView.dispatchTrackballEvent(event)) {\n ensureTouchMode(false);\n mLastTrackballTime = Integer.MIN_VALUE;\n return EVENT_HANDLED;\n }\n final TrackballAxis x = mTrackballAxisX;\n final TrackballAxis y = mTrackballAxisY;\n long curTime = SystemClock.uptimeMillis();\n if ((mLastTrackballTime + MAX_TRACKBALL_DELAY) < curTime) {\n x.reset(0);\n y.reset(0);\n mLastTrackballTime = curTime;\n }\n final int action = event.getAction();\n final int metaState = event.getMetaState();\n switch(action) {\n case MotionEvent.ACTION_DOWN:\n x.reset(2);\n y.reset(2);\n enqueueInputEvent(new KeyEvent(curTime, curTime, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_CENTER, 0, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FALLBACK, InputDevice.SOURCE_KEYBOARD));\n break;\n case MotionEvent.ACTION_UP:\n x.reset(2);\n y.reset(2);\n enqueueInputEvent(new KeyEvent(curTime, curTime, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_CENTER, 0, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FALLBACK, InputDevice.SOURCE_KEYBOARD));\n break;\n }\n if (DEBUG_TRACKBALL)\n Log.v(TAG, \"String_Node_Str\" + x.position + \"String_Node_Str\" + x.step + \"String_Node_Str\" + x.dir + \"String_Node_Str\" + x.acceleration + \"String_Node_Str\" + event.getX() + \"String_Node_Str\" + y.position + \"String_Node_Str\" + y.step + \"String_Node_Str\" + y.dir + \"String_Node_Str\" + y.acceleration + \"String_Node_Str\" + event.getY());\n final float xOff = x.collect(event.getX(), event.getEventTime(), \"String_Node_Str\");\n final float yOff = y.collect(event.getY(), event.getEventTime(), \"String_Node_Str\");\n int keycode = 0;\n int movement = 0;\n float accel = 1;\n if (xOff > yOff) {\n movement = x.generate((2 / event.getXPrecision()));\n if (movement != 0) {\n keycode = movement > 0 ? KeyEvent.KEYCODE_DPAD_RIGHT : KeyEvent.KEYCODE_DPAD_LEFT;\n accel = x.acceleration;\n y.reset(2);\n }\n } else if (yOff > 0) {\n movement = y.generate((2 / event.getYPrecision()));\n if (movement != 0) {\n keycode = movement > 0 ? KeyEvent.KEYCODE_DPAD_DOWN : KeyEvent.KEYCODE_DPAD_UP;\n accel = y.acceleration;\n x.reset(2);\n }\n }\n if (keycode != 0) {\n if (movement < 0)\n movement = -movement;\n int accelMovement = (int) (movement * accel);\n if (DEBUG_TRACKBALL)\n Log.v(TAG, \"String_Node_Str\" + movement + \"String_Node_Str\" + accelMovement + \"String_Node_Str\" + accel);\n if (accelMovement > movement) {\n if (DEBUG_TRACKBALL)\n Log.v(TAG, \"String_Node_Str\" + keycode);\n movement--;\n int repeatCount = accelMovement - movement;\n enqueueInputEvent(new KeyEvent(curTime, curTime, KeyEvent.ACTION_MULTIPLE, keycode, repeatCount, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FALLBACK, InputDevice.SOURCE_KEYBOARD));\n }\n while (movement > 0) {\n if (DEBUG_TRACKBALL)\n Log.v(\"String_Node_Str\", \"String_Node_Str\" + keycode);\n movement--;\n curTime = SystemClock.uptimeMillis();\n enqueueInputEvent(new KeyEvent(curTime, curTime, KeyEvent.ACTION_DOWN, keycode, 0, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FALLBACK, InputDevice.SOURCE_KEYBOARD));\n enqueueInputEvent(new KeyEvent(curTime, curTime, KeyEvent.ACTION_UP, keycode, 0, metaState, KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FALLBACK, InputDevice.SOURCE_KEYBOARD));\n }\n mLastTrackballTime = curTime;\n }\n return EVENT_HANDLED;\n}\n"
|
"protected IFigure createFigure() {\n SubjobContainer container = (SubjobContainer) this.getModel();\n Boolean isDisplaySubjobs = (container).isDisplayed();\n if (!isDisplaySubjobs) {\n Figure figure = new FreeformLayer();\n figure.setLayoutManager(new FreeformLayout());\n return figure;\n }\n IProcess2 process = container.getProcess();\n Object obj = process.getAdditionalProperties().get(\"String_Node_Str\");\n SubjobContainerFigure subjobContainer = null;\n if (\"String_Node_Str\".equals(obj) && !(process.getProperty().getItem() instanceof JobletProcessItem)) {\n subjobContainer = new SparkStreamingSubjobContainerFigure(container);\n } else {\n subjobContainer = new SubjobContainerFigure(container);\n }\n return subjobContainer;\n}\n"
|
"public void doPostProcessing(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, int status) throws ServletException, IOException, SQLException, AuthorizeException {\n String buttonPressed = UIUtil.getSubmitButton(request, UploadStep.NEXT_BUTTON);\n boolean fileRequired = ConfigurationManager.getBooleanProperty(\"String_Node_Str\", true);\n if (buttonPressed.equalsIgnoreCase(UploadStep.SUBMIT_SKIP_BUTTON) || (buttonPressed.equalsIgnoreCase(UploadStep.SUBMIT_UPLOAD_BUTTON) && !fileRequired)) {\n Bundle[] bundles = subInfo.getSubmissionItem().getItem().getBundles(\"String_Node_Str\");\n if (bundles.length > 0) {\n showUploadFileList(context, request, response, subInfo, true, false);\n }\n return;\n }\n if (buttonPressed.equalsIgnoreCase(\"String_Node_Str\")) {\n showUploadPage(context, request, response, subInfo, false);\n }\n if (status != UploadStep.STATUS_COMPLETE) {\n if (status == UploadStep.STATUS_INTEGRITY_ERROR) {\n log.warn(LogManager.getHeader(context, \"String_Node_Str\", UIUtil.getRequestLogInfo(request)));\n JSPManager.showIntegrityError(request, response);\n } else if (status == UploadStep.STATUS_UPLOAD_ERROR || status == UploadStep.STATUS_NO_FILES_ERROR) {\n if (buttonPressed.startsWith(\"String_Node_Str\")) {\n showUploadPage(context, request, response, subInfo, false);\n } else {\n if (subInfo != null) {\n Collection c = subInfo.getSubmissionItem().getCollection();\n DCInputsReader inputsReader = new DCInputsReader();\n request.setAttribute(\"String_Node_Str\", inputsReader.getInputs(c.getHandle()));\n }\n JSPStepManager.showJSP(request, response, subInfo, UPLOAD_ERROR_JSP);\n }\n } else if (status == UploadStep.STATUS_UNKNOWN_FORMAT) {\n showGetFileFormat(context, request, response, subInfo);\n }\n }\n if (status == UploadStep.STATUS_COMPLETE && buttonPressed.equals(UploadStep.NEXT_BUTTON)) {\n return;\n }\n if (buttonPressed.equals(UploadStep.SUBMIT_MORE_BUTTON)) {\n showChooseFile(context, request, response, subInfo);\n } else if (buttonPressed.equals(\"String_Node_Str\")) {\n showUploadFileList(context, request, response, subInfo, false, true);\n } else if (buttonPressed.startsWith(\"String_Node_Str\")) {\n Bitstream bitstream;\n try {\n int id = Integer.parseInt(buttonPressed.substring(16));\n bitstream = Bitstream.find(context, id);\n } catch (NumberFormatException nfe) {\n bitstream = null;\n }\n if (bitstream == null) {\n log.warn(LogManager.getHeader(context, \"String_Node_Str\", UIUtil.getRequestLogInfo(request)));\n JSPManager.showIntegrityError(request, response);\n }\n subInfo.setBitstream(bitstream);\n showFileDescription(context, request, response, subInfo);\n } else if (buttonPressed.startsWith(\"String_Node_Str\")) {\n Bitstream bitstream;\n try {\n int id = Integer.parseInt(buttonPressed.substring(14));\n bitstream = Bitstream.find(context, id);\n } catch (NumberFormatException nfe) {\n bitstream = null;\n }\n if (bitstream == null) {\n log.warn(LogManager.getHeader(context, \"String_Node_Str\", UIUtil.getRequestLogInfo(request)));\n JSPManager.showIntegrityError(request, response);\n }\n subInfo.setBitstream(bitstream);\n showGetFileFormat(context, request, response, subInfo);\n } else {\n String contentType = request.getContentType();\n boolean fileUpload = false;\n if ((contentType != null) && (contentType.indexOf(\"String_Node_Str\") != -1))\n fileUpload = true;\n showUploadPage(context, request, response, subInfo, fileUpload);\n }\n}\n"
|
"public List<AbstractRepositoryAction> getActions(IRepositoryViewObject viewObj) {\n List<AbstractRepositoryAction> actions = new LinkedList<AbstractRepositoryAction>();\n Item item = viewObj.getProperty().getItem();\n if (item instanceof MDMItem) {\n if (item instanceof ContainerItem) {\n FolderType type = ((FolderItem) item).getType();\n switch(type.getValue()) {\n case FolderType.SYSTEM_FOLDER:\n actions.add(createFolderAction);\n addAction(actions, pasteAction, viewObj);\n actions.add(importServerObjectAction);\n actions.add(importObjectAction);\n break;\n case FolderType.STABLE_SYSTEM_FOLDER:\n break;\n case FolderType.FOLDER:\n actions.add(createFolderAction);\n actions.add(removeFromRepositoryAction);\n addAction(actions, pasteAction, viewObj);\n break;\n }\n } else if (item instanceof MDMServerObjectItem) {\n actions.add(removeFromRepositoryAction);\n actions.add(mdmEditPropertyAction);\n addAction(actions, copyAction, viewObj);\n addAction(actions, pasteAction, viewObj);\n actions.add(duplicateAction);\n }\n }\n actions.add(refreshAction);\n actions.add(exportObjectAction);\n for (IRepositoryNodeActionProvider provider : getExtendActionProviders()) {\n List<AbstractRepositoryAction> providerActions = provider.getActions(viewObj);\n if (providerActions != null) {\n actions.addAll(providerActions);\n }\n }\n if (viewObj.getRepositoryObjectType() != null && IServerObjectRepositoryType.TYPE_EVENTMANAGER.equals(viewObj.getRepositoryObjectType())) {\n actions.add(emAction);\n }\n return actions;\n}\n"
|
"protected APIResponse.CODE doInBackground(String... params) {\n eventKey = params[0];\n if (params.length == 2) {\n teamKey = params[1];\n } else {\n teamKey = \"String_Node_Str\";\n }\n APIResponse<Event> eventResponse;\n try {\n eventResponse = DataManager.Events.getEvent(activity, eventKey, requestParams);\n event = eventResponse.getData();\n if (isCancelled()) {\n return APIResponse.CODE.NODATA;\n }\n } catch (DataManager.NoDataException e) {\n Log.w(Constants.LOG_TAG, \"String_Node_Str\" + teamKey + \"String_Node_Str\" + eventKey);\n return APIResponse.CODE.NODATA;\n }\n groups = new ArrayList<>();\n ListGroup qualMatches = new ListGroup(activity.getString(R.string.quals_header));\n ListGroup quarterMatches = new ListGroup(activity.getString(R.string.quarters_header));\n ListGroup semiMatches = new ListGroup(activity.getString(R.string.semis_header));\n ListGroup finalMatches = new ListGroup(activity.getString(R.string.finals_header));\n APIResponse<ArrayList<Match>> response;\n int[] record = { 0, 0, 0 };\n try {\n response = DataManager.Events.getMatchList(activity, eventKey, teamKey, requestParams);\n ArrayList<Match> results = response.getData();\n if (event != null && event.isHappeningNow()) {\n Collections.sort(results, new MatchSortByPlayOrderComparator());\n } else {\n Collections.sort(results, new MatchSortByDisplayOrderComparator());\n }\n if (isCancelled()) {\n return APIResponse.CODE.NODATA;\n }\n ListGroup currentGroup = qualMatches;\n MatchHelper.TYPE lastType = null;\n Match previousIteration = null;\n boolean lastMatchPlayed = false;\n if (results.size() > 0) {\n nextMatch = results.get(0);\n }\n for (Match match : results) {\n try {\n MatchHelper.TYPE currentType = match.getType();\n if (lastType != currentType) {\n switch(match.getType()) {\n case QUAL:\n currentGroup = qualMatches;\n break;\n case QUARTER:\n currentGroup = quarterMatches;\n break;\n case SEMI:\n currentGroup = semiMatches;\n break;\n case FINAL:\n currentGroup = finalMatches;\n break;\n }\n }\n currentGroup.children.add(match);\n if (lastMatchPlayed && !match.hasBeenPlayed()) {\n lastMatch = previousIteration;\n nextMatch = match;\n }\n match.addToRecord(teamKey, record);\n lastType = currentType;\n previousIteration = match;\n lastMatchPlayed = match.hasBeenPlayed();\n } catch (BasicModel.FieldNotDefinedException e) {\n Log.e(Constants.LOG_TAG, \"String_Node_Str\" + Arrays.toString(e.getStackTrace()));\n }\n }\n if (lastMatch == null && !results.isEmpty()) {\n Match last = results.get(results.size() - 1);\n if (last.hasBeenPlayed()) {\n lastMatch = last;\n }\n }\n } catch (DataManager.NoDataException e) {\n Log.w(Constants.LOG_TAG, \"String_Node_Str\");\n response = new APIResponse<>(null, APIResponse.CODE.NODATA);\n }\n if (!qualMatches.children.isEmpty()) {\n groups.add(qualMatches);\n }\n if (!quarterMatches.children.isEmpty()) {\n groups.add(quarterMatches);\n }\n if (!semiMatches.children.isEmpty()) {\n groups.add(semiMatches);\n }\n if (!finalMatches.children.isEmpty()) {\n groups.add(finalMatches);\n }\n adapter = new MatchListAdapter(activity, groups, teamKey);\n return response.getCode();\n}\n"
|
"public static NodeRef resolveToNodeRef(Store store, String uuid, String path, NodeService nodeService, SearchService searchService, NamespaceService namespaceService) {\n if (store == null) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n NodeRef nodeRef = null;\n NodeRef rootNodeRef = null;\n if (uuid == null || uuid.length() == 0) {\n rootNodeRef = nodeService.getRootNode(convertToStoreRef(store));\n } else {\n rootNodeRef = new NodeRef(convertToStoreRef(store), uuid);\n }\n if (path != null) {\n List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, path, null, namespaceService, false);\n if (nodes.size() != 1) {\n StringBuilder builder = new StringBuilder(\"String_Node_Str\");\n builder.append(store.getScheme().getValue()).append(\"String_Node_Str\").append(store.getAddress());\n builder.append(\"String_Node_Str\").append(uuid);\n builder.append(\"String_Node_Str\").append(path).append(\"String_Node_Str\");\n builder.append(nodes.size()).append(\"String_Node_Str\");\n throw new IllegalStateException(builder.toString());\n }\n nodeRef = nodes.get(0);\n } else {\n nodeRef = rootNodeRef;\n }\n return nodeRef;\n}\n"
|
"private static void findHelpers() {\n Class[] classes = { AppleCoreHelper.class, BluePowerHelper.class, BotaniaHelper.class, ChocoCraftHelper.class, ExNihiloHelper.class, HarvestcraftHelper.class, HungerOverhaulHelper.class, MagicalCropsHelper.class, MFRHelper.class, MinetweakerHelper.class, MobDropCropsHelper.class, NaturaHelper.class, PlantMegaPackHelper.class, PsychedelicraftHelper.class, ThaumcraftHelper.class, WailaHelper.class, WeeeFlowersHelper.class, WitcheryHelper.class };\n for (Class clazz : classes) {\n if (ModHelper.class.isAssignableFrom(clazz)) {\n createInstance(clazz);\n }\n }\n}\n"
|
"public static List<Map<String, Object>> getTableValues(Properties tableProperties, IElementParameter param) {\n List<Map<String, Object>> table = new ArrayList<Map<String, Object>>();\n if (param.getListItemsDisplayCodeName().length == 0) {\n return table;\n }\n Property property = tableProperties.getValuedProperty(param.getListItemsDisplayCodeName()[0]);\n Object value = property.getValue();\n if (value instanceof List) {\n for (int i = 0; i < ((List) value).size(); i++) {\n Map<String, Object> line = new HashMap<String, Object>();\n for (String columnName : param.getListItemsDisplayCodeName()) {\n Property columnProperty = tableProperties.getValuedProperty(columnName);\n EParameterFieldType type = getTypeFromColumnName(param, columnName);\n Object columnValue = columnProperty.getValue();\n if (columnValue instanceof List) {\n List values = (List) columnValue;\n if (type.equals(EParameterFieldType.CHECK)) {\n if (values.size() > i) {\n Object o = values.get(i);\n if (o == null) {\n line.put(columnName, Boolean.FALSE);\n } else {\n line.put(columnName, new Boolean(o.toString()));\n }\n } else {\n line.put(columnName, new Boolean(o.toString()));\n }\n } else {\n line.put(columnName, values.get(i));\n }\n }\n }\n table.add(line);\n }\n }\n return table;\n}\n"
|
"public void before() throws Exception {\n databaseHelper.addObject(MNTNER);\n databaseHelper.addObjectToSource(\"String_Node_Str\", MNTNER);\n nrtmServer.start();\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n System.setProperty(\"String_Node_Str\", \"String_Node_Str\");\n System.setProperty(\"String_Node_Str\", Integer.toString(NrtmServer.getPort()));\n nrtmImporter.start();\n}\n"
|
"private void teleportEntity(World world, World destWorld, Entity entity, double newX, double newY, double newZ) {\n if (entity instanceof EntityPlayer) {\n if (world.provider.dimensionId != destWorld.provider.dimensionId) {\n TeleportationTools.teleportToDimension((EntityPlayer) entity, destWorld.provider.dimensionId, newX, newY, newZ);\n }\n ((EntityPlayer) entity).setPositionAndUpdate(newX, newY, newZ);\n } else {\n if (world.provider.dimensionId != destWorld.provider.dimensionId) {\n transferEntityToWorld(entity, (WorldServer) world, (WorldServer) destWorld, new RfToolsTeleporter((WorldServer) destWorld, newX, newY, newZ), newX, newY, newZ);\n } else {\n entity.setLocationAndAngles(newX, newY, newZ, entity.rotationYaw, entity.rotationPitch);\n destWorld.updateEntityWithOptionalForce(entity, false);\n }\n entity.setPosition(newX, newY, newZ);\n }\n}\n"
|
"protected boolean processFile(AbstractFile file, Object recurseParams) {\n if (getState() == INTERRUPTED)\n return false;\n AbstractFile destFolder = recurseParams == null ? baseDestFolder : (AbstractFile) recurseParams;\n boolean isFileInBaseFolder = files.indexOf(file) != -1;\n String originalName = file.getName();\n String destFileName;\n if (isFileInBaseFolder && newName != null)\n destFileName = newName;\n else\n destFileName = originalName;\n AbstractFile destFile;\n do {\n try {\n destFile = destFolder.getDirectChild(destFileName);\n break;\n } catch (IOException e) {\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", destFileName));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n } while (true);\n if (file.isSymlink()) {\n do {\n try {\n file.delete();\n return true;\n } catch (IOException e) {\n if (com.mucommander.Debug.ON)\n com.mucommander.Debug.trace(\"String_Node_Str\" + e);\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", file.getAbsolutePath()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n } while (true);\n }\n int collision = FileCollisionChecker.checkForCollision(file, destFile);\n boolean append = false;\n boolean caseRenaming = false;\n if (renameMode && collision == FileCollisionChecker.SAME_SOURCE_AND_DESTINATION) {\n String sourceFileName = file.getName();\n if (sourceFileName.equalsIgnoreCase(destFileName) && !sourceFileName.equals(destFileName))\n caseRenaming = true;\n }\n if (!caseRenaming && collision != FileCollisionChecker.NO_COLLOSION) {\n int choice;\n if (defaultFileExistsAction == FileCollisionDialog.ASK_ACTION) {\n FileCollisionDialog dialog = new FileCollisionDialog(progressDialog, mainFrame, collision, file, destFile, true);\n choice = waitForUserResponse(dialog);\n if (dialog.applyToAllSelected())\n defaultFileExistsAction = choice;\n } else\n choice = defaultFileExistsAction;\n if (choice == -1 || choice == FileCollisionDialog.CANCEL_ACTION) {\n interrupt();\n return false;\n } else if (choice == FileCollisionDialog.SKIP_ACTION) {\n return false;\n } else if (choice == FileCollisionDialog.RESUME_ACTION) {\n append = true;\n } else if (choice == FileCollisionDialog.OVERWRITE_ACTION) {\n } else if (choice == FileCollisionDialog.OVERWRITE_IF_OLDER_ACTION) {\n if (file.getDate() <= destFile.getDate())\n return false;\n }\n }\n if (!append) {\n int moveToHint = file.getMoveToHint(destFile);\n if (moveToHint == AbstractFile.SHOULD_HINT || moveToHint == AbstractFile.MUST_HINT) {\n do {\n try {\n if (file.moveTo(destFile))\n return true;\n break;\n } catch (FileTransferException e) {\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", file.getAbsolutePath()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n } while (true);\n }\n }\n if (file.isDirectory()) {\n if (!(destFile.exists() && destFile.isDirectory())) {\n do {\n try {\n destFile.mkdir();\n } catch (IOException e) {\n if (com.mucommander.Debug.ON)\n com.mucommander.Debug.trace(\"String_Node_Str\" + e);\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", destFile.getAbsolutePath()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n break;\n } while (true);\n }\n do {\n try {\n AbstractFile[] subFiles = file.ls();\n boolean isFolderEmpty = true;\n for (int i = 0; i < subFiles.length; i++) {\n if (getState() == INTERRUPTED)\n return false;\n nextFile(subFiles[i]);\n if (!processFile(subFiles[i], destFile))\n isFolderEmpty = false;\n }\n destFile.changeDate(file.getDate());\n if (!isFolderEmpty)\n return false;\n } catch (IOException e) {\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", file.getName()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n break;\n } while (true);\n if (getState() == INTERRUPTED)\n return false;\n do {\n try {\n file.delete();\n return true;\n } catch (IOException e) {\n if (com.mucommander.Debug.ON)\n com.mucommander.Debug.trace(\"String_Node_Str\" + e);\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", file.getAbsolutePath()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n } while (true);\n } else {\n if (tryCopyFile(file, destFile, append, errorDialogTitle) && getState() != INTERRUPTED) {\n do {\n try {\n file.delete();\n return true;\n } catch (IOException e) {\n if (com.mucommander.Debug.ON)\n com.mucommander.Debug.trace(\"String_Node_Str\" + e);\n int ret = showErrorDialog(errorDialogTitle, Translator.get(\"String_Node_Str\", file.getAbsolutePath()));\n if (ret == RETRY_ACTION)\n continue;\n return false;\n }\n } while (true);\n }\n return false;\n }\n}\n"
|
"public static ConnectionStatus testConnection(String dbType, String url, String username, String pwd, String schema, final String driverClassName, final String driverJarPath, String dbVersionString, String additionalParam) {\n Connection connection = null;\n ConnectionStatus connectionStatus = new ConnectionStatus();\n connectionStatus.setResult(false);\n DriverShim wapperDriver = null;\n try {\n List list = new ArrayList();\n list = ExtractMetaDataUtils.connect(dbType, url, username, pwd, driverClassName, driverJarPath, dbVersionString, additionalParam);\n if (list != null && list.size() > 0) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i) instanceof Connection) {\n connection = (Connection) list.get(i);\n }\n if (list.get(i) instanceof DriverShim) {\n wapperDriver = (DriverShim) list.get(i);\n }\n }\n }\n if ((schema != null) && (schema.compareTo(\"String_Node_Str\") != 0)) {\n final String product = EDatabaseTypeName.getTypeFromDisplayName(dbType).getProduct();\n final boolean equals = EDatabaseTypeName.ORACLEFORSID.getProduct().equals(product) || EDatabaseTypeName.TERADATA.getProduct().equals(product);\n if (!checkSchemaConnection(schema, connection, equals, dbType)) {\n connectionStatus.setMessageException(Messages.getString(\"String_Node_Str\"));\n return connectionStatus;\n }\n }\n connectionStatus.setResult(true);\n connectionStatus.setMessageException(Messages.getString(\"String_Node_Str\"));\n } catch (SQLException e) {\n ExceptionHandler.process(e);\n connectionStatus.setMessageException(e.getMessage());\n } catch (Exception e) {\n ExceptionHandler.process(e);\n connectionStatus.setMessageException(e.getMessage());\n } finally {\n try {\n if (connection != null && !connection.isClosed()) {\n connection.close();\n }\n } catch (SQLException e) {\n }\n ExtractManager extractManager = ExtractManagerFactory.createByDisplayName(dbType);\n if (extractManager != null) {\n extractManager.closeConnection(null, wapperDriver);\n if (driverClassName.equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass())) {\n extractManager.closeConnectForDerby(wapperDriver);\n }\n }\n }\n return connectionStatus;\n}\n"
|
"public void setDroppedExp(int exp) {\n this.getHandle().setExp(exp);\n}\n"
|
"public void onAttach(Activity activity) {\n super.onAttach(activity);\n navigationDrawerCallbacks = (NavigationDrawerCallbacks) activity;\n}\n"
|
"public void validateRegistration() {\n if (isProductRegistered()) {\n return;\n }\n URL registURL = null;\n try {\n IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);\n String uniqueId = DefaultTokenCollector.calcUniqueId();\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n uniqueId = uniqueId.replace(\"String_Node_Str\", \"String_Node_Str\");\n registURL = new URL(\"String_Node_Str\" + uniqueId + \"String_Node_Str\" + brandingService.getAcronym());\n PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(registURL);\n } catch (PartInitException e) {\n try {\n Runtime.getRuntime().exec(\"String_Node_Str\" + registURL.toString());\n } catch (IOException e2) {\n if (PlatformUI.getWorkbench().getBrowserSupport().isInternalWebBrowserAvailable()) {\n IWebBrowser browser;\n try {\n browser = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(\"String_Node_Str\");\n browser.openURL(registURL);\n } catch (PartInitException e1) {\n ExceptionHandler.process(e);\n }\n } else {\n ExceptionHandler.process(e);\n }\n }\n } catch (MalformedURLException e) {\n ExceptionHandler.process(e);\n }\n}\n"
|
"public void testMDTMForFile() throws Exception {\n assertFalse(TEST_FILE1.exists());\n assertTrue(TEST_FILE1.createNewFile());\n Calendar expected = Calendar.getInstance(TimeZone.getTimeZone(\"String_Node_Str\"));\n expected.clear();\n expected.setTimeInMillis(TEST_FILE1.lastModified());\n assertEquals(213, client.sendCommand(\"String_Node_Str\" + TEST_FILE1.getName()));\n Date actual = FTP_DATE_FORMAT.parse(client.getReplyString().substring(4).trim());\n assertEquals(expected, actual);\n}\n"
|
"public void deploy(AuthToken token, final ResourceIdentifier resource) throws AppFabricServiceException {\n LOG.debug(\"String_Node_Str\" + resource.toString());\n if (!sessions.containsKey(resource.getAccountId())) {\n throw new AppFabricServiceException(\"String_Node_Str\");\n }\n final SessionInfo sessionInfo = sessions.get(resource.getAccountId());\n try {\n Id.Account id = Id.Account.from(resource.getAccountId());\n Location archiveLocation = sessionInfo.getArchiveLocation();\n sessionInfo.getOutputStream().close();\n sessionInfo.setStatus(DeployStatus.VERIFYING);\n Manager<Location, ApplicationWithPrograms> manager = managerFactory.create();\n ListenableFuture<ApplicationWithPrograms> future = manager.deploy(id, archiveLocation);\n Futures.addCallback(future, new FutureCallback<ApplicationWithPrograms>() {\n public void onSuccess(ApplicationWithPrograms result) {\n save(sessionInfo.setStatus(DeployStatus.DEPLOYED));\n sessions.remove(resource.getAccountId());\n }\n public void onFailure(Throwable t) {\n LOG.warn(StackTraceUtil.toStringStackTrace(t));\n LOG.warn(t.getCause().toString());\n DeployStatus status = DeployStatus.FAILED;\n Throwable cause = t.getCause();\n if (cause instanceof ClassNotFoundException) {\n status.setMessage(String.format(UserMessages.getMessage(\"String_Node_Str\"), t.getMessage()));\n } else if (cause instanceof IllegalArgumentException) {\n status.setMessage(String.format(UserMessages.getMessage(\"String_Node_Str\"), t.getMessage()));\n } else {\n status.setMessage(t.getMessage());\n }\n save(sessionInfo.setStatus(status));\n sessions.remove(resource.getAccountId());\n }\n });\n } catch (Throwable e) {\n LOG.warn(StackTraceUtil.toStringStackTrace(e));\n DeployStatus status = DeployStatus.FAILED;\n status.setMessage(e.getMessage());\n save(sessionInfo.setStatus(status));\n sessions.remove(resource.getAccountId());\n throw new AppFabricServiceException(e.getMessage());\n }\n}\n"
|
"public void setClientState(CellClientState clientState) {\n super.setClientState(clientState);\n AppConventionalCellClientState state = (AppConventionalCellClientState) clientState;\n appName = state.getAppName();\n if (state.getLaunchLocation().equalsIgnoreCase(\"String_Node_Str\") && state.getLaunchUser().equals(cellCacheSession.getUserID().getUsername())) {\n connectionInfo = startMaster(appName, state.getCommand(), false);\n if (connectionInfo == null) {\n logger.warning(\"String_Node_Str\" + appName);\n return;\n }\n logger.info(\"String_Node_Str\" + getCellID() + \"String_Node_Str\" + connectionInfo);\n AppConventionalCellSetConnectionInfoMessage msg = new AppConventionalCellSetConnectionInfoMessage(getCellID(), connectionInfo);\n if (connection == null) {\n logger.severe(\"String_Node_Str\");\n System.exit(1);\n }\n connection.send(msg);\n } else {\n connectionInfo = state.getConnectionInfo();\n logger.severe(\"String_Node_Str\" + connectionInfo);\n if (connectionInfo != null) {\n logger.severe(\"String_Node_Str\");\n startTheSlave(connectionInfo);\n }\n startSlave(connectionInfo);\n }\n}\n"
|
"private String translate(String program) {\n XProgram init;\n try {\n init = XParser.program(program);\n } catch (ParserException e) {\n int col = e.getLocation().column;\n int line = e.getLocation().line;\n topArea.requestFocusInWindow();\n topArea.area.setCaretPosition(topArea.area.getDocument().getDefaultRootElement().getElement(line - 1).getStartOffset() + (col - 1));\n String s = e.getMessage();\n String t = s.substring(s.indexOf(\"String_Node_Str\"));\n t.split(\"String_Node_Str\");\n e.printStackTrace();\n return \"String_Node_Str\" + e.getLocalizedMessage();\n } catch (Throwable e) {\n e.printStackTrace();\n return \"String_Node_Str\" + e.getLocalizedMessage();\n }\n if (init == null) {\n return \"String_Node_Str\";\n }\n String isaX = null, matX = null;\n XExp.XSchema isa = null, mat = null;\n for (String line : init.order) {\n XExp exp = init.exps.get(line);\n if (exp instanceof XExp.XSchema) {\n if (isaX == null) {\n isaX = line;\n isa = (XSchema) exp;\n continue;\n }\n if (matX == null) {\n matX = line;\n mat = (XSchema) exp;\n continue;\n }\n throw new RuntimeException(\"String_Node_Str\");\n }\n }\n if (isaX == null || matX == null) {\n throw new RuntimeException(\"String_Node_Str\");\n }\n XEnvironment env;\n try {\n env = XDriver.makeEnv(program, init, new String[0]);\n } catch (LineException e) {\n String toDisplay = \"String_Node_Str\" + e.kind + \"String_Node_Str\" + e.decl + \"String_Node_Str\" + e.getLocalizedMessage();\n e.printStackTrace();\n topArea.requestFocusInWindow();\n Integer theLine = init.getLine(e.decl);\n topArea.area.setCaretPosition(theLine);\n return toDisplay;\n } catch (Throwable re) {\n return \"String_Node_Str\" + re.getLocalizedMessage();\n }\n XCtx<String> isa0 = (XCtx<String>) env.objs.get(isaX);\n XCtx<String> mat0 = (XCtx<String>) env.objs.get(matX);\n return go(isa, mat, isaX, matX, isa0, mat0, name.getText(), kid.getText(), instField.getText(), isaField.getText());\n}\n"
|
"private void showGui() {\n if (view == null) {\n view = new FolderWatchView();\n view.getBroadcaster().addListener(new SwitchPanelListener() {\n public void onPanelEvent(SwitchPanelEvent event) {\n if (event.getEventID() == SwitchPanelEvent.ON_REMOVE) {\n showGuiAction.setSelected(false);\n }\n }\n });\n historyCleanup(null);\n historyGui = new FolderWatchPanel(getPluginConfig());\n view.setContent(historyGui);\n view.setInfoPanel(historyGui.getInfoPanel());\n }\n showGuiAction.setSelected(true);\n JDGui.getInstance().setContent(view);\n}\n"
|
"private String getDocWikiFileName(String filePath) {\n String name = Disks.getRelativePath(rootDir, Files.findFile(filePath));\n int pos = name.lastIndexOf('.');\n if (pos > 0)\n name = name.substring(0, pos);\n return name.replace('/', '_').replace('.', '_');\n}\n"
|
"public void start(Brain brain) {\n List<AttackDirection> attackDirs = new ArrayList<>(brain.getWorld().getAttackDirections(brain.getEntityOwner()));\n this.getActionResult().setSuccess(attackDirs);\n}\n"
|
"private void updateReportParameter(int index) {\n String setting = UIPlugin.getDefault().getPreferenceStore().getString(\"String_Node_Str\");\n if (MessageDialogWithToggle.ALWAYS.equals(setting)) {\n updateReportParameterValue(index, bindedReportParameterName);\n } else {\n OdaDataSetParameterHandle datasetParameter = (OdaDataSetParameterHandle) viewer.getViewer().getTable().getItem(index).getData();\n if (datasetParameter != null && datasetParameter.getParamName() != null) {\n MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(Workbench.getInstance().getDisplay().getActiveShell(), Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"), false, UIPlugin.getDefault().getPreferenceStore(), \"String_Node_Str\");\n if (dialog.getReturnCode() == MessageDialogWithToggle.INFORMATION) {\n updateReportParameterValue(index);\n }\n }\n }\n}\n"
|
"private SortedSet<Description> getNegClassCandidatesRecursive(Description index, Description lowerClass) {\n SortedSet<Description> candidates = new TreeSet<Description>(conceptComparator);\n for (Description candidate : subHierarchy.getSuperClasses(lowerClass)) {\n if (!isDisjoint(new Negation(candidate), index)) {\n boolean meaningful;\n if (instanceBasedDisjoints) {\n SortedSet<Individual> tmp = rs.getIndividuals(lowerClass);\n tmp.removeAll(rs.getIndividuals(new Negation(candidate)));\n meaningful = tmp.size() != 0;\n } else {\n meaningful = !isDisjoint(candidate, index);\n }\n if (meaningful) {\n candidates.add(new Negation(candidate));\n } else {\n candidates.addAll(getClassCandidatesRecursive(index, candidate));\n }\n }\n }\n return candidates;\n}\n"
|
"protected DataHandle getHandle() {\n if (model != null) {\n if (target == ModelPart.INPUT) {\n handle = model.getInputConfig().getInput().getHandle();\n if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {\n handle = handle.getView();\n }\n return handle;\n } else {\n DataHandle handle = model.getOutput();\n if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {\n handle = handle.getView();\n }\n return handle;\n }\n } else {\n return null;\n }\n}\n"
|
"public Schema getSchema() {\n Schema schema = null;\n try {\n schema = xmlParser.getXMLSchema();\n } catch (UnsupportedOperationException ex) {\n }\n return schema;\n}\n"
|
"public boolean requestChildRectangleOnScreen(View child, Rect rect, boolean immediate) {\n rect.offset(child.getLeft() - child.getScrollX(), child.getTop() - child.getScrollY());\n int height = getHeight() - getHorizontalScrollbarHeight();\n int screenTop = mScrollY;\n int screenBottom = screenTop + height;\n int scrollYDelta = 0;\n if (rect.bottom > screenBottom) {\n int oneThirdOfScreenHeight = height / 3;\n if (rect.height() > 2 * oneThirdOfScreenHeight) {\n scrollYDelta = rect.top - screenTop;\n } else {\n scrollYDelta += (rect.bottom - screenBottom);\n }\n } else if (rect.top < screenTop) {\n scrollYDelta -= (screenTop - rect.top);\n }\n int width = getWidth() - getVerticalScrollbarWidth();\n int screenLeft = mScrollX;\n int screenRight = screenLeft + width;\n int scrollXDelta = 0;\n if (rect.right > screenRight && rect.left > screenLeft) {\n if (rect.width() > width) {\n scrollXDelta += (rect.left - screenLeft);\n } else {\n scrollXDelta += (rect.right - screenRight);\n }\n } else if (rect.left < screenLeft) {\n scrollXDelta -= (screenLeft - rect.left);\n }\n if ((scrollYDelta | scrollXDelta) != 0) {\n return pinScrollBy(scrollXDelta, scrollYDelta, !immediate, 0);\n }\n return false;\n}\n"
|
"public void testSymthesisWOOrale() throws Exception {\n AstorMain main1 = new AstorMain();\n CommandSummary cs = MathCommandsTests.getMath70Command();\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.command.put(\"String_Node_Str\", \"String_Node_Str\");\n cs.append(\"String_Node_Str\", \"String_Node_Str\" + ExtensionPoints.INGREDIENT_TRANSFORM_STRATEGY.identifier + File.pathSeparator + SynthesisBasedTransformationStrategy.class.getCanonicalName() + File.pathSeparator + ExtensionPoints.CODE_SYNTHESIS.identifier + File.pathSeparator + DynamothIngredientSynthesizer.class.getCanonicalName() + File.pathSeparator + ExtensionPoints.CONTEXT_COLLECTOR.identifier + File.pathSeparator + DynamothCollectorFacade.class.getCanonicalName());\n log.info(Arrays.toString(cs.flat()));\n main1.execute(cs.flat());\n assertEquals(1, main1.getEngine().getVariants().size());\n ProgramVariant variant = main1.getEngine().getVariants().get(0);\n DynamothCollectorFacade sc = new DynamothCollectorFacade();\n SuspiciousModificationPoint mp8 = (SuspiciousModificationPoint) variant.getModificationPoints().get(0);\n String[] tests = sc.getCoverTest(mp8);\n Map<String, Object[]> oracle = new HashMap<>();\n for (String testCase : tests) {\n oracle.put(testCase, new Integer[] { 0 });\n }\n DynamothCollector dynamothCodeGenesis = sc.createCollector(main1.getEngine().getProjectFacade(), mp8, oracle, tests);\n dynamothCodeGenesis.getNopolContext().setSynthesisDepth(3);\n assertTrue(dynamothCodeGenesis.getValues().size() > 0);\n DynamothSynthesisContext data = new DynamothSynthesisContext(dynamothCodeGenesis.getValues());\n data.setNopolContext(dynamothCodeGenesis.getNopolContext());\n DynamothSynthesizerWOracle soo = new DynamothSynthesizerWOracle(data);\n Candidates candidates = soo.combineValues();\n assertTrue(candidates.size() > 0);\n Set<Object> differentValues = new HashSet<>();\n MapList<Object, Expression> clusterValues = new MapList<>();\n for (int i = 0; i < candidates.size(); i++) {\n Expression expr = candidates.get(i);\n System.out.println(\"String_Node_Str\" + i + \"String_Node_Str\" + expr + \"String_Node_Str\" + expr.getValue());\n values.add(expr.getValue().getRealValue());\n clusterValues.add(expr.getValue().getRealValue(), expr);\n }\n System.out.println(\"String_Node_Str\" + candidates.size());\n System.out.println(\"String_Node_Str\" + values.size() + \"String_Node_Str\" + values);\n System.out.println(\"String_Node_Str\" + clusterValues.keySet().size() + \"String_Node_Str\" + clusterValues);\n assertTrue(candidates.stream().filter(e -> e.toString().equals(\"String_Node_Str\")).findAny().isPresent());\n}\n"
|
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Timber.plant(new Timber.DebugTree());\n if (savedInstanceState == null) {\n getSupportFragmentManager().beginTransaction().addToBackStack(this.toString()).replace(R.id.activity_main, new MainFragment(), this.toString()).commit();\n }\n}\n"
|
"public static IToken tokenize(String code) {\n int len = code.length();\n StringBuilder buf = new StringBuilder(20);\n IToken first = new InferredSemicolon(0, 0);\n IToken prev = first;\n int start = 0;\n int lineNumber = 1;\n char l = 0;\n char c = 0;\n int type = 0;\n int subtype = 0;\n boolean addToken = false;\n boolean reparse = true;\n boolean string = false;\n for (int i = 0; i < len; ++i, l = c) {\n c = code.charAt(i);\n if (type == 0) {\n start = i;\n if (c == '\\n') {\n lineNumber++;\n continue;\n }\n if (c <= ' ') {\n continue;\n }\n if (string && c == '}') {\n type = STRING_2;\n subtype = STRING_PART;\n continue;\n }\n int m = getMode(c, code, i);\n type = m & 0xFFFF;\n subtype = m & 0xFFFF0000;\n }\n switch(type) {\n case IDENTIFIER:\n if (subtype == MOD_DOTS) {\n if (c == '.') {\n buf.append(c);\n } else {\n addToken = true;\n reparse = true;\n }\n } else if (c == '_' || c == '$') {\n subtype = MOD_SYMBOL | MOD_LETTER;\n buf.append(c);\n } else {\n boolean letter = (subtype & MOD_LETTER) != 0;\n boolean symbol = (subtype & MOD_SYMBOL) != 0;\n if (letter) {\n if (isIdentifierPart(c)) {\n subtype = MOD_LETTER;\n buf.append(c);\n continue;\n }\n }\n if (symbol) {\n if (isIdentifierSymbol(c)) {\n subtype = MOD_SYMBOL;\n buf.append(c);\n continue;\n }\n }\n addToken = true;\n }\n break;\n case SYMBOL:\n buf.append(c);\n addToken = true;\n reparse = false;\n break;\n case BRACKET:\n buf.append(c);\n addToken = true;\n reparse = false;\n break;\n case COMMENT:\n if (subtype == MOD_LINE) {\n if (c == '\\n') {\n type = 0;\n continue;\n }\n } else if (subtype == MOD_BLOCK) {\n if (l == '*' && c == '/') {\n type = 0;\n continue;\n }\n }\n break;\n case INT:\n case LONG:\n if (c == '.') {\n type = FLOAT;\n buf.append('.');\n } else if (c == 'l' || c == 'L') {\n type = LONG;\n addToken = true;\n reparse = false;\n } else if (subtype == MOD_DEC) {\n if (isDigit(c)) {\n buf.append(c);\n } else if (c == 'f' || c == 'F') {\n type = FLOAT;\n addToken = true;\n reparse = false;\n } else if (c == 'd' || c == 'D') {\n type = DOUBLE;\n addToken = true;\n reparse = false;\n } else {\n addToken = true;\n }\n } else if (subtype == MOD_BIN) {\n if (c == 'b' || isBinDigit(c)) {\n buf.append(c);\n } else {\n addToken = true;\n }\n } else if (subtype == MOD_OCT) {\n if (isOctDigit(c)) {\n buf.append(c);\n } else {\n addToken = true;\n }\n } else if (subtype == MOD_HEX) {\n if (c == 'x' || isHexDigit(c)) {\n buf.append(c);\n } else {\n addToken = true;\n }\n }\n break;\n case FLOAT:\n case DOUBLE:\n if (c == 'x') {\n subtype = MOD_HEX;\n buf.append(c);\n } else if (c == 'f' || c == 'F') {\n addToken = true;\n reparse = false;\n } else if (c == 'd' || c == 'D') {\n type = DOUBLE;\n addToken = true;\n reparse = false;\n } else if (isDigit(c) || c == '.' || c == 'e') {\n buf.append(c);\n } else {\n addToken = true;\n }\n break;\n case STRING:\n if (c == '\"' && buf.length() > 0) {\n buf.append('\"');\n addToken = true;\n reparse = false;\n } else if (c == '\\\\' && appendEscape(buf, code.charAt(i + 1))) {\n i++;\n continue;\n } else if (c != '\\t') {\n buf.append(c);\n }\n break;\n case STRING_START:\n if (c == '\"' && (buf.length() > 1 || string)) {\n subtype = STRING_END;\n string = false;\n addToken = true;\n reparse = false;\n break;\n } else if (c == '\\\\' && appendEscape(buf, code.charAt(i + 1))) {\n i++;\n continue;\n } else if (c == '$' && code.charAt(i + 1) == '{') {\n i += 2;\n addToken = true;\n string = true;\n } else if (c != '\\t') {\n buf.append(c);\n }\n break;\n case CHAR:\n if (c == '\\'' && buf.length() > 0) {\n buf.append('\\'');\n addToken = true;\n reparse = false;\n } else if (c == '\\\\' && appendEscape(buf, code.charAt(i + 1))) {\n i++;\n continue;\n } else if (c != '\\t') {\n buf.append(c);\n }\n break;\n }\n if (addToken) {\n prev = addToken(prev, buf, type | subtype, lineNumber, start);\n addToken = false;\n type = 0;\n if (reparse) {\n i--;\n } else {\n reparse = true;\n }\n }\n }\n if (buf.length() > 0) {\n addToken(prev, buf, type | subtype, lineNumber, start);\n }\n return first.getNext();\n}\n"
|
"private String embedFile(String filename, boolean base64encode) {\n if (filename == null)\n return null;\n if (filename.startsWith(VpnProfile.INLINE_TAG))\n return filename;\n File possibleFile = findFile(filename);\n if (possibleFile == null)\n return filename;\n else\n return readFileContent(possibleFile, base64encode);\n}\n"
|
"protected void updateSite2SiteVpnConnectionState(final List<DomainRouterVO> routers) {\n for (final DomainRouterVO router : routers) {\n final List<Site2SiteVpnConnectionVO> conns = _s2sVpnMgr.getConnectionsForRouter(router);\n if (conns == null || conns.isEmpty()) {\n continue;\n }\n if (router.getState() != State.Running) {\n for (final Site2SiteVpnConnectionVO conn : conns) {\n if (conn.getState() != Site2SiteVpnConnection.State.Error) {\n conn.setState(Site2SiteVpnConnection.State.Disconnected);\n _s2sVpnConnectionDao.persist(conn);\n }\n }\n continue;\n }\n final List<String> ipList = new ArrayList<String>();\n for (final Site2SiteVpnConnectionVO conn : conns) {\n if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected) {\n continue;\n }\n final Site2SiteCustomerGateway gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());\n ipList.add(gw.getGatewayIp());\n }\n final String privateIP = router.getPrivateIpAddress();\n final HostVO host = _hostDao.findById(router.getHostId());\n if (host == null || host.getState() != Status.Up) {\n continue;\n } else if (host.getManagementServerId() != ManagementServerNode.getManagementServerId()) {\n continue;\n } else if (privateIP != null) {\n final CheckS2SVpnConnectionsCommand command = new CheckS2SVpnConnectionsCommand(ipList);\n command.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));\n command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());\n command.setWait(30);\n final Answer origAnswer = _agentMgr.easySend(router.getHostId(), command);\n CheckS2SVpnConnectionsAnswer answer = null;\n if (origAnswer instanceof CheckS2SVpnConnectionsAnswer) {\n answer = (CheckS2SVpnConnectionsAnswer) origAnswer;\n } else {\n s_logger.warn(\"String_Node_Str\" + router.getHostName() + \"String_Node_Str\");\n continue;\n }\n if (!answer.getResult()) {\n s_logger.warn(\"String_Node_Str\" + router.getHostName() + \"String_Node_Str\");\n continue;\n }\n for (final Site2SiteVpnConnectionVO conn : conns) {\n final Site2SiteVpnConnectionVO lock = _s2sVpnConnectionDao.acquireInLockTable(conn.getId());\n if (lock == null) {\n throw new CloudRuntimeException(\"String_Node_Str\" + conn.getId());\n }\n try {\n if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected) {\n continue;\n }\n final Site2SiteVpnConnection.State oldState = conn.getState();\n final Site2SiteCustomerGateway gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());\n if (answer.isConnected(gw.getGatewayIp())) {\n conn.setState(Site2SiteVpnConnection.State.Connected);\n } else {\n conn.setState(Site2SiteVpnConnection.State.Disconnected);\n }\n _s2sVpnConnectionDao.persist(conn);\n if (oldState != conn.getState()) {\n final String title = \"String_Node_Str\" + gw.getName() + \"String_Node_Str\" + oldState + \"String_Node_Str\" + conn.getState();\n final String context = \"String_Node_Str\" + gw.getName() + \"String_Node_Str\" + router.getHostName() + \"String_Node_Str\" + router.getId() + \"String_Node_Str\" + \"String_Node_Str\" + oldState + \"String_Node_Str\" + conn.getState();\n s_logger.info(context);\n _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, router.getDataCenterId(), router.getPodIdToDeployIn(), title, context);\n }\n } finally {\n _s2sVpnConnectionDao.releaseFromLockTable(lock.getId());\n }\n }\n }\n }\n}\n"
|
"public BigDecimal getValue(double low, double high, Estimator estimator) {\n if (low > high)\n throw new IllegalArgumentException(\"String_Node_Str\" + \"String_Node_Str\");\n return getValue(new Interval<BigDecimal>(low, high, false, false), estimator);\n}\n"
|
"static void initializeKeys(Object[] key, Object[] absent, int size) {\n if (eclass == Object.class || eclass == Integer.class) {\n initInts(key, absent, size);\n } else if (eclass == Float.class) {\n initFloats(key, absent, size);\n } else if (eclass == Double.class) {\n initDoubles(key, absent, size);\n } else if (eclass == String.class) {\n initWords(size, key, absent);\n } else\n throw new Error(\"String_Node_Str\");\n}\n"
|
"public void onSmileClick() {\n int smilesLayoutHeight = getSmileLayoutSizeInPixels();\n if (isSmilesLayoutShowing()) {\n hideSmileLayout();\n } else {\n smilesAnimator.animateHeightFrom(Consts.ZERO_INT_VALUE, smilesLayoutHeight);\n }\n}\n"
|
"public void configurePipeline(PipelineConfigurer pipelineConfigurer) {\n pipelineConfigurer.usePluginClass(\"String_Node_Str\", Context.INITIAL_CONTEXT_FACTORY, \"String_Node_Str\", PluginProperties.builder().build());\n}\n"
|
"private void updateEditorSettings() {\n if (!AppPrefs.isVisualEditorAvailable()) {\n PreferenceScreen preferenceScreen = (PreferenceScreen) findPreference(getActivity().getString(R.string.pref_key_account_settings_root));\n PreferenceCategory editor = (PreferenceCategory) findPreference(getActivity().getString(R.string.pref_key_editor));\n if (preferenceScreen != null && editor != null) {\n preferenceScreen.removePreference(editor);\n }\n } else {\n final ListPreference editorTypePreference = (ListPreference) findPreference(getActivity().getString(R.string.pref_key_editor_type));\n editorTypePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n public boolean onPreferenceChange(final Preference preference, final Object value) {\n if (value != null) {\n int index = Integer.parseInt(value.toString());\n CharSequence[] entries = editorTypePreference.getEntries();\n editorTypePreference.setSummary(entries[index]);\n switch(index) {\n case IDX_VISUAL_EDITOR:\n AppPrefs.setAztecEditorEnabled(false);\n AppPrefs.setVisualEditorEnabled(true);\n break;\n case IDX_AZTEC_EDITOR:\n AppPrefs.setAztecEditorEnabled(true);\n AppPrefs.setVisualEditorEnabled(false);\n AppPrefs.setNewEditorPromoRequired(false);\n break;\n default:\n AppPrefs.setAztecEditorEnabled(false);\n AppPrefs.setVisualEditorEnabled(false);\n break;\n }\n toggleEditorFooterPreference();\n return true;\n } else {\n return false;\n }\n }\n });\n final int editorTypeSetting;\n if (AppPrefs.isAztecEditorEnabled()) {\n editorTypeSetting = IDX_AZTEC_EDITOR;\n } else if (AppPrefs.isVisualEditorEnabled()) {\n editorTypeSetting = IDX_VISUAL_EDITOR;\n } else {\n editorTypeSetting = IDX_LEGACY_EDITOR;\n }\n toggleEditorFooterPreference();\n }\n}\n"
|
"public void testJDTClassNode_633() {\n try {\n JDTResolver.recordInstances = true;\n runConformTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" }, \"String_Node_Str\");\n JDTClassNode classnode = JDTResolver.getCachedNode(\"String_Node_Str\");\n assertNotNull(classnode);\n List<MethodNode> methods = classnode.getMethods();\n assertEquals(1, methods.size());\n assertEquals(\"String_Node_Str\", methods.get(0).getTypeDescriptor());\n } finally {\n JDTResolver.instances.clear();\n JDTResolver.recordInstances = false;\n }\n}\n"
|
"public void createLava(Block block) {\n if (isEarthbendableMaterial(block.getType(), player)) {\n TempBlock tblock = new TempBlock(block, Material.STATIONARY_LAVA, (byte) 0);\n TEMP_LAVA_BLOCKS.add(tblock);\n affectedBlocks.add(tblock);\n if (allowNaturalFlow)\n TempBlock.instances.remove(block);\n }\n}\n"
|
"public void handleEvent(Event event) {\n GC gc = event.gc;\n Rectangle area = table.getClientArea();\n Color previousBgColor = gc.getBackground();\n gc.setBackground(emptyZoneColor);\n int starty = table.getHeaderHeight() + table.getItemCount() * table.getItemHeight() - table.getVerticalBar().getSelection() * table.getItemHeight();\n if (starty < area.height) {\n gc.fillRectangle(0, starty, area.width, area.height);\n }\n TableColumn[] tableColumns = table.getColumns();\n int widthColumns = 0;\n for (TableColumn tableColumn : tableColumns) {\n widthColumns += tableColumn.getWidth();\n }\n if (widthColumns < area.width) {\n gc.fillRectangle(widthColumns + 1, 0, area.width, area.height);\n }\n gc.setBackground(previousBgColor);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.