content
stringlengths
40
137k
"public boolean apply(Game game, Ability source) {\n if (source instanceof SpellAbility) {\n Card card = game.getCard(source.getSourceId());\n if (card != null && (card.getCardType().contains(CardType.ARTIFACT) || card.getCardType().contains(CardType.CREATURE))) {\n return true;\n }\n }\n return false;\n}\n"
"public DomainVO updateDomain(UpdateDomainCmd cmd) {\n Long domainId = cmd.getId();\n String domainName = cmd.getDomainName();\n String networkDomain = cmd.getNetworkDomain();\n DomainVO domain = _domainDao.findById(domainId);\n if (domain == null) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + domainId);\n } else if (domain.getParent() == null && domainName != null) {\n throw new InvalidParameterValueException(\"String_Node_Str\");\n }\n Account caller = UserContext.current().getCaller();\n _accountMgr.checkAccess(caller, domain);\n if (domainName != null) {\n SearchCriteria<DomainVO> sc = _domainDao.createSearchCriteria();\n sc.addAnd(\"String_Node_Str\", SearchCriteria.Op.EQ, domainName);\n List<DomainVO> domains = _domainDao.search(sc, null);\n boolean sameDomain = (domains.size() == 1 && domains.get(0).getId() == domainId);\n if (!domains.isEmpty() && !sameDomain) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + domainId + \"String_Node_Str\" + domainName + \"String_Node_Str\");\n }\n }\n if (networkDomain != null) {\n if (!NetUtils.verifyDomainName(networkDomain)) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n }\n Transaction txn = Transaction.currentTxn();\n txn.start();\n if (domainName != null) {\n String updatedDomainPath = getUpdatedDomainPath(domain.getPath(), domainName);\n updateDomainChildren(domain, updatedDomainPath);\n domain.setName(domainName);\n domain.setPath(updatedDomainPath);\n }\n if (networkDomain != null) {\n domain.setNetworkDomain(networkDomain);\n }\n _domainDao.update(domainId, domain);\n txn.commit();\n return _domainDao.findById(domainId);\n}\n"
"public DetachVolumeResponseType detach(DetachVolumeType request) throws EucalyptusCloudException {\n final DetachVolumeResponseType reply = (DetachVolumeResponseType) request.getReply();\n final String volumeId = normalizeVolumeIdentifier(request.getVolumeId());\n final String instanceId = normalizeOptionalInstanceIdentifier(request.getInstanceId());\n final Context ctx = Contexts.lookup();\n Volume vol;\n try {\n vol = Volumes.lookup(ctx.getUserFullName().asAccountFullName(), volumeId);\n } catch (NoSuchElementException ex) {\n try {\n vol = Volumes.lookup(null, volumeId);\n } catch (NoSuchElementException e) {\n throw new ClientComputeException(\"String_Node_Str\", \"String_Node_Str\" + request.getVolumeId() + \"String_Node_Str\");\n }\n }\n if (!RestrictedTypes.filterPrivileged().apply(vol)) {\n throw new ClientUnauthorizedComputeException(\"String_Node_Str\" + volumeId + \"String_Node_Str\" + ctx.getUser().getName());\n }\n VmInstance vm = null;\n String remoteDevice = null;\n AttachedVolume volume = null;\n VmVolumeAttachment vmVolAttach = null;\n try {\n vmVolAttach = VmInstances.lookupVolumeAttachment(volumeId);\n remoteDevice = vmVolAttach.getRemoteDevice();\n volume = VmVolumeAttachment.asAttachedVolume(vmVolAttach.getVmInstance()).apply(vmVolAttach);\n vm = vmVolAttach.getVmInstance();\n } catch (NoSuchElementException ex) {\n throw new ClientComputeException(\"String_Node_Str\", \"String_Node_Str\" + volumeId);\n }\n if (vmVolAttach.getIsRootDevice() && !VmState.STOPPED.equals(vm.getState())) {\n throw new ClientComputeException(\"String_Node_Str\", \"String_Node_Str\" + volumeId + \"String_Node_Str\" + vm.getInstanceId() + \"String_Node_Str\" + vm.getState().toString().toLowerCase());\n }\n if (vm != null && MigrationState.isMigrating(vm)) {\n throw Exceptions.toUndeclared(\"String_Node_Str\" + vm.getInstanceId() + \"String_Node_Str\" + vm.getMigrationTask());\n }\n if (volume == null) {\n throw new ClientComputeException(\"String_Node_Str\", \"String_Node_Str\" + volumeId);\n }\n if (!RestrictedTypes.filterPrivileged().apply(vm)) {\n throw new EucalyptusCloudException(\"String_Node_Str\" + instanceId + \"String_Node_Str\" + ctx.getUser().getName());\n }\n if (instanceId != null && vm != null && !vm.getInstanceId().equals(instanceId)) {\n throw new ClientComputeException(\"String_Node_Str\", \"String_Node_Str\" + instanceId);\n }\n if (request.getDevice() != null && !request.getDevice().equals(\"String_Node_Str\") && !volume.getDevice().equals(request.getDevice())) {\n throw new EucalyptusCloudException(\"String_Node_Str\" + request.getDevice());\n }\n ServiceConfiguration scVm;\n try {\n scVm = Topology.lookup(Storage.class, vm.lookupPartition());\n } catch (Exception ex) {\n LOG.error(ex, ex);\n throw new EucalyptusCloudException(\"String_Node_Str\" + vm.getPartition(), ex);\n }\n if (VmState.STOPPED.equals(vm.getState())) {\n try {\n final DetachStorageVolumeType detach = new DetachStorageVolumeType(volume.getVolumeId());\n AsyncRequests.sendSync(scVm, detach);\n } catch (Exception e) {\n LOG.debug(e);\n Logs.extreme().debug(e, e);\n }\n vm.removeVolumeAttachment(volume.getVolumeId());\n } else {\n Cluster cluster = null;\n ServiceConfiguration ccConfig = null;\n try {\n ccConfig = Topology.lookup(ClusterController.class, vm.lookupPartition());\n cluster = Clusters.lookup(ccConfig);\n } catch (NoSuchElementException e) {\n LOG.debug(e, e);\n throw new EucalyptusCloudException(\"String_Node_Str\" + vm.getPartition());\n }\n final ClusterDetachVolumeType detachVolume = new ClusterDetachVolumeType();\n detachVolume.setVolumeId(volume.getVolumeId());\n detachVolume.setRemoteDevice(remoteDevice);\n detachVolume.setDevice(volume.getDevice().replaceAll(\"String_Node_Str\", \"String_Node_Str\"));\n detachVolume.setInstanceId(vm.getInstanceId());\n detachVolume.setForce(request.getForce());\n VolumeDetachCallback ncDetach = new VolumeDetachCallback(detachVolume);\n AsyncRequests.newRequest(ncDetach).dispatch(cluster.getConfiguration());\n vm.updateVolumeAttachment(volumeId, AttachmentState.detaching);\n volume.setStatus(\"String_Node_Str\");\n }\n reply.setDetachedVolume(volume);\n Volumes.fireUsageEvent(vol, VolumeEvent.forVolumeDetach(vm.getInstanceUuid(), vm.getInstanceId()));\n return reply;\n}\n"
"private static ClassLoader[] getClassLoaders() {\n ClassLoader[] classLoaders = new ClassLoader[2];\n classLoaders[0] = ProviderManager.class.getClassLoader();\n classLoaders[1] = Thread.currentThread().getContextClassLoader();\n List<ClassLoader> loaders = new ArrayList<ClassLoader>();\n for (ClassLoader classLoader : classLoaders) {\n if (classLoader != null) {\n loaders.add(classLoader);\n }\n }\n return loaders.toArray(new ClassLoader[loaders.size()]);\n}\n"
"public void testExtendingRawJavaType() {\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\");\n}\n"
"public TextureRegion getCellImage(Element e) {\n String iconName = MessageFormat.format(\"String_Node_Str\", e.getAttribute(\"String_Node_Str\"));\n TextureRegion image = null;\n if (!custom)\n image = Ctx.assetManager.getIcon(iconName);\n else\n image = Ctx.assetManager.getIcon(\"String_Node_Str\");\n return image;\n}\n"
"public void onPostsLoaded(int postCount) {\n if (!isAdded()) {\n return;\n }\n if (postCount == 0) {\n mEmptyView.setVisibility(View.VISIBLE);\n } else {\n mEmptyView.setVisibility(View.GONE);\n }\n if (postCount == 0 && !isRefreshing()) {\n updateEmptyView(MessageType.NO_CONTENT);\n }\n if (postCount == 0 && mCanLoadMorePosts) {\n if (isAdded() && NetworkUtils.isNetworkAvailable(getActivity())) {\n setRefreshing(true);\n requestPosts(false);\n } else {\n updateEmptyView(MessageType.NETWORK_ERROR);\n }\n } else if (mShouldSelectFirstPost) {\n mShouldSelectFirstPost = false;\n if (mPostsListAdapter.getCount() > 0) {\n PostsListPost postsListPost = (PostsListPost) mPostsListAdapter.getItem(0);\n if (postsListPost != null) {\n showPost(postsListPost.getPostId());\n getListView().setItemChecked(0, true);\n }\n }\n } else if (isAdded() && ((PostsActivity) getActivity()).isDualPane()) {\n int selectedPosition = getListView().getCheckedItemPosition();\n if (selectedPosition != ListView.INVALID_POSITION && selectedPosition < mPostsListAdapter.getCount()) {\n PostsListPost postsListPost = (PostsListPost) mPostsListAdapter.getItem(selectedPosition);\n if (postsListPost != null) {\n showPost(postsListPost.getPostId());\n }\n }\n }\n}\n"
"public Response put(URI uri, Object object, boolean newEntity, int writeQuorum) {\n assertNotEmpty(object, \"String_Node_Str\");\n final JsonObject json = getGson().toJsonTree(object).getAsJsonObject();\n String id = getAsString(json, \"String_Node_Str\");\n String rev = getAsString(json, \"String_Node_Str\");\n if (newEntity) {\n assertNull(rev, \"String_Node_Str\");\n id = (id == null) ? generateUUID() : id;\n } else {\n assertNotEmpty(id, \"String_Node_Str\");\n assertNotEmpty(rev, \"String_Node_Str\");\n }\n}\n"
"public void processConfigFile(File file) throws IOException, BindException {\n PropertiesConfiguration confFile;\n try {\n confFile = new PropertiesConfiguration(file);\n } catch (ConfigurationException e) {\n throw new BindException(\"String_Node_Str\", e);\n }\n Iterator<String> it = confFile.getKeys();\n Map<String, String> shortNames = new HashMap<String, String>();\n while (it.hasNext()) {\n String key = it.next();\n String longName = shortNames.get(key);\n String[] values = confFile.getStringArray(key);\n if (longName != null) {\n key = longName;\n }\n for (String value : values) {\n boolean isSingleton = false;\n if (value.equals(ConfigurationImpl.SINGLETON)) {\n isSingleton = true;\n }\n if (value.equals(ConfigurationImpl.REGISTERED)) {\n try {\n this.conf.namespace.register(conf.classForName(key));\n } catch (ClassNotFoundException e) {\n throw new BindException(\"String_Node_Str\" + key + \"String_Node_Str\", e);\n }\n }\n if (key.equals(ConfigurationImpl.IMPORT)) {\n if (isSingleton) {\n throw new IllegalArgumentException(\"String_Node_Str\" + ConfigurationImpl.IMPORT + \"String_Node_Str\" + ConfigurationImpl.SINGLETON + \"String_Node_Str\");\n }\n try {\n this.conf.namespace.register(conf.classForName(value));\n String[] tok = value.split(ReflectionUtilities.regexp);\n try {\n this.conf.namespace.getNode(tok[tok.length - 1]);\n throw new IllegalArgumentException(\"String_Node_Str\" + tok[tok.length - 1]);\n } catch (NameResolutionException e) {\n String oldValue = shortNames.put(tok[tok.length - 1], value);\n if (oldValue != null) {\n throw new IllegalArgumentException(\"String_Node_Str\" + tok[tok.length - 1] + \"String_Node_Str\" + oldValue + \"String_Node_Str\" + value);\n }\n }\n } catch (ClassNotFoundException e) {\n throw new BindException(\"String_Node_Str\" + value + \"String_Node_Str\", e);\n }\n } else {\n if (isSingleton) {\n final Class<?> c;\n try {\n c = conf.classForName(key);\n } catch (ClassNotFoundException e) {\n throw new BindException(\"String_Node_Str\", e);\n }\n bindSingleton(c);\n } else {\n try {\n bind(key, value);\n } catch (ClassNotFoundException e) {\n throw new BindException(\"String_Node_Str\", e);\n }\n }\n }\n }\n }\n}\n"
"public void testExpression3() {\n String expression = oldExpressions[3];\n try {\n List list = extractColumnExpression(new ScriptExpression(expression));\n assertTrue(list.size() == 2);\n } catch (BirtException e) {\n fail(\"String_Node_Str\");\n }\n}\n"
"private double getRMSD(AFPChain afpChain, Atom[] ca1, Atom[] ca2) throws StructureException {\n Atom[] ca2clone = StructureTools.cloneAtomArray(ca2);\n rotateAtoms2(afpChain, ca2clone);\n Atom[] catmp1 = AFPAlignmentDisplay.getAlignedAtoms1(afpChain, ca1);\n Atom[] catmp2 = AFPAlignmentDisplay.getAlignedAtoms2(afpChain, ca2clone);\n assertTrue(catmp1.length == catmp2.length);\n assertTrue(catmp1.length == afpChain.getNrEQR());\n return Calc.rmsd(catmp1, catmp2);\n}\n"
"public PresenceStatus getLastPresenceStatus(ProtocolProviderService protocolProvider) {\n String lastStatus = getLastStatusString(protocolProvider);\n OperationSetPresence presence = mainFrame.getProtocolPresenceOpSet(protocolProvider);\n if (presence == null)\n return null;\n Iterator i = presence.getSupportedStatusSet();\n if (lastStatus != null) {\n PresenceStatus status;\n while (i.hasNext()) {\n status = (PresenceStatus) i.next();\n if (status.getStatusName().equals(lastStatus)) {\n return status;\n }\n }\n }\n return null;\n}\n"
"public void handleMessage(String messageType, JSONObject response) {\n try {\n boolean newProjects = false;\n JSONArray projectsList = response.getJSONArray(\"String_Node_Str\");\n for (int i = 0; i < projectsList.length(); i++) {\n JSONObject project = projectsList.getJSONObject(i);\n String projectName = project.getString(\"String_Node_Str\");\n projectsNames.add(projectName);\n }\n setElements((String[]) projectsNames.toArray(new String[projectsNames.size()]));\n } catch (Exception e) {\n e.printStackTrace();\n }\n messagingConnector.removeMessageHandler(this);\n}\n"
"public static void paint(Level level, Room room) {\n fill(level, room, Terrain.WALL);\n fill(level, room, 1, Terrain.HIGH_GRASS);\n fill(level, room, 2, Terrain.GRASS);\n room.entrance().set(Room.Door.Type.REGULAR);\n if (Dungeon.isChallenged(Challenges.NO_FOOD)) {\n if (Random.Int(2) == 0) {\n level.plant(new Sungrass.Seed(), level.pointToCell(room.random()));\n }\n } else {\n int bushes = Random.Int(3);\n if (bushes == 0) {\n level.plant(new Sungrass.Seed(), level.pointToCell(room.random()));\n } else if (bushes == 1) {\n level.plant(new BlandfruitBush.Seed(), level.pointToCell(room.random()));\n } else if (Random.Int(5) == 0) {\n int plant1, plant2;\n plant1 = level.pointToCell(room.random());\n level.plant(new Sungrass.Seed(), plant1);\n do {\n plant2 = level.pointToCell(room.random());\n } while (plant2 == plant1);\n level.plant(new BlandfruitBush.Seed(), plant2);\n }\n }\n Foliage light = (Foliage) level.blobs.get(Foliage.class);\n if (light == null) {\n light = new Foliage();\n }\n for (int i = room.top + 1; i < room.bottom; i++) {\n for (int j = room.left + 1; j < room.right; j++) {\n light.seed(level, j + level.width() * i, 1);\n }\n }\n level.blobs.put(Foliage.class, light);\n}\n"
"public int getDispatchReduceFreq() {\n return getDispatchReduceFrequency();\n}\n"
"public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {\n monitorWrap = new EventLoopProgressMonitor(monitor);\n try {\n for (ResourcesManager resManager : finalCheckManagers) {\n List<ImportItem> projectRecords = importManager.populateImportingItems(resManager, true, monitorWrap);\n importManager.importItemRecords(monitorWrap, resManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);\n }\n } catch (Exception e) {\n ExceptionHandler.process(e);\n }\n monitorWrap.done();\n if (monitor.isCanceled()) {\n MessageDialog.openInformation(getShell(), Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"));\n return;\n } else {\n MessageDialog.openInformation(getShell(), Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"));\n }\n}\n"
"public void init(Map<String, Map<String, TblColRef>> columnMap) {\n if (null != partitionDateColumn) {\n partitionDateColumn = partitionDateColumn.toUpperCase();\n String[] columns = StringSplitter.split(partitionDateColumn, \"String_Node_Str\");\n if (null != columns && columns.length == 3) {\n Map<String, TblColRef> cols = columnMap.get(columns[0].toUpperCase() + \"String_Node_Str\" + columns[1].toUpperCase());\n if (cols != null)\n partitionDateColumnRef = cols.get(columns[1].toUpperCase());\n }\n }\n}\n"
"final void put(Task.TaskKey key, V value) {\n mCache.put(key.id, value);\n mTaskKeys.put(key.id, key);\n}\n"
"public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {\n String className = reader.getAttribute(\"String_Node_Str\");\n RubyClass c = resolveClass(className);\n if (c == null)\n throw new IllegalArgumentException(\"String_Node_Str\" + className);\n Class r = c.getReifiedClass();\n if (r != null) {\n Converter cnv = xs.getConverterLookup().lookupConverterForType(r);\n if (cnv != this)\n return cnv.unmarshal(reader, context);\n }\n IRubyObject o = c.allocate();\n while (reader.hasMoreChildren()) {\n reader.moveDown();\n String fieldName = reader.getNodeName();\n Class valueType;\n className = reader.getAttribute(\"String_Node_Str\");\n if (className != null) {\n valueType = mapper.realClass(className);\n } else {\n valueType = IRubyObject.class;\n }\n IRubyObject value = (IRubyObject) context.convertAnother(o, valueType);\n c.getVariableAccessorForWrite('@' + fieldName).set(o, value);\n reader.moveUp();\n }\n return o;\n}\n"
"protected void updateHandlersForAssign(final AttributeDefinition handlerAttribute, final ModelNode operation, final ModelNode model) throws OperationFailedException {\n final String handlerName = getHandlerName(operation);\n if (handlerExists(handlerName, handlerAttribute, model)) {\n throw createFailureMessage(MESSAGES.handlerAlreadyDefined(handlerName));\n }\n parent.get(handlerAttribute.getName()).add(handlerName);\n}\n"
"public void testDisabledEffectOnChangeZone() {\n addCard(Zone.BATTLEFIELD, playerA, \"String_Node_Str\", 1);\n addCard(Zone.HAND, playerA, \"String_Node_Str\");\n addCard(Zone.BATTLEFIELD, playerA, \"String_Node_Str\", 4);\n addCard(Zone.HAND, playerA, \"String_Node_Str\", 2);\n addCard(Zone.BATTLEFIELD, playerA, \"String_Node_Str\", 1);\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"String_Node_Str\");\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"String_Node_Str\", \"String_Node_Str\");\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"String_Node_Str\");\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n assertLife(playerA, 21);\n assertLife(playerB, 20);\n}\n"
"protected void openNextFile() {\n while ((curFileIndex + 1) % numTasks != taskId) {\n curFileIndex++;\n }\n if (curFileIndex < files.length) {\n try {\n File file = files[curFileIndex];\n scanner = new Scanner(file);\n curLineIndex = 0;\n LOG.info(\"String_Node_Str\", file.getName(), FileUtils.humanReadableByteCount(file.length()));\n } catch (FileNotFoundException ex) {\n LOG.error(String.format(\"String_Node_Str\", files[curFileIndex]), ex);\n throw new IllegalStateException(\"String_Node_Str\", ex);\n }\n }\n}\n"
"public void testName002Negative() throws Exception {\n boolean exception = false;\n String msg = null;\n String src = \"String_Node_Str\";\n String tmpdir = System.getenv(\"String_Node_Str\");\n try {\n Class[] jClasses = new Class[] { Name002.class };\n Generator gen = new Generator(new JavaModelInputImpl(jClasses, new JavaModelImpl(Thread.currentThread().getContextClassLoader())));\n gen.generateSchemaFiles(tmpdir, null);\n SchemaFactory sFact = SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);\n Schema theSchema = sFact.newSchema(new File(tmpdir + \"String_Node_Str\"));\n Validator validator = theSchema.newValidator();\n StreamSource ss = new StreamSource(new File(src));\n validator.validate(ss);\n } catch (Exception ex) {\n exception = true;\n msg = ex.getMessage();\n }\n assertFalse(\"String_Node_Str\" + msg, exception == false);\n}\n"
"public String getQuery(boolean useCastIfApplicable) {\n AdapterQueryBuilder contentValue = new AdapterQueryBuilder();\n if (!requiresTypeConverter) {\n if (castedClass != null && useCastIfApplicable) {\n contentValue.appendCast(isABlob ? \"String_Node_Str\" : castedClass);\n } else {\n contentValue.append(\"String_Node_Str\");\n }\n }\n contentValue.appendVariable(isModelContainerAdapter).append(\"String_Node_Str\");\n if (isModelContainerAdapter) {\n contentValue.appendGetValue(containerKeyName);\n } else if (fieldIsAModelContainer) {\n contentValue.append(columnName).append(\"String_Node_Str\").appendGetValue(referencedColumnFieldName);\n } else {\n if (isForeignKeyField) {\n ColumnAccessModel columnAccessModel = new ColumnAccessModel(parentColumnDefinition.getManager(), parentColumnDefinition, isModelContainerAdapter);\n contentValue.append(columnAccessModel.getReferencedColumnFieldName()).append(\"String_Node_Str\");\n }\n contentValue.append(getReferencedColumnFieldName());\n }\n if (isABlob && !isModelContainerAdapter) {\n contentValue.append(\"String_Node_Str\");\n }\n if (!requiresTypeConverter) {\n contentValue.append(\"String_Node_Str\");\n }\n return contentValue.getQuery();\n}\n"
"public String getAbsoluteImageFolder() {\n return imageFolder + File.separator + request.getSession().getId();\n}\n"
"public FeatureVector getObservedFeatureCounts(double[] params) {\n model.updateModelFromDoubles(params);\n FgModel feats = new FgModel(model);\n feats.zero();\n for (int i = 0; i < data.size(); i++) {\n FgExample ex = data.get(i);\n FgInferencer infLat = getInfLat(ex);\n FactorGraph fgLat = ex.updateFgLat(model, infLat.isLogDomain());\n infLat.run();\n addExpectedFeatureCounts(fgLat, ex, infLat, data.getTemplates(), 1.0, feats);\n }\n double[] f = new double[numParams];\n feats.updateDoublesFromModel(f);\n return new FeatureVector(f);\n}\n"
"public ListenableFuture<?> run(Id.Program programId, Map<String, String> systemOverrides) throws TaskExecutionException, IOException {\n Map<String, String> userArgs = Maps.newHashMap();\n Map<String, String> systemArgs = Maps.newHashMap();\n String scheduleName = systemOverrides.get(ProgramOptionConstants.SCHEDULE_NAME);\n ApplicationSpecification appSpec = store.getApplication(programId.getApplication());\n if (appSpec == null || appSpec.getSchedules().get(scheduleName) == null) {\n throw new TaskExecutionException(String.format(UserMessages.getMessage(UserErrors.PROGRAM_NOT_FOUND), programId), false);\n }\n ScheduleSpecification spec = appSpec.getSchedules().get(scheduleName);\n if (!requirementsChecker.checkSatisfied(programId, spec.getSchedule())) {\n return Futures.<Void>immediateFuture(null);\n }\n userArgs.putAll(spec.getProperties());\n userArgs.putAll(propertiesResolver.getUserProperties(programId));\n systemArgs.putAll(propertiesResolver.getSystemProperties(programId));\n systemArgs.putAll(systemOverrides);\n return execute(programId, systemArgs, userArgs);\n}\n"
"public boolean hasTarget() {\n return this.targetEntity != null;\n}\n"
"public boolean validateDrop(Object target, int operation, TransferData transferType) {\n if (target == null) {\n return false;\n super.validateDrop(target, operation, transferType);\n boolean isValid = true;\n for (Object obj : ((StructuredSelection) getViewer().getSelection()).toArray()) {\n RepositoryNode sourceNode = (RepositoryNode) obj;\n if (sourceNode != null) {\n IRepositoryViewObject object = sourceNode.getObject();\n if (object == null) {\n return false;\n }\n if (object.getRepositoryObjectType() == ERepositoryObjectType.JOB_DOC || object.getRepositoryObjectType() == ERepositoryObjectType.JOBLET_DOC) {\n if (GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class)) {\n IDiagramModelService diagramModelService = (IDiagramModelService) GlobalServiceRegister.getDefault().getService(IDiagramModelService.class);\n if (diagramModelService != null && BusinessType.SHAP == diagramModelService.getBusinessModelType(target)) {\n return true;\n }\n }\n return false;\n } else if (object.getRepositoryObjectType() == ERepositoryObjectType.ROUTINES) {\n Property property = object.getProperty();\n RoutineItem item = (RoutineItem) property.getItem();\n if (item.isBuiltIn() && target instanceof RepositoryNode) {\n return false;\n }\n } else if (object.getRepositoryObjectType() == ERepositoryObjectType.SQLPATTERNS) {\n Property property = object.getProperty();\n SQLPatternItem item = (SQLPatternItem) property.getItem();\n if (item.isSystem() && target instanceof RepositoryNode) {\n return false;\n }\n }\n }\n switch(operation) {\n case DND.DROP_COPY:\n isValid = CopyObjectAction.getInstance().validateAction(sourceNode, (RepositoryNode) target);\n break;\n case DND.DROP_MOVE:\n isValid = MoveObjectAction.getInstance().validateAction(sourceNode, (RepositoryNode) target, true);\n break;\n case DND.DROP_DEFAULT:\n case DND.Drop:\n isValid = MoveObjectAction.getInstance().validateAction(sourceNode, (RepositoryNode) target, true);\n break;\n default:\n isValid = false;\n }\n }\n return isValid;\n}\n"
"protected void render() {\n int numAllowedValues = 0, maxValueLength = 12, maxShortValues = 8;\n boolean shortValues = true;\n AllowedValueType valueType = null;\n for (String value : entry.getAllowedValues()) {\n lowercaseAllowedValues.add(value.toLowerCase());\n }\n valueType = entry.getValueType();\n numAllowedValues = entry.getAllowedValues().size();\n for (String i : entry.getAllowedValues()) {\n if (i.length() > maxValueLength) {\n shortValues = false;\n break;\n }\n }\n if (getLayout() == null) {\n FillLayout layout = new FillLayout(SWT.VERTICAL);\n layout.marginHeight = 5;\n layout.marginWidth = 3;\n layout.spacing = 5;\n setLayout(layout);\n }\n FillLayout fillLayout = new FillLayout(SWT.VERTICAL);\n fillLayout.marginHeight = 5;\n fillLayout.marginWidth = 3;\n fillLayout.spacing = 5;\n Layout layout = fillLayout;\n if (valueType == AllowedValueType.Discrete && numAllowedValues > 0) {\n if (numAllowedValues <= maxShortValues && shortValues) {\n if (numAllowedValues == 2 && allowedBinaryValues.containsAll(lowercaseAllowedValues)) {\n createCheckbox();\n } else {\n createLabel();\n createButtons();\n }\n } else {\n createLabel();\n createDropdown();\n }\n } else if (valueType == AllowedValueType.Discrete) {\n throwMissingValuesError();\n } else if (valueType == AllowedValueType.File) {\n createLabel();\n createDropdown();\n createBrowseButton();\n final RowLayout rowLayout = new RowLayout();\n rowLayout.wrap = true;\n rowLayout.fill = false;\n rowLayout.center = true;\n layout = rowLayout;\n final RowData rowData = new RowData();\n dropDown.setLayoutData(rowData);\n final int minWidth = 50;\n final int unwrappedWidth;\n Button button = buttons.get(0);\n int labelWidth = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;\n int buttonWidth = button.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;\n int padding = 2 * rowLayout.spacing + rowLayout.marginLeft + rowLayout.marginWidth * 2 + rowLayout.marginRight + 30;\n unwrappedWidth = labelWidth + buttonWidth + padding;\n int availableWidth = getClientArea().width - unwrappedWidth;\n rowData.width = (availableWidth > minWidth ? availableWidth : minWidth);\n if (resizeListener != null) {\n removeControlListener(resizeListener);\n }\n resizeListener = new ControlAdapter() {\n public void controlResized(ControlEvent e) {\n int availableWidth = getClientArea().width - unwrappedWidth;\n rowData.width = (availableWidth > minWidth ? availableWidth : minWidth);\n layout();\n }\n };\n addControlListener(resizeListener);\n } else {\n createLabel();\n createTextfield();\n }\n setLayout(layout);\n return;\n}\n"
"public void test() {\n driver.get(\"String_Node_Str\");\n searchTextField.sendKeys(\"String_Node_Str\");\n btnG.click();\n Assert.assertNotEquals(0, foundLinks.size());\n}\n"
"public JClassType getSuperclass() {\n if (isUpperBound()) {\n return getFirstBound();\n }\n return getOracle().getJavaLangObject();\n}\n"
"private int saveHierarchyRows(ILevelDefn[] levelDefs, int[][] keyDataType, int[][] attributesDataType, DiskSortedStack sortedDimensionSet) throws IOException, BirtException {\n DiskSortedStack sortedDimMembers = new DiskSortedStack(Math.min(sortedDimensionSet.size(), Constants.MAX_LIST_BUFFER_SIZE), true, false, Member.getCreator());\n IDiskArray[] indexKeyLists = new IDiskArray[keyDataType.length];\n for (int i = 0; i < indexKeyLists.length; i++) {\n indexKeyLists[i] = new BufferedStructureArray(IndexKey.getCreator(), Constants.LIST_BUFFER_SIZE);\n }\n Object obj = sortedDimensionSet.pop();\n int currentIndex = 0;\n IndexKey indexKey = null;\n while (obj != null) {\n DimensionRow dimRows = (DimensionRow) obj;\n Member[] levelMembers = dimRows.getMembers();\n for (int i = 0; i < indexKeyLists.length; i++) {\n indexKey = new IndexKey();\n indexKey.setKey(levelMembers[i].getKeyValues());\n indexKey.setOffset((int) documentObj.getFilePointer());\n indexKey.setDimensionPos(currentIndex);\n indexKeyLists[i].add(indexKey);\n }\n offsetDocObj.writeInt((int) documentObj.getFilePointer());\n sortedDimMembers.push(dimRows.getMembers()[levelDefs.length - 1]);\n writeDimensionRow(dimRows, keyDataType, attributesDataType);\n obj = sortedDimensionSet.pop();\n currentIndex++;\n }\n validateDimensionMembers(sortedDimMembers);\n DiskIndex[] diskIndex = new DiskIndex[indexKeyLists.length];\n for (int i = 0; i < indexKeyLists.length; i++) {\n diskIndex[i] = DiskIndex.createIndex(documentManager, NamingUtil.getLevelIndexDocName(dimensionName, levelDefs[i].getLevelName()), indexKeyLists[i], false);\n }\n levels = new Level[levelDefs.length];\n for (int i = 0; i < levels.length; i++) {\n levels[i] = new Level(documentManager, levelDefs[i], keyDataType[i], attributesDataType[i], currentIndex, diskIndex[i]);\n }\n for (int i = 0; i < levels.length; i++) {\n this.levelMap.put(levels[i].getName(), levels[i]);\n }\n return currentIndex;\n}\n"
"protected String parseDelay() {\n DoubleParamType aux = getDelay();\n if (aux == null)\n return \"String_Node_Str\";\n String content = \"String_Node_Str\" + aux.parse();\n if (aux.getValue() != null)\n content += \"String_Node_Str\";\n else\n content += \"String_Node_Str\";\n return content;\n}\n"
"public Object get(String name, Scriptable start) {\n PropertyInfo pinfo = this.classWrapper.getProperty(name);\n if (pinfo != null) {\n Method getter = pinfo.getGetter();\n if (getter == null) {\n throw new EvaluatorException(\"String_Node_Str\" + name + \"String_Node_Str\");\n }\n try {\n Object javaObject = this.getJavaObject();\n if (javaObject == null) {\n throw new IllegalStateException(\"String_Node_Str\" + this.classWrapper + \"String_Node_Str\");\n }\n Object val = getter.invoke(javaObject, (Object[]) null);\n return JavaScript.getInstance().getJavascriptObject(val, start.getParentScope());\n } catch (Exception err) {\n err.printStackTrace();\n return new Object();\n }\n } else {\n Function f = this.classWrapper.getFunction(name);\n if (f != null) {\n return f;\n } else {\n Object result = super.get(name, start);\n if (result != Scriptable.NOT_FOUND) {\n return result;\n }\n PropertyInfo ni = this.classWrapper.getNameIndexer();\n if (ni != null) {\n Method getter = ni.getGetter();\n if (getter != null) {\n Object javaObject = this.getJavaObject();\n if (javaObject == null) {\n throw new IllegalStateException(\"String_Node_Str\" + this.classWrapper + \"String_Node_Str\");\n }\n try {\n Object val = getter.invoke(javaObject, new Object[] { name });\n if (val == null) {\n return super.get(name, start);\n } else {\n return JavaScript.getInstance().getJavascriptObject(val, start.getParentScope());\n }\n } catch (Exception err) {\n throw new WrappedException(err);\n }\n }\n }\n return Scriptable.NOT_FOUND;\n }\n }\n}\n"
"public void run() {\n if (dimensionHandle == null) {\n return;\n }\n transStar(NAME);\n try {\n CrosstabReportItemHandle handle = dimensionHandle.getCrosstab();\n dimensionHandle.getCrosstab().removeDimension(dimensionHandle.getAxisType(), dimensionHandle.getIndex());\n if (bool) {\n CrosstabAdaptUtil.removeInvalidBindings(handle);\n }\n AggregationCellProviderWrapper providerWrapper = new AggregationCellProviderWrapper((ExtendedItemHandle) handle.getModelHandle());\n providerWrapper.updateAllAggregationCells(AggregationCellViewAdapter.SWITCH_VIEW_TYPE);\n } catch (SemanticException e) {\n rollBack();\n ExceptionHandler.handle(e);\n return;\n }\n transEnd();\n}\n"
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n setContentView(R.layout.activity_linechart_noseekbar);\n mChart = (LineChart) findViewById(R.id.chart1);\n mChart.setOnChartValueSelectedListener(this);\n mChart.setDrawYValues(false);\n mChart.setDrawGridBackground(false);\n mChart.setDescription(\"String_Node_Str\");\n String[] xVals = new String[30];\n for (int i = 0; i < 30; i++) xVals[i] = \"String_Node_Str\" + i;\n ArrayList<Entry> yVals = new ArrayList<Entry>();\n for (int i = 0; i < 10; i++) yVals.add(new Entry((float) (Math.random() * 50) + 50f, i));\n LineDataSet set = new LineDataSet(yVals, \"String_Node_Str\");\n set.setLineWidth(2.5f);\n set.setCircleSize(4.5f);\n set.setColor(Color.rgb(240, 99, 99));\n set.setCircleColor(Color.rgb(240, 99, 99));\n set.setHighLightColor(Color.rgb(190, 190, 190));\n LineData data = new LineData(xVals, set);\n mChart.setData(data);\n mChart.invalidate();\n}\n"
"public Map<ProjectVersionRef, String> translateVersions(List<ProjectVersionRef> projects) {\n final Map<ProjectVersionRef, String> result = new HashMap<>();\n logger.debug(\"String_Node_Str\" + projects);\n final Queue<Task> queue = new ArrayDeque<>();\n queue.add(new Task(projects, chunkSplitCount, endpointUrl));\n while (!queue.isEmpty()) {\n Task task = queue.remove();\n task.executeTranslate();\n if (task.isSuccess()) {\n result.putAll(task.getResult());\n } else {\n if (task.canSplit()) {\n List<Task> tasks = task.split();\n logger.debug(\"String_Node_Str\" + \"String_Node_Str\" + task + \"String_Node_Str\" + tasks);\n queue.addAll(tasks);\n } else {\n if (task.getStatus() > 0)\n throw new RestException(\"String_Node_Str\" + task.getStatus());\n else\n throw new RestException(\"String_Node_Str\" + task.getException(), task.getException());\n }\n }\n }\n return result;\n}\n"
"public void dispose() {\n try {\n if (CAPRecordedCommand.getRecordListener() == this) {\n CAPRecordedCommand.setRecordListener(null);\n TestExecutionContributor.getInstance().getClientTest().resetToTesting();\n }\n if (getEditorSite() != null && getEditorSite().getPage() != null) {\n ded.fireRecordModeStateChanged(RecordModeState.notRunning);\n removeGlobalActionHandler();\n }\n } finally {\n super.dispose();\n }\n}\n"
"public static void checkNotNullOrEmpty(String object, String objectName, String details, Object... data) throws OseeCoreException {\n checkNotNull(object, objectName, details, data);\n if (object.length() == 0) {\n String message = String.format(details, data);\n throw new OseeArgumentException(\"String_Node_Str\", objectName, message);\n }\n}\n"
"public void run() {\n if (isMultiplayerWorld()) {\n int pollingTime = 0;\n setHasInventoryChanged(false);\n while (!hasInventoryChanged() && pollingTime < POLLING_TIMEOUT) {\n trySleep(POLLING_DELAY);\n }\n if (pollingTime < AUTOREPLACE_DELAY)\n trySleep(AUTOREPLACE_DELAY - pollingTime);\n if (pollingTime >= POLLING_TIMEOUT)\n log.warning(\"String_Node_Str\");\n } else {\n trySleep(AUTOREPLACE_DELAY);\n }\n try {\n ItemStack stack = inventory.getItemStack(i);\n if (stack != null && getItemID(stack) == expectedItemId) {\n inventory.moveStack(i, targetedSlot, Integer.MAX_VALUE);\n }\n } catch (NullPointerException e) {\n }\n}\n"
"public static PieceType getBishopPieceType() {\n Map<Direction, Integer> movements = Maps.newHashMap();\n for (Direction direction : Direction.DIAGONAL_DIRECTIONS) {\n movements.put(direction, UNLIMITED);\n }\n return new PieceType(\"String_Node_Str\", movements, null);\n}\n"
"public void processRequests() {\n while (true) {\n WSJob<?> job = null;\n job = queue.dequeue();\n if (job == null) {\n break;\n }\n try {\n ArrayList<Object> input = new ArrayList<Object>();\n TaskParams taskParams = job.taskParams;\n ServiceImplementation service = (ServiceImplementation) job.impl;\n Parameter[] parameters = taskParams.getParameters();\n for (int i = 0; i < taskParams.getParameters().length; i++) {\n if (parameters[i].getDirection() == ParamDirection.IN) {\n switch(parameters[i].getType()) {\n case OBJECT_T:\n case SCO_T:\n case PSCO_T:\n DependencyParameter dp = (DependencyParameter) parameters[i];\n Object o = getObjectValue(dp);\n input.add(o);\n break;\n case FILE_T:\n break;\n default:\n BasicTypeParameter btParB = (BasicTypeParameter) parameters[i];\n input.add(btParB.getValue());\n }\n }\n }\n ServiceInstance si = (ServiceInstance) job.getResourceNode();\n String portName = service.getRequirements().getPort();\n String operationName = service.getOperation();\n if (operationName.compareTo(\"String_Node_Str\") == 0) {\n operationName = taskParams.getName();\n }\n Client client = getClient(si, portName);\n ClientCallback cb = new ClientCallback();\n client.invoke(cb, operationName, input.toArray());\n Object[] result = cb.get();\n if (result.length > 0) {\n job.returnValue = result[0];\n }\n job.listener.jobCompleted(job);\n } catch (Exception e) {\n job.listener.jobFailed(job, JobEndStatus.EXECUTION_FAILED);\n logger.error(SUBMIT_ERROR, e);\n return;\n }\n }\n}\n"
"protected boolean calculateEnabled() {\n RepositoryNode rootNode = ((ProjectRepositoryNode) ProjectRepositoryNode.getInstance()).getRootRepositoryNode(ERepositoryObjectType.METADATA);\n if (getSelectedObjects().isEmpty() || rootNode == null || rootNode.getChildren().size() == 0) {\n return false;\n } else {\n Object s = getSelectedObjects().get(0);\n if (s instanceof List && !((List) s).isEmpty()) {\n List selectedarts = (List) s;\n Object object = selectedarts.get(selectedarts.size() - 1);\n if (object instanceof TreeNodeEditPart) {\n TreeNodeEditPart parentPart = (TreeNodeEditPart) object;\n schemaNode = (TreeNode) parentPart.getModel();\n if (schemaNode.eContainer() instanceof AbstractInOutTree && XmlMapUtil.DOCUMENT.equals(schemaNode.getType())) {\n return true;\n }\n }\n }\n }\n return false;\n}\n"
"public void processCommand(ICommandSender commandSender, String[] args) {\n EntityPlayerMP entityPlayerMP = getCommandSenderAsPlayer(commandSender);\n if (entityPlayerMP != null) {\n StructureEntityInfo structureEntityInfo = StructureEntityInfo.getStructureEntityInfo(entityPlayerMP);\n if (structureEntityInfo != null) {\n if (args.length >= 1) {\n switch(args[0]) {\n case \"String_Node_Str\":\n structureEntityInfo.selectedPoint1 = null;\n structureEntityInfo.selectedPoint2 = null;\n structureEntityInfo.sendSelectionChangesToClients(entityPlayerMP);\n } else {\n throw new WrongUsageException(\"String_Node_Str\");\n }\n } else {\n throw new WrongUsageException(\"String_Node_Str\");\n }\n } else {\n throw new WrongUsageException(\"String_Node_Str\");\n }\n }\n } else {\n throw new WrongUsageException(\"String_Node_Str\");\n }\n}\n"
"private int calculateBranchNodePosition(BranchSummaryNode summaryNode) {\n boolean isIncomingNode = linearizedNodesToIncomingBranchSummaryNodesMap.get(summaryNode.getAssociatedLinearizedNode()) == summaryNode;\n ALinearizableNode linearizedNode = summaryNode.getAssociatedLinearizedNode();\n Vec3f linearizedNodePosition = linearizedNode.getPosition();\n float sideSpacing = pixelGLConverter.getGLHeightForPixelHeight(BRANCH_AREA_SIDE_SPACING_PIXELS);\n float branchSummaryNodeToLinearizedNodeDistance = pixelGLConverter.getGLHeightForPixelHeight(BRANCH_SUMMARY_NODE_TO_LINEARIZED_NODE_VERTICAL_DISTANCE_PIXELS);\n float width = summaryNode.getWidth();\n float titleAreaHeight = pixelGLConverter.getGLHeightForPixelHeight(summaryNode.getTitleAreaHeightPixels());\n float nodePositionY = linearizedNodePosition.y() + (isIncomingNode ? branchSummaryNodeToLinearizedNodeDistance : -branchSummaryNodeToLinearizedNodeDistance) - (summaryNode.getHeight() / 2.0f) + titleAreaHeight / 2.0f;\n summaryNode.setPosition(new Vec3f(sideSpacing + width / 2.0f, nodePositionY, (summaryNode.isCollapsed() ? 0 : 0.2f)));\n float bottomPositionY = nodePositionY - (summaryNode.getHeight() / 2.0f);\n int minViewHeightPixels = 0;\n minViewHeightPixels = pixelGLConverter.getPixelHeightForGLHeight(viewFrustum.getBottom() - bottomPositionY) + parentGLCanvas.getHeight();\n return minViewHeightPixels;\n}\n"
"private List<Map<String, Object>> executeMetricNamesQuery(String tenantId, Map<String, String> dimensions, String offset, int limit) {\n String offsetPart = \"String_Node_Str\";\n if (offset != null && !offset.isEmpty()) {\n sb.append(\"String_Node_Str\");\n }\n String sql = String.format(FIND_METRIC_NAMES_SQL, MetricQueries.buildJoinClauseFor(dimensions), sb);\n try (Handle h = db.open()) {\n Query<Map<String, Object>> query = h.createQuery(sql).bind(\"String_Node_Str\", tenantId).bind(\"String_Node_Str\", limit + 1);\n if (offset != null && !offset.isEmpty()) {\n logger.debug(\"String_Node_Str\", offset);\n try {\n query.bind(\"String_Node_Str\", Hex.decodeHex(offset.toCharArray()));\n } catch (DecoderException e) {\n throw Exceptions.badRequest(\"String_Node_Str\" + offset, e);\n }\n }\n DimensionQueries.bindDimensionsToQuery(query, dimensions);\n return query.list();\n }\n}\n"
"public boolean performFinish() {\n boolean res = super.performFinish();\n if (res) {\n IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(getModel().getArtifactId());\n IFolder folder = project.getFolder(yangPage.getRootDir());\n if (!folder.exists()) {\n try {\n folder.create(true, true, null);\n if (yangPage.createExampleFile()) {\n folder.getFile(\"String_Node_Str\").create(FileLocator.openStream(YangUIPlugin.getDefault().getBundle(), new Path(\"String_Node_Str\"), false), true, null);\n }\n } catch (CoreException | IOException e) {\n e.printStackTrace();\n return false;\n }\n }\n }\n return res;\n}\n"
"void addNumber(double x) {\n char prev = getLastChar();\n boolean negativeZero = isNegativeZero(x);\n if ((x < 0 || negativeZero) && prev == '-') {\n add(\"String_Node_Str\");\n }\n if (negativeZero) {\n addConstant(\"String_Node_Str\");\n } else if ((long) x == x) {\n long value = (long) x;\n long mantissa = value;\n int exp = 0;\n if (Math.abs(x) >= 100) {\n while (mantissa / 10 * ((long) Math.pow(10, exp + 1)) == value) {\n mantissa /= 10;\n exp++;\n }\n }\n if (exp > 2) {\n addConstant(Long.toString(mantissa) + \"String_Node_Str\" + Integer.toString(exp));\n } else {\n long valueAbs = Math.abs(value);\n if (valueAbs > 1000000000000L && Long.toHexString(valueAbs).length() + 2 < Long.toString(valueAbs).length()) {\n addConstant((value < 0 ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + Long.toHexString(valueAbs));\n } else {\n addConstant(Long.toString(value));\n }\n }\n } else {\n addConstant(String.valueOf(x).replace(\"String_Node_Str\", \"String_Node_Str\").replaceFirst(\"String_Node_Str\", \"String_Node_Str\"));\n }\n}\n"
"public Field deserialize(JsonElement element, Type type, JsonDeserializationContext gsonContext) throws JsonParseException {\n JsonObject jsonObject = element != null && !element.isJsonNull() ? element.getAsJsonObject() : null;\n JsonElement fieldType = jsonObject != null && !jsonObject.isJsonNull() ? jsonObject.get(\"String_Node_Str\") : null;\n String fieldTypeName = fieldType != null && !fieldType.isJsonNull() ? fieldType.getAsString() : Field.Type.undefined.name();\n Field.Type typeEnum;\n try {\n typeEnum = Field.Type.valueOf(fieldTypeName);\n } catch (IllegalArgumentException e) {\n typeEnum = Field.Type.undefined;\n }\n switch(typeEnum) {\n case app:\n return gsonContext.deserialize(element, ApplicationReference.class);\n case calculation:\n return gsonContext.deserialize(element, CalculationField.class);\n case category:\n return gsonContext.deserialize(element, Category.class);\n case contact:\n return gsonContext.deserialize(element, ContactField.class);\n case date:\n return gsonContext.deserialize(element, DateField.class);\n case duration:\n return gsonContext.deserialize(element, DurationField.class);\n case embed:\n return gsonContext.deserialize(element, EmbedField.class);\n case image:\n return gsonContext.deserialize(element, ImageField.class);\n case location:\n return gsonContext.deserialize(element, LocationField.class);\n case money:\n return gsonContext.deserialize(element, MoneyField.class);\n case number:\n return gsonContext.deserialize(element, NumberField.class);\n case progress:\n return gsonContext.deserialize(element, ProgressField.class);\n case text:\n return gsonContext.deserialize(element, Text.class);\n case title:\n return gsonContext.deserialize(element, TitleField.class);\n default:\n return gsonContext.deserialize(element, Text.class);\n }\n}\n"
"public void removeTrackings(Component comp) {\n final Map<Object, TrackerNode> nodesMap = (Map<Object, TrackerNode>) _compMap.remove(comp);\n if (nodesMap != null) {\n final Set<TrackerNode> removed = new LinkedHashSet<TrackerNode>();\n final Collection<TrackerNode> nodes = nodesMap.values();\n for (TrackerNode node : nodes) {\n removed.add(node);\n removed.addAll(node.getDependents());\n }\n removeAllFromBeanMap(removed);\n removeAllFromNullMap(removed);\n }\n}\n"
"public List<Compound> findCompounds() {\n TreeMap<String, Compound> chainIds2entities = findCompoundsFromAlignment();\n List<Compound> compounds = findUniqueCompounds(chainIds2entities);\n createPurelyNonPolyCompounds(compounds);\n return compounds;\n}\n"
"public void handleReceived(ClientConnection connection) {\n TridentPlayer player = ((PlayerConnection) connection).getPlayer();\n Coordinates from = player.getLocation();\n Coordinates to = player.getLocation();\n to.setYaw(this.newYaw);\n to.setPitch(this.newPitch);\n PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);\n TridentServer.getInstance().eventHandler().call(event);\n if (event.isIgnored()) {\n PacketPlayOutEntityTeleport cancel = new PacketPlayOutEntityTeleport();\n cancel.set(\"String_Node_Str\", player.getId()).set(\"String_Node_Str\", from).set(\"String_Node_Str\", player.isOnGround());\n TridentPlayer.sendAll(cancel);\n return;\n }\n player.setLocation(to);\n PacketPlayOutEntityLook headMove = new PacketPlayOutEntityLook();\n headMove.set(\"String_Node_Str\", player.getId()).set(\"String_Node_Str\", to).set(\"String_Node_Str\", player.isOnGround());\n TridentPlayer.sendAll(headMove);\n}\n"
"private Resource saveScreenshots(Item item) {\n Resource itemResource = xmiResourceManager.getScreenshotResource(item, true, true);\n EMap screenshots = null;\n if (item instanceof ProcessItem) {\n screenshots = ((ProcessItem) item).getProcess().getScreenshots();\n } else if (item instanceof JobletProcessItem) {\n screenshots = ((JobletProcessItem) item).getJobletProcess().getScreenshots();\n }\n if (screenshots != null && !screenshots.isEmpty()) {\n itemResource.getContents().clear();\n itemResource.getContents().addAll(EcoreUtil.copyAll(screenshots));\n }\n return itemResource;\n}\n"
"public Control createContents(Composite parent) {\n initPropertyBinding();\n int size = bindingName.size();\n Composite composite = new Composite(parent, SWT.NONE);\n composite.setLayout(new GridLayout(3, false));\n GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);\n composite.setLayoutData(gridData);\n Label nameLabel;\n Text propertyText = null;\n for (int i = 0; i < size; i++) {\n nameLabel = new Label(composite, SWT.NONE);\n nameLabel.setText((String) displayName.get(i) + \"String_Node_Str\");\n nameLabelList.add(nameLabel);\n GridData data = new GridData(GridData.FILL_HORIZONTAL);\n if (((String) bindingName.get(i)).equals(QUERYTEXT)) {\n propertyText = new Text(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);\n data.heightHint = 100;\n } else if (((String) bindingName.get(i)).equals(PASSWORD)) {\n propertyText = new Text(composite, SWT.BORDER);\n if (ds instanceof DesignElementHandle) {\n Expression expr = ((DesignElementHandle) ds).getPropertyBindingExpression((String) bindingName.get(i));\n if (expr != null && ExpressionType.CONSTANT.equals(expr.getType())) {\n Text dummy = new Text(composite, SWT.BORDER | SWT.PASSWORD);\n propertyText.setEchoChar(dummy.getEchoChar());\n dummy.dispose();\n }\n }\n } else\n propertyText = new Text(composite, SWT.BORDER);\n propertyText.setLayoutData(data);\n propertyText.setText((String) bindingValue.get(i) == null ? \"String_Node_Str\" : (String) bindingValue.get(i));\n propertyTextList.add(propertyText);\n if (ds instanceof OdaDataSourceHandle) {\n handle = (OdaDataSourceHandle) ds;\n OdaDataSourceHandle odsh = (OdaDataSourceHandle) ds;\n Utility.setSystemHelp(composite, IHelpConstants.PREFIX + \"String_Node_Str\" + \"String_Node_Str\" + odsh.getExtensionID().replace('.', '_') + \"String_Node_Str\" + \"String_Node_Str\");\n } else if (ds instanceof OdaDataSetHandle) {\n handle = (OdaDataSetHandle) ds;\n OdaDataSourceHandle odsh = (OdaDataSourceHandle) (((OdaDataSetHandle) ds).getDataSource());\n Utility.setSystemHelp(composite, IHelpConstants.PREFIX + \"String_Node_Str\" + \"String_Node_Str\" + odsh.getExtensionID().replace('.', '_') + \"String_Node_Str\" + \"String_Node_Str\");\n }\n createExpressionButton(composite, propertyText, (String) bindingName.get(i));\n }\n if (size <= 0)\n setEmptyPropertyMessages(composite);\n return composite;\n}\n"
"public void assignWeight(Expression measurementEquation, String[] _stateVariables) throws IllegalActionException, NameDuplicationException {\n Token _result;\n Token _particleCovariance;\n Parameter p;\n if (this.getSize() != _stateVariables.length) {\n throw new IllegalActionException(\"String_Node_Str\");\n } else {\n for (int i = 0; i < _stateVariables.length; i++) {\n if ((ParticleFilter.this).getAttribute(_stateVariables[i]) == null) {\n p = new Parameter(ParticleFilter.this, _stateVariables[i]);\n } else {\n p = (Parameter) (ParticleFilter.this).getAttribute(_stateVariables[i]);\n }\n p.setExpression(_particleValue.get(i).toString());\n _tokenMap.put(_stateVariables[i], new DoubleToken(_particleValue.get(i).doubleValue()));\n }\n try {\n PtParser parser = new PtParser();\n _parseTree = parser.generateParseTree(measurementEquation.expression.getExpression());\n _result = _parseTreeEvaluator.evaluateParseTree(_parseTree, _scope);\n _parseTree = parser.generateParseTree(_measurementCovariance.expression.getExpression());\n _particleCovariance = _parseTreeEvaluator.evaluateParseTree(_parseTree, _scope);\n } catch (Throwable throwable) {\n throw new IllegalActionException(\"String_Node_Str\");\n }\n if (_result == null) {\n throw new IllegalActionException(\"String_Node_Str\" + measurementEquation.expression.getExpression());\n }\n Type t = _measurementEquation.output.getType();\n if (t.equals(BaseType.DOUBLE)) {\n double _meanEstimate = ((DoubleToken) _result).doubleValue();\n double z_t = ((DoubleToken) _measurementValues.get(_measurementVariable)).doubleValue();\n _weight = 1 / (Math.pow(2 * Math.PI, 0.5) * DoubleMatrixMath.determinant(_Sigma)) * Math.exp(-Math.pow(z_t - _meanEstimate, 2) / (2 * Math.pow(_Sigma[0][0], 2)));\n } else {\n MatrixToken z_t = (MatrixToken) _measurementValues.get(_measurementVariable);\n int k = z_t.getRowCount();\n MatrixToken X = (DoubleMatrixToken) z_t.subtract((Token) _result);\n MatrixToken Covariance = (DoubleMatrixToken) _particleCovariance;\n MatrixToken Xt = new DoubleMatrixToken(DoubleMatrixMath.transpose(X.doubleMatrix()));\n double multiplier = Math.pow(2 * Math.PI, -0.5 * k) * Math.pow(DoubleMatrixMath.determinant(Covariance.doubleMatrix()), -0.5);\n Token exponent = Xt.multiply(Covariance);\n exponent = exponent.multiply(X);\n double value = ((DoubleMatrixToken) exponent).getElementAt(0, 0);\n _weight = multiplier * Math.exp(-0.5 * value);\n }\n }\n}\n"
"public Query getQueryImplementation(String jpaQuery, PersistenceDelegator persistenceDelegator) {\n if (jpaQuery == null) {\n throw new QueryHandlerException(\"String_Node_Str\");\n }\n KunderaQuery kunderaQuery = new KunderaQuery();\n ApplicationMetadata appMetadata = KunderaMetadata.INSTANCE.getApplicationMetadata();\n String mappedQuery = appMetadata.getQuery(jpaQuery);\n boolean isNative = appMetadata.isNative(jpaQuery);\n EntityMetadata m = null;\n if (!isNative) {\n KunderaQueryParser parser = new KunderaQueryParser(kunderaQuery, mappedQuery != null ? mappedQuery : jpaQuery);\n parser.parse();\n kunderaQuery.postParsingInit();\n m = kunderaQuery.getEntityMetadata();\n } else {\n Class mappedClass = appMetadata.getMappedClass(jpaQuery);\n m = KunderaMetadataManager.getEntityMetadata(mappedClass);\n }\n Query query = null;\n try {\n query = getQuery(jpaQuery, persistenceDelegator, m);\n } catch (Exception e) {\n log.error(e.getMessage());\n throw new QueryHandlerException(e);\n }\n return query;\n}\n"
"public void onSelection(SelectionEvent<Integer> event) {\n String newHistoryToken;\n switch(event.getSelectedItem()) {\n case 0:\n newHistoryToken = \"String_Node_Str\";\n break;\n case 1:\n default:\n newHistoryToken = RESOLVER.getHistoryPath() + \"String_Node_Str\";\n break;\n }\n if (!History.getToken().equals(newHistoryToken)) {\n History.newItem(newHistoryToken);\n }\n}\n"
"public boolean findExistLanguageByName(String languageName) {\n Search search = new Search();\n search.addFilterEqual(\"String_Node_Str\", languageName);\n LanguagePo languagePo = languageDao.searchUnique(search);\n LanguageBo languageBo = modelMapper.map(languagePo, LanguageBo.class);\n return languageBo;\n}\n"
"public void schedule() {\n if (myPet.getStatus() == MyPet.PetState.Here && isActive() && active && selectedBuffs.size() != 0 && --beaconTimer <= 0) {\n beaconTimer = 2;\n double range = this.range * myPet.getHungerValue() / 100.;\n if (range < 0.7) {\n active = false;\n selectedBuffs.clear();\n }\n if (selectedBuffs.size() > selectableBuffs) {\n int usableBuff = 0;\n for (int buff : selectedBuffs) {\n if (buffLevel.get(buff) > 0) {\n usableBuff = buff;\n }\n }\n selectedBuffs.clear();\n if (usableBuff != 0) {\n selectedBuffs.add(usableBuff);\n }\n }\n if (selectedBuffs.size() == 0) {\n return;\n }\n BukkitUtil.playParticleEffect(myPet.getLocation().add(0, 1, 0), EnumParticle.SPELL_WITCH, 0.2F, 0.2F, 0.2F, 0.1F, 5, 20);\n List<Player> members = null;\n if (PARTY_SUPPORT && reciever == BeaconReciever.Party) {\n members = PartyManager.getPartyMembers(getMyPet().getOwner().getPlayer());\n }\n targetLoop: for (Object entityObj : this.myPet.getCraftPet().getHandle().world.a(EntityHuman.class, myPet.getCraftPet().getHandle().getBoundingBox().grow(range, range, range))) {\n EntityHuman entityHuman = (EntityHuman) entityObj;\n if (!entityHuman.getBukkitEntity().equals(Bukkit.getPlayer(entityHuman.getName()))) {\n continue;\n }\n int amplification;\n switch(reciever) {\n case Owner:\n if (!myPet.getOwner().equals(entityHuman)) {\n continue targetLoop;\n } else {\n for (int buff : selectedBuffs) {\n amplification = buffLevel.get(buff) - 1;\n entityHuman.addEffect(new MobEffect(buff, duration * 20, amplification, true, false));\n }\n BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0, 1, 0), EnumParticle.SPELL_INSTANT, 0.2F, 0.2F, 0.2F, 0.1F, 5, 20);\n break targetLoop;\n }\n case Everyone:\n for (int buff : selectedBuffs) {\n amplification = buffLevel.get(buff) - 1;\n if (entityHuman.hasEffect(buff)) {\n MobEffect effect = entityHuman.getEffect(buffEffectLists.get(buff));\n effect.a(new MobEffect(buff, duration * 20, amplification, true, false));\n entityHuman.updateEffects = true;\n } else {\n entityHuman.addEffect(new MobEffect(buff, duration * 20, amplification, true, false));\n }\n }\n BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0, 1, 0), EnumParticle.SPELL_INSTANT, 0.2F, 0.2F, 0.2F, 0.1F, 5, 20);\n break;\n case Party:\n if (PARTY_SUPPORT && members != null) {\n if (entityHuman.getBukkitEntity() instanceof Player && members.contains(entityHuman.getBukkitEntity())) {\n for (int buff : selectedBuffs) {\n amplification = buffLevel.get(buff) - 1;\n if (entityHuman.hasEffect(buff)) {\n MobEffect effect = entityHuman.getEffect(buffEffectLists.get(buff));\n effect.a(new MobEffect(buff, duration * 20, amplification, true, false));\n entityHuman.updateEffects = true;\n } else {\n entityHuman.addEffect(new MobEffect(buff, duration * 20, amplification, true, false));\n }\n }\n BukkitUtil.playParticleEffect(entityHuman.getBukkitEntity().getLocation().add(0, 1, 0), EnumParticle.SPELL_INSTANT, 0.2F, 0.2F, 0.2F, 0.1F, 5, 20);\n }\n break;\n } else {\n reciever = BeaconReciever.Owner;\n break targetLoop;\n }\n }\n }\n if (HUNGER_DECREASE_TIME > 0 && hungerDecreaseTimer-- < 0) {\n myPet.setHungerValue(myPet.getHungerValue() - 1);\n hungerDecreaseTimer = HUNGER_DECREASE_TIME;\n }\n }\n}\n"
"public void trim(final int depth) {\n if (depth < 0) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n final MutableThreadContextStack values = stack.get();\n if (values == null) {\n return;\n }\n final List<String> copy = new ArrayList<String>();\n final int count = Math.min(depth, list.size());\n for (int i = 0; i < count; i++) {\n copy.add(list.get(i));\n }\n stack.set(copy);\n}\n"
"private boolean handleContextItemSelected(MenuItem item, int position) {\n ContextMenuInfo menuInfo = item.getMenuInfo();\n int startPosition;\n int groupPosition;\n List<String> medias;\n int id = item.getItemId();\n boolean useAllItems = id == R.id.audio_list_browser_play_all;\n boolean append = id == R.id.audio_list_browser_append;\n if (ExpandableListContextMenuInfo.class.isInstance(menuInfo)) {\n ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;\n groupPosition = ExpandableListView.getPackedPositionGroup(info.packedPosition);\n } else\n groupPosition = position;\n if (id == R.id.audio_list_browser_delete) {\n AlertDialog alertDialog = CommonDialogs.deleteMedia(getActivity(), mSongsAdapter.getLocations(groupPosition).get(0), new VlcRunnable(mSongsAdapter.getItem(groupPosition)) {\n public void run(Object o) {\n AudioBrowserListAdapter.ListItem listItem = (AudioBrowserListAdapter.ListItem) o;\n Media media = listItem.mMediaList.get(0);\n mMediaLibrary.getMediaItems().remove(media);\n mAudioController.removeLocation(media.getLocation());\n updateLists();\n }\n });\n alertDialog.show();\n return true;\n }\n if (id == R.id.audio_list_browser_set_song) {\n AudioUtil.setRingtone(mSongsAdapter.getItem(groupPosition).mMediaList.get(0), getActivity());\n return true;\n }\n if (useAllItems) {\n medias = new ArrayList<String>();\n startPosition = mSongsAdapter.getListWithPosition(medias, groupPosition);\n } else {\n startPosition = 0;\n switch(mFlingViewGroup.getPosition()) {\n case MODE_SONG:\n medias = mSongsAdapter.getLocations(groupPosition);\n break;\n case MODE_ARTIST:\n medias = mArtistsAdapter.getLocations(groupPosition);\n break;\n case MODE_ALBUM:\n medias = mAlbumsAdapter.getLocations(groupPosition);\n break;\n case MODE_GENRE:\n medias = mGenresAdapter.getLocations(groupPosition);\n break;\n default:\n return true;\n }\n }\n if (append)\n mAudioController.append(medias);\n else\n mAudioController.load(medias, startPosition);\n return super.onContextItemSelected(item);\n}\n"
"protected void updateRtLFlag() throws EngineException {\n if (renderOptions == null)\n return;\n IReportRunnable runnable = executionContext.getRunnable();\n if (runnable == null)\n return;\n ReportDesignHandle handle = (ReportDesignHandle) runnable.getDesignHandle();\n if (handle != null) {\n Object bidiFlag = renderOptions.getOption(IRenderOption.RTL_FLAG);\n if (Boolean.TRUE.equals(bidiFlag)) {\n String bidiOrientation = DesignChoiceConstants.BIDI_DIRECTION_RTL;\n try {\n handle.setBidiOrientation(bidiOrientation);\n Report report = executionContext.getReport();\n AbstractStyle rootStyle = (AbstractStyle) report.getStyles().get(report.getRootStyleName());\n if (rootStyle != null) {\n rootStyle.setDirection(bidiOrientation);\n }\n } catch (SemanticException e) {\n log.log(Level.WARNING, \"String_Node_Str\", e);\n throw new EngineException(\"String_Node_Str\");\n }\n } else if (handle.isDirectionRTL()) {\n renderOptions.setOption(IRenderOption.RTL_FLAG, new Boolean(true));\n IRenderOption renderOptions2 = executionContext.getRenderOption();\n if (renderOptions2 != null) {\n renderOptions2.setOption(IRenderOption.RTL_FLAG, new Boolean(true));\n executionContext.setRenderOption(renderOptions2);\n }\n }\n }\n}\n"
"public static void execute(Configuration jooqConf, CollectionSchema colSchema) {\n ConnectionProvider provider = jooqConf.connectionProvider();\n Connection connection = provider.acquire();\n Statement st = null;\n try {\n st = connection.createStatement();\n st.executeUpdate(\"String_Node_Str\" + colSchema.getName() + \"String_Node_Str\");\n } catch (SQLException ex) {\n throw new ToroImplementationException(ex);\n } finally {\n AutoCloser.close(st);\n }\n Table<Record> rootTable = DSL.tableByName(colSchema.getName(), \"String_Node_Str\");\n deleteAll(dsl, rootTable);\n}\n"
"public void tearDown() {\n super.tearDown();\n backend.shutdown();\n localServer.stop(Integer.MAX_VALUE);\n}\n"
"private Map<String, Object> parseMetadataAndClose(final Element parent, final String name, final IdentifiedObject fallback) throws ParseException {\n properties.clear();\n properties.put(IdentifiedObject.NAME_KEY, (name.isEmpty() && fallback != null) ? fallback.getName() : name);\n Element element;\n while ((element = parent.pullElement(OPTIONAL, ID_KEYWORDS)) != null) {\n final String codeSpace = element.pullString(\"String_Node_Str\");\n final String code = element.pullObject(\"String_Node_Str\").toString();\n final Object version = element.pullOptional(Object.class);\n final Element citation = element.pullElement(OPTIONAL, WKTKeywords.Citation);\n final String authority;\n if (citation != null) {\n authority = citation.pullString(\"String_Node_Str\");\n citation.close(ignoredElements);\n } else {\n authority = codeSpace;\n }\n final Element uri = element.pullElement(OPTIONAL, WKTKeywords.URI);\n if (uri != null) {\n uri.pullString(\"String_Node_Str\");\n uri.close(ignoredElements);\n }\n element.close(ignoredElements);\n final ImmutableIdentifier id = new ImmutableIdentifier(Citations.fromName(authority), codeSpace, code, (version != null) ? version.toString() : null, null);\n final Object previous = properties.put(IdentifiedObject.IDENTIFIERS_KEY, id);\n if (previous != null) {\n Identifier[] identifiers;\n if (previous instanceof Identifier) {\n identifiers = new Identifier[] { (Identifier) previous, id };\n } else {\n identifiers = (Identifier[]) previous;\n final int n = identifiers.length;\n identifiers = Arrays.copyOf(identifiers, n + 1);\n identifiers[n] = id;\n }\n properties.put(IdentifiedObject.IDENTIFIERS_KEY, identifiers);\n }\n }\n if (!parent.isEmpty()) {\n element = parent.pullElement(OPTIONAL, WKTKeywords.Scope);\n if (element != null) {\n properties.put(ReferenceSystem.SCOPE_KEY, element.pullString(\"String_Node_Str\"));\n element.close(ignoredElements);\n }\n DefaultExtent extent = null;\n while ((element = parent.pullElement(OPTIONAL, WKTKeywords.Area)) != null) {\n final String area = element.pullString(\"String_Node_Str\");\n element.close(ignoredElements);\n if (extent == null) {\n extent = new DefaultExtent(area, null, null, null);\n } else {\n extent.getGeographicElements().add(new DefaultGeographicDescription(area));\n }\n }\n while ((element = parent.pullElement(OPTIONAL, WKTKeywords.BBox)) != null) {\n final double southBoundLatitude = element.pullDouble(\"String_Node_Str\");\n final double westBoundLongitude = element.pullDouble(\"String_Node_Str\");\n final double northBoundLatitude = element.pullDouble(\"String_Node_Str\");\n final double eastBoundLongitude = element.pullDouble(\"String_Node_Str\");\n element.close(ignoredElements);\n if (extent == null)\n extent = new DefaultExtent();\n extent.getGeographicElements().add(new DefaultGeographicBoundingBox(westBoundLongitude, eastBoundLongitude, southBoundLatitude, northBoundLatitude));\n }\n while ((element = parent.pullElement(OPTIONAL, WKTKeywords.VerticalExtent)) != null) {\n final double minimum = element.pullDouble(\"String_Node_Str\");\n final double maximum = element.pullDouble(\"String_Node_Str\");\n Unit<Length> unit = parseScaledUnit(element, WKTKeywords.LengthUnit, SI.METRE);\n element.close(ignoredElements);\n if (unit == null)\n unit = SI.METRE;\n if (extent == null)\n extent = new DefaultExtent();\n verticalElements = new VerticalInfo(verticalElements, extent, minimum, maximum, unit).resolve(verticalCRS);\n }\n while ((element = parent.pullElement(OPTIONAL, WKTKeywords.TimeExtent)) != null) {\n if (element.peekValue() instanceof String) {\n element.pullString(\"String_Node_Str\");\n element.pullString(\"String_Node_Str\");\n element.close(ignoredElements);\n warning(Errors.formatInternational(Errors.Keys.UnsupportedType_1, \"String_Node_Str\"), null);\n } else {\n final Date startTime = element.pullDate(\"String_Node_Str\");\n final Date endTime = element.pullDate(\"String_Node_Str\");\n element.close(ignoredElements);\n try {\n final DefaultTemporalExtent t = new DefaultTemporalExtent();\n t.setBounds(startTime, endTime);\n if (extent == null)\n extent = new DefaultExtent();\n extent.getTemporalElements().add(t);\n } catch (UnsupportedOperationException e) {\n warning(parent, element, e);\n }\n }\n }\n element = parent.pullElement(OPTIONAL, WKTKeywords.Remark);\n if (element != null) {\n properties.put(IdentifiedObject.REMARKS_KEY, element.pullString(\"String_Node_Str\"));\n element.close(ignoredElements);\n }\n }\n parent.close(ignoredElements);\n return properties;\n}\n"
"public String getNamedExpression(String name) {\n UserPropertyDefnHandle propDefn = handle.getUserPropertyDefnHandle(name);\n Object userProp = getUserProperty(name);\n if (propDefn == null || userProp == null || propDefn.getType() != IPropertyType.EXPRESSION_TYPE)\n return null;\n return propDefn.getDefn().getDefault().toString();\n}\n"
"protected void onDetachedFromWindow() {\n super.onDetachedFromWindow();\n if (!isInEditMode()) {\n Config config = Config.getInstance();\n config.unregisterListener(this);\n }\n}\n"
"public <E> List<E> findByRange(Class<E> entityClass, EntityMetadata metadata, byte[] startRow, byte[] endRow, String[] columns) {\n EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(entityClass);\n String tableName = entityMetadata.getTableName();\n List results = new ArrayList();\n if (isFindKeyOnly(metadata, columns)) {\n columns = null;\n filter.addFilter(new KeyOnlyFilter());\n }\n try {\n results = handler.readDataByRange(tableName, entityClass, metadata, startRow, endRow, columns);\n } catch (IOException ioex) {\n log.error(\"String_Node_Str\", ioex);\n throw new KunderaException(ioex);\n }\n return results;\n}\n"
"private void init(ClientHandler root, ClientConfig config, IoCComponentProviderFactory provider) {\n this.es = new LazyVal<ExecutorService>() {\n protected ExecutorService instance() {\n return Executors.newCachedThreadPool();\n }\n };\n Class<?>[] components = ServiceFinder.find(\"String_Node_Str\").toClassArray();\n if (components.length > 0) {\n if (LOGGER.isLoggable(Level.INFO)) {\n StringBuilder b = new StringBuilder();\n b.append(\"String_Node_Str\");\n for (Class c : components) b.append('\\n').append(\"String_Node_Str\").append(c);\n LOGGER.log(Level.INFO, b.toString());\n }\n config = new ComponentsClientConfig(config, components);\n }\n final InjectableProviderFactory injectableFactory = new InjectableProviderFactory();\n getProperties().putAll(config.getProperties());\n if (provider != null) {\n if (provider instanceof IoCComponentProcessorFactoryInitializer) {\n IoCComponentProcessorFactoryInitializer i = (IoCComponentProcessorFactoryInitializer) provider;\n i.init(new ComponentProcessorFactoryImpl(injectableFactory));\n }\n }\n this.componentProviderFactory = (provider == null) ? new ProviderFactory(injectableFactory) : new IoCProviderFactory(injectableFactory, provider);\n ProviderServices providerServices = new ProviderServices(ClientSide.class, this.componentProviderFactory, config.getClasses(), config.getSingletons());\n vpps = providerServices.getServices(ViewProxyProvider.class);\n injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(FeaturesAndProperties.class, config));\n injectableFactory.add(new ContextInjectableProvider<ClientConfig>(ClientConfig.class, config));\n injectableFactory.add(new ContextInjectableProvider<Client>(Client.class, this));\n injectableFactory.configure(providerServices);\n final ContextResolverFactory crf = new ContextResolverFactory();\n final MessageBodyFactory bodyContext = new MessageBodyFactory(providerServices, config.getFeature(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE));\n injectableFactory.add(new ContextInjectableProvider<MessageBodyWorkers>(MessageBodyWorkers.class, bodyContext));\n this.providers = new Providers() {\n public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> c, Type t, Annotation[] as, MediaType m) {\n return bodyContext.getMessageBodyReader(c, t, as, m);\n }\n public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> c, Type t, Annotation[] as, MediaType m) {\n return bodyContext.getMessageBodyWriter(c, t, as, m);\n }\n public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> c) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n public <T> ContextResolver<T> getContextResolver(Class<T> ct, MediaType m) {\n return crf.resolve(ct, m);\n }\n };\n injectableFactory.add(new ContextInjectableProvider<Providers>(Providers.class, this.providers));\n injectableFactory.add(new InjectableProvider<Context, Type>() {\n public ComponentScope getScope() {\n return ComponentScope.Singleton;\n }\n public Injectable<Injectable> getInjectable(ComponentContext ic, Context a, Type c) {\n if (c instanceof ParameterizedType) {\n ParameterizedType pt = (ParameterizedType) c;\n if (pt.getRawType() == Injectable.class) {\n if (pt.getActualTypeArguments().length == 1) {\n final Injectable<?> i = injectableFactory.getInjectable(a.annotationType(), ic, a, pt.getActualTypeArguments()[0], ComponentScope.PERREQUEST_UNDEFINED_SINGLETON);\n if (i == null)\n return null;\n return new Injectable<Injectable>() {\n public Injectable getValue() {\n return i;\n }\n };\n }\n }\n }\n return null;\n }\n });\n crf.init(providerServices, injectableFactory);\n bodyContext.init();\n Errors.setReportMissingDependentFieldOrMethod(true);\n componentProviderFactory.injectOnAllComponents();\n componentProviderFactory.injectOnProviderInstances(config.getSingletons());\n componentProviderFactory.injectOnProviderInstance(root);\n}\n"
"public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {\n members.add(MemberInfo.create(name, desc));\n return null;\n}\n"
"public void activate(final ComponentContext context) throws Exception {\n final boolean lazyStart = org.eclipse.flux.core.Activator.getDefault().isLazyStart();\n final IMessagingConnector messagingConnector = org.eclipse.flux.core.Activator.getDefault().getMessagingConnector();\n new Thread() {\n public void run() {\n String userChannel = messagingConnector.getChannel();\n JdtChannelListener jdtChannelListener = new JdtChannelListener();\n for (; userChannel == null; userChannel = messagingConnector.getChannel()) {\n try {\n sleep(WAIT_TIME_PERIOD);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }.start();\n }\n}\n"
"boolean allGreater(String[] list1, String[] list2){\n\tif (list1.length != list2.length)\n\t\treturn false;\n\tif (list1.length == 0 || list2.length == 0)\n\t\treturn false;\n\tfor (int i = 0; i < list1.length; i++){\n\t\tif (list1[i] == null || list2[i] == null){\n\t\t\tcontinue;\n\t\t}\n\t\tif (list1[i] <= list2[i]){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n"
"public Adapter createStoragePathAdapter(String path, boolean isLocal) {\n IFileRevision findFileRevision = findFileRevision((ITypedElement) accessor);\n IFile file = findFile((ITypedElement) accessor);\n boolean local = file != null;\n if (!isLocal && findFileRevision != null) {\n return new StoragePathAdapter(path, local, findFileRevision.getContentIdentifier(), findFileRevision.getAuthor());\n } else {\n return new StoragePathAdapter(path, isLocal);\n }\n}\n"
"public <K, V, C extends Configuration<K, V>> ICache<K, V> createCache(String cacheName, C configuration) throws IllegalArgumentException {\n checkIfManagerNotClosed();\n checkNotNull(cacheName, \"String_Node_Str\");\n checkNotNull(configuration, \"String_Node_Str\");\n final CacheConfig<K, V> newCacheConfig = createCacheConfig(cacheName, configuration);\n if (caches.containsKey(newCacheConfig.getNameWithPrefix())) {\n throw new CacheException(\"String_Node_Str\" + cacheName + \"String_Node_Str\");\n }\n final ICache<K, V> cacheProxy = createCacheProxy(newCacheConfig);\n CacheConfig<K, V> current = createConfigOnPartition(newCacheConfig);\n if (current == null) {\n addCacheConfigIfAbsent(newCacheConfig);\n caches.put(newCacheConfig.getNameWithPrefix(), cacheProxy);\n registerListeners(newCacheConfig, cacheProxy);\n return cacheProxy;\n }\n ICache<?, ?> cache = getOrPutIfAbsent(current.getNameWithPrefix(), cacheProxy);\n CacheConfig config = cache.getConfiguration(CacheConfig.class);\n if (config.equals(newCacheConfig)) {\n return (ICache<K, V>) cache;\n }\n throw new CacheException(\"String_Node_Str\" + cacheName + \"String_Node_Str\");\n}\n"
"public static <T> List<T> sortPageAll2(int pageNo, int numPerPage, Comparator<T> comparator, Collection<T>... colls) {\n BoundedPriorityQueue<T> queue = new BoundedPriorityQueue<>(pageNo * numPerPage, comparator);\n for (Collection<T> coll : colls) {\n queue.addAll(coll);\n }\n int resultSize = queue.size();\n if (resultSize <= numPerPage) {\n return queue.toList();\n }\n final int[] startEnd = PageUtil.transToStartEnd(pageNo, numPerPage);\n if (startEnd[1] > resultSize) {\n return new ArrayList<>();\n }\n return queue.toList().subList(startEnd[0], startEnd[1]);\n}\n"
"private boolean areaSizeOk(Player player) {\n return (Math.abs(player.areastart.x() - player.areaend.x()) < 50) && (Math.abs(player.areastart.z() - player.areaend.z()) < 50) && player.areaend.dimension() == player.areastart.dimension();\n}\n"
"public void paintControl(PaintEvent pe) {\n if (idr != null && fdCurrent != null && bUseSize) {\n idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, pe.gc);\n TextRenderEvent tre = new TextRenderEvent(this);\n tre.setAction(TextRenderEvent.RENDER_TEXT_IN_BLOCK);\n TextAlignment ta = TextAlignmentImpl.create();\n if (fdCurrent != null) {\n ta.setHorizontalAlignment(ChartUIUtil.getFontTextAlignment(fdCurrent).getHorizontalAlignment());\n ta.setVerticalAlignment(ChartUIUtil.getFontTextAlignment(fdCurrent).getVerticalAlignment());\n } else {\n ta.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL);\n ta.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);\n }\n tre.setBlockAlignment(ta);\n Bounds bo = BoundsImpl.create(0, 0, this.getSize().x - 3, this.getSize().y - 3);\n tre.setBlockBounds(bo);\n String fontName = ChartUIUtil.getFontName(fdCurrent);\n Text tx = TextImpl.create(fontName);\n FontDefinition fd = fdCurrent.copyInstance();\n fd.setName(fontName);\n if (!fd.isSetSize()) {\n fd.setSize(9);\n }\n tx.setFont(fd);\n ColorDefinition cdFore, cdBack;\n if (!this.isEnabled()) {\n Color cFore = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);\n Color cBack = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);\n cdFore = ColorDefinitionImpl.create(cFore.getRed(), cFore.getGreen(), cFore.getBlue());\n cdBack = ColorDefinitionImpl.create(cBack.getRed(), cBack.getGreen(), cBack.getBlue());\n } else {\n Color cBack = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND);\n cdBack = ColorDefinitionImpl.create(cBack.getRed(), cBack.getGreen(), cBack.getBlue());\n if (cdCurrent != null && bUseColor) {\n cdFore = cdCurrent.copyInstance();\n } else {\n Color cFore = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);\n cdFore = ColorDefinitionImpl.create(cFore.getRed(), cFore.getGreen(), cFore.getBlue());\n }\n }\n tx.setColor(cdFore);\n Label lb = LabelImpl.create();\n lb.setBackground(cdBack);\n lb.setCaption(tx);\n tre.setLabel(lb);\n RectangleRenderEvent rre = new RectangleRenderEvent(this);\n rre.setBounds(bo);\n rre.setBackground(cdBack);\n try {\n idr.fillRectangle(rre);\n idr.drawText(tre);\n } catch (ChartException e) {\n }\n return;\n }\n Font fSize = null;\n Font fCurrent = null;\n Color cFore = null;\n Color cBack = null;\n GC gc = pe.gc;\n gc.setAdvanced(true);\n Font fOld = gc.getFont();\n if (!this.isEnabled()) {\n cFore = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);\n cBack = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);\n } else {\n cBack = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND);\n if (cdCurrent != null && bUseColor && cdCurrent.getTransparency() > 0) {\n cFore = new Color(this.getDisplay(), cdCurrent.getRed(), cdCurrent.getGreen(), cdCurrent.getBlue());\n } else {\n cFore = new Color(this.getDisplay(), 0, 0, 0);\n }\n }\n gc.setForeground(cFore);\n gc.setBackground(cBack);\n gc.fillRectangle(0, 0, this.getSize().x, this.getSize().y);\n if (fdCurrent != null) {\n int iStyle = (fdCurrent.isSetBold() && fdCurrent.isBold()) ? SWT.BOLD : SWT.NORMAL;\n iStyle |= (fdCurrent.isSetItalic() && fdCurrent.isItalic()) ? SWT.ITALIC : iStyle;\n String sFontName = ChartUIUtil.getFontName(fdCurrent);\n if (!bUseSize) {\n gc.setClipping(2, 2, this.getSize().x - 40, 26);\n fCurrent = new Font(this.getDisplay(), ChartUIUtil.getFontName(fdCurrent), fOld.getFontData()[0].getHeight(), iStyle);\n } else {\n fCurrent = new Font(this.getDisplay(), ChartUIUtil.getFontName(fdCurrent), fdCurrent.isSetSize() ? (int) fdCurrent.getSize() : 9, iStyle);\n }\n gc.setFont(fCurrent);\n int iStartX = 5;\n int iStartY = 3;\n if (bUseAlignment) {\n if (ChartUIUtil.getFontTextAlignment(fdCurrent).getHorizontalAlignment().equals(HorizontalAlignment.LEFT_LITERAL)) {\n iStartX = 5;\n } else if (ChartUIUtil.getFontTextAlignment(fdCurrent).getHorizontalAlignment().equals(HorizontalAlignment.CENTER_LITERAL)) {\n iStartX = this.getSize().x / 2 - (getStringWidth(gc, sFontName).x / 2);\n } else if (ChartUIUtil.getFontTextAlignment(fdCurrent).getHorizontalAlignment().equals(HorizontalAlignment.RIGHT_LITERAL)) {\n iStartX = this.getSize().x - getStringWidth(gc, sFontName).x - 5;\n }\n if (ChartUIUtil.getFontTextAlignment(fdCurrent).getVerticalAlignment().equals(VerticalAlignment.TOP_LITERAL)) {\n iStartY = 3;\n } else if (ChartUIUtil.getFontTextAlignment(fdCurrent).getVerticalAlignment().equals(VerticalAlignment.CENTER_LITERAL)) {\n iStartY = (this.getSize().y / 2);\n if (bUseSize) {\n iStartY -= (getStringWidth(gc, sFontName).y / 2);\n } else {\n iStartY -= 15;\n }\n } else if (ChartUIUtil.getFontTextAlignment(fdCurrent).getVerticalAlignment().equals(VerticalAlignment.BOTTOM_LITERAL)) {\n iStartY = this.getSize().y;\n if (bUseSize) {\n iStartY -= (getStringWidth(gc, sFontName).y) + 5;\n } else {\n iStartY -= 30;\n }\n }\n }\n gc.drawText(sFontName, iStartX, iStartY);\n if (fdCurrent.isUnderline()) {\n gc.drawLine(iStartX, iStartY + getStringWidth(gc, sFontName).y - gc.getFontMetrics().getDescent(), iStartX + getStringWidth(gc, sFontName).x - gc.getFontMetrics().getDescent(), iStartY + getStringWidth(gc, sFontName).y - gc.getFontMetrics().getDescent());\n }\n if (fdCurrent.isStrikethrough()) {\n gc.drawLine(iStartX, iStartY + (getStringWidth(gc, sFontName).y / 2) + 1, iStartX + getStringWidth(gc, sFontName).x, iStartY + (getStringWidth(gc, sFontName).y / 2) + 1);\n }\n if (!bUseSize) {\n gc.setClipping(1, 1, this.getSize().x, this.getSize().y);\n fSize = new Font(this.getDisplay(), \"String_Node_Str\", fOld.getFontData()[0].getHeight(), SWT.NORMAL);\n gc.setFont(fSize);\n String sizeString = \"String_Node_Str\" + (fdCurrent.isSetSize() ? String.valueOf((int) fdCurrent.getSize()) : ChartUIUtil.FONT_AUTO) + \"String_Node_Str\";\n Point pt = gc.textExtent(sizeString);\n gc.drawText(sizeString, this.getSize().x - pt.x - this.getBorderWidth() - 2, (this.getSize().y - pt.y) / 2 - 1);\n fSize.dispose();\n preferredWidth = getStringWidth(gc, sFontName).x + getStringWidth(gc, sizeString).x + 5 + iStartX;\n }\n fCurrent.dispose();\n }\n if (this.isEnabled()) {\n cFore.dispose();\n }\n gc.setFont(fOld);\n}\n"
"private static void loadValuesFromUser(Map<ConfigProperty, String> initialValues) {\n if (!initialValues.isEmpty()) {\n for (Entry<ConfigProperty, String> eachConfig : initialValues.entrySet()) {\n xmlConfig.setProperty(eachConfig.getKey().getName(), eachConfig.getValue());\n }\n }\n}\n"
"public int predict(double[] x, double[] posteriori) {\n if (x.length != p) {\n throw new IllegalArgumentException(String.format(\"String_Node_Str\", x.length, p));\n }\n if (posteriori != null && posteriori.length != k) {\n throw new IllegalArgumentException(String.format(\"String_Node_Str\", posteriori.length, k));\n }\n if (k == 2) {\n double f = 1.0 / (1.0 + Math.exp(-dot(x, w)));\n if (posteriori != null) {\n posteriori[0] = 1.0 - f;\n posteriori[1] = f;\n }\n if (f < 0.5) {\n return 0;\n } else {\n return 1;\n }\n } else {\n int label = -1;\n double max = Double.NEGATIVE_INFINITY;\n for (int i = 0; i < k; i++) {\n double prob = dot(x, W[i]);\n if (prob > max) {\n max = prob;\n label = i;\n }\n if (posteriori != null) {\n posteriori[i] = prob;\n }\n }\n if (posteriori != null) {\n double Z = 0.0;\n for (int i = 0; i < k; i++) {\n posteriori[i] = Math.exp(posteriori[i] - max);\n Z += posteriori[i];\n }\n for (int i = 0; i < k; i++) {\n posteriori[i] /= Z;\n }\n }\n return label;\n }\n}\n"
"public void surfaceDestroyed(SurfaceHolder holder) {\n scene.stop();\n drawThread.setRunning(false);\n while (retry) {\n try {\n drawThread.join();\n retry = false;\n } catch (InterruptedException e) {\n }\n }\n}\n"
"public boolean handles(ReadableArchive archive) {\n boolean isWeldArchive = false;\n if (isEntryPresent(archive, WeldUtils.WEB_INF)) {\n isWeldArchive = isEntryPresent(archive, WeldUtils.WEB_INF_BEANS_XML) || isEntryPresent(archive, WeldUtils.WEB_INF_CLASSES_META_INF_BEANS_XML);\n if (!isWeldArchive) {\n if (isEntryPresent(archive, WeldUtils.WEB_INF_LIB)) {\n isWeldArchive = scanLibDir(archive, WeldUtils.WEB_INF_LIB);\n }\n }\n }\n String archiveName = archive.getName();\n if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_JAR_SUFFIX)) {\n isWeldArchive = isEntryPresent(archive, WeldUtils.META_INF_BEANS_XML);\n }\n if (!isWeldArchive && isEntryPresent(archive, WeldUtils.META_INF_BEANS_XML)) {\n isWeldArchive = true;\n }\n if (!isWeldArchive && archiveName != null && archiveName.endsWith(WeldUtils.EXPANDED_RAR_SUFFIX)) {\n isWeldArchive = isEntryPresent(archive, WeldUtils.META_INF_BEANS_XML);\n }\n return isWeldArchive;\n}\n"
"protected final void writeRead(final ReadSequence readSequence, final OutputCollector<Text, Text> collector, final Reporter reporter) throws IOException {\n this.writer.write(readSequence.toFastQ());\n reporter.incrCounter(this.counterGroup, Common.SOAP_INPUT_READS_COUNTER, 1);\n if (this.reporter == null && reporter != null)\n this.reporter = reporter;\n if (this.collector == null && collector != null)\n this.collector = collector;\n}\n"
"public String humanReadablePath() {\n String path = super.humanReadablePath();\n if (order == null) {\n return path;\n }\n switch(order) {\n case TOP_HOUR:\n case TOP_DAY:\n case TOP_WEEK:\n case TOP_MONTH:\n case TOP_YEAR:\n case TOP_ALL:\n return path + \"String_Node_Str\" + General.asciiLowercase(order.name().split(\"String_Node_Str\")[1]);\n default:\n return path;\n }\n}\n"
"public void focusVertex(final OverlayVertexWrapper<V, E> vertex) {\n wrappedFocusModel.focusVertex(OverlayVertexWrapper.wrappedOrNull(vertex));\n}\n"
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n if (controller != null) {\n for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {\n Player player = game.getPlayer(playerId);\n if (player != null) {\n for (Card card : player.getHand().getCards(game)) {\n card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);\n }\n for (Card card : player.getGraveyard().getCards(game)) {\n card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);\n }\n player.shuffleLibrary(game);\n }\n }\n for (Card card : controller.getLibrary().getTopCards(game, 10)) {\n controller.moveCardToExileWithInfo(card, null, \"String_Node_Str\", source.getSourceId(), game, Zone.LIBRARY, true);\n }\n for (UUID playerId : controller.getInRange()) {\n Player player = game.getPlayer(playerId);\n if (player != null) {\n int cardsToDrawCount = player.getAmount(0, 7, \"String_Node_Str\", game);\n player.drawCards(cardsToDrawCount, game);\n }\n }\n }\n return true;\n}\n"
"public UncheckedRow lastUncheckedRow() {\n long rowPtr = nativeLastRow(nativePtr);\n if (rowPtr != 0) {\n return table.getUncheckedRowByPointer(rowPtr);\n }\n return null;\n}\n"
"void playMiscAnimation(String name) {\n if (getavatar().getCharacterParams().isAnimateBody()) {\n setMiscAnimation(name);\n triggerReleased(TriggerNames.MiscAction.ordinal());\n triggerPressed(TriggerNames.MiscAction.ordinal());\n triggerReleased(TriggerNames.MiscAction.ordinal());\n }\n}\n"
"public void prepareStop(VirtualMachineProfile profile) {\n UserVmVO vm = _vmDao.findById(profile.getId());\n if (vm != null && vm.getState() == State.Stopping)\n collectVmDiskStatistics(vm);\n}\n"
"private static boolean equalsStrIgnoreCase(String s, String t) {\n if (s == null && t == null)\n return true;\n if ((s != null) && (t != null)) {\n return s.equalsIgnoreCase(t);\n }\n return false;\n}\n"
"public void testIsMetByShouldReturnFalseWhenTheCriterionIsUnmetEvenForCriteriaThatCrossMidnight() throws Exception {\n for (int begin = 1; begin < HOURS_IN_DAY; begin++) {\n for (int end = 0; end < begin; end++) {\n TimeVisibilityCriterion criterion = new TimeVisibilityCriterion(begin, end);\n for (int hour = end; hour != begin; hour = (hour + 1) % HOURS_IN_DAY) {\n Date date = new Date(1, 1, 1, hour, 0, 0);\n Mockito.when(world.getWorldDate()).thenReturn(date);\n Assert.assertFalse(criterion.isMetBy(observer));\n }\n }\n }\n}\n"
"public void Annotate(boolean ClearExistingLabels, FPGAReport reporter) {\n if (Annotated) {\n reporter.AddInfo(\"String_Node_Str\");\n return;\n }\n SortedSet<Component> comps = new TreeSet<Component>(new AnnotateComparator());\n HashMap<String, AutoLabel> lablers = new HashMap<String, AutoLabel>();\n Set<String> LabelNames = new HashSet<String>();\n for (Component comp : getNonWires()) {\n AttributeSet attrs = comp.getAttributeSet();\n if (attrs.containsAttribute(StdAttr.LABEL)) {\n String label = attrs.getValue(StdAttr.LABEL);\n if (!label.isEmpty()) {\n if (LabelNames.contains(label.toUpperCase())) {\n attrs.setValue(StdAttr.LABEL, \"String_Node_Str\");\n reporter.AddSevereWarning(\"String_Node_Str\" + this.getName() + \"String_Node_Str\" + label);\n } else {\n LabelNames.add(label.toUpperCase());\n }\n }\n }\n if (comp.getFactory().RequiresNonZeroLabel()) {\n if (ClearExistingLabels) {\n reporter.AddInfo(\"String_Node_Str\" + this.getName() + \"String_Node_Str\" + comp.getAttributeSet().getValue(StdAttr.LABEL));\n comp.getAttributeSet().setValue(StdAttr.LABEL, \"String_Node_Str\");\n }\n if (comp.getAttributeSet().getValue(StdAttr.LABEL).isEmpty()) {\n comps.add(comp);\n String ComponentName = GetAnnotationName(comp);\n if (!lablers.containsKey(ComponentName)) {\n lablers.put(ComponentName, new AutoLabel(ComponentName + \"String_Node_Str\", this));\n }\n }\n }\n if (comp.getFactory() instanceof SubcircuitFactory) {\n SubcircuitFactory sub = (SubcircuitFactory) comp.getFactory();\n sub.getSubcircuit().Annotate(ClearExistingLabels, reporter);\n }\n }\n for (Component comp : comps) {\n String ComponentName = GetAnnotationName(comp);\n if (!lablers.containsKey(ComponentName) || !lablers.get(ComponentName).hasNext(this)) {\n reporter.AddFatalError(\"String_Node_Str\");\n return;\n } else {\n String NewLabel = lablers.get(ComponentName).GetNext(this, comp.getFactory());\n comp.getAttributeSet().setValue(StdAttr.LABEL, NewLabel);\n reporter.AddInfo(\"String_Node_Str\" + this.getName() + \"String_Node_Str\" + NewLabel);\n }\n }\n Annotated = true;\n}\n"
"double interDensity(Vector uIJ, int cI, int cJ) {\n List<VectorWritable> repI = representativePoints.get(cI);\n List<VectorWritable> repJ = representativePoints.get(cJ);\n double density = 0.0;\n double std = (getStdev(cI) + getStdev(cJ)) / 2.0;\n for (VectorWritable vwI : repI) {\n if (measure.distance(uIJ, vwI.get()) <= std) {\n density++;\n }\n }\n for (VectorWritable vwJ : repJ) {\n if (measure.distance(uIJ, vwJ.get()) <= std) {\n density++;\n }\n }\n return density / (repI.size() + repJ.size());\n}\n"
"public Iterator<? extends NewsIndex> getIndexesOfAllArchivedNews(Source s, String sd, String ed) {\n if (_log.isInfoEnabled()) {\n _log.info(\"String_Node_Str\" + sd);\n _log.info(\"String_Node_Str\" + ed);\n }\n return ((List<SQL_NewsIndex>) GET_ALL_NEWS_INDEXES_BETWEEN_DATES_FROM_FEED_ID.execute(new Object[] { s.getFeed().getKey(), new java.sql.Date(sd.getTime()), new java.sql.Date(ed.getTime()) })).iterator();\n}\n"
"public void init() {\n MockitoAnnotations.initMocks(this);\n unpauseJob = new UnpauseJob(jobCurator, pk);\n}\n"
"public ConsoleReporterDefinition applyAsOverride(final ConsoleReporterDefinition override) {\n ConsoleReporterDefinition consoleReporterDefinition = new ConsoleReporterDefinition();\n consoleReporterDefinition.setName(this.name);\n consoleReporterDefinition.setDurationUnit(this.durationUnit);\n consoleReporterDefinition.setRateUnit(this.rateUnit);\n consoleReporterDefinition.setPeriodDuration(this.periodDuration);\n consoleReporterDefinition.setPeriodDurationUnit(this.periodDurationUnit);\n consoleReporterDefinition.setFilter(this.filter);\n consoleReporterDefinition.setNameIfNotNull(override.getName());\n consoleReporterDefinition.setDurationUnitIfNotNull(override.getDurationUnit());\n consoleReporterDefinition.setRateUnitIfNotNull(override.getRateUnit());\n consoleReporterDefinition.setPeriodDurationIfNotNull(override.getPeriodDuration());\n consoleReporterDefinition.setPeriodDurationUnitIfNotNull(override.getPeriodDurationUnit());\n consoleReporterDefinition.setFilterIfNotNull(override.getFilter());\n return consoleReporterDefinition;\n}\n"
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n response.setContentType(\"String_Node_Str\");\n response.setContentType(\"String_Node_Str\");\n response.setHeader(\"String_Node_Str\", \"String_Node_Str\");\n response.setHeader(\"String_Node_Str\", \"String_Node_Str\");\n response.setDateHeader(\"String_Node_Str\", 0);\n Twitter twitter = new TwitterFactory().getInstance();\n twitter.setOAuthConsumer(configMgr.getConsumerKey(), configMgr.getConsumerSecret());\n RequestToken requestToken = (RequestToken) request.getSession().getAttribute(REQUEST_TOKEN);\n String verifier = request.getParameter(OAUTH_VERIFIER);\n try {\n AccessToken accessToken = twitter.getOAuthAccessToken(requestToken, verifier);\n long userId = accessToken.getUserId();\n String screenName = accessToken.getScreenName();\n String oauthToken = accessToken.getToken();\n String oauthTokenSecret = accessToken.getTokenSecret();\n User user = null;\n user = userMgr.getUserById(userId);\n twitter4j.User twUser = twitter.showUser(userId);\n if (user == null) {\n user = new User();\n user.setId(userId);\n user.setUserName(screenName);\n user.setFirstLogin(Calendar.getInstance().getTime());\n user.setLastIp(request.getRemoteAddr());\n user.setLastLogin(Calendar.getInstance().getTime());\n user.setOauthToken(oauthToken);\n user.setOauthTokenSecret(oauthTokenSecret);\n user.setCash(configMgr.getInitialMoney());\n user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());\n userMgr.saveUser(user);\n request.setAttribute(User.USER, user);\n } else {\n user = new User();\n user.setId(userId);\n user.setLastLogin(Calendar.getInstance().getTime());\n user.setUserName(screenName);\n user.setLastIp(request.getRemoteHost());\n user.setOauthToken(oauthToken);\n user.setOauthTokenSecret(oauthTokenSecret);\n user.setPictureUrl(twUser.getProfileImageURL().toExternalForm());\n userMgr.updateUser(user);\n request.setAttribute(User.USER, user);\n }\n request.getSession().removeAttribute(REQUEST_TOKEN);\n Cookie[] cookies = createCookie(userId, oauthToken);\n writeCookies(response, cookies);\n } catch (TwitterException e) {\n throw new ServletException(e);\n }\n response.sendRedirect(request.getContextPath() + \"String_Node_Str\");\n}\n"
"public void visitColumn(ColumnHandle handle) {\n ColumnDesign col = new ColumnDesign();\n setupReportElement(col, handle);\n col.setColumnHeaderState(false);\n DimensionType width = createDimension(handle.getWidth(), false);\n col.setWidth(width);\n boolean supress = handle.suppressDuplicates();\n col.setSuppressDuplicate(supress);\n VisibilityDesign visibility = createVisibility(handle.visibilityRulesIterator());\n col.setVisibility(visibility);\n setCurrentElement(col);\n}\n"
"public static String getFormattedOutput(InputStream is) throws IOException {\n ANTLRInputStream in = new ANTLRInputStream(is);\n cqlLexer lexer = new cqlLexer(in);\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n tokens.fill();\n populateComments(tokens);\n cqlParser parser = new cqlParser(tokens);\n parser.addErrorListener(new SyntaxErrorListener());\n parser.setBuildParseTree(true);\n ParserRuleContext tree = parser.library();\n CqlFormatterVisitor formatter = new CqlFormatterVisitor();\n String output = (String) formatter.visit(tree);\n if (!((SyntaxErrorListener) parser.getErrorListeners().get(1)).result.errors.isEmpty()) {\n CqlFormatterVisitor.endResult.setCql(input);\n CqlFormatterVisitor.endResult.setErrors(((SyntaxErrorListener) parser.getErrorListeners().get(1)).result.errors);\n return CqlFormatterVisitor.endResult.inputInError();\n }\n return listener.refineOutput(output);\n}\n"
"public com.massivecraft.factions.Faction getFactionById(String id) {\n try {\n return (com.massivecraft.factions.Faction) this.getInstance().getClass().getMethod(\"String_Node_Str\", String.class).invoke(this.getInstance(), id);\n } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {\n FactionsFramework.get().logError(e);\n return null;\n }\n}\n"