idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
736,483
public static VerifySentenceResponse unmarshall(VerifySentenceResponse verifySentenceResponse, UnmarshallerContext _ctx) {<NEW_LINE>verifySentenceResponse.setRequestId(_ctx.stringValue("VerifySentenceResponse.RequestId"));<NEW_LINE>verifySentenceResponse.setSuccess(_ctx.booleanValue("VerifySentenceResponse.Success"));<NEW_LINE>verifySentenceResponse.setIncorrectWords(_ctx.integerValue("VerifySentenceResponse.IncorrectWords"));<NEW_LINE>verifySentenceResponse.setTargetRole(_ctx.integerValue("VerifySentenceResponse.TargetRole"));<NEW_LINE>verifySentenceResponse.setCode(_ctx.stringValue("VerifySentenceResponse.Code"));<NEW_LINE>verifySentenceResponse.setMessage<MASK><NEW_LINE>verifySentenceResponse.setSourceRole(_ctx.integerValue("VerifySentenceResponse.SourceRole"));<NEW_LINE>List<Delta> data = new ArrayList<Delta>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("VerifySentenceResponse.Data.Length"); i++) {<NEW_LINE>Delta delta = new Delta();<NEW_LINE>delta.setType(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Type"));<NEW_LINE>Source source = new Source();<NEW_LINE>source.setPosition(_ctx.integerValue("VerifySentenceResponse.Data[" + i + "].Source.Position"));<NEW_LINE>List<String> line = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("VerifySentenceResponse.Data[" + i + "].Source.Line.Length"); j++) {<NEW_LINE>line.add(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Source.Line[" + j + "]"));<NEW_LINE>}<NEW_LINE>source.setLine(line);<NEW_LINE>delta.setSource(source);<NEW_LINE>Target target = new Target();<NEW_LINE>target.setPosition(_ctx.integerValue("VerifySentenceResponse.Data[" + i + "].Target.Position"));<NEW_LINE>List<String> line1 = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("VerifySentenceResponse.Data[" + i + "].Target.Line.Length"); j++) {<NEW_LINE>line1.add(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Target.Line[" + j + "]"));<NEW_LINE>}<NEW_LINE>target.setLine1(line1);<NEW_LINE>delta.setTarget(target);<NEW_LINE>data.add(delta);<NEW_LINE>}<NEW_LINE>verifySentenceResponse.setData(data);<NEW_LINE>return verifySentenceResponse;<NEW_LINE>}
(_ctx.stringValue("VerifySentenceResponse.Message"));
279,971
private static void writeThreadPoolConfigJson(JsonGenerator json, HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolConfiguration threadPoolConfig) throws IOException {<NEW_LINE>json.writeObjectFieldStart(threadPoolKey.name());<NEW_LINE>json.writeNumberField("coreSize", threadPoolConfig.getCoreSize());<NEW_LINE>json.writeNumberField("maximumSize", threadPoolConfig.getMaximumSize());<NEW_LINE>json.writeNumberField(<MASK><NEW_LINE>json.writeNumberField("maxQueueSize", threadPoolConfig.getMaxQueueSize());<NEW_LINE>json.writeNumberField("queueRejectionThreshold", threadPoolConfig.getQueueRejectionThreshold());<NEW_LINE>json.writeNumberField("keepAliveTimeInMinutes", threadPoolConfig.getKeepAliveTimeInMinutes());<NEW_LINE>json.writeBooleanField("allowMaximumSizeToDivergeFromCoreSize", threadPoolConfig.getAllowMaximumSizeToDivergeFromCoreSize());<NEW_LINE>json.writeNumberField("counterBucketSizeInMilliseconds", threadPoolConfig.getRollingCounterBucketSizeInMilliseconds());<NEW_LINE>json.writeNumberField("counterBucketCount", threadPoolConfig.getRollingCounterNumberOfBuckets());<NEW_LINE>json.writeEndObject();<NEW_LINE>}
"actualMaximumSize", threadPoolConfig.getActualMaximumSize());
1,823,124
public MetadataProviderResponse addMetadataFromFieldType(AddMetadataFromFieldTypeRequest addMetadataFromFieldTypeRequest, Map<String, FieldMetadata> metadata) {<NEW_LINE>if (addMetadataFromFieldTypeRequest.getPresentationAttribute() instanceof BasicFieldMetadata && SupportedFieldType.PASSWORD.equals(((BasicFieldMetadata) addMetadataFromFieldTypeRequest.getPresentationAttribute()).getExplicitFieldType())) {<NEW_LINE>// build the metadata for the password field<NEW_LINE>addMetadataFromFieldTypeRequest.getDynamicEntityDao().getDefaultFieldMetadataProvider(<MASK><NEW_LINE>((BasicFieldMetadata) addMetadataFromFieldTypeRequest.getPresentationAttribute()).setFieldType(SupportedFieldType.PASSWORD);<NEW_LINE>BasicFieldMetadata originalMd = (BasicFieldMetadata) addMetadataFromFieldTypeRequest.getPresentationAttribute();<NEW_LINE>// clone the password field and add in a custom one<NEW_LINE>BasicFieldMetadata confirmMd = (BasicFieldMetadata) originalMd.cloneFieldMetadata();<NEW_LINE>confirmMd.setFieldName("passwordConfirm");<NEW_LINE>confirmMd.setFriendlyName("AdminUserImpl_Admin_Password_Confirm");<NEW_LINE>confirmMd.setExplicitFieldType(SupportedFieldType.PASSWORD_CONFIRM);<NEW_LINE>confirmMd.setValidationConfigurations(new HashMap<String, List<Map<String, String>>>());<NEW_LINE>confirmMd.setOrder(originalMd.getOrder() + 1);<NEW_LINE>metadata.put("passwordConfirm", confirmMd);<NEW_LINE>return MetadataProviderResponse.HANDLED;<NEW_LINE>} else {<NEW_LINE>return MetadataProviderResponse.NOT_HANDLED;<NEW_LINE>}<NEW_LINE>}
).addMetadataFromFieldType(addMetadataFromFieldTypeRequest, metadata);
1,522,502
public void insertModel(final int pos, final IModel model) {<NEW_LINE>if (model == null || model.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.configuration != model.getConfiguration()) {<NEW_LINE>throw new TemplateProcessingException("Cannot add model of class " + model.getClass().getName() + " to the current template, as " + "it was created using a different Template Engine Configuration.");<NEW_LINE>}<NEW_LINE>if (this.templateMode != model.getTemplateMode()) {<NEW_LINE>throw new TemplateProcessingException("Cannot add model of class " + model.getClass().getName() + " to the current template, as " + "it was created using a different Template Mode: " + model.getTemplateMode() + " instead of " + "the current " + this.templateMode);<NEW_LINE>}<NEW_LINE>if (this.queue.length <= (this.queueSize + model.size())) {<NEW_LINE>// We need to grow the queue!<NEW_LINE>this.queue = Arrays.copyOf(this.queue, Math.max(this.queueSize + model.size(), this.queue<MASK><NEW_LINE>}<NEW_LINE>if (model instanceof TemplateModel) {<NEW_LINE>doInsertTemplateModel(pos, (TemplateModel) model);<NEW_LINE>} else if (model instanceof Model) {<NEW_LINE>doInsertModel(pos, (Model) model);<NEW_LINE>} else {<NEW_LINE>doInsertOtherModel(pos, model);<NEW_LINE>}<NEW_LINE>}
.length + INITIAL_EVENT_QUEUE_SIZE / 2));
1,764,361
private OsmTrack findTrack(final String operationName, final MatchedWaypoint startWp, final MatchedWaypoint endWp, final OsmTrack costCuttingTrack, final OsmTrack refTrack, final boolean fastPartialRecalc) {<NEW_LINE>try {<NEW_LINE>final List<OsmNode> wpts2 = new ArrayList<OsmNode>();<NEW_LINE>if (startWp != null) {<NEW_LINE>wpts2.add(startWp.waypoint);<NEW_LINE>}<NEW_LINE>if (endWp != null) {<NEW_LINE>wpts2.add(endWp.waypoint);<NEW_LINE>}<NEW_LINE>routingContext.cleanNogoList(wpts2);<NEW_LINE>final boolean detailed = guideTrack != null;<NEW_LINE>resetCache(detailed);<NEW_LINE>nodesCache.nodesMap.cleanupMode = detailed ? 0 : (<MASK><NEW_LINE>return findTrackHelper(operationName, startWp, endWp, costCuttingTrack, refTrack, fastPartialRecalc);<NEW_LINE>} finally {<NEW_LINE>routingContext.restoreNogoList();<NEW_LINE>// clean only non-virgin caches<NEW_LINE>nodesCache.clean(false);<NEW_LINE>}<NEW_LINE>}
routingContext.considerTurnRestrictions ? 2 : 1);
827,973
private boolean sendMetaInfoForFile(byte[] sizeAsBytes) {<NEW_LINE>final byte[] standardReplyBytes = new byte[] { // 'TUC0'<NEW_LINE>// 'TUC0'<NEW_LINE>0x54, // 'TUC0'<NEW_LINE>0x55, // 'TUC0'<NEW_LINE>0x43, // CMD_TYPE_RESPONSE = 1<NEW_LINE>0x30, // CMD_TYPE_RESPONSE = 1<NEW_LINE>0x01, // CMD_TYPE_RESPONSE = 1<NEW_LINE>0x00, // CMD_TYPE_RESPONSE = 1<NEW_LINE>0x00, 0x00, 0x01, 0x00, 0x00, 0x00 };<NEW_LINE>final byte[<MASK><NEW_LINE>if (writeUsb(standardReplyBytes)) {<NEW_LINE>// Send integer value of '1' in Little-endian format.<NEW_LINE>print("Sending response failed [1/3]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (writeUsb(sizeAsBytes)) {<NEW_LINE>// Send EXACTLY what has been received<NEW_LINE>print("Sending response failed [2/3]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (writeUsb(twelveZeroBytes)) {<NEW_LINE>// kinda another one padding<NEW_LINE>print("Sending response failed [3/3]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
] twelveZeroBytes = new byte[12];
298,113
protected void handle(final DeleteSnapshotOnPrimaryStorageMsg msg) {<NEW_LINE>final DeleteSnapshotOnPrimaryStorageReply reply = new DeleteSnapshotOnPrimaryStorageReply();<NEW_LINE>final <MASK><NEW_LINE>final NfsPrimaryStorageBackend bkd = getBackend(nfsMgr.findHypervisorTypeByImageFormatAndPrimaryStorageUuid(sinv.getFormat(), self.getUuid()));<NEW_LINE>bkd.delete(getSelfInventory(), sinv.getPrimaryStorageInstallPath(), new Completion(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>NfsDeleteVolumeSnapshotGC gc = new NfsDeleteVolumeSnapshotGC();<NEW_LINE>gc.NAME = String.format("gc-nfs-%s-snapshot-%s", self.getUuid(), sinv.getUuid());<NEW_LINE>gc.snapshot = sinv;<NEW_LINE>gc.primaryStorageUuid = self.getUuid();<NEW_LINE>gc.hypervisorType = bkd.getHypervisorType().toString();<NEW_LINE>gc.submit(NfsPrimaryStorageGlobalConfig.GC_INTERVAL.value(Long.class), TimeUnit.SECONDS);<NEW_LINE>logger.warn(String.format("NFS primary storage[uuid:%s] failed to delete a volume snapshot[uuid:%s], %s. A GC" + " job[uuid:%s] is scheduled to cleanup it in the interval of %s seconds", self.getUuid(), sinv.getUuid(), errorCode, gc.getUuid(), NfsPrimaryStorageGlobalConfig.GC_INTERVAL.value(Long.class)));<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
VolumeSnapshotInventory sinv = msg.getSnapshot();
1,800,310
private static void fillCheckbox(Graphics g, int width, int height) {<NEW_LINE>int x1 = scaleCoordinate(2.0450495f, 16, width);<NEW_LINE>int y1 = <MASK><NEW_LINE>int x2 = scaleCoordinate(5.8675725f, 16, width);<NEW_LINE>int y2 = scaleCoordinate(13.921746f, 16, height);<NEW_LINE>int x3 = scaleCoordinate(5.8675725f, 16, width);<NEW_LINE>int y3 = scaleCoordinate(11f, 16, height);<NEW_LINE>g.fillTriangle(x1, y1, x2, y2, x3, y3);<NEW_LINE>x1 = scaleCoordinate(14.38995f, 16, width);<NEW_LINE>y1 = scaleCoordinate(0, 16, height);<NEW_LINE>g.fillTriangle(x1, y1, x2, y2, x3, y3);<NEW_LINE>}
scaleCoordinate(9.4227722f, 16, height);
174,135
public void seek(long position, long timeUs) {<NEW_LINE>// If the timestamp adjuster has not yet established a timestamp offset, we need to reset its<NEW_LINE>// expected first sample timestamp to be the new seek position. Without this, the timestamp<NEW_LINE>// adjuster would incorrectly establish its timestamp offset assuming that the first sample<NEW_LINE>// after this seek corresponds to the start of the stream (or a previous seek position, if there<NEW_LINE>// was one).<NEW_LINE>boolean resetTimestampAdjuster = timestampAdjuster.getTimestampOffsetUs() == C.TIME_UNSET;<NEW_LINE>if (!resetTimestampAdjuster) {<NEW_LINE><MASK><NEW_LINE>// Also reset the timestamp adjuster if its offset was calculated based on a non-zero position<NEW_LINE>// in the stream (other than the position being seeked to), since in this case the offset may<NEW_LINE>// not be accurate.<NEW_LINE>resetTimestampAdjuster = adjusterFirstSampleTimestampUs != C.TIME_UNSET && adjusterFirstSampleTimestampUs != 0 && adjusterFirstSampleTimestampUs != timeUs;<NEW_LINE>}<NEW_LINE>if (resetTimestampAdjuster) {<NEW_LINE>timestampAdjuster.reset(timeUs);<NEW_LINE>}<NEW_LINE>if (psBinarySearchSeeker != null) {<NEW_LINE>psBinarySearchSeeker.setSeekTargetUs(timeUs);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < psPayloadReaders.size(); i++) {<NEW_LINE>psPayloadReaders.valueAt(i).seek();<NEW_LINE>}<NEW_LINE>}
long adjusterFirstSampleTimestampUs = timestampAdjuster.getFirstSampleTimestampUs();
1,719,747
public StreamObserver<LogMessage> openLog(StreamObserver<Status> responseObserver) {<NEW_LINE>return new StreamObserver<LogMessage>() {<NEW_LINE><NEW_LINE>private int logId;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(LogMessage logMessage) throws LogDaemonException {<NEW_LINE>logId = logMessage.getLogId();<NEW_LINE>if (!fileIdToPath.containsKey(logId)) {<NEW_LINE>throw new LogDaemonException("The provided logFileId " + logId + " does not exist.");<NEW_LINE>}<NEW_LINE>String path = fileIdToPath.get(logId);<NEW_LINE>try {<NEW_LINE>appendLog(logId, logMessage.getLogMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Failed to append log file at " + path, e);<NEW_LINE>throw new LogDaemonException(e, "Failed to append log file at %s", path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>LOG.error("log appending cancelled", t);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompleted() {<NEW_LINE>// if client calls onCompleted and closes the stream<NEW_LINE>// then close FileOutputStream of corresponding StreamObserver<NEW_LINE>String <MASK><NEW_LINE>try {<NEW_LINE>logStreams.get(logId).close();<NEW_LINE>responseObserver.onNext(Status.newBuilder().setCode(ExitCode.SUCCESS.getCode()).setMessage("LogD closed stream to " + logFilePath).build());<NEW_LINE>} catch (IOException e) {<NEW_LINE>responseObserver.onNext(Status.newBuilder().setCode(ExitCode.BUILD_ERROR.getCode()).setMessage("Failed to close log stream to " + logFilePath).build());<NEW_LINE>}<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
logFilePath = fileIdToPath.get(logId);
407,526
private OHashTable.BucketPath nextNonEmptyNode(OHashTable.BucketPath bucketPath, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>nextBucketLoop: while (bucketPath != null) {<NEW_LINE>final long[] node = directory.getNode(bucketPath.nodeIndex, atomicOperation);<NEW_LINE>final int startIndex = bucketPath.itemIndex + bucketPath.hashMapOffset;<NEW_LINE>@SuppressWarnings("UnnecessaryLocalVariable")<NEW_LINE>final int endIndex = MAX_LEVEL_SIZE;<NEW_LINE>for (int i = startIndex; i < endIndex; i++) {<NEW_LINE>final long position = node[i];<NEW_LINE>if (position > 0) {<NEW_LINE>final int hashMapSize = 1 << bucketPath.nodeLocalDepth;<NEW_LINE>final int hashMapOffset = (i / hashMapSize) * hashMapSize;<NEW_LINE>final int itemIndex = i - hashMapOffset;<NEW_LINE>return new OHashTable.BucketPath(bucketPath.parent, hashMapOffset, itemIndex, bucketPath.nodeIndex, bucketPath.nodeLocalDepth, bucketPath.nodeGlobalDepth);<NEW_LINE>}<NEW_LINE>if (position < 0) {<NEW_LINE>final int childNodeIndex = (int) ((position & Long.MAX_VALUE) >> 8);<NEW_LINE>final int childItemOffset = (int) position & 0xFF;<NEW_LINE>final OHashTable.BucketPath parent = new OHashTable.BucketPath(bucketPath.parent, 0, i, bucketPath.nodeIndex, <MASK><NEW_LINE>final int childLocalDepth = directory.getNodeLocalDepth(childNodeIndex, atomicOperation);<NEW_LINE>bucketPath = new OHashTable.BucketPath(parent, childItemOffset, 0, childNodeIndex, childLocalDepth, bucketPath.nodeGlobalDepth + childLocalDepth);<NEW_LINE>continue nextBucketLoop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bucketPath = nextLevelUp(bucketPath, atomicOperation);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
bucketPath.nodeLocalDepth, bucketPath.nodeGlobalDepth);
613,010
public I_EDI_Desadv addToDesadvCreateForOrderIfNotExist(@NonNull final I_C_Order orderRecord) {<NEW_LINE>Check.assumeNotEmpty(orderRecord.<MASK><NEW_LINE>final I_EDI_Desadv desadvRecord = retrieveOrCreateDesadv(orderRecord);<NEW_LINE>orderRecord.setEDI_Desadv_ID(desadvRecord.getEDI_Desadv_ID());<NEW_LINE>final List<I_C_OrderLine> orderLines = orderDAO.retrieveOrderLines(orderRecord, I_C_OrderLine.class);<NEW_LINE>for (final I_C_OrderLine orderLine : orderLines) {<NEW_LINE>if (orderLine.getEDI_DesadvLine_ID() > 0) {<NEW_LINE>// is already assigned to a desadv line<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (orderLine.isPackagingMaterial()) {<NEW_LINE>// packing materials from the OL don't belong into the desadv<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final I_EDI_DesadvLine desadvLine = retrieveOrCreateDesadvLine(orderRecord, desadvRecord, orderLine);<NEW_LINE>Check.errorIf(desadvLine.getM_Product_ID() != orderLine.getM_Product_ID(), "EDI_DesadvLine {} of EDI_Desadv {} has M_Product_ID {} and C_OrderLine {} of C_Order {} has M_Product_ID {}, but both have POReference {} and Line {} ", desadvLine, desadvRecord, desadvLine.getM_Product_ID(), orderLine, orderRecord, orderLine.getM_Product_ID(), orderRecord.getPOReference(), orderLine.getLine());<NEW_LINE>orderLine.setEDI_DesadvLine(desadvLine);<NEW_LINE>InterfaceWrapperHelper.save(orderLine);<NEW_LINE>}<NEW_LINE>updateFullfilmentPercent(desadvRecord);<NEW_LINE>saveRecord(desadvRecord);<NEW_LINE>return desadvRecord;<NEW_LINE>}
getPOReference(), "C_Order {} has a not-empty POReference", orderRecord);
337,906
public void write(JsonWriter out, Name value) throws IOException {<NEW_LINE>JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();<NEW_LINE>obj.remove("additionalProperties");<NEW_LINE>// serialize additonal properties<NEW_LINE>if (value.getAdditionalProperties() != null) {<NEW_LINE>for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {<NEW_LINE>if (entry.getValue() instanceof String)<NEW_LINE>obj.addProperty(entry.getKey(), (String) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Number)<NEW_LINE>obj.addProperty(entry.getKey(), (Number) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Boolean)<NEW_LINE>obj.addProperty(entry.getKey(), (Boolean) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Character)<NEW_LINE>obj.addProperty(entry.getKey(), (Character) entry.getValue());<NEW_LINE>else {<NEW_LINE>obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
elementAdapter.write(out, obj);
352,198
static void replaceCompleter(PropertyProcessor propertyProcessor) {<NEW_LINE>Context context = propertyProcessor.getContext();<NEW_LINE>ReflectUtil.LiveFieldRef thisCompleterField;<NEW_LINE>if (JreUtil.isJava8()) {<NEW_LINE>ClassReader classReader = ClassReader.instance(context);<NEW_LINE>thisCompleterField = ReflectUtil.field(classReader, "thisCompleter");<NEW_LINE>} else {<NEW_LINE>Object classFinder = ReflectUtil.method("com.sun.tools.javac.code.ClassFinder", "instance", Context.class).invokeStatic(context);<NEW_LINE>thisCompleterField = <MASK><NEW_LINE>}<NEW_LINE>Symbol.Completer thisCompleter = (Symbol.Completer) thisCompleterField.get();<NEW_LINE>if (!(thisCompleter instanceof ClassReaderCompleter)) {<NEW_LINE>Symbol.Completer myCompleter = new ClassReaderCompleter(propertyProcessor, thisCompleter, propertyProcessor.getJavacTask());<NEW_LINE>thisCompleterField.set(myCompleter);<NEW_LINE>if (JreUtil.isJava9orLater()) {<NEW_LINE>ReflectUtil.field(Symtab.instance(context), "initialCompleter").set(myCompleter);<NEW_LINE>ReflectUtil.field(JavacProcessingEnvironment.instance(context), "initialCompleter").set(myCompleter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ReflectUtil.field(classFinder, "thisCompleter");
910,086
private void addWriteResult(final BulkWriteResult wr, final Resource rep, final String requestPath) {<NEW_LINE>Resource nrep = new Resource();<NEW_LINE>if (wr.wasAcknowledged()) {<NEW_LINE>if (wr.getUpserts() != null || wr.getInserts() != null) {<NEW_LINE>nrep.addProperty("inserted", new BsonInt32((wr.getUpserts() != null ? wr.getUpserts().size() : 0) + (wr.getInserts() != null ? wr.getInserts().size() : 0)));<NEW_LINE>// add links to new, upserted documents<NEW_LINE>if (wr.getUpserts() != null) {<NEW_LINE>wr.getUpserts().stream().forEach(update -> nrep.addLink(new Link("rh:newdoc", RepresentationUtils.getReferenceLink(requestPath, update.getId())), true));<NEW_LINE>}<NEW_LINE>// add links to new, inserted documents<NEW_LINE>if (wr.getInserts() != null) {<NEW_LINE>wr.getInserts().stream().forEach(insert -> nrep.addLink(new Link("rh:newdoc", RepresentationUtils.getReferenceLink(requestPath, insert.getId())), true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nrep.addProperty("deleted", new BsonInt32(wr.getDeletedCount()));<NEW_LINE>nrep.addProperty("modified", new BsonInt32<MASK><NEW_LINE>nrep.addProperty("matched", new BsonInt32(wr.getMatchedCount()));<NEW_LINE>rep.addChild("rh:result", nrep);<NEW_LINE>}<NEW_LINE>}
(wr.getModifiedCount()));
1,797,279
public static void print(RedisCache redisCache) {<NEW_LINE>StringBuilder redisInfo = new StringBuilder().append("Redis Cache Name: ").append(redisCache.name()).append("\n\tResource group: ").append(redisCache.resourceGroupName()).append("\n\tRegion: ").append(redisCache.region()).append("\n\tSKU Name: ").append(redisCache.sku().name()).append("\n\tSKU Family: ").append(redisCache.sku().family()).append("\n\tHostname: ").append(redisCache.hostname()).append("\n\tSSL port: ").append(redisCache.sslPort()).append("\n\tNon-SSL port (6379) enabled: ").append(redisCache.nonSslPort());<NEW_LINE>if (redisCache.redisConfiguration() != null && !redisCache.redisConfiguration().isEmpty()) {<NEW_LINE>redisInfo.append("\n\tRedis Configuration:");<NEW_LINE>for (Map.Entry<String, String> redisConfiguration : redisCache.redisConfiguration().entrySet()) {<NEW_LINE>redisInfo.append("\n\t '").append(redisConfiguration.getKey()).append("' : '").append(redisConfiguration.getValue()).append("'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (redisCache.isPremium()) {<NEW_LINE><MASK><NEW_LINE>List<ScheduleEntry> scheduleEntries = premium.listPatchSchedules();<NEW_LINE>if (scheduleEntries != null && !scheduleEntries.isEmpty()) {<NEW_LINE>redisInfo.append("\n\tRedis Patch Schedule:");<NEW_LINE>for (ScheduleEntry schedule : scheduleEntries) {<NEW_LINE>redisInfo.append("\n\t\tDay: '").append(schedule.dayOfWeek()).append("', start at: '").append(schedule.startHourUtc()).append("', maintenance window: '").append(schedule.maintenanceWindow()).append("'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(redisInfo.toString());<NEW_LINE>}
RedisCachePremium premium = redisCache.asPremium();
379,629
final DescribeDBParameterGroupsResult executeDescribeDBParameterGroups(DescribeDBParameterGroupsRequest describeDBParameterGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBParameterGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBParameterGroupsRequest> request = null;<NEW_LINE>Response<DescribeDBParameterGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBParameterGroupsRequestMarshaller().marshall(super.beforeMarshalling(describeDBParameterGroupsRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBParameterGroups");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDBParameterGroupsResult> responseHandler = new StaxResponseHandler<DescribeDBParameterGroupsResult>(new DescribeDBParameterGroupsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,656,621
private static Class<?> _getEntityClass(final Type genericType) {<NEW_LINE>if (null == genericType) {<NEW_LINE>return Object.class;<NEW_LINE>}<NEW_LINE>if (genericType instanceof Class && genericType != JAXBElement.class) {<NEW_LINE>final Class<?> clazz = (Class<?>) genericType;<NEW_LINE>if (clazz.isArray()) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return clazz;<NEW_LINE>} else if (genericType instanceof ParameterizedType) {<NEW_LINE>final ParameterizedType parameterizedType = (ParameterizedType) genericType;<NEW_LINE>final Type[] arguments = parameterizedType.getActualTypeArguments();<NEW_LINE>final Type type = parameterizedType.getRawType() == Map.class ? arguments[1] : arguments[0];<NEW_LINE>if (type instanceof ParameterizedType) {<NEW_LINE>final Type rawType = ((ParameterizedType) type).getRawType();<NEW_LINE>if (rawType == JAXBElement.class) {<NEW_LINE>return _getEntityClass(type);<NEW_LINE>}<NEW_LINE>} else if (type instanceof WildcardType) {<NEW_LINE>final Type[] upperTypes = ((WildcardType) type).getUpperBounds();<NEW_LINE>if (upperTypes.length > 0) {<NEW_LINE>final Type upperType = upperTypes[0];<NEW_LINE>if (upperType instanceof Class) {<NEW_LINE>return (Class<?>) upperType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (JAXBElement.class == type || type instanceof TypeVariable) {<NEW_LINE>return Object.class;<NEW_LINE>}<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>return (Class<?>) type;<NEW_LINE>} else if (genericType instanceof GenericArrayType) {<NEW_LINE>final GenericArrayType genericArrayType = (GenericArrayType) genericType;<NEW_LINE>return _getEntityClass(genericArrayType.getGenericComponentType());<NEW_LINE>} else {<NEW_LINE>return Object.class;<NEW_LINE>}<NEW_LINE>}
_getEntityClass(clazz.getComponentType());
437,458
public List<JavascriptResource> build(JavascriptGeneratorMode mode, boolean isCompat, String inputContent, String outputFileName) throws IOException {<NEW_LINE><MASK><NEW_LINE>StringWriter compressedSourceWriter = new StringWriter();<NEW_LINE>if (mode == JavascriptGeneratorMode.PRODUCTION) {<NEW_LINE>try (StringWriter sourcemapSectionWriter = new StringWriter()) {<NEW_LINE>final List<JavascriptProcessingError> errors = jsWriter.compress(new StringReader(inputContent), compressedSourceWriter, sourcemapSectionWriter, Files.getNameWithoutExtension(outputFileName) + ".map.js", null);<NEW_LINE>proccessBuildErrorsAndWarnings(errors);<NEW_LINE>return Arrays.asList(new JavascriptResource(inputContent, compressedSourceWriter.toString(), sourcemapSectionWriter.toString()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>jsWriter.compress(inputContent, compressedSourceWriter, outputFileName);<NEW_LINE>return Arrays.asList(new JavascriptResource(null, compressedSourceWriter.toString(), null));<NEW_LINE>}<NEW_LINE>}
JavascriptWriter jsWriter = mode.getJavascriptWriter();
1,362,521
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.group_join_bottom_sheet, container, false);<NEW_LINE>groupCancelButton = view.findViewById(R.id.group_join_cancel_button);<NEW_LINE>groupJoinButton = view.findViewById(R.id.group_join_button);<NEW_LINE>busy = view.findViewById(R.id.group_join_busy);<NEW_LINE>avatar = view.findViewById(R.id.group_join_recipient_avatar);<NEW_LINE>groupName = view.findViewById(R.id.group_join_group_name);<NEW_LINE>groupDescription = view.findViewById(R.id.group_join_group_description);<NEW_LINE>groupDetails = view.findViewById(R.id.group_join_group_details);<NEW_LINE>groupJoinExplain = view.findViewById(R.id.group_join_explain);<NEW_LINE>groupCancelButton.<MASK><NEW_LINE>avatar.setImageBytesForGroup(null, new FallbackPhotoProvider(), AvatarColor.UNKNOWN);<NEW_LINE>return view;<NEW_LINE>}
setOnClickListener(v -> dismiss());
871,086
public static long readLong(final DataInput in) throws IOException {<NEW_LINE>int b = in.readByte() & 0xFF;<NEW_LINE>int n = b & 0x7F;<NEW_LINE>long l;<NEW_LINE>if (b > 0x7F) {<NEW_LINE>b = in.readByte() & 0xFF;<NEW_LINE>n ^= (b & 0x7F) << 7;<NEW_LINE>if (b > 0x7F) {<NEW_LINE>b = in.readByte() & 0xFF;<NEW_LINE>n ^= (b & 0x7F) << 14;<NEW_LINE>if (b > 0x7F) {<NEW_LINE>b = in.readByte() & 0xFF;<NEW_LINE>n ^= (b & 0x7F) << 21;<NEW_LINE>l = b > 0x7F ? innerLongDecode(n, in) : n;<NEW_LINE>} else {<NEW_LINE>l = n;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>l = n;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>l = n;<NEW_LINE>}<NEW_LINE>return (l >>> 1<MASK><NEW_LINE>}
) ^ -(l & 1);
695,950
private void prepare(UploadCheckPoint uploadCheckPoint, UploadFileRequest uploadFileRequest) {<NEW_LINE>uploadCheckPoint.magic = UploadCheckPoint.UPLOAD_MAGIC;<NEW_LINE>uploadCheckPoint.uploadFile = uploadFileRequest.getUploadFile();<NEW_LINE>uploadCheckPoint.key = uploadFileRequest.getKey();<NEW_LINE>uploadCheckPoint.uploadFileStat = FileStat.getFileStat(uploadCheckPoint.uploadFile);<NEW_LINE>uploadCheckPoint.uploadParts = splitFile(uploadCheckPoint.uploadFileStat.size, uploadFileRequest.getPartSize());<NEW_LINE>uploadCheckPoint.partETags <MASK><NEW_LINE>uploadCheckPoint.originPartSize = uploadFileRequest.getPartSize();<NEW_LINE>ObjectMetadata metadata = uploadFileRequest.getObjectMetadata();<NEW_LINE>if (metadata == null) {<NEW_LINE>metadata = new ObjectMetadata();<NEW_LINE>}<NEW_LINE>if (metadata.getContentType() == null) {<NEW_LINE>metadata.setContentType(Mimetypes.getInstance().getMimetype(uploadCheckPoint.uploadFile, uploadCheckPoint.key));<NEW_LINE>}<NEW_LINE>InitiateMultipartUploadRequest initiateUploadRequest = new InitiateMultipartUploadRequest(uploadFileRequest.getBucketName(), uploadFileRequest.getKey(), metadata);<NEW_LINE>Payer payer = uploadFileRequest.getRequestPayer();<NEW_LINE>if (payer != null) {<NEW_LINE>initiateUploadRequest.setRequestPayer(payer);<NEW_LINE>}<NEW_LINE>initiateUploadRequest.setSequentialMode(uploadFileRequest.getSequentialMode());<NEW_LINE>InitiateMultipartUploadResult initiateUploadResult = initiateMultipartUploadWrap(uploadCheckPoint, initiateUploadRequest);<NEW_LINE>uploadCheckPoint.uploadID = initiateUploadResult.getUploadId();<NEW_LINE>}
= new ArrayList<PartETag>();
1,007,957
public void updateLocalFeedCounts(FeedSet fs) {<NEW_LINE>// decompose the FeedSet into a list of single feeds that need to be recounted<NEW_LINE>List<String> feedIds = new ArrayList<String>();<NEW_LINE>List<String> socialFeedIds = new ArrayList<String>();<NEW_LINE>if (fs.isAllNormal()) {<NEW_LINE>feedIds.addAll(getAllFeeds());<NEW_LINE>socialFeedIds.addAll(getAllSocialFeeds());<NEW_LINE>} else if (fs.getMultipleFeeds() != null) {<NEW_LINE>feedIds.<MASK><NEW_LINE>} else if (fs.getSingleFeed() != null) {<NEW_LINE>feedIds.add(fs.getSingleFeed());<NEW_LINE>} else if (fs.getSingleSocialFeed() != null) {<NEW_LINE>socialFeedIds.add(fs.getSingleSocialFeed().getKey());<NEW_LINE>} else if (fs.getMultipleSocialFeeds() != null) {<NEW_LINE>socialFeedIds.addAll(fs.getMultipleSocialFeeds().keySet());<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Asked to refresh story counts for FeedSet of unknown type.");<NEW_LINE>}<NEW_LINE>// now recount the number of unreads in each feed, one by one<NEW_LINE>for (String feedId : feedIds) {<NEW_LINE>FeedSet singleFs = FeedSet.singleFeed(feedId);<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(DatabaseConstants.FEED_NEGATIVE_COUNT, getLocalUnreadCount(singleFs, StateFilter.NEG));<NEW_LINE>values.put(DatabaseConstants.FEED_NEUTRAL_COUNT, getLocalUnreadCount(singleFs, StateFilter.NEUT));<NEW_LINE>values.put(DatabaseConstants.FEED_POSITIVE_COUNT, getLocalUnreadCount(singleFs, StateFilter.BEST));<NEW_LINE>synchronized (RW_MUTEX) {<NEW_LINE>dbRW.update(DatabaseConstants.FEED_TABLE, values, DatabaseConstants.FEED_ID + " = ?", new String[] { feedId });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String socialId : socialFeedIds) {<NEW_LINE>FeedSet singleFs = FeedSet.singleSocialFeed(socialId, "");<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(DatabaseConstants.SOCIAL_FEED_NEGATIVE_COUNT, getLocalUnreadCount(singleFs, StateFilter.NEG));<NEW_LINE>values.put(DatabaseConstants.SOCIAL_FEED_NEUTRAL_COUNT, getLocalUnreadCount(singleFs, StateFilter.NEUT));<NEW_LINE>values.put(DatabaseConstants.SOCIAL_FEED_POSITIVE_COUNT, getLocalUnreadCount(singleFs, StateFilter.BEST));<NEW_LINE>synchronized (RW_MUTEX) {<NEW_LINE>dbRW.update(DatabaseConstants.SOCIALFEED_TABLE, values, DatabaseConstants.SOCIAL_FEED_ID + " = ?", new String[] { socialId });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addAll(fs.getMultipleFeeds());
948,381
public static ListAnsInstancesResponse unmarshall(ListAnsInstancesResponse listAnsInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAnsInstancesResponse.setRequestId(_ctx.stringValue("ListAnsInstancesResponse.RequestId"));<NEW_LINE>listAnsInstancesResponse.setHttpCode(_ctx.stringValue("ListAnsInstancesResponse.HttpCode"));<NEW_LINE>listAnsInstancesResponse.setTotalCount(_ctx.integerValue("ListAnsInstancesResponse.TotalCount"));<NEW_LINE>listAnsInstancesResponse.setMessage(_ctx.stringValue("ListAnsInstancesResponse.Message"));<NEW_LINE>listAnsInstancesResponse.setPageSize(_ctx.integerValue("ListAnsInstancesResponse.PageSize"));<NEW_LINE>listAnsInstancesResponse.setPageNumber(_ctx.integerValue("ListAnsInstancesResponse.PageNumber"));<NEW_LINE>listAnsInstancesResponse.setErrorCode(_ctx.stringValue("ListAnsInstancesResponse.ErrorCode"));<NEW_LINE>listAnsInstancesResponse.setSuccess(_ctx.booleanValue("ListAnsInstancesResponse.Success"));<NEW_LINE>List<NacosAnsInstance> data = new ArrayList<NacosAnsInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAnsInstancesResponse.Data.Length"); i++) {<NEW_LINE>NacosAnsInstance nacosAnsInstance = new NacosAnsInstance();<NEW_LINE>nacosAnsInstance.setDefaultKey(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].DefaultKey"));<NEW_LINE>nacosAnsInstance.setEphemeral(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Ephemeral"));<NEW_LINE>nacosAnsInstance.setMarked(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Marked"));<NEW_LINE>nacosAnsInstance.setIp(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].Ip"));<NEW_LINE>nacosAnsInstance.setInstanceId(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].InstanceId"));<NEW_LINE>nacosAnsInstance.setPort(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].Port"));<NEW_LINE>nacosAnsInstance.setLastBeat(_ctx.longValue("ListAnsInstancesResponse.Data[" + i + "].LastBeat"));<NEW_LINE>nacosAnsInstance.setOkCount(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].OkCount"));<NEW_LINE>nacosAnsInstance.setWeight(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].Weight"));<NEW_LINE>nacosAnsInstance.setInstanceHeartBeatInterval(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].InstanceHeartBeatInterval"));<NEW_LINE>nacosAnsInstance.setIpDeleteTimeout(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].IpDeleteTimeout"));<NEW_LINE>nacosAnsInstance.setApp(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].App"));<NEW_LINE>nacosAnsInstance.setFailCount(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].FailCount"));<NEW_LINE>nacosAnsInstance.setHealthy(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Healthy"));<NEW_LINE>nacosAnsInstance.setEnabled(_ctx.booleanValue("ListAnsInstancesResponse.Data[" + i + "].Enabled"));<NEW_LINE>nacosAnsInstance.setDatumKey(_ctx.stringValue<MASK><NEW_LINE>nacosAnsInstance.setClusterName(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].ClusterName"));<NEW_LINE>nacosAnsInstance.setInstanceHeartBeatTimeOut(_ctx.integerValue("ListAnsInstancesResponse.Data[" + i + "].InstanceHeartBeatTimeOut"));<NEW_LINE>nacosAnsInstance.setServiceName(_ctx.stringValue("ListAnsInstancesResponse.Data[" + i + "].ServiceName"));<NEW_LINE>nacosAnsInstance.setMetadata(_ctx.mapValue("ListAnsInstancesResponse.Data[" + i + "].Metadata"));<NEW_LINE>data.add(nacosAnsInstance);<NEW_LINE>}<NEW_LINE>listAnsInstancesResponse.setData(data);<NEW_LINE>return listAnsInstancesResponse;<NEW_LINE>}
("ListAnsInstancesResponse.Data[" + i + "].DatumKey"));
1,438,910
protected void renderGraph(Graphics2D g2, double scale) {<NEW_LINE>List<List<SquareNode>> graphs = getClusters();<NEW_LINE>BasicStroke strokeWide = new BasicStroke(3);<NEW_LINE><MASK><NEW_LINE>Line2D.Double l = new Line2D.Double();<NEW_LINE>g2.setStroke(new BasicStroke(3));<NEW_LINE>for (int i = 0; i < graphs.size(); i++) {<NEW_LINE>List<SquareNode> graph = graphs.get(i);<NEW_LINE>int key = graphs.size() == 1 ? 0 : 255 * i / (graphs.size() - 1);<NEW_LINE>int rgb = key << 8 | (255 - key);<NEW_LINE>g2.setColor(new Color(rgb));<NEW_LINE>List<SquareEdge> edges = new ArrayList<>();<NEW_LINE>for (SquareNode n : graph) {<NEW_LINE>for (int j = 0; j < n.edges.length; j++) {<NEW_LINE>if (n.edges[j] != null && !edges.contains(n.edges[j])) {<NEW_LINE>edges.add(n.edges[j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (SquareEdge e : edges) {<NEW_LINE>Point2D_F64 a = e.a.center;<NEW_LINE>Point2D_F64 b = e.b.center;<NEW_LINE>// Point2D_F64 a = e.a.square.get(e.sideA);<NEW_LINE>// Point2D_F64 b = e.b.square.get(e.sideB);<NEW_LINE>l.setLine(a.x * scale, a.y * scale, b.x * scale, b.y * scale);<NEW_LINE>g2.setColor(Color.CYAN);<NEW_LINE>g2.setStroke(strokeWide);<NEW_LINE>g2.draw(l);<NEW_LINE>g2.setColor(new Color(rgb));<NEW_LINE>g2.setStroke(strokeNarrow);<NEW_LINE>g2.draw(l);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BasicStroke strokeNarrow = new BasicStroke(2);
832,832
static void copyDirectory(final Path source, final Path target, final CopyOption... options) throws IOException {<NEW_LINE>final boolean foreign = source.getFileSystem().provider() != target.getFileSystem().provider();<NEW_LINE>FileVisitor<Path> visitor = new SimpleFileVisitor<Path>() {<NEW_LINE><NEW_LINE>public FileVisitResult preVisitDirectory(Path current, BasicFileAttributes attr) throws IOException {<NEW_LINE>// get the *delta* path against the source path<NEW_LINE>Path rel = source.relativize(current);<NEW_LINE>String delta = rel != null ? rel.toString() : null;<NEW_LINE>Path newFolder = delta != null ? target.resolve(delta) : target;<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("Copy DIR: $current -> " + newFolder);<NEW_LINE>// this `copy` creates the new folder, but does not copy the contained files<NEW_LINE>Files.createDirectory(newFolder);<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path current, BasicFileAttributes attr) throws IOException {<NEW_LINE>// get the *delta* path against the source path<NEW_LINE>Path rel = source.relativize(current);<NEW_LINE>String delta = rel != null ? rel.toString() : null;<NEW_LINE>Path newFile = delta != null ? target.resolve(delta) : target;<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("Copy file: " + current + " -> " + newFile.toUri());<NEW_LINE>copyFile(current, newFile, foreign, options);<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS<MASK><NEW_LINE>}
), Integer.MAX_VALUE, visitor);
1,625,428
public void contextInitialized(final ServletContextEvent event) {<NEW_LINE>LOGGER.info("Initializing asynchronous event subsystem");<NEW_LINE>if (RequirementsVerifier.failedValidation()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EVENT_SERVICE.subscribe(BomUploadEvent.class, BomUploadProcessingTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(<MASK><NEW_LINE>EVENT_SERVICE.subscribe(InternalAnalysisEvent.class, InternalAnalysisTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(OssIndexAnalysisEvent.class, OssIndexAnalysisTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(GitHubAdvisoryMirrorEvent.class, GitHubAdvisoryMirrorTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(VulnDbSyncEvent.class, VulnDbSyncTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(VulnDbAnalysisEvent.class, VulnDbAnalysisTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(VulnerabilityAnalysisEvent.class, VulnerabilityAnalysisTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(PortfolioVulnerabilityAnalysisEvent.class, VulnerabilityAnalysisTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(RepositoryMetaEvent.class, RepositoryMetaAnalyzerTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(MetricsUpdateEvent.class, MetricsUpdateTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(CloneProjectEvent.class, CloneProjectTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(FortifySscUploadEventAbstract.class, FortifySscUploadTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(DefectDojoUploadEventAbstract.class, DefectDojoUploadTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(KennaSecurityUploadEventAbstract.class, KennaSecurityUploadTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(InternalComponentIdentificationEvent.class, InternalComponentIdentificationTask.class);<NEW_LINE>EVENT_SERVICE.subscribe(ClearComponentAnalysisCacheEvent.class, ClearComponentAnalysisCacheTask.class);<NEW_LINE>EVENT_SERVICE_ST.subscribe(IndexEvent.class, IndexTask.class);<NEW_LINE>EVENT_SERVICE_ST.subscribe(NistMirrorEvent.class, NistMirrorTask.class);<NEW_LINE>EVENT_SERVICE_ST.subscribe(EpssMirrorEvent.class, EpssMirrorTask.class);<NEW_LINE>TaskScheduler.getInstance();<NEW_LINE>}
LdapSyncEvent.class, LdapSyncTask.class);
1,111,999
public void onGroupInfoChanged(String groupID, List<V2TIMGroupChangeInfo> changeInfos) {<NEW_LINE>HashMap<String, Object> param = new HashMap<>();<NEW_LINE>param.put(TUIConstants.TUIGroup.GROUP_ID, groupID);<NEW_LINE>for (V2TIMGroupChangeInfo changeInfo : changeInfos) {<NEW_LINE>if (changeInfo.getType() == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_NAME) {<NEW_LINE>param.put(TUIConstants.TUIGroup.GROUP_NAME, changeInfo.getValue());<NEW_LINE>} else if (changeInfo.getType() == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_FACE_URL) {<NEW_LINE>param.put(TUIConstants.TUIGroup.GROUP_FACE_URL, changeInfo.getValue());<NEW_LINE>} else if (changeInfo.getType() == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_OWNER) {<NEW_LINE>param.put(TUIConstants.TUIGroup.GROUP_OWNER, changeInfo.getValue());<NEW_LINE>} else if (changeInfo.getType() == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_NOTIFICATION) {<NEW_LINE>param.put(TUIConstants.TUIGroup.GROUP_NOTIFICATION, changeInfo.getValue());<NEW_LINE>} else if (changeInfo.getType() == V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_INTRODUCTION) {<NEW_LINE>param.put(TUIConstants.TUIGroup.<MASK><NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TUICore.notifyEvent(TUIConstants.TUIGroup.EVENT_GROUP, TUIConstants.TUIGroup.EVENT_SUB_KEY_GROUP_INFO_CHANGED, param);<NEW_LINE>}
GROUP_INTRODUCTION, changeInfo.getValue());
1,215,624
private List<MLDataFormats.MessageRange> buildIndividualDeletedMessageRanges() {<NEW_LINE>lock.readLock().lock();<NEW_LINE>try {<NEW_LINE>if (individualDeletedMessages.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>MLDataFormats.NestedPositionInfo.Builder nestedPositionBuilder = MLDataFormats.NestedPositionInfo.newBuilder();<NEW_LINE>MLDataFormats.MessageRange.Builder messageRangeBuilder = MLDataFormats.MessageRange.newBuilder();<NEW_LINE>AtomicInteger acksSerializedSize = new AtomicInteger(0);<NEW_LINE>List<MessageRange> rangeList = Lists.newArrayList();<NEW_LINE>individualDeletedMessages.forEach((positionRange) -> {<NEW_LINE><MASK><NEW_LINE>nestedPositionBuilder.setLedgerId(p.getLedgerId());<NEW_LINE>nestedPositionBuilder.setEntryId(p.getEntryId());<NEW_LINE>messageRangeBuilder.setLowerEndpoint(nestedPositionBuilder.build());<NEW_LINE>p = positionRange.upperEndpoint();<NEW_LINE>nestedPositionBuilder.setLedgerId(p.getLedgerId());<NEW_LINE>nestedPositionBuilder.setEntryId(p.getEntryId());<NEW_LINE>messageRangeBuilder.setUpperEndpoint(nestedPositionBuilder.build());<NEW_LINE>MessageRange messageRange = messageRangeBuilder.build();<NEW_LINE>acksSerializedSize.addAndGet(messageRange.getSerializedSize());<NEW_LINE>rangeList.add(messageRange);<NEW_LINE>return rangeList.size() <= config.getMaxUnackedRangesToPersist();<NEW_LINE>});<NEW_LINE>this.individualDeletedMessagesSerializedSize = acksSerializedSize.get();<NEW_LINE>return rangeList;<NEW_LINE>} finally {<NEW_LINE>lock.readLock().unlock();<NEW_LINE>}<NEW_LINE>}
PositionImpl p = positionRange.lowerEndpoint();
803,239
public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) {<NEW_LINE>getWidget().client = client;<NEW_LINE>getWidget().id = uidl.getId();<NEW_LINE>if (uidl.hasVariable("text")) {<NEW_LINE>String newValue = uidl.getStringVariable("text");<NEW_LINE>if (!SharedUtil.equals(newValue, cachedValue)) {<NEW_LINE><MASK><NEW_LINE>cachedValue = newValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isRealUpdate(uidl)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getWidget().setEnabled(isEnabled());<NEW_LINE>getWidget().setReadOnly(isReadOnly());<NEW_LINE>getWidget().immediate = getState().immediate;<NEW_LINE>int newMaxLength = uidl.hasAttribute("maxLength") ? uidl.getIntAttribute("maxLength") : -1;<NEW_LINE>if (newMaxLength >= 0) {<NEW_LINE>if (getWidget().maxLength == -1) {<NEW_LINE>getWidget().keyPressHandler = getWidget().rta.addKeyPressHandler(getWidget());<NEW_LINE>}<NEW_LINE>getWidget().maxLength = newMaxLength;<NEW_LINE>} else if (getWidget().maxLength != -1) {<NEW_LINE>getWidget().getElement().setAttribute("maxlength", "");<NEW_LINE>getWidget().maxLength = -1;<NEW_LINE>getWidget().keyPressHandler.removeHandler();<NEW_LINE>}<NEW_LINE>if (uidl.hasAttribute("selectAll")) {<NEW_LINE>getWidget().selectAll();<NEW_LINE>}<NEW_LINE>}
getWidget().setValue(newValue);
511,236
// add or update broker special topic info<NEW_LINE>private void repBrokerTopicInfo(int brokerId, Map<String, TopicInfo> topicInfoMap) {<NEW_LINE>if (topicInfoMap == null || topicInfoMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// add topic info<NEW_LINE>ConcurrentHashMap<Integer, TopicInfo> newTopicInfoView;<NEW_LINE>ConcurrentHashMap<Integer, TopicInfo> curTopicInfoView;<NEW_LINE>for (TopicInfo topicInfo : topicInfoMap.values()) {<NEW_LINE>if (topicInfo == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>curTopicInfoView = topicConfInfoMap.get(topicInfo.getTopic());<NEW_LINE>if (curTopicInfoView == null) {<NEW_LINE>newTopicInfoView = new ConcurrentHashMap<Integer, TopicInfo>();<NEW_LINE>curTopicInfoView = topicConfInfoMap.putIfAbsent(topicInfo.getTopic(), newTopicInfoView);<NEW_LINE>if (curTopicInfoView == null) {<NEW_LINE>curTopicInfoView = newTopicInfoView;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>curTopicInfoView.put(brokerId, topicInfo.clone());<NEW_LINE>}<NEW_LINE>// add broker index<NEW_LINE>ConcurrentHashSet<String> curTopicSet = brokerIdIndexMap.get(brokerId);<NEW_LINE>if (curTopicSet == null) {<NEW_LINE>ConcurrentHashSet<String> newTopicSet = new ConcurrentHashSet<>();<NEW_LINE>curTopicSet = <MASK><NEW_LINE>if (curTopicSet == null) {<NEW_LINE>curTopicSet = newTopicSet;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>curTopicSet.addAll(topicInfoMap.keySet());<NEW_LINE>}
brokerIdIndexMap.putIfAbsent(brokerId, newTopicSet);
254,456
private Expression evaluateArgumentExpressions(AST ast, ITypeBinding requiredType, String key) {<NEW_LINE>CompilationUnit root = (CompilationUnit) fCallerNode.getRoot();<NEW_LINE>int offset = fCallerNode.getStartPosition();<NEW_LINE>Expression best = null;<NEW_LINE>ITypeBinding bestType = null;<NEW_LINE>ScopeAnalyzer analyzer = new ScopeAnalyzer(root);<NEW_LINE>IBinding[] bindings = analyzer.getDeclarationsInScope(offset, ScopeAnalyzer.VARIABLES);<NEW_LINE>for (int i = 0; i < bindings.length; i++) {<NEW_LINE>IVariableBinding curr = (IVariableBinding) bindings[i];<NEW_LINE>ITypeBinding type = curr.getType();<NEW_LINE>if (type != null && canAssign(type, requiredType) && testModifier(curr)) {<NEW_LINE>if (best == null || isMoreSpecific(bestType, type)) {<NEW_LINE>best = ast.newSimpleName(curr.getName());<NEW_LINE>bestType = type;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Expression defaultExpression = <MASK><NEW_LINE>if (best == null) {<NEW_LINE>best = defaultExpression;<NEW_LINE>}<NEW_LINE>return best;<NEW_LINE>}
ASTNodeFactory.newDefaultExpression(ast, requiredType);
880,548
private static void handlePlugInSingleRow(ConfigurationCompiler configuration, Element element) {<NEW_LINE>String name = element.getAttributes().getNamedItem("name").getTextContent();<NEW_LINE>String functionClassName = element.getAttributes().getNamedItem("function-class").getTextContent();<NEW_LINE>String functionMethodName = element.getAttributes().getNamedItem("function-method").getTextContent();<NEW_LINE>ConfigurationCompilerPlugInSingleRowFunction.ValueCache valueCache = ConfigurationCompilerPlugInSingleRowFunction.ValueCache.DISABLED;<NEW_LINE>ConfigurationCompilerPlugInSingleRowFunction.FilterOptimizable filterOptimizable = ConfigurationCompilerPlugInSingleRowFunction.FilterOptimizable.ENABLED;<NEW_LINE>String valueCacheStr = getOptionalAttribute(element, "value-cache");<NEW_LINE>if (valueCacheStr != null) {<NEW_LINE>valueCache = ConfigurationCompilerPlugInSingleRowFunction.ValueCache.valueOf(valueCacheStr.toUpperCase(Locale.ENGLISH));<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (filterOptimizableStr != null) {<NEW_LINE>filterOptimizable = ConfigurationCompilerPlugInSingleRowFunction.FilterOptimizable.valueOf(filterOptimizableStr.toUpperCase(Locale.ENGLISH));<NEW_LINE>}<NEW_LINE>String rethrowExceptionsStr = getOptionalAttribute(element, "rethrow-exceptions");<NEW_LINE>boolean rethrowExceptions = false;<NEW_LINE>if (rethrowExceptionsStr != null) {<NEW_LINE>rethrowExceptions = Boolean.parseBoolean(rethrowExceptionsStr);<NEW_LINE>}<NEW_LINE>String eventTypeName = getOptionalAttribute(element, "event-type-name");<NEW_LINE>configuration.addPlugInSingleRowFunction(new ConfigurationCompilerPlugInSingleRowFunction(name, functionClassName, functionMethodName, valueCache, filterOptimizable, rethrowExceptions, eventTypeName));<NEW_LINE>}
filterOptimizableStr = getOptionalAttribute(element, "filter-optimizable");
65,152
private TypeSpec createType(int sdk, boolean debuggable) {<NEW_LINE>TypeSpec.Builder result = TypeSpec.classBuilder(bindingClassName.simpleName()).addModifiers(PUBLIC).addOriginatingElement(enclosingElement);<NEW_LINE>if (isFinal) {<NEW_LINE>result.addModifiers(FINAL);<NEW_LINE>}<NEW_LINE>if (parentBinding != null) {<NEW_LINE>result.superclass(parentBinding.getBindingClassName());<NEW_LINE>} else {<NEW_LINE>result.addSuperinterface(UNBINDER);<NEW_LINE>}<NEW_LINE>if (hasTargetField()) {<NEW_LINE>result.addField(targetTypeName, "target", PRIVATE);<NEW_LINE>}<NEW_LINE>if (isView) {<NEW_LINE><MASK><NEW_LINE>} else if (isActivity) {<NEW_LINE>result.addMethod(createBindingConstructorForActivity());<NEW_LINE>} else if (isDialog) {<NEW_LINE>result.addMethod(createBindingConstructorForDialog());<NEW_LINE>}<NEW_LINE>if (!constructorNeedsView()) {<NEW_LINE>// Add a delegating constructor with a target type + view signature for reflective use.<NEW_LINE>result.addMethod(createBindingViewDelegateConstructor());<NEW_LINE>}<NEW_LINE>result.addMethod(createBindingConstructor(sdk, debuggable));<NEW_LINE>if (hasViewBindings() || parentBinding == null) {<NEW_LINE>result.addMethod(createBindingUnbindMethod(result));<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}
result.addMethod(createBindingConstructorForView());
1,263,729
protected boolean isSourceMethod(InfoflowManager manager, Stmt sCallSite) {<NEW_LINE>// We only support method calls<NEW_LINE>if (!sCallSite.containsInvokeExpr())<NEW_LINE>return false;<NEW_LINE>// Check for a direct match<NEW_LINE>SootMethod callee = sCallSite<MASK><NEW_LINE>if (this.sources.contains(callee))<NEW_LINE>return true;<NEW_LINE>// Check whether we have any of the interfaces on the list<NEW_LINE>String subSig = callee.getSubSignature();<NEW_LINE>for (SootClass i : interfacesOf.getUnchecked(sCallSite.getInvokeExpr().getMethod().getDeclaringClass())) {<NEW_LINE>SootMethod sm = i.getMethodUnsafe(subSig);<NEW_LINE>if (sm != null && this.sources.contains(sm))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Ask the CFG in case we don't know any better<NEW_LINE>for (SootMethod sm : manager.getICFG().getCalleesOfCallAt(sCallSite)) {<NEW_LINE>if (this.sources.contains(sm))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// nothing found<NEW_LINE>return false;<NEW_LINE>}
.getInvokeExpr().getMethod();
1,121,970
private void applyStyleRecord(ParsableByteArray parsableByteArray, SpannableStringBuilder cueText) throws SubtitleDecoderException {<NEW_LINE>assertTrue(parsableByteArray.bytesLeft() >= SIZE_STYLE_RECORD);<NEW_LINE>int start = parsableByteArray.readUnsignedShort();<NEW_LINE>int end = parsableByteArray.readUnsignedShort();<NEW_LINE>// font identifier<NEW_LINE>parsableByteArray.skipBytes(2);<NEW_LINE>int fontFace = parsableByteArray.readUnsignedByte();<NEW_LINE>// font size<NEW_LINE>parsableByteArray.skipBytes(1);<NEW_LINE>int colorRgba = parsableByteArray.readInt();<NEW_LINE>if (end > cueText.length()) {<NEW_LINE>Log.w(TAG, "Truncating styl end (" + end + ") to cueText.length() (" + cueText.length() + ").");<NEW_LINE>end = cueText.length();<NEW_LINE>}<NEW_LINE>if (start >= end) {<NEW_LINE>Log.w(TAG, "Ignoring styl with start (" + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>attachFontFace(cueText, fontFace, defaultFontFace, start, end, SPAN_PRIORITY_HIGH);<NEW_LINE>attachColor(cueText, colorRgba, defaultColorRgba, start, end, SPAN_PRIORITY_HIGH);<NEW_LINE>}
start + ") >= end (" + end + ").");
53,021
public ApiKeyBean updateClientApiKey(String organizationId, String clientId, String version, ApiKeyBean bean) throws ClientNotFoundException, NotAuthorizedException, InvalidVersionException, InvalidClientStatusException {<NEW_LINE>securityContext.checkPermissions(PermissionType.clientEdit, organizationId);<NEW_LINE>try {<NEW_LINE>ClientVersionBean clientVersion = <MASK><NEW_LINE>if (clientVersion.getStatus() == ClientStatus.Registered) {<NEW_LINE>throw ExceptionFactory.invalidClientStatusException();<NEW_LINE>}<NEW_LINE>String newApiKey = bean.getApiKey();<NEW_LINE>if (StringUtils.isEmpty(newApiKey)) {<NEW_LINE>newApiKey = apiKeyGenerator.generate();<NEW_LINE>}<NEW_LINE>clientVersion.setApikey(newApiKey);<NEW_LINE>clientVersion.setModifiedBy(securityContext.getCurrentUser());<NEW_LINE>clientVersion.setModifiedOn(new Date());<NEW_LINE>storage.beginTx();<NEW_LINE>storage.updateClientVersion(clientVersion);<NEW_LINE>storage.commitTx();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug(String.format("Updated an API Key for client %s version %s", clientVersion.getClient().getName(), clientVersion));<NEW_LINE>ApiKeyBean rval = new ApiKeyBean();<NEW_LINE>rval.setApiKey(newApiKey);<NEW_LINE>return rval;<NEW_LINE>} catch (AbstractRestException e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>storage.rollbackTx();<NEW_LINE>throw new SystemErrorException(e);<NEW_LINE>}<NEW_LINE>}
getClientVersionInternal(organizationId, clientId, version);
295,140
protected DocWriter createWriter(final MBasicTable table, final Document document, final OutputStream out) {<NEW_LINE>final RtfWriter2 writer = RtfWriter2.getInstance(document, out);<NEW_LINE>// title<NEW_LINE>final String title = buildTitle(table);<NEW_LINE>if (title != null) {<NEW_LINE>final HeaderFooter header = new RtfHeaderFooter(new Paragraph(title));<NEW_LINE>header.setAlignment(Element.ALIGN_LEFT);<NEW_LINE>header.setBorder(Rectangle.NO_BORDER);<NEW_LINE>document.setHeader(header);<NEW_LINE>document.addTitle(title);<NEW_LINE>}<NEW_LINE>// advanced page numbers : x/y<NEW_LINE>final Paragraph footerParagraph = new Paragraph();<NEW_LINE>final Font font = FontFactory.getFont(FontFactory.TIMES_ROMAN, 12, Font.NORMAL);<NEW_LINE>footerParagraph.add(new RtfPageNumber(font));<NEW_LINE>footerParagraph.add(<MASK><NEW_LINE>footerParagraph.add(new RtfTotalPageNumber(font));<NEW_LINE>footerParagraph.setAlignment(Element.ALIGN_CENTER);<NEW_LINE>final HeaderFooter footer = new RtfHeaderFooter(footerParagraph);<NEW_LINE>footer.setBorder(Rectangle.TOP);<NEW_LINE>document.setFooter(footer);<NEW_LINE>return writer;<NEW_LINE>}
new Phrase(" / ", font));
798,881
public void initialize() {<NEW_LINE>if (savedPassword != null) {<NEW_LINE>savePasswordCheckbox.setSelected(true);<NEW_LINE>passwordField.setPassword(savedPassword);<NEW_LINE>}<NEW_LINE>unlockButtonDisabled.bind(unlockInProgress.or(passwordField.textProperty().isEmpty()));<NEW_LINE>var leftArmTranslation = new Translate(24, 0);<NEW_LINE>var leftArmRotation = new Rotate(60, 16, 30, 0);<NEW_LINE>var leftArmRetracted = new KeyValue(leftArmTranslation.xProperty(), 24);<NEW_LINE>var leftArmExtended = new KeyValue(leftArmTranslation.xProperty(), 0.0);<NEW_LINE>var leftArmHorizontal = new KeyValue(leftArmRotation.angleProperty(), 60, Interpolator.EASE_OUT);<NEW_LINE>var leftArmHanging = new KeyValue(leftArmRotation.angleProperty(), 0);<NEW_LINE>leftArm.getTransforms().setAll(leftArmTranslation, leftArmRotation);<NEW_LINE>var rightArmTranslation = new Translate(-24, 0);<NEW_LINE>var rightArmRotation = new Rotate(60, 48, 30, 0);<NEW_LINE>var rightArmRetracted = new KeyValue(rightArmTranslation.xProperty(), -24);<NEW_LINE>var rightArmExtended = new KeyValue(rightArmTranslation.xProperty(), 0.0);<NEW_LINE>var rightArmHorizontal = new KeyValue(rightArmRotation.angleProperty(), -60);<NEW_LINE>var rightArmHanging = new KeyValue(rightArmRotation.angleProperty(), 0, Interpolator.EASE_OUT);<NEW_LINE>rightArm.getTransforms().setAll(rightArmTranslation, rightArmRotation);<NEW_LINE>var legsRetractedY = new KeyValue(legs.scaleYProperty(), 0);<NEW_LINE>var legsExtendedY = new KeyValue(legs.scaleYProperty(), 1, Interpolator.EASE_OUT);<NEW_LINE>var legsRetractedX = new KeyValue(legs.scaleXProperty(), 0);<NEW_LINE>var legsExtendedX = new KeyValue(legs.scaleXProperty(), 1, Interpolator.EASE_OUT);<NEW_LINE>legs.setScaleY(0);<NEW_LINE>legs.setScaleX(0);<NEW_LINE>var faceHidden = new KeyValue(face.opacityProperty(), 0.0);<NEW_LINE>var faceVisible = new KeyValue(face.opacityProperty(), 1.0, Interpolator.LINEAR);<NEW_LINE>face.setOpacity(0);<NEW_LINE>unlockAnimation = new //<NEW_LINE>//<NEW_LINE>Timeline(//<NEW_LINE>new KeyFrame(Duration.ZERO, leftArmRetracted, leftArmHorizontal, rightArmRetracted, rightArmHorizontal, legsRetractedY, legsRetractedX, faceHidden), //<NEW_LINE>new KeyFrame(Duration.millis(200), leftArmExtended, leftArmHorizontal, rightArmRetracted, rightArmHorizontal), //<NEW_LINE>new KeyFrame(Duration.millis(400), leftArmExtended, leftArmHanging, rightArmExtended, rightArmHorizontal), //<NEW_LINE>new KeyFrame(Duration.millis(600), leftArmExtended, leftArmHanging, rightArmExtended, rightArmHanging), //<NEW_LINE>new KeyFrame(Duration.millis(800), legsExtendedY, legsExtendedX, faceHidden), new KeyFrame(Duration.<MASK><NEW_LINE>result.whenCompleteAsync((r, t) -> stopUnlockAnimation());<NEW_LINE>}
millis(1000), faceVisible));
1,503,318
public static StatementExecutorResponse execute(final ConfiguredStatement<ListProperties> statement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {<NEW_LINE>final KsqlConfigResolver resolver = new KsqlConfigResolver();<NEW_LINE>final Map<String, String> engineProperties = statement.getSessionConfig().getConfig(false).getAllConfigPropsWithSecretsObfuscated();<NEW_LINE>final List<Property> mergedProperties = mergedProperties(statement);<NEW_LINE>final List<String> overwritten = mergedProperties.stream().filter(property -> !Objects.equals(engineProperties.get(property.getName()), property.getValue())).map(Property::getName).<MASK><NEW_LINE>final List<String> defaultProps = mergedProperties.stream().filter(property -> resolver.resolve(property.getName(), false).map(resolved -> resolved.isDefaultValue(property.getValue())).orElse(false)).map(Property::getName).collect(Collectors.toList());<NEW_LINE>return StatementExecutorResponse.handled(Optional.of(new PropertiesList(statement.getStatementText(), mergedProperties, overwritten, defaultProps)));<NEW_LINE>}
collect(Collectors.toList());
137,094
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {<NEW_LINE>setPreferencesFromResource(R.xml.preferences_services_geocaching_com, rootKey);<NEW_LINE>// Open website Preference<NEW_LINE>final Preference openWebsite = findPreference(getString(R.string.pref_fakekey_gc_website));<NEW_LINE>final String urlOrHost = GCConnector.getInstance().getHost();<NEW_LINE>openWebsite.setOnPreferenceClickListener(preference -> {<NEW_LINE>final String url = StringUtils.startsWith(urlOrHost, <MASK><NEW_LINE>ShareUtils.openUrl(getContext(), url);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>// Facebook Login Hint<NEW_LINE>final Preference loginFacebook = findPreference(getString(R.string.pref_gc_fb_login_hint));<NEW_LINE>loginFacebook.setOnPreferenceClickListener(preference -> {<NEW_LINE>final AlertDialog.Builder builder = Dialogs.newBuilder(getContext());<NEW_LINE>builder.setMessage(R.string.settings_info_facebook_login).setIcon(android.R.drawable.ic_dialog_info).setTitle(R.string.settings_info_facebook_login_title).setPositiveButton(android.R.string.ok, (dialog, id) -> dialog.cancel()).setNegativeButton(R.string.more_information, (dialog, id) -> ShareUtils.openUrl(getContext(), getString(R.string.settings_facebook_login_url)));<NEW_LINE>builder.create().show();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}
"http") ? urlOrHost : "http://" + urlOrHost;
1,264,787
protected Object extend(Object[] arguments) {<NEW_LINE>if (JSConfig.SubstrateVM) {<NEW_LINE>throw Errors.unsupported("JavaAdapter");<NEW_LINE>}<NEW_LINE>if (arguments.length == 0) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("Java.extend needs at least one argument.");<NEW_LINE>}<NEW_LINE>final int typesLength;<NEW_LINE>final Object classOverrides;<NEW_LINE>if (JSRuntime.isObject(arguments[arguments.length - 1])) {<NEW_LINE>classOverrides = arguments[arguments.length - 1];<NEW_LINE>typesLength = arguments.length - 1;<NEW_LINE>if (typesLength == 0) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("Java.extend needs at least one type argument.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>classOverrides = null;<NEW_LINE>typesLength = arguments.length;<NEW_LINE>}<NEW_LINE>final TruffleLanguage.Env env = getRealm().getEnv();<NEW_LINE>final Object[] types = new Object[typesLength];<NEW_LINE>for (int i = 0; i < typesLength; i++) {<NEW_LINE>if (!isType(arguments[i], env)) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("Java.extend needs Java types as its arguments.");<NEW_LINE>}<NEW_LINE>types[i] = arguments[i];<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (classOverrides != null) {<NEW_LINE>return env.createHostAdapterWithClassOverrides(types, classOverrides);<NEW_LINE>} else {<NEW_LINE>return env.createHostAdapter(types);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw Errors.createTypeError(ex.<MASK><NEW_LINE>}<NEW_LINE>}
getMessage(), ex, this);
1,717,248
public static void main(String[] args) throws IOException, ClassNotFoundException {<NEW_LINE>String dvmodelFile = null;<NEW_LINE>String lexparserFile = null;<NEW_LINE>String testTreebankPath = null;<NEW_LINE>FileFilter testTreebankFilter = null;<NEW_LINE>List<String> unusedArgs = new ArrayList<>();<NEW_LINE>for (int argIndex = 0; argIndex < args.length; ) {<NEW_LINE>if (args[argIndex].equalsIgnoreCase("-lexparser")) {<NEW_LINE>lexparserFile = args[argIndex + 1];<NEW_LINE>argIndex += 2;<NEW_LINE>} else if (args[argIndex].equalsIgnoreCase("-testTreebank")) {<NEW_LINE>Pair<String, FileFilter> treebankDescription = ArgUtils.getTreebankDescription(args, argIndex, "-testTreebank");<NEW_LINE>argIndex = argIndex + ArgUtils.<MASK><NEW_LINE>testTreebankPath = treebankDescription.first();<NEW_LINE>testTreebankFilter = treebankDescription.second();<NEW_LINE>} else {<NEW_LINE>unusedArgs.add(args[argIndex++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("Loading lexparser from: " + lexparserFile);<NEW_LINE>String[] newArgs = unusedArgs.toArray(new String[unusedArgs.size()]);<NEW_LINE>LexicalizedParser lexparser = LexicalizedParser.loadModel(lexparserFile, newArgs);<NEW_LINE>log.info("... done");<NEW_LINE>Treebank testTreebank = null;<NEW_LINE>if (testTreebankPath != null) {<NEW_LINE>log.info("Reading in trees from " + testTreebankPath);<NEW_LINE>if (testTreebankFilter != null) {<NEW_LINE>log.info("Filtering on " + testTreebankFilter);<NEW_LINE>}<NEW_LINE>testTreebank = lexparser.getOp().tlpParams.memoryTreebank();<NEW_LINE>;<NEW_LINE>testTreebank.loadPath(testTreebankPath, testTreebankFilter);<NEW_LINE>log.info("Read in " + testTreebank.size() + " trees for testing");<NEW_LINE>}<NEW_LINE>double[] labelResults = new double[weights.length];<NEW_LINE>double[] tagResults = new double[weights.length];<NEW_LINE>for (int i = 0; i < weights.length; ++i) {<NEW_LINE>lexparser.getOp().baseParserWeight = weights[i];<NEW_LINE>EvaluateTreebank evaluator = new EvaluateTreebank(lexparser);<NEW_LINE>evaluator.testOnTreebank(testTreebank);<NEW_LINE>labelResults[i] = evaluator.getLBScore();<NEW_LINE>tagResults[i] = evaluator.getTagScore();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < weights.length; ++i) {<NEW_LINE>log.info("LexicalizedParser weight " + weights[i] + ": labeled " + labelResults[i] + " tag " + tagResults[i]);<NEW_LINE>}<NEW_LINE>}
numSubArgs(args, argIndex) + 1;
373,427
private JComponent createActionsToolbar() {<NEW_LINE>DefaultActionGroup toolbarGroup = new DefaultActionGroup();<NEW_LINE>toolbarGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.TOOLBAR_ACTION_GROUP));<NEW_LINE>DefaultActionGroup mainGroup = new DefaultActionGroup();<NEW_LINE>mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_TEXT_FILTER_SETTINGS_ACTION));<NEW_LINE>mainGroup<MASK><NEW_LINE>mainGroup.add(myFilterUi.createActionGroup());<NEW_LINE>mainGroup.addSeparator();<NEW_LINE>if (BekUtil.isBekEnabled()) {<NEW_LINE>if (BekUtil.isLinearBekEnabled()) {<NEW_LINE>mainGroup.add(new IntelliSortChooserPopupAction());<NEW_LINE>// can not register both of the actions in xml file, choosing to register an action for the "outer world"<NEW_LINE>// I can of course if linear bek is enabled replace the action on start but why bother<NEW_LINE>} else {<NEW_LINE>mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_INTELLI_SORT_ACTION));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mainGroup.add(toolbarGroup);<NEW_LINE>ActionToolbar toolbar = createActionsToolbar(mainGroup);<NEW_LINE>Wrapper textFilter = new Wrapper(myTextFilter);<NEW_LINE>textFilter.setVerticalSizeReferent(toolbar.getComponent());<NEW_LINE>textFilter.setBorder(JBUI.Borders.emptyLeft(5));<NEW_LINE>ActionToolbar settings = createActionsToolbar(new DefaultActionGroup(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_QUICK_SETTINGS_ACTION)));<NEW_LINE>settings.setReservePlaceAutoPopupIcon(false);<NEW_LINE>settings.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);<NEW_LINE>JPanel panel = new JPanel(new MigLayout("ins 0, fill", "[left]0[left, fill]push[right]", "center"));<NEW_LINE>panel.add(textFilter);<NEW_LINE>panel.add(toolbar.getComponent());<NEW_LINE>panel.add(settings.getComponent());<NEW_LINE>return panel;<NEW_LINE>}
.add(new AnSeparator());
755,218
public void resultChanged(org.openide.util.LookupEvent ev) {<NEW_LINE>Collection<? extends ActionMap> ams = result.allInstances();<NEW_LINE>if (err.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>err.fine("changed maps : " + ams);<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// do nothing if maps are actually the same<NEW_LINE>if (ams.size() == actionMaps.size()) {<NEW_LINE>boolean theSame = true;<NEW_LINE>int i = 0;<NEW_LINE>for (Iterator<? extends ActionMap> newMaps = ams.iterator(); newMaps.hasNext(); i++) {<NEW_LINE>ActionMap oldMap = actionMaps.get(i).get();<NEW_LINE>if (oldMap == null || oldMap != newMaps.next()) {<NEW_LINE>theSame = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (theSame) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update actionMaps<NEW_LINE>List<Reference<ActionMap>> tempActionMaps = new ArrayList<Reference<ActionMap>>(2);<NEW_LINE>for (ActionMap actionMap : ams) {<NEW_LINE>tempActionMaps.add(new WeakReference<ActionMap>(actionMap));<NEW_LINE>}<NEW_LINE>actionMaps = tempActionMaps;<NEW_LINE>if (err.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>err.fine("clearActionPerformers");<NEW_LINE>}<NEW_LINE>Mutex.EVENT.readAccess(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>clearActionPerformers();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
err.fine("previous maps: " + actionMaps);
436,960
void bufferAdd(ByteBuffer buf) {<NEW_LINE>final <MASK><NEW_LINE>if (object instanceof ByteBuffer) {<NEW_LINE>final ByteBuffer other = (ByteBuffer) object;<NEW_LINE>BloomKFilter.mergeBloomFilterByteBuffers(buf, buf.position(), other, other.position());<NEW_LINE>} else {<NEW_LINE>if (object instanceof Long) {<NEW_LINE>BloomKFilter.addLong(buf, (long) object);<NEW_LINE>} else if (object instanceof Double) {<NEW_LINE>BloomKFilter.addDouble(buf, (double) object);<NEW_LINE>} else if (object instanceof Float) {<NEW_LINE>BloomKFilter.addFloat(buf, (float) object);<NEW_LINE>} else if (object instanceof String) {<NEW_LINE>BloomKFilter.addString(buf, (String) object);<NEW_LINE>} else {<NEW_LINE>BloomKFilter.addBytes(buf, null, 0, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Object object = selector.getObject();
466,498
public long count(Id source, List<EdgeStep> steps, boolean containsTraversed, long dedupSize) {<NEW_LINE>E.checkNotNull(source, "source vertex id");<NEW_LINE>this.checkVertexExist(source, "source vertex");<NEW_LINE>E.checkArgument(steps != null && !steps.isEmpty(), "The steps can't be empty");<NEW_LINE>checkDedupSize(dedupSize);<NEW_LINE>this.containsTraversed = containsTraversed;<NEW_LINE>this.dedupSize = dedupSize;<NEW_LINE>if (this.containsTraversed) {<NEW_LINE>this.count.increment();<NEW_LINE>}<NEW_LINE>int stepNum = steps.size();<NEW_LINE>EdgeStep firstStep = steps.get(0);<NEW_LINE>if (stepNum == 1) {<NEW_LINE>// Just one step, query count and return<NEW_LINE>long edgesCount = this.edgesCount(source, firstStep);<NEW_LINE>this.count.add(edgesCount);<NEW_LINE>return this.count.longValue();<NEW_LINE>}<NEW_LINE>// Multiple steps, construct first step to iterator<NEW_LINE>Iterator<Edge> edges = <MASK><NEW_LINE>// Wrap steps to Iterator except last step<NEW_LINE>for (int i = 1; i < stepNum - 1; i++) {<NEW_LINE>EdgeStep currentStep = steps.get(i);<NEW_LINE>edges = new FlatMapperIterator<>(edges, (edge) -> {<NEW_LINE>Id target = ((HugeEdge) edge).id().otherVertexId();<NEW_LINE>return this.edgesOfVertexWithCount(target, currentStep);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// The last step, just query count<NEW_LINE>EdgeStep lastStep = steps.get(stepNum - 1);<NEW_LINE>while (edges.hasNext()) {<NEW_LINE>Id target = ((HugeEdge) edges.next()).id().otherVertexId();<NEW_LINE>if (this.dedup(target)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Count last layer vertices(without dedup size)<NEW_LINE>long edgesCount = this.edgesCount(target, lastStep);<NEW_LINE>this.count.add(edgesCount);<NEW_LINE>}<NEW_LINE>return this.count.longValue();<NEW_LINE>}
this.edgesOfVertexWithCount(source, firstStep);
519,699
public void route() {<NEW_LINE>if (start == null || end == null) {<NEW_LINE>if (start == null) {<NEW_LINE>if (starting.getText().length() > 0) {<NEW_LINE>starting.setError("Choose location from dropdown.");<NEW_LINE>} else {<NEW_LINE>Toast.makeText(this, "Please choose a starting point.", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (end == null) {<NEW_LINE>if (destination.getText().length() > 0) {<NEW_LINE>destination.setError("Choose location from dropdown.");<NEW_LINE>} else {<NEW_LINE>Toast.makeText(this, "Please choose a destination.", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>progressDialog = ProgressDialog.show(this, "Please wait.", "Fetching route information.", true);<NEW_LINE>Routing routing = new Routing.Builder().travelMode(AbstractRouting.TravelMode.DRIVING).withListener(this).alternativeRoutes(true).waypoints(start, end).build();<NEW_LINE>routing.execute();<NEW_LINE>}<NEW_LINE>}
Toast.LENGTH_SHORT).show();
1,163,344
public void exitIp_prefix_list_tail(Ip_prefix_list_tailContext ctx) {<NEW_LINE>LineAction action = toLineAction(ctx.action);<NEW_LINE>Prefix prefix = Prefix.parse(ctx.prefix.getText());<NEW_LINE>int prefixLength = prefix.getPrefixLength();<NEW_LINE>int minLen = prefixLength;<NEW_LINE>int maxLen = prefixLength;<NEW_LINE>if (ctx.minpl != null) {<NEW_LINE>minLen = toInteger(ctx.minpl);<NEW_LINE>maxLen = Prefix.MAX_PREFIX_LENGTH;<NEW_LINE>}<NEW_LINE>if (ctx.maxpl != null) {<NEW_LINE>maxLen = toInteger(ctx.maxpl);<NEW_LINE>}<NEW_LINE>if (ctx.eqpl != null) {<NEW_LINE>minLen = toInteger(ctx.eqpl);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SubRange lengthRange = new SubRange(minLen, maxLen);<NEW_LINE>PrefixListLine line = new PrefixListLine(action, prefix, lengthRange);<NEW_LINE>_currentPrefixList.addLine(line);<NEW_LINE>}
maxLen = toInteger(ctx.eqpl);
1,749,518
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.fragment_auto_applink, container, false);<NEW_LINE>final EditText viewAppID = (EditText) view.findViewById(R.id.auto_applink_app_id);<NEW_LINE>final EditText viewProductID = (EditText) view.<MASK><NEW_LINE>Button sendButton = (Button) view.findViewById(R.id.auto_applink_button);<NEW_LINE>sendButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>String appID = viewAppID.getText().toString();<NEW_LINE>String productID = viewProductID.getText().toString();<NEW_LINE>if (appID.length() == 0) {<NEW_LINE>showAlert("Invalid App ID!");<NEW_LINE>} else if (productID.length() == 0) {<NEW_LINE>showAlert("Invalid Product ID!");<NEW_LINE>} else {<NEW_LINE>String autoAppLink = "fb" + appID + "://applinks?al_applink_data=";<NEW_LINE>JSONObject data = new JSONObject();<NEW_LINE>try {<NEW_LINE>data.put("product_id", productID);<NEW_LINE>data.put("is_auto_applink", true);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>showAlert("Cannot generate auto applink url!");<NEW_LINE>}<NEW_LINE>String dataString = data.toString();<NEW_LINE>autoAppLink = autoAppLink + Uri.encode(dataString);<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(autoAppLink));<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>}
findViewById(R.id.auto_applink_product_id);
1,819,116
public final ObjectelemContext objectelem() throws RecognitionException {<NEW_LINE>ObjectelemContext _localctx = new ObjectelemContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 26, RULE_objectelem);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(199);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case Identifier:<NEW_LINE>{<NEW_LINE>setState(195);<NEW_LINE>match(Identifier);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LPAREN:<NEW_LINE>{<NEW_LINE>setState(196);<NEW_LINE>match(LPAREN);<NEW_LINE>setState(197);<NEW_LINE>match(Identifier);<NEW_LINE>setState(198);<NEW_LINE>match(RPAREN);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(201);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == ASSIGN || _la == COLON)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(202);<NEW_LINE>expression(0);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
304,508
private void loadNode128() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.FileType_GetPosition, new QualifiedName(0, "GetPosition"), new LocalizedText("en", "GetPosition"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.FileType_GetPosition, Identifiers.HasProperty, Identifiers.FileType_GetPosition_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.FileType_GetPosition, Identifiers.HasProperty, Identifiers.FileType_GetPosition_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.FileType_GetPosition, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.FileType_GetPosition, Identifiers.HasComponent, Identifiers.FileType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
588,759
public void addComponent(ChatConversationComponent component) {<NEW_LINE>synchronized (scrollToBottomRunnable) {<NEW_LINE>StyleSheet styleSheet = document.getStyleSheet();<NEW_LINE>Style style = styleSheet.addStyle(StyleConstants.ComponentElementName, styleSheet.getStyle("body"));<NEW_LINE>// The image must first be wrapped in a style<NEW_LINE>style.addAttribute(<MASK><NEW_LINE>TransparentPanel wrapPanel = new TransparentPanel(new BorderLayout());<NEW_LINE>wrapPanel.add(component, BorderLayout.NORTH);<NEW_LINE>style.addAttribute(StyleConstants.ComponentAttribute, wrapPanel);<NEW_LINE>style.addAttribute(Attribute.ID, ChatHtmlUtils.MESSAGE_TEXT_ID);<NEW_LINE>SimpleDateFormat sdf = new SimpleDateFormat(HistoryService.DATE_FORMAT);<NEW_LINE>style.addAttribute(ChatHtmlUtils.DATE_ATTRIBUTE, sdf.format(component.getDate()));<NEW_LINE>scrollToBottomIsPending = true;<NEW_LINE>// We need to reinitialize the last message ID, because we don't<NEW_LINE>// want components to be taken into account.<NEW_LINE>lastMessageUID = null;<NEW_LINE>// Insert the component style at the end of the text<NEW_LINE>try {<NEW_LINE>document.insertString(document.getLength(), "ignored text", style);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>logger.error("Insert in the HTMLDocument failed.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
AbstractDocument.ElementNameAttribute, StyleConstants.ComponentElementName);
1,240,902
public List selectInstancesFiredTriggerRecords(Connection conn, String instanceName) throws SQLException {<NEW_LINE>PreparedStatement ps = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>List lst = new LinkedList();<NEW_LINE>ps = conn.prepareStatement(rtp(SELECT_INSTANCES_FIRED_TRIGGERS.toLowerCase()));<NEW_LINE>ps.setString(1, instanceName);<NEW_LINE>rs = ps.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>FiredTriggerRecord rec = new FiredTriggerRecord();<NEW_LINE>rec.setFireInstanceId(rs.getString(COL_ENTRY_ID.toLowerCase()));<NEW_LINE>rec.setFireInstanceState(rs.getString(COL_ENTRY_STATE.toLowerCase()));<NEW_LINE>rec.setFireTimestamp(rs.getLong(COL_FIRED_TIME.toLowerCase()));<NEW_LINE>rec.setSchedulerInstanceId(rs.getString(COL_INSTANCE_NAME.toLowerCase()));<NEW_LINE>rec.setTriggerIsVolatile(getBoolean(rs<MASK><NEW_LINE>rec.setTriggerKey(new Key(rs.getString(COL_TRIGGER_NAME.toLowerCase()), rs.getString(COL_TRIGGER_GROUP.toLowerCase())));<NEW_LINE>if (!rec.getFireInstanceState().equals(STATE_ACQUIRED)) {<NEW_LINE>rec.setJobIsStateful(getBoolean(rs, COL_IS_STATEFUL.toLowerCase()));<NEW_LINE>rec.setJobRequestsRecovery(rs.getBoolean(COL_REQUESTS_RECOVERY.toLowerCase()));<NEW_LINE>rec.setJobKey(new Key(rs.getString(COL_JOB_NAME.toLowerCase()), rs.getString(COL_JOB_GROUP.toLowerCase())));<NEW_LINE>}<NEW_LINE>rec.setPriority(rs.getInt(COL_PRIORITY.toLowerCase()));<NEW_LINE>lst.add(rec);<NEW_LINE>}<NEW_LINE>return lst;<NEW_LINE>} finally {<NEW_LINE>closeResultSet(rs);<NEW_LINE>closeStatement(ps);<NEW_LINE>}<NEW_LINE>}
, COL_IS_VOLATILE.toLowerCase()));
1,064,518
private PopOver createPopOver() {<NEW_LINE>Label titleLabel = new Label(popupTitle);<NEW_LINE>titleLabel.setMaxWidth(DEFAULT_WIDTH);<NEW_LINE>titleLabel.setWrapText(true);<NEW_LINE>titleLabel.setPadding(new Insets(10, 10, 0, 10));<NEW_LINE>titleLabel.getStyleClass().add("account-status-title");<NEW_LINE>Label infoLabel = new Label(witnessAgeData.getInfo());<NEW_LINE>infoLabel.setMaxWidth(DEFAULT_WIDTH);<NEW_LINE>infoLabel.setWrapText(true);<NEW_LINE>infoLabel.setPadding(new Insets(0, 10, 4, 10));<NEW_LINE>infoLabel.getStyleClass().add("small-text");<NEW_LINE>Label buyLabel = createDetailsItem(Res.get("offerbook.timeSinceSigning.tooltip.checkmark.buyBtc"), witnessAgeData.isAccountSigned());<NEW_LINE>Label waitLabel = createDetailsItem(Res.get("offerbook.timeSinceSigning.tooltip.checkmark.wait", SignedWitnessService.SIGNER_AGE_DAYS), witnessAgeData.isLimitLifted());<NEW_LINE>Hyperlink learnMoreLink = new ExternalHyperlink(Res.get("offerbook.timeSinceSigning.tooltip.learnMore"), null, "0.769em");<NEW_LINE>learnMoreLink.setMaxWidth(DEFAULT_WIDTH);<NEW_LINE>learnMoreLink.setWrapText(true);<NEW_LINE>learnMoreLink.setPadding(new Insets(10, 10, 2, 10));<NEW_LINE>learnMoreLink.getStyleClass().addAll("very-small-text");<NEW_LINE>learnMoreLink.setOnAction((e) -> GUIUtil.openWebPage("https://bisq.wiki/Account_limits"));<NEW_LINE>VBox vBox = new VBox(2, titleLabel, infoLabel, buyLabel, waitLabel, learnMoreLink);<NEW_LINE>vBox.setPadding(new Insets(2, 0, 2, 0));<NEW_LINE>vBox.setAlignment(Pos.CENTER_LEFT);<NEW_LINE>PopOver popOver = new PopOver(vBox);<NEW_LINE>popOver.setArrowLocation(PopOver.ArrowLocation.LEFT_CENTER);<NEW_LINE>vBox.<MASK><NEW_LINE>vBox.setOnMouseExited(mouseEvent -> {<NEW_LINE>keepPopOverVisible = false;<NEW_LINE>popOver.hide();<NEW_LINE>});<NEW_LINE>return popOver;<NEW_LINE>}
setOnMouseEntered(mouseEvent -> keepPopOverVisible = true);
1,731,229
public void run() {<NEW_LINE>ServerAddress coordinatorAddress = null;<NEW_LINE>try {<NEW_LINE>coordinatorAddress = startCoordinatorClientService();<NEW_LINE>} catch (UnknownHostException e1) {<NEW_LINE>throw new RuntimeException("Failed to start the coordinator service", e1);<NEW_LINE>}<NEW_LINE>final HostAndPort clientAddress = coordinatorAddress.address;<NEW_LINE>try {<NEW_LINE>getCoordinatorLock(clientAddress);<NEW_LINE>} catch (KeeperException | InterruptedException e) {<NEW_LINE>throw new IllegalStateException("Exception getting Coordinator lock", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MetricsUtil.initializeMetrics(getContext().getConfiguration(), this.applicationName, clientAddress);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>LOG.error("Error initializing metrics, metrics will not be emitted.", e1);<NEW_LINE>}<NEW_LINE>// On a re-start of the coordinator it's possible that external compactions are in-progress.<NEW_LINE>// Attempt to get the running compactions on the compactors and then resolve which tserver<NEW_LINE>// the external compaction came from to re-populate the RUNNING collection.<NEW_LINE>LOG.info("Checking for running external compactions");<NEW_LINE>// On re-start contact the running Compactors to try and seed the list of running compactions<NEW_LINE>List<RunningCompaction> running = ExternalCompactionUtil.getCompactionsRunningOnCompactors(getContext());<NEW_LINE>if (running.isEmpty()) {<NEW_LINE>LOG.info("No running external compactions found");<NEW_LINE>} else {<NEW_LINE>LOG.info("Found {} running external compactions", running.size());<NEW_LINE>running.forEach(rc -> {<NEW_LINE>TCompactionStatusUpdate update = new TCompactionStatusUpdate();<NEW_LINE><MASK><NEW_LINE>update.setMessage("Coordinator restarted, compaction found in progress");<NEW_LINE>rc.addUpdate(System.currentTimeMillis(), update);<NEW_LINE>RUNNING.put(ExternalCompactionId.of(rc.getJob().getExternalCompactionId()), rc);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>tserverSet.startListeningForTabletServerChanges();<NEW_LINE>startDeadCompactionDetector();<NEW_LINE>LOG.info("Starting loop to check tservers for compaction summaries");<NEW_LINE>while (!shutdown) {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>updateSummaries();<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>TIME_COMPACTOR_LAST_CHECKED.forEach((k, v) -> {<NEW_LINE>if ((now - v) > getMissingCompactorWarningTime()) {<NEW_LINE>LOG.warn("No compactors have checked in with coordinator for queue {} in {}ms", k, getMissingCompactorWarningTime());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>long checkInterval = getTServerCheckInterval();<NEW_LINE>long duration = (System.currentTimeMillis() - start);<NEW_LINE>if (checkInterval - duration > 0) {<NEW_LINE>LOG.debug("Waiting {}ms for next tserver check", (checkInterval - duration));<NEW_LINE>UtilWaitThread.sleep(checkInterval - duration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Shutting down");<NEW_LINE>}
update.setState(TCompactionState.IN_PROGRESS);
1,327,039
void updateHistoryItem(@NonNull WikivoyageSearchHistoryItem item) {<NEW_LINE>String travelBook = item.getTravelBook(context);<NEW_LINE>if (travelBook == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SQLiteConnection conn = openConnection(false);<NEW_LINE>if (conn != null) {<NEW_LINE>try {<NEW_LINE>conn.execSQL("UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_IS_PART_OF + " = ?, " + HISTORY_COL_LAST_ACCESSED + " = ? " + "WHERE " + HISTORY_COL_ARTICLE_TITLE + " = ? " + " AND " + HISTORY_COL_LANG + " = ?" + " AND " + HISTORY_COL_TRAVEL_BOOK + " = ?", new Object[] { item.isPartOf, item.lastAccessed, item.articleTitle<MASK><NEW_LINE>} finally {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, item.lang, travelBook });
1,071,812
SequenceStorage doRight(SequenceStorage left, SequenceStorage right, @Cached ConditionProfile shouldOverflow, @Cached PRaiseNode raiseNode, @Cached LenNode lenNode, @Cached BranchProfile outOfMemProfile) {<NEW_LINE>int destlen = 0;<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>int len2 = lenNode.execute(right);<NEW_LINE>// we eagerly generalize the store to avoid possible cascading generalizations<NEW_LINE>destlen = PythonUtils.addExact(len1, len2);<NEW_LINE>if (errorForOverflow == OverflowError && shouldOverflow.profile(destlen >= SysModuleBuiltins.MAXSIZE)) {<NEW_LINE>// cpython raises an overflow error when this happens<NEW_LINE>throw raiseNode.raise(OverflowError);<NEW_LINE>}<NEW_LINE>SequenceStorage generalized = generalizeStore(createEmpty(left, right, destlen), right);<NEW_LINE>return doConcat(generalized, left, right);<NEW_LINE>} catch (OutOfMemoryError e) {<NEW_LINE>outOfMemProfile.enter();<NEW_LINE>throw raiseNode.raise(MemoryError);<NEW_LINE>} catch (OverflowException e) {<NEW_LINE>outOfMemProfile.enter();<NEW_LINE>throw raiseNode.raise(errorForOverflow);<NEW_LINE>}<NEW_LINE>}
len1 = lenNode.execute(left);
1,168,433
private AWSCredentials fromStaticCredentials() {<NEW_LINE>if (StringUtils.isNullOrEmpty(profile.getAwsAccessIdKey())) {<NEW_LINE>throw new SdkClientException(String.format("Unable to load credentials into profile [%s]: AWS Access Key ID is not specified.", profile.getProfileName()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNullOrEmpty(profile.getAwsSecretAccessKey())) {<NEW_LINE>throw new SdkClientException(String.format("Unable to load credentials into profile [%s]: AWS Secret Access Key is not specified."<MASK><NEW_LINE>}<NEW_LINE>if (profile.getAwsSessionToken() == null) {<NEW_LINE>return new BasicAWSCredentials(profile.getAwsAccessIdKey(), profile.getAwsSecretAccessKey());<NEW_LINE>} else {<NEW_LINE>if (profile.getAwsSessionToken().isEmpty()) {<NEW_LINE>throw new SdkClientException(String.format("Unable to load credentials into profile [%s]: AWS Session Token is empty.", profile.getProfileName()));<NEW_LINE>}<NEW_LINE>return new BasicSessionCredentials(profile.getAwsAccessIdKey(), profile.getAwsSecretAccessKey(), profile.getAwsSessionToken());<NEW_LINE>}<NEW_LINE>}
, profile.getAwsSecretAccessKey()));
1,293,891
private static ParseResults parseMimeType(String mimeType) {<NEW_LINE>String[] parts = mimeType.split(";");<NEW_LINE>ParseResults results = new ParseResults();<NEW_LINE>results.params = new HashMap<>();<NEW_LINE>for (int i = 1; i < parts.length; ++i) {<NEW_LINE>String p = parts[i];<NEW_LINE>String[] subParts = p.split("=");<NEW_LINE>if (subParts.length == 2) {<NEW_LINE>results.params.put(subParts[0].trim(), subParts[1].trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String fullType = parts[0].trim();<NEW_LINE>// Java URLConnection class sends an Accept header that includes a<NEW_LINE>// single "*" - Turn it into a legal wildcard.<NEW_LINE>if (fullType.equals("*")) {<NEW_LINE>fullType = "*/*";<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (slashIndex != -1) {<NEW_LINE>results.type = fullType.substring(0, slashIndex);<NEW_LINE>results.subType = fullType.substring(slashIndex + 1);<NEW_LINE>} else {<NEW_LINE>// If the type is invalid, attempt to turn into a wildcard<NEW_LINE>results.type = fullType;<NEW_LINE>results.subType = "*";<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
slashIndex = fullType.indexOf('/');
722,495
public JWSPolicyData postSignedPolicyRequest(String domainName, SignedPolicyRequest request, String matchingTag, java.util.Map<String, java.util.List<String>> headers) {<NEW_LINE>WebTarget target = base.path("/domain/{domainName}/policy/signed").resolveTemplate("domainName", domainName);<NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>if (matchingTag != null) {<NEW_LINE>invocationBuilder = invocationBuilder.header("If-None-Match", matchingTag);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.post(javax.ws.rs.client.Entity.entity(request, "application/json"));<NEW_LINE><MASK><NEW_LINE>switch(code) {<NEW_LINE>case 200:<NEW_LINE>case 304:<NEW_LINE>if (headers != null) {<NEW_LINE>headers.put("tag", java.util.Arrays.asList((String) response.getHeaders().getFirst("ETag")));<NEW_LINE>}<NEW_LINE>if (code == 304) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return response.readEntity(JWSPolicyData.class);<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>}
int code = response.getStatus();
62,631
public static void testTransformPointsWithErrorCodes() {<NEW_LINE>if (osr.GetPROJVersionMajor() < 8) {<NEW_LINE>System.out.println("Skip testTransformPointsWithErrorCodes() due to PROJ < 8");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SpatialReference s = new SpatialReference("");<NEW_LINE>s.SetFromUserInput("+proj=longlat +ellps=GRS80");<NEW_LINE>SpatialReference t = new SpatialReference("");<NEW_LINE>t.SetFromUserInput("+proj=tmerc +ellps=GRS80");<NEW_LINE>CoordinateTransformation ct = CoordinateTransformation.CreateCoordinateTransformation(s, t);<NEW_LINE>double[][] coords = new double[][] { new double[] { 1, 2 }, new double[] { 1, 2, 3, 4 }, new double[] { 90, 0 } };<NEW_LINE>int[] errorCodes = ct.TransformPointsWithErrorCodes(coords);<NEW_LINE>check(Math.abs(coords[0][0] - 111257.80439304397) < 1e-5);<NEW_LINE>check(Math.abs(coords[0][1] - 221183.3401672801) < 1e-5);<NEW_LINE>check(errorCodes[0] == 0);<NEW_LINE>check(Math.abs(coords[1][0] - 111257.80439304397) < 1e-5);<NEW_LINE>check(Math.abs(coords[1][1] - 221183.3401672801) < 1e-5);<NEW_LINE>check(Math.abs(coords[1][2] - 3) < 1e-5);<NEW_LINE>check(Math.abs(coords[1][3] - 4) < 1e-5);<NEW_LINE>check(errorCodes[1] == 0);<NEW_LINE>check(coords[2][0] == Double.POSITIVE_INFINITY);<NEW_LINE>check(errorCodes<MASK><NEW_LINE>}
[2] == osr.PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN);
787,900
private void addEdgeColoringControls(final DefaultFormBuilder formBuilder) {<NEW_LINE>TranslatedObject[] automaticLayoutTypes = TranslatedObject.fromEnum(AutomaticEdgeColor.class.getSimpleName() + ".", AutomaticEdgeColor.Rule.class);<NEW_LINE>mAutomaticEdgeColorComboBox = JComboBoxFactory.create(automaticLayoutTypes);<NEW_LINE>DefaultComboBoxModel automaticEdgeColorComboBoxModel = <MASK><NEW_LINE>automaticEdgeColorComboBoxModel.addElement(AUTOMATIC_LAYOUT_DISABLED);<NEW_LINE>automaticEdgeColorComboBoxModel.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);<NEW_LINE>mAutomaticEdgeColorComboBox.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>if (internalChange)<NEW_LINE>return;<NEW_LINE>final ModeController modeController = Controller.getCurrentModeController();<NEW_LINE>AutomaticEdgeColorHook hook = modeController.getExtension(AutomaticEdgeColorHook.class);<NEW_LINE>TranslatedObject selectedItem = (TranslatedObject) mAutomaticEdgeColorComboBox.getSelectedItem();<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>final AutomaticEdgeColor oldExtension = (AutomaticEdgeColor) hook.getMapHook(map);<NEW_LINE>final int colorCount = oldExtension == null ? 0 : oldExtension.getColorCounter();<NEW_LINE>final NodeModel rootNode = map.getRootNode();<NEW_LINE>hook.undoableDeactivateHook(rootNode);<NEW_LINE>if (!selectedItem.equals(AUTOMATIC_LAYOUT_DISABLED)) {<NEW_LINE>final AutomaticEdgeColor newExtension = new AutomaticEdgeColor((AutomaticEdgeColor.Rule) selectedItem.getObject(), colorCount);<NEW_LINE>hook.undoableActivateHook(rootNode, newExtension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>appendLabeledComponent(formBuilder, "AutomaticEdgeColorHookAction.text", mAutomaticEdgeColorComboBox);<NEW_LINE>mEditEdgeColorsBtn = TranslatedElementFactory.createButton("editEdgeColors");<NEW_LINE>mEditEdgeColorsBtn.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final MEdgeController edgeController = (MEdgeController) modeController.getExtension(EdgeController.class);<NEW_LINE>edgeController.editEdgeColorConfiguration(Controller.getCurrentController().getMap());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>formBuilder.appendLineGapRow();<NEW_LINE>formBuilder.nextLine();<NEW_LINE>formBuilder.appendRow(FormSpecs.PREF_ROWSPEC);<NEW_LINE>formBuilder.setColumn(1);<NEW_LINE>formBuilder.append(mEditEdgeColorsBtn, formBuilder.getColumnCount());<NEW_LINE>formBuilder.nextLine();<NEW_LINE>}
(DefaultComboBoxModel) mAutomaticEdgeColorComboBox.getModel();
1,415,850
public CostSheetLine createCostSheetLine(String name, String code, int bomLevel, BigDecimal consumptionQty, BigDecimal costPrice, CostSheetGroup costSheetGroup, Product product, int typeSelect, int typeSelectIcon, Unit unit, WorkCenter workCenter, CostSheetLine parentCostSheetLine) {<NEW_LINE>logger.debug("Add a new line of cost sheet ({} - {} - BOM level {} - cost price : {})", code, name, bomLevel, costPrice);<NEW_LINE>CostSheetLine costSheetLine = new CostSheetLine(code, name);<NEW_LINE>costSheetLine.setBomLevel(bomLevel);<NEW_LINE>costSheetLine.setConsumptionQty(consumptionQty.setScale(appBaseService.getNbDecimalDigitForQty(), RoundingMode.HALF_UP));<NEW_LINE>costSheetLine.setCostSheetGroup(costSheetGroup);<NEW_LINE>costSheetLine.setProduct(product);<NEW_LINE>costSheetLine.setTypeSelect(typeSelect);<NEW_LINE>costSheetLine.setTypeSelectIcon(typeSelectIcon);<NEW_LINE>if (unit != null) {<NEW_LINE>costSheetLine.setUnit(unitRepo.find(unit.getId()));<NEW_LINE>}<NEW_LINE>costSheetLine.setWorkCenter(workCenter);<NEW_LINE>if (costPrice == null) {<NEW_LINE>costPrice = BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>costSheetLine.setCostPrice(costPrice.setScale(appProductionService.getNbDecimalDigitForUnitPrice(), BigDecimal.ROUND_HALF_UP));<NEW_LINE>if (parentCostSheetLine != null) {<NEW_LINE>parentCostSheetLine.addCostSheetLineListItem(costSheetLine);<NEW_LINE>this.createIndirectCostSheetGroups(costSheetGroup, <MASK><NEW_LINE>}<NEW_LINE>return costSheetLine;<NEW_LINE>}
parentCostSheetLine, costSheetLine.getCostPrice());
1,294,893
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "g,ge,l,le".split(",");<NEW_LINE>String stmtText = "@name('s0') select " + "intPrimitive > all (select intPrimitive from SupportBean(theString like \"S%\")#keepall) as g, " + "intPrimitive >= all (select intPrimitive from SupportBean(theString like \"S%\")#keepall) as ge, " + "intPrimitive < all (select intPrimitive from SupportBean(theString like \"S%\")#keepall) as l, " + "intPrimitive <= all (select intPrimitive from SupportBean(theString like \"S%\")#keepall) as le " + "from SupportBean(theString like \"E%\")";<NEW_LINE>env.compileDeployAddListenerMileZero(stmtText, "s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { true, true, true, true });<NEW_LINE>env.sendEventBean(new SupportBean("S1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { false, true, false, true });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { true, true, false, false });<NEW_LINE>env.sendEventBean(new SupportBean("S2", 2));<NEW_LINE>env.sendEventBean(new SupportBean("E3", 3));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { true, true, false, false });<NEW_LINE>env.sendEventBean(new SupportBean("E4", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { false, true, false, false });<NEW_LINE>env.sendEventBean(new SupportBean("E5", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { false, false, false, true });<NEW_LINE>env.sendEventBean(new SupportBean("E6", 0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { false, false, true, true });<NEW_LINE>env.undeployAll();<NEW_LINE>env.tryInvalidCompile("select intArr > all (select intPrimitive from SupportBean#keepall) from SupportBeanArrayCollMap", "Failed to validate select-clause expression subquery number 1 querying SupportBean: Collection or array comparison and null-type values are not allowed for the IN, ANY, SOME or ALL keywords [select intArr > all (select intPrimitive from SupportBean#keepall) from SupportBeanArrayCollMap]");<NEW_LINE>// test OM<NEW_LINE>env.eplToModelCompileDeploy<MASK><NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { true, true, true, true });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(stmtText).addListener("s0");
1,347,988
private RubyNumeric powerFixnum(ThreadContext context, RubyFixnum other) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>long a = value;<NEW_LINE>long b = other.value;<NEW_LINE>if (b < 0) {<NEW_LINE>RubyRational rational = <MASK><NEW_LINE>return (RubyNumeric) numFuncall(context, rational, sites(context).op_exp_rational, other);<NEW_LINE>}<NEW_LINE>if (b == 0) {<NEW_LINE>return RubyFixnum.one(runtime);<NEW_LINE>}<NEW_LINE>if (b == 1) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (a == 0) {<NEW_LINE>return b > 0 ? RubyFixnum.zero(runtime) : RubyNumeric.dbl2ival(runtime, 1.0 / 0.0);<NEW_LINE>}<NEW_LINE>if (a == 1) {<NEW_LINE>return RubyFixnum.one(runtime);<NEW_LINE>}<NEW_LINE>if (a == -1) {<NEW_LINE>return b % 2 == 0 ? RubyFixnum.one(runtime) : RubyFixnum.minus_one(runtime);<NEW_LINE>}<NEW_LINE>return Numeric.int_pow(context, a, b);<NEW_LINE>}
RubyRational.newRationalRaw(runtime, this);
1,741,845
public Request<MoveByoipCidrToIpamRequest> marshall(MoveByoipCidrToIpamRequest moveByoipCidrToIpamRequest) {<NEW_LINE>if (moveByoipCidrToIpamRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<MoveByoipCidrToIpamRequest> request = new DefaultRequest<MoveByoipCidrToIpamRequest>(moveByoipCidrToIpamRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (moveByoipCidrToIpamRequest.getCidr() != null) {<NEW_LINE>request.addParameter("Cidr", StringUtils.fromString(moveByoipCidrToIpamRequest.getCidr()));<NEW_LINE>}<NEW_LINE>if (moveByoipCidrToIpamRequest.getIpamPoolId() != null) {<NEW_LINE>request.addParameter("IpamPoolId", StringUtils.fromString(moveByoipCidrToIpamRequest.getIpamPoolId()));<NEW_LINE>}<NEW_LINE>if (moveByoipCidrToIpamRequest.getIpamPoolOwner() != null) {<NEW_LINE>request.addParameter("IpamPoolOwner", StringUtils.fromString(moveByoipCidrToIpamRequest.getIpamPoolOwner()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "MoveByoipCidrToIpam");
559,428
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {<NEW_LINE>super.onCreateOptionsMenu(menu, inflater);<NEW_LINE>MenuItem menuItem;<NEW_LINE>if (!mIsMergeRequired) {<NEW_LINE>// menu to inflate the view where search and select all icon is there.<NEW_LINE>inflater.inflate(R.menu.activity_view_files_actions, menu);<NEW_LINE>MenuItem item = menu.findItem(R.id.action_search);<NEW_LINE>menuItem = menu.findItem(R.id.select_all);<NEW_LINE>mSearchView = (SearchView) item.getActionView();<NEW_LINE>mSearchView.setQueryHint(getString(R.string.search_hint));<NEW_LINE>mSearchView.setSubmitButtonEnabled(true);<NEW_LINE>mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String s) {<NEW_LINE>setDataForQueryChange(s);<NEW_LINE>mSearchView.clearFocus();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String s) {<NEW_LINE>setDataForQueryChange(s);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSearchView.setOnCloseListener(() -> {<NEW_LINE>populatePdfList(null);<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>mSearchView.setIconifiedByDefault(true);<NEW_LINE>} else {<NEW_LINE>inflater.inflate(<MASK><NEW_LINE>MenuItem item = menu.findItem(R.id.item_merge);<NEW_LINE>// Show Merge icon when two or more files was selected<NEW_LINE>item.setVisible(mCountFiles > 1);<NEW_LINE>menuItem = menu.findItem(R.id.select_all);<NEW_LINE>}<NEW_LINE>if (mIsAllFilesSelected) {<NEW_LINE>menuItem.setIcon(R.drawable.ic_check_box_24dp);<NEW_LINE>}<NEW_LINE>}
R.menu.activity_view_files_actions_if_selected, menu);
808,443
// copied from htsjdk.variant.variantcontext.CommonInfo.getAttributeAsList for simplicity<NEW_LINE>// maybe we should expose this as a static method in htsjdk?<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public static List<Object> attributeToList(final Object attribute) {<NEW_LINE>if (attribute == null)<NEW_LINE>return Collections.emptyList();<NEW_LINE>if (attribute instanceof List)<NEW_LINE>return (List<Object>) attribute;<NEW_LINE>if (attribute.getClass().isArray()) {<NEW_LINE>if (attribute instanceof int[]) {<NEW_LINE>return Arrays.stream((int[]) attribute).boxed().collect(Collectors.toList());<NEW_LINE>} else if (attribute instanceof double[]) {<NEW_LINE>return Arrays.stream((double[]) attribute).boxed().collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>return Arrays.asList((Object[]) attribute);<NEW_LINE>}<NEW_LINE>if (attribute instanceof String) {<NEW_LINE>return new ArrayList<>(Arrays.asList((Object[]) ((String) attribute<MASK><NEW_LINE>}<NEW_LINE>return Collections.singletonList(attribute);<NEW_LINE>}
).split(",")));
1,507,040
public Chart apply(@Nonnull final EntityResponse entityResponse) {<NEW_LINE>final Chart result = new Chart();<NEW_LINE>result.setUrn(entityResponse.getUrn().toString());<NEW_LINE>result.setType(EntityType.CHART);<NEW_LINE>EnvelopedAspectMap aspectMap = entityResponse.getAspects();<NEW_LINE>MappingHelper<Chart> mappingHelper = new MappingHelper<>(aspectMap, result);<NEW_LINE>mappingHelper.<MASK><NEW_LINE>mappingHelper.mapToResult(CHART_INFO_ASPECT_NAME, this::mapChartInfo);<NEW_LINE>mappingHelper.mapToResult(CHART_QUERY_ASPECT_NAME, this::mapChartQuery);<NEW_LINE>mappingHelper.mapToResult(EDITABLE_CHART_PROPERTIES_ASPECT_NAME, this::mapEditableChartProperties);<NEW_LINE>mappingHelper.mapToResult(OWNERSHIP_ASPECT_NAME, (chart, dataMap) -> chart.setOwnership(OwnershipMapper.map(new Ownership(dataMap))));<NEW_LINE>mappingHelper.mapToResult(STATUS_ASPECT_NAME, (chart, dataMap) -> chart.setStatus(StatusMapper.map(new Status(dataMap))));<NEW_LINE>mappingHelper.mapToResult(GLOBAL_TAGS_ASPECT_NAME, this::mapGlobalTags);<NEW_LINE>mappingHelper.mapToResult(INSTITUTIONAL_MEMORY_ASPECT_NAME, (chart, dataMap) -> chart.setInstitutionalMemory(InstitutionalMemoryMapper.map(new InstitutionalMemory(dataMap))));<NEW_LINE>mappingHelper.mapToResult(GLOSSARY_TERMS_ASPECT_NAME, (chart, dataMap) -> chart.setGlossaryTerms(GlossaryTermsMapper.map(new GlossaryTerms(dataMap))));<NEW_LINE>mappingHelper.mapToResult(CONTAINER_ASPECT_NAME, this::mapContainers);<NEW_LINE>mappingHelper.mapToResult(DOMAINS_ASPECT_NAME, this::mapDomains);<NEW_LINE>mappingHelper.mapToResult(DEPRECATION_ASPECT_NAME, (chart, dataMap) -> chart.setDeprecation(DeprecationMapper.map(new Deprecation(dataMap))));<NEW_LINE>return mappingHelper.getResult();<NEW_LINE>}
mapToResult(CHART_KEY_ASPECT_NAME, this::mapChartKey);
22,799
public List<HalFormsProperty> createProperties(HalFormsAffordanceModel model) {<NEW_LINE>Assert.notNull(model, "HalFormsModel must not be null!");<NEW_LINE>if (!ENTITY_ALTERING_METHODS.contains(model.getHttpMethod())) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>HalFormsOptionsFactory optionsFactory = configuration.getOptionsFactory();<NEW_LINE>return model.createProperties((payload, metadata) -> {<NEW_LINE><MASK><NEW_LINE>HalFormsOptions options = optionsFactory.getOptions(payload, metadata);<NEW_LINE>HalFormsProperty property = //<NEW_LINE>new HalFormsProperty().withName(metadata.getName()).//<NEW_LINE>withRequired(metadata.isRequired()).withReadOnly(metadata.isReadOnly()).withMin(metadata.getMin()).withMax(metadata.getMax()).withMinLength(metadata.getMinLength()).withMaxLength(//<NEW_LINE>metadata.getMaxLength()).//<NEW_LINE>withRegex(//<NEW_LINE>lookupRegex(metadata)).//<NEW_LINE>withType(//<NEW_LINE>inputType).//<NEW_LINE>withValue(options != null ? options.getSelectedValue() : null).withOptions(options);<NEW_LINE>Function<String, I18nedPropertyMetadata> factory = I18nedPropertyMetadata.factory(payload, property);<NEW_LINE>return Optional.of(property).map(it -> i18n(it, factory.apply("_placeholder"), it::withPlaceholder)).map(it -> i18n(it, factory.apply("_prompt"), it::withPrompt)).map(it -> model.hasHttpMethod(HttpMethod.PATCH) ? it.withRequired(false) : it).orElse(property);<NEW_LINE>});<NEW_LINE>}
String inputType = metadata.getInputType();
1,562,276
protected Control createCustomArea(Composite parent) {<NEW_LINE>loadable = new LoadablePanel<Text>(parent, widgets, panel -> new Text(panel, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT<MASK><NEW_LINE>loadable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>loadable.startLoading();<NEW_LINE>Rpc.listen(text, new UiErrorCallback<String, String, String>(parent, LOG) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected ResultOrError<String, String> onRpcThread(Rpc.Result<String> result) {<NEW_LINE>try {<NEW_LINE>return success(result.get());<NEW_LINE>} catch (RpcException e) {<NEW_LINE>return error(e.getMessage());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>return error(e.getCause().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onUiThreadSuccess(String result) {<NEW_LINE>loadable.getContents().setText(result);<NEW_LINE>loadable.stopLoading();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onUiThreadError(String error) {<NEW_LINE>loadable.showMessage(MessageType.Error, error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return loadable;<NEW_LINE>}
.H_SCROLL | SWT.V_SCROLL));
178,707
public static void statistics(List<Point3D_F64> cloud, Point3D_F64 mean, Point3D_F64 stdev) {<NEW_LINE>final int N = cloud.size();<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>Point3D_F64 p = cloud.get(i);<NEW_LINE>mean.x += p.x / N;<NEW_LINE>mean<MASK><NEW_LINE>mean.z += p.z / N;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>Point3D_F64 p = cloud.get(i);<NEW_LINE>double dx = p.x - mean.x;<NEW_LINE>double dy = p.y - mean.y;<NEW_LINE>double dz = p.z - mean.z;<NEW_LINE>stdev.x += dx * dx / N;<NEW_LINE>stdev.y += dy * dy / N;<NEW_LINE>stdev.z += dz * dz / N;<NEW_LINE>}<NEW_LINE>stdev.x = Math.sqrt(stdev.x);<NEW_LINE>stdev.y = Math.sqrt(stdev.y);<NEW_LINE>stdev.z = Math.sqrt(stdev.z);<NEW_LINE>}
.y += p.y / N;
1,033,094
public static LinkedBuffer writeTagAndRawVarInt32(int tag, int tagSize, int value, final WriteSession session, LinkedBuffer lb) {<NEW_LINE>final int size = computeRawVarint32Size(value);<NEW_LINE>final int totalSize = tagSize + size;<NEW_LINE>if (lb.offset + totalSize > lb.buffer.length) {<NEW_LINE>lb = new LinkedBuffer(session.nextBufferSize, lb);<NEW_LINE>}<NEW_LINE>final byte[] buffer = lb.buffer;<NEW_LINE>int offset = lb.offset;<NEW_LINE>lb.offset += totalSize;<NEW_LINE>session.size += totalSize;<NEW_LINE>if (tagSize == 1) {<NEW_LINE>buffer[offset++] = (byte) tag;<NEW_LINE>} else {<NEW_LINE>for (int i = 0, last = tagSize - 1; i < last; i++, tag >>>= 7) {<NEW_LINE>buffer[offset++] = (byte) ((tag & 0x7F) | 0x80);<NEW_LINE>}<NEW_LINE>buffer[offset++] = (byte) tag;<NEW_LINE>}<NEW_LINE>if (size == 1) {<NEW_LINE>buffer[offset] = (byte) value;<NEW_LINE>} else {<NEW_LINE>for (int i = 0, last = size - 1; i < last; i++, value >>>= 7) {<NEW_LINE>buffer[offset++] = (byte) (<MASK><NEW_LINE>}<NEW_LINE>buffer[offset] = (byte) value;<NEW_LINE>}<NEW_LINE>return lb;<NEW_LINE>}
(value & 0x7F) | 0x80);
725,558
private static String formatDocumentation(String input) {<NEW_LINE>StringBuilder builder = new StringBuilder(input.length());<NEW_LINE>String[] paragraphs = PARAGRAPH.split(input);<NEW_LINE>for (String paragraph : paragraphs) {<NEW_LINE>if (builder.length() != 0) {<NEW_LINE>builder.append("\n\n");<NEW_LINE>}<NEW_LINE>Matcher matcher = WHITESPACE.matcher(paragraph);<NEW_LINE>int lineLen = 8;<NEW_LINE>int lastMatch = 0;<NEW_LINE>while (matcher.find()) {<NEW_LINE>int wordLen = matcher.start() - lastMatch;<NEW_LINE>if (160 < lineLen + wordLen + 1) {<NEW_LINE>builder.append("\n");<NEW_LINE>lineLen = 8;<NEW_LINE>}<NEW_LINE>builder.append(<MASK><NEW_LINE>builder.append(paragraph, lastMatch, matcher.start());<NEW_LINE>lineLen += wordLen + 1;<NEW_LINE>lastMatch = matcher.end();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
lineLen == 8 ? " " : " ");
812,067
private void loadNextValue(LeafReaderContext context, int docID) {<NEW_LINE>NumericDocValues docValues;<NEW_LINE>if (docValuesCache.containsKey(context)) {<NEW_LINE>docValues = docValuesCache.get(context);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>docValues = context.reader().getNumericDocValues(field);<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (docValues != null) {<NEW_LINE>try {<NEW_LINE>int valueDocId = docValues.advance(docID);<NEW_LINE>if (valueDocId != docID) {<NEW_LINE>throw new RuntimeException("Expected doc values and doc scores to iterate together, but score doc id is " + docID + ", and value doc id is " + valueDocId + ".");<NEW_LINE>}<NEW_LINE>currentValue = docValues.longValue();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>currentValue = -1;<NEW_LINE>}<NEW_LINE>}
docValuesCache.put(context, docValues);
1,201,136
public boolean modifyApis(String app, String ip, int port, List<ApiDefinitionEntity> apis) {<NEW_LINE>if (apis == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AssertUtil.notEmpty(app, "Bad app name");<NEW_LINE>AssertUtil.notEmpty(ip, "Bad machine IP");<NEW_LINE>AssertUtil.isTrue(port > 0, "Bad machine port");<NEW_LINE>String data = JSON.toJSONString(apis.stream().map(r -> r.toApiDefinition()).collect(Collectors.toList()));<NEW_LINE>Map<String, String> params = new HashMap<>(2);<NEW_LINE>params.put("data", data);<NEW_LINE>String result = executeCommand(app, ip, port, MODIFY_GATEWAY_API_PATH, <MASK><NEW_LINE>logger.info("Modify gateway apis: {}", result);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Error when modifying gateway apis", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
params, true).get();
876,644
protected void init() {<NEW_LINE>super.init();<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.SECURITY_ROLE_MAPPING), SecurityRoleMappingNode.class);<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_REFERENCE), ResourceRefNode.class);<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.EJB_REFERENCE), EjbRefNode.class);<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_ENV_REFERENCE), ResourceEnvRefNode.class);<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE), MessageDestinationRefNode.class);<NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION), MessageDestinationRuntimeNode.class);<NEW_LINE>registerElementHandler(new XMLElement(WebServicesTagNames<MASK><NEW_LINE>registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY), ResourcePropertyNode.class);<NEW_LINE>}
.SERVICE_REF), ServiceRefNode.class);
337,560
public boolean apply(Game game, Ability source) {<NEW_LINE>Token token = new TombspawnZombieToken();<NEW_LINE>Player activePlayer = game.getPlayer(game.getActivePlayerId());<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (game.getPlayer(source.getControllerId()) != null && activePlayer != null && permanent != null) {<NEW_LINE>Object object = game.getState().getValue(CardUtil.getCardZoneString("_tokensCreated", source.getSourceId(), game));<NEW_LINE>Set<UUID> tokensCreated;<NEW_LINE>if (object != null) {<NEW_LINE>tokensCreated = (Set<UUID>) object;<NEW_LINE>} else {<NEW_LINE>tokensCreated = new HashSet<>();<NEW_LINE>}<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>int creatureCardsInGraveyard = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, source.getSourceId(), source, game);<NEW_LINE>token.putOntoBattlefield(creatureCardsInGraveyard, game, source, playerId);<NEW_LINE>for (UUID tokenId : token.getLastAddedTokenIds()) {<NEW_LINE>tokensCreated.add(tokenId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>game.getState().setValue(CardUtil.getCardZoneString("_tokensCreated", source.getSourceId(), game), tokensCreated);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPermanent(source.getSourceId());
784,218
private void loadNode959() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ExclusiveLimitStateMachineType_HighHighToHigh_TransitionNumber, new QualifiedName(0, "TransitionNumber"), new LocalizedText("en", "TransitionNumber"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHighToHigh_TransitionNumber, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHighToHigh_TransitionNumber, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ExclusiveLimitStateMachineType_HighHighToHigh_TransitionNumber, Identifiers.HasProperty, Identifiers.ExclusiveLimitStateMachineType_HighHighToHigh.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,451,328
public void handle(Context ctx) throws IOException, ServletException {<NEW_LINE>boolean isTraceMode = Cat.getManager().isTraceMode();<NEW_LINE>HttpServletRequest req = ctx.getRequest();<NEW_LINE>HttpServletResponse res = ctx.getResponse();<NEW_LINE>MessageProducer producer = Cat.getProducer();<NEW_LINE>int mode = ctx.getMode();<NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>ctx.setRootId(req.getHeader("X-CAT-ROOT-ID"));<NEW_LINE>ctx.setParentId(req.getHeader("X-CAT-PARENT-ID"));<NEW_LINE>ctx.setId(req.getHeader("X-CAT-ID"));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>ctx.setRootId(producer.createMessageId());<NEW_LINE>ctx.setParentId(ctx.getRootId());<NEW_LINE>ctx.setId(producer.createMessageId());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException(String.format("Internal Error: unsupported mode(%s)!", mode));<NEW_LINE>}<NEW_LINE>if (isTraceMode) {<NEW_LINE>MessageTree tree = Cat.getManager().getThreadLocalMessageTree();<NEW_LINE>tree.setMessageId(ctx.getId());<NEW_LINE>tree.<MASK><NEW_LINE>tree.setRootMessageId(ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-SERVER", getCatServer());<NEW_LINE>switch(mode) {<NEW_LINE>case 0:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>res.setHeader("X-CAT-ROOT-ID", ctx.getRootId());<NEW_LINE>res.setHeader("X-CAT-PARENT-ID", ctx.getParentId());<NEW_LINE>res.setHeader("X-CAT-ID", ctx.getId());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ctx.handle();<NEW_LINE>}
setParentMessageId(ctx.getParentId());
466,779
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String workspaceName = Utils.getValueFromIdByName(id, "workspaces");<NEW_LINE>if (workspaceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));<NEW_LINE>}<NEW_LINE>String sqlPoolName = <MASK><NEW_LINE>if (sqlPoolName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id)));<NEW_LINE>}<NEW_LINE>String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups");<NEW_LINE>if (workloadGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "sqlPools");
442,960
protected void initializePolymorphicQualifiers(@UnderInitialization DefaultQualifierKindHierarchy this) {<NEW_LINE>for (DefaultQualifierKind qualifierKind : qualifierKinds) {<NEW_LINE>Class<? extends Annotation<MASK><NEW_LINE>PolymorphicQualifier polyMetaAnno = clazz.getAnnotation(PolymorphicQualifier.class);<NEW_LINE>if (polyMetaAnno == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>qualifierKind.poly = qualifierKind;<NEW_LINE>String topName = QualifierKindHierarchy.annotationClassName(polyMetaAnno.value());<NEW_LINE>if (nameToQualifierKind.containsKey(topName)) {<NEW_LINE>qualifierKind.top = nameToQualifierKind.get(topName);<NEW_LINE>} else if (topName.equals(Annotation.class.getCanonicalName())) {<NEW_LINE>// Annotation.class is the default value of PolymorphicQualifier. If it is used,<NEW_LINE>// then there must be exactly one top.<NEW_LINE>if (tops.size() == 1) {<NEW_LINE>qualifierKind.top = tops.iterator().next();<NEW_LINE>} else {<NEW_LINE>throw new TypeSystemError("Polymorphic qualifier %s did not specify a top annotation class. Tops: [%s]", qualifierKind, StringsPlume.join(", ", tops));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new TypeSystemError("Polymorphic qualifier %s's top, %s, is not a qualifier.", qualifierKind, topName);<NEW_LINE>}<NEW_LINE>qualifierKind.strictSuperTypes = Collections.singleton(qualifierKind.top);<NEW_LINE>qualifierKind.top.poly = qualifierKind;<NEW_LINE>}<NEW_LINE>}
> clazz = qualifierKind.getAnnotationClass();
700,267
protected void readMapDataBlocks(SearchRequest<BinaryMapDataObject> req, MapTree tree, MapIndex root) throws IOException {<NEW_LINE>List<BinaryMapDataObject> tempResults = null;<NEW_LINE>long baseId = 0;<NEW_LINE>while (true) {<NEW_LINE>if (req.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>if (tempResults != null) {<NEW_LINE>for (BinaryMapDataObject obj : tempResults) {<NEW_LINE>req.publish(obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>case MapDataBlock.BASEID_FIELD_NUMBER:<NEW_LINE>baseId = codedIS.readUInt64();<NEW_LINE>if (READ_STATS) {<NEW_LINE>req.stat.addBlockHeader(MapDataBlock.BASEID_FIELD_NUMBER, 0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MapDataBlock.DATAOBJECTS_FIELD_NUMBER:<NEW_LINE>int length = codedIS.readRawVarint32();<NEW_LINE>int oldLimit = codedIS.pushLimit(length);<NEW_LINE>if (READ_STATS) {<NEW_LINE>req.stat.lastObjectSize += length;<NEW_LINE>req.stat.addBlockHeader(MapDataBlock.DATAOBJECTS_FIELD_NUMBER, length);<NEW_LINE>}<NEW_LINE>BinaryMapDataObject mapObject = readMapDataObject(tree, req, root);<NEW_LINE>if (mapObject != null) {<NEW_LINE>mapObject.setId(mapObject.getId() + baseId);<NEW_LINE>if (READ_STATS) {<NEW_LINE>req.publish(mapObject);<NEW_LINE>}<NEW_LINE>if (tempResults == null) {<NEW_LINE>tempResults = new ArrayList<BinaryMapDataObject>();<NEW_LINE>}<NEW_LINE>tempResults.add(mapObject);<NEW_LINE>}<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>break;<NEW_LINE>case MapDataBlock.STRINGTABLE_FIELD_NUMBER:<NEW_LINE>length = codedIS.readRawVarint32();<NEW_LINE><MASK><NEW_LINE>if (READ_STATS) {<NEW_LINE>req.stat.addBlockHeader(MapDataBlock.STRINGTABLE_FIELD_NUMBER, length);<NEW_LINE>req.stat.lastBlockStringTableSize += length;<NEW_LINE>}<NEW_LINE>if (tempResults != null) {<NEW_LINE>List<String> stringTable = readStringTable();<NEW_LINE>for (int i = 0; i < tempResults.size(); i++) {<NEW_LINE>BinaryMapDataObject rs = tempResults.get(i);<NEW_LINE>if (rs.objectNames != null) {<NEW_LINE>int[] keys = rs.objectNames.keys();<NEW_LINE>for (int j = 0; j < keys.length; j++) {<NEW_LINE>rs.objectNames.put(keys[j], stringTable.get(rs.objectNames.get(keys[j]).charAt(0)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>codedIS.skipRawBytes(codedIS.getBytesUntilLimit());<NEW_LINE>}<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
oldLimit = codedIS.pushLimit(length);
1,499,479
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_account_push_notifications);<NEW_LINE>final Intent intent = getIntent();<NEW_LINE>AccountJid account = getAccount(intent);<NEW_LINE>if (account == null) {<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>accountItem = AccountManager.getInstance().getAccount(account);<NEW_LINE>if (accountItem == null) {<NEW_LINE>Application.getInstance().onError(R.string.NO_SUCH_ACCOUNT);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>toolbar = (Toolbar) findViewById(R.id.toolbar_default);<NEW_LINE>toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);<NEW_LINE>toolbar.setNavigationOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>toolbar.setTitle(R.string.account_push);<NEW_LINE>barPainter <MASK><NEW_LINE>barPainter.updateWithAccountName(account);<NEW_LINE>switchPush = findViewById(R.id.switchPush);<NEW_LINE>rlPushSwitch = findViewById(R.id.rlPushSwitch);<NEW_LINE>tvPushState = findViewById(R.id.tvPushState);<NEW_LINE>rlPushSwitch.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>AccountManager.getInstance().setPushEnabled(accountItem, !switchPush.isChecked());<NEW_LINE>updateSwitchButton();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
= new BarPainter(this, toolbar);
1,819,709
public static void vertical(Kernel1D_S32 kernel, InterleavedS16 src, InterleavedI16 dst, int divisor) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int numBands = src.getNumBands();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final <MASK><NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - (kernelWidth - offset - 1);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(offset, yEnd, y -> {<NEW_LINE>for (int y = offset; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int indexSrcStart = src.startIndex + (y - offset) * src.stride;<NEW_LINE>for (int x = 0; x < imgWidth; x++) {<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>int indexSrc = indexSrcStart + band;<NEW_LINE>int total = 0;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += (dataSrc[indexSrc]) * dataKer[k];<NEW_LINE>indexSrc += src.stride;<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (short) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>indexSrcStart += numBands;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int imgWidth = dst.getWidth();
1,396,270
public void read(org.apache.thrift.protocol.TProtocol iprot, sortkey_count_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // HASH_KEY<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE><MASK><NEW_LINE>struct.hash_key.read(iprot);<NEW_LINE>struct.setHash_keyIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate<NEW_LINE>// method<NEW_LINE>struct.validate();<NEW_LINE>}
struct.hash_key = new blob();
1,572,883
final SetTypeDefaultVersionResult executeSetTypeDefaultVersion(SetTypeDefaultVersionRequest setTypeDefaultVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setTypeDefaultVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetTypeDefaultVersionRequest> request = null;<NEW_LINE>Response<SetTypeDefaultVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetTypeDefaultVersionRequestMarshaller().marshall(super.beforeMarshalling(setTypeDefaultVersionRequest));<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, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetTypeDefaultVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetTypeDefaultVersionResult> responseHandler = new StaxResponseHandler<SetTypeDefaultVersionResult>(new SetTypeDefaultVersionResultStaxUnmarshaller());<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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
283,938
public void run(WorkingCopy copy) throws IOException {<NEW_LINE>copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);<NEW_LINE>Element e = description.getElementHandle().resolve(copy);<NEW_LINE>TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);<NEW_LINE>path = copy.getTreeUtilities().getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);<NEW_LINE>if (path == null) {<NEW_LINE>// NOI18N<NEW_LINE>String message = NbBundle.getMessage(LoggerGenerator.class, "ERR_CannotFindOriginalClass");<NEW_LINE>org.netbeans.editor.Utilities.setStatusBoldText(component, message);<NEW_LINE>} else {<NEW_LINE>ClassTree cls = (ClassTree) path.getLeaf();<NEW_LINE>CodeStyle cs = CodeStyle.getDefault(component.getDocument());<NEW_LINE>Set<Modifier> mods = EnumSet.of(Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL);<NEW_LINE>List<String> names = Utilities.varNamesSuggestions(null, ElementKind.FIELD, mods, "LOG", null, copy.getTypes(), copy.getElements(), e.getEnclosedElements(), cs);<NEW_LINE>// NOI18N<NEW_LINE>VariableTree var = createLoggerField(copy.getTreeMaker(), cls, names.size() > 0 ? names.get<MASK><NEW_LINE>copy.rewrite(cls, GeneratorUtils.insertClassMembers(copy, cls, Collections.singletonList(var), caretOffset));<NEW_LINE>}<NEW_LINE>}
(0) : "LOG", mods);
680,810
public void update(final JRootPane component, final Language language, final String key, final Object... data) {<NEW_LINE>super.update(component, language, key, data);<NEW_LINE>if (language.containsText(key)) {<NEW_LINE>final Window window = CoreSwingUtils.getWindowAncestor(component);<NEW_LINE>if (window instanceof Frame) {<NEW_LINE>((Frame) window).setTitle(language.get(key, data));<NEW_LINE>} else if (window instanceof Dialog) {<NEW_LINE>((Dialog) window).setTitle(language.get(key, data));<NEW_LINE>}<NEW_LINE>// Updating custom window title upon language changes<NEW_LINE>// todo This should be done within WRootPaneUI instead<NEW_LINE>if (component.getUI() instanceof WRootPaneUI) {<NEW_LINE>final JComponent titleComponent = ((WRootPaneUI) component.<MASK><NEW_LINE>if (titleComponent != null) {<NEW_LINE>titleComponent.repaint();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getUI()).getTitleComponent();
559,590
private ResponseSpec testJsonFormDataRequestCreation(String param, String param2) throws WebClientResponseException {<NEW_LINE>Object postBody = null;<NEW_LINE>// verify the required parameter 'param' is set<NEW_LINE>if (param == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// verify the required parameter 'param2' is set<NEW_LINE>if (param2 == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new <MASK><NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>if (param != null)<NEW_LINE>formParams.add("param", param);<NEW_LINE>if (param2 != null)<NEW_LINE>formParams.add("param2", param2);<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/x-www-form-urlencoded" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, Object>();
345,200
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String loadBalancerName, String backendAddressPoolName, 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 (loadBalancerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (backendAddressPoolName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter backendAddressPoolName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, loadBalancerName, backendAddressPoolName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,626,430
protected void subscribeURLs(URL url, NotifyListener listener, Set<String> serviceNames) {<NEW_LINE>serviceNames = toTreeSet(serviceNames);<NEW_LINE>String serviceNamesKey = toStringKeys(serviceNames);<NEW_LINE>String protocolServiceKey = url.getProtocolServiceKey();<NEW_LINE>logger.info(String.format("Trying to subscribe from apps %s for service key %s, ", serviceNamesKey, protocolServiceKey));<NEW_LINE>// register ServiceInstancesChangedListener<NEW_LINE>Lock appSubscriptionLock = getAppSubscription(serviceNamesKey);<NEW_LINE>try {<NEW_LINE>appSubscriptionLock.lock();<NEW_LINE>ServiceInstancesChangedListener <MASK><NEW_LINE>if (serviceInstancesChangedListener == null) {<NEW_LINE>serviceInstancesChangedListener = serviceDiscovery.createListener(serviceNames);<NEW_LINE>serviceInstancesChangedListener.setUrl(url);<NEW_LINE>for (String serviceName : serviceNames) {<NEW_LINE>List<ServiceInstance> serviceInstances = serviceDiscovery.getInstances(serviceName);<NEW_LINE>if (CollectionUtils.isNotEmpty(serviceInstances)) {<NEW_LINE>serviceInstancesChangedListener.onEvent(new ServiceInstancesChangedEvent(serviceName, serviceInstances));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>serviceListeners.put(serviceNamesKey, serviceInstancesChangedListener);<NEW_LINE>}<NEW_LINE>if (!serviceInstancesChangedListener.isDestroyed()) {<NEW_LINE>serviceInstancesChangedListener.setUrl(url);<NEW_LINE>listener.addServiceListener(serviceInstancesChangedListener);<NEW_LINE>serviceInstancesChangedListener.addListenerAndNotify(protocolServiceKey, listener);<NEW_LINE>serviceDiscovery.addServiceInstancesChangedListener(serviceInstancesChangedListener);<NEW_LINE>} else {<NEW_LINE>logger.info(String.format("Listener of %s has been destroyed by another thread.", serviceNamesKey));<NEW_LINE>serviceListeners.remove(serviceNamesKey);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>appSubscriptionLock.unlock();<NEW_LINE>}<NEW_LINE>}
serviceInstancesChangedListener = serviceListeners.get(serviceNamesKey);
834,111
final DescribeClientVpnRoutesResult executeDescribeClientVpnRoutes(DescribeClientVpnRoutesRequest describeClientVpnRoutesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClientVpnRoutesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClientVpnRoutesRequest> request = null;<NEW_LINE>Response<DescribeClientVpnRoutesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeClientVpnRoutesRequestMarshaller().marshall(super.beforeMarshalling(describeClientVpnRoutesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeClientVpnRoutes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeClientVpnRoutesResult> responseHandler = new StaxResponseHandler<DescribeClientVpnRoutesResult>(new DescribeClientVpnRoutesResultStaxUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
538,438
final ListDeliveryStreamsResult executeListDeliveryStreams(ListDeliveryStreamsRequest listDeliveryStreamsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDeliveryStreamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDeliveryStreamsRequest> request = null;<NEW_LINE>Response<ListDeliveryStreamsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDeliveryStreamsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeliveryStreamsRequest));<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, "Firehose");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeliveryStreams");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDeliveryStreamsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeliveryStreamsResultJsonUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,816,637
private void process(EClass eClass, EReference eReferencedFrom) {<NEW_LINE>if (definesNode.has(eClass.getName())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if (eReferencedFrom != null) {<NEW_LINE>// System.out.println(eReferencedFrom.getEContainingClass().getName() + "." + eReferencedFrom.getName() + " -> " + eClass.getName());<NEW_LINE>// }<NEW_LINE>ObjectNode defineNode = OBJECT_MAPPER.createObjectNode();<NEW_LINE>definesNode.set(eClass.getName(), defineNode);<NEW_LINE>// TODO no type node required, subclasses always used<NEW_LINE>ObjectNode typeNode = OBJECT_MAPPER.createObjectNode();<NEW_LINE>typeNode.put("name", eClass.getName());<NEW_LINE>typeNode.put("includeAllSubTypes", true);<NEW_LINE>defineNode.set("type", typeNode);<NEW_LINE>ArrayNode fieldsNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE>defineNode.set("fields", fieldsNode);<NEW_LINE>ArrayNode includesNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE><MASK><NEW_LINE>for (EReference eReference : eClass.getEAllReferences()) {<NEW_LINE>if (!packageMetaData.isInverse(eReference) || isException(eReference)) {<NEW_LINE>EClass eType = (EClass) eReference.getEType();<NEW_LINE>if (eType.getEPackage() == ePackage) {<NEW_LINE>for (EClass eClass2 : packageMetaData.getAllSubClassesIncludingSelf(eType)) {<NEW_LINE>if (eClass2.getEAnnotation("wrapped") == null) {<NEW_LINE>process(eClass2);<NEW_LINE>includesNode.add(eClass2.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldsNode.add(eReference.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
defineNode.set("includes", includesNode);
1,803,195
public boolean applyFilter(String filter) {<NEW_LINE>// ignore if not fetched yet<NEW_LINE>if (prefetchedObjectList_ == null)<NEW_LINE>return false;<NEW_LINE>boolean anyMatched = false;<NEW_LINE>// don't be case sensitive<NEW_LINE>String lowerFilter = filter.toLowerCase();<NEW_LINE>for (int i = 0; i < prefetchedObjectList_.length(); i++) {<NEW_LINE>// retrieve name of object for matching<NEW_LINE>DatabaseObject <MASK><NEW_LINE>String name = object.getName();<NEW_LINE>if (name == null)<NEW_LINE>continue;<NEW_LINE>// don't match by default<NEW_LINE>boolean matches = false;<NEW_LINE>// if we have a provider for this object, apply the filter<NEW_LINE>// recursively; we also match if any child object matches<NEW_LINE>if (objectProviders_.containsKey(object))<NEW_LINE>matches |= objectProviders_.get(object).applyFilter(filter);<NEW_LINE>// we match if our own name matches<NEW_LINE>matches |= name.toLowerCase().contains(lowerFilter);<NEW_LINE>// remember whether we matched; we'll use this later to render a CSS<NEW_LINE>// class to indicate the match<NEW_LINE>object.setMatches(matches);<NEW_LINE>anyMatched |= matches;<NEW_LINE>}<NEW_LINE>// redraw<NEW_LINE>updateData(prefetchedObjectList_);<NEW_LINE>// indicate whether any of the child nodes matched<NEW_LINE>return anyMatched;<NEW_LINE>}
object = prefetchedObjectList_.get(i);
1,169,245
private void registerNavigateReceiver(@NonNull MapActivity mapActivity) {<NEW_LINE>final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);<NEW_LINE>BroadcastReceiver navigateReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>String profileStr = intent.getStringExtra(AIDL_PROFILE);<NEW_LINE>final ApplicationMode profile = ApplicationMode.valueOfStringKey(profileStr, DEFAULT_PROFILE);<NEW_LINE>boolean validProfile = false;<NEW_LINE>for (ApplicationMode mode : VALID_PROFILES) {<NEW_LINE>if (mode == profile) {<NEW_LINE>validProfile = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MapActivity mapActivity = mapActivityRef.get();<NEW_LINE>if (mapActivity != null && validProfile) {<NEW_LINE>String startName = intent.getStringExtra(AIDL_START_NAME);<NEW_LINE>if (Algorithms.isEmpty(startName)) {<NEW_LINE>startName = "";<NEW_LINE>}<NEW_LINE>String destName = intent.getStringExtra(AIDL_DEST_NAME);<NEW_LINE>if (Algorithms.isEmpty(destName)) {<NEW_LINE>destName = "";<NEW_LINE>}<NEW_LINE>final LatLon start;<NEW_LINE>final PointDescription startDesc;<NEW_LINE>double startLat = intent.getDoubleExtra(AIDL_START_LAT, 0);<NEW_LINE>double startLon = intent.getDoubleExtra(AIDL_START_LON, 0);<NEW_LINE>if (startLat != 0 && startLon != 0) {<NEW_LINE>start = new LatLon(startLat, startLon);<NEW_LINE>startDesc = new PointDescription(PointDescription.POINT_TYPE_LOCATION, startName);<NEW_LINE>} else {<NEW_LINE>start = null;<NEW_LINE>startDesc = null;<NEW_LINE>}<NEW_LINE>double destLat = intent.getDoubleExtra(AIDL_DEST_LAT, 0);<NEW_LINE>double destLon = intent.getDoubleExtra(AIDL_DEST_LON, 0);<NEW_LINE>final LatLon dest = new LatLon(destLat, destLon);<NEW_LINE>final PointDescription destDesc = new PointDescription(PointDescription.POINT_TYPE_LOCATION, destName);<NEW_LINE>final RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>boolean force = intent.getBooleanExtra(AIDL_FORCE, true);<NEW_LINE>final boolean locationPermission = intent.getBooleanExtra(AIDL_LOCATION_PERMISSION, false);<NEW_LINE>if (routingHelper.isFollowingMode() && !force) {<NEW_LINE>mapActivity.getMapActions().stopNavigationActionConfirm(dialog -> {<NEW_LINE>MapActivity mapActivity1 = mapActivityRef.get();<NEW_LINE>if (mapActivity1 != null && !routingHelper.isFollowingMode()) {<NEW_LINE>ExternalApiHelper.startNavigation(mapActivity1, start, startDesc, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>ExternalApiHelper.startNavigation(mapActivity, start, startDesc, dest, destDesc, profile, locationPermission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>registerReceiver(navigateReceiver, mapActivity, AIDL_NAVIGATE);<NEW_LINE>}
dest, destDesc, profile, locationPermission);
1,536,259
private <K, V> Eh107Cache<K, V> wrapEhcacheCache(String alias, InternalCache<K, V> cache) {<NEW_LINE>CacheLoaderWriter<? super K, V> cacheLoaderWriter = cache.getCacheLoaderWriter();<NEW_LINE>boolean storeByValueOnHeap = false;<NEW_LINE>for (ServiceConfiguration<?, ?> serviceConfiguration : cache.getRuntimeConfiguration().getServiceConfigurations()) {<NEW_LINE>if (serviceConfiguration instanceof DefaultCopierConfiguration) {<NEW_LINE>DefaultCopierConfiguration<?> copierConfig = (DefaultCopierConfiguration) serviceConfiguration;<NEW_LINE>if (!copierConfig.getClazz().isAssignableFrom(IdentityCopier.class))<NEW_LINE>storeByValueOnHeap = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Eh107Configuration<K, V> config = new Eh107ReverseConfiguration<>(cache, cacheLoaderWriter != null, cacheLoaderWriter != null, storeByValueOnHeap);<NEW_LINE>configurationMerger.setUpManagementAndStats(cache, config);<NEW_LINE>Eh107Expiry<K, V> expiry = new EhcacheExpiryWrapper<>(cache.getRuntimeConfiguration().getExpiryPolicy());<NEW_LINE>CacheResources<K, V> resources = new CacheResources<>(alias, wrapCacheLoaderWriter(cacheLoaderWriter), expiry);<NEW_LINE>return new Eh107Cache<>(alias, config, <MASK><NEW_LINE>}
resources, cache, statisticsService, this);
1,282,729
private void handleAjaxAction(final String loggedInUser, final String proxyUser, final HttpServletRequest request, final HttpServletResponse response, final Session session) throws ServletException, IOException {<NEW_LINE>Map<String, Object> ret = new HashMap<>();<NEW_LINE>FileSystem fs = null;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>fs = getFileSystem(loggedInUser, proxyUser);<NEW_LINE>} catch (final HadoopSecurityManagerException e) {<NEW_LINE>errorAjax(response, ret, "Cannot get FileSystem.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String ajaxName = getParam(request, "ajax");<NEW_LINE>Path path = null;<NEW_LINE>if (!hasParam(request, "path")) {<NEW_LINE>errorAjax(response, ret, "Missing parameter 'path'.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>path = new Path(getParam(request, "path"));<NEW_LINE>if (!fs.exists(path)) {<NEW_LINE>errorAjax(response, ret, path.toUri().getPath() + " does not exist.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ajaxName.equals("fetchschema")) {<NEW_LINE>handleAjaxFetchSchema(fs, request, ret, session, path);<NEW_LINE>} else if (ajaxName.equals("fetchfile")) {<NEW_LINE>// Note: fetchFile writes directly to the output stream. Thus, we need<NEW_LINE>// to make sure we do not write to the output stream once this call<NEW_LINE>// returns.<NEW_LINE>ret = null;<NEW_LINE>handleAjaxFetchFile(fs, request, response, session, path);<NEW_LINE>} else {<NEW_LINE>ret.put("error", "Unknown AJAX action " + ajaxName);<NEW_LINE>}<NEW_LINE>if (ret != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>fs.close();<NEW_LINE>}<NEW_LINE>}
this.writeJSON(response, ret);