idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
622,405
protected void resetDeleteSubscriptionMessage(MESubscription subscription, boolean isLocalBus) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "resetDeleteSubscriptionMessage", new Object[] { subscription<MASK><NEW_LINE>// Reset the state<NEW_LINE>reset();<NEW_LINE>// Indicate that this is a create message<NEW_LINE>iSubscriptionMessage.setSubscriptionMessageType(SubscriptionMessageType.DELETE);<NEW_LINE>// Add the subscription related information.<NEW_LINE>iTopics.add(subscription.getTopic());<NEW_LINE>if (isLocalBus) {<NEW_LINE>// see defect 267686:<NEW_LINE>// local bus subscriptions expect the subscribing ME's<NEW_LINE>// detination uuid to be set in the iTopicSpaces field<NEW_LINE>iTopicSpaces.add(subscription.getTopicSpaceUuid().toString());<NEW_LINE>} else {<NEW_LINE>// see defect 267686:<NEW_LINE>// foreign bus subscriptions need to set the subscribers's topic space name.<NEW_LINE>// This is because the messages sent to this topic over the link<NEW_LINE>// will need to have a routing destination set, which requires<NEW_LINE>// this value.<NEW_LINE>iTopicSpaces.add(subscription.getTopicSpaceName().toString());<NEW_LINE>}<NEW_LINE>iTopicSpaceMappings.add(subscription.getForeignTSName());<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "resetDeleteSubscriptionMessage");<NEW_LINE>}
, new Boolean(isLocalBus) });
354,977
public // with a NEW transaction branch.<NEW_LINE>void start(PersistentTranId ptid, TransactionParticipant participant) throws XidAlreadyKnownException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "start", new Object[] { "PersistentTranId=" + ptid, "Participant=" + participant });<NEW_LINE>// Defect 455354<NEW_LINE>// We need to make sure that any changes to the association<NEW_LINE>// lists occur under a lock.<NEW_LINE>//<NEW_LINE>// We also need to check the _unassociatedTrans and _suspendedTrans lists<NEW_LINE>// to make sure that we aren't being asked to start a new branch using an<NEW_LINE>// Xid that is still running or in the process of being completed.<NEW_LINE>synchronized (_associationLock) {<NEW_LINE>if (!_associatedTrans.containsKey(ptid) && !_unassociatedTrans.containsKey(ptid) && !_suspendedTrans.containsKey(ptid)) {<NEW_LINE>_associatedTrans.put(ptid, participant);<NEW_LINE>} else {<NEW_LINE>XidAlreadyKnownException xake = new XidAlreadyKnownException("XID_ALREADY_ASSOCIATED_SIMS1009", new Object[] { "start(XID,TMNOFLAGS)", ptid.toTMString() });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.event(this, tc, "Cannot start new association with this Xid. It is already known!", xake);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "start");<NEW_LINE>throw xake;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>}
exit(this, tc, "start");
1,650,174
final GetCallAnalyticsJobResult executeGetCallAnalyticsJob(GetCallAnalyticsJobRequest getCallAnalyticsJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCallAnalyticsJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCallAnalyticsJobRequest> request = null;<NEW_LINE>Response<GetCallAnalyticsJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCallAnalyticsJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCallAnalyticsJobRequest));<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, "Transcribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCallAnalyticsJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCallAnalyticsJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCallAnalyticsJobResultJsonUnmarshaller());<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);
479,974
public void multiLevelManufOrderOnLoad(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>Long moId = Long.valueOf(request.getContext().get("id").toString());<NEW_LINE>ManufOrder mo = Beans.get(ManufOrderRepository<MASK><NEW_LINE>boolean showOnlyMissingQty = request.getContext().get("_showOnlyMissingQty") != null && Boolean.parseBoolean(request.getContext().get("_showOnlyMissingQty").toString());<NEW_LINE>ProdProductProductionRepository prodProductProductionRepository = Beans.get(ProdProductProductionRepository.class);<NEW_LINE>List<ProdProduct> prodProducts = mo.getToConsumeProdProductList().stream().filter(prodProduct -> prodProduct.getProduct().getProductSubTypeSelect() == ProductRepository.PRODUCT_SUB_TYPE_FINISHED_PRODUCT || prodProduct.getProduct().getProductSubTypeSelect() == ProductRepository.PRODUCT_SUB_TYPE_SEMI_FINISHED_PRODUCT).filter(prodProduct -> !showOnlyMissingQty || prodProductProductionRepository.computeMissingQty(prodProduct.getProduct().getId(), prodProduct.getQty(), moId).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());<NEW_LINE>response.setValue("$components", prodProducts);<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>}
.class).find(moId);
311,051
public void initialize(OptionValues options, Iterable<DebugHandlersFactory> factories, HotSpotProviders providers, GraalHotSpotVMConfig config, HotSpotAllocationSnippets.Templates allocationSnippetTemplates) {<NEW_LINE>super.initialize(options, runtime, providers);<NEW_LINE>assert target == providers.getCodeCache().getTarget();<NEW_LINE>instanceofSnippets = new InstanceOfSnippets.Templates(options, runtime, providers);<NEW_LINE>allocationSnippets = allocationSnippetTemplates;<NEW_LINE>monitorSnippets = new MonitorSnippets.Templates(options, runtime, providers, config.useFastLocking);<NEW_LINE>g1WriteBarrierSnippets = new HotSpotG1WriteBarrierSnippets.Templates(options, runtime, providers, config);<NEW_LINE>serialWriteBarrierSnippets = new HotSpotSerialWriteBarrierSnippets.Templates(options, runtime, providers);<NEW_LINE>exceptionObjectSnippets = new LoadExceptionObjectSnippets.Templates(options, providers);<NEW_LINE>assertionSnippets = new AssertionSnippets.Templates(options, providers);<NEW_LINE>logSnippets = new LogSnippets.Templates(options, providers);<NEW_LINE>arraycopySnippets = new ArrayCopySnippets.Templates(new HotSpotArraycopySnippets(), runtime, options, providers);<NEW_LINE>stringToBytesSnippets = new StringToBytesSnippets.Templates(options, providers);<NEW_LINE>identityHashCodeSnippets = new IdentityHashCodeSnippets.Templates(new HotSpotHashCodeSnippets(), options, providers, HotSpotReplacementsUtil.MARK_WORD_LOCATION);<NEW_LINE>isArraySnippets = new IsArraySnippets.Templates(new HotSpotIsArraySnippets(), options, providers);<NEW_LINE>objectCloneSnippets = new ObjectCloneSnippets.Templates(options, providers);<NEW_LINE>foreignCallSnippets = new ForeignCallSnippets.Templates(options, providers);<NEW_LINE>registerFinalizerSnippets = new RegisterFinalizerSnippets.Templates(options, providers);<NEW_LINE>objectSnippets = new ObjectSnippets.Templates(options, providers);<NEW_LINE>unsafeSnippets = new UnsafeSnippets.Templates(options, providers);<NEW_LINE>replacements.registerSnippetTemplateCache(new BigIntegerSnippets.Templates(options, providers));<NEW_LINE>replacements.registerSnippetTemplateCache(new DigestBaseSnippets.Templates(options, providers));<NEW_LINE>initializeExtensions(<MASK><NEW_LINE>}
options, factories, providers, config);
1,267,864
private Mono<Response<Flux<ByteBuffer>>> refreshWithResponseAsync(String deviceName, String storageAccountName, String containerName, String resourceGroupName, 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 (deviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (storageAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (containerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.refresh(this.client.getEndpoint(), deviceName, storageAccountName, containerName, this.client.getSubscriptionId(), resourceGroupName, this.client.<MASK><NEW_LINE>}
getApiVersion(), accept, context);
1,022,630
public static XC_MethodHook.Unhook hookMethod(Member hookMethod, XC_MethodHook callback) {<NEW_LINE>if (!(hookMethod instanceof Method) && !(hookMethod instanceof Constructor<?>)) {<NEW_LINE>throw new IllegalArgumentException("Only methods and constructors can be hooked: " + hookMethod.toString());<NEW_LINE>} else if (hookMethod.getDeclaringClass().isInterface()) {<NEW_LINE>throw new IllegalArgumentException("Cannot hook interfaces: " + hookMethod.toString());<NEW_LINE>} else if (Modifier.isAbstract(hookMethod.getModifiers())) {<NEW_LINE>throw new IllegalArgumentException("Cannot hook abstract methods: " + hookMethod.toString());<NEW_LINE>}<NEW_LINE>if (callback == null) {<NEW_LINE>throw new IllegalArgumentException("callback should not be null!");<NEW_LINE>}<NEW_LINE>boolean newMethod = false;<NEW_LINE>CopyOnWriteSortedSet<XC_MethodHook> callbacks;<NEW_LINE>synchronized (sHookedMethodCallbacks) {<NEW_LINE><MASK><NEW_LINE>if (callbacks == null) {<NEW_LINE>callbacks = new CopyOnWriteSortedSet<>();<NEW_LINE>sHookedMethodCallbacks.put(hookMethod, callbacks);<NEW_LINE>newMethod = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>callbacks.add(callback);<NEW_LINE>if (newMethod) {<NEW_LINE>Class<?> declaringClass = hookMethod.getDeclaringClass();<NEW_LINE>int slot;<NEW_LINE>Class<?>[] parameterTypes;<NEW_LINE>Class<?> returnType;<NEW_LINE>if (runtime == RUNTIME_ART) {<NEW_LINE>slot = 0;<NEW_LINE>parameterTypes = null;<NEW_LINE>returnType = null;<NEW_LINE>} else if (hookMethod instanceof Method) {<NEW_LINE>slot = getIntField(hookMethod, "slot");<NEW_LINE>parameterTypes = ((Method) hookMethod).getParameterTypes();<NEW_LINE>returnType = ((Method) hookMethod).getReturnType();<NEW_LINE>} else {<NEW_LINE>slot = getIntField(hookMethod, "slot");<NEW_LINE>parameterTypes = ((Constructor<?>) hookMethod).getParameterTypes();<NEW_LINE>returnType = null;<NEW_LINE>}<NEW_LINE>AdditionalHookInfo additionalInfo = new AdditionalHookInfo(callbacks, parameterTypes, returnType);<NEW_LINE>Member reflectMethod = EdXpConfigGlobal.getHookProvider().findMethodNative(hookMethod);<NEW_LINE>if (reflectMethod != null) {<NEW_LINE>hookMethodNative(reflectMethod, declaringClass, slot, additionalInfo);<NEW_LINE>} else {<NEW_LINE>PendingHooks.recordPendingMethod((Method) hookMethod, additionalInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return callback.new Unhook(hookMethod);<NEW_LINE>}
callbacks = sHookedMethodCallbacks.get(hookMethod);
195,720
public Optional<String> extractToken(Map<String, List<String>> headers) {<NEW_LINE>List<String> tokenHeaders = headers.getOrDefault(tokenHeader, Collections.emptyList());<NEW_LINE>if (tokenHeaders.isEmpty()) {<NEW_LINE>// I only understand configured header, ignore everything else<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (tokenHeaders.size() > 1) {<NEW_LINE>// we can try to find the one that matches (e.g. if Authorization is defined twice, once with basic<NEW_LINE>// and once with bearer<NEW_LINE>SecurityException caught = null;<NEW_LINE>Optional<String> result = Optional.empty();<NEW_LINE>for (String header : tokenHeaders) {<NEW_LINE>try {<NEW_LINE>result = Optional.of(headerExtractor.apply(header));<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>caught = e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.isPresent()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (caught != null) {<NEW_LINE>throw caught;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>String tokenHeader = tokenHeaders.get(0);<NEW_LINE>return Optional.of<MASK><NEW_LINE>}<NEW_LINE>}
(headerExtractor.apply(tokenHeader));
529,426
public static void uploadToGamingServices(String caption, Uri imageUri, Bundle params, GraphRequest.Callback callback) throws FileNotFoundException {<NEW_LINE>AccessToken accessToken = AccessToken.getCurrentAccessToken();<NEW_LINE>if (Utility.isFileUri(imageUri) || Utility.isContentUri(imageUri)) {<NEW_LINE>GraphRequest.newUploadPhotoRequest(accessToken, GamingMediaUploader.photoUploadEdge, imageUri, caption, <MASK><NEW_LINE>} else {<NEW_LINE>Bundle parameters = new Bundle();<NEW_LINE>if (params != null) {<NEW_LINE>parameters.putAll(params);<NEW_LINE>}<NEW_LINE>parameters.putString("url", imageUri.toString());<NEW_LINE>if (caption != null && !caption.isEmpty()) {<NEW_LINE>parameters.putString("caption", caption);<NEW_LINE>}<NEW_LINE>(new GraphRequest(accessToken, GamingMediaUploader.photoUploadEdge, parameters, HttpMethod.POST, callback)).executeAsync();<NEW_LINE>}<NEW_LINE>}
params, callback).executeAsync();
102,159
private void runDemo(ConfigurableApplicationContext context) {<NEW_LINE>KafkaGateway kafkaGateway = context.getBean(KafkaGateway.class);<NEW_LINE>System.out.println("Sending 10 messages...");<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>String message = "foo" + i;<NEW_LINE>System.out.println("Send to Kafka: " + message);<NEW_LINE>kafkaGateway.sendToKafka(message, this.properties.getTopic());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>Message<?> received = kafkaGateway.receiveFromKafka();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>System.out.println("Adding an adapter for a second topic and sending 10 messages...");<NEW_LINE>addAnotherListenerForTopics(this.properties.getNewTopic());<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>String message = "bar" + i;<NEW_LINE>System.out.println("Send to Kafka: " + message);<NEW_LINE>kafkaGateway.sendToKafka(message, this.properties.getNewTopic());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>Message<?> received = kafkaGateway.receiveFromKafka();<NEW_LINE>System.out.println(received);<NEW_LINE>}<NEW_LINE>context.close();<NEW_LINE>}
System.out.println(received);
362,433
public void handleResponse(final Response response) {<NEW_LINE>String method = response.getMethod();<NEW_LINE>if (method == null || !method.startsWith("Console")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ("Console.messageAdded".equals(method)) {<NEW_LINE>JSONObject msg = ((JSONObject) response.getParams().get("message"));<NEW_LINE>final ConsoleMessage cm = new ConsoleMessage(msg);<NEW_LINE>transport.getRequestProcessor().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>notifyConsoleMessage(cm);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if ("Console.messageRepeatCountUpdated".equals(method)) {<NEW_LINE>final int count = ((Number) response.getParams().get<MASK><NEW_LINE>transport.getRequestProcessor().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>notifyConsoleMessageRepeatCountUpdated(count);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if ("Console.messagesCleared".equals(method)) {<NEW_LINE>transport.getRequestProcessor().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>notifyConsoleMessagesCleared();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>LOGGER.warning("Unknown console event: method = " + method);<NEW_LINE>}<NEW_LINE>}
("count")).intValue();
1,258,088
void analyzeCustomizationString(String statement) {<NEW_LINE>String n = getBracketedName();<NEW_LINE>// NOI18N<NEW_LINE>String stBound = n + "." + TEXT_BOUND;<NEW_LINE>// NOI18N<NEW_LINE>String stConstrained = n + "." + TEXT_CONSTRAINED;<NEW_LINE>// NOI18N<NEW_LINE>String stPropertyEditor = n + "." + TEXT_PROPERTY_EDITOR;<NEW_LINE>int peIndex;<NEW_LINE>if (statement.indexOf(stBound) != -1) {<NEW_LINE>setBound(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (statement.indexOf(stConstrained) != -1) {<NEW_LINE>setConstrained(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (peIndex != -1) {<NEW_LINE>String paramString = statement.substring(peIndex + stPropertyEditor.length());<NEW_LINE>String[] params = BiAnalyser.getParameters(paramString);<NEW_LINE>if (params.length > 0)<NEW_LINE>setPropertyEditorClass(params[0]);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
peIndex = statement.indexOf(stPropertyEditor);
1,097,833
public int andCardinality(ArrayContainer x) {<NEW_LINE>if (this.nbrruns == 0) {<NEW_LINE>return x.cardinality;<NEW_LINE>}<NEW_LINE>int rlepos = 0;<NEW_LINE>int arraypos = 0;<NEW_LINE>int andCardinality = 0;<NEW_LINE>int rleval = (this.getValue(rlepos));<NEW_LINE>int rlelength = (this.getLength(rlepos));<NEW_LINE>while (arraypos < x.cardinality) {<NEW_LINE>int arrayval = (x.content[arraypos]);<NEW_LINE>while (rleval + rlelength < arrayval) {<NEW_LINE>// this will frequently be false<NEW_LINE>++rlepos;<NEW_LINE>if (rlepos == this.nbrruns) {<NEW_LINE>// we are done<NEW_LINE>return andCardinality;<NEW_LINE>}<NEW_LINE>rleval = <MASK><NEW_LINE>rlelength = (this.getLength(rlepos));<NEW_LINE>}<NEW_LINE>if (rleval > arrayval) {<NEW_LINE>arraypos = Util.advanceUntil(x.content, arraypos, x.cardinality, this.getValue(rlepos));<NEW_LINE>} else {<NEW_LINE>andCardinality++;<NEW_LINE>arraypos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return andCardinality;<NEW_LINE>}
(this.getValue(rlepos));
1,554,308
public okhttp3.Call commitCall(String repository, String branch, CommitCreation commitCreation, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = commitCreation;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/branches/{branch}/commits".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())).replaceAll("\\{" + "branch" + "\\}", localVarApiClient.escapeString(branch.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
String[] localVarAccepts = { "application/json" };
839,214
private Inspector maybeConvertWset(Inspector data) {<NEW_LINE>var <MASK><NEW_LINE>for (int i = 0; i < data.entryCount(); i++) {<NEW_LINE>Inspector obj = data.entry(i);<NEW_LINE>if (obj.type() != Type.OBJECT || obj.fieldCount() != 2) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Inspector item = obj.field("item");<NEW_LINE>Inspector weight = obj.field("weight");<NEW_LINE>if (!item.valid())<NEW_LINE>return null;<NEW_LINE>if (!weight.valid())<NEW_LINE>return null;<NEW_LINE>// TODO support non-integer weights?<NEW_LINE>if (weight.type() != Type.LONG)<NEW_LINE>return null;<NEW_LINE>if (item.type() == Type.STRING) {<NEW_LINE>wset.put(item.asString(), weight.asLong());<NEW_LINE>} else if (settings.jsonWsetsAll) {<NEW_LINE>wset.put(item.toString(), weight.asLong());<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return wset;<NEW_LINE>}
wset = new Value.ObjectValue();
638,219
public void printLocalMean(AutoTypeImage imageIn) {<NEW_LINE>String imageName = imageIn.getSingleBandName();<NEW_LINE><MASK><NEW_LINE>String workType = ("DogArray_" + imageIn.getKernelType()).replace("S32", "I32");<NEW_LINE>out.print("\tpublic static GrayU8 localMean( " + imageName + " input , GrayU8 output ,\n" + "\t\t\t\t\t\t\t\t\t\t\t ConfigLength width , float scale , boolean down ,\n" + "\t\t\t\t\t\t\t\t\t\t\t " + imageName + " storage1 , " + imageName + " storage2 ,\n" + "\t\t\t\t\t\t\t\t\t\t\t @Nullable GrowArray<" + workType + "> storage3 ) {\n" + "\n" + "\t\tint radius = width.computeI(Math.min(input.width,input.height))/2;\n" + "\n" + "\t\t" + imageName + " mean = storage1;\n" + "\n" + "\t\tBlurImageOps.mean(input,mean,radius,storage2,storage3);\n" + "\n" + "\t\tif( down ) {\n" + "\t\t\t//CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {\n" + "\t\t\tfor( int y = 0; y < input.height; y++ ) {\n" + "\t\t\t\tint indexIn = input.startIndex + y*input.stride;\n" + "\t\t\t\tint indexOut = output.startIndex + y*output.stride;\n" + "\t\t\t\tint indexMean = mean.startIndex + y*mean.stride;\n" + "\n" + "\t\t\t\tint end = indexIn + input.width;\n" + "\n" + "\t\t\t\twhile(indexIn < end) {\n" + "\t\t\t\t\tfloat threshold = (mean.data[indexMean++]" + bitwise + ") * scale;\n" + "\t\t\t\t\toutput.data[indexOut++] = (input.data[indexIn++]" + bitwise + ") <= threshold ? (byte)1:0;\n" + "\t\t\t\t}\n" + "\t\t\t}\n" + "\t\t\t//CONCURRENT_ABOVE });\n" + "\t\t} else {\n" + "\t\t\t//CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {\n" + "\t\t\tfor( int y = 0; y < input.height; y++ ) {\n" + "\t\t\t\tint indexIn = input.startIndex + y*input.stride;\n" + "\t\t\t\tint indexOut = output.startIndex + y*output.stride;\n" + "\t\t\t\tint indexMean = mean.startIndex + y*mean.stride;\n" + "\n" + "\t\t\t\tint end = indexIn + input.width;\n" + "\n" + "\t\t\t\twhile(indexIn < end) {\n" + "\t\t\t\t\tfloat threshold = (mean.data[indexMean++]" + bitwise + ");\n" + "\t\t\t\t\toutput.data[indexOut++] = (input.data[indexIn++]" + bitwise + ")*scale > threshold ? (byte)1:0;\n" + "\t\t\t\t}\n" + "\t\t\t}\n" + "\t\t\t//CONCURRENT_ABOVE });\n" + "\t\t}\n" + "\n" + "\t\treturn output;\n" + "\t}\n\n");<NEW_LINE>}
String bitwise = imageIn.getBitWise();
1,609,926
@ApiOperation(value = "Create of update a Property", response = Response.class)<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiResponses({ @ApiResponse(code = 201, message = "Property has been created"), @ApiResponse(code = 204, message = "No content, feature is updated") })<NEW_LINE>public Response upsertProperty(@Context HttpHeaders headers, @PathParam("name") String name, PropertyApiBean pApiBean) {<NEW_LINE>// Parameter validations<NEW_LINE>if ("".equals(name) || !name.equals(pApiBean.getName())) {<NEW_LINE>String errMsg = "Invalid identifier expected " + name;<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).entity(errMsg).build();<NEW_LINE>}<NEW_LINE>Property<?> property = pApiBean.asProperty();<NEW_LINE>// Update or create ?<NEW_LINE>if (!getPropertyStore().existProperty(property.getName())) {<NEW_LINE>getPropertyStore().createProperty(property);<NEW_LINE>String location = String.format("%s", uriInfo.getAbsolutePath().toString());<NEW_LINE>try {<NEW_LINE>return Response.created(new URI(location)).build();<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>return Response.status(Response.Status.CREATED).header(LOCATION, location).entity(name).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Create<NEW_LINE><MASK><NEW_LINE>return Response.noContent().build();<NEW_LINE>}
getPropertyStore().updateProperty(property);
263,264
public com.amazonaws.services.signer.model.BadRequestException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.signer.model.BadRequestException badRequestException = new com.amazonaws.services.signer.model.BadRequestException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>badRequestException.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return badRequestException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,682,949
final GetStudioComponentResult executeGetStudioComponent(GetStudioComponentRequest getStudioComponentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStudioComponentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetStudioComponentRequest> request = null;<NEW_LINE>Response<GetStudioComponentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetStudioComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getStudioComponentRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStudioComponent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetStudioComponentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetStudioComponentResultJsonUnmarshaller());<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.SERVICE_ID, "nimble");
610,583
public static ParaRPr apply(ParaRPr source, ParaRPr destination) {<NEW_LINE>if (!isEmpty(source)) {<NEW_LINE>if (destination == null)<NEW_LINE>destination = Context.getWmlObjectFactory().createParaRPr();<NEW_LINE>destination.setRStyle(apply(source.getRStyle(), destination.getRStyle()));<NEW_LINE>destination.setRFonts(apply(source.getRFonts(), destination.getRFonts()));<NEW_LINE>destination.setB(apply(source.getB(), destination.getB()));<NEW_LINE>destination.setBCs(apply(source.getBCs(), destination.getBCs()));<NEW_LINE>destination.setI(apply(source.getI(), destination.getI()));<NEW_LINE>destination.setICs(apply(source.getICs(), destination.getICs()));<NEW_LINE>destination.setCaps(apply(source.getCaps(), destination.getCaps()));<NEW_LINE>destination.setSmallCaps(apply(source.getSmallCaps(), destination.getSmallCaps()));<NEW_LINE>destination.setStrike(apply(source.getStrike(), destination.getStrike()));<NEW_LINE>destination.setDstrike(apply(source.getDstrike(), destination.getDstrike()));<NEW_LINE>destination.setOutline(apply(source.getOutline(), destination.getOutline()));<NEW_LINE>destination.setShadow(apply(source.getShadow(), destination.getShadow()));<NEW_LINE>destination.setEmboss(apply(source.getEmboss(), destination.getEmboss()));<NEW_LINE>destination.setImprint(apply(source.getImprint(), destination.getImprint()));<NEW_LINE>destination.setSnapToGrid(apply(source.getSnapToGrid(), destination.getSnapToGrid()));<NEW_LINE>destination.setVanish(apply(source.getVanish(), destination.getVanish()));<NEW_LINE>destination.setColor(apply(source.getColor(), destination.getColor()));<NEW_LINE>destination.setSpacing(apply(source.getSpacing(), destination.getSpacing()));<NEW_LINE>destination.setW(apply(source.getW(), destination.getW()));<NEW_LINE>destination.setKern(apply(source.getKern(), destination.getKern()));<NEW_LINE>destination.setPosition(apply(source.getPosition(), destination.getPosition()));<NEW_LINE>destination.setSz(apply(source.getSz(), destination.getSz()));<NEW_LINE>destination.setSzCs(apply(source.getSzCs(), destination.getSzCs()));<NEW_LINE>destination.setHighlight(apply(source.getHighlight(), destination.getHighlight()));<NEW_LINE>destination.setU(apply(source.getU(), destination.getU()));<NEW_LINE>destination.setEffect(apply(source.getEffect(), destination.getEffect()));<NEW_LINE>destination.setBdr(apply(source.getBdr(), destination.getBdr()));<NEW_LINE>destination.setShd(apply(source.getShd(), destination.getShd()));<NEW_LINE>destination.setVertAlign(apply(source.getVertAlign(), destination.getVertAlign()));<NEW_LINE>destination.setRtl(apply(source.getRtl(), destination.getRtl()));<NEW_LINE>destination.setCs(apply(source.getCs(), destination.getCs()));<NEW_LINE>destination.setEm(apply(source.getEm(), destination.getEm()));<NEW_LINE>destination.setSpecVanish(apply(source.getSpecVanish(), destination.getSpecVanish()));<NEW_LINE>destination.setOMath(apply(source.getOMath()<MASK><NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
, destination.getOMath()));
523,704
private void testGetAllTimersProgrammaticTransactionalCreate(String beanName, String info) throws Exception {<NEW_LINE>TimerTestBean bean = lookupBean(TimerTestBean.class, EJB_MODULE, beanName);<NEW_LINE>TimerTestBean otherbean = lookupBean(TimerTestBean.class, OTHER_EJB_MODULE, beanName);<NEW_LINE>TimerTestBean warbean = lookupBean(TimerTestBean.class, WAR_MODULE, beanName);<NEW_LINE>int expectedAutomatic = bean.getAllExpectedAutomaticTimerCount();<NEW_LINE>int otherExpectedAutomatic = otherbean.getAllExpectedAutomaticTimerCount();<NEW_LINE>int warExpectedAutomatic = warbean.getAllExpectedAutomaticTimerCount();<NEW_LINE>logger.info(" --> creating timers under new UserTransaction for beans : " + beanName);<NEW_LINE>userTran.begin();<NEW_LINE>bean.<MASK><NEW_LINE>otherbean.createTimers(4, info + "-rollback");<NEW_LINE>warbean.createTimers(3, info + "-rollback");<NEW_LINE>bean.verifyGetAllTimers(expectedAutomatic + 5);<NEW_LINE>otherbean.verifyGetAllTimers(otherExpectedAutomatic + 4);<NEW_LINE>warbean.verifyGetAllTimers(warExpectedAutomatic + 3);<NEW_LINE>logger.info(" --> Rolling back UserTransaction : " + beanName);<NEW_LINE>userTran.rollback();<NEW_LINE>bean.verifyGetAllTimers(expectedAutomatic);<NEW_LINE>otherbean.verifyGetAllTimers(otherExpectedAutomatic);<NEW_LINE>warbean.verifyGetAllTimers(warExpectedAutomatic);<NEW_LINE>logger.info(" --> creating timers under new UserTransaction for beans : " + beanName);<NEW_LINE>userTran.begin();<NEW_LINE>bean.createTimers(5, info + "-commit");<NEW_LINE>otherbean.createTimers(4, info + "-commit");<NEW_LINE>warbean.createTimers(3, info + "-commit");<NEW_LINE>bean.verifyGetAllTimers(expectedAutomatic + 5);<NEW_LINE>otherbean.verifyGetAllTimers(otherExpectedAutomatic + 4);<NEW_LINE>warbean.verifyGetAllTimers(warExpectedAutomatic + 3);<NEW_LINE>logger.info(" --> Committing UserTransaction : " + beanName);<NEW_LINE>userTran.commit();<NEW_LINE>bean.verifyGetAllTimers(expectedAutomatic + 5);<NEW_LINE>otherbean.verifyGetAllTimers(otherExpectedAutomatic + 4);<NEW_LINE>warbean.verifyGetAllTimers(warExpectedAutomatic + 3);<NEW_LINE>}
createTimers(5, info + "-rollback");
623,468
public void onTabClose(TabCloseEvent event) {<NEW_LINE>// can't proceed if there is no active editor or display<NEW_LINE>if (activeEditor_ == null)<NEW_LINE>return;<NEW_LINE>if (event.getTabIndex() >= editors_.size())<NEW_LINE>// Seems like this should never happen...?<NEW_LINE>return;<NEW_LINE>final <MASK><NEW_LINE>if (editors_.get(event.getTabIndex()).getId() == activeEditorId) {<NEW_LINE>// scan the source navigation history for an entry that can<NEW_LINE>// be used as the next active tab (anything that doesn't have<NEW_LINE>// the same document id as the currently active tab)<NEW_LINE>SourceNavigation srcNav = manager_.getSourceNavigationHistory().scanBack(navigation -> navigation.getDocumentId() != activeEditorId);<NEW_LINE>// see if the source navigation we found corresponds to an active<NEW_LINE>// tab -- if it does then set this on the event<NEW_LINE>if (srcNav != null) {<NEW_LINE>for (int i = 0; i < editors_.size(); i++) {<NEW_LINE>if (srcNav.getDocumentId() == editors_.get(i).getId()) {<NEW_LINE>display_.selectTab(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String activeEditorId = activeEditor_.getId();
1,270,619
public Pair<Double, SGDVector> lossAndGradient(SGDVector truth, SGDVector prediction) {<NEW_LINE>DenseVector labels, densePred;<NEW_LINE>if (truth instanceof SparseVector) {<NEW_LINE>labels = ((SparseVector) truth).densify();<NEW_LINE>} else {<NEW_LINE>labels = (DenseVector) truth;<NEW_LINE>}<NEW_LINE>if (prediction instanceof SparseVector) {<NEW_LINE>densePred = ((SparseVector) prediction).densify();<NEW_LINE>} else {<NEW_LINE>densePred = (DenseVector) prediction;<NEW_LINE>}<NEW_LINE>double loss = 0.0;<NEW_LINE>for (int i = 0; i < prediction.size(); i++) {<NEW_LINE>double label = labels.get(i);<NEW_LINE>double pred = densePred.get(i);<NEW_LINE>double yhat = SigmoidNormalizer.sigmoid(pred);<NEW_LINE>// numerically stable form of loss computation<NEW_LINE>loss += Math.max(pred, 0) - (pred * label) + Math.log1p(Math.exp(-Math.abs(pred)));<NEW_LINE>densePred.set(i<MASK><NEW_LINE>}<NEW_LINE>return new Pair<>(loss, densePred);<NEW_LINE>}
, -(yhat - label));
1,751,389
private void addToChain(InterceptorChain chain, Message m) {<NEW_LINE>Collection<InterceptorProvider> providers = CastUtils.cast((Collection<?>) m.get(Message.INTERCEPTOR_PROVIDERS));<NEW_LINE>if (providers != null) {<NEW_LINE>for (InterceptorProvider p : providers) {<NEW_LINE>chain.add(p.getInInterceptors());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<Interceptor<? extends Message>> is = CastUtils.cast((Collection<?>) m.get(Message.IN_INTERCEPTORS));<NEW_LINE>if (is != null) {<NEW_LINE>// this helps to detect if need add CertConstraintsInterceptor to chain<NEW_LINE>String rqURL = (String) m.get(Message.REQUEST_URL);<NEW_LINE>boolean isHttps = (rqURL != null && rqURL.indexOf("https:") > -1) ? true : false;<NEW_LINE>for (Interceptor<? extends Message> i : is) {<NEW_LINE>if (i instanceof CertConstraintsInterceptor && isHttps == false) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>chain.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m.getDestination() instanceof InterceptorProvider) {<NEW_LINE>chain.add(((InterceptorProvider) m.getDestination<MASK><NEW_LINE>}<NEW_LINE>}
()).getInInterceptors());
800,038
public GetFunctionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetFunctionResult getFunctionResult = new GetFunctionResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getFunctionResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("functionConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFunctionResult.setFunctionConfiguration(FunctionConfigurationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getFunctionResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,544,451
public void mousePressed(MouseEvent e) {<NEW_LINE>e.consume();<NEW_LINE>AbstractButton b = (AbstractButton) e.getComponent();<NEW_LINE>MultiViewModel model = TabsComponent.this.model;<NEW_LINE>if (model != null) {<NEW_LINE>if (TabsComponent.this.splitPane != null) {<NEW_LINE>ButtonModel buttonModel = b.getModel();<NEW_LINE>if (buttonModel instanceof TabsButtonModel) {<NEW_LINE>MultiViewDescription buttonsDescription = ((TabsButtonModel) buttonModel).getButtonsDescription();<NEW_LINE>TabsComponent.this.hiddenTriggeredByMultiViewButton = true;<NEW_LINE>if (((ContextAwareDescription) buttonsDescription).isSplitDescription()) {<NEW_LINE>model.getButtonGroupSplit().setSelected(b.getModel(), true);<NEW_LINE>TabsComponent.this.isTopLeft = false;<NEW_LINE>TabsComponent.this.topBottomDescriptions[1] = buttonsDescription;<NEW_LINE>} else {<NEW_LINE>model.getButtonGroup().setSelected(b.getModel(), true);<NEW_LINE>TabsComponent.this.isTopLeft = true;<NEW_LINE>TabsComponent.this.topBottomDescriptions[0] = buttonsDescription;<NEW_LINE>}<NEW_LINE>model.fireActivateCurrent();<NEW_LINE>TabsComponent.this.hiddenTriggeredByMultiViewButton = false;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>model.getButtonGroup().setSelected(<MASK><NEW_LINE>model.fireActivateCurrent();<NEW_LINE>}<NEW_LINE>}
b.getModel(), true);
713,284
private Item buildNearestNeighbor(String key, Inspector value) {<NEW_LINE>HashMap<Integer, Inspector> children = childMap(value);<NEW_LINE>Preconditions.checkArgument(children.size() == 2, "Expected 2 arguments, got %s.", children.size());<NEW_LINE>String field = children.get(0).asString();<NEW_LINE>String property = children.get(1).asString();<NEW_LINE>NearestNeighborItem item = new NearestNeighborItem(field, property);<NEW_LINE>Inspector annotations = getAnnotations(value);<NEW_LINE>if (annotations != null) {<NEW_LINE>annotations.traverse((ObjectTraverser) (annotation_name, annotation_value) -> {<NEW_LINE>if (TARGET_HITS.equals(annotation_name)) {<NEW_LINE>item.setTargetNumHits((int) (annotation_value.asDouble()));<NEW_LINE>}<NEW_LINE>if (TARGET_NUM_HITS.equals(annotation_name)) {<NEW_LINE>item.setTargetNumHits((int) <MASK><NEW_LINE>}<NEW_LINE>if (DISTANCE_THRESHOLD.equals(annotation_name)) {<NEW_LINE>double distanceThreshold = annotation_value.asDouble();<NEW_LINE>item.setDistanceThreshold(distanceThreshold);<NEW_LINE>}<NEW_LINE>if (HNSW_EXPLORE_ADDITIONAL_HITS.equals(annotation_name)) {<NEW_LINE>int hnswExploreAdditionalHits = (int) (annotation_value.asDouble());<NEW_LINE>item.setHnswExploreAdditionalHits(hnswExploreAdditionalHits);<NEW_LINE>}<NEW_LINE>if (APPROXIMATE.equals(annotation_name)) {<NEW_LINE>boolean allowApproximate = annotation_value.asBool();<NEW_LINE>item.setAllowApproximate(allowApproximate);<NEW_LINE>}<NEW_LINE>if (LABEL.equals(annotation_name)) {<NEW_LINE>item.setLabel(annotation_value.asString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return item;<NEW_LINE>}
(annotation_value.asDouble()));
1,302,612
protected void blurObjectIntoView(Graphics2D gView, BufferedImage frame, Nozzle nozzle, Location l) {<NEW_LINE>// Blur according to Z coordinate<NEW_LINE>AffineTransform tx = gView.getTransform();<NEW_LINE>gView.setTransform(new AffineTransform());<NEW_LINE>double distanceMm = Math.abs(l.subtract(getSimulatedLocation()).convertToUnits(LengthUnit.Millimeters).getZ());<NEW_LINE>final double bokeh = 0.01 / getSimulatedUnitsPerPixel().convertToUnits(LengthUnit.Millimeters).getX();<NEW_LINE>// Be reasonable.<NEW_LINE>double radius = Math.min(distanceMm * bokeh, 5);<NEW_LINE>ConvolveOp op = null;<NEW_LINE>if (radius > 0.01) {<NEW_LINE>int size = (int) Math.ceil(radius) * 2 + 1;<NEW_LINE>float[] data = new float[size * size];<NEW_LINE>double sum = 0;<NEW_LINE>int num = 0;<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>double x = i / size - size / 2.0 + 0.5;<NEW_LINE>double y = i <MASK><NEW_LINE>double r = Math.sqrt(x * x + y * y);<NEW_LINE>// rough approximation<NEW_LINE>float weight = (float) Math.max(0, Math.min(1, radius + 1 - r));<NEW_LINE>data[i] = weight;<NEW_LINE>sum += weight;<NEW_LINE>if (weight > 0) {<NEW_LINE>num++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (num > 1) {<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>data[i] /= sum;<NEW_LINE>}<NEW_LINE>Kernel kernel = new Kernel(size, size, data);<NEW_LINE>op = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gView.drawImage(frame, op, 0, 0);<NEW_LINE>gView.setTransform(tx);<NEW_LINE>}
% size - size / 2.0 + 0.5;
1,321,288
public Description match(ExpressionTree tree, VisitorState state) {<NEW_LINE>MatchResult result = ContainmentMatchers.firstNonNullMatchResult(tree, state);<NEW_LINE>if (result == null) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Types types = state.getTypes();<NEW_LINE>TypeCompatibilityReport compatibilityReport = typeCompatibilityUtils.compatibilityOfTypes(result.targetType(), result.sourceType(), state);<NEW_LINE>if (compatibilityReport.isCompatible()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>String sourceType = Signatures.prettyType(result.sourceType());<NEW_LINE>String targetType = Signatures.prettyType(result.targetType());<NEW_LINE>if (sourceType.equals(targetType)) {<NEW_LINE>sourceType = result<MASK><NEW_LINE>targetType = result.targetType().toString();<NEW_LINE>}<NEW_LINE>Description.Builder description = buildDescription(tree).setMessage(result.message(sourceType, targetType) + compatibilityReport.extraReason());<NEW_LINE>switch(fixType) {<NEW_LINE>case PRINT_TYPES_AS_COMMENT:<NEW_LINE>description.addFix(SuggestedFix.prefixWith(tree, String.format("/* expected: %s, actual: %s */", ASTHelpers.getUpperBound(result.targetType(), types), result.sourceType())));<NEW_LINE>break;<NEW_LINE>case CAST:<NEW_LINE>result.buildFix().ifPresent(description::addFix);<NEW_LINE>break;<NEW_LINE>case SUPPRESS_WARNINGS:<NEW_LINE>SuggestedFix.Builder builder = SuggestedFix.builder();<NEW_LINE>builder.prefixWith(result.sourceTree(), String.format("/* expected: %s, actual: %s */ ", targetType, sourceType));<NEW_LINE>addSuppressWarnings(builder, state, "CollectionIncompatibleType");<NEW_LINE>description.addFix(builder.build());<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return description.build();<NEW_LINE>}
.sourceType().toString();
409,990
public void process(T input) {<NEW_LINE>super.initialize(<MASK><NEW_LINE>if (isSaveOriginalReference())<NEW_LINE>throw new IllegalArgumentException("The original reference cannot be saved");<NEW_LINE>if (tempImage == null) {<NEW_LINE>tempImage = (T) input.createNew(input.width, input.height);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < scale.length; i++) {<NEW_LINE>T prev = i == 0 ? input : getLayer(i - 1);<NEW_LINE>T layer = getLayer(i);<NEW_LINE>// Apply the requested blur to the previous layer<NEW_LINE>BlurStorageFilter<T> blur = (BlurStorageFilter<T>) FactoryBlurFilter.gaussian(layer.getImageType(), sigmaLayers[i], -1);<NEW_LINE>tempImage.reshape(prev.width, prev.height);<NEW_LINE>blur.process(prev, tempImage);<NEW_LINE>// Resample the blurred image<NEW_LINE>if (scale[i] == 1) {<NEW_LINE>layer.setTo(tempImage);<NEW_LINE>} else {<NEW_LINE>PixelTransformAffine_F32 model = DistortSupport.transformScale(layer, tempImage, null);<NEW_LINE>new FDistort(tempImage, layer).transform(model).interp(interpolate).apply();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
input.width, input.height);
769,882
protected final void writeChunk(ObjectDataOutput out, MapChunkContext context) throws IOException {<NEW_LINE>SerializationService ss = context.getSerializationService();<NEW_LINE>long recordCount = 0;<NEW_LINE>out.writeString(context.getMapName());<NEW_LINE>Iterator<Map.Entry<Data, Record>> entries = context.getIterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Map.Entry<Data, Record> entry = entries.next();<NEW_LINE>Data dataKey = entry.getKey();<NEW_LINE>Record record = entry.getValue();<NEW_LINE>Data dataValue = ss.toData(record.getValue());<NEW_LINE>IOUtil.writeData(out, dataKey);<NEW_LINE>Records.writeRecord(out, record, dataValue);<NEW_LINE>Records.writeExpiry(out<MASK><NEW_LINE>recordCount++;<NEW_LINE>if (isEndOfChunk.getAsBoolean()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>incrementReplicationRecordCount(recordCount);<NEW_LINE>if (!entries.hasNext()) {<NEW_LINE>incrementReplicationCount();<NEW_LINE>}<NEW_LINE>// indicates end of chunk<NEW_LINE>IOUtil.writeData(out, null);<NEW_LINE>}
, context.getExpiryMetadata(dataKey));
265,061
public boolean handle(PluginMessage packet) {<NEW_LINE>if (bungeecordMessageResponder.process(packet)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// We need to specially handle REGISTER and UNREGISTER packets. Later on, we'll write them to<NEW_LINE>// the client.<NEW_LINE>if (PluginMessageUtil.isRegister(packet)) {<NEW_LINE>serverConn.getPlayer().getKnownChannels().addAll<MASK><NEW_LINE>return false;<NEW_LINE>} else if (PluginMessageUtil.isUnregister(packet)) {<NEW_LINE>serverConn.getPlayer().getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (PluginMessageUtil.isMcBrand(packet)) {<NEW_LINE>PluginMessage rewritten = PluginMessageUtil.rewriteMinecraftBrand(packet, server.getVersion(), playerConnection.getProtocolVersion());<NEW_LINE>playerConnection.write(rewritten);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (serverConn.getPhase().handle(serverConn, serverConn.getPlayer(), packet)) {<NEW_LINE>// Handled.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ChannelIdentifier id = server.getChannelRegistrar().getFromId(packet.getChannel());<NEW_LINE>if (id == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>byte[] copy = ByteBufUtil.getBytes(packet.content());<NEW_LINE>PluginMessageEvent event = new PluginMessageEvent(serverConn, serverConn.getPlayer(), id, copy);<NEW_LINE>server.getEventManager().fire(event).thenAcceptAsync(pme -> {<NEW_LINE>if (pme.getResult().isAllowed() && !playerConnection.isClosed()) {<NEW_LINE>PluginMessage copied = new PluginMessage(packet.getChannel(), Unpooled.wrappedBuffer(copy));<NEW_LINE>playerConnection.write(copied);<NEW_LINE>}<NEW_LINE>}, playerConnection.eventLoop()).exceptionally((ex) -> {<NEW_LINE>logger.error("Exception while handling plugin message {}", packet, ex);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
(PluginMessageUtil.getChannels(packet));
1,654,029
private JsMessage addLinkProps(JsMessage msg) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>// Add Link specific properties to message<NEW_LINE>msg.setGuaranteedCrossBusLinkName(_linkName);<NEW_LINE>msg.setGuaranteedCrossBusSourceBusUUID(_messageProcessor.getMessagingEngineBusUuid());<NEW_LINE>// Check whether we need to override the outbound Userid<NEW_LINE>if (_linkSetOutboundUserId) {<NEW_LINE>// Check whether this message was sent by the privileged<NEW_LINE>// Jetstream SIBServerSubject.If it was then we don't reset<NEW_LINE>// the userid in the message<NEW_LINE>if (!_messageProcessor.getAuthorisationUtils().sentBySIBServer(msg)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Set outbound userid: " + _linkOutboundUserid + ", in message");<NEW_LINE>// Call SIB.security (ultimately) to set outbounduserid into msg<NEW_LINE>_messageProcessor.getAccessChecker().setSecurityIDInMessage(_linkOutboundUserid, msg);<NEW_LINE>// Set the application userid (JMSXuserid)<NEW_LINE>msg.setApiUserId(_linkOutboundUserid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "addLinkProps");<NEW_LINE>return msg;<NEW_LINE>}
entry(tc, "addLinkProps", msg);
660,909
public static void main(String[] args) {<NEW_LINE>final Properties options = StringUtils.argsToProperties(args, argOptionDefs());<NEW_LINE>if (args.length < 1 || options.containsKey("help")) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Pattern posPattern = options.containsKey("searchPos") ? Pattern.compile(options.getProperty("searchPos")) : null;<NEW_LINE>final Pattern wordPattern = options.containsKey("searchWord") ? Pattern.compile(options.getProperty("searchWord")) : null;<NEW_LINE>final boolean plainPrint = PropertiesUtils.getBool(options, "plain", false);<NEW_LINE>final boolean ner = PropertiesUtils.getBool(options, "ner", false);<NEW_LINE>final boolean detailedAnnotations = PropertiesUtils.getBool(options, "detailedAnnotations", false);<NEW_LINE>final boolean expandElisions = PropertiesUtils.getBool(options, "expandElisions", false);<NEW_LINE>final boolean expandConmigo = PropertiesUtils.getBool(options, "expandConmigo", false);<NEW_LINE>String[] remainingArgs = options.getProperty("").split(" ");<NEW_LINE>List<File> fileList = new ArrayList<>();<NEW_LINE>for (String remainingArg : remainingArgs) fileList.add(new File(remainingArg));<NEW_LINE>final SpanishXMLTreeReaderFactory trf = new SpanishXMLTreeReaderFactory(true, true, ner, detailedAnnotations, expandElisions, expandConmigo);<NEW_LINE>ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());<NEW_LINE>for (final File file : fileList) {<NEW_LINE>pool.execute(() -> {<NEW_LINE>try {<NEW_LINE>Reader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "ISO-8859-1"));<NEW_LINE>TreeReader tr = trf.newTreeReader(file.getPath(), in);<NEW_LINE>process(file, tr, posPattern, wordPattern, plainPrint);<NEW_LINE>tr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>pool.shutdown();<NEW_LINE>try {<NEW_LINE>pool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeInterruptedException(e);<NEW_LINE>}<NEW_LINE>}
log.info(usage());
574,856
private ExportResult<CalendarContainerResource> exportCalendars(TokensAndUrlAuthData authData, Optional<PaginationData> pageData) {<NEW_LINE>Calendar.CalendarList.List listRequest;<NEW_LINE>CalendarList listResult;<NEW_LINE>// Get calendar information<NEW_LINE>try {<NEW_LINE>listRequest = getOrCreateCalendarInterface(authData).calendarList().list();<NEW_LINE>if (pageData.isPresent()) {<NEW_LINE>StringPaginationToken paginationToken = (StringPaginationToken) pageData.get();<NEW_LINE>Preconditions.checkState(paginationToken.getToken()<MASK><NEW_LINE>listRequest.setPageToken(((StringPaginationToken) pageData.get()).getToken().substring(CALENDAR_TOKEN_PREFIX.length()));<NEW_LINE>}<NEW_LINE>listResult = listRequest.execute();<NEW_LINE>} catch (IOException e) {<NEW_LINE>return new ExportResult<>(e);<NEW_LINE>}<NEW_LINE>// Set up continuation data<NEW_LINE>PaginationData nextPageData = null;<NEW_LINE>if (listResult.getNextPageToken() != null) {<NEW_LINE>nextPageData = new StringPaginationToken(CALENDAR_TOKEN_PREFIX + listResult.getNextPageToken());<NEW_LINE>}<NEW_LINE>ContinuationData continuationData = new ContinuationData(nextPageData);<NEW_LINE>// Process calendar list<NEW_LINE>List<CalendarModel> calendarModels = new ArrayList<>(listResult.getItems().size());<NEW_LINE>for (CalendarListEntry calendarData : listResult.getItems()) {<NEW_LINE>CalendarModel model = convertToCalendarModel(calendarData);<NEW_LINE>continuationData.addContainerResource(new IdOnlyContainerResource(calendarData.getId()));<NEW_LINE>calendarModels.add(model);<NEW_LINE>}<NEW_LINE>CalendarContainerResource calendarContainerResource = new CalendarContainerResource(calendarModels, null);<NEW_LINE>// Get result type<NEW_LINE>ExportResult.ResultType resultType = ResultType.CONTINUE;<NEW_LINE>if (calendarModels.isEmpty()) {<NEW_LINE>resultType = ResultType.END;<NEW_LINE>}<NEW_LINE>return new ExportResult<>(resultType, calendarContainerResource, continuationData);<NEW_LINE>}
.startsWith(CALENDAR_TOKEN_PREFIX), "Token is not applicable");
1,834,853
public void process(String command, String[] args, PrintStream out) throws CommandException {<NEW_LINE>if (args.length == 0) {<NEW_LINE>out.println(USAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = new File(args[0]);<NEW_LINE>if (!file.exists() || !file.isFile()) {<NEW_LINE>out.println("The specified command file " + file.getAbsolutePath() + " does not exist or is not a file");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (file.length() > Integer.MAX_VALUE) {<NEW_LINE>out.println("The specified command file " + file.getAbsolutePath() + " is too large to be read");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String charset = defaultCharset;<NEW_LINE>if (args.length == 2) {<NEW_LINE>charset = args[1];<NEW_LINE>} else if (args.length > 2) {<NEW_LINE>out.println(USAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<String> commands = parseCmdFile(file, charset);<NEW_LINE>for (String cmd : commands) {<NEW_LINE>out.println(Session.prompt + cmd);<NEW_LINE>try {<NEW_LINE>ToolsRegistry.process(cmd, out);<NEW_LINE>} catch (CommandException e) {<NEW_LINE>out.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>out.println("The supplied charset " + charset + " for reading the command file is not supported");<NEW_LINE>} catch (IOException e) {<NEW_LINE>out.println(<MASK><NEW_LINE>}<NEW_LINE>}
"Error reading from command file " + file.getAbsolutePath());
424,545
public static DescribeFabricOrganizationPeersResponse unmarshall(DescribeFabricOrganizationPeersResponse describeFabricOrganizationPeersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricOrganizationPeersResponse.setRequestId(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.RequestId"));<NEW_LINE>describeFabricOrganizationPeersResponse.setSuccess(_ctx.booleanValue("DescribeFabricOrganizationPeersResponse.Success"));<NEW_LINE>describeFabricOrganizationPeersResponse.setErrorCode(_ctx.integerValue("DescribeFabricOrganizationPeersResponse.ErrorCode"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricOrganizationPeersResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setUpdateTime(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].UpdateTime"));<NEW_LINE>resultItem.setDomain(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].Domain"));<NEW_LINE>resultItem.setInternetIp(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].InternetIp"));<NEW_LINE>resultItem.setCreateTime(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].CreateTime"));<NEW_LINE>resultItem.setIsAnchor(_ctx.booleanValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].IsAnchor"));<NEW_LINE>resultItem.setInstanceType(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].InstanceType"));<NEW_LINE>resultItem.setPort(_ctx.integerValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].Port"));<NEW_LINE>resultItem.setOrganizationPeerName(_ctx.stringValue("DescribeFabricOrganizationPeersResponse.Result[" + i + "].OrganizationPeerName"));<NEW_LINE>resultItem.setIntranetIp(_ctx.stringValue<MASK><NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeFabricOrganizationPeersResponse.setResult(result);<NEW_LINE>return describeFabricOrganizationPeersResponse;<NEW_LINE>}
("DescribeFabricOrganizationPeersResponse.Result[" + i + "].IntranetIp"));
790,716
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>int topOffset = 0;<NEW_LINE>// TODO - other option is to let the painting of the dark border to the inner component and make this border's insets smaller.<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>Integer in = (Integer) jc.getClientProperty("MultiViewBorderHack.topOffset");<NEW_LINE>topOffset = in == null ? topOffset : in.intValue();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderShadow"));<NEW_LINE>g.drawLine(0, 0, 0, height - 1);<NEW_LINE>if (topOffset != 0) {<NEW_LINE>g.drawLine(1, topOffset - 1, 1, topOffset);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderDarkShadow"));<NEW_LINE>g.drawLine(1, topOffset, 1, height - 2);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderHighlight"));<NEW_LINE>g.drawLine(1, height - 1, width - 1, height - 1);<NEW_LINE>g.drawLine(width - 1, height - 2, width - 1, 0);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderLight"));<NEW_LINE>g.drawLine(2, height - 2, width - 2, height - 2);<NEW_LINE>g.drawLine(width - 2, height - 3, width - 2, 0);<NEW_LINE>g.translate(-x, -y);<NEW_LINE>}
g.translate(x, y);
1,028,482
protected List<Versionable> findAllVersions(final String id, final Optional<Integer> maxResults) throws DotDataException, DotStateException {<NEW_LINE>final Identifier identifier = this.iapi.find(id);<NEW_LINE>if (identifier == null) {<NEW_LINE>throw new DotDataException("identifier:" + identifier + " not found");<NEW_LINE>}<NEW_LINE>if ("contentlet".equals(identifier.getAssetType())) {<NEW_LINE>try {<NEW_LINE>return Collections.unmodifiableList(FactoryLocator.getContentletFactory().findAllVersions(identifier, true, maxResults.isPresent() ? maxResults.get() : null));<NEW_LINE>} catch (DotSecurityException e) {<NEW_LINE>throw new DotDataException("Cannot get versions for contentlet with identifier:" + identifier);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Class<?> clazz = InodeUtils.getClassByDBType(identifier.getAssetType());<NEW_LINE>if (clazz.equals(Inode.class)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>if (clazz.equals(Template.class)) {<NEW_LINE>final List<Versionable> templateAllVersions = new ArrayList<>();<NEW_LINE>templateAllVersions.addAll(FactoryLocator.getTemplateFactory().findAllVersions(identifier, true));<NEW_LINE>return templateAllVersions;<NEW_LINE>}<NEW_LINE>final HibernateUtil dh = new HibernateUtil(clazz);<NEW_LINE>dh.setQuery("from inode in class " + clazz.getName() + " where inode.identifier = ? and inode.type='" + identifier.getAssetType() + "' order by mod_date desc");<NEW_LINE>dh.setParam(id);<NEW_LINE>if (maxResults.isPresent()) {<NEW_LINE>dh.setMaxResults(maxResults.get());<NEW_LINE>}<NEW_LINE>Logger.debug(this.getClass(), "findAllVersions query: " + dh.getQuery());<NEW_LINE>return (List<Versionable>) dh.list();<NEW_LINE>}<NEW_LINE>}
new ArrayList<Versionable>(1);
282,621
static Optional<RegistryAuthenticator> fromAuthenticationMethod(String authenticationMethod, RegistryEndpointRequestProperties registryEndpointRequestProperties, @Nullable String userAgent, FailoverHttpClient httpClient) throws RegistryAuthenticationFailedException {<NEW_LINE>// If the authentication method starts with 'basic ' (case insensitive), no registry<NEW_LINE>// authentication is needed.<NEW_LINE>if (authenticationMethod.matches("^(?i)(basic) .*")) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>String registryUrl = registryEndpointRequestProperties.getServerUrl();<NEW_LINE>String imageName = registryEndpointRequestProperties.getImageName();<NEW_LINE>// Checks that the authentication method starts with 'bearer ' (case insensitive).<NEW_LINE>if (!authenticationMethod.matches("^(?i)(bearer) .*")) {<NEW_LINE>throw newRegistryAuthenticationFailedException(registryUrl, imageName, authenticationMethod, "Bearer");<NEW_LINE>}<NEW_LINE>Pattern realmPattern = Pattern.compile("realm=\"(.*?)\"");<NEW_LINE>Matcher realmMatcher = realmPattern.matcher(authenticationMethod);<NEW_LINE>if (!realmMatcher.find()) {<NEW_LINE>throw newRegistryAuthenticationFailedException(registryUrl, imageName, authenticationMethod, "realm");<NEW_LINE>}<NEW_LINE>String realm = realmMatcher.group(1);<NEW_LINE>Pattern servicePattern = Pattern.compile("service=\"(.*?)\"");<NEW_LINE>Matcher <MASK><NEW_LINE>// use the provided registry location when missing service (e.g., for OpenShift)<NEW_LINE>String service = serviceMatcher.find() ? serviceMatcher.group(1) : registryUrl;<NEW_LINE>return Optional.of(new RegistryAuthenticator(realm, service, registryEndpointRequestProperties, userAgent, httpClient));<NEW_LINE>}
serviceMatcher = servicePattern.matcher(authenticationMethod);
1,167,578
public void validateBlocks(Function<Long, Boolean> validator, boolean repair) throws UnavailableException {<NEW_LINE>List<Long> invalidBlocks = new ArrayList<>();<NEW_LINE>try (CloseableIterator<Block> iter = mBlockStore.getCloseableIterator()) {<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>long id = iter.next().getId();<NEW_LINE>if (!validator.apply(id)) {<NEW_LINE>invalidBlocks.add(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!invalidBlocks.isEmpty()) {<NEW_LINE>long limit = 100;<NEW_LINE>List<Long> loggedBlocks = invalidBlocks.stream().limit(limit).<MASK><NEW_LINE>LOG.warn("Found {} orphan blocks without corresponding file metadata.", invalidBlocks.size());<NEW_LINE>if (invalidBlocks.size() > limit) {<NEW_LINE>LOG.warn("The first {} orphan blocks include {}.", limit, loggedBlocks);<NEW_LINE>} else {<NEW_LINE>LOG.warn("The orphan blocks include {}.", loggedBlocks);<NEW_LINE>}<NEW_LINE>if (repair) {<NEW_LINE>LOG.warn("Deleting {} orphan blocks.", invalidBlocks.size());<NEW_LINE>removeBlocks(invalidBlocks, true);<NEW_LINE>} else {<NEW_LINE>LOG.warn("Restart Alluxio master with {}=true to delete the blocks and repair the system.", PropertyKey.Name.MASTER_STARTUP_BLOCK_INTEGRITY_CHECK_ENABLED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
1,123,475
private static void storeVariable(ProcessingEnvironment processingEnv, Types types, AnnotatedTypeFactory atypeFactory, VariableTree var) {<NEW_LINE>VarSymbol sym = (VarSymbol) TreeUtils.elementFromDeclaration(var);<NEW_LINE>AnnotatedTypeMirror type;<NEW_LINE>if (atypeFactory instanceof GenericAnnotatedTypeFactory) {<NEW_LINE>// TODO: this is rather ugly: we do not want refinement from the<NEW_LINE>// initializer of the field. We need a general way to get<NEW_LINE>// the "defaulted" type of a variable.<NEW_LINE>type = ((GenericAnnotatedTypeFactory<?, ?, ?, ?>) atypeFactory).getAnnotatedTypeLhs(var);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>TypeAnnotationPosition tapos = TypeAnnotationUtils.fieldTAPosition(((JCTree) var).pos);<NEW_LINE>List<Attribute.TypeCompound> tcs;<NEW_LINE>tcs = generateTypeCompounds(processingEnv, type, tapos);<NEW_LINE>addUniqueTypeCompounds(types, sym, tcs);<NEW_LINE>}
type = atypeFactory.getAnnotatedType(var);
1,084,940
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", source, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetCardInHand target = new TargetCardInHand(filter);<NEW_LINE>if (target.canChoose(controller.getId(), source, game) && target.choose(outcome, controller.getId(), source.getSourceId(), source, game)) {<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>UUID cardId = target.getFirstTarget();<NEW_LINE>Card <MASK><NEW_LINE>if (card != null && game.getCombat() != null) {<NEW_LINE>UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);<NEW_LINE>if (defenderId != null) {<NEW_LINE>controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>Permanent creature = game.getPermanent(cardId);<NEW_LINE>if (creature != null) {<NEW_LINE>game.getCombat().addAttackerToCombat(card.getId(), defenderId, game);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
card = game.getCard(cardId);
776,631
public boolean apply(Game game, Ability source) {<NEW_LINE>Card evershrikeCard = game.getCard(source.getSourceId());<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null || evershrikeCard == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int xAmount = source.getManaCostsToPay().getX();<NEW_LINE>controller.moveCards(evershrikeCard, Zone.BATTLEFIELD, source, game);<NEW_LINE>Permanent evershrikePermanent = game.getPermanent(evershrikeCard.getId());<NEW_LINE>if (evershrikePermanent == null) {<NEW_LINE>if (game.getState().getZone(evershrikeCard.getId()) != Zone.EXILED) {<NEW_LINE>controller.moveCards(evershrikeCard, Zone.EXILED, source, game);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean exileSource = true;<NEW_LINE>FilterCard filterAuraCard = new FilterCard("Aura card with mana value X or less from your hand");<NEW_LINE>filterAuraCard.add(CardType.ENCHANTMENT.getPredicate());<NEW_LINE>filterAuraCard.add(SubType.AURA.getPredicate());<NEW_LINE>filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));<NEW_LINE>filterAuraCard.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xAmount + 1));<NEW_LINE>int count = controller.getHand().count(filterAuraCard, game);<NEW_LINE>if (count > 0 && controller.chooseUse(Outcome.Benefit, "Put an Aura card from your hand onto the battlefield attached to " + evershrikeCard.getIdName() + "?", source, game)) {<NEW_LINE>TargetCard targetAura = new TargetCard(Zone.HAND, filterAuraCard);<NEW_LINE>if (controller.choose(Outcome.Benefit, controller.getHand(), targetAura, game)) {<NEW_LINE>Card aura = game.<MASK><NEW_LINE>if (aura != null) {<NEW_LINE>game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);<NEW_LINE>if (controller.moveCards(aura, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>evershrikePermanent.addAttachment(aura.getId(), source, game);<NEW_LINE>}<NEW_LINE>exileSource = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exileSource) {<NEW_LINE>controller.moveCards(evershrikeCard, Zone.EXILED, source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getCard(targetAura.getFirstTarget());
17,992
public boolean visit(IResourceProxy proxy) throws CoreException {<NEW_LINE>switch(proxy.getType()) {<NEW_LINE>case IResource.FILE:<NEW_LINE>// GROOVY edit<NEW_LINE>// if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(proxy.getName())) {<NEW_LINE>// GRECLIPSE-404 must call 'isJavaLikeFile' directly in order to make the Scala-Eclipse plugin's weaving happy<NEW_LINE>String resourceName = proxy.getName();<NEW_LINE>if ((!isInterestingProject && org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(resourceName) && !LanguageSupportFactory.isInterestingSourceFile(resourceName)) || (isInterestingProject && LanguageSupportFactory.isSourceFile(resourceName, isInterestingProject))) {<NEW_LINE>// GROOVY end<NEW_LINE>IResource resource = proxy.requestResource();<NEW_LINE>if (exclusionPatterns != null || inclusionPatterns != null)<NEW_LINE>if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false))<NEW_LINE>return false;<NEW_LINE>SourceFile unit = new SourceFile<MASK><NEW_LINE>sourceFiles.add(unit);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>case IResource.FOLDER:<NEW_LINE>IPath folderPath = null;<NEW_LINE>if (isAlsoProject)<NEW_LINE>if (isExcludedFromProject(folderPath = proxy.requestFullPath()))<NEW_LINE>return false;<NEW_LINE>if (exclusionPatterns != null) {<NEW_LINE>if (folderPath == null)<NEW_LINE>folderPath = proxy.requestFullPath();<NEW_LINE>if (Util.isExcluded(folderPath, inclusionPatterns, exclusionPatterns, true)) {<NEW_LINE>// must walk children if inclusionPatterns != null, can skip them if == null<NEW_LINE>// but folder is excluded so do not create it in the output folder<NEW_LINE>return inclusionPatterns != null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isOutputFolder) {<NEW_LINE>if (folderPath == null)<NEW_LINE>folderPath = proxy.requestFullPath();<NEW_LINE>String packageName = folderPath.lastSegment();<NEW_LINE>if (packageName.length() > 0) {<NEW_LINE>String sourceLevel = AbstractImageBuilder.this.javaBuilder.javaProject.getOption(JavaCore.COMPILER_SOURCE, true);<NEW_LINE>String complianceLevel = AbstractImageBuilder.this.javaBuilder.javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);<NEW_LINE>if (JavaConventions.validatePackageName(packageName, sourceLevel, complianceLevel).getSeverity() != IStatus.ERROR)<NEW_LINE>createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
((IFile) resource, sourceLocation);
1,237,422
final RegisterTypeResult executeRegisterType(RegisterTypeRequest registerTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterTypeRequest> request = null;<NEW_LINE>Response<RegisterTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterTypeRequestMarshaller().marshall(super.beforeMarshalling(registerTypeRequest));<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, "RegisterType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RegisterTypeResult> responseHandler = new StaxResponseHandler<RegisterTypeResult>(new RegisterTypeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
170,046
final void showHelp(long address) {<NEW_LINE>System.out.println("c: continue");<NEW_LINE>System.out.println("n: step over");<NEW_LINE>if (emulator.isRunning()) {<NEW_LINE>System.out.println("bt: back trace");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("st hex: search stack");<NEW_LINE>System.out.println("shw hex: search writable heap");<NEW_LINE>System.out.println("shr hex: search readable heap");<NEW_LINE>System.out.println("shx hex: search executable heap");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("nb: break at next block");<NEW_LINE>System.out.println("s|si: step into");<NEW_LINE>System.out.println("s[decimal]: execute specified amount instruction");<NEW_LINE>System.out.println("s(blx): execute util BLX mnemonic, low performance");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("m(op) [size]: show memory, default size is 0x70, size may hex or decimal");<NEW_LINE>System.out.println("mr0-mr7, mfp, mip, msp [size]: show memory of specified register");<NEW_LINE>System.out.println("m(address) [size]: show memory of specified address, address must start with 0x");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("wr0-wr7, wfp, wip, wsp <value>: write specified register");<NEW_LINE>System.out.println("wb(address), ws(address), wi(address) <value>: write (byte, short, integer) memory of specified address, address must start with 0x");<NEW_LINE>System.out.println("wx(address) <hex>: write bytes to memory at specified address, address must start with 0x");<NEW_LINE>System.out.println();<NEW_LINE><MASK><NEW_LINE>System.out.println("b: add breakpoint of register PC");<NEW_LINE>System.out.println("r: remove breakpoint of register PC");<NEW_LINE>System.out.println("blr: add temporarily breakpoint of register LR");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("p (assembly): patch assembly at PC address");<NEW_LINE>System.out.println("where: show java stack trace");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("trace [begin end]: Set trace instructions");<NEW_LINE>System.out.println("traceRead [begin end]: Set trace memory read");<NEW_LINE>System.out.println("traceWrite [begin end]: Set trace memory write");<NEW_LINE>System.out.println("vm: view loaded modules");<NEW_LINE>System.out.println("vbs: view breakpoints");<NEW_LINE>System.out.println("d|dis: show disassemble");<NEW_LINE>System.out.println("d(0x): show disassemble at specify address");<NEW_LINE>System.out.println("stop: stop emulation");<NEW_LINE>System.out.println("run [arg]: run test");<NEW_LINE>System.out.println("gc: Run System.gc()");<NEW_LINE>System.out.println("threads: show thread list");<NEW_LINE>if (emulator.getFamily() == Family.iOS && !emulator.isRunning()) {<NEW_LINE>System.out.println("dump [class name]: dump objc class");<NEW_LINE>System.out.println("search [keywords]: search objc classes");<NEW_LINE>}<NEW_LINE>Module module = emulator.getMemory().findModuleByAddress(address);<NEW_LINE>if (module != null) {<NEW_LINE>System.out.printf("cc size: convert asm from 0x%x - 0x%x + size bytes to c function%n", address, address);<NEW_LINE>}<NEW_LINE>}
System.out.println("b(address): add temporarily breakpoint, address must start with 0x, can be module offset");
1,571,740
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>icon = new javax.swing.JLabel();<NEW_LINE>problemDescription = new javax.swing.JTextPane();<NEW_LINE>showDetails = new javax.swing.JButton();<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>icon.setBackground(javax.swing.UIManager.getDefaults<MASK><NEW_LINE>icon.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 6, 1, 6));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>add(icon, gridBagConstraints);<NEW_LINE>problemDescription.setEditable(false);<NEW_LINE>// NOI18N<NEW_LINE>problemDescription.setContentType("text/html");<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(problemDescription, gridBagConstraints);<NEW_LINE>showDetails.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>showDetailsActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 2;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>add(showDetails, gridBagConstraints);<NEW_LINE>showDetails.getAccessibleContext().setAccessibleName(showDetails.getText());<NEW_LINE>showDetails.getAccessibleContext().setAccessibleDescription(showDetails.getText());<NEW_LINE>}
().getColor("TextArea.background"));
82,960
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Context mContext = getActivity();<NEW_LINE>HashMap<String, String> fonts = FontManager.getFontsMap();<NEW_LINE><MASK><NEW_LINE>mFontNames = new ArrayList<>();<NEW_LINE>for (String path : fonts.keySet()) {<NEW_LINE>mFontPaths.add(path);<NEW_LINE>mFontNames.add(fonts.get(path));<NEW_LINE>}<NEW_LINE>ThemeHelper themeHelper = new ThemeHelper(getActivity());<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>LayoutInflater inflater = getActivity().getLayoutInflater();<NEW_LINE>View view = inflater.inflate(R.layout.dialog_font_picker, null);<NEW_LINE>view.setBackgroundColor(themeHelper.getBackgroundColor());<NEW_LINE>FontAdapter adapter = new FontAdapter(mContext);<NEW_LINE>builder.setAdapter(adapter, new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface arg0, int arg1) {<NEW_LINE>mSelectedFont = mFontPaths.get(arg1);<NEW_LINE>mListener.onFontSelected(FontPickerDialog.this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LinearLayout titleLinearLayout = new LinearLayout(mContext);<NEW_LINE>titleLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>titleLinearLayout.setOrientation(LinearLayout.HORIZONTAL);<NEW_LINE>TextView title = new TextView(mContext);<NEW_LINE>title.setText(R.string.select_a_font);<NEW_LINE>title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);<NEW_LINE>title.setTypeface(null, Typeface.BOLD);<NEW_LINE>title.setTextColor(ContextCompat.getColor(mContext, R.color.white));<NEW_LINE>title.setPadding(40, 40, 40, 40);<NEW_LINE>titleLinearLayout.setBackgroundColor(ContextCompat.getColor(mContext, R.color.accent_cyan));<NEW_LINE>titleLinearLayout.addView(title);<NEW_LINE>builder.setCustomTitle(titleLinearLayout);<NEW_LINE>builder.setNegativeButton(getString(R.string.cancel).toUpperCase(), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(DialogInterface dialog, int id) {<NEW_LINE>// don't have to do anything on cancel<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return builder.create();<NEW_LINE>}
mFontPaths = new ArrayList<>();
668,674
public T poll() {<NEW_LINE>if (sourceMode == ASYNC) {<NEW_LINE>long dropped = 0;<NEW_LINE>for (; ; ) {<NEW_LINE>T v = s.poll();<NEW_LINE>try {<NEW_LINE>if (v == null || predicate.test(v)) {<NEW_LINE>if (dropped != 0) {<NEW_LINE>request(dropped);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>Operators.onDiscard(v, this.ctx);<NEW_LINE>dropped++;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>RuntimeException e_ = Operators.onNextPollError(v, e, currentContext());<NEW_LINE>Operators.onDiscard(v, this.ctx);<NEW_LINE>if (e_ != null) {<NEW_LINE>throw e_;<NEW_LINE>}<NEW_LINE>// else continue<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (; ; ) {<NEW_LINE>T v = s.poll();<NEW_LINE>try {<NEW_LINE>if (v == null || predicate.test(v)) {<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>Operators.<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>RuntimeException e_ = Operators.onNextPollError(v, e, currentContext());<NEW_LINE>Operators.onDiscard(v, this.ctx);<NEW_LINE>if (e_ != null) {<NEW_LINE>throw e_;<NEW_LINE>}<NEW_LINE>// else continue<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
onDiscard(v, this.ctx);
1,392,607
public BatchPutGeofenceRequestEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchPutGeofenceRequestEntry batchPutGeofenceRequestEntry = new BatchPutGeofenceRequestEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("GeofenceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchPutGeofenceRequestEntry.setGeofenceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Geometry", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchPutGeofenceRequestEntry.setGeometry(GeofenceGeometryJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchPutGeofenceRequestEntry;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
210,748
private JavaRDD<Element> doOperation(final GetJavaRDDOfElements operation, final Context context, final AccumuloStore accumuloStore) throws OperationException {<NEW_LINE>final JavaSparkContext sparkContext = JavaSparkContext.fromSparkContext(SparkContextUtil.getSparkSession(context, accumuloStore.getProperties()).sparkContext());<NEW_LINE>final Configuration conf = getConfiguration(operation);<NEW_LINE>// Use batch scan option when performing seeded operation<NEW_LINE>InputConfigurator.setBatchScan(AccumuloInputFormat.class, conf, true);<NEW_LINE>addIterators(accumuloStore, conf, <MASK><NEW_LINE>addRanges(accumuloStore, conf, operation);<NEW_LINE>final JavaPairRDD<Element, NullWritable> pairRDD = sparkContext.newAPIHadoopRDD(conf, ElementInputFormat.class, Element.class, NullWritable.class);<NEW_LINE>final JavaRDD<Element> rdd = pairRDD.map(new FirstElement());<NEW_LINE>return rdd;<NEW_LINE>}
context.getUser(), operation);
525,390
public static DescribeInstancesResponse unmarshall(DescribeInstancesResponse describeInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeInstancesResponse.setRequestId(_ctx.stringValue("DescribeInstancesResponse.RequestId"));<NEW_LINE>describeInstancesResponse.setPageNumber(_ctx.integerValue("DescribeInstancesResponse.PageNumber"));<NEW_LINE>describeInstancesResponse.setPageSize(_ctx.integerValue("DescribeInstancesResponse.PageSize"));<NEW_LINE>describeInstancesResponse.setTotalCount(_ctx.integerValue("DescribeInstancesResponse.TotalCount"));<NEW_LINE>List<InstanceItem> instanceItems = new ArrayList<InstanceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeInstancesResponse.InstanceItems.Length"); i++) {<NEW_LINE>InstanceItem instanceItem = new InstanceItem();<NEW_LINE>instanceItem.setStatus(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].Status"));<NEW_LINE>instanceItem.setAppJson(_ctx.stringValue<MASK><NEW_LINE>instanceItem.setApiJson(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ApiJson"));<NEW_LINE>instanceItem.setProductName(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ProductName"));<NEW_LINE>instanceItem.setImageJson(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ImageJson"));<NEW_LINE>instanceItem.setInstanceId(_ctx.longValue("DescribeInstancesResponse.InstanceItems[" + i + "].InstanceId"));<NEW_LINE>instanceItem.setExtendJson(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ExtendJson"));<NEW_LINE>instanceItem.setBeganOn(_ctx.longValue("DescribeInstancesResponse.InstanceItems[" + i + "].BeganOn"));<NEW_LINE>instanceItem.setProductType(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ProductType"));<NEW_LINE>instanceItem.setHostJson(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].HostJson"));<NEW_LINE>instanceItem.setProductSkuCode(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ProductSkuCode"));<NEW_LINE>instanceItem.setCreatedOn(_ctx.longValue("DescribeInstancesResponse.InstanceItems[" + i + "].CreatedOn"));<NEW_LINE>instanceItem.setIdaasJson(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].IdaasJson"));<NEW_LINE>instanceItem.setEndOn(_ctx.longValue("DescribeInstancesResponse.InstanceItems[" + i + "].EndOn"));<NEW_LINE>instanceItem.setOrderId(_ctx.longValue("DescribeInstancesResponse.InstanceItems[" + i + "].OrderId"));<NEW_LINE>instanceItem.setProductCode(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].ProductCode"));<NEW_LINE>instanceItem.setSupplierName(_ctx.stringValue("DescribeInstancesResponse.InstanceItems[" + i + "].SupplierName"));<NEW_LINE>instanceItems.add(instanceItem);<NEW_LINE>}<NEW_LINE>describeInstancesResponse.setInstanceItems(instanceItems);<NEW_LINE>return describeInstancesResponse;<NEW_LINE>}
("DescribeInstancesResponse.InstanceItems[" + i + "].AppJson"));
1,041,414
public void disposal(LocalDate disposalDate, BigDecimal disposalAmount, FixedAsset fixedAsset) throws AxelorException {<NEW_LINE>Map<Integer, List<FixedAssetLine>> fixedAssetLineMap = fixedAsset.getFixedAssetLineList().stream().collect(Collectors.groupingBy(FixedAssetLine::getStatusSelect));<NEW_LINE>List<FixedAssetLine> previousPlannedLineList = fixedAssetLineMap.get(FixedAssetLineRepository.STATUS_PLANNED);<NEW_LINE>List<FixedAssetLine> previousRealizedLineList = fixedAssetLineMap.get(FixedAssetLineRepository.STATUS_REALIZED);<NEW_LINE>FixedAssetLine previousPlannedLine = previousPlannedLineList != null && !previousPlannedLineList.isEmpty() ? previousPlannedLineList.get(0) : null;<NEW_LINE>FixedAssetLine previousRealizedLine = previousRealizedLineList != null && !previousRealizedLineList.isEmpty() ? previousRealizedLineList.get(previousRealizedLineList.<MASK><NEW_LINE>if (previousPlannedLine != null && disposalDate.isAfter(previousPlannedLine.getDepreciationDate())) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.FIXED_ASSET_DISPOSAL_DATE_ERROR_2));<NEW_LINE>}<NEW_LINE>if (previousRealizedLine != null && disposalDate.isBefore(previousRealizedLine.getDepreciationDate())) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.FIXED_ASSET_DISPOSAL_DATE_ERROR_1));<NEW_LINE>}<NEW_LINE>if (disposalAmount.compareTo(BigDecimal.ZERO) != 0) {<NEW_LINE>FixedAssetLine depreciationFixedAssetLine = generateProrataDepreciationLine(fixedAsset, disposalDate, previousRealizedLine);<NEW_LINE>fixedAssetLineMoveService.realize(depreciationFixedAssetLine);<NEW_LINE>fixedAssetLineMoveService.generateDisposalMove(depreciationFixedAssetLine);<NEW_LINE>} else {<NEW_LINE>if (disposalAmount.compareTo(fixedAsset.getResidualValue()) != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<FixedAssetLine> fixedAssetLineList = fixedAsset.getFixedAssetLineList().stream().filter(fixedAssetLine -> fixedAssetLine.getStatusSelect() == FixedAssetLineRepository.STATUS_PLANNED).collect(Collectors.toList());<NEW_LINE>for (FixedAssetLine fixedAssetLine : fixedAssetLineList) {<NEW_LINE>fixedAsset.removeFixedAssetLineListItem(fixedAssetLine);<NEW_LINE>}<NEW_LINE>fixedAsset.setStatusSelect(FixedAssetRepository.STATUS_TRANSFERRED);<NEW_LINE>fixedAsset.setDisposalDate(disposalDate);<NEW_LINE>fixedAsset.setDisposalValue(disposalAmount);<NEW_LINE>fixedAssetRepo.save(fixedAsset);<NEW_LINE>}
size() - 1) : null;
1,465,819
public static SessionId fromInboundMessage(Message message) {<NEW_LINE>SessionId sessionId = null;<NEW_LINE>String localTag = message.getToHeader().getTag();<NEW_LINE>String remoteTag = message.getFromHeader().getTag();<NEW_LINE>// old clients might send us requests with no To tag<NEW_LINE>if (null == localTag)<NEW_LINE>localTag = "";<NEW_LINE>// 3261-12.1.1<NEW_LINE>// A UAS MUST be prepared to receive a<NEW_LINE>// request without a tag in the From field, in which case the tag is<NEW_LINE>// considered to have a value of null.<NEW_LINE>if (null == remoteTag)<NEW_LINE>remoteTag = "";<NEW_LINE>String callId = message.getCallIdHeader().getCallId();<NEW_LINE>sessionId = new <MASK><NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer b = new StringBuffer(64);<NEW_LINE>b.append("Created ");<NEW_LINE>b.append(sessionId);<NEW_LINE>b.append(" \nFor Message: ");<NEW_LINE>b.append(message.getStartLine());<NEW_LINE>c_logger.traceDebug("SessionId", "fromMessage", b.toString());<NEW_LINE>}<NEW_LINE>return sessionId;<NEW_LINE>}
SessionId(callId, localTag, remoteTag);
1,079,225
public boolean onOptionsItemSelected(MenuItem item) {<NEW_LINE><MASK><NEW_LINE>if (id == android.R.id.home) {<NEW_LINE>onBackPressed();<NEW_LINE>}<NEW_LINE>if (id == R.id.slider) {<NEW_LINE>SettingValues.albumSwipe = true;<NEW_LINE>SettingValues.prefs.edit().putBoolean(SettingValues.PREF_ALBUM_SWIPE, true).apply();<NEW_LINE>Intent i = new Intent(Tumblr.this, TumblrPager.class);<NEW_LINE>int adapterPosition = getIntent().getIntExtra(MediaView.ADAPTER_POSITION, -1);<NEW_LINE>i.putExtra(MediaView.ADAPTER_POSITION, adapterPosition);<NEW_LINE>if (getIntent().hasExtra(MediaView.SUBMISSION_URL)) {<NEW_LINE>i.putExtra(MediaView.SUBMISSION_URL, getIntent().getStringExtra(MediaView.SUBMISSION_URL));<NEW_LINE>}<NEW_LINE>if (getIntent().hasExtra(SUBREDDIT)) {<NEW_LINE>i.putExtra(SUBREDDIT, getIntent().getStringExtra(SUBREDDIT));<NEW_LINE>}<NEW_LINE>i.putExtra("url", url);<NEW_LINE>startActivity(i);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>if (id == R.id.grid) {<NEW_LINE>mToolbar.findViewById(R.id.grid).callOnClick();<NEW_LINE>}<NEW_LINE>if (id == R.id.comments) {<NEW_LINE>SubmissionsView.datachanged(adapterPosition);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>if (id == R.id.external) {<NEW_LINE>LinkUtil.openExternally(url);<NEW_LINE>}<NEW_LINE>if (id == R.id.download) {<NEW_LINE>for (final Photo elem : images) {<NEW_LINE>doImageSave(false, elem.getOriginalSize().getUrl());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}
int id = item.getItemId();
1,301,724
private void writeEntry(HashtableEntry entry) throws IOException, EOFException, FileManagerException, ClassNotFoundException {<NEW_LINE>long index = getHtindex(<MASK><NEW_LINE>if (index == 0) {<NEW_LINE>// first one in this bucket<NEW_LINE>// write to disk<NEW_LINE>updateEntry(entry);<NEW_LINE>// update index<NEW_LINE>writeHashIndex(entry.index, entry.location, entry.tableid);<NEW_LINE>} else if (index == entry.location) {<NEW_LINE>// replacing first entry<NEW_LINE>updateEntry(entry);<NEW_LINE>// update index<NEW_LINE>writeHashIndex(entry.index, entry.location, entry.tableid);<NEW_LINE>} else {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>// If the entry has a "previous" pointer, then it was read earlier<NEW_LINE>// from disk. Otherwise, it is a brand new entry. If it is a brand<NEW_LINE>// entry, we write it to disk and chain at the front of the bucket.<NEW_LINE>// If "previous" is not zero, we check to see if reallocation is<NEW_LINE>// needed (location == 0). If not, we simply update on disk and we're<NEW_LINE>// done. If reallocation is needed we update on disk to do the allocation<NEW_LINE>// and call updatePointer to chain into the bucket.<NEW_LINE>//<NEW_LINE>if (entry.previous == 0) {<NEW_LINE>entry.next = index;<NEW_LINE>updateEntry(entry);<NEW_LINE>// update index<NEW_LINE>writeHashIndex(entry.index, entry.location, entry.tableid);<NEW_LINE>} else {<NEW_LINE>if (entry.location == 0) {<NEW_LINE>// allocation needed?<NEW_LINE>// do allocation<NEW_LINE>updateEntry(entry);<NEW_LINE>// chain in<NEW_LINE>updatePointer(entry.previous, entry.location);<NEW_LINE>} else {<NEW_LINE>// no allocation, just update fields<NEW_LINE>updateEntry(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
entry.index, entry.tableid);
290,494
private int retrieveAndIncrementSequenceCurrentNext(@NonNull final DocumentSequenceInfo docSeqInfo) {<NEW_LINE>final String trxName = getTrxName();<NEW_LINE>final List<Object> sqlParams = new ArrayList<>();<NEW_LINE>final String sql;<NEW_LINE>if (isAdempiereSys()) {<NEW_LINE>sql = "UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID=? RETURNING CurrentNextSys - ?";<NEW_LINE>sqlParams.add(docSeqInfo.getIncrementNo());<NEW_LINE>sqlParams.add(docSeqInfo.getAdSequenceId());<NEW_LINE>sqlParams.add(docSeqInfo.getIncrementNo());<NEW_LINE>} else if (docSeqInfo.isStartNewYear()) {<NEW_LINE>final String calendarYear = getCalendarYear(docSeqInfo.getDateColumn());<NEW_LINE>sql = "UPDATE AD_Sequence_No SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ? AND CalendarYear = ? RETURNING CurrentNext - ?";<NEW_LINE>sqlParams.add(docSeqInfo.getIncrementNo());<NEW_LINE>sqlParams.add(docSeqInfo.getAdSequenceId());<NEW_LINE>sqlParams.add(calendarYear);<NEW_LINE>sqlParams.add(docSeqInfo.getIncrementNo());<NEW_LINE>} else {<NEW_LINE>sql = "UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ? RETURNING CurrentNext - ?";<NEW_LINE>sqlParams.add(docSeqInfo.getIncrementNo());<NEW_LINE>sqlParams.add(docSeqInfo.getAdSequenceId());<NEW_LINE>sqlParams.<MASK><NEW_LINE>}<NEW_LINE>final IMutable<Integer> currentSeq = new Mutable<>(-1);<NEW_LINE>DB.executeUpdateEx(sql, sqlParams.toArray(), trxName, QUERY_TIME_OUT, rs -> currentSeq.setValue(rs.getInt(1)));<NEW_LINE>return currentSeq.getValue();<NEW_LINE>}
add(docSeqInfo.getIncrementNo());
32,302
public void generateSyntheticBodyForSwitchTable(SyntheticMethodBinding methodBinding) {<NEW_LINE>ClassScope scope = ((SourceTypeBinding) methodBinding.declaringClass).scope;<NEW_LINE>initializeMaxLocals(methodBinding);<NEW_LINE>final BranchLabel nullLabel = new BranchLabel(this);<NEW_LINE>FieldBinding syntheticFieldBinding = methodBinding.targetReadField;<NEW_LINE>fieldAccess(<MASK><NEW_LINE>dup();<NEW_LINE>ifnull(nullLabel);<NEW_LINE>areturn();<NEW_LINE>pushOnStack(syntheticFieldBinding.type);<NEW_LINE>nullLabel.place();<NEW_LINE>pop();<NEW_LINE>ReferenceBinding enumBinding = (ReferenceBinding) methodBinding.targetEnumType;<NEW_LINE>ArrayBinding arrayBinding = scope.createArrayType(enumBinding, 1);<NEW_LINE>invokeJavaLangEnumValues(enumBinding, arrayBinding);<NEW_LINE>arraylength();<NEW_LINE>newarray(ClassFileConstants.INT_ARRAY);<NEW_LINE>astore_0();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>LocalVariableBinding localVariableBinding = new LocalVariableBinding(" tab".toCharArray(), scope.createArrayType(TypeBinding.INT, 1), 0, false);<NEW_LINE>addVariable(localVariableBinding);<NEW_LINE>final FieldBinding[] fields = enumBinding.fields();<NEW_LINE>if (fields != null) {<NEW_LINE>for (int i = 0, max = fields.length; i < max; i++) {<NEW_LINE>FieldBinding fieldBinding = fields[i];<NEW_LINE>if ((fieldBinding.getAccessFlags() & ClassFileConstants.AccEnum) != 0) {<NEW_LINE>final BranchLabel endLabel = new BranchLabel(this);<NEW_LINE>final ExceptionLabel anyExceptionHandler = new ExceptionLabel(this, TypeBinding.LONG);<NEW_LINE>anyExceptionHandler.placeStart();<NEW_LINE>aload_0();<NEW_LINE>fieldAccess(Opcodes.OPC_getstatic, fieldBinding, null);<NEW_LINE>invokeEnumOrdinal(enumBinding.constantPoolName());<NEW_LINE>// zero should not be returned see bug 141810<NEW_LINE>this.generateInlinedValue(fieldBinding.id + 1);<NEW_LINE>iastore();<NEW_LINE>anyExceptionHandler.placeEnd();<NEW_LINE>goto_(endLabel);<NEW_LINE>// Generate the body of the exception handler<NEW_LINE>pushExceptionOnStack(TypeBinding.LONG);<NEW_LINE>anyExceptionHandler.place();<NEW_LINE>// we don't use it so we can pop it<NEW_LINE>pop();<NEW_LINE>endLabel.place();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>aload_0();<NEW_LINE>if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK9) {<NEW_LINE>// Modifying a final field outside of the <clinit> method is not allowed in 9<NEW_LINE>dup();<NEW_LINE>fieldAccess(Opcodes.OPC_putstatic, syntheticFieldBinding, null);<NEW_LINE>}<NEW_LINE>areturn();<NEW_LINE>removeVariable(localVariableBinding);<NEW_LINE>}
Opcodes.OPC_getstatic, syntheticFieldBinding, null);
1,160,500
public void startContentTagsTable(List<String> columnHeaders) {<NEW_LINE>StringBuilder htmlOutput = new StringBuilder();<NEW_LINE>// NON-NLS<NEW_LINE>htmlOutput.append("<table>\n<thead>\n\t<tr>\n");<NEW_LINE>// Add the specified columns.<NEW_LINE>for (String columnHeader : columnHeaders) {<NEW_LINE>// NON-NLS<NEW_LINE>htmlOutput.append("\t\t<th>").append(columnHeader).append("</th>\n");<NEW_LINE>}<NEW_LINE>// Add a column for a hyperlink to a local copy of the tagged content.<NEW_LINE>// NON-NLS<NEW_LINE>htmlOutput.append("\t\t<th></th>\n");<NEW_LINE>// NON-NLS<NEW_LINE>htmlOutput.append("\t</tr>\n</thead>\n");<NEW_LINE>try {<NEW_LINE>out.write(htmlOutput.toString());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Failed to write table start: {0}", ex);
760,573
public CloseResponseM2P producerCloseClientP2M(CloseRequestP2M request, final String rmtAddress, boolean overtls) throws Exception {<NEW_LINE>final StringBuilder strBuffer = new StringBuilder(512);<NEW_LINE>CloseResponseM2P.Builder builder = CloseResponseM2P.newBuilder();<NEW_LINE>builder.setSuccess(false);<NEW_LINE>CertifiedResult certResult = serverAuthHandler.identityValidUserInfo(<MASK><NEW_LINE>if (!certResult.result) {<NEW_LINE>builder.setErrCode(certResult.errCode);<NEW_LINE>builder.setErrMsg(certResult.errInfo);<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>ParamCheckResult paramCheckResult = PBParameterUtils.checkClientId(request.getClientId(), strBuffer);<NEW_LINE>if (!paramCheckResult.result) {<NEW_LINE>builder.setErrCode(paramCheckResult.errCode);<NEW_LINE>builder.setErrMsg(paramCheckResult.errMsg);<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>final String producerId = (String) paramCheckResult.checkData;<NEW_LINE>checkNodeStatus(producerId, strBuffer);<NEW_LINE>new ReleaseProducer().run(producerId, false);<NEW_LINE>heartbeatManager.unRegProducerNode(producerId);<NEW_LINE>logger.info(strBuffer.append("[Producer Closed] ").append(producerId).append(", isOverTLS=").append(overtls).toString());<NEW_LINE>builder.setSuccess(true);<NEW_LINE>builder.setErrCode(TErrCodeConstants.SUCCESS);<NEW_LINE>builder.setErrMsg("OK!");<NEW_LINE>return builder.build();<NEW_LINE>}
request.getAuthInfo(), true);
901,665
private ResultImplementation<NBGroupInfo> findDependencyUsageGroups(String groupId, String artifactId, String version, ResultImpl<NBGroupInfo> result, List<RepositoryInfo> repos, final boolean skipUnIndexed) {<NEW_LINE>// tempmaps<NEW_LINE>Map<String, NBGroupInfo> groupMap = new <MASK><NEW_LINE>Map<String, NBArtifactInfo> artifactMap = new HashMap<String, NBArtifactInfo>();<NEW_LINE>List<NBGroupInfo> groupInfos = new ArrayList<NBGroupInfo>(result.getResults());<NEW_LINE>ResultImpl<NBVersionInfo> res = new ResultImpl<>(new Redo<NBVersionInfo>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(ResultImpl<NBVersionInfo> result) {<NEW_LINE>// noop will not be called<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findDependencyUsage(groupId, artifactId, version, res, repos, skipUnIndexed);<NEW_LINE>convertToNBGroupInfo(res.getResults(), groupMap, artifactMap, groupInfos);<NEW_LINE>if (res.isPartial()) {<NEW_LINE>result.addSkipped(res.getSkipped());<NEW_LINE>}<NEW_LINE>result.setResults(groupInfos);<NEW_LINE>return result;<NEW_LINE>}
HashMap<String, NBGroupInfo>();
1,130,155
private void generateFunctionJS() throws IOException {<NEW_LINE>// Naturally ordered set of function names<NEW_LINE>TreeSet<String> functionSet = new TreeSet<>();<NEW_LINE>// Extracting ONLY builtIn functions (i.e those already available)<NEW_LINE>List<FunctionHolder> builtInFuncHolderList = this.drillbit.getContext().getFunctionImplementationRegistry().getLocalFunctionRegistry().getAllJarsWithFunctionsHolders().get(LocalFunctionRegistry.BUILT_IN);<NEW_LINE>// Build List of 'usable' functions (i.e. functions that start with an alphabet and can be auto-completed by the ACE library)<NEW_LINE>// Example of 'unusable' functions would be operators like '<', '!'<NEW_LINE>int skipCount = 0;<NEW_LINE>for (FunctionHolder builtInFunctionHolder : builtInFuncHolderList) {<NEW_LINE>String name = builtInFunctionHolder.getName();<NEW_LINE>if (!name.contains(" ") && name.matches("([a-z]|[A-Z])\\w+") && !builtInFunctionHolder.getHolder().isInternal()) {<NEW_LINE>functionSet.add(name);<NEW_LINE>} else {<NEW_LINE>logger.debug("Non-alphabetic leading character. Function skipped : {} ", name);<NEW_LINE>skipCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("{} functions will not be available in WebUI", skipCount);<NEW_LINE>// Generated file<NEW_LINE>File functionsListFile = new File(getOrCreateTmpJavaScriptDir(), ACE_MODE_SQL_JS);<NEW_LINE>// Template source Javascript file<NEW_LINE>try (InputStream aceModeSqlTemplateStream = Resource.newClassPathResource(ACE_MODE_SQL_TEMPLATE_JS).getInputStream()) {<NEW_LINE>// Create a copy of a template and write with that!<NEW_LINE>java.nio.file.Files.copy(aceModeSqlTemplateStream, functionsListFile.toPath());<NEW_LINE>}<NEW_LINE>// Construct String<NEW_LINE>String funcListString = <MASK><NEW_LINE>Path path = Paths.get(functionsListFile.getPath());<NEW_LINE>try (Stream<String> lines = Files.lines(path)) {<NEW_LINE>// Replacing first occurrence<NEW_LINE>List<String> // Replacing first occurrence<NEW_LINE>replaced = lines.map(line -> line.replaceFirst(DRILL_FUNCTIONS_PLACEHOLDER, funcListString)).collect(Collectors.toList());<NEW_LINE>Files.write(path, replaced);<NEW_LINE>}<NEW_LINE>}
String.join("|", functionSet);
1,322,303
public void call(Subscriber<? super List<Chapter>> subscriber) {<NEW_LINE>try {<NEW_LINE>// Mongo mongo = new Mongo();<NEW_LINE>List<Chapter> list = new ArrayList<>();<NEW_LINE>// list.addAll(mongo.QueryComicBase(comic));<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>comic.setUrl(parser.getUrl(comic.getCid()));<NEW_LINE>Request request = parser.getInfoRequest(comic.getCid());<NEW_LINE>String html = getResponseBody(App.getHttpClient(), request);<NEW_LINE>Comic newComic = parser.parseInfo(html, comic);<NEW_LINE>RxBus.getInstance().post(new RxEvent(RxEvent.EVENT_COMIC_UPDATE_INFO, newComic));<NEW_LINE>request = parser.getChapterRequest(html, comic.getCid());<NEW_LINE>if (request != null) {<NEW_LINE>html = getResponseBody(App.getHttpClient(), request);<NEW_LINE>}<NEW_LINE>Long sourceComic = Long.parseLong(comic.getSource() + "000" + (comic.getId() == null ? "00" : comic.getId()));<NEW_LINE>list = parser.parseChapter(html, comic, sourceComic);<NEW_LINE>if (list == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// mongo.UpdateComicBase(comic, list);<NEW_LINE>}<NEW_LINE>if (!list.isEmpty()) {<NEW_LINE>subscriber.onNext(list);<NEW_LINE>subscriber.onCompleted();<NEW_LINE>} else {<NEW_LINE>throw new ParseErrorException();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>subscriber.onError(e);<NEW_LINE>}<NEW_LINE>}
list = parser.parseChapter(html);
1,655,806
public static DescribeDomainCcActivityLogResponse unmarshall(DescribeDomainCcActivityLogResponse describeDomainCcActivityLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainCcActivityLogResponse.setRequestId(_ctx.stringValue("DescribeDomainCcActivityLogResponse.RequestId"));<NEW_LINE>describeDomainCcActivityLogResponse.setPageIndex(_ctx.longValue("DescribeDomainCcActivityLogResponse.PageIndex"));<NEW_LINE>describeDomainCcActivityLogResponse.setPageSize(_ctx.longValue("DescribeDomainCcActivityLogResponse.PageSize"));<NEW_LINE>describeDomainCcActivityLogResponse.setTotal(_ctx.longValue("DescribeDomainCcActivityLogResponse.Total"));<NEW_LINE>List<LogInfo> activityLog = new ArrayList<LogInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainCcActivityLogResponse.ActivityLog.Length"); i++) {<NEW_LINE>LogInfo logInfo = new LogInfo();<NEW_LINE>logInfo.setTimeStamp(_ctx.stringValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].TimeStamp"));<NEW_LINE>logInfo.setValue(_ctx.stringValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].Value"));<NEW_LINE>logInfo.setTriggerObject(_ctx.stringValue<MASK><NEW_LINE>logInfo.setDomainName(_ctx.stringValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].DomainName"));<NEW_LINE>logInfo.setTtl(_ctx.longValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].Ttl"));<NEW_LINE>logInfo.setAction(_ctx.stringValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].Action"));<NEW_LINE>logInfo.setRuleName(_ctx.stringValue("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].RuleName"));<NEW_LINE>activityLog.add(logInfo);<NEW_LINE>}<NEW_LINE>describeDomainCcActivityLogResponse.setActivityLog(activityLog);<NEW_LINE>return describeDomainCcActivityLogResponse;<NEW_LINE>}
("DescribeDomainCcActivityLogResponse.ActivityLog[" + i + "].TriggerObject"));
695,380
public synchronized WebRtcServiceState terminate(@NonNull WebRtcServiceState currentState, @Nullable RemotePeer remotePeer) {<NEW_LINE>Log.i(tag, "terminate():");<NEW_LINE>RemotePeer activePeer = currentState.getCallInfoState().getActivePeer();<NEW_LINE>if (activePeer == null && remotePeer == null) {<NEW_LINE>Log.i(tag, "skipping with no active peer");<NEW_LINE>return currentState;<NEW_LINE>} else if (activePeer != null && !activePeer.callIdEquals(remotePeer)) {<NEW_LINE>Log.i(tag, "skipping remotePeer is not active peer");<NEW_LINE>return currentState;<NEW_LINE>} else {<NEW_LINE>activePeer = remotePeer;<NEW_LINE>}<NEW_LINE>ApplicationDependencies.getAppForegroundObserver().removeListener(webRtcInteractor.getForegroundListener());<NEW_LINE>webRtcInteractor.<MASK><NEW_LINE>boolean playDisconnectSound = (activePeer.getState() == CallState.DIALING) || (activePeer.getState() == CallState.REMOTE_RINGING) || (activePeer.getState() == CallState.RECEIVED_BUSY) || (activePeer.getState() == CallState.CONNECTED);<NEW_LINE>webRtcInteractor.stopAudio(playDisconnectSound);<NEW_LINE>webRtcInteractor.terminateCall(activePeer.getId());<NEW_LINE>webRtcInteractor.updatePhoneState(LockManager.PhoneState.IDLE);<NEW_LINE>webRtcInteractor.stopForegroundService();<NEW_LINE>return WebRtcVideoUtil.deinitializeVideo(currentState).builder().changeCallInfoState().activePeer(null).commit().changeLocalDeviceState().commit().actionProcessor(new IdleActionProcessor(webRtcInteractor)).terminate(remotePeer.getCallId()).build();<NEW_LINE>}
updatePhoneState(LockManager.PhoneState.PROCESSING);
745,871
private boolean placeBlockSimple_old(BlockPos pos) {<NEW_LINE>Vec3d eyesPos = RotationUtils.getEyesPos();<NEW_LINE>Vec3d posVec = Vec3d.ofCenter(pos);<NEW_LINE>for (Direction side : Direction.values()) {<NEW_LINE>BlockPos <MASK><NEW_LINE>// check if neighbor can be right clicked<NEW_LINE>if (!BlockUtils.canBeClicked(neighbor))<NEW_LINE>continue;<NEW_LINE>Vec3d hitVec = posVec.add(Vec3d.of(side.getVector()).multiply(0.5));<NEW_LINE>// check if hitVec is within range (6 blocks)<NEW_LINE>if (eyesPos.squaredDistanceTo(hitVec) > 36)<NEW_LINE>continue;<NEW_LINE>// place block<NEW_LINE>IMC.getInteractionManager().rightClickBlock(neighbor, side.getOpposite(), hitVec);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
neighbor = pos.offset(side);
1,557,121
static RealVector makeValues(PreferenceDomain domain) {<NEW_LINE>if (!domain.hasPrecision()) {<NEW_LINE>throw new IllegalArgumentException("domain is not discrete");<NEW_LINE>}<NEW_LINE>final double min = domain.getMinimum();<NEW_LINE>final double max = domain.getMaximum();<NEW_LINE>final <MASK><NEW_LINE>final double nv = (max - min) / prec;<NEW_LINE>int n = (int) nv;<NEW_LINE>if (Math.abs(nv - n) > 1.0e-6) {<NEW_LINE>// one more to cover everything...<NEW_LINE>n += 1;<NEW_LINE>}<NEW_LINE>if (n == 0) {<NEW_LINE>throw new IllegalArgumentException("range has no elements");<NEW_LINE>}<NEW_LINE>double[] values = new double[n + 1];<NEW_LINE>for (int i = 0; i <= n; i++) {<NEW_LINE>values[i] = min + (prec * i);<NEW_LINE>}<NEW_LINE>return new ArrayRealVector(values);<NEW_LINE>}
double prec = domain.getPrecision();
542,320
public SpockExecutionContext execute(SpockExecutionContext context, DynamicTestExecutor dynamicTestExecutor) throws Exception {<NEW_LINE>verifyNotSkipped(getNodeInfo());<NEW_LINE>ErrorInfoCollector errorInfoCollector = new ErrorInfoCollector();<NEW_LINE>context = context.withErrorInfoCollector(errorInfoCollector);<NEW_LINE>ParameterizedFeatureChildExecutor childExecutor = new ParameterizedFeatureChildExecutor(this, dynamicTestExecutor);<NEW_LINE>context.getRunner().runParameterizedFeature(context, childExecutor);<NEW_LINE>errorInfoCollector.assertEmpty();<NEW_LINE>if (childExecutor.getExecutionCount() < 1) {<NEW_LINE>throw new SpockExecutionException("Data provider has no data");<NEW_LINE>}<NEW_LINE>// do not try to aggregate iteration results if they are reported individually<NEW_LINE>if (getNodeInfo().isReportIterations()) {<NEW_LINE>return context;<NEW_LINE>}<NEW_LINE>Map<Status, Queue<Throwable><MASK><NEW_LINE>if (childResults.containsKey(FAILED)) {<NEW_LINE>handleFailedChildren(childResults);<NEW_LINE>} else if (!childResults.containsKey(SUCCESSFUL)) {<NEW_LINE>handleOnlyAbortedChildren(childResults);<NEW_LINE>}<NEW_LINE>return context;<NEW_LINE>}
> childResults = childExecutor.getResults();
1,165,082
static ActionConfig actionConfigFromStarlark(StarlarkInfo actionConfigStruct) throws EvalException {<NEW_LINE>checkRightProviderType(actionConfigStruct, "action_config");<NEW_LINE>String actionName = getMandatoryFieldFromStarlarkProvider(<MASK><NEW_LINE>if (actionName == null || actionName.isEmpty()) {<NEW_LINE>throw infoError(actionConfigStruct, "The 'action_name' field of action_config must be a nonempty string.");<NEW_LINE>}<NEW_LINE>if (!actionName.matches("^[_a-z0-9+\\-\\.]*$")) {<NEW_LINE>throw infoError(actionConfigStruct, "An action_config's name must consist solely of lowercase ASCII letters, digits, " + "'.', '_', '+', and '-', got '%s'", actionName);<NEW_LINE>}<NEW_LINE>Boolean enabled = getMandatoryFieldFromStarlarkProvider(actionConfigStruct, "enabled", Boolean.class);<NEW_LINE>ImmutableList.Builder<CcToolchainFeatures.Tool> toolBuilder = ImmutableList.builder();<NEW_LINE>ImmutableList<StarlarkInfo> toolStructs = getStarlarkProviderListFromStarlarkField(actionConfigStruct, "tools");<NEW_LINE>for (StarlarkInfo toolStruct : toolStructs) {<NEW_LINE>toolBuilder.add(toolFromStarlark(toolStruct));<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<FlagSet> flagSetBuilder = ImmutableList.builder();<NEW_LINE>ImmutableList<StarlarkInfo> flagSets = getStarlarkProviderListFromStarlarkField(actionConfigStruct, "flag_sets");<NEW_LINE>for (StarlarkInfo flagSet : flagSets) {<NEW_LINE>flagSetBuilder.add(flagSetFromStarlark(flagSet, actionName));<NEW_LINE>}<NEW_LINE>ImmutableList<String> implies = getStringListFromStarlarkProviderField(actionConfigStruct, "implies");<NEW_LINE>return new ActionConfig(actionName, actionName, toolBuilder.build(), flagSetBuilder.build(), enabled, implies);<NEW_LINE>}
actionConfigStruct, "action_name", String.class);
60,158
protected void visitUninterpretedTagStart(Element jspElement) throws JspCoreException {<NEW_LINE>// 245645.1 Start<NEW_LINE>String uri = jspElement.getNamespaceURI();<NEW_LINE>if (uri != null) {<NEW_LINE>if (uri.startsWith("urn:jsptld:")) {<NEW_LINE>uri = uri.substring(uri.indexOf("urn:jsptld:") + 11);<NEW_LINE>} else if (uri.startsWith("urn:jsptagdir:")) {<NEW_LINE>uri = uri.substring(uri.indexOf("urn:jsptagdir:") + 14);<NEW_LINE>}<NEW_LINE>TagLibraryInfoImpl tli = tagLibraryCache.getTagLibraryInfo(uri, "", jspUri);<NEW_LINE>if (tli != null) {<NEW_LINE>System.out.<MASK><NEW_LINE>jspElement.setPrefix("");<NEW_LINE>visitCustomTagStart(jspElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 245645.1 End<NEW_LINE>}
println("tli for " + uri + " found");
371,513
public static String computeMessageId(JSONObject message, SourceType sourceType) throws Exception {<NEW_LINE>JSONArray location = message.getJSONArray("location_point");<NEW_LINE>if (location == null) {<NEW_LINE>throw new Exception("location_point not found");<NEW_LINE>}<NEW_LINE>String longitude, latitude;<NEW_LINE>try {<NEW_LINE>Object <MASK><NEW_LINE>longitude = rawLon instanceof Integer ? Integer.toString((Integer) rawLon) : (rawLon instanceof Double ? Double.toString((Double) rawLon) : (String) rawLon);<NEW_LINE>Object rawLat = location.get(0);<NEW_LINE>latitude = rawLat instanceof Integer ? Integer.toString((Integer) rawLat) : (rawLat instanceof Double ? Double.toString((Double) rawLat) : (String) rawLat);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new ClassCastException("Unable to extract lat, lon from location_point " + e.getMessage());<NEW_LINE>}<NEW_LINE>// Modification time = 'mtime' value. If not found, take current time<NEW_LINE>Object mtime = message.get("mtime");<NEW_LINE>if (mtime == null) {<NEW_LINE>mtime = Long.toString(System.currentTimeMillis());<NEW_LINE>message.put("mtime", mtime);<NEW_LINE>}<NEW_LINE>// Id format : <source_type>_<lat>_<lon>_<mtime><NEW_LINE>return sourceType.toString() + "_" + latitude + "_" + longitude + "_" + mtime;<NEW_LINE>}
rawLon = location.get(1);
479,516
protected void readCityStreets(SearchRequest<Street> resultMatcher, City city, List<String> attributeTagsTable) throws IOException {<NEW_LINE>int x = MapUtils.get31TileNumberX(city.getLocation().getLongitude());<NEW_LINE>int y = MapUtils.get31TileNumberY(city.getLocation().getLatitude());<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>return;<NEW_LINE>case OsmandOdb.CityBlockIndex.STREETS_FIELD_NUMBER:<NEW_LINE>Street s = new Street(city);<NEW_LINE>s.setFileOffset(codedIS.getTotalBytesRead());<NEW_LINE>int length = codedIS.readRawVarint32();<NEW_LINE>int <MASK><NEW_LINE>readStreet(s, null, false, x >> 7, y >> 7, city.isPostcode() ? city.getName() : null, attributeTagsTable);<NEW_LINE>publishRawData(resultMatcher, s);<NEW_LINE>if (resultMatcher == null || resultMatcher.publish(s)) {<NEW_LINE>city.registerStreet(s);<NEW_LINE>}<NEW_LINE>if (resultMatcher != null && resultMatcher.isCancelled()) {<NEW_LINE>codedIS.skipRawBytes(codedIS.getBytesUntilLimit());<NEW_LINE>}<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>break;<NEW_LINE>case OsmandOdb.CityBlockIndex.BUILDINGS_FIELD_NUMBER:<NEW_LINE>// buildings for the town are not used now<NEW_LINE>skipUnknownField(t);<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
oldLimit = codedIS.pushLimit(length);
1,464,840
public void listModels() {<NEW_LINE>// BEGIN: com.azure.digitaltwins.core.DigitalTwinsAsyncClient.listModels<NEW_LINE>digitalTwinsAsyncClient.listModels().doOnNext(model -> System.out.println("Retrieved model with Id: " + model.getModelId<MASK><NEW_LINE>// END: com.azure.digitaltwins.core.DigitalTwinsAsyncClient.listModels<NEW_LINE>// BEGIN: com.azure.digitaltwins.core.DigitalTwinsAsyncClient.listModels#ListModelsOptions<NEW_LINE>digitalTwinsAsyncClient.listModels(new ListModelsOptions().setMaxItemsPerPage(5).setIncludeModelDefinition(true)).doOnNext(model -> System.out.println("Retrieved model with Id: " + model.getModelId())).subscribe();<NEW_LINE>// END: com.azure.digitaltwins.core.DigitalTwinsAsyncClient.listModels#ListModelsOptions<NEW_LINE>}
())).subscribe();
501,189
public void buildFile(final BuildContext context, IProgressMonitor monitor) {<NEW_LINE>if (context == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Ensure a parse happened<NEW_LINE>context.getAST();<NEW_LINE>} catch (CoreException e) {<NEW_LINE>// ignores the parser exception<NEW_LINE>}<NEW_LINE>// Set our temp fields up<NEW_LINE>this.fContext = context;<NEW_LINE>this.fLocation = context.getURI();<NEW_LINE>this.fPath = fLocation.toString();<NEW_LINE>this.fProblems = new ArrayList<IProblem>();<NEW_LINE>try {<NEW_LINE>// Add parse errors...<NEW_LINE>Collection<IParseError> parseErrors = context.getParseErrors();<NEW_LINE>if (!CollectionsUtil.isEmpty(parseErrors)) {<NEW_LINE>fProblems.addAll(CollectionsUtil.map(parseErrors, new IMap<IParseError, IProblem>() {<NEW_LINE><NEW_LINE>public IProblem map(IParseError parseError) {<NEW_LINE>int offset = parseError.getOffset();<NEW_LINE><MASK><NEW_LINE>if (offset < 0 && lineno > 0) {<NEW_LINE>try {<NEW_LINE>offset = getDocument(fContext).getLineOffset(lineno - 1);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Problem(parseError.getSeverity().intValue(), parseError.getMessage(), offset, parseError.getLength(), parseError.getLineNumber(), fPath);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>JSCorePlugin.getDefault(), // $NON-NLS-1$<NEW_LINE>MessageFormat.format("Failed to parse {0} for JS Parser Validation", fPath), e);<NEW_LINE>}<NEW_LINE>context.putProblems(IJSConstants.JS_PROBLEM_MARKER_TYPE, fProblems);<NEW_LINE>// Clean up the temporary fields<NEW_LINE>this.fDocument = null;<NEW_LINE>this.fPath = null;<NEW_LINE>this.fLocation = null;<NEW_LINE>this.fContext = null;<NEW_LINE>}
int lineno = parseError.getLineNumber();
504,677
public static long byteStringAs(String str, ByteUnit unit) {<NEW_LINE>String lower = str.toLowerCase().trim();<NEW_LINE>try {<NEW_LINE>Matcher m = Pattern.compile("([0-9]+)([a-z]+)?").matcher(lower);<NEW_LINE>Matcher fractionMatcher = Pattern.compile("([0-9]+\\.[0-9]+)([a-z]+)?").matcher(lower);<NEW_LINE>if (m.matches()) {<NEW_LINE>long val = Long.parseLong(m.group(1));<NEW_LINE>String suffix = m.group(2);<NEW_LINE>// Check for invalid suffixes<NEW_LINE>if (suffix != null && !byteSuffixes.containsKey(suffix)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>// If suffix is valid use that, otherwise none was provided and use the default passed<NEW_LINE>return unit.convertFrom(val, suffix != null ? byteSuffixes.get(suffix) : unit);<NEW_LINE>} else if (fractionMatcher.matches()) {<NEW_LINE>throw new NumberFormatException("Fractional values are not supported. Input was: " + fractionMatcher.group(1));<NEW_LINE>} else {<NEW_LINE>throw new NumberFormatException("Failed to parse byte string: " + str);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>String byteError = "Size must be specified as bytes (b), " + "kibibytes (k), mebibytes (m), gibibytes (g), tebibytes (t), or pebibytes(p). " + "E.g. 50b, 100k, or 250m.";<NEW_LINE>throw new NumberFormatException(byteError + "\n" + e.getMessage());<NEW_LINE>}<NEW_LINE>}
NumberFormatException("Invalid suffix: \"" + suffix + "\"");
83,894
public void init(ConfiguredRuleClassProvider.Builder builder) {<NEW_LINE>builder.addConfigurationFragment(JavaConfiguration.class);<NEW_LINE>builder.addBuildInfoFactory(new BazelJavaBuildInfoFactory());<NEW_LINE>builder.addRuleDefinition(new BazelJavaRuleClasses.BaseJavaBinaryRule());<NEW_LINE>builder.addRuleDefinition(new IjarBaseRule());<NEW_LINE>builder.addRuleDefinition(new JavaToolchainBaseRule());<NEW_LINE>builder.addRuleDefinition(new JavaRuntimeBaseRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaRuleClasses.JavaBaseRule());<NEW_LINE>builder.addRuleDefinition(new ProguardLibraryRule());<NEW_LINE>builder.addRuleDefinition(new JavaImportBaseRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaRuleClasses.JavaRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaBinaryRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaLibraryRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaImportRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaTestRule());<NEW_LINE>builder.addRuleDefinition(new BazelJavaPluginRule());<NEW_LINE>builder.addRuleDefinition(JavaToolchainRule.create(BazelJavaToolchain.class));<NEW_LINE>builder.addRuleDefinition(new JavaPackageConfigurationRule());<NEW_LINE>builder.addRuleDefinition(new JavaRuntimeRule());<NEW_LINE>builder.addRuleDefinition(new JavaPluginsFlagAliasRule());<NEW_LINE>builder.addRuleDefinition(new ExtraActionRule());<NEW_LINE>builder.addRuleDefinition(new ActionListenerRule());<NEW_LINE>builder.addStarlarkBootstrap(new JavaBootstrap(new JavaStarlarkCommon(BazelJavaSemantics.INSTANCE), JavaInfo.PROVIDER, JavaPluginInfo.PROVIDER, new JavaProtoStarlarkCommon<MASK><NEW_LINE>try {<NEW_LINE>builder.addWorkspaceFileSuffix(ResourceFileLoader.loadResource(BazelJavaRuleClasses.class, "jdk.WORKSPACE"));<NEW_LINE>builder.addWorkspaceFileSuffix(ResourceFileLoader.loadResource(JavaRules.class, "coverage.WORKSPACE"));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}
(), ProguardSpecProvider.PROVIDER));
69,019
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>mAppContext = getApplicationContext();<NEW_LINE>mBackGroundText = findViewById(R.id.connectCameraText);<NEW_LINE>mGLSurfaceView = findViewById(R.id.glSurfaceView);<NEW_LINE>mStartRecordFab = findViewById(R.id.startRecordFab);<NEW_LINE>mStopRecordFab = <MASK><NEW_LINE>mStartRecordFab.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>toggleRecording();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mStopRecordFab.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>toggleRecording();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Android 9 also requires camera permissions<NEW_LINE>if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.O && ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.CAMERA }, PERMISSIONS_REQUEST_CAMERA);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mPermissionsGranted = true;<NEW_LINE>}
findViewById(R.id.stopRecordFab);
1,741,752
private void jaxrpc(String[] args, WsCompile wsCompile, Descriptor desc, ArrayList<String> files) throws Exception {<NEW_LINE>try {<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>debug("---> ARGS = ");<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>logger.fine(args[i] + "; ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean compiled = wsCompile.getCompileTool().run(args);<NEW_LINE>done(wsCompile.getCompileTool());<NEW_LINE>if (compiled) {<NEW_LINE>Iterator generatedFiles = wsCompile.getGeneratedFiles().iterator();<NEW_LINE>while (generatedFiles.hasNext()) {<NEW_LINE>GeneratedFileInfo next = <MASK><NEW_LINE>String fileType = next.getType();<NEW_LINE>File file = next.getFile();<NEW_LINE>String origPath = file.getPath();<NEW_LINE>if (origPath.endsWith(".java")) {<NEW_LINE>int javaIndex = origPath.lastIndexOf(".java");<NEW_LINE>String newPath = origPath.substring(0, javaIndex) + ".class";<NEW_LINE>if (keepJaxrpcGeneratedFile(fileType, desc)) {<NEW_LINE>files.add(newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new Exception("jaxrpc compilation exception");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Exception ge = new Exception(t.getMessage());<NEW_LINE>ge.initCause(t);<NEW_LINE>throw ge;<NEW_LINE>}<NEW_LINE>}
(GeneratedFileInfo) generatedFiles.next();
536,687
public void layout() {<NEW_LINE>if (sizeInvalid)<NEW_LINE>computeSize();<NEW_LINE>if (wrap) {<NEW_LINE>layoutWrapped();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean round = this.round;<NEW_LINE>int align = this.align;<NEW_LINE>float space = this.space, padBottom = this.padBottom, fill = this.fill;<NEW_LINE>float rowHeight = (expand ? getHeight() : prefHeight) - padTop - padBottom, x = padLeft;<NEW_LINE>if ((align & Align.right) != 0)<NEW_LINE>x += getWidth() - prefWidth;<NEW_LINE>else if (// center<NEW_LINE>(align & Align.left) == 0)<NEW_LINE>x += (getWidth() - prefWidth) / 2;<NEW_LINE>float startY;<NEW_LINE>if ((align & Align.bottom) != 0)<NEW_LINE>startY = padBottom;<NEW_LINE>else if ((align & Align.top) != 0)<NEW_LINE>startY <MASK><NEW_LINE>else<NEW_LINE>startY = padBottom + (getHeight() - padBottom - padTop - rowHeight) / 2;<NEW_LINE>align = rowAlign;<NEW_LINE>SnapshotArray<Actor> children = getChildren();<NEW_LINE>int i = 0, n = children.size, incr = 1;<NEW_LINE>if (reverse) {<NEW_LINE>i = n - 1;<NEW_LINE>n = -1;<NEW_LINE>incr = -1;<NEW_LINE>}<NEW_LINE>for (int r = 0; i != n; i += incr) {<NEW_LINE>Actor child = children.get(i);<NEW_LINE>float width, height;<NEW_LINE>Layout layout = null;<NEW_LINE>if (child instanceof Layout) {<NEW_LINE>layout = (Layout) child;<NEW_LINE>width = layout.getPrefWidth();<NEW_LINE>height = layout.getPrefHeight();<NEW_LINE>} else {<NEW_LINE>width = child.getWidth();<NEW_LINE>height = child.getHeight();<NEW_LINE>}<NEW_LINE>if (fill > 0)<NEW_LINE>height = rowHeight * fill;<NEW_LINE>if (layout != null) {<NEW_LINE>height = Math.max(height, layout.getMinHeight());<NEW_LINE>float maxHeight = layout.getMaxHeight();<NEW_LINE>if (maxHeight > 0 && height > maxHeight)<NEW_LINE>height = maxHeight;<NEW_LINE>}<NEW_LINE>float y = startY;<NEW_LINE>if ((align & Align.top) != 0)<NEW_LINE>y += rowHeight - height;<NEW_LINE>else if (// center<NEW_LINE>(align & Align.bottom) == 0)<NEW_LINE>y += (rowHeight - height) / 2;<NEW_LINE>if (round)<NEW_LINE>child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));<NEW_LINE>else<NEW_LINE>child.setBounds(x, y, width, height);<NEW_LINE>x += width + space;<NEW_LINE>if (layout != null)<NEW_LINE>layout.validate();<NEW_LINE>}<NEW_LINE>}
= getHeight() - padTop - rowHeight;
1,456,679
public EncryptionConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EncryptionConfiguration encryptionConfiguration = new EncryptionConfiguration();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("S3Encryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfiguration.setS3Encryption(new ListUnmarshaller<S3Encryption>(S3EncryptionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CloudWatchEncryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfiguration.setCloudWatchEncryption(CloudWatchEncryptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("JobBookmarksEncryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfiguration.setJobBookmarksEncryption(JobBookmarksEncryptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return encryptionConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,678,384
private DependencyManagement parseDependencyManagement(XmlPullParser parser, boolean strict) throws IOException, XmlPullParserException {<NEW_LINE>String tagName = parser.getName();<NEW_LINE>DependencyManagement dependencyManagement = new DependencyManagement();<NEW_LINE>for (int i = parser.getAttributeCount() - 1; i >= 0; i--) {<NEW_LINE>String name = parser.getAttributeName(i);<NEW_LINE>String <MASK><NEW_LINE>if (name.indexOf(':') >= 0) {<NEW_LINE>// just ignore attributes with non-default namespace (for example: xmlns:xsi)<NEW_LINE>} else {<NEW_LINE>checkUnknownAttribute(parser, name, tagName, strict);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>java.util.Set parsed = new java.util.HashSet();<NEW_LINE>while ((strict ? parser.nextTag() : nextTag(parser)) == XmlPullParser.START_TAG) {<NEW_LINE>if (checkFieldWithDuplicate(parser, "dependencies", null, parsed)) {<NEW_LINE>java.util.List dependencies = new java.util.ArrayList();<NEW_LINE>dependencyManagement.setDependencies(dependencies);<NEW_LINE>while (parser.nextTag() == XmlPullParser.START_TAG) {<NEW_LINE>if ("dependency".equals(parser.getName())) {<NEW_LINE>dependencies.add(parseDependency(parser, strict));<NEW_LINE>} else {<NEW_LINE>checkUnknownElement(parser, strict);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>checkUnknownElement(parser, strict);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dependencyManagement;<NEW_LINE>}
value = parser.getAttributeValue(i);
844,270
final BatchGetApplicationsResult executeBatchGetApplications(BatchGetApplicationsRequest batchGetApplicationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetApplicationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetApplicationsRequest> request = null;<NEW_LINE>Response<BatchGetApplicationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetApplicationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetApplicationsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeDeploy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetApplications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetApplicationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetApplicationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
761,574
protected void writeConfig() {<NEW_LINE>IProgressMonitor monitor = new NullProgressMonitor();<NEW_LINE>TemplateCore template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveConfig");<NEW_LINE>Map<String, String> valueStore = template.getValueStore();<NEW_LINE>valueStore.put("projectName", project.getName());<NEW_LINE>valueStore.put("configFile", configPath.getProjectRelativePath().toOSString());<NEW_LINE>valueStore.put("ProdID", this.prodId);<NEW_LINE>valueStore.<MASK><NEW_LINE>valueStore.put("StackMinSize", this.stackMinSize);<NEW_LINE>valueStore.put("StackMaxSize", this.stackMaxSize);<NEW_LINE>valueStore.put("HeapMinSize", this.heapMinSize);<NEW_LINE>valueStore.put("HeapInitSize", this.heapInitSize);<NEW_LINE>valueStore.put("HeapMaxSize", this.heapMaxSize);<NEW_LINE>valueStore.put("TcsNum", this.tcsNum);<NEW_LINE>valueStore.put("TcsMaxNum", this.tcsMaxNum);<NEW_LINE>valueStore.put("TcsMinPool", this.tcsPool);<NEW_LINE>valueStore.put("TcsPolicy", this.tcsPolicy);<NEW_LINE>valueStore.put("DisableDebug", this.disableDebug);<NEW_LINE>IStatus[] result = template.executeTemplateProcesses(monitor, true);<NEW_LINE>for (IStatus status : result) {<NEW_LINE>}<NEW_LINE>}
put("IsvSvn", this.isvSvn);
1,517,859
public Request<ReportInstanceStatusRequest> marshall(ReportInstanceStatusRequest reportInstanceStatusRequest) {<NEW_LINE>if (reportInstanceStatusRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ReportInstanceStatusRequest> request = new DefaultRequest<ReportInstanceStatusRequest>(reportInstanceStatusRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>java.util.List<String> instancesList = reportInstanceStatusRequest.getInstances();<NEW_LINE>int instancesListIndex = 1;<NEW_LINE>for (String instancesListValue : instancesList) {<NEW_LINE>if (instancesListValue != null) {<NEW_LINE>request.addParameter("InstanceId." + instancesListIndex, StringUtils.fromString(instancesListValue));<NEW_LINE>}<NEW_LINE>instancesListIndex++;<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getStatus() != null) {<NEW_LINE>request.addParameter("Status", StringUtils.fromString(reportInstanceStatusRequest.getStatus()));<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getStartTime() != null) {<NEW_LINE>request.addParameter("StartTime", StringUtils.fromDate(reportInstanceStatusRequest.getStartTime()));<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getEndTime() != null) {<NEW_LINE>request.addParameter("EndTime", StringUtils.fromDate(reportInstanceStatusRequest.getEndTime()));<NEW_LINE>}<NEW_LINE>java.util.List<String> reasonCodesList = reportInstanceStatusRequest.getReasonCodes();<NEW_LINE>int reasonCodesListIndex = 1;<NEW_LINE>for (String reasonCodesListValue : reasonCodesList) {<NEW_LINE>if (reasonCodesListValue != null) {<NEW_LINE>request.addParameter("ReasonCode." + reasonCodesListIndex, StringUtils.fromString(reasonCodesListValue));<NEW_LINE>}<NEW_LINE>reasonCodesListIndex++;<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(reportInstanceStatusRequest.getDescription()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ReportInstanceStatus");
1,651,864
private static AttributeInfo loadBody(short attributeNameIndex, ClassFile classFile, DataInputStream dis) throws IOException {<NEW_LINE>// max_stack<NEW_LINE>final <MASK><NEW_LINE>// max_locals<NEW_LINE>final short maxLocals = dis.readShort();<NEW_LINE>// code_length, code<NEW_LINE>final byte[] code = ClassFile.readLengthAndBytes(dis);<NEW_LINE>// exception_table_length<NEW_LINE>ExceptionTableEntry[] etes = new ExceptionTableEntry[dis.readUnsignedShort()];<NEW_LINE>for (int i = 0; i < etes.length; ++i) {<NEW_LINE>// exception_table<NEW_LINE>etes[i] = new // startPC<NEW_LINE>ExceptionTableEntry(// endPC<NEW_LINE>dis.readShort(), // handlerPC<NEW_LINE>dis.readShort(), // catchType<NEW_LINE>dis.readShort(), dis.readShort());<NEW_LINE>}<NEW_LINE>// attributes_count<NEW_LINE>AttributeInfo[] attributes = new AttributeInfo[dis.readUnsignedShort()];<NEW_LINE>for (int i = 0; i < attributes.length; ++i) {<NEW_LINE>// attributes<NEW_LINE>attributes[i] = classFile.loadAttribute(dis);<NEW_LINE>}<NEW_LINE>return new // attributeNameIndex<NEW_LINE>CodeAttribute(// maxStack<NEW_LINE>attributeNameIndex, // maxLocals<NEW_LINE>maxStack, // code<NEW_LINE>maxLocals, // exceptionTableEntries<NEW_LINE>code, // attributes<NEW_LINE>etes, attributes);<NEW_LINE>}
short maxStack = dis.readShort();
556,931
public void actionPerformed(@Nonnull GuiButton guiButton) {<NEW_LINE>super.actionPerformed(guiButton);<NEW_LINE>if (guiButton.id == ID_COLOR_BUTTON) {<NEW_LINE>conduit.setExtractionSignalColor(gui.getDir(), DyeColor.fromIndex(colorB.getColorIndex()));<NEW_LINE>PacketHandler.INSTANCE.sendToServer(new PacketExtractMode(conduit<MASK><NEW_LINE>} else if (guiButton.id == ID_INSERT_FILTER_OPTIONS) {<NEW_LINE>doOpenFilterGui(FilterGuiUtil.INDEX_OUTPUT_FLUID);<NEW_LINE>return;<NEW_LINE>} else if (guiButton.id == ID_EXTRACT_FILTER_OPTIONS) {<NEW_LINE>doOpenFilterGui(FilterGuiUtil.INDEX_INPUT_FLUID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (eCon != null) {<NEW_LINE>if (guiButton.id == ID_INSERT_CHANNEL) {<NEW_LINE>DyeColor col = EnumReader.get(DyeColor.class, insertChannelB.getColorIndex());<NEW_LINE>eCon.setOutputColor(gui.getDir(), col);<NEW_LINE>} else if (guiButton.id == ID_EXTRACT_CHANNEL) {<NEW_LINE>DyeColor col = EnumReader.get(DyeColor.class, extractChannelB.getColorIndex());<NEW_LINE>eCon.setInputColor(gui.getDir(), col);<NEW_LINE>} else if (guiButton.id == ID_PRIORITY_UP) {<NEW_LINE>eCon.setOutputPriority(gui.getDir(), eCon.getOutputPriority(gui.getDir()) + 1);<NEW_LINE>} else if (guiButton.id == ID_PRIORITY_DOWN) {<NEW_LINE>eCon.setOutputPriority(gui.getDir(), eCon.getOutputPriority(gui.getDir()) - 1);<NEW_LINE>} else if (guiButton.id == ID_ROUND_ROBIN) {<NEW_LINE>eCon.setRoundRobinEnabled(gui.getDir(), !eCon.isRoundRobinEnabled(gui.getDir()));<NEW_LINE>} else if (guiButton.id == ID_LOOP) {<NEW_LINE>eCon.setSelfFeedEnabled(gui.getDir(), !eCon.isSelfFeedEnabled(gui.getDir()));<NEW_LINE>}<NEW_LINE>PacketHandler.INSTANCE.sendToServer(new PacketEnderLiquidConduit(eCon, gui.getDir()));<NEW_LINE>}<NEW_LINE>}
, gui.getDir()));
660,735
protected void tally(CrawlURI curi, Stage stage) {<NEW_LINE>// Tally per-server, per-host, per-frontier-class running totals<NEW_LINE>CrawlServer server = getServerCache().getServerFor(curi.getUURI());<NEW_LINE>if (server != null) {<NEW_LINE>synchronized (server) {<NEW_LINE>server.getSubstats().tally(curi, stage);<NEW_LINE>server.makeDirty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>CrawlHost host = getServerCache().getHostFor(curi.getUURI());<NEW_LINE>if (host != null) {<NEW_LINE>synchronized (host) {<NEW_LINE>host.getSubstats().tally(curi, stage);<NEW_LINE>host.makeDirty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.<MASK><NEW_LINE>}<NEW_LINE>FrontierGroup group = getGroup(curi);<NEW_LINE>synchronized (group) {<NEW_LINE>group.tally(curi, stage);<NEW_LINE>group.makeDirty();<NEW_LINE>}<NEW_LINE>}
WARNING, "unable to tally host stats for " + curi, e);
1,806,149
public boolean isStrobogrammatic(String num) {<NEW_LINE>int i = 0;<NEW_LINE>int j = num.length() - 1;<NEW_LINE>Map<Character, Character> map = new HashMap();<NEW_LINE>map.put('8', '8');<NEW_LINE><MASK><NEW_LINE>map.put('0', '0');<NEW_LINE>if (j == 0) {<NEW_LINE>return map.containsKey(num.charAt(i));<NEW_LINE>}<NEW_LINE>map.put('9', '6');<NEW_LINE>map.put('6', '9');<NEW_LINE>while (i < j) {<NEW_LINE>if (!map.containsKey(num.charAt(i)) || !map.containsKey(num.charAt(j))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (map.get(num.charAt(i)) != num.charAt(j)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>j--;<NEW_LINE>}<NEW_LINE>return map.containsKey(num.charAt(i));<NEW_LINE>}
map.put('1', '1');
228,236
private Object readMark2(int b) throws IOException {<NEW_LINE>switch(b) {<NEW_LINE>case ObjectWriter.STRING:<NEW_LINE>return readString(readInt());<NEW_LINE>case ObjectWriter.DECIMAL:<NEW_LINE>int scale = read2();<NEW_LINE>int len = read2();<NEW_LINE>byte[] buf = new byte[len];<NEW_LINE>readFully(buf, 0, len);<NEW_LINE>return new BigDecimal(new BigInteger(buf), scale);<NEW_LINE>case ObjectWriter.SEQUENCE:<NEW_LINE>len = readInt();<NEW_LINE>Sequence seq = new Sequence(len);<NEW_LINE>for (int i = 0; i < len; ++i) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return seq;<NEW_LINE>case ObjectWriter.TABLE:<NEW_LINE>return readTable();<NEW_LINE>case ObjectWriter.RECORD:<NEW_LINE>return readRecord();<NEW_LINE>case ObjectWriter.BLOB:<NEW_LINE>return readByteArray();<NEW_LINE>default:<NEW_LINE>// ObjectWriter.AVG<NEW_LINE>AvgValue avg = new AvgValue();<NEW_LINE>avg.readData(this);<NEW_LINE>return avg;<NEW_LINE>}<NEW_LINE>}
seq.add(readObject());
65,741
protected List<ClassificationResult<BytesRef>> buildListFromTopDocs(TopDocs topDocs) throws IOException {<NEW_LINE>Map<BytesRef, Integer> classCounts = new HashMap<>();<NEW_LINE>// this is a boost based on class ranking positions in topDocs<NEW_LINE>Map<BytesRef, Double> // this is a boost based on class ranking positions in topDocs<NEW_LINE>classBoosts = new HashMap<>();<NEW_LINE>float maxScore = topDocs.totalHits.value == 0 ? Float.NaN : topDocs.scoreDocs[0].score;<NEW_LINE>for (ScoreDoc scoreDoc : topDocs.scoreDocs) {<NEW_LINE>IndexableField[] storableFields = indexSearcher.doc(scoreDoc.doc).getFields(classFieldName);<NEW_LINE>for (IndexableField singleStorableField : storableFields) {<NEW_LINE>if (singleStorableField != null) {<NEW_LINE>BytesRef cl = new BytesRef(singleStorableField.stringValue());<NEW_LINE>// update count<NEW_LINE>classCounts.merge(cl, 1, Integer::sum);<NEW_LINE>// update boost, the boost is based on the best score<NEW_LINE>Double totalBoost = classBoosts.get(cl);<NEW_LINE>double singleBoost = scoreDoc.score / maxScore;<NEW_LINE>if (totalBoost != null) {<NEW_LINE>classBoosts.put(cl, totalBoost + singleBoost);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ClassificationResult<BytesRef>> returnList = new ArrayList<>();<NEW_LINE>List<ClassificationResult<BytesRef>> temporaryList = new ArrayList<>();<NEW_LINE>int sumdoc = 0;<NEW_LINE>for (Map.Entry<BytesRef, Integer> entry : classCounts.entrySet()) {<NEW_LINE>Integer count = entry.getValue();<NEW_LINE>// the boost is normalized to be 0<b<1<NEW_LINE>Double // the boost is normalized to be 0<b<1<NEW_LINE>normBoost = classBoosts.get(entry.getKey()) / count;<NEW_LINE>temporaryList.add(new ClassificationResult<>(entry.getKey().clone(), (count * normBoost) / (double) k));<NEW_LINE>sumdoc += count;<NEW_LINE>}<NEW_LINE>// correction<NEW_LINE>if (sumdoc < k) {<NEW_LINE>for (ClassificationResult<BytesRef> cr : temporaryList) {<NEW_LINE>returnList.add(new ClassificationResult<>(cr.getAssignedClass(), cr.getScore() * k / (double) sumdoc));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>returnList = temporaryList;<NEW_LINE>}<NEW_LINE>return returnList;<NEW_LINE>}
classBoosts.put(cl, singleBoost);
1,277,610
private static <T> T createInstance(Constructor<T> constructor, Object... arguments) throws Exception {<NEW_LINE>if (constructor == null) {<NEW_LINE>throw new IllegalArgumentException("Constructor cannot be null");<NEW_LINE>}<NEW_LINE>constructor.setAccessible(true);<NEW_LINE>T createdObject = null;<NEW_LINE>try {<NEW_LINE>if (constructor.isVarArgs()) {<NEW_LINE>Class<?>[] parameterTypes = constructor.getParameterTypes();<NEW_LINE>final int varArgsIndex = parameterTypes.length - 1;<NEW_LINE>Class<?> varArgsType = parameterTypes[varArgsIndex].getComponentType();<NEW_LINE>Object varArgsArrayInstance = createAndPopulateVarArgsArray(varArgsType, varArgsIndex, arguments);<NEW_LINE>Object[] completeArgumentList = new Object[parameterTypes.length];<NEW_LINE>System.arraycopy(arguments, 0, completeArgumentList, 0, varArgsIndex);<NEW_LINE>completeArgumentList[completeArgumentList.length - 1] = varArgsArrayInstance;<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>createdObject = constructor.newInstance(arguments);<NEW_LINE>}<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause instanceof Exception) {<NEW_LINE>throw (Exception) cause;<NEW_LINE>} else if (cause instanceof Error) {<NEW_LINE>throw (Error) cause;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return createdObject;<NEW_LINE>}
createdObject = constructor.newInstance(completeArgumentList);
1,504,374
public void testSetShortProperty_TCP_SecOff(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>JMSContext jmsContextQCFTCP = qcfTCP.createContext();<NEW_LINE>emptyQueue(qcfTCP, queue1);<NEW_LINE>JMSConsumer jmsConsumer = jmsContextQCFTCP.createConsumer(queue1);<NEW_LINE><MASK><NEW_LINE>TextMessage tmsg = jmsContextQCFTCP.createTextMessage();<NEW_LINE>String propName = "MyProp";<NEW_LINE>short propValue1 = 21;<NEW_LINE>tmsg.setShortProperty(propName, propValue1);<NEW_LINE>short propValue2 = 21;<NEW_LINE>jmsProducer.setProperty(propName, propValue2);<NEW_LINE>jmsProducer.send(queue1, tmsg);<NEW_LINE>Short actualPropValue = jmsConsumer.receive(30000).getShortProperty(propName);<NEW_LINE>boolean testFailed = false;<NEW_LINE>if (actualPropValue != propValue2) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContextQCFTCP.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testSetShortProperty_TCP_SecOff failed");<NEW_LINE>}<NEW_LINE>}
JMSProducer jmsProducer = jmsContextQCFTCP.createProducer();
1,562,179
private void enrollNewQuarantineAndRecovery(PartitionState newPartitionState, PartitionState oldPartitionState, long quarantineLatency, long currentTime) {<NEW_LINE>int partitionId = newPartitionState.getPartitionId();<NEW_LINE>Map<TrackerClient, LoadBalancerQuarantine> quarantineMap = newPartitionState.getQuarantineMap();<NEW_LINE>Map<TrackerClient, LoadBalancerQuarantine> quarantineHistory = newPartitionState.getQuarantineHistory();<NEW_LINE>Set<TrackerClient> recoverySet = newPartitionState.getRecoveryTrackerClients();<NEW_LINE>for (TrackerClient trackerClient : newPartitionState.getTrackerClients()) {<NEW_LINE>TrackerClientState trackerClientState = newPartitionState.getTrackerClientStateMap().get(trackerClient);<NEW_LINE>double <MASK><NEW_LINE>// Check and enroll quarantine map<NEW_LINE>boolean isQuarantined = enrollClientInQuarantineMap(trackerClient, trackerClientState, serverWeight, quarantineMap, quarantineHistory, newPartitionState.getTrackerClientStateMap().size(), quarantineLatency, currentTime);<NEW_LINE>if (!isQuarantined) {<NEW_LINE>if (!_fastRecoveryEnabled) {<NEW_LINE>performNormalRecovery(trackerClientState);<NEW_LINE>} else {<NEW_LINE>// Only enroll the client into recovery state if fast recovery is enabled<NEW_LINE>enrollSingleClientInRecoverySet(trackerClient, trackerClientState, serverWeight, recoverySet, oldPartitionState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
serverWeight = trackerClient.getPartitionWeight(partitionId);
685,902
public Object apply(@Nonnull Context ctx) throws Exception {<NEW_LINE>final String resolvedPath;<NEW_LINE>String filepath = ctx.pathMap().getOrDefault(filekey, "index.html");<NEW_LINE>Asset asset = resolve(filepath);<NEW_LINE>if (asset == null) {<NEW_LINE>if (fallback != null) {<NEW_LINE>asset = resolve(fallback);<NEW_LINE>}<NEW_LINE>// Still null?<NEW_LINE>if (asset == null) {<NEW_LINE>ctx.send(StatusCode.NOT_FOUND);<NEW_LINE>return ctx;<NEW_LINE>} else {<NEW_LINE>resolvedPath = fallback;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resolvedPath = filepath;<NEW_LINE>}<NEW_LINE>CacheControl <MASK><NEW_LINE>// handle If-None-Match<NEW_LINE>if (cacheParams.isEtag()) {<NEW_LINE>String ifnm = ctx.header("If-None-Match").value((String) null);<NEW_LINE>if (ifnm != null && ifnm.equals(asset.getEtag())) {<NEW_LINE>ctx.send(StatusCode.NOT_MODIFIED);<NEW_LINE>asset.close();<NEW_LINE>return ctx;<NEW_LINE>} else {<NEW_LINE>ctx.setResponseHeader("ETag", asset.getEtag());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Handle If-Modified-Since<NEW_LINE>if (cacheParams.isLastModified()) {<NEW_LINE>long lastModified = asset.getLastModified();<NEW_LINE>if (lastModified > 0) {<NEW_LINE>long ifms = ctx.header("If-Modified-Since").longValue(-1);<NEW_LINE>if (lastModified / ONE_SEC <= ifms / ONE_SEC) {<NEW_LINE>ctx.send(StatusCode.NOT_MODIFIED);<NEW_LINE>asset.close();<NEW_LINE>return ctx;<NEW_LINE>}<NEW_LINE>ctx.setResponseHeader("Last-Modified", Instant.ofEpochMilli(lastModified));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// cache control<NEW_LINE>if (cacheParams.getMaxAge() >= 0) {<NEW_LINE>ctx.setResponseHeader("Cache-Control", "max-age=" + cacheParams.getMaxAge());<NEW_LINE>} else if (cacheParams.getMaxAge() == CacheControl.NO_CACHE) {<NEW_LINE>ctx.setResponseHeader("Cache-Control", "no-store, must-revalidate");<NEW_LINE>}<NEW_LINE>long length = asset.getSize();<NEW_LINE>if (length != -1) {<NEW_LINE>ctx.setResponseLength(length);<NEW_LINE>}<NEW_LINE>ctx.setResponseType(asset.getContentType());<NEW_LINE>return ctx.send(asset.stream());<NEW_LINE>}
cacheParams = cacheControl.apply(resolvedPath);
1,050,949
public AnalysisResult execute(File baseDir, ReportOptions data, SettingsFactory settings, Map<String, String> environmentVariables) {<NEW_LINE>if (data.getVerbosity() == VERBOSE) {<NEW_LINE>Log.getLogger().info("Project base directory is " + data.getProjectBase());<NEW_LINE>Log.getLogger().info("---------------------------------------------------------------------------");<NEW_LINE>Log.getLogger().info("Enabled (+) and disabled (-) features.");<NEW_LINE>Log.getLogger().info("-----------------------------------------");<NEW_LINE>settings.describeFeatures(asInfo("+"), asInfo("-"));<NEW_LINE>Log.getLogger().info("---------------------------------------------------------------------------");<NEW_LINE>}<NEW_LINE>settings.checkRequestedFeatures();<NEW_LINE>checkMatrixMode(data);<NEW_LINE>final ClassPath cp = data.getClassPath();<NEW_LINE>// workaround for apparent java 1.5 JVM bug . . . might not play nicely<NEW_LINE>// with distributed testing<NEW_LINE>final JavaAgent jac = new JarCreatingJarFinder(new ClassPathByteArraySource(cp));<NEW_LINE>final KnownLocationJavaAgentFinder ja = new KnownLocationJavaAgentFinder(jac.getJarLocation().get());<NEW_LINE>final ResultOutputStrategy reportOutput = settings.getOutputStrategy();<NEW_LINE>final MutationResultListenerFactory reportFactory = settings.createListener();<NEW_LINE>final CoverageOptions coverageOptions = settings.createCoverageOptions();<NEW_LINE>final LaunchOptions launchOptions = new LaunchOptions(ja, settings.getJavaExecutable(), data.getJvmArgs(), environmentVariables).usingClassPathJar(data.useClasspathJar());<NEW_LINE>final ProjectClassPaths cps = data.getMutationClassPaths();<NEW_LINE>final CodeSource code = new CodeSource(cps);<NEW_LINE>final Timings timings = new Timings();<NEW_LINE>final CoverageGenerator coverageDatabase = new DefaultCoverageGenerator(baseDir, coverageOptions, launchOptions, code, settings.createCoverageExporter(), timings, data.getVerbosity());<NEW_LINE>final Optional<WriterFactory<MASK><NEW_LINE>WriterFactory historyWriter = maybeWriter.orElse(new NullWriterFactory());<NEW_LINE>final HistoryStore history = makeHistoryStore(data, maybeWriter);<NEW_LINE>final MutationStrategies strategies = new MutationStrategies(settings.createEngine(), history, coverageDatabase, reportFactory, reportOutput);<NEW_LINE>final MutationCoverage report = new MutationCoverage(strategies, baseDir, code, data, settings, timings);<NEW_LINE>try {<NEW_LINE>return AnalysisResult.success(report.runReport());<NEW_LINE>} catch (final IOException e) {<NEW_LINE>return AnalysisResult.fail(e);<NEW_LINE>} finally {<NEW_LINE>jac.close();<NEW_LINE>ja.close();<NEW_LINE>historyWriter.close();<NEW_LINE>}<NEW_LINE>}
> maybeWriter = data.createHistoryWriter();
1,068,193
private void createObjectsTable(Composite parent) {<NEW_LINE>Composite placeholder = UIUtils.createComposite(parent, 1);<NEW_LINE>placeholder.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Group tableGroup = UIUtils.createControlGroup(placeholder, UINavigatorMessages.confirm_deleting_multiple_objects_table_group_name, 1, GridData.FILL_BOTH, 0);<NEW_LINE>tableGroup.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Table objectsTable = new Table(tableGroup, SWT.BORDER | SWT.FULL_SELECTION);<NEW_LINE>objectsTable.setHeaderVisible(false);<NEW_LINE>objectsTable.setLinesVisible(true);<NEW_LINE>GridData gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>int fontHeight = UIUtils.getFontHeight(objectsTable);<NEW_LINE>int rowCount = selectedObjects.size();<NEW_LINE>gd.widthHint = fontHeight * 7;<NEW_LINE>gd.heightHint = rowCount < 6 ? fontHeight * 2 * rowCount : fontHeight * 10;<NEW_LINE>objectsTable.setLayoutData(gd);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_name);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, "Type");<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_description);<NEW_LINE>for (Object obj : selectedObjects) {<NEW_LINE>if (!(obj instanceof DBNNode)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DBNNode node = (DBNNode) obj;<NEW_LINE>TableItem item = new TableItem(objectsTable, SWT.NONE);<NEW_LINE>item.setImage(DBeaverIcons.getImage(node.getNodeIcon()));<NEW_LINE>if (node instanceof DBNResource && ((DBNResource) node).getResource() != null) {<NEW_LINE>item.setText(0, node.getName());<NEW_LINE>IResource resource = ((DBNResource) node).getResource();<NEW_LINE>IPath resLocation = resource == null ? null : resource.getLocation();<NEW_LINE>item.setText(1, "File");<NEW_LINE>item.setText(2, resLocation == null ? "" : resLocation.toFile().getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>item.setText(0, node.getNodeFullName());<NEW_LINE>item.setText(<MASK><NEW_LINE>item.setText(2, CommonUtils.toString(node.getNodeDescription()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UIUtils.asyncExec(() -> UIUtils.packColumns(objectsTable, true));<NEW_LINE>}
1, node.getNodeType());
1,743,430
public TSStatus appendSchemaTemplate(TSAppendSchemaTemplateReq req) {<NEW_LINE>int size = req.getMeasurementsSize();<NEW_LINE>String[] measurements = new String[size];<NEW_LINE>TSDataType[] dataTypes = new TSDataType[size];<NEW_LINE>TSEncoding[] encodings = new TSEncoding[size];<NEW_LINE>CompressionType[] compressionTypes = new CompressionType[size];<NEW_LINE>for (int i = 0; i < req.getDataTypesSize(); i++) {<NEW_LINE>measurements[i] = req.getMeasurements().get(i);<NEW_LINE>dataTypes[i] = TSDataType.values()[req.getDataTypes().get(i)];<NEW_LINE>encodings[i] = TSEncoding.values()[req.getEncodings().get(i)];<NEW_LINE>compressionTypes[i] = CompressionType.values()[req.getCompressors<MASK><NEW_LINE>}<NEW_LINE>AppendTemplatePlan plan = new AppendTemplatePlan(req.getName(), req.isAligned, measurements, dataTypes, encodings, compressionTypes);<NEW_LINE>TSStatus status = serviceProvider.checkAuthority(plan, req.getSessionId());<NEW_LINE>return status != null ? status : executeNonQueryPlan(plan);<NEW_LINE>}
().get(i)];
1,832,368
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workId) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.fetch(workId, Work.class, ListTools<MASK><NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, work.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>List<Wo> wos = Wo.copier.copy(emc.listEqual(ReadCompleted.class, ReadCompleted.work_FIELDNAME, workId));<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getStartTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
.toList(Work.job_FIELDNAME));
1,501,331
public Policy findById(ResourceServer resourceServer, String id) {<NEW_LINE>if (id == null)<NEW_LINE>return null;<NEW_LINE>CachedPolicy cached = cache.get(id, CachedPolicy.class);<NEW_LINE>if (cached != null) {<NEW_LINE>logger.tracev("by id cache hit: {0}", cached.getId());<NEW_LINE>}<NEW_LINE>if (cached == null) {<NEW_LINE>if (!modelMightExist(id))<NEW_LINE>return null;<NEW_LINE>Policy model = getPolicyStoreDelegate().findById(resourceServer, id);<NEW_LINE>Long loaded = cache.getCurrentRevision(id);<NEW_LINE>if (model == null) {<NEW_LINE>setModelDoesNotExists(id, loaded);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (invalidations.contains(id))<NEW_LINE>return model;<NEW_LINE>cached <MASK><NEW_LINE>cache.addRevisioned(cached, startupRevision);<NEW_LINE>} else if (invalidations.contains(id)) {<NEW_LINE>return getPolicyStoreDelegate().findById(resourceServer, id);<NEW_LINE>} else if (managedPolicies.containsKey(id)) {<NEW_LINE>return managedPolicies.get(id);<NEW_LINE>}<NEW_LINE>PolicyAdapter adapter = new PolicyAdapter(cached, StoreFactoryCacheSession.this);<NEW_LINE>managedPolicies.put(id, adapter);<NEW_LINE>return adapter;<NEW_LINE>}
= new CachedPolicy(loaded, model);