content stringlengths 40 137k |
|---|
"public void stopReading() {\n active = false;\n try {\n reader.close();\n } catch (IOException e) {\n throw new IllegalStateException(\"String_Node_Str\", e);\n } finally {\n try {\n if (activeExecution != null) {\n activeExecution.interrupt();\n }\n } catch (Throwable ex) {\n throw new IllegalStateException(\"String_Node_Str\", ex);\n }\n }\n}\n"
|
"private void sendMessage(String message) throws IOException {\n if (message.length() > 0) {\n if (message.length() > MESSAGE_SIZE) {\n int end = MESSAGE_SIZE - 1;\n while (end > 0 && message.charAt(end) != ' ') {\n end--;\n }\n if (end == 0) {\n end = MESSAGE_SIZE;\n } else {\n end++;\n }\n if (end > 0 && message.charAt(end) == '\\u00a7') {\n end--;\n }\n String firstPart = message.substring(0, end);\n sendMessagePacket(firstPart);\n sendMessage(getLastColorCode(firstPart) + message.substring(end));\n } else {\n end++;\n }\n if (message.charAt(end) == '\\u00a7') {\n end--;\n }\n String firstPart = message.substring(0, end);\n sendMessagePacket(firstPart);\n sendMessage(getLastColorCode(firstPart) + message.substring(end));\n } else {\n int end = message.length();\n if (message.charAt(end - 1) == '\\u00a7') {\n end--;\n }\n sendMessagePacket(message.substring(0, end));\n }\n}\n"
|
"public void testEmployeeSchemaGenMissingRequiredElement() throws Exception {\n boolean exception = false;\n String src = \"String_Node_Str\";\n String tmpdir = System.getenv(\"String_Node_Str\");\n String msg = \"String_Node_Str\";\n try {\n Class[] jClasses = new Class[] { Address.class, Employee.class, PhoneNumber.class, Department.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.getLocalizedMessage();\n }\n assertTrue(\"String_Node_Str\", exception);\n assertTrue(\"String_Node_Str\" + msg, msg.contains(\"String_Node_Str\"));\n}\n"
|
"public void delete(NamespaceId namespaceId) throws IOException, ExploreException, SQLException {\n deleteLocation(namespaceId);\n if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED) && !NamespaceId.DEFAULT.equals(namespaceId)) {\n exploreFacade.removeNamespace(namespaceId.toId());\n }\n}\n"
|
"private double getMaxLongitude(DataTilePos pos) {\n return (pos.getTileZ() + 1) * this.tileSize.getZ();\n}\n"
|
"public DocumentRevision createDocumentMaster(String pParentFolder, String pDocMId, String pTitle, String pDescription, String pDocMTemplateId, String pWorkflowModelId, ACLUserEntry[] pACLUserEntries, ACLUserGroupEntry[] pACLUserGroupEntries, Map<String, Collection<String>> userRoleMapping, Map<String, Collection<String>> groupRoleMapping) throws UserNotFoundException, AccessRightException, WorkspaceNotFoundException, NotAllowedException, FolderNotFoundException, DocumentMasterTemplateNotFoundException, FileAlreadyExistsException, CreationException, DocumentRevisionAlreadyExistsException, RoleNotFoundException, WorkflowModelNotFoundException, DocumentMasterAlreadyExistsException, UserGroupNotFoundException {\n User user = userManager.checkWorkspaceWriteAccess(Folder.parseWorkspaceId(pParentFolder));\n Locale locale = new Locale(user.getLanguage());\n checkNameValidity(pDocMId, locale);\n Folder folder = new FolderDAO(locale, em).loadFolder(pParentFolder);\n checkFolderWritingRight(user, folder);\n DocumentMaster docM;\n DocumentRevision docR;\n DocumentIteration newDoc;\n DocumentMasterDAO docMDAO = new DocumentMasterDAO(locale, em);\n if (pDocMTemplateId == null) {\n docM = new DocumentMaster(user.getWorkspace(), pDocMId, user);\n docM.setType(\"String_Node_Str\");\n docMDAO.createDocM(docM);\n docR = docM.createNextRevision(user);\n newDoc = docR.createNextIteration(user);\n } else {\n DocumentMasterTemplate template = new DocumentMasterTemplateDAO(locale, em).loadDocMTemplate(new DocumentMasterTemplateKey(user.getWorkspaceId(), pDocMTemplateId));\n if (!Tools.validateMask(template.getMask(), pDocMId)) {\n throw new NotAllowedException(locale, \"String_Node_Str\");\n }\n docM = new DocumentMaster(user.getWorkspace(), pDocMId, user);\n docM.setType(template.getDocumentType());\n docM.setAttributesLocked(template.isAttributesLocked());\n docMDAO.createDocM(docM);\n docR = docM.createNextRevision(user);\n newDoc = docR.createNextIteration(user);\n List<InstanceAttribute> attrs = new ArrayList<>();\n for (InstanceAttributeTemplate attrTemplate : template.getAttributeTemplates()) {\n InstanceAttribute attr = attrTemplate.createInstanceAttribute();\n attrs.add(attr);\n }\n newDoc.setInstanceAttributes(attrs);\n BinaryResourceDAO binDAO = new BinaryResourceDAO(locale, em);\n for (BinaryResource sourceFile : template.getAttachedFiles()) {\n String fileName = sourceFile.getName();\n long length = sourceFile.getContentLength();\n Date lastModified = sourceFile.getLastModified();\n String fullName = docM.getWorkspaceId() + \"String_Node_Str\" + docM.getId() + \"String_Node_Str\" + fileName;\n BinaryResource targetFile = new BinaryResource(fullName, length, lastModified);\n binDAO.createBinaryResource(targetFile);\n newDoc.addFile(targetFile);\n try {\n dataManager.copyData(sourceFile, targetFile);\n } catch (StorageException e) {\n LOGGER.log(Level.INFO, null, e);\n }\n }\n }\n if (pWorkflowModelId != null) {\n UserDAO userDAO = new UserDAO(locale, em);\n UserGroupDAO groupDAO = new UserGroupDAO(locale, em);\n RoleDAO roleDAO = new RoleDAO(locale, em);\n Map<Role, Collection<User>> roleUserMap = new HashMap<>();\n for (Map.Entry<String, Collection<String>> pair : userRoleMapping.entrySet()) {\n String roleName = pair.getKey();\n Collection<String> userLogins = pair.getValue();\n Role role = roleDAO.loadRole(new RoleKey(Folder.parseWorkspaceId(pParentFolder), roleName));\n Set<User> users = new HashSet<>();\n roleUserMap.put(role, users);\n for (String login : userLogins) {\n User u = userDAO.loadUser(new UserKey(Folder.parseWorkspaceId(pParentFolder), login));\n users.add(u);\n }\n }\n Map<Role, Collection<UserGroup>> roleGroupMap = new HashMap<>();\n for (Map.Entry<String, Collection<String>> pair : groupRoleMapping.entrySet()) {\n String roleName = pair.getKey();\n Collection<String> groupIds = pair.getValue();\n Role role = roleDAO.loadRole(new RoleKey(Folder.parseWorkspaceId(pParentFolder), roleName));\n Set<UserGroup> groups = new HashSet<>();\n roleGroupMap.put(role, groups);\n for (String groupId : groupIds) {\n UserGroup g = groupDAO.loadUserGroup(new UserGroupKey(Folder.parseWorkspaceId(pParentFolder), groupId));\n groups.add(g);\n }\n }\n WorkflowModel workflowModel = new WorkflowModelDAO(locale, em).loadWorkflowModel(new WorkflowModelKey(user.getWorkspaceId(), pWorkflowModelId));\n Workflow workflow = workflowModel.createWorkflow(roleUserMap, roleGroupMap);\n docR.setWorkflow(workflow);\n for (Task task : workflow.getTasks()) {\n if (!task.hasPotentialWorker()) {\n throw new NotAllowedException(locale, \"String_Node_Str\");\n }\n }\n runningTasks = workflow.getRunningTasks();\n for (Task runningTask : runningTasks) {\n runningTask.start();\n }\n em.flush();\n mailer.sendApproval(runningTasks, docR);\n }\n docR.setTitle(pTitle);\n docR.setDescription(pDescription);\n if ((pACLUserEntries != null && pACLUserEntries.length > 0) || (pACLUserGroupEntries != null && pACLUserGroupEntries.length > 0)) {\n ACL acl = new ACL();\n if (pACLUserEntries != null) {\n for (ACLUserEntry entry : pACLUserEntries) {\n acl.addEntry(em.getReference(User.class, new UserKey(user.getWorkspaceId(), entry.getPrincipalLogin())), entry.getPermission());\n }\n }\n if (pACLUserGroupEntries != null) {\n for (ACLUserGroupEntry entry : pACLUserGroupEntries) {\n acl.addEntry(em.getReference(UserGroup.class, new UserGroupKey(user.getWorkspaceId(), entry.getPrincipalId())), entry.getPermission());\n }\n }\n docR.setACL(acl);\n }\n Date now = new Date();\n docM.setCreationDate(now);\n docR.setCreationDate(now);\n docR.setLocation(folder);\n docR.setCheckOutUser(user);\n docR.setCheckOutDate(now);\n newDoc.setCreationDate(now);\n new DocumentRevisionDAO(locale, em).createDocR(docR);\n return docR;\n}\n"
|
"public void getLogNext(LoggingContext loggingContext, ReadRange readRange, int maxEvents, Filter filter, Callback callback) {\n if (readRange.getKafkaOffset() < 0) {\n getLogPrev(loggingContext, readRange, maxEvents, filter, callback);\n return;\n }\n Filter contextFilter = LoggingContextHelper.createFilter(loggingContext);\n callback.init();\n try {\n int count = 0;\n for (LogEvent logLine : logEvents) {\n if (logLine.getOffset().getKafkaOffset() >= readRange.getKafkaOffset()) {\n long logTime = logLine.getLoggingEvent().getTimeStamp();\n if (!contextFilter.match(logLine.getLoggingEvent()) || logTime < readRange.getFromMillis() || logTime >= readRange.getToMillis()) {\n continue;\n }\n if (++count > maxEvents) {\n break;\n }\n if (!filter.match(logLine.getLoggingEvent())) {\n continue;\n }\n callback.handle(logLine);\n }\n }\n } catch (Throwable e) {\n LOG.error(\"String_Node_Str\", e);\n } finally {\n callback.close();\n }\n}\n"
|
"public Object invokeFinal(Object iContent, Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {\n Object selectedValue = getSingleSelection(iContent);\n if (selectedValue != null) {\n SchemaClass clazz = Roma.schema().getSchemaClass(EntityHelper.getEntityObject(selectedValue).getClass());\n SchemaClass selectedValueClass = Roma.schema().getSchemaClass(selectedValue.getClass());\n Object domainInstance;\n if (!selectedValueClass.equals(clazz)) {\n if (!selectedValueClass.isAssignableAs(clazz)) {\n domainInstance = EntityHelper.getEntityObject(selectedValue);\n } else\n domainInstance = selectedValue;\n } else {\n domainInstance = selectedValue;\n } else {\n domainInstance = selectedValue;\n }\n SchemaClass formClass = CRUDHelper.getCRUDInstance(EntityHelper.getEntityObject(selectedValue).getClass());\n Object formInstance;\n if (formClass == null)\n formInstance = domainInstance;\n else {\n try {\n formInstance = EntityHelper.createObject(domainInstance, formClass);\n } catch (InstantiationException e) {\n throw new RuntimeException(e);\n }\n }\n if (formInstance instanceof CRUDInstance) {\n ((CRUDInstance<?>) formInstance).setMode(getOpenMode());\n }\n if (formInstance instanceof Bindable)\n ((Bindable) formInstance).setSource(iContent, field.getName());\n if (formClass == null) {\n final InstanceWrapper instanceWrapper = new InstanceWrapper(iContent, field, formInstance, getOpenMode());\n Roma.aspect(FlowAspect.class).forward(instanceWrapper, \"String_Node_Str\");\n } else\n Roma.aspect(FlowAspect.class).forward(formInstance, \"String_Node_Str\");\n return null;\n}\n"
|
"public PersistenceUnitUtil getPersistenceUnitUtil() {\n return delegate.getPersistenceUnitUtil();\n}\n"
|
"public void finalize(QueueEntryPointer entryPointer, QueueConsumer consumer, int totalNumGroups, long writePoint) throws OperationException {\n if (consumer.getInstanceId() != 0) {\n return;\n }\n ReadPointer readPointer = oracle.dirtyReadPointer();\n final long evictStartTimeInSecs = System.currentTimeMillis() / 1000;\n QueueStateImpl queueState = getQueueState(consumer, readPointer);\n if (evictStartTimeInSecs - queueState.getLastEvictTimeInSecs() < EVICT_INTERVAL_IN_SECS) {\n return;\n }\n List<byte[]> writeKeys = new ArrayList<byte[]>();\n List<byte[]> writeCols = new ArrayList<byte[]>();\n List<byte[]> writeValues = new ArrayList<byte[]>();\n if (LOG.isTraceEnabled()) {\n logTrace(String.format(\"String_Node_Str\", consumer.getGroupId()));\n }\n final long minGroupEvictEntry = getMinGroupEvictEntry(consumer, readPointer);\n if (minGroupEvictEntry == INVALID_ENTRY_ID) {\n return;\n }\n writeKeys.add(GLOBAL_EVICT_META_PREFIX);\n writeCols.add(makeColumnName(GROUP_MAX_EVICT_ENTRY, consumer.getGroupId()));\n writeValues.add(Bytes.toBytes(minGroupEvictEntry));\n writeKeys.add(makeRowKey(CONSUMER_META_PREFIX, consumer.getGroupId(), consumer.getInstanceId()));\n writeCols.add(LAST_EVICT_TIME_IN_SECS);\n writeValues.add(Bytes.toBytes(evictStartTimeInSecs));\n queueState.setLastEvictTimeInSecs(evictStartTimeInSecs);\n if (LOG.isTraceEnabled()) {\n logTrace(String.format(\"String_Node_Str\", minGroupEvictEntry, consumer.getGroupId()));\n }\n if (consumer.getGroupId() == 0) {\n if (LOG.isTraceEnabled()) {\n logTrace(\"String_Node_Str\");\n }\n final long currentMinEvictedEntry = runEviction(consumer, minGroupEvictEntry, readPointer);\n if (currentMinEvictedEntry != INVALID_ENTRY_ID) {\n writeKeys.add(GLOBAL_EVICT_META_PREFIX);\n writeCols.add(GLOBAL_LAST_EVICT_ENTRY);\n writeValues.add(Bytes.toBytes(currentMinEvictedEntry));\n }\n }\n byte[][] keyArray = new byte[writeKeys.size()][];\n byte[][] colArray = new byte[writeCols.size()][];\n byte[][] valArray = new byte[writeValues.size()][];\n table.put(writeKeys.toArray(keyArray), writeCols.toArray(colArray), writePoint, writeValues.toArray(valArray));\n}\n"
|
"public boolean apply(Game game, Ability source) {\n MageObject mageObject;\n if (source.getZone() == Zone.BATTLEFIELD) {\n mageObject = source.getSourceObjectIfItStillExists(game);\n } else {\n mageObject = game.getObject(source.getSourceId());\n }\n if (mageObject == null) {\n if (duration.equals(Duration.Custom)) {\n discard();\n }\n return false;\n }\n if (amount != null) {\n int value = amount.calculate(game, source, this);\n mageObject.getPower().setValue(value);\n mageObject.getToughness().setValue(value);\n return true;\n } else {\n if (power != Integer.MIN_VALUE) {\n mageObject.getPower().setValue(power);\n }\n if (toughness != Integer.MIN_VALUE) {\n mageObject.getToughness().setValue(toughness);\n }\n }\n return true;\n}\n"
|
"public long getTimeSinceCreation() {\n return System.currentTimeMillis() - creationTime;\n}\n"
|
"public byte[] sendVolumeUp() {\n return new byte[] { mSteeringWheelAddress, 0x04, mRadioAddress, 0x32, 0x11, 0x1F };\n}\n"
|
"public void removeFacet() {\n if (hasFacet()) {\n try {\n IFacetedProject facetedProject = ProjectFacetsManager.create(project);\n if (facetedProject != null) {\n facetedProject.uninstallProjectFacet(FACET.getDefaultVersion(), null, null);\n }\n } catch (CoreException e) {\n CloudFoundryPlugin.log(e);\n }\n }\n}\n"
|
"public static void main(String[] args) throws Exception {\n final String ALL_ASYNC = \"String_Node_Str\" + AsyncLoggerContextSelector.class.getName();\n final String CACHEDCLOCK = \"String_Node_Str\";\n final String SYSCLOCK = \"String_Node_Str\";\n final String LOG12 = RunLog4j1.class.getName();\n final String LOG20 = RunLog4j2.class.getName();\n final String LOGBK = RunLogback.class.getName();\n long start = System.nanoTime();\n List<Setup> tests = new ArrayList<PerfTestDriver.Setup>();\n tests.add(s(\"String_Node_Str\", LOG20, \"String_Node_Str\", ALL_ASYNC, SYSCLOCK));\n tests.add(s(\"String_Node_Str\", LOG20, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOGBK, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOG12, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOG20, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOGBK, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOG12, \"String_Node_Str\"));\n tests.add(s(\"String_Node_Str\", LOG20, \"String_Node_Str\"));\n final int MAX_THREADS = 16;\n for (int i = 2; i <= MAX_THREADS; i *= 2) {\n tests.add(m(\"String_Node_Str\", LOGBK, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOG12, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOG20, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOGBK, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOG12, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOG20, \"String_Node_Str\", i));\n tests.add(m(\"String_Node_Str\", LOG20, \"String_Node_Str\", i, ALL_ASYNC, SYSCLOCK));\n tests.add(m(\"String_Node_Str\", LOG20, \"String_Node_Str\", i));\n }\n String java = args.length > 0 ? args[0] : \"String_Node_Str\";\n int repeat = args.length > 1 ? Integer.parseInt(args[1]) : 5;\n int x = 0;\n for (Setup config : tests) {\n System.out.print(config.description());\n ProcessBuilder pb = config.throughputTest(java);\n pb.redirectErrorStream(true);\n long t1 = System.nanoTime();\n runPerfTest(repeat, x++, config, pb);\n System.out.printf(\"String_Node_Str\", (System.nanoTime() - t1) / (1000.0 * 1000.0 * 1000.0));\n FileReader reader = new FileReader(config._temp);\n CharBuffer buffer = CharBuffer.allocate(256 * 1024);\n reader.read(buffer);\n reader.close();\n config._temp.delete();\n buffer.flip();\n String raw = buffer.toString();\n System.out.print(raw);\n Stats stats = new Stats(raw);\n System.out.println(stats);\n System.out.println(\"String_Node_Str\");\n config._stats = stats;\n }\n new File(\"String_Node_Str\").delete();\n System.out.printf(\"String_Node_Str\", (System.nanoTime() - start) / (60.0 * 1000.0 * 1000.0 * 1000.0));\n printRanking(tests.toArray(new Setup[tests.size()]));\n}\n"
|
"public void run() {\n IScope mixinArguments = data.getMixinArguments();\n ScopeView mixinWorkingScope = data.getMixinWorkingScope();\n mixinWorkingScope.getParent().add(mixinArguments);\n mixinWorkingScope.saveLocalDataForTheWholeWayUp();\n data.setMixinWorkingScope(mixinWorkingScope);\n GuardValue guardValue2 = data.getGuardValue();\n IScope mixinWorkingScope2 = data.getMixinWorkingScope();\n if (guardValue2 != GuardValue.DO_NOT_USE) {\n BodyCompilationData compiled = resolveCalledBody(callerScope, mixin, mixinWorkingScope2, ReturnMode.MIXINS_AND_VARIABLES);\n data.setReplacement(compiled.getReplacement());\n data.setReturnValues(compiled.getReturnValues());\n }\n}\n"
|
"String printCubeAlongEdge(CubeCursor cursor, List columnEdgeBindingNames, List rowEdgeBindingNames, List measureBindingNames, List rowGrandTotal, String columnGrandTotal, String totalGrandTotal, List countryGrandTotal) throws Exception {\n EdgeCursor edge1 = (EdgeCursor) (cursor.getOrdinateEdge().get(0));\n EdgeCursor edge2 = (EdgeCursor) (cursor.getOrdinateEdge().get(1));\n String[] lines = new String[edge1.getDimensionCursor().size()];\n for (int i = 0; i < lines.length; i++) {\n lines[i] = \"String_Node_Str\";\n }\n while (edge1.next()) {\n for (int i = 0; i < lines.length; i++) {\n DimensionCursor dimCursor = (DimensionCursor) edge1.getDimensionCursor().get(i);\n lines[i] += dimCursor.getObject(columnEdgeBindingNames.get(i).toString()) + \"String_Node_Str\";\n }\n }\n String output = \"String_Node_Str\";\n for (int i = 0; i < lines.length; i++) {\n output += \"String_Node_Str\" + lines[i];\n }\n while (edge2.next()) {\n String line = \"String_Node_Str\";\n for (int k = 0; k < rowEdgeBindingNames.size(); k++) {\n DimensionCursor dimCursor = (DimensionCursor) edge2.getDimensionCursor().get(k);\n line += dimCursor.getObject(rowEdgeBindingNames.get(k).toString()).toString() + \"String_Node_Str\";\n }\n edge1.beforeFirst();\n while (edge1.next()) {\n DimensionCursor countryCursor = (DimensionCursor) edge1.getDimensionCursor().get(0);\n if (measureBindingNames != null) {\n for (int j = 0; j < measureBindingNames.size(); j++) {\n line += cursor.getObject(OlapExpressionUtil.createMeasureCalculateMemeberName(measureBindingNames.get(j).toString())) + \"String_Node_Str\";\n }\n if (countryGrandTotal != null)\n for (int k = 0; k < countryGrandTotal.size(); k++) {\n if (edge1.getPosition() == countryCursor.getEdgeEnd() && countryGrandTotal != null) {\n line += cursor.getObject(countryGrandTotal.get(k).toString());\n }\n }\n line += \"String_Node_Str\";\n }\n }\n if (rowGrandTotal != null)\n for (int j = 0; j < rowGrandTotal.size(); j++) {\n line += cursor.getObject(rowGrandTotal.get(j).toString()) + \"String_Node_Str\";\n }\n output += \"String_Node_Str\" + line;\n }\n edge1.close();\n edge2.close();\n if (columnGrandTotal != null) {\n output += \"String_Node_Str\" + columnGrandTotal + \"String_Node_Str\";\n edge1.beforeFirst();\n while (edge1.next()) {\n output += cursor.getObject(columnGrandTotal) + \"String_Node_Str\";\n }\n }\n if (totalGrandTotal != null)\n output += cursor.getObject(totalGrandTotal);\n cursor.close();\n System.out.print(output);\n return output;\n}\n"
|
"public void testSimple() throws Exception {\n Channel channel = new Channel(channelName, channelUrl);\n SequenceIterator iterator = factory.create(999, channel);\n check(iterator, \"String_Node_Str\");\n check(iterator, \"String_Node_Str\");\n int end = insertAndCheck(iterator, 3);\n iterator.exit();\n iterator = factory.create(iterator.getCurrent(), channel);\n insertAndCheck(iterator, end);\n}\n"
|
"protected void _calculateDelayOffsets() throws IllegalActionException {\n _visitedActors = new HashSet<Actor>();\n _clearDelayOffsets();\n _inputModelTimeDelays = new HashMap<IOPort, Map<Integer, SuperdenseDependency>>();\n _portDelays = new HashMap<IOPort, SuperdenseDependency>();\n if (getContainer() instanceof TypedCompositeActor) {\n for (Actor actor : (List<Actor>) (((TypedCompositeActor) getContainer()).deepEntityList())) {\n for (TypedIOPort inputPort : (List<TypedIOPort>) (actor.inputPortList())) {\n _portDelays.put(inputPort, SuperdenseDependency.OPLUS_IDENTITY);\n }\n for (TypedIOPort outputPort : (List<TypedIOPort>) (actor.outputPortList())) {\n _portDelays.put(outputPort, SuperdenseDependency.OPLUS_IDENTITY);\n }\n }\n for (TypedIOPort inputPort : (List<TypedIOPort>) (((Actor) getContainer()).inputPortList())) {\n SuperdenseDependency startDelay;\n Double start = null;\n if (_isNetworkPort(inputPort)) {\n start = _getNetworkTotalDelay(inputPort);\n if (start != null) {\n start += getAssumedSynchronizationErrorBound();\n } else {\n start = getAssumedSynchronizationErrorBound();\n }\n } else {\n start = _getRealTimeDelay(inputPort);\n }\n if (start == null) {\n start = 0.0;\n }\n startDelay = SuperdenseDependency.valueOf(-start, 0);\n _portDelays.put(inputPort, startDelay);\n }\n for (TypedIOPort startPort : (List<TypedIOPort>) (((TypedCompositeActor) getContainer()).inputPortList())) {\n _traverseToCalcMinDelay(startPort);\n }\n for (Actor actor : (List<Actor>) ((CompositeActor) getContainer()).deepEntityList()) {\n if (!_visitedActors.contains(actor)) {\n for (IOPort port : (List<IOPort>) actor.outputPortList()) {\n Receiver[][] remoteReceivers = port.getRemoteReceivers();\n for (int i = 0; i < remoteReceivers.length; i++) {\n if (remoteReceivers[0] != null) {\n for (int j = 0; j < remoteReceivers[i].length; j++) {\n Receiver receiver = remoteReceivers[i][j];\n IOPort receivePort = receiver.getContainer();\n int channel = receivePort.getChannelForReceiver(receiver);\n Map<Integer, SuperdenseDependency> channelDependency = (Map<Integer, SuperdenseDependency>) _inputModelTimeDelays.get(receivePort);\n if (channelDependency == null) {\n channelDependency = new HashMap<Integer, SuperdenseDependency>();\n }\n channelDependency.put(Integer.valueOf(channel), SuperdenseDependency.OPLUS_IDENTITY);\n _inputModelTimeDelays.put(receivePort, channelDependency);\n }\n }\n }\n }\n }\n }\n }\n for (IOPort inputPort : (Set<IOPort>) _inputModelTimeDelays.keySet()) {\n Map<Integer, SuperdenseDependency> channelDependency = (Map<Integer, SuperdenseDependency>) _inputModelTimeDelays.get(inputPort);\n int size = 1;\n for (Integer portChannelMinDelay : channelDependency.keySet()) {\n if (portChannelMinDelay.intValue() >= size) {\n size = portChannelMinDelay.intValue() + 1;\n }\n }\n double[] delayOffsets = new double[size];\n for (Integer portChannelMinDelay : channelDependency.keySet()) {\n delayOffsets[portChannelMinDelay.intValue()] = _calculateMinDelayForPortChannel(inputPort, portChannelMinDelay);\n }\n _setDelayOffset(inputPort, delayOffsets);\n }\n}\n"
|
"public void postCalculateChanges(org.eclipse.persistence.sessions.changesets.ChangeRecord changeRecord, UnitOfWorkImpl uow) {\n Object oldValue = ((ObjectReferenceChangeRecord) changeRecord).getOldValue();\n if (oldValue != null) {\n uow.addDeletedPrivateOwnedObjects(this, oldValue);\n }\n}\n"
|
"public LayoutMode getInteractionLayout() {\n Object obj = parameters.get(KEY_INTERACTION_LAYOUT);\n if (obj instanceof LayoutMode) {\n return (LayoutMode) obj;\n } else if (obj instanceof String) {\n LayoutMode theCode = null;\n try {\n theCode = LayoutMode.valueForString((String) obj);\n } catch (Exception e) {\n DebugTool.logError(\"String_Node_Str\" + getClass().getSimpleName() + \"String_Node_Str\" + KEY_INTERACTION_LAYOUT, e);\n }\n return theCode;\n }\n return null;\n}\n"
|
"public void run() {\n final UsbDeviceConnection deviceConnection = usbDeviceConnection;\n final UsbEndpoint usbEndpoint = inputEndpoint;\n final int maxPacketSize = inputEndpoint.getMaxPacketSize();\n final MidiInputDevice sender = MidiInputDevice.this;\n final OnMidiInputEventListener midiEventListener = MidiInputDevice.this.midiEventListener;\n final byte[] bulkReadBuffer = new byte[maxPacketSize];\n byte[] readBuffer = new byte[maxPacketSize * 2];\n int readBufferSize = 0;\n byte[] read = new byte[maxPacketSize * 2];\n int length;\n int cable;\n int codeIndexNumber;\n int byte1;\n int byte2;\n int byte3;\n int i;\n int readSize;\n int unreadSize;\n final int RPN_STATUS_NONE = 0;\n final int RPN_STATUS_RPN = 1;\n final int RPN_STATUS_NRPN = 2;\n int rpnNrpnFunction;\n int rpnNrpnValueMsb;\n int rpnNrpnValueLsb;\n int rpnStatus = RPN_STATUS_NONE;\n int rpnFunctionMsb = 0x7f;\n int rpnFunctionLsb = 0x7f;\n int nrpnFunctionMsb = 0x7f;\n int nrpnFunctionLsb = 0x7f;\n SparseIntArray rpnCacheMsb = new SparseIntArray();\n SparseIntArray rpnCacheLsb = new SparseIntArray();\n SparseIntArray nrpnCacheMsb = new SparseIntArray();\n SparseIntArray nrpnCacheLsb = new SparseIntArray();\n ReusableByteArrayOutputStream[] systemExclusive = new ReusableByteArrayOutputStream[16];\n for (i = 0; i < 16; i++) {\n systemExclusive[i] = new ReusableByteArrayOutputStream();\n }\n while (!stopFlag) {\n length = deviceConnection.bulkTransfer(usbEndpoint, bulkReadBuffer, maxPacketSize, 10);\n synchronized (suspendSignal) {\n if (suspendFlag) {\n try {\n suspendSignal.wait(100);\n } catch (InterruptedException e) {\n }\n continue;\n }\n }\n if (length <= 0) {\n continue;\n }\n System.arraycopy(bulkReadBuffer, 0, readBuffer, readBufferSize, length);\n readBufferSize += length;\n if (readBufferSize < 4) {\n continue;\n }\n readSize = readBufferSize / 4 * 4;\n System.arraycopy(readBuffer, 0, read, 0, readSize);\n unreadSize = readBufferSize - readSize;\n if (unreadSize > 0) {\n System.arraycopy(readBuffer, readSize, readBuffer, 0, unreadSize);\n readBufferSize = unreadSize;\n } else {\n readBufferSize = 0;\n }\n for (i = 0; i < readSize; i += 4) {\n cable = (read[i] >> 4) & 0xf;\n codeIndexNumber = read[i] & 0xf;\n byte1 = read[i + 1] & 0xff;\n byte2 = read[i + 2] & 0xff;\n byte3 = read[i + 3] & 0xff;\n switch(codeIndexNumber) {\n case 0:\n if (midiEventListener != null) {\n midiEventListener.onMidiMiscellaneousFunctionCodes(sender, cable, byte1, byte2, byte3);\n }\n break;\n case 1:\n if (midiEventListener != null) {\n midiEventListener.onMidiCableEvents(sender, cable, byte1, byte2, byte3);\n }\n break;\n case 2:\n if (midiEventListener != null) {\n byte[] bytes = new byte[] { (byte) byte1, (byte) byte2 };\n midiEventListener.onMidiSystemCommonMessage(sender, cable, bytes);\n }\n break;\n case 3:\n if (midiEventListener != null) {\n byte[] bytes = new byte[] { (byte) byte1, (byte) byte2, (byte) byte3 };\n midiEventListener.onMidiSystemCommonMessage(sender, cable, bytes);\n }\n break;\n case 4:\n synchronized (systemExclusive[cable]) {\n systemExclusive[cable].write(byte1);\n systemExclusive[cable].write(byte2);\n systemExclusive[cable].write(byte3);\n }\n break;\n case 5:\n synchronized (systemExclusive[cable]) {\n systemExclusive[cable].write(byte1);\n if (midiEventListener != null) {\n byte[] sysexBytes = systemExclusive[cable].toByteArray();\n if (sysexBytes.length == 1) {\n switch(sysexBytes[0] & 0xff) {\n case 0xf6:\n midiEventListener.onMidiTuneRequest(sender, cable);\n break;\n case 0xf8:\n midiEventListener.onMidiTimingClock(sender, cable);\n break;\n case 0xfa:\n midiEventListener.onMidiStart(sender, cable);\n break;\n case 0xfb:\n midiEventListener.onMidiContinue(sender, cable);\n break;\n case 0xfc:\n midiEventListener.onMidiStop(sender, cable);\n break;\n case 0xfe:\n midiEventListener.onMidiActiveSensing(sender, cable);\n break;\n case 0xff:\n midiEventListener.onMidiReset(sender, cable);\n break;\n }\n }\n midiEventListener.onMidiSystemExclusive(sender, cable, sysexBytes);\n }\n systemExclusive[cable].reset();\n }\n break;\n case 6:\n synchronized (systemExclusive[cable]) {\n systemExclusive[cable].write(byte1);\n systemExclusive[cable].write(byte2);\n if (midiEventListener != null) {\n midiEventListener.onMidiSystemExclusive(sender, cable, systemExclusive[cable].toByteArray());\n }\n systemExclusive[cable].reset();\n }\n break;\n case 7:\n synchronized (systemExclusive[cable]) {\n systemExclusive[cable].write(byte1);\n systemExclusive[cable].write(byte2);\n systemExclusive[cable].write(byte3);\n if (midiEventListener != null) {\n midiEventListener.onMidiSystemExclusive(sender, cable, systemExclusive[cable].toByteArray());\n }\n systemExclusive[cable].reset();\n }\n break;\n case 8:\n if (midiEventListener != null) {\n midiEventListener.onMidiNoteOff(sender, cable, byte1 & 0xf, byte2, byte3);\n }\n break;\n case 9:\n if (midiEventListener != null) {\n if (byte3 == 0x00) {\n midiEventListener.onMidiNoteOff(sender, cable, byte1 & 0xf, byte2, byte3);\n } else {\n midiEventListener.onMidiNoteOn(sender, cable, byte1 & 0xf, byte2, byte3);\n }\n }\n break;\n case 10:\n if (midiEventListener != null) {\n midiEventListener.onMidiPolyphonicAftertouch(sender, cable, byte1 & 0xf, byte2, byte3);\n }\n break;\n case 11:\n if (midiEventListener != null) {\n midiEventListener.onMidiControlChange(sender, cable, byte1 & 0xf, byte2, byte3);\n }\n switch(byte2) {\n case 6:\n {\n rpnNrpnValueMsb = byte3 & 0x7f;\n if (rpnStatus == RPN_STATUS_RPN) {\n rpnNrpnFunction = ((rpnFunctionMsb & 0x7f) << 7) | (rpnFunctionLsb & 0x7f);\n rpnCacheMsb.put(rpnNrpnFunction, rpnNrpnValueMsb);\n rpnNrpnValueLsb = rpnCacheLsb.get(rpnNrpnFunction, 0);\n if (midiEventListener != null) {\n midiEventListener.onMidiRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, (rpnNrpnValueMsb << 7 | rpnNrpnValueLsb));\n midiEventListener.onMidiRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, rpnNrpnValueMsb, rpnNrpnValueLsb);\n }\n } else if (rpnStatus == RPN_STATUS_NRPN) {\n rpnNrpnFunction = ((nrpnFunctionMsb & 0x7f) << 7) | (nrpnFunctionLsb & 0x7f);\n nrpnCacheMsb.put(rpnNrpnFunction, rpnNrpnValueMsb);\n rpnNrpnValueLsb = nrpnCacheLsb.get(rpnNrpnFunction, 0);\n if (midiEventListener != null) {\n midiEventListener.onMidiNRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, (rpnNrpnValueMsb << 7 | rpnNrpnValueLsb));\n midiEventListener.onMidiNRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, rpnNrpnValueMsb, rpnNrpnValueLsb);\n }\n }\n break;\n }\n case 38:\n {\n rpnNrpnValueLsb = byte3 & 0x7f;\n if (rpnStatus == RPN_STATUS_RPN) {\n rpnNrpnFunction = ((rpnFunctionMsb & 0x7f) << 7) | (rpnFunctionLsb & 0x7f);\n rpnNrpnValueMsb = rpnCacheMsb.get(rpnNrpnFunction, 0);\n rpnCacheLsb.put(rpnNrpnFunction, rpnNrpnValueLsb);\n if (midiEventListener != null) {\n midiEventListener.onMidiRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, (rpnNrpnValueMsb << 7 | rpnNrpnValueLsb));\n midiEventListener.onMidiRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, rpnNrpnValueMsb, rpnNrpnValueLsb);\n }\n } else if (rpnStatus == RPN_STATUS_NRPN) {\n rpnNrpnFunction = ((nrpnFunctionMsb & 0x7f) << 7) | (nrpnFunctionLsb & 0x7f);\n rpnNrpnValueMsb = nrpnCacheMsb.get(rpnNrpnFunction, 0);\n nrpnCacheLsb.put(rpnNrpnFunction, rpnNrpnValueLsb);\n if (midiEventListener != null) {\n midiEventListener.onMidiNRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, (rpnNrpnValueMsb << 7 | rpnNrpnValueLsb));\n midiEventListener.onMidiNRPNReceived(sender, cable, byte1 & 0xf, rpnNrpnFunction, rpnNrpnValueMsb, rpnNrpnValueLsb);\n }\n }\n break;\n }\n case 98:\n {\n nrpnFunctionLsb = byte3 & 0x7f;\n rpnStatus = RPN_STATUS_NRPN;\n break;\n }\n case 99:\n {\n nrpnFunctionMsb = byte3 & 0x7f;\n rpnStatus = RPN_STATUS_NRPN;\n break;\n }\n case 100:\n {\n rpnFunctionLsb = byte3 & 0x7f;\n if (rpnFunctionMsb == 0x7f && rpnFunctionLsb == 0x7f) {\n rpnStatus = RPN_STATUS_NONE;\n } else {\n rpnStatus = RPN_STATUS_RPN;\n }\n break;\n }\n case 101:\n {\n rpnFunctionMsb = byte3 & 0x7f;\n if (rpnFunctionMsb == 0x7f && rpnFunctionLsb == 0x7f) {\n rpnStatus = RPN_STATUS_NONE;\n } else {\n rpnStatus = RPN_STATUS_RPN;\n }\n break;\n }\n default:\n break;\n }\n break;\n case 12:\n if (midiEventListener != null) {\n midiEventListener.onMidiProgramChange(sender, cable, byte1 & 0xf, byte2);\n }\n break;\n case 13:\n if (midiEventListener != null) {\n midiEventListener.onMidiChannelAftertouch(sender, cable, byte1 & 0xf, byte2);\n }\n break;\n case 14:\n if (midiEventListener != null) {\n midiEventListener.onMidiPitchWheel(sender, cable, byte1 & 0xf, byte2 | (byte3 << 7));\n }\n break;\n case 15:\n if (midiEventListener != null) {\n midiEventListener.onMidiSingleByte(sender, cable, byte1);\n }\n break;\n default:\n break;\n }\n }\n }\n}\n"
|
"public static <T> List<T> loadEmfModel(EPackage pkg, String file) throws IOException {\n ResourceSet resourceSet = getResourceSet(pkg);\n List<T> list = new ArrayList<T>();\n URI uri = URI.createFileURI(file);\n Resource resource = resourceSet.getResource(uri, true);\n resource.load(null);\n for (EObject obj : resource.getContents()) {\n list.add((T) obj);\n }\n return list;\n}\n"
|
"protected void setupRemoteServiceAdapters() throws Exception {\n final int clientCount = getClientCount();\n for (int i = 0; i < clientCount; i++) {\n adapters[i] = (IRemoteServiceContainerAdapter) getClients()[i].getAdapter(IRemoteServiceContainerAdapter.class);\n }\n}\n"
|
"public byte[] toByteArray(Object oid) {\n Object id = ((OpenJPAId) oid).getIdObject();\n if (id == null) {\n return null;\n }\n return dynamicSerializer.toBytes(createComposite(id));\n}\n"
|
"public void doLayout(List<? extends IGLLayoutElement> children, float w, float h) {\n IGLLayoutElement hist = children.get(HIST);\n final boolean smallHeader = isSmallHeader(h);\n if (smallHeader)\n hist.hide();\n else\n hist.setBounds(1, hasTitle ? LABEL_HEIGHT : 0, w - 2, h - (hasTitle ? LABEL_HEIGHT : 0));\n if (config.isInteractive()) {\n IGLLayoutElement weight = children.get(DRAG_WEIGHT);\n weight.setBounds(w, hasTitle && !smallHeader ? LABEL_HEIGHT : 0, (isHovered && config.canChangeWeights()) ? 8 : 0, h - (hasTitle && !smallHeader ? LABEL_HEIGHT : 0));\n {\n IGLLayoutElement buttons = children.get(BUTTONS);\n float minWidth = (buttons.asElement() instanceof ButtonBar) ? ((ButtonBar) buttons.asElement()).getMinWidth() : 0;\n boolean showButtonBar = isHovered && !isWeightDragging;\n float yb = 0;\n switch(config.getButtonBarPosition()) {\n case AT_THE_BOTTOM:\n yb = isHovered ? (h - 2 - RenderStyle.BUTTON_WIDTH) : h;\n break;\n case OVER_LABEL:\n yb = 0;\n break;\n case UNDER_LABEL:\n yb = LABEL_HEIGHT;\n break;\n case ABOVE_LABEL:\n yb = showButtonBar ? -RenderStyle.BUTTON_WIDTH : 0;\n break;\n case BELOW_HIST:\n yb = isHovered ? h : h;\n break;\n }\n float hb = showButtonBar ? RenderStyle.BUTTON_WIDTH : 0;\n if ((w - 4) < minWidth) {\n float missing = minWidth - (w - 4);\n buttons.setBounds(-missing * 0.5f, yb, minWidth, hb);\n } else {\n buttons.setBounds(2, yb, w - 4, hb);\n }\n }\n {\n IGLLayoutElement uncollapse = children.get(UNCOLLAPSE);\n float yb = 0;\n switch(config.getButtonBarPosition()) {\n case AT_THE_BOTTOM:\n yb = isHovered ? (h - 2 - RenderStyle.BUTTON_WIDTH) : h;\n break;\n case OVER_LABEL:\n yb = 0;\n break;\n case UNDER_LABEL:\n yb = LABEL_HEIGHT;\n break;\n case ABOVE_LABEL:\n yb = isHovered ? -RenderStyle.BUTTON_WIDTH : 0;\n break;\n case BELOW_HIST:\n yb = isHovered ? h : h;\n break;\n }\n uncollapse.setBounds((w - RenderStyle.BUTTON_WIDTH) * .5f, yb, RenderStyle.BUTTON_WIDTH, isHovered ? RenderStyle.BUTTON_WIDTH : 0);\n }\n for (IGLLayoutElement r : children.subList(FIRST_CUSTOM, children.size())) r.setBounds(defaultValue(r.getSetX(), 0), defaultValue(r.getSetY(), h), defaultValue(r.getSetWidth(), w), defaultValue(r.getSetHeight(), HIST_HEIGHT));\n }\n}\n"
|
"public static String getString(String key) {\n String message = key;\n String messageKey = MESSAGEMAP.get(key);\n if (null != messageKey && !DefaultMessagesImpl.getString(messageKey).startsWith(KEY_NOT_FOUND_PREFIX) && !DefaultMessagesImpl.getString(messageKey).endsWith(KEY_NOT_FOUND_SUFFIX)) {\n message = DefaultMessagesImpl.getString(messageKey);\n }\n return message;\n}\n"
|
"public static final Atom[] cloneAtomArray(Atom[] ca) {\n Atom[] newCA = new Atom[ca.length];\n List<Chain> model = new ArrayList<Chain>();\n int apos = -1;\n for (Atom a : ca) {\n apos++;\n Group parentG = a.getGroup();\n Chain parentC = parentG.getChain();\n Chain newChain = null;\n for (Chain c : model) {\n if (c.getChainID().equals(parentC.getChainID())) {\n newChain = c;\n break;\n }\n }\n if (newChain == null) {\n newChain = new ChainImpl();\n newChain.setChainID(parentC.getChainID());\n model.add(newChain);\n }\n Group parentN = (Group) parentG.clone();\n newCA[apos] = parentN.getAtom(a.getName());\n try {\n newChain.getGroupByPDB(parentN.getResidueNumber());\n } catch (StructureException e) {\n newChain.addGroup(parentN);\n }\n }\n return newCA;\n}\n"
|
"public static Filter parseString(String string) throws Filter.FilterException {\n String regexStripped = stripRegex(string);\n Matcher bracketMatcher = bracketsPattern.matcher(regexStripped);\n if (bracketMatcher.matches()) {\n Filter group;\n boolean inverted = \"String_Node_Str\".equals(bracketMatcher.group(2));\n int startBracket = regexStripped.indexOf(\"String_Node_Str\");\n int endBracket = getBracketMatch(regexStripped, startBracket);\n group = parseString(string.substring(startBracket + 1, endBracket));\n group.inverted = inverted;\n Pattern leftCompound = Pattern.compile(\"String_Node_Str\");\n Pattern rightCompound = Pattern.compile(\"String_Node_Str\");\n String left = string.substring(0, startBracket);\n String right = string.substring(endBracket + 1, regexStripped.length());\n Matcher leftMatcher = leftCompound.matcher(left);\n Matcher rightMatcher = rightCompound.matcher(right);\n if (leftMatcher.matches()) {\n group = new CompoundFilter(parseString(leftMatcher.group(1)), leftMatcher.group(2), group);\n }\n if (rightMatcher.matches()) {\n group = new CompoundFilter(group, rightMatcher.group(2), parseString(rightMatcher.group(3)));\n }\n return group;\n } else {\n Matcher compoundMatcher = compoundPattern.matcher(regexStripped);\n if (compoundMatcher.matches()) {\n return new CompoundFilter(compoundMatcher.group(1), compoundMatcher.group(2), compoundMatcher.group(3));\n } else {\n Pattern operation = Pattern.compile(\"String_Node_Str\");\n Matcher operationMatcher = operation.matcher(string);\n if (operationMatcher.matches()) {\n return new Filter(operationMatcher.group(1).trim(), operationMatcher.group(2), operationMatcher.group(3).trim());\n }\n }\n }\n throw new Filter.FilterException(\"String_Node_Str\");\n}\n"
|
"public void run() {\n AutotoolsConfigurationManager.getInstance().syncConfigurations(project);\n ICConfigurationDescription cfgds = CoreModel.getDefault().getProjectDescription(project).getActiveConfiguration();\n if (cfgds != null) {\n IAConfiguration iaConfig = AutotoolsConfigurationManager.getInstance().getConfiguration(project, cfgds.getId());\n iaConfig.setOption(optId, optVal);\n AutotoolsConfigurationManager.getInstance().saveConfigs(project);\n }\n}\n"
|
"private TransferEnvelopeReceiverList getReceiverList(final JobID jobID, final ChannelID sourceChannelID) {\n TransferEnvelopeReceiverList receiverList = this.receiverCache.get(sourceChannelID);\n if (receiverList == null) {\n try {\n while (true) {\n ConnectionInfoLookupResponse lookupResponse;\n synchronized (this.channelLookupService) {\n lookupResponse = this.channelLookupService.lookupConnectionInfo(this.localConnectionInfo, jobID, sourceChannelID);\n }\n if (lookupResponse.receiverNotFound()) {\n throw new IOException(\"String_Node_Str\" + sourceChannelID);\n }\n if (lookupResponse.receiverNotReady()) {\n Thread.sleep(500);\n continue;\n }\n if (lookupResponse.receiverReady()) {\n receiverList = new TransferEnvelopeReceiverList(lookupResponse);\n break;\n }\n }\n if (receiverList != null) {\n this.receiverCache.put(sourceChannelID, receiverList);\n if (LOG.isDebugEnabled()) {\n final StringBuilder sb = new StringBuilder();\n sb.append(\"String_Node_Str\" + sourceChannelID + \"String_Node_Str\" + this.localConnectionInfo + \"String_Node_Str\");\n if (receiverList.hasLocalReceivers()) {\n sb.append(\"String_Node_Str\");\n final Iterator<ChannelID> it = receiverList.getLocalReceivers().iterator();\n while (it.hasNext()) {\n sb.append(\"String_Node_Str\" + it.next() + \"String_Node_Str\");\n }\n }\n if (receiverList.hasRemoteReceivers()) {\n sb.append(\"String_Node_Str\");\n final Iterator<InetSocketAddress> it = receiverList.getRemoteReceivers().iterator();\n while (it.hasNext()) {\n sb.append(\"String_Node_Str\" + it.next() + \"String_Node_Str\");\n }\n }\n LOG.debug(sb.toString());\n }\n }\n } catch (InterruptedException ie) {\n } catch (IOException ioe) {\n }\n }\n return receiverList;\n}\n"
|
"public void revert(INDArray array, MinMaxStats stats) {\n array.subi(minRange);\n array.divi(maxRange - minRange);\n if (array.rank() <= 2) {\n array.muliRowVector(stats.getRange());\n array.addiRowVector(stats.getLower());\n } else {\n Nd4j.getExecutioner().execAndReturn(new BroadcastMulOp(array, stats.getRange(), array, 1));\n Nd4j.getExecutioner().execAndReturn(new BroadcastAddOp(array, stats.getLower(), array, 1));\n }\n}\n"
|
"public static ImageIcon getAccountStatusImage(ProtocolProviderService pps) {\n ImageIcon statusIcon;\n OperationSetPresence presence = pps.getOperationSet(OperationSetPresence.class);\n Image statusImage;\n byte[] protocolStatusIcon = null;\n if (presence != null)\n protocolStatusIcon = presence.getPresenceStatus().getStatusIcon();\n if (presence != null && protocolStatusIcon != null) {\n statusImage = ImageUtils.getBytesInImage(protocolStatusIcon);\n } else {\n byte[] bytes = pps.getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16);\n statusImage = (bytes == null) ? null : ImageUtils.getBytesInImage(bytes);\n if (!pps.isRegistered() && (statusImage != null)) {\n statusImage = LightGrayFilter.createDisabledImage(statusImage);\n }\n }\n statusIcon = new ImageIcon(getIndexedProtocolImage(statusImage, pps));\n return statusIcon;\n}\n"
|
"public void testResponse() throws NoSuchAlgorithmException {\n byte[] expected_A = trim(new BigInteger(\"String_Node_Str\", 16).toByteArray());\n byte[] expected_x = new BigInteger(\"String_Node_Str\", 16).toByteArray();\n byte[] expected_M1 = trim(new BigInteger(\"String_Node_Str\", 16).toByteArray());\n String username = \"String_Node_Str\", password = \"String_Node_Str\", salt = \"String_Node_Str\", a = \"String_Node_Str\";\n byte[] a_byte = new BigInteger(a, 16).toByteArray();\n LeapSRPSession client = new LeapSRPSession(username, password, a_byte);\n byte[] x = client.calculatePasswordHash(username, password, new BigInteger(salt, 16).toByteArray());\n assertTrue(Arrays.equals(x, expected_x));\n byte[] A = client.exponential();\n assertTrue(Arrays.equals(A, expected_A));\n String B = \"String_Node_Str\";\n byte[] M1 = client.response(new BigInteger(salt, 16).toByteArray(), new BigInteger(B, 16).toByteArray());\n assertTrue(Arrays.equals(M1, expected_M1));\n expected_A = trim(new BigInteger(\"String_Node_Str\", 16).toByteArray());\n expected_M1 = trim(new BigInteger(\"String_Node_Str\", 16).toByteArray());\n a = \"String_Node_Str\";\n a_byte = new BigInteger(a, 16).toByteArray();\n params = new SRPParameters(new BigInteger(ConfigHelper.NG_1024, 16).toByteArray(), new BigInteger(\"String_Node_Str\").toByteArray(), new BigInteger(salt, 16).toByteArray(), \"String_Node_Str\");\n client = new LeapSRPSession(username, password, params, a_byte);\n x = client.calculatePasswordHash(username, password, new BigInteger(salt, 16).toByteArray());\n A = client.exponential();\n B = \"String_Node_Str\";\n M1 = client.response(new BigInteger(salt, 16).toByteArray(), new BigInteger(B, 16).toByteArray());\n assertTrue(Arrays.equals(M1, expected_M1));\n expected_M1 = new BigInteger(\"String_Node_Str\", 16).toByteArray();\n expected_A = new BigInteger(\"String_Node_Str\", 16).toByteArray();\n B = \"String_Node_Str\";\n a = \"String_Node_Str\";\n a_byte = new BigInteger(a, 16).toByteArray();\n params = new SRPParameters(new BigInteger(ConfigHelper.NG_1024, 16).toByteArray(), new BigInteger(\"String_Node_Str\").toByteArray(), new BigInteger(salt, 16).toByteArray(), \"String_Node_Str\");\n client = new LeapSRPSession(username, password, params, a_byte);\n x = client.calculatePasswordHash(username, password, new BigInteger(salt, 16).toByteArray());\n A = client.exponential();\n M1 = client.response(new BigInteger(salt, 16).toByteArray(), new BigInteger(B, 16).toByteArray());\n assertTrue(Arrays.equals(M1, expected_M1));\n}\n"
|
"protected final Address advanceToBlock(Address block, int sizeClass) {\n if (LAZY_SWEEP)\n return makeFreeListFromLiveBits(block, sizeClass, msSpace.getMarkState());\n else\n return getFreeList(block);\n}\n"
|
"public void onActionResult(boolean succeeded) {\n mIsModeratingComment = false;\n if (succeeded && mOnCommentChangeListener != null)\n mOnCommentChangeListener.onCommentChanged(ChangedFrom.COMMENT_DETAIL);\n if (hasActivity()) {\n mLayoutButtons.setEnabled(true);\n if (succeeded) {\n mComment.setStatus(CommentStatus.toString(newStatus));\n } else {\n ToastUtils.showToast(getActivity(), R.string.error_moderate_comment, ToastUtils.Duration.LONG);\n }\n updateStatusViews();\n }\n updateStatusViews();\n}\n"
|
"protected void prepareHandlers(final Context context) {\n addHandler(Attributes.View.OnClick, new EventProcessor<V>(context) {\n public void setOnEventListener(final V view, final ParserContext parserContext, final JsonElement attributeValue) {\n view.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n fireEvent(view, parserContext, EventType.OnClick, attributeValue);\n }\n });\n }\n });\n addHandler(Attributes.View.Background, new DrawableResourceProcessor<V>(context) {\n public void setDrawable(V view, Drawable drawable) {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n view.setBackgroundDrawable(drawable);\n } else {\n view.setBackground(drawable);\n }\n }\n });\n addHandler(Attributes.View.Height, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n layoutParams.height = ParseHelper.parseDimension(attributeValue, context);\n view.setLayoutParams(layoutParams);\n }\n });\n addHandler(Attributes.View.Width, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n layoutParams.width = ParseHelper.parseDimension(attributeValue, context);\n view.setLayoutParams(layoutParams);\n }\n });\n addHandler(Attributes.View.Weight, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n LinearLayout.LayoutParams layoutParams;\n if (view.getLayoutParams() instanceof LinearLayout.LayoutParams) {\n layoutParams = (LinearLayout.LayoutParams) view.getLayoutParams();\n layoutParams.weight = ParseHelper.parseFloat(attributeValue);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(attributeKey + \"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.LayoutGravity, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n if (layoutParams instanceof LinearLayout.LayoutParams) {\n LinearLayout.LayoutParams linearLayoutParams = (LinearLayout.LayoutParams) layoutParams;\n linearLayoutParams.gravity = ParseHelper.parseGravity(attributeValue);\n view.setLayoutParams(layoutParams);\n } else if (layoutParams instanceof FrameLayout.LayoutParams) {\n FrameLayout.LayoutParams linearLayoutParams = (FrameLayout.LayoutParams) layoutParams;\n linearLayoutParams.gravity = ParseHelper.parseGravity(attributeValue);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(attributeKey + \"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.Padding, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(dimension, dimension, dimension, dimension);\n }\n });\n addHandler(Attributes.View.PaddingLeft, new DimensionAttributeProcessor<V>() {\n\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(dimension, view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingTop, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), dimension, view.getPaddingRight(), view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingRight, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), dimension, view.getPaddingBottom());\n }\n });\n addHandler(Attributes.View.PaddingBottom, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), view.getPaddingRight(), dimension);\n }\n });\n addHandler(Attributes.View.Margin, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int dimension = ParseHelper.parseDimension(attributeValue, context);\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(dimension, dimension, dimension, dimension);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginLeft, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(dimension, layoutParams.topMargin, layoutParams.rightMargin, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginTop, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, dimension, layoutParams.rightMargin, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginRight, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, dimension, layoutParams.bottomMargin);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MarginBottom, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {\n ViewGroup.MarginLayoutParams layoutParams;\n layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();\n layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, layoutParams.rightMargin, dimension);\n view.setLayoutParams(layoutParams);\n } else {\n if (logger.isErrorEnabled()) {\n logger.error(\"String_Node_Str\");\n }\n }\n }\n });\n addHandler(Attributes.View.MinHeight, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n view.setMinimumHeight(dimension);\n }\n });\n addHandler(Attributes.View.MinWidth, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n view.setMinimumWidth(dimension);\n }\n });\n addHandler(Attributes.View.Elevation, new DimensionAttributeProcessor<V>() {\n public void setDimension(V view, String attributeKey, int dimension) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n view.setElevation(dimension);\n }\n }\n });\n addHandler(Attributes.View.Alpha, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setAlpha(ParseHelper.parseFloat(attributeValue));\n }\n });\n addHandler(Attributes.View.Visibility, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setVisibility(ParseHelper.parseVisibility(attributeValue));\n }\n });\n addHandler(Attributes.View.Invisibility, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setVisibility(ParseHelper.parseInvisibility(attributeValue));\n }\n });\n addHandler(Attributes.View.Id, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setId(IdGenerator.getInstance().getUnique(attributeValue));\n }\n });\n addHandler(Attributes.View.ContentDescription, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setContentDescription(attributeValue);\n }\n });\n addHandler(Attributes.View.Clickable, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n boolean clickable = ParseHelper.parseBoolean(attributeValue);\n view.setClickable(clickable);\n }\n });\n addHandler(Attributes.View.Tag, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setTag(attributeValue);\n }\n });\n addHandler(Attributes.View.Border, new JsonDataProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, JsonElement attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n Drawable border = Utils.getBorderDrawble(attributeValue, context);\n if (border == null) {\n return;\n }\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n view.setBackgroundDrawable(border);\n } else {\n view.setBackground(border);\n }\n }\n });\n addHandler(Attributes.View.Enabled, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n boolean enabled = ParseHelper.parseBoolean(attributeValue);\n view.setEnabled(enabled);\n }\n });\n addHandler(Attributes.View.Style, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n Styles styles = parserContext.getStyles();\n LayoutHandler handler = parserContext.getLayoutBuilder().getHandler(Utils.getPropertyAsString(layout, ProteusConstants.TYPE));\n if (styles == null) {\n return;\n }\n String[] styleSet = attributeValue.split(ProteusConstants.STYLE_DELIMITER);\n for (String styleName : styleSet) {\n if (styles.contains(styleName)) {\n process(styles.getStyle(styleName), layout, proteusView, (handler != null ? handler : ViewParser.this), parserContext.getLayoutBuilder(), parserContext, parent, index);\n }\n }\n }\n private void process(Map<String, JsonElement> style, JsonObject layout, ProteusView proteusView, LayoutHandler handler, LayoutBuilder builder, ParserContext parserContext, ProteusView parent, int index) {\n for (Map.Entry<String, JsonElement> attribute : style.entrySet()) {\n if (layout.has(attribute.getKey())) {\n continue;\n }\n builder.handleAttribute(handler, parserContext, attribute.getKey(), attribute.getValue(), layout, proteusView, parent, index);\n }\n }\n });\n addHandler(Attributes.View.TransitionName, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n view.setTransitionName(attributeValue);\n }\n }\n });\n addHandler(Attributes.View.RequiresFadingEdge, new StringAttributeProcessor<V>() {\n private final String NONE = \"String_Node_Str\";\n private final String BOTH = \"String_Node_Str\";\n private final String VERTICAL = \"String_Node_Str\";\n private final String HORIZONTAL = \"String_Node_Str\";\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n switch(attributeValue) {\n case NONE:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n case BOTH:\n view.setVerticalFadingEdgeEnabled(true);\n view.setHorizontalFadingEdgeEnabled(true);\n break;\n case VERTICAL:\n view.setVerticalFadingEdgeEnabled(true);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n case HORIZONTAL:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(true);\n break;\n default:\n view.setVerticalFadingEdgeEnabled(false);\n view.setHorizontalFadingEdgeEnabled(false);\n break;\n }\n }\n });\n addHandler(Attributes.View.FadingEdgeLength, new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n view.setFadingEdgeLength(ParseHelper.parseInt(attributeValue));\n }\n });\n final HashMap<String, Integer> relativeLayoutParams = new HashMap<>();\n relativeLayoutParams.put(Attributes.View.Above.getName(), RelativeLayout.ABOVE);\n relativeLayoutParams.put(Attributes.View.AlignBaseline.getName(), RelativeLayout.ALIGN_BASELINE);\n relativeLayoutParams.put(Attributes.View.AlignBottom.getName(), RelativeLayout.ALIGN_BOTTOM);\n relativeLayoutParams.put(Attributes.View.AlignEnd.getName(), RelativeLayout.ALIGN_END);\n relativeLayoutParams.put(Attributes.View.AlignLeft.getName(), RelativeLayout.ALIGN_LEFT);\n relativeLayoutParams.put(Attributes.View.AlignParentBottom.getName(), RelativeLayout.ALIGN_PARENT_BOTTOM);\n relativeLayoutParams.put(Attributes.View.AlignParentEnd.getName(), RelativeLayout.ALIGN_PARENT_END);\n relativeLayoutParams.put(Attributes.View.AlignParentLeft.getName(), RelativeLayout.ALIGN_PARENT_LEFT);\n relativeLayoutParams.put(Attributes.View.AlignParentRight.getName(), RelativeLayout.ALIGN_PARENT_RIGHT);\n relativeLayoutParams.put(Attributes.View.AlignParentStart.getName(), RelativeLayout.ALIGN_PARENT_START);\n relativeLayoutParams.put(Attributes.View.AlignParentTop.getName(), RelativeLayout.ALIGN_PARENT_TOP);\n relativeLayoutParams.put(Attributes.View.AlignRight.getName(), RelativeLayout.ALIGN_RIGHT);\n relativeLayoutParams.put(Attributes.View.AlignStart.getName(), RelativeLayout.ALIGN_START);\n relativeLayoutParams.put(Attributes.View.AlignTop.getName(), RelativeLayout.ALIGN_TOP);\n relativeLayoutParams.put(Attributes.View.Below.getName(), RelativeLayout.BELOW);\n relativeLayoutParams.put(Attributes.View.CenterHorizontal.getName(), RelativeLayout.CENTER_HORIZONTAL);\n relativeLayoutParams.put(Attributes.View.CenterInParent.getName(), RelativeLayout.CENTER_IN_PARENT);\n relativeLayoutParams.put(Attributes.View.CenterVertical.getName(), RelativeLayout.CENTER_VERTICAL);\n relativeLayoutParams.put(Attributes.View.ToEndOf.getName(), RelativeLayout.END_OF);\n relativeLayoutParams.put(Attributes.View.ToLeftOf.getName(), RelativeLayout.LEFT_OF);\n relativeLayoutParams.put(Attributes.View.ToRightOf.getName(), RelativeLayout.RIGHT_OF);\n relativeLayoutParams.put(Attributes.View.ToStartOf.getName(), RelativeLayout.START_OF);\n StringAttributeProcessor<V> relativeLayoutProcessor = new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int id = IdGenerator.getInstance().getUnique(attributeValue);\n Integer rule = relativeLayoutParams.get(attributeKey);\n ParseHelper.addRelativeLayoutRule(view, rule, id);\n }\n };\n StringAttributeProcessor<V> relativeLayoutBooleanProcessor = new StringAttributeProcessor<V>() {\n public void handle(ParserContext parserContext, String attributeKey, String attributeValue, V view, ProteusView proteusView, ProteusView parent, JsonObject layout, int index) {\n int trueOrFalse = ParseHelper.parseRelativeLayoutBoolean(attributeValue);\n ParseHelper.addRelativeLayoutRule(view, relativeLayoutParams.get(attributeKey), trueOrFalse);\n }\n };\n addHandler(Attributes.View.Above, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignBaseline, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignBottom, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignEnd, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignLeft, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignRight, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignStart, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignTop, relativeLayoutProcessor);\n addHandler(Attributes.View.Below, relativeLayoutProcessor);\n addHandler(Attributes.View.ToEndOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToLeftOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToRightOf, relativeLayoutProcessor);\n addHandler(Attributes.View.ToStartOf, relativeLayoutProcessor);\n addHandler(Attributes.View.AlignParentBottom, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentEnd, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentLeft, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentRight, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentStart, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.AlignParentTop, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterHorizontal, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterInParent, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.CenterVertical, relativeLayoutBooleanProcessor);\n addHandler(Attributes.View.Animation, new TweenAnimationResourceProcessor<V>(context) {\n public void setAnimation(V view, Animation animation) {\n view.setAnimation(animation);\n }\n });\n}\n"
|
"public final void log(ConnectionFactory connectionFactory) throws ResourceException {\n try {\n T eventBuilder = getEventBuilder().transactionIdFromRootContext(context).timestamp(System.currentTimeMillis()).eventName(getEventName()).authenticationFromSecurityContext(context).action(null != syncOperation ? syncOperation.action : null).exception(exception).linkQualifier(linkQualifier).mapping(mapping).message(message).messageDetail(messageDetail).situation(null != syncOperation ? syncOperation.situation : null).sourceObjectId(sourceObjectId).status(status).targetObjectId(targetObjectId);\n AuditEvent auditEvent = applyCustomFields(eventBuilder).toEvent();\n connectionFactory.getConnection().create(context, Requests.newCreateRequest(getAuditPath(), auditEvent.getValue()));\n } catch (ResourceException e) {\n throw e;\n } catch (Exception e) {\n throw new InternalServerErrorException(e.getMessage(), e);\n }\n}\n"
|
"public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {\n if (side != EnumFacing.UP) {\n return EnumActionResult.FAIL;\n }\n if (world.isRemote)\n return EnumActionResult.SUCCESS;\n IBlockState iblockstate = world.getBlockState(targetPos);\n Block block = iblockstate.getBlock();\n boolean replaceable = block.isReplaceable(world, pos);\n if (!replaceable) {\n pos = pos.up();\n }\n int direction = MathHelper.floor_double((player.rotationYaw * 4F) / 360F + 0.5D) & 3;\n EnumFacing facing = EnumFacing.getHorizontal(direction);\n BlockPos other = pos.offset(facing);\n boolean other_replaceable = block.isReplaceable(world, other);\n boolean flag1 = world.isAirBlock(pos) || replaceable;\n boolean flag2 = world.isAirBlock(other) || other_replaceable;\n if (player.canPlayerEdit(pos, side, stack) && player.canPlayerEdit(other, side, stack)) {\n VampirismMod.log.t(\"String_Node_Str\", flag1, flag2, UtilLib.doesBlockHaveSolidTopSurface(world, pos.down()), UtilLib.doesBlockHaveSolidTopSurface(world, other.down()));\n if (flag1 && flag2 && UtilLib.doesBlockHaveSolidTopSurface(world, pos.down()) && UtilLib.doesBlockHaveSolidTopSurface(world, other.down())) {\n IBlockState state1 = ModBlocks.medChair.getDefaultState().withProperty(BlockMedChair.PART, BlockMedChair.EnumPart.BOTTOM).withProperty(BlockMedChair.FACING, facing.getOpposite());\n if (world.setBlockState(pos, state1, 3)) {\n IBlockState state2 = state1.withProperty(BlockMedChair.PART, BlockMedChair.EnumPart.TOP).withProperty(BlockMedChair.FACING, facing.getOpposite());\n world.setBlockState(other, state2, 3);\n }\n --stack.stackSize;\n return EnumActionResult.SUCCESS;\n }\n }\n return EnumActionResult.FAIL;\n}\n"
|
"public void onUnrarEvent(int id, UnrarWrapper wrapper) {\n switch(id) {\n case JDUnrarConstants.WRAPPER_EXTRACTION_FAILED:\n if (wrapper.getException() != null) {\n wrapper.getDownloadLink().getLinkStatus().setErrorMessage(\"String_Node_Str\" + wrapper.getException().getMessage());\n wrapper.getDownloadLink().requestGuiUpdate();\n } else {\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n }\n this.onFinished(wrapper);\n break;\n case JDUnrarConstants.WRAPPER_FAILED_PASSWORD:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n this.onFinished(wrapper);\n break;\n case JDUnrarConstants.WRAPPER_CRACK_PASSWORD:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n break;\n case JDUnrarConstants.WRAPPER_NEW_STATUS:\n break;\n case JDUnrarConstants.WRAPPER_START_OPEN_ARCHIVE:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n break;\n case JDUnrarConstants.WRAPPER_OPEN_ARCHIVE_SUCCESS:\n break;\n case JDUnrarConstants.WRAPPER_PASSWORD_FOUND:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n break;\n case JDUnrarConstants.WRAPPER_ON_PROGRESS:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n if (wrapper.getDownloadLink().getPluginProgress() == null) {\n wrapper.getDownloadLink().setPluginProgress(new PluginProgress(wrapper.getExtractedSize(), wrapper.getTotalSize(), Color.YELLOW.darker()));\n } else {\n wrapper.getDownloadLink().getPluginProgress().setCurrent(wrapper.getExtractedSize());\n }\n wrapper.getDownloadLink().requestGuiUpdate();\n break;\n case JDUnrarConstants.WRAPPER_START_EXTRACTION:\n break;\n case JDUnrarConstants.WRAPPER_STARTED:\n break;\n case JDUnrarConstants.WRAPPER_EXTRACTION_FAILED_CRC:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().reset();\n wrapper.getDownloadLink().requestGuiUpdate();\n this.onFinished(wrapper);\n break;\n case JDUnrarConstants.WRAPPER_PROGRESS_SINGLE_FILE_FINISHED:\n break;\n case JDUnrarConstants.WRAPPER_FINISHED_SUCCESSFULL:\n wrapper.getDownloadLink().getLinkStatus().setStatusText(\"String_Node_Str\");\n wrapper.getDownloadLink().requestGuiUpdate();\n this.onFinished(wrapper);\n break;\n default:\n System.out.println(\"String_Node_Str\");\n }\n}\n"
|
"public int getFormat() {\n return ImageFormat.YUV_420_888;\n}\n"
|
"private IMetadataColumn parseFieldToMetadataColumn(Field field) {\n if (field == null) {\n return null;\n }\n IMetadataColumn mdColumn = new org.talend.core.model.metadata.MetadataColumn();\n mdColumn.setLabel(field.getName());\n mdColumn.setKey(false);\n String type = field.getType().toString();\n String talendType = \"String_Node_Str\";\n if (type.equals(\"String_Node_Str\")) {\n talendType = \"String_Node_Str\";\n } else if (type.equals(\"String_Node_Str\")) {\n talendType = \"String_Node_Str\";\n } else if (type.equals(\"String_Node_Str\") || type.equals(\"String_Node_Str\")) {\n talendType = \"String_Node_Str\";\n } else if (type.equals(\"String_Node_Str\") || type.equals(\"String_Node_Str\")) {\n talendType = \"String_Node_Str\";\n } else {\n talendType = \"String_Node_Str\";\n }\n mdColumn.setTalendType(\"String_Node_Str\" + talendType);\n mdColumn.setNullable(field.isNillable());\n if (type.equals(\"String_Node_Str\")) {\n mdColumn.setPattern(\"String_Node_Str\");\n } else if (type.equals(\"String_Node_Str\")) {\n mdColumn.setPattern(\"String_Node_Str\");\n } else {\n mdColumn.setPattern(null);\n }\n mdColumn.setLength(field.getLength());\n mdColumn.setPrecision(field.getPrecision());\n mdColumn.setDefault(field.getDefaultValueFormula());\n return mdColumn;\n}\n"
|
"public void doSpecial() {\n for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {\n if (Dungeon.level.heroFOV[mob.pos]) {\n Buff.affect(mob, Burning.class).reignite(mob);\n Buff.prolong(mob, Roots.class, 3);\n }\n }\n curUser.HP -= (curUser.HP / 3);\n curUser.spend(Actor.TICK);\n curUser.sprite.operate(curUser.pos);\n curUser.busy();\n curUser.sprite.centerEmitter().start(ElmoParticle.FACTORY, 0.15f, 4);\n Sample.INSTANCE.play(Assets.SND_READ);\n}\n"
|
"private static void printPages(int pages, int mode) {\n double mb = (double) (pages << LOG_BYTES_IN_PAGE) / (double) (1 << 20);\n switch(mode) {\n case PAGES:\n Log.write(pages);\n Log.write(\"String_Node_Str\");\n break;\n case MB:\n Log.write(mb);\n Log.write(\"String_Node_Str\");\n break;\n case PAGES_MB:\n Log.write(pages);\n Log.write(\"String_Node_Str\");\n Log.write(mb);\n Log.write(\"String_Node_Str\");\n break;\n case MB_PAGES:\n Log.write(mb);\n Log.write(\"String_Node_Str\");\n Log.write(pages);\n Log.write(\"String_Node_Str\");\n break;\n default:\n Assert.fail(\"String_Node_Str\");\n }\n}\n"
|
"public void run() throws PersistenceException {\n try {\n for (String name : names) {\n String path = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();\n path = path + File.separatorChar + projectLabel + File.separatorChar + ERepositoryObjectType.getFolderName(ERepositoryObjectType.LIBS) + File.separatorChar + name;\n File libsTargetFile = new File(path);\n File source = null;\n EMap<String, String> jarsToRelative = LibrariesIndexManager.getInstance().getIndex().getJarsToRelativePath();\n String relativePath = jarsToRelative.get(name);\n if (relativePath != null) {\n if (!relativePath.startsWith(\"String_Node_Str\")) {\n relativePath = \"String_Node_Str\" + relativePath;\n }\n try {\n URI uri = new URI(relativePath);\n URL url = FileLocator.toFileURL(uri.toURL());\n source = new File(url.getFile());\n } catch (URISyntaxException e) {\n CommonExceptionHandler.process(e);\n }\n }\n if (source == null) {\n source = new File(PreferencesUtilities.getLibrariesPath(ECodeLanguage.JAVA) + File.separatorChar + name);\n }\n FilesUtils.copyFile(source, libsTargetFile);\n synJavaLibs(source);\n }\n eclipseProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());\n } catch (IOException e) {\n ExceptionHandler.process(e);\n } catch (CoreException e) {\n ExceptionHandler.process(e);\n }\n}\n"
|
"public static boolean checkBilanLibelleValue(String bilanLibelle) {\n if (BILAN_LIBELLE_ADULTESISOLES.equals(bilanLibelle) || BILAN_LIBELLE_ENFANTS.equals(bilanLibelle) || BILAN_LIBELLE_JEUNES.equals(bilanLibelle) || BILAN_LIBELLE_SENIORS.equals(bilanLibelle)) {\n return true;\n } else {\n return false;\n }\n}\n"
|
"public int[] getSlotsForStructureFace(EnumFacing side, BlockPos local) {\n return globalLocationMaterialInput.equals(local) ? slotsMaterialInput : slotsDefault;\n}\n"
|
"public boolean isReceivingAudio() {\n return !_phone.getCallService().isRemoteAudioMuted(getKey());\n}\n"
|
"private ColumnInfo[] generateColumnInfo(List<String> columns) throws SQLException {\n Map<String, Integer> columnNameToTypeMap = Maps.newLinkedHashMap();\n DatabaseMetaData dbmd = conn.getMetaData();\n String escapedTableName = StringUtil.escapeLike(tableName);\n String[] schemaAndTable = escapedTableName.split(\"String_Node_Str\");\n ResultSet rs = null;\n try {\n rs = dbmd.getColumns(null, (schemaAndTable.length == 1 ? \"String_Node_Str\" : schemaAndTable[0]), (schemaAndTable.length == 1 ? escapedTableName : schemaAndTable[1]), null);\n while (rs.next()) {\n columnNameToTypeMap.put(rs.getString(QueryUtil.COLUMN_NAME_POSITION), rs.getInt(QueryUtil.DATA_TYPE_POSITION));\n }\n } finally {\n if (rs != null) {\n rs.close();\n }\n }\n ColumnInfo[] columnType;\n if (columns == null) {\n int i = 0;\n columnType = new ColumnInfo[columnNameToTypeMap.size()];\n for (Map.Entry<String, Integer> entry : columnNameToTypeMap.entrySet()) {\n columnType[i++] = new ColumnInfo('\"' + entry.getKey() + '\"', entry.getValue());\n }\n } else {\n columnType = new ColumnInfo[columns.size()];\n for (int i = 0; i < columns.size(); i++) {\n String columnName = SchemaUtil.normalizeIdentifier(columns.get(i).trim());\n Integer sqlType = columnNameToTypeMap.get(columnName);\n if (sqlType == null) {\n if (isStrict) {\n throw new SQLExceptionInfo.Builder(SQLExceptionCode.COLUMN_NOT_FOUND).setColumnName(columnName).setTableName(tableName).build().buildException();\n }\n unfoundColumnCount++;\n } else {\n columnType[i] = new ColumnInfo(columnName, sqlType);\n }\n }\n if (unfoundColumnCount == columns.size()) {\n throw new SQLExceptionInfo.Builder(SQLExceptionCode.COLUMN_NOT_FOUND).setColumnName(Arrays.toString(columns.toArray(new String[0]))).setTableName(tableName).build().buildException();\n }\n }\n return columnType;\n}\n"
|
"static java.sql.Time parseSqlTime(final String value) {\n try {\n return new Time(getSqlTimeFormat().parse(value).getTime());\n } catch (ParseException e) {\n return throwRuntimeParseException(value, e, sqlTimeFormat);\n }\n}\n"
|
"public boolean accept(File dir, String name) {\n return name.toLowerCase(Locale.ENGLISH).endsWith(\"String_Node_Str\");\n}\n"
|
"ActivityRecord findTaskLocked(ActivityRecord target) {\n Intent intent = target.intent;\n ActivityInfo info = target.info;\n ComponentName cls = intent.getComponent();\n if (info.targetActivity != null) {\n cls = new ComponentName(info.packageName, info.targetActivity);\n }\n final int userId = UserHandle.getUserId(info.applicationInfo.uid);\n boolean isDocument = intent != null & intent.isDocument();\n Uri documentData = isDocument ? intent.getData() : null;\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + target + \"String_Node_Str\" + this);\n for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {\n final TaskRecord task = mTaskHistory.get(taskNdx);\n if (task.voiceSession != null) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + task + \"String_Node_Str\");\n continue;\n }\n if (task.userId != userId) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + task + \"String_Node_Str\");\n continue;\n }\n final ActivityRecord r = task.getTopActivity();\n if (r == null || r.finishing || r.userId != userId || r.launchMode == ActivityInfo.LAUNCH_SINGLE_INSTANCE) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + task + \"String_Node_Str\" + r);\n continue;\n }\n final Intent taskIntent = task.intent;\n final Intent affinityIntent = task.affinityIntent;\n final boolean taskIsDocument;\n final Uri taskDocumentData;\n if (taskIntent != null && taskIntent.isDocument()) {\n taskIsDocument = true;\n taskDocumentData = taskIntent.getData();\n } else if (affinityIntent != null && affinityIntent.isDocument()) {\n taskIsDocument = true;\n taskDocumentData = affinityIntent.getData();\n } else {\n taskIsDocument = false;\n taskDocumentData = null;\n }\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + taskIntent.getComponent().flattenToShortString() + \"String_Node_Str\" + r.task.rootAffinity + \"String_Node_Str\" + intent.getComponent().flattenToShortString() + \"String_Node_Str\" + info.taskAffinity);\n if (!isDocument && !taskIsDocument && task.rootAffinity != null) {\n if (task.rootAffinity.equals(target.taskAffinity)) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\");\n return r;\n }\n } else if (taskIntent != null && taskIntent.getComponent() != null && taskIntent.getComponent().compareTo(cls) == 0 && Objects.equals(documentData, taskDocumentData)) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\");\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + intent + \"String_Node_Str\" + r.intent);\n return r;\n } else if (affinityIntent != null && affinityIntent.getComponent() != null && affinityIntent.getComponent().compareTo(cls) == 0 && Objects.equals(documentData, taskDocumentData)) {\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\");\n if (DEBUG_TASKS)\n Slog.d(TAG, \"String_Node_Str\" + intent + \"String_Node_Str\" + r.intent);\n return r;\n } else if (DEBUG_TASKS) {\n Slog.d(TAG, \"String_Node_Str\" + task);\n }\n }\n return null;\n}\n"
|
"protected IViewerReportDesignHandle getDesignHandle(HttpServletRequest request) {\n IViewerReportDesignHandle design = null;\n IReportRunnable reportRunnable = null;\n boolean isValidDocument = ParameterAccessor.isValidFilePath(this.reportDocumentName);\n if (isValidDocument) {\n IReportDocument reportDocumentInstance = ReportEngineService.getInstance().openReportDocument(this.reportDesignName, this.reportDocumentName, this.getModuleOptions(request));\n if (reportDocumentInstance != null) {\n reportRunnable = reportDocumentInstance.getReportRunnable();\n if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(request.getServletPath())) {\n this.parameterMap = reportDocumentInstance.getParameterValues();\n }\n if (ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT_DOCUMENT) != null)\n this.documentInUrl = true;\n reportDocumentInstance.close();\n }\n }\n if (reportRunnable == null) {\n if (ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_REPORT_DOCUMENT) && !ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_REPORT)) {\n if (isValidDocument)\n this.exception = new ViewerException(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_FILE_ERROR, new String[] { this.reportDocumentName });\n else\n this.exception = new ViewerException(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_ACCESS_ERROR, new String[] { this.reportDocumentName });\n return design;\n }\n if (!ParameterAccessor.isValidFilePath(this.reportDesignName)) {\n this.exception = new ViewerException(ResourceConstants.GENERAL_EXCEPTION_REPORT_ACCESS_ERROR, new String[] { this.reportDesignName });\n } else {\n try {\n File file = new File(this.reportDesignName);\n if (file.exists()) {\n reportRunnable = ReportEngineService.getInstance().openReportDesign(this.reportDesignName, this.getModuleOptions(request));\n } else if (!ParameterAccessor.isWorkingFolderAccessOnly()) {\n this.reportDesignName = ParameterAccessor.getParameter(request, ParameterAccessor.PARAM_REPORT);\n InputStream is = null;\n URL url = null;\n try {\n String reportPath = this.reportDesignName;\n if (!reportPath.startsWith(\"String_Node_Str\"))\n reportPath = \"String_Node_Str\" + reportPath;\n url = request.getSession().getServletContext().getResource(reportPath);\n if (url != null)\n is = url.openStream();\n if (is != null)\n reportRunnable = ReportEngineService.getInstance().openReportDesign(url.toString(), is, this.getModuleOptions(request));\n } catch (Exception e) {\n }\n reportRunnable = ReportEngineService.getInstance().openReportDesign(url.toString(), is, this.getModuleOptions(request));\n } else {\n this.exception = new ViewerException(ResourceConstants.GENERAL_EXCEPTION_REPORT_FILE_ERROR, new String[] { this.reportDesignName });\n }\n } catch (EngineException e) {\n this.exception = e;\n }\n }\n }\n if (reportRunnable != null) {\n design = new BirtViewerReportDesignHandle(IViewerReportDesignHandle.RPT_RUNNABLE_OBJECT, reportRunnable);\n }\n return design;\n}\n"
|
"public static void tryMatchOrError(ArrayDeque<HtmlTagEntry> openStack, ArrayDeque<HtmlTagEntry> closeQueue, ErrorReporter errorReporter) {\n while (!openStack.isEmpty() && !closeQueue.isEmpty()) {\n if (!matchOrError(openStack.pollFirst(), closeQueue.pollFirst(), errorReporter)) {\n return false;\n }\n }\n}\n"
|
"private void checkSchema() {\n boolean canEditSchema = false;\n boolean noSchema = false;\n for (IElementParameter param : this.getElementParameters()) {\n if (param.isShow(getElementParameters()) && param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)) {\n canEditSchema = true;\n break;\n }\n }\n INodeConnector mainConnector;\n if (isELTComponent()) {\n mainConnector = this.getConnectorFromType(EConnectionType.TABLE);\n } else {\n mainConnector = this.getConnectorFromType(EConnectionType.FLOW_MAIN);\n }\n List<INodeConnector> mainConnectors = this.getConnectorsFromType(EConnectionType.FLOW_MAIN);\n if (mainConnector != null && !isExternalNode()) {\n IMetadataTable table = getMetadataFromConnector(mainConnector.getName());\n if (canEditSchema && table != null) {\n if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {\n for (int i = 0; i < table.getListColumns().size(); i++) {\n IMetadataColumn column = table.getListColumns().get(i);\n if (column.isCustom()) {\n continue;\n }\n String value = column.getPattern();\n String typevalue = column.getTalendType();\n if (JavaTypesManager.DATE.getId().equals(typevalue) || PerlTypesManager.DATE.equals(typevalue)) {\n if (value == null || \"String_Node_Str\".equals(value)) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.WARNING, this, errorMessage);\n noSchema = true;\n }\n }\n }\n }\n if ((mainConnector.getMaxLinkInput() == 0 || (\"String_Node_Str\".equals(getComponent().getName()) && (mainConnector.getMaxLinkInput() != 0) && getCurrentActiveLinksNbOutput(EConnectionType.FLOW_MAIN) > 0)) && (mainConnector.getMaxLinkOutput() != 0)) {\n if (table.getListColumns().size() == 0) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.WARNING, this, errorMessage);\n noSchema = true;\n }\n }\n } else {\n if ((mainConnector.getMaxLinkInput() != 0) && (mainConnector.getMaxLinkOutput() != 0)) {\n if (table != null && table.getListColumns().size() == 0) {\n noSchema = true;\n }\n }\n if (getCurrentActiveLinksNbInput(EConnectionType.FLOW_MAIN) == 0 && noSchema) {\n if ((getCurrentActiveLinksNbOutput(EConnectionType.FLOW_MAIN) > 0) || (getCurrentActiveLinksNbOutput(EConnectionType.FLOW_REF) > 0)) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n }\n ICoreTisService service = null;\n if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreTisService.class)) {\n service = (ICoreTisService) GlobalServiceRegister.getDefault().getService(ICoreTisService.class);\n }\n if (mainConnector != null && !noSchema && canEditSchema) {\n if (getMetadataList() != null) {\n for (IMetadataTable meta : getMetadataList()) {\n if (meta == null) {\n continue;\n }\n int nbDynamic = 0;\n for (IMetadataColumn col : meta.getListColumns()) {\n if (col.getTalendType() != null && col.getTalendType().equals(\"String_Node_Str\")) {\n nbDynamic++;\n }\n }\n if (!isJoblet()) {\n if (nbDynamic > 1) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n if (nbDynamic > 0 && service == null) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n if (nbDynamic > 0 && service != null) {\n if (!service.isSupportDynamicType(this.getComponent().getName())) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n }\n }\n }\n if (mainConnector != null && !noSchema && (!canEditSchema || isExternalNode())) {\n if (mainConnector.isMultiSchema()) {\n if (getMetadataList() != null) {\n for (IMetadataTable meta : getMetadataList()) {\n String componentName = this.getComponent().getName();\n if (!componentName.equals(\"String_Node_Str\") && meta.getListColumns().size() == 0 && !isCheckMultiSchemaForMSField() && checkSchemaForEBCDIC(meta)) {\n String tableLabel = meta.getTableName();\n if (meta.getLabel() != null) {\n tableLabel = meta.getLabel();\n }\n String errorMessage = Messages.getString(\"String_Node_Str\", tableLabel);\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n }\n }\n schemaSynchronized = true;\n if ((component.isSchemaAutoPropagated() && getComponent().getName().equals(\"String_Node_Str\")) && (getMetadataList().size() != 0)) {\n for (INodeConnector nodeConnector : mainConnectors) {\n INodeConnector actualConnector = nodeConnector;\n if (actualConnector != null) {\n int maxFlowInput = actualConnector.getMaxLinkInput();\n if (maxFlowInput <= 1 || getComponent().useLookup() || isELTComponent()) {\n IMetadataTable inputMeta = null, outputMeta = getMetadataList().get(0);\n if ((actualConnector.getMaxLinkInput() != 0) && (actualConnector.getMaxLinkOutput() != 0)) {\n IConnection inputConnecion = null;\n for (IConnection connection : inputs) {\n if (connection.isActivate() && (connection.getLineStyle().equals(EConnectionType.FLOW_MAIN) || connection.getLineStyle().equals(EConnectionType.TABLE))) {\n inputMeta = connection.getMetadataTable();\n inputConnecion = connection;\n }\n }\n if (inputMeta != null) {\n if ((!outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_IGNORE_KEY | IMetadataColumn.OPTIONS_IGNORE_NULLABLE | IMetadataColumn.OPTIONS_IGNORE_COMMENT | IMetadataColumn.OPTIONS_IGNORE_PATTERN | IMetadataColumn.OPTIONS_IGNORE_DBCOLUMNNAME | IMetadataColumn.OPTIONS_IGNORE_DBTYPE | IMetadataColumn.OPTIONS_IGNORE_DEFAULT | IMetadataColumn.OPTIONS_IGNORE_BIGGER_SIZE))) {\n if (!outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_NONE) && outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_IGNORE_LENGTH)) {\n String warningMessage = Messages.getString(\"String_Node_Str\", inputConnecion.getName());\n Problems.add(ProblemStatus.WARNING, this, warningMessage);\n } else {\n schemaSynchronized = false;\n String errorMessage = Messages.getString(\"String_Node_Str\", inputConnecion.getName());\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n }\n }\n }\n }\n }\n if ((component.isSchemaAutoPropagated() || getComponent().getComponentType() == EComponentType.JOBLET) && (getMetadataList().size() != 0)) {\n IConnection inputConnecion = null;\n INodeConnector nodeConn = getConnectorFromName(EConnectionType.FLOW_MAIN.getName());\n if (nodeConn != null) {\n int maxFlowInput = nodeConn.getMaxLinkInput();\n if (maxFlowInput <= 1 || getComponent().useLookup() || isELTComponent()) {\n IMetadataTable inputMeta = null, outputMeta = getMetadataList().get(0);\n for (IConnection connection : inputs) {\n if (connection.isActivate() && (connection.getLineStyle().equals(EConnectionType.FLOW_MAIN) || connection.getLineStyle().equals(EConnectionType.TABLE))) {\n inputMeta = connection.getMetadataTable();\n inputConnecion = connection;\n }\n }\n if (inputMeta != null) {\n INodeConnector connector = getConnectorFromName(outputMeta.getAttachedConnector());\n if (connector != null && ((connector.getMaxLinkInput() != 0 && connector.getMaxLinkOutput() != 0) || getComponent().getComponentType() == EComponentType.JOBLET_INPUT_OUTPUT) && (!outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_IGNORE_KEY | IMetadataColumn.OPTIONS_IGNORE_NULLABLE | IMetadataColumn.OPTIONS_IGNORE_COMMENT | IMetadataColumn.OPTIONS_IGNORE_PATTERN | IMetadataColumn.OPTIONS_IGNORE_DBCOLUMNNAME | IMetadataColumn.OPTIONS_IGNORE_DBTYPE | IMetadataColumn.OPTIONS_IGNORE_DEFAULT | IMetadataColumn.OPTIONS_IGNORE_BIGGER_SIZE))) {\n if (!outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_NONE) && outputMeta.sameMetadataAs(inputMeta, IMetadataColumn.OPTIONS_IGNORE_LENGTH)) {\n String warningMessage = Messages.getString(\"String_Node_Str\", inputConnecion.getName());\n Problems.add(ProblemStatus.WARNING, this, warningMessage);\n } else {\n schemaSynchronized = false;\n String errorMessage = Messages.getString(\"String_Node_Str\", inputConnecion.getName());\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n if (outputMeta != null) {\n for (int i = 0; i < outputMeta.getListColumns().size(); i++) {\n IMetadataColumn column = outputMeta.getListColumns().get(i);\n String sourceType = column.getType();\n String typevalue = column.getTalendType();\n String currentDbmsId = outputMeta.getDbms();\n if (currentDbmsId != null && !TypesManager.checkDBType(currentDbmsId, typevalue, sourceType)) {\n String errorMessage = \"String_Node_Str\";\n Problems.add(ProblemStatus.WARNING, this, errorMessage);\n }\n }\n }\n }\n } else {\n for (IElementParameter param : this.getElementParameters()) {\n if (param.isShow(getElementParameters()) && param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)) {\n IMetadataTable table = getMetadataFromConnector(param.getContext());\n IElementParameter connParam = param.getChildParameters().get(EParameterName.CONNECTION.getName());\n if (table != null && connParam != null && !StringUtils.isEmpty((String) connParam.getValue())) {\n for (IConnection connection : inputs) {\n if (connection.isActivate() && connection.getName().equals(connParam.getValue())) {\n if (!table.sameMetadataAs(connection.getMetadataTable(), IMetadataColumn.OPTIONS_IGNORE_KEY | IMetadataColumn.OPTIONS_IGNORE_NULLABLE | IMetadataColumn.OPTIONS_IGNORE_COMMENT | IMetadataColumn.OPTIONS_IGNORE_PATTERN | IMetadataColumn.OPTIONS_IGNORE_DBCOLUMNNAME | IMetadataColumn.OPTIONS_IGNORE_DBTYPE | IMetadataColumn.OPTIONS_IGNORE_DEFAULT | IMetadataColumn.OPTIONS_IGNORE_BIGGER_SIZE)) {\n schemaSynchronized = false;\n String errorMessage = Messages.getString(\"String_Node_Str\", connection.getName());\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n }\n }\n }\n }\n }\n }\n }\n }\n if (component.useMerge() && !this.getConnectorFromType(EConnectionType.FLOW_MERGE).isMergeAllowDifferentSchema()) {\n if (getMetadataList().get(0).getListColumns().size() == 0) {\n String errorMessage = Messages.getString(\"String_Node_Str\");\n Problems.add(ProblemStatus.ERROR, this, errorMessage);\n } else {\n if (inputs.size() > 0) {\n IMetadataTable firstSchema = inputs.get(0).getMetadataTable();\n boolean isSame = firstSchema.sameMetadataAs(getMetadataList().get(0));\n if (!isSame) {\n String warningMessage = Messages.getString(\"String_Node_Str\", getUniqueName());\n Problems.add(ProblemStatus.WARNING, this, warningMessage);\n }\n }\n }\n if (inputs.size() > 1) {\n IMetadataTable firstSchema = inputs.get(0).getMetadataTable();\n boolean isSame = true;\n for (int i = 1; i < inputs.size(); i++) {\n if (!firstSchema.sameMetadataAs(inputs.get(i).getMetadataTable(), IMetadataColumn.OPTIONS_IGNORE_DBCOLUMNNAME | IMetadataColumn.OPTIONS_IGNORE_DEFAULT | IMetadataColumn.OPTIONS_IGNORE_COMMENT | IMetadataColumn.OPTIONS_IGNORE_DBTYPE)) {\n isSame = false;\n break;\n }\n }\n if (!isSame) {\n String warningMessage = Messages.getString(\"String_Node_Str\", getUniqueName());\n Problems.add(ProblemStatus.WARNING, this, warningMessage);\n }\n }\n }\n syncSpecialSchema();\n}\n"
|
"public void removeSkill(String skillName) {\n DBSkills skillsdb = RCPlayer.plugin.getDatabase().find(DBSkills.class).where().ieq(\"String_Node_Str\", skillName).where().ieq(\"String_Node_Str\", player.getName()).findUnique();\n if (RCPermissions.removeParent(player, skillsdb.getGroupName())) {\n decreaseSkillCount();\n addSkillPoints(skillsdb.getSkillPoints());\n RCPlayer.plugin.getDatabase().delete(skillsdb);\n RCPlayer.plugin.getDatabase().save(skillsdb);\n return true;\n }\n return false;\n}\n"
|
"public void onUpdate(ItemStack is, World world, Entity entity, int slot, boolean isHeld) {\n if (world.isRemote) {\n if (is.hasTagCompound() && entity instanceof EntityPlayer) {\n NBTTagCompound nbt = ItemUtil.getNBT(is, false);\n currentBiome = nbt.getByte(\"String_Node_Str\");\n if (lastSavedX == Integer.MAX_VALUE && lastSavedZ == Integer.MAX_VALUE) {\n for (int x = entity.chunkCoordX - 96, z; x <= entity.chunkCoordX + 96; x++) {\n for (z = entity.chunkCoordZ - 96; z <= entity.chunkCoordZ + 96; z++) {\n byte biome = IslandSpawnChecker.getIslandBiomeAt(x, z, nbt.getLong(\"String_Node_Str\"), nbt.getInteger(\"String_Node_Str\"));\n if (biome != -1)\n locations.get(biome).add(new BlockPosM(x * 16 + (IslandSpawnChecker.featureSize >> 1), 0, z * 16 + (IslandSpawnChecker.featureSize >> 1)));\n }\n }\n lastSavedX = entity.chunkCoordX;\n lastSavedZ = entity.chunkCoordZ;\n } else if (MathUtil.square(entity.chunkCoordX - lastSavedX) + MathUtil.square(entity.chunkCoordZ - lastSavedZ) > 250F) {\n lastSavedX = lastSavedZ = Integer.MAX_VALUE;\n }\n }\n } else {\n NBTTagCompound nbt = ItemUtil.getNBT(is, true);\n if (entity instanceof EntityPlayerMP) {\n EntityPlayerMP player = (EntityPlayerMP) entity;\n if (!player.getStatFile().hasAchievementUnlocked(AchievementManager.BIOME_COMPASS))\n player.addStat(AchievementManager.BIOME_COMPASS, 1);\n }\n if (is.stackTagCompound == null)\n is.stackTagCompound = new NBTTagCompound();\n if (!nbt.hasKey(\"String_Node_Str\")) {\n nbt.setLong(\"String_Node_Str\", world.getSeed());\n nbt.setShort(\"String_Node_Str\", (short) (1 + WorldDataHandler.<DragonSavefile>get(DragonSavefile.class).getDragonDeathAmount()));\n } else if (isHeld && entity.dimension == 1 && entity.ticksExisted % 100 == 0) {\n int seed2 = 1 + WorldDataHandler.<DragonSavefile>get(DragonSavefile.class).getDragonDeathAmount();\n if (seed2 != nbt.getShort(\"String_Node_Str\"))\n nbt.setShort(\"String_Node_Str\", (short) seed2);\n }\n }\n}\n"
|
"public void write(final String filename) throws DITAOTException {\n final File inputFile = new File(filename);\n final File outputFile = new File(filename + FILE_EXTENSION_TEMP);\n try {\n final Transformer transformer = TransformerFactory.newInstance().newTransformer();\n final XMLReader reader = StringUtils.getXMLReader();\n setParent(reader);\n setContentHandler(null);\n in = new BufferedInputStream(new FileInputStream(inputFile));\n out = new BufferedOutputStream(new FileOutputStream(outputFile));\n final Source source = new SAXSource(this, new InputSource(in));\n final Result result = new StreamResult(out);\n transformer.transform(source, result);\n if (!inputFile.delete()) {\n final Properties prop = new Properties();\n prop.put(\"String_Node_Str\", inputFile.getPath());\n prop.put(\"String_Node_Str\", outputFile.getPath());\n logger.logError(MessageUtils.getMessage(\"String_Node_Str\", prop).toString());\n }\n if (!outputFile.renameTo(inputFile)) {\n final Properties prop = new Properties();\n prop.put(\"String_Node_Str\", inputFile.getPath());\n prop.put(\"String_Node_Str\", outputFile.getPath());\n logger.logError(MessageUtils.getMessage(\"String_Node_Str\", prop).toString());\n }\n } catch (final Exception e) {\n logger.logException(e);\n }\n}\n"
|
"private Collection<URL> getScripts(FileModel userRulesFileModel) {\n String userRulesDirectory = userRulesFileModel == null ? null : userRulesFileModel.getFilePath();\n List<URL> scripts = scanner.scan(GROOVY_RULES_EXTENSION);\n if (userRulesPath == null) {\n return scripts;\n }\n final List<URL> results = new ArrayList<>(scripts);\n try {\n Files.walkFileTree(Paths.get(userRulesPath), new SimpleFileVisitor<Path>() {\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (file.getFileName().toString().endsWith(GROOVY_RULES_EXTENSION)) {\n results.add(file.toUri().toURL());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n throw new WindupException(\"String_Node_Str\" + userRulesPath + \"String_Node_Str\" + e.getMessage(), e);\n }\n return results;\n}\n"
|
"private Node tryFoldTypeof(Node originalTypeofNode) {\n Preconditions.checkArgument(originalTypeofNode.getType() == Token.TYPEOF);\n Node argumentNode = originalTypeofNode.getFirstChild();\n if (argumentNode == null || !NodeUtil.isLiteralValue(argumentNode, true)) {\n return originalTypeofNode;\n }\n String typeNameString = null;\n switch(argumentNode.getType()) {\n case Token.STRING:\n typeNameString = \"String_Node_Str\";\n break;\n case Token.NUMBER:\n typeNameString = \"String_Node_Str\";\n break;\n case Token.TRUE:\n case Token.FALSE:\n typeNameString = \"String_Node_Str\";\n break;\n case Token.NULL:\n case Token.OBJECTLIT:\n case Token.ARRAYLIT:\n typeNameString = \"String_Node_Str\";\n break;\n case Token.VOID:\n typeNameString = \"String_Node_Str\";\n break;\n case Token.NAME:\n if (\"String_Node_Str\".equals(argumentNode.getString())) {\n typeNameString = \"String_Node_Str\";\n }\n break;\n }\n if (typeNameString != null) {\n Node newNode = Node.newString(typeNameString);\n originalTypeofNode.getParent().replaceChild(originalTypeofNode, newNode);\n reportCodeChange();\n return newNode;\n }\n return originalTypeofNode;\n}\n"
|
"private static Set<Integer> checkNodeStore(String storeName, Set<Integer> propertySet) throws IOException {\n File nodeStore = new File(storeName);\n if (!nodeStore.exists()) {\n throw new IOException(\"String_Node_Str\" + storeName);\n }\n File idGenerator = new File(storeName + \"String_Node_Str\");\n if (idGenerator.exists()) {\n boolean success = idGenerator.delete();\n assert success;\n }\n int recordSize = 9;\n System.out.print(storeName);\n ByteBuffer buffer = ByteBuffer.allocate(recordSize);\n FileChannel fileChannel = new RandomAccessFile(storeName, \"String_Node_Str\").getChannel();\n long fileSize = fileChannel.size();\n fileChannel.position(0);\n long dot = fileSize / recordSize / 20;\n Set<Integer> nodeSet = new java.util.HashSet<Integer>();\n int i = 0;\n int inUseCount = 0;\n for (i = 0; (long) (i + 1) * recordSize <= fileSize; i++) {\n buffer.clear();\n fileChannel.position((long) i * recordSize);\n fileChannel.read(buffer);\n buffer.flip();\n byte inUse = buffer.get();\n if (inUse == RECORD_IN_USE) {\n inUseCount++;\n int nextRel = buffer.getInt();\n int nextProp = buffer.getInt();\n if (nextRel != NO_NEXT_RELATIONSHIP) {\n nodeSet.add(i);\n }\n if (nextProp != NO_NEXT_PROPERTY && !propertySet.remove(nextProp)) {\n throw new IOException(\"String_Node_Str\" + nextProp + \"String_Node_Str\" + i);\n }\n } else if (inUse != RECORD_NOT_IN_USE) {\n System.out.println(\"String_Node_Str\" + i);\n System.out.println(\"String_Node_Str\" + inUse);\n }\n if (dot != 0 && i % dot == 0) {\n System.out.print(\"String_Node_Str\");\n }\n }\n System.out.print(\"String_Node_Str\" + i + \"String_Node_Str\" + inUseCount);\n fileChannel.close();\n System.out.println(\"String_Node_Str\");\n return nodeSet;\n}\n"
|
"public String createInstanceIDVar(final BPELPlanContext context, final String templateId) {\n final String instanceURLVarName = (context.getRelationshipTemplate() == null ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + ModelUtils.makeValidNCName(templateId) + \"String_Node_Str\" + context.getIdForNames();\n final QName stringTypeDeclId = context.importQName(new QName(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\"));\n if (!context.addGlobalVariable(instanceURLVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) {\n return null;\n }\n return instanceURLVarName;\n}\n"
|
"static JSONObject createAppearanceChangeJson(AbstractProperty prop, UUID objectUuid) {\n boolean visibilityChange = prop.getName().equalsIgnoreCase(\"String_Node_Str\");\n if (visibilityChange) {\n boolean newValue = PropertyHelper.getValueBool(prop);\n return createSetVisibleCommandJson(newValue, objectUuid);\n }\n boolean scaleChange = prop.getName().equalsIgnoreCase(\"String_Node_Str\");\n if (scaleChange) {\n JSONObject commandJson = new JSONObject();\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", objectUuid.toString());\n JSONArray jsonVec3 = new JSONArray();\n for (int i = 0; i < 3; i++) jsonVec3.add(PropertyHelper.getValueVec3(prop, i));\n commandJson.put(\"String_Node_Str\", jsonVec3);\n commandJson.put(\"String_Node_Str\", jsonVec3);\n return commandJson;\n }\n boolean opacityChange = prop.getName().equalsIgnoreCase(\"String_Node_Str\");\n boolean representationChange = prop.getName().equalsIgnoreCase(\"String_Node_Str\");\n if (opacityChange || representationChange) {\n JSONObject commandJson = new JSONObject();\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", objectUuid.toString());\n if (opacityChange) {\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", PropertyHelper.getValueDouble(prop));\n } else {\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", PropertyHelper.getValueInt(prop) == 2);\n }\n return commandJson;\n }\n if (prop.getName().equalsIgnoreCase(\"String_Node_Str\")) {\n JSONObject commandJson = new JSONObject();\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n commandJson.put(\"String_Node_Str\", \"String_Node_Str\");\n Vec3 newColor = new Vec3();\n for (int i = 0; i < 3; i++) newColor.set(i, PropertyHelper.getValueVec3(prop, i));\n return createSetMaterialColorCommand(newColor, objectUuid);\n }\n JSONObject commandJson = new JSONObject();\n return commandJson;\n}\n"
|
"public void releaseFileChannelForReading(final GateID gateID, final FileID fileID, boolean deleteFile) {\n try {\n getReadableSpillingFile(gateID, fileID).unlockReadableFileChannel();\n } catch (Exception e) {\n LOG.error(StringUtils.stringifyException(e));\n }\n}\n"
|
"public void showResults() {\n super.showResults();\n if (ConfigurationProperties.getPropertyBool(\"String_Node_Str\")) {\n log.info(\"String_Node_Str\" + this.currentStat.ingAttemptsSuccessfulPatches.size() + \"String_Node_Str\" + Stats.sum(currentStat.ingAttemptsSuccessfulPatches) + \"String_Node_Str\" + this.currentStat.ingAttemptsSuccessfulPatches.stream().map(Pair::getAttempts).collect(Collectors.toList()));\n log.info(\"String_Node_Str\" + this.currentStat.ingAttemptsFailingPatches.size() + \"String_Node_Str\" + Stats.sum(currentStat.ingAttemptsFailingPatches) + \"String_Node_Str\" + this.currentStat.ingAttemptsFailingPatches.stream().map(Pair::getAttempts).collect(Collectors.toList()));\n log.info(\"String_Node_Str\" + this.currentStat.patch_attempts.size() + \"String_Node_Str\" + this.currentStat.patch_attempts);\n log.info(\"String_Node_Str\" + this.currentStat.ingAttemptsSuccessfulPatches);\n log.info(\"String_Node_Str\" + this.currentStat.ingAttemptsFailingPatches);\n log.info(\"String_Node_Str\" + this.currentStat.successfulTransformedIngredients);\n }\n if (this.ingredientSearchStrategy != null && this.ingredientSearchStrategy.getIngredientSpace() instanceof ExpressionTypeIngredientSpace) {\n ExpressionTypeIngredientSpace space = (ExpressionTypeIngredientSpace) this.ingredientSearchStrategy.getIngredientSpace();\n space.toJSON(this.getProjectFacade().getProperties().getWorkingDirForSource());\n Stats.currentStat.toJSON(this.getProjectFacade().getProperties().getWorkingDirForSource(), Stats.currentStat.ingredientSpaceSize, \"String_Node_Str\");\n Stats.currentStat.toJSON(this.getProjectFacade().getProperties().getWorkingDirForSource(), Stats.currentStat.combinationByIngredientSize, \"String_Node_Str\");\n }\n}\n"
|
"private static int getTagLength(int tag) {\n return TAG_LENGTH_MAP.get(tag);\n}\n"
|
"public void testMultipleSources() {\n List<String> fastFoodVerify = new ArrayList<String>();\n EventList<String> wendys = fastFood.createMemberList();\n wendys.add(\"String_Node_Str\");\n wendys.add(\"String_Node_Str\");\n wendys.add(\"String_Node_Str\");\n wendys.add(\"String_Node_Str\");\n EventList<String> mcDonalds = new BasicEventList<String>();\n mcDonalds.add(\"String_Node_Str\");\n mcDonalds.add(\"String_Node_Str\");\n mcDonalds.add(\"String_Node_Str\");\n mcDonalds.add(\"String_Node_Str\");\n EventList<String> tacoBell = new BasicEventList<String>();\n tacoBell.add(\"String_Node_Str\");\n tacoBell.add(\"String_Node_Str\");\n CompositeList<String> fastFood = new CompositeList<String>();\n ListConsistencyListener.install(fastFood);\n fastFood.addMemberList(wendys);\n fastFood.addMemberList(mcDonalds);\n fastFood.addMemberList(tacoBell);\n fastFoodVerify.clear();\n fastFoodVerify.addAll(wendys);\n fastFoodVerify.addAll(mcDonalds);\n fastFoodVerify.addAll(tacoBell);\n assertEquals(fastFoodVerify, fastFood);\n wendys.add(\"String_Node_Str\");\n wendys.add(\"String_Node_Str\");\n fastFoodVerify.clear();\n fastFoodVerify.addAll(wendys);\n fastFoodVerify.addAll(mcDonalds);\n fastFoodVerify.addAll(tacoBell);\n assertEquals(fastFoodVerify, fastFood);\n wendys.remove(1);\n fastFood.set(0, \"String_Node_Str\");\n fastFood.remove(1);\n fastFoodVerify.clear();\n fastFoodVerify.addAll(wendys);\n fastFoodVerify.addAll(mcDonalds);\n fastFoodVerify.addAll(tacoBell);\n assertEquals(fastFoodVerify, fastFood);\n mcDonalds.add(\"String_Node_Str\");\n fastFoodVerify.clear();\n fastFoodVerify.addAll(wendys);\n fastFoodVerify.addAll(mcDonalds);\n fastFoodVerify.addAll(tacoBell);\n assertEquals(fastFoodVerify, fastFood);\n fastFood.removeMemberList(mcDonalds);\n fastFoodVerify.clear();\n fastFoodVerify.addAll(wendys);\n fastFoodVerify.addAll(tacoBell);\n assertEquals(fastFoodVerify, fastFood);\n}\n"
|
"public static MultipleSequenceAlignment<ProteinSequence, AminoAcidCompound> toProteinMSA(MultipleAlignment msta) throws CompoundNotFoundException {\n Group g = msta.getAtomArrays().get(0)[0].getGroup();\n if (!(g instanceof AminoAcid)) {\n throw new IllegalArgumentException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n MultipleSequenceAlignment<ProteinSequence, AminoAcidCompound> msa = new MultipleSequenceAlignment<ProteinSequence, AminoAcidCompound>();\n List<String> seqs = getSequenceAlignment(msta);\n for (int i = 0; i < msta.size(); i++) {\n String id = msta.getStructureIdentifier(i).toString();\n if (uniqueID.containsKey(id)) {\n uniqueID.put(id, uniqueID.get(id) + 1);\n id += \"String_Node_Str\" + uniqueID.get(id);\n } else\n uniqueID.put(id, 1);\n AccessionID acc = new AccessionID(id);\n ProteinSequence pseq = new ProteinSequence(seqs.get(i));\n pseq.setAccession(id);\n msa.addAlignedSequence(pseq);\n }\n return msa;\n}\n"
|
"public List<TdColumn> fillColumns(ColumnSet colSet, DatabaseMetaData dbJDBCMetadata, List<String> columnFilter, String columnPattern) {\n if (colSet == null || dbJDBCMetadata == null) {\n return null;\n }\n List<TdColumn> returnColumns = new ArrayList<TdColumn>();\n Map<String, TdColumn> columnMap = new HashMap<String, TdColumn>();\n String typeName = null;\n try {\n String catalogName = getName(CatalogHelper.getParentCatalog(colSet));\n Schema schema = SchemaHelper.getParentSchema(colSet);\n if (catalogName == null && schema != null) {\n catalogName = getName(CatalogHelper.getParentCatalog(schema));\n }\n String schemaPattern = getName(schema);\n schemaPattern = \"String_Node_Str\".equals(schemaPattern) ? null : schemaPattern;\n String tablePattern = getName(colSet);\n if (MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {\n schemaPattern = ColumnSetHelper.getTableOwner(colSet);\n }\n ResultSet columns = dbJDBCMetadata.getColumns(catalogName, schemaPattern, tablePattern, columnPattern);\n boolean isOdbcTeradata = ConnectionUtils.isOdbcTeradata(dbJDBCMetadata);\n while (columns.next()) {\n int decimalDigits = 0;\n int numPrecRadix = 0;\n String columnName = columns.getString(GetColumn.COLUMN_NAME.name());\n TdColumn column = ColumnHelper.createTdColumn(columnName);\n int dataType = 0;\n try {\n typeName = columns.getString(GetColumn.TYPE_NAME.name());\n typeName = typeName.toUpperCase().trim();\n typeName = ManagementTextUtils.filterSpecialChar(typeName);\n if (typeName.startsWith(\"String_Node_Str\") && typeName.endsWith(\"String_Node_Str\")) {\n typeName = \"String_Node_Str\";\n }\n typeName = MetadataToolHelper.validateValueForDBType(typeName);\n if (dbJDBCMetadata instanceof DB2ForZosDataBaseMetadata) {\n dataType = Java2SqlType.getJavaTypeBySqlType(typeName);\n decimalDigits = columns.getInt(GetColumn.DECIMAL_DIGITS.name());\n } else if (dbJDBCMetadata instanceof TeradataDataBaseMetadata) {\n dataType = Java2SqlType.getTeradataJavaTypeBySqlTypeAsInt(typeName);\n typeName = Java2SqlType.getTeradataJavaTypeBySqlTypeAsString(typeName);\n } else {\n dataType = columns.getInt(GetColumn.DATA_TYPE.name());\n if (!isOdbcTeradata) {\n numPrecRadix = columns.getInt(GetColumn.NUM_PREC_RADIX.name());\n decimalDigits = columns.getInt(GetColumn.DECIMAL_DIGITS.name());\n }\n }\n if (MetadataConnectionUtils.isMssql(dbJDBCMetadata)) {\n if (typeName.toLowerCase().equals(\"String_Node_Str\")) {\n dataType = 91;\n } else if (typeName.toLowerCase().equals(\"String_Node_Str\")) {\n dataType = 92;\n }\n }\n if (!isOdbcTeradata) {\n int column_size = columns.getInt(GetColumn.COLUMN_SIZE.name());\n column.setLength(column_size);\n }\n } catch (Exception e1) {\n log.warn(e1, e1);\n }\n TdSqlDataType sqlDataType = MetadataConnectionUtils.createDataType(dataType, typeName, decimalDigits, numPrecRadix);\n column.setSqlDataType(sqlDataType);\n int nullable = 0;\n if (dbJDBCMetadata instanceof DB2ForZosDataBaseMetadata || dbJDBCMetadata instanceof TeradataDataBaseMetadata || dbJDBCMetadata instanceof EmbeddedHiveDataBaseMetadata) {\n String isNullable = columns.getString(\"String_Node_Str\");\n if (!isNullable.equals(\"String_Node_Str\")) {\n nullable = 1;\n }\n } else {\n nullable = columns.getInt(GetColumn.NULLABLE.name());\n }\n column.getSqlDataType().setNullable(NullableType.get(nullable));\n String colComment = columns.getString(GetColumn.REMARKS.name());\n if (colComment == null) {\n colComment = \"String_Node_Str\";\n }\n ColumnHelper.setComment(colComment, column);\n Object defaultvalue = null;\n try {\n if (!isOdbcTeradata) {\n defaultvalue = columns.getObject(GetColumn.COLUMN_DEF.name());\n }\n } catch (Exception e1) {\n log.warn(e1, e1);\n }\n String defaultStr = (defaultvalue != null) ? String.valueOf(defaultvalue) : null;\n TdExpression defExpression = createTdExpression(GetColumn.COLUMN_DEF.name(), defaultStr);\n column.setInitialValue(defExpression);\n extractMeta.handleDefaultValue(column, dbJDBCMetadata);\n DatabaseConnection dbConnection = (DatabaseConnection) ConnectionHelper.getConnection(colSet);\n String dbmsId = dbConnection == null ? null : dbConnection.getDbmsId();\n if (dbmsId != null) {\n MappingTypeRetriever mappingTypeRetriever = MetadataTalendType.getMappingTypeRetriever(dbmsId);\n String talendType = mappingTypeRetriever.getDefaultSelectedTalendType(typeName, ExtractMetaDataUtils.getIntMetaDataInfo(columns, \"String_Node_Str\"), (dbJDBCMetadata instanceof TeradataDataBaseMetadata) ? 0 : ExtractMetaDataUtils.getIntMetaDataInfo(columns, \"String_Node_Str\"));\n column.setTalendType(talendType);\n String defaultSelectedDbType = MetadataTalendType.getMappingTypeRetriever(dbConnection.getDbmsId()).getDefaultSelectedDbType(talendType);\n column.setSourceType(defaultSelectedDbType);\n }\n try {\n column.setNullable(\"String_Node_Str\".equals(columns.getString(GetColumn.IS_NULLABLE.name())));\n } catch (Exception e) {\n }\n returnColumns.add(column);\n columnMap.put(columnName, column);\n }\n columns.close();\n if (isLinked()) {\n ColumnSetHelper.addColumns(colSet, returnColumns);\n }\n fillPkandFk(colSet, columnMap, dbJDBCMetadata, catalogName, schemaPattern, tablePattern);\n } catch (Exception e) {\n log.error(e, e);\n }\n return returnColumns;\n}\n"
|
"public void run() {\n final String outputPath = layoutData.getOutputLabel().getText();\n final boolean isPreprocess = preprocessEnabled.getSelection();\n final List<String> selectedFiles = inputLayoutData.getSelectedFiles();\n final boolean isBuildMatrix = buildMAtrix.getSelection();\n final String windowSizeStr = windowSize.getText();\n final String thresholdLimit = thresholdValue.getText();\n TacitFormComposite.writeConsoleHeaderBegining(\"String_Node_Str\");\n cooccurrenceAnalysisJob = new Job(\"String_Node_Str\") {\n private Preprocess preprocessTask;\n private String dirPath;\n private String seedFilePath = seedFile.getText();\n\n private String seedFileLocation;\n protected IStatus run(IProgressMonitor monitor) {\n TacitFormComposite.setConsoleViewInFocus();\n TacitFormComposite.updateStatusMessage(getViewSite(), null, null, form);\n monitor.beginTask(\"String_Node_Str\", selectedFiles.size() + 40);\n preprocessTask = null;\n dirPath = \"String_Node_Str\";\n seedFilePath = seedFile.getText();\n List<File> inputFiles = new ArrayList<File>();\n if (isPreprocess) {\n monitor.subTask(\"String_Node_Str\");\n preprocessTask = new Preprocess(\"String_Node_Str\");\n try {\n dirPath = preprocessTask.doPreprocessing(selectedFiles, \"String_Node_Str\");\n monitor.worked(10);\n ArrayList<String> seedList = new ArrayList<String>();\n seedList.add(seedFilePath);\n monitor.subTask(\"String_Node_Str\");\n preprocessTask.doPreprocessing(seedList, \"String_Node_Str\");\n monitor.worked(5);\n seedFileLocation = new File(dirPath + File.separator + new File(seedFilePath).getName()).getAbsolutePath();\n File[] inputFile = new File(dirPath).listFiles();\n for (File iFile : inputFile) {\n inputFiles.add(iFile);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n for (String filepath : selectedFiles) {\n if ((new File(filepath).isDirectory())) {\n continue;\n }\n inputFiles.add(new File(filepath));\n }\n monitor.worked(15);\n }\n long startTime = System.currentTimeMillis();\n boolean result = new CooccurrenceAnalysis().invokeCooccurrence(selectedFiles, seedFileLocation, outputPath, windowSizeStr, thresholdLimit, isBuildMatrix, monitor);\n if (result) {\n TacitFormComposite.updateStatusMessage(getViewSite(), \"String_Node_Str\", IStatus.OK, form);\n ConsoleView.printlInConsoleln(\"String_Node_Str\" + (System.currentTimeMillis() - startTime) + \"String_Node_Str\");\n if (preprocessEnabled.getSelection()) {\n monitor.subTask(\"String_Node_Str\");\n preprocessTask.clean();\n }\n monitor.worked(5);\n TacitFormComposite.writeConsoleHeaderBegining(\"String_Node_Str\");\n return Status.OK_STATUS;\n } else {\n TacitFormComposite.updateStatusMessage(getViewSite(), \"String_Node_Str\", IStatus.ERROR, form);\n if (preprocessEnabled.getSelection()) {\n monitor.subTask(\"String_Node_Str\");\n preprocessTask.clean();\n }\n monitor.worked(5);\n TacitFormComposite.writeConsoleHeaderBegining(\"String_Node_Str\");\n return Status.CANCEL_STATUS;\n }\n }\n };\n cooccurrenceAnalysisJob.setUser(true);\n if (canProceed()) {\n cooccurrenceAnalysisJob.schedule();\n }\n}\n"
|
"protected void serviceStop() throws Exception {\n if (drainEventsOnStop) {\n blockNewEvents = true;\n LOG.info(\"String_Node_Str\");\n synchronized (waitForDrained) {\n while (!drained && eventHandlingThread.isAlive()) {\n waitForDrained.wait(1000);\n LOG.info(\"String_Node_Str\");\n }\n }\n }\n stopped = true;\n if (eventHandlingThread != null) {\n eventHandlingThread.interrupt();\n try {\n eventHandlingThread.join();\n } catch (InterruptedException ie) {\n LOG.warn(\"String_Node_Str\", ie);\n }\n }\n super.serviceStop();\n}\n"
|
"public void writeInteger(int v) {\n throw new UnsupportedOperationException(getClass().getName());\n}\n"
|
"private boolean isTemplatePropertiesMatchCandidateFilters(NodeTemplate nodeTemplate, MatchingConfiguration matchingConfiguration, LocationResourceTemplate candidate, IndexedNodeType candidateType, Map<String, IndexedCapabilityType> capabilityTypes) {\n if (!isTemplatePropertiesMatchCandidateFilter(nodeTemplate.getProperties(), matchingConfiguration.getProperties(), candidate.getTemplate().getProperties(), candidateType.getProperties())) {\n return false;\n }\n for (Map.Entry<String, MatchingFilterDefinition> capabilityMatchingFilterEntry : matchingConfiguration.getCapabilities().entrySet()) {\n FilterDefinition filterDefinition = new FilterDefinition();\n Capability candidateCapability = candidate.getTemplate().getCapabilities().get(capabilityMatchingFilterEntry.getKey());\n IndexedCapabilityType capabilityType = capabilityTypes.get(candidateCapability.getType());\n Capability templateCapability = nodeTemplate.getCapabilities().get(capabilityMatchingFilterEntry.getKey());\n if (templateCapability != null && !isTemplatePropertiesMatchCandidateFilter(templateCapability.getProperties(), capabilityMatchingFilterEntry.getValue().getProperties(), candidateCapability.getProperties(), capabilityType.getProperties())) {\n return false;\n }\n }\n return true;\n}\n"
|
"public String getAppStoreListForPlatform(int platform, int listType, String category, int count, Model model) throws URISyntaxException {\n logger.info(\"String_Node_Str\" + platform + \"String_Node_Str\" + listType + \"String_Node_Str\" + count);\n AppStoreList appStoreList = appStoreService.getAppStoreListForPlatform(count, listType, platform);\n model.addAttribute(\"String_Node_Str\", gson.toJson(appStoreList));\n return \"String_Node_Str\";\n}\n"
|
"private OozieJob createOozieJobObject(AbstractJob job, AbstractWorkflowDataModel wfdm) {\n OozieJob ret = null;\n if (job instanceof JavaJob) {\n } else if (job instanceof PerlJob) {\n ret = new OozieJob(job, job.getAlgo() + \"String_Node_Str\" + this.jobs.size(), wfdm.getEnv().getOOZIE_WORK_DIR());\n } else if (job instanceof JavaSeqwareModuleJob) {\n } else {\n ret = new OozieJob(job, job.getAlgo() + \"String_Node_Str\" + this.jobs.size(), wfdm.getConfigs().get(\"String_Node_Str\"));\n }\n return ret;\n}\n"
|
"public synchronized CoverageReport getResult() {\n if (report != null) {\n final CoverageReport r = report.get();\n if (r != null) {\n return r;\n }\n }\n final JacocoReportDir reportFolder = getJacocoReport();\n try {\n CoverageReport r = new CoverageReport(this, reportFolder.parse(inclusions, exclusions));\n report = new WeakReference<>(r);\n r.setThresholds(thresholds);\n return r;\n } catch (IOException e) {\n getLogger().println(\"String_Node_Str\" + reportFolder);\n e.printStackTrace(getLogger());\n return null;\n }\n}\n"
|
"public static CartridgeBean convertCartridgeToCartridgeDefinitionBean(Cartridge cartridgeInfo) {\n CartridgeBean cartridge = new CartridgeBean();\n cartridge.setType(cartridgeInfo.getType());\n cartridge.setProvider(cartridgeInfo.getProvider());\n cartridge.setCategory(cartridgeInfo.getCategory());\n cartridge.setHost(cartridgeInfo.getHostName());\n cartridge.setDisplayName(cartridgeInfo.getDisplayName());\n cartridge.setDescription(cartridgeInfo.getDescription());\n cartridge.setVersion(cartridgeInfo.getVersion());\n cartridge.setMultiTenant(cartridgeInfo.getMultiTenant());\n cartridge.setDescription(cartridgeInfo.getDescription());\n cartridge.setLoadBalancingIPType(cartridgeInfo.getLoadBalancingIPType());\n if (cartridgeInfo.getMetadataKeys() != null && cartridgeInfo.getMetadataKeys()[0] != null) {\n cartridge.setMetadataKeys(cartridgeInfo.getMetadataKeys());\n }\n cartridge.setTenantPartitions(cartridgeInfo.getTenantPartitions());\n cartridge.setPersistence(convertPersistenceToPersistenceBean(cartridgeInfo.getPersistence()));\n cartridge.setDeployment(convertDeploymentToDeploymentBean(cartridgeInfo.getDeploymentDirs(), cartridgeInfo.getBaseDir()));\n cartridge.setIaasProvider(convertIaaSProviderToIaaSProviderBean(cartridgeInfo.getIaasConfigs()));\n cartridge.setPortMapping(convertPortMappingsToStubPortMappingBeans(cartridgeInfo.getPortMappings()));\n cartridge.setProperty(convertCCStubPropertiesToPropertyBeans(cartridgeInfo.getProperties()));\n return cartridge;\n}\n"
|
"public void setDateFormat(String dateFormat) {\n String prevDateFormat = getDateFormat();\n super.setDateFormat(dateFormat);\n if (!dateFormat.equals(prevDateFormat)) {\n if (cachedTemplateDateFormats != null) {\n for (int i = 0; i < CACHED_TDFS_LENGTH; i += CACHED_TDFS_ZONELESS_INPUT_OFFS) {\n cachedTemplateDateFormats[i + TemplateDateModel.DATE] = null;\n }\n }\n }\n}\n"
|
"public int getUnitSize() {\n if (unit_size == null || unit_size.isEmpty()) {\n return 0;\n }\n return Integer.parseInt(unit_size);\n}\n"
|
"public void testValidateRequestInvalidCredential() throws Exception {\n CallerOnlyCredential coc = new CallerOnlyCredential(USER1);\n withMessageContext(ap, ch).withCredential(coc).withBeanInstance(null);\n try {\n AuthenticationStatus status = cfam.validateRequest(req, res, hmc);\n fail(\"String_Node_Str\");\n } catch (AuthenticationException e) {\n assertTrue(\"String_Node_Str\", outputMgr.checkForStandardErr(\"String_Node_Str\"));\n assertTrue(\"String_Node_Str\", e.getMessage().contains(\"String_Node_Str\"));\n }\n}\n"
|
"private static List<Color> getCurrentColorList(List<?> columnKeys) {\n List<Color> colorList = new ArrayList<>();\n int colorSize = ChartDecorator.COLOR_LIST.size();\n for (Object columnKey : columnKeys) {\n int groupSize = Integer.parseInt(columnKey.toString());\n colorList.add(ChartDecorator.COLOR_LIST.get(Math.abs((groupSize - 1) % colorSize)));\n }\n return colorList;\n}\n"
|
"public Rectangle call() throws Exception {\n TableView<?> table = getRealComponent();\n TableColumn col = null;\n if (m_columns.size() == 0) {\n col = table.getVisibleLeafColumn(column);\n } else {\n col = m_columns.get(column);\n }\n table.scrollTo(row);\n table.scrollToColumn(col);\n table.layout();\n List<? extends TableCell> tCells = ComponentHandler.getAssignableFrom(TableCell.class);\n for (TableCell<?, ?> cell : tCells) {\n if (cell.getIndex() == row && cell.getTableColumn() == col && cell.getTableView() == table) {\n Bounds b = cell.getBoundsInParent();\n Point2D pos = cell.localToScreen(0, 0);\n Point2D parentPos = table.localToScreen(0, 0);\n return new Rectangle(Rounding.round(pos.getX() - parentPos.getX()), Rounding.round(pos.getY() - parentPos.getY()), Rounding.round(b.getWidth()), Rounding.round(b.getHeight()));\n }\n }\n return null;\n}\n"
|
"private boolean readTxn() {\n int count = 0;\n while (true) {\n long txn = txMem.getLong(TableUtils.TX_OFFSET_TXN);\n if (txn == this.txn) {\n return false;\n }\n Unsafe.getUnsafe().loadFence();\n if (txn == txMem.getLong(TableUtils.TX_OFFSET_TXN_CHECK)) {\n Unsafe.getUnsafe().loadFence();\n final long transientRowCount = txMem.getLong(TableUtils.TX_OFFSET_TRANSIENT_ROW_COUNT);\n final long fixedRowCount = txMem.getLong(TableUtils.TX_OFFSET_FIXED_ROW_COUNT);\n final long maxTimestamp = txMem.getLong(TableUtils.TX_OFFSET_MAX_TIMESTAMP);\n final long structVersion = txMem.getLong(TableUtils.TX_OFFSET_STRUCT_VERSION);\n this.symbolCountSnapshot.clear();\n int symbolMapCount = txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT);\n if (symbolMapCount > 0) {\n txMem.grow(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + symbolMapCount * 4);\n for (int i = 0; i < symbolMapCount; i++) {\n symbolCountSnapshot.add(txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + i * 4));\n }\n }\n Unsafe.getUnsafe().loadFence();\n if (txn == txMem.getLong(TableUtils.TX_OFFSET_TXN)) {\n this.txn = txn;\n this.transientRowCount = transientRowCount;\n this.rowCount = fixedRowCount + transientRowCount;\n this.maxTimestamp = maxTimestamp;\n this.structVersion = structVersion;\n LOG.info().$(\"String_Node_Str\").$(txn).$(\"String_Node_Str\").$(transientRowCount).$(\"String_Node_Str\").$(fixedRowCount).$(\"String_Node_Str\").$(maxTimestamp).$(\"String_Node_Str\").$(count).$(']').$();\n break;\n }\n count++;\n LockSupport.parkNanos(1);\n }\n }\n return true;\n}\n"
|
"protected void configure() {\n bind(QueueReaderFactory.class).in(Scopes.SINGLETON);\n install(new DataFabricFacadeModule());\n bind(ProgramStateWriter.class).to(MessagingProgramStateWriter.class);\n bind(RuntimeStore.class).to(RemoteRuntimeStore.class);\n install(createStreamFactoryModule());\n bind(UGIProvider.class).to(CurrentUGIProvider.class).in(Scopes.SINGLETON);\n bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);\n bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);\n bind(ProgramId.class).toInstance(programId);\n bind(ExploreClient.class).to(ProgramDiscoveryExploreClient.class).in(Scopes.SINGLETON);\n}\n"
|
"public void testTraceControlComponents() throws Exception {\n fProxy.setTestFile(fTestFile);\n fProxy.setScenario(SCEN_INIT_TEST);\n ITraceControlComponent root = TraceControlTestFacility.getInstance().getControlView().getTraceControlRoot();\n IHost host = new Host(new SystemProfile(\"String_Node_Str\", true));\n host.setHostName(\"String_Node_Str\");\n TargetNodeComponent node = new TargetNodeComponent(\"String_Node_Str\", root, host, fProxy);\n root.addChild(node);\n node.connect();\n fFacility.waitForJobs();\n assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());\n ITraceControlComponent[] groups = node.getChildren();\n assertNotNull(groups);\n assertEquals(2, groups.length);\n ITraceControlComponent[] providers = groups[0].getChildren();\n KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];\n ITraceControlComponent[] events = kernelProvider.getChildren();\n assertNotNull(events);\n assertEquals(3, events.length);\n BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0];\n BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1];\n TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());\n TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());\n TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());\n fProxy.setScenario(SCEN_SCENARIO1_TEST);\n TraceSessionComponent session = createSession(groups[1]);\n assertNotNull(session);\n assertEquals(\"String_Node_Str\", session.getName());\n assertEquals(\"String_Node_Str\", session.getSessionPath());\n assertEquals(TraceSessionState.INACTIVE, session.getSessionState());\n ITraceControlComponent[] components = { baseEventInfo0, baseEventInfo1 };\n fFacility.getControlView().setSelection(components);\n fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n ITraceControlComponent[] domains = session.getChildren();\n assertNotNull(domains);\n assertEquals(1, domains.length);\n assertEquals(\"String_Node_Str\", domains[0].getName());\n ITraceControlComponent[] channels = domains[0].getChildren();\n assertNotNull(channels);\n assertEquals(1, channels.length);\n assertTrue(channels[0] instanceof TraceChannelComponent);\n TraceChannelComponent channel = (TraceChannelComponent) channels[0];\n assertEquals(\"String_Node_Str\", channel.getName());\n assertEquals(4, channel.getNumberOfSubBuffers());\n assertEquals(\"String_Node_Str\", channel.getOutputType());\n assertEquals(false, channel.isOverwriteMode());\n assertEquals(200, channel.getReadTimer());\n assertEquals(TraceEnablement.ENABLED, channel.getState());\n assertEquals(262144, channel.getSubBufferSize());\n assertEquals(0, channel.getSwitchTimer());\n ITraceControlComponent[] channel0Events = channel.getChildren();\n assertNotNull(channel0Events);\n assertEquals(2, channel0Events.length);\n assertTrue(channel0Events[0] instanceof TraceEventComponent);\n assertTrue(channel0Events[1] instanceof TraceEventComponent);\n TraceEventComponent event = (TraceEventComponent) channel0Events[0];\n assertEquals(\"String_Node_Str\", event.getName());\n assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());\n assertEquals(TraceEventType.TRACEPOINT, event.getEventType());\n assertEquals(TraceEnablement.ENABLED, event.getState());\n TraceEventComponent event1 = (TraceEventComponent) channel0Events[1];\n assertEquals(\"String_Node_Str\", event1.getName());\n assertEquals(TraceLogLevel.TRACE_EMERG, event1.getLogLevel());\n assertEquals(TraceEventType.TRACEPOINT, event1.getEventType());\n assertEquals(TraceEnablement.ENABLED, event1.getState());\n ITraceControlComponent[] selection = { event, event1 };\n fFacility.getControlView().setSelection(selection);\n fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n assertEquals(TraceEnablement.DISABLED, event.getState());\n assertEquals(TraceEnablement.DISABLED, event1.getState());\n fFacility.getControlView().setSelection(event1);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n assertEquals(TraceEnablement.ENABLED, event1.getState());\n destroySession(session);\n assertEquals(0, groups[1].getChildren().length);\n fProxy.setScenario(SCEN_SCENARIO2_TEST);\n CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub();\n sessionDialogStub.setSessionPath(\"String_Node_Str\");\n TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);\n session = createSession(groups[1]);\n assertNotNull(session);\n assertEquals(\"String_Node_Str\", session.getName());\n assertEquals(\"String_Node_Str\", session.getSessionPath());\n assertEquals(TraceSessionState.INACTIVE, session.getSessionState());\n TraceControlDialogFactory.getInstance().setCreateChannelDialog(new CreateChannelDialogStub());\n fFacility.getControlView().setSelection(session);\n fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n domains = session.getChildren();\n assertNotNull(domains);\n assertEquals(1, domains.length);\n assertEquals(\"String_Node_Str\", domains[0].getName());\n channels = domains[0].getChildren();\n assertNotNull(channels);\n assertEquals(1, channels.length);\n assertTrue(channels[0] instanceof TraceChannelComponent);\n channel = (TraceChannelComponent) channels[0];\n assertEquals(\"String_Node_Str\", channel.getName());\n assertEquals(2, channel.getNumberOfSubBuffers());\n assertEquals(\"String_Node_Str\", channel.getOutputType());\n assertEquals(false, channel.isOverwriteMode());\n assertEquals(100, channel.getReadTimer());\n assertEquals(TraceEnablement.ENABLED, channel.getState());\n assertEquals(16384, channel.getSubBufferSize());\n assertEquals(200, channel.getSwitchTimer());\n UstProviderComponent ustProvider = (UstProviderComponent) providers[1];\n assertEquals(\"String_Node_Str\", ustProvider.getName());\n assertEquals(9379, ustProvider.getPid());\n events = ustProvider.getChildren();\n assertNotNull(events);\n assertEquals(2, events.length);\n baseEventInfo0 = (BaseEventComponent) events[0];\n baseEventInfo1 = (BaseEventComponent) events[1];\n ITraceControlComponent[] ustSelection = { baseEventInfo0, baseEventInfo1 };\n fFacility.getControlView().setSelection(ustSelection);\n fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n domains = session.getChildren();\n channels = domains[0].getChildren();\n ITraceControlComponent[] ustEvents = channels[0].getChildren();\n assertEquals(2, ustEvents.length);\n event = (TraceEventComponent) ustEvents[0];\n assertEquals(\"String_Node_Str\", event.getName());\n assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel());\n assertEquals(TraceEventType.TRACEPOINT, event.getEventType());\n assertEquals(TraceEnablement.ENABLED, event.getState());\n event = (TraceEventComponent) ustEvents[1];\n assertEquals(\"String_Node_Str\", ustEvents[1].getName());\n assertEquals(TraceLogLevel.TRACE_DEBUG_LINE, event.getLogLevel());\n assertEquals(TraceEventType.TRACEPOINT, event.getEventType());\n assertEquals(TraceEnablement.ENABLED, event.getState());\n fFacility.getControlView().setSelection(event);\n fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n assertEquals(TraceEnablement.DISABLED, event.getState());\n fFacility.getControlView().setSelection(event);\n fFacility.executeCommand(\"String_Node_Str\");\n fFacility.waitForJobs();\n assertEquals(TraceEnablement.ENABLED, event.getState());\n destroySession(session);\n assertEquals(0, groups[1].getChildren().length);\n}\n"
|
"public String applyColour(Color[] palette, Color oldBackground, Color oldForeground, boolean[] oldFormat, Color newBackground, Color newForeground, boolean[] newFormat) {\n StringBuilder rc = new StringBuilder();\n int colourindex1back = -1, colourindex2back = -1;\n int colourindex1fore = -1, colourindex2fore = -1;\n if ((oldBackground != null) && (newBackground == null))\n rc.append(\"String_Node_Str\");\n else if ((oldBackground == null) || (oldBackground.equals(newBackground) == false))\n if (newBackground != null) {\n colourindex1back = matchColour(newBackground, palette, 16, 256, this.chroma);\n if (this.fullcolour)\n colourindex2back = this.colourful ? matchColour(this.fullcolour ? newBackground : palette[colourindex1back], this.palette, 0, 8, this.chroma) : 7;\n else\n colourindex2back = colourindex1back;\n }\n if ((oldForeground != null) && (newForeground == null))\n rc.append(\"String_Node_Str\");\n else if ((oldForeground == null) || (oldForeground.equals(newForeground) == false))\n if (newForeground != null) {\n colourindex1fore = matchColour(newForeground, palette, 16, 256, this.chroma);\n if (this.fullcolour) {\n int s = ((newFormat.length > 9) && newFormat[9]) ? 0 : (newFormat[0] ? 8 : 0);\n int e = ((newFormat.length > 9) && newFormat[9]) ? 16 : (s + 8);\n colourindex2fore = this.colourful ? matchColour(this.fullcolour ? newForeground : palette[colourindex1fore], this.palette, s, e, this.chroma) : 15;\n if (((colourindex2fore == 0) && (newBackground == null)) || (colourindex2fore == colourindex2back))\n colourindex2fore ^= 8;\n } else\n colourindex2fore = colourindex1fore;\n }\n if (colourindex2back != -1)\n if (this.fullcolour) {\n Color colour = newBackground;\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2back);\n rc.append(\"String_Node_Str\");\n rc.append(\"String_Node_Str\".charAt(colour.getRed() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getRed() & 15));\n rc.append('/');\n rc.append(\"String_Node_Str\".charAt(colour.getGreen() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getGreen() & 15));\n rc.append('/');\n rc.append(\"String_Node_Str\".charAt(colour.getBlue() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getBlue() & 15));\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2back);\n palette[colourindex2back] = colour;\n } else if (colourindex2back < 16) {\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2back);\n } else {\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2back);\n }\n if (colourindex2fore != -1)\n if (this.fullcolour) {\n Color colour = newForeground;\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2fore);\n rc.append(\"String_Node_Str\");\n rc.append(\"String_Node_Str\".charAt(colour.getRed() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getRed() & 15));\n rc.append('/');\n rc.append(\"String_Node_Str\".charAt(colour.getGreen() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getGreen() & 15));\n rc.append('/');\n rc.append(\"String_Node_Str\".charAt(colour.getBlue() >>> 4));\n rc.append(\"String_Node_Str\".charAt(colour.getBlue() & 15));\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2fore & 7);\n palette[colourindex2fore] = colour;\n } else if (colourindex2fore < 16) {\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2fore & 7);\n } else {\n rc.append(\"String_Node_Str\");\n rc.append(colourindex2fore);\n }\n boolean _ = newFormat[0];\n newFormat[0] = (colourindex2fore == -1) ? oldFormat[0] : ((8 <= colourindex2fore) && (colourindex2fore < 16));\n for (int i = 0; i < 9; i++) if (newFormat[i] ^ oldFormat[i])\n if ((oldFormat[i] = newFormat[i])) {\n rc.append(\"String_Node_Str\");\n rc.append(i + 1);\n } else {\n rc.append(\"String_Node_Str\");\n rc.append(i + 1);\n }\n newFormat[0] = _;\n String _rc = rc.toString();\n if (_rc.isEmpty())\n return \"String_Node_Str\";\n return (\"String_Node_Str\" + _rc.substring(1)).replace(\"String_Node_Str\", \"String_Node_Str\") + \"String_Node_Str\";\n}\n"
|
"private void createNameText(Composite content) {\n final Label nameLabel = new Label(content, SWT.CHECK);\n nameLabel.setText(Messages.getString(\"String_Node_Str\"));\n GridData labelData = new GridData();\n labelData.horizontalSpan = 1;\n labelData.verticalIndent = 5;\n nameLabel.setLayoutData(labelData);\n nameText = new Text(content, SWT.BORDER);\n GridData textGd = new GridData(GridData.FILL_HORIZONTAL);\n textGd.verticalIndent = 15;\n textGd.horizontalIndent = 10;\n nameText.setLayoutData(textGd);\n nameText.setText(this.fileName == null ? \"String_Node_Str\" : this.fileName);\n nameText.addModifyListener(new ModifyListener() {\n public void modifyText(ModifyEvent e) {\n fileName = nameText.getText().trim();\n validate();\n }\n });\n}\n"
|
"public static <P1, F1, S1> SST<P1, F1, S1> union(SST<P1, F1, S1> sst1, SST<P1, F1, S1> sst2, BooleanAlgebraSubst<P1, F1, S1> ba) {\n if (sst1.isEmpty && sst2.isEmpty)\n return getEmptySST(ba);\n if (sst1.isEmpty)\n return (SST<P1, F1, S1>) sst2.clone();\n if (sst2.isEmpty)\n return (SST<P1, F1, S1>) sst1.clone();\n Collection<SSTMove<P1, F1, S1>> transitions = new ArrayList<SSTMove<P1, F1, S1>>();\n Map<Integer, OutputUpdate<P1, F1, S1>> outputFunction = new HashMap<Integer, OutputUpdate<P1, F1, S1>>();\n Integer initialState;\n Integer numberOfVariables;\n int offSet = sst1.maxStateId + 2;\n initialState = sst1.maxStateId + 1;\n Integer varRenameSst1 = 0;\n Integer varRenameSst2 = 0;\n numberOfVariables = Math.max(sst1.variableCount, sst2.variableCount);\n for (SSTInputMove<P1, F1, S1> t : sst1.getInputMovesFrom(sst1.states)) {\n FunctionalVariableUpdate<P1, F1, S1> variableUpdate = t.variableUpdate.renameVars(varRenameSst1).liftToNVars(numberOfVariables);\n SSTInputMove<P1, F1, S1> newMove = new SSTInputMove<P1, F1, S1>(t.from, t.to, t.guard, variableUpdate);\n transitions.add(newMove);\n }\n for (SSTEpsilon<P1, F1, S1> t : sst1.getEpsilonMovesFrom(sst1.states)) {\n SimpleVariableUpdate<P1, F1, S1> variableUpdate = t.variableUpdate.renameVars(varRenameSst1).liftToNVars(numberOfVariables);\n SSTEpsilon<P1, F1, S1> newMove = new SSTEpsilon<P1, F1, S1>(t.from, t.to, variableUpdate);\n transitions.add(newMove);\n }\n for (SSTInputMove<P1, F1, S1> t : sst2.getInputMovesFrom(sst2.states)) {\n FunctionalVariableUpdate<P1, F1, S1> variableUpdate = t.variableUpdate.renameVars(varRenameSst2).liftToNVars(numberOfVariables);\n SSTInputMove<P1, F1, S1> newMove = new SSTInputMove<P1, F1, S1>(t.from + offSet, t.to + offSet, t.guard, variableUpdate);\n transitions.add(newMove);\n }\n for (SSTEpsilon<P1, F1, S1> t : sst2.getEpsilonMovesFrom(sst2.states)) {\n SimpleVariableUpdate<P1, F1, S1> variableUpdate = t.variableUpdate.renameVars(varRenameSst2).liftToNVars(numberOfVariables);\n SSTEpsilon<P1, F1, S1> newMove = new SSTEpsilon<P1, F1, S1>(t.from + offSet, t.to + offSet, variableUpdate);\n transitions.add(newMove);\n }\n ArrayList<List<ConstantToken<P1, F1, S1>>> resUpdate = new ArrayList<List<ConstantToken<P1, F1, S1>>>();\n for (int i = 0; i < numberOfVariables; i++) resUpdate.add(new ArrayList<ConstantToken<P1, F1, S1>>());\n SSTEpsilon<P1, F1, S1> newMove1 = new SSTEpsilon<P1, F1, S1>(initialState, sst1.initialState, new SimpleVariableUpdate<P1, F1, S1>(resUpdate));\n transitions.add(newMove1);\n SSTEpsilon<P1, F1, S1> newMove2 = new SSTEpsilon<P1, F1, S1>(initialState, sst2.initialState + offSet, new SimpleVariableUpdate<P1, F1, S1>(resUpdate));\n transitions.add(newMove2);\n for (Integer state : sst1.getFinalStates()) outputFunction.put(state, sst1.outputFunction.get(state).renameVars(varRenameSst1));\n for (Integer state : sst2.getFinalStates()) outputFunction.put(state + offSet, sst2.outputFunction.get(state).renameVars(varRenameSst2));\n return MkSST(transitions, initialState, numberOfVariables, outputFunction, ba);\n}\n"
|
"public void initialize() throws Exception {\n publisherURLHttp = getPublisherURLHttp();\n storeURLHttp = getStoreURLHttp();\n endpointUrl = backEndServerUrl.getWebAppURLHttp() + \"String_Node_Str\";\n apiStore = new APIStoreRestClient(storeURLHttp);\n apiPublisher = new APIPublisherRestClient(publisherURLHttp);\n apiPublisher.login(user.getUserName(), user.getPassword());\n userManagementClient1 = new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(), createSession(keyManagerContext));\n userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER, null, permissions);\n userManagementClient1.addRole(INTERNAL_ROLE_SUBSCRIBER_1, null, permissions);\n userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_USERNAME, String.valueOf(CARBON_SUPER_SUBSCRIBER_PASSWORD), new String[] { INTERNAL_ROLE_SUBSCRIBER }, null);\n userManagementClient1.addUser(CARBON_SUPER_SUBSCRIBER_1_USERNAME, String.valueOf(CARBON_SUPER_SUBSCRIBER_1_PASSWORD), new String[] { INTERNAL_ROLE_SUBSCRIBER_1 }, null);\n}\n"
|
"public void startIMUCalibration() throws RemoteException {\n if (!getDroneMgr().getDrone().getCalibrationSetup().startCalibration()) {\n Bundle extrasBundle = new Bundle(1);\n extrasBundle.putString(Extra.EXTRA_CALIBRATION_IMU_MESSAGE, context.getString(R.string.failed_start_calibration_message));\n try {\n getCallback().onDroneEvent(Event.EVENT_CALIBRATION_IMU_ERROR, extrasBundle);\n } catch (DeadObjectException e) {\n handleDeadObjectException(e);\n }\n }\n}\n"
|
"public void runPacket_whenBroken() throws Exception {\n Operation op = new DummyOperation();\n setCallId(op, 1000 * 1000);\n Packet packet = toPacket(local, remote, op);\n byte[] bytes = packet.toByteArray();\n for (int k = 0; k < bytes.length; k++) {\n bytes[k]++;\n }\n operationRunner.run(packet);\n}\n"
|
"private void readText(HttpServletRequest request, Item item, String element, String qualifier, boolean repeated, String lang) {\n String dcname = element;\n if (qualifier != null) {\n dcname = element + \"String_Node_Str\" + qualifier;\n }\n List vals = new LinkedList();\n if (repeated) {\n vals = getRepeatedParameter(request, dcname);\n String buttonPressed = UIUtil.getSubmitButton(request, \"String_Node_Str\");\n String removeButton = \"String_Node_Str\" + dcname + \"String_Node_Str\";\n if (buttonPressed.startsWith(removeButton)) {\n int valToRemove = Integer.parseInt(buttonPressed.substring(removeButton.length()));\n vals.remove(valToRemove);\n }\n } else {\n String s = request.getParameter(dcname);\n if (s != null && !s.equals(\"String_Node_Str\")) {\n vals.add(s);\n }\n }\n item.clearDC(element, qualifier, Item.ANY);\n for (int i = 0; i < vals.size(); i++) {\n String s = (String) vals.get(i);\n if (s != null && !s.trim().equals(\"String_Node_Str\")) {\n item.addDC(element, qualifier, lang, s);\n }\n }\n}\n"
|
"public void complete(CompleteOperation completeOperation, InputComponent<?, Object> input, ShellContext context, String typedValue, ConverterFactory converterFactory) {\n SelectComponent<?, Object> selectComponent = (SelectComponent<?, Object>) input;\n Converter<Object, String> itemLabelConverter = (Converter<Object, String>) InputComponents.getItemLabelConverter(converterFactory, selectComponent);\n Iterable<Object> valueChoices = selectComponent.getValueChoices();\n for (Object choice : valueChoices) {\n String convert = itemLabelConverter.convert(choice);\n if (noTypedValue || convert.startsWith(typedValue)) {\n completeOperation.addCompletionCandidate(convert);\n }\n }\n}\n"
|
"public String request(int sid, String msg) {\n int playerIndex = 0;\n for (int i = 0; i < playerNum; i++) {\n if (allPlayers[i].SID == sid) {\n playerIndex = i;\n break;\n }\n }\n String result = \"String_Node_Str\";\n switch(gameState) {\n case INIT:\n if (playerState[playerIndex] == 0) {\n result = GodHelper.toInit(allUserInfo, \"String_Node_Str\", playerIndex, heroList);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 1) {\n heroChoose(sid, msg);\n gameState = GameState.MAINGAME;\n playerState[playerIndex] = 0;\n result = GodHelper.toChooseHero(\"String_Node_Str\", heroChoices, teamResult);\n }\n break;\n case MAINGAME:\n switch(phaseState) {\n case PREPARE:\n if (playerState[playerIndex] == 0) {\n GambleChecker.cardDistribute(cardHeap, allPlayers[playerIndex], 4);\n int[] playerHandCard = new int[allPlayers[playerIndex].handCardsNum];\n seenCardJudge(playerIndex, playerHandCard);\n for (int i = 0; i < playerNum; i++) {\n if (map.distance[allPlayers[playerIndex].preLoc][allPlayers[i].preLoc] < allPlayers[playerIndex].range)\n availableFireTarget[i] = 1;\n }\n toDirection(playerIndex);\n result = GodHelper.toCardDistribute(\"String_Node_Str\", playerHandCard, availableFireTarget, availableMoveDirection);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 1) {\n MsgChooseDecision dec = GodHelper.getChooseDecision(msg);\n if (dec.decision() == -1)\n allPlayers[playerIndex].stratDecision = GambleChecker.DEPOSIT;\n else {\n allPlayers[playerIndex].stratDecision = allPlayers[playerIndex].handCards[dec.decision()];\n GambleChecker.cardToHeap(cardHeap, dec.decision());\n allPlayers[playerIndex].handCards[dec.decision()] = GambleChecker.NOTHING;\n GambleChecker.cardSort(allPlayers[playerIndex].handCards);\n allPlayers[playerIndex].handCardsNum -= 1;\n }\n decisionChoices[playerIndex] = allPlayers[playerIndex].stratDecision;\n featureChoose(msg, allPlayers[playerIndex], playerIndex);\n int[] playerHandCard = new int[allPlayers[playerIndex].handCardsNum];\n for (int i = 0; i < allPlayers[playerIndex].handCardsNum; i++) playerHandCard[i] = allPlayers[playerIndex].handCards[i];\n if (allPlayers[playerIndex].isSeenCard)\n result = GodHelper.toChooseDecision(\"String_Node_Str\", playerHandCard);\n else\n result = GodHelper.toChooseDecision(\"String_Node_Str\", playerHandCard);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 2) {\n seenCard(playerIndex, msg, allPlayers[playerIndex]);\n if (allPlayers[playerIndex].isSeenCard)\n result = GodHelper.toSeenCard(\"String_Node_Str\", decisionChoices, seenCardChoices);\n else\n result = GodHelper.toSeenCard(\"String_Node_Str\", decisionChoices, seenCardChoices);\n playerState[playerIndex] = 0;\n phaseState = PhaseState.GAMBLE;\n }\n break;\n case GAMBLE:\n if (playerState[playerIndex] == 0) {\n gambleChoose(msg, allPlayers[playerIndex], playerIndex);\n playerState[playerIndex] += 1;\n int[] playerHandCard = new int[allPlayers[playerIndex].handCardsNum];\n for (int i = 0; i < allPlayers[playerIndex].handCardsNum; i++) playerHandCard[i] = allPlayers[playerIndex].handCards[i];\n result = GodHelper.toChooseGamble(\"String_Node_Str\", playerHandCard);\n } else if (playerState[playerIndex] == 1) {\n winJudge();\n for (int i = 0; i < playerNum; i++) {\n if (allPlayers[i].isWin)\n playerWinList[i] = 1;\n }\n playerState[playerIndex] = 0;\n phaseState = PhaseState.ACTION;\n result = GodHelper.toWinJudge(\"String_Node_Str\", gambleChoices, cardNumList, playerWinList, fireList);\n }\n break;\n case ACTION:\n if (playerState[playerIndex] == 0) {\n depositAccount();\n result = GodHelper.toDepositAccount(\"String_Node_Str\", energyList);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 1) {\n skillsAccount();\n result = GodHelper.toSkillsAccount(\"String_Node_Str\");\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 2) {\n fireAccount();\n result = GodHelper.toFireAccount(\"String_Node_Str\", healthPointList);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 3) {\n moveAccount();\n result = GodHelper.toMoveAccount(\"String_Node_Str\", locationList);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 4) {\n elemAccount();\n result = GodHelper.toElemAccount(\"String_Node_Str\", elementList);\n playerState[playerIndex] += 1;\n } else if (playerState[playerIndex] == 5) {\n humanVictory();\n if (humanWin) {\n result = GodHelper.toHumanVictory(\"String_Node_Str\");\n playerState[playerIndex] = 0;\n gameState = GameState.END;\n } else {\n result = GodHelper.toHumanVictory(\"String_Node_Str\");\n playerState[playerIndex] += 1;\n }\n } else if (playerState[playerIndex] == 6) {\n infectionAccount();\n if (zombieWin) {\n result = GodHelper.toInfectionAccount(\"String_Node_Str\", teamList);\n playerState[playerIndex] = 0;\n gameState = GameState.END;\n } else {\n result = GodHelper.toInfectionAccount(\"String_Node_Str\", teamList);\n playerState[playerIndex] += 1;\n }\n } else if (playerState[playerIndex] == 7) {\n desertAccount(playerIndex, msg);\n int[] playerHandCard = new int[allPlayers[playerIndex].handCardsNum];\n for (int i = 0; i < allPlayers[playerIndex].handCardsNum; i++) playerHandCard[i] = allPlayers[playerIndex].handCards[i];\n result = GodHelper.toDesertAccount(\"String_Node_Str\", allPlayers[playerIndex].energy, playerHandCard);\n phaseState = PhaseState.PREPARE;\n playerState[playerIndex] = 0;\n seen_card_count = 0;\n gamble_count = 0;\n desert_count = 0;\n for (int i = 0; i < playerNum; i++) {\n allPlayers[i].stratDecision = GambleChecker.DEPOSIT;\n allPlayers[i].fireTarget = -1;\n allPlayers[i].moveDirection = -1;\n availableFireTarget[i] = -1;\n availableMoveDirection[i] = -1;\n decisionChoices[i] = GambleChecker.DEPOSIT;\n seenCardChoices[i] = 0;\n gambleChoices[i] = GambleChecker.PAPER;\n cardNumList[i] = 0;\n playerWinList[i] = 0;\n fireList[i] = -1;\n }\n }\n break;\n }\n break;\n case END:\n result = GodHelper.toGameOver(\"String_Node_Str\", scoreList);\n break;\n }\n if (result.equals(\"String_Node_Str\")) {\n System.out.printf(\"String_Node_Str\", sid, msg, gameState.toString());\n }\n return result;\n}\n"
|
"public void createMissingDescription() {\n SyncPolicyTO policy = new SyncPolicyTO();\n policy.setSpecification(new SyncPolicySpec());\n Throwable t = null;\n try {\n createPolicy(policyService, PolicyType.SYNC, policy);\n fail();\n } catch (SyncopeClientCompositeErrorException sccee) {\n t = sccee.getException(SyncopeClientExceptionType.InvalidSyncPolicy);\n }\n assertNotNull(t);\n}\n"
|
"public boolean saveSSHKey(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final String sshPublicKey) throws ResourceUnavailableException {\n if (vm != null && vm.getVirtualMachine().getState().equals(VirtualMachine.State.Running)) {\n throw new CloudRuntimeException(\"String_Node_Str\");\n }\n final boolean canHandle = canHandle(network.getTrafficType());\n if (canHandle) {\n storePasswordInVmDetails(vm);\n }\n return canHandle;\n}\n"
|
"public static void addFlag(CommandContext args, Player player, HumanNPC npc) {\n if (!args.hasFlag('a') && !args.hasFlag('g') && !args.hasFlag('m') && !args.hasFlag('p')) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n Guard guard = npc.getType(\"String_Node_Str\");\n int flagOffset = 1, priority = 1;\n if (args.hasFlag('i')) {\n ++flagOffset;\n priority = args.getInteger(1);\n }\n boolean isSafe = args.getString(flagOffset).charAt(0) == '-';\n if (args.hasFlag('a')) {\n guard.getFlags().addToAll(args.getFlags(), FlagInfo.newInstance(\"String_Node_Str\", priority, args.argsLength() > flagOffset ? args.getString(flagOffset).charAt(0) == '-' : false));\n player.sendMessage(ChatColor.GREEN + \"String_Node_Str\");\n return;\n } else if (args.argsLength() == 1 || flagOffset == 2) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n String name = isSafe ? args.getJoinedStrings(flagOffset).replaceFirst(\"String_Node_Str\", \"String_Node_Str\") : args.getJoinedStrings(flagOffset);\n name = name.toLowerCase();\n FlagType type = FlagType.PLAYER;\n if (args.hasFlag('g')) {\n if (!PermissionManager.useSuperPerms()) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n Group group = PermissionManager.getGroup(name);\n if (group == null) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n type = FlagType.GROUP;\n }\n if (args.hasFlag('m')) {\n if (!EntityUtils.validType(name, true)) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n type = FlagType.MOB;\n }\n String prefix = guard.getFlags().contains(type, name) ? \"String_Node_Str\" : \"String_Node_Str\";\n guard.getFlags().addFlag(type, FlagInfo.newInstance(name, priority, isSafe));\n player.sendMessage(ChatColor.GREEN + prefix + \"String_Node_Str\" + StringUtils.wrap(name) + \"String_Node_Str\");\n}\n"
|
"public void shouldExecuteBoot2Docker() {\n Map<String, String> map = new HashMap<String, String>();\n map.put(\"String_Node_Str\", \"String_Node_Str\");\n map.put(\"String_Node_Str\", \"String_Node_Str\");\n map.put(\"String_Node_Str\", \"String_Node_Str\");\n CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(map);\n when(commandLineExecutor.execCommand(\"String_Node_Str\", \"String_Node_Str\")).thenReturn(\"String_Node_Str\");\n DockerClientExecutor dockerClientExecutor = new DockerClientExecutor(cubeConfiguration, new Boot2Docker(commandLineExecutor), operatingSystemResolver);\n assertThat(dockerClientExecutor.getDockerUri().getHost(), is(\"String_Node_Str\"));\n}\n"
|
"private Map<ImportItem, List<ImportItem>> getTestCaseItemMap(List<ImportItem> items) {\n Map<ImportItem, List<ImportItem>> map = new HashMap<ImportItem, List<ImportItem>>();\n ITestContainerProviderService testContainerService = null;\n if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {\n testContainerService = (ITestContainerProviderService) GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);\n }\n if (items != null && testContainerService != null) {\n for (ImportItem ir : items) {\n if (ir.getItem() != null && !testContainerService.isTestContainerItem(ir.getItem())) {\n itemMap.put(ir.getProperty().getId(), ir);\n map.put(ir, new ArrayList<ImportItem>());\n }\n }\n Set<String> keys = itemMap.keySet();\n for (String key : keys) {\n Item item = itemMap.get(key).getItem();\n if (item == null) {\n continue;\n }\n boolean isTestContainer = testContainerService.isTestContainerItem(item);\n if (!isTestContainer) {\n List<ImportItem> children = new ArrayList<ImportItem>();\n for (ImportItem child : items) {\n Item childItem = child.getItem();\n if (childItem == null) {\n continue;\n }\n isTestContainer = testContainerService.isTestContainerItem(childItem);\n if (isTestContainer) {\n String path = childItem.getState().getPath();\n if (path != null && path.contains(\"String_Node_Str\")) {\n int index = path.indexOf(\"String_Node_Str\");\n path = path.substring(index + 1);\n if (path.equals(item.getProperty().getId())) {\n children.add(child);\n }\n }\n }\n }\n map.put(ir, children);\n }\n }\n }\n return map;\n}\n"
|
"public boolean isRendererForitem(Item item, PreviewProperties properties) {\n return item instanceof EdgeItem && properties.getBooleanValue(PreviewProperty.SHOW_EDGES) && properties.getBooleanValue(PreviewProperty.DIRECTED) && (Boolean) item.getData(EdgeItem.DIRECTED) && !(Boolean) item.getData(EdgeItem.SELF_LOOP) && !properties.getBooleanValue(PreviewProperty.MOVING);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.