content stringlengths 40 137k |
|---|
"private void syncSelectionToModel() {\n if (_model instanceof ListSelectionModel) {\n ListSelectionModel model = (ListSelectionModel) _model;\n model.clearSelection();\n if (_selItem != null) {\n int index = getChildren().indexOf(_selItem);\n model.addSelectionInterval(index, index);\n } else\n model.clearSelection();\n }\n}\n"
|
"public void save(World world) {\n world.mapStorage.setData(DIMMANAGER_NAME, this);\n markDirty();\n syncDimInfoToClients(world);\n}\n"
|
"public void refresh() {\n container.removeAllItems();\n container.addAll(context.getOperationsService().findGroups());\n table.sort();\n setButtonsEnabled();\n}\n"
|
"private String transmit(String soapAction, String data) {\n HttpPost post = generatePost(soapAction, data);\n return executePost(post);\n}\n"
|
"public void exitScope() {\n Scriptable parentScope = scope.getParentScope();\n if (parentScope != null)\n scope = parentScope;\n }\n}\n"
|
"public static void main(String[] args) {\n test4();\n}\n"
|
"public void testWaitUntilElementDisapearPos() {\n Grid.driver().get(url);\n WebDriverWaitUtils.waitUntilPageTitleContains(pageTitle);\n Button btn = new Button(disappearElement);\n btn.click();\n WebDriverWaitUtils.waitUntilElementIsInvisible(disappearElement);\n}\n"
|
"public void sendResponses(Response[] responses, QueryRequest query, byte[] clientGUID) {\n if ((responses == null) || ((responses.length < 1)))\n return false;\n if (query.desiresOutOfBandReplies() && (query.getHops() > 1) && !query.isFirewalledSource() && RouterService.isGUESSCapable() && RouterService.acceptedIncomingConnection() && !RouterService.getUploadManager().isBusy()) {\n if (bufferResponsesForLaterDelivery(query, responses)) {\n InetAddress addr = null;\n try {\n addr = InetAddress.getByName(query.getReplyAddress());\n } catch (UnknownHostException uhe) {\n return;\n }\n int port = query.getReplyPort();\n try {\n int resultCount = (responses.length > 255) ? 255 : responses.length;\n ReplyNumberVendorMessage vm = new ReplyNumberVendorMessage(new GUID(query.getGUID()), resultCount);\n UDPService.instance().send(vm, addr, port);\n } catch (BadPacketException bpe) {\n ErrorService.error(bpe);\n }\n }\n return;\n }\n Iterator iterator = responsesToQueryReplies(responses, query);\n try {\n while (iterator.hasNext()) {\n QueryReply queryReply = (QueryReply) iterator.next();\n sendQueryReply(query, queryReply);\n }\n } catch (IOException e) {\n }\n}\n"
|
"public JExpression createConstant(Outline outline, XmlString lexical) {\n if (isCollection())\n return null;\n if (adapter == null)\n return coreType.createConstant(outline, lexical);\n JExpression cons = coreType.createConstant(outline, lexical);\n Class<? extends XmlAdapter> atype = adapter.getAdapterIfKnown();\n if (cons instanceof JStringLiteral && atype != null) {\n JStringLiteral scons = (JStringLiteral) cons;\n XmlAdapter a = ClassFactory.create(atype);\n try {\n Object value = a.unmarshal(scons.str);\n if (value instanceof String) {\n return JExpr.lit((String) value);\n }\n } catch (Exception e) {\n }\n }\n return JExpr._new(adapter.getAdapterClass(outline)).invoke(\"String_Node_Str\").arg(cons);\n}\n"
|
"private void loadNetworkImage(Cursor cursor, NetworkImageView imageView) {\n String thumbnailURL = cursor.getString(cursor.getColumnIndex(\"String_Node_Str\"));\n Uri uri = Uri.parse(thumbnailURL);\n if (thumbnailURL != null && MediaUtils.isValidImage(uri.getLastPathSegment())) {\n imageView.setTag(thumbnailURL);\n imageView.setImageUrl(thumbnailURL, WordPress.imageLoader);\n }\n}\n"
|
"private void create() {\n try {\n if (!(host == null || \"String_Node_Str\".equals(host) || \"String_Node_Str\".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP.equals(host))) {\n throw new MessageQueueException(\"String_Node_Str\", -1);\n }\n String fullname = \"String_Node_Str\" + queueName;\n String qLabel = \"String_Node_Str\" + this.getClass().getName() + \"String_Node_Str\";\n boolean transactional = false;\n msmqHandle = Queue.create(fullname, qLabel, transactional);\n } catch (MessageQueueException ex1) {\n throw new MessageQueueException(\"String_Node_Str\" + ex1, ex1.hresult);\n }\n}\n"
|
"Pair<Map<String, List<Element>>, Map<String, List<Element>>> computeCandidates(Set<String> forcedUnresolved) {\n final CompilationUnitTree cut = info.getCompilationUnit();\n ClasspathInfo cpInfo = allInfo.getClasspathInfo();\n final TreeVisitorImpl v = new TreeVisitorImpl(info);\n setVisitor(v);\n try {\n v.scan(cut, new HashMap<String, Object>());\n } finally {\n setVisitor(null);\n }\n Set<String> unresolvedNames = new HashSet<String>(v.unresolved);\n unresolvedNames.addAll(forcedUnresolved);\n unresolvedNames.addAll(JavadocImports.computeUnresolvedImports(info));\n for (String unresolved : unresolvedNames) {\n if (isCancelled())\n return null;\n List<Element> classes = new ArrayList<Element>();\n Set<ElementHandle<TypeElement>> typeNames = info.getClasspathInfo().getClassIndex().getDeclaredTypes(unresolved, NameKind.SIMPLE_NAME, EnumSet.allOf(ClassIndex.SearchScope.class));\n if (typeNames == null) {\n return null;\n }\n for (ElementHandle<TypeElement> typeName : typeNames) {\n if (isCancelled())\n return null;\n TypeElement te = modle != null ? info.getElements().getTypeElement(modle, typeName.getQualifiedName()) : info.getElements().getTypeElement(typeName.getQualifiedName());\n if (te == null) {\n Logger.getLogger(ComputeImports.class.getName()).log(Level.INFO, \"String_Node_Str\" + typeName + \"String_Node_Str\");\n continue;\n }\n if (info.getElements().getPackageOf(te).getQualifiedName().length() != 0 && !Utilities.isExcluded(te.getQualifiedName())) {\n classes.add(te);\n }\n }\n Iterable<Symbols> simpleNames = info.getClasspathInfo().getClassIndex().getDeclaredSymbols(unresolved, NameKind.SIMPLE_NAME, EnumSet.allOf(ClassIndex.SearchScope.class));\n if (simpleNames == null) {\n return null;\n }\n for (final Symbols p : simpleNames) {\n if (isCancelled())\n return null;\n final TypeElement te = p.getEnclosingType().resolve(info);\n final Set<String> idents = p.getSymbols();\n if (te != null) {\n for (Element ne : te.getEnclosedElements()) {\n if (!ne.getModifiers().contains(Modifier.STATIC))\n continue;\n if (idents.contains(getSimpleName(ne, te))) {\n classes.add(ne);\n }\n }\n }\n }\n candidates.put(unresolved, new ArrayList(classes));\n notFilteredCandidates.put(unresolved, classes);\n }\n boolean wasChanged = true;\n while (wasChanged) {\n if (isCancelled())\n return new Pair(Collections.emptyMap(), Collections.emptyMap());\n wasChanged = false;\n possibleMethodFQNs.clear();\n fqn2Methods.clear();\n for (Hint hint : v.hints) {\n wasChanged |= hint.filter(info, this);\n }\n }\n for (String sn : possibleMethodFQNs.keySet()) {\n Set<String> fqns = possibleMethodFQNs.get(sn);\n List<Element> cands = candidates.get(sn);\n List<Element> rawCands = notFilteredCandidates.get(sn);\n if (cands != null) {\n for (Iterator<Element> itE = cands.iterator(); itE.hasNext(); ) {\n Element x = itE.next();\n if (x.getKind() != ElementKind.METHOD) {\n continue;\n }\n String fq = info.getElementUtilities().getElementName(x, true).toString();\n if (!fqns.contains(fq)) {\n itE.remove();\n }\n }\n }\n if (rawCands != null) {\n for (Iterator<Element> itE = rawCands.iterator(); itE.hasNext(); ) {\n Element x = itE.next();\n if (x.getKind() != ElementKind.METHOD) {\n continue;\n }\n String fq = info.getElementUtilities().getElementName(x, true).toString();\n if (!fqns.contains(fq)) {\n itE.remove();\n }\n }\n }\n }\n return new Pair<Map<String, List<Element>>, Map<String, List<Element>>>(candidates, notFilteredCandidates);\n}\n"
|
"protected void onZap(Ballistica beam) {\n for (int c : beam.subPath(0, beam.dist)) CellEmitter.center(c).burst(BloodParticle.BURST, 1);\n int cell = beam.collisionPos;\n Char ch = Actor.findChar(cell);\n Heap heap = Dungeon.level.heaps.get(cell);\n if (ch != null && ch instanceof Mob) {\n if (((Mob) ch).ally || ch.buff(Charm.class) != null || ch.buff(Corruption.class) != null) {\n int missingHP = ch.HT - ch.HP;\n int healing = (int) Math.ceil((missingHP * (0.30f + (0.03f * level))));\n ch.HP += healing;\n ch.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1 + level / 2);\n ch.sprite.showStatus(CharSprite.POSITIVE, \"String_Node_Str\", healing);\n } else if (undeadMobs.contains(ch.getClass())) {\n int damage = (int) Math.ceil(ch.HT * (0.3f + (0.05f * level)));\n ch.damage(damage, this);\n ch.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10 + level);\n Sample.INSTANCE.play(Assets.SND_BURNING);\n } else {\n float duration = 5 + level;\n Buff.affect(ch, Charm.class, Charm.durationFactor(ch) * duration).object = curUser.id();\n duration *= Random.Float(0.75f, 1f);\n Buff.affect(curUser, Charm.class, Charm.durationFactor(ch) * duration).object = ch.id();\n ch.sprite.centerEmitter().start(Speck.factory(Speck.HEART), 0.2f, 5);\n curUser.sprite.centerEmitter().start(Speck.factory(Speck.HEART), 0.2f, 5);\n }\n } else if (heap != null && heap.type == Heap.Type.HEAP) {\n Item item = heap.peek();\n if (item != null && Random.Float() <= 0.3f + level * 0.1f) {\n if (item.cursed) {\n item.cursed = false;\n CellEmitter.get(cell).start(ShadowParticle.UP, 0.05f, 10);\n Sample.INSTANCE.play(Assets.SND_BURNING);\n }\n int lvldiffFromBase = item.level - (item instanceof Ring ? 1 : 0);\n if (lvldiffFromBase < 0) {\n item.upgrade(-lvldiffFromBase);\n CellEmitter.get(cell).start(Speck.factory(Speck.UP), 0.2f, 3);\n Sample.INSTANCE.play(Assets.SND_EVOKE);\n }\n }\n } else if (Dungeon.level.map[cell] == Terrain.GRASS) {\n Dungeon.level.set(cell, Terrain.HIGH_GRASS);\n GameScene.updateMap(cell);\n CellEmitter.get(cell).burst(LeafParticle.LEVEL_SPECIFIC, 4);\n } else if (Dungeon.level.map[cell] == Terrain.EMBERS) {\n if (Random.Float() <= 0.3f + level * 0.03f) {\n Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), cell);\n CellEmitter.get(cell).burst(LeafParticle.LEVEL_SPECIFIC, 8);\n GameScene.updateMap(cell);\n } else {\n Dungeon.level.set(cell, Terrain.HIGH_GRASS);\n GameScene.updateMap(cell);\n CellEmitter.get(cell).burst(LeafParticle.LEVEL_SPECIFIC, 4);\n }\n } else\n return;\n if (!freeCharge) {\n damageHero();\n } else {\n freeCharge = false;\n }\n}\n"
|
"private void initFrom(String val) {\n int begin = 0;\n int offset = 0;\n int last = val.length() - 1;\n String scaleString = null;\n StringBuilder unscaledBuffer;\n if (val == null) {\n throw new NullPointerException();\n }\n unscaledBuffer = new StringBuilder(val.length());\n if ((offset <= last) && (val.charAt(offset) == '+')) {\n offset++;\n begin++;\n }\n int counter = 0;\n boolean wasNonZero = false;\n for (; (offset <= last) && (val.charAt(offset) != '.') && (val.charAt(offset) != 'e') && (val.charAt(offset) != 'E'); offset++) {\n if (!wasNonZero) {\n if (val.charAt(offset) == '0') {\n counter++;\n } else {\n wasNonZero = true;\n }\n }\n }\n unscaledBuffer.append(val, begin, offset);\n if ((offset <= last) && (val.charAt(offset) == '.')) {\n offset++;\n begin = offset;\n for (; (offset <= last) && (val.charAt(offset) != 'e') && (val.charAt(offset) != 'E'); offset++) {\n if (!wasNonZero) {\n if (val.charAt(offset) == '0') {\n counter++;\n } else {\n wasNonZero = true;\n }\n }\n }\n scale = offset - begin;\n unscaledBuffer.append(val, begin, offset);\n } else {\n scale = 0;\n }\n if ((offset <= last) && ((val.charAt(offset) == 'e') || (val.charAt(offset) == 'E'))) {\n offset++;\n begin = offset;\n if ((offset <= last) && (val.charAt(offset) == '+')) {\n offset++;\n if ((offset <= last) && (val.charAt(offset) != '-')) {\n begin++;\n }\n }\n scaleString = val.substring(begin, last + 1);\n scale = scale - Integer.parseInt(scaleString);\n if (scale != (int) scale) {\n throw new NumberFormatException(\"String_Node_Str\");\n }\n }\n String unscaled = unscaledBuffer.toString();\n if (unscaled.length() < 16) {\n smallValue = parseUnscaled(unscaled);\n if (Double.isNaN(smallValue)) {\n throw new NumberFormatException(\"String_Node_Str\" + val + \"String_Node_Str\");\n }\n bitLength = bitLength(smallValue);\n } else {\n setUnscaledValue(new BigInteger(unscaled));\n }\n precision = unscaledBuffer.length() - counter;\n for (int i = 0; i < unscaledBuffer.length(); ++i) {\n char ch = unscaledBuffer.charAt(i);\n if (ch != '-' && ch != '0') {\n break;\n }\n --precision;\n }\n}\n"
|
"public boolean setValue(Object value) {\n try {\n if (value == null) {\n this.value = null;\n } else if (\"String_Node_Str\".equals(type)) {\n byte[] tmp = (byte[]) value;\n this.value = JSON.toJSONString(tmp);\n } else if (\"String_Node_Str\".equals(type)) {\n this.value = (String) value;\n } else if (\"String_Node_Str\".equals(type)) {\n boolean tmp = (boolean) value;\n this.value = JSON.toJSONString(tmp);\n } else if (\"String_Node_Str\".equals(type)) {\n int tmp = (int) value;\n this.value = JSON.toJSONString(tmp);\n } else if (\"String_Node_Str\".equals(type)) {\n List tmp = (List) value;\n this.value = JSON.toJSONString(tmp);\n } else if (\"String_Node_Str\".equals(type)) {\n Object tmp = (Object) value;\n this.value = JSON.toJSONString(tmp);\n } else if (\"String_Node_Str\".equals(type)) {\n } else {\n throw new SDKException(\"String_Node_Str\");\n }\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n}\n"
|
"public void constructCaches(int cacheSize) {\n _scheduleCache = new HashMap();\n if (cacheSize > 0) {\n _scheduleKeyList = new ArrayList(cacheSize);\n }\n _externalRatesCache = new TreeMap();\n _cacheSize = cacheSize;\n}\n"
|
"protected void drawImage(String uri, String extension, float imageX, float imageY, float height, float width, String helpText) throws Exception {\n if (uri == null) {\n return;\n }\n byte[] imageData = null;\n InputStream imageStream = new URL(uri).openStream();\n int data;\n ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();\n while ((data = imageStream.read()) != -1) {\n byteArrayOut.write(data);\n }\n drawImage(byteArrayOut.toByteArray(), extension, imageX, imageY, height, width, helpText);\n}\n"
|
"private void processRefProperty(RefProperty subRef, String externalFile) {\n if (isAnExternalRefFormat(subRef.getRefFormat())) {\n if (subRef.get$ref().startsWith(\"String_Node_Str\"))\n processRefToExternalDefinition(subRef.get$ref(), RefFormat.RELATIVE);\n else {\n processRefToExternalDefinition($ref, RefFormat.URL);\n }\n } else {\n processRefToExternalDefinition(externalFile + subRef.get$ref(), RefFormat.RELATIVE);\n }\n}\n"
|
"public Loader<SimpleCursor> onCreateLoader(int i, Bundle bundle) {\n return new SimpleCursorLoader(getActivity(), RelatedMovies.fromMovie(movieId), MoviesAdapter.PROJECTION, null, null, null);\n}\n"
|
"public void setMarginsRelative(int start, int top, int end, int bottom) {\n startMargin = start;\n topMargin = top;\n endMargin = end;\n bottomMargin = bottom;\n mMarginFlags |= NEED_RESOLUTION_MASK;\n}\n"
|
"public static ReusableBuffer deserializeSerializableBuffer(ReusableBuffer data) {\n final int dataSize = data.getInt();\n if (dataSize == 0)\n return BufferPool.allocate(0);\n final ReusableBuffer viewbuf = data.createViewBuffer();\n viewbuf.range(data.position(), dataSize);\n if (dataSize % 4 > 0) {\n for (int k = 0; k < (4 - (dataSize % 4)); k++) {\n data.get();\n }\n }\n return viewbuf;\n}\n"
|
"public static String paramName(final Parameter param, final Parameter[] all) {\n final Optional<Pair<Class<? extends Annotation>, String>> parameterAnnotation = parameterAnnotation(param);\n String paramName;\n if (parameterAnnotation.isPresent()) {\n paramName = parameterAnnotation.get().getValue();\n } else {\n if (param.getType().isPrimitive()) {\n paramName = param.getType().getSimpleName() + \"String_Node_Str\";\n } else {\n paramName = param.getType().getSimpleName();\n }\n int found = 0;\n for (final Parameter p : all) {\n if (!parameterAnnotation(param).isPresent() && p.getType().equals(param.getType())) {\n found++;\n }\n }\n if (found > 1) {\n paramName += ThreadLocalRandom.current().nextInt(0, 9999);\n }\n }\n return uncapitalize(paramName);\n}\n"
|
"public String logout() {\n try {\n myLogger.debug(\"String_Node_Str\");\n this.credential.destroy();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n}\n"
|
"public void updateCachedIssues(List<Issue> issueList) {\n if (issueList.size() == 0) {\n return;\n }\n WeakReference<Model> selfRef = new WeakReference<Model>(this);\n for (int i = issueList.size() - 1; i >= 0; i--) {\n Issue issue = issueList.get(i);\n Platform.runLater(new Runnable() {\n public void run() {\n TurboIssue newCached = new TurboIssue(issue, selfRef.get());\n updateCachedIssue(newCached);\n }\n });\n }\n}\n"
|
"public List<DedicatedResourceVO> dedicateHost(final Long hostId, final Long domainId, final String accountName) {\n Long accountId = null;\n if (accountName != null) {\n Account caller = CallContext.current().getCallingAccount();\n Account owner = _accountMgr.finalizeOwner(caller, accountName, domainId, null);\n accountId = owner.getId();\n }\n checkAccountAndDomain(accountId, domainId);\n HostVO host = _hostDao.findById(hostId);\n if (host == null) {\n throw new InvalidParameterValueException(\"String_Node_Str\" + hostId);\n } else {\n if (host.getType() != Host.Type.Routing) {\n throw new CloudRuntimeException(\"String_Node_Str\" + host.getName());\n }\n DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId);\n DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId());\n DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId());\n DedicatedResourceVO dedicatedZoneOfHost = _dedicatedDao.findByZoneId(host.getDataCenterId());\n if (dedicatedHost != null) {\n s_logger.error(\"String_Node_Str\" + host.getName() + \"String_Node_Str\");\n throw new CloudRuntimeException(\"String_Node_Str\" + host.getName() + \"String_Node_Str\");\n }\n if (dedicatedClusterOfHost != null) {\n boolean domainIdInChildreanList = getDomainChildIds(dedicatedClusterOfHost.getDomainId()).contains(domainId);\n if (dedicatedClusterOfHost.getAccountId() != null || (accountId == null && !domainIdInChildreanList) || (accountId != null && !(dedicatedClusterOfHost.getDomainId().equals(domainId) || domainIdInChildreanList))) {\n ClusterVO cluster = _clusterDao.findById(host.getClusterId());\n s_logger.error(\"String_Node_Str\" + cluster.getName() + \"String_Node_Str\");\n throw new CloudRuntimeException(\"String_Node_Str\" + cluster.getName() + \"String_Node_Str\");\n }\n }\n if (dedicatedPodOfHost != null) {\n boolean domainIdInChildreanList = getDomainChildIds(dedicatedPodOfHost.getDomainId()).contains(domainId);\n if (dedicatedPodOfHost.getAccountId() != null || (accountId == null && !domainIdInChildreanList) || (accountId != null && !(dedicatedPodOfHost.getDomainId() == domainId || domainIdInChildreanList))) {\n HostPodVO pod = _podDao.findById(host.getPodId());\n s_logger.error(\"String_Node_Str\" + pod.getName() + \"String_Node_Str\");\n throw new CloudRuntimeException(\"String_Node_Str\" + pod.getName() + \"String_Node_Str\");\n }\n }\n if (dedicatedZoneOfHost != null) {\n boolean domainIdInChildreanList = getDomainChildIds(dedicatedZoneOfHost.getDomainId()).contains(domainId);\n if (dedicatedZoneOfHost.getAccountId() != null || (accountId == null && !domainIdInChildreanList) || (accountId != null && !(dedicatedZoneOfHost.getDomainId() == domainId || domainIdInChildreanList))) {\n DataCenterVO zone = _zoneDao.findById(host.getDataCenterId());\n s_logger.error(\"String_Node_Str\" + zone.getName() + \"String_Node_Str\");\n throw new CloudRuntimeException(\"String_Node_Str\" + zone.getName() + \"String_Node_Str\");\n }\n }\n }\n List<Long> childDomainIds = getDomainChildIds(domainId);\n childDomainIds.add(domainId);\n checkHostSuitabilityForExplicitDedication(accountId, childDomainIds, hostId);\n final Long accountIdFinal = accountId;\n return Transaction.execute(new TransactionCallback<List<DedicatedResourceVO>>() {\n public List<DedicatedResourceVO> doInTransaction(TransactionStatus status) {\n AffinityGroup group = findOrCreateDedicatedAffinityGroup(domainId, accountIdFinal);\n if (group == null) {\n s_logger.error(\"String_Node_Str\");\n throw new CloudRuntimeException(\"String_Node_Str\");\n }\n DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(null, null, null, hostId, null, null, group.getId());\n try {\n dedicatedResource.setDomainId(domainId);\n if (accountIdFinal != null) {\n dedicatedResource.setAccountId(accountIdFinal);\n }\n dedicatedResource = _dedicatedDao.persist(dedicatedResource);\n } catch (Exception e) {\n s_logger.error(\"String_Node_Str\" + e.getMessage(), e);\n throw new CloudRuntimeException(\"String_Node_Str\");\n }\n List<DedicatedResourceVO> result = new ArrayList<DedicatedResourceVO>();\n result.add(dedicatedResource);\n return result;\n }\n });\n}\n"
|
"private void initSchema(Job job) throws IOException {\n if (schema != null) {\n return;\n }\n schema = PigSchemaConverter.parsePigSchema(getPropertyFromUDFContext(PARQUET_PIG_SCHEMA));\n if (schema == null && requestedSchema != null) {\n schema = requestedSchema;\n return;\n }\n schema = PigSchemaConverter.parsePigSchema(getPropertyFromUDFContext(PARQUET_PIG_SCHEMA));\n if (schema == null) {\n final GlobalMetaData globalMetaData = getParquetInputFormat().getGlobalMetaData(job);\n schema = getPigSchemaFromMultipleFiles(globalMetaData.getSchema(), globalMetaData.getKeyValueMetaData());\n }\n if (isElephantBirdCompatible(job)) {\n convertToElephantBirdCompatibleSchema(schema);\n }\n}\n"
|
"public String toString() {\n return number == 0 ? \"String_Node_Str\" : \"String_Node_Str\" + number + \"String_Node_Str\";\n}\n"
|
"public SwaggerDeserializationResult readWithInfo(String swaggerAsString) {\n if (swaggerAsString == null) {\n return new SwaggerDeserializationResult().message(\"String_Node_Str\");\n }\n try {\n JsonNode node;\n if (swaggerAsString.trim().startsWith(\"String_Node_Str\")) {\n ObjectMapper mapper = Json.mapper();\n node = mapper.readTree(swaggerAsString);\n } else {\n node = DeserializationUtils.readYamlTree(swaggerAsString);\n }\n SwaggerDeserializationResult result = new Swagger20Parser().readWithInfo(node);\n if (result != null) {\n if (resolve) {\n result.setSwagger(new SwaggerResolver(result.getSwagger(), new ArrayList<AuthorizationValue>(), null).resolve());\n }\n } else {\n result = new SwaggerDeserializationResult().message(\"String_Node_Str\");\n }\n return result;\n } catch (Exception e) {\n return new SwaggerDeserializationResult().message(\"String_Node_Str\");\n }\n}\n"
|
"private SpecificationPackage loadPack(String fn) throws FHIRException, IOException {\n if (\"String_Node_Str\".equals(version)) {\n sp = SpecificationPackage.fromPath(fn, new R2ToR4Loader());\n } else if (\"String_Node_Str\".equals(version)) {\n return SpecificationPackage.fromPath(fn, new R3ToR4Loader());\n } else if (\"String_Node_Str\".equals(version)) {\n return SpecificationPackage.fromPath(fn, new R3ToR4Loader());\n } else\n return SpecificationPackage.fromPath(fn);\n}\n"
|
"public void testCopyFromNestedArrayRow() throws Exception {\n execute(\"String_Node_Str\" + \"String_Node_Str\");\n ensureYellow();\n execute(\"String_Node_Str\", new Object[] { nestedArrayCopyFilePath + \"String_Node_Str\" });\n assertEquals(1L, response.rowCount());\n refresh();\n execute(\"String_Node_Str\");\n assertThat(response.rowCount(), is(1L));\n assertThat(TestingHelpers.printedTable(response.rows()), is(\"String_Node_Str\"));\n}\n"
|
"public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {\n updateBatteryState(intent);\n } else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {\n updateSignalState(intent);\n } else if (intent.getAction().equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) {\n int state = intent.getIntExtra(BluetoothA2dp.EXTRA_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED);\n int oldState = intent.getIntExtra(BluetoothA2dp.EXTRA_PREVIOUS_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED);\n BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);\n synchronized (BluetoothHandsfree.this) {\n mA2dpState = state;\n mA2dpDevice = device;\n if (oldState == BluetoothA2dp.STATE_PLAYING && mA2dpState == BluetoothA2dp.STATE_CONNECTED) {\n if (mA2dpSuspended) {\n if (mPendingSco) {\n mHandler.removeMessages(MESSAGE_CHECK_PENDING_SCO);\n if (DBG)\n log(\"String_Node_Str\");\n mOutgoingSco = createScoSocket();\n if (!mOutgoingSco.connect(mHeadset.getRemoteDevice().getAddress())) {\n mOutgoingSco = null;\n }\n mPendingSco = false;\n }\n }\n }\n mPendingSco = false;\n }\n }\n}\n"
|
"public void createNamespace(NamespaceMeta metadata) throws NamespaceCannotBeCreatedException, AlreadyExistsException {\n Preconditions.checkArgument(metadata != null, \"String_Node_Str\");\n if (hasNamespace(Id.Namespace.from(metadata.getName()))) {\n throw new AlreadyExistsException(NAMESPACE_ELEMENT_TYPE, metadata.getName());\n }\n try {\n dsFramework.createNamespace(Id.Namespace.from(metadata.getName()));\n } catch (DatasetManagementException e) {\n throw new NamespaceCannotBeCreatedException(metadata.getName(), e);\n }\n store.createNamespace(metadata);\n}\n"
|
"public NEATPopulation getPopulation() {\n if (this.comboPopulation.getSelectedValue() == null)\n return null;\n return ((ProjectEGFile) this.comboPopulation.getSelectedValue());\n}\n"
|
"public void onEntityDeath(EntityDeathEvent event) {\n if (!(event instanceof PlayerDeathEvent)) {\n Player killer = ecoEntityUtil.getKillerFromDeathEvent(event);\n if (killer != null) {\n Bukkit.getPluginManager().callEvent(new CreatureKilledByPlayerEvent(event));\n } else {\n plugin.getRewardManager(event.getEntity().getWorld()).handleNoFarm(event);\n }\n return;\n }\n Bukkit.getPluginManager().callEvent(new CreatureKilledByPlayerEvent(event));\n}\n"
|
"public void afterStory(boolean given) {\n if (isAfterStory(currentStory)) {\n ThucydidesWebDriverSupport.closeAllDrivers();\n generateReports();\n } else if (!isFixture(currentStory)) {\n StepEventBus.getEventBus().testSuiteFinished();\n clearListeners();\n }\n}\n"
|
"public void actionPerformed(ActionEvent actor) {\n if (!(round instanceof OperatingRound))\n return;\n oRound = (OperatingRound) round;\n retrieveStep = true;\n JComponent source = (JComponent) actor.getSource();\n String command = actor.getActionCommand();\n List<PossibleAction> executedActions = null;\n PossibleAction executedAction = null;\n PossibleAction executedActionToComplete = null;\n Class executedActionType = null;\n if (source instanceof ActionTaker) {\n executedActions = ((ActionTaker) source).getPossibleActions();\n if (!executedActions.isEmpty()) {\n executedAction = executedActions.get(0);\n executedActionType = executedAction.getClass();\n log.debug(\"String_Node_Str\" + executedAction.toString());\n }\n }\n int amount;\n if (executedActionType == SetDividend.class) {\n SetDividend action = (SetDividend) executedAction;\n if (command.equals(SET_REVENUE_CMD)) {\n amount = ((Integer) revenueSelect[orCompIndex].getValue()).intValue();\n log.debug(\"String_Node_Str\" + amount);\n action.setActualRevenue(amount);\n if (action.getRevenueAllocation() != SetDividend.UNKNOWN) {\n orWindow.process(action);\n } else {\n orStep = OperatingRound.STEP_PAYOUT;\n retrieveStep = false;\n updateStatus(action);\n }\n } else {\n orWindow.process(action);\n }\n } else if (command.equals(BUY_TRAIN_CMD)) {\n buyTrain();\n } else if (command.equals(BUY_PRIVATE_CMD)) {\n buyPrivate();\n } else if (executedActionType == NullAction.class || executedActionType == GameAction.class) {\n orWindow.process(executedAction);\n }\n ReportWindow.addLog();\n if (!(GameManager.getInstance().getCurrentRound() instanceof OperatingRound)) {\n orWindow.updateORWindow();\n }\n}\n"
|
"static public void updateOrCreateExitDataPropertyWithCommand(String command, String value, boolean delete) {\n boolean isValueNull = false;\n if (value == null || \"String_Node_Str\".equals(value)) {\n isValueNull = true;\n }\n StringBuffer result = new StringBuffer(512);\n String currentProperty = System.getProperty(org.eclipse.equinox.app.IApplicationContext.EXIT_DATA_PROPERTY);\n if (currentProperty != null) {\n Pattern commandPattern = Pattern.compile(command + patternStr);\n Matcher restartMatcher = commandPattern.matcher(currentProperty);\n if (delete) {\n if (restartMatcher.find()) {\n currentProperty = restartMatcher.replaceAll(\"String_Node_Str\");\n }\n } else {\n if (restartMatcher.find()) {\n currentProperty = restartMatcher.replaceAll(command + EclipseCommandLine.NEW_LINE + (isValueNull ? \"String_Node_Str\" : value + EclipseCommandLine.NEW_LINE));\n } else {\n int indexOfVmArgs = currentProperty.indexOf(CMD_VMARGS);\n if (indexOfVmArgs >= 0) {\n currentProperty = currentProperty.substring(0, indexOfVmArgs) + command + EclipseCommandLine.NEW_LINE + (isValueNull ? \"String_Node_Str\" : value + EclipseCommandLine.NEW_LINE) + currentProperty.substring(indexOfVmArgs);\n } else {\n throw new IllegalArgumentException(\"String_Node_Str\" + org.eclipse.equinox.app.IApplicationContext.EXIT_DATA_PROPERTY + \"String_Node_Str\" + EclipseCommandLine.CMD_VMARGS);\n }\n }\n }\n result.append(currentProperty);\n } else {\n String property = System.getProperty(EclipseCommandLine.PROP_VM);\n result.append(property);\n result.append(EclipseCommandLine.NEW_LINE);\n String vmargs = System.getProperty(EclipseCommandLine.PROP_VMARGS);\n if (vmargs != null) {\n result.append(vmargs);\n }\n property = System.getProperty(EclipseCommandLine.PROP_COMMANDS);\n if (property == null) {\n if (value != null) {\n result.append(command);\n result.append(EclipseCommandLine.NEW_LINE);\n if (!isValueNull) {\n result.append(value);\n result.append(EclipseCommandLine.NEW_LINE);\n }\n }\n } else {\n Pattern commandPattern = Pattern.compile(command + \"String_Node_Str\");\n Matcher restartMatcher = commandPattern.matcher(property);\n if (delete) {\n if (restartMatcher.find()) {\n property = restartMatcher.replaceAll(EclipseCommandLine.NEW_LINE);\n }\n } else {\n if (restartMatcher.find()) {\n property = restartMatcher.replaceAll(command + EclipseCommandLine.NEW_LINE + (isValueNull ? \"String_Node_Str\" : value + EclipseCommandLine.NEW_LINE));\n } else {\n result.append(command);\n result.append(EclipseCommandLine.NEW_LINE);\n if (!isValueNull) {\n result.append(value);\n result.append(EclipseCommandLine.NEW_LINE);\n }\n }\n }\n result.append(property);\n }\n if (vmargs != null) {\n result.append(EclipseCommandLine.CMD_VMARGS);\n result.append(EclipseCommandLine.NEW_LINE);\n result.append(vmargs);\n }\n }\n System.setProperty(org.eclipse.equinox.app.IApplicationContext.EXIT_DATA_PROPERTY, result.toString());\n}\n"
|
"public boolean add(CharSequence key) {\n if (insertKey(key)) {\n list.add(key);\n if (free == 0) {\n resize();\n }\n return true;\n }\n return false;\n}\n"
|
"private List<Statement> evalStmt(IASTStatement statement) throws DOMException {\n List<Statement> ret = new ArrayList<Statement>();\n if (statement instanceof IASTBreakStatement) {\n print(\"String_Node_Str\");\n int temp = findLastLoopId();\n if (temp != -1) {\n Block blk = ast.newBlock();\n blk.statements().add(ast.newExpressionStatement(createCleanupCall(temp + 1)));\n blk.statements().add(ast.newBreakStatement());\n ret.add(blk);\n } else\n ret.add(ast.newBreakStatement());\n } else if (statement instanceof IASTCaseStatement) {\n IASTCaseStatement caseStatement = (IASTCaseStatement) statement;\n print(\"String_Node_Str\");\n SwitchCase cs = ast.newSwitchCase();\n cs.setExpression(eval1Expr(caseStatement.getExpression()));\n ret.add(cs);\n } else if (statement instanceof IASTContinueStatement) {\n print(\"String_Node_Str\");\n int temp = findLastLoopId();\n if (m_localVariableId != -1) {\n Block blk = ast.newBlock();\n blk.statements().add(ast.newExpressionStatement(createCleanupCall(temp + 1)));\n blk.statements().add(ast.newContinueStatement());\n ret.add(blk);\n } else\n ret.add(ast.newContinueStatement());\n } else if (statement instanceof IASTDefaultStatement) {\n print(\"String_Node_Str\");\n SwitchCase cs = ast.newSwitchCase();\n cs.setExpression(null);\n ret.add(cs);\n } else if (statement instanceof IASTGotoStatement) {\n IASTGotoStatement gotoStatement = (IASTGotoStatement) statement;\n print(\"String_Node_Str\");\n getSimpleName(gotoStatement.getName());\n } else if (statement instanceof IASTNullStatement) {\n print(\"String_Node_Str\");\n ret.add(ast.newEmptyStatement());\n } else if (statement instanceof IASTProblemStatement) {\n IASTProblemStatement probStatement = (IASTProblemStatement) statement;\n print(\"String_Node_Str\" + probStatement.getProblem().getMessageWithLocation());\n } else if (statement instanceof IASTCompoundStatement) {\n IASTCompoundStatement compoundStatement = (IASTCompoundStatement) statement;\n print(\"String_Node_Str\");\n m_localVariableStack.push(new StackVar(m_localVariableId, m_isLoop));\n m_isLoop = false;\n Block block = ast.newBlock();\n for (IASTStatement childStatement : compoundStatement.getStatements()) block.statements().addAll(evalStmt(childStatement));\n block.statements().addAll(stmtQueue);\n stmtQueue.clear();\n int temp = m_localVariableStack.pop().id;\n if (!block.statements().isEmpty() && !(block.statements().get(block.statements().size() - 1) instanceof ReturnStatement) && m_localVariableId != -1) {\n block.statements().add(ast.newExpressionStatement(createCleanupCall(temp + 1)));\n }\n m_localVariableId = temp;\n ret.add(block);\n } else if (statement instanceof IASTDeclarationStatement) {\n IASTDeclarationStatement declarationStatement = (IASTDeclarationStatement) statement;\n print(\"String_Node_Str\");\n List<VariableDeclarationFragment> frags = getDeclarationFragments(declarationStatement.getDeclaration());\n List<Type> types = evaluateDeclarationReturnTypes(declarationStatement.getDeclaration());\n for (int i = 0; i < types.size(); i++) {\n VariableDeclarationStatement decl = ast.newVariableDeclarationStatement(frags.get(i));\n decl.setType(types.get(i));\n ret.add(decl);\n }\n ret.addAll(stmtQueue);\n stmtQueue.clear();\n } else if (statement instanceof IASTDoStatement) {\n IASTDoStatement doStatement = (IASTDoStatement) statement;\n print(\"String_Node_Str\");\n DoStatement dos = ast.newDoStatement();\n m_isLoop = true;\n dos.setBody(eval1Stmt(doStatement.getBody()));\n m_isLoop = false;\n dos.setExpression(evalExpr(doStatement.getCondition(), TypeEnum.BOOLEAN).get(0));\n ret.add(dos);\n } else if (statement instanceof IASTExpressionStatement) {\n IASTExpressionStatement expressionStatement = (IASTExpressionStatement) statement;\n print(\"String_Node_Str\");\n ret.add(ast.newExpressionStatement(eval1Expr(expressionStatement.getExpression())));\n } else if (statement instanceof IASTForStatement) {\n IASTForStatement forStatement = (IASTForStatement) statement;\n print(\"String_Node_Str\");\n if (forStatement instanceof ICPPASTForStatement)\n ;\n ForStatement fs = ast.newForStatement();\n List<Expression> inits = evaluateForInitializer(forStatement.getInitializerStatement());\n Expression expr = evalExpr(forStatement.getConditionExpression(), TypeEnum.BOOLEAN).get(0);\n List<Expression> updaters = evalExpr(forStatement.getIterationExpression());\n if (inits != null)\n fs.initializers().addAll(inits);\n if (expr != null)\n fs.setExpression(expr);\n if (updaters.get(0) != null)\n fs.updaters().addAll(updaters);\n m_isLoop = true;\n fs.setBody(eval1Stmt(forStatement.getBody()));\n m_isLoop = false;\n ret.add(fs);\n } else if (statement instanceof IASTIfStatement) {\n IASTIfStatement ifStatement = (IASTIfStatement) statement;\n print(\"String_Node_Str\");\n IfStatement ifs = ast.newIfStatement();\n if (ifStatement instanceof ICPPASTIfStatement && ((ICPPASTIfStatement) ifStatement).getConditionDeclaration() != null) {\n ICPPASTIfStatement cppIf = (ICPPASTIfStatement) ifStatement;\n List<VariableDeclarationFragment> frags = getDeclarationFragments(cppIf.getConditionDeclaration());\n frags.get(0).setInitializer(null);\n VariableDeclarationStatement decl = ast.newVariableDeclarationStatement(frags.get(0));\n Type jType = evaluateDeclarationReturnTypes(cppIf.getConditionDeclaration()).get(0);\n decl.setType(jType);\n ret.add(decl);\n List<Expression> exprs = evaluateDeclarationReturnInitializers(cppIf.getConditionDeclaration());\n Assignment assign = jast.newAssign().left(ast.newSimpleName(frags.get(0).getName().getIdentifier())).right(exprs.get(0)).op(Assignment.Operator.ASSIGN).toAST();\n IASTExpression expr = evalDeclarationReturnFirstInitializerExpression(cppIf.getConditionDeclaration());\n Expression finalExpr = makeExpressionBoolean(assign, expr);\n ifs.setExpression(finalExpr);\n } else {\n ifs.setExpression(evalExpr(ifStatement.getConditionExpression(), TypeEnum.BOOLEAN).get(0));\n }\n ifs.setThenStatement(eval1Stmt(ifStatement.getThenClause()));\n List<Statement> elseStmts = evalStmt(ifStatement.getElseClause());\n ifs.setElseStatement(!elseStmts.isEmpty() ? elseStmts.get(0) : null);\n ret.add(ifs);\n } else if (statement instanceof IASTLabelStatement) {\n IASTLabelStatement labelStatement = (IASTLabelStatement) statement;\n print(\"String_Node_Str\");\n evalStmt(labelStatement.getNestedStatement());\n } else if (statement instanceof IASTReturnStatement) {\n IASTReturnStatement returnStatement = (IASTReturnStatement) statement;\n print(\"String_Node_Str\");\n JASTHelper.Method method = jast.newMethod().on(\"String_Node_Str\").call(\"String_Node_Str\");\n ReturnStatement ret2 = ast.newReturnStatement();\n if (returnStatement.getReturnValue() != null) {\n if (returnStatement.getReturnValue() != null && ((returnStatement.getReturnValue().getExpressionType() instanceof ICompositeType || (returnStatement.getReturnValue().getExpressionType() instanceof IQualifierType && ((IQualifierType) returnStatement.getReturnValue().getExpressionType()).getType() instanceof ICompositeType)) && !(eval1Expr(returnStatement.getReturnValue()) instanceof ClassInstanceCreation))) {\n ClassInstanceCreation create = jast.newClassCreate().type(cppToJavaType(returnStatement.getReturnValue().getExpressionType())).with(eval1Expr(returnStatement.getReturnValue())).toAST();\n if (m_localVariableId != -1)\n method.with(create);\n else\n ret2.setExpression(create);\n } else {\n if (m_localVariableId != -1)\n method.with(eval1Expr(returnStatement.getReturnValue()));\n else\n ret2.setExpression(eval1Expr(returnStatement.getReturnValue()));\n }\n if (m_localVariableId != -1) {\n method.with(\"String_Node_Str\").with(0);\n ret2.setExpression(method.toAST());\n }\n ret.add(ret2);\n } else {\n if (m_localVariableId != -1) {\n Block blk = ast.newBlock();\n method.with(ast.newNullLiteral()).with(\"String_Node_Str\").with(0);\n blk.statements().add(ast.newExpressionStatement(method.toAST()));\n blk.statements().add(ret2);\n ret.add(blk);\n } else\n ret.add(ret2);\n }\n } else if (statement instanceof IASTSwitchStatement) {\n IASTSwitchStatement switchStatement = (IASTSwitchStatement) statement;\n print(\"String_Node_Str\");\n SwitchStatement swt = ast.newSwitchStatement();\n if (switchStatement instanceof ICPPASTSwitchStatement && ((ICPPASTSwitchStatement) switchStatement).getControllerDeclaration() != null) {\n ICPPASTSwitchStatement cppSwitch = (ICPPASTSwitchStatement) switchStatement;\n List<VariableDeclarationFragment> frags = getDeclarationFragments(cppSwitch.getControllerDeclaration());\n frags.get(0).setInitializer(null);\n VariableDeclarationStatement decl = ast.newVariableDeclarationStatement(frags.get(0));\n Type jType = evaluateDeclarationReturnTypes(cppSwitch.getControllerDeclaration()).get(0);\n decl.setType(jType);\n ret.add(decl);\n List<Expression> exprs = evaluateDeclarationReturnInitializers(cppSwitch.getControllerDeclaration());\n Assignment assign = jast.newAssign().left(ast.newSimpleName(frags.get(0).getName().getIdentifier())).right(exprs.get(0)).op(Assignment.Operator.ASSIGN).toAST();\n swt.setExpression(assign);\n } else {\n swt.setExpression(evalExpr(switchStatement.getControllerExpression()).get(0));\n }\n if (switchStatement.getBody() instanceof IASTCompoundStatement) {\n IASTCompoundStatement compound = (IASTCompoundStatement) switchStatement.getBody();\n for (IASTStatement stmt : compound.getStatements()) {\n swt.statements().addAll(evalStmt(stmt));\n }\n } else {\n swt.statements().addAll(evalStmt(switchStatement.getBody()));\n }\n ret.add(swt);\n } else if (statement instanceof IASTWhileStatement) {\n IASTWhileStatement whileStatement = (IASTWhileStatement) statement;\n print(\"String_Node_Str\");\n WhileStatement whs = ast.newWhileStatement();\n if (whileStatement instanceof ICPPASTWhileStatement && ((ICPPASTWhileStatement) whileStatement).getConditionDeclaration() != null) {\n ICPPASTWhileStatement cppWhile = (ICPPASTWhileStatement) whileStatement;\n List<VariableDeclarationFragment> frags = getDeclarationFragments(cppWhile.getConditionDeclaration());\n frags.get(0).setInitializer(null);\n VariableDeclarationStatement decl = ast.newVariableDeclarationStatement(frags.get(0));\n Type jType = evaluateDeclarationReturnTypes(cppWhile.getConditionDeclaration()).get(0);\n decl.setType(jType);\n ret.add(decl);\n List<Expression> exprs = evaluateDeclarationReturnInitializers(cppWhile.getConditionDeclaration());\n Assignment assign = jast.newAssign().left(ast.newSimpleName(frags.get(0).getName().getIdentifier())).right(exprs.get(0)).op(Assignment.Operator.ASSIGN).toAST();\n IASTExpression expr = evalDeclarationReturnFirstInitializerExpression(cppWhile.getConditionDeclaration());\n Expression finalExpr = makeExpressionBoolean(assign, expr);\n whs.setExpression(finalExpr);\n } else {\n whs.setExpression(evalExpr(whileStatement.getCondition(), TypeEnum.BOOLEAN).get(0));\n }\n whs.setBody(evalStmt(whileStatement.getBody()).get(0));\n ret.add(whs);\n } else if (statement instanceof ICPPASTTryBlockStatement) {\n ICPPASTTryBlockStatement tryBlockStatement = (ICPPASTTryBlockStatement) statement;\n print(\"String_Node_Str\");\n TryStatement trys = ast.newTryStatement();\n trys.setBody((Block) evalStmt(tryBlockStatement.getTryBody()));\n for (ICPPASTCatchHandler catchHandler : tryBlockStatement.getCatchHandlers()) trys.catchClauses().add(evaluateCatchClause(catchHandler));\n ret.add(trys);\n } else if (statement != null) {\n printerr(statement.getClass().getCanonicalName());\n }\n return ret;\n}\n"
|
"public final String render(StackTrace stackTrace) {\n final StringBuilder builder = new StringBuilder();\n renderPreTrace(builder, stackTrace);\n List<Entry> ignoredEntries = new ArrayList<Entry>();\n for (int segmentIndex = 0; segmentIndex < stackTrace.getSegments().size(); segmentIndex++) {\n Segment segment = stackTrace.getSegments().get(segmentIndex);\n renderPreSegment(builder, stackTrace.getSegments(), segmentIndex);\n for (int entryIndex = 0; entryIndex < segment.numberOfEntries(); entryIndex++) {\n Entry entry = segment.getEntries().get(entryIndex);\n if (filter == null) {\n renderEntry(builder, segment.getEntries(), entryIndex);\n } else if (filter.include(entry, entryIndex)) {\n if (!ignoredEntries.isEmpty()) {\n renderIgnoredEntries(builder, ignoredEntries, entryIndex - ignoredEntries.size());\n ignoredEntries.clear();\n }\n renderEntry(builder, segment.getEntries(), entryIndex);\n } else {\n ignoredEntries.add(entry);\n }\n }\n if (!ignoredEntries.isEmpty()) {\n renderIgnoredEntries(builder, ignoredEntries, segment.numberOfEntries() - ignoredEntries.size());\n ignoredEntries.clear();\n }\n renderPostSegment(builder, stackTrace.getSegments(), segmentIndex);\n segmentIndex++;\n }\n renderPostTrace(builder, stackTrace);\n return builder.toString();\n}\n"
|
"protected void doConnect() throws Exception {\n try {\n client.connect(\"String_Node_Str\", getListenerPort());\n } catch (FTPConnectionClosedException e) {\n Thread.sleep(200);\n client.connect(\"String_Node_Str\", port);\n }\n}\n"
|
"public void clearAndExecute(final RedisRunner runner) {\n final Jedis jedis = pool.getResource();\n jedis.flushAll();\n pool.returnResource(jedis);\n runner.run(pool.getResource());\n pool.returnResource(jedis);\n}\n"
|
"public void onPacketSending(PacketEvent event) {\n StructureModifier<GameProfile> profiles = event.getPacket().getSpecificModifier(GameProfile.class);\n GameProfile profile = profiles.read(0);\n String name = profile.getName();\n SkinsRestorer.getInstance().logDebug(\"String_Node_Str\" + name);\n if (SkinsRestorer.getInstance().getSkinStorage().hasLoadedSkinData(name)) {\n SkinsRestorer.getInstance().logDebug(\"String_Node_Str\" + name);\n SkinProfile skinprofile = SkinsRestorer.getInstance().getSkinStorage().getLoadedSkinData(name);\n profiles.write(0, ProfileUtils.recreateProfile(profile, skinprofile));\n }\n}\n"
|
"public static int digit(char c, int radix) {\n if (radix < MIN_RADIX || radix > MAX_RADIX) {\n return -1;\n }\n if (c >= '0' && c <= '9') {\n return c - '0';\n } else if (c >= 'a' && c < ('a' + radix - 10)) {\n return c - 'a' + 10;\n } else if (c >= 'A' && c < ('A' + radix - 10)) {\n return c - 'A' + 10;\n }\n return -1;\n}\n"
|
"public static void main(String[] args) {\n FlagsImpl flags = new FlagsImpl();\n CmdLineParser parser = new CmdLineParser(flags);\n if (args.length == 0) {\n parser.printUsage(System.out);\n System.exit(0);\n }\n try {\n parser.parseArgument(args);\n if (flags.getDisplayHelp()) {\n parser.printUsage(System.out);\n System.exit(0);\n }\n File config = new File(flags.getConfig());\n Set<FileInfo> fileSet = new LinkedHashSet<FileInfo>();\n List<Class<? extends Module>> plugins = new LinkedList<Class<? extends Module>>();\n String defaultServerAddress = null;\n if (flags.getTests().size() > 0 || flags.getReset() || !flags.getArguments().isEmpty() || flags.getPreloadFiles() || flags.getDryRun()) {\n if (config.exists()) {\n ConfigurationParser configParser = new ConfigurationParser(config.getParentFile());\n PluginLoader pluginLoader = new PluginLoader();\n try {\n configParser.parse(new FileInputStream(flags.getConfig()));\n fileSet = configParser.getFilesList();\n defaultServerAddress = configParser.getServer();\n plugins = pluginLoader.load(configParser.getPlugins());\n } catch (FileNotFoundException e) {\n System.err.println(e);\n System.exit(1);\n }\n }\n }\n Guice.createInjector(new JsTestDriverModule(flags, fileSet, defaultServerAddress, plugins)).getInstance(ActionRunner.class).runActions();\n } catch (CmdLineException e) {\n System.err.println(e.getMessage());\n parser.printUsage(System.err);\n } catch (Exception e) {\n System.err.println(e);\n System.exit(1);\n }\n}\n"
|
"public static String cleanAllEntities(String broken) {\n String working = broken;\n allEntities: while (true) {\n int amp = working.indexOf('&');\n if (amp == -1) {\n break allEntities;\n }\n int i = amp + 1;\n singleEntity: while (true) {\n char c = working.charAt(i);\n if (c == ';') {\n DataPolice.report(\"String_Node_Str\" + working.substring(amp, i + 1));\n working = working.substring(0, amp) + working.substring(i + 1);\n break singleEntity;\n }\n if (!Character.isLetterOrDigit(c) && c != '-') {\n working = working.substring(0, amp) + working.substring(i);\n break singleEntity;\n }\n i++;\n if (i >= working.length()) {\n break singleEntity;\n }\n }\n }\n return working;\n}\n"
|
"private void impactExistingAnalyses(DataProvider oldDataProvider) throws PartInitException {\n EList<Dependency> clientDependencies = oldDataProvider.getSupplierDependency();\n List<Analysis> unsynedAnalyses = new ArrayList<Analysis>();\n for (Dependency dep : clientDependencies) {\n StringBuffer impactedAnaStr = new StringBuffer();\n for (ModelElement mod : dep.getClient()) {\n if (!(mod instanceof Analysis)) {\n continue;\n }\n Analysis ana = (Analysis) mod;\n unsynedAnalyses.add(ana);\n impactedAnaStr.append(ana.getName());\n }\n for (Analysis analysis : unsynedAnalyses) {\n Resource eResource = analysis.eResource();\n if (eResource == null) {\n continue;\n }\n EMFSharedResources.getInstance().unloadResource(eResource.getURI().toString());\n IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\n Path path = new Path(analysis.getFileName() == null ? eResource.getURI().toPlatformString(false) : analysis.getFileName());\n IFile file = root.getFile(path);\n analysis = (Analysis) AnaResourceFileHelper.getInstance().getModelElement(file);\n if (analysis != null) {\n eResource = analysis.eResource();\n Map<EObject, Collection<Setting>> referenceMaps = EcoreUtil.UnresolvedProxyCrossReferencer.find(eResource);\n Iterator<EObject> it = referenceMaps.keySet().iterator();\n ModelElement eobj = null;\n while (it.hasNext()) {\n eobj = (ModelElement) it.next();\n Collection<Setting> settings = referenceMaps.get(eobj);\n for (Setting setting : settings) {\n if (setting.getEObject() instanceof AnalysisContext) {\n analysis.getContext().getAnalysedElements().remove(eobj);\n } else if (setting.getEObject() instanceof Indicator) {\n analysis.getResults().getIndicators().remove(setting.getEObject());\n }\n }\n }\n }\n AnaResourceFileHelper.getInstance().save(analysis);\n }\n }\n IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();\n IEditorReference[] editors = activePage.getEditorReferences();\n if (editors != null) {\n for (IEditorReference editorRef : editors) {\n if (editorRef.getId().equals(ANALYSIS_EDITOR_ID)) {\n boolean isConfirm = MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString(\"String_Node_Str\"), Messages.getString(\"String_Node_Str\"));\n if (!isConfirm) {\n return;\n }\n }\n }\n for (IEditorReference editorRef : editors) {\n IEditorInput editorInput = editorRef.getEditorInput();\n if (editorRef.getId().equals(ANALYSIS_EDITOR_ID)) {\n activePage.closeEditor(editorRef.getEditor(false), false);\n activePage.openEditor(editorInput, ANALYSIS_EDITOR_ID);\n }\n }\n }\n}\n"
|
"public void createPartControl(Composite parent) {\n ftpClient = FtpConnection.getInstance();\n ftpClient.addLogListener(this);\n Composite container = new Composite(parent, SWT.NONE);\n container.setLayout(new FillLayout());\n styledText = new StyledText(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);\n styledText.setLayout(new FillLayout());\n styledText.setEditable(false);\n String log = ftpClient.getLog();\n if (log == null) {\n log = \"String_Node_Str\";\n }\n styledText.setText(log);\n styledText.setTopIndex(styledText.getLineCount());\n createActions();\n initializeToolBar();\n initializeMenu();\n}\n"
|
"public String[] getValues(String key, String[] defaultValues) {\n if (key == null) {\n throw new IllegalArgumentException(EXCEPTIONS.getString(\"String_Node_Str\", \"String_Node_Str\"));\n }\n String[] values = null;\n PortletPreference pref = (PortletPreference) preferences.get(key);\n if (pref != null) {\n values = pref.getValues();\n }\n if (values == null) {\n values = defaultValues;\n }\n return values;\n}\n"
|
"public boolean m(Entity entity) {\n int damage = isMyPet() ? myPet.getDamage() : MyPet.getStartDamage(MyPetType.getMyPetTypeByEntityClass(this.getClass()).getMyPetClass());\n if (entity instanceof EntityPlayer) {\n Player victim = (Player) entity.getBukkitEntity();\n if (!MyPetPvP.canHurt(myPet.getOwner().getPlayer(), victim)) {\n if (myPet.hasTarget()) {\n myPet.getCraftPet().getHandle().setGoalTarget(null);\n }\n return false;\n }\n }\n return entity.damageEntity(DamageSource.mobAttack(this), damage);\n}\n"
|
"public LogMessageImpl handle(LogMessageImpl msg) {\n try (Writer out = this.check()) {\n out.write(msg.format(0));\n out.write(LINE_SEP);\n out.flush();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n return msg;\n}\n"
|
"private void updateSystemVmTemplates(final Connection conn) {\n LOG.debug(\"String_Node_Str\");\n final Set<Hypervisor.HypervisorType> hypervisorsListInUse = new HashSet<Hypervisor.HypervisorType>();\n try (PreparedStatement pstmt = conn.prepareStatement(\"String_Node_Str\");\n ResultSet rs = pstmt.executeQuery()) {\n while (rs.next()) {\n switch(Hypervisor.HypervisorType.getType(rs.getString(1))) {\n case XenServer:\n hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer);\n break;\n case KVM:\n hypervisorsListInUse.add(Hypervisor.HypervisorType.KVM);\n break;\n case VMware:\n hypervisorsListInUse.add(Hypervisor.HypervisorType.VMware);\n break;\n case Hyperv:\n hypervisorsListInUse.add(Hypervisor.HypervisorType.Hyperv);\n break;\n default:\n break;\n }\n }\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\", e);\n }\n final Map<Hypervisor.HypervisorType, String> NewTemplateNameList = new HashMap<Hypervisor.HypervisorType, String>() {\n {\n put(Hypervisor.HypervisorType.XenServer, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.VMware, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.KVM, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.Hyperv, \"String_Node_Str\");\n }\n };\n final Map<Hypervisor.HypervisorType, String> routerTemplateConfigurationNames = new HashMap<Hypervisor.HypervisorType, String>() {\n {\n put(Hypervisor.HypervisorType.XenServer, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.VMware, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.KVM, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.Hyperv, \"String_Node_Str\");\n }\n };\n final Map<Hypervisor.HypervisorType, String> newTemplateUrl = new HashMap<Hypervisor.HypervisorType, String>() {\n {\n put(Hypervisor.HypervisorType.XenServer, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.VMware, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.KVM, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.Hyperv, \"String_Node_Str\");\n }\n };\n final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType, String>() {\n {\n put(Hypervisor.HypervisorType.XenServer, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.VMware, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.KVM, \"String_Node_Str\");\n put(Hypervisor.HypervisorType.Hyperv, \"String_Node_Str\");\n }\n };\n for (final Map.Entry<Hypervisor.HypervisorType, String> hypervisorAndTemplateName : NewTemplateNameList.entrySet()) {\n LOG.debug(\"String_Node_Str\" + hypervisorAndTemplateName.getKey() + \"String_Node_Str\");\n try (PreparedStatement pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n long templateId = -1;\n pstmt.setString(1, hypervisorAndTemplateName.getValue());\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n templateId = rs.getLong(1);\n }\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\", e);\n }\n if (templateId != -1) {\n try (PreparedStatement templ_type_pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n templ_type_pstmt.setLong(1, templateId);\n templ_type_pstmt.executeUpdate();\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + templateId + \"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\" + templateId + \"String_Node_Str\", e);\n }\n try (PreparedStatement update_templ_id_pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n update_templ_id_pstmt.setLong(1, templateId);\n update_templ_id_pstmt.setString(2, hypervisorAndTemplateName.getKey().toString());\n update_templ_id_pstmt.executeUpdate();\n } catch (final Exception e) {\n LOG.error(\"String_Node_Str\" + hypervisorAndTemplateName.getKey().toString() + \"String_Node_Str\" + templateId + \"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\" + hypervisorAndTemplateName.getKey().toString() + \"String_Node_Str\" + templateId, e);\n }\n try (PreparedStatement update_pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n update_pstmt.setString(1, hypervisorAndTemplateName.getValue());\n update_pstmt.setString(2, routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()));\n update_pstmt.executeUpdate();\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + \"String_Node_Str\" + hypervisorAndTemplateName.getValue() + \"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\" + routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()) + \"String_Node_Str\" + hypervisorAndTemplateName.getValue(), e);\n }\n try (PreparedStatement update_pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n update_pstmt.setString(1, \"String_Node_Str\");\n update_pstmt.setString(2, \"String_Node_Str\");\n update_pstmt.executeUpdate();\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\", e);\n }\n } else {\n if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())) {\n throw new CloudRuntimeException(getUpgradedVersion() + hypervisorAndTemplateName.getKey() + \"String_Node_Str\");\n } else {\n LOG.warn(getUpgradedVersion() + hypervisorAndTemplateName.getKey() + \"String_Node_Str\" + hypervisorAndTemplateName.getKey() + \"String_Node_Str\");\n try (PreparedStatement update_templ_url_pstmt = conn.prepareStatement(\"String_Node_Str\")) {\n update_templ_url_pstmt.setString(1, newTemplateUrl.get(hypervisorAndTemplateName.getKey()));\n update_templ_url_pstmt.setString(2, newTemplateChecksum.get(hypervisorAndTemplateName.getKey()));\n update_templ_url_pstmt.setString(3, hypervisorAndTemplateName.getKey().toString());\n update_templ_url_pstmt.executeUpdate();\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + hypervisorAndTemplateName.getKey().toString() + \"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\" + hypervisorAndTemplateName.getKey().toString(), e);\n }\n }\n }\n } catch (final SQLException e) {\n LOG.error(\"String_Node_Str\" + e.getMessage());\n throw new CloudRuntimeException(\"String_Node_Str\", e);\n }\n }\n LOG.debug(\"String_Node_Str\");\n}\n"
|
"public boolean onPartActivate(EntityPlayer player, Vec3 pos) {\n ItemStack is = player.inventory.getCurrentItem();\n TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem(is);\n if (is != null && is.getItem() instanceof IMemoryCard) {\n IMemoryCard mc = (IMemoryCard) is.getItem();\n NBTTagCompound data = mc.getData(is);\n ItemStack newType = ItemStack.loadItemStackFromNBT(data);\n long freq = data.getLong(\"String_Node_Str\");\n if (newType != null) {\n if (newType.getItem() instanceof IPartItem) {\n IPart testPart = ((IPartItem) newType.getItem()).createPartFromItemStack(newType);\n if (testPart instanceof PartP2PTunnel) {\n getHost().removePart(side, true);\n ForgeDirection dir = getHost().addPart(newType, side, player);\n IPart newBus = getHost().getPart(dir);\n if (newBus instanceof PartP2PTunnel) {\n PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;\n newTunnel.output = true;\n try {\n P2PCache p2p = newTunnel.proxy.getP2P();\n p2p.updateFreq(newTunnel, freq);\n } catch (GridAccessException e) {\n }\n newTunnel.onTunnelNetworkChange();\n }\n mc.notifyUser(player, MemoryCardMessages.SETTINGS_LOADED);\n return true;\n }\n }\n }\n mc.notifyUser(player, MemoryCardMessages.INVALID_MACHINE);\n } else if (tt != null) {\n ItemStack newType = null;\n switch(tt) {\n case RF_POWER:\n newType = AEApi.instance().parts().partP2PTunnelRF.stack(1);\n break;\n case BC_POWER:\n newType = AEApi.instance().parts().partP2PTunnelMJ.stack(1);\n break;\n case FLUID:\n newType = AEApi.instance().parts().partP2PTunnelLiquids.stack(1);\n break;\n case IC2_POWER:\n newType = AEApi.instance().parts().partP2PTunnelEU.stack(1);\n break;\n case ITEM:\n newType = AEApi.instance().parts().partP2PTunnelItems.stack(1);\n break;\n case ME:\n newType = AEApi.instance().parts().partP2PTunnelME.stack(1);\n break;\n case REDSTONE:\n newType = AEApi.instance().parts().partP2PTunnelRedstone.stack(1);\n break;\n }\n if (newType != null && !Platform.isSameItem(newType, this.is)) {\n boolean oldOutput = output;\n long myFreq = freq;\n getHost().removePart(side, false);\n ForgeDirection dir = getHost().addPart(newType, side, player);\n IPart newBus = getHost().getPart(dir);\n if (newBus instanceof PartP2PTunnel) {\n PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;\n newTunnel.output = oldOutput;\n newTunnel.onChange();\n try {\n P2PCache p2p = newTunnel.proxy.getP2P();\n p2p.updateFreq(newTunnel, myFreq);\n } catch (GridAccessException e) {\n }\n }\n tile.getWorldObj().notifyBlocksOfNeighborChange(tile.xCoord, tile.yCoord, tile.zCoord, Platform.air);\n return true;\n }\n }\n return false;\n}\n"
|
"public Object get(Data key) {\n checkIfLoaded();\n if (hasWaitingWriteBehindDeleteOperation(key)) {\n return null;\n }\n long now = getNow();\n Record record = records.get(key);\n record = nullIfExpired(record);\n Object value = null;\n if (record == null) {\n if (mapContainer.getStore() != null) {\n value = loadFromStoreOrStagingArea(key);\n if (value != null) {\n record = mapService.createRecord(name, key, value, DEFAULT_TTL, now);\n records.put(key, record);\n saveIndex(record);\n updateSizeEstimator(calculateRecordSize(record));\n }\n }\n } else {\n accessRecord(record, now);\n value = record.getValue();\n }\n value = mapService.interceptGet(name, value);\n postReadCleanUp(now);\n return value;\n}\n"
|
"public synchronized void updateFogCell(int cell) {\n updateFogArea(cell % mapWidth, cell / mapWidth, 1, 1);\n}\n"
|
"public boolean onActivated(EntityPlayer player) {\n if (player.inventory.getCurrentItem() != null) {\n if (player.inventory.getCurrentItem().getItem() instanceof ItemMissile) {\n if (this.getStackInSlot(0) == null) {\n this.setInventorySlotContents(0, player.inventory.getCurrentItem());\n if (!player.capabilities.isCreativeMode)\n player.inventory.setInventorySlotContents(player.inventory.currentItem, null);\n return true;\n } else {\n ItemStack player_held = player.inventory.getCurrentItem();\n if (!player.capabilities.isCreativeMode)\n player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0));\n this.setInventorySlotContents(0, player_held);\n return true;\n }\n }\n } else if (this.getStackInSlot(0) != null) {\n player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0));\n this.setInventorySlotContents(0, null);\n return true;\n }\n if (!this.worldObj.isRemote)\n player.openGui(ICBMExplosion.instance, 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);\n return true;\n}\n"
|
"static IQuery.GroupSpec groupDefnToSpec(Context cx, IGroupDefinition src, String expr, String columnName, int index) throws DataException {\n ColumnInfo groupKeyInfo = new ColumnInfo(index, columnName);\n int groupIndex = groupKeyInfo.getColumnIndex();\n String groupKey = groupKeyInfo.getColumnName();\n boolean isComplexExpression = true;\n IQuery.GroupSpec dest = new IQuery.GroupSpec(groupIndex, groupKey);\n dest.setName(src.getName());\n dest.setInterval(src.getInterval());\n dest.setIntervalRange(src.getIntervalRange());\n dest.setIntervalStart(src.getIntervalStart());\n dest.setSortDirection(src.getSortDirection());\n dest.setFilters(src.getFilters());\n if (src.getSorts().size() != 0) {\n dest.setSorts(src.getSorts());\n }\n dest.setIsComplexExpression(isComplexExpression);\n return dest;\n}\n"
|
"private void createOrUpdateNode(DocumentStore store, UpdateOp op) {\n Map<String, Object> map = store.createOrUpdate(Collection.NODES, op);\n if (baseRevision != null) {\n Revision newestRev = mk.getNewestRevision(map, revision, true);\n if (newestRev == null) {\n if (op.isDelete || !op.isNew) {\n throw new MicroKernelException(\"String_Node_Str\" + op.path + \"String_Node_Str\" + \"String_Node_Str\" + revision + \"String_Node_Str\" + map);\n }\n } else {\n if (op.isNew) {\n throw new MicroKernelException(\"String_Node_Str\" + op.path + \"String_Node_Str\" + newestRev + \"String_Node_Str\" + revision + \"String_Node_Str\" + map);\n }\n if (mk.isRevisionNewer(newestRev, baseRevision)) {\n throw new MicroKernelException(\"String_Node_Str\" + op.path + \"String_Node_Str\" + newestRev + \"String_Node_Str\" + baseRevision + \"String_Node_Str\" + revision + \"String_Node_Str\" + map);\n }\n }\n }\n int size = Utils.estimateMemoryUsage(map);\n if (size > MAX_DOCUMENT_SIZE) {\n UpdateOp[] split = splitDocument(map);\n UpdateOp old = split[0];\n if (old != null) {\n store.createOrUpdate(Collection.NODES, old);\n }\n UpdateOp main = split[1];\n if (main != null) {\n store.createOrUpdate(Collection.NODES, main);\n }\n }\n}\n"
|
"public void disableFollow() {\n if (isFollowEnabled.compareAndSet(true, false)) {\n realLocation = null;\n MavLinkDoCmds.resetROI(drone);\n disableWatchdog();\n }\n}\n"
|
"public boolean canExecute() {\n return super.canExecute() && handle.canDrop();\n}\n"
|
"public String toJson(Object src, Type typeOfSrc) {\n if (src == null) {\n return;\n }\n JsonSerializationContext context = new JsonSerializationContextDefault(navigatorFactory, serializeNulls, serializers);\n JsonElement jsonElement = context.serialize(src, typeOfSrc);\n StringWriter writer = new StringWriter();\n formatter.format(jsonElement, new PrintWriter(writer), serializeNulls);\n return jsonElement == null ? \"String_Node_Str\" : writer.toString();\n}\n"
|
"public void graph_request(String sGraphRequest, String sKeys, String sVals, String sMethod) {\n trace(\"String_Node_Str\" + sMethod);\n Bundle params = stringTo_bundle(sKeys, sVals);\n final Request req = new Request(Session.getActiveSession(), sGraphRequest, params, HttpMethod.valueOf(sMethod), listener_request);\n _mSurface.queueEvent(new Runnable() {\n\n public void run() {\n RequestAsyncTask task = new RequestAsyncTask(req);\n task.execute();\n }\n });\n}\n"
|
"private void renderBinaryValues(Graphics2D g2, QrCode qr) {\n locator.setMarker(qr);\n List<Point2D_I32> points = QrCode.LOCATION_BITS[qr.version];\n PackedBits8 bits = new PackedBits8();\n bits.data = qr.rawbits;\n bits.size = qr.rawbits.length * 8;\n Point2D_F32 p = new Point2D_F32();\n g2.setStroke(new BasicStroke(1));\n for (int i = 0; i < bits.size; i++) {\n Point2D_I32 c = points.get(i);\n locatorB.gridToImage(c.y + 0.5f, c.x + 0.5f, p);\n int value = qr.mask.apply(c.y, c.x, bits.get(i));\n if (value == 1) {\n renderCircleAt(g2, p, Color.BLACK, Color.LIGHT_GRAY);\n } else if (value == 0) {\n renderCircleAt(g2, p, Color.WHITE, Color.LIGHT_GRAY);\n } else {\n renderCircleAt(g2, p, Color.RED, Color.LIGHT_GRAY);\n }\n }\n}\n"
|
"private SendFragment getSendFragment() {\n return (SendFragment) getFragment(getChildFragmentManager(), SEND);\n}\n"
|
"private <T extends Collection<ProcessSpecification<?>>> T createProcessSpecification(BasicFlowletContext flowletContext, TypeToken<? extends Flowlet> flowletType, ProcessMethodFactory processMethodFactory, ProcessSpecificationFactory processSpecFactory, T result) throws NoSuchMethodException {\n Set<FlowletMethod> seenMethods = Sets.newHashSet();\n for (TypeToken<?> type : flowletType.getTypes().classes()) {\n if (type.getRawType().equals(Object.class)) {\n break;\n }\n for (Method method : type.getRawType().getDeclaredMethods()) {\n if (!seenMethods.add(new FlowletMethod(method, flowletType))) {\n continue;\n }\n ProcessInput processInputAnnotation = method.getAnnotation(ProcessInput.class);\n Tick tickAnnotation = method.getAnnotation(Tick.class);\n if (processInputAnnotation == null && tickAnnotation == null) {\n continue;\n }\n int maxRetries = (tickAnnotation == null) ? processInputAnnotation.maxRetries() : tickAnnotation.maxRetries();\n ProcessMethod processMethod = processMethodFactory.create(method, maxRetries);\n Set<String> inputNames;\n Schema schema;\n TypeToken<?> dataType;\n ConsumerConfig consumerConfig;\n int batchSize = 1;\n if (tickAnnotation != null) {\n inputNames = ImmutableSet.of();\n consumerConfig = new ConsumerConfig(0, 0, 1, DequeueStrategy.FIFO, null);\n schema = Schema.of(Schema.Type.NULL);\n dataType = TypeToken.of(void.class);\n } else {\n inputNames = Sets.newHashSet(processInputAnnotation.value());\n if (inputNames.isEmpty()) {\n inputNames.add(FlowletDefinition.ANY_INPUT);\n }\n dataType = flowletType.resolveType(method.getGenericParameterTypes()[0]);\n consumerConfig = getConsumerConfig(flowletContext, method);\n Integer processBatchSize = getBatchSize(method);\n if (processBatchSize != null) {\n if (dataType.getRawType().equals(Iterator.class)) {\n Preconditions.checkArgument(dataType.getType() instanceof ParameterizedType, \"String_Node_Str\");\n dataType = flowletType.resolveType(((ParameterizedType) dataType.getType()).getActualTypeArguments()[0]);\n }\n batchSize = processBatchSize;\n }\n try {\n schema = schemaGenerator.generate(dataType.getType());\n } catch (UnsupportedTypeException e) {\n throw Throwables.propagate(e);\n }\n }\n ProcessSpecification processSpec = processSpecFactory.create(inputNames, schema, dataType, processMethod, consumerConfig, batchSize, tickAnnotation);\n if (processSpec != null) {\n result.add(processSpec);\n }\n }\n }\n Preconditions.checkArgument(!result.isEmpty(), \"String_Node_Str\", flowletContext.getFlowletId(), flowletContext.getFlowId(), flowletContext.getApplicationId(), flowletType);\n return result;\n}\n"
|
"public void start() {\n try {\n InputStream is = new ClassPathResource(resourcePath, InstrumentationApplication.class.getClassLoader()).getInputStream();\n File tmpConfig = new File(resourcePath);\n if (!tmpConfig.getParentFile().exists())\n tmpConfig.getParentFile().mkdirs();\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tmpConfig));\n IOUtils.copy(is, bos);\n bos.flush();\n run(new String[] { \"String_Node_Str\", tmpConfig.getAbsolutePath() });\n tmpConfig.deleteOnExit();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n}\n"
|
"public synchronized int process(Buffer buffer) {\n if (buffer.isDiscard())\n return BUFFER_PROCESSED_OK;\n int bufferLength = buffer.getLength();\n if (bufferLength == 0)\n return BUFFER_PROCESSED_OK;\n Format format = buffer.getFormat();\n if ((format != null) && (format != this.inputFormat) && !format.equals(this.inputFormat) && (setInputFormat(format) == null)) {\n return BUFFER_PROCESSED_FAILED;\n }\n if (handle == 0)\n return BUFFER_PROCESSED_FAILED;\n else {\n Dimension size = null;\n if (format != null)\n size = ((VideoFormat) format).getSize();\n if (size == null) {\n size = this.inputFormat.getSize();\n if (size == null)\n return BUFFER_PROCESSED_FAILED;\n }\n if ((size.width >= SwScale.MIN_SWS_SCALE_HEIGHT_OR_WIDTH) && (size.height >= SwScale.MIN_SWS_SCALE_HEIGHT_OR_WIDTH)) {\n Component component = getComponent();\n boolean repaint = process(handle, component, (int[]) buffer.getData(), buffer.getOffset(), bufferLength, size.width, size.height);\n if (repaint)\n component.repaint();\n }\n return BUFFER_PROCESSED_OK;\n }\n}\n"
|
"public String[] generateStatements(Database database) throws UnsupportedChangeException {\n List<String> sql = new ArrayList<String>();\n String alterTable = \"String_Node_Str\" + getTableName() + \"String_Node_Str\" + getColumn().getName() + \"String_Node_Str\" + database.getColumnType(getColumn());\n if (column.getConstraints() != null) {\n if (column.getConstraints().isNullable() != null && !column.getConstraints().isNullable()) {\n alterTable += \"String_Node_Str\";\n } else {\n }\n if (column.getDefaultValue() != null || column.getDefaultValueBoolean() != null || column.getDefaultValueDate() != null || column.getDefaultValueNumeric() != null) {\n alterTable += \"String_Node_Str\" + column.getDefaultColumnValue(database);\n }\n }\n sql.add(alterTable);\n if (database instanceof DB2Database) {\n sql.add(\"String_Node_Str\" + getTableName() + \"String_Node_Str\");\n }\n if (getColumn().getDefaultValue() != null || getColumn().getDefaultValueBoolean() != null || getColumn().getDefaultValueDate() != null || getColumn().getDefaultValueNumeric() != null) {\n AddDefaultValueChange change = new AddDefaultValueChange();\n change.setTableName(getTableName());\n change.setColumnName(getColumn().getName());\n change.setDefaultValue(getColumn().getDefaultValue());\n change.setDefaultValueNumeric(getColumn().getDefaultValueNumeric());\n change.setDefaultValueDate(getColumn().getDefaultValueDate());\n change.setDefaultValueBoolean(getColumn().getDefaultValueBoolean());\n sql.addAll(Arrays.asList(change.generateStatements(database)));\n }\n if (getColumn().getConstraints() != null) {\n if (getColumn().getConstraints().isPrimaryKey() != null && getColumn().getConstraints().isPrimaryKey()) {\n AddPrimaryKeyChange change = new AddPrimaryKeyChange();\n change.setTableName(getTableName());\n change.setColumnNames(getColumn().getName());\n sql.addAll(Arrays.asList(change.generateStatements(database)));\n }\n if (getColumn().getConstraints().isNullable() != null && !getColumn().getConstraints().isNullable()) {\n AddNotNullConstraintChange change = new AddNotNullConstraintChange();\n change.setTableName(getTableName());\n change.setColumnName(getColumn().getName());\n change.setColumnDataType(getColumn().getType());\n sql.addAll(Arrays.asList(change.generateStatements(database)));\n }\n }\n return sql.toArray(new String[sql.size()]);\n}\n"
|
"public void setDoc(IDocument doc) {\n Assert.isNotNull(doc, \"String_Node_Str\");\n this.doc = doc;\n}\n"
|
"public void init() throws Exception {\n _node1 = new ServerDispatcher(Listener.NULL_LISTENER);\n _node2 = new ServerDispatcher(Listener.NULL_LISTENER);\n _tport1 = new TransportImpl(new FailureDetectorImpl(5000, FailureDetectorImpl.OPEN_PIN));\n _node1.init(_tport1);\n _tport2 = new TransportImpl(new FailureDetectorImpl(5000, FailureDetectorImpl.OPEN_PIN));\n _tport2.filterTx(new LastDropper());\n _node2.init(_tport2);\n}\n"
|
"protected List<GraphTargetItem> printGraph(List<GraphPart> visited, List<Object> localData, Stack<GraphTargetItem> stack, List<GraphPart> allParts, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<Loop> loops, List<GraphTargetItem> ret) {\n if (stopPart == null) {\n stopPart = new ArrayList<>();\n }\n if (visited.contains(part)) {\n } else {\n visited.add(part);\n }\n if (ret == null) {\n ret = new ArrayList<>();\n }\n boolean debugMode = false;\n if (debugMode) {\n System.err.println(\"String_Node_Str\" + part + \"String_Node_Str\" + part.nextParts.size());\n }\n if (part == null) {\n return ret;\n }\n part = checkPart(localData, part);\n if (part == null) {\n return ret;\n }\n if (part.ignored) {\n return ret;\n }\n List<GraphPart> loopContinues = getLoopsContinues(loops);\n boolean isLoop = false;\n Loop currentLoop = null;\n for (Loop el : loops) {\n if ((el.loopContinue == part) && (el.phase == 0)) {\n currentLoop = el;\n currentLoop.phase = 1;\n isLoop = true;\n break;\n }\n }\n if (debugMode) {\n System.err.println(\"String_Node_Str\" + loops.size());\n }\n for (int l = loops.size() - 1; l >= 0; l--) {\n Loop el = loops.get(l);\n if (el == currentLoop) {\n if (debugMode) {\n System.err.println(\"String_Node_Str\" + el);\n }\n continue;\n }\n if (el.phase != 1) {\n if (debugMode) {\n }\n continue;\n }\n if (el.loopBreak == part) {\n if (currentLoop != null) {\n currentLoop.phase = 0;\n }\n ret.add(new BreakItem(null, el.id));\n return ret;\n }\n if (el.loopPreContinue == part) {\n if (currentLoop != null) {\n currentLoop.phase = 0;\n }\n ret.add(new ContinueItem(null, el.id));\n return ret;\n }\n if (el.loopContinue == part) {\n if (currentLoop != null) {\n currentLoop.phase = 0;\n }\n ret.add(new ContinueItem(null, el.id));\n return ret;\n }\n }\n if (stopPart.contains(part)) {\n if (currentLoop != null) {\n currentLoop.phase = 0;\n }\n return ret;\n }\n if ((part != null) && (code.size() <= part.start)) {\n ret.add(new ScriptEndItem());\n return ret;\n }\n List<GraphTargetItem> currentRet = ret;\n UniversalLoopItem loopItem = null;\n if (isLoop) {\n loopItem = new UniversalLoopItem(null, currentLoop);\n currentRet.add(loopItem);\n loopItem.commands = new ArrayList<>();\n currentRet = loopItem.commands;\n }\n boolean parseNext = true;\n List<GraphTargetItem> output = new ArrayList<>();\n List<GraphPart> parts = new ArrayList<>();\n if (part instanceof GraphPartMulti) {\n parts = ((GraphPartMulti) part).parts;\n } else {\n parts.add(part);\n }\n int end = part.end;\n for (GraphPart p : parts) {\n end = p.end;\n int start = p.start;\n try {\n output.addAll(code.translatePart(p, localData, stack, start, end));\n if ((end >= code.size() - 1) && p.nextParts.isEmpty()) {\n output.add(new ScriptEndItem());\n }\n } catch (Exception ex) {\n Logger.getLogger(Graph.class.getName()).log(Level.SEVERE, \"String_Node_Str\", ex);\n return ret;\n }\n }\n if (part.nextParts.size() == 2) {\n if ((stack.size() >= 2) && (stack.get(stack.size() - 1) instanceof NotItem) && (((NotItem) (stack.get(stack.size() - 1))).getOriginal().getNotCoerced() == stack.get(stack.size() - 2).getNotCoerced())) {\n currentRet.addAll(output);\n GraphPart sp0 = getNextNoJump(part.nextParts.get(0));\n GraphPart sp1 = getNextNoJump(part.nextParts.get(1));\n boolean reversed = false;\n loopContinues = getLoopsContinues(loops);\n loopContinues.add(part);\n if (sp1.leadsTo(code, sp0, loops)) {\n } else if (sp0.leadsTo(code, sp1, loops)) {\n reversed = true;\n }\n GraphPart next = reversed ? sp0 : sp1;\n GraphTargetItem ti;\n if ((ti = checkLoop(next, stopPart, loops)) != null) {\n currentRet.add(ti);\n } else {\n List<GraphPart> stopPart2 = new ArrayList<>(stopPart);\n stopPart2.add(reversed ? sp1 : sp0);\n printGraph(visited, localData, stack, allParts, parent, next, stopPart2, loops);\n GraphTargetItem second = stack.pop();\n GraphTargetItem first = stack.pop();\n if (!reversed) {\n AndItem a = new AndItem(null, first, second);\n stack.push(a);\n a.firstPart = part;\n if (second instanceof AndItem) {\n a.firstPart = ((AndItem) second).firstPart;\n }\n if (second instanceof OrItem) {\n a.firstPart = ((OrItem) second).firstPart;\n }\n } else {\n OrItem o = new OrItem(null, first, second);\n stack.push(o);\n o.firstPart = part;\n if (second instanceof AndItem) {\n o.firstPart = ((AndItem) second).firstPart;\n }\n if (second instanceof OrItem) {\n o.firstPart = ((OrItem) second).firstPart;\n }\n }\n next = reversed ? sp1 : sp0;\n if ((ti = checkLoop(next, stopPart, loops)) != null) {\n currentRet.add(ti);\n } else {\n currentRet.addAll(printGraph(visited, localData, stack, allParts, parent, next, stopPart, loops));\n }\n }\n parseNext = false;\n } else if ((stack.size() >= 2) && (stack.get(stack.size() - 1).getNotCoerced() == stack.get(stack.size() - 2).getNotCoerced())) {\n currentRet.addAll(output);\n GraphPart sp0 = getNextNoJump(part.nextParts.get(0));\n GraphPart sp1 = getNextNoJump(part.nextParts.get(1));\n boolean reversed = false;\n loopContinues = getLoopsContinues(loops);\n loopContinues.add(part);\n if (sp1.leadsTo(code, sp0, loops)) {\n } else if (sp0.leadsTo(code, sp1, loops)) {\n reversed = true;\n }\n GraphPart next = reversed ? sp0 : sp1;\n GraphTargetItem ti;\n if ((ti = checkLoop(next, stopPart, loops)) != null) {\n currentRet.add(ti);\n } else {\n List<GraphPart> stopPart2 = new ArrayList<>(stopPart);\n stopPart2.add(reversed ? sp1 : sp0);\n printGraph(visited, localData, stack, allParts, parent, next, stopPart2, loops);\n GraphTargetItem second = stack.pop();\n GraphTargetItem first = stack.pop();\n if (reversed) {\n AndItem a = new AndItem(null, first, second);\n stack.push(a);\n a.firstPart = part;\n if (second instanceof AndItem) {\n a.firstPart = ((AndItem) second).firstPart;\n }\n if (second instanceof OrItem) {\n a.firstPart = ((AndItem) second).firstPart;\n }\n } else {\n OrItem o = new OrItem(null, first, second);\n stack.push(o);\n o.firstPart = part;\n if (second instanceof OrItem) {\n o.firstPart = ((OrItem) second).firstPart;\n }\n if (second instanceof OrItem) {\n o.firstPart = ((OrItem) second).firstPart;\n }\n }\n next = reversed ? sp1 : sp0;\n if ((ti = checkLoop(next, stopPart, loops)) != null) {\n currentRet.add(ti);\n } else {\n currentRet.addAll(printGraph(visited, localData, stack, allParts, parent, next, stopPart, loops));\n }\n }\n parseNext = false;\n }\n }\n if (parseNext) {\n List<GraphTargetItem> retCheck = check(code, localData, allParts, stack, parent, part, stopPart, loops, output, currentLoop);\n if (retCheck != null) {\n if (!retCheck.isEmpty()) {\n currentRet.addAll(retCheck);\n }\n parseNext = false;\n } else {\n currentRet.addAll(output);\n }\n }\n if (parseNext) {\n if (part.nextParts.size() > 2) {\n GraphPart next = getMostCommonPart(part.nextParts, loops);\n List<GraphPart> vis = new ArrayList<>();\n GraphTargetItem switchedItem = stack.pop();\n List<GraphTargetItem> caseValues = new ArrayList<>();\n List<List<GraphTargetItem>> caseCommands = new ArrayList<>();\n List<GraphTargetItem> defaultCommands = new ArrayList<>();\n List<Integer> valueMappings = new ArrayList<>();\n Loop swLoop = new Loop(loops.size(), null, next);\n swLoop.phase = 1;\n loops.add(swLoop);\n boolean first = false;\n for (GraphPart p : part.nextParts) {\n if (vis.contains(p)) {\n valueMappings.add(caseCommands.size() - 1);\n continue;\n }\n if (!first) {\n valueMappings.add(caseCommands.size());\n }\n List<GraphPart> stopPart2 = new ArrayList<>();\n if (next != null) {\n stopPart2.add(next);\n } else if (!stopPart.isEmpty()) {\n stopPart2.add(stopPart.get(stopPart.size() - 1));\n }\n for (GraphPart p2 : part.nextParts) {\n if (p2 == p) {\n continue;\n }\n if (!stopPart2.contains(p2)) {\n stopPart2.add(p2);\n }\n }\n if (next != p) {\n if (first) {\n defaultCommands = printGraph(visited, prepareBranchLocalData(localData), stack, allParts, part, p, stopPart2, loops);\n } else {\n caseCommands.add(printGraph(visited, prepareBranchLocalData(localData), stack, allParts, part, p, stopPart2, loops));\n }\n vis.add(p);\n }\n first = false;\n }\n SwitchItem sw = new SwitchItem(null, swLoop, switchedItem, caseValues, caseCommands, defaultCommands, valueMappings);\n currentRet.add(sw);\n swLoop.phase = 2;\n if (next != null) {\n currentRet.addAll(printGraph(visited, localData, stack, allParts, part, next, stopPart, loops));\n }\n } else if (part.nextParts.size() == 2) {\n GraphTargetItem expr = stack.pop();\n if (expr instanceof LogicalOpItem) {\n expr = ((LogicalOpItem) expr).invert();\n } else {\n expr = new NotItem(null, expr);\n }\n GraphPart next = getNextCommonPart(part, loops);\n Stack<GraphTargetItem> trueStack = (Stack<GraphTargetItem>) stack.clone();\n Stack<GraphTargetItem> falseStack = (Stack<GraphTargetItem>) stack.clone();\n int trueStackSizeBefore = trueStack.size();\n int falseStackSizeBefore = falseStack.size();\n List<GraphTargetItem> onTrue = new ArrayList<>();\n boolean isEmpty = part.nextParts.get(0) == part.nextParts.get(1);\n if (isEmpty) {\n next = part.nextParts.get(0);\n }\n List<GraphPart> stopPart2 = new ArrayList<>(stopPart);\n if (next != null) {\n stopPart2.add(next);\n }\n if (!isEmpty) {\n onTrue = printGraph(visited, prepareBranchLocalData(localData), trueStack, allParts, part, part.nextParts.get(1), stopPart2, loops);\n }\n List<GraphTargetItem> onFalse = new ArrayList<>();\n if (!isEmpty) {\n onFalse = printGraph(visited, prepareBranchLocalData(localData), falseStack, allParts, part, part.nextParts.get(0), stopPart2, loops);\n }\n if (isEmpty(onTrue) && isEmpty(onFalse) && (trueStack.size() > trueStackSizeBefore) && (falseStack.size() > falseStackSizeBefore)) {\n stack.push(new TernarOpItem(null, expr, trueStack.pop(), falseStack.pop()));\n } else {\n currentRet.add(new IfItem(null, expr, onTrue, onFalse));\n }\n if (next != null) {\n printGraph(visited, localData, stack, allParts, part, next, stopPart, loops, currentRet);\n }\n } else if (part.nextParts.size() == 1) {\n boolean nextloop = false;\n for (Loop l : loops) {\n if (part.nextParts.get(0) == l.loopContinue) {\n nextloop = true;\n break;\n }\n if (part.nextParts.get(0) == l.loopPreContinue) {\n nextloop = true;\n break;\n }\n }\n if (true) {\n printGraph(visited, localData, stack, allParts, part, part.nextParts.get(0), stopPart, loops, currentRet);\n }\n }\n }\n if (isLoop) {\n LoopItem li = loopItem;\n boolean loopTypeFound = false;\n boolean hasContinue = false;\n processIfs(loopItem.commands);\n checkContinueAtTheEnd(loopItem.commands, currentLoop);\n List<ContinueItem> continues = loopItem.getContinues();\n for (ContinueItem c : continues) {\n if (c.loopId == currentLoop.id) {\n hasContinue = true;\n break;\n }\n }\n if (!hasContinue) {\n if (currentLoop.loopPreContinue != null) {\n List<GraphPart> stopContPart = new ArrayList<>();\n stopContPart.add(currentLoop.loopContinue);\n GraphPart precoBackup = currentLoop.loopPreContinue;\n currentLoop.loopPreContinue = null;\n loopItem.commands.addAll(printGraph(visited, localData, new Stack<GraphTargetItem>(), allParts, null, precoBackup, stopContPart, loops));\n }\n }\n if (!loopTypeFound && (!loopItem.commands.isEmpty())) {\n if (loopItem.commands.get(0) instanceof IfItem) {\n IfItem ifi = (IfItem) loopItem.commands.get(0);\n List<GraphTargetItem> bodyBranch = null;\n boolean inverted = false;\n boolean breakpos2 = false;\n if ((ifi.onTrue.size() == 1) && (ifi.onTrue.get(0) instanceof BreakItem)) {\n BreakItem bi = (BreakItem) ifi.onTrue.get(0);\n if (bi.loopId == currentLoop.id) {\n bodyBranch = ifi.onFalse;\n inverted = true;\n }\n } else if ((ifi.onFalse.size() == 1) && (ifi.onFalse.get(0) instanceof BreakItem)) {\n BreakItem bi = (BreakItem) ifi.onFalse.get(0);\n if (bi.loopId == currentLoop.id) {\n bodyBranch = ifi.onTrue;\n }\n } else if (loopItem.commands.size() == 2 && (loopItem.commands.get(1) instanceof BreakItem)) {\n BreakItem bi = (BreakItem) loopItem.commands.get(1);\n if (bi.loopId == currentLoop.id) {\n bodyBranch = ifi.onTrue;\n breakpos2 = true;\n }\n }\n if (bodyBranch != null) {\n int index = ret.indexOf(loopItem);\n ret.remove(index);\n List<GraphTargetItem> exprList = new ArrayList<>();\n GraphTargetItem expr = ifi.expression;\n if (inverted) {\n if (expr instanceof LogicalOpItem) {\n expr = ((LogicalOpItem) expr).invert();\n } else {\n expr = new NotItem(null, expr);\n }\n }\n exprList.add(expr);\n List<GraphTargetItem> commands = new ArrayList<>();\n commands.addAll(bodyBranch);\n loopItem.commands.remove(0);\n if (breakpos2) {\n loopItem.commands.remove(0);\n }\n commands.addAll(loopItem.commands);\n checkContinueAtTheEnd(commands, currentLoop);\n List<GraphTargetItem> finalComm = new ArrayList<>();\n if (currentLoop.loopPreContinue != null) {\n GraphPart backup = currentLoop.loopPreContinue;\n currentLoop.loopPreContinue = null;\n List<GraphPart> stopPart2 = new ArrayList<>(stopPart);\n stopPart2.add(currentLoop.loopContinue);\n finalComm = printGraph(visited, localData, new Stack<GraphTargetItem>(), allParts, null, backup, stopPart2, loops);\n currentLoop.loopPreContinue = backup;\n checkContinueAtTheEnd(finalComm, currentLoop);\n }\n if (!finalComm.isEmpty()) {\n ret.add(index, li = new ForTreeItem(null, currentLoop, new ArrayList<GraphTargetItem>(), exprList.get(exprList.size() - 1), finalComm, commands));\n } else {\n ret.add(index, li = new WhileItem(null, currentLoop, exprList, commands));\n }\n loopTypeFound = true;\n }\n }\n }\n if (!loopTypeFound && (!loopItem.commands.isEmpty())) {\n if (loopItem.commands.get(loopItem.commands.size() - 1) instanceof IfItem) {\n IfItem ifi = (IfItem) loopItem.commands.get(loopItem.commands.size() - 1);\n List<GraphTargetItem> bodyBranch = null;\n boolean inverted = false;\n if ((ifi.onTrue.size() == 1) && (ifi.onTrue.get(0) instanceof BreakItem)) {\n BreakItem bi = (BreakItem) ifi.onTrue.get(0);\n if (bi.loopId == currentLoop.id) {\n bodyBranch = ifi.onFalse;\n inverted = true;\n }\n } else if ((ifi.onFalse.size() == 1) && (ifi.onFalse.get(0) instanceof BreakItem)) {\n BreakItem bi = (BreakItem) ifi.onFalse.get(0);\n if (bi.loopId == currentLoop.id) {\n bodyBranch = ifi.onTrue;\n }\n }\n if (bodyBranch != null) {\n int index = ret.indexOf(loopItem);\n ret.remove(index);\n List<GraphTargetItem> exprList = new ArrayList<>();\n GraphTargetItem expr = ifi.expression;\n if (inverted) {\n if (expr instanceof LogicalOpItem) {\n expr = ((LogicalOpItem) expr).invert();\n } else {\n expr = new NotItem(null, expr);\n }\n }\n checkContinueAtTheEnd(bodyBranch, currentLoop);\n List<GraphTargetItem> commands = new ArrayList<>();\n if (!bodyBranch.isEmpty()) {\n ret.add(index, loopItem);\n } else {\n loopItem.commands.remove(loopItem.commands.size() - 1);\n commands.addAll(loopItem.commands);\n commands.addAll(bodyBranch);\n exprList.add(expr);\n checkContinueAtTheEnd(commands, currentLoop);\n ret.add(index, li = new DoWhileItem(null, currentLoop, commands, exprList));\n }\n loopTypeFound = true;\n }\n }\n }\n if (!loopTypeFound) {\n if (currentLoop.loopPreContinue != null) {\n loopTypeFound = true;\n GraphPart backup = currentLoop.loopPreContinue;\n currentLoop.loopPreContinue = null;\n List<GraphPart> stopPart2 = new ArrayList<>(stopPart);\n stopPart2.add(currentLoop.loopContinue);\n List<GraphTargetItem> finalComm = printGraph(visited, localData, new Stack<GraphTargetItem>(), allParts, null, backup, stopPart2, loops);\n currentLoop.loopPreContinue = backup;\n checkContinueAtTheEnd(finalComm, currentLoop);\n if (!finalComm.isEmpty()) {\n if (finalComm.get(finalComm.size() - 1) instanceof IfItem) {\n IfItem ifi = (IfItem) finalComm.get(finalComm.size() - 1);\n boolean ok = false;\n boolean invert = false;\n if (((ifi.onTrue.size() == 1) && (ifi.onTrue.get(0) instanceof BreakItem) && (((BreakItem) ifi.onTrue.get(0)).loopId == currentLoop.id)) && ((ifi.onTrue.size() == 1) && (ifi.onFalse.get(0) instanceof ContinueItem) && (((ContinueItem) ifi.onFalse.get(0)).loopId == currentLoop.id))) {\n ok = true;\n invert = true;\n }\n if (((ifi.onTrue.size() == 1) && (ifi.onTrue.get(0) instanceof ContinueItem) && (((ContinueItem) ifi.onTrue.get(0)).loopId == currentLoop.id)) && ((ifi.onTrue.size() == 1) && (ifi.onFalse.get(0) instanceof BreakItem) && (((BreakItem) ifi.onFalse.get(0)).loopId == currentLoop.id))) {\n ok = true;\n }\n if (ok) {\n finalComm.remove(finalComm.size() - 1);\n int index = ret.indexOf(loopItem);\n ret.remove(index);\n List<GraphTargetItem> exprList = new ArrayList<>(finalComm);\n GraphTargetItem expr = ifi.expression;\n if (invert) {\n if (expr instanceof LogicalOpItem) {\n expr = ((LogicalOpItem) expr).invert();\n } else {\n expr = new NotItem(null, expr);\n }\n }\n exprList.add(expr);\n ret.add(index, li = new DoWhileItem(null, currentLoop, loopItem.commands, exprList));\n }\n }\n }\n }\n }\n if (!loopTypeFound) {\n checkContinueAtTheEnd(loopItem.commands, currentLoop);\n }\n currentLoop.phase = 2;\n GraphTargetItem replaced = checkLoop(li, localData, loops);\n if (replaced != li) {\n int index = ret.indexOf(li);\n ret.remove(index);\n if (replaced != null) {\n ret.add(index, replaced);\n }\n }\n if (currentLoop.loopBreak != null) {\n ret.addAll(printGraph(visited, localData, stack, allParts, part, currentLoop.loopBreak, stopPart, loops));\n }\n }\n return ret;\n}\n"
|
"public void updateHosts(List<Host> hosts) {\n ThreadPreconditions.checkOnMainThread();\n if (hosts == null) {\n mHosts = Collections.emptyList();\n } else {\n mHosts = hosts;\n }\n notifyDataSetChanged();\n}\n"
|
"private void initComponents(CalendarState cs, Customer customer) {\n assignmentNumber = customer.getAssignmentList().size();\n reviewNumber = customer.getReviewList().size();\n if (cs.equals(CalendarState.DELETING_REVIEW) || cs.equals(CalendarState.SHOW_REVIEWS)) {\n infoPanel = new JPanel[reviewNumber];\n labelDescription = new JLabel[reviewNumber];\n buttonAction = new JButton[reviewNumber];\n } else {\n infoPanel = new JPanel[assignmentNumber];\n labelDescription = new JLabel[assignmentNumber];\n buttonAction = new JButton[assignmentNumber];\n labelState = new JLabel[assignmentNumber];\n }\n DBConnector dbConnector = new DBConnector();\n if (cs.equals(CalendarState.REVIEWING)) {\n setTitle(\"String_Node_Str\");\n for (Integer i = 0; i < infoPanel.length; i++) {\n Assignment a = null;\n try {\n int j = i + 1;\n String s = \"String_Node_Str\";\n a = customer.getAssignmentList().get(j);\n ResultSet rs = dbConnector.askDB(\"String_Node_Str\" + a.getCode() + \"String_Node_Str\");\n rs.next();\n s += \"String_Node_Str\" + rs.getString(\"String_Node_Str\");\n labelDescription[i] = new JLabel(s);\n buttonAction[i] = new JButton(\"String_Node_Str\");\n createPanel(i);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }\n } else if (cs.equals(CalendarState.DELETING_REVIEW)) {\n setTitle(\"String_Node_Str\");\n for (Integer i = 0; i < infoPanel.length; i++) {\n Review r = null;\n int j = i + 1;\n r = customer.getReviewList().get(j);\n String s = \"String_Node_Str\" + r.toString();\n labelDescription[i] = new JLabel(s);\n buttonAction[i] = new JButton(\"String_Node_Str\");\n createPanel(i);\n }\n } else if (cs.equals(CalendarState.SHOW_REVIEWS)) {\n setTitle(\"String_Node_Str\");\n for (Integer i = 0; i < infoPanel.length; i++) {\n Review r = null;\n int j = i + 1;\n r = customer.getReviewList().get(j);\n String s = \"String_Node_Str\" + r.toString();\n labelDescription[i] = new JLabel(s);\n buttonAction[i] = new JButton(\"String_Node_Str\");\n createPanel(i);\n }\n } else {\n setTitle(\"String_Node_Str\");\n for (Integer i = 0; i < infoPanel.length; i++) {\n Assignment a = null;\n try {\n int j = i + 1;\n String s = \"String_Node_Str\";\n a = customer.getAssignmentList().get(j);\n ResultSet rs = dbConnector.askDB(\"String_Node_Str\" + a.getCode() + \"String_Node_Str\");\n rs.next();\n s += \"String_Node_Str\" + rs.getString(\"String_Node_Str\");\n labelDescription[i] = new JLabel(s);\n buttonAction[i] = new JButton(\"String_Node_Str\");\n createPanel(i);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }\n }\n scrollPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\n scrollPanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n add(scrollPanel);\n}\n"
|
"protected void init() {\n assert (content instanceof IImageContent);\n image = (IImageContent) content;\n maxWidth = parent.getMaxAvaWidth();\n Dimension content = getSpecifiedDimension(image);\n IStyle style = image.getComputedStyle();\n root = (ContainerArea) AreaFactory.createInlineContainer(image, true, true);\n int marginWidth = getDimensionValue(style.getProperty(StyleConstants.STYLE_MARGIN_LEFT)) + getDimensionValue(style.getProperty(StyleConstants.STYLE_MARGIN_RIGHT));\n int borderWidth = getDimensionValue(style.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH)) + getDimensionValue(style.getProperty(StyleConstants.STYLE_BORDER_RIGHT_WIDTH));\n IStyle areaStyle = root.getStyle();\n if (marginWidth > maxWidth) {\n areaStyle.setMarginLeft(\"String_Node_Str\");\n areaStyle.setMarginRight(\"String_Node_Str\");\n marginWidth = 0;\n }\n int maxContentWidthWithBorder = maxWidth - marginWidth;\n if (borderWidth > maxContentWidthWithBorder) {\n areaStyle.setProperty(IStyle.STYLE_BORDER_LEFT_WIDTH, IStyle.NUMBER_0);\n areaStyle.setProperty(IStyle.STYLE_BORDER_RIGHT_WIDTH, IStyle.NUMBER_0);\n borderWidth = 0;\n }\n ImageArea imageArea = (ImageArea) AreaFactory.createImageArea(image, content);\n root.addChild(imageArea);\n imageArea.setPosition(getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_BORDER_LEFT_WIDTH)), getDimensionValue(areaStyle.getProperty(StyleConstants.STYLE_BORDER_TOP_WIDTH)));\n root.setWidth(content.getWidth());\n root.setHeight(content.getHeight());\n removePadding(areaStyle);\n imageArea.setWidth(root.getContentWidth());\n imageArea.setHeight(root.getContentHeight());\n}\n"
|
"public void onBlockBurn(BlockBurnEvent e) {\n Block b = e.getBlock();\n Location location = BukkitUtil.getLocation(b.getLocation());\n PlotArea area = location.getPlotArea();\n if (area == null) {\n return;\n }\n Plot plot = location.getOwnedPlot();\n if (plot == null || !plot.getFlag(Flags.BLOCK_BURN).or(false)) {\n event.setCancelled(true);\n }\n}\n"
|
"public void load_ExceptionPropagation() throws Exception {\n CacheLoader<Integer, Integer> clDefault = new MockCacheLoader<Integer, Integer>();\n Cache<Integer, Integer> cache = getCacheManager().configureCache(getTestCacheName(), new MutableConfiguration<Integer, Integer>().setCacheLoaderFactory(Factories.of(clDefault)));\n Integer key = 1;\n CompletionListenerFuture future = new CompletionListenerFuture();\n cache.loadAll(Collections.singleton(key), true, future);\n try {\n future.get(FUTURE_WAIT_MILLIS, TimeUnit.MILLISECONDS);\n assertTrue(future.isDone());\n fail(\"String_Node_Str\");\n } catch (ExecutionException e) {\n assertEquals(UnsupportedOperationException.class, e.getCause().getClass());\n }\n}\n"
|
"private IndexInfo readIndex(byte[] indexBytes) {\n DataInput input = ByteStreams.newDataInput(indexBytes);\n IndexInfo index = IndexInfoSerializer.deserialize(input);\n return index;\n}\n"
|
"protected void toString(StringBuilder sb) {\n for (int i = 0; i < expressions.length; i++) {\n Expression expression = expressions[i];\n if (expression instanceof ExNumber) {\n if (((ExNumber) expression).isNegative()) {\n expression.toString(sb);\n } else {\n if (i > 0) {\n sb.append('+');\n }\n expression.toString(sb, getPriority());\n }\n } else if (expression instanceof ExMul) {\n ((ExMul) expression).appendToSum(sb, i == 0);\n } else {\n if (i > 0) {\n sb.append('+');\n }\n sb.append('+');\n expression.toString(sb, getPriority());\n }\n }\n}\n"
|
"public Rsrcc_srcm_stmt_kind_tgtc_tgtm edgesOutOf(MethodOrMethodContext m) {\n return new Rsrcc_srcm_stmt_kind_tgtc_tgtmBDD(new jedd.internal.RelationContainer(new jedd.Attribute[] { srcm.v(), stmt.v(), tgtc.v(), tgtm.v(), srcc.v(), kind.v() }, new jedd.PhysicalDomain[] { T1.v(), ST.v(), V2.v(), T2.v(), V1.v(), FD.v() }, (\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\"), jedd.internal.Jedd.v().join(jedd.internal.Jedd.v().read(edges), jedd.internal.Jedd.v().literal(new Object[] { m.context(), m.method() }, new jedd.Attribute[] { ctxt.v(), method.v() }, new jedd.PhysicalDomain[] { V1.v(), T1.v() }), new jedd.PhysicalDomain[] { T1.v(), V1.v() })), \"String_Node_Str\");\n}\n"
|
"public void start(Stage primaryStage) throws Exception {\n AppDirectory.initAppDir(\"String_Node_Str\");\n log.info(\"String_Node_Str\" + VERSION);\n log.info(\"String_Node_Str\" + appInstallDir);\n ProgressIndicator indicator = showGiantProgressWheel(primaryStage);\n List<ECPoint> pubkeys = Crypto.decode(\"String_Node_Str\");\n Updater updater = new Updater(\"String_Node_Str\", \"String_Node_Str\" + VERSION, VERSION, AppDirectory.dir(), UpdateFX.findCodePath(ExampleApp.class), pubkeys, 1) {\n protected void updateProgress(long workDone, long max) {\n super.updateProgress(workDone, max);\n Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);\n }\n };\n indicator.progressProperty().bind(updater.progressProperty());\n log.info(\"String_Node_Str\");\n updater.setOnSucceeded(event -> {\n try {\n UpdateSummary summary = updater.get();\n if (summary.newVersion > VERSION) {\n log.info(\"String_Node_Str\" + summary.newVersion);\n UpdateFX.restartApp();\n }\n } catch (Throwable e) {\n log.error(\"String_Node_Str\", e);\n }\n });\n new Thread(updater, \"String_Node_Str\").start();\n primaryStage.show();\n}\n"
|
"public View getView(int position, View convertView, ViewGroup parent) {\n View view = convertView;\n if (view == null) {\n view = inflater.inflate(R.layout.futaba_row, null);\n }\n FutabaStatus item = (FutabaStatus) items.get(position);\n if (item != null) {\n TextView screenName = (TextView) view.findViewById(R.id.toptext);\n screenName.setTypeface(Typeface.DEFAULT_BOLD);\n TextView text = (TextView) view.findViewById(R.id.bottomtext);\n if (screenName != null) {\n screenName.setText(\"String_Node_Str\");\n }\n try {\n URL imgURL = new URL(item.getImgURL());\n if (item.getImgURL() != \"String_Node_Str\") {\n ImageView iv = (ImageView) view.findViewById(R.id.image);\n ImageGetTask task = new ImageGetTask(iv);\n task.execute(item.getImgURL());\n screenName.setText(\"String_Node_Str\");\n } else {\n }\n } catch (Exception e) {\n Log.d(\"String_Node_Str\", e.toString());\n }\n if (text != null) {\n text.setText(item.getText());\n }\n }\n return view;\n}\n"
|
"public int getItemViewType(int position) {\n int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns;\n if (position < numHeadersAndPlaceholders && (position % mNumColumns != 0)) {\n return mAdapter != null ? mAdapter.getViewTypeCount() : 1;\n }\n if (mAdapter != null && position >= numHeadersAndPlaceholders && position < numHeadersAndPlaceholders + mAdapter.getCount() + (mNumColumns - (mAdapter.getCount() % mNumColumns))) {\n int adjPosition = position - numHeadersAndPlaceholders;\n int adapterCount = mAdapter.getCount();\n if (adjPosition < adapterCount) {\n return mAdapter.getItemViewType(adjPosition);\n }\n }\n int numFootersAndPlaceholders = getFootersCount() * mNumColumns;\n if (mAdapter != null && position < numHeadersAndPlaceholders + mAdapter.getCount() + numFootersAndPlaceholders) {\n return mAdapter != null ? mAdapter.getViewTypeCount() : 1;\n }\n return AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER;\n}\n"
|
"public double integrate(final FirstOrderDifferentialEquations equations, final double t0, final double[] y0, final double t, final double[] y) throws MathUserException, IntegratorException {\n sanityChecks(equations, t0, y0, t, y);\n setEquations(equations);\n resetEvaluations();\n final boolean forward = t > t0;\n final double[] yDot0 = new double[y0.length];\n final double[] y1 = new double[y0.length];\n final double[] yTmp = new double[y0.length];\n final double[] yTmpDot = new double[y0.length];\n final double[][] diagonal = new double[sequence.length - 1][];\n final double[][] y1Diag = new double[sequence.length - 1][];\n for (int k = 0; k < sequence.length - 1; ++k) {\n diagonal[k] = new double[y0.length];\n y1Diag[k] = new double[y0.length];\n }\n final double[][][] fk = new double[sequence.length][][];\n for (int k = 0; k < sequence.length; ++k) {\n fk[k] = new double[sequence[k] + 1][];\n fk[k][0] = yDot0;\n for (int l = 0; l < sequence[k]; ++l) {\n fk[k][l + 1] = new double[y0.length];\n }\n }\n if (y != y0) {\n System.arraycopy(y0, 0, y, 0, y0.length);\n }\n double[] yDot1 = new double[y0.length];\n double[][] yMidDots = null;\n final boolean denseOutput = requiresDenseOutput();\n if (denseOutput) {\n yMidDots = new double[1 + 2 * sequence.length][];\n for (int j = 0; j < yMidDots.length; ++j) {\n yMidDots[j] = new double[y0.length];\n }\n } else {\n yMidDots = new double[1][];\n yMidDots[0] = new double[y0.length];\n }\n final double[] scale = new double[mainSetDimension];\n rescale(y, y, scale);\n final double tol = (vecRelativeTolerance == null) ? scalRelativeTolerance : vecRelativeTolerance[0];\n final double log10R = FastMath.log10(FastMath.max(1.0e-10, tol));\n int targetIter = FastMath.max(1, FastMath.min(sequence.length - 2, (int) FastMath.floor(0.5 - 0.6 * log10R)));\n AbstractStepInterpolator interpolator = null;\n if (denseOutput) {\n interpolator = new GraggBulirschStoerStepInterpolator(y, yDot0, y1, yDot1, yMidDots, forward);\n } else {\n interpolator = new DummyStepInterpolator(y, yDot1, forward);\n }\n interpolator.storeTime(t0);\n stepStart = t0;\n double hNew = 0;\n double maxError = Double.MAX_VALUE;\n boolean previousRejected = false;\n boolean firstTime = true;\n boolean newStep = true;\n boolean firstStepAlreadyComputed = false;\n for (StepHandler handler : stepHandlers) {\n handler.reset();\n }\n setStateInitialized(false);\n costPerTimeUnit[0] = 0;\n isLastStep = false;\n do {\n double error;\n boolean reject = false;\n if (newStep) {\n interpolator.shift();\n if (!firstStepAlreadyComputed) {\n computeDerivatives(stepStart, y, yDot0);\n }\n if (firstTime) {\n hNew = initializeStep(equations, forward, 2 * targetIter + 1, scale, stepStart, y, yDot0, yTmp, yTmpDot);\n }\n newStep = false;\n }\n stepSize = hNew;\n if ((forward && (stepStart + stepSize > t)) || ((!forward) && (stepStart + stepSize < t))) {\n stepSize = t - stepStart;\n }\n final double nextT = stepStart + stepSize;\n isLastStep = forward ? (nextT >= t) : (nextT <= t);\n int k = -1;\n for (boolean loop = true; loop; ) {\n ++k;\n if (!tryStep(stepStart, y, stepSize, k, scale, fk[k], (k == 0) ? yMidDots[0] : diagonal[k - 1], (k == 0) ? y1 : y1Diag[k - 1], yTmp)) {\n hNew = FastMath.abs(filterStep(stepSize * stabilityReduction, forward, false));\n reject = true;\n loop = false;\n } else {\n if (k > 0) {\n extrapolate(0, k, y1Diag, y1);\n rescale(y, y1, scale);\n error = 0;\n for (int j = 0; j < mainSetDimension; ++j) {\n final double e = FastMath.abs(y1[j] - y1Diag[0][j]) / scale[j];\n error += e * e;\n }\n error = FastMath.sqrt(error / mainSetDimension);\n if ((error > 1.0e15) || ((k > 1) && (error > maxError))) {\n hNew = FastMath.abs(filterStep(stepSize * stabilityReduction, forward, false));\n reject = true;\n loop = false;\n } else {\n maxError = FastMath.max(4 * error, 1.0);\n final double exp = 1.0 / (2 * k + 1);\n double fac = stepControl2 / FastMath.pow(error / stepControl1, exp);\n final double pow = FastMath.pow(stepControl3, exp);\n fac = FastMath.max(pow / stepControl4, FastMath.min(1 / pow, fac));\n optimalStep[k] = FastMath.abs(filterStep(stepSize * fac, forward, true));\n costPerTimeUnit[k] = costPerStep[k] / optimalStep[k];\n switch(k - targetIter) {\n case -1:\n if ((targetIter > 1) && !previousRejected) {\n if (error <= 1.0) {\n loop = false;\n } else {\n final double ratio = ((double) sequence[targetIter] * sequence[targetIter + 1]) / (sequence[0] * sequence[0]);\n if (error > ratio * ratio) {\n reject = true;\n loop = false;\n targetIter = k;\n if ((targetIter > 1) && (costPerTimeUnit[targetIter - 1] < orderControl1 * costPerTimeUnit[targetIter])) {\n --targetIter;\n }\n hNew = optimalStep[targetIter];\n }\n }\n }\n break;\n case 0:\n if (error <= 1.0) {\n loop = false;\n } else {\n final double ratio = ((double) sequence[k + 1]) / sequence[0];\n if (error > ratio * ratio) {\n reject = true;\n loop = false;\n if ((targetIter > 1) && (costPerTimeUnit[targetIter - 1] < orderControl1 * costPerTimeUnit[targetIter])) {\n --targetIter;\n }\n hNew = optimalStep[targetIter];\n }\n }\n break;\n case 1:\n if (error > 1.0) {\n reject = true;\n if ((targetIter > 1) && (costPerTimeUnit[targetIter - 1] < orderControl1 * costPerTimeUnit[targetIter])) {\n --targetIter;\n }\n hNew = optimalStep[targetIter];\n }\n loop = false;\n break;\n default:\n if ((firstTime || isLastStep) && (error <= 1.0)) {\n loop = false;\n }\n break;\n }\n }\n }\n }\n }\n if (!reject) {\n computeDerivatives(stepStart + stepSize, y1, yDot1);\n }\n double hInt = getMaxStep();\n if (denseOutput && !reject) {\n for (int j = 1; j <= k; ++j) {\n extrapolate(0, j, diagonal, yMidDots[0]);\n }\n final int mu = 2 * k - mudif + 3;\n for (int l = 0; l < mu; ++l) {\n final int l2 = l / 2;\n double factor = FastMath.pow(0.5 * sequence[l2], l);\n int middleIndex = fk[l2].length / 2;\n for (int i = 0; i < y0.length; ++i) {\n yMidDots[l + 1][i] = factor * fk[l2][middleIndex + l][i];\n }\n for (int j = 1; j <= k - l2; ++j) {\n factor = FastMath.pow(0.5 * sequence[j + l2], l);\n middleIndex = fk[l2 + j].length / 2;\n for (int i = 0; i < y0.length; ++i) {\n diagonal[j - 1][i] = factor * fk[l2 + j][middleIndex + l][i];\n }\n extrapolate(l2, j, diagonal, yMidDots[l + 1]);\n }\n for (int i = 0; i < y0.length; ++i) {\n yMidDots[l + 1][i] *= stepSize;\n }\n for (int j = (l + 1) / 2; j <= k; ++j) {\n for (int m = fk[j].length - 1; m >= 2 * (l + 1); --m) {\n for (int i = 0; i < y0.length; ++i) {\n fk[j][m][i] -= fk[j][m - 2][i];\n }\n }\n }\n }\n if (mu >= 0) {\n final GraggBulirschStoerStepInterpolator gbsInterpolator = (GraggBulirschStoerStepInterpolator) interpolator;\n gbsInterpolator.computeCoefficients(mu, stepSize);\n if (useInterpolationError) {\n final double interpError = gbsInterpolator.estimateError(scale);\n hInt = FastMath.abs(stepSize / FastMath.max(FastMath.pow(interpError, 1.0 / (mu + 4)), 0.01));\n if (interpError > 10.0) {\n hNew = hInt;\n reject = true;\n }\n }\n }\n }\n if (!reject) {\n interpolator.storeTime(stepStart + stepSize);\n stepStart = acceptStep(interpolator, y1, yDot1, t);\n interpolator.storeTime(stepStart);\n System.arraycopy(y1, 0, y, 0, y0.length);\n System.arraycopy(yDot1, 0, yDot0, 0, y0.length);\n firstStepAlreadyComputed = true;\n int optimalIter;\n if (k == 1) {\n optimalIter = 2;\n if (previousRejected) {\n optimalIter = 1;\n }\n } else if (k <= targetIter) {\n optimalIter = k;\n if (costPerTimeUnit[k - 1] < orderControl1 * costPerTimeUnit[k]) {\n optimalIter = k - 1;\n } else if (costPerTimeUnit[k] < orderControl2 * costPerTimeUnit[k - 1]) {\n optimalIter = FastMath.min(k + 1, sequence.length - 2);\n }\n } else {\n optimalIter = k - 1;\n if ((k > 2) && (costPerTimeUnit[k - 2] < orderControl1 * costPerTimeUnit[k - 1])) {\n optimalIter = k - 2;\n }\n if (costPerTimeUnit[k] < orderControl2 * costPerTimeUnit[optimalIter]) {\n optimalIter = FastMath.min(k, sequence.length - 2);\n }\n }\n if (previousRejected) {\n targetIter = FastMath.min(optimalIter, k);\n hNew = FastMath.min(FastMath.abs(stepSize), optimalStep[targetIter]);\n } else {\n if (optimalIter <= k) {\n hNew = optimalStep[optimalIter];\n } else {\n if ((k < targetIter) && (costPerTimeUnit[k] < orderControl2 * costPerTimeUnit[k - 1])) {\n hNew = filterStep(optimalStep[k] * costPerStep[optimalIter + 1] / costPerStep[k], forward, false);\n } else {\n hNew = filterStep(optimalStep[k] * costPerStep[optimalIter] / costPerStep[k], forward, false);\n }\n }\n targetIter = optimalIter;\n }\n newStep = true;\n }\n hNew = FastMath.min(hNew, hInt);\n if (!forward) {\n hNew = -hNew;\n }\n firstTime = false;\n if (reject) {\n isLastStep = false;\n previousRejected = true;\n } else {\n previousRejected = false;\n }\n } while (!isLastStep);\n final double stopTime = stepStart;\n resetInternalState();\n return stopTime;\n}\n"
|
"private boolean hasNewSuggestion(List<String> addedLabels, Optional<String> suggestion) {\n return suggestion.isPresent() && !(issue.getLabels()).contains(suggestion.get()) && !addedLabels.contains(suggestion.get());\n}\n"
|
"public Result<Boolean> setAlias(String addr, String password, String aliasName) {\n if (!Address.validAddress(addr)) {\n Result.getFailed(AccountErrorCode.PARAMETER_ERROR);\n }\n Account account = accountCacheService.getAccountByAddress(addr);\n if (null == account) {\n account = accountService.getAccount(addr).getData();\n if (null == account) {\n return Result.getFailed(AccountErrorCode.ACCOUNT_NOT_EXIST);\n }\n try {\n if (account.isEncrypted()) {\n if (!account.unlock(password)) {\n return Result.getFailed(AccountErrorCode.PASSWORD_IS_WRONG);\n }\n }\n } catch (NulsException e) {\n return Result.getFailed(AccountErrorCode.PASSWORD_IS_WRONG);\n }\n }\n if (StringUtils.isNotBlank(account.getAlias())) {\n return new Result(false, AccountErrorCode.ACCOUNT_ALREADY_SET_ALIAS, \"String_Node_Str\");\n }\n if (!StringUtils.validAlias(aliasName)) {\n return new Result(false, \"String_Node_Str\");\n }\n if (isAliasExist(aliasName)) {\n Result.getFailed(AccountErrorCode.ALIAS_EXIST);\n }\n byte[] addressBytes = account.getAddress().getBase58Bytes();\n try {\n AliasTransaction tx = new AliasTransaction();\n tx.setTime(System.currentTimeMillis());\n Alias alias = new Alias(addressBytes, aliasName);\n tx.setTxData(alias);\n tx.setHash(NulsDigestData.calcDigestData(tx.serialize()));\n CoinDataResult coinDataResult = accountLedgerService.getCoinData(addressBytes, AccountConstant.ALIAS_NA, tx.size());\n if (!coinDataResult.isEnough()) {\n Result.getFailed(AccountErrorCode.INSUFFICIENT_BALANCE);\n }\n CoinData coinData = new CoinData();\n coinData.setFrom(coinDataResult.getCoinList());\n Coin change = coinDataResult.getChange();\n if (null != change) {\n List<Coin> toList = new ArrayList<>();\n toList.add(change);\n coinData.setTo(toList);\n }\n tx.setCoinData(coinData);\n NulsSignData nulsSignData = accountService.signData(tx.serializeForHash(), account, password);\n P2PKHScriptSig scriptSig = new P2PKHScriptSig(nulsSignData, account.getPubKey());\n tx.setScriptSig(scriptSig.serialize());\n TransactionMessage message = new TransactionMessage();\n message.setMsgBody(tx);\n messageBusService.receiveMessage(message, null);\n return Result.getSuccess();\n } catch (Exception e) {\n Log.error(e);\n return new Result(false, e.getMessage());\n }\n}\n"
|
"private DatagramChannel connectClient(final int port) throws IOException {\n final DatagramChannel client = DatagramChannel.open();\n final InetSocketAddress hostAddress = new InetSocketAddress(port);\n client.configureBlocking(false);\n synchronized (closeables) {\n client.bind(hostAddress);\n if (LOG.isDebugEnabled())\n LOG.debug(\"String_Node_Str\" + port);\n closeables.add(client);\n }\n return client;\n}\n"
|
"public void testDynamicServerListChangesAdd() throws Exception {\n testNoServerFail();\n list.add(new InetSocketAddress(1036));\n SleepUtils.dummySleep(6000);\n int serverSize = getNamingService().list(defaultServices).get(DEFAULT_KEY).size();\n Assert.assertEquals(6, serverSize);\n EchoInfo echoInfo = new EchoInfo(DEFAULT_KEY);\n Set<String> returnValues = new HashSet<String>();\n for (int i = 0; i < serverSize * 2; i++) {\n EchoInfo echo = proxy.echo(echoInfo);\n returnValues.add(echo.getMessage());\n }\n Assert.assertEquals(6, returnValues.size());\n}\n"
|
"Collection getModifiedFiles(long lastBuildTime) {\n List ret = new ArrayList();\n for (Iterator i = buildConfig.getFiles().iterator(); i.hasNext(); ) {\n File file = (File) i.next();\n if (!file.exists())\n continue;\n long modTime = file.lastModified();\n if (modTime + 1000 >= lastBuildTime) {\n ret.add(file);\n }\n }\n return ret;\n}\n"
|
"public void testRemoveOwner() throws IOException, URISyntaxException {\n RestConnection conn = new RestConnection();\n assertTrue(conn.login(\"String_Node_Str\", \"String_Node_Str\"));\n URI uri = UriBuilder.fromUri(getContextURI()).path(\"String_Node_Str\").path(entry1.getKey().toString()).path(\"String_Node_Str\").path(id1.getUser().getKey().toString()).build();\n HttpDelete method = conn.createDelete(uri, MediaType.APPLICATION_JSON);\n HttpResponse response = conn.execute(method);\n assertEquals(200, response.getStatusLine().getStatusCode());\n CatalogManager catalogManager = CatalogManager.getInstance();\n CatalogEntry entry = catalogManager.loadCatalogEntry(entry1.getKey());\n List<Identity> identities = BaseSecurityManager.getInstance().getIdentitiesOfSecurityGroup(entry.getOwnerGroup());\n boolean found = false;\n for (Identity identity : identities) {\n if (identity.getKey().equals(id1.getKey())) {\n found = true;\n }\n }\n assertFalse(found);\n conn.shutdown();\n}\n"
|
"public void refresh() {\n if (element instanceof FakeElement) {\n DisplayUtils.getDisplay().syncExec(new Runnable() {\n\n public void run() {\n operationInThread();\n }\n });\n}\n"
|
"public OUser user() {\n if (mContext != null)\n return OUser.current(mContext);\n return null;\n}\n"
|
"protected static Map<String, Object> fixKeyNames(Map<String, Object> map) {\n Map<String, Object> results = new HashMap<String, Object>();\n for (Map.Entry<String, Object> entry : map.entrySet()) {\n String key = entry.getKey().substring(0, 1).toLowerCase(GuiUtil.guiLocale) + entry.getKey().substring(1);\n Object value = entry.getValue();\n results.put(key, value);\n }\n return results;\n}\n"
|
"public MRJobInfo getMRJobInfo(Id.Run runId) throws IOException, NotFoundException {\n Preconditions.checkArgument(ProgramType.MAPREDUCE.equals(runId.getProgram().getType()));\n JobClient jobClient;\n JobStatus[] jobs;\n try {\n jobClient = new JobClient(hConf);\n jobs = jobClient.getAllJobs();\n } catch (Exception e) {\n LOG.warn(\"String_Node_Str\", e);\n throw new IOException(e);\n }\n JobStatus thisJob = findJobForRunId(jobs, runId);\n RunningJob runningJob = jobClient.getJob(thisJob.getJobID());\n Counters counters = runningJob.getCounters();\n TaskReport[] mapTaskReports = jobClient.getMapTaskReports(thisJob.getJobID());\n TaskReport[] reduceTaskReports = jobClient.getReduceTaskReports(thisJob.getJobID());\n return new MRJobInfo(thisJob.getMapProgress(), thisJob.getReduceProgress(), groupToMap(counters.getGroup(TaskCounter.class.getName())), toMRTaskInfos(mapTaskReports), toMRTaskInfos(reduceTaskReports), true);\n}\n"
|
"private static void addActionLogComment(Submission submission) {\n String subject = params.get(\"String_Node_Str\");\n String message = params.get(\"String_Node_Str\");\n if (params.get(\"String_Node_Str\") != null) {\n if (subject == null || subject.isEmpty())\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n if (message == null || message.isEmpty())\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n }\n if (!validation.hasErrors()) {\n if (params.get(\"String_Node_Str\") != null) {\n submission.setState(stateManager.getState(\"String_Node_Str\"));\n VireoEmail email = emailService.createEmail();\n email.addParameters(submission);\n email.setSubject(subject);\n email.setMessage(message);\n email.applyParameterSubstitution();\n email.addTo(submission.getSubmitter());\n if (params.get(\"String_Node_Str\") != null && submission.getCommitteeContactEmail() != null) {\n email.addCc(submission.getCommitteeContactEmail());\n }\n email.setFrom(context.getPerson());\n email.setReplyTo(context.getPerson());\n if (params.get(\"String_Node_Str\") != null && \"String_Node_Str\".equals(params.get(\"String_Node_Str\"))) {\n email.setLogOnCompletion(context.getPerson(), submission);\n emailService.sendEmail(email, false);\n } else {\n subject = email.getSubject();\n message = email.getMessage();\n String entry;\n if (subject != null && subject.trim().length() > 0)\n entry = subject + \"String_Node_Str\" + message;\n else\n entry = message;\n ActionLog log = submission.logAction(entry);\n if (\"String_Node_Str\".equals(params.get(\"String_Node_Str\")))\n log.setPrivate(true);\n submission.save();\n log.save();\n }\n }\n}\n"
|
"private static String getTipFormatted(String displayName, String tipValue) {\n if (displayName.startsWith(\"String_Node_Str\")) {\n ScriptEngineManager manager = new ScriptEngineManager(null);\n ScriptEngine engine = manager.getEngineByName(\"String_Node_Str\");\n try {\n engine.eval(displayName);\n Invocable invoke = (Invocable) engine;\n return String.valueOf(invoke.invokeFunction(\"String_Node_Str\", tipValue));\n } catch (Exception e) {\n e.printStackTrace();\n return \"String_Node_Str\";\n }\n } else {\n if (flag == 2) {\n return String.format(\"String_Node_Str\", displayName, tipValue);\n } else {\n return String.format(\"String_Node_Str\" + TAB + ALIGNRIGHT + WHITE + \"String_Node_Str\", displayName, tipValue);\n }\n }\n}\n"
|
"public void execute() throws BuildException {\n if ((sourceFileSets.size() == 0) && (sourceFileLists.size() == 0)) {\n throw new BuildException(\"String_Node_Str\");\n }\n if ((targetFileSets.size() == 0) && (targetFileLists.size() == 0)) {\n throw new BuildException(\"String_Node_Str\");\n }\n long now = (new Date()).getTime();\n if (Os.isFamily(\"String_Node_Str\")) {\n now += 2000;\n }\n Vector allTargets = new Vector();\n long oldestTargetTime = 0;\n File oldestTarget = null;\n Enumeration enumTargetSets = targetFileSets.elements();\n while (enumTargetSets.hasMoreElements()) {\n FileSet targetFS = (FileSet) enumTargetSets.nextElement();\n DirectoryScanner targetDS = targetFS.getDirectoryScanner(project);\n String[] targetFiles = targetDS.getIncludedFiles();\n for (int i = 0; i < targetFiles.length; i++) {\n File dest = new File(targetFS.getDir(project), targetFiles[i]);\n allTargets.addElement(dest);\n if (dest.lastModified() > now) {\n log(\"String_Node_Str\" + targetFiles[i] + \"String_Node_Str\", Project.MSG_WARN);\n }\n if (oldestTarget == null || dest.lastModified() < oldestTargetTime) {\n oldestTargetTime = dest.lastModified();\n oldestTarget = dest;\n }\n }\n }\n boolean upToDate = true;\n Enumeration enumTargetLists = targetFileLists.elements();\n while (enumTargetLists.hasMoreElements()) {\n FileList targetFL = (FileList) enumTargetLists.nextElement();\n String[] targetFiles = targetFL.getFiles(project);\n for (int i = 0; i < targetFiles.length; i++) {\n File dest = new File(targetFL.getDir(project), targetFiles[i]);\n if (!dest.exists()) {\n log(targetFiles[i] + \"String_Node_Str\", Project.MSG_VERBOSE);\n upToDate = false;\n continue;\n } else {\n allTargets.addElement(dest);\n }\n if (dest.lastModified() > now) {\n log(\"String_Node_Str\" + targetFiles[i] + \"String_Node_Str\", Project.MSG_WARN);\n }\n if (oldestTarget == null || dest.lastModified() < oldestTargetTime) {\n oldestTargetTime = dest.lastModified();\n oldestTarget = dest;\n }\n }\n }\n if (oldestTarget != null) {\n log(oldestTarget + \"String_Node_Str\", Project.MSG_VERBOSE);\n } else {\n upToDate = false;\n }\n if (upToDate) {\n Enumeration enumSourceLists = sourceFileLists.elements();\n while (upToDate && enumSourceLists.hasMoreElements()) {\n FileList sourceFL = (FileList) enumSourceLists.nextElement();\n String[] sourceFiles = sourceFL.getFiles(project);\n for (int i = 0; upToDate && i < sourceFiles.length; i++) {\n File src = new File(sourceFL.getDir(project), sourceFiles[i]);\n if (src.lastModified() > now) {\n log(\"String_Node_Str\" + sourceFiles[i] + \"String_Node_Str\", Project.MSG_WARN);\n }\n if (!src.exists()) {\n log(sourceFiles[i] + \"String_Node_Str\", Project.MSG_VERBOSE);\n upToDate = false;\n break;\n }\n if (src.lastModified() > oldestTargetTime) {\n upToDate = false;\n log(oldestTarget + \"String_Node_Str\" + sourceFiles[i], Project.MSG_VERBOSE);\n }\n } while (upToDate && (++i < sourceFiles.length));\n }\n }\n if (upToDate) {\n Enumeration enumSourceSets = sourceFileSets.elements();\n while (upToDate && enumSourceSets.hasMoreElements()) {\n FileSet sourceFS = (FileSet) enumSourceSets.nextElement();\n DirectoryScanner sourceDS = sourceFS.getDirectoryScanner(project);\n String[] sourceFiles = sourceDS.getIncludedFiles();\n for (int i = 0; upToDate && i < sourceFiles.length; i++) {\n File src = new File(sourceFS.getDir(project), sourceFiles[i]);\n if (src.lastModified() > now) {\n log(\"String_Node_Str\" + sourceFiles[i] + \"String_Node_Str\", Project.MSG_WARN);\n }\n if (src.lastModified() > oldestTargetTime) {\n upToDate = false;\n log(oldestTarget + \"String_Node_Str\" + sourceFiles[i], Project.MSG_VERBOSE);\n }\n }\n }\n }\n if (!upToDate) {\n log(\"String_Node_Str\", Project.MSG_VERBOSE);\n for (Enumeration e = allTargets.elements(); e.hasMoreElements(); ) {\n File fileToRemove = (File) e.nextElement();\n log(\"String_Node_Str\" + fileToRemove.getAbsolutePath(), Project.MSG_VERBOSE);\n fileToRemove.delete();\n }\n }\n}\n"
|
"public static void documentInfo(Long subId) {\n Submission sub = getSubmission();\n String title = params.get(\"String_Node_Str\");\n String degreeMonth = params.get(\"String_Node_Str\");\n String degreeYear = params.get(\"String_Node_Str\");\n Date defenseDate = null;\n DateFormat formatter = new SimpleDateFormat(\"String_Node_Str\");\n try {\n if (params.get(\"String_Node_Str\") != null && !\"String_Node_Str\".equals(params.get(\"String_Node_Str\").trim()))\n defenseDate = (Date) formatter.parse(params.get(\"String_Node_Str\"));\n } catch (ParseException e) {\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n }\n String docType = params.get(\"String_Node_Str\");\n String abstractText = params.get(\"String_Node_Str\");\n String keywords = params.get(\"String_Node_Str\");\n String subjectPrimary = params.get(\"String_Node_Str\");\n String subjectSecondary = params.get(\"String_Node_Str\");\n String subjectTertiary = params.get(\"String_Node_Str\");\n String docLanguage = null;\n if (isFieldRequired(DOCUMENT_LANGUAGE) && settingRepo.findAllLanguages().size() == 1) {\n docLanguage = settingRepo.findAllLanguages().get(0).getName();\n } else {\n docLanguage = params.get(\"String_Node_Str\");\n if (docLanguage != null && docLanguage.trim().length() == 0)\n docLanguage = null;\n }\n Boolean publishedMaterialFlag = params.get(\"String_Node_Str\", Boolean.class);\n if (publishedMaterialFlag == null)\n publishedMaterialFlag = false;\n String publishedMaterial = params.get(\"String_Node_Str\");\n if (!publishedMaterialFlag)\n publishedMaterial = null;\n String chairEmail = params.get(\"String_Node_Str\");\n String embargosString = params.get(\"String_Node_Str\");\n List<String> embargos = new ArrayList<String>();\n for (EmbargoGuarantor gaurantor : EmbargoGuarantor.values()) {\n String embargoString = params.get(\"String_Node_Str\" + gaurantor.name());\n if (embargoString != null && embargoString.trim().length() != 0)\n embargos.add(embargoString);\n }\n List<TransientMember> committee = parseCommitteeMembers();\n if (\"String_Node_Str\".equals(params.get(\"String_Node_Str\"))) {\n if (isFieldEnabled(DOCUMENT_TITLE))\n sub.setDocumentTitle(title);\n if (isFieldEnabled(GRADUATION_DATE)) {\n if (!isEmpty(degreeMonth)) {\n try {\n sub.setGraduationMonth(Integer.parseInt(degreeMonth));\n } catch (RuntimeException re) {\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n }\n } else {\n sub.setGraduationMonth(null);\n }\n if (!isEmpty(degreeYear)) {\n try {\n sub.setGraduationYear(Integer.parseInt(degreeYear));\n } catch (RuntimeException re) {\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n }\n } else {\n sub.setGraduationYear(null);\n }\n }\n if (isFieldEnabled(DEFENSE_DATE)) {\n sub.setDefenseDate(defenseDate);\n }\n if (isFieldEnabled(DOCUMENT_TYPE))\n sub.setDocumentType(docType);\n if (isFieldEnabled(DOCUMENT_ABSTRACT))\n sub.setDocumentAbstract(abstractText);\n if (isFieldEnabled(DOCUMENT_KEYWORDS))\n sub.setDocumentKeywords(keywords);\n if (isFieldEnabled(DOCUMENT_SUBJECTS)) {\n sub.getDocumentSubjects().clear();\n if (!isEmpty(subjectPrimary))\n sub.addDocumentSubject(subjectPrimary);\n if (!isEmpty(subjectSecondary))\n sub.addDocumentSubject(subjectSecondary);\n if (!isEmpty(subjectTertiary))\n sub.addDocumentSubject(subjectTertiary);\n }\n if (isFieldEnabled(DOCUMENT_LANGUAGE))\n sub.setDocumentLanguage(docLanguage);\n if (isFieldEnabled(COMMITTEE_CONTACT_EMAIL))\n sub.setCommitteeContactEmail(chairEmail);\n if (isFieldEnabled(PUBLISHED_MATERIAL)) {\n if (publishedMaterialFlag)\n sub.setPublishedMaterial(publishedMaterial);\n else\n sub.setPublishedMaterial(null);\n }\n if (isFieldEnabled(EMBARGO_TYPE)) {\n for (String embargo : embargos) {\n try {\n sub.addEmbargoType(settingRepo.findEmbargoType(Long.parseLong(embargo)));\n } catch (RuntimeException re) {\n if (isFieldRequired(EMBARGO_TYPE))\n validation.addError(\"String_Node_Str\", \"String_Node_Str\");\n }\n }\n }\n if (isFieldEnabled(COMMITTEE)) {\n try {\n saveCommitteeMembers(sub, committee);\n } catch (RuntimeException re) {\n }\n }\n sub.save();\n } else {\n if (isFieldEnabled(DOCUMENT_TITLE))\n title = sub.getDocumentTitle();\n if (isFieldEnabled(GRADUATION_DATE) && sub.getGraduationMonth() != null)\n degreeMonth = sub.getGraduationMonth().toString();\n if (isFieldEnabled(GRADUATION_DATE) && sub.getGraduationYear() != null)\n degreeYear = sub.getGraduationYear().toString();\n if (isFieldEnabled(DEFENSE_DATE) && sub.getDefenseDate() != null)\n defenseDate = sub.getDefenseDate();\n if (isFieldEnabled(DOCUMENT_TYPE))\n docType = sub.getDocumentType();\n if (isFieldEnabled(DOCUMENT_ABSTRACT))\n abstractText = sub.getDocumentAbstract();\n if (isFieldEnabled(DOCUMENT_KEYWORDS))\n keywords = sub.getDocumentKeywords();\n if (isFieldEnabled(DOCUMENT_SUBJECTS)) {\n List<String> subjects = sub.getDocumentSubjects();\n if (subjects.size() > 0)\n subjectPrimary = subjects.get(0);\n if (subjects.size() > 1)\n subjectSecondary = subjects.get(1);\n if (subjects.size() > 2)\n subjectTertiary = subjects.get(2);\n }\n if (isFieldEnabled(DOCUMENT_LANGUAGE)) {\n docLanguage = sub.getDocumentLanguage();\n }\n if (isFieldEnabled(COMMITTEE))\n committee = loadCommitteeMembers(sub);\n if (isFieldEnabled(COMMITTEE_CONTACT_EMAIL))\n chairEmail = sub.getCommitteeContactEmail();\n if (isFieldEnabled(PUBLISHED_MATERIAL))\n publishedMaterial = sub.getPublishedMaterial();\n }\n if (\"String_Node_Str\".equals(params.get(\"String_Node_Str\")) || \"String_Node_Str\".equals(flash.get(\"String_Node_Str\"))) {\n verify(sub);\n }\n if (params.get(\"String_Node_Str\") != null && !validation.hasErrors()) {\n FileUpload.fileUpload(subId);\n }\n List<Integer> degreeYears = getDegreeYears();\n renderArgs.put(\"String_Node_Str\", degreeYears);\n List<String> docTypes = getValidDocumentTypes(sub);\n renderArgs.put(\"String_Node_Str\", docTypes);\n List<EmbargoType> embargoTypes = settingRepo.findAllActiveEmbargoTypes();\n renderArgs.put(\"String_Node_Str\", embargoTypes);\n List<ProquestSubject> subjects = proquestRepo.findAllSubjects();\n renderArgs.put(\"String_Node_Str\", subjects);\n List<CommitteeMemberRoleType> availableRoles = settingRepo.findAllCommitteeMemberRoleTypes(sub.getDegreeLevel());\n renderArgs.put(\"String_Node_Str\", availableRoles);\n List<Language> languages = settingRepo.findAllLanguages();\n renderArgs.put(\"String_Node_Str\", languages);\n int committeeSlots = 4;\n if (committee.size() > 3)\n committeeSlots = committee.size();\n if (params.get(\"String_Node_Str\") != null)\n committeeSlots += 4;\n List<String> stickies = new ArrayList<String>();\n String stickiesRaw = settingRepo.getConfigValue(SUBMIT_DOCUMENT_INFO_STICKIES);\n if (stickiesRaw != null && !\"String_Node_Str\".equals(stickiesRaw)) {\n try {\n CSVReader reader = new CSVReader(new StringReader(stickiesRaw));\n stickies = Arrays.asList(reader.readNext());\n reader.close();\n } catch (IOException ioe) {\n throw new RuntimeException(ioe);\n }\n }\n if (publishedMaterial != null)\n publishedMaterialFlag = true;\n renderTemplate(\"String_Node_Str\", subId, stickies, title, degreeMonth, degreeYear, defenseDate, docType, abstractText, keywords, subjectPrimary, subjectSecondary, subjectTertiary, docLanguage, committeeSlots, committee, chairEmail, publishedMaterialFlag, publishedMaterial, embargos);\n}\n"
|
"public void close() {\n if (this.running) {\n this.running = false;\n if (this.currentBuffer != null && this.currentElement != null) {\n if (this.currentBuffer.isEmpty()) {\n this.queues.empty.add(this.currentElement);\n } else {\n this.queues.sort.add(this.currentElement);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + this.currentElement.id + \"String_Node_Str\");\n }\n }\n }\n }\n this.currentBuffer = null;\n this.currentElement = null;\n this.queues.sort.add(SENTINEL);\n if (LOG.isDebugEnabled())\n LOG.debug(\"String_Node_Str\");\n}\n"
|
"public void testExistsBadUri1() throws Exception {\n Assert.assertFalse(factory.exists(\"String_Node_Str\", conf));\n}\n"
|
"public void run() {\n try {\n jButtonStopSearch.setVisible(true);\n String nameFile = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n String nameFileUpCase = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n String nameFiles = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n String nameFolder = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n String nameFolderUpCase = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n String nameFolders = translation.getString(Translation.SEC_WMAIN, \"String_Node_Str\");\n model = new RedistTableModel(translation);\n setTableModelUI();\n List<File> srcFolders = new ArrayList<>(32);\n if (fSteamDir.exists()) {\n srcFolders.add(fSteamDir);\n }\n File[] customFolders = customFoldersListStrToFiles();\n for (File customFolder : customFolders) {\n if (!srcFolders.contains(customFolder)) {\n srcFolders.add(customFolder);\n }\n }\n List<File> allFiles = new ArrayList<>(1024);\n FileUtils.listDir(thisframe, allFiles, srcFolders, config.getMaDepth(), dangerousFolders);\n List<Redist> checkedFiles = new ArrayList<>(128);\n List<Redist> checkedFolders = new ArrayList<>(128);\n FileComparator tc = new FileComparator(allFiles, patternsCfg.getRedistFilePatternsAndDesc(patternsCfg.getEnableExperimentalPatterns()), checkedFiles, true);\n try {\n Log.info(\"String_Node_Str\");\n tc.start();\n } catch (InterruptedException ex) {\n Log.error(ex);\n }\n tc = new FileComparator(allFiles, patternsCfg.getRedistFolderPatternsAndDesc(patternsCfg.getEnableExperimentalPatterns()), checkedFolders, false);\n try {\n Log.info(\"String_Node_Str\");\n tc.start();\n } catch (InterruptedException ex) {\n Log.error(ex);\n }\n uncheckedRedistPathList = uncheckedItems.getUncheckedItems();\n for (Redist redist : checkedFiles) {\n boolean checked = !uncheckedRedistPathList.contains(redist.getFile().getAbsolutePath());\n model.addRow(new Object[] { checked, redist.getFile().getAbsolutePath(), redist.getSize(), \"String_Node_Str\" + nameFileUpCase + \"String_Node_Str\" + redist.getDescription() });\n }\n for (Redist redist : checkedFolders) {\n boolean check = !uncheckedRedistPathList.contains(redist.getFile().getAbsolutePath() + File.separatorChar);\n model.addRow(new Object[] { check, redist.getFile().getAbsolutePath() + File.separatorChar, redist.getSize(), \"String_Node_Str\" + nameFolderUpCase + \"String_Node_Str\" + redist.getDescription() });\n }\n int nbFiles = checkedFiles.size();\n int nbFolders = checkedFolders.size();\n jPanelList.setBorder(BorderFactory.createTitledBorder(tblRedistLabelDefault + \"String_Node_Str\" + nbFiles + \"String_Node_Str\" + (nbFiles > 1 ? nameFiles : nameFile) + \"String_Node_Str\" + checkedFolders.size() + \"String_Node_Str\" + (nbFolders > 1 ? nameFolders : nameFolder)));\n } catch (InfinitiveLoopException | IOException ex) {\n Log.error(ex);\n } finally {\n jButtonStopSearch.setVisible(false);\n buttonReload.setText(btnReloadLabelInitial);\n enableAllUI(true);\n boolean rdistFound = model.getRowCount() > 0;\n jButtonRemoveRedistItemsFromDisk.setEnabled(rdistFound);\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.