idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,552,350 | public Status check() {<NEW_LINE>List<ProtocolServer> servers = DubboProtocol.getDubboProtocol().getServers();<NEW_LINE>if (servers == null || servers.isEmpty()) {<NEW_LINE>return new Status(Status.Level.UNKNOWN);<NEW_LINE>}<NEW_LINE>Status.Level level = Status.Level.OK;<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>for (ProtocolServer protocolServer : servers) {<NEW_LINE>RemotingServer server = protocolServer.getRemotingServer();<NEW_LINE>if (!server.isBound()) {<NEW_LINE>level = Status.Level.ERROR;<NEW_LINE>buf.setLength(0);<NEW_LINE>buf.append(server.getLocalAddress());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (buf.length() > 0) {<NEW_LINE>buf.append(',');<NEW_LINE>}<NEW_LINE>buf.append(server.getLocalAddress());<NEW_LINE>buf.append("(clients:");<NEW_LINE>buf.append(server.getChannels().size());<NEW_LINE>buf.append(')');<NEW_LINE>}<NEW_LINE>return new Status(<MASK><NEW_LINE>} | level, buf.toString()); |
147,700 | public static void printUnknown(final Set<Class<?>> classes, final String command) {<NEW_LINE>final Map<Class, Integer> distances = new HashMap<Class, Integer>();<NEW_LINE>int bestDistance = Integer.MAX_VALUE;<NEW_LINE>int bestN = 0;<NEW_LINE>// Score against all classes<NEW_LINE>for (final Class clazz : classes) {<NEW_LINE>final String name = clazz.getSimpleName();<NEW_LINE>final int distance;<NEW_LINE>if (name.equals(command)) {<NEW_LINE>throw new RuntimeException("Command matches: " + command);<NEW_LINE>}<NEW_LINE>if (name.startsWith(command) || (MINIMUM_SUBSTRING_LENGTH <= command.length() && name.contains(command))) {<NEW_LINE>distance = 0;<NEW_LINE>} else {<NEW_LINE>distance = StringUtil.levenshteinDistance(command, name, 0, 2, 1, 4);<NEW_LINE>}<NEW_LINE>distances.put(clazz, distance);<NEW_LINE>if (distance < bestDistance) {<NEW_LINE>bestDistance = distance;<NEW_LINE>bestN = 1;<NEW_LINE>} else if (distance == bestDistance) {<NEW_LINE>bestN++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Upper bound on the similarity score<NEW_LINE>if (0 == bestDistance && bestN == classes.size()) {<NEW_LINE>bestDistance = HELP_SIMILARITY_FLOOR + 1;<NEW_LINE>}<NEW_LINE>// Output similar matches<NEW_LINE>System.err.println(String<MASK><NEW_LINE>if (bestDistance < HELP_SIMILARITY_FLOOR) {<NEW_LINE>System.err.println(String.format("Did you mean %s?", (bestN < 2) ? "this" : "one of these"));<NEW_LINE>for (final Class clazz : classes) {<NEW_LINE>if (bestDistance == distances.get(clazz)) {<NEW_LINE>System.err.println(String.format(" %s", clazz.getSimpleName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .format("'%s' is not a valid command. See PicardCommandLine -h for more information.", command)); |
334,472 | public List<BibDataSet> processingReferenceSection(String referenceTextBlock, ReferenceSegmenter referenceSegmenter) {<NEW_LINE>List<LabeledReferenceResult> <MASK><NEW_LINE>List<BibDataSet> results = new ArrayList<>();<NEW_LINE>List<List<LayoutToken>> allRefBlocks = new ArrayList<>();<NEW_LINE>if (segm == null || segm.size() == 0)<NEW_LINE>return results;<NEW_LINE>for (LabeledReferenceResult ref : segm) {<NEW_LINE>if (ref.getTokens() == null || ref.getTokens().size() == 0)<NEW_LINE>continue;<NEW_LINE>allRefBlocks.add(ref.getTokens());<NEW_LINE>}<NEW_LINE>List<BiblioItem> bibList = processingLayoutTokenMultiple(allRefBlocks, 0);<NEW_LINE>int i = 0;<NEW_LINE>for (LabeledReferenceResult ref : segm) {<NEW_LINE>if (ref.getTokens() == null || ref.getTokens().size() == 0)<NEW_LINE>continue;<NEW_LINE>BiblioItem bib = bibList.get(i);<NEW_LINE>i++;<NEW_LINE>if ((bib != null) && !bib.rejectAsReference()) {<NEW_LINE>BibDataSet bds = new BibDataSet();<NEW_LINE>bds.setRefSymbol(ref.getLabel());<NEW_LINE>bib.setReference(ref.getReferenceText());<NEW_LINE>bds.setResBib(bib);<NEW_LINE>bds.setRawBib(ref.getReferenceText());<NEW_LINE>bds.getResBib().setCoordinates(ref.getCoordinates());<NEW_LINE>results.add(bds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | segm = referenceSegmenter.extract(referenceTextBlock); |
592,817 | public void preferenceChange(PreferenceChangeEvent event) {<NEW_LINE>final var prefs = event.getNode();<NEW_LINE>final var prop = event.getKey();<NEW_LINE>if (prop.equals(TEMPLATE_TYPE)) {<NEW_LINE>int oldValue = templateType;<NEW_LINE>int value = prefs.getInt(TEMPLATE_TYPE, TEMPLATE_UNKNOWN);<NEW_LINE>if (value != oldValue) {<NEW_LINE>templateType = value;<NEW_LINE>propertySupport.<MASK><NEW_LINE>propertySupport.firePropertyChange(TEMPLATE_TYPE, oldValue, value);<NEW_LINE>}<NEW_LINE>} else if (prop.equals(TEMPLATE_FILE)) {<NEW_LINE>final var oldValue = templateFile;<NEW_LINE>final var value = convertFile(prefs.get(TEMPLATE_FILE, null));<NEW_LINE>if (!Objects.equals(value, oldValue)) {<NEW_LINE>templateFile = value;<NEW_LINE>if (templateType == TEMPLATE_CUSTOM) {<NEW_LINE>customTemplate = null;<NEW_LINE>propertySupport.firePropertyChange(TEMPLATE, oldValue, value);<NEW_LINE>}<NEW_LINE>propertySupport.firePropertyChange(TEMPLATE_FILE, oldValue, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | firePropertyChange(TEMPLATE, oldValue, value); |
692,935 | private <T> T run(Retryable<T> op, boolean interruptible) throws InterruptedException, RetryGiveupException {<NEW_LINE>int retryWait = initialRetryWait;<NEW_LINE>int retryCount = 0;<NEW_LINE>Exception firstException = null;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>return op.call();<NEW_LINE>} catch (Exception exception) {<NEW_LINE>if (firstException == null) {<NEW_LINE>firstException = exception;<NEW_LINE>}<NEW_LINE>if (!op.isRetryableException(exception) || retryCount >= retryLimit) {<NEW_LINE><MASK><NEW_LINE>throw new RetryGiveupException(firstException);<NEW_LINE>}<NEW_LINE>retryCount++;<NEW_LINE>op.onRetry(exception, retryCount, retryLimit, retryWait);<NEW_LINE>try {<NEW_LINE>Thread.sleep(retryWait);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>if (interruptible) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// exponential back-off with hard limit<NEW_LINE>retryWait *= 2;<NEW_LINE>if (retryWait > maxRetryWait) {<NEW_LINE>retryWait = maxRetryWait;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | op.onGiveup(firstException, exception); |
1,358,562 | public List<PropertyValue> queryTitleForm(String title, Logger logger) {<NEW_LINE>title = super.capitalizeTitle(title);<NEW_LINE>String quotedTitle = title.replaceAll("\"", "").replaceAll("\\\\", "").replaceAll("\n", " ");<NEW_LINE>String rawQueryStr = // (A) fetch resources with @title label<NEW_LINE>"{\n" + " ?res rdfs:label \"" + quotedTitle + "\"@en.\n" + // (B) fetch also resources targetted by @title redirect<NEW_LINE>"} UNION {\n" + " ?redir dbo:wikiPageRedirects ?res .\n" + " ?redir rdfs:label \"" + quotedTitle + "\"@en .\n" + // set the output variables<NEW_LINE>"}\n" + // ?val might be a resource - in that case, convert it to a label<NEW_LINE>"?res ?property ?valres .\n" + "OPTIONAL { ?valres rdfs:label ?vlabel . }\n" + // weed out resources that are categories and other in-namespace junk<NEW_LINE>"BIND ( IF(BOUND(?vlabel), ?vlabel, ?valres) AS ?value )\n" + // select only relevant properties<NEW_LINE>"FILTER ( !regex(str(?res), '^http://dbpedia.org/resource/[^_]*:', 'i') )\n" + "FILTER ( regex(str(?property), '^http://dbpedia.org/ontology', 'i') )\n" + "FILTER ( !regex(str(?property), '^http://dbpedia.org/ontology/(wiki|abstract)', 'i') )\n" + "";<NEW_LINE>// logger.debug("executing sparql query: {}", rawQueryStr);<NEW_LINE>List<Literal[]> rawResults = rawQuery(rawQueryStr, new String[] { "property", "value", "/valres", "/res" }, 0);<NEW_LINE>List<PropertyValue> results = new ArrayList<PropertyValue>(rawResults.size());<NEW_LINE>for (Literal[] rawResult : rawResults) {<NEW_LINE>String propLabel = rawResult[0].getString().replaceAll(".*/", "").replaceAll("_", " ").replaceAll("([a-z])([A-Z])", "$1 $2");<NEW_LINE>String value = rawResult[1].getString().replaceAll("\\s+\\([^)]*\\)\\s*$", "");<NEW_LINE>String valRes = rawResult[2] != null ? rawResult[2].getString() : null;<NEW_LINE>String objRes = rawResult[3].getString();<NEW_LINE>logger.debug("DBpedia {} property: {} -> {} ({})", <MASK><NEW_LINE>AnswerFV fv = new AnswerFV();<NEW_LINE>fv.setFeature(AF.OriginDBpOntology, 1.0);<NEW_LINE>results.add(new PropertyValue(title, objRes, propLabel, value, valRes, null, fv, AnswerSourceStructured.ORIGIN_ONTOLOGY));<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | title, propLabel, value, valRes); |
468,591 | public RunningTaskInfo buildRunningTaskInfo(K key) {<NEW_LINE>SingleFlightContext c = getContext(key);<NEW_LINE>if (c == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TaskSingleFlightContext context = (TaskSingleFlightContext) c;<NEW_LINE>final Instant now = Instant.now();<NEW_LINE>final RunningTaskInfo info = new RunningTaskInfo();<NEW_LINE>info.setExecutionTime(Duration.between(context.getStartTime(), now).getSeconds());<NEW_LINE>info.setPendingTime(0);<NEW_LINE>info.setName(String.valueOf(key));<NEW_LINE>info.setClassName(TaskSingleFlightContext.class.getSimpleName());<NEW_LINE>info.setIndex(0);<NEW_LINE>ReturnValueCompletion<V<MASK><NEW_LINE>if (first != null) {<NEW_LINE>Map<String, String> threadContext = first.getThreadContext();<NEW_LINE>if (threadContext != null) {<NEW_LINE>info.setApiName(threadContext.get(Constants.THREAD_CONTEXT_TASK_NAME));<NEW_LINE>info.setApiId(threadContext.get(Constants.THREAD_CONTEXT_API));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>info.setContextList(Collections.emptyList());<NEW_LINE>info.setContext(map(e("apiName", info.getApiName()), e("apiId", info.getApiId())).toString());<NEW_LINE>return info;<NEW_LINE>} | > first = context.getFirst(); |
801,464 | protected void initShortcutActions() {<NEW_LINE>String filterApplyShortcut = clientConfig.getFilterApplyShortcut();<NEW_LINE>String filterSelectShortcut = clientConfig.getFilterSelectShortcut();<NEW_LINE>if (filter.getApplyTo() instanceof ListComponent) {<NEW_LINE>ListComponent listComponent = (ListComponent) filter.getApplyTo();<NEW_LINE>if (listComponent.getAction(Filter.APPLY_ACTION_ID) == null) {<NEW_LINE>Action applyFilterAction = new BaseAction(Filter.APPLY_ACTION_ID).withShortcut(filterApplyShortcut).withHandler(event -> {<NEW_LINE>if (event.getSource().isVisible()) {<NEW_LINE>applyFilter();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listComponent.addAction(applyFilterAction);<NEW_LINE>}<NEW_LINE>if (listComponent.getAction(Filter.SELECT_ACTION_ID) == null) {<NEW_LINE>Action selectFilterAction = new BaseAction(Filter.SELECT_ACTION_ID).withShortcut(filterSelectShortcut).withHandler(event -> {<NEW_LINE>if (event.getSource().isVisible()) {<NEW_LINE>openFilterSelectMenu();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listComponent.addAction(selectFilterAction);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groupBoxLayout.addShortcutAction(new ShortcutAction(filterApplyShortcut<MASK><NEW_LINE>groupBoxLayout.addShortcutAction(new ShortcutAction(filterSelectShortcut, shortcutTriggeredEvent -> openFilterSelectMenu()));<NEW_LINE>} | , shortcutTriggeredEvent -> applyFilter())); |
1,010,110 | private void sendOutMessages(@NotNull final List<PUBLISH> retainedPublishes) {<NEW_LINE>if (!channel.isActive()) {<NEW_LINE>for (final PUBLISH publish : retainedPublishes) {<NEW_LINE>payloadPersistence.decrementReferenceCounter(publish.getPublishId());<NEW_LINE>}<NEW_LINE>resultFuture.setException(CLOSED_CHANNEL_EXCEPTION);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>for (final Topic topic : subscribedTopics) {<NEW_LINE>log.trace("Sending retained message with topic [{}] for client [{}]", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ImmutableList.Builder<PUBLISH> builder = ImmutableList.builder();<NEW_LINE>final ImmutableList.Builder<ListenableFuture<Void>> futures = ImmutableList.builder();<NEW_LINE>for (final PUBLISH publish : retainedPublishes) {<NEW_LINE>if (publish.getQoS() == QoS.AT_MOST_ONCE) {<NEW_LINE>futures.add(sendQos0PublishDirectly(publish));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>builder.add(publish);<NEW_LINE>}<NEW_LINE>final ImmutableList<PUBLISH> qos1and2Messages = builder.build();<NEW_LINE>if (qos1and2Messages.isEmpty()) {<NEW_LINE>resultFuture.setFuture(FutureUtils.voidFutureFromList(futures.build()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Long queueLimit = channel.attr(ChannelAttributes.CLIENT_CONNECTION).get().getQueueSizeMaximum();<NEW_LINE>futures.add(clientQueuePersistence.add(clientId, false, qos1and2Messages, true, Objects.requireNonNullElseGet(queueLimit, mqttConfigurationService::maxQueuedMessages)));<NEW_LINE>resultFuture.setFuture(FutureUtils.voidFutureFromList(futures.build()));<NEW_LINE>} | topic.getTopic(), clientId); |
386,890 | private void superPrePassivate(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>ResultsLocal results = ResultsLocalBean.getSFBean();<NEW_LINE>results.addPrePassivate(CLASS_NAME, "superPrePassivate");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object<MASK><NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PrePassivate")) {<NEW_LINE>data = (String) map.get("PrePassivate");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PrePassivate", data);<NEW_LINE>results.setPrePassivateContextData(data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with PrePassivate interceptor");<NEW_LINE>} else if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PrePassivate<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PrePassivate interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EJBException("unexpected Throwable", e);<NEW_LINE>}<NEW_LINE>} | > map = inv.getContextData(); |
586,908 | private void initRecyclerTemplateList(WXSDKInstance instance, BasicComponentData basicComponentData, WXVContainer parent) {<NEW_LINE>updateRecyclerAttr();<NEW_LINE>mTemplateViewTypes = new ArrayMap<>();<NEW_LINE>// empty view, when template was not sended<NEW_LINE>mTemplateViewTypes.put(EMPTY_HOLDER_TEMPLATE_KEY, 0);<NEW_LINE>mTemplateSources = new HashMap<>();<NEW_LINE>mTemplatesCache = new ConcurrentHashMap<>();<NEW_LINE>mStickyHelper = new TemplateStickyHelper(this);<NEW_LINE>orientation = basicComponentData<MASK><NEW_LINE>listDataTemplateKey = WXUtils.getString(getAttrs().get(Constants.Name.Recycler.LIST_DATA_TEMPLATE_SWITCH_KEY), Constants.Name.Recycler.SLOT_TEMPLATE_CASE);<NEW_LINE>listDataItemKey = WXUtils.getString(getAttrs().get(Constants.Name.Recycler.LIST_DATA_ITEM), listDataItemKey);<NEW_LINE>listDataIndexKey = WXUtils.getString(getAttrs().get(Constants.Name.Recycler.LIST_DATA_ITEM_INDEX), listDataIndexKey);<NEW_LINE>cellDataManager = new CellDataManager(this);<NEW_LINE>cellDataManager.listData = parseListDataToJSONArray(getAttrs().get(Constants.Name.Recycler.LIST_DATA));<NEW_LINE>// TODO<NEW_LINE>// if(mDomObject != null<NEW_LINE>// && mDomObject.getCellList() != null<NEW_LINE>// && mDomObject.getCellList().size() > 0){<NEW_LINE>// Runnable runnable = new Runnable() {<NEW_LINE>// // @Override<NEW_LINE>// public void run() {<NEW_LINE>// if(isDestoryed()){<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>// long start = System.currentTimeMillis();<NEW_LINE>// if(mDomObject != null && mDomObject.getCellList() != null){<NEW_LINE>// for(int i=0; i<mDomObject.getCellList().size(); i++){<NEW_LINE>// addChild(ComponentUtils.buildTree(mDomObject.getCellList().get(i), WXRecyclerTemplateList.this));<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// if(WXEnvironment.isOpenDebugLog() && ENABLE_TRACE_LOG){<NEW_LINE>// WXLogUtils.d(TAG, "TemplateList BuildDomTree Used " + (System.currentTimeMillis() - start));<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// };<NEW_LINE>// WXSDKManager.getInstance().getWXDomManager().post(runnable);<NEW_LINE>// }<NEW_LINE>} | .getAttrs().getOrientation(); |
1,824,036 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>String sessionHandle = InputParser.getQueryParamOrThrowError(req, "sessionHandle", false);<NEW_LINE>assert sessionHandle != null;<NEW_LINE>try {<NEW_LINE>JsonObject userDataInDatabase = Session.getSessionData(main, sessionHandle);<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "OK");<NEW_LINE>result.add("userDataInDatabase", userDataInDatabase);<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (StorageQueryException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} catch (UnauthorisedException e) {<NEW_LINE>Logging.debug(main<MASK><NEW_LINE>JsonObject reply = new JsonObject();<NEW_LINE>reply.addProperty("status", "UNAUTHORISED");<NEW_LINE>reply.addProperty("message", e.getMessage());<NEW_LINE>super.sendJsonResponse(200, reply, resp);<NEW_LINE>}<NEW_LINE>} | , Utils.exceptionStacktraceToString(e)); |
77,107 | protected void doExecute(ExecutionContext context) {<NEW_LINE>CommandConsole commandConsole = context.getCommandConsole();<NEW_LINE>ManifestFileProcessor processor = new ManifestFileProcessor();<NEW_LINE>for (Map.Entry<String, Map<String, ProvisioningFeatureDefinition>> prodFeatureEntries : processor.getFeatureDefinitionsByProduct().entrySet()) {<NEW_LINE>String productName = prodFeatureEntries.getKey();<NEW_LINE>boolean headingPrinted = false;<NEW_LINE>for (Map.Entry<String, ProvisioningFeatureDefinition> entry : prodFeatureEntries.getValue().entrySet()) {<NEW_LINE>// entry.getKey() this is the longer Subsystem-SymbolicName<NEW_LINE>FeatureDefinition featureDefintion = entry.getValue();<NEW_LINE><MASK><NEW_LINE>if (featureDefintion.getVisibility() == Visibility.PUBLIC) {<NEW_LINE>if (productName.equals(ManifestFileProcessor.CORE_PRODUCT_NAME)) {<NEW_LINE>commandConsole.printInfoMessage(featureName);<NEW_LINE>} else {<NEW_LINE>if (headingPrinted == false) {<NEW_LINE>commandConsole.printlnInfoMessage("");<NEW_LINE>commandConsole.printInfoMessage("Product Extension: ");<NEW_LINE>commandConsole.printlnInfoMessage(productName);<NEW_LINE>headingPrinted = true;<NEW_LINE>}<NEW_LINE>int colonIndex = featureName.indexOf(":");<NEW_LINE>commandConsole.printInfoMessage(featureName.substring(colonIndex + 1));<NEW_LINE>}<NEW_LINE>commandConsole.printlnInfoMessage("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String featureName = featureDefintion.getFeatureName(); |
495,855 | static TBigInteger consBigInteger(int bitLength, int certainty, Random rnd) {<NEW_LINE>// PRE: bitLength >= 2;<NEW_LINE>// For small numbers get a random prime from the prime table<NEW_LINE>if (bitLength <= 10) {<NEW_LINE>int<MASK><NEW_LINE>return BIprimes[rp[0] + rnd.nextInt(rp[1])];<NEW_LINE>}<NEW_LINE>int shiftCount = (-bitLength) & 31;<NEW_LINE>int last = (bitLength + 31) >> 5;<NEW_LINE>TBigInteger n = new TBigInteger(1, last, new int[last]);<NEW_LINE>last--;<NEW_LINE>do {<NEW_LINE>// To fill the array with random integers<NEW_LINE>for (int i = 0; i < n.numberLength; i++) {<NEW_LINE>n.digits[i] = rnd.nextInt();<NEW_LINE>}<NEW_LINE>// To fix to the correct bitLength<NEW_LINE>n.digits[last] |= 0x80000000;<NEW_LINE>n.digits[last] >>>= shiftCount;<NEW_LINE>// To create an odd number<NEW_LINE>n.digits[0] |= 1;<NEW_LINE>} while (!isProbablePrime(n, certainty));<NEW_LINE>return n;<NEW_LINE>} | [] rp = offsetPrimes[bitLength]; |
126,584 | public void release() {<NEW_LINE>if (Log.isDebugModeEnabled()) {<NEW_LINE>Log.d(TAG, "Releasing: " + this, Log.DEBUG_MODE);<NEW_LINE>}<NEW_LINE>releaseLongPressMotionEvent();<NEW_LINE>View nv = getNativeView();<NEW_LINE>if (nv != null) {<NEW_LINE>if (nv instanceof ViewGroup) {<NEW_LINE>ViewGroup vg = (ViewGroup) nv;<NEW_LINE>if (Log.isDebugModeEnabled()) {<NEW_LINE>Log.d(TAG, "Group has: " + vg.getChildCount(), Log.DEBUG_MODE);<NEW_LINE>}<NEW_LINE>if (!(vg instanceof AdapterView<?>)) {<NEW_LINE>vg.removeAllViews();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (d != null) {<NEW_LINE>d.setCallback(null);<NEW_LINE>if (d instanceof TiBackgroundDrawable) {<NEW_LINE>((TiBackgroundDrawable) d).releaseDelegate();<NEW_LINE>}<NEW_LINE>d = null;<NEW_LINE>}<NEW_LINE>if (!(nativeView instanceof AdapterView)) {<NEW_LINE>nativeView.setOnClickListener(null);<NEW_LINE>}<NEW_LINE>nativeView.setOnLongClickListener(null);<NEW_LINE>nativeView.setOnTouchListener(null);<NEW_LINE>nativeView.setOnDragListener(null);<NEW_LINE>nativeView.setOnFocusChangeListener(null);<NEW_LINE>nativeView = null;<NEW_LINE>borderView = null;<NEW_LINE>if (proxy != null) {<NEW_LINE>proxy.setModelListener(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (children != null) {<NEW_LINE>ArrayList<TiUIView> childViews = new ArrayList<>(children);<NEW_LINE>for (TiUIView child : childViews) {<NEW_LINE>remove(child);<NEW_LINE>}<NEW_LINE>children.clear();<NEW_LINE>children = null;<NEW_LINE>}<NEW_LINE>proxy = null;<NEW_LINE>layoutParams = null;<NEW_LINE>} | Drawable d = nv.getBackground(); |
679,006 | public void iteratorwhileSnippet() throws MalformedURLException {<NEW_LINE>HttpHeaders httpHeaders = new HttpHeaders().set("header1", "value1").set("header2", "value2");<NEW_LINE>HttpRequest httpRequest = new HttpRequest(HttpMethod.<MASK><NEW_LINE>String deserializedHeaders = "header1,value1,header2,value2";<NEW_LINE>IterableStream<PagedResponseBase<String, Integer>> myIterableStream = new IterableStream<>(Flux.just(createPagedResponse(httpRequest, httpHeaders, deserializedHeaders, 1, 3)));<NEW_LINE>// BEGIN: com.azure.core.util.iterableStream.iterator.while<NEW_LINE>// Iterate over iterator<NEW_LINE>for (PagedResponseBase<String, Integer> resp : myIterableStream) {<NEW_LINE>if (resp.getStatusCode() == HttpURLConnection.HTTP_OK) {<NEW_LINE>System.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl());<NEW_LINE>resp.getElements().forEach(value -> System.out.printf("Response value is %d%n", value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// END: com.azure.core.util.iterableStream.iterator.while<NEW_LINE>} | GET, new URL("http://localhost")); |
336,560 | public void write(Object instance, Object value) {<NEW_LINE>setAccessible();<NEW_LINE>try {<NEW_LINE>if (primitive) {<NEW_LINE>if (value == null) {<NEW_LINE>if (applyDefault == null) {<NEW_LINE>Object currentValue = read(instance, true);<NEW_LINE>applyDefault = defaultPrimitiveValue.equals(currentValue);<NEW_LINE>}<NEW_LINE>if (applyDefault == Boolean.TRUE) {<NEW_LINE>value = defaultPrimitiveValue;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (defaultPrimitiveValue.getClass() != value.getClass() && value instanceof Number) {<NEW_LINE>Number number = ((Number) value);<NEW_LINE>if (fieldType == int.class) {<NEW_LINE>value = number.intValue();<NEW_LINE>} else if (fieldType == long.class) {<NEW_LINE>value = number.longValue();<NEW_LINE>} else if (fieldType == double.class) {<NEW_LINE>value = number.doubleValue();<NEW_LINE>} else if (fieldType == float.class) {<NEW_LINE>value = number.floatValue();<NEW_LINE>} else if (fieldType == byte.class) {<NEW_LINE>value = number.byteValue();<NEW_LINE>} else if (fieldType == short.class) {<NEW_LINE>value = number.shortValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (writeMethod != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>((Field) target).set(instance, value);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>String valueTypeName = value == null ? null : value.getClass().getName();<NEW_LINE>String msg;<NEW_LINE>String details = null;<NEW_LINE>if (valueTypeName != null) {<NEW_LINE>msg = "Unable to set value '{value}' of type '" + valueTypeName + "' to " + toString();<NEW_LINE>} else {<NEW_LINE>msg = "Unable to set value 'null' to " + toString();<NEW_LINE>}<NEW_LINE>if (e instanceof InvocationTargetException) {<NEW_LINE>e = e.getCause();<NEW_LINE>details = msg;<NEW_LINE>}<NEW_LINE>if (e instanceof DataProcessingException) {<NEW_LINE>DataProcessingException ex = (DataProcessingException) e;<NEW_LINE>ex.markAsNonFatal();<NEW_LINE>ex.setValue(value);<NEW_LINE>ex.setDetails(details);<NEW_LINE>throw (DataProcessingException) e;<NEW_LINE>}<NEW_LINE>DataProcessingException ex = new DataProcessingException(msg, e);<NEW_LINE>ex.markAsNonFatal();<NEW_LINE>ex.setValue(value);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | writeMethod.invoke(instance, value); |
1,718,873 | public static DescribeRenewalPriceResponse unmarshall(DescribeRenewalPriceResponse describeRenewalPriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRenewalPriceResponse.setRequestId(_ctx.stringValue("DescribeRenewalPriceResponse.RequestId"));<NEW_LINE>Order order = new Order();<NEW_LINE>order.setOriginalAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.OriginalAmount"));<NEW_LINE>order.setDiscountAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.DiscountAmount"));<NEW_LINE>order.setTradeAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.TradeAmount"));<NEW_LINE>order.setCurrency(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Currency"));<NEW_LINE>List<String> ruleIds1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Order.RuleIds.Length"); i++) {<NEW_LINE>ruleIds1.add(_ctx.stringValue<MASK><NEW_LINE>}<NEW_LINE>order.setRuleIds1(ruleIds1);<NEW_LINE>List<Coupon> coupons = new ArrayList<Coupon>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Order.Coupons.Length"); i++) {<NEW_LINE>Coupon coupon = new Coupon();<NEW_LINE>coupon.setDescription(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].Description"));<NEW_LINE>coupon.setIsSelected(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].IsSelected"));<NEW_LINE>coupon.setCouponNo(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].CouponNo"));<NEW_LINE>coupon.setName(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].Name"));<NEW_LINE>coupons.add(coupon);<NEW_LINE>}<NEW_LINE>order.setCoupons(coupons);<NEW_LINE>describeRenewalPriceResponse.setOrder(order);<NEW_LINE>List<SubOrder> subOrders = new ArrayList<SubOrder>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.SubOrders.Length"); i++) {<NEW_LINE>SubOrder subOrder = new SubOrder();<NEW_LINE>subOrder.setOriginalAmount(_ctx.floatValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].OriginalAmount"));<NEW_LINE>subOrder.setDiscountAmount(_ctx.floatValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].DiscountAmount"));<NEW_LINE>subOrder.setTradeAmount(_ctx.floatValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].TradeAmount"));<NEW_LINE>subOrder.setInstanceId(_ctx.stringValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].InstanceId"));<NEW_LINE>List<String> ruleIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].RuleIds.Length"); j++) {<NEW_LINE>ruleIds.add(_ctx.stringValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].RuleIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>subOrder.setRuleIds(ruleIds);<NEW_LINE>subOrders.add(subOrder);<NEW_LINE>}<NEW_LINE>describeRenewalPriceResponse.setSubOrders(subOrders);<NEW_LINE>List<Rule> rules = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Rules.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setRuleDescId(_ctx.longValue("DescribeRenewalPriceResponse.Rules[" + i + "].RuleDescId"));<NEW_LINE>rule.setTitle(_ctx.stringValue("DescribeRenewalPriceResponse.Rules[" + i + "].Title"));<NEW_LINE>rule.setName(_ctx.stringValue("DescribeRenewalPriceResponse.Rules[" + i + "].Name"));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>describeRenewalPriceResponse.setRules(rules);<NEW_LINE>return describeRenewalPriceResponse;<NEW_LINE>} | ("DescribeRenewalPriceResponse.Order.RuleIds[" + i + "]")); |
77,219 | public static ListEngineNamespacesResponse unmarshall(ListEngineNamespacesResponse listEngineNamespacesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listEngineNamespacesResponse.setRequestId<MASK><NEW_LINE>listEngineNamespacesResponse.setHttpCode(_ctx.stringValue("ListEngineNamespacesResponse.HttpCode"));<NEW_LINE>listEngineNamespacesResponse.setTotalCount(_ctx.integerValue("ListEngineNamespacesResponse.TotalCount"));<NEW_LINE>listEngineNamespacesResponse.setMessage(_ctx.stringValue("ListEngineNamespacesResponse.Message"));<NEW_LINE>listEngineNamespacesResponse.setPageSize(_ctx.integerValue("ListEngineNamespacesResponse.PageSize"));<NEW_LINE>listEngineNamespacesResponse.setPageNumber(_ctx.integerValue("ListEngineNamespacesResponse.PageNumber"));<NEW_LINE>listEngineNamespacesResponse.setErrorCode(_ctx.stringValue("ListEngineNamespacesResponse.ErrorCode"));<NEW_LINE>listEngineNamespacesResponse.setSuccess(_ctx.booleanValue("ListEngineNamespacesResponse.Success"));<NEW_LINE>List<Namespace> data = new ArrayList<Namespace>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListEngineNamespacesResponse.Data.Length"); i++) {<NEW_LINE>Namespace namespace = new Namespace();<NEW_LINE>namespace.setType(_ctx.integerValue("ListEngineNamespacesResponse.Data[" + i + "].Type"));<NEW_LINE>namespace.setNamespaceShowName(_ctx.stringValue("ListEngineNamespacesResponse.Data[" + i + "].NamespaceShowName"));<NEW_LINE>namespace.setQuota(_ctx.integerValue("ListEngineNamespacesResponse.Data[" + i + "].Quota"));<NEW_LINE>namespace.setNamespace(_ctx.stringValue("ListEngineNamespacesResponse.Data[" + i + "].Namespace"));<NEW_LINE>namespace.setNamespaceDesc(_ctx.stringValue("ListEngineNamespacesResponse.Data[" + i + "].NamespaceDesc"));<NEW_LINE>namespace.setConfigCount(_ctx.integerValue("ListEngineNamespacesResponse.Data[" + i + "].ConfigCount"));<NEW_LINE>namespace.setServiceCount(_ctx.stringValue("ListEngineNamespacesResponse.Data[" + i + "].ServiceCount"));<NEW_LINE>data.add(namespace);<NEW_LINE>}<NEW_LINE>listEngineNamespacesResponse.setData(data);<NEW_LINE>return listEngineNamespacesResponse;<NEW_LINE>} | (_ctx.stringValue("ListEngineNamespacesResponse.RequestId")); |
1,307,925 | private boolean invariant() {<NEW_LINE>// initializingShards must consistent with that in shards<NEW_LINE>Collection<ShardRouting> shardRoutingsInitializing = StreamSupport.stream(shards.spliterator(), false).filter(ShardRouting::initializing).collect(Collectors.toList());<NEW_LINE>assert initializingShards.size() == shardRoutingsInitializing.size();<NEW_LINE>assert initializingShards.containsAll(shardRoutingsInitializing);<NEW_LINE>// relocatingShards must consistent with that in shards<NEW_LINE>Collection<ShardRouting> shardRoutingsRelocating = StreamSupport.stream(shards.spliterator(), false).filter(ShardRouting::relocating).collect(Collectors.toList());<NEW_LINE>assert relocatingShards.size<MASK><NEW_LINE>assert relocatingShards.containsAll(shardRoutingsRelocating);<NEW_LINE>final Map<Index, Set<ShardRouting>> shardRoutingsByIndex = StreamSupport.stream(shards.spliterator(), false).collect(Collectors.groupingBy(ShardRouting::index, Collectors.toSet()));<NEW_LINE>assert shardRoutingsByIndex.equals(shardsByIndex);<NEW_LINE>return true;<NEW_LINE>} | () == shardRoutingsRelocating.size(); |
129,874 | public com.amazonaws.services.migrationhubrefactorspaces.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.migrationhubrefactorspaces.model.ValidationException validationException = new com.amazonaws.services.migrationhubrefactorspaces.model.ValidationException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return validationException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
11,874 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>int width = MeasureSpec.getSize(widthMeasureSpec);<NEW_LINE>int height = MeasureSpec.getSize(heightMeasureSpec);<NEW_LINE>float y = 0;<NEW_LINE>float consumedHeight;<NEW_LINE>float textMargin = DisplayUtils.dpToPx(getContext(), TEXT_MARGIN_DIP);<NEW_LINE>float iconMargin = DisplayUtils.dpToPx(getContext(), ICON_MARGIN_DIP);<NEW_LINE>Paint.FontMetrics fontMetrics = mPaint.getFontMetrics();<NEW_LINE>// week text.<NEW_LINE>y += textMargin;<NEW_LINE>mWeekTextBaseLine = y - fontMetrics.top;<NEW_LINE>y += fontMetrics.bottom - fontMetrics.top;<NEW_LINE>y += textMargin;<NEW_LINE>// date text.<NEW_LINE>y += textMargin;<NEW_LINE>mDateTextBaseLine = y - fontMetrics.top;<NEW_LINE>y += fontMetrics.bottom - fontMetrics.top;<NEW_LINE>y += textMargin;<NEW_LINE>// day icon.<NEW_LINE>if (mDayIconDrawable != null) {<NEW_LINE>y += iconMargin;<NEW_LINE>mDayIconLeft = (width - mIconSize) / 2f;<NEW_LINE>mDayIconTop = y;<NEW_LINE>y += mIconSize;<NEW_LINE>y += iconMargin;<NEW_LINE>}<NEW_LINE>consumedHeight = y;<NEW_LINE>// margin bottom.<NEW_LINE>float marginBottom = DisplayUtils.dpToPx(<MASK><NEW_LINE>consumedHeight += marginBottom;<NEW_LINE>// night icon.<NEW_LINE>if (mNightIconDrawable != null) {<NEW_LINE>mNightIconLeft = (width - mIconSize) / 2f;<NEW_LINE>mNightIconTop = height - marginBottom - iconMargin - mIconSize;<NEW_LINE>consumedHeight += mIconSize + 2 * iconMargin;<NEW_LINE>}<NEW_LINE>// chartItem item view.<NEW_LINE>if (mChartItem != null) {<NEW_LINE>mChartItem.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec((int) (height - consumedHeight), MeasureSpec.EXACTLY));<NEW_LINE>}<NEW_LINE>mTrendViewTop = y;<NEW_LINE>mChartTop = (int) (mTrendViewTop + mChartItem.getMarginTop());<NEW_LINE>mChartBottom = (int) (mTrendViewTop + mChartItem.getMeasuredHeight() - mChartItem.getMarginBottom());<NEW_LINE>setMeasuredDimension(width, height);<NEW_LINE>} | getContext(), TrendRecyclerView.ITEM_MARGIN_BOTTOM_DIP); |
1,062,268 | final void onExecuteWrite(@NonNull final BluetoothGattServer server, @NonNull final BluetoothDevice device, final int requestId, final boolean execute) {<NEW_LINE>log(Log.DEBUG, () -> "[Server callback] Execute write request (requestId=" + requestId + ", execute=" + execute + ")");<NEW_LINE>if (execute) {<NEW_LINE>final Deque<Pair<Object, byte[]>> values = preparedValues;<NEW_LINE>log(Log.INFO, () -> "[Server] Execute write request received");<NEW_LINE>preparedValues = null;<NEW_LINE>if (prepareError != 0) {<NEW_LINE>sendResponse(server, device, prepareError, requestId, 0, null);<NEW_LINE>prepareError = 0;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sendResponse(server, device, BluetoothGatt.GATT_SUCCESS, requestId, 0, null);<NEW_LINE>if (values == null || values.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean startNextRequest = false;<NEW_LINE>for (final Pair<Object, byte[]> value : values) {<NEW_LINE>if (value.first instanceof BluetoothGattCharacteristic) {<NEW_LINE>final BluetoothGattCharacteristic characteristic = (BluetoothGattCharacteristic) value.first;<NEW_LINE>startNextRequest = assignAndNotify(device, <MASK><NEW_LINE>} else if (value.first instanceof BluetoothGattDescriptor) {<NEW_LINE>final BluetoothGattDescriptor descriptor = (BluetoothGattDescriptor) value.first;<NEW_LINE>startNextRequest = assignAndNotify(device, descriptor, value.second) || startNextRequest;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (checkCondition() || startNextRequest) {<NEW_LINE>nextRequest(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log(Log.INFO, () -> "[Server] Cancel write request received");<NEW_LINE>preparedValues = null;<NEW_LINE>sendResponse(server, device, BluetoothGatt.GATT_SUCCESS, requestId, 0, null);<NEW_LINE>}<NEW_LINE>} | characteristic, value.second) || startNextRequest; |
815,093 | private Mono<PagedResponse<AvailableServiceAliasInner>> listSinglePageAsync(String location, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
697,880 | public Collection<DynamicRecord> remove(long labelId, NodeStore nodeStore, CursorContext cursorContext, StoreCursors storeCursors, MemoryTracker memoryTracker) {<NEW_LINE>nodeStore.ensureHeavy(node, firstDynamicLabelRecordId(node<MASK><NEW_LINE>long[] existingLabelIds = getDynamicLabelsArray(node.getUsedDynamicLabelRecords(), nodeStore.getDynamicLabelStore(), storeCursors);<NEW_LINE>long[] newLabelIds = filter(existingLabelIds, labelId);<NEW_LINE>List<DynamicRecord> existingRecords = node.getDynamicLabelRecords();<NEW_LINE>if (InlineNodeLabels.tryInlineInNodeRecord(node, newLabelIds, existingRecords)) {<NEW_LINE>setNotInUse(existingRecords);<NEW_LINE>} else {<NEW_LINE>Collection<DynamicRecord> newRecords = allocateRecordsForDynamicLabels(node.getId(), newLabelIds, new ReusableRecordsCompositeAllocator(existingRecords, nodeStore.getDynamicLabelStore()), cursorContext, memoryTracker);<NEW_LINE>node.setLabelField(dynamicPointer(newRecords), existingRecords);<NEW_LINE>if (!newRecords.equals(existingRecords)) {<NEW_LINE>// One less dynamic record, mark that one as not in use<NEW_LINE>for (DynamicRecord record : existingRecords) {<NEW_LINE>if (!newRecords.contains(record)) {<NEW_LINE>record.setInUse(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return existingRecords;<NEW_LINE>} | .getLabelField()), storeCursors); |
891,831 | private static void processOutputLimitedViewDefaultCodegen(ResultSetProcessorRowForAllForge forge, CodegenClassScope classScope, CodegenMethod method, CodegenInstanceAux instance) {<NEW_LINE>CodegenMethod getSelectListEventAddList = getSelectListEventsAddListCodegen(forge, classScope, instance);<NEW_LINE>CodegenMethod getSelectListEventAsArray = getSelectListEventsAsArrayCodegen(forge, classScope, instance);<NEW_LINE>ResultSetProcessorUtil.prefixCodegenNewOldEvents(method.getBlock(), forge.isSorting(), forge.isSelectRStream());<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "eventsPerStream", newArrayByLength(EventBean.EPTYPE, constant(1)));<NEW_LINE>CodegenBlock forEach = method.getBlock().forEach(UniformPair.EPTYPE, "pair", REF_VIEWEVENTSLIST);<NEW_LINE>{<NEW_LINE>if (forge.isSelectRStream()) {<NEW_LINE>forEach.localMethod(getSelectListEventAddList, constantFalse(), REF_ISSYNTHESIZE, ref("oldEvents"));<NEW_LINE>if (forge.isSorting()) {<NEW_LINE>forEach.exprDotMethod(ref("oldEventsSortKey"), "add", exprDotMethod(MEMBER_ORDERBYPROCESSOR, "getSortKey", constantNull(), constantFalse(), MEMBER_EXPREVALCONTEXT));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>forEach.staticMethod(ResultSetProcessorUtil.class, METHOD_APPLYAGGVIEWRESULT, MEMBER_AGGREGATIONSVC, MEMBER_EXPREVALCONTEXT, cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("pair"), "getFirst")), cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("pair"), "getSecond")), ref("eventsPerStream"));<NEW_LINE>forEach.localMethod(getSelectListEventAddList, constantTrue(), REF_ISSYNTHESIZE, ref("newEvents"));<NEW_LINE>if (forge.isSorting()) {<NEW_LINE>forEach.exprDotMethod(ref("newEventsSortKey"), "add", exprDotMethod(MEMBER_ORDERBYPROCESSOR, "getSortKey", constantNull(), constantTrue(), MEMBER_EXPREVALCONTEXT));<NEW_LINE>}<NEW_LINE>forEach.blockEnd();<NEW_LINE>}<NEW_LINE>CodegenBlock ifEmpty = method.getBlock().ifCondition(not(exprDotMethod(REF_VIEWEVENTSLIST, "isEmpty")));<NEW_LINE>ResultSetProcessorUtil.finalizeOutputMaySortMayRStreamCodegen(ifEmpty, ref("newEvents"), ref("newEventsSortKey"), ref("oldEvents"), ref("oldEventsSortKey"), forge.isSelectRStream(), forge.isSorting());<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "newEventsArr", localMethod(getSelectListEventAsArray, constantTrue(), REF_ISSYNTHESIZE, constantFalse())).declareVar(EventBean.EPTYPEARRAY, "oldEventsArr", forge.isSelectRStream() ? localMethod(getSelectListEventAsArray, constantFalse(), REF_ISSYNTHESIZE, constantFalse()) : constantNull()).methodReturn(staticMethod(ResultSetProcessorUtil.class, METHOD_TOPAIRNULLIFALLNULL, ref("newEventsArr"<MASK><NEW_LINE>} | ), ref("oldEventsArr"))); |
432,873 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String hubName, String predictionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (hubName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (predictionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter predictionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, hubName, predictionName, this.client.getApiVersion(), this.client.getSubscriptionId(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
901,466 | public OperationResult<Rows<K, C>> execute() throws ConnectionException {<NEW_LINE>final AtomicReference<ConnectionException> reference = new AtomicReference<ConnectionException>(null);<NEW_LINE>final List<Row<K, C>> list = Collections.synchronizedList(new LinkedList<Row<K, C>>());<NEW_LINE>RowCallback<K, C> rowCallback = new RowCallback<K, C>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(Rows<K, C> rows) {<NEW_LINE>if (rows != null && !rows.isEmpty()) {<NEW_LINE>for (Row<K, C> row : rows) {<NEW_LINE>list.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean failure(ConnectionException e) {<NEW_LINE>reference.set(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>executeWithCallback(rowCallback);<NEW_LINE>if (reference.get() != null) {<NEW_LINE>throw reference.get();<NEW_LINE>}<NEW_LINE>CqlRowListImpl<K, C> allRows = new CqlRowListImpl<MASK><NEW_LINE>return new CqlOperationResultImpl<Rows<K, C>>(null, allRows);<NEW_LINE>} | <K, C>(list); |
316,251 | public void bind(@NonNull final Object data, final int index, @NonNull final RecyclerView.ViewHolder holder) {<NEW_LINE>final Object item = getItems(data).get(index);<NEW_LINE>final View view = holder.itemView;<NEW_LINE>final ViewDataBinding viewDataBinding = DataBindingUtil.bind(view);<NEW_LINE>final Integer <MASK><NEW_LINE>if (itemVariable != BR_NO_ID) {<NEW_LINE>viewDataBinding.setVariable(itemVariable, item);<NEW_LINE>view.setTag(R.id.agera__rvdatabinding__item_id, itemVariable);<NEW_LINE>}<NEW_LINE>if (collectionId != BR_NO_ID) {<NEW_LINE>viewDataBinding.setVariable(collectionId, data);<NEW_LINE>view.setTag(R.id.agera__rvdatabinding__collection_id, collectionId);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < handlers.size(); i++) {<NEW_LINE>final int variableId = handlers.keyAt(i);<NEW_LINE>viewDataBinding.setVariable(variableId, handlers.valueAt(i));<NEW_LINE>}<NEW_LINE>viewDataBinding.executePendingBindings();<NEW_LINE>} | itemVariable = itemId.apply(item); |
46,192 | private static String[] splitWorker(final String str, final char separatorChar, final boolean preserveAllTokens) {<NEW_LINE>// Performance tuned for 2.0 (JDK1.4)<NEW_LINE>if (str == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int len = str.length();<NEW_LINE>if (len == 0) {<NEW_LINE>return ArrayUtils.EMPTY_STRING_ARRAY;<NEW_LINE>}<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>int i = 0, start = 0;<NEW_LINE>boolean match = false;<NEW_LINE>boolean lastMatch = false;<NEW_LINE>while (i < len) {<NEW_LINE>if (str.charAt(i) == separatorChar) {<NEW_LINE>if (match || preserveAllTokens) {<NEW_LINE>list.add(str.substring(start, i));<NEW_LINE>match = false;<NEW_LINE>lastMatch = true;<NEW_LINE>}<NEW_LINE>start = ++i;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>lastMatch = false;<NEW_LINE>match = true;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (match || preserveAllTokens && lastMatch) {<NEW_LINE>list.add(str.substring(start, i));<NEW_LINE>}<NEW_LINE>return list.<MASK><NEW_LINE>} | toArray(new String[0]); |
1,829,886 | final AddThingToThingGroupResult executeAddThingToThingGroup(AddThingToThingGroupRequest addThingToThingGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addThingToThingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddThingToThingGroupRequest> request = null;<NEW_LINE>Response<AddThingToThingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddThingToThingGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addThingToThingGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddThingToThingGroup");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddThingToThingGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddThingToThingGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,425,374 | // For a normal container, initializeNoDependenceConfig must succeed<NEW_LINE>public void initializeNoDependenceConfig() throws Exception {<NEW_LINE>yarnConfig = new YarnConfiguration();<NEW_LINE>frameworkName = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_FRAMEWORK_NAME);<NEW_LINE>// frameworkVersion and amVersion for this AM is got from EnvironmentVariable,<NEW_LINE>// so it will not change across attempts.<NEW_LINE>// This can avoid multiple AM of one Framework running at the same time eventually,<NEW_LINE>// by comparing these versions with the corresponding ones on the ZK.<NEW_LINE>frameworkVersion = Integer.parseInt(CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_FRAMEWORK_VERSION));<NEW_LINE>zkConnectString = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_ZK_CONNECT_STRING);<NEW_LINE>zkRootDir = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_ZK_ROOT_DIR);<NEW_LINE>amVersion = Integer.parseInt(CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_AM_VERSION));<NEW_LINE>amRmHeartbeatIntervalSec = Integer.parseInt(CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_AM_RM_HEARTBEAT_INTERVAL_SEC));<NEW_LINE>amHostName = DnsUtils.getLocalHost();<NEW_LINE>amRpcPort = -1;<NEW_LINE>// Set a NotEmpty amTrackingUrl will override default (Proxied)TrackingUrl and OriginalTrackingUrl<NEW_LINE>// which point to RMWebAPP.<NEW_LINE>amTrackingUrl = "";<NEW_LINE>amUser = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_USER);<NEW_LINE>amLocalDirs = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_LOCAL_DIRS);<NEW_LINE>amLogDirs = CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_LOG_DIRS);<NEW_LINE>amContainerId = <MASK><NEW_LINE>} | CommonUtils.getEnvironmentVariable(GlobalConstants.ENV_VAR_CONTAINER_ID); |
1,287,160 | private boolean addBreaksToActivityMap() {<NEW_LINE>boolean hasBreaks = false;<NEW_LINE>Set<String> <MASK><NEW_LINE>for (Vehicle v : uniqueVehicles) {<NEW_LINE>if (v.getBreak() != null) {<NEW_LINE>if (!uniqueBreakIds.add(v.getBreak().getId()))<NEW_LINE>throw new IllegalArgumentException("The vehicle routing roblem already contains a vehicle break with id " + v.getBreak().getId() + ". Please choose unique ids for each vehicle break.");<NEW_LINE>hasBreaks = true;<NEW_LINE>List<AbstractActivity> breakActivities = jobActivityFactory.createActivities(v.getBreak());<NEW_LINE>if (breakActivities.isEmpty())<NEW_LINE>throw new IllegalArgumentException("At least one activity for break needs to be created by activityFactory.");<NEW_LINE>for (AbstractActivity act : breakActivities) {<NEW_LINE>act.setIndex(activityIndexCounter);<NEW_LINE>incActivityIndexCounter();<NEW_LINE>}<NEW_LINE>activityMap.put(v.getBreak(), breakActivities);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasBreaks;<NEW_LINE>} | uniqueBreakIds = new HashSet<>(); |
1,275,021 | private Method findSuperclassMethod(@DottedClassName String superclassName, Method subclassMethod) throws ClassNotFoundException {<NEW_LINE>String methodName = subclassMethod.getName();<NEW_LINE>Type[] subArgs = null;<NEW_LINE>JavaClass <MASK><NEW_LINE>Method[] methods = superClass.getMethods();<NEW_LINE>outer: for (Method m : methods) {<NEW_LINE>if (m.getName().equals(methodName)) {<NEW_LINE>if (subArgs == null) {<NEW_LINE>subArgs = Type.getArgumentTypes(subclassMethod.getSignature());<NEW_LINE>}<NEW_LINE>Type[] superArgs = Type.getArgumentTypes(m.getSignature());<NEW_LINE>if (subArgs.length == superArgs.length) {<NEW_LINE>for (int j = 0; j < subArgs.length; j++) {<NEW_LINE>if (!superArgs[j].equals(subArgs[j])) {<NEW_LINE>continue outer;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!"Object".equals(superclassName)) {<NEW_LINE>@DottedClassName<NEW_LINE>String superSuperClassName = superClass.getSuperclassName();<NEW_LINE>if (superSuperClassName.equals(superclassName)) {<NEW_LINE>throw new ClassNotFoundException("superclass of " + superclassName + " is itself");<NEW_LINE>}<NEW_LINE>return findSuperclassMethod(superSuperClassName, subclassMethod);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | superClass = Repository.lookupClass(superclassName); |
83,037 | void loadIncludesExcludes(IncludeExcludeVisualizer v) {<NEW_LINE>Set<File> roots = new HashSet<File>();<NEW_LINE>for (DefaultTableModel model : new DefaultTableModel[] { SOURCE_ROOTS_MODEL, TEST_ROOTS_MODEL }) {<NEW_LINE>for (Object row : model.getDataVector()) {<NEW_LINE>File d = (File) ((Vector) row).elementAt(0);<NEW_LINE>if (d.isDirectory()) {<NEW_LINE>roots.add(d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String webDocRoot = WEB_DOCBASE_DIR_MODEL.getText(0, WEB_DOCBASE_DIR_MODEL.getLength());<NEW_LINE>File d = project.getAntProjectHelper().resolveFile(webDocRoot);<NEW_LINE>if (d.isDirectory()) {<NEW_LINE>roots.add(d);<NEW_LINE>}<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>v.setRoots(roots.toArray(new File[<MASK><NEW_LINE>v.setIncludePattern(includes);<NEW_LINE>v.setExcludePattern(excludes);<NEW_LINE>} | roots.size()])); |
1,680,038 | private void pushBoundsToOuter() {<NEW_LINE>InferenceContext18 outer = this.outerContext;<NEW_LINE>if (outer != null && outer.stepCompleted >= APPLICABILITY_INFERRED) {<NEW_LINE>// need to wait till after overload resolution?<NEW_LINE>boolean deferred = outer.currentInvocation instanceof Invocation;<NEW_LINE>BoundSet toPush = deferred ? this.currentBounds<MASK><NEW_LINE>Runnable job = () -> {<NEW_LINE>if (outer.directlyAcceptingInnerBounds) {<NEW_LINE>outer.currentBounds.addBounds(toPush, this.environment);<NEW_LINE>} else if (outer.innerInbox == null) {<NEW_LINE>// copy now, unless already copied on behalf of 'deferred'<NEW_LINE>outer.innerInbox = deferred ? toPush : toPush.copy();<NEW_LINE>} else {<NEW_LINE>outer.innerInbox.addBounds(toPush, this.environment);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (deferred) {<NEW_LINE>this.pushToOuterJob = job;<NEW_LINE>} else {<NEW_LINE>// TODO(stephan): ever reached? for ReferenceExpression? (would need a corresponding new call to flushBoundOutbox()).<NEW_LINE>job.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .copy() : this.currentBounds; |
1,232,893 | private void openGooglePlayPage(String packageName) throws android.content.ActivityNotFoundException {<NEW_LINE>String pName = packageName.equals("com.android.webview") ? "com.google.android.webview" : packageName;<NEW_LINE>try {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW, Uri<MASK><NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>startActivity(intent);<NEW_LINE>} catch (android.content.ActivityNotFoundException e) {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + pName));<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOGTAG, "Cannot open Google Play. (" + e.getMessage() + ")");<NEW_LINE>}<NEW_LINE>} | .parse("market://details?id=" + pName)); |
168,315 | public static ListApiMsgRecordsResponse unmarshall(ListApiMsgRecordsResponse listApiMsgRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApiMsgRecordsResponse.setRequestId(_ctx.stringValue("ListApiMsgRecordsResponse.RequestId"));<NEW_LINE>listApiMsgRecordsResponse.setPageIndex<MASK><NEW_LINE>listApiMsgRecordsResponse.setSuccess(_ctx.booleanValue("ListApiMsgRecordsResponse.Success"));<NEW_LINE>listApiMsgRecordsResponse.setCnt(_ctx.longValue("ListApiMsgRecordsResponse.Cnt"));<NEW_LINE>listApiMsgRecordsResponse.setErrorMessage(_ctx.stringValue("ListApiMsgRecordsResponse.ErrorMessage"));<NEW_LINE>listApiMsgRecordsResponse.setPageSize(_ctx.integerValue("ListApiMsgRecordsResponse.PageSize"));<NEW_LINE>listApiMsgRecordsResponse.setErrorCode(_ctx.stringValue("ListApiMsgRecordsResponse.ErrorCode"));<NEW_LINE>List<ApiMsgSearchVO> data = new ArrayList<ApiMsgSearchVO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApiMsgRecordsResponse.Data.Length"); i++) {<NEW_LINE>ApiMsgSearchVO apiMsgSearchVO = new ApiMsgSearchVO();<NEW_LINE>apiMsgSearchVO.setMsg(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].Msg"));<NEW_LINE>apiMsgSearchVO.setUid(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].Uid"));<NEW_LINE>apiMsgSearchVO.setWriteTime(_ctx.longValue("ListApiMsgRecordsResponse.Data[" + i + "].WriteTime"));<NEW_LINE>apiMsgSearchVO.setMsgId(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].MsgId"));<NEW_LINE>apiMsgSearchVO.setState(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].State"));<NEW_LINE>apiMsgSearchVO.setType(_ctx.integerValue("ListApiMsgRecordsResponse.Data[" + i + "].Type"));<NEW_LINE>data.add(apiMsgSearchVO);<NEW_LINE>}<NEW_LINE>listApiMsgRecordsResponse.setData(data);<NEW_LINE>return listApiMsgRecordsResponse;<NEW_LINE>} | (_ctx.integerValue("ListApiMsgRecordsResponse.PageIndex")); |
1,539,879 | public boolean canHandle(TSSCompoundSecMechConfig requirement) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.debug(tc, "canHandle()");<NEW_LINE>Tr.debug(tc, " CSS SUPPORTS: " + ConfigUtil.flags(supports));<NEW_LINE>Tr.debug(tc, " CSS REQUIRES: " + ConfigUtil.flags(requires));<NEW_LINE>Tr.debug(tc, " TSS SUPPORTS: " + ConfigUtil.flags(requirement.getSupports()));<NEW_LINE>Tr.debug(tc, " TSS REQUIRES: " + ConfigUtil.flags<MASK><NEW_LINE>}<NEW_LINE>// If no sslRef is specified then go the path to pick up the outbound SSL default/filter match<NEW_LINE>if (transport_mech.getOutboundSSLReference()) {<NEW_LINE>return extractSSLTransportForEachAddress(requirement);<NEW_LINE>}<NEW_LINE>if ((supports & requirement.getRequires()) != requirement.getRequires()) {<NEW_LINE>buildSupportsFailedMsg(requirement);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if ((requires & requirement.getSupports()) != requires) {<NEW_LINE>buildRequiresFailedMsg(requirement);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!transport_mech.canHandle(requirement.getTransport_mech(), as_mech.getMechanism())) {<NEW_LINE>cantHandleMsg = transport_mech.getCantHandleMsg();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!as_mech.canHandle(requirement.getAs_mech())) {<NEW_LINE>buildAsFailedMsg(requirement);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!sas_mech.canHandle(requirement.getSas_mech(), as_mech.getMechanism())) {<NEW_LINE>cantHandleMsg = sas_mech.getCantHandleMsg();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (requirement.getRequires())); |
210,480 | public void onReceive(Context context, Intent intent) {<NEW_LINE>String action = intent.getAction();<NEW_LINE>if (ACTION_USB_PERMISSION.equals(action)) {<NEW_LINE>Log.d(TAG, "Requesting permission for USB device.");<NEW_LINE>synchronized (this) {<NEW_LINE>UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);<NEW_LINE>if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {<NEW_LINE>if (device != null && !usbDeviceManager.isRequested(device)) {<NEW_LINE>Log.d(TAG, "Permission granted for USB device: " + device);<NEW_LINE>int <MASK><NEW_LINE>spiceAttachUsbDeviceByFileDescriptor(fDesc);<NEW_LINE>usbDeviceManager.setPermission(device, true, fDesc);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "Permission denied for USB device: " + device);<NEW_LINE>if (device != null) {<NEW_LINE>usbDeviceManager.setPermission(device, false, -1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isInNormalProtocol) {<NEW_LINE>usbDeviceManager.getUsbDevicePermissions();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fDesc = usbDeviceManager.getFileDescriptorForUsbDevice(device); |
335,454 | public static SocketAddress parseServerSocketAddress(String value) {<NEW_LINE>if (value.startsWith(UNIX_DOMAIN_SOCKET_PREFIX)) {<NEW_LINE>DomainSocketAddress domainAddress = parseUnixSocketAddress(value);<NEW_LINE>File file = new File(domainAddress.path());<NEW_LINE>try {<NEW_LINE>if (file.createNewFile()) {<NEW_LINE>// If this application created the file, delete it when the application exits.<NEW_LINE>file.deleteOnExit();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return domainAddress;<NEW_LINE>} else {<NEW_LINE>// Standard TCP/IP address.<NEW_LINE>String[] parts = <MASK><NEW_LINE>if (parts.length < 2) {<NEW_LINE>throw new IllegalArgumentException("Address must be a unix:// path or be in the form host:port. Got: " + value);<NEW_LINE>}<NEW_LINE>String host = parts[0];<NEW_LINE>int port = Integer.parseInt(parts[1]);<NEW_LINE>return new InetSocketAddress(host, port);<NEW_LINE>}<NEW_LINE>} | value.split(":", 2); |
769,627 | private void writeEverything() {<NEW_LINE>acceptInTransaction(statement -> {<NEW_LINE>final Write dataWriteOperations = statement.dataWrite();<NEW_LINE>for (PrimitiveIntIterator it = iterable.iterator(); it.hasNext(); ) {<NEW_LINE>final int id = it.next();<NEW_LINE>// build int array<NEW_LINE>final int[] data = new int[allCommunities.length];<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>try {<NEW_LINE>data[i] <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataWriteOperations.nodeSetProperty(mapping.toOriginalNodeId(id), propertyId, Values.intValue(finalCommunities[id]));<NEW_LINE>dataWriteOperations.nodeSetProperty(mapping.toOriginalNodeId(id), intermediateCommunitiesPropertyId, Values.intArray(data));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = allCommunities[i][id]; |
1,827,227 | // Print CPPCODE method header.<NEW_LINE>private String generateCPPMethodheader(CppCodeProduction p) {<NEW_LINE>StringBuffer sig = new StringBuffer();<NEW_LINE>String ret, params;<NEW_LINE>Token t = null;<NEW_LINE>String method_name = p.getLhs();<NEW_LINE>boolean void_ret = false;<NEW_LINE>boolean ptr_ret = false;<NEW_LINE>// codeGenerator.printTokenSetup(t); ccol = 1;<NEW_LINE>// String comment1 = codeGenerator.getLeadingComments(t);<NEW_LINE>// cline = t.beginLine;<NEW_LINE>// ccol = t.beginColumn;<NEW_LINE>// sig.append(t.image);<NEW_LINE>// if (t.kind == JavaCCParserConstants.VOID) void_ret = true;<NEW_LINE>// if (t.kind == JavaCCParserConstants.STAR) ptr_ret = true;<NEW_LINE>for (int i = 0; i < p.getReturnTypeTokens().size(); i++) {<NEW_LINE>t = (Token) (p.getReturnTypeTokens().get(i));<NEW_LINE>String s = codeGenerator.getStringToPrint(t);<NEW_LINE>sig.append(t.toString());<NEW_LINE>sig.append(" ");<NEW_LINE>if (t.kind == JavaCCParserConstants.VOID)<NEW_LINE>void_ret = true;<NEW_LINE>if (t.kind == JavaCCParserConstants.STAR)<NEW_LINE>ptr_ret = true;<NEW_LINE>}<NEW_LINE>String comment2 = "";<NEW_LINE>if (t != null)<NEW_LINE>comment2 = codeGenerator.getTrailingComments(t);<NEW_LINE>ret = sig.toString();<NEW_LINE>sig.setLength(0);<NEW_LINE>sig.append("(");<NEW_LINE>if (p.getParameterListTokens().size() != 0) {<NEW_LINE>codeGenerator.printTokenSetup((Token) (p.getParameterListTokens().get(0)));<NEW_LINE>for (java.util.Iterator it = p.getParameterListTokens().iterator(); it.hasNext(); ) {<NEW_LINE>t = (Token) it.next();<NEW_LINE>sig.append<MASK><NEW_LINE>}<NEW_LINE>sig.append(codeGenerator.getTrailingComments(t));<NEW_LINE>}<NEW_LINE>sig.append(")");<NEW_LINE>params = sig.toString();<NEW_LINE>// For now, just ignore comments<NEW_LINE>codeGenerator.generateMethodDefHeader(ret, cu_name, p.getLhs() + params, sig.toString());<NEW_LINE>return "";<NEW_LINE>} | (codeGenerator.getStringToPrint(t)); |
532,494 | public void updateCodegenPropertyEnum(CodegenProperty var) {<NEW_LINE>Map<String, Object> allowableValues = var.allowableValues;<NEW_LINE>// handle array<NEW_LINE>if (var.mostInnerItems != null) {<NEW_LINE>allowableValues = var.mostInnerItems.allowableValues;<NEW_LINE>}<NEW_LINE>if (allowableValues == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Object> values = (List<Object>) allowableValues.get("values");<NEW_LINE>if (values == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType;<NEW_LINE>Optional<Schema> referencedSchema = ModelUtils.getSchemas(openAPI).entrySet().stream().filter(entry -> Objects.equals(varDataType, toModelName(entry.getKey()))).map(Map.Entry::getValue).findFirst();<NEW_LINE>String dataType = (referencedSchema.isPresent()) ? getTypeDeclaration(referencedSchema.get()) : varDataType;<NEW_LINE>List<Map<String, Object>> enumVars = buildEnumVars(values, dataType);<NEW_LINE>// if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames<NEW_LINE>Map<String, Object> extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions<MASK><NEW_LINE>if (referencedSchema.isPresent()) {<NEW_LINE>extensions = referencedSchema.get().getExtensions();<NEW_LINE>}<NEW_LINE>updateEnumVarsWithExtensions(enumVars, extensions, dataType);<NEW_LINE>allowableValues.put("enumVars", enumVars);<NEW_LINE>// handle default value for enum, e.g. available => StatusEnum.AVAILABLE<NEW_LINE>if (var.defaultValue != null) {<NEW_LINE>final String enumDefaultValue = getEnumDefaultValue(var.defaultValue, dataType);<NEW_LINE>String enumName = null;<NEW_LINE>for (Map<String, Object> enumVar : enumVars) {<NEW_LINE>if (enumDefaultValue.equals(enumVar.get("value"))) {<NEW_LINE>enumName = (String) enumVar.get("name");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (enumName != null) {<NEW_LINE>var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | () : var.getVendorExtensions(); |
281,791 | public Object instantiateItem(ViewGroup container, int position) {<NEW_LINE>if (bound == null || bound.getBridges().size() <= position) {<NEW_LINE>Log.w(TAG, "Activity not bound when creating TerminalView.");<NEW_LINE>}<NEW_LINE>TerminalBridge bridge = bound.getBridges().get(position);<NEW_LINE>bridge.promptHelper.setHandler(promptHandler);<NEW_LINE>// inflate each terminal view<NEW_LINE>RelativeLayout view = (RelativeLayout) inflater.inflate(R.layout.item_terminal, container, false);<NEW_LINE>// set the terminal name overlay text<NEW_LINE>TextView terminalNameOverlay = view.<MASK><NEW_LINE>terminalNameOverlay.setText(bridge.host.getNickname());<NEW_LINE>// and add our terminal view control, using index to place behind overlay<NEW_LINE>final TerminalView terminal = new TerminalView(container.getContext(), bridge, pager);<NEW_LINE>terminal.setId(R.id.terminal_view);<NEW_LINE>view.addView(terminal, 0);<NEW_LINE>// Tag the view with its bridge so it can be retrieved later.<NEW_LINE>view.setTag(bridge);<NEW_LINE>container.addView(view);<NEW_LINE>terminalNameOverlay.startAnimation(fade_out_delayed);<NEW_LINE>return view;<NEW_LINE>} | findViewById(R.id.terminal_name_overlay); |
283,845 | private void generate15Client(boolean isJsr109Platform, ProgressHandle handle) throws IOException {<NEW_LINE>// !PW Get client support from project (from first page of wizard)<NEW_LINE>JAXWSClientSupport jaxWsClientSupport = null;<NEW_LINE>if (project != null) {<NEW_LINE>jaxWsClientSupport = JAXWSClientSupport.getJaxWsClientSupport(project.getProjectDirectory());<NEW_LINE>}<NEW_LINE>if (jaxWsClientSupport == null) {<NEW_LINE>// notify no client support<NEW_LINE>// String mes = MessageFormat.format (<NEW_LINE>// NbBundle.getMessage (WebServiceClientWizardIterator.class, "ERR_WebServiceClientSupportNotFound"),<NEW_LINE>// new Object [] {"Servlet Listener"}); //NOI18N<NEW_LINE>// NOI18N<NEW_LINE>String mes = NbBundle.getMessage(WebServiceClientWizardIterator.class, "ERR_NoWebServiceClientSupport");<NEW_LINE>NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(desc);<NEW_LINE>handle.finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String wsdlUrl = (String) wiz.getProperty(ClientWizardProperties.WSDL_DOWNLOAD_URL);<NEW_LINE>String filePath = (String) wiz.getProperty(ClientWizardProperties.WSDL_FILE_PATH);<NEW_LINE>Boolean useDispatch = (Boolean) wiz.getProperty(ClientWizardProperties.USEDISPATCH);<NEW_LINE>// if (wsdlUrl==null) wsdlUrl = "file:"+(filePath.startsWith("/")?filePath:"/"+filePath); //NOI18N<NEW_LINE>if (wsdlUrl == null) {<NEW_LINE>wsdlUrl = FileUtil.toFileObject(FileUtil.normalizeFile(new File(filePath))).toURL().toExternalForm();<NEW_LINE>}<NEW_LINE>String packageName = (String) wiz.getProperty(ClientWizardProperties.WSDL_PACKAGE_NAME);<NEW_LINE>if (packageName != null && packageName.length() == 0)<NEW_LINE>packageName = null;<NEW_LINE>String clientName = jaxWsClientSupport.addServiceClient(getWsdlName(wsdlUrl<MASK><NEW_LINE>if (useDispatch) {<NEW_LINE>List clients = jaxWsClientSupport.getServiceClients();<NEW_LINE>for (Object c : clients) {<NEW_LINE>if (((Client) c).getName().equals(clientName)) {<NEW_LINE>((Client) c).setUseDispatch(useDispatch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JaxWsModel jaxWsModel = (JaxWsModel) project.getLookup().lookup(JaxWsModel.class);<NEW_LINE>jaxWsModel.write();<NEW_LINE>}<NEW_LINE>handle.finish();<NEW_LINE>} | ), wsdlUrl, packageName, isJsr109Platform); |
629,931 | public void run() {<NEW_LINE>Bitmap resizedBitmap = null;<NEW_LINE>if (bitmap.getWidth() % 2 == 1) {<NEW_LINE>resizedBitmap = Bitmap.createBitmap(bitmap.getWidth() + 1, bitmap.getHeight(), Bitmap.Config.ARGB_8888);<NEW_LINE>resizedBitmap.<MASK><NEW_LINE>Canvas can = new Canvas(resizedBitmap);<NEW_LINE>can.drawARGB(0x00, 0x00, 0x00, 0x00);<NEW_LINE>can.drawBitmap(bitmap, 0, 0, null);<NEW_LINE>addedPadding = 1;<NEW_LINE>} else {<NEW_LINE>addedPadding = 0;<NEW_LINE>}<NEW_LINE>glTextureId = OpenGlUtils.loadTexture(resizedBitmap != null ? resizedBitmap : bitmap, glTextureId, recycle);<NEW_LINE>if (resizedBitmap != null) {<NEW_LINE>resizedBitmap.recycle();<NEW_LINE>}<NEW_LINE>imageWidth = bitmap.getWidth();<NEW_LINE>imageHeight = bitmap.getHeight();<NEW_LINE>adjustImageScaling();<NEW_LINE>} | setDensity(bitmap.getDensity()); |
972,300 | public void processMessage(PeerConnection peer, TronMessage msg) throws P2pException {<NEW_LINE>ChainInventoryMessage chainInventoryMessage = (ChainInventoryMessage) msg;<NEW_LINE>check(peer, chainInventoryMessage);<NEW_LINE>peer.setNeedSyncFromPeer(true);<NEW_LINE>peer.setSyncChainRequested(null);<NEW_LINE>Deque<BlockId> blockIdWeGet = new LinkedList<>(chainInventoryMessage.getBlockIds());<NEW_LINE>if (blockIdWeGet.size() == 1 && tronNetDelegate.containBlock(blockIdWeGet.peek())) {<NEW_LINE>peer.setNeedSyncFromPeer(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>while (!peer.getSyncBlockToFetch().isEmpty()) {<NEW_LINE>if (peer.getSyncBlockToFetch().peekLast().equals(blockIdWeGet.peekFirst())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>peer.getSyncBlockToFetch().pollLast();<NEW_LINE>}<NEW_LINE>blockIdWeGet.poll();<NEW_LINE>peer.setRemainNum(chainInventoryMessage.getRemainNum());<NEW_LINE>peer.<MASK><NEW_LINE>synchronized (tronNetDelegate.getBlockLock()) {<NEW_LINE>while (!peer.getSyncBlockToFetch().isEmpty() && tronNetDelegate.containBlock(peer.getSyncBlockToFetch().peek())) {<NEW_LINE>BlockId blockId = peer.getSyncBlockToFetch().pop();<NEW_LINE>peer.setBlockBothHave(blockId);<NEW_LINE>logger.info("Block {} from {} is processed", blockId.getString(), peer.getNode().getHost());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((chainInventoryMessage.getRemainNum() == 0 && !peer.getSyncBlockToFetch().isEmpty()) || (chainInventoryMessage.getRemainNum() != 0 && peer.getSyncBlockToFetch().size() > NetConstants.SYNC_FETCH_BATCH_NUM)) {<NEW_LINE>syncService.setFetchFlag(true);<NEW_LINE>} else {<NEW_LINE>syncService.syncNext(peer);<NEW_LINE>}<NEW_LINE>} | getSyncBlockToFetch().addAll(blockIdWeGet); |
897,409 | public RowChange buildPartial() {<NEW_LINE>RowChange result = new RowChange(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.tableId_ = tableId_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.eventType_ = eventType_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.isDdl_ = isDdl_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.sql_ = sql_;<NEW_LINE>if (rowDatasBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>rowDatas_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.rowDatas_ = rowDatas_;<NEW_LINE>} else {<NEW_LINE>result.rowDatas_ = rowDatasBuilder_.build();<NEW_LINE>}<NEW_LINE>if (propsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>props_ = java.util.Collections.unmodifiableList(props_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.props_ = props_;<NEW_LINE>} else {<NEW_LINE>result.props_ = propsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.ddlSchemaName_ = ddlSchemaName_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | util.Collections.unmodifiableList(rowDatas_); |
533,757 | public void executeUpgrade() throws DotDataException, DotRuntimeException {<NEW_LINE>// Run upgrade as usual<NEW_LINE>super.executeUpgrade();<NEW_LINE>// For Oracle the Alter (DDL) needs to be executed on a different connection<NEW_LINE>Connection conn = null;<NEW_LINE>try {<NEW_LINE>if (DbConnectionFactory.isOracle()) {<NEW_LINE>conn = DbConnectionFactory.getDataSource().getConnection();<NEW_LINE>conn.setAutoCommit(true);<NEW_LINE>Logger.info(this, "Executing: " + ORACLE_ADD_UNIQUE_CONSTRAINT);<NEW_LINE><MASK><NEW_LINE>db.setSQL(ORACLE_ADD_UNIQUE_CONSTRAINT);<NEW_LINE>db.loadResult(conn);<NEW_LINE>Logger.info(this, "Finished Executing: " + ORACLE_ADD_UNIQUE_CONSTRAINT);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotDataException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (conn != null) {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DotDataException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final DotConnect db = new DotConnect(); |
11,312 | public com.amazonaws.services.backupgateway.model.InternalServerException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.backupgateway.model.InternalServerException internalServerException = new com.amazonaws.services.backupgateway.model.InternalServerException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ErrorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>internalServerException.setErrorCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return internalServerException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
660,357 | public static long[] decimalToULong(DecimalStructure from) {<NEW_LINE>int bufPos = 0;<NEW_LINE>long x = 0;<NEW_LINE>int intg, frac;<NEW_LINE>long to;<NEW_LINE>if (from.isNeg()) {<NEW_LINE>return new long[] { 0L, E_DEC_OVERFLOW };<NEW_LINE>}<NEW_LINE>for (intg = from.getIntegers(); intg > 0; intg -= DIG_PER_DEC1) {<NEW_LINE>long y = x;<NEW_LINE>x = x * DIG_BASE + from.getBuffValAt(bufPos++);<NEW_LINE>if (UnsignedLongs.compare(y, MAX_UNSIGNED_LONG_DIV_DIG_BASE) > 0 || UnsignedLongs.compare(x, y) < 0) {<NEW_LINE>return new long[] { UNSIGNED_MAX_LONG, E_DEC_OVERFLOW };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>to = x;<NEW_LINE>for (frac = from.getFractions(); frac > 0; frac -= DIG_PER_DEC1) {<NEW_LINE>if (from.getBuffValAt(bufPos++) != 0) {<NEW_LINE>return new long[] { to, E_DEC_TRUNCATED };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} | long[] { to, E_DEC_OK }; |
282,998 | public Request<AttachThingPrincipalRequest> marshall(AttachThingPrincipalRequest attachThingPrincipalRequest) {<NEW_LINE>if (attachThingPrincipalRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(AttachThingPrincipalRequest)");<NEW_LINE>}<NEW_LINE>Request<AttachThingPrincipalRequest> request = new DefaultRequest<AttachThingPrincipalRequest>(attachThingPrincipalRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>if (attachThingPrincipalRequest.getPrincipal() != null) {<NEW_LINE>request.addHeader("x-amzn-principal", StringUtils.fromString(attachThingPrincipalRequest.getPrincipal()));<NEW_LINE>}<NEW_LINE>String uriResourcePath = "/things/{thingName}/principals";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{thingName}", (attachThingPrincipalRequest.getThingName() == null) ? "" : StringUtils.fromString<MASK><NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>request.addHeader("Content-Length", "0");<NEW_LINE>request.setContent(new ByteArrayInputStream(new byte[0]));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (attachThingPrincipalRequest.getThingName())); |
1,269,134 | public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {<NEW_LINE>FlowableEntityWithVariablesEvent eventWithVariables = (FlowableEntityWithVariablesEvent) event;<NEW_LINE>ExecutionEntity processInstanceEntity = (ExecutionEntity) eventWithVariables.getEntity();<NEW_LINE>Map<String, Object> data = new HashMap<>();<NEW_LINE>putInMapIfNotNull(data, Fields.ID, processInstanceEntity.getId());<NEW_LINE>putInMapIfNotNull(data, Fields.BUSINESS_KEY, processInstanceEntity.getBusinessKey());<NEW_LINE>putInMapIfNotNull(data, Fields.PROCESS_DEFINITION_ID, processInstanceEntity.getProcessDefinitionId());<NEW_LINE>putInMapIfNotNull(data, Fields.<MASK><NEW_LINE>putInMapIfNotNull(data, Fields.CREATE_TIME, timeStamp);<NEW_LINE>if (eventWithVariables.getVariables() != null && !eventWithVariables.getVariables().isEmpty()) {<NEW_LINE>Map<String, Object> variableMap = new HashMap<>();<NEW_LINE>for (Object variableName : eventWithVariables.getVariables().keySet()) {<NEW_LINE>putInMapIfNotNull(variableMap, (String) variableName, eventWithVariables.getVariables().get(variableName));<NEW_LINE>}<NEW_LINE>putInMapIfNotNull(data, Fields.VARIABLES, variableMap);<NEW_LINE>}<NEW_LINE>return createEventLogEntry(TYPE, processInstanceEntity.getProcessDefinitionId(), processInstanceEntity.getId(), null, null, data);<NEW_LINE>} | NAME, processInstanceEntity.getName()); |
837,798 | public PushBuilder newPushBuilder() {<NEW_LINE>String methodName = "newPushBuilder";<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.entering(<MASK><NEW_LINE>}<NEW_LINE>IRequest40 iRequest = (IRequest40) getIRequest();<NEW_LINE>if (!((Http2Request) iRequest.getHttpRequest()).isPushSupported()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.logp(Level.FINE, CLASS_NAME, methodName, "push not supported");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String sessionID = null;<NEW_LINE>if (_sessionCreated)<NEW_LINE>sessionID = getSession(false).getId();<NEW_LINE>else<NEW_LINE>sessionID = getRequestedSessionId();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.logp(Level.FINE, CLASS_NAME, methodName, "sessionId = " + sessionID);<NEW_LINE>}<NEW_LINE>SRTServletResponse40 response = (SRTServletResponse40) this._connContext.getResponse();<NEW_LINE>PushBuilder pb = new HttpPushBuilder(this, sessionID, getPushBuilderHeaders(), response.getAddedCookies());<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.exiting(CLASS_NAME, methodName);<NEW_LINE>}<NEW_LINE>return pb;<NEW_LINE>} | CLASS_NAME, methodName, "this -> " + this); |
1,699,486 | private static void testEquals() {<NEW_LINE>// equals<NEW_LINE>assertTrue(B.equals(B));<NEW_LINE>assertTrue(B.equals(new Byte((byte) 1)));<NEW_LINE>assertTrue(D.equals(D));<NEW_LINE>assertTrue(D.equals(new Double(1.0)));<NEW_LINE>assertTrue(F.equals(F));<NEW_LINE>assertTrue(F.equals(new Float(1.0f)));<NEW_LINE>assertTrue(I.equals(I));<NEW_LINE>assertTrue(I.equals(new Integer(1)));<NEW_LINE>assertTrue(L.equals(L));<NEW_LINE>assertTrue(L.equals(new Long(1L)));<NEW_LINE>assertTrue(S.equals(S));<NEW_LINE>assertTrue(S.equals(new Short((short) 1)));<NEW_LINE>assertFalse(L.equals(I));<NEW_LINE>assertFalse(B.equals(D));<NEW_LINE>assertFalse(B.equals(F));<NEW_LINE>assertFalse(B.equals(I));<NEW_LINE>assertFalse(B.equals(L));<NEW_LINE>assertFalse(B.equals(S));<NEW_LINE>assertFalse(D.equals(B));<NEW_LINE>assertFalse(D.equals(F));<NEW_LINE>assertFalse(D.equals(I));<NEW_LINE>assertFalse(D.equals(L));<NEW_LINE>assertFalse(D.equals(S));<NEW_LINE>assertTrue(C.equals(C));<NEW_LINE>assertTrue(C.equals(new Character('a')));<NEW_LINE>assertFalse(C.equals(new Character('b')));<NEW_LINE>assertTrue(BOOL.equals(BOOL));<NEW_LINE>assertTrue(BOOL.equals<MASK><NEW_LINE>assertFalse(BOOL.equals(new Boolean(false)));<NEW_LINE>} | (new Boolean(true))); |
919,586 | public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {<NEW_LINE>int side = faces[face.getIndex()];<NEW_LINE>int bid = this.getSide(BlockFace.fromIndex(faces2[<MASK><NEW_LINE>if ((!target.isTransparent() || bid == GLASS || bid == STAINED_GLASS) && face != BlockFace.DOWN) {<NEW_LINE>this.setDamage(side);<NEW_LINE>this.getLevel().setBlock(block, this, true, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Block below = this.down();<NEW_LINE>if (!below.isTransparent() || below instanceof BlockFence || below.getId() == COBBLE_WALL || below.getId() == GLASS || below.getId() == STAINED_GLASS) {<NEW_LINE>this.setDamage(0);<NEW_LINE>this.getLevel().setBlock(block, this, true, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | side])).getId(); |
1,500,782 | public io.kubernetes.client.proto.V1.PersistentVolumeClaimTemplate buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1.PersistentVolumeClaimTemplate result = new io.kubernetes.client.proto.V1.PersistentVolumeClaimTemplate(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result.metadata_ = metadataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>if (specBuilder_ == null) {<NEW_LINE>result.spec_ = spec_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .spec_ = specBuilder_.build(); |
1,466,989 | public void register(SettingsRegistry.SettingKey<?> key) {<NEW_LINE>Object value;<NEW_LINE>if (configuration != null) {<NEW_LINE>if (key.getDefault() instanceof Boolean) {<NEW_LINE>value = configuration.get(key.getCategory(), key.getKey(), (Boolean) key.getDefault()).getBoolean();<NEW_LINE>} else if (key.getDefault() instanceof Integer) {<NEW_LINE>value = configuration.get(key.getCategory(), key.getKey(), (Integer) key.getDefault()).getInt();<NEW_LINE>} else if (key.getDefault() instanceof Double) {<NEW_LINE>value = configuration.get(key.getCategory(), key.getKey(), (Double) key.<MASK><NEW_LINE>} else if (key.getDefault() instanceof String) {<NEW_LINE>Property property = configuration.get(key.getCategory(), key.getKey(), (String) key.getDefault());<NEW_LINE>value = property.getString();<NEW_LINE>if (key instanceof SettingsRegistry.MultipleChoiceSettingKey) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<String> choices = ((SettingsRegistry.MultipleChoiceSettingKey<String>) key).getChoices();<NEW_LINE>property.setValidValues(choices.toArray(new String[0]));<NEW_LINE>property.setComment("Valid values: " + String.join(", ", choices));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Default type " + key.getDefault().getClass() + " not supported.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>value = NULL_OBJECT;<NEW_LINE>}<NEW_LINE>settings.put(key, value);<NEW_LINE>} | getDefault()).getDouble(); |
542,503 | private Mono<Tuple2<Message<Object>, RequestEntity<?>>> buildMessage(RequestEntity<?> httpEntity, ServerWebExchange exchange) {<NEW_LINE>ServerHttpRequest request = exchange.getRequest();<NEW_LINE>MultiValueMap<String, String> requestParams = request.getQueryParams();<NEW_LINE>EvaluationContext <MASK><NEW_LINE>Object payload;<NEW_LINE>if (getPayloadExpression() != null) {<NEW_LINE>payload = getPayloadExpression().getValue(evaluationContext);<NEW_LINE>} else {<NEW_LINE>payload = httpEntity.getBody();<NEW_LINE>}<NEW_LINE>Map<String, Object> headers = getHeaderMapper().toHeaders(request.getHeaders());<NEW_LINE>if (!CollectionUtils.isEmpty(getHeaderExpressions())) {<NEW_LINE>headers.putAll(ExpressionEvalMap.from(getHeaderExpressions()).usingEvaluationContext(evaluationContext).withRoot(httpEntity).build());<NEW_LINE>}<NEW_LINE>if (payload == null) {<NEW_LINE>payload = requestParams;<NEW_LINE>}<NEW_LINE>AbstractIntegrationMessageBuilder<Object> messageBuilder = prepareRequestMessageBuilder(request, payload, headers);<NEW_LINE>return exchange.getPrincipal().map(principal -> messageBuilder.setHeader(HttpHeaders.USER_PRINCIPAL, principal)).defaultIfEmpty(messageBuilder).map(AbstractIntegrationMessageBuilder::build).zipWith(Mono.just(httpEntity));<NEW_LINE>} | evaluationContext = buildEvaluationContext(httpEntity, exchange); |
996,455 | public static void initBuiltins(FunctionSet functionSet) {<NEW_LINE>for (Type t : Type.getNumericTypes()) {<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.MULTIPLY.getName(), Lists.newArrayList(t, t), t));<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.ADD.getName(), Lists.newArrayList(t, t), t));<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.SUBTRACT.getName(), Lists.newArrayList(t, t), t));<NEW_LINE>}<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.DIVIDE.getName(), Lists.<Type>newArrayList(Type.DOUBLE, Type.DOUBLE), Type.DOUBLE));<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.DIVIDE.getName(), Lists.<Type>newArrayList(Type.DECIMALV2, Type.<MASK><NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.DIVIDE.getName(), Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL32), Type.DECIMAL32));<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.DIVIDE.getName(), Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL64), Type.DECIMAL64));<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.DIVIDE.getName(), Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL128), Type.DECIMAL128));<NEW_LINE>// MOD(), FACTORIAL(), BITAND(), BITOR(), BITXOR(), and BITNOT() are registered as<NEW_LINE>// builtins, see starrocks_functions.py<NEW_LINE>for (Type t : Type.getIntegerTypes()) {<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.INT_DIVIDE.getName(), Lists.newArrayList(t, t), t));<NEW_LINE>}<NEW_LINE>for (Type t : Arrays.asList(Type.DECIMAL32, Type.DECIMAL64, Type.DECIMAL128)) {<NEW_LINE>functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(Operator.INT_DIVIDE.getName(), Lists.newArrayList(t, t), Type.BIGINT));<NEW_LINE>}<NEW_LINE>} | DECIMALV2), Type.DECIMALV2)); |
1,147,426 | public List<List<String>> groupAnagrams(String[] strs) {<NEW_LINE>if (strs == null || strs.length == 0)<NEW_LINE>return new ArrayList<List<String>>();<NEW_LINE>int listIndex = 0;<NEW_LINE>List<List<String>> result = new ArrayList<>();<NEW_LINE>Map<String, Integer> anagramGroup = new HashMap<>();<NEW_LINE>for (String str : strs) {<NEW_LINE>char[<MASK><NEW_LINE>Arrays.sort(chars);<NEW_LINE>String sorted = new String(chars);<NEW_LINE>if (anagramGroup.containsKey(sorted)) {<NEW_LINE>int index = anagramGroup.get(sorted);<NEW_LINE>List<String> listResult = result.get(index);<NEW_LINE>listResult.add(str);<NEW_LINE>} else {<NEW_LINE>List<String> resultList = new ArrayList<>();<NEW_LINE>resultList.add(str);<NEW_LINE>result.add(listIndex, resultList);<NEW_LINE>anagramGroup.put(sorted, listIndex);<NEW_LINE>listIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ] chars = str.toCharArray(); |
430,868 | public void processLinkageTable(String pltName, Address minAddress, Address maxAddress, TaskMonitor monitor) throws CancelledException {<NEW_LINE>try {<NEW_LINE>// Disassemble section.<NEW_LINE>// Disassembly is only done so we can see all instructions since many<NEW_LINE>// of them are unreachable after applying relocations<NEW_LINE>disassemble(minAddress, maxAddress, program, monitor);<NEW_LINE>// Any symbols in the linkage section should be converted to External function thunks<NEW_LINE>// This can be seen with ARM Android examples.<NEW_LINE>int <MASK><NEW_LINE>if (count > 0) {<NEW_LINE>log("Converted " + count + " " + pltName + " section symbols to external thunks");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = "Failed to process " + pltName + " at " + minAddress + ": " + e.getMessage();<NEW_LINE>log(msg);<NEW_LINE>Msg.error(this, msg, e);<NEW_LINE>}<NEW_LINE>} | count = convertSymbolsToExternalFunctions(minAddress, maxAddress); |
698,803 | private void fetchRequests(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) {<NEW_LINE>Iterator<ReplicaId> replicaIterator = operationTracker.getReplicaIterator();<NEW_LINE>while (replicaIterator.hasNext()) {<NEW_LINE>ReplicaId replicaId = replicaIterator.next();<NEW_LINE>String hostname = replicaId.getDataNodeId().getHostname();<NEW_LINE>Port port = RouterUtils.getPortToConnectTo(replicaId, routerConfig.routerEnableHttp2NetworkClient);<NEW_LINE>GetRequest getRequest = createGetRequest(blobId, getOperationFlag(), options.getBlobOptions.getGetOption());<NEW_LINE>RequestInfo request = new RequestInfo(hostname, port, getRequest, replicaId, operationQuotaCharger);<NEW_LINE>int correlationId = getRequest.getCorrelationId();<NEW_LINE>correlationIdToGetRequestInfo.put(correlationId, new GetRequestInfo(replicaId, time.milliseconds()));<NEW_LINE>requestRegistrationCallback.registerRequestToSend(this, request);<NEW_LINE>replicaIterator.remove();<NEW_LINE>if (RouterUtils.isRemoteReplica(routerConfig, replicaId)) {<NEW_LINE>logger.trace("Making request with correlationId {} to a remote replica {} in {} ", correlationId, replicaId.getDataNodeId(), replicaId.<MASK><NEW_LINE>routerMetrics.crossColoRequestCount.inc();<NEW_LINE>} else {<NEW_LINE>logger.trace("Making request with correlationId {} to a local replica {} ", correlationId, replicaId.getDataNodeId());<NEW_LINE>}<NEW_LINE>routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getBlobInfoRequestRate.mark();<NEW_LINE>}<NEW_LINE>} | getDataNodeId().getDatacenterName()); |
914,549 | public void propertyChange(final PropertyChangeEvent pEvent) {<NEW_LINE>assert pEvent != null;<NEW_LINE><MASK><NEW_LINE>// Get last revision number from TT-storage.<NEW_LINE>final JFileChooser fileChooser = (JFileChooser) pEvent.getSource();<NEW_LINE>final File tmpDir = fileChooser.getSelectedFile();<NEW_LINE>long revNumber = 0;<NEW_LINE>if (tmpDir != null) {<NEW_LINE>// Remove items first.<NEW_LINE>cb.removeActionListener(mActionListener);<NEW_LINE>cb.removeAllItems();<NEW_LINE>// A directory is in focus.<NEW_LINE>boolean error = false;<NEW_LINE>try {<NEW_LINE>final Database db = Databases.openDatabase(tmpDir);<NEW_LINE>final NodeReadTrx rtx = db.getSession(new org.sirix.access.conf.SessionConfiguration.Builder("shredded").build()).beginNodeReadTrx();<NEW_LINE>revNumber = rtx.getRevisionNumber();<NEW_LINE>rtx.close();<NEW_LINE>} catch (final SirixException e) {<NEW_LINE>// Selected directory is not a sirix storage.<NEW_LINE>error = true;<NEW_LINE>}<NEW_LINE>if (!error) {<NEW_LINE>// Create items, which are used as available revisions.<NEW_LINE>for (int i = 0; i <= revNumber; i++) {<NEW_LINE>cb.addItem(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cb.addActionListener(mActionListener);<NEW_LINE>}<NEW_LINE>} | assert pEvent.getSource() instanceof JFileChooser; |
937,347 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String modelFlag, String workId) throws Exception {<NEW_LINE>logger.debug(effectivePerson, "modelFlag:{}, workId:{}.", modelFlag, workId);<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Model model = emc.flag(modelFlag, Model.class);<NEW_LINE>if (null == model) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Work work = emc.flag(workId, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>List<Wo> wos = ThisApplication.context().applications().getQuery(x_query_service_processing.class, Applications.joinQueryUri("neural", "list", "calculate", "model", model.getId(), "work", work.getId())).getDataAsList(Wo.class);<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | ExceptionEntityNotExist(modelFlag, Model.class); |
1,804,218 | final CreateModelResult executeCreateModel(CreateModelRequest createModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateModelRequest> request = null;<NEW_LINE>Response<CreateModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createModelRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "LookoutVision");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateModelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateModelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateModel"); |
1,694,356 | public void displayAvailableTrackingNumber(ActionRequest request, ActionResponse response) {<NEW_LINE>Context context = request.getContext();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>LinkedHashMap<String, Object> stockMoveLineMap = (LinkedHashMap<String, Object>) context.get("_stockMoveLine");<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>LinkedHashMap<String, Object> stockMoveMap = (LinkedHashMap<String, Object>) context.get("_stockMove");<NEW_LINE>Integer stockMoveLineId = (Integer) stockMoveLineMap.get("id");<NEW_LINE>Integer stockMoveId = (Integer) stockMoveMap.get("id");<NEW_LINE>StockMoveLine stockMoveLine = Beans.get(StockMoveLineRepository.class).find(new Long(stockMoveLineId));<NEW_LINE>StockMove stockMove = Beans.get(StockMoveRepository.class).find(new Long(stockMoveId));<NEW_LINE>if (stockMoveLine == null || stockMoveLine.getProduct() == null || stockMove == null || stockMove.getFromStockLocation() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<TrackingNumber> trackingNumberList = Beans.get(StockMoveLineService.class).getAvailableTrackingNumbers(stockMoveLine, stockMove);<NEW_LINE>if (trackingNumberList == null || trackingNumberList.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SortedSet<Map<String, Object>> trackingNumbers = new TreeSet<Map<String, Object>>(Comparator.comparing(m -> (String) m.get("trackingNumberSeq")));<NEW_LINE>StockLocationLineService stockLocationLineService = Beans.get(StockLocationLineService.class);<NEW_LINE>for (TrackingNumber trackingNumber : trackingNumberList) {<NEW_LINE>StockLocationLine detailStockLocationLine = stockLocationLineService.getDetailLocationLine(stockMove.getFromStockLocation(), <MASK><NEW_LINE>BigDecimal availableQty = detailStockLocationLine != null ? detailStockLocationLine.getCurrentQty() : BigDecimal.ZERO;<NEW_LINE>Map<String, Object> map = new HashMap<String, Object>();<NEW_LINE>map.put("trackingNumber", trackingNumber);<NEW_LINE>map.put("trackingNumberSeq", trackingNumber.getTrackingNumberSeq());<NEW_LINE>map.put("counter", BigDecimal.ZERO);<NEW_LINE>map.put("warrantyExpirationDate", trackingNumber.getWarrantyExpirationDate());<NEW_LINE>map.put("perishableExpirationDate", trackingNumber.getPerishableExpirationDate());<NEW_LINE>map.put("$availableQty", availableQty);<NEW_LINE>map.put("$moveTypeSelect", stockMove.getTypeSelect());<NEW_LINE>map.put("origin", trackingNumber.getOrigin());<NEW_LINE>map.put("note", trackingNumber.getNote());<NEW_LINE>trackingNumbers.add(map);<NEW_LINE>}<NEW_LINE>response.setValue("$trackingNumbers", trackingNumbers);<NEW_LINE>} | stockMoveLine.getProduct(), trackingNumber); |
557,953 | public void prompt(final String hostname, final List<X509Certificate> certificates) throws ConnectionCanceledException {<NEW_LINE>final SecPolicyRef policyRef = SecurityFunctions.library.SecPolicyCreateSSL(true, hostname);<NEW_LINE>final PointerByReference reference = new PointerByReference();<NEW_LINE>SecurityFunctions.library.SecTrustCreateWithCertificates(KeychainCertificateStore.toDEREncodedCertificates(certificates), policyRef, reference);<NEW_LINE>final SecTrustRef trustRef = new <MASK><NEW_LINE>final AtomicReference<SFCertificateTrustPanel> ref = new AtomicReference<>();<NEW_LINE>controller.invoke(new DefaultMainAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>ref.set(SFCertificateTrustPanel.sharedCertificateTrustPanel());<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>final SFCertificateTrustPanel panel = ref.get();<NEW_LINE>panel.setInformativeText(null);<NEW_LINE>panel.setAlternateButtonTitle(LocaleFactory.localizedString("Disconnect"));<NEW_LINE>panel.setPolicies(policyRef);<NEW_LINE>panel.setShowsHelp(true);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Display trust panel for controller %s", controller));<NEW_LINE>}<NEW_LINE>final int option = this.prompt(panel, trustRef);<NEW_LINE>FoundationKitFunctions.library.CFRelease(trustRef);<NEW_LINE>FoundationKitFunctions.library.CFRelease(policyRef);<NEW_LINE>switch(option) {<NEW_LINE>case SheetCallback.DEFAULT_OPTION:<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>throw new ConnectionCanceledException();<NEW_LINE>}<NEW_LINE>} | SecTrustRef(reference.getValue()); |
342,658 | private AuthenticationStatus handleAuthorizationHeader(String authHeader, Subject clientSubject, HttpMessageContext httpMessageContext) throws AuthenticationException {<NEW_LINE>AuthenticationStatus status = AuthenticationStatus.SEND_FAILURE;<NEW_LINE>int rspStatus = HttpServletResponse.SC_FORBIDDEN;<NEW_LINE>// the format of CustomHAM is "userid:password"<NEW_LINE>String[] values = authHeader.split(":");<NEW_LINE>if (values.length == 2) {<NEW_LINE>UsernamePasswordCredential cred = new UsernamePasswordCredential(values[<MASK><NEW_LINE>CredentialValidationResult result = validateUserAndPassword(cred);<NEW_LINE>if (result.getStatus() == CredentialValidationResult.Status.VALID) {<NEW_LINE>setLoginHashtable(clientSubject, result);<NEW_LINE>httpMessageContext.getMessageInfo().getMap().put("javax.servlet.http.authType", "JASPI_AUTH");<NEW_LINE>rspStatus = HttpServletResponse.SC_OK;<NEW_LINE>status = AuthenticationStatus.SUCCESS;<NEW_LINE>} else if (result.getStatus() == CredentialValidationResult.Status.NOT_VALIDATED) {<NEW_LINE>status = AuthenticationStatus.NOT_DONE;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO: Determine if serviceability message is needed<NEW_LINE>}<NEW_LINE>httpMessageContext.getResponse().setStatus(rspStatus);<NEW_LINE>return status;<NEW_LINE>} | 0], values[1]); |
1,662,710 | protected void determineCoverageGoals(boolean updateArchive) {<NEW_LINE>List<BranchCoverageTestFitness> goals = new BranchCoverageFactory().getCoverageGoals();<NEW_LINE>for (BranchCoverageTestFitness goal : goals) {<NEW_LINE>// Skip instrumented branches - we only want real branches<NEW_LINE>if (goal.getBranch() != null) {<NEW_LINE>if (goal.getBranch().isInstrumented()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (updateArchive && Properties.TEST_ARCHIVE)<NEW_LINE>Archive.getArchiveInstance().addTarget(goal);<NEW_LINE>if (goal.getBranch() == null) {<NEW_LINE>branchlessMethodCoverageMap.put(goal.getClassName() + "." + <MASK><NEW_LINE>} else {<NEW_LINE>branchesId.add(goal.getBranch().getActualBranchId());<NEW_LINE>if (goal.getBranchExpressionValue())<NEW_LINE>branchCoverageTrueMap.put(goal.getBranch().getActualBranchId(), goal);<NEW_LINE>else<NEW_LINE>branchCoverageFalseMap.put(goal.getBranch().getActualBranchId(), goal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | goal.getMethod(), goal); |
1,492,970 | public static boolean isMeasureSpecCompatible(int oldSizeSpec, int sizeSpec, int oldMeasuredSize) {<NEW_LINE>final int newSpecMode = <MASK><NEW_LINE>final int newSpecSize = View.MeasureSpec.getSize(sizeSpec);<NEW_LINE>final int oldSpecMode = View.MeasureSpec.getMode(oldSizeSpec);<NEW_LINE>final int oldSpecSize = View.MeasureSpec.getSize(oldSizeSpec);<NEW_LINE>return oldSizeSpec == sizeSpec || (oldSpecMode == UNSPECIFIED && newSpecMode == UNSPECIFIED) || newSizeIsExactAndMatchesOldMeasuredSize(newSpecMode, newSpecSize, oldMeasuredSize) || oldSizeIsUnspecifiedAndStillFits(oldSpecMode, newSpecMode, newSpecSize, oldMeasuredSize) || newMeasureSizeIsStricterAndStillValid(oldSpecMode, newSpecMode, oldSpecSize, newSpecSize, oldMeasuredSize);<NEW_LINE>} | View.MeasureSpec.getMode(sizeSpec); |
625,236 | protected OptionParser buildOptionParser() {<NEW_LINE>OptionParser parser = new OptionParser();<NEW_LINE>parser.accepts("config", "location of config.properties file").withRequiredArg();<NEW_LINE>parser.accepts("env_config", "json object encoded config in an environment variable").withRequiredArg();<NEW_LINE>parser.accepts("__separator_1", "");<NEW_LINE>parser.accepts("database", "database that contains the table to bootstrap").withRequiredArg();<NEW_LINE>parser.accepts("table", "table to bootstrap").withRequiredArg();<NEW_LINE>parser.accepts("where", "where clause to restrict the rows bootstrapped from the specified table. e.g. my_date >= '2017-01-01 11:07:13'").withOptionalArg();<NEW_LINE>parser.accepts("__separator_2", "");<NEW_LINE>parser.accepts("abort", "bootstrap_id to abort").withRequiredArg();<NEW_LINE>parser.accepts("monitor", "bootstrap_id to monitor").withRequiredArg();<NEW_LINE>parser.accepts("__separator_3", "");<NEW_LINE>parser.accepts("client_id", "maxwell client to perform the bootstrap").withRequiredArg();<NEW_LINE>parser.accepts(<MASK><NEW_LINE>parser.accepts("__separator_4", "");<NEW_LINE>parser.accepts("host", "mysql host containing 'maxwell' database. default: localhost").withRequiredArg();<NEW_LINE>parser.accepts("user", "mysql username. default: maxwell").withRequiredArg();<NEW_LINE>parser.accepts("password", "mysql password").withOptionalArg();<NEW_LINE>parser.accepts("port", "mysql port. default: 3306").withRequiredArg();<NEW_LINE>parser.accepts("__separator_5", "");<NEW_LINE>parser.accepts("replication_host", "mysql host to query. default: (host)").withRequiredArg();<NEW_LINE>parser.accepts("replication_user", "username. default: maxwell").withRequiredArg();<NEW_LINE>parser.accepts("replication_password", "password").withOptionalArg();<NEW_LINE>parser.accepts("replication_port", "port. default: 3306").withRequiredArg();<NEW_LINE>parser.accepts("__separator_6", "");<NEW_LINE>parser.accepts("comment", "arbitrary comment to be added to every bootstrap row record").withRequiredArg();<NEW_LINE>parser.accepts("schema_database", "database that contains maxwell schema and state").withRequiredArg();<NEW_LINE>parser.accepts("help", "display help").forHelp();<NEW_LINE>BuiltinHelpFormatter helpFormatter = new BuiltinHelpFormatter(200, 4) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String format(Map<String, ? extends OptionDescriptor> options) {<NEW_LINE>this.addRows(options.values());<NEW_LINE>String output = this.formattedHelpOutput();<NEW_LINE>return output.replaceAll("--__separator_.*", "");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>parser.formatHelpWith(helpFormatter);<NEW_LINE>return parser;<NEW_LINE>} | "log_level", "log level, one of DEBUG|INFO|WARN|ERROR. default: WARN").withRequiredArg(); |
409,773 | public com.amazonaws.services.savingsplans.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.savingsplans.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotFoundException;<NEW_LINE>} | savingsplans.model.ResourceNotFoundException(null); |
1,366,832 | protected List<String> gatherCompletedFlows(List<String> completedActivityInstances, List<String> currentActivityinstances, BpmnModel pojoModel) {<NEW_LINE>List<String> completedFlows = new ArrayList<>();<NEW_LINE>List<String> activities = new ArrayList<>(completedActivityInstances);<NEW_LINE>if (currentActivityinstances != null) {<NEW_LINE>activities.addAll(currentActivityinstances);<NEW_LINE>}<NEW_LINE>// TODO: not a robust way of checking when parallel paths are active, should be revisited<NEW_LINE>// Go over all activities and check if it's possible to match any outgoing paths against the activities<NEW_LINE>for (FlowElement activity : pojoModel.getMainProcess().getFlowElements()) {<NEW_LINE>if (activity instanceof FlowNode) {<NEW_LINE>int index = activities.<MASK><NEW_LINE>if (index >= 0 && index + 1 < activities.size()) {<NEW_LINE>List<SequenceFlow> outgoingFlows = ((FlowNode) activity).getOutgoingFlows();<NEW_LINE>for (SequenceFlow flow : outgoingFlows) {<NEW_LINE>String destinationFlowId = flow.getTargetRef();<NEW_LINE>if (destinationFlowId.equals(activities.get(index + 1))) {<NEW_LINE>completedFlows.add(flow.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return completedFlows;<NEW_LINE>} | indexOf(activity.getId()); |
1,491,164 | protected void read(Map<Integer, ByteBuffer> tags) {<NEW_LINE>for (Iterator<Entry<Integer, ByteBuffer>> it = tags.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Entry<Integer, ByteBuffer> entry = it.next();<NEW_LINE><MASK><NEW_LINE>switch(entry.getKey()) {<NEW_LINE>case 0x4401:<NEW_LINE>packageUID = UL.read(_bb);<NEW_LINE>break;<NEW_LINE>case 0x4402:<NEW_LINE>name = readUtf16String(_bb);<NEW_LINE>break;<NEW_LINE>case 0x4403:<NEW_LINE>tracks = readULBatch(_bb);<NEW_LINE>break;<NEW_LINE>case 0x4404:<NEW_LINE>packageModifiedDate = readDate(_bb);<NEW_LINE>break;<NEW_LINE>case 0x4405:<NEW_LINE>packageCreationDate = readDate(_bb);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Logger.warn(String.format("Unknown tag [ " + ul + "]: %04x", entry.getKey()));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>} | ByteBuffer _bb = entry.getValue(); |
1,755,389 | public void paintComponent(java.awt.Graphics g) {<NEW_LINE>if (res.isOverrideMode()) {<NEW_LINE>if (res.isOverridenResource(getText())) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>if (charged) {<NEW_LINE>DELETE_ICON.paintIcon(this, g, getWidth() - <MASK><NEW_LINE>} else {<NEW_LINE>Graphics2D g2d = (Graphics2D) g.create();<NEW_LINE>g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.25f));<NEW_LINE>DELETE_ICON.paintIcon(this, g2d, getWidth() - X_ICON.getIconWidth(), 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Graphics2D g2d = (Graphics2D) g.create();<NEW_LINE>g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.25f));<NEW_LINE>super.paintComponent(g2d);<NEW_LINE>if (charged) {<NEW_LINE>TICK_ICON.paintIcon(this, g, getWidth() - X_ICON.getIconWidth(), 0);<NEW_LINE>} else {<NEW_LINE>TICK_ICON.paintIcon(this, g2d, getWidth() - X_ICON.getIconWidth(), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.paintComponent(g);<NEW_LINE>if (charged) {<NEW_LINE>X_ICON.paintIcon(this, g, getWidth() - X_ICON.getIconWidth(), 0);<NEW_LINE>} else {<NEW_LINE>Graphics2D g2d = (Graphics2D) g.create();<NEW_LINE>g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.25f));<NEW_LINE>X_ICON.paintIcon(this, g2d, getWidth() - X_ICON.getIconWidth(), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | X_ICON.getIconWidth(), 0); |
1,748,165 | public int unpRead(byte[] addr, int offset, int count) throws IOException, RarException {<NEW_LINE>int retCode = 0, totalRead = 0;<NEW_LINE>while (count > 0) {<NEW_LINE>int readSize = (count > unpPackedSize) ? (int) unpPackedSize : count;<NEW_LINE>retCode = inputStream.read(addr, offset, readSize);<NEW_LINE>if (retCode < 0) {<NEW_LINE>throw new EOFException();<NEW_LINE>}<NEW_LINE>if (subHead.isSplitAfter()) {<NEW_LINE>packedCRC = RarCRC.checkCrc((int) packedCRC, addr, offset, retCode);<NEW_LINE>}<NEW_LINE>curUnpRead += retCode;<NEW_LINE>totalRead += retCode;<NEW_LINE>offset += retCode;<NEW_LINE>count -= retCode;<NEW_LINE>unpPackedSize -= retCode;<NEW_LINE>archive.bytesReadRead(retCode);<NEW_LINE>if (unpPackedSize == 0 && subHead.isSplitAfter()) {<NEW_LINE>Volume nextVolume = archive.getVolumeManager().nextArchive(<MASK><NEW_LINE>if (nextVolume == null) {<NEW_LINE>nextVolumeMissing = true;<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>FileHeader hd = this.getSubHeader();<NEW_LINE>if (hd.getUnpVersion() >= 20 && hd.getFileCRC() != 0xffffffff && this.getPackedCRC() != ~hd.getFileCRC()) {<NEW_LINE>throw new RarException(RarExceptionType.crcError);<NEW_LINE>}<NEW_LINE>UnrarCallback callback = archive.getUnrarCallback();<NEW_LINE>if ((callback != null) && !callback.isNextVolumeReady(nextVolume)) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>archive.setVolume(nextVolume);<NEW_LINE>hd = archive.nextFileHeader();<NEW_LINE>if (hd == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>this.init(hd);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (retCode != -1) {<NEW_LINE>retCode = totalRead;<NEW_LINE>}<NEW_LINE>return retCode;<NEW_LINE>} | archive, archive.getVolume()); |
687,671 | private void drawStone(Graphics2D g, Graphics2D gShadow, int centerX, int centerY, Stone color, int x, int y) {<NEW_LINE>// g.setRenderingHint(KEY_ALPHA_INTERPOLATION,<NEW_LINE>// VALUE_ALPHA_INTERPOLATION_QUALITY);<NEW_LINE>g.setRenderingHint(KEY_INTERPOLATION, VALUE_INTERPOLATION_BILINEAR);<NEW_LINE>g.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);<NEW_LINE>if (color.isBlack() || color.isWhite()) {<NEW_LINE>boolean isBlack = color.isBlack();<NEW_LINE>boolean isGhost = (color == Stone.BLACK_GHOST || color == Stone.WHITE_GHOST);<NEW_LINE>if (uiConfig.getBoolean("fancy-stones")) {<NEW_LINE>drawShadow(gShadow, centerX, centerY, isGhost);<NEW_LINE>int size = stoneRadius * 2 + 1;<NEW_LINE>g.drawImage(getScaleStone(isBlack, size), centerX - stoneRadius, centerY - stoneRadius, size, size, null);<NEW_LINE>} else {<NEW_LINE>drawShadow(gShadow, centerX, centerY, true);<NEW_LINE>Color blackColor = isGhost ? new Color(0, 0, 0) : Color.BLACK;<NEW_LINE>Color whiteColor = isGhost ? new Color(255, <MASK><NEW_LINE>g.setColor(isBlack ? blackColor : whiteColor);<NEW_LINE>fillCircle(g, centerX, centerY, stoneRadius);<NEW_LINE>if (!isBlack) {<NEW_LINE>g.setColor(blackColor);<NEW_LINE>drawCircle(g, centerX, centerY, stoneRadius);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 255, 255) : Color.WHITE; |
900,297 | public Iterator<Double> call(Iterator<DataSet> iterator) throws Exception {<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>return Collections.emptyIterator();<NEW_LINE>}<NEW_LINE>MultiLayerNetwork network = new MultiLayerNetwork(MultiLayerConfiguration.fromJson(jsonConfig.getValue()));<NEW_LINE>network.init();<NEW_LINE>INDArray val = params.value().dup();<NEW_LINE>if (val.length() != network.numParams(false))<NEW_LINE>throw new IllegalStateException("Network did not have same number of parameters as the broadcast set parameters");<NEW_LINE>network.setParameters(val);<NEW_LINE>List<Double> ret = new ArrayList<>();<NEW_LINE>List<DataSet> collect = new ArrayList<>(batchSize);<NEW_LINE>int totalCount = 0;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>collect.clear();<NEW_LINE>int nExamples = 0;<NEW_LINE>while (iterator.hasNext() && nExamples < batchSize) {<NEW_LINE>DataSet ds = iterator.next();<NEW_LINE>int n = ds.numExamples();<NEW_LINE>collect.add(ds);<NEW_LINE>nExamples += n;<NEW_LINE>}<NEW_LINE>totalCount += nExamples;<NEW_LINE>DataSet <MASK><NEW_LINE>INDArray scores = network.scoreExamples(data, addRegularization);<NEW_LINE>double[] doubleScores = scores.data().asDouble();<NEW_LINE>for (double doubleScore : doubleScores) {<NEW_LINE>ret.add(doubleScore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Scored {} examples ", totalCount);<NEW_LINE>}<NEW_LINE>return ret.iterator();<NEW_LINE>} | data = DataSet.merge(collect); |
2,709 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ResultSet1NoneNoHavingNoJoin());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ResultSet3NoneHavingNoJoin());<NEW_LINE>execs.add(new ResultSet4NoneHavingJoin());<NEW_LINE>execs.add(new ResultSet5DefaultNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet6DefaultNoHavingJoin());<NEW_LINE>execs.add(new ResultSet7DefaultHavingNoJoin());<NEW_LINE>execs.add(new ResultSet8DefaultHavingJoin());<NEW_LINE>execs.add(new ResultSet9AllNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet10AllNoHavingJoin());<NEW_LINE>execs.add(new ResultSet11AllHavingNoJoin());<NEW_LINE>execs.add(new ResultSet11AllHavingNoJoinHinted());<NEW_LINE>execs.add(new ResultSet12AllHavingJoin());<NEW_LINE>execs.add(new ResultSet13LastNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet14LastNoHavingJoin());<NEW_LINE>execs.add(new ResultSet15LastHavingNoJoin());<NEW_LINE>execs.add(new ResultSet16LastHavingJoin());<NEW_LINE>execs.add(new ResultSet17FirstNoHavingNoJoinIStreamOnly());<NEW_LINE>execs.add(new ResultSet17FirstNoHavingNoJoinIRStream());<NEW_LINE>execs.add(new ResultSet18SnapshotNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSetHaving());<NEW_LINE>execs.add(new ResultSetHavingJoin());<NEW_LINE>execs.add(new ResultSetMaxTimeWindow());<NEW_LINE>execs.add(new ResultSetLimitSnapshot());<NEW_LINE>execs.add(new ResultSetLimitSnapshotJoin());<NEW_LINE>execs.add(new ResultSetJoinSortWindow());<NEW_LINE>execs.add(new ResultSetRowPerEventNoJoinLast());<NEW_LINE>execs.add(new ResultSetRowPerEventJoinAll());<NEW_LINE>execs.add(new ResultSetRowPerEventJoinLast());<NEW_LINE>execs.add(new ResultSetTime());<NEW_LINE>execs.add(new ResultSetCount());<NEW_LINE>return execs;<NEW_LINE>} | .add(new ResultSet2NoneNoHavingJoin()); |
1,370,791 | private static EditorTextField createTextField(@Nonnull final Project project, @Nonnull final ProjectSystemId externalSystemId) {<NEW_LINE>ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);<NEW_LINE>assert manager != null;<NEW_LINE>final AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);<NEW_LINE>final ExternalSystemUiAware uiAware = ExternalSystemUiUtil.getUiAware(externalSystemId);<NEW_LINE>TextFieldCompletionProvider provider = new TextFieldCompletionProviderDumbAware() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void addCompletionVariants(@Nonnull String text, int offset, @Nonnull String prefix, @Nonnull CompletionResultSet result) {<NEW_LINE>for (Map.Entry<ExternalProjectPojo, Collection<ExternalProjectPojo>> entry : settings.getAvailableProjects().entrySet()) {<NEW_LINE>String rootProjectPath = entry<MASK><NEW_LINE>String rootProjectName = uiAware.getProjectRepresentationName(rootProjectPath, null);<NEW_LINE>ExternalProjectPathLookupElement rootProjectElement = new ExternalProjectPathLookupElement(rootProjectName, rootProjectPath);<NEW_LINE>result.addElement(rootProjectElement);<NEW_LINE>for (ExternalProjectPojo subProject : entry.getValue()) {<NEW_LINE>String p = subProject.getPath();<NEW_LINE>if (rootProjectPath.equals(p)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String subProjectName = uiAware.getProjectRepresentationName(p, rootProjectPath);<NEW_LINE>ExternalProjectPathLookupElement subProjectElement = new ExternalProjectPathLookupElement(subProjectName, p);<NEW_LINE>result.addElement(subProjectElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.stopHere();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>EditorTextField result = provider.createEditor(project, false, new Consumer<Editor>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void consume(Editor editor) {<NEW_LINE>collapseIfPossible(editor, externalSystemId, project);<NEW_LINE>editor.getSettings().setShowIntentionBulb(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>result.setBorder(UIUtil.getTextFieldBorder());<NEW_LINE>result.setOneLineMode(true);<NEW_LINE>result.setOpaque(true);<NEW_LINE>result.setBackground(UIUtil.getTextFieldBackground());<NEW_LINE>return result;<NEW_LINE>} | .getKey().getPath(); |
979,677 | // old javadoc style check which doesn't include all leading comments into declaration<NEW_LINE>// for backward compatibility with 2.1 DOM<NEW_LINE>@Override<NEW_LINE>public void checkComment() {<NEW_LINE>// discard obsolete comments while inside methods or fields initializer (see bug 74369)<NEW_LINE>if (!(this.diet && this.dietInt == 0) && this.scanner.commentPtr >= 0) {<NEW_LINE>flushCommentsDefinedPriorTo(this.endStatementPosition);<NEW_LINE>}<NEW_LINE>boolean deprecated = false;<NEW_LINE>boolean checkDeprecated = false;<NEW_LINE>int lastCommentIndex = -1;<NEW_LINE>// since jdk1.2 look only in the last java doc comment...<NEW_LINE>nextComment: for (lastCommentIndex = this.scanner.commentPtr; lastCommentIndex >= 0; lastCommentIndex--) {<NEW_LINE>// look for @deprecated into the first javadoc comment preceeding the declaration<NEW_LINE>int commentSourceStart = this.scanner.commentStarts[lastCommentIndex];<NEW_LINE>// javadoc only (non javadoc comment have negative start and/or end positions.)<NEW_LINE>if ((commentSourceStart < 0) || (this.modifiersSourceStart != -1 && this.modifiersSourceStart < commentSourceStart) || (this.scanner.commentStops[lastCommentIndex] < 0)) {<NEW_LINE>continue nextComment;<NEW_LINE>}<NEW_LINE>checkDeprecated = true;<NEW_LINE>// stop is one over<NEW_LINE>int commentSourceEnd = this.scanner.commentStops[lastCommentIndex] - 1;<NEW_LINE>// do not report problem before last parsed comment while recovering code...<NEW_LINE>if (this.javadocParser.shouldReportProblems) {<NEW_LINE>this.javadocParser.reportProblems = this.currentElement <MASK><NEW_LINE>} else {<NEW_LINE>this.javadocParser.reportProblems = false;<NEW_LINE>}<NEW_LINE>deprecated = this.javadocParser.checkDeprecation(lastCommentIndex);<NEW_LINE>this.javadoc = this.javadocParser.docComment;<NEW_LINE>if (this.currentElement == null)<NEW_LINE>this.lastJavadocEnd = commentSourceEnd;<NEW_LINE>break nextComment;<NEW_LINE>}<NEW_LINE>if (deprecated) {<NEW_LINE>checkAndSetModifiers(ClassFileConstants.AccDeprecated);<NEW_LINE>}<NEW_LINE>// modify the modifier source start to point at the first comment<NEW_LINE>if (lastCommentIndex >= 0 && checkDeprecated) {<NEW_LINE>int lastCommentStart = this.scanner.commentStarts[lastCommentIndex];<NEW_LINE>if (lastCommentStart < 0)<NEW_LINE>lastCommentStart = -lastCommentStart;<NEW_LINE>if (this.forStartPosition == 0 || this.forStartPosition < lastCommentStart) {<NEW_LINE>// only if there is no "for" in between<NEW_LINE>this.modifiersSourceStart = lastCommentStart;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | == null || commentSourceEnd > this.lastJavadocEnd; |
301,756 | public byte[] persistJsonToBytes(ClassLoader classLoader, String str) throws ParseException {<NEW_LINE>final byte[] bytes;<NEW_LINE>if (format == Format.PERSISTABLE) {<NEW_LINE>throw new SafeIllegalArgumentException("Tried to pass json into a persistable type.");<NEW_LINE>} else if (format == Format.PERSISTER) {<NEW_LINE>Persister<?> persister = getPersister();<NEW_LINE>if (JsonNode.class == persister.getPersistingClassType()) {<NEW_LINE>try {<NEW_LINE>JsonNode jsonNode = new ObjectMapper().readValue(str, JsonNode.class);<NEW_LINE>return ((Persister<JsonNode>) persister).persistToBytes(jsonNode);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw Throwables.throwUncheckedException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new SafeIllegalArgumentException("Tried to write json to a Persister that isn't for JsonNode.");<NEW_LINE>}<NEW_LINE>} else if (format == Format.PROTO) {<NEW_LINE>Message.Builder builder = createBuilder(classLoader);<NEW_LINE>// This will have issues with base64 blobs<NEW_LINE>JsonFormat.merge(str, builder);<NEW_LINE>bytes = builder<MASK><NEW_LINE>} else {<NEW_LINE>bytes = type.convertFromString(str);<NEW_LINE>}<NEW_LINE>return CompressionUtils.compress(bytes, compression);<NEW_LINE>} | .build().toByteArray(); |
686,497 | private BlockNode parseBlock(Token token, Parser parser, TokenStream stream) {<NEW_LINE>if (stream.current().test(Token.Type.TEXT)) {<NEW_LINE>Token textToken = stream.expect(Token.Type.TEXT);<NEW_LINE>if (textToken.getValue().trim().length() > 0) {<NEW_LINE>throw new ParserException(null, "A template that extends another one cannot include content outside blocks. Did you forget to put the content inside a {% block %} tag?", textToken.getLineNumber(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>stream.expect(Token.Type.EXECUTE_START);<NEW_LINE>// we're finished with blocks, expect {% endembed %}<NEW_LINE>if (stream.current().test(Token.Type.NAME, "end" + this.getTag())) {<NEW_LINE>stream.expect(Token.Type.NAME, "end" + this.getTag());<NEW_LINE>stream.expect(Token.Type.EXECUTE_END);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// otherwise start parsing a block tag and let the actual BlockTokenParser do the rest (to make sure it parses the<NEW_LINE>// same as top-level blocks)<NEW_LINE>return (BlockNode) blockTokenParser.parse(token, parser);<NEW_LINE>} | ), stream.getFilename()); |
127,129 | // for quick UI testing<NEW_LINE>public static void main(String[] args) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {<NEW_LINE>if (!fxAvailable) {<NEW_LINE>System.out.println("JavaFX not available");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// JavaFXFileChooser chooser = new JavaFXFileChooser();<NEW_LINE>JFileChooser chooser = FileChooserFactory.getArchiveFileChooser();<NEW_LINE>chooser.addChoosableFileFilter(new FileNameExtensionFilter("Description1", new <MASK><NEW_LINE>// chooser.addChoosableFileFilter(new FileNameExtensionFilter("Description2", new String[] { "p12" }));<NEW_LINE>chooser.setDialogTitle("Dialog Title");<NEW_LINE>chooser.setCurrentDirectory(new File("."));<NEW_LINE>// chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>// chooser.setSelectedFiles(new ArrayList<File>());<NEW_LINE>chooser.setMultiSelectionEnabled(true);<NEW_LINE>// chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.showDialog(null, "Button Text");<NEW_LINE>// chooser.showSaveDialog(null);<NEW_LINE>// File file = chooser.getSelectedFile();<NEW_LINE>// System.out.println(file.getAbsolutePath());<NEW_LINE>System.out.println(chooser.getSelectedFiles().length);<NEW_LINE>Method platformExitMethod = platformClass.getMethod("exit");<NEW_LINE>platformExitMethod.invoke(null);<NEW_LINE>} | String[] { "jks" })); |
1,819,849 | public Mono<Response<Flux<ByteBuffer>>> cancelWithResponseAsync(String resourceGroupName, String vmScaleSetName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (vmScaleSetName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.cancel(this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
401,761 | private static MethodSpec.Builder addParametersToStaticTriggerMethods(ClassName contextClassName, SpecMethodModel<EventMethod, EventDeclarationModel> eventMethodModel, MethodSpec.Builder eventTriggerMethod) {<NEW_LINE>for (int i = 0, size = eventMethodModel.methodParams.size(); i < size; i++) {<NEW_LINE>final MethodParamModel methodParamModel = eventMethodModel.methodParams.get(i);<NEW_LINE>if (methodParamModel.getTypeName().equals(contextClassName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (MethodParamModelUtils.isAnnotatedWith(methodParamModel, FromTrigger.class)) {<NEW_LINE>eventTriggerMethod.addParameter(ParameterSpec.builder(methodParamModel.getTypeName(), methodParamModel.getName()).addAnnotations(methodParamModel.getExternalAnnotations<MASK><NEW_LINE>}<NEW_LINE>if (MethodParamModelUtils.isAnnotatedWith(methodParamModel, Param.class)) {<NEW_LINE>eventTriggerMethod.addParameter(ParameterSpec.builder(methodParamModel.getTypeName(), methodParamModel.getName()).addAnnotations(methodParamModel.getExternalAnnotations()).build());<NEW_LINE>maybeAddGenericTypeToStaticFunction(methodParamModel, eventTriggerMethod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eventTriggerMethod;<NEW_LINE>} | ()).build()); |
786,354 | public static ListSecurityPoliciesResponse unmarshall(ListSecurityPoliciesResponse listSecurityPoliciesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSecurityPoliciesResponse.setRequestId(_ctx.stringValue("ListSecurityPoliciesResponse.RequestId"));<NEW_LINE>listSecurityPoliciesResponse.setMaxResults(_ctx.integerValue("ListSecurityPoliciesResponse.MaxResults"));<NEW_LINE>listSecurityPoliciesResponse.setNextToken(_ctx.stringValue("ListSecurityPoliciesResponse.NextToken"));<NEW_LINE>listSecurityPoliciesResponse.setTotalCount(_ctx.integerValue("ListSecurityPoliciesResponse.TotalCount"));<NEW_LINE>List<SecurityPolicy> securityPolicies = new ArrayList<SecurityPolicy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSecurityPoliciesResponse.SecurityPolicies.Length"); i++) {<NEW_LINE>SecurityPolicy securityPolicy = new SecurityPolicy();<NEW_LINE>securityPolicy.setResourceGroupId(_ctx.stringValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].ResourceGroupId"));<NEW_LINE>securityPolicy.setSecurityPolicyId(_ctx.stringValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].SecurityPolicyId"));<NEW_LINE>securityPolicy.setSecurityPolicyName(_ctx.stringValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].SecurityPolicyName"));<NEW_LINE>securityPolicy.setSecurityPolicyStatus(_ctx.stringValue<MASK><NEW_LINE>List<String> ciphers = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].Ciphers.Length"); j++) {<NEW_LINE>ciphers.add(_ctx.stringValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].Ciphers[" + j + "]"));<NEW_LINE>}<NEW_LINE>securityPolicy.setCiphers(ciphers);<NEW_LINE>List<String> tLSVersions = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].TLSVersions.Length"); j++) {<NEW_LINE>tLSVersions.add(_ctx.stringValue("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].TLSVersions[" + j + "]"));<NEW_LINE>}<NEW_LINE>securityPolicy.setTLSVersions(tLSVersions);<NEW_LINE>securityPolicies.add(securityPolicy);<NEW_LINE>}<NEW_LINE>listSecurityPoliciesResponse.setSecurityPolicies(securityPolicies);<NEW_LINE>return listSecurityPoliciesResponse;<NEW_LINE>} | ("ListSecurityPoliciesResponse.SecurityPolicies[" + i + "].SecurityPolicyStatus")); |
55,498 | public static void convertJsonToOutParameters(JsonNode objectNode, BaseElement baseElement) {<NEW_LINE>JsonNode parametersNode = getProperty(PROPERTY_EVENT_REGISTRY_OUT_PARAMETERS, objectNode);<NEW_LINE>parametersNode = CmmnJsonConverterUtil.validateIfNodeIsTextual(parametersNode);<NEW_LINE>if (parametersNode != null && parametersNode.get("outParameters") != null) {<NEW_LINE>parametersNode = CmmnJsonConverterUtil.validateIfNodeIsTextual(parametersNode);<NEW_LINE>JsonNode parameterArray = parametersNode.get("outParameters");<NEW_LINE>for (JsonNode parameterNode : parameterArray) {<NEW_LINE>if (parameterNode.get(PROPERTY_EVENT_REGISTRY_PARAMETER_EVENTNAME) != null && !parameterNode.get(PROPERTY_EVENT_REGISTRY_PARAMETER_EVENTNAME).isNull()) {<NEW_LINE>ExtensionElement extensionElement = addFlowableExtensionElement("eventOutParameter", baseElement);<NEW_LINE>String eventName = parameterNode.get(PROPERTY_EVENT_REGISTRY_PARAMETER_EVENTNAME).asText();<NEW_LINE>String eventType = parameterNode.get(PROPERTY_EVENT_REGISTRY_PARAMETER_EVENTTYPE).asText();<NEW_LINE>String variableName = parameterNode.get(PROPERTY_EVENT_REGISTRY_PARAMETER_VARIABLENAME).asText();<NEW_LINE><MASK><NEW_LINE>addExtensionAttribute("sourceType", eventType, extensionElement);<NEW_LINE>addExtensionAttribute("target", variableName, extensionElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addExtensionAttribute("source", eventName, extensionElement); |
672,356 | static AuthInitiateMessage decode(byte[] wire) {<NEW_LINE>AuthInitiateMessage message = new AuthInitiateMessage();<NEW_LINE>int offset = 0;<NEW_LINE>byte[] r = new byte[32];<NEW_LINE>byte[] s = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, r, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>System.arraycopy(wire, offset, s, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>int v = wire[offset] + 27;<NEW_LINE>offset += 1;<NEW_LINE>message.signature = ECDSASignature.fromComponents(r, s, (byte) v);<NEW_LINE>message.ephemeralPublicHash = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, message.ephemeralPublicHash, 0, 32);<NEW_LINE>offset += 32;<NEW_LINE>byte[<MASK><NEW_LINE>System.arraycopy(wire, offset, bytes, 1, 64);<NEW_LINE>offset += 64;<NEW_LINE>// uncompressed<NEW_LINE>bytes[0] = 0x04;<NEW_LINE>message.publicKey = ECKey.CURVE.getCurve().decodePoint(bytes);<NEW_LINE>message.nonce = new byte[32];<NEW_LINE>System.arraycopy(wire, offset, message.nonce, 0, 32);<NEW_LINE>offset += message.nonce.length;<NEW_LINE>byte tokenUsed = wire[offset];<NEW_LINE>offset += 1;<NEW_LINE>if (tokenUsed != 0x00 && tokenUsed != 0x01) {<NEW_LINE>// TODO specific exception<NEW_LINE>throw new RuntimeException("invalid boolean");<NEW_LINE>}<NEW_LINE>message.isTokenUsed = (tokenUsed == 0x01);<NEW_LINE>return message;<NEW_LINE>} | ] bytes = new byte[65]; |
308,464 | private void reverseGeocode(Point point) {<NEW_LINE>final ListenableFuture<List<GeocodeResult>> results = mLocatorTask.reverseGeocodeAsync(point, mReverseGeocodeParameters);<NEW_LINE>try {<NEW_LINE>List<GeocodeResult> geocodeResults = results.get();<NEW_LINE>if (!geocodeResults.isEmpty()) {<NEW_LINE>// get the top result<NEW_LINE>GeocodeResult geocode = geocodeResults.get(0);<NEW_LINE>String detail;<NEW_LINE>// attributes from a click-based search<NEW_LINE>String street = geocode.getAttributes().get("StAddr").toString();<NEW_LINE>String city = geocode.getAttributes().get("City").toString();<NEW_LINE>String region = geocode.getAttributes().get("Region").toString();<NEW_LINE>String postCode = geocode.getAttributes().get("Postal").toString();<NEW_LINE>detail = city + ", " + region + ", " + postCode;<NEW_LINE>String address = street + ", " + detail;<NEW_LINE>displayGeocodeResult(point, address);<NEW_LINE>}<NEW_LINE>} catch (ExecutionException | InterruptedException e) {<NEW_LINE>String error = "Error getting geocode results: " + e.getMessage();<NEW_LINE>Toast.makeText(this, error, <MASK><NEW_LINE>Log.e(TAG, error);<NEW_LINE>}<NEW_LINE>} | Toast.LENGTH_LONG).show(); |
290,318 | public static ListDevopsProjectTaskFlowStatusResponse unmarshall(ListDevopsProjectTaskFlowStatusResponse listDevopsProjectTaskFlowStatusResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevopsProjectTaskFlowStatusResponse.setRequestId(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.RequestId"));<NEW_LINE>listDevopsProjectTaskFlowStatusResponse.setErrorMsg(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.ErrorMsg"));<NEW_LINE>listDevopsProjectTaskFlowStatusResponse.setSuccessful(_ctx.booleanValue("ListDevopsProjectTaskFlowStatusResponse.Successful"));<NEW_LINE>listDevopsProjectTaskFlowStatusResponse.setErrorCode(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.ErrorCode"));<NEW_LINE>List<TaskflowStatus> object = new ArrayList<TaskflowStatus>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevopsProjectTaskFlowStatusResponse.Object.Length"); i++) {<NEW_LINE>TaskflowStatus taskflowStatus = new TaskflowStatus();<NEW_LINE>taskflowStatus.setTaskflowId(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].TaskflowId"));<NEW_LINE>taskflowStatus.setKind(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Kind"));<NEW_LINE>taskflowStatus.setPos(_ctx.integerValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Pos"));<NEW_LINE>taskflowStatus.setIsDeleted(_ctx.booleanValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].IsDeleted"));<NEW_LINE>taskflowStatus.setUpdated(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Updated"));<NEW_LINE>taskflowStatus.setCreatorId(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].CreatorId"));<NEW_LINE>taskflowStatus.setName(_ctx.stringValue<MASK><NEW_LINE>taskflowStatus.setCreated(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Created"));<NEW_LINE>taskflowStatus.setRejectStatusIds(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].RejectStatusIds"));<NEW_LINE>taskflowStatus.setId(_ctx.stringValue("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Id"));<NEW_LINE>object.add(taskflowStatus);<NEW_LINE>}<NEW_LINE>listDevopsProjectTaskFlowStatusResponse.setObject(object);<NEW_LINE>return listDevopsProjectTaskFlowStatusResponse;<NEW_LINE>} | ("ListDevopsProjectTaskFlowStatusResponse.Object[" + i + "].Name")); |
18,908 | public void add(Node node) {<NEW_LINE>float x = node.x();<NEW_LINE>float y = node.y();<NEW_LINE><MASK><NEW_LINE>// Get the rectangle occupied by the node<NEW_LINE>double nxmin = x - (radius * ratio + margin);<NEW_LINE>double nxmax = x + (radius * ratio + margin);<NEW_LINE>double nymin = y - (radius * ratio + margin);<NEW_LINE>double nymax = y + (radius * ratio + margin);<NEW_LINE>// Get the rectangle as boxes<NEW_LINE>int minXbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nxmin - xmin) / (xmax - xmin));<NEW_LINE>int maxXbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nxmax - xmin) / (xmax - xmin));<NEW_LINE>int minYbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nymin - ymin) / (ymax - ymin));<NEW_LINE>int maxYbox = (int) Math.floor((COLUMNS_ROWS - 1) * (nymax - ymin) / (ymax - ymin));<NEW_LINE>for (int col = minXbox; col <= maxXbox; col++) {<NEW_LINE>for (int row = minYbox; row <= maxYbox; row++) {<NEW_LINE>try {<NEW_LINE>data.get(new Cell(row, col)).add(node);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Exceptions.printStackTrace(e);<NEW_LINE>if (nxmin < xmin || nxmax > xmax) {<NEW_LINE>}<NEW_LINE>if (nymin < ymin || nymax > ymax) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | float radius = node.size(); |
581,922 | private Pair<IndexMultiKey, EventTableAndNamePair> addIndex(QueryPlanIndexItem indexItem, Iterable<EventBean> prefilledEvents, EventType indexedType, String indexName, String indexModuleName, AgentInstanceContext agentInstanceContext, DataInputOutputSerde optionalValueSerde) {<NEW_LINE>// not resolved as full match and not resolved as unique index match, allocate<NEW_LINE>IndexMultiKey indexPropKey = indexItem.toIndexMultiKey();<NEW_LINE>EventTable table = EventTableUtil.buildIndex(agentInstanceContext, 0, indexItem, indexedType, indexItem.isUnique(<MASK><NEW_LINE>try {<NEW_LINE>// fill table since its new<NEW_LINE>EventBean[] events = new EventBean[1];<NEW_LINE>for (EventBean prefilledEvent : prefilledEvents) {<NEW_LINE>events[0] = prefilledEvent;<NEW_LINE>table.add(events, agentInstanceContext);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>table.destroy();<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>// add table<NEW_LINE>tables.add(table);<NEW_LINE>// add index, reference counted<NEW_LINE>tableIndexesRefCount.put(indexPropKey, new EventTableIndexRepositoryEntry(indexName, indexModuleName, table));<NEW_LINE>return new Pair<>(indexPropKey, new EventTableAndNamePair(table, indexName));<NEW_LINE>} | ), indexName, optionalValueSerde, false); |
1,597,764 | public static GetExperimentTaskResponse unmarshall(GetExperimentTaskResponse getExperimentTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>getExperimentTaskResponse.setRequestId(_ctx.stringValue("GetExperimentTaskResponse.RequestId"));<NEW_LINE>getExperimentTaskResponse.setExperimentId(_ctx.stringValue("GetExperimentTaskResponse.ExperimentId"));<NEW_LINE>getExperimentTaskResponse.setExperimentName(_ctx.stringValue("GetExperimentTaskResponse.ExperimentName"));<NEW_LINE>getExperimentTaskResponse.setHttpStatusCode(_ctx.integerValue("GetExperimentTaskResponse.HttpStatusCode"));<NEW_LINE>getExperimentTaskResponse.setStartTime(_ctx.longValue("GetExperimentTaskResponse.StartTime"));<NEW_LINE>getExperimentTaskResponse.setState(_ctx.stringValue("GetExperimentTaskResponse.State"));<NEW_LINE>getExperimentTaskResponse.setSuccess(_ctx.booleanValue("GetExperimentTaskResponse.Success"));<NEW_LINE>getExperimentTaskResponse.setTaskId(_ctx.stringValue("GetExperimentTaskResponse.TaskId"));<NEW_LINE>getExperimentTaskResponse.setResult(_ctx.stringValue("GetExperimentTaskResponse.Result"));<NEW_LINE>List<ActivitiesItem> activities = new ArrayList<ActivitiesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetExperimentTaskResponse.Activities.Length"); i++) {<NEW_LINE>ActivitiesItem activitiesItem = new ActivitiesItem();<NEW_LINE>activitiesItem.setActivityId(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].ActivityId"));<NEW_LINE>activitiesItem.setActivityName(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].ActivityName"));<NEW_LINE>activitiesItem.setCheckState(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].CheckState"));<NEW_LINE>activitiesItem.setEndTime(_ctx.longValue("GetExperimentTaskResponse.Activities[" + i + "].EndTime"));<NEW_LINE>activitiesItem.setExperimentTaskId(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].ExperimentTaskId"));<NEW_LINE>activitiesItem.setRunResult(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].RunResult"));<NEW_LINE>activitiesItem.setStartTime(_ctx.longValue("GetExperimentTaskResponse.Activities[" + i + "].StartTime"));<NEW_LINE>activitiesItem.setState(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].State"));<NEW_LINE>activitiesItem.setPhase(_ctx.stringValue("GetExperimentTaskResponse.Activities[" + i + "].Phase"));<NEW_LINE>activitiesItem.setTaskId(_ctx.stringValue<MASK><NEW_LINE>activities.add(activitiesItem);<NEW_LINE>}<NEW_LINE>getExperimentTaskResponse.setActivities(activities);<NEW_LINE>return getExperimentTaskResponse;<NEW_LINE>} | ("GetExperimentTaskResponse.Activities[" + i + "].TaskId")); |
698,088 | private I_C_Order copyProposalHeader(@NonNull final I_C_Order fromProposal) {<NEW_LINE>final I_C_Order newSalesOrder = InterfaceWrapperHelper.copy().setFrom(fromProposal).setSkipCalculatedColumns(true).copyToNew(I_C_Order.class);<NEW_LINE><MASK><NEW_LINE>newSalesOrder.setC_DocType_ID(newOrderDocTypeId.getRepoId());<NEW_LINE>if (newOrderDateOrdered != null) {<NEW_LINE>newSalesOrder.setDateOrdered(newOrderDateOrdered);<NEW_LINE>}<NEW_LINE>if (!Check.isBlank(poReference)) {<NEW_LINE>newSalesOrder.setPOReference(poReference);<NEW_LINE>}<NEW_LINE>newSalesOrder.setDatePromised(fromProposal.getDatePromised());<NEW_LINE>newSalesOrder.setPreparationDate(fromProposal.getPreparationDate());<NEW_LINE>newSalesOrder.setDocStatus(DocStatus.Drafted.getCode());<NEW_LINE>newSalesOrder.setDocAction(X_C_Order.DOCACTION_Complete);<NEW_LINE>newSalesOrder.setRef_Proposal_ID(fromProposal.getC_Order_ID());<NEW_LINE>orderDAO.save(newSalesOrder);<NEW_LINE>fromProposal.setRef_Order_ID(newSalesOrder.getC_Order_ID());<NEW_LINE>orderDAO.save(fromProposal);<NEW_LINE>return newSalesOrder;<NEW_LINE>} | orderBL.setDocTypeTargetIdAndUpdateDescription(newSalesOrder, newOrderDocTypeId); |
402,307 | public boolean onOptionsItemSelected(@NonNull MenuItem item) {<NEW_LINE>if (super.onOptionsItemSelected(item)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final int itemId = item.getItemId();<NEW_LINE>if (itemId == R.id.refresh_item) {<NEW_LINE>AutoUpdateManager.runImmediate(requireContext());<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.mark_all_read_item) {<NEW_LINE>ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(getActivity(), R.string.mark_all_read_label, R.string.mark_all_read_confirmation_msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onConfirmButtonPressed(DialogInterface dialog) {<NEW_LINE>dialog.dismiss();<NEW_LINE>DBWriter.markAllItemsRead();<NEW_LINE>((MainActivity) getActivity()).showSnackbarAbovePlayer(R.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>markAllReadConfirmationDialog.createNewDialog().show();<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.remove_all_new_flags_item) {<NEW_LINE>ConfirmationDialog removeAllNewFlagsConfirmationDialog = new ConfirmationDialog(getActivity(), R.string.remove_all_new_flags_label, R.string.remove_all_new_flags_confirmation_msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onConfirmButtonPressed(DialogInterface dialog) {<NEW_LINE>dialog.dismiss();<NEW_LINE>DBWriter.removeAllNewFlags();<NEW_LINE>((MainActivity) getActivity()).showSnackbarAbovePlayer(R.string.removed_all_new_flags_msg, Toast.LENGTH_SHORT);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>removeAllNewFlagsConfirmationDialog.createNewDialog().show();<NEW_LINE>return true;<NEW_LINE>} else if (itemId == R.id.action_search) {<NEW_LINE>((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | string.mark_all_read_msg, Toast.LENGTH_SHORT); |
571,411 | // Object Not Supported Reply Message indicates that the target<NEW_LINE>// server does not recognize or support the object<NEW_LINE>// specified as data in an OBJDSS for the command associated<NEW_LINE>// with the object.<NEW_LINE>// The OBJNSPRM is also returned if an object is found in a<NEW_LINE>// valid collection in an OBJDSS (such as RECAL collection)<NEW_LINE>// that that is not valid for that collection.<NEW_LINE>// PROTOCOL Architects an SQLSTATE of 58015.<NEW_LINE>//<NEW_LINE>// Messages<NEW_LINE>// SQLSTATE : 58015<NEW_LINE>// The DDM object is not supported.<NEW_LINE>// SQLCODE : -30071<NEW_LINE>// <object-identifier> Object is not supported.<NEW_LINE>// The current transaction is rolled back and the application<NEW_LINE>// is disconnected from the remote database. The command<NEW_LINE>// cannot be processed.<NEW_LINE>//<NEW_LINE>//<NEW_LINE>// Returned from Server:<NEW_LINE>// SVRCOD - required (8 - ERROR, 16 - SEVERE)<NEW_LINE>// CODPNT - required<NEW_LINE>// RECCNT - optional (MINVAL 0) (will not be returned - should be ignored)<NEW_LINE>// RDBNAM - optional (MINLVL 3)<NEW_LINE>//<NEW_LINE>// Also called by NetPackageReply and NetStatementReply<NEW_LINE>void parseOBJNSPRM() {<NEW_LINE>boolean svrcodReceived = false;<NEW_LINE>int svrcod = CodePoint.SVRCOD_INFO;<NEW_LINE>boolean rdbnamReceived = false;<NEW_LINE>String rdbnam = null;<NEW_LINE>boolean codpntReceived = false;<NEW_LINE>int codpnt = 0;<NEW_LINE>parseLengthAndMatchCodePoint(CodePoint.OBJNSPRM);<NEW_LINE>pushLengthOnCollectionStack();<NEW_LINE>int peekCP = peekCodePoint();<NEW_LINE>while (peekCP != END_OF_COLLECTION) {<NEW_LINE>boolean foundInPass = false;<NEW_LINE>if (peekCP == CodePoint.SVRCOD) {<NEW_LINE>foundInPass = true;<NEW_LINE>svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);<NEW_LINE>svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR, CodePoint.SVRCOD_SEVERE);<NEW_LINE>peekCP = peekCodePoint();<NEW_LINE>}<NEW_LINE>if (peekCP == CodePoint.RDBNAM) {<NEW_LINE>foundInPass = true;<NEW_LINE>rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);<NEW_LINE>rdbnam = parseRDBNAM(true);<NEW_LINE>peekCP = peekCodePoint();<NEW_LINE>}<NEW_LINE>if (peekCP == CodePoint.CODPNT) {<NEW_LINE>foundInPass = true;<NEW_LINE>codpntReceived = checkAndGetReceivedFlag(codpntReceived);<NEW_LINE>codpnt = parseCODPNT();<NEW_LINE>peekCP = peekCodePoint();<NEW_LINE>}<NEW_LINE>// skip the RECCNT<NEW_LINE>if (!foundInPass) {<NEW_LINE>throwUnknownCodepoint(peekCP);<NEW_LINE>;<NEW_LINE>// doPrmnsprmSemantics(peekCP);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>popCollectionStack();<NEW_LINE>if (!svrcodReceived)<NEW_LINE>throwMissingRequiredCodepoint("SVRCOD", CodePoint.SVRCOD);<NEW_LINE>if (!codpntReceived)<NEW_LINE><MASK><NEW_LINE>// checkRequiredObjects(svrcodReceived, codpntReceived);<NEW_LINE>// @AGG don't think this is used netAgent_.setSvrcod(svrcod);<NEW_LINE>// doObjnsprmSemantics(codpnt);<NEW_LINE>throw new IllegalStateException("SQLState.DRDA_DDM_OBJECT_NOT_SUPPORTED");<NEW_LINE>} | throwMissingRequiredCodepoint("CODPNT", CodePoint.CODPNT); |
1,721,588 | public void serialize(ByteBuffer buffer) {<NEW_LINE>ByteBuffer buf = buffer.order() == LITTLE_ENDIAN ? buffer : buffer.slice().order(LITTLE_ENDIAN);<NEW_LINE>int startOffset;<NEW_LINE>boolean hasrun = hasRunCompression();<NEW_LINE>if (hasrun) {<NEW_LINE>buf.putInt(SERIAL_COOKIE | ((size - 1) << 16));<NEW_LINE>int offset = buf.position();<NEW_LINE>for (int i = 0; i < size; i += 8) {<NEW_LINE>int runMarker = 0;<NEW_LINE>for (int j = 0; j < 8 && i + j < size; ++j) {<NEW_LINE>if (values[i + j] instanceof MappeableRunContainer) {<NEW_LINE>runMarker |= (1 << j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.put((byte) runMarker);<NEW_LINE>}<NEW_LINE>int runMarkersLength = buf.position() - offset;<NEW_LINE>if (this.size < NO_OFFSET_THRESHOLD) {<NEW_LINE>startOffset = 4 + 4 * this.size + runMarkersLength;<NEW_LINE>} else {<NEW_LINE>startOffset = 4 + 8 * this.size + runMarkersLength;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// backwards compatibility<NEW_LINE>buf.putInt(SERIAL_COOKIE_NO_RUNCONTAINER);<NEW_LINE>buf.putInt(size);<NEW_LINE>startOffset = 4 + 4 + 4 * this.size + 4 * this.size;<NEW_LINE>}<NEW_LINE>for (int k = 0; k < size; ++k) {<NEW_LINE>buf.putChar(this.keys[k]);<NEW_LINE>buf.putChar((char) (this.values[k]<MASK><NEW_LINE>}<NEW_LINE>if ((!hasrun) || (this.size >= NO_OFFSET_THRESHOLD)) {<NEW_LINE>// writing the containers offsets<NEW_LINE>for (int k = 0; k < this.size; ++k) {<NEW_LINE>buf.putInt(startOffset);<NEW_LINE>startOffset = startOffset + this.values[k].getArraySizeInBytes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int k = 0; k < size; ++k) {<NEW_LINE>values[k].writeArray(buf);<NEW_LINE>}<NEW_LINE>if (buf != buffer) {<NEW_LINE>buffer.position(buffer.position() + buf.position());<NEW_LINE>}<NEW_LINE>} | .getCardinality() - 1)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.