idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
518,572
|
private static Request prepareReindexRequest(ReindexRequest reindexRequest, boolean waitForCompletion) throws IOException {<NEW_LINE>String endpoint = new EndpointBuilder().addPathPart("_reindex").build();<NEW_LINE>Request request = new Request(HttpPost.METHOD_NAME, endpoint);<NEW_LINE>Params params = new Params().withWaitForCompletion(waitForCompletion).withRefresh(reindexRequest.isRefresh()).withTimeout(reindexRequest.getTimeout()).withWaitForActiveShards(reindexRequest.getWaitForActiveShards()).withRequestsPerSecond(reindexRequest.getRequestsPerSecond()).withSlices(reindexRequest.getSlices()).withRequireAlias(reindexRequest.getDestination().isRequireAlias());<NEW_LINE>if (reindexRequest.getScrollTime() != null) {<NEW_LINE>params.putParam(<MASK><NEW_LINE>}<NEW_LINE>request.addParameters(params.asMap());<NEW_LINE>request.setEntity(createEntity(reindexRequest, REQUEST_BODY_CONTENT_TYPE));<NEW_LINE>return request;<NEW_LINE>}
|
"scroll", reindexRequest.getScrollTime());
|
391,678
|
public void opExecution(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, OpContext opContext, INDArray[] outputs) {<NEW_LINE>Preconditions.checkState(variableName != null, "No variable name has been set yet. Variable name must be set before using this listener");<NEW_LINE>Preconditions.checkState(eps != 0.0, "Epsilon has not been set");<NEW_LINE>List<String> outs = op.getOutputsOfOp();<NEW_LINE>int i = 0;<NEW_LINE>for (String s : outs) {<NEW_LINE>if (variableName.equals(s)) {<NEW_LINE>Preconditions.checkState(idx != null || outputs[i].isScalar(), "No index to modify has been set yet. Index must be set before using this listener");<NEW_LINE>double orig = outputs<MASK><NEW_LINE>outputs[i].putScalar(idx, orig + eps);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}
|
[i].getDouble(idx);
|
233,037
|
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {<NEW_LINE>if (perspectiveId != null && perspective != null && perspectiveId.equals(perspective.getId())) {<NEW_LINE>int version = Platform.getPreferencesService().getInt(pluginId, preferenceId, 0, null);<NEW_LINE>if (perspectiveVersion > version) {<NEW_LINE>resetPerspective(page);<NEW_LINE>// we will only ask once regardless if user chose to update the perspective<NEW_LINE>IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(pluginId);<NEW_LINE>prefs.putInt(preferenceId, perspectiveVersion);<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>// ignores the exception<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (perspective != null) {<NEW_LINE>String perspectiveId = perspective.getId();<NEW_LINE>if (!StringUtil.isEmpty(perspectiveId)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int <MASK><NEW_LINE>if (index > -1) {<NEW_LINE>perspectiveId = perspectiveId.substring(index + 1);<NEW_LINE>}<NEW_LINE>sendEvent(new FeatureEvent(MessageFormat.format(PERSPECTIVE_ACTIVATE_EVENT, perspectiveId), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
index = perspectiveId.lastIndexOf(".");
|
843,515
|
public boolean open(FileSchemaNegotiator negotiator) {<NEW_LINE>try {<NEW_LINE>// init InputStream for pcap file<NEW_LINE>errorContext = negotiator.parentErrorContext();<NEW_LINE>DrillFileSystem dfs = negotiator.fileSystem();<NEW_LINE>path = dfs.makeQualified(negotiator.split().getPath());<NEW_LINE>in = dfs.openPossiblyCompressedStream(path);<NEW_LINE>// decode the pcap file<NEW_LINE>PcapDecoder decoder = new PcapDecoder(IOUtils.toByteArray(in));<NEW_LINE>decoder.decode();<NEW_LINE>pcapIterator = decoder<MASK><NEW_LINE>logger.debug("The config is {}, root is {}, columns has {}", config, scan.getSelectionRoot(), columns);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw UserException.dataReadError(e).message("Failure in initial pcapng inputstream. " + e.getMessage()).addContext(errorContext).build(logger);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw UserException.dataReadError(e).message("Failed to decode the pcapng file. " + e.getMessage()).addContext(errorContext).build(logger);<NEW_LINE>}<NEW_LINE>// define the schema<NEW_LINE>negotiator.tableSchema(defineMetadata(), true);<NEW_LINE>ResultSetLoader resultSetLoader = negotiator.build();<NEW_LINE>loader = resultSetLoader.writer();<NEW_LINE>// bind the writer for columns<NEW_LINE>bindColumns(loader);<NEW_LINE>return true;<NEW_LINE>}
|
.getSectionList().iterator();
|
304,605
|
public ReturnObject invoke(String methodName, String targetObjectId, List<Object> args) {<NEW_LINE>if (args == null) {<NEW_LINE>args = new ArrayList<Object>();<NEW_LINE>}<NEW_LINE>ReturnObject returnObject = null;<NEW_LINE>try {<NEW_LINE>Object targetObject = getObjectFromId(targetObjectId);<NEW_LINE><MASK><NEW_LINE>Object[] parameters = args.toArray();<NEW_LINE>MethodInvoker method = null;<NEW_LINE>if (targetObject != null) {<NEW_LINE>method = rEngine.getMethod(targetObject, methodName, parameters);<NEW_LINE>} else {<NEW_LINE>method = rEngine.getMethod(targetObjectId.substring(Protocol.STATIC_PREFIX.length()), methodName, parameters);<NEW_LINE>}<NEW_LINE>Object object = rEngine.invoke(targetObject, method, parameters);<NEW_LINE>returnObject = getReturnObject(object);<NEW_LINE>} catch (Py4JJavaException je) {<NEW_LINE>String id = putNewObject(je.getCause());<NEW_LINE>returnObject = ReturnObject.getErrorReferenceReturnObject(id);<NEW_LINE>} catch (Py4JException pe) {<NEW_LINE>throw pe;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new Py4JException(e);<NEW_LINE>}<NEW_LINE>return returnObject;<NEW_LINE>}
|
logger.finer("Calling: " + methodName);
|
115,111
|
public Location deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) {<NEW_LINE>Map<?, ?> map = ctx.deserialize(Map.class, parser);<NEW_LINE>Location l;<NEW_LINE>String podNumber = (String) map.get("podNumber");<NEW_LINE>if (podNumber != null) {<NEW_LINE>// must be Pod<NEW_LINE>Pod pod = new Pod();<NEW_LINE>pod.setPodNumber(podNumber);<NEW_LINE>l = pod;<NEW_LINE>} else {<NEW_LINE>// must be ReservableRoom<NEW_LINE>ReservableRoom rr = new ReservableRoom();<NEW_LINE>rr.setCapacity(((Number) map.get("capacity")).shortValue());<NEW_LINE>rr.setRoomName((String<MASK><NEW_LINE>rr.setRoomNumber((String) map.get("roomNumber"));<NEW_LINE>l = rr;<NEW_LINE>}<NEW_LINE>l.setBuilding((String) map.get("building"));<NEW_LINE>l.setCity((String) map.get("city"));<NEW_LINE>l.setFloor(((Number) map.get("floor")).shortValue());<NEW_LINE>l.setState((String) map.get("state"));<NEW_LINE>l.setStreetAddress((String) map.get("address"));<NEW_LINE>l.setZipCode(((Number) map.get("zipCode")).intValue());<NEW_LINE>return l;<NEW_LINE>}
|
) map.get("roomName"));
|
641,742
|
public RawJson shardingBeanToJson(Shardings shardings) {<NEW_LINE>// bean to json obj<NEW_LINE>JsonObjectWriter jsonObj = new JsonObjectWriter();<NEW_LINE>jsonObj.addProperty(ClusterPathUtil.VERSION, shardings.getVersion());<NEW_LINE>JsonArray schemaArray = new JsonArray();<NEW_LINE>for (Schema schema : shardings.getSchema()) {<NEW_LINE>if (schema.getTable() != null) {<NEW_LINE>JsonObject schemaJsonObj = gson.toJsonTree(schema).getAsJsonObject();<NEW_LINE>schemaJsonObj.remove("table");<NEW_LINE>JsonArray tableArray = new JsonArray();<NEW_LINE>for (Object table : schema.getTable()) {<NEW_LINE>JsonElement tableElement = gson.toJsonTree(table, Table.class);<NEW_LINE>tableArray.add(tableElement);<NEW_LINE>}<NEW_LINE>schemaJsonObj.add("table", gson.toJsonTree(tableArray));<NEW_LINE>schemaArray.add(gson.toJsonTree(schemaJsonObj));<NEW_LINE>} else {<NEW_LINE>schemaArray.add(gson.toJsonTree(schema));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonObj.add(ClusterPathUtil.SCHEMA, gson.toJsonTree(schemaArray));<NEW_LINE>jsonObj.add(ClusterPathUtil.SHARDING_NODE, gson.toJsonTree(shardings.getShardingNode()));<NEW_LINE>List<Function> functionList = shardings.getFunction();<NEW_LINE>readMapFileAddFunction(functionList);<NEW_LINE>jsonObj.add(ClusterPathUtil.FUNCTION<MASK><NEW_LINE>return RawJson.of(jsonObj);<NEW_LINE>}
|
, gson.toJsonTree(functionList));
|
1,051,806
|
private static ColumnarArray toColumnarArray(RunLengthEncodedBlock rleBlock) {<NEW_LINE>ColumnarArray columnarArray = toColumnarArray(rleBlock.getValue());<NEW_LINE>int positionCount = rleBlock.getPositionCount();<NEW_LINE>// build new offsets block<NEW_LINE>int[] offsets = new int[positionCount + 1];<NEW_LINE>int valueLength = columnarArray.getLength(0);<NEW_LINE>for (int i = 0; i < offsets.length; i++) {<NEW_LINE>offsets[i] = i * valueLength;<NEW_LINE>}<NEW_LINE>// create indexes for a dictionary block of the elements<NEW_LINE>int[] dictionaryIds = new int[positionCount * valueLength];<NEW_LINE>int nextDictionaryIndex = 0;<NEW_LINE>for (int position = 0; position < positionCount; position++) {<NEW_LINE>for (int entryIndex = 0; entryIndex < valueLength; entryIndex++) {<NEW_LINE>dictionaryIds[nextDictionaryIndex] = entryIndex;<NEW_LINE>nextDictionaryIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Block elementsBlock = columnarArray.getElementsBlock();<NEW_LINE>return new // The estimated serialized size is the sum of the following<NEW_LINE>ColumnarArray(// The estimated serialized size is the sum of the following<NEW_LINE>rleBlock, // The estimated serialized size is the sum of the following<NEW_LINE>0, // The estimated serialized size is the sum of the following<NEW_LINE>offsets, // The estimated serialized size is the sum of the following<NEW_LINE>new DictionaryBlock(dictionaryIds.length, elementsBlock, dictionaryIds), // The estimated serialized size is the sum of the following<NEW_LINE>INSTANCE_SIZE + rleBlock.getRetainedSizeInBytes() + sizeOf(offsets) + sizeOf(dictionaryIds), // 1) the offsets size: Integer.BYTES * positionCount<NEW_LINE>// 2) nulls array size: Byte.BYTES * positionCount<NEW_LINE>// 3) the estimated serialized size for the elementsBlock which was just constructed as a new DictionaryBlock:<NEW_LINE>// the average row size: elementsBlock.getSizeInBytes() / (double) elementsBlock.getPositionCount() * the number of rows: offsets[positionCount]<NEW_LINE>(Integer.BYTES + Byte.BYTES) * positionCount + (long) (elementsBlock.getSizeInBytes() / (double) elementsBlock.getPositionCount(<MASK><NEW_LINE>}
|
) * offsets[positionCount]));
|
1,805,735
|
public static void store(Properties properties, OutputStream outputStream, @Nullable String comment, Charset charset, String lineSeparator) throws IOException {<NEW_LINE>String rawContents;<NEW_LINE>if (charset.equals(Charsets.ISO_8859_1)) {<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>properties.store(out, comment);<NEW_LINE>rawContents = new String(out.toByteArray(), Charsets.ISO_8859_1);<NEW_LINE>} else {<NEW_LINE>StringWriter out = new StringWriter();<NEW_LINE>properties.store(out, comment);<NEW_LINE>rawContents = out.toString();<NEW_LINE>}<NEW_LINE>String systemLineSeparator = SystemProperties.getInstance().getLineSeparator();<NEW_LINE>List<String> lines = Lists.newArrayList(Splitter.on(systemLineSeparator).omitEmptyStrings().split(rawContents));<NEW_LINE>int lastCommentLine = -1;<NEW_LINE>for (int lineNo = 0, len = lines.size(); lineNo < len; lineNo++) {<NEW_LINE>String <MASK><NEW_LINE>if (line.startsWith("#")) {<NEW_LINE>lastCommentLine = lineNo;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// The last comment line is the timestamp<NEW_LINE>List<String> nonCommentLines;<NEW_LINE>if (lastCommentLine != -1) {<NEW_LINE>lines.remove(lastCommentLine);<NEW_LINE>nonCommentLines = lines.subList(lastCommentLine, lines.size());<NEW_LINE>} else {<NEW_LINE>nonCommentLines = lines;<NEW_LINE>}<NEW_LINE>Collections.sort(nonCommentLines);<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (String line : lines) {<NEW_LINE>builder.append(line);<NEW_LINE>builder.append(lineSeparator);<NEW_LINE>}<NEW_LINE>outputStream.write(builder.toString().getBytes(charset));<NEW_LINE>}
|
line = lines.get(lineNo);
|
1,095,974
|
private void writeIndex(IndexOutput metaOut, IndexOutput indexOut, int countPerLeaf, int numLeaves, byte[] packedIndex, long dataStartFP) throws IOException {<NEW_LINE>CodecUtil.<MASK><NEW_LINE>metaOut.writeVInt(config.numDims);<NEW_LINE>metaOut.writeVInt(config.numIndexDims);<NEW_LINE>metaOut.writeVInt(countPerLeaf);<NEW_LINE>metaOut.writeVInt(config.bytesPerDim);<NEW_LINE>assert numLeaves > 0;<NEW_LINE>metaOut.writeVInt(numLeaves);<NEW_LINE>metaOut.writeBytes(minPackedValue, 0, config.packedIndexBytesLength);<NEW_LINE>metaOut.writeBytes(maxPackedValue, 0, config.packedIndexBytesLength);<NEW_LINE>metaOut.writeVLong(pointCount);<NEW_LINE>metaOut.writeVInt(docsSeen.cardinality());<NEW_LINE>metaOut.writeVInt(packedIndex.length);<NEW_LINE>metaOut.writeLong(dataStartFP);<NEW_LINE>// If metaOut and indexOut are the same file, we account for the fact that<NEW_LINE>// writing a long makes the index start 8 bytes later.<NEW_LINE>metaOut.writeLong(indexOut.getFilePointer() + (metaOut == indexOut ? Long.BYTES : 0));<NEW_LINE>indexOut.writeBytes(packedIndex, 0, packedIndex.length);<NEW_LINE>}
|
writeHeader(metaOut, CODEC_NAME, VERSION_CURRENT);
|
1,012,709
|
private void drawCardinalDirections(Canvas canvas, QuadPoint center, float radiusLength, RotatedTileBox tileBox, RenderingLineAttributes attrs) {<NEW_LINE>float textMargin = AndroidUtils.dpToPx(app, 14);<NEW_LINE>attrs.paint2.setTextAlign(Paint.Align.CENTER);<NEW_LINE>attrs.paint3.setTextAlign(Paint.Align.CENTER);<NEW_LINE>setAttrsPaintsTypeface(attrs, Typeface.DEFAULT_BOLD);<NEW_LINE>for (int i = 0; i < degrees.length; i += 9) {<NEW_LINE>String cardinalDirection = getCardinalDirection(i);<NEW_LINE>if (cardinalDirection != null) {<NEW_LINE>float textWidth = AndroidUtils.getTextWidth(attrs.paint2.getTextSize(), cardinalDirection);<NEW_LINE>canvas.save();<NEW_LINE>canvas.translate(center.x, center.y);<NEW_LINE>canvas.rotate(-i * 5 - 90);<NEW_LINE>canvas.translate(0, radiusLength - textMargin - textWidth / 2);<NEW_LINE>canvas.rotate(i * 5 - tileBox.getRotate() + 90);<NEW_LINE>canvas.drawText(cardinalDirection, 0, 0, attrs.paint3);<NEW_LINE>canvas.drawText(cardinalDirection, <MASK><NEW_LINE>canvas.restore();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>attrs.paint2.setTextAlign(Paint.Align.LEFT);<NEW_LINE>attrs.paint3.setTextAlign(Paint.Align.LEFT);<NEW_LINE>setAttrsPaintsTypeface(attrs, null);<NEW_LINE>}
|
0, 0, attrs.paint2);
|
193,125
|
public NpmPackageSearchResultJson search(PackageSearchSpec thePackageSearchSpec) {<NEW_LINE>NpmPackageSearchResultJson retVal = new NpmPackageSearchResultJson();<NEW_LINE>CriteriaBuilder cb = myEntityManager.getCriteriaBuilder();<NEW_LINE>// Query for total<NEW_LINE>{<NEW_LINE>CriteriaQuery<Long> countCriteriaQuery = cb.createQuery(Long.class);<NEW_LINE>Root<NpmPackageVersionEntity> countCriteriaRoot = countCriteriaQuery.from(NpmPackageVersionEntity.class);<NEW_LINE>countCriteriaQuery.multiselect(cb.countDistinct(countCriteriaRoot.get("myPackageId")));<NEW_LINE>List<Predicate> predicates = createSearchPredicates(thePackageSearchSpec, cb, countCriteriaRoot);<NEW_LINE>countCriteriaQuery.where(toPredicateArray(predicates));<NEW_LINE>Long total = myEntityManager.<MASK><NEW_LINE>retVal.setTotal(Math.toIntExact(total));<NEW_LINE>}<NEW_LINE>// Query for results<NEW_LINE>{<NEW_LINE>CriteriaQuery<NpmPackageVersionEntity> criteriaQuery = cb.createQuery(NpmPackageVersionEntity.class);<NEW_LINE>Root<NpmPackageVersionEntity> root = criteriaQuery.from(NpmPackageVersionEntity.class);<NEW_LINE>List<Predicate> predicates = createSearchPredicates(thePackageSearchSpec, cb, root);<NEW_LINE>criteriaQuery.where(toPredicateArray(predicates));<NEW_LINE>criteriaQuery.orderBy(cb.asc(root.get("myPackageId")));<NEW_LINE>TypedQuery<NpmPackageVersionEntity> query = myEntityManager.createQuery(criteriaQuery);<NEW_LINE>query.setFirstResult(thePackageSearchSpec.getStart());<NEW_LINE>query.setMaxResults(thePackageSearchSpec.getSize());<NEW_LINE>List<NpmPackageVersionEntity> resultList = query.getResultList();<NEW_LINE>for (NpmPackageVersionEntity next : resultList) {<NEW_LINE>if (!retVal.hasPackageWithId(next.getPackageId())) {<NEW_LINE>retVal.addObject().getPackage().setName(next.getPackageId()).setDescription(next.getPackage().getDescription()).setVersion(next.getVersionId()).addFhirVersion(next.getFhirVersionId()).setBytes(next.getPackageSizeBytes());<NEW_LINE>} else {<NEW_LINE>NpmPackageSearchResultJson.Package retPackage = retVal.getPackageWithId(next.getPackageId());<NEW_LINE>retPackage.addFhirVersion(next.getFhirVersionId());<NEW_LINE>int cmp = PackageVersionComparator.INSTANCE.compare(next.getVersionId(), retPackage.getVersion());<NEW_LINE>if (cmp > 0) {<NEW_LINE>retPackage.setVersion(next.getVersionId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
|
createQuery(countCriteriaQuery).getSingleResult();
|
651,214
|
public static Builder withRelyingPartyRegistration(RelyingPartyRegistration registration) {<NEW_LINE>Assert.notNull(registration, "registration cannot be null");<NEW_LINE>return withRegistrationId(registration.getRegistrationId()).entityId(registration.getEntityId()).signingX509Credentials((c) -> c.addAll(registration.getSigningX509Credentials())).decryptionX509Credentials((c) -> c.addAll(registration.getDecryptionX509Credentials())).assertionConsumerServiceLocation(registration.getAssertionConsumerServiceLocation()).assertionConsumerServiceBinding(registration.getAssertionConsumerServiceBinding()).singleLogoutServiceLocation(registration.getSingleLogoutServiceLocation()).singleLogoutServiceResponseLocation(registration.getSingleLogoutServiceResponseLocation()).singleLogoutServiceBinding(registration.getSingleLogoutServiceBinding()).nameIdFormat(registration.getNameIdFormat()).assertingPartyDetails((assertingParty) -> assertingParty.entityId(registration.getAssertingPartyDetails().getEntityId()).wantAuthnRequestsSigned(registration.getAssertingPartyDetails().getWantAuthnRequestsSigned()).signingAlgorithms((algorithms) -> algorithms.addAll(registration.getAssertingPartyDetails().getSigningAlgorithms())).verificationX509Credentials((c) -> c.addAll(registration.getAssertingPartyDetails().getVerificationX509Credentials())).encryptionX509Credentials((c) -> c.addAll(registration.getAssertingPartyDetails().getEncryptionX509Credentials())).singleSignOnServiceLocation(registration.getAssertingPartyDetails().getSingleSignOnServiceLocation()).singleSignOnServiceBinding(registration.getAssertingPartyDetails().getSingleSignOnServiceBinding()).singleLogoutServiceLocation(registration.getAssertingPartyDetails().getSingleLogoutServiceLocation()).singleLogoutServiceResponseLocation(registration.getAssertingPartyDetails().getSingleLogoutServiceResponseLocation()).singleLogoutServiceBinding(registration.getAssertingPartyDetails<MASK><NEW_LINE>}
|
().getSingleLogoutServiceBinding()));
|
1,597,198
|
public static QuerySideMessageResponse unmarshall(QuerySideMessageResponse querySideMessageResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySideMessageResponse.setRequestId<MASK><NEW_LINE>querySideMessageResponse.setErrorMessage(_ctx.stringValue("QuerySideMessageResponse.ErrorMessage"));<NEW_LINE>querySideMessageResponse.setSuccess(_ctx.booleanValue("QuerySideMessageResponse.Success"));<NEW_LINE>querySideMessageResponse.setErrorCode(_ctx.stringValue("QuerySideMessageResponse.ErrorCode"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setEndTime(_ctx.longValue("QuerySideMessageResponse.Data.EndTime"));<NEW_LINE>data.setStartTime(_ctx.longValue("QuerySideMessageResponse.Data.StartTime"));<NEW_LINE>List<SideMessageDTO> messages = new ArrayList<SideMessageDTO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySideMessageResponse.Data.Messages.Length"); i++) {<NEW_LINE>SideMessageDTO sideMessageDTO = new SideMessageDTO();<NEW_LINE>sideMessageDTO.setUuid(_ctx.stringValue("QuerySideMessageResponse.Data.Messages[" + i + "].Uuid"));<NEW_LINE>sideMessageDTO.setTimeStamp(_ctx.longValue("QuerySideMessageResponse.Data.Messages[" + i + "].TimeStamp"));<NEW_LINE>sideMessageDTO.setSuccess(_ctx.booleanValue("QuerySideMessageResponse.Data.Messages[" + i + "].Success"));<NEW_LINE>sideMessageDTO.setContent(_ctx.stringValue("QuerySideMessageResponse.Data.Messages[" + i + "].Content"));<NEW_LINE>messages.add(sideMessageDTO);<NEW_LINE>}<NEW_LINE>data.setMessages(messages);<NEW_LINE>querySideMessageResponse.setData(data);<NEW_LINE>return querySideMessageResponse;<NEW_LINE>}
|
(_ctx.stringValue("QuerySideMessageResponse.RequestId"));
|
609,273
|
public void marshall(ContainerOverride containerOverride, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (containerOverride == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(containerOverride.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(containerOverride.getEnvironment(), ENVIRONMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerOverride.getEnvironmentFiles(), ENVIRONMENTFILES_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerOverride.getCpu(), CPU_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerOverride.getMemory(), MEMORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerOverride.getMemoryReservation(), MEMORYRESERVATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerOverride.getResourceRequirements(), RESOURCEREQUIREMENTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
containerOverride.getCommand(), COMMAND_BINDING);
|
1,519,021
|
public boolean createTopic(String topicName) throws BrokerException {<NEW_LINE>try {<NEW_LINE>TransactionInfo transactionInfo = FabricSDKWrapper.executeTransaction(hfClient, channel, topicControllerChaincodeID, true, "addTopicInfo", fabricConfig.getTransactionTimeout(), topicName, fabricConfig.getTopicVerison());<NEW_LINE>if (ErrorCode.SUCCESS.getCode() != transactionInfo.getCode()) {<NEW_LINE>if (WeEventConstants.TOPIC_ALREADY_EXIST.equals(transactionInfo.getMessage())) {<NEW_LINE>throw new BrokerException(ErrorCode.TOPIC_ALREADY_EXIST);<NEW_LINE>}<NEW_LINE>throw new BrokerException(transactionInfo.getCode(), transactionInfo.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (ProposalException | ExecutionException | InvalidArgumentException exception) {<NEW_LINE>log.error("create topic :{} failed due to transaction execution error.{}", topicName, exception);<NEW_LINE>throw new BrokerException(ErrorCode.TRANSACTION_EXECUTE_ERROR);<NEW_LINE>} catch (InterruptedException exception) {<NEW_LINE>log.error("create topic :{} failed due to transaction execution error.{}", topicName, exception);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new BrokerException(ErrorCode.TRANSACTION_EXECUTE_ERROR);<NEW_LINE>} catch (TimeoutException timeout) {<NEW_LINE>log.error("create topic :{} failed due to transaction execution timeout. {}", topicName, timeout);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
throw new BrokerException(ErrorCode.TRANSACTION_TIMEOUT);
|
1,704,332
|
default void slabStairsCrafting(Consumer<FinishedRecipe> consumer, BuildingBlockObject saveing, String folder, boolean addStonecutter) {<NEW_LINE>Item item = saveing.asItem();<NEW_LINE>TriggerInstance hasBlock = RecipeProvider.has(item);<NEW_LINE>// slab<NEW_LINE>ItemLike slab = saveing.getSlab();<NEW_LINE>ShapedRecipeBuilder.shaped(slab, 6).define('B', item).pattern("BBB").unlockedBy("has_item", hasBlock).group(Objects.requireNonNull(slab.asItem().getRegistryName()).toString()).save(consumer, wrap(item, folder, "_slab"));<NEW_LINE>// stairs<NEW_LINE>ItemLike stairs = saveing.getStairs();<NEW_LINE>ShapedRecipeBuilder.shaped(stairs, 4).define('B', item).pattern("B ").pattern("BB ").pattern("BBB").unlockedBy("has_item", hasBlock).group(Objects.requireNonNull(stairs.asItem().getRegistryName()).toString()).save(consumer, wrap(item, folder, "_stairs"));<NEW_LINE>// only add stonecutter if relevant<NEW_LINE>if (addStonecutter) {<NEW_LINE>Ingredient ingredient = Ingredient.of(item);<NEW_LINE>SingleItemRecipeBuilder.stonecutting(ingredient, slab, 2).unlockedBy("has_item", hasBlock).save(consumer, wrap(item, folder, "_slab_stonecutter"));<NEW_LINE>SingleItemRecipeBuilder.stonecutting(ingredient, stairs).unlockedBy("has_item", hasBlock).save(consumer, wrap<MASK><NEW_LINE>}<NEW_LINE>}
|
(item, folder, "_stairs_stonecutter"));
|
93,036
|
public void YieldInstr(YieldInstr yieldinstr) {<NEW_LINE>jvmMethod().loadContext();<NEW_LINE><MASK><NEW_LINE>if (yieldinstr.getYieldArg() == UndefinedValue.UNDEFINED) {<NEW_LINE>jvmMethod().getYieldCompiler().yieldSpecific();<NEW_LINE>} else {<NEW_LINE>Operand yieldOp = yieldinstr.getYieldArg();<NEW_LINE>if (yieldinstr.isUnwrapArray() && yieldOp instanceof Array && ((Array) yieldOp).size() > 1) {<NEW_LINE>Array yieldValues = (Array) yieldOp;<NEW_LINE>for (Operand yieldValue : yieldValues) {<NEW_LINE>visit(yieldValue);<NEW_LINE>}<NEW_LINE>jvmMethod().getYieldCompiler().yieldValues(yieldValues.size());<NEW_LINE>} else {<NEW_LINE>visit(yieldinstr.getYieldArg());<NEW_LINE>jvmMethod().getYieldCompiler().yield(yieldinstr.isUnwrapArray());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jvmStoreLocal(yieldinstr.getResult());<NEW_LINE>}
|
visit(yieldinstr.getBlockArg());
|
1,139,737
|
public ProjectValidation validateVersion(IJavaProject jp) throws Exception {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>if (jp != null) {<NEW_LINE>List<File> librariesOnClasspath = SpringProjectUtil.getLibrariesOnClasspath(jp, "spring");<NEW_LINE>if (librariesOnClasspath != null) {<NEW_LINE>for (File file : librariesOnClasspath) {<NEW_LINE><MASK><NEW_LINE>for (SpringProjectsProvider projectsProvider : projectsProviders) {<NEW_LINE>Generations generations = projectsProvider.getGenerations(versionInfo.getSlug());<NEW_LINE>if (generations != null) {<NEW_LINE>List<Generation> gens = generations.getGenerations();<NEW_LINE>if (gens != null) {<NEW_LINE>for (Generation gen : gens) {<NEW_LINE>resolveWarnings(gen, builder, versionInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.length() > 0 ? new ProjectValidation(builder.toString(), MessageType.Warning) : ProjectValidation.OK;<NEW_LINE>}
|
SpringVersionInfo versionInfo = new SpringVersionInfo(file);
|
1,115,960
|
public void marshall(PutRuleRequest putRuleRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (putRuleRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getScheduleExpression(), SCHEDULEEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getEventPattern(), EVENTPATTERN_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(putRuleRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
putRuleRequest.getEventBusName(), EVENTBUSNAME_BINDING);
|
1,047,377
|
int computeLayoutsToFillListViewport(List<ComponentTreeHolder> holders, int offset, int maxWidth, int maxHeight, @Nullable Size outputSize) {<NEW_LINE>final LayoutInfo.ViewportFiller filler = mLayoutInfo.createViewportFiller(maxWidth, maxHeight);<NEW_LINE>if (filler == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final boolean isTracing = ComponentsSystrace.isTracing();<NEW_LINE>if (isTracing) {<NEW_LINE>ComponentsSystrace.beginSection("computeLayoutsToFillListViewport");<NEW_LINE>}<NEW_LINE>final int widthSpec = SizeSpec.makeSizeSpec(maxWidth, SizeSpec.EXACTLY);<NEW_LINE>final int heightSpec = SizeSpec.makeSizeSpec(maxHeight, SizeSpec.EXACTLY);<NEW_LINE>final Size outSize = new Size();<NEW_LINE>int numInserted = 0;<NEW_LINE>int index = offset;<NEW_LINE>while (filler.wantsMore() && index < holders.size()) {<NEW_LINE>final ComponentTreeHolder <MASK><NEW_LINE>final RenderInfo renderInfo = holder.getRenderInfo();<NEW_LINE>// Bail as soon as we see a View since we can't tell what height it is and don't want to<NEW_LINE>// layout too much :(<NEW_LINE>if (renderInfo.rendersView()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>holder.computeLayoutSync(mComponentContext, mLayoutInfo.getChildWidthSpec(widthSpec, renderInfo), mLayoutInfo.getChildHeightSpec(heightSpec, renderInfo), outSize);<NEW_LINE>filler.add(renderInfo, outSize.width, outSize.height);<NEW_LINE>index++;<NEW_LINE>numInserted++;<NEW_LINE>}<NEW_LINE>if (outputSize != null) {<NEW_LINE>final int fill = filler.getFill();<NEW_LINE>if (mLayoutInfo.getScrollDirection() == VERTICAL) {<NEW_LINE>outputSize.width = maxWidth;<NEW_LINE>outputSize.height = Math.min(fill, maxHeight);<NEW_LINE>} else {<NEW_LINE>outputSize.width = Math.min(fill, maxWidth);<NEW_LINE>outputSize.height = maxHeight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isTracing) {<NEW_LINE>ComponentsSystrace.endSection();<NEW_LINE>}<NEW_LINE>logFillViewportInserted(numInserted, holders.size());<NEW_LINE>return numInserted;<NEW_LINE>}
|
holder = holders.get(index);
|
1,512,226
|
final DescribeLoadBalancersResult executeDescribeLoadBalancers(DescribeLoadBalancersRequest describeLoadBalancersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLoadBalancersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLoadBalancersRequest> request = null;<NEW_LINE>Response<DescribeLoadBalancersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLoadBalancersRequestMarshaller().marshall(super.beforeMarshalling(describeLoadBalancersRequest));<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, "Elastic Load Balancing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLoadBalancers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeLoadBalancersResult> responseHandler = new StaxResponseHandler<DescribeLoadBalancersResult>(new DescribeLoadBalancersResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
invoke(request, responseHandler, executionContext);
|
303,610
|
private static synchronized void load(WebAppModel model, IntPredicate action) {<NEW_LINE>captureLatch = new CountDownLatch(1);<NEW_LINE>thrown.set(null);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>// zoom should only be factored on raster prints<NEW_LINE>pageZoom = model.getZoom();<NEW_LINE>pageWidth = model.getWebWidth();<NEW_LINE>pageHeight = model.getWebHeight();<NEW_LINE>log.trace("Setting starting size {}:{}", pageWidth, pageHeight);<NEW_LINE>adjustSize(pageWidth * pageZoom, pageHeight * pageZoom);<NEW_LINE>if (pageHeight == 0) {<NEW_LINE>webView.setMinHeight(1);<NEW_LINE>webView.setPrefHeight(1);<NEW_LINE>webView.setMaxHeight(1);<NEW_LINE>}<NEW_LINE>autosize(webView);<NEW_LINE>printAction = action;<NEW_LINE>if (model.isPlainText()) {<NEW_LINE>webView.getEngine().loadContent(<MASK><NEW_LINE>} else {<NEW_LINE>webView.getEngine().load(model.getSource());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
model.getSource(), "text/html");
|
1,335,773
|
// Returns true if first is < second<NEW_LINE>@Override<NEW_LINE>public boolean lessThan(ShardRef first, ShardRef second) {<NEW_LINE>assert first != second;<NEW_LINE>final FieldDoc firstFD = (FieldDoc) shardHits[first<MASK><NEW_LINE>final FieldDoc secondFD = (FieldDoc) shardHits[second.shardIndex][second.hitIndex];<NEW_LINE>// System.out.println(" lessThan:\n first=" + first + " doc=" + firstFD.doc + " score=" +<NEW_LINE>// firstFD.score + "\n second=" + second + " doc=" + secondFD.doc + " score=" +<NEW_LINE>// secondFD.score);<NEW_LINE>for (int compIDX = 0; compIDX < comparators.length; compIDX++) {<NEW_LINE>final FieldComparator comp = comparators[compIDX];<NEW_LINE>// System.out.println(" cmp idx=" + compIDX + " cmp1=" + firstFD.fields[compIDX] + "<NEW_LINE>// cmp2=" + secondFD.fields[compIDX] + " reverse=" + reverseMul[compIDX]);<NEW_LINE>final int cmp = reverseMul[compIDX] * comp.compareValues(firstFD.fields[compIDX], secondFD.fields[compIDX]);<NEW_LINE>if (cmp != 0) {<NEW_LINE>// System.out.println(" return " + (cmp < 0));<NEW_LINE>return cmp < 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tieBreakLessThan(first, firstFD, second, secondFD, tieBreaker);<NEW_LINE>}
|
.shardIndex][first.hitIndex];
|
999,408
|
public void processEntryEvent(Event event, RequestContext requestContext) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "processEntryEvent " + event);<NEW_LINE>}<NEW_LINE>if (_logger.isLoggable(Level.INFO)) {<NEW_LINE>try {<NEW_LINE>LogRecordContext.addExtension(<MASK><NEW_LINE>if (includeContextInfo && event.getContextInfo() != null) {<NEW_LINE>LogRecordContext.addExtension("contextInfo", event.getContextInfo().toString());<NEW_LINE>}<NEW_LINE>if (includeContextInfo && event.getContextInfo() != null) {<NEW_LINE>_logger.info("BEGIN " + "requestID=" + requestContext.getRequestId().getId() + EventLoggingConstants.EVENT_LOG_MESSAGE_SEPARATOR + "eventType=" + event.getType() + EventLoggingConstants.EVENT_LOG_MESSAGE_SEPARATOR + "contextInfo=" + event.getContextInfo());<NEW_LINE>} else {<NEW_LINE>_logger.info("BEGIN " + "requestID=" + requestContext.getRequestId().getId() + EventLoggingConstants.EVENT_LOG_MESSAGE_SEPARATOR + "eventType=" + event.getType());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LogRecordContext.removeExtension("eventType");<NEW_LINE>if (includeContextInfo && event.getContextInfo() != null) {<NEW_LINE>LogRecordContext.removeExtension("contextInfo");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
"eventType", event.getType());
|
419,097
|
private Mono<Response<SupportedOptimizationTypesListResultInner>> listSupportedOptimizationTypesWithResponseAsync(String resourceGroupName, String profileName, Context context) {<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.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (profileName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter profileName 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 accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.listSupportedOptimizationTypes(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>}
|
this.client.mergeContext(context);
|
1,823,692
|
protected void encodeMarkup(FacesContext context, TextEditor editor) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = editor.getClientId(context);<NEW_LINE>String valueToRender = sanitizeHtml(context, editor, ComponentUtils.getValueToRender(context, editor));<NEW_LINE>String inputId = clientId + "_input";<NEW_LINE>String editorId = clientId + "_editor";<NEW_LINE>UIComponent toolbar = editor.getFacet("toolbar");<NEW_LINE>String style = editor.getStyle();<NEW_LINE>String styleClass = createStyleClass(editor, TextEditor.EDITOR_CLASS);<NEW_LINE><MASK><NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>renderARIARequired(context, editor);<NEW_LINE>renderARIAInvalid(context, editor);<NEW_LINE>if (editor.isToolbarVisible() && ComponentUtils.shouldRenderFacet(toolbar)) {<NEW_LINE>writer.startElement("div", editor);<NEW_LINE>writer.writeAttribute("id", clientId + "_toolbar", null);<NEW_LINE>writer.writeAttribute("class", "ui-editor-toolbar", null);<NEW_LINE>toolbar.encodeAll(context);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>writer.startElement("div", editor);<NEW_LINE>writer.writeAttribute("id", editorId, null);<NEW_LINE>if (valueToRender != null) {<NEW_LINE>writer.write(valueToRender);<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>renderHiddenInput(context, inputId, valueToRender, editor.isDisabled());<NEW_LINE>writer.endElement("div");<NEW_LINE>}
|
writer.startElement("div", editor);
|
1,226,263
|
public byte[] encodeRepresentation(String repr, MemBuffer buf, Settings settings, int length) throws DataTypeEncodeException {<NEW_LINE>int format = getFormatSettingsDefinition().getFormat(settings);<NEW_LINE>BigInteger value;<NEW_LINE>int radix;<NEW_LINE>String suffix;<NEW_LINE>switch(format) {<NEW_LINE>case FormatSettingsDefinition.CHAR:<NEW_LINE>StringDataInstance sdi = StringDataInstance.getStringDataInstance(this, buf, settings, getLength());<NEW_LINE>try {<NEW_LINE>return sdi.encodeReplacementFromCharRepresentation(repr);<NEW_LINE>} catch (MalformedInputException | UnmappableCharacterException | StringParseException e) {<NEW_LINE>throw new DataTypeEncodeException(repr, this, e);<NEW_LINE>}<NEW_LINE>case FormatSettingsDefinition.HEX:<NEW_LINE>radix = 16;<NEW_LINE>suffix = "h";<NEW_LINE>break;<NEW_LINE>case FormatSettingsDefinition.DECIMAL:<NEW_LINE>radix = 10;<NEW_LINE>suffix = "";<NEW_LINE>break;<NEW_LINE>case FormatSettingsDefinition.BINARY:<NEW_LINE>radix = 2;<NEW_LINE>suffix = "b";<NEW_LINE>break;<NEW_LINE>case FormatSettingsDefinition.OCTAL:<NEW_LINE>radix = 8;<NEW_LINE>suffix = "o";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>if (!repr.endsWith(suffix)) {<NEW_LINE>throw new DataTypeEncodeException("value must have " + suffix + " suffix", repr, this);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>value = new BigInteger(repr.substring(0, repr.length() - suffix.length()), radix);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (format != FormatSettingsDefinition.DECIMAL && isSigned()) {<NEW_LINE>BigInteger umax = BigInteger.ONE.shiftLeft(8 * length);<NEW_LINE>BigInteger smax = umax.shiftRight(1);<NEW_LINE>if (smax.compareTo(value) <= 0 && value.compareTo(umax) < 0) {<NEW_LINE>value = value.subtract(umax);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeValue(value, buf, settings, length);<NEW_LINE>}
|
DataTypeEncodeException(repr, this, e);
|
812,295
|
protected void deployResourcesInternal(String deploymentNameHint, Resource[] resources, FormEngine engine) {<NEW_LINE><MASK><NEW_LINE>// Create a single deployment for all resources using the name hint as the literal name<NEW_LINE>final FormDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentNameHint);<NEW_LINE>for (final Resource resource : resources) {<NEW_LINE>addResource(resource, deploymentBuilder);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>deploymentBuilder.deploy();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>if (isThrowExceptionOnDeploymentFailure()) {<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Exception while autodeploying form definitions. " + "This exception can be ignored if the root cause indicates a unique constraint violation, " + "which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
FormRepositoryService repositoryService = engine.getFormRepositoryService();
|
408,737
|
private void insideTypeParameter(Env env) throws IOException {<NEW_LINE>int offset = env.getOffset();<NEW_LINE>TreePath path = env.getPath();<NEW_LINE>TypeParameterTree tp = (TypeParameterTree) path.getLeaf();<NEW_LINE>CompilationController controller = env.getController();<NEW_LINE>TokenSequence<JavaTokenId> ts = <MASK><NEW_LINE>if (ts != null) {<NEW_LINE>switch(ts.token().id()) {<NEW_LINE>case EXTENDS:<NEW_LINE>controller.toPhase(Phase.ELEMENTS_RESOLVED);<NEW_LINE>addTypes(env, EnumSet.of(CLASS, INTERFACE, ANNOTATION_TYPE), null);<NEW_LINE>break;<NEW_LINE>case AMP:<NEW_LINE>controller.toPhase(Phase.ELEMENTS_RESOLVED);<NEW_LINE>addTypes(env, EnumSet.of(INTERFACE, ANNOTATION_TYPE), null);<NEW_LINE>break;<NEW_LINE>case IDENTIFIER:<NEW_LINE>if (ts.offset() == env.getSourcePositions().getStartPosition(env.getRoot(), tp)) {<NEW_LINE>addKeyword(env, EXTENDS_KEYWORD, SPACE, false);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
findLastNonWhitespaceToken(env, tp, offset);
|
925,104
|
public static OutputCallback constructOutputCallback(OutputStream outStream, String key, ConcurrentMap<String, StreamJunction> streamJunctionMap, StreamDefinition outputStreamDefinition, SiddhiQueryContext siddhiQueryContext) {<NEW_LINE>String id = outStream.getId();<NEW_LINE>// Construct CallBack<NEW_LINE>if (outStream instanceof InsertIntoStream) {<NEW_LINE>StreamJunction outputStreamJunction = streamJunctionMap.get(id + key);<NEW_LINE>if (outputStreamJunction == null) {<NEW_LINE>outputStreamJunction = new StreamJunction(outputStreamDefinition, siddhiQueryContext.getSiddhiAppContext().getExecutorService(), siddhiQueryContext.getSiddhiAppContext().getBufferSize(), null, siddhiQueryContext.getSiddhiAppContext());<NEW_LINE>streamJunctionMap.putIfAbsent(id + key, outputStreamJunction);<NEW_LINE>}<NEW_LINE>InsertIntoStreamCallback insertIntoStreamCallback = new InsertIntoStreamCallback(outputStreamDefinition, siddhiQueryContext.getName());<NEW_LINE>insertIntoStreamCallback.init(streamJunctionMap.get(id + key));<NEW_LINE>return insertIntoStreamCallback;<NEW_LINE>} else {<NEW_LINE>throw new SiddhiAppCreationException(outStream.getClass().getName() + " not supported", outStream.getQueryContextStartIndex(<MASK><NEW_LINE>}<NEW_LINE>}
|
), outStream.getQueryContextEndIndex());
|
1,682,072
|
public JsonObject toJSON() {<NEW_LINE>JsonObject sinfo = new JsonObject();<NEW_LINE>sinfo.addProperty("tooltips for default roll format", getUseToolTipsForDefaultRollFormat() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("GM reveals vision for unowned tokens", getGmRevealsVisionForUnownedTokens() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("players can reveal", getPlayersCanRevealVision() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("auto reveal on movement", isAutoRevealOnMovement() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("movement locked", isMovementLocked() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("token editor locked", isTokenEditorLocked() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("restricted impersonation", isRestrictedImpersonation() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("individual views", isUseIndividualViews() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("individual fow", isUseIndividualFOW() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("strict token management", useStrictTokenManagement() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("players receive campaign macros", playersReceiveCampaignMacros() ? <MASK><NEW_LINE>sinfo.addProperty("hide map select ui", getMapSelectUIHidden() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("disable player asset panel", getDisablePlayerAssetPanel() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>WalkerMetric metric = MapTool.isPersonalServer() ? AppPreferences.getMovementMetric() : getMovementMetric();<NEW_LINE>sinfo.addProperty("movement metric", metric.name());<NEW_LINE>sinfo.addProperty("using ai", isUsingAstarPathfinding() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("vbl blocks movement", getVblBlocksMove() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("timeInMs", getSystemTime());<NEW_LINE>sinfo.addProperty("timeDate", getTimeDate());<NEW_LINE>JsonArray gms = new JsonArray();<NEW_LINE>for (String gm : MapTool.getGMs()) {<NEW_LINE>gms.add(gm);<NEW_LINE>}<NEW_LINE>sinfo.add("gm", gms);<NEW_LINE>sinfo.addProperty("hosting server", MapTool.isHostingServer() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("personal server", MapTool.isPersonalServer() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("useWebRTC", AppState.useWebRTC() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>StartServerDialogPreferences prefs = new StartServerDialogPreferences();<NEW_LINE>sinfo.addProperty("usePasswordFile", prefs.getUsePasswordFile() ? BigDecimal.ONE : BigDecimal.ZERO);<NEW_LINE>sinfo.addProperty("server name", prefs.getRPToolsName());<NEW_LINE>sinfo.addProperty("port number", prefs.getPort());<NEW_LINE>return sinfo;<NEW_LINE>}
|
BigDecimal.ONE : BigDecimal.ZERO);
|
1,735,357
|
private // returns map; key=command name; value=array of targets for given command<NEW_LINE>HashMap<String, String[]> loadTargetsFromConfig() {<NEW_LINE>HashMap<String, String[]> targets = new HashMap<String, String[]>(6);<NEW_LINE>String config = evaluateProperty(project, PROP_CONFIG);<NEW_LINE>// load targets from shared config<NEW_LINE>FileObject propFO = project.getProjectDirectory().getFileObject("nbproject/configs/" + config + ".properties");<NEW_LINE>if (propFO == null) {<NEW_LINE>return targets;<NEW_LINE>}<NEW_LINE>Properties props = new Properties();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>props.load(is);<NEW_LINE>} finally {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>return targets;<NEW_LINE>}<NEW_LINE>Enumeration<?> propNames = props.propertyNames();<NEW_LINE>while (propNames.hasMoreElements()) {<NEW_LINE>String propName = (String) propNames.nextElement();<NEW_LINE>if (propName.startsWith("$target.")) {<NEW_LINE>String tNameVal = props.getProperty(propName);<NEW_LINE>if (tNameVal != null && !tNameVal.equals("")) {<NEW_LINE>String cmdNameKey = propName.substring("$target.".length());<NEW_LINE>StringTokenizer stok = new StringTokenizer(tNameVal.trim(), " ");<NEW_LINE>List<String> targetNames = new ArrayList<String>(3);<NEW_LINE>while (stok.hasMoreTokens()) {<NEW_LINE>targetNames.add(stok.nextToken());<NEW_LINE>}<NEW_LINE>targets.put(cmdNameKey, targetNames.toArray(new String[targetNames.size()]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targets;<NEW_LINE>}
|
InputStream is = propFO.getInputStream();
|
266,516
|
private void showActivePage() {<NEW_LINE>if (_activePage == null)<NEW_LINE>return;<NEW_LINE>int number = _pages.indexOf(_activePage);<NEW_LINE>// show the active page<NEW_LINE>_cards.show(_content, "page" + number);<NEW_LINE>// update the wizard header<NEW_LINE>if (_header != null) {<NEW_LINE>_header.setTitle(_activePage.getTitle());<NEW_LINE>_header.setDescription(_activePage.getDescription());<NEW_LINE>_header.setIcon(_activePage.getIcon());<NEW_LINE>}<NEW_LINE>// set visibility and localized text of buttons<NEW_LINE>if (number == 0) {<NEW_LINE>_previousButton.setVisible(false);<NEW_LINE>} else {<NEW_LINE>_previousButton.setVisible(_activePage.isPreviousVisible());<NEW_LINE>}<NEW_LINE>_previousAction.putValue(Action.NAME, getPreviousString());<NEW_LINE>_cancelButton.<MASK><NEW_LINE>_cancelAction.putValue(Action.NAME, getCancelString());<NEW_LINE>_nextButton.setVisible(_activePage.isNextVisible());<NEW_LINE>_nextAction.putValue(Action.NAME, getNextString());<NEW_LINE>if (number + 1 == _pages.size()) {<NEW_LINE>_nextAction.putValue(Action.NAME, getFinishString());<NEW_LINE>} else {<NEW_LINE>_nextAction.putValue(Action.NAME, getNextString());<NEW_LINE>}<NEW_LINE>if (_nextButton.isVisible()) {<NEW_LINE>getRootPane().setDefaultButton(_nextButton);<NEW_LINE>// workaround wrong default button (e.g. on OverviewPage)<NEW_LINE>if (_activePage.getFocusField() == null) {<NEW_LINE>_nextButton.grabFocus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_activePage.doActivate();<NEW_LINE>}
|
setVisible(_activePage.isCancelVisible());
|
616,205
|
private ImmutableList<I_M_Attribute> retrieveAvailableAttributes() {<NEW_LINE>final WindowType type = getWindowType();<NEW_LINE>final AttributeSetInstanceId attributeSetInstanceId = getAttributeSetInstanceId();<NEW_LINE>final AttributeSetId attributeSetId = getAttributeSetId();<NEW_LINE>final SOTrx soTrx = getSOTrx();<NEW_LINE>final int callerColumnId = getCallerColumnId();<NEW_LINE>final Stream<I_M_Attribute> attributes;<NEW_LINE>switch(type) {<NEW_LINE>case Regular:<NEW_LINE>{<NEW_LINE>attributes = retrieveAvailableAttributeSetAndInstanceAttributes(attributeSetId, attributeSetInstanceId).stream();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ProductWindow:<NEW_LINE>{<NEW_LINE>attributes = attributesRepo.getAttributesByAttributeSetId(attributeSetId).stream();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ProcessParameter:<NEW_LINE>{<NEW_LINE>// All attributes<NEW_LINE>attributes = attributesRepo.getAllAttributes().stream().sorted(Comparator.comparing(I_M_Attribute::getName).thenComparing(I_M_Attribute::getM_Attribute_ID));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case Pricing:<NEW_LINE>{<NEW_LINE>attributes = attributesRepo.getAllAttributes().stream().sorted(Comparator.comparing(I_M_Attribute::getName).thenComparing(I_M_Attribute::getM_Attribute_ID)).filter(attribute -> isPricingRelevantAttribute(attribute));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case StrictASIAttributes:<NEW_LINE>{<NEW_LINE>attributes = retrieveAvailableAttributeSetAndInstanceAttributes(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attributes.filter(attribute -> attributeSetId.isNone() || !attributeExcludeBL.isExcludedAttribute(attribute, attributeSetId, callerColumnId, soTrx)).collect(ImmutableList.toImmutableList());<NEW_LINE>}
|
attributeSetId, attributeSetInstanceId).stream();
|
404,120
|
public static byte[] encrypt(CipherAlgorithm cipherAlgorithm, byte[] plaintextUnpadded, byte[] key, byte[] iv) throws CryptoException {<NEW_LINE>byte[] result = new byte[0];<NEW_LINE>try {<NEW_LINE>byte[] plaintext = addPadding(plaintextUnpadded, cipherAlgorithm.getKeySize());<NEW_LINE>Cipher cipher = Cipher.getInstance(cipherAlgorithm.getJavaName());<NEW_LINE>BulkCipherAlgorithm bulkCipher = BulkCipherAlgorithm.getBulkCipherAlgorithm(cipherAlgorithm);<NEW_LINE>SecretKeySpec secretKey = new SecretKeySpec(<MASK><NEW_LINE>IvParameterSpec ivSpec = new IvParameterSpec(iv);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivSpec);<NEW_LINE>result = cipher.doFinal(plaintext);<NEW_LINE>} catch (InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | NoSuchPaddingException | NoSuchAlgorithmException ex) {<NEW_LINE>throw new CryptoException("Error while StatePlaintext Encryption. See Debug-Log for more Information.", ex);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
key, bulkCipher.getJavaName());
|
1,000,777
|
private static long hashLength0to16(byte[] bytes, int offset, int length) {<NEW_LINE>if (length >= 8) {<NEW_LINE>long mul = K2 + length * 2L;<NEW_LINE>long a = <MASK><NEW_LINE>long b = load64(bytes, offset + length - 8);<NEW_LINE>long c = rotateRight(b, 37) * mul + a;<NEW_LINE>long d = (rotateRight(a, 25) + b) * mul;<NEW_LINE>return hashLength16(c, d, mul);<NEW_LINE>}<NEW_LINE>if (length >= 4) {<NEW_LINE>long mul = K2 + length * 2;<NEW_LINE>long a = load32(bytes, offset) & 0xFFFFFFFFL;<NEW_LINE>return hashLength16(length + (a << 3), load32(bytes, offset + length - 4) & 0xFFFFFFFFL, mul);<NEW_LINE>}<NEW_LINE>if (length > 0) {<NEW_LINE>byte a = bytes[offset];<NEW_LINE>byte b = bytes[offset + (length >> 1)];<NEW_LINE>byte c = bytes[offset + (length - 1)];<NEW_LINE>int y = (a & 0xFF) + ((b & 0xFF) << 8);<NEW_LINE>int z = length + ((c & 0xFF) << 2);<NEW_LINE>return shiftMix(y * K2 ^ z * K0) * K2;<NEW_LINE>}<NEW_LINE>return K2;<NEW_LINE>}
|
load64(bytes, offset) + K2;
|
536,057
|
public static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2) {<NEW_LINE>final int length1 = x1.highLowContainer.size(), length2 = x2.highLowContainer.size();<NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE>while (pos1 < length1 && pos2 < length2) {<NEW_LINE>final char s1 = x1.highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>final char s2 = <MASK><NEW_LINE>if (s1 == s2) {<NEW_LINE>final Container c1 = x1.highLowContainer.getContainerAtIndex(pos1);<NEW_LINE>final Container c2 = x2.highLowContainer.getContainerAtIndex(pos2);<NEW_LINE>if (c1.intersects(c2)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>++pos1;<NEW_LINE>++pos2;<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>pos1 = x1.highLowContainer.advanceUntil(s2, pos1);<NEW_LINE>} else {<NEW_LINE>pos2 = x2.highLowContainer.advanceUntil(s1, pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
x2.highLowContainer.getKeyAtIndex(pos2);
|
1,533,943
|
public void onClick(View view) {<NEW_LINE>BottomSheetItemWithCompoundButton item = (BottomSheetItemWithCompoundButton) itemSwitchLiveUpdate;<NEW_LINE>boolean checked = item.isChecked();<NEW_LINE>item.setChecked(!checked);<NEW_LINE>if (onLiveUpdatesForLocalChange != null && onLiveUpdatesForLocalChange.onUpdateLocalIndex(fileName, !checked, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>updateLastCheck();<NEW_LINE>updateFrequencyHelpMessage();<NEW_LINE>updateFileSize();<NEW_LINE>Fragment target = getTargetFragment();<NEW_LINE>if (target instanceof LiveUpdatesFragment) {<NEW_LINE>((LiveUpdatesFragment) target).runSort();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>})) {<NEW_LINE>item.setTitle(getStateText(!checked));<NEW_LINE>updateCustomButtonView(app, null, item.getView<MASK><NEW_LINE>CommonPreference<Boolean> localUpdatePreference = preferenceForLocalIndex(fileName, settings);<NEW_LINE>frequencyToggleButton.setItemsEnabled(localUpdatePreference.get());<NEW_LINE>timeOfDayToggleButton.setItemsEnabled(localUpdatePreference.get());<NEW_LINE>setStateViaWiFiButton(localUpdatePreference);<NEW_LINE>}<NEW_LINE>}
|
(), !checked, nightMode);
|
1,017,010
|
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>lShortcut = new javax.swing.JLabel();<NEW_LINE>tfShortcut = new javax.swing.JTextField();<NEW_LINE>lConflict = new javax.swing.JLabel();<NEW_LINE>lShortcut.setLabelFor(tfShortcut);<NEW_LINE>lShortcut.setText("Shortcut:");<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(lConflict, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE).addGroup(layout.createSequentialGroup().addComponent(lShortcut).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(tfShortcut, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE))).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(lShortcut).addComponent(tfShortcut, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(lConflict).addContainerGap(41, Short.MAX_VALUE)));<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ShortcutsDialog.class, "AN_ShortcutsDialog"));<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>}
|
(ShortcutsDialog.class, "AD_ShortcutsDialog"));
|
1,133,697
|
public static MethodBinding checkForContradictions(MethodBinding method, Object location, Scope scope) {<NEW_LINE>int start = 0, end = 0;<NEW_LINE>if (location instanceof InvocationSite) {<NEW_LINE>start = ((<MASK><NEW_LINE>end = ((InvocationSite) location).sourceEnd();<NEW_LINE>} else if (location instanceof ASTNode) {<NEW_LINE>start = ((ASTNode) location).sourceStart;<NEW_LINE>end = ((ASTNode) location).sourceEnd;<NEW_LINE>}<NEW_LINE>SearchContradictions searchContradiction = new SearchContradictions();<NEW_LINE>TypeBindingVisitor.visit(searchContradiction, method.returnType);<NEW_LINE>if (searchContradiction.typeWithContradiction != null) {<NEW_LINE>if (scope == null)<NEW_LINE>return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);<NEW_LINE>// note: if needed, we might want to update the method by removing the contradictory annotations??<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>Expression[] arguments = null;<NEW_LINE>if (location instanceof Invocation)<NEW_LINE>arguments = ((Invocation) location).arguments();<NEW_LINE>for (int i = 0; i < method.parameters.length; i++) {<NEW_LINE>TypeBindingVisitor.visit(searchContradiction, method.parameters[i]);<NEW_LINE>if (searchContradiction.typeWithContradiction != null) {<NEW_LINE>if (scope == null)<NEW_LINE>return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);<NEW_LINE>if (arguments != null && i < arguments.length)<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred(method, arguments[i]);<NEW_LINE>else<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return method;<NEW_LINE>}
|
InvocationSite) location).sourceStart();
|
1,483,965
|
protected void handleL1L2BackwardCompatibility(BaseLayer baseLayer, ObjectNode on) {<NEW_LINE>if (on != null && (on.has("l1") || on.has("l2"))) {<NEW_LINE>// Legacy format JSON<NEW_LINE>baseLayer.setRegularization(new ArrayList<Regularization>());<NEW_LINE>baseLayer.setRegularizationBias(new ArrayList<Regularization>());<NEW_LINE>if (on.has("l1")) {<NEW_LINE>double l1 = on.get("l1").doubleValue();<NEW_LINE>if (l1 > 0.0) {<NEW_LINE>baseLayer.getRegularization().add(new L1Regularization(l1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (on.has("l2")) {<NEW_LINE>double l2 = on.get("l2").doubleValue();<NEW_LINE>if (l2 > 0.0) {<NEW_LINE>// Default to non-LR based WeightDecay, to match behaviour in 1.0.0-beta3<NEW_LINE>baseLayer.getRegularization().add(new WeightDecay(l2, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (on.has("l1Bias")) {<NEW_LINE>double l1Bias = on.get("l1Bias").doubleValue();<NEW_LINE>if (l1Bias > 0.0) {<NEW_LINE>baseLayer.getRegularizationBias().add(new L1Regularization(l1Bias));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (on.has("l2Bias")) {<NEW_LINE>double l2Bias = on.get("l2Bias").doubleValue();<NEW_LINE>if (l2Bias > 0.0) {<NEW_LINE>// Default to non-LR based WeightDecay, to match behaviour in 1.0.0-beta3<NEW_LINE>baseLayer.getRegularizationBias().add(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
new WeightDecay(l2Bias, false));
|
1,525,143
|
public static com.azure.search.documents.indexes.implementation.models.SearchIndexer map(SearchIndexer obj) {<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(<MASK><NEW_LINE>com.azure.search.documents.indexes.implementation.models.SearchIndexer searchIndexer = new com.azure.search.documents.indexes.implementation.models.SearchIndexer().setName(obj.getName()).setDataSourceName(obj.getDataSourceName()).setTargetIndexName(obj.getTargetIndexName());<NEW_LINE>searchIndexer.setSchedule(obj.getSchedule());<NEW_LINE>searchIndexer.setSkillsetName(obj.getSkillsetName());<NEW_LINE>searchIndexer.setDescription(obj.getDescription());<NEW_LINE>searchIndexer.setETag(obj.getETag());<NEW_LINE>searchIndexer.setFieldMappings(obj.getFieldMappings());<NEW_LINE>searchIndexer.setIsDisabled(obj.isDisabled());<NEW_LINE>if (obj.getParameters() != null) {<NEW_LINE>com.azure.search.documents.indexes.implementation.models.IndexingParameters parameters = IndexingParametersConverter.map(obj.getParameters());<NEW_LINE>searchIndexer.setParameters(parameters);<NEW_LINE>}<NEW_LINE>searchIndexer.setOutputFieldMappings(obj.getOutputFieldMappings());<NEW_LINE>searchIndexer.setEncryptionKey(obj.getEncryptionKey());<NEW_LINE>searchIndexer.setCache(obj.getCache());<NEW_LINE>return searchIndexer;<NEW_LINE>}
|
obj.getName(), "The SearchIndexer name cannot be null");
|
739,271
|
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String stmtOrigText = "@name('split') @public on SupportBean " + "insert into AStream2SP select * where intPrimitive=1 " + "insert into BStream2SP select * where intPrimitive=1 or intPrimitive=2";<NEW_LINE>env.compileDeploy(stmtOrigText, path).addListener("split");<NEW_LINE>tryAssertion(env, path);<NEW_LINE>path.clear();<NEW_LINE>// statement object model<NEW_LINE>EPStatementObjectModel model = new EPStatementObjectModel();<NEW_LINE>model.setAnnotations(Arrays.asList(new AnnotationPart("Audit"), new AnnotationPart("public")));<NEW_LINE>model.setFromClause(FromClause.create(<MASK><NEW_LINE>model.setInsertInto(InsertIntoClause.create("AStream2SP"));<NEW_LINE>model.setSelectClause(SelectClause.createWildcard());<NEW_LINE>model.setWhereClause(Expressions.eq("intPrimitive", 1));<NEW_LINE>OnInsertSplitStreamClause clause = OnClause.createOnInsertSplitStream();<NEW_LINE>model.setOnExpr(clause);<NEW_LINE>OnInsertSplitStreamItem item = OnInsertSplitStreamItem.create(InsertIntoClause.create("BStream2SP"), SelectClause.createWildcard(), Expressions.or(Expressions.eq("intPrimitive", 1), Expressions.eq("intPrimitive", 2)));<NEW_LINE>clause.addItem(item);<NEW_LINE>model.setAnnotations(Arrays.asList(AnnotationPart.nameAnnotation("split"), new AnnotationPart("public")));<NEW_LINE>assertEquals(stmtOrigText, model.toEPL());<NEW_LINE>env.compileDeploy(model, path).addListener("split");<NEW_LINE>tryAssertion(env, path);<NEW_LINE>path.clear();<NEW_LINE>env.eplToModelCompileDeploy(stmtOrigText, path).addListener("split");<NEW_LINE>tryAssertion(env, path);<NEW_LINE>}
|
FilterStream.create("SupportBean")));
|
1,810,635
|
public org.apache.submarine.server.api.proto.TritonModelConfig.ModelSequenceBatching buildPartial() {<NEW_LINE>org.apache.submarine.server.api.proto.TritonModelConfig.ModelSequenceBatching result = new org.apache.submarine.server.api.proto.TritonModelConfig.ModelSequenceBatching(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>if (strategyChoiceCase_ == 3) {<NEW_LINE>if (directBuilder_ == null) {<NEW_LINE>result.strategyChoice_ = strategyChoice_;<NEW_LINE>} else {<NEW_LINE>result.strategyChoice_ = directBuilder_.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (strategyChoiceCase_ == 4) {<NEW_LINE>if (oldestBuilder_ == null) {<NEW_LINE>result.strategyChoice_ = strategyChoice_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.maxSequenceIdleMicroseconds_ = maxSequenceIdleMicroseconds_;<NEW_LINE>if (controlInputBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>controlInput_ = java.util.Collections.unmodifiableList(controlInput_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.controlInput_ = controlInput_;<NEW_LINE>} else {<NEW_LINE>result.controlInput_ = controlInputBuilder_.build();<NEW_LINE>}<NEW_LINE>if (stateBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>state_ = java.util.Collections.unmodifiableList(state_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.state_ = state_;<NEW_LINE>} else {<NEW_LINE>result.state_ = stateBuilder_.build();<NEW_LINE>}<NEW_LINE>result.strategyChoiceCase_ = strategyChoiceCase_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
|
.strategyChoice_ = oldestBuilder_.build();
|
437,350
|
public void exitSummary_address_is_stanza(Summary_address_is_stanzaContext ctx) {<NEW_LINE>Ip ip = toIp(ctx.ip);<NEW_LINE>Ip mask = toIp(ctx.mask);<NEW_LINE>Prefix prefix = Prefix.create(ip, mask);<NEW_LINE>RoutingProtocol sourceProtocol = RoutingProtocol.ISIS_L1;<NEW_LINE><MASK><NEW_LINE>r.setSummaryPrefix(prefix);<NEW_LINE>_currentIsisProcess.getRedistributionPolicies().put(sourceProtocol, r);<NEW_LINE>if (ctx.metric != null) {<NEW_LINE>int metric = toInteger(ctx.metric);<NEW_LINE>r.setMetric(metric);<NEW_LINE>}<NEW_LINE>if (!ctx.LEVEL_1().isEmpty()) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_1);<NEW_LINE>} else if (!ctx.LEVEL_2().isEmpty()) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_2);<NEW_LINE>} else if (!ctx.LEVEL_1_2().isEmpty()) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_1_2);<NEW_LINE>} else {<NEW_LINE>r.setLevel(IsisRedistributionPolicy.DEFAULT_LEVEL);<NEW_LINE>}<NEW_LINE>}
|
IsisRedistributionPolicy r = new IsisRedistributionPolicy(sourceProtocol);
|
20,920
|
private void loadNode454() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Write.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Data</Name><DataType><Identifier>i=15</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new <MASK><NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
|
DataValue(new Variant(o));
|
905,618
|
public static void convolve3(Kernel2D_S32 kernel, GrayS16 input, GrayI16 output, int skip, int divisor) {<NEW_LINE>final short[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int widthEnd = UtilDownConvolve.computeMaxSide(input.width, skip, radius);<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>int halfDivisor = divisor / 2;<NEW_LINE>final int[] totalRow = new int[widthEnd + 1];<NEW_LINE>final int offset = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offset; y <= heightEnd; y += skip) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int indexSrcRow = input.startIndex + (y - radius) * input.stride - radius;<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += <MASK><NEW_LINE>totalRow[x] = total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 3; i++) {<NEW_LINE>indexSrcRow = input.startIndex + (y + i - radius) * input.stride - radius;<NEW_LINE>k1 = kernel.data[i * 3 + 0];<NEW_LINE>k2 = kernel.data[i * 3 + 1];<NEW_LINE>k3 = kernel.data[i * 3 + 2];<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>totalRow[x] += total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride + offset / skip;<NEW_LINE>for (int x = offset; x <= widthEnd; x += skip) {<NEW_LINE>dataDst[indexDst++] = (short) ((totalRow[x] + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
(dataSrc[indexSrc]) * k3;
|
805,078
|
public RoutingProfileSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RoutingProfileSummary routingProfileSummary = new RoutingProfileSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>routingProfileSummary.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>routingProfileSummary.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>routingProfileSummary.setName(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 routingProfileSummary;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
1,376,198
|
private void changeMethodConfigPanel(AuthenticationMethodType newMethodType) {<NEW_LINE>// If there's no new method, don't display anything<NEW_LINE>if (newMethodType == null) {<NEW_LINE>getConfigContainerPanel().removeAll();<NEW_LINE>getConfigContainerPanel().setVisible(false);<NEW_LINE>this.shownMethodType = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If a panel of the correct type is already shown, do nothing<NEW_LINE>if (shownMethodType != null && newMethodType.getClass().equals(shownMethodType.getClass())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Creating new panel for configuring: " + newMethodType.getName());<NEW_LINE>}<NEW_LINE>this.getConfigContainerPanel().removeAll();<NEW_LINE>// show the panel according to whether the authentication type needs configuration<NEW_LINE>if (newMethodType.hasOptionsPanel()) {<NEW_LINE>shownConfigPanel = newMethodType.buildOptionsPanel(getUISharedContext());<NEW_LINE>getConfigContainerPanel().<MASK><NEW_LINE>} else {<NEW_LINE>shownConfigPanel = null;<NEW_LINE>getConfigContainerPanel().add(new JLabel(LABEL_CONFIG_NOT_NEEDED), BorderLayout.CENTER);<NEW_LINE>}<NEW_LINE>this.shownMethodType = newMethodType;<NEW_LINE>this.getConfigContainerPanel().setVisible(true);<NEW_LINE>this.getConfigContainerPanel().revalidate();<NEW_LINE>}
|
add(shownConfigPanel, BorderLayout.CENTER);
|
475,692
|
public void lsdSort(String[] array) {<NEW_LINE>if (array == null || array.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Extended ASCII characters<NEW_LINE>int alphabetSize = 256;<NEW_LINE>String[] auxArray = new String[array.length];<NEW_LINE>int maxStringLength = getMaxStringLength(array);<NEW_LINE>for (int digit = maxStringLength - 1; digit >= 0; digit--) {<NEW_LINE>// Sort by key-indexed counting on digitTh char<NEW_LINE>// Compute frequency counts<NEW_LINE>int[] count <MASK><NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>int digitIndex = charAt(array[i], digit);<NEW_LINE>count[digitIndex + 1]++;<NEW_LINE>}<NEW_LINE>// Transform counts to indices<NEW_LINE>for (int r = 0; r < alphabetSize; r++) {<NEW_LINE>count[r + 1] += count[r];<NEW_LINE>}<NEW_LINE>// Distribute<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>int digitIndex = charAt(array[i], digit);<NEW_LINE>int indexInAuxArray = count[digitIndex]++;<NEW_LINE>auxArray[indexInAuxArray] = array[i];<NEW_LINE>}<NEW_LINE>// Copy back<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>array[i] = auxArray[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
= new int[alphabetSize + 1];
|
1,216,560
|
private void handleSpeakerCommand(String channelId, Command command) throws SpeakerException {<NEW_LINE>switch(channelId) {<NEW_LINE>case CLEAR_ZONE:<NEW_LINE>if (OnOffType.ON.equals(command)) {<NEW_LINE>speaker.zoneManager().releaseZone();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CONTROL:<NEW_LINE>handleControlCommand(command);<NEW_LINE>break;<NEW_LINE>case INPUT:<NEW_LINE>speaker.input().setInput(command.toString());<NEW_LINE>break;<NEW_LINE>case LOOP_MODE:<NEW_LINE>speaker.setLoopMode(LoopMode.parse(command.toString()));<NEW_LINE>break;<NEW_LINE>case MUTE:<NEW_LINE>speaker.volume().mute(OnOffType.ON.equals(command));<NEW_LINE>break;<NEW_LINE>case STOP:<NEW_LINE>speaker.stop();<NEW_LINE>break;<NEW_LINE>case SHUFFLE_MODE:<NEW_LINE>handleShuffleModeCommand(command);<NEW_LINE>break;<NEW_LINE>case STREAM:<NEW_LINE>logger.debug("Starting to stream URL: {}", command.toString());<NEW_LINE>speaker.<MASK><NEW_LINE>break;<NEW_LINE>case VOLUME:<NEW_LINE>handleVolumeCommand(command);<NEW_LINE>break;<NEW_LINE>case ZONE_MEMBERS:<NEW_LINE>handleZoneMembersCommand(command);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.warn("Unable to handle command {} on unknown channel {}", command, channelId);<NEW_LINE>}<NEW_LINE>}
|
playItem(command.toString());
|
676,089
|
public void editEndpoint(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, LanguageException {<NEW_LINE>try {<NEW_LINE>String serverName = request.getParameter("serverName");<NEW_LINE>String <MASK><NEW_LINE>PublishingEndPoint existingServer = APILocator.getPublisherEndPointAPI().findEndPointByName(serverName);<NEW_LINE>if (existingServer != null && !id.equals(existingServer.getId())) {<NEW_LINE>Logger.info(getClass(), "Can't save EndPoint. An Endpoint with the given name already exists. ");<NEW_LINE>User user = getUser();<NEW_LINE>response.getWriter().println("FAILURE: " + LanguageUtil.get(user, "publisher_Endpoint_name_exists"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String protocol = request.getParameter("protocol");<NEW_LINE>PublishingEndPoint endpoint = factory.getPublishingEndPoint(protocol);<NEW_LINE>endpoint.setId(id);<NEW_LINE>endpoint.setServerName(new StringBuilder(request.getParameter("serverName")));<NEW_LINE>endpoint.setAddress(request.getParameter("address"));<NEW_LINE>endpoint.setPort(request.getParameter("port"));<NEW_LINE>endpoint.setProtocol(request.getParameter("protocol"));<NEW_LINE>endpoint.setAuthKey(new StringBuilder(PublicEncryptionFactory.encryptString(request.getParameter("authKey"))));<NEW_LINE>endpoint.setEnabled(null != request.getParameter("enabled"));<NEW_LINE>endpoint.setSending("true".equals(request.getParameter("sending")));<NEW_LINE>endpoint.setGroupId(request.getParameter("environmentId"));<NEW_LINE>// Validate.<NEW_LINE>try {<NEW_LINE>endpoint.validatePublishingEndPoint();<NEW_LINE>} catch (PublishingEndPointValidationException e) {<NEW_LINE>throw new DotDataException(handlePublishingEndPointValidationException(e));<NEW_LINE>}<NEW_LINE>// Update the endpoint.<NEW_LINE>PublishingEndPointAPI peAPI = APILocator.getPublisherEndPointAPI();<NEW_LINE>peAPI.updateEndPoint(endpoint);<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.info(getClass(), "Error editing EndPoint. Error Message: " + e.getMessage());<NEW_LINE>response.getWriter().println("FAILURE: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
|
id = request.getParameter("identifier");
|
1,001,716
|
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = setupInfra(env, namedWindow);<NEW_LINE>String query = "select * from MyInfra";<NEW_LINE>EPCompiled compiled = env.compileFAF(query, path);<NEW_LINE>EPFireAndForgetQueryResult result = env.runtime().<MASK><NEW_LINE>final String[] fields = new String[] { "theString", "intPrimitive" };<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.iterator(), fields, null);<NEW_LINE>EPFireAndForgetPreparedQuery prepared = env.runtime().getFireAndForgetService().prepareQuery(compiled);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(prepared.execute().iterator(), fields, null);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>result = env.runtime().getFireAndForgetService().executeQuery(compiled);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.iterator(), fields, new Object[][] { { "E1", 1 } });<NEW_LINE>EPAssertionUtil.assertPropsPerRow(prepared.execute().iterator(), fields, new Object[][] { { "E1", 1 } });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>result = env.runtime().getFireAndForgetService().executeQuery(compiled);<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(result.iterator(), fields, new Object[][] { { "E1", 1 }, { "E2", 2 } });<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(prepared.execute().iterator(), fields, new Object[][] { { "E1", 1 }, { "E2", 2 } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
getFireAndForgetService().executeQuery(compiled);
|
49,446
|
public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenExpressionField typeMember = codegenClassScope.addFieldUnshared(true, ObjectArrayEventType.EPTYPE, cast(ObjectArrayEventType.EPTYPE, EventTypeUtility.resolveTypeCodegen(eventType, EPStatementInitServices.REF)));<NEW_LINE>EPTypeClass initializationType = JavaClassHelper.getBoxedType((EPTypeClass) initialization.getEvaluationType());<NEW_LINE>EPType innerType = innerExpression.getEvaluationType();<NEW_LINE>ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(initializationType, EnumAggregateScalar.class, scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMSCOLLOBJ);<NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>block.declareVar(initializationType, "value", initialization.evaluateCodegen(initializationType, methodNode, scope, codegenClassScope)).ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(ref("value"));<NEW_LINE>block.declareVar(ObjectArrayEventBean.EPTYPE, "event", newInstance(ObjectArrayEventBean.EPTYPE, newArrayByLength(EPTypePremade.OBJECT.getEPType(), constant(numParameters)), typeMember)).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("event")).declareVar(EPTypePremade.OBJECTARRAY.getEPType(), "props", exprDotMethod(<MASK><NEW_LINE>if (numParameters > 3) {<NEW_LINE>block.assignArrayElement("props", constant(3), exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "size"));<NEW_LINE>}<NEW_LINE>if (numParameters > 2) {<NEW_LINE>block.declareVar(EPTypePremade.INTEGERPRIMITIVE.getEPType(), "count", constant(-1));<NEW_LINE>}<NEW_LINE>CodegenBlock forEach = block.forEach(EPTypePremade.OBJECT.getEPType(), "next", EnumForgeCodegenNames.REF_ENUMCOLL).assignArrayElement("props", constant(0), ref("value")).assignArrayElement("props", constant(1), ref("next"));<NEW_LINE>if (numParameters > 2) {<NEW_LINE>forEach.incrementRef("count").assignArrayElement("props", constant(2), ref("count"));<NEW_LINE>}<NEW_LINE>if (innerType == EPTypeNull.INSTANCE) {<NEW_LINE>forEach.assignRef("value", constantNull());<NEW_LINE>} else {<NEW_LINE>forEach.assignRef("value", innerExpression.evaluateCodegen((EPTypeClass) innerType, methodNode, scope, codegenClassScope));<NEW_LINE>}<NEW_LINE>forEach.blockEnd();<NEW_LINE>block.methodReturn(ref("value"));<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(), premade.getExprCtx());<NEW_LINE>}
|
ref("event"), "getProperties"));
|
320,790
|
public ResponseEntity<BufferedImage> photo(@PathVariable String id, HttpServletRequest request) throws Exception {<NEW_LINE>InputStream photo = sparklrService.loadSparklrPhoto(id);<NEW_LINE>if (photo == null) {<NEW_LINE>throw new UnavailableException("The requested photo does not exist");<NEW_LINE>}<NEW_LINE>BufferedImage body;<NEW_LINE>MediaType contentType = MediaType.IMAGE_JPEG;<NEW_LINE>Iterator<ImageReader> imageReaders = ImageIO.getImageReadersByMIMEType(contentType.toString());<NEW_LINE>if (imageReaders.hasNext()) {<NEW_LINE>ImageReader imageReader = imageReaders.next();<NEW_LINE>ImageReadParam irp = imageReader.getDefaultReadParam();<NEW_LINE>imageReader.setInput(new MemoryCacheImageInputStream(photo), true);<NEW_LINE>body = imageReader.read(0, irp);<NEW_LINE>} else {<NEW_LINE>throw new HttpMessageNotReadableException("Could not find javax.imageio.ImageReader for Content-Type [" + contentType + "]");<NEW_LINE>}<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(MediaType.IMAGE_JPEG);<NEW_LINE>request.setAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, Collections.singleton(MediaType.IMAGE_JPEG));<NEW_LINE>return new ResponseEntity<BufferedImage>(<MASK><NEW_LINE>}
|
body, headers, HttpStatus.OK);
|
383,252
|
public void marshall(DefaultWorkspaceCreationProperties defaultWorkspaceCreationProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (defaultWorkspaceCreationProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(defaultWorkspaceCreationProperties.getEnableInternetAccess(), ENABLEINTERNETACCESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(defaultWorkspaceCreationProperties.getDefaultOu(), DEFAULTOU_BINDING);<NEW_LINE>protocolMarshaller.marshall(defaultWorkspaceCreationProperties.getCustomSecurityGroupId(), CUSTOMSECURITYGROUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(defaultWorkspaceCreationProperties.getUserEnabledAsLocalAdministrator(), USERENABLEDASLOCALADMINISTRATOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(defaultWorkspaceCreationProperties.getEnableMaintenanceMode(), ENABLEMAINTENANCEMODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
defaultWorkspaceCreationProperties.getEnableWorkDocs(), ENABLEWORKDOCS_BINDING);
|
1,033,697
|
public void read(org.apache.thrift.protocol.TProtocol prot, add_aggregate_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet <MASK><NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.mid = iprot.readI64();<NEW_LINE>struct.setMidIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.aggregate_name = iprot.readString();<NEW_LINE>struct.setAggregateNameIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.filter_id = iprot.readString();<NEW_LINE>struct.setFilterIdIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.aggregate_expr = iprot.readString();<NEW_LINE>struct.setAggregateExprIsSet(true);<NEW_LINE>}<NEW_LINE>}
|
incoming = iprot.readBitSet(4);
|
1,594,673
|
private static String versionString(ImmutableVersionConstraint version) {<NEW_LINE>String requiredVersion = version.getRequiredVersion();<NEW_LINE>String strictVersion = version.getStrictVersion();<NEW_LINE>String preferredVersion = version.getPreferredVersion();<NEW_LINE>List<String> rejectedVersions = version.getRejectedVersions();<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (rejectedVersions.isEmpty() && strictVersion.isEmpty() && preferredVersion.isEmpty()) {<NEW_LINE>// typical shortcut case, "foo='1.2'"<NEW_LINE>sb.append(quoted(requiredVersion));<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>sb.append("{ ");<NEW_LINE>List<String> parts = Lists.newArrayList();<NEW_LINE>if (!strictVersion.isEmpty()) {<NEW_LINE>parts.add(keyValuePair("strictly", strictVersion));<NEW_LINE>}<NEW_LINE>if (!preferredVersion.isEmpty()) {<NEW_LINE>parts.add<MASK><NEW_LINE>}<NEW_LINE>if (!requiredVersion.isEmpty() && strictVersion.isEmpty()) {<NEW_LINE>parts.add(keyValuePair("require", requiredVersion));<NEW_LINE>}<NEW_LINE>if (!rejectedVersions.isEmpty()) {<NEW_LINE>if (rejectedVersions.contains("+")) {<NEW_LINE>parts.add("rejectAll = true");<NEW_LINE>} else {<NEW_LINE>parts.add("reject = [" + rejectedVersions.stream().map(TomlWriter::quoted).collect(Collectors.joining(", ")) + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(String.join(", ", parts)).append(" }");<NEW_LINE>return sb.toString();<NEW_LINE>}
|
(keyValuePair("prefer", preferredVersion));
|
1,122,528
|
protected boolean beforeSave(boolean newRecord) {<NEW_LINE>// Client/Org Check<NEW_LINE>if (getAD_Org_ID() == 0) {<NEW_LINE>int contextOrgId = Env.getAD_Org_ID(getCtx());<NEW_LINE>if (contextOrgId != 0) {<NEW_LINE>setAD_Org_ID(contextOrgId);<NEW_LINE>log.warning("Changed Org to Context=" + contextOrgId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getAD_Client_ID() == 0) {<NEW_LINE>processMessage = "AD_Client_ID = 0";<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// New Record Doc Type - make sure DocType set to 0<NEW_LINE>if (newRecord && getC_DocType_ID() == 0)<NEW_LINE>setC_DocType_ID(0);<NEW_LINE>// Default Warehouse<NEW_LINE>if (getM_Warehouse_ID() == 0) {<NEW_LINE>int warehouseId = Env.getContextAsInt(getCtx(), "#M_Warehouse_ID");<NEW_LINE>if (warehouseId != 0)<NEW_LINE>setM_Warehouse_ID(warehouseId);<NEW_LINE>else {<NEW_LINE>log.saveError("FillMandatory", Msg.getElement(getCtx(), "M_Warehouse_ID"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reservations in Warehouse<NEW_LINE>if (!newRecord && is_ValueChanged("M_Warehouse_ID")) {<NEW_LINE>if (!getLines().stream().anyMatch(orderLine -> orderLine.canChangeWarehouse()))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// No Partner Info - set Template<NEW_LINE>if (getC_BPartner_ID() == 0)<NEW_LINE>setBPartner(MBPartner.getTemplate(getCtx(), getAD_Client_ID()));<NEW_LINE>if (getC_BPartner_Location_ID() == 0)<NEW_LINE>setBPartner(new MBPartner(getCtx(), getC_BPartner_ID(), null));<NEW_LINE>// Default Sales Rep<NEW_LINE>if (getSalesRep_ID() == 0) {<NEW_LINE>int userId = Env.<MASK><NEW_LINE>if (userId != 0)<NEW_LINE>setSalesRep_ID(userId);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
getContextAsInt(getCtx(), "#AD_User_ID");
|
127,714
|
public void onMotionEvent(MotionEvent ev) {<NEW_LINE>if (mVelocityTracker == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mVelocityTracker.addMovement(ev);<NEW_LINE>switch(ev.getActionMasked()) {<NEW_LINE>case ACTION_DOWN:<NEW_LINE>{<NEW_LINE>mDownPos.set(ev.getX(), ev.getY());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_MOVE:<NEW_LINE>{<NEW_LINE>if (!mInterceptedTouch) {<NEW_LINE>float displacementX = ev<MASK><NEW_LINE>float displacementY = ev.getY() - mDownPos.y;<NEW_LINE>if (squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop) {<NEW_LINE>if (mDisableHorizontalSwipe && Math.abs(displacementX) > Math.abs(displacementY)) {<NEW_LINE>// Horizontal gesture is not allowed in this region<NEW_LINE>endTouchTracking();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>mInterceptedTouch = true;<NEW_LINE>if (mOnInterceptTouch != null) {<NEW_LINE>mOnInterceptTouch.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_CANCEL:<NEW_LINE>endTouchTracking();<NEW_LINE>break;<NEW_LINE>case ACTION_UP:<NEW_LINE>{<NEW_LINE>onGestureEnd(ev);<NEW_LINE>endTouchTracking();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.getX() - mDownPos.x;
|
1,330,385
|
private JFieldVar createStaticField(EReceiverHolder holder, String prefix, String methodName, String[] values) {<NEW_LINE>String staticFieldName = CaseHelper.camelCaseToUpperSnakeCase(prefix, methodName, null);<NEW_LINE>if (values == null || values.length == 0) {<NEW_LINE>return null;<NEW_LINE>} else if (values.length == 1) {<NEW_LINE>return holder.getGeneratedClass().field(PUBLIC | STATIC | FINAL, getClasses().STRING, staticFieldName, lit(values[0]));<NEW_LINE>}<NEW_LINE>JInvocation asListInvoke = getClasses().ARRAYS.staticInvoke("asList");<NEW_LINE>for (String scheme : values) {<NEW_LINE>asListInvoke.arg(scheme);<NEW_LINE>}<NEW_LINE>AbstractJClass listOfStrings = getClasses().LIST.<MASK><NEW_LINE>return holder.getGeneratedClass().field(PUBLIC | STATIC | FINAL, listOfStrings, staticFieldName, asListInvoke);<NEW_LINE>}
|
narrow(getClasses().STRING);
|
438,121
|
final ListGroupMembershipsResult executeListGroupMemberships(ListGroupMembershipsRequest listGroupMembershipsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listGroupMembershipsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListGroupMembershipsRequest> request = null;<NEW_LINE>Response<ListGroupMembershipsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListGroupMembershipsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listGroupMembershipsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListGroupMemberships");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListGroupMembershipsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListGroupMembershipsResultJsonUnmarshaller());<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>}
|
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
|
586,287
|
private static void tryPattern(RegressionEnvironment env, String text, AtomicInteger milestone, Integer[] intBoxedA, Double[] doubleBoxedA, Integer[] intBoxedB, Double[] doubleBoxedB, boolean[] expected) {<NEW_LINE>assertEquals(intBoxedA.length, doubleBoxedA.length);<NEW_LINE>assertEquals(intBoxedB.length, doubleBoxedB.length);<NEW_LINE>assertEquals(<MASK><NEW_LINE>assertEquals(intBoxedA.length, doubleBoxedB.length);<NEW_LINE>for (int i = 0; i < intBoxedA.length; i++) {<NEW_LINE>env.compileDeploy("@name('s0') " + text).addListener("s0");<NEW_LINE>sendBeanIntDouble(env, intBoxedA[i], doubleBoxedA[i]);<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendBeanIntDouble(env, intBoxedB[i], doubleBoxedB[i]);<NEW_LINE>int index = i;<NEW_LINE>env.assertListener("s0", listener -> assertEquals("failed at index " + index, expected[index], listener.getAndClearIsInvoked()));<NEW_LINE>env.undeployAll();<NEW_LINE>}<NEW_LINE>}
|
expected.length, doubleBoxedA.length);
|
1,642,700
|
private void expandExternals(MaterialConfig configuredMaterial, MaterialConfigs expandedMaterials) {<NEW_LINE>SvnMaterialConfig svnMaterialConfig = (SvnMaterialConfig) configuredMaterial;<NEW_LINE>if (!svnMaterialConfig.isCheckExternals()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<SvnExternal> urLs = svn(svnMaterialConfig).getAllExternalURLs();<NEW_LINE>for (SvnExternal externalUrl : urLs) {<NEW_LINE>SvnMaterialConfig svnMaterial = new SvnMaterialConfig();<NEW_LINE>svnMaterial.setUrl(externalUrl.getURL());<NEW_LINE>svnMaterial.setUserName(svnMaterialConfig.getUserName());<NEW_LINE>svnMaterial.setPassword(svnMaterialConfig.getPassword());<NEW_LINE>svnMaterial.setCheckExternals(true);<NEW_LINE>svnMaterial.setFolder(svnMaterialConfig.folderFor(externalUrl.getFolder()));<NEW_LINE>svnMaterial.<MASK><NEW_LINE>expandedMaterials.add(svnMaterial);<NEW_LINE>}<NEW_LINE>}
|
setFilter(svnMaterialConfig.filter());
|
107,709
|
public DescribeResourcePoliciesResult describeResourcePolicies(DescribeResourcePoliciesRequest describeResourcePoliciesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeResourcePoliciesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeResourcePoliciesRequest> request = null;<NEW_LINE>Response<DescribeResourcePoliciesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeResourcePoliciesResult, JsonUnmarshallerContext> unmarshaller = new DescribeResourcePoliciesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeResourcePoliciesResult> responseHandler = new JsonResponseHandler<DescribeResourcePoliciesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
|
DescribeResourcePoliciesRequestMarshaller().marshall(describeResourcePoliciesRequest);
|
276,409
|
protected AuthenticatedUserDisplayInfo parseActivitiesResponse(String responseBody) {<NEW_LINE>DocumentBuilderFactory dbFact = DocumentBuilderFactory.newInstance();<NEW_LINE>try (StringReader reader = new StringReader(responseBody)) {<NEW_LINE>DocumentBuilder db = dbFact.newDocumentBuilder();<NEW_LINE>Document doc = db.parse(new InputSource(reader));<NEW_LINE>String organization = getNodes(doc, "activities:employments", "employment:employment-summary", "employment:organization", "common:name").stream().findFirst().map(Node::getTextContent).map(String::trim).orElse(null);<NEW_LINE>String department = getNodes(doc, "activities:employments", "employment:employment-summary", "employment:department-name").stream().findFirst().map(Node::getTextContent).map(String::trim).orElse(null);<NEW_LINE>String role = getNodes(doc, "activities:employments", "employment:employment-summary", "employment:role-title").stream().findFirst().map(Node::getTextContent).map(String::trim).orElse(null);<NEW_LINE>String position = Stream.of(role, department).filter(Objects::nonNull).collect(joining(", "));<NEW_LINE>return new AuthenticatedUserDisplayInfo(null, <MASK><NEW_LINE>} catch (SAXException ex) {<NEW_LINE>logger.log(Level.SEVERE, "XML error parsing response body from ORCiD: " + ex.getMessage(), ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.SEVERE, "I/O error parsing response body from ORCiD: " + ex.getMessage(), ex);<NEW_LINE>} catch (ParserConfigurationException ex) {<NEW_LINE>logger.log(Level.SEVERE, "While parsing the ORCiD response: Bad parse configuration. " + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
null, null, organization, position);
|
1,281,545
|
private String runLiquid(final String templateSource, final Map<String, Object> templateParams, final String templateIncludePath) throws IOException {<NEW_LINE>// TODO: Check if it is required to process JRuby options.<NEW_LINE>final ScriptingContainerDelegate localJRubyContainer = LazyScriptingContainerDelegate.withGems(rootLogger, this.embulkSystemProperties);<NEW_LINE>if (localJRubyContainer == null) {<NEW_LINE>// TODO: Handle the exception better and have a better error message.<NEW_LINE>throw new IOException("JRuby is not configured well to run Liquid. Configure the Embulk system property \"jruby\".");<NEW_LINE>}<NEW_LINE>localJRubyContainer.runScriptlet("require 'liquid'");<NEW_LINE>localJRubyContainer.put("__internal_liquid_template_source__", templateSource);<NEW_LINE>localJRubyContainer.runScriptlet("template = Liquid::Template.parse(__internal_liquid_template_source__, :error_mode => :strict)");<NEW_LINE>localJRubyContainer.remove("__internal_liquid_template_source__");<NEW_LINE>if (templateIncludePath != null) {<NEW_LINE>localJRubyContainer.put("__internal_liquid_template_include_path_java__", templateIncludePath);<NEW_LINE>localJRubyContainer.runScriptlet("__internal_liquid_template_include_path__ = File.expand_path(__internal_liquid_template_include_path_java__ || File.dirname(config)) unless __internal_liquid_template_include_path_java__ == false");<NEW_LINE>localJRubyContainer.runScriptlet("template.registers[:file_system] = Liquid::LocalFileSystem.new(__internal_liquid_template_include_path__, \"_%s.yml.liquid\")");<NEW_LINE>localJRubyContainer.remove("__internal_liquid_template_include_path__");<NEW_LINE>}<NEW_LINE>// TODO: Convert |templateParams| recursively to Ruby's Hash.<NEW_LINE>localJRubyContainer.put("__internal_liquid_template_params__", templateParams);<NEW_LINE>localJRubyContainer.runScriptlet("__internal_liquid_template_data__ = { 'env' => ENV.to_h }.merge(__internal_liquid_template_params__)");<NEW_LINE>localJRubyContainer.remove("__internal_liquid_template_params__");<NEW_LINE>final Object <MASK><NEW_LINE>return renderedObject.toString();<NEW_LINE>}
|
renderedObject = localJRubyContainer.runScriptlet("template.render(__internal_liquid_template_data__)");
|
293,069
|
static void delFixedAttr(Frame frame, Object self, @SuppressWarnings("unused") String name, @SuppressWarnings("unused") Object value, @SuppressWarnings("unused") @Cached("name") String cachedName, @Shared("getClass") @Cached GetClassNode getClass, @Shared("lookupDel") @Cached(parameters = "DelAttr") LookupSpecialMethodSlotNode lookupDelattr, @Shared("lookupGet") @Cached(parameters = "GetAttribute") LookupSpecialMethodSlotNode lookupGetattr, @Shared("raise") @Cached PRaiseNode raise, @Shared("callDel") @Cached CallBinaryMethodNode callDelattr) {<NEW_LINE>Object type = getClass.execute(self);<NEW_LINE>Object delattr = lookupDelattr.<MASK><NEW_LINE>if (delattr == PNone.NO_VALUE) {<NEW_LINE>if (lookupGetattr.execute(frame, type, self) == PNone.NO_VALUE) {<NEW_LINE>throw raise.raise(TypeError, P_HAS_NO_ATTRS_S_TO_DELETE, self, name);<NEW_LINE>} else {<NEW_LINE>throw raise.raise(TypeError, P_HAS_RO_ATTRS_S_TO_DELETE, self, name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>callDelattr.executeObject(frame, delattr, self, name);<NEW_LINE>}
|
execute(frame, type, self);
|
377,113
|
public void run() throws InterruptedException {<NEW_LINE><MASK><NEW_LINE>CountDownLatch countdownLatch = new CountDownLatch(1);<NEW_LINE>// The connection string value can be obtained by:<NEW_LINE>// 1. Going to your Service Bus namespace in Azure Portal.<NEW_LINE>// 2. Go to "Shared access policies"<NEW_LINE>// 3. Copy the connection string for the "RootManageSharedAccessKey" policy.<NEW_LINE>// The 'connectionString' format is shown below.<NEW_LINE>// 1. "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}"<NEW_LINE>// 2. "<<fully-qualified-namespace>>" will look similar to "{your-namespace}.servicebus.windows.net"<NEW_LINE>// 3. "queueName" will be the name of the Service Bus queue instance you created<NEW_LINE>// inside the Service Bus namespace.<NEW_LINE>// Create a receiver using connection string.<NEW_LINE>ServiceBusReceiverAsyncClient receiver = new ServiceBusClientBuilder().connectionString(connectionString).receiver().queueName(queueName).buildAsyncClient();<NEW_LINE>receiver.peekMessage().subscribe(message -> {<NEW_LINE>System.out.println("Received Message Id: " + message.getMessageId());<NEW_LINE>System.out.println("Received Message: " + message.getBody().toString());<NEW_LINE>}, error -> System.err.println("Error occurred while receiving message: " + error), () -> {<NEW_LINE>System.out.println("Receiving complete.");<NEW_LINE>sampleSuccessful.set(true);<NEW_LINE>});<NEW_LINE>// Subscribe is not a blocking call so we wait here so the program does not end while finishing<NEW_LINE>// the peek operation.<NEW_LINE>countdownLatch.await(10, TimeUnit.SECONDS);<NEW_LINE>// Close the receiver.<NEW_LINE>receiver.close();<NEW_LINE>// This assertion is to ensure that samples are working. Users should remove this.<NEW_LINE>Assertions.assertTrue(sampleSuccessful.get());<NEW_LINE>}
|
AtomicBoolean sampleSuccessful = new AtomicBoolean(false);
|
436,234
|
public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) {<NEW_LINE>List<OneOffWhiteListEntry> entries = data.getLeft();<NEW_LINE>Integer disableBlockHeight = data.getRight();<NEW_LINE>int serializationSize = entries.size() * 2 + 1;<NEW_LINE>byte[][] serializedLockWhitelist = new byte[serializationSize][];<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>OneOffWhiteListEntry <MASK><NEW_LINE>serializedLockWhitelist[2 * i] = RLP.encodeElement(entry.address().getHash160());<NEW_LINE>serializedLockWhitelist[2 * i + 1] = RLP.encodeBigInteger(BigInteger.valueOf(entry.maxTransferValue().longValue()));<NEW_LINE>}<NEW_LINE>serializedLockWhitelist[serializationSize - 1] = RLP.encodeBigInteger(BigInteger.valueOf(disableBlockHeight));<NEW_LINE>return RLP.encodeList(serializedLockWhitelist);<NEW_LINE>}
|
entry = entries.get(i);
|
1,430,375
|
public static DescribePdnsOperateLogsResponse unmarshall(DescribePdnsOperateLogsResponse describePdnsOperateLogsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePdnsOperateLogsResponse.setRequestId(_ctx.stringValue("DescribePdnsOperateLogsResponse.RequestId"));<NEW_LINE>describePdnsOperateLogsResponse.setTotalCount(_ctx.longValue("DescribePdnsOperateLogsResponse.TotalCount"));<NEW_LINE>describePdnsOperateLogsResponse.setPageSize(_ctx.longValue("DescribePdnsOperateLogsResponse.PageSize"));<NEW_LINE>describePdnsOperateLogsResponse.setPageNumber(_ctx.longValue("DescribePdnsOperateLogsResponse.PageNumber"));<NEW_LINE>List<Log> logs <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePdnsOperateLogsResponse.Logs.Length"); i++) {<NEW_LINE>Log log = new Log();<NEW_LINE>log.setOperateTime(_ctx.stringValue("DescribePdnsOperateLogsResponse.Logs[" + i + "].OperateTime"));<NEW_LINE>log.setAction(_ctx.stringValue("DescribePdnsOperateLogsResponse.Logs[" + i + "].Action"));<NEW_LINE>log.setType(_ctx.stringValue("DescribePdnsOperateLogsResponse.Logs[" + i + "].Type"));<NEW_LINE>log.setContent(_ctx.stringValue("DescribePdnsOperateLogsResponse.Logs[" + i + "].content"));<NEW_LINE>logs.add(log);<NEW_LINE>}<NEW_LINE>describePdnsOperateLogsResponse.setLogs(logs);<NEW_LINE>return describePdnsOperateLogsResponse;<NEW_LINE>}
|
= new ArrayList<Log>();
|
964,902
|
public void storeSettings() {<NEW_LINE>GlobalCitationKeyPattern newKeyPattern = new GlobalCitationKeyPattern(initialCitationKeyPatternPreferences.getKeyPattern().getDefaultValue());<NEW_LINE>patternListProperty.forEach(item -> {<NEW_LINE>String patternString = item.getPattern();<NEW_LINE>if (!item.getEntryType().getName().equals("default")) {<NEW_LINE>if (!patternString.trim().isEmpty()) {<NEW_LINE>newKeyPattern.addCitationKeyPattern(item.getEntryType(), patternString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!defaultKeyPatternProperty.getValue().getPattern().trim().isEmpty()) {<NEW_LINE>// we do not trim the value at the assignment to enable users to have spaces at the beginning and<NEW_LINE>// at the end of the pattern<NEW_LINE>newKeyPattern.setDefaultValue(defaultKeyPatternProperty.getValue().getPattern());<NEW_LINE>}<NEW_LINE>CitationKeyPatternPreferences.<MASK><NEW_LINE>if (letterStartAProperty.getValue()) {<NEW_LINE>keySuffix = CitationKeyPatternPreferences.KeySuffix.SECOND_WITH_A;<NEW_LINE>} else if (letterStartBProperty.getValue()) {<NEW_LINE>keySuffix = CitationKeyPatternPreferences.KeySuffix.SECOND_WITH_B;<NEW_LINE>}<NEW_LINE>preferences.storeCitationKeyPatternPreferences(new CitationKeyPatternPreferences(!overwriteAllowProperty.getValue(), overwriteWarningProperty.getValue(), generateOnSaveProperty.getValue(), keySuffix, keyPatternRegexProperty.getValue(), keyPatternReplacementProperty.getValue(), unwantedCharactersProperty.getValue(), newKeyPattern, initialCitationKeyPatternPreferences.getKeywordDelimiter()));<NEW_LINE>}
|
KeySuffix keySuffix = CitationKeyPatternPreferences.KeySuffix.ALWAYS;
|
1,819,695
|
/*<NEW_LINE>public void userFeatureArrToSerializable() throws Exception {<NEW_LINE>Business businessEjb = IiopLogic.lookupBusiness(orb);<NEW_LINE>UserFeatureService a = new UserFeatureService("user feature 1");<NEW_LINE>UserFeatureService b = new UserFeatureService("user feature 2");<NEW_LINE><MASK><NEW_LINE>UserFeatureService[] arr = { a, b, c };<NEW_LINE>Serializable se = arr;<NEW_LINE>Assert.assertArrayEquals((Object[]) se, (Object[]) businessEjb.takesSerializable(arr));<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Test<NEW_LINE>public void stubToEjbIface() throws Exception {<NEW_LINE>Business businessEjb = IiopLogic.lookupBusiness(orb);<NEW_LINE>TestRemote testEjb = IiopLogic.lookupEjb(orb);<NEW_LINE>TestRemote iface = testEjb;<NEW_LINE>Assert.assertEquals(iface, businessEjb.takesEjbIface(testEjb));<NEW_LINE>}
|
UserFeatureService c = new UserFeatureService("user feature 3");
|
180,147
|
private void presentActionDone() {<NEW_LINE>switch(model.getOperation()) {<NEW_LINE>case UNINSTALL:<NEW_LINE>component.setHeadAndContent(UninstallStep_Header_UninstallDone_Head(), UninstallStep_Header_UninstallDone_Content());<NEW_LINE>break;<NEW_LINE>case ENABLE:<NEW_LINE>component.setHeadAndContent(UninstallStep_Header_ActivateDone_Head(), UninstallStep_Header_ActivateDone_Content());<NEW_LINE>break;<NEW_LINE>case DISABLE:<NEW_LINE>component.setHeadAndContent(UninstallStep_Header_DeactivateDone_Head(), UninstallStep_Header_DeactivateDone_Content());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false : "Unknown OperationType " + model.getOperation();<NEW_LINE>}<NEW_LINE>model.modifyOptionsForDoClose(wd);<NEW_LINE>switch(model.getOperation()) {<NEW_LINE>case UNINSTALL:<NEW_LINE>panel.setBody(UninstallStep_UninstallDone_Text(), model.getAllVisibleUpdateElements());<NEW_LINE>break;<NEW_LINE>case ENABLE:<NEW_LINE>panel.setBody(UninstallStep_ActivateDone_Text(), model.getAllVisibleUpdateElements());<NEW_LINE>break;<NEW_LINE>case DISABLE:<NEW_LINE>panel.setBody(UninstallStep_DeactivateDone_Text(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false : "Unknown OperationType " + model.getOperation();<NEW_LINE>}<NEW_LINE>}
|
), model.getAllVisibleUpdateElements());
|
996,952
|
public static void putLongToBytes(byte[] bytes, int offset, long l) {<NEW_LINE>bytes[offset] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 1] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 2] = <MASK><NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 3] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 4] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 5] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 6] = (byte) (l & 0xff);<NEW_LINE>l >>= 8;<NEW_LINE>bytes[offset + 7] = (byte) (l & 0xff);<NEW_LINE>}
|
(byte) (l & 0xff);
|
1,689,426
|
protected ValuesSourceAggregatorFactory innerBuild(AggregationContext context, ValuesSourceConfig config, AggregatorFactory parent, Builder subFactoriesBuilder) throws IOException {<NEW_LINE>AutoDateHistogramAggregatorSupplier aggregatorSupplier = context.getValuesSourceRegistry().getAggregator(REGISTRY_KEY, config);<NEW_LINE>RoundingInfo[] roundings = buildRoundings(<MASK><NEW_LINE>int maxRoundingInterval = Arrays.stream(roundings, 0, roundings.length - 1).map(rounding -> rounding.innerIntervals).flatMapToInt(Arrays::stream).boxed().reduce(Integer::max).get();<NEW_LINE>Settings settings = context.getIndexSettings().getNodeSettings();<NEW_LINE>int maxBuckets = MultiBucketConsumerService.MAX_BUCKET_SETTING.get(settings);<NEW_LINE>int bucketCeiling = maxBuckets / maxRoundingInterval;<NEW_LINE>if (numBuckets > bucketCeiling) {<NEW_LINE>throw new IllegalArgumentException(NUM_BUCKETS_FIELD.getPreferredName() + " must be less than " + bucketCeiling);<NEW_LINE>}<NEW_LINE>return new AutoDateHistogramAggregatorFactory(name, config, numBuckets, roundings, context, parent, subFactoriesBuilder, metadata, aggregatorSupplier);<NEW_LINE>}
|
timeZone(), getMinimumIntervalExpression());
|
343,389
|
private BestellungAntwortPosition toJAXB(final OrderResponsePackageItem orderPackageItem) {<NEW_LINE>final int qty = orderPackageItem.getQty().getValueAsInt();<NEW_LINE>final ImmutableList<BestellungAnteil> soapItemParts;<NEW_LINE>if (orderPackageItem.getParts().isEmpty()) {<NEW_LINE>final BestellungAnteil soapItemPart = jaxbObjectFactory.createBestellungAnteil();<NEW_LINE>soapItemPart.setMenge(qty);<NEW_LINE>soapItemPart.setTyp(BestellungRueckmeldungTyp.NORMAL);<NEW_LINE>soapItemPart.setGrund(BestellungDefektgrund.KEINE_ANGABE);<NEW_LINE>// FIXME: hardcoded<NEW_LINE>soapItemPart.setLieferzeitpunkt(JAXBDateUtils.toXMLGregorianCalendar(LocalDateTime.now().plusDays(1)));<NEW_LINE>// FIXME: hardcoded<NEW_LINE>soapItemPart.setTourId("1");<NEW_LINE>soapItemParts = ImmutableList.of(soapItemPart);<NEW_LINE>} else {<NEW_LINE>soapItemParts = orderPackageItem.getParts().stream().map(this::toJAXB).collect(ImmutableList.toImmutableList());<NEW_LINE>}<NEW_LINE>final BestellungAntwortPosition soapItem = jaxbObjectFactory.createBestellungAntwortPosition();<NEW_LINE>soapItem.setBestellPzn(orderPackageItem.getPzn().getValueAsLong());<NEW_LINE>soapItem.setBestellMenge(qty);<NEW_LINE>soapItem.setBestellLiefervorgabe(orderPackageItem.<MASK><NEW_LINE>soapItem.getAnteile().addAll(soapItemParts);<NEW_LINE>soapItem.setSubstitution(toJAXB(orderPackageItem.getSubstitution()));<NEW_LINE>return soapItem;<NEW_LINE>}
|
getDeliverySpecifications().getV1SoapCode());
|
1,586,750
|
SaveReturn printHtml(final File f) {<NEW_LINE>Future<Object> waiter = mainFrame.getBackgroundExecutor().submit(() -> {<NEW_LINE>HTMLBugReporter reporter = new HTMLBugReporter(<MASK><NEW_LINE>reporter.setIsRelaxed(true);<NEW_LINE>reporter.setOutputStream(UTF8.printStream(new FileOutputStream(f)));<NEW_LINE>for (BugInstance bug : mainFrame.getBugCollection().getCollection()) {<NEW_LINE>try {<NEW_LINE>if (mainFrame.getViewFilter().show(bug)) {<NEW_LINE>reporter.reportBug(bug);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reporter.finish();<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>waiter.get();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return SaveReturn.SAVE_ERROR;<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>return SaveReturn.SAVE_ERROR;<NEW_LINE>}<NEW_LINE>return SaveReturn.SAVE_SUCCESSFUL;<NEW_LINE>}
|
mainFrame.getProject(), "default.xsl");
|
458,508
|
public final SubQueryExprContext subQueryExpr() throws RecognitionException {<NEW_LINE>SubQueryExprContext _localctx = new SubQueryExprContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 340, RULE_subQueryExpr);<NEW_LINE>paraphrases.push("subquery");<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(2342);<NEW_LINE>match(LPAREN);<NEW_LINE>setState(2343);<NEW_LINE>match(SELECT);<NEW_LINE>setState(2345);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == DISTINCT) {<NEW_LINE>{<NEW_LINE>setState(2344);<NEW_LINE>match(DISTINCT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2347);<NEW_LINE>selectionList();<NEW_LINE>setState(2348);<NEW_LINE>match(FROM);<NEW_LINE>setState(2349);<NEW_LINE>subSelectFilterExpr();<NEW_LINE>setState(2352);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == WHERE) {<NEW_LINE>{<NEW_LINE>setState(2350);<NEW_LINE>match(WHERE);<NEW_LINE>setState(2351);<NEW_LINE>whereClause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2357);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>if (_la == GROUP) {<NEW_LINE>{<NEW_LINE>setState(2354);<NEW_LINE>match(GROUP);<NEW_LINE>setState(2355);<NEW_LINE>match(BY);<NEW_LINE>setState(2356);<NEW_LINE>groupByListExpr();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2361);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == HAVING) {<NEW_LINE>{<NEW_LINE>setState(2359);<NEW_LINE>match(HAVING);<NEW_LINE>setState(2360);<NEW_LINE>havingClause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2363);<NEW_LINE>match(RPAREN);<NEW_LINE>}<NEW_LINE>_ctx.stop = _input.LT(-1);<NEW_LINE>paraphrases.pop();<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
|
_la = _input.LA(1);
|
1,619,425
|
private void configureColumn(int type, boolean indexFlag, int index) {<NEW_LINE>final MemoryMA primary;<NEW_LINE>final MemoryMA secondary;<NEW_LINE>final MemoryCARW oooPrimary;<NEW_LINE>final MemoryCARW oooSecondary;<NEW_LINE>final MemoryCARW oooPrimary2;<NEW_LINE>final MemoryCARW oooSecondary2;<NEW_LINE>if (type > 0) {<NEW_LINE>primary = Vm.getMAInstance();<NEW_LINE>oooPrimary = Vm.getCARWInstance(o3ColumnMemorySize, Integer.MAX_VALUE, MemoryTag.NATIVE_O3);<NEW_LINE>oooPrimary2 = Vm.getCARWInstance(o3ColumnMemorySize, Integer.MAX_VALUE, MemoryTag.NATIVE_O3);<NEW_LINE>switch(ColumnType.tagOf(type)) {<NEW_LINE>case ColumnType.BINARY:<NEW_LINE>case ColumnType.STRING:<NEW_LINE>secondary = Vm.getMAInstance();<NEW_LINE>oooSecondary = Vm.getCARWInstance(o3ColumnMemorySize, Integer.MAX_VALUE, MemoryTag.NATIVE_O3);<NEW_LINE>oooSecondary2 = Vm.getCARWInstance(o3ColumnMemorySize, Integer.MAX_VALUE, MemoryTag.NATIVE_O3);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>secondary = null;<NEW_LINE>oooSecondary = null;<NEW_LINE>oooSecondary2 = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>primary = secondary = NullMemory.INSTANCE;<NEW_LINE>oooPrimary = oooSecondary <MASK><NEW_LINE>}<NEW_LINE>int baseIndex = getPrimaryColumnIndex(index);<NEW_LINE>columns.extendAndSet(baseIndex, primary);<NEW_LINE>columns.extendAndSet(baseIndex + 1, secondary);<NEW_LINE>o3Columns.extendAndSet(baseIndex, oooPrimary);<NEW_LINE>o3Columns.extendAndSet(baseIndex + 1, oooSecondary);<NEW_LINE>o3Columns2.extendAndSet(baseIndex, oooPrimary2);<NEW_LINE>o3Columns2.extendAndSet(baseIndex + 1, oooSecondary2);<NEW_LINE>configureNullSetters(nullSetters, type, primary, secondary);<NEW_LINE>configureNullSetters(o3NullSetters, type, oooPrimary, oooSecondary);<NEW_LINE>if (indexFlag) {<NEW_LINE>indexers.extendAndSet((columns.size() - 1) / 2, new SymbolColumnIndexer());<NEW_LINE>}<NEW_LINE>rowValueIsNotNull.add(0);<NEW_LINE>}
|
= oooPrimary2 = oooSecondary2 = NullMemory.INSTANCE;
|
643,664
|
private void assignGroupsToDatasets() throws JRException {<NEW_LINE>for (Iterator<JRElementDataset> it = groupBoundDatasets.iterator(); it.hasNext(); ) {<NEW_LINE>JRDesignElementDataset dataset = (JRDesignElementDataset) it.next();<NEW_LINE>JRDatasetRun datasetRun = dataset.getDatasetRun();<NEW_LINE>Map<String, JRGroup> groupsMap;<NEW_LINE>if (datasetRun == null) {<NEW_LINE>groupsMap = jasperDesign.getGroupsMap();<NEW_LINE>} else {<NEW_LINE>Map<String, JRDataset> datasetMap = jasperDesign.getDatasetMap();<NEW_LINE>String datasetName = datasetRun.getDatasetName();<NEW_LINE>JRDesignDataset subDataset = (JRDesignDataset) datasetMap.get(datasetName);<NEW_LINE>if (subDataset == null) {<NEW_LINE>throw new JRException(EXCEPTION_MESSAGE_KEY_UNKNOWN_SUBDATASET, <MASK><NEW_LINE>}<NEW_LINE>groupsMap = subDataset.getGroupsMap();<NEW_LINE>}<NEW_LINE>if (dataset.getIncrementTypeValue() == IncrementTypeEnum.GROUP) {<NEW_LINE>String groupName = null;<NEW_LINE>JRGroup group = dataset.getIncrementGroup();<NEW_LINE>if (group != null) {<NEW_LINE>groupName = group.getName();<NEW_LINE>group = groupsMap.get(group.getName());<NEW_LINE>}<NEW_LINE>if (!ignoreConsistencyProblems && group == null) {<NEW_LINE>throw new JRValidationException("Unknown increment group '" + groupName + "' for chart dataset.", dataset);<NEW_LINE>}<NEW_LINE>dataset.setIncrementGroup(group);<NEW_LINE>} else {<NEW_LINE>dataset.setIncrementGroup(null);<NEW_LINE>}<NEW_LINE>if (dataset.getDatasetResetType() == DatasetResetTypeEnum.GROUP) {<NEW_LINE>String groupName = null;<NEW_LINE>JRGroup group = dataset.getResetGroup();<NEW_LINE>if (group != null) {<NEW_LINE>groupName = group.getName();<NEW_LINE>group = groupsMap.get(group.getName());<NEW_LINE>}<NEW_LINE>if (!ignoreConsistencyProblems && group == null) {<NEW_LINE>throw new JRValidationException("Unknown reset group '" + groupName + "' for chart dataset.", dataset);<NEW_LINE>}<NEW_LINE>dataset.setResetGroup(group);<NEW_LINE>} else {<NEW_LINE>dataset.setResetGroup(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
new Object[] { datasetName });
|
1,631,533
|
// ///////////////////////////////////////////////////<NEW_LINE>// ///////////// API Implementation///////////////////<NEW_LINE>// ///////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {<NEW_LINE>final DataCenter dataCenter = _resourceService.getZone(getZoneId());<NEW_LINE>if (dataCenter == null) {<NEW_LINE>throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find zone by ID: " + getZoneId());<NEW_LINE>}<NEW_LINE>List<? extends VsphereStoragePolicy> storagePolicies = _vmwareDatacenterService.importVsphereStoragePolicies(this);<NEW_LINE>final ListResponse<VsphereStoragePoliciesResponse> responseList = new ListResponse<>();<NEW_LINE>final List<VsphereStoragePoliciesResponse> storagePoliciesResponseList = new ArrayList<>();<NEW_LINE>for (VsphereStoragePolicy storagePolicy : storagePolicies) {<NEW_LINE>final VsphereStoragePoliciesResponse storagePoliciesResponse = new VsphereStoragePoliciesResponse();<NEW_LINE>storagePoliciesResponse.setZoneId(dataCenter.getUuid());<NEW_LINE>storagePoliciesResponse.setId(storagePolicy.getUuid());<NEW_LINE>storagePoliciesResponse.setName(storagePolicy.getName());<NEW_LINE>storagePoliciesResponse.setPolicyId(storagePolicy.getPolicyId());<NEW_LINE>storagePoliciesResponse.setDescription(storagePolicy.getDescription());<NEW_LINE>storagePoliciesResponse.setObjectName("StoragePolicy");<NEW_LINE>storagePoliciesResponseList.add(storagePoliciesResponse);<NEW_LINE>}<NEW_LINE>responseList.setResponses(storagePoliciesResponseList);<NEW_LINE><MASK><NEW_LINE>setResponseObject(responseList);<NEW_LINE>}
|
responseList.setResponseName(getCommandName());
|
1,825,956
|
static protected int isSimpleAsFeature(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, NonSimpleResult result, ProgressTracker progressTracker) {<NEW_LINE>if (result != null) {<NEW_LINE>result.m_reason = NonSimpleResult.Reason.NotDetermined;<NEW_LINE>result.m_vertexIndex1 = -1;<NEW_LINE>result.m_vertexIndex2 = -1;<NEW_LINE>}<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return 1;<NEW_LINE>Geometry.Type gt = geometry.getType();<NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return 1;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new Polyline(seg.getDescription());<NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return isSimpleAsFeature(polyline, <MASK><NEW_LINE>}<NEW_LINE>// double geomTolerance = 0;<NEW_LINE>int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl()).getIsSimple(tolerance);<NEW_LINE>int knownSimpleResult = bForce ? -1 : isSimple;<NEW_LINE>// TODO: need to distinguish KnownSimple between SimpleAsFeature and<NEW_LINE>// SimplePlanar.<NEW_LINE>// From the first sight it seems the SimplePlanar implies<NEW_LINE>// SimpleAsFeature.<NEW_LINE>if (knownSimpleResult != -1)<NEW_LINE>return knownSimpleResult;<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, false);<NEW_LINE>if (gt == Geometry.Type.MultiPoint) {<NEW_LINE>knownSimpleResult = helper.multiPointIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polyline) {<NEW_LINE>knownSimpleResult = helper.polylineIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polygon) {<NEW_LINE>knownSimpleResult = helper.polygonIsSimpleAsFeature_();<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>((MultiVertexGeometryImpl) (geometry._getImpl())).setIsSimple(knownSimpleResult, tolerance, false);<NEW_LINE>if (result != null && knownSimpleResult == 0)<NEW_LINE>result.Assign(helper.m_nonSimpleResult);<NEW_LINE>return knownSimpleResult;<NEW_LINE>}
|
spatialReference, bForce, result, progressTracker);
|
1,203,988
|
private void virtualSwap(List<DataDivision> dataDivisionList, int a, int b) {<NEW_LINE>DataDivision divA = null;<NEW_LINE>DataDivision divB = null;<NEW_LINE>int offsetA = 0;<NEW_LINE>int offsetB = 0;<NEW_LINE>// Find points a and b in the collections.<NEW_LINE>int baseIndex = 0;<NEW_LINE>for (DataDivision division : dataDivisionList) {<NEW_LINE>baseIndex += division.getCount();<NEW_LINE>if (divA == null && a < baseIndex) {<NEW_LINE>divA = division;<NEW_LINE>offsetA = a - (baseIndex - division.getCount());<NEW_LINE>}<NEW_LINE>if (divB == null && b < baseIndex) {<NEW_LINE>divB = division;<NEW_LINE>offsetB = b - (baseIndex - division.getCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Swap a and b.<NEW_LINE>int temp = <MASK><NEW_LINE>divA.getMask()[offsetA] = divB.getMask()[offsetB];<NEW_LINE>divB.getMask()[offsetB] = temp;<NEW_LINE>}
|
divA.getMask()[offsetA];
|
1,394,134
|
private void promptForFiles() {<NEW_LINE>DialogProperties properties = new DialogProperties();<NEW_LINE>properties.selection_mode = DialogConfigs.MULTI_MODE;<NEW_LINE>properties.selection_type = DialogConfigs.FILE_SELECT;<NEW_LINE>properties.root = new File(DialogConfigs.DEFAULT_DIR);<NEW_LINE>properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);<NEW_LINE>properties.offset = new File(DialogConfigs.DEFAULT_DIR);<NEW_LINE>Set<String> registeredExtensions = ArchiveFileFactory.getRegisteredExtensions();<NEW_LINE>// api check<NEW_LINE>if (Build.VERSION.SDK_INT >= 14)<NEW_LINE>registeredExtensions.add("gpkg");<NEW_LINE>registeredExtensions.add("map");<NEW_LINE>String[] ret = new <MASK><NEW_LINE>ret = registeredExtensions.toArray(ret);<NEW_LINE>properties.extensions = ret;<NEW_LINE>FilePickerDialog dialog = new FilePickerDialog(getContext(), properties);<NEW_LINE>dialog.setTitle("Select a File");<NEW_LINE>dialog.setDialogSelectionListener(new DialogSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSelectedFilePaths(String[] files) {<NEW_LINE>// files is the array of the paths of files selected by the Application User.<NEW_LINE>setProviderConfig(files);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.show();<NEW_LINE>}
|
String[registeredExtensions.size()];
|
1,683,084
|
protected void paintSelection(Graphics graphics) {<NEW_LINE>if (selectionStart == -1)<NEW_LINE>return;<NEW_LINE>graphics.setXORMode(true);<NEW_LINE>graphics.setBackgroundColor(ColorConstants.white);<NEW_LINE>TextFragmentBox frag;<NEW_LINE>for (int i = 0; i < fragments.size(); i++) {<NEW_LINE>frag = (TextFragmentBox) fragments.get(i);<NEW_LINE>// Loop until first visible fragment<NEW_LINE>if (frag.offset + frag.length <= selectionStart)<NEW_LINE>continue;<NEW_LINE>if (frag.offset > selectionEnd)<NEW_LINE>return;<NEW_LINE>if (selectionStart <= frag.offset && selectionEnd >= frag.offset + frag.length) {<NEW_LINE>int y = frag.getLineRoot().getVisibleTop();<NEW_LINE>int height = frag.getLineRoot().getVisibleBottom() - y;<NEW_LINE>graphics.fillRectangle(frag.getX(), y, frag.getWidth(), height);<NEW_LINE>} else if (selectionEnd > frag.offset && selectionStart < frag.offset + frag.length) {<NEW_LINE>Point p1 = getPointInBox(frag, Math.max(frag.offset, selectionStart), i, false);<NEW_LINE>Point p2 = getPointInBox(frag, Math.min(frag.offset + frag.length, selectionEnd) - 1, i, true);<NEW_LINE>Rectangle rect <MASK><NEW_LINE>rect.width--;<NEW_LINE>rect.y = frag.getLineRoot().getVisibleTop();<NEW_LINE>rect.height = frag.getLineRoot().getVisibleBottom() - rect.y;<NEW_LINE>graphics.fillRectangle(rect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
= new Rectangle(p1, p2);
|
660,514
|
public String generateUserKey(String username, String keyname) throws ServletException {<NEW_LINE>// set key type<NEW_LINE>int type = KeyPair.RSA;<NEW_LINE>if ("dsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.DSA;<NEW_LINE>} else if ("ecdsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.ECDSA;<NEW_LINE>}<NEW_LINE>JSch jsch = new JSch();<NEW_LINE>String pubKey;<NEW_LINE>try {<NEW_LINE>KeyPair keyPair = KeyPair.genKeyPair(jsch, type, SSHUtil.KEY_LENGTH);<NEW_LINE>OutputStream os = new ByteArrayOutputStream();<NEW_LINE>keyPair.writePrivateKey(os, publicKey.getPassphrase().getBytes());<NEW_LINE>// set private key<NEW_LINE>try {<NEW_LINE>getRequest().getSession().setAttribute(PVT_KEY, EncryptionUtil.encrypt(os.toString()));<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>log.error(ex.toString(), ex);<NEW_LINE>throw new ServletException(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>os = new ByteArrayOutputStream();<NEW_LINE>keyPair.writePublicKey(os, username + "@" + keyname);<NEW_LINE>pubKey = os.toString();<NEW_LINE>keyPair.dispose();<NEW_LINE>} catch (JSchException ex) {<NEW_LINE>log.error(ex.toString(), ex);<NEW_LINE>throw new ServletException(<MASK><NEW_LINE>}<NEW_LINE>return pubKey;<NEW_LINE>}
|
ex.toString(), ex);
|
1,735,009
|
public void testCBRestrictsWhenHalfOpen() throws Exception {<NEW_LINE>// Open the breaker<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>try {<NEW_LINE>bean.serviceM(false, null, null);<NEW_LINE>} catch (ConnectException e) {<NEW_LINE>// Expected<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Wait for breaker to half open<NEW_LINE>Thread.<MASK><NEW_LINE>// Start a task which runs until we count down the latch<NEW_LINE>CountDownLatch hasStartedLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch mayFinishLatch = new CountDownLatch(1);<NEW_LINE>try {<NEW_LINE>Future<?> future = runner.call(() -> bean.serviceM(true, hasStartedLatch, mayFinishLatch));<NEW_LINE>hasStartedLatch.await(TestConstants.TEST_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>// Running another task should result in a CircuitBreakerOpenException<NEW_LINE>try {<NEW_LINE>bean.serviceM(true, null, null);<NEW_LINE>fail("CircuitBreakerOpenException not thrown");<NEW_LINE>} catch (CircuitBreakerOpenException ex) {<NEW_LINE>// Expected<NEW_LINE>}<NEW_LINE>// Long running task still should not have finished at this point<NEW_LINE>assertFalse("Long running task completed too soon", future.isDone());<NEW_LINE>// Allow long running task to finish<NEW_LINE>mayFinishLatch.countDown();<NEW_LINE>future.get(TestConstants.TEST_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>// Now we should be able to run another task<NEW_LINE>bean.serviceM(true, null, null);<NEW_LINE>} finally {<NEW_LINE>// Ensure we always clean up the long running task in case of failure<NEW_LINE>mayFinishLatch.countDown();<NEW_LINE>}<NEW_LINE>}
|
sleep(TestConstants.TIMEOUT + 100);
|
1,759,182
|
private void addIndexForAlert(Connection conn) {<NEW_LINE>// First drop if it exists. (Due to patches shipped to customers some will have the index and some wont.)<NEW_LINE>List<String> indexList <MASK><NEW_LINE>s_logger.debug("Dropping index i_alert__last_sent if it exists");<NEW_LINE>// in 4.1, we created this index that is not in convention.<NEW_LINE>indexList.add("last_sent");<NEW_LINE>indexList.add("i_alert__last_sent");<NEW_LINE>DbUpgradeUtils.dropKeysIfExist(conn, "alert", indexList, false);<NEW_LINE>// Now add index.<NEW_LINE>try (PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`alert` ADD INDEX `i_alert__last_sent`(`last_sent`)")) {<NEW_LINE>pstmt.executeUpdate();<NEW_LINE>s_logger.debug("Added index i_alert__last_sent for table alert");<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new CloudRuntimeException("Unable to add index i_alert__last_sent to alert table for the column last_sent", e);<NEW_LINE>}<NEW_LINE>}
|
= new ArrayList<String>();
|
1,653,725
|
private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, Predicate<IndexEntry> predicate, Map<StoreKey, IndexFinalState> keyFinalStates) throws StoreException {<NEW_LINE>diskIOScheduler.getSlice(BlobStoreStats.IO_SCHEDULER_JOB_TYPE, BlobStoreStats.<MASK><NEW_LINE>logger.trace("Processing index entries backward by IndexScanner for segment {} for store {}", indexSegment.getFile().getName(), storeId);<NEW_LINE>// valid index entries wrt log segment reference time<NEW_LINE>forEachValidIndexEntry(indexSegment, newScanResults.logSegmentForecastStartTimeMsForDeleted, newScanResults.logSegmentForecastStartTimeMsForExpired, null, keyFinalStates, false, entry -> {<NEW_LINE>if (predicate == null || predicate.test(entry)) {<NEW_LINE>processEntryForLogSegmentBucket(newScanResults, entry, keyFinalStates);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// valid index entries wrt container reference time<NEW_LINE>forEachIndexEntry(indexSegment, newScanResults.containerForecastStartTimeMs, newScanResults.containerForecastStartTimeMs, null, keyFinalStates, true, (entry, isValid) -> {<NEW_LINE>if (predicate == null || predicate.test(entry)) {<NEW_LINE>processEntryForContainerBucket(newScanResults, entry, isValid, keyFinalStates);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
IO_SCHEDULER_JOB_ID, indexSegment.size());
|
189,362
|
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent descrationDemon = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null && descrationDemon != null) {<NEW_LINE>for (UUID opponentId : game.getOpponents(controller.getId())) {<NEW_LINE>Player <MASK><NEW_LINE>if (opponent != null) {<NEW_LINE>FilterControlledPermanent filter = new FilterControlledPermanent("creature to sacrifice");<NEW_LINE>filter.add(CardType.CREATURE.getPredicate());<NEW_LINE>filter.add(TargetController.YOU.getControllerPredicate());<NEW_LINE>TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);<NEW_LINE>if (target.canChoose(opponent.getId(), source, game)) {<NEW_LINE>if (opponent.chooseUse(Outcome.AIDontUseIt, "Sacrifice a creature to tap " + descrationDemon.getLogName() + "and put a +1/+1 counter on it?", source, game)) {<NEW_LINE>opponent.choose(Outcome.Sacrifice, target, source, game);<NEW_LINE>Permanent permanent = game.getPermanent(target.getFirstTarget());<NEW_LINE>if (permanent != null) {<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>game.informPlayers(opponent.getLogName() + " sacrifices " + permanent.getLogName() + " to tap " + descrationDemon.getLogName() + ". A +1/+1 counter was put on it");<NEW_LINE>descrationDemon.tap(source, game);<NEW_LINE>descrationDemon.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
opponent = game.getPlayer(opponentId);
|
1,359,682
|
private void addImports(SrcLinkedClass srcClass) {<NEW_LINE>srcClass.addImport(Bindings.class);<NEW_LINE>srcClass.addImport(Endpoint.class);<NEW_LINE>srcClass.addImport(Executor.class);<NEW_LINE>srcClass.addImport(GqlQuery.class);<NEW_LINE>srcClass.addImport(GqlQueryResult.class);<NEW_LINE>srcClass.addImport(Requester.class);<NEW_LINE>srcClass.addImport(GqlType.class);<NEW_LINE>srcClass.addImport(GqlBuilder.class);<NEW_LINE>srcClass.addImport(DataBindings.class);<NEW_LINE>srcClass.addImport(IBindingType.class);<NEW_LINE>srcClass.addImport(IJsonBindingsBacked.class);<NEW_LINE><MASK><NEW_LINE>srcClass.addImport(List.class);<NEW_LINE>srcClass.addImport(IListBacked.class);<NEW_LINE>srcClass.addImport(Loader.class);<NEW_LINE>srcClass.addImport(Map.class);<NEW_LINE>srcClass.addImport(HashMap.class);<NEW_LINE>srcClass.addImport(RuntimeMethods.class);<NEW_LINE>srcClass.addImport(Supplier.class);<NEW_LINE>srcClass.addImport(NotNull.class);<NEW_LINE>srcClass.addImport(ActualName.class);<NEW_LINE>srcClass.addImport(DisableStringLiteralTemplates.class);<NEW_LINE>srcClass.addImport(SourcePosition.class);<NEW_LINE>srcClass.addImport(Structural.class);<NEW_LINE>srcClass.addImport(FragmentValue.class);<NEW_LINE>srcClass.addStaticImport(RuntimeMethods.class.getName() + ".coerceFromBindingsValue");<NEW_LINE>importAllOtherGqlTypes(srcClass);<NEW_LINE>}
|
srcClass.addImport(IProxyFactory.class);
|
700,458
|
private void trashComment() {<NEW_LINE>if (!isAdded() || mComment == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CommentStatus status = CommentStatus.fromString(mComment.getStatus());<NEW_LINE>// If the comment status is trash or spam, next deletion is a permanent deletion.<NEW_LINE>if (status == CommentStatus.TRASH || status == CommentStatus.SPAM) {<NEW_LINE>AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(getActivity());<NEW_LINE>dialogBuilder.setTitle(getResources().getText<MASK><NEW_LINE>dialogBuilder.setMessage(getResources().getText(R.string.dlg_sure_to_delete_comment));<NEW_LINE>dialogBuilder.setPositiveButton(getResources().getText(R.string.yes), (dialog, whichButton) -> {<NEW_LINE>moderateComment(CommentStatus.DELETED);<NEW_LINE>announceCommentStatusChangeForAccessibility(CommentStatus.DELETED);<NEW_LINE>});<NEW_LINE>dialogBuilder.setNegativeButton(getResources().getText(R.string.no), null);<NEW_LINE>dialogBuilder.setCancelable(true);<NEW_LINE>dialogBuilder.create().show();<NEW_LINE>} else {<NEW_LINE>moderateComment(CommentStatus.TRASH);<NEW_LINE>announceCommentStatusChangeForAccessibility(CommentStatus.TRASH);<NEW_LINE>}<NEW_LINE>}
|
(R.string.delete));
|
1,709,780
|
public static <T> MutableSortedSet<MutableSortedSet<T>> powerSet(SortedSet<T> set) {<NEW_LINE>Comparator<? super T> comparator = set.comparator();<NEW_LINE>MutableSortedSet<T> innerTree = TreeSortedSet.newSet(comparator);<NEW_LINE>TreeSortedSet<MutableSortedSet<T>> sortedSetIterables = TreeSortedSet.newSet(Comparators.<T>powerSet());<NEW_LINE>MutableSortedSet<MutableSortedSet<T>> <MASK><NEW_LINE>return Iterate.injectInto(seed, set, new Function2<MutableSortedSet<MutableSortedSet<T>>, T, MutableSortedSet<MutableSortedSet<T>>>() {<NEW_LINE><NEW_LINE>public MutableSortedSet<MutableSortedSet<T>> value(MutableSortedSet<MutableSortedSet<T>> accumulator, final T element) {<NEW_LINE>return accumulator.union(accumulator.collect(new Function<MutableSortedSet<T>, MutableSortedSet<T>>() {<NEW_LINE><NEW_LINE>public MutableSortedSet<T> valueOf(MutableSortedSet<T> set) {<NEW_LINE>MutableSortedSet<T> newSet = set.clone();<NEW_LINE>newSet.add(element);<NEW_LINE>return newSet;<NEW_LINE>}<NEW_LINE>}).toSet());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
seed = sortedSetIterables.with(innerTree);
|
354,756
|
public Comic parseInfo(String html, Comic comic) {<NEW_LINE>Node body = new Node(html);<NEW_LINE>String title = body.text("#ct > div.detail_info > a._btnInfo > p.subj");<NEW_LINE>String cover = body.src("#_episodeList > li > a > div.row > div.pic > img");<NEW_LINE>String update = body.text("#_episodeList > li > a > div.row > div.info > p.date");<NEW_LINE>if (update != null) {<NEW_LINE>String[] args = update.split("\\D");<NEW_LINE>update = StringUtils.format("%4d-%02d-%02d", Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.<MASK><NEW_LINE>}<NEW_LINE>String author = body.text("#ct > div.detail_info > a._btnInfo > p.author");<NEW_LINE>String intro = body.text("#_informationLayer > p.summary_area");<NEW_LINE>boolean status = isFinish(body.text("#_informationLayer > div.info_update"));<NEW_LINE>comic.setInfo(title, cover, update, intro, author, status);<NEW_LINE>return comic;<NEW_LINE>}
|
parseInt(args[2]));
|
241,365
|
public ListContentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListContentsResult listContentsResult = new ListContentsResult();<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 listContentsResult;<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("contentSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContentsResult.setContentSummaries(new ListUnmarshaller<ContentSummary>(ContentSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listContentsResult.setNextToken(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 listContentsResult;<NEW_LINE>}
|
JsonToken token = context.getCurrentToken();
|
1,443,549
|
private Position decodeV3(String sentence, Channel channel, SocketAddress remoteAddress) {<NEW_LINE>Parser parser = new Parser(PATTERN_V3, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>DateBuilder dateBuilder = new DateBuilder().setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>int mcc = parser.nextInt();<NEW_LINE>int mnc = parser.nextInt();<NEW_LINE>int count = parser.nextInt();<NEW_LINE>Network network = new Network();<NEW_LINE>String[] values = parser.next().split(",");<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>network.addCellTower(CellTower.from(mcc, mnc, Integer.parseInt(values[i * 4]), Integer.parseInt(values[i <MASK><NEW_LINE>}<NEW_LINE>position.setNetwork(network);<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextHexInt());<NEW_LINE>dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));<NEW_LINE>getLastLocation(position, dateBuilder.getDate());<NEW_LINE>processStatus(position, parser.nextLong(16, 0));<NEW_LINE>return position;<NEW_LINE>}
|
* 4 + 1])));
|
1,839,522
|
public void renderLines(PoseStack matrices, Tesselator tessellator, BufferBuilder bufferBuilder, double cx, double cy, double cz, float partialTick) {<NEW_LINE>Vec3 v1 = shape.relativiseRender(client.<MASK><NEW_LINE>Vec3 v2 = shape.relativiseRender(client.level, shape.to, partialTick);<NEW_LINE>drawLine(tessellator, bufferBuilder, (float) (v1.x - cx - renderEpsilon), (float) (v1.y - cy - renderEpsilon), (float) (v1.z - cz - renderEpsilon), (float) (v2.x - cx + renderEpsilon), (float) (v2.y - cy + renderEpsilon), (float) (v2.z - cz + renderEpsilon), shape.r, shape.g, shape.b, shape.a);<NEW_LINE>}
|
level, shape.from, partialTick);
|
957,466
|
protected void performContextAction(Node[] nodes) {<NEW_LINE>VCSContext ctx = HgUtils.getCurrentContext(nodes);<NEW_LINE>final File[] roots = HgUtils.getActionRoots(ctx);<NEW_LINE>if (roots == null || roots.length == 0)<NEW_LINE>return;<NEW_LINE>final File root = Mercurial.getInstance().getRepositoryRoot(roots[0]);<NEW_LINE>Utils.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (QUtils.isMQEnabledExtension(root)) {<NEW_LINE>EventQueue.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>GoToPatch goToPatch = new GoToPatch(root);<NEW_LINE>if (goToPatch.showDialog()) {<NEW_LINE>if (goToPatch.isPopAllSelected()) {<NEW_LINE>goToPatch(root, null, null);<NEW_LINE>} else if (goToPatch.getSelectedQueue() != null) {<NEW_LINE><MASK><NEW_LINE>goToPatch(root, q.getName(), null);<NEW_LINE>} else if (goToPatch.getSelectedPatch() != null) {<NEW_LINE>QPatch patch = goToPatch.getSelectedPatch();<NEW_LINE>goToPatch(root, patch.getQueue().isActive() ? null : patch.getQueue().getName(), patch.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
Queue q = goToPatch.getSelectedQueue();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.