idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
697,343 | private // region Metadata<NEW_LINE>void onMetadataChanged(@NonNull final StreamInfo info) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.d(TAG, "Playback - onMetadataChanged() called, playing: " + info.getName());<NEW_LINE>}<NEW_LINE>initThumbnail(info.getThumbnailUrl());<NEW_LINE>registerStreamViewed();<NEW_LINE>updateStreamRelatedViews();<NEW_LINE>showHideKodiButton();<NEW_LINE>binding.titleTextView.<MASK><NEW_LINE>binding.channelTextView.setText(info.getUploaderName());<NEW_LINE>this.seekbarPreviewThumbnailHolder.resetFrom(this.getContext(), info.getPreviewFrames());<NEW_LINE>NotificationUtil.getInstance().createNotificationIfNeededAndUpdate(this, false);<NEW_LINE>final boolean showThumbnail = prefs.getBoolean(context.getString(R.string.show_thumbnail_key), true);<NEW_LINE>mediaSessionManager.setMetadata(getVideoTitle(), getUploaderName(), showThumbnail ? Optional.ofNullable(getThumbnail()) : Optional.empty(), StreamTypeUtil.isLiveStream(info.getStreamType()) ? -1 : info.getDuration());<NEW_LINE>notifyMetadataUpdateToListeners();<NEW_LINE>if (areSegmentsVisible) {<NEW_LINE>if (segmentAdapter.setItems(info)) {<NEW_LINE>final int adapterPosition = getNearestStreamSegmentPosition(simpleExoPlayer.getCurrentPosition());<NEW_LINE>segmentAdapter.selectSegmentAt(adapterPosition);<NEW_LINE>binding.itemsList.scrollToPosition(adapterPosition);<NEW_LINE>} else {<NEW_LINE>closeItemsList();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setText(info.getName()); |
981,050 | private void init(@Nonnull IModObject modObject) {<NEW_LINE>SmartModelAttacher.registerNoProps(this);<NEW_LINE>PaintRegistry.registerModel(MODEL_UP, new ResourceLocation("minecraft:block/stone_pressure_plate_up"), PaintRegistry.PaintMode.ALL_TEXTURES);<NEW_LINE>PaintRegistry.registerModel(MODEL_DOWN, new ResourceLocation("minecraft:block/stone_pressure_plate_down"), PaintRegistry.PaintMode.ALL_TEXTURES);<NEW_LINE>defaultPaints.put(EnumPressurePlateType.WOOD, Blocks.WOODEN_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.STONE, Blocks.STONE_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.IRON, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.GOLD, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE.getDefaultState());<NEW_LINE>// we "hide" our textures for our variants in these blockstates. Our paint rendering will make sure they are never actually rendered.<NEW_LINE>defaultPaints.put(EnumPressurePlateType.DARKSTEEL, getDefaultState().withProperty(BlockPressurePlateWeighted.POWER, 1));<NEW_LINE>defaultPaints.put(EnumPressurePlateType.SOULARIUM, getDefaultState().withProperty(BlockPressurePlateWeighted.POWER, 2));<NEW_LINE>defaultPaints.put(EnumPressurePlateType.TUNED, getDefaultState().withProperty<MASK><NEW_LINE>} | (BlockPressurePlateWeighted.POWER, 3)); |
1,839,207 | public synchronized void append(byte[] buffer, int offset, int size) throws IOException {<NEW_LINE>if (size == 0)<NEW_LINE>return;<NEW_LINE>if (myNextChunkBuffer == null)<NEW_LINE>loadAppendBuffer();<NEW_LINE>if (myNextChunkBuffer.length != myAppendBufferLength && myBufferPosition + size >= myNextChunkBuffer.length) {<NEW_LINE>int newBufferSize = calcBufferSize(myBufferPosition + size);<NEW_LINE>if (newBufferSize != myNextChunkBuffer.length) {<NEW_LINE>myNextChunkBuffer = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int bufferPosition = offset;<NEW_LINE>int sizeToWrite = size;<NEW_LINE>while (sizeToWrite > 0) {<NEW_LINE>int bytesToWriteInTheBuffer = Math.min(myNextChunkBuffer.length - myBufferPosition, sizeToWrite);<NEW_LINE>System.arraycopy(buffer, bufferPosition, myNextChunkBuffer, myBufferPosition, bytesToWriteInTheBuffer);<NEW_LINE>myBufferPosition += bytesToWriteInTheBuffer;<NEW_LINE>bufferPosition += bytesToWriteInTheBuffer;<NEW_LINE>sizeToWrite -= bytesToWriteInTheBuffer;<NEW_LINE>saveNextChunkIfNeeded();<NEW_LINE>}<NEW_LINE>if (myUncompressedFileLength == -1)<NEW_LINE>length();<NEW_LINE>myUncompressedFileLength += size;<NEW_LINE>myDirty = true;<NEW_LINE>} | Arrays.copyOf(myNextChunkBuffer, newBufferSize); |
1,822,606 | protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {<NEW_LINE>CryptorRuleHandler ruleHandle = CryptorResponsePluginDataHandler.CACHED_HANDLE.get().obtainHandle(CacheKeyUtils.INST.getKey(rule));<NEW_LINE>if (Objects.isNull(ruleHandle)) {<NEW_LINE>LOG.error("Cryptor response rule configuration is null :{}", rule.getId());<NEW_LINE>return chain.execute(exchange);<NEW_LINE>}<NEW_LINE>Pair<Boolean, String> pair = JsonUtil.checkParam(ruleHandle);<NEW_LINE>if (Boolean.TRUE.equals(pair.getLeft())) {<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.CRYPTOR_RESPONSE_ERROR_CONFIGURATION.getCode(), ShenyuResultEnum.CRYPTOR_RESPONSE_ERROR_CONFIGURATION.getMsg() + "[" + pair.getRight() + "]", null);<NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>return chain.execute(exchange.mutate().response(new CryptorResponseDecorator(exchange, <MASK><NEW_LINE>} | ruleHandle)).build()); |
503,110 | public void rip() throws IOException {<NEW_LINE>int index = 0;<NEW_LINE>logger.info("Retrieving " + this.url);<NEW_LINE>sendUpdate(STATUS.LOADING_RESOURCE, this.url.toExternalForm());<NEW_LINE>JSONObject json = getFirstPage();<NEW_LINE>while (json != null) {<NEW_LINE>List<String> imageURLs = getURLsFromJSON(json);<NEW_LINE>// Remove all but 1 image<NEW_LINE>if (isThisATest()) {<NEW_LINE>while (imageURLs.size() > 1) {<NEW_LINE>imageURLs.remove(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (imageURLs.size() == 0) {<NEW_LINE>throw new IOException("No images found at " + this.url);<NEW_LINE>}<NEW_LINE>for (String imageURL : imageURLs) {<NEW_LINE>if (isStopped()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>index += 1;<NEW_LINE>logger.debug("Found image url #" + index + ": " + imageURL);<NEW_LINE>downloadURL(new URL(imageURL), index);<NEW_LINE>}<NEW_LINE>if (isStopped() || isThisATest()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>json = getNextPage(json);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.info("Can't get next page: " + e.getMessage());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If they're using a thread pool, wait for it.<NEW_LINE>if (getThreadPool() != null) {<NEW_LINE>logger.debug("Waiting for threadpool " + getThreadPool().getClass().getName());<NEW_LINE>getThreadPool().waitForThreads();<NEW_LINE>}<NEW_LINE>waitForThreads();<NEW_LINE>} | sendUpdate(STATUS.LOADING_RESOURCE, "next page"); |
810,886 | private static void validateType(Type type, boolean hasArrayOrCollectionWrapped) {<NEW_LINE>if (!(type instanceof ParameterizedType)) {<NEW_LINE>if (UNSUPPORTED_TYPES.contains(type)) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("Type '%s' is not supported. " + "Please use @FieldIgnore to exclude the field " + "and manually build SearchField to the list if the field is needed. %n" + "For more information, refer to link: aka.ms/azsdk/java/search/fieldbuilder", type.getTypeName())));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ParameterizedType parameterizedType = (ParameterizedType) type;<NEW_LINE>if (Map.class.isAssignableFrom((Class<?>) parameterizedType.getRawType())) {<NEW_LINE>throw LOGGER.<MASK><NEW_LINE>}<NEW_LINE>if (hasArrayOrCollectionWrapped) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("Only single-dimensional array is supported."));<NEW_LINE>}<NEW_LINE>if (!List.class.isAssignableFrom((Class<?>) parameterizedType.getRawType())) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("Collection type %s is not supported", type.getTypeName())));<NEW_LINE>}<NEW_LINE>} | logExceptionAsError(new IllegalArgumentException("Map and its subclasses are not supported")); |
1,440,570 | private void appendRpcServerSpanTags(Invoker<?> invoker, SofaTracerSpan sofaTracerSpan) {<NEW_LINE>if (sofaTracerSpan == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RpcContext rpcContext = RpcContext.getContext();<NEW_LINE>Map<String, String<MASK><NEW_LINE>tagsStr.put(Tags.SPAN_KIND.getKey(), spanKind(rpcContext));<NEW_LINE>String service = invoker.getInterface().getName();<NEW_LINE>tagsStr.put(CommonSpanTags.SERVICE, service == null ? BLANK : service);<NEW_LINE>String methodName = rpcContext.getMethodName();<NEW_LINE>tagsStr.put(CommonSpanTags.METHOD, methodName == null ? BLANK : methodName);<NEW_LINE>String app = rpcContext.getUrl().getParameter(CommonConstants.APPLICATION_KEY);<NEW_LINE>tagsStr.put(CommonSpanTags.REMOTE_HOST, rpcContext.getRemoteHost());<NEW_LINE>tagsStr.put(CommonSpanTags.LOCAL_APP, app == null ? BLANK : app);<NEW_LINE>tagsStr.put(CommonSpanTags.CURRENT_THREAD_NAME, Thread.currentThread().getName());<NEW_LINE>String protocol = rpcContext.getUrl().getProtocol();<NEW_LINE>tagsStr.put(CommonSpanTags.PROTOCOL, protocol == null ? BLANK : protocol);<NEW_LINE>tagsStr.put(CommonSpanTags.LOCAL_HOST, rpcContext.getLocalHost());<NEW_LINE>tagsStr.put(CommonSpanTags.LOCAL_PORT, String.valueOf(rpcContext.getLocalPort()));<NEW_LINE>} | > tagsStr = sofaTracerSpan.getTagsWithStr(); |
842,820 | public void shutDown(CloseConnectionReason closeConnectionReason, @Nullable Runnable shutDownCompleteHandler) {<NEW_LINE>log.info("Connection shutdown started");<NEW_LINE>log.debug("shutDown: peersNodeAddressOptional={}, closeConnectionReason={}", peersNodeAddressOptional, closeConnectionReason);<NEW_LINE>connectionState.shutDown();<NEW_LINE>if (!stopped) {<NEW_LINE>String peersNodeAddress = peersNodeAddressOptional.map(NodeAddress::toString).orElse("null");<NEW_LINE>log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" + "ShutDown connection:" + "\npeersNodeAddress=" + peersNodeAddress + "\ncloseConnectionReason=" + closeConnectionReason + "\nuid=" + uid + "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");<NEW_LINE>if (closeConnectionReason.sendCloseMessage) {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>String reason = closeConnectionReason == CloseConnectionReason.RULE_VIOLATION ? getRuleViolation().name() : closeConnectionReason.name();<NEW_LINE><MASK><NEW_LINE>stopped = true;<NEW_LINE>Uninterruptibles.sleepUninterruptibly(200, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error(t.getMessage());<NEW_LINE>t.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>stopped = true;<NEW_LINE>UserThread.execute(() -> doShutDown(closeConnectionReason, shutDownCompleteHandler));<NEW_LINE>}<NEW_LINE>}, "Connection:SendCloseConnectionMessage-" + this.uid).start();<NEW_LINE>} else {<NEW_LINE>stopped = true;<NEW_LINE>doShutDown(closeConnectionReason, shutDownCompleteHandler);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO find out why we get called that<NEW_LINE>log.debug("stopped was already at shutDown call");<NEW_LINE>UserThread.execute(() -> doShutDown(closeConnectionReason, shutDownCompleteHandler));<NEW_LINE>}<NEW_LINE>} | sendMessage(new CloseConnectionMessage(reason)); |
1,042,765 | public IPSetForwardedIPConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>IPSetForwardedIPConfig iPSetForwardedIPConfig = new IPSetForwardedIPConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("HeaderName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSetForwardedIPConfig.setHeaderName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FallbackBehavior", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSetForwardedIPConfig.setFallbackBehavior(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Position", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSetForwardedIPConfig.setPosition(context.getUnmarshaller(String.<MASK><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 iPSetForwardedIPConfig;<NEW_LINE>} | class).unmarshall(context)); |
252,597 | private TypecheckingResult typecheckImplementation(ClassField field, Concrete.Expression implBody, ClassCallExpression fieldSetClass, boolean addImplicitLambdas) {<NEW_LINE>Expression type = fieldSetClass.getDefinition().getFieldType(field, fieldSetClass.getLevels(field.getParentClass()), new ReferenceExpression<MASK><NEW_LINE>// Expression type = FieldCallExpression.make(field, fieldSetClass.getLevels(), new ReferenceExpression(fieldSetClass.getThisBinding())).getType();<NEW_LINE>if (implBody instanceof Concrete.HoleExpression && field.getReferable().isParameterField() && !field.getReferable().isExplicitField() && field.isTypeClass() && type instanceof ClassCallExpression && !((ClassCallExpression) type).getDefinition().isRecord()) {<NEW_LINE>TypecheckingResult result;<NEW_LINE>ClassDefinition classDef = ((ClassCallExpression) type).getDefinition();<NEW_LINE>RecursiveInstanceHoleExpression holeExpr = implBody instanceof RecursiveInstanceHoleExpression ? (RecursiveInstanceHoleExpression) implBody : null;<NEW_LINE>if (classDef.getClassifyingField() == null) {<NEW_LINE>TypecheckingResult instance = myInstancePool.findInstance(null, type, new SubclassSearchParameters(classDef), implBody, holeExpr, myDefinition);<NEW_LINE>if (instance == null) {<NEW_LINE>ArgInferenceError error = new InstanceInferenceError(classDef.getReferable(), implBody, holeExpr, new Expression[0]);<NEW_LINE>errorReporter.report(error);<NEW_LINE>result = new TypecheckingResult(new ErrorExpression(error), type);<NEW_LINE>} else {<NEW_LINE>result = instance;<NEW_LINE>if (result.type == null) {<NEW_LINE>result.type = type;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = new TypecheckingResult(InferenceReferenceExpression.make(new TypeClassInferenceVariable(field.getName(), type, classDef, false, false, implBody, holeExpr, myDefinition, getAllBindings()), myEquations), type);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (field.isProperty()) {<NEW_LINE>setCaseLevel(implBody, -1);<NEW_LINE>}<NEW_LINE>if (addImplicitLambdas) {<NEW_LINE>implBody = addImplicitLamParams(implBody, type);<NEW_LINE>}<NEW_LINE>TypecheckingResult result = fieldSetClass.getDefinition().isGoodField(field) ? checkArgument(implBody, type, null, null) : checkExpr(implBody, type);<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result.type = type;<NEW_LINE>return result;<NEW_LINE>} | (fieldSetClass.getThisBinding())); |
1,392,259 | final ListCrossAccountAuthorizationsResult executeListCrossAccountAuthorizations(ListCrossAccountAuthorizationsRequest listCrossAccountAuthorizationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listCrossAccountAuthorizationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListCrossAccountAuthorizationsRequest> request = null;<NEW_LINE>Response<ListCrossAccountAuthorizationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListCrossAccountAuthorizationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCrossAccountAuthorizationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCrossAccountAuthorizations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListCrossAccountAuthorizationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCrossAccountAuthorizationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
394,585 | public void actionPerformed(final ActionEvent e) {<NEW_LINE>final IdeFocusManager fm = IdeFocusManager.findInstanceByContext(myContext);<NEW_LINE>final ActionCallback typeAhead = new ActionCallback();<NEW_LINE>final String id = ActionManager.getInstance().getId(myAction.getAction());<NEW_LINE>if (id != null) {<NEW_LINE>FeatureUsageTracker.getInstance().triggerFeatureUsed("context.menu.click.stats." + id.replace(' ', '.'));<NEW_LINE>}<NEW_LINE>fm.typeAheadUntil(typeAhead, getText());<NEW_LINE>fm.runOnOwnContext(myContext, () -> {<NEW_LINE>final AnActionEvent event = new AnActionEvent(new MouseEvent(ActionMenuItem.this, MouseEvent.MOUSE_PRESSED, 0, e.getModifiers(), getWidth() / 2, getHeight() / 2, 1, false), myContext, myPlace, myPresentation, ActionManager.getInstance(), e.<MASK><NEW_LINE>final AnAction menuItemAction = myAction.getAction();<NEW_LINE>if (ActionUtil.lastUpdateAndCheckDumb(menuItemAction, event, false)) {<NEW_LINE>ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();<NEW_LINE>actionManager.fireBeforeActionPerformed(menuItemAction, myContext, event);<NEW_LINE>fm.doWhenFocusSettlesDown(typeAhead::setDone);<NEW_LINE>ActionUtil.performActionDumbAware(menuItemAction, event);<NEW_LINE>actionManager.queueActionPerformedEvent(menuItemAction, myContext, event);<NEW_LINE>} else {<NEW_LINE>typeAhead.setDone();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getModifiers(), true, false); |
597,421 | private static boolean areArraysEquivalent(Object val1, Object val2, boolean shouldCompareCommonProps) {<NEW_LINE>if (val1 instanceof byte[]) {<NEW_LINE>return Arrays.equals((byte[]) val1, (byte[]) val2);<NEW_LINE>} else if (val1 instanceof short[]) {<NEW_LINE>return Arrays.equals((short[]) val1, (short[]) val2);<NEW_LINE>} else if (val1 instanceof char[]) {<NEW_LINE>return Arrays.equals((char[]) val1, (char[]) val2);<NEW_LINE>} else if (val1 instanceof int[]) {<NEW_LINE>return Arrays.equals((int[]) val1<MASK><NEW_LINE>} else if (val1 instanceof long[]) {<NEW_LINE>return Arrays.equals((long[]) val1, (long[]) val2);<NEW_LINE>} else if (val1 instanceof float[]) {<NEW_LINE>return Arrays.equals((float[]) val1, (float[]) val2);<NEW_LINE>} else if (val1 instanceof double[]) {<NEW_LINE>return Arrays.equals((double[]) val1, (double[]) val2);<NEW_LINE>} else if (val1 instanceof boolean[]) {<NEW_LINE>return Arrays.equals((boolean[]) val1, (boolean[]) val2);<NEW_LINE>} else {<NEW_LINE>final Object[] array1 = (Object[]) val1;<NEW_LINE>final Object[] array2 = (Object[]) val2;<NEW_LINE>if (array1.length != array2.length) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 0, size = array1.length; i < size; i++) {<NEW_LINE>if (!areObjectsEquivalent(array1[i], array2[i], shouldCompareCommonProps)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | , (int[]) val2); |
1,373,513 | private List<I_M_HU> generateLUTUHandlingUnitsForQtyToAllocate0(@NonNull final IAllocationRequest request) {<NEW_LINE>markNotConfigurable();<NEW_LINE>//<NEW_LINE>// Source: our line<NEW_LINE>final IAllocationSource source = createAllocationSource();<NEW_LINE>//<NEW_LINE>// Destination: our configured LU/TU Producer<NEW_LINE>final ILUTUProducerAllocationDestination destination = getLUTUProducerAllocationDestination();<NEW_LINE>//<NEW_LINE>// Execute transfer<NEW_LINE>final HULoader loader = HULoader.of(source, destination);<NEW_LINE>// Allow Partial Unloads (from source): no, we need to over allocated if required<NEW_LINE>loader.setAllowPartialUnloads(false);<NEW_LINE>// Allow Partial Loads (to destination): yes, because it could happen that we already have some pre-generated HUs (see "beforeLUTUProducerExecution" method)<NEW_LINE>// to Destination<NEW_LINE>loader.setAllowPartialLoads(true);<NEW_LINE>final IAllocationResult result = loader.load(request);<NEW_LINE>//<NEW_LINE>// Make sure everything was transferred<NEW_LINE>final boolean allowPartialResults = loader.isAllowPartialLoads<MASK><NEW_LINE>if (!allowPartialResults && !result.isCompleted()) {<NEW_LINE>final String errmsg = "Cannot create HU for " + this;<NEW_LINE>throw new AdempiereException(errmsg);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Get the newly created HUs<NEW_LINE>final List<I_M_HU> handlingUnits = destination.getCreatedHUs();<NEW_LINE>return handlingUnits;<NEW_LINE>} | () || loader.isAllowPartialUnloads(); |
1,607,610 | public boolean apply(final VariantContext vc) {<NEW_LINE>if (vc.getStart() == vc.getEnd()) {<NEW_LINE>// This isn't a multi-allelic segment, so it can only be produced by a single segment.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final Collection<VcfPathSegment> intersectingSegments = multiSegmentDetectorPerFile.get(sourceSegment.vcf()).getOverlaps(new Interval(vc.getContig(), vc.getStart(), vc.getEnd()));<NEW_LINE>if (intersectingSegments.size() < 2) {<NEW_LINE>// There's only one segment that produces this variant<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// The convention is: only emit the VC if it is produced from the first segment that can produce it in the list.<NEW_LINE>final int sourceSegmentIndex = segments.indexOf(sourceSegment);<NEW_LINE><MASK><NEW_LINE>for (final VcfPathSegment intersectingSegment : intersectingSegments) {<NEW_LINE>if (segments.indexOf(intersectingSegment) < sourceSegmentIndex) {<NEW_LINE>// There is a segment that produces this variant earlier in the segment list, exclude it.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug("Emitting wide variant because it belongs to first segment: ", vc);<NEW_LINE>return true;<NEW_LINE>} | LOG.debug("Found wide variant spanning multiple source segments: ", vc); |
1,436,063 | final DescribePackagesResult executeDescribePackages(DescribePackagesRequest describePackagesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePackagesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePackagesRequest> request = null;<NEW_LINE>Response<DescribePackagesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribePackagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePackagesRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePackages");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePackagesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePackagesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
406,936 | private // ////////////////<NEW_LINE>void onUDP(ProxyMessage msg) throws IOException {<NEW_LINE>if (msg.ip.getHostAddress().equals("0.0.0.0"))<NEW_LINE>msg<MASK><NEW_LINE>log("Creating UDP relay server for " + msg.ip + ":" + msg.port);<NEW_LINE>relayServer = new UDPRelayServer(msg.ip, msg.port, Thread.currentThread(), sock, auth);<NEW_LINE>ProxyMessage response;<NEW_LINE>response = new Socks5Message(Proxy.SOCKS_SUCCESS, relayServer.relayIP, relayServer.relayPort);<NEW_LINE>response.write(out);<NEW_LINE>relayServer.start();<NEW_LINE>// Make timeout infinit.<NEW_LINE>sock.setSoTimeout(0);<NEW_LINE>try {<NEW_LINE>while (in.read() >= 0) /* do nothing */<NEW_LINE>;<NEW_LINE>} catch (EOFException eofe) {<NEW_LINE>}<NEW_LINE>} | .ip = sock.getInetAddress(); |
110,160 | protected void configure() {<NEW_LINE>bind(ConfigurationService.class).asEagerSingleton();<NEW_LINE>bind(SidecarService.class).asEagerSingleton();<NEW_LINE>bind(CollectorService.class).asEagerSingleton();<NEW_LINE>bind(<MASK><NEW_LINE>install(new FactoryModuleBuilder().implement(AdministrationFilter.class, Names.named("collector"), CollectorAdministrationFilter.class).implement(AdministrationFilter.class, Names.named("configuration"), ConfigurationAdministrationFilter.class).implement(AdministrationFilter.class, Names.named("os"), OsAdministrationFilter.class).implement(AdministrationFilter.class, Names.named("status"), StatusAdministrationFilter.class).build(AdministrationFilter.Factory.class));<NEW_LINE>addSystemRestResource(ActionResource.class);<NEW_LINE>addSystemRestResource(AdministrationResource.class);<NEW_LINE>addSystemRestResource(CollectorResource.class);<NEW_LINE>addSystemRestResource(ConfigurationResource.class);<NEW_LINE>addSystemRestResource(ConfigurationVariableResource.class);<NEW_LINE>addSystemRestResource(SidecarResource.class);<NEW_LINE>addPermissions(SidecarRestPermissions.class);<NEW_LINE>addPeriodical(PurgeExpiredSidecarsThread.class);<NEW_LINE>addPeriodical(PurgeExpiredConfigurationUploads.class);<NEW_LINE>addAuditEventTypes(SidecarAuditEventTypes.class);<NEW_LINE>final Multibinder<Migration> binder = Multibinder.newSetBinder(binder(), Migration.class);<NEW_LINE>binder.addBinding().to(V20180212165000_AddDefaultCollectors.class);<NEW_LINE>binder.addBinding().to(V20180323150000_AddSidecarUser.class);<NEW_LINE>binder.addBinding().to(V20180601151500_AddDefaultConfiguration.class);<NEW_LINE>serviceBinder().addBinding().to(EtagService.class).in(Scopes.SINGLETON);<NEW_LINE>} | ConfigurationVariableService.class).asEagerSingleton(); |
403,348 | public void run(Metadata metaData) {<NEW_LINE>Table table = tableHandle.resolve(metaData);<NEW_LINE>try {<NEW_LINE>CreateTable cmd = spec.createCommandCreateTable(table.getName());<NEW_LINE>Collection<Column<MASK><NEW_LINE>List<TableColumn> pks = new LinkedList<TableColumn>();<NEW_LINE>for (Column column : columns) {<NEW_LINE>TableColumn col = connector.getColumnSpecification(table, column);<NEW_LINE>cmd.getColumns().add(col);<NEW_LINE>if (col.getObjectType().equals(TableColumn.PRIMARY_KEY)) {<NEW_LINE>pks.add(col);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pks.size() > 1) {<NEW_LINE>setPrimaryKeyColumns(pks, connector, cmd, table);<NEW_LINE>}<NEW_LINE>FileOutputStream fstream = new FileOutputStream(file);<NEW_LINE>ObjectOutputStream ostream = new ObjectOutputStream(fstream);<NEW_LINE>cmd.setSpecification(null);<NEW_LINE>ostream.writeObject(cmd);<NEW_LINE>ostream.flush();<NEW_LINE>ostream.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>array[0] = e;<NEW_LINE>}<NEW_LINE>} | > columns = table.getColumns(); |
562,756 | private String genConfig(String timerTrigger, String script, String authToken, String description) {<NEW_LINE>String scmTrigger = "* * * * *";<NEW_LINE>return "" + "<?xml version='1.1' encoding='UTF-8'?>\n" + "<flow-definition plugin=\"workflow-job@2.41\">\n" + " <actions>\n" + " <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction " + "plugin=\"pipeline-model-definition@1.8.5\"/>\n" + " <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction " + "plugin=\"pipeline-model-definition@1.8.5\">\n" + " <jobProperties/>\n" + " <triggers/>\n" + " <parameters/>\n" + " <options/>\n" + " </org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>\n" + " </actions>\n" + " <description>" + description + "</description>\n" + " <keepDependencies>false</keepDependencies>\n" + " <properties>\n" + " <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin=\"gitlab-plugin@1.5.20\">\n" + " <gitLabConnection></gitLabConnection>\n" + " <jobCredentialId></jobCredentialId>\n" + " <useAlternativeCredential>false</useAlternativeCredential>\n" + " </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>\n" + " <org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>\n" + " <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>\n" + " <triggers>\n" + " <hudson.triggers.TimerTrigger>\n" + " <spec>" + timerTrigger + "</spec>\n" + " </hudson.triggers.TimerTrigger>\n" + " <hudson.triggers.SCMTrigger>\n" + " <spec>" + scmTrigger + "</spec>\n" + " <ignorePostCommitHooks>false</ignorePostCommitHooks>\n" + " </hudson.triggers.SCMTrigger>\n" + " </triggers>\n" + " </org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>\n" + " </properties>\n" + " <definition class=\"org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition\" plugin=\"workflow-cps@2" + ".92\">\n" + " <script>" + script + "</script>\n" + " <sandbox>true</sandbox>\n" + " </definition>\n" + " <triggers/>\n" + " <authToken>" <MASK><NEW_LINE>} | + authToken + "</authToken>\n" + " <disabled>false</disabled>\n" + "</flow-definition>"; |
1,025,335 | private void mountInternal(RpcContext rpcContext, LockedInodePath inodePath, AlluxioURI ufsPath, MountContext context) throws InvalidPathException, FileAlreadyExistsException, FileDoesNotExistException, IOException, AccessControlException {<NEW_LINE>// Check that the Alluxio Path does not exist<NEW_LINE>if (inodePath.fullPathExists()) {<NEW_LINE>// TODO(calvin): Add a test to validate this (ALLUXIO-1831)<NEW_LINE>throw new InvalidPathException(ExceptionMessage.MOUNT_POINT_ALREADY_EXISTS.getMessage(inodePath.getUri()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>mountInternal(rpcContext, inodePath, ufsPath, mountId, context);<NEW_LINE>boolean loadMetadataSucceeded = false;<NEW_LINE>try {<NEW_LINE>// This will create the directory at alluxioPath<NEW_LINE>InodeSyncStream.loadDirectoryMetadata(rpcContext, inodePath, LoadMetadataContext.mergeFrom(LoadMetadataPOptions.newBuilder().setCreateAncestors(false)), mMountTable, this);<NEW_LINE>loadMetadataSucceeded = true;<NEW_LINE>} finally {<NEW_LINE>if (!loadMetadataSucceeded) {<NEW_LINE>mMountTable.delete(rpcContext, inodePath.getUri(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | long mountId = IdUtils.createMountId(); |
123,703 | private /*<NEW_LINE>* Fills the main list view with model names.<NEW_LINE>* Handles filling the ArrayLists and attaching<NEW_LINE>* ArrayAdapters to main ListView<NEW_LINE>*/<NEW_LINE>void fillModelList() {<NEW_LINE>// Anonymous class for handling list item clicks<NEW_LINE>mModelDisplayList = new ArrayList<>(mModels.size());<NEW_LINE>mModelIds = new ArrayList<>(mModels.size());<NEW_LINE>for (int i = 0; i < mModels.size(); i++) {<NEW_LINE>mModelIds.add(mModels.get(i).getLong("id"));<NEW_LINE>mModelDisplayList.add(new DisplayPair(mModels.get(i).getString("name"), <MASK><NEW_LINE>}<NEW_LINE>mModelDisplayAdapter = new DisplayPairAdapter(this, mModelDisplayList);<NEW_LINE>mModelListView.setAdapter(mModelDisplayAdapter);<NEW_LINE>mModelListView.setOnItemClickListener((parent, view, position, id) -> {<NEW_LINE>long noteTypeID = mModelIds.get(position);<NEW_LINE>mModelListPosition = position;<NEW_LINE>Intent noteOpenIntent = new Intent(ModelBrowser.this, ModelFieldEditor.class);<NEW_LINE>noteOpenIntent.putExtra("title", mModelDisplayList.get(position).getName());<NEW_LINE>noteOpenIntent.putExtra("noteTypeID", noteTypeID);<NEW_LINE>startActivityForResultWithAnimation(noteOpenIntent, 0, START);<NEW_LINE>});<NEW_LINE>mModelListView.setOnItemLongClickListener((parent, view, position, id) -> {<NEW_LINE>String cardName = mModelDisplayList.get(position).getName();<NEW_LINE>mCurrentID = mModelIds.get(position);<NEW_LINE>mModelListPosition = position;<NEW_LINE>mContextMenu = ModelBrowserContextMenu.newInstance(cardName, mContextMenuListener);<NEW_LINE>showDialogFragment(mContextMenu);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>updateSubtitleText();<NEW_LINE>} | mCardCounts.get(i))); |
910,760 | public int onUpdate(int type) {<NEW_LINE>if (type == Level.BLOCK_UPDATE_RANDOM) {<NEW_LINE>Block block = this.getLevel().getBlock(new Vector3(this.x, this.y, this.z));<NEW_LINE>if (block.up().getLightLevel() < 4) {<NEW_LINE>BlockSpreadEvent ev = new BlockSpreadEvent(block, this, new BlockDirt());<NEW_LINE>Server.getInstance().getPluginManager().callEvent(ev);<NEW_LINE>} else if (block.up().getLightLevel() >= 9) {<NEW_LINE>for (int l = 0; l < 4; ++l) {<NEW_LINE>NukkitRandom random = new NukkitRandom();<NEW_LINE>int x = random.nextRange((int) this.x - 1, (int) this.x + 1);<NEW_LINE>int y = random.nextRange((int) this.y - 2, (int) this.y + 2);<NEW_LINE>int z = random.nextRange((int) this.z - 1, (int) this.z + 1);<NEW_LINE>Block blocks = this.getLevel().getBlock(new Vector3(x, y, z));<NEW_LINE>if (blocks.getId() == Block.DIRT && blocks.getDamage() == 0x0F && blocks.up().getLightLevel() >= 4 && blocks.z <= 2) {<NEW_LINE>BlockSpreadEvent ev = new BlockSpreadEvent(blocks, this, new BlockGrass());<NEW_LINE>Server.getInstance().<MASK><NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>this.getLevel().setBlock(blocks, ev.getNewState());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | getPluginManager().callEvent(ev); |
1,675,228 | public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.CREATE);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>validateFields(form, v -> throwValidationError(v, this::asEditHtml));<NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>getDoc(form).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>entity.putAll(fessConfig.convertToStorableDoc(form.doc));<NEW_LINE>final String newId = ComponentUtil.<MASK><NEW_LINE>entity.put(fessConfig.getIndexFieldId(), newId);<NEW_LINE>final String index = fessConfig.getIndexDocumentUpdateIndex();<NEW_LINE>searchEngineClient.store(index, entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed to add {}", entity, e);<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), this::asEditHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>} | getCrawlingInfoHelper().generateId(entity); |
61,646 | private void generateCharacterEncodingRangeCheck(final StringBuilder sb, final String varName, final Token token) {<NEW_LINE>final String characterEncoding = token.encoding().characterEncoding();<NEW_LINE>if (null != characterEncoding) {<NEW_LINE>if (JavaUtil.isAsciiEncoding(characterEncoding)) {<NEW_LINE>imports.peek().add("fmt");<NEW_LINE>sb.append(String.format("\tfor idx, ch := range %1$s {\n" + "\t\tif ch > 127 {\n" + "\t\t\treturn fmt.Errorf(\"%1$s[%%d]=%%d" + " failed ASCII validation\", idx, ch)\n" <MASK><NEW_LINE>} else if (JavaUtil.isUtf8Encoding(characterEncoding)) {<NEW_LINE>imports.peek().add("errors");<NEW_LINE>imports.peek().add("unicode/utf8");<NEW_LINE>sb.append(String.format("\tif !utf8.Valid(%1$s[:]) {\n" + "\t\treturn errors.New(\"%1$s failed UTF-8 validation\")\n" + "\t}\n", varName));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported encoding: " + characterEncoding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + "\t\t}\n" + "\t}\n", varName)); |
631,939 | public static byte[] marshalWithLenientRetry(EppOutput eppOutput) {<NEW_LINE>checkState(eppOutput != null);<NEW_LINE>// We need to marshal to a string instead of writing the response directly to the servlet's<NEW_LINE>// response writer, so that partial results don't get written on failure.<NEW_LINE>try {<NEW_LINE>return EppXmlTransformer.marshal(eppOutput, STRICT);<NEW_LINE>} catch (XmlException e) {<NEW_LINE>// We failed to marshal with validation. This is very bad, but we can potentially still send<NEW_LINE>// back slightly invalid xml, so try again without validation.<NEW_LINE>try {<NEW_LINE>byte[] lenient = EppXmlTransformer.marshal(eppOutput, LENIENT);<NEW_LINE>// Marshaling worked even though the results didn't validate against the schema.<NEW_LINE>logger.atSevere().withCause(e).log("Result marshaled but did not validate: %s", <MASK><NEW_LINE>return lenient;<NEW_LINE>} catch (XmlException e2) {<NEW_LINE>// Failing to marshal at all is not recoverable.<NEW_LINE>throw new RuntimeException(e2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new String(lenient, UTF_8)); |
188,151 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol as mySymbol from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by mySymbol";<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE><MASK><NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>orderValuesBySymbol(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol as mySymbol, price as myPrice from " + "SupportMarketDataBean#length(5) " + "output every 6 events " + "order by myPrice";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "mySymbol");<NEW_LINE>assertValues(env, spv.prices, "myPrice");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "mySymbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol, price as myPrice from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (myPrice * 6) + 5, price";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myPrice" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>epl = "@name('s0') select symbol, 1+volume*23 as myVol from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by (price * 6) + 5, price, myVol";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>orderValuesByPrice(spv);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol", "myVol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>} | createAndSend(env, epl, milestone); |
1,774,413 | final CreateSecurityGroupResult executeCreateSecurityGroup(CreateSecurityGroupRequest createSecurityGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSecurityGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSecurityGroupRequest> request = null;<NEW_LINE>Response<CreateSecurityGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSecurityGroupRequestMarshaller().marshall(super.beforeMarshalling(createSecurityGroupRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSecurityGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateSecurityGroupResult> responseHandler = new StaxResponseHandler<CreateSecurityGroupResult>(new CreateSecurityGroupResultStaxUnmarshaller());<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()); |
363,581 | private static void encounter(List<String> textRecord, Encounter encounter) {<NEW_LINE>String encounterTime = dateFromTimestamp(encounter.start);<NEW_LINE>String clinician = "";<NEW_LINE>if (encounter.clinician != null) {<NEW_LINE>clinician = " (" + encounter.clinician.attributes.get(Clinician.NAME_PREFIX) + " " + encounter.clinician.attributes.<MASK><NEW_LINE>}<NEW_LINE>if (encounter.reason == null && encounter.provider == null) {<NEW_LINE>textRecord.add(encounterTime + clinician + " : " + encounter.codes.get(0).display);<NEW_LINE>} else if (encounter.reason == null && encounter.provider != null) {<NEW_LINE>textRecord.add(encounterTime + clinician + " : Encounter at " + encounter.provider.name);<NEW_LINE>} else if (encounter.reason != null && encounter.provider == null) {<NEW_LINE>textRecord.add(encounterTime + clinician + " : Encounter for " + encounter.reason.display);<NEW_LINE>} else {<NEW_LINE>textRecord.add(encounterTime + clinician + " : Encounter at " + encounter.provider.name + " : Encounter for " + encounter.reason.display);<NEW_LINE>}<NEW_LINE>} | get(Clinician.NAME) + ")"; |
818,094 | public static void main(String[] args) {<NEW_LINE>final ConfigBuilder configBuilder = new ConfigBuilder();<NEW_LINE>if (args.length > 0) {<NEW_LINE>configBuilder.withMasterUrl(args[0]);<NEW_LINE>}<NEW_LINE>try (OpenShiftClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build().adapt(OpenShiftClient.class)) {<NEW_LINE>VersionInfo openShiftVersionInfo = client.getVersion();<NEW_LINE>logger.info("Version details of this OpenShift cluster :-");<NEW_LINE>logger.info("Major : {}", openShiftVersionInfo.getMajor());<NEW_LINE>logger.info("Minor : {}", openShiftVersionInfo.getMinor());<NEW_LINE>logger.info("GitVersion : {}", openShiftVersionInfo.getGitVersion());<NEW_LINE>logger.info("BuildDate : {}", openShiftVersionInfo.getBuildDate());<NEW_LINE>logger.info("GitTreeState : {}", openShiftVersionInfo.getGitTreeState());<NEW_LINE>logger.info("Platform : {}", openShiftVersionInfo.getPlatform());<NEW_LINE>logger.info(<MASK><NEW_LINE>logger.info("GoVersion : {}", openShiftVersionInfo.getGoVersion());<NEW_LINE>logger.info("GitCommit : {}", openShiftVersionInfo.getGitCommit());<NEW_LINE>}<NEW_LINE>} | "GitVersion : {}", openShiftVersionInfo.getGitVersion()); |
997,766 | private static ArrowType parseComplexFormat(String format, String payload) throws NumberFormatException, UnsupportedOperationException, IllegalStateException {<NEW_LINE>switch(format) {<NEW_LINE>case "d":<NEW_LINE>{<NEW_LINE>int[] parts = payloadToIntArray(payload);<NEW_LINE>Preconditions.checkState(parts.length == 2 || parts.length == 3, "Format %s:%s is illegal", format, payload);<NEW_LINE>int precision = parts[0];<NEW_LINE>int scale = parts[1];<NEW_LINE>Integer bitWidth = (parts.length == 3) ? parts[2] : null;<NEW_LINE>return ArrowType.Decimal.createDecimal(precision, scale, bitWidth);<NEW_LINE>}<NEW_LINE>case "w":<NEW_LINE>return new ArrowType.FixedSizeBinary<MASK><NEW_LINE>case "+w":<NEW_LINE>return new ArrowType.FixedSizeList(Integer.parseInt(payload));<NEW_LINE>case "+ud":<NEW_LINE>return new ArrowType.Union(UnionMode.Dense, payloadToIntArray(payload));<NEW_LINE>case "+us":<NEW_LINE>return new ArrowType.Union(UnionMode.Sparse, payloadToIntArray(payload));<NEW_LINE>case "tss":<NEW_LINE>return new ArrowType.Timestamp(TimeUnit.SECOND, payloadToTimezone(payload));<NEW_LINE>case "tsm":<NEW_LINE>return new ArrowType.Timestamp(TimeUnit.MILLISECOND, payloadToTimezone(payload));<NEW_LINE>case "tsu":<NEW_LINE>return new ArrowType.Timestamp(TimeUnit.MICROSECOND, payloadToTimezone(payload));<NEW_LINE>case "tsn":<NEW_LINE>return new ArrowType.Timestamp(TimeUnit.NANOSECOND, payloadToTimezone(payload));<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException(String.format("Format %s:%s is not supported", format, payload));<NEW_LINE>}<NEW_LINE>} | (Integer.parseInt(payload)); |
1,419,364 | public void endTessellation() {<NEW_LINE>if (root.tessUpdate) {<NEW_LINE>if (root.tessKind == TRIANGLES && hasPolys) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyVertex.glId);<NEW_LINE>tessGeo.finalPolyVerticesBuffer(firstModifiedPolyVertex, lastModifiedPolyVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyColor.glId);<NEW_LINE>tessGeo.finalPolyColorsBuffer(firstModifiedPolyColor, lastModifiedPolyColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyNormal.glId);<NEW_LINE>tessGeo.finalPolyNormalsBuffer(firstModifiedPolyNormal, lastModifiedPolyNormal);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyTexCoord.glId);<NEW_LINE>tessGeo.finalPolyTexCoordsBuffer(firstModifiedPolyTexCoord, lastModifiedPolyTexCoord);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyAmbient.glId);<NEW_LINE>tessGeo.finalPolyAmbientBuffer(firstModifiedPolyAmbient, lastModifiedPolyAmbient);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolySpecular.glId);<NEW_LINE><MASK><NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyEmissive.glId);<NEW_LINE>tessGeo.finalPolyEmissiveBuffer(firstModifiedPolyEmissive, lastModifiedPolyEmissive);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyShininess.glId);<NEW_LINE>tessGeo.finalPolyShininessBuffer(firstModifiedPolyShininess, lastModifiedPolyShininess);<NEW_LINE>for (String name : polyAttribs.keySet()) {<NEW_LINE>VertexAttribute attrib = polyAttribs.get(name);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, attrib.buf.glId);<NEW_LINE>tessGeo.finalPolyAttribsBuffer(attrib, attrib.firstModified, attrib.lastModified);<NEW_LINE>}<NEW_LINE>} else if (root.tessKind == LINES && hasLines) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineVertex.glId);<NEW_LINE>tessGeo.finalLineVerticesBuffer(firstModifiedLineVertex, lastModifiedLineVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineColor.glId);<NEW_LINE>tessGeo.finalLineColorsBuffer(firstModifiedLineColor, lastModifiedLineColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineAttrib.glId);<NEW_LINE>tessGeo.finalLineDirectionsBuffer(firstModifiedLineAttribute, lastModifiedLineAttribute);<NEW_LINE>} else if (root.tessKind == POINTS && hasPoints) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointVertex.glId);<NEW_LINE>tessGeo.finalPointVerticesBuffer(firstModifiedPointVertex, lastModifiedPointVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointColor.glId);<NEW_LINE>tessGeo.finalPointColorsBuffer(firstModifiedPointColor, lastModifiedPointColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointAttrib.glId);<NEW_LINE>tessGeo.finalPointOffsetsBuffer(firstModifiedPointAttribute, lastModifiedPointAttribute);<NEW_LINE>}<NEW_LINE>root.selVertices = null;<NEW_LINE>root.tessUpdate = false;<NEW_LINE>// To avoid triggering a new tessellation in the draw method.<NEW_LINE>root.modified = false;<NEW_LINE>}<NEW_LINE>} | tessGeo.finalPolySpecularBuffer(firstModifiedPolySpecular, lastModifiedPolySpecular); |
1,438,154 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('typea') @public create schema TypeA()", path);<NEW_LINE>env.compileDeploy("@name('typeb') @public create schema TypeB()", path);<NEW_LINE>env.compileDeploy("@name('typec') @public create schema TypeC(a TypeA, b TypeB)", path);<NEW_LINE>env.compileDeploy("@name('typed') @public create schema TypeD(c TypeC)", path);<NEW_LINE>env.compileDeploy("@name('typee') @public create schema TypeE(c TypeC)", path);<NEW_LINE>String <MASK><NEW_LINE>String b = env.deploymentId("typeb");<NEW_LINE>String c = env.deploymentId("typec");<NEW_LINE>String d = env.deploymentId("typed");<NEW_LINE>String e = env.deploymentId("typee");<NEW_LINE>assertProvided(env, a, makeProvided(EPObjectType.EVENTTYPE, "TypeA", c));<NEW_LINE>assertConsumed(env, a);<NEW_LINE>assertProvided(env, b, makeProvided(EPObjectType.EVENTTYPE, "TypeB", c));<NEW_LINE>assertConsumed(env, b);<NEW_LINE>assertProvided(env, c, makeProvided(EPObjectType.EVENTTYPE, "TypeC", d, e));<NEW_LINE>assertConsumed(env, c, new EPDeploymentDependencyConsumed.Item(a, EPObjectType.EVENTTYPE, "TypeA"), new EPDeploymentDependencyConsumed.Item(b, EPObjectType.EVENTTYPE, "TypeB"));<NEW_LINE>assertProvided(env, d);<NEW_LINE>assertConsumed(env, d, new EPDeploymentDependencyConsumed.Item(c, EPObjectType.EVENTTYPE, "TypeC"));<NEW_LINE>assertProvided(env, e);<NEW_LINE>assertConsumed(env, e, new EPDeploymentDependencyConsumed.Item(c, EPObjectType.EVENTTYPE, "TypeC"));<NEW_LINE>env.undeployAll();<NEW_LINE>} | a = env.deploymentId("typea"); |
246,270 | protected PropertyMetadata toProperty(CompiledPropertyMetadata compiledProperty, LocalizedMessageProvider messageProvider) {<NEW_LINE>StandardPropertyMetadata property = new StandardPropertyMetadata();<NEW_LINE>String name = compiledProperty.getName();<NEW_LINE>property.setName(name);<NEW_LINE>property.<MASK><NEW_LINE>property.setConstantDeclarationClass(compiledProperty.getConstantDeclarationClass());<NEW_LINE>property.setConstantFieldName(compiledProperty.getConstantFieldName());<NEW_LINE>property.setLabel(messageProvider.getMessage(PropertyMetadataConstants.PROPERTY_LABEL_PREFIX + name));<NEW_LINE>property.setDescription(messageProvider.getMessage(PropertyMetadataConstants.PROPERTY_DESCRIPTION_PREFIX + name));<NEW_LINE>property.setDefaultValue(compiledProperty.getDefaultValue());<NEW_LINE>// TODO lucianc copy?<NEW_LINE>property.setScopes(compiledProperty.getScopes());<NEW_LINE>// TODO lucianc copy?<NEW_LINE>property.setScopeQualifications(compiledProperty.getScopeQualifications());<NEW_LINE>property.setSinceVersion(compiledProperty.getSinceVersion());<NEW_LINE>property.setValueType(compiledProperty.getValueType());<NEW_LINE>property.setDeprecated(compiledProperty.isDeprecated());<NEW_LINE>return property;<NEW_LINE>} | setCategory(compiledProperty.getCategory()); |
475,166 | public static CodegenExpression codegen(ExprRelationalOpNodeForge forge, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {<NEW_LINE>ExprForge lhs = forge.getForgeRenderable().getChildNodes()[0].getForge();<NEW_LINE>ExprForge rhs = forge.getForgeRenderable().getChildNodes()[1].getForge();<NEW_LINE><MASK><NEW_LINE>if (lhsType == null || lhsType == EPTypeNull.INSTANCE) {<NEW_LINE>return constantNull();<NEW_LINE>}<NEW_LINE>EPType rhsType = rhs.getEvaluationType();<NEW_LINE>if (rhsType == null || rhsType == EPTypeNull.INSTANCE) {<NEW_LINE>return constantNull();<NEW_LINE>}<NEW_LINE>EPTypeClass lhsTypeClass = (EPTypeClass) lhsType;<NEW_LINE>EPTypeClass rhsTypeClass = (EPTypeClass) rhsType;<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChild(EPTypePremade.BOOLEANBOXED.getEPType(), ExprRelationalOpNodeForgeEval.class, codegenClassScope);<NEW_LINE>CodegenBlock block = methodNode.getBlock().declareVar(lhsTypeClass, "left", lhs.evaluateCodegen(lhsTypeClass, methodNode, exprSymbol, codegenClassScope));<NEW_LINE>if (!lhsTypeClass.getType().isPrimitive()) {<NEW_LINE>block.ifRefNullReturnNull("left");<NEW_LINE>}<NEW_LINE>block.declareVar(rhsTypeClass, "right", rhs.evaluateCodegen(rhsTypeClass, methodNode, exprSymbol, codegenClassScope));<NEW_LINE>if (!rhsTypeClass.getType().isPrimitive()) {<NEW_LINE>block.ifRefNullReturnNull("right");<NEW_LINE>}<NEW_LINE>block.methodReturn(forge.getComputer().codegen(ref("left"), lhsTypeClass, ref("right"), rhsTypeClass));<NEW_LINE>return localMethod(methodNode);<NEW_LINE>} | EPType lhsType = lhs.getEvaluationType(); |
1,028,304 | /*<NEW_LINE>* Download an image from a HTTP URL.<NEW_LINE>*<NEW_LINE>* @param String HTTP URL to download from.<NEW_LINE>* @param String The filename to save the remote image as.<NEW_LINE>* @return String Returns 'true' or 'false'. As Rhino does not like boolean, this is a String.<NEW_LINE>*/<NEW_LINE>public static String downloadHTTPTo(String urlString, String location) {<NEW_LINE>try {<NEW_LINE>URL url = new URL(urlString);<NEW_LINE>ByteArrayOutputStream outputStream;<NEW_LINE>try (InputStream inputStream = new BufferedInputStream(url.openStream())) {<NEW_LINE>outputStream = new ByteArrayOutputStream();<NEW_LINE>byte[] buffer = new byte[1024];<NEW_LINE>int n = 0;<NEW_LINE>while ((n = inputStream.read(buffer)) != -1) {<NEW_LINE>outputStream.<MASK><NEW_LINE>}<NEW_LINE>outputStream.close();<NEW_LINE>}<NEW_LINE>byte[] imgData = outputStream.toByteArray();<NEW_LINE>if (!new File(location.substring(0, location.lastIndexOf("/"))).exists()) {<NEW_LINE>new File(location.substring(0, location.lastIndexOf("/"))).mkdirs();<NEW_LINE>}<NEW_LINE>try (FileOutputStream fileOutputStream = new FileOutputStream(location)) {<NEW_LINE>fileOutputStream.write(imgData);<NEW_LINE>}<NEW_LINE>return new String("true");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>com.gmt2001.Console.debug.println("ImgDownload::downloadHTTP(" + urlString + ", " + location + ") failed: " + ex.getMessage());<NEW_LINE>return new String("false");<NEW_LINE>}<NEW_LINE>} | write(buffer, 0, n); |
1,075,025 | public void onRestored(Context context, int[] oldWidgetIds, int[] newWidgetIds) {<NEW_LINE>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);<NEW_LINE>SharedPreferences.Editor editor = prefs.edit();<NEW_LINE>for (int i = 0; i < oldWidgetIds.length; ++i) {<NEW_LINE>String oldKey = getUserIdPreferenceName(oldWidgetIds[i]);<NEW_LINE>if (prefs.contains(oldKey)) {<NEW_LINE>editor.putInt(getUserIdPreferenceName(newWidgetIds[i]), prefs.<MASK><NEW_LINE>editor.remove(oldKey);<NEW_LINE>}<NEW_LINE>oldKey = getMeasurementPreferenceName(oldWidgetIds[i]);<NEW_LINE>if (prefs.contains(oldKey)) {<NEW_LINE>editor.putString(getMeasurementPreferenceName(newWidgetIds[i]), prefs.getString(oldKey, ""));<NEW_LINE>editor.remove(oldKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>editor.apply();<NEW_LINE>} | getInt(oldKey, -1)); |
982,788 | final GetChangeTokenStatusResult executeGetChangeTokenStatus(GetChangeTokenStatusRequest getChangeTokenStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getChangeTokenStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetChangeTokenStatusRequest> request = null;<NEW_LINE>Response<GetChangeTokenStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetChangeTokenStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getChangeTokenStatusRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetChangeTokenStatus");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetChangeTokenStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetChangeTokenStatusResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
557,795 | public void buttonPressed() {<NEW_LINE>MapActivity activity = getMapActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>AlertDialog.Builder bld <MASK><NEW_LINE>bld.setMessage(R.string.recording_delete_confirm);<NEW_LINE>bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>MapActivity a = getMapActivity();<NEW_LINE>if (plugin != null && a != null) {<NEW_LINE>boolean deleted = false;<NEW_LINE>OsmPoint point = getOsmPoint();<NEW_LINE>if (point instanceof OsmNotesPoint) {<NEW_LINE>deleted = plugin.getDBBug().deleteAllBugModifications((OsmNotesPoint) point);<NEW_LINE>} else if (point instanceof OpenstreetmapPoint) {<NEW_LINE>deleted = plugin.getDBPOI().deletePOI((OpenstreetmapPoint) point);<NEW_LINE>}<NEW_LINE>if (deleted) {<NEW_LINE>a.getContextMenu().close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bld.setNegativeButton(R.string.shared_string_no, null);<NEW_LINE>bld.show();<NEW_LINE>}<NEW_LINE>} | = new AlertDialog.Builder(activity); |
525,070 | private String doGenerate() {<NEW_LINE>Map<ClassDeclaration, Set<String>> planClassMap = parentClassMap.entrySet().stream().filter(kv -> kv.getValue().contains("org.apache.doris.nereids.trees.plans.Plan")).filter(kv -> !kv.getKey().name.equals("GroupPlan")).filter(kv -> !Modifier.isAbstract(kv.getKey().modifiers.mod) && kv.getKey() instanceof ClassDeclaration).collect(Collectors.toMap(kv -> (ClassDeclaration) kv.getKey(), kv -> kv.getValue()));<NEW_LINE>List<PatternGenerator> generators = planClassMap.entrySet().stream().map(kv -> PatternGenerator.create(this, kv.getKey(), kv.getValue())).filter(Optional::isPresent).map(Optional::get).sorted((g1, g2) -> {<NEW_LINE>// logical first<NEW_LINE>if (g1.isLogical() != g2.isLogical()) {<NEW_LINE>return g1.<MASK><NEW_LINE>}<NEW_LINE>// leaf first<NEW_LINE>if (g1.childrenNum() != g2.childrenNum()) {<NEW_LINE>return g1.childrenNum() - g2.childrenNum();<NEW_LINE>}<NEW_LINE>// string dict sort<NEW_LINE>return g1.opType.name.compareTo(g2.opType.name);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return PatternGenerator.generateCode(generators, this);<NEW_LINE>} | isLogical() ? -1 : 1; |
1,569,352 | protected void printSegmentAssignment(Map<String, Map<String, String>> mapping) throws Exception {<NEW_LINE>LOGGER.info(JsonUtils.objectToPrettyString(mapping));<NEW_LINE>Map<String, List<String>> serverToSegmentMapping = new TreeMap<>();<NEW_LINE>for (String segment : mapping.keySet()) {<NEW_LINE>Map<String, String> serverToStateMap = mapping.get(segment);<NEW_LINE>for (String server : serverToStateMap.keySet()) {<NEW_LINE>if (!serverToSegmentMapping.containsKey(server)) {<NEW_LINE>serverToSegmentMapping.put(server, new ArrayList<>());<NEW_LINE>}<NEW_LINE>serverToSegmentMapping.get(server).add(segment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DescriptiveStatistics stats = new DescriptiveStatistics();<NEW_LINE>for (String server : serverToSegmentMapping.keySet()) {<NEW_LINE>List<String> <MASK><NEW_LINE>LOGGER.info("server " + server + " has " + list.size() + " segments");<NEW_LINE>stats.addValue(list.size());<NEW_LINE>}<NEW_LINE>LOGGER.info("Segment Distrbution stat");<NEW_LINE>LOGGER.info(stats.toString());<NEW_LINE>} | list = serverToSegmentMapping.get(server); |
570,769 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.skill_reusable__intent_fragment_extra_item, container, false);<NEW_LINE>editText_key = view.findViewById(R.id.editText_key);<NEW_LINE>editText_value = view.findViewById(R.id.editText_value);<NEW_LINE>spinner_type = view.findViewById(R.id.spinner_type);<NEW_LINE>if (item != null) {<NEW_LINE>editText_key.setText(item.key);<NEW_LINE><MASK><NEW_LINE>String[] types = getResources().getStringArray(R.array.extra_type);<NEW_LINE>for (int i = 0; i < types.length; i++) {<NEW_LINE>if (types[i].equals(item.type)) {<NEW_LINE>spinner_type.setSelection(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>} | editText_value.setText(item.value); |
1,823,046 | public MarkedObject[] queryRange(J9ObjectPointer base, J9ObjectPointer top) throws CorruptDataException {<NEW_LINE>ArrayList<MarkedObject> results = new ArrayList<MarkedObject>();<NEW_LINE>if (base.lt(_heapBase)) {<NEW_LINE>base = J9ObjectPointer.cast(_heapBase);<NEW_LINE>}<NEW_LINE>if (top.gt(_heapTop)) {<NEW_LINE>top = J9ObjectPointer.cast(_heapTop);<NEW_LINE>}<NEW_LINE>if (base.gt(top)) {<NEW_LINE>base = top;<NEW_LINE>}<NEW_LINE>J9ObjectPointer cursor = base;<NEW_LINE>while (cursor.lt(top)) {<NEW_LINE>UDATA heapBaseOffset = UDATA.cast(cursor).sub(UDATA.cast(_heapBase));<NEW_LINE>// pairs of UDATA, so *2<NEW_LINE>UDATA pageIndex = heapBaseOffset.div(MM_CompactScheme.sizeof_page).mult(2);<NEW_LINE>UDATA <MASK><NEW_LINE>UDATA compactTableEntry_bits = _heapMapBits.at(pageIndex.add(1));<NEW_LINE>// Horribly inefficient -- recomputing relocations every single time!<NEW_LINE>if (compactTableEntry_addr.allBitsIn(3)) {<NEW_LINE>// Object has been compacted -- assuming that the pointer was the pre-compacted one<NEW_LINE>J9ObjectPointer newObject = J9ObjectPointer.cast(compactTableEntry_addr.bitAnd(~3));<NEW_LINE>UDATA bits = compactTableEntry_bits;<NEW_LINE>UDATA offset = heapBaseOffset.mod(MM_CompactScheme.sizeof_page).div(2 * MM_HeapMap.J9MODRON_HEAP_SLOTS_PER_HEAPMAP_BIT * UDATA.SIZEOF);<NEW_LINE>UDATA bitMask = new UDATA(1).leftShift(offset);<NEW_LINE>if (bits.bitAnd(bitMask).eq(bitMask)) {<NEW_LINE>long mask = 1;<NEW_LINE>int ordinal = 0;<NEW_LINE>for (int i = offset.intValue(); i > 0; i--) {<NEW_LINE>if (bits.allBitsIn(mask)) {<NEW_LINE>ordinal += 1;<NEW_LINE>}<NEW_LINE>mask <<= 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < ordinal; i++) {<NEW_LINE>UDATA objectSize = ObjectModel.getConsumedSizeInBytesWithHeader(newObject);<NEW_LINE>newObject = newObject.addOffset(objectSize);<NEW_LINE>}<NEW_LINE>results.add(new MarkedObject(cursor, _heapMapBits.add(pageIndex), newObject));<NEW_LINE>}<NEW_LINE>cursor = cursor.addOffset(getObjectGrain() * 2);<NEW_LINE>} else { | compactTableEntry_addr = _heapMapBits.at(pageIndex); |
44,091 | final ListFargateProfilesResult executeListFargateProfiles(ListFargateProfilesRequest listFargateProfilesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFargateProfilesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListFargateProfilesRequest> request = null;<NEW_LINE>Response<ListFargateProfilesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFargateProfilesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFargateProfilesRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFargateProfiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFargateProfilesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFargateProfilesResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
667,029 | static void rtAssertEquals(final float[] a, final float[] b, final float eps) {<NEW_LINE>if ((a == null) && (b == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((a != null) && (b != null)) {<NEW_LINE>final int alen = a.length;<NEW_LINE>if (alen != b.length) {<NEW_LINE>error("Array lengths not equal: " + a.length + ", " + b.length);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < alen; i++) {<NEW_LINE>if (Math.abs(a[i] - b[i]) > eps) {<NEW_LINE>error("abs(" + a[i] + " - " + b<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>error("Array " + ((a == null) ? "a" : "b") + " is null");<NEW_LINE>}<NEW_LINE>} | [i] + ") > " + eps); |
1,734,213 | final UpdateJobStatusResult executeUpdateJobStatus(UpdateJobStatusRequest updateJobStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateJobStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateJobStatusRequest> request = null;<NEW_LINE>Response<UpdateJobStatusResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateJobStatusRequestMarshaller().marshall(super.beforeMarshalling(updateJobStatusRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateJobStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>ValidationUtils.assertStringNotEmpty(updateJobStatusRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(updateJobStatusRequest.getAccountId(), "AccountId", "updateJobStatusRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", updateJobStatusRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateJobStatusResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<UpdateJobStatusResult>(new UpdateJobStatusResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,230,769 | final CreateWebACLMigrationStackResult executeCreateWebACLMigrationStack(CreateWebACLMigrationStackRequest createWebACLMigrationStackRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createWebACLMigrationStackRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateWebACLMigrationStackRequest> request = null;<NEW_LINE>Response<CreateWebACLMigrationStackResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateWebACLMigrationStackRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createWebACLMigrationStackRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateWebACLMigrationStack");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateWebACLMigrationStackResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateWebACLMigrationStackResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,485,256 | // @see SWTSkinObjectBasic#paintControl(org.eclipse.swt.graphics.GC)<NEW_LINE>@Override<NEW_LINE>public void paintControl(GC gc) {<NEW_LINE>super.paintControl(gc);<NEW_LINE>int fullWidth = maxSize.x == 0 || imageFGbounds == null ? canvas.getClientArea().width : imageFGbounds.width;<NEW_LINE>if (percent > 0 && imageFG != null) {<NEW_LINE>int xDrawTo = (int) (fullWidth * percent);<NEW_LINE>int xDrawToSrc = xDrawTo > imageFGbounds.width ? imageFGbounds.width : xDrawTo;<NEW_LINE>int y = (maxSize.y - imageFGbounds.height) / 2;<NEW_LINE>gc.drawImage(imageFG, 0, 0, xDrawToSrc, imageFGbounds.height, 0, y, xDrawTo, imageFGbounds.height);<NEW_LINE>}<NEW_LINE>if (percent < 100 && imageBG != null && imageFGbounds != null) {<NEW_LINE>int xDrawFrom = (int) (imageBGbounds.width * percent);<NEW_LINE>int xDrawWidth = imageBGbounds.width - xDrawFrom;<NEW_LINE>gc.drawImage(imageBG, xDrawFrom, 0, xDrawWidth, imageFGbounds.height, xDrawFrom, 0, xDrawWidth, imageFGbounds.height);<NEW_LINE>}<NEW_LINE>int drawWidth = fullWidth - imageThumbBounds.width;<NEW_LINE>int xThumbPos = (int) ((mouseDown && !mouseMoveAdjusts ? draggingPercent : percent) * drawWidth);<NEW_LINE>gc.<MASK><NEW_LINE>} | drawImage(imageThumb, xThumbPos, 0); |
572,226 | public static void launchQuPath(HostServices hostServices, boolean isSwing) {<NEW_LINE>QuPathGUI instance = getInstance();<NEW_LINE>if (instance != null) {<NEW_LINE>logger.info("Request to launch QuPath - will try to show existing instance instead");<NEW_LINE>if (Platform.isFxApplicationThread())<NEW_LINE>instance<MASK><NEW_LINE>else {<NEW_LINE>Platform.runLater(() -> instance.getStage().show());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Platform.isFxApplicationThread()) {<NEW_LINE>System.out.println("Launching new QuPath instance...");<NEW_LINE>logger.info("Launching new QuPath instance...");<NEW_LINE>Stage stage = new Stage();<NEW_LINE>QuPathGUI qupath = new QuPathGUI(hostServices, stage, (String) null, false, false);<NEW_LINE>qupath.getStage().show();<NEW_LINE>System.out.println("Done!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("QuPath launch requested in " + Thread.currentThread());<NEW_LINE>if (isSwing) {<NEW_LINE>// If we are starting from a Swing application, try to ensure we are on the correct thread<NEW_LINE>// (This can be particularly important on macOS)<NEW_LINE>if (SwingUtilities.isEventDispatchThread()) {<NEW_LINE>System.out.println("Initializing with JFXPanel...");<NEW_LINE>// To initialize<NEW_LINE>new JFXPanel();<NEW_LINE>Platform.runLater(() -> launchQuPath(hostServices, true));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>SwingUtilities.invokeLater(() -> launchQuPath(hostServices, true));<NEW_LINE>// Required to be able to restart QuPath... or probably any JavaFX application<NEW_LINE>Platform.setImplicitExit(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>// This will fail if already started... but unfortunately there is no method to query if this is the case<NEW_LINE>System.out.println("Calling Platform.startup()...");<NEW_LINE>Platform.startup(() -> launchQuPath(hostServices, false));<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("If JavaFX is initialized, be sure to call launchQuPath() on the Application thread!");<NEW_LINE>System.out.println("Calling Platform.runLater()...");<NEW_LINE>Platform.runLater(() -> launchQuPath(hostServices, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getStage().show(); |
515,713 | public AggregateComplianceByConfigRule unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AggregateComplianceByConfigRule aggregateComplianceByConfigRule = new AggregateComplianceByConfigRule();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ConfigRuleName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregateComplianceByConfigRule.setConfigRuleName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Compliance", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregateComplianceByConfigRule.setCompliance(ComplianceJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("AccountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregateComplianceByConfigRule.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AwsRegion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>aggregateComplianceByConfigRule.setAwsRegion(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 aggregateComplianceByConfigRule;<NEW_LINE>} | ().unmarshall(context)); |
1,571,154 | // Extractor implementation.<NEW_LINE>@Override<NEW_LINE>public boolean sniff(ExtractorInput input) throws IOException {<NEW_LINE>// Skip any ID3 headers.<NEW_LINE>ParsableByteArray scratch = new ParsableByteArray(ID3_HEADER_LENGTH);<NEW_LINE>int startPosition = 0;<NEW_LINE>while (true) {<NEW_LINE>input.peekFully(scratch.getData(), /* offset= */<NEW_LINE>0, ID3_HEADER_LENGTH);<NEW_LINE>scratch.setPosition(0);<NEW_LINE>if (scratch.readUnsignedInt24() != ID3_TAG) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// version, flags<NEW_LINE>scratch.skipBytes(3);<NEW_LINE>int length = scratch.readSynchSafeInt();<NEW_LINE>startPosition += 10 + length;<NEW_LINE>input.advancePeekPosition(length);<NEW_LINE>}<NEW_LINE>input.resetPeekPosition();<NEW_LINE>input.advancePeekPosition(startPosition);<NEW_LINE>int headerPosition = startPosition;<NEW_LINE>int validFramesCount = 0;<NEW_LINE>while (true) {<NEW_LINE>input.peekFully(scratch.getData(), /* offset= */<NEW_LINE>0, /* length= */<NEW_LINE>FRAME_HEADER_SIZE);<NEW_LINE>scratch.setPosition(0);<NEW_LINE><MASK><NEW_LINE>if (syncBytes != AC40_SYNCWORD && syncBytes != AC41_SYNCWORD) {<NEW_LINE>validFramesCount = 0;<NEW_LINE>input.resetPeekPosition();<NEW_LINE>if (++headerPosition - startPosition >= MAX_SNIFF_BYTES) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>input.advancePeekPosition(headerPosition);<NEW_LINE>} else {<NEW_LINE>if (++validFramesCount >= 4) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int frameSize = Ac4Util.parseAc4SyncframeSize(scratch.getData(), syncBytes);<NEW_LINE>if (frameSize == C.LENGTH_UNSET) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>input.advancePeekPosition(frameSize - FRAME_HEADER_SIZE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int syncBytes = scratch.readUnsignedShort(); |
676,683 | private static Lookup[] delegates(Lookup prevFolderLkp, String path) {<NEW_LINE>ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class);<NEW_LINE>LOG.log(Level.FINEST, "lkp loader: {0}", loader);<NEW_LINE>if (loader == null) {<NEW_LINE>loader = Thread.currentThread().getContextClassLoader();<NEW_LINE>LOG.log(Level.FINEST, "ccl: {0}", loader);<NEW_LINE>}<NEW_LINE>if (loader == null) {<NEW_LINE>loader = RecognizeInstanceObjects.class.getClassLoader();<NEW_LINE>}<NEW_LINE>LOG.log(<MASK><NEW_LINE>// NOI18N<NEW_LINE>Lookup base = Lookups.metaInfServices(loader, "META-INF/namedservices/" + path);<NEW_LINE>FileObject fo = FileUtil.getConfigFile(path);<NEW_LINE>if (fo == null) {<NEW_LINE>return new Lookup[] { base };<NEW_LINE>}<NEW_LINE>String s;<NEW_LINE>if (path.endsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>s = path.substring(0, path.length() - 1);<NEW_LINE>} else {<NEW_LINE>s = path;<NEW_LINE>}<NEW_LINE>if (prevFolderLkp == null) {<NEW_LINE>prevFolderLkp = new org.openide.loaders.FolderLookup(DataFolder.findFolder(fo), s).getLookup();<NEW_LINE>}<NEW_LINE>return new Lookup[] { prevFolderLkp, base };<NEW_LINE>} | Level.FINER, "metaInfServices for {0}", loader); |
748,842 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>intentTextView = findViewById(R.id.intentView);<NEW_LINE>recordButton = findViewById(R.id.record_button);<NEW_LINE>// on android 11, RecognitionService has to be specifically added to android manifest.<NEW_LINE>if (!SpeechRecognizer.isRecognitionAvailable(this)) {<NEW_LINE>displayError("Speech Recognition not available.");<NEW_LINE>}<NEW_LINE>speechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);<NEW_LINE>speechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);<NEW_LINE>speechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);<NEW_LINE>speechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());<NEW_LINE>try {<NEW_LINE>porcupineManager = new PorcupineManager.Builder().setAccessKey(ACCESS_KEY).setKeyword(defaultKeyword).setSensitivity(0.7f).build(getApplicationContext(), porcupineManagerCallback);<NEW_LINE>} catch (PorcupineInvalidArgumentException e) {<NEW_LINE>onPorcupineInitError(String.format("%s\nEnsure your accessKey '%s' is a valid access key.", e<MASK><NEW_LINE>} catch (PorcupineActivationException e) {<NEW_LINE>onPorcupineInitError("AccessKey activation error");<NEW_LINE>} catch (PorcupineActivationLimitException e) {<NEW_LINE>onPorcupineInitError("AccessKey reached its device limit");<NEW_LINE>} catch (PorcupineActivationRefusedException e) {<NEW_LINE>onPorcupineInitError("AccessKey refused");<NEW_LINE>} catch (PorcupineActivationThrottledException e) {<NEW_LINE>onPorcupineInitError("AccessKey has been throttled");<NEW_LINE>} catch (PorcupineException e) {<NEW_LINE>onPorcupineInitError("Failed to initialize Porcupine " + e.getMessage());<NEW_LINE>}<NEW_LINE>currentState = AppState.STOPPED;<NEW_LINE>} | .getMessage(), ACCESS_KEY)); |
1,627,452 | final ListTagsForDeliveryStreamResult executeListTagsForDeliveryStream(ListTagsForDeliveryStreamRequest listTagsForDeliveryStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForDeliveryStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForDeliveryStreamRequest> request = null;<NEW_LINE>Response<ListTagsForDeliveryStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForDeliveryStreamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForDeliveryStreamRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Firehose");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForDeliveryStreamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForDeliveryStreamResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForDeliveryStream"); |
646,657 | public void deleteKeyword() {<NEW_LINE>// get the amount of selected keywords.<NEW_LINE><MASK><NEW_LINE>// if nothing is selected, leave<NEW_LINE>if (rowcount < 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// prepare the msg-string<NEW_LINE>String msg;<NEW_LINE>// if we have just a single selection, use phrasing for that message<NEW_LINE>msg = // else if we have multiple selectios, use phrasing with appropriate wording<NEW_LINE>(1 == rowcount) ? // else if we have multiple selectios, use phrasing with appropriate wording<NEW_LINE>getResourceMap().getString("askForDeleteKeywordMsgSingle") : getResourceMap().getString("askForDeleteKeywordMsgMultiple", String.valueOf(rowcount));<NEW_LINE>// ask whether keyword really should be deleted<NEW_LINE>int option = JOptionPane.showConfirmDialog(getFrame(), msg, getResourceMap().getString("askForDeleteKeywordTitle"), JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);<NEW_LINE>// if yes, go on<NEW_LINE>if (JOptionPane.YES_OPTION == option) {<NEW_LINE>// and delete the keywords by opening a dialog with a background task<NEW_LINE>// if dialog window isn't already created, do this now<NEW_LINE>if (null == taskDlg) {<NEW_LINE>// get parent und init window<NEW_LINE>taskDlg = new TaskProgressDialog(getFrame(), TaskProgressDialog.TASK_DELETEKEYWORDS, data, ZettelkastenViewUtil.retrieveSelectedValuesFromTable(jTableKeywords, 0));<NEW_LINE>// center window<NEW_LINE>taskDlg.setLocationRelativeTo(getFrame());<NEW_LINE>}<NEW_LINE>ZettelkastenApp.getApplication().show(taskDlg);<NEW_LINE>// dispose the window and clear the object<NEW_LINE>taskDlg.dispose();<NEW_LINE>taskDlg = null;<NEW_LINE>// remove entries also from table and linked list<NEW_LINE>linkedkeywordlist = ZettelkastenViewUtil.updateTableFrequencyRemove(jTableKeywords, linkedkeywordlist, this);<NEW_LINE>// show amount of entries<NEW_LINE>statusMsgLabel.setText("(" + String.valueOf(jTableKeywords.getRowCount()) + " " + getResourceMap().getString("statusTextKeywords") + ")");<NEW_LINE>// finally, update display<NEW_LINE>updateDisplay();<NEW_LINE>}<NEW_LINE>} | int rowcount = jTableKeywords.getSelectedRowCount(); |
881,428 | public final Lambdef_nocondContext lambdef_nocond() throws RecognitionException {<NEW_LINE>Lambdef_nocondContext _localctx = new Lambdef_nocondContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 108, RULE_lambdef_nocond);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1052);<NEW_LINE>_localctx.l = match(LAMBDA);<NEW_LINE>ArgDefListBuilder args = null;<NEW_LINE>setState(1057);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << NAME) | (1L << STAR) | (1L << POWER))) != 0)) {<NEW_LINE>{<NEW_LINE>setState(1054);<NEW_LINE>_localctx.varargslist = varargslist();<NEW_LINE>args = _localctx.varargslist.result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ScopeInfo functionScope = scopeEnvironment.pushScope(ScopeEnvironment.LAMBDA_NAME, ScopeInfo.ScopeKind.Function);<NEW_LINE>functionScope.setHasAnnotations(true);<NEW_LINE>if (args != null) {<NEW_LINE>args.defineParamsInScope(functionScope);<NEW_LINE>}<NEW_LINE>setState(1060);<NEW_LINE>match(COLON);<NEW_LINE>setState(1061);<NEW_LINE>_localctx.test_nocond = test_nocond();<NEW_LINE>scopeEnvironment.popScope();<NEW_LINE>_localctx.result = new LambdaSSTNode(functionScope, args, _localctx.test_nocond.result, getStartIndex(_localctx), getLastIndex(_localctx));<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _errHandler.reportError(this, re); |
1,816,621 | static KV<Long, Integer> computePositionForIndex(Map<OffsetRange, Integer> nonOverlappingRangesToNumElementsPerPosition, int index) {<NEW_LINE>if (index < 0) {<NEW_LINE>throw new IndexOutOfBoundsException(String.format("Position %s was out of bounds for ranges %s.", index, nonOverlappingRangesToNumElementsPerPosition));<NEW_LINE>}<NEW_LINE>for (Map.Entry<OffsetRange, Integer> range : nonOverlappingRangesToNumElementsPerPosition.entrySet()) {<NEW_LINE>int numElementsInRange = Ints.checkedCast(Math.multiplyExact(Math.subtractExact(range.getKey().getTo(), range.getKey().getFrom())<MASK><NEW_LINE>if (numElementsInRange <= index) {<NEW_LINE>index -= numElementsInRange;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long position = range.getKey().getFrom() + index / range.getValue();<NEW_LINE>int subPosition = index % range.getValue();<NEW_LINE>return KV.of(position, subPosition);<NEW_LINE>}<NEW_LINE>throw new IndexOutOfBoundsException(String.format("Position %s was out of bounds for ranges %s.", index, nonOverlappingRangesToNumElementsPerPosition));<NEW_LINE>} | , range.getValue())); |
785,227 | public void marshall(Flow flow, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (flow == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(flow.getAvailabilityZone(), AVAILABILITYZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(flow.getEgressIp(), EGRESSIP_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getEntitlements(), ENTITLEMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getFlowArn(), FLOWARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getMediaStreams(), MEDIASTREAMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getOutputs(), OUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getSource(), SOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getSourceFailoverConfig(), SOURCEFAILOVERCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getSources(), SOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getVpcInterfaces(), VPCINTERFACES_BINDING);<NEW_LINE>protocolMarshaller.marshall(flow.getMaintenance(), MAINTENANCE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | flow.getDescription(), DESCRIPTION_BINDING); |
539,909 | static Single<WebServer> startServer(int unsecured, int secured) {<NEW_LINE>SocketConfiguration socketConf = SocketConfiguration.builder().name("secured").port(secured).tls(tlsConfig()).build();<NEW_LINE>Single<WebServer> webServer = WebServer.builder().port(unsecured).routing(createPlainRouting()).addSocket(socketConf, createMtlsRouting()).build().start();<NEW_LINE>webServer.thenAccept(ws -> {<NEW_LINE>System.out.println("WebServer is up!");<NEW_LINE>System.out.println("Unsecured: http://localhost:" + ws.port() + "/");<NEW_LINE>System.out.println("Secured: https://localhost:" + ws<MASK><NEW_LINE>ws.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!"));<NEW_LINE>}).exceptionally(t -> {<NEW_LINE>System.err.println("Startup failed: " + t.getMessage());<NEW_LINE>t.printStackTrace(System.err);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return webServer;<NEW_LINE>} | .port("secured") + "/"); |
975,184 | public ResponseEntity<AttackResult> checkout(@RequestHeader(value = "Authorization", required = false) String token) {<NEW_LINE>if (token == null) {<NEW_LINE>return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Jwt jwt = Jwts.parser().setSigningKey(JWT_PASSWORD).parse(token.replace("Bearer ", ""));<NEW_LINE>Claims claims = (Claims) jwt.getBody();<NEW_LINE>String user = (String) claims.get("user");<NEW_LINE>if ("Tom".equals(user)) {<NEW_LINE>return ok(success(this).build());<NEW_LINE>}<NEW_LINE>return ok(failed(this).feedback("jwt-refresh-not-tom").feedbackArgs(user).build());<NEW_LINE>} catch (ExpiredJwtException e) {<NEW_LINE>return ok(failed(this).output(e.getMessage<MASK><NEW_LINE>} catch (JwtException e) {<NEW_LINE>return ok(failed(this).feedback("jwt-invalid-token").build());<NEW_LINE>}<NEW_LINE>} | ()).build()); |
103,344 | final ListCertificatesByCAResult executeListCertificatesByCA(ListCertificatesByCARequest listCertificatesByCARequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listCertificatesByCARequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListCertificatesByCARequest> request = null;<NEW_LINE>Response<ListCertificatesByCAResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListCertificatesByCARequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCertificatesByCARequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListCertificatesByCA");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListCertificatesByCAResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new ListCertificatesByCAResultJsonUnmarshaller()); |
1,599,001 | InvokeRequest buildInvokeRequest(Method method, Object object) throws IOException {<NEW_LINE>final LambdaFunction lambdaFunction = method.getAnnotation(LambdaFunction.class);<NEW_LINE>final InvokeRequest invokeRequest = new InvokeRequest();<NEW_LINE>if (lambdaFunction.functionName().isEmpty()) {<NEW_LINE>invokeRequest.setFunctionName(method.getName());<NEW_LINE>} else {<NEW_LINE>invokeRequest.setFunctionName(lambdaFunction.functionName());<NEW_LINE>}<NEW_LINE>invokeRequest.<MASK><NEW_LINE>// If the log type is other than 'None', force to be RequestResponse.<NEW_LINE>if (!LogType.None.toString().equals(lambdaFunction.logType())) {<NEW_LINE>invokeRequest.setInvocationType(InvocationType.RequestResponse);<NEW_LINE>} else {<NEW_LINE>invokeRequest.setInvocationType(lambdaFunction.invocationType());<NEW_LINE>}<NEW_LINE>if (!lambdaFunction.qualifier().isEmpty()) {<NEW_LINE>invokeRequest.setQualifier(lambdaFunction.qualifier());<NEW_LINE>}<NEW_LINE>// set base64 encoded client context string<NEW_LINE>if (clientContext != null) {<NEW_LINE>invokeRequest.setClientContext(clientContext.toBase64String());<NEW_LINE>}<NEW_LINE>invokeRequest.setPayload(ByteBuffer.wrap(binder.serialize(object)));<NEW_LINE>return invokeRequest;<NEW_LINE>} | setLogType(lambdaFunction.logType()); |
956,283 | void initializeModuleLoader() {<NEW_LINE>ModuleResolverFactory moduleResolverFactory = null;<NEW_LINE>switch(options.getModuleResolutionMode()) {<NEW_LINE>case BROWSER:<NEW_LINE>moduleResolverFactory = BrowserModuleResolver.FACTORY;<NEW_LINE>break;<NEW_LINE>case NODE:<NEW_LINE>// processJsonInputs requires a module loader to already be defined<NEW_LINE>// so we redefine it afterwards with the package.json inputs<NEW_LINE>moduleResolverFactory = new NodeModuleResolver.Factory(processJsonInputs(moduleGraph.getAllInputs()));<NEW_LINE>break;<NEW_LINE>case WEBPACK:<NEW_LINE>moduleResolverFactory = new WebpackModuleResolver.Factory(inputPathByWebpackId);<NEW_LINE>break;<NEW_LINE>case BROWSER_WITH_TRANSFORMED_PREFIXES:<NEW_LINE>moduleResolverFactory = new BrowserWithTransformedPrefixesModuleResolver.Factory(options.getBrowserResolverPrefixReplacements());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>this.moduleLoader = ModuleLoader.builder().setModuleRoots(options.moduleRoots).setInputs(moduleGraph.getAllInputs()).setFactory(moduleResolverFactory).setPathResolver(PathResolver.RELATIVE).setPathEscaper(options.<MASK><NEW_LINE>} | getPathEscaper()).build(); |
1,565,635 | private void generateHalideLibraryTarget(ImmutableXCodeNativeTargetAttributes.Builder xcodeNativeTargetAttributesBuilder, ImmutableSet.Builder<Path> xcconfigPathsBuilder, ImmutableSet.Builder<String> targetConfigNamesBuilder, TargetNode<HalideLibraryDescriptionArg> targetNode) throws IOException {<NEW_LINE>BuildTarget buildTarget = targetNode.getBuildTarget();<NEW_LINE>xcodeNativeTargetAttributesBuilder.setTarget(Optional.of(buildTarget));<NEW_LINE>String productName = getProductNameForBuildTargetNode(targetNode);<NEW_LINE>Path outputPath = getHalideOutputPath(targetNode.getFilesystem(), buildTarget);<NEW_LINE>Path scriptPath = halideBuckConfig.getXcodeCompileScriptPath();<NEW_LINE>Optional<String> script = projectFilesystem.readFileIfItExists(scriptPath);<NEW_LINE>PBXShellScriptBuildPhase scriptPhase = objectFactory.createShellScriptBuildPhase();<NEW_LINE>scriptPhase.setShellScript(script.orElse(""));<NEW_LINE>xcodeNativeTargetAttributesBuilder.setProduct(Optional.of(new XcodeProductMetadata(ProductTypes.STATIC_LIBRARY, productName, outputPath)));<NEW_LINE>BuildTarget <MASK><NEW_LINE>Path compilerPath = BuildTargetPaths.getGenPath(projectFilesystem, compilerTarget, "%s");<NEW_LINE>ImmutableMap<String, String> appendedConfig = ImmutableMap.of();<NEW_LINE>ImmutableMap<String, String> extraSettings = ImmutableMap.of();<NEW_LINE>Builder<String, String> defaultSettingsBuilder = ImmutableMap.builder();<NEW_LINE>defaultSettingsBuilder.put("REPO_ROOT", projectFilesystem.getRootPath().normalize().toString());<NEW_LINE>defaultSettingsBuilder.put("HALIDE_COMPILER_PATH", compilerPath.toString());<NEW_LINE>// pass the source list to the xcode script<NEW_LINE>String halideCompilerSrcs;<NEW_LINE>Iterable<Path> compilerSrcFiles = Iterables.transform(targetNode.getConstructorArg().getSrcs(), input -> resolveSourcePath(input.getSourcePath()));<NEW_LINE>halideCompilerSrcs = Joiner.on(" ").join(compilerSrcFiles);<NEW_LINE>defaultSettingsBuilder.put("HALIDE_COMPILER_SRCS", halideCompilerSrcs);<NEW_LINE>String halideCompilerFlags;<NEW_LINE>halideCompilerFlags = Joiner.on(" ").join(targetNode.getConstructorArg().getCompilerFlags());<NEW_LINE>defaultSettingsBuilder.put("HALIDE_COMPILER_FLAGS", halideCompilerFlags);<NEW_LINE>defaultSettingsBuilder.put("HALIDE_OUTPUT_PATH", outputPath.toString());<NEW_LINE>defaultSettingsBuilder.put("HALIDE_FUNC_NAME", buildTarget.getShortName());<NEW_LINE>defaultSettingsBuilder.put(PRODUCT_NAME, productName);<NEW_LINE>BuildConfiguration.writeBuildConfigurationsForTarget(targetNode, buildTarget, defaultCxxPlatform, defaultPathResolver, xcodeNativeTargetAttributesBuilder, extraSettings, defaultSettingsBuilder.build(), appendedConfig, projectFilesystem, options.shouldGenerateReadOnlyFiles(), targetConfigNamesBuilder, xcconfigPathsBuilder);<NEW_LINE>} | compilerTarget = HalideLibraryDescription.createHalideCompilerBuildTarget(buildTarget); |
158,835 | protected void processAttributes(AbstractWmlConversionContext context, List<Property> properties, Element element) {<NEW_LINE>CTShd shd = null;<NEW_LINE>// the background color of the page is assumed as white<NEW_LINE>int bgColor = 0xffffff;<NEW_LINE>// the default color of the font is assumed as black<NEW_LINE>int fgColor = 0;<NEW_LINE>int pctPattern = -1;<NEW_LINE>for (int i = 0; i < properties.size(); i++) {<NEW_LINE>if (properties.get(i) instanceof Shading) {<NEW_LINE>shd = (CTShd) properties.get(i).getObject();<NEW_LINE>fgColor = extractColor(shd.getColor(), 0);<NEW_LINE>if ((shd.getVal() != null) && ("clear".equals(shd.getVal().value())) && ("auto".equals(shd.getFill()))) {<NEW_LINE>// This is a reset to the background color of the page,<NEW_LINE>// it is treated as an special case, as the background color<NEW_LINE>// isn't inherited<NEW_LINE>bgColor = 0xffffff;<NEW_LINE>pctPattern = -2;<NEW_LINE>} else {<NEW_LINE>pctPattern = (shd.getVal() != null ? extractPattern(shd.getVal().value()) : -1);<NEW_LINE>bgColor = extractColor(shd.getFill(), bgColor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pctPattern == -1) {<NEW_LINE>applyAttributes(context, properties, element);<NEW_LINE>} else {<NEW_LINE>properties.add(createShading(fgColor, bgColor, pctPattern));<NEW_LINE>applyAttributes(context, properties, element);<NEW_LINE>properties.remove(<MASK><NEW_LINE>}<NEW_LINE>} | properties.size() - 1); |
106,594 | public void paintIcon(Component c, Graphics graphics, int x, int y) {<NEW_LINE>Graphics2D g2 = <MASK><NEW_LINE>g2.setColor(Color.WHITE);<NEW_LINE>int width = getIconWidth();<NEW_LINE>int height = getIconHeight();<NEW_LINE>g2.drawRect(1, 1, width - 2, height - 2);<NEW_LINE>g2.setFont(font);<NEW_LINE>g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);<NEW_LINE>FontMetrics fm = g2.getFontMetrics();<NEW_LINE>Rectangle2D bounds = fm.getStringBounds(HELP_STRING, g2);<NEW_LINE>float xPos = (float) ((width - bounds.getWidth()) / 2);<NEW_LINE>int ascent = fm.getAscent();<NEW_LINE>int descent = fm.getDescent();<NEW_LINE>float yPos = ((height + 1) / 2 - (ascent + descent) / 2 + ascent);<NEW_LINE>g2.drawString(HELP_STRING, xPos, yPos);<NEW_LINE>g2.translate(-x, -y);<NEW_LINE>} | (Graphics2D) graphics.create(); |
298,537 | public static DescribeInstancesResponse unmarshall(DescribeInstancesResponse describeInstancesResponse, UnmarshallerContext context) {<NEW_LINE>describeInstancesResponse.setRequestId(context.stringValue("DescribeInstancesResponse.RequestId"));<NEW_LINE>describeInstancesResponse.setTotalCount(context.integerValue("DescribeInstancesResponse.TotalCount"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setRegionId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].RegionId"));<NEW_LINE>instance.setZoneId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].ZoneId"));<NEW_LINE>instance.setHsmStatus(context.integerValue<MASK><NEW_LINE>instance.setHsmOem(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].HsmOem"));<NEW_LINE>instance.setHsmDeviceType(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].HsmDeviceType"));<NEW_LINE>instance.setVpcId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].VpcId"));<NEW_LINE>instance.setVswitchId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].VswitchId"));<NEW_LINE>instance.setIp(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].Ip"));<NEW_LINE>instance.setRemark(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].Remark"));<NEW_LINE>instance.setExpiredTime(context.longValue("DescribeInstancesResponse.Instances[" + i + "].ExpiredTime"));<NEW_LINE>instance.setCreateTime(context.longValue("DescribeInstancesResponse.Instances[" + i + "].CreateTime"));<NEW_LINE>List<String> whiteList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeInstancesResponse.Instances[" + i + "].WhiteList.Length"); j++) {<NEW_LINE>whiteList.add(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].WhiteList[" + j + "]"));<NEW_LINE>}<NEW_LINE>instance.setWhiteList(whiteList);<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>describeInstancesResponse.setInstances(instances);<NEW_LINE>return describeInstancesResponse;<NEW_LINE>} | ("DescribeInstancesResponse.Instances[" + i + "].HsmStatus")); |
799,658 | public void handleEvent(Event event) {<NEW_LINE>final TOTorrent torrent = dms[0].getTorrent();<NEW_LINE>if (torrent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String msg_key_prefix = "MyTorrentsView.menu.edit_source.";<NEW_LINE>SimpleTextEntryWindow text_entry = new SimpleTextEntryWindow();<NEW_LINE>text_entry.setParentShell(shell);<NEW_LINE><MASK><NEW_LINE>text_entry.setMessage(msg_key_prefix + "message");<NEW_LINE>text_entry.setPreenteredText(TorrentUtils.getObtainedFrom(torrent), false);<NEW_LINE>text_entry.setWidthHint(500);<NEW_LINE>text_entry.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver text_entry) {<NEW_LINE>if (text_entry.hasSubmittedInput()) {<NEW_LINE>TorrentUtils.setObtainedFrom(torrent, text_entry.getSubmittedInput());<NEW_LINE>try {<NEW_LINE>TorrentUtils.writeToFile(torrent);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | text_entry.setTitle(msg_key_prefix + "title"); |
685,055 | public JsonElement serialize(Blacklists src, Type typeOfSrc, JsonSerializationContext context) {<NEW_LINE>JsonObject blacklists_obj = new JsonObject();<NEW_LINE>for (BlacklistDescriptor bl : src.mLists) {<NEW_LINE>JsonObject bl_obj = new JsonObject();<NEW_LINE>bl_obj.add("num_rules", new JsonPrimitive(bl.num_rules));<NEW_LINE>bl_obj.add("last_update", new JsonPrimitive(bl.getLastUpdate()));<NEW_LINE>blacklists_obj.add(bl.fname, bl_obj);<NEW_LINE>}<NEW_LINE>JsonObject rv = new JsonObject();<NEW_LINE>rv.add("last_update", new JsonPrimitive(src.mLastUpdate));<NEW_LINE>rv.add("num_domain_rules", <MASK><NEW_LINE>rv.add("num_ip_rules", new JsonPrimitive(src.mNumIPRules));<NEW_LINE>rv.add("blacklists", blacklists_obj);<NEW_LINE>return rv;<NEW_LINE>} | new JsonPrimitive(src.mNumDomainRules)); |
650,602 | protected void onPostExecute(SaveGpxResult result) {<NEW_LINE>isSaving = false;<NEW_LINE>app.getNotificationHelper().refreshNotifications();<NEW_LINE>updateControl();<NEW_LINE>Map<String, GPXFile> gpxFilesByName = result.getGpxFilesByName();<NEW_LINE>GPXFile gpxFile = null;<NEW_LINE>File file = null;<NEW_LINE>if (!Algorithms.isEmpty(gpxFilesByName)) {<NEW_LINE>String gpxFileName = gpxFilesByName.keySet()<MASK><NEW_LINE>gpxFile = gpxFilesByName.get(gpxFileName);<NEW_LINE>file = getSavedGpxFile(gpxFileName + GPX_FILE_EXT);<NEW_LINE>}<NEW_LINE>boolean fileExists = file != null && file.exists();<NEW_LINE>boolean gpxFileNonEmpty = gpxFile != null && (gpxFile.hasTrkPt() || gpxFile.hasWptPt());<NEW_LINE>if (fileExists && gpxFileNonEmpty) {<NEW_LINE>if (openTrack) {<NEW_LINE>TrackMenuFragment.openTrack(mapActivity, file, null);<NEW_LINE>} else {<NEW_LINE>FragmentActivity fragmentActivity = activityRef != null ? activityRef.get() : null;<NEW_LINE>if (AndroidUtils.isActivityNotDestroyed(fragmentActivity)) {<NEW_LINE>FragmentManager fragmentManager = fragmentActivity.getSupportFragmentManager();<NEW_LINE>SaveGPXBottomSheet.showInstance(fragmentManager, file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (onComplete != null) {<NEW_LINE>onComplete.run();<NEW_LINE>}<NEW_LINE>} | .iterator().next(); |
224,403 | public S3Grant unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>S3Grant s3Grant = new S3Grant();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return s3Grant;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Grantee", targetDepth)) {<NEW_LINE>s3Grant.setGrantee(S3GranteeStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Permission", targetDepth)) {<NEW_LINE>s3Grant.setPermission(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return s3Grant;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
644,218 | protected TokenResponse executeRefreshToken() throws IOException {<NEW_LINE>if (serviceAccountPrivateKey == null) {<NEW_LINE>return super.executeRefreshToken();<NEW_LINE>}<NEW_LINE>// service accounts: no refresh token; instead use private key to request new access token<NEW_LINE>JsonWebSignature.Header header = new JsonWebSignature.Header();<NEW_LINE>header.setAlgorithm("RS256");<NEW_LINE>header.setType("JWT");<NEW_LINE>header.setKeyId(serviceAccountPrivateKeyId);<NEW_LINE>JsonWebToken.Payload payload = new JsonWebToken.Payload();<NEW_LINE>long currentTime = getClock().currentTimeMillis();<NEW_LINE>payload.setIssuer(serviceAccountId);<NEW_LINE>payload.setAudience(getTokenServerEncodedUrl());<NEW_LINE>payload.setIssuedAtTimeSeconds(currentTime / 1000);<NEW_LINE>payload.setExpirationTimeSeconds(currentTime / 1000 + 3600);<NEW_LINE>payload.setSubject(serviceAccountUser);<NEW_LINE>payload.put("scope", Joiner.on(' ').join(serviceAccountScopes));<NEW_LINE>try {<NEW_LINE>String assertion = JsonWebSignature.signUsingRsaSha256(serviceAccountPrivateKey, getJsonFactory(), header, payload);<NEW_LINE>TokenRequest request = new TokenRequest(getTransport(), getJsonFactory(), new GenericUrl<MASK><NEW_LINE>request.put("assertion", assertion);<NEW_LINE>return request.execute();<NEW_LINE>} catch (GeneralSecurityException exception) {<NEW_LINE>IOException e = new IOException();<NEW_LINE>e.initCause(exception);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | (getTokenServerEncodedUrl()), "urn:ietf:params:oauth:grant-type:jwt-bearer"); |
1,566,537 | private UpdateShipmentScheduleRequest toUpdateShipmentScheduleRequestOrNull(@NonNull final JsonCreateShipmentInfo createShipmentInfo, @NonNull final ShippingInfoCache cache) {<NEW_LINE>final LocalDateTime deliveryDate = createShipmentInfo.getMovementDate();<NEW_LINE>final LocationBasicInfo bPartnerLocation = LocationBasicInfo.ofNullable(createShipmentInfo.getShipToLocation(), countryCodeFactory).orElse(null);<NEW_LINE>final String bpartnerCode = createShipmentInfo.getBusinessPartnerSearchKey();<NEW_LINE>final List<JsonAttributeInstance> attributes = createShipmentInfo.getAttributes();<NEW_LINE>final DeliveryRule deliveryRule = DeliveryRule.ofNullableCode(createShipmentInfo.getDeliveryRule());<NEW_LINE>final ShipperId shipperId = cache.getShipperId(createShipmentInfo.getShipperInternalName());<NEW_LINE>if (deliveryDate == null && bPartnerLocation == null && Check.isBlank(bpartnerCode) && Check.isEmpty(attributes) && deliveryRule == null && shipperId == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final ShipmentScheduleId shipmentScheduleId = extractShipmentScheduleId(createShipmentInfo);<NEW_LINE>final OrgId <MASK><NEW_LINE>final ZoneId timeZoneId = orgDAO.getTimeZone(orgId);<NEW_LINE>final List<CreateAttributeInstanceReq> attributeInstanceRequestList = Check.isEmpty(attributes) ? null : attributeSetHelper.toCreateAttributeInstanceReqList(attributes);<NEW_LINE>return UpdateShipmentScheduleRequest.builder().shipmentScheduleId(shipmentScheduleId).bPartnerCode(bpartnerCode).bPartnerLocation(bPartnerLocation).attributes(attributeInstanceRequestList).deliveryDate(TimeUtil.asZonedDateTime(deliveryDate, timeZoneId)).deliveryRule(deliveryRule).shipperId(shipperId).build();<NEW_LINE>} | orgId = cache.getOrgId(shipmentScheduleId); |
1,183,400 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View root = inflater.inflate(R.layout.about, container, false);<NEW_LINE>((TextView) root.findViewById(R.id.version)).setText(BuildConfig.VERSION_NAME);<NEW_LINE>((TextView) root.findViewById(R.id.data_version)).setText(getString(R.string.data_version, localDate(Framework.nativeGetDataVersion())));<NEW_LINE>setupItem(R.id.web, true, root);<NEW_LINE>setupItem(R.id.github, false, root);<NEW_LINE>setupItem(R.id.telegram, false, root);<NEW_LINE>setupItem(R.id.instagram, false, root);<NEW_LINE>setupItem(R.id.facebook, false, root);<NEW_LINE>setupItem(R.id.twitter, false, root);<NEW_LINE>setupItem(R.id.faq, true, root);<NEW_LINE>setupItem(R.id.report, true, root);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if ("google".equalsIgnoreCase(BuildConfig.FLAVOR)) {<NEW_LINE>TextView view = root.findViewById(R.id.support_us);<NEW_LINE>view.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>setupItem(R.id.support_us, true, root);<NEW_LINE>}<NEW_LINE>setupItem(R.id.rate, true, root);<NEW_LINE>setupItem(R.id.copyright, false, root);<NEW_LINE>View termOfUseView = root.findViewById(R.id.term_of_use_link);<NEW_LINE>View privacyPolicyView = root.findViewById(R.id.privacy_policy);<NEW_LINE>termOfUseView.<MASK><NEW_LINE>privacyPolicyView.setOnClickListener(v -> onPrivacyPolicyClick());<NEW_LINE>return root;<NEW_LINE>} | setOnClickListener(v -> onTermOfUseClick()); |
1,734,007 | public Request<AnalyzeIDRequest> marshall(AnalyzeIDRequest analyzeIDRequest) {<NEW_LINE>if (analyzeIDRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(AnalyzeIDRequest)");<NEW_LINE>}<NEW_LINE>Request<AnalyzeIDRequest> request = new DefaultRequest<AnalyzeIDRequest>(analyzeIDRequest, "AmazonTextract");<NEW_LINE>String target = "Textract.AnalyzeID";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (analyzeIDRequest.getDocumentPages() != null) {<NEW_LINE>java.util.List<Document> documentPages = analyzeIDRequest.getDocumentPages();<NEW_LINE>jsonWriter.name("DocumentPages");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Document documentPagesItem : documentPages) {<NEW_LINE>if (documentPagesItem != null) {<NEW_LINE>DocumentJsonMarshaller.getInstance().marshall(documentPagesItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | t.getMessage(), t); |
320,008 | private static KeyFile loadPrivateKey(String privateKeyURL) throws IOException {<NEW_LINE>try {<NEW_LINE>URLConnection urlConnection = new org.apache.pulsar.client.api.url.URL(privateKeyURL).openConnection();<NEW_LINE>try {<NEW_LINE>String protocol = urlConnection.getURL().getProtocol();<NEW_LINE>String contentType = urlConnection.getContentType();<NEW_LINE>if ("data".equals(protocol) && !"application/json".equals(contentType)) {<NEW_LINE>throw new IllegalArgumentException("Unsupported media type or encoding format: " + urlConnection.getContentType());<NEW_LINE>}<NEW_LINE>KeyFile privateKey;<NEW_LINE>try (Reader r = new InputStreamReader((InputStream) urlConnection.getContent(), StandardCharsets.UTF_8)) {<NEW_LINE>privateKey = KeyFile.fromJson(r);<NEW_LINE>}<NEW_LINE>return privateKey;<NEW_LINE>} finally {<NEW_LINE>IOUtils.close(urlConnection);<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException | InstantiationException | IllegalAccessException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new IOException("Invalid privateKey format", e); |
1,760,891 | public void addInstances(InstanceList training) {<NEW_LINE>alphabet = training.getDataAlphabet();<NEW_LINE>numTypes = alphabet.size();<NEW_LINE>betaSum = beta * numTypes;<NEW_LINE>typeTopicCounts = new int[numTypes][numTopics];<NEW_LINE>typeTopicWeights = new double[numTypes][numTopics];<NEW_LINE>totalTopicWeights = new double[numTopics];<NEW_LINE>for (int type = 0; type < numTypes; type++) {<NEW_LINE>Arrays.fill<MASK><NEW_LINE>}<NEW_LINE>Arrays.fill(totalTopicWeights, betaSum);<NEW_LINE>int doc = 0;<NEW_LINE>for (Instance instance : training) {<NEW_LINE>doc++;<NEW_LINE>FeatureSequence tokenSequence = (FeatureSequence) instance.getData();<NEW_LINE>LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[tokenSequence.size()]);<NEW_LINE>TopicAssignment t = new TopicAssignment(instance, topicSequence);<NEW_LINE>data.add(t);<NEW_LINE>}<NEW_LINE>} | (typeTopicWeights[type], beta); |
425,935 | final DeleteContactListResult executeDeleteContactList(DeleteContactListRequest deleteContactListRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteContactListRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteContactListRequest> request = null;<NEW_LINE>Response<DeleteContactListResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteContactListRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteContactListRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteContactList");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteContactListResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteContactListResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
903,634 | public ListOutgoingCertificatesResult listOutgoingCertificates(ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listOutgoingCertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListOutgoingCertificatesRequest> request = null;<NEW_LINE>Response<ListOutgoingCertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListOutgoingCertificatesRequestMarshaller().marshall(listOutgoingCertificatesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListOutgoingCertificatesResult, JsonUnmarshallerContext> unmarshaller = new ListOutgoingCertificatesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListOutgoingCertificatesResult> responseHandler = new JsonResponseHandler<ListOutgoingCertificatesResult>(unmarshaller);<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
433,023 | public void run() throws Exception {<NEW_LINE>File socketFile = new File("/tmp/ClientAndServer.sock");<NEW_LINE>// Clean up from previous runs.<NEW_LINE>socketFile.delete();<NEW_LINE>MockWebServer server = new MockWebServer();<NEW_LINE>server.setServerSocketFactory(new UnixDomainServerSocketFactory(socketFile));<NEW_LINE>server.setProtocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE));<NEW_LINE>server.enqueue(new MockResponse().setBody("hello"));<NEW_LINE>server.start();<NEW_LINE>OkHttpClient client = new OkHttpClient.Builder().socketFactory(new UnixDomainSocketFactory(socketFile)).protocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE)).build();<NEW_LINE>Request request = new Request.Builder().<MASK><NEW_LINE>try (Response response = client.newCall(request).execute()) {<NEW_LINE>System.out.println(response.body().string());<NEW_LINE>}<NEW_LINE>server.shutdown();<NEW_LINE>socketFile.delete();<NEW_LINE>} | url("http://publicobject.com/helloworld.txt").build(); |
1,723,334 | public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>getMenuInflater().inflate(<MASK><NEW_LINE>appUsageMenu = menu.findItem(R.id.action_app_usage);<NEW_LINE>logViewerMenu = menu.findItem(R.id.action_log_viewer);<NEW_LINE>MenuItem apkUpdaterMenu = menu.findItem(R.id.action_apk_updater);<NEW_LINE>try {<NEW_LINE>if (!getPackageManager().getApplicationInfo(PACKAGE_NAME_APK_UPDATER, 0).enabled)<NEW_LINE>throw new PackageManager.NameNotFoundException();<NEW_LINE>apkUpdaterMenu.setVisible(true);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>apkUpdaterMenu.setVisible(false);<NEW_LINE>}<NEW_LINE>MenuItem termuxMenu = menu.findItem(R.id.action_termux);<NEW_LINE>try {<NEW_LINE>if (!getPackageManager().getApplicationInfo(PACKAGE_NAME_TERMUX, 0).enabled)<NEW_LINE>throw new PackageManager.NameNotFoundException();<NEW_LINE>termuxMenu.setVisible(true);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>termuxMenu.setVisible(false);<NEW_LINE>}<NEW_LINE>return super.onCreateOptionsMenu(menu);<NEW_LINE>} | R.menu.activity_main_actions, menu); |
23,351 | private static void parseObjectGotoArray(HippyArray array, Object obj) throws JSONException {<NEW_LINE>if (obj == null || obj == JSONObject.NULL) {<NEW_LINE>array.pushNull();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class<?> cls = obj.getClass();<NEW_LINE>if (obj instanceof String) {<NEW_LINE>array<MASK><NEW_LINE>} else if (cls == int.class || cls == Integer.class) {<NEW_LINE>array.pushInt((Integer) obj);<NEW_LINE>} else if (cls == double.class || cls == Double.class) {<NEW_LINE>array.pushDouble((Double) obj);<NEW_LINE>} else if (cls == long.class || cls == Long.class) {<NEW_LINE>array.pushLong((Long) obj);<NEW_LINE>} else if (cls == boolean.class || cls == Boolean.class) {<NEW_LINE>array.pushBoolean((Boolean) obj);<NEW_LINE>} else if (cls == HippyArray.class) {<NEW_LINE>array.pushArray((HippyArray) obj);<NEW_LINE>} else if (cls == HippyMap.class) {<NEW_LINE>array.pushMap((HippyMap) obj);<NEW_LINE>} else if (cls == JSONArray.class) {<NEW_LINE>HippyArray arr = new HippyArray();<NEW_LINE>JSONArray jsonArr = (JSONArray) obj;<NEW_LINE>int length = jsonArr.length();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>parseObjectGotoArray(arr, jsonArr.get(i));<NEW_LINE>}<NEW_LINE>array.pushArray(arr);<NEW_LINE>} else if (cls == JSONObject.class) {<NEW_LINE>HippyMap map = new HippyMap();<NEW_LINE>JSONObject jsonObj = (JSONObject) obj;<NEW_LINE>Iterator<String> keys = jsonObj.keys();<NEW_LINE>while (keys.hasNext()) {<NEW_LINE>String key = keys.next();<NEW_LINE>parseObjectGotoMap(map, key, jsonObj.get(key));<NEW_LINE>}<NEW_LINE>array.pushMap(map);<NEW_LINE>}<NEW_LINE>} | .pushString((String) obj); |
1,697,988 | public boolean selectSuccess(TransportHelper helper, Object attachment) {<NEW_LINE>try {<NEW_LINE>int written = helper.write(bb, false);<NEW_LINE>if (bb.remaining() > 0) {<NEW_LINE>helper.registerForWriteSelects(this, null);<NEW_LINE>} else {<NEW_LINE>if (Logger.isEnabled()) {<NEW_LINE>Logger.log(new LogEvent(LOGID, "HTTP connection from " + connection.getEndpoint()<MASK><NEW_LINE>}<NEW_LINE>connection.close(null);<NEW_LINE>}<NEW_LINE>return (written > 0);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>helper.cancelWriteSelects();<NEW_LINE>if (Logger.isEnabled()) {<NEW_LINE>Logger.log(new LogEvent(LOGID, "HTTP connection from " + connection.getEndpoint().getNotionalAddress() + " failed to write error '" + data + "'"));<NEW_LINE>}<NEW_LINE>connection.close(e == null ? null : Debug.getNestedExceptionMessage(e));<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>} | .getNotionalAddress() + " closed")); |
1,660,628 | ActionResult<WrapOutId> execute(String appDictFlag, String appInfoFlag, String path0, String path1, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<WrapOutId> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = business.getAppInfoFactory().pick(appInfoFlag);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionAppInfoNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>String id = business.getAppDictFactory().getWithAppInfoWithUniqueName(appInfo.getId(), appDictFlag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionAppDictNotExist(appInfoFlag);<NEW_LINE>}<NEW_LINE>AppDict dict = emc.find(id, AppDict.class);<NEW_LINE>this.create(business, dict, jsonElement, path0, path1);<NEW_LINE>emc.commit();<NEW_LINE>WrapOutId wrap = new WrapOutId(dict.getId());<NEW_LINE>result.setData(wrap);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | result = new ActionResult<>(); |
342,976 | private void updateInstance(Matrix4f worldMatrix, float[] store, int offset, Matrix3f tempMat3, Quaternion tempQuat) {<NEW_LINE>worldMatrix.toRotationMatrix(tempMat3);<NEW_LINE>tempMat3.invertLocal();<NEW_LINE>// NOTE: No need to take the transpose in order to encode<NEW_LINE>// into quaternion, the multiplication in the shader is vec * quat<NEW_LINE>// apparently...<NEW_LINE>tempQuat.fromRotationMatrix(tempMat3);<NEW_LINE>// Column-major encoding. The "W" field in each of the encoded<NEW_LINE>// vectors represents the quaternion.<NEW_LINE>store[offset + 0] = worldMatrix.m00;<NEW_LINE>store[offset + 1] = worldMatrix.m10;<NEW_LINE>store[offset + 2] = worldMatrix.m20;<NEW_LINE>store[offset + 3] = tempQuat.getX();<NEW_LINE>store[offset + 4] = worldMatrix.m01;<NEW_LINE>store[<MASK><NEW_LINE>store[offset + 6] = worldMatrix.m21;<NEW_LINE>store[offset + 7] = tempQuat.getY();<NEW_LINE>store[offset + 8] = worldMatrix.m02;<NEW_LINE>store[offset + 9] = worldMatrix.m12;<NEW_LINE>store[offset + 10] = worldMatrix.m22;<NEW_LINE>store[offset + 11] = tempQuat.getZ();<NEW_LINE>store[offset + 12] = worldMatrix.m03;<NEW_LINE>store[offset + 13] = worldMatrix.m13;<NEW_LINE>store[offset + 14] = worldMatrix.m23;<NEW_LINE>store[offset + 15] = tempQuat.getW();<NEW_LINE>} | offset + 5] = worldMatrix.m11; |
197,890 | public static boolean isJavascriptMimeType(final String mimeType) {<NEW_LINE>if (mimeType == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String mimeTypeLC = <MASK><NEW_LINE>return "application/ecmascript".equals(mimeTypeLC) || APPLICATION_JAVASCRIPT.equals(mimeTypeLC) || "application/x-ecmascript".equals(mimeTypeLC) || "application/x-javascript".equals(mimeTypeLC) || "text/ecmascript".equals(mimeTypeLC) || "text/javascript".equals(mimeTypeLC) || "text/javascript1.0".equals(mimeTypeLC) || "text/javascript1.1".equals(mimeTypeLC) || "text/javascript1.2".equals(mimeTypeLC) || "text/javascript1.3".equals(mimeTypeLC) || "text/javascript1.4".equals(mimeTypeLC) || "text/javascript1.5".equals(mimeTypeLC) || "text/jscript".equals(mimeTypeLC) || "text/livescript".equals(mimeTypeLC) || "text/x-ecmascript".equals(mimeTypeLC) || "text/x-javascript".equals(mimeTypeLC);<NEW_LINE>} | mimeType.toLowerCase(Locale.ROOT); |
315,013 | private void copyLuceneTextIndexIfExists(File segmentDirectory, File v3Dir) throws IOException {<NEW_LINE>// TODO: see if this can be done by reusing some existing methods<NEW_LINE>String suffix = V1Constants.Indexes.LUCENE_TEXT_INDEX_FILE_EXTENSION;<NEW_LINE>File[] textIndexFiles = segmentDirectory.listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return name.endsWith(suffix);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (File textIndexFile : textIndexFiles) {<NEW_LINE>File[] indexFiles = textIndexFile.listFiles();<NEW_LINE>File v3LuceneIndexDir = new File(v3Dir, textIndexFile.getName());<NEW_LINE>v3LuceneIndexDir.mkdir();<NEW_LINE>for (File indexFile : indexFiles) {<NEW_LINE>File v3LuceneIndexFile = new File(v3LuceneIndexDir, indexFile.getName());<NEW_LINE>Files.copy(indexFile.toPath(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if segment reload is issued asking for up-conversion of<NEW_LINE>// on-disk segment format from v1/v2 to v3, then in addition<NEW_LINE>// to moving the lucene text index files, we need to move the<NEW_LINE>// docID mapping/cache file created by us in v1/v2 during an earlier<NEW_LINE>// load of the segment.<NEW_LINE>String docIDFileSuffix = V1Constants.Indexes.LUCENE_TEXT_INDEX_DOCID_MAPPING_FILE_EXTENSION;<NEW_LINE>File[] textIndexDocIdMappingFiles = segmentDirectory.listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return name.endsWith(docIDFileSuffix);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (File docIdMappingFile : textIndexDocIdMappingFiles) {<NEW_LINE>File v3DocIdMappingFile = new File(v3Dir, docIdMappingFile.getName());<NEW_LINE>Files.copy(docIdMappingFile.toPath(), v3DocIdMappingFile.toPath());<NEW_LINE>}<NEW_LINE>} | ), v3LuceneIndexFile.toPath()); |
1,391,847 | protected Control createDialogArea(Composite parent) {<NEW_LINE>setTitle("Select Deployment Manifest for project '" + model.getProjectName() + "'");<NEW_LINE>Composite container = (Composite) super.createDialogArea(parent);<NEW_LINE>final Composite composite = new Composite(container, parent.getStyle());<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>composite.setLayout(new GridLayout());<NEW_LINE>createModeSwitchGroup(composite);<NEW_LINE>createFileGroup(composite);<NEW_LINE>createResizeSash(composite);<NEW_LINE>createYamlContentsGroup(composite);<NEW_LINE>if (model.supportsSsh) {<NEW_LINE>createJmxSshOptionsGroup(composite);<NEW_LINE>}<NEW_LINE>activateHandlers();<NEW_LINE>model.type.addListener(new ValueListener<ManifestType>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void gotValue(LiveExpression<ManifestType> exp, ManifestType type) {<NEW_LINE>GridData gridData;<NEW_LINE>boolean isFile = type == ManifestType.FILE;<NEW_LINE>buttonFileManifest.setSelection(isFile);<NEW_LINE>buttonManualManifest.setSelection(!isFile);<NEW_LINE>refreshButton.setEnabled(isFile && !workspaceViewer.getSelection().isEmpty());<NEW_LINE>workspaceViewer.getControl().setEnabled(isFile);<NEW_LINE>fileLabel.setEnabled(isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) fileGroup.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>fileGroup.setVisible(isFile);<NEW_LINE>fileGroup.setLayoutData(gridData);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) resizeSash.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>resizeSash.setVisible(isFile);<NEW_LINE>resizeSash.setLayoutData(gridData);<NEW_LINE>fileGroup.getParent().layout();<NEW_LINE>fileYamlComposite.setVisible(isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) fileYamlComposite.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>fileYamlComposite.setLayoutData(gridData);<NEW_LINE>manualYamlComposite.setVisible(!isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) manualYamlComposite.getLayoutData());<NEW_LINE>gridData.exclude = isFile;<NEW_LINE>manualYamlComposite.setLayoutData(gridData);<NEW_LINE>yamlGroup.layout();<NEW_LINE>yamlGroup<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>model.getValidator().addListener(new UIValueListener<ValidationResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void uiGotValue(LiveExpression<ValidationResult> exp, ValidationResult value) {<NEW_LINE>ValidationResult result = exp.getValue();<NEW_LINE>if (getButton(IDialogConstants.OK_ID) != null) {<NEW_LINE>getButton(IDialogConstants.OK_ID).setEnabled(result.status != IStatus.ERROR);<NEW_LINE>}<NEW_LINE>setMessage(result.msg, result.getMessageProviderStatus());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>parent.pack(true);<NEW_LINE>if (!workspaceViewer.getSelection().isEmpty()) {<NEW_LINE>workspaceViewer.setSelection(workspaceViewer.getSelection(), true);<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>} | .getParent().layout(); |
1,728,817 | private void doInit() {<NEW_LINE>QueryRunner run = new QueryRunner(ds);<NEW_LINE>Boolean isInitialized;<NEW_LINE>try {<NEW_LINE>isInitialized = run.<MASK><NEW_LINE>} catch (SQLException e) {<NEW_LINE>isInitialized = false;<NEW_LINE>}<NEW_LINE>if (isInitialized) {<NEW_LINE>System.out.println("============================================");<NEW_LINE>System.out.println("Apiman Gateway database already initialized.");<NEW_LINE>System.out.println("============================================");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClassLoader cl = JdbcInitializer.class.getClassLoader();<NEW_LINE>URL resource = cl.getResource("ddls/apiman-gateway_" + dbType + ".ddl");<NEW_LINE>try (InputStream is = resource.openStream()) {<NEW_LINE>System.out.println("=======================================");<NEW_LINE>System.out.println("Initializing apiman Gateway database.");<NEW_LINE>DdlParser ddlParser = new DdlParser();<NEW_LINE>List<String> statements = ddlParser.parse(is);<NEW_LINE>for (String sql : statements) {<NEW_LINE>System.out.println(sql);<NEW_LINE>run.update(sql);<NEW_LINE>}<NEW_LINE>System.out.println("=======================================");<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | query("SELECT * FROM gw_apis", rs -> true); |
479,282 | public void visit(StaticConstantAccess node) {<NEW_LINE>String clsName = CodeUtils.extractUnqualifiedClassName(node);<NEW_LINE>ClassElementAttribute c = getCurrentClassElement();<NEW_LINE>switch(clsName) {<NEW_LINE>case // NOI18N<NEW_LINE>"self":<NEW_LINE>if (c != null) {<NEW_LINE>clsName = c.getName();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // NOI18N<NEW_LINE>"parent":<NEW_LINE>if (c != null) {<NEW_LINE>c = c.getSuperClass();<NEW_LINE>if (c != null) {<NEW_LINE>clsName = c.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>Collection<AttributedElement> nn = getNamedGlobalElements(Kind.CLASS, clsName);<NEW_LINE>if (!nn.isEmpty()) {<NEW_LINE>for (AttributedElement ell : nn) {<NEW_LINE>ClassElementAttribute ce = (ClassElementAttribute) ell;<NEW_LINE>if (ce != null && ce.getName().equals(clsName)) {<NEW_LINE>String name = CodeUtils.extractUnqualifiedClassName(node);<NEW_LINE>AttributedElement thisEl = ce.<MASK><NEW_LINE>node2Element.put(node.getDispatcher(), ce);<NEW_LINE>node2Element.put(node, thisEl);<NEW_LINE>node2Element.put(node.getConstant(), thisEl);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visit(node);<NEW_LINE>} | lookup(name, Kind.CONST); |
90,460 | static int calcSize(int origDim, String requestedDim, int defaultDim, boolean negativeAllowed) {<NEW_LINE>if (requestedDim == null) {<NEW_LINE>return defaultDim;<NEW_LINE>}<NEW_LINE>boolean percent = false;<NEW_LINE>if (requestedDim.endsWith("%")) {<NEW_LINE>percent = true;<NEW_LINE>requestedDim = requestedDim.substring(0, requestedDim.length() - 1);<NEW_LINE>} else if (requestedDim.endsWith("px")) {<NEW_LINE>// Pixels can be described either simply as '20' or as '20px'<NEW_LINE>requestedDim = requestedDim.substring(0, requestedDim.length() - 2);<NEW_LINE>}<NEW_LINE>int dim = 0;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// dim=-1;<NEW_LINE>return origDim;<NEW_LINE>}<NEW_LINE>if ((dim < 0) && (!negativeAllowed)) {<NEW_LINE>// Dimension was negative<NEW_LINE>return origDim;<NEW_LINE>}<NEW_LINE>if (percent) {<NEW_LINE>return origDim * dim / 100;<NEW_LINE>} else {<NEW_LINE>return dim;<NEW_LINE>}<NEW_LINE>} | dim = Integer.parseInt(requestedDim); |
887,585 | public boolean copyDir(URI srcUri, URI dstUri) throws IOException {<NEW_LINE>LOGGER.info("Copying uri {} to uri {}", srcUri, dstUri);<NEW_LINE>Preconditions.checkState(exists<MASK><NEW_LINE>if (srcUri.equals(dstUri)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!isDirectory(srcUri)) {<NEW_LINE>delete(dstUri, true);<NEW_LINE>return copyFile(srcUri, dstUri);<NEW_LINE>}<NEW_LINE>dstUri = normalizeToDirectoryUri(dstUri);<NEW_LINE>Path srcPath = Paths.get(srcUri.getPath());<NEW_LINE>try {<NEW_LINE>boolean copySucceeded = true;<NEW_LINE>for (String filePath : listFiles(srcUri, true)) {<NEW_LINE>URI srcFileURI = URI.create(filePath);<NEW_LINE>String directoryEntryPrefix = srcFileURI.getPath();<NEW_LINE>URI src = new URI(srcUri.getScheme(), srcUri.getHost(), directoryEntryPrefix, null);<NEW_LINE>String relativeSrcPath = srcPath.relativize(Paths.get(directoryEntryPrefix)).toString();<NEW_LINE>String dstPath = dstUri.resolve(relativeSrcPath).getPath();<NEW_LINE>URI dst = new URI(dstUri.getScheme(), dstUri.getHost(), dstPath, null);<NEW_LINE>copySucceeded &= copyFile(src, dst);<NEW_LINE>}<NEW_LINE>return copySucceeded;<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>} | (srcUri), "Source URI '%s' does not exist", srcUri); |
1,642,686 | void checkUnlabeledData() throws IOException {<NEW_LINE>File unClassifiedResource <MASK><NEW_LINE>FileLabelAwareIterator unClassifiedIterator = new FileLabelAwareIterator.Builder().addSourceFolder(unClassifiedResource).build();<NEW_LINE>MeansBuilder meansBuilder = new MeansBuilder((InMemoryLookupTable<VocabWord>) paragraphVectors.getLookupTable(), tokenizerFactory);<NEW_LINE>LabelSeeker seeker = new LabelSeeker(iterator.getLabelsSource().getLabels(), (InMemoryLookupTable<VocabWord>) paragraphVectors.getLookupTable());<NEW_LINE>while (unClassifiedIterator.hasNextDocument()) {<NEW_LINE>LabelledDocument document = unClassifiedIterator.nextDocument();<NEW_LINE>INDArray documentAsCentroid = meansBuilder.documentAsVector(document);<NEW_LINE>List<Pair<String, Double>> scores = seeker.getScores(documentAsCentroid);<NEW_LINE>log.info("Document '" + document.getLabels() + "' falls into the following categories: ");<NEW_LINE>for (Pair<String, Double> score : scores) {<NEW_LINE>log.info(" " + score.getFirst() + ": " + score.getSecond());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new File(dataLocalPath, "paravec/unlabeled"); |
438,710 | protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {<NEW_LINE><MASK><NEW_LINE>String instanceRefName = "instance";<NEW_LINE>String mode = "DISTRIBUTED";<NEW_LINE>if (attributes != null) {<NEW_LINE>for (int a = 0; a < attributes.getLength(); a++) {<NEW_LINE>Node att = attributes.item(a);<NEW_LINE>String name = att.getNodeName();<NEW_LINE>if ("instance-ref".equals(name)) {<NEW_LINE>instanceRefName = att.getTextContent();<NEW_LINE>} else if ("mode".equals(name)) {<NEW_LINE>mode = att.getTextContent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class clz = null;<NEW_LINE>ClassLoader classLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>if ("DISTRIBUTED".equals(mode)) {<NEW_LINE>clz = ClassLoaderUtil.loadClass(classLoader, CACHE_REGION_FACTORY);<NEW_LINE>} else if ("LOCAL".equals(mode)) {<NEW_LINE>clz = ClassLoaderUtil.loadClass(classLoader, LOCAL_CACHE_REGION_FACTORY);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown Hibernate L2 cache mode: " + mode);<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>ExceptionUtil.sneakyThrow(e);<NEW_LINE>}<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(clz);<NEW_LINE>builder.addConstructorArgReference(instanceRefName);<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>} | NamedNodeMap attributes = element.getAttributes(); |
1,663,140 | final GetServerDetailsResult executeGetServerDetails(GetServerDetailsRequest getServerDetailsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServerDetailsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServerDetailsRequest> request = null;<NEW_LINE>Response<GetServerDetailsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServerDetailsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServerDetailsRequest));<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, "MigrationHubStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServerDetails");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetServerDetailsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServerDetailsResultJsonUnmarshaller());<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); |
1,321,729 | public com.amazonaws.services.applicationdiscovery.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.applicationdiscovery.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.applicationdiscovery.model.ResourceNotFoundException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceNotFoundException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,706,062 | public Xid[] recover(int flag) throws XAException {<NEW_LINE>NodeEngine nodeEngine = getNodeEngine();<NEW_LINE>XAService xaService = getService();<NEW_LINE>OperationService operationService = nodeEngine.getOperationService();<NEW_LINE>ClusterService clusterService = nodeEngine.getClusterService();<NEW_LINE>Collection<Member> memberList = clusterService.getMembers();<NEW_LINE>List<Future<SerializableList>> futureList = new ArrayList<Future<SerializableList>>();<NEW_LINE>for (Member member : memberList) {<NEW_LINE>if (member.localMember()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>CollectRemoteTransactionsOperation op = new CollectRemoteTransactionsOperation();<NEW_LINE>Address address = member.getAddress();<NEW_LINE>InternalCompletableFuture<SerializableList> future = operationService.invokeOnTarget(SERVICE_NAME, op, address);<NEW_LINE>futureList.add(future);<NEW_LINE>}<NEW_LINE>Set<SerializableXID> xids = new HashSet<SerializableXID>(xaService.getPreparedXids());<NEW_LINE>for (Future<SerializableList> future : futureList) {<NEW_LINE>try {<NEW_LINE>SerializableList xidSet = future.get();<NEW_LINE>for (Data xidData : xidSet) {<NEW_LINE>SerializableXID xid = nodeEngine.toObject(xidData);<NEW_LINE>xids.add(xid);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>currentThread().interrupt();<NEW_LINE>throw new XAException(XAException.XAER_RMERR);<NEW_LINE>} catch (MemberLeftException e) {<NEW_LINE><MASK><NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause instanceof HazelcastInstanceNotActiveException || cause instanceof TargetNotMemberException) {<NEW_LINE>logger.warning("Member left while recovering", e);<NEW_LINE>} else {<NEW_LINE>throw new XAException(XAException.XAER_RMERR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return xids.toArray(new SerializableXID[0]);<NEW_LINE>} | logger.warning("Member left while recovering", e); |
1,688,840 | public VoiceGatewayPayload<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {<NEW_LINE>JsonNode json = p.getCodec().readTree(p);<NEW_LINE>int op = json.get("op").asInt();<NEW_LINE>JsonNode d = json.get("d");<NEW_LINE>switch(op) {<NEW_LINE>case Hello.OP:<NEW_LINE>return new Hello(d.get<MASK><NEW_LINE>case Ready.OP:<NEW_LINE>return new Ready(d.get("ssrc").asInt(), d.get("ip").asText(), d.get("port").asInt());<NEW_LINE>case HeartbeatAck.OP:<NEW_LINE>return new HeartbeatAck(d.asLong());<NEW_LINE>case SessionDescription.OP:<NEW_LINE>ArrayNode arrayNode = ((ArrayNode) d.get("secret_key"));<NEW_LINE>byte[] secret_key = p.getCodec().readValue(arrayNode.traverse(p.getCodec()), byte[].class);<NEW_LINE>return new SessionDescription(d.get("mode").asText(), secret_key);<NEW_LINE>case Speaking.OP:<NEW_LINE>return new Speaking(d.get("user_id").asText(), d.get("ssrc").asInt(), d.get("speaking").asBoolean());<NEW_LINE>case VoiceDisconnect.OP:<NEW_LINE>return new VoiceDisconnect(d.get("user_id").asText());<NEW_LINE>case Resumed.OP:<NEW_LINE>// actually "d": null<NEW_LINE>return new Resumed(d.asText());<NEW_LINE>default:<NEW_LINE>LOG.debug("Received voice gateway payload with unhandled OP: {}", op);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ("heartbeat_interval").asLong()); |
1,476,254 | public static List<JComponent> createTextTitles(@Nonnull ContentDiffRequest request, @Nonnull List<? extends Editor> editors) {<NEW_LINE>List<DiffContent> contents = request.getContents();<NEW_LINE>List<String> titles = request.getContentTitles();<NEW_LINE>boolean equalCharsets = TextDiffViewerUtil.areEqualCharsets(contents);<NEW_LINE>boolean equalSeparators = TextDiffViewerUtil.areEqualLineSeparators(contents);<NEW_LINE>List<JComponent> result = new ArrayList<>(contents.size());<NEW_LINE>if (equalCharsets && equalSeparators && !ContainerUtil.exists(titles, Condition.NOT_NULL)) {<NEW_LINE>return Collections.nCopies(<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < contents.size(); i++) {<NEW_LINE>JComponent title = createTitle(StringUtil.notNullize(titles.get(i)), contents.get(i), equalCharsets, equalSeparators, editors.get(i));<NEW_LINE>title = createTitleWithNotifications(title, contents.get(i));<NEW_LINE>result.add(title);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | titles.size(), null); |
71,266 | public ApiResponse<Void> recycleBinDeleteRecycleBinItemWithHttpInfo(String id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling recycleBinDeleteRecycleBinItem");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/recyclebin/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.