idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
300,167 | public void forEveryEdge(EdgeVisitor visitor) {<NEW_LINE>int tmpNode = getFromNode();<NEW_LINE>int len = edgeIds.size();<NEW_LINE>int prevEdgeId = EdgeIterator.NO_EDGE;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>EdgeIteratorState edgeBase = graph.getEdgeIteratorState(edgeIds.get(i), tmpNode);<NEW_LINE>if (edgeBase == null)<NEW_LINE>throw new IllegalStateException("Edge " + edgeIds.get(i) + " was empty when requested with node " + tmpNode + ", array index:" + i + ", edges:" + edgeIds.size());<NEW_LINE>tmpNode = edgeBase.getBaseNode();<NEW_LINE>// more efficient swap, currently not implemented for virtual edges: visitor.next(edgeBase.detach(true), i);<NEW_LINE>edgeBase = graph.getEdgeIteratorState(<MASK><NEW_LINE>visitor.next(edgeBase, i, prevEdgeId);<NEW_LINE>prevEdgeId = edgeBase.getEdge();<NEW_LINE>}<NEW_LINE>visitor.finish();<NEW_LINE>} | edgeBase.getEdge(), tmpNode); |
515,251 | private void actOnLogin(PostLoginEvent event) {<NEW_LINE>ProxiedPlayer player = event.getPlayer();<NEW_LINE>UUID playerUUID = player.getUniqueId();<NEW_LINE>String playerName = player.getName();<NEW_LINE>InetAddress address = player<MASK><NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>ActiveSession session = new ActiveSession(playerUUID, serverInfo.getServerUUID(), time, null, null);<NEW_LINE>session.getExtraData().put(PlayerName.class, new PlayerName(playerName));<NEW_LINE>session.getExtraData().put(ServerName.class, new ServerName("Proxy Server"));<NEW_LINE>sessionCache.cacheSession(playerUUID, session);<NEW_LINE>Database database = dbSystem.getDatabase();<NEW_LINE>boolean gatheringGeolocations = config.isTrue(DataGatheringSettings.GEOLOCATIONS);<NEW_LINE>if (gatheringGeolocations) {<NEW_LINE>database.executeTransaction(new GeoInfoStoreTransaction(playerUUID, address, time, geolocationCache::getCountry));<NEW_LINE>}<NEW_LINE>database.executeTransaction(new PlayerRegisterTransaction(playerUUID, () -> time, playerName));<NEW_LINE>processing.submitNonCritical(() -> extensionService.updatePlayerValues(playerUUID, playerName, CallEvents.PLAYER_JOIN));<NEW_LINE>if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) {<NEW_LINE>processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName));<NEW_LINE>}<NEW_LINE>} | .getAddress().getAddress(); |
1,104,476 | public void execute() throws MojoExecutionException, MojoFailureException {<NEW_LINE>// Make an early exit if we're not supposed to generate the APK<NEW_LINE>if (!generateApk) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConfigHandler cfh = new ConfigHandler(this, this.session, this.execution);<NEW_LINE>cfh.parseConfiguration();<NEW_LINE>generateIntermediateApk();<NEW_LINE>// Compile resource exclusion patterns, if any<NEW_LINE>if (excludeJarResources != null && excludeJarResources.length > 0) {<NEW_LINE>getLog().debug("Compiling " + excludeJarResources.length + " patterns");<NEW_LINE>excludeJarResourcesPatterns = new Pattern[excludeJarResources.length];<NEW_LINE>for (int index = 0; index < excludeJarResources.length; ++index) {<NEW_LINE>excludeJarResourcesPatterns[index] = Pattern.compile(excludeJarResources[index]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Initialize apk build configuration<NEW_LINE>File outputFile = new File(outputApk);<NEW_LINE>final boolean signWithDebugKeyStore = getAndroidSigner().isSignWithDebugKeyStore();<NEW_LINE>if (getAndroidSigner().shouldCreateBothSignedAndUnsignedApk()) {<NEW_LINE>getLog().info("Creating debug key signed apk file " + outputFile);<NEW_LINE>createApkFile(outputFile, true);<NEW_LINE>final File unsignedOutputFile = new File(targetDirectory, finalName + "-unsigned." + APK);<NEW_LINE>getLog(<MASK><NEW_LINE>createApkFile(unsignedOutputFile, false);<NEW_LINE>projectHelper.attachArtifact(project, unsignedOutputFile, classifier == null ? "unsigned" : classifier + "_unsigned");<NEW_LINE>} else {<NEW_LINE>createApkFile(outputFile, signWithDebugKeyStore);<NEW_LINE>}<NEW_LINE>if (classifier == null) {<NEW_LINE>// Set the generated .apk file as the main artifact (because the pom states <packaging>apk</packaging>)<NEW_LINE>project.getArtifact().setFile(outputFile);<NEW_LINE>} else {<NEW_LINE>// If there is a classifier specified, attach the artifact using that<NEW_LINE>projectHelper.attachArtifact(project, AndroidExtension.APK, classifier, outputFile);<NEW_LINE>}<NEW_LINE>} | ).info("Creating additional unsigned apk file " + unsignedOutputFile); |
1,636,144 | private void replayRecording(final long recordingLength, final long recordingId) {<NEW_LINE>try (Subscription subscription = aeronArchive.replay(recordingId, 0L, recordingLength, REPLAY_URI, REPLAY_STREAM_ID)) {<NEW_LINE>final IdleStrategy idleStrategy = SampleConfiguration.newIdleStrategy();<NEW_LINE>while (!subscription.isConnected()) {<NEW_LINE>idleStrategy.idle();<NEW_LINE>}<NEW_LINE>messageCount = 0;<NEW_LINE>final Image image = subscription.imageAtIndex(0);<NEW_LINE>final ImageFragmentAssembler fragmentAssembler = new ImageFragmentAssembler(this::onMessage);<NEW_LINE>while (messageCount < NUMBER_OF_MESSAGES) {<NEW_LINE>final int fragments = image.poll(fragmentAssembler, FRAGMENT_COUNT_LIMIT);<NEW_LINE>if (0 == fragments && image.isClosed()) {<NEW_LINE>System.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>idleStrategy.idle(fragments);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.println("\n*** unexpected end of stream at message count: " + messageCount); |
940,225 | protected void sync() {<NEW_LINE>inSync = true;<NEW_LINE>WSDLComponent secBinding = null;<NEW_LINE>WSDLComponent topSecBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>WSDLComponent protTokenKind = SecurityTokensModelHelper.getTokenElement(topSecBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent protToken = SecurityTokensModelHelper.getTokenTypeElement(protTokenKind);<NEW_LINE>boolean secConv = (protToken instanceof SecureConversationToken);<NEW_LINE>setChBox(secConvChBox, secConv);<NEW_LINE>if (secConv) {<NEW_LINE>WSDLComponent bootPolicy = SecurityTokensModelHelper.getTokenElement(protToken, BootstrapPolicy.class);<NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(bootPolicy);<NEW_LINE>Policy p = (Policy) secBinding.getParent();<NEW_LINE>setChBox(derivedKeysChBox, SecurityPolicyModelHelper.isRequireDerivedKeys(protToken));<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(p));<NEW_LINE>setChBox(encryptSignatureChBox<MASK><NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(bootPolicy));<NEW_LINE>} else {<NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>setChBox(derivedKeysChBox, false);<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(comp));<NEW_LINE>setChBox(encryptSignatureChBox, SecurityPolicyModelHelper.isEncryptSignature(comp));<NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(comp));<NEW_LINE>}<NEW_LINE>WSDLComponent tokenKind = SecurityTokensModelHelper.getTokenElement(secBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent token = SecurityTokensModelHelper.getTokenTypeElement(tokenKind);<NEW_LINE>setCombo(tokenTypeCombo, SecurityTokensModelHelper.getIssuedTokenType(token));<NEW_LINE>setCombo(keyTypeCombo, SecurityTokensModelHelper.getIssuedKeyType(token));<NEW_LINE>fillKeySize(keySizeCombo, ComboConstants.ISSUED_KEYTYPE_PUBLIC.equals(keyTypeCombo.getSelectedItem()));<NEW_LINE>setCombo(keySizeCombo, SecurityTokensModelHelper.getIssuedKeySize(token));<NEW_LINE>issuerAddressField.setText(SecurityTokensModelHelper.getIssuedIssuerAddress(token));<NEW_LINE>issuerMetadataField.setText(SecurityTokensModelHelper.getIssuedIssuerMetadataAddress(token));<NEW_LINE>setChBox(reqDerivedKeys, SecurityPolicyModelHelper.isRequireDerivedKeys(token));<NEW_LINE>setCombo(algoSuiteCombo, AlgoSuiteModelHelper.getAlgorithmSuite(secBinding));<NEW_LINE>setCombo(layoutCombo, SecurityPolicyModelHelper.getMessageLayout(secBinding));<NEW_LINE>enableDisable();<NEW_LINE>inSync = false;<NEW_LINE>} | , SecurityPolicyModelHelper.isEncryptSignature(bootPolicy)); |
760,719 | public com.amazonaws.services.sso.model.UnauthorizedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.sso.model.UnauthorizedException unauthorizedException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unauthorizedException;<NEW_LINE>} | sso.model.UnauthorizedException(null); |
1,428,773 | private TrackedEventMessage<?> doConsumeNext() {<NEW_LINE>HashMap<String, TrackedEventMessage<?>> candidateMessagesToReturn = new HashMap<>();<NEW_LINE>peekForMessages(candidateMessagesToReturn);<NEW_LINE>// select message to return from candidates<NEW_LINE>final Optional<Map.Entry<String, TrackedEventMessage<?>>> chosenMessage = candidateMessagesToReturn.entrySet().stream().min(trackedEventComparator);<NEW_LINE>// Ensure the chosen message is actually consumed from the stream<NEW_LINE>return chosenMessage.map(e -> {<NEW_LINE>String streamId = e.getKey();<NEW_LINE>TrackedEventMessage<?> message = e.getValue();<NEW_LINE>try {<NEW_LINE>MultiSourceTrackingToken advancedToken = this.trackingToken.advancedTo(<MASK><NEW_LINE>return messageSource(streamId).nextAvailable().withTrackingToken(advancedToken);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>logger.warn("Thread Interrupted whilst consuming next message", ex);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}).orElse(null);<NEW_LINE>} | streamId, message.trackingToken()); |
1,268,189 | public com.amazonaws.services.appintegrations.model.ThrottlingException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.appintegrations.model.ThrottlingException throttlingException = new com.amazonaws.services.appintegrations.model.ThrottlingException(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 throttlingException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,704,892 | public void onApplicationEvent(@NotNull ApplicationReadyEvent applicationReadyEvent) {<NEW_LINE>UpstreamCluster brokerCluster = upstreamManager.findBroker();<NEW_LINE>if (brokerCluster == null)<NEW_LINE>return;<NEW_LINE>// rsocket broker cluster logic<NEW_LINE>CloudEventImpl<AppStatusEvent> appStatusEventCloudEvent = RSocketCloudEventBuilder.builder(new AppStatusEvent(RSocketAppContext.ID, AppStatusEvent.STATUS_SERVING)).build();<NEW_LINE>LoadBalancedRSocket loadBalancedRSocket = brokerCluster.getLoadBalancedRSocket();<NEW_LINE>// ports update<NEW_LINE>ConfigurableEnvironment env = applicationReadyEvent.getApplicationContext().getEnvironment();<NEW_LINE>int serverPort = Integer.parseInt(env.getProperty("server.port", "0"));<NEW_LINE>if (serverPort == 0) {<NEW_LINE>if (RSocketAppContext.webPort > 0 || RSocketAppContext.managementPort > 0 || RSocketAppContext.rsocketPorts != null) {<NEW_LINE>PortsUpdateEvent portsUpdateEvent = new PortsUpdateEvent();<NEW_LINE>portsUpdateEvent.setAppId(RSocketAppContext.ID);<NEW_LINE>portsUpdateEvent.setWebPort(RSocketAppContext.webPort);<NEW_LINE>portsUpdateEvent.setManagementPort(RSocketAppContext.managementPort);<NEW_LINE>portsUpdateEvent.setRsocketPorts(RSocketAppContext.rsocketPorts);<NEW_LINE>CloudEventImpl<PortsUpdateEvent> portsUpdateCloudEvent = RSocketCloudEventBuilder.builder(portsUpdateEvent).build();<NEW_LINE>loadBalancedRSocket.fireCloudEventToUpstreamAll(portsUpdateCloudEvent).doOnSuccess(aVoid -> log.info(RsocketErrorCode.message("RST-301200", loadBalancedRSocket.getActiveUris()))).subscribe();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// app status<NEW_LINE>loadBalancedRSocket.fireCloudEventToUpstreamAll(appStatusEventCloudEvent).doOnSuccess(aVoid -> log.info(RsocketErrorCode.message("RST-301200", loadBalancedRSocket.getActiveUris()))).subscribe();<NEW_LINE>// service exposed<NEW_LINE>CloudEventImpl<ServicesExposedEvent> servicesExposedEventCloudEvent = rsocketRequesterSupport<MASK><NEW_LINE>if (servicesExposedEventCloudEvent != null) {<NEW_LINE>loadBalancedRSocket.fireCloudEventToUpstreamAll(servicesExposedEventCloudEvent).doOnSuccess(aVoid -> {<NEW_LINE>String exposedServices = rsocketRequesterSupport.exposedServices().get().stream().map(ServiceLocator::getGsv).collect(Collectors.joining(","));<NEW_LINE>log.info(RsocketErrorCode.message("RST-301201", exposedServices, loadBalancedRSocket.getActiveUris()));<NEW_LINE>}).subscribe();<NEW_LINE>}<NEW_LINE>} | .servicesExposedEvent().get(); |
1,047,329 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create table varagg as (" + "key string primary key, total sum(int))", path);<NEW_LINE>env.compileDeploy("into table varagg " + "select sum(intPrimitive) as total from SupportBean group by theString", path);<NEW_LINE>env.compileDeploy("@name('s0') on SupportBean_S0 select total as value from varagg where key = p00", path).addListener("s0");<NEW_LINE>assertValues(env, "G1,G2", new Integer[] { null, null });<NEW_LINE>env.sendEventBean(new SupportBean("G1", 100));<NEW_LINE>assertValues(env, "G1,G2", new Integer[] { 100, null });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("G2", 200));<NEW_LINE>assertValues(env, "G1,G2", new Integer[] { 100, 200 });<NEW_LINE>env.compileDeploy("@name('i1') on SupportBean_S1 select total from varagg where key = p10", path).addListener("i1");<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(0, "G2"));<NEW_LINE>env.assertEqualsNew("i1", "total", 500);<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBean("G2", 300)); |
206,948 | public void enableSGR(SGR sgr) throws IOException {<NEW_LINE>switch(sgr) {<NEW_LINE>case BLINK:<NEW_LINE>writeCSISequenceToTerminal((byte) '5', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case BOLD:<NEW_LINE>writeCSISequenceToTerminal((byte) '1', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case BORDERED:<NEW_LINE>writeCSISequenceToTerminal((byte) '5', (byte) '1', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case CIRCLED:<NEW_LINE>writeCSISequenceToTerminal((byte) '5', (byte<MASK><NEW_LINE>break;<NEW_LINE>case CROSSED_OUT:<NEW_LINE>writeCSISequenceToTerminal((byte) '9', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case FRAKTUR:<NEW_LINE>writeCSISequenceToTerminal((byte) '2', (byte) '0', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case REVERSE:<NEW_LINE>writeCSISequenceToTerminal((byte) '7', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case UNDERLINE:<NEW_LINE>writeCSISequenceToTerminal((byte) '4', (byte) 'm');<NEW_LINE>break;<NEW_LINE>case ITALIC:<NEW_LINE>writeCSISequenceToTerminal((byte) '3', (byte) 'm');<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | ) '2', (byte) 'm'); |
44,959 | 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>logger.info("Using master with URL: {}", args[0]);<NEW_LINE>}<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {<NEW_LINE>String namespace = "default";<NEW_LINE>logger.info("Using namespace: {}", namespace);<NEW_LINE>Pod pod = client.pods().inNamespace(namespace).load(PortForwardExample.class.getResourceAsStream("/portforward-example-pod.yml")).get();<NEW_LINE>final String podName = pod.getMetadata().getName();<NEW_LINE>client.pods().inNamespace(namespace).create(pod);<NEW_LINE>logger.info("Pod {} created", podName);<NEW_LINE>int containerPort = pod.getSpec().getContainers().get(0).getPorts().get(0).getContainerPort();<NEW_LINE>client.pods().inNamespace(namespace).withName(podName).waitUntilReady(10, TimeUnit.SECONDS);<NEW_LINE>InetAddress inetAddress = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 });<NEW_LINE>LocalPortForward portForward = client.pods().inNamespace("default").withName("testpod").portForward(containerPort, inetAddress, 8080);<NEW_LINE>logger.info("Port forwarded for 60 seconds at http://127.0.0.1:{}", portForward.getLocalPort());<NEW_LINE>logger.info("Checking forwarded port:-");<NEW_LINE>final ResponseBody responseBody = new OkHttpClient().newCall(new Request.Builder().get().url("http://127.0.0.1:" + portForward.getLocalPort()).build()).execute().body();<NEW_LINE>logger.info("Response: \n{}", responseBody != null ? responseBody.string() : "[Empty Body]");<NEW_LINE><MASK><NEW_LINE>logger.info("Closing forwarded port");<NEW_LINE>portForward.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Exception occurred: {}", e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | Thread.sleep(60 * 1000L); |
181,969 | public void bootstrapPeriodic(final KeycloakSessionFactory sessionFactory, final TimerProvider timer) {<NEW_LINE>KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(KeycloakSession session) {<NEW_LINE>Stream<RealmModel> realms = session.realms().getRealmsWithProviderTypeStream(UserStorageProvider.class);<NEW_LINE>realms.forEach(realm -> {<NEW_LINE>Stream<UserStorageProviderModel> providers = realm.getUserStorageProvidersStream();<NEW_LINE>providers.forEachOrdered(provider -> {<NEW_LINE>UserStorageProviderFactory factory = (UserStorageProviderFactory) session.getKeycloakSessionFactory().getProviderFactory(UserStorageProvider.class, provider.getProviderId());<NEW_LINE>if (factory instanceof ImportSynchronization && provider.isImportEnabled()) {<NEW_LINE>refreshPeriodicSyncForProvider(sessionFactory, timer, provider, realm.getId());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>ClusterProvider clusterProvider = session.getProvider(ClusterProvider.class);<NEW_LINE>clusterProvider.registerListener(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | USER_STORAGE_TASK_KEY, new UserStorageClusterListener(sessionFactory)); |
1,319,043 | public Object eval(final HttpServletRequest request, final HttpServletResponse response, final Reader velocityReader, final Map<String, Object> contextParams) {<NEW_LINE>final Context context = null == request || null == response ? com.dotmarketing.util.VelocityUtil.getBasicContext() : VelocityUtil.getInstance().getContext(request, response);<NEW_LINE>contextParams.forEach(context::put);<NEW_LINE>context.put<MASK><NEW_LINE>final StringWriter evalResult = new StringWriter();<NEW_LINE>try {<NEW_LINE>VelocityUtil.getEngine().evaluate(context, evalResult, StringPool.BLANK, velocityReader);<NEW_LINE>} catch (MethodInvocationException e) {<NEW_LINE>if (e.getCause() instanceof DotToolException) {<NEW_LINE>Logger.error(this, "Error evaluating velocity: " + (e.getCause()).getCause().getMessage());<NEW_LINE>throw new DotRuntimeException(e.getCause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return CollectionsUtils.map("output", evalResult, "dotJSON", context.get("dotJSON"));<NEW_LINE>} | ("dotJSON", new DotJSON()); |
454,558 | public Builder mergeFrom(voldemort.client.protocol.pb.VAdminProto.RebalanceStateChangeRequest other) {<NEW_LINE>if (other == voldemort.client.protocol.pb.VAdminProto.RebalanceStateChangeRequest.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (!other.rebalanceTaskList_.isEmpty()) {<NEW_LINE>if (result.rebalanceTaskList_.isEmpty()) {<NEW_LINE>result.rebalanceTaskList_ = new java.util.ArrayList<voldemort.client.protocol.pb.VAdminProto.RebalanceTaskInfoMap>();<NEW_LINE>}<NEW_LINE>result.rebalanceTaskList_.addAll(other.rebalanceTaskList_);<NEW_LINE>}<NEW_LINE>if (other.hasClusterString()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (other.hasStoresString()) {<NEW_LINE>setStoresString(other.getStoresString());<NEW_LINE>}<NEW_LINE>if (other.hasSwapRo()) {<NEW_LINE>setSwapRo(other.getSwapRo());<NEW_LINE>}<NEW_LINE>if (other.hasChangeClusterMetadata()) {<NEW_LINE>setChangeClusterMetadata(other.getChangeClusterMetadata());<NEW_LINE>}<NEW_LINE>if (other.hasChangeRebalanceState()) {<NEW_LINE>setChangeRebalanceState(other.getChangeRebalanceState());<NEW_LINE>}<NEW_LINE>if (other.hasRollback()) {<NEW_LINE>setRollback(other.getRollback());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>} | setClusterString(other.getClusterString()); |
881,292 | public void start() {<NEW_LINE>// Create the channel<NEW_LINE>ManagedChannel channel = VertxChannelBuilder.forAddress(vertx, "localhost", 8080)<MASK><NEW_LINE>// Get a stub to use for interacting with the remote service<NEW_LINE>VertxConversationalServiceGrpc.ConversationalServiceVertxStub stub = VertxConversationalServiceGrpc.newVertxStub(channel);<NEW_LINE>// Make a request<NEW_LINE>Messages.StreamingOutputCallRequest request = Messages.StreamingOutputCallRequest.newBuilder().build();<NEW_LINE>// Call the remote service<NEW_LINE>stub.fullDuplexCall(writeStream -> {<NEW_LINE>// start the conversation<NEW_LINE>writeStream.write(Messages.StreamingOutputCallRequest.newBuilder().build());<NEW_LINE>vertx.setTimer(500L, t -> {<NEW_LINE>writeStream.write(Messages.StreamingOutputCallRequest.newBuilder().build());<NEW_LINE>});<NEW_LINE>}).handler(req -> {<NEW_LINE>System.out.println("Client: received response");<NEW_LINE>});<NEW_LINE>} | .usePlaintext().build(); |
721,773 | final DescribeListenerResult executeDescribeListener(DescribeListenerRequest describeListenerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeListenerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeListenerRequest> request = null;<NEW_LINE>Response<DescribeListenerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeListenerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeListenerRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeListener");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeListenerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeListenerResultJsonUnmarshaller());<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()); |
680,249 | private Double realOperator(Object[] args) {<NEW_LINE>Object arg0 = args[0];<NEW_LINE>Object arg1 = args[1];<NEW_LINE>Double value = DataTypes.DoubleType.convertFrom(arg0);<NEW_LINE>boolean isArg1Unsigned = operandTypes.get(1) instanceof ULongType || arg1 instanceof UInt64 || arg1 instanceof BigInteger;<NEW_LINE>Object decObj = isArg1Unsigned ? DataTypes.ULongType.convertFrom(arg1) : <MASK><NEW_LINE>long dec = decObj == null ? 0L : ((Number) decObj).longValue();<NEW_LINE>boolean isDecNeg = dec < 0 && !isArg1Unsigned;<NEW_LINE>long absDec = isDecNeg ? -dec : dec;<NEW_LINE>// tmp2 is here to avoid return the value with 80 bit precision<NEW_LINE>// This will fix that the test round(0.1,1) = round(0.1,1) is true<NEW_LINE>// Tagging with volatile is no guarantee, it may still be optimized away<NEW_LINE>double tmp2;<NEW_LINE>double tmp = Math.pow(10, absDec);<NEW_LINE>double divTmp = value / tmp;<NEW_LINE>double mulTmp = value * tmp;<NEW_LINE>if (isDecNeg && Double.isInfinite(tmp)) {<NEW_LINE>tmp2 = 0.0D;<NEW_LINE>} else if (!isDecNeg && (Double.isInfinite(mulTmp) || Double.isNaN(mulTmp))) {<NEW_LINE>tmp2 = value;<NEW_LINE>} else if (isTruncate()) {<NEW_LINE>if (value >= 0.0D) {<NEW_LINE>tmp2 = dec < 0 ? Math.floor(divTmp) * tmp : Math.floor(mulTmp) / tmp;<NEW_LINE>} else {<NEW_LINE>tmp2 = dec < 0 ? Math.ceil(divTmp) * tmp : Math.ceil(mulTmp) / tmp;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tmp2 = dec < 0 ? Math.rint(divTmp) * tmp : Math.rint(mulTmp) / tmp;<NEW_LINE>}<NEW_LINE>return tmp2;<NEW_LINE>} | DataTypes.LongType.convertFrom(arg1); |
231,425 | private void createPolygons() {<NEW_LINE>// create input polygon 1<NEW_LINE>PointCollection pointsPoly = new PointCollection(SpatialReferences.getWebMercator());<NEW_LINE>pointsPoly.add(new Point(-13160, 6710100));<NEW_LINE>pointsPoly.add(new Point(-13300, 6710500));<NEW_LINE>pointsPoly.add(new Point(-13760, 6710730));<NEW_LINE>pointsPoly.add(new Point(-14660, 6710000));<NEW_LINE>pointsPoly.add(new Point(-13960, 6709400));<NEW_LINE>inputPolygon1 = new Polygon(pointsPoly);<NEW_LINE>// create and add a blue graphic to show input polygon 1<NEW_LINE>SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x990000CC, lineSymbol);<NEW_LINE>inputGeometryOverlay.getGraphics().add(new Graphic(inputPolygon1, fillSymbol));<NEW_LINE>// create input polygon 2 with a green (0xFF009900) symbol<NEW_LINE>// outer ring<NEW_LINE>PointCollection outerRingSegmentCollection = new PointCollection(SpatialReferences.getWebMercator());<NEW_LINE>outerRingSegmentCollection.add(new Point(-13060, 6711030));<NEW_LINE>outerRingSegmentCollection.add(new Point(-12160, 6710730));<NEW_LINE>outerRingSegmentCollection.add(new Point(-13160, 6709700));<NEW_LINE>outerRingSegmentCollection.add(new Point(-14560, 6710730));<NEW_LINE>outerRingSegmentCollection.add(new Point(-13060, 6711030));<NEW_LINE>Part outerRing = new Part(outerRingSegmentCollection);<NEW_LINE>// inner ring<NEW_LINE>PointCollection innerRingSegmentCollection = new PointCollection(SpatialReferences.getWebMercator());<NEW_LINE>innerRingSegmentCollection.add(new <MASK><NEW_LINE>innerRingSegmentCollection.add(new Point(-12450, 6710660));<NEW_LINE>innerRingSegmentCollection.add(new Point(-13160, 6709900));<NEW_LINE>innerRingSegmentCollection.add(new Point(-14160, 6710630));<NEW_LINE>innerRingSegmentCollection.add(new Point(-13060, 6710910));<NEW_LINE>Part innerRing = new Part(innerRingSegmentCollection);<NEW_LINE>// add both parts (rings) to a part collection and create a geometry from it<NEW_LINE>PartCollection polygonParts = new PartCollection(outerRing);<NEW_LINE>polygonParts.add(innerRing);<NEW_LINE>inputPolygon2 = new Polygon(polygonParts);<NEW_LINE>// create and add a green graphic to show input polygon 2<NEW_LINE>fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x99009900, lineSymbol);<NEW_LINE>inputGeometryOverlay.getGraphics().add(new Graphic(inputPolygon2, fillSymbol));<NEW_LINE>} | Point(-13060, 6710910)); |
246,186 | private AndroidManifest parse(File androidManifestFile, boolean libraryProject) throws AndroidManifestNotFoundException {<NEW_LINE>DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>Document doc;<NEW_LINE>try {<NEW_LINE>DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();<NEW_LINE>doc = docBuilder.parse(androidManifestFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Could not parse the AndroidManifest.xml file at path {}", androidManifestFile, e);<NEW_LINE>throw new AndroidManifestNotFoundException("Could not parse the AndroidManifest.xml file at path {}" + androidManifestFile, e);<NEW_LINE>}<NEW_LINE>Element documentElement = doc.getDocumentElement();<NEW_LINE>documentElement.normalize();<NEW_LINE>String applicationPackage = documentElement.getAttribute("package");<NEW_LINE>int minSdkVersion = -1;<NEW_LINE>int maxSdkVersion = -1;<NEW_LINE>int targetSdkVersion = -1;<NEW_LINE>NodeList sdkNodes = documentElement.getElementsByTagName("uses-sdk");<NEW_LINE>if (sdkNodes.getLength() > 0) {<NEW_LINE>Node sdkNode = sdkNodes.item(0);<NEW_LINE>minSdkVersion = extractAttributeIntValue(sdkNode, "android:minSdkVersion", -1);<NEW_LINE>maxSdkVersion = extractAttributeIntValue(sdkNode, "android:maxSdkVersion", -1);<NEW_LINE>targetSdkVersion = extractAttributeIntValue(sdkNode, "android:targetSdkVersion", -1);<NEW_LINE>}<NEW_LINE>if (libraryProject) {<NEW_LINE>return AndroidManifest.createLibraryManifest(applicationPackage, minSdkVersion, maxSdkVersion, targetSdkVersion);<NEW_LINE>}<NEW_LINE>NodeList applicationNodes = documentElement.getElementsByTagName("application");<NEW_LINE>String applicationClassQualifiedName = null;<NEW_LINE>boolean applicationDebuggableMode = false;<NEW_LINE>if (applicationNodes.getLength() > 0) {<NEW_LINE>Node applicationNode = applicationNodes.item(0);<NEW_LINE>Node nameAttribute = applicationNode.getAttributes().getNamedItem("android:name");<NEW_LINE>applicationClassQualifiedName = manifestNameToValidQualifiedName(applicationPackage, nameAttribute);<NEW_LINE>if (applicationClassQualifiedName == null) {<NEW_LINE>if (nameAttribute != null) {<NEW_LINE>LOGGER.warn("The class application declared in the AndroidManifest.xml cannot be found in the compile path: [{}]", nameAttribute.getNodeValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Node debuggableAttribute = applicationNode.getAttributes().getNamedItem("android:debuggable");<NEW_LINE>if (debuggableAttribute != null) {<NEW_LINE>applicationDebuggableMode = debuggableAttribute.getNodeValue().equalsIgnoreCase("true");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NodeList activityNodes = documentElement.getElementsByTagName("activity");<NEW_LINE>List<String> activityQualifiedNames = extractComponentNames(applicationPackage, activityNodes);<NEW_LINE>NodeList serviceNodes = documentElement.getElementsByTagName("service");<NEW_LINE>List<String> serviceQualifiedNames = extractComponentNames(applicationPackage, serviceNodes);<NEW_LINE>NodeList <MASK><NEW_LINE>List<String> receiverQualifiedNames = extractComponentNames(applicationPackage, receiverNodes);<NEW_LINE>NodeList providerNodes = documentElement.getElementsByTagName("provider");<NEW_LINE>List<String> providerQualifiedNames = extractComponentNames(applicationPackage, providerNodes);<NEW_LINE>List<String> componentQualifiedNames = new ArrayList<>();<NEW_LINE>componentQualifiedNames.addAll(activityQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(serviceQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(receiverQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(providerQualifiedNames);<NEW_LINE>NodeList metaDataNodes = documentElement.getElementsByTagName("meta-data");<NEW_LINE>Map<String, AndroidManifest.MetaDataInfo> metaDataQualifiedNames = extractMetaDataQualifiedNames(metaDataNodes);<NEW_LINE>NodeList usesPermissionNodes = documentElement.getElementsByTagName("uses-permission");<NEW_LINE>List<String> usesPermissionQualifiedNames = extractUsesPermissionNames(usesPermissionNodes);<NEW_LINE>List<String> permissionQualifiedNames = new ArrayList<>();<NEW_LINE>permissionQualifiedNames.addAll(usesPermissionQualifiedNames);<NEW_LINE>return AndroidManifest.createManifest(applicationPackage, applicationClassQualifiedName, componentQualifiedNames, metaDataQualifiedNames, permissionQualifiedNames, minSdkVersion, maxSdkVersion, targetSdkVersion, applicationDebuggableMode);<NEW_LINE>} | receiverNodes = documentElement.getElementsByTagName("receiver"); |
1,387,071 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>msgPanel = new javax.swing.JTextPane();<NEW_LINE>msgPanel.setBackground(new Color(0, 0, 0, 0));<NEW_LINE>// NOI18N<NEW_LINE>msgPanel.setContentType("text/html");<NEW_LINE>msgPanel.setEditable(false);<NEW_LINE>msgPanel.setOpaque(false);<NEW_LINE>msgPanel.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {<NEW_LINE><NEW_LINE>public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {<NEW_LINE>msgPanelHyperlinkUpdate(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jScrollPane1.setViewportView(msgPanel);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE<MASK><NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));<NEW_LINE>} | , 490, Short.MAX_VALUE)); |
949,921 | public boolean pointerReleased(int pointer, float x, float y) {<NEW_LINE>if (skip) {<NEW_LINE>skip = false;<NEW_LINE>return checkPointerHandled(x, y);<NEW_LINE>}<NEW_LINE>if (layoutEditMode == LAYOUT_EOF) {<NEW_LINE>if (pointer > associatedKeys.length) {<NEW_LINE>return checkPointerHandled(x, y);<NEW_LINE>}<NEW_LINE>if (associatedKeys[pointer] != null) {<NEW_LINE>Emulator.pressKey(associatedKeys[pointer].getKeyCode(), 1);<NEW_LINE>if (associatedKeys[pointer].getSecondKeyCode() != 0) {<NEW_LINE>Emulator.pressKey(associatedKeys[pointer<MASK><NEW_LINE>}<NEW_LINE>associatedKeys[pointer].setSelected(false);<NEW_LINE>associatedKeys[pointer] = null;<NEW_LINE>repaint();<NEW_LINE>}<NEW_LINE>} else if (layoutEditMode == LAYOUT_KEYS) {<NEW_LINE>editedIndex = -1;<NEW_LINE>}<NEW_LINE>return checkPointerHandled(x, y);<NEW_LINE>} | ].getSecondKeyCode(), 1); |
1,660,750 | private boolean authenticationWasSuccessful(final HttpServletRequest request, final HttpServletResponse response) throws IOException {<NEW_LINE>final String origin = URIUtil.getName(String.valueOf(request.getRequestURL()));<NEW_LINE>final String code = request.getParameter("code");<NEW_LINE>final String idToken = request.getParameter("id_token");<NEW_LINE>final String <MASK><NEW_LINE>final String signedRequest = request.getParameter("signed_request");<NEW_LINE>final String redirectUrl = request.getRequestURL().toString();<NEW_LINE>final ExternalOAuthCodeToken codeToken = new ExternalOAuthCodeToken(code, origin, redirectUrl, idToken, accessToken, signedRequest, new UaaAuthenticationDetails(request));<NEW_LINE>try {<NEW_LINE>final Authentication authentication = externalOAuthAuthenticationManager.authenticate(codeToken);<NEW_LINE>SecurityContextHolder.getContext().setAuthentication(authentication);<NEW_LINE>ofNullable(successHandler).ifPresent(handler -> handler.setSavedAccountOptionCookie(request, response, authentication));<NEW_LINE>// TODO: :eyes_narrowed:<NEW_LINE>// should be an instance of AuthenticationException<NEW_LINE>// but can we trust it?<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("ExternalOAuth Authentication exception", ex);<NEW_LINE>String message = ex.getMessage();<NEW_LINE>if (!hasText(message)) {<NEW_LINE>message = ex.getClass().getSimpleName();<NEW_LINE>}<NEW_LINE>final String errorMessage = String.format("There was an error when authenticating against the external identity provider: %s", message);<NEW_LINE>request.getSession().setAttribute("oauth_error", errorMessage);<NEW_LINE>response.sendRedirect(request.getContextPath() + "/oauth_error");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | accessToken = request.getParameter("access_token"); |
215,575 | private EventSetDescriptor[] introspectEvents() throws IntrospectionException {<NEW_LINE>// Get descriptors for the public methods<NEW_LINE>// FIXME: performance<NEW_LINE>MethodDescriptor[] theMethods = introspectMethods();<NEW_LINE>if (theMethods == null)<NEW_LINE>return null;<NEW_LINE>HashMap<String, HashMap> eventTable = new HashMap<String<MASK><NEW_LINE>// Search for methods that add an Event Listener<NEW_LINE>for (int i = 0; i < theMethods.length; i++) {<NEW_LINE>introspectListenerMethods(PREFIX_ADD, theMethods[i].getMethod(), eventTable);<NEW_LINE>introspectListenerMethods(PREFIX_REMOVE, theMethods[i].getMethod(), eventTable);<NEW_LINE>introspectGetListenerMethods(theMethods[i].getMethod(), eventTable);<NEW_LINE>}<NEW_LINE>ArrayList<EventSetDescriptor> eventList = new ArrayList<EventSetDescriptor>();<NEW_LINE>for (Map.Entry<String, HashMap> entry : eventTable.entrySet()) {<NEW_LINE>HashMap table = entry.getValue();<NEW_LINE>Method add = (Method) table.get(PREFIX_ADD);<NEW_LINE>Method remove = (Method) table.get(PREFIX_REMOVE);<NEW_LINE>if ((add == null) || (remove == null)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Method get = (Method) table.get(PREFIX_GET);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Class<?> listenerType = (Class) table.get("listenerType");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Method[] listenerMethods = (Method[]) table.get("listenerMethods");<NEW_LINE>EventSetDescriptor eventSetDescriptor = new EventSetDescriptor(decapitalize(entry.getKey()), listenerType, listenerMethods, add, remove, get);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>eventSetDescriptor.setUnicast(table.get("isUnicast") != null);<NEW_LINE>eventList.add(eventSetDescriptor);<NEW_LINE>}<NEW_LINE>EventSetDescriptor[] theEvents = new EventSetDescriptor[eventList.size()];<NEW_LINE>eventList.toArray(theEvents);<NEW_LINE>return theEvents;<NEW_LINE>} | , HashMap>(theMethods.length); |
1,291,320 | final PutCorsPolicyResult executePutCorsPolicy(PutCorsPolicyRequest putCorsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putCorsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutCorsPolicyRequest> request = null;<NEW_LINE>Response<PutCorsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutCorsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putCorsPolicyRequest));<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, "MediaStore");<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<PutCorsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutCorsPolicyResultJsonUnmarshaller());<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, "PutCorsPolicy"); |
730,723 | public static VariantContext trimAlleles(final VariantContext inputVC, final boolean trimForward, final boolean trimReverse) {<NEW_LINE>Utils.nonNull(inputVC);<NEW_LINE>if (inputVC.getNAlleles() <= 1 || inputVC.getAlleles().stream().anyMatch(a -> a.length() == 1 && !a.equals(Allele.SPAN_DEL))) {<NEW_LINE>return inputVC;<NEW_LINE>}<NEW_LINE>final List<byte[]> sequences = inputVC.getAlleles().stream().filter(a -> !a.isSymbolic() && !a.equals(Allele.SPAN_DEL)).map(Allele::getBases).collect(Collectors.toList());<NEW_LINE>final List<IndexRange> ranges = inputVC.getAlleles().stream().filter(a -> !a.isSymbolic() && !a.equals(Allele.SPAN_DEL)).map(a -> new IndexRange(0, a.length())).collect(Collectors.toList());<NEW_LINE>final Pair<Integer, Integer> shifts = AlignmentUtils.normalizeAlleles(sequences, ranges, 0, true);<NEW_LINE>final int endTrim = shifts.getRight();<NEW_LINE>final int startTrim = -shifts.getLeft();<NEW_LINE>final boolean emptyAllele = ranges.stream().anyMatch(r -> r.size() == 0);<NEW_LINE>final boolean restoreOneBaseAtEnd = emptyAllele && startTrim == 0;<NEW_LINE>final <MASK><NEW_LINE>// if the end trimming consumed all the bases, leave one base<NEW_LINE>final int endBasesToClip = restoreOneBaseAtEnd ? endTrim - 1 : endTrim;<NEW_LINE>final int startBasesToClip = restoreOneBaseAtStart ? startTrim - 1 : startTrim;<NEW_LINE>return trimAlleles(inputVC, (trimForward ? startBasesToClip : 0) - 1, trimReverse ? endBasesToClip : 0);<NEW_LINE>} | boolean restoreOneBaseAtStart = emptyAllele && startTrim > 0; |
905,049 | private void propertiesAsJson(HttpServletRequest req, HttpServletResponse res) throws IOException {<NEW_LINE>String[] pathParts = req.<MASK><NEW_LINE>res.setContentType(CONTENT_TYPE_JSON);<NEW_LINE>if (pathParts.length > 3) {<NEW_LINE>String propertyName = pathParts[3];<NEW_LINE>if (getFf4j().getPropertiesStore().existProperty(propertyName)) {<NEW_LINE>Property<?> p = getFf4j().getPropertiesStore().readProperty(propertyName);<NEW_LINE>res.getWriter().println(p.toJson());<NEW_LINE>} else {<NEW_LINE>res.setStatus(WebConstants.STATUS_NOT_FOUND);<NEW_LINE>res.getWriter().println("Property " + propertyName + " does not exist in property store.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Map<String, Property<?>> mapOfFeatures = getFf4j().getPropertiesStore().readAllProperties();<NEW_LINE>StringBuilder sb = new StringBuilder("[");<NEW_LINE>boolean first = true;<NEW_LINE>for (Property<?> myProperty : mapOfFeatures.values()) {<NEW_LINE>if (!first) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>sb.append(myProperty.toJson());<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>sb.append("]");<NEW_LINE>res.getWriter().println(sb.toString());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} | getPathInfo().split("/"); |
353,706 | static public Class<?> loadClass(String classNameOrURI, Class<?> requiredClass) {<NEW_LINE>if (classNameOrURI == null)<NEW_LINE>throw new ARQInternalErrorException("Null classNameorIRI");<NEW_LINE>if (classNameOrURI.startsWith("http:"))<NEW_LINE>return null;<NEW_LINE>if (classNameOrURI.startsWith("urn:"))<NEW_LINE>return null;<NEW_LINE>String className = classNameOrURI;<NEW_LINE>if (classNameOrURI.startsWith(ARQConstants.javaClassURIScheme))<NEW_LINE>className = classNameOrURI.substring(ARQConstants.javaClassURIScheme.length());<NEW_LINE>Class<?> classObj = null;<NEW_LINE>try {<NEW_LINE>classObj = Class.forName(className);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>// It is possible that when coming from a URI we might have<NEW_LINE>// characters which aren't valid as Java identifiers<NEW_LINE>// We should see if we can load the class with the escaped class<NEW_LINE>// name instead<NEW_LINE>String baseUri = className.substring(0, className.lastIndexOf('.') + 1);<NEW_LINE>String escapedClassName = escape(className.substring(className.lastIndexOf('.') + 1));<NEW_LINE>try {<NEW_LINE>classObj = <MASK><NEW_LINE>} catch (ClassNotFoundException innerEx) {<NEW_LINE>// Ignore, handled in the outer catch<NEW_LINE>}<NEW_LINE>if (classObj == null) {<NEW_LINE>Log.warn(ClsLoader.class, "Class not found: " + className);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (requiredClass != null && !requiredClass.isAssignableFrom(classObj)) {<NEW_LINE>Log.warn(ClsLoader.class, "Class '" + className + "' found but not a " + Lib.classShortName(requiredClass));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return classObj;<NEW_LINE>} | Class.forName(baseUri + escapedClassName); |
1,553,709 | private void reconcileAndLogDifference(Applications delta, String reconcileHashCode) throws Throwable {<NEW_LINE>logger.debug("The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry", reconcileHashCode, delta.getAppsHashCode());<NEW_LINE>RECONCILE_HASH_CODES_MISMATCH.increment();<NEW_LINE>long currentUpdateGeneration = fetchRegistryGeneration.get();<NEW_LINE>EurekaHttpResponse<Applications> httpResponse = clientConfig.getRegistryRefreshSingleVipAddress() == null ? eurekaTransport.queryClient.getApplications(remoteRegionsRef.get()) : eurekaTransport.queryClient.getVip(clientConfig.getRegistryRefreshSingleVipAddress(), remoteRegionsRef.get());<NEW_LINE>Applications serverApps = httpResponse.getEntity();<NEW_LINE>if (serverApps == null) {<NEW_LINE>logger.warn("Cannot fetch full registry from the server; reconciliation failure");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fetchRegistryGeneration.compareAndSet(currentUpdateGeneration, currentUpdateGeneration + 1)) {<NEW_LINE>localRegionApps.set(this.filterAndShuffle(serverApps));<NEW_LINE>getApplications().<MASK><NEW_LINE>logger.debug("The Reconcile hashcodes after complete sync up, client : {}, server : {}.", getApplications().getReconcileHashCode(), delta.getAppsHashCode());<NEW_LINE>} else {<NEW_LINE>logger.warn("Not setting the applications map as another thread has advanced the update generation");<NEW_LINE>}<NEW_LINE>} | setVersion(delta.getVersion()); |
478,686 | public final void functionDeclaration() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST functionDeclaration_AST = null;<NEW_LINE>PascalAST tmp87_AST = null;<NEW_LINE>tmp87_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp87_AST);<NEW_LINE>match(FUNCTION);<NEW_LINE>identifier();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case LPAREN:<NEW_LINE>{<NEW_LINE>formalParameterList();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case COLON:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>match(COLON);<NEW_LINE>resultType();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>match(SEMI);<NEW_LINE>block();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>functionDeclaration_AST = (PascalAST) currentAST.root;<NEW_LINE>returnAST = functionDeclaration_AST;<NEW_LINE>} | (1), getFilename()); |
661,676 | public com.amazonaws.services.organizations.model.HandshakeConstraintViolationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.organizations.model.HandshakeConstraintViolationException handshakeConstraintViolationException = new com.amazonaws.services.organizations.model.HandshakeConstraintViolationException(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>if (context.testExpression("Reason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>handshakeConstraintViolationException.setReason(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 handshakeConstraintViolationException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
446,017 | private void dfsAggregations(Terms terms, ESResultSet rs, List<Object> row) throws SQLException {<NEW_LINE>List<Object> currentRow = Utils.clone(row);<NEW_LINE>String columnName = terms.getName();<NEW_LINE>if (!rs.getHeading().hasLabel(columnName))<NEW_LINE>throw new SQLException("Unable to identify column for aggregation named " + columnName);<NEW_LINE>Column aggCol = rs.getHeading().getColumnByLabel(columnName);<NEW_LINE>for (Terms.Bucket bucket : terms.getBuckets()) {<NEW_LINE>boolean metricAggs = false;<NEW_LINE>List<Aggregation> aggs = bucket.getAggregations().asList();<NEW_LINE>if (aggs.size() == 0) {<NEW_LINE>currentRow.set(aggCol.getIndex(), bucket.getKey());<NEW_LINE>metricAggs = true;<NEW_LINE>} else<NEW_LINE>for (Aggregation agg : bucket.getAggregations().asList()) {<NEW_LINE>if (agg instanceof Terms) {<NEW_LINE>currentRow.set(aggCol.getIndex(), bucket.getKey());<NEW_LINE>dfsAggregations((Terms) agg, rs, currentRow);<NEW_LINE>} else {<NEW_LINE>if (metricAggs == false) {<NEW_LINE>currentRow.set(aggCol.getIndex(), bucket.getKey());<NEW_LINE>metricAggs = true;<NEW_LINE>}<NEW_LINE>String metricName = agg.getName();<NEW_LINE>if (!rs.getHeading().hasLabel(metricName))<NEW_LINE>throw new SQLException("Unable to identify column for aggregation named " + metricName);<NEW_LINE>Column metricCol = rs.<MASK><NEW_LINE>currentRow.set(metricCol.getIndex(), agg.getProperty("value"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metricAggs) {<NEW_LINE>rs.add(currentRow);<NEW_LINE>currentRow = Utils.clone(row);<NEW_LINE>}<NEW_LINE>currentRow = Utils.clone(row);<NEW_LINE>}<NEW_LINE>} | getHeading().getColumnByLabel(metricName); |
164,524 | final DeleteSimulationApplicationResult executeDeleteSimulationApplication(DeleteSimulationApplicationRequest deleteSimulationApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSimulationApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSimulationApplicationRequest> request = null;<NEW_LINE>Response<DeleteSimulationApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteSimulationApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSimulationApplicationRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSimulationApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSimulationApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSimulationApplicationResultJsonUnmarshaller());<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); |
1,363,822 | private TaskResult processAttempt(StoredSessionAttempt attempt, Config lastStateParams, OptionRerunOn rerunOn, boolean ignoreFailure) {<NEW_LINE>if (attempt.getStateFlags().isDone()) {<NEW_LINE>// A flag to distinguish whether the attempt is kicked by require> or previous attempt.<NEW_LINE>boolean requireKicked = lastStateParams.get(<MASK><NEW_LINE>if (!requireKicked && (rerunOn == OptionRerunOn.ALL || rerunOn == OptionRerunOn.FAILED && !attempt.getStateFlags().isSuccess())) {<NEW_LINE>// To force run, set flag gen_retry_attempt_name and do polling<NEW_LINE>throw nextPolling(lastStateParams.deepCopy().set("rerun_on_retry_attempt_name", UUID.randomUUID().toString()));<NEW_LINE>}<NEW_LINE>if (!ignoreFailure && !attempt.getStateFlags().isSuccess()) {<NEW_LINE>// ignore_failure is false and the attempt is in error state. Make this operator failed.<NEW_LINE>throw new TaskExecutionException(String.format(ENGLISH, "Dependent workflow failed. Session id: %d, attempt id: %d", attempt.getSessionId(), attempt.getId()));<NEW_LINE>}<NEW_LINE>return TaskResult.empty(cf);<NEW_LINE>} else {<NEW_LINE>// Wait for finish running attempt<NEW_LINE>throw nextPolling(lastStateParams.deepCopy());<NEW_LINE>}<NEW_LINE>} | "require_kicked", boolean.class, false); |
1,777,582 | public void parseLight(IElementType t, PsiBuilder b) {<NEW_LINE>boolean r;<NEW_LINE>b = adapt_builder_(t, b, this, null);<NEW_LINE>Marker m = enter_section_(b, 0, _COLLAPSE_, null);<NEW_LINE>if (t == BIT_STRING) {<NEW_LINE>r = bitString(b, 0);<NEW_LINE>} else if (t == FUNCTION_REFERENCE) {<NEW_LINE>r = functionReference(b, 0);<NEW_LINE>} else if (t == LAST_TAIL) {<NEW_LINE>r = lastTail(b, 0);<NEW_LINE>} else if (t == LIST) {<NEW_LINE>r = list(b, 0);<NEW_LINE>} else if (t == MAP) {<NEW_LINE>r = map(b, 0);<NEW_LINE>} else if (t == OPERANDS) {<NEW_LINE><MASK><NEW_LINE>} else if (t == OPERATION) {<NEW_LINE>r = operation(b, 0);<NEW_LINE>} else if (t == QUALIFIER) {<NEW_LINE>r = qualifier(b, 0);<NEW_LINE>} else if (t == RELATIVE) {<NEW_LINE>r = relative(b, 0);<NEW_LINE>} else if (t == STRUCT) {<NEW_LINE>r = struct(b, 0);<NEW_LINE>} else if (t == TERM) {<NEW_LINE>r = term(b, 0);<NEW_LINE>} else if (t == TUPLE) {<NEW_LINE>r = tuple(b, 0);<NEW_LINE>} else if (t == VALUES) {<NEW_LINE>r = values(b, 0);<NEW_LINE>} else {<NEW_LINE>r = parse_root_(t, b, 0);<NEW_LINE>}<NEW_LINE>exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);<NEW_LINE>} | r = operands(b, 0); |
1,667,886 | final EnableAddOnResult executeEnableAddOn(EnableAddOnRequest enableAddOnRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableAddOnRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableAddOnRequest> request = null;<NEW_LINE>Response<EnableAddOnResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableAddOnRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableAddOnRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableAddOn");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableAddOnResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableAddOnResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,759,148 | private void storePubKeyEntry(EncryptConfigEntry entry) {<NEW_LINE>FileOutputStream fos = null;<NEW_LINE>ObjectOutputStream p = null;<NEW_LINE>rw.writeLock().lock();<NEW_LINE>try {<NEW_LINE>File file = new File(clientConfig.getConfStoreBasePath() + entry.getUserName() + ".pubKey");<NEW_LINE>if (!file.getParentFile().exists()) {<NEW_LINE>file<MASK><NEW_LINE>}<NEW_LINE>if (!file.exists()) {<NEW_LINE>file.createNewFile();<NEW_LINE>}<NEW_LINE>fos = new FileOutputStream(file);<NEW_LINE>p = new ObjectOutputStream(fos);<NEW_LINE>p.writeObject(entry);<NEW_LINE>p.flush();<NEW_LINE>// p.close();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOGGER.error("store EncryptConfigEntry " + entry.toString() + " exception ", e);<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>if (fos != null) {<NEW_LINE>try {<NEW_LINE>fos.close();<NEW_LINE>} catch (Throwable e2) {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rw.writeLock().unlock();<NEW_LINE>}<NEW_LINE>} | .getParentFile().mkdir(); |
359,662 | public void contextInitialized(GenericServletWrapper.ServletContext servletContext) {<NEW_LINE>final LiquibaseConfiguration liquibaseConfiguration = Scope.getCurrentScope().getSingleton(LiquibaseConfiguration.class);<NEW_LINE>try {<NEW_LINE>this.hostName = NetUtil.getLocalHostName();<NEW_LINE>} catch (Exception e) {<NEW_LINE>servletContext.log(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InitialContext ic = null;<NEW_LINE>String failOnError = null;<NEW_LINE>final ServletConfigurationValueProvider servletConfigurationValueProvider = new ServletConfigurationValueProvider(servletContext, ic);<NEW_LINE>try {<NEW_LINE>ic = new InitialContext();<NEW_LINE>liquibaseConfiguration.registerProvider(servletConfigurationValueProvider);<NEW_LINE>failOnError = (String) liquibaseConfiguration.getCurrentConfiguredValue(null, null, LIQUIBASE_ONERROR_FAIL).getValue();<NEW_LINE>if (checkPreconditions(servletContext, ic)) {<NEW_LINE>executeUpdate(servletContext, ic);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!"false".equals(failOnError)) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (ic != null) {<NEW_LINE>try {<NEW_LINE>ic.close();<NEW_LINE>} catch (NamingException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>liquibaseConfiguration.removeProvider(servletConfigurationValueProvider);<NEW_LINE>}<NEW_LINE>} | "Cannot find hostname: " + e.getMessage()); |
107,031 | private void processParenPad(Map<String, String> moduleProps, Properties props) {<NEW_LINE>String option = getPropertyValue(moduleProps, "option", "nospace");<NEW_LINE>String space = "space".equals(option) ? "true" : "false";<NEW_LINE>List<Token> tokens = getApplicableTokens(moduleProps, "tokens");<NEW_LINE>if (tokens.contains(Token.METHOD_CALL)) {<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_METHOD_CALL_PAREN, space);<NEW_LINE>}<NEW_LINE>if (tokens.contains(Token.LPAREN) || tokens.contains(Token.RPAREN)) {<NEW_LINE><MASK><NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_CAST_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_CATCH_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_FOR_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_IF_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_METHOD_DECL_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_SWITCH_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_SYNC_PAREN, space);<NEW_LINE>props.setProperty(PROP_SPACE_WITHIN_WHILE_PAREN, space);<NEW_LINE>}<NEW_LINE>} | props.setProperty(PROP_SPACE_WITHIN_ANN_PAREN, space); |
238,477 | private void drawArea(Set<MapWaypoint> area, Graphics2D g, JXMapViewer map) {<NEW_LINE>if (area.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean first = true;<NEW_LINE>GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, area.size());<NEW_LINE>for (MapWaypoint wp : area) {<NEW_LINE>Point2D p = map.getTileFactory().geoToPixel(wp.getPosition(<MASK><NEW_LINE>int thisX = (int) p.getX();<NEW_LINE>int thisY = (int) p.getY();<NEW_LINE>if (first) {<NEW_LINE>polygon.moveTo(thisX, thisY);<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>polygon.lineTo(thisX, thisY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>polygon.closePath();<NEW_LINE>Color areaColor = area.iterator().next().getColor();<NEW_LINE>final double maxColorValue = 255.0;<NEW_LINE>g.setPaint(new Color((float) (areaColor.getRed() / maxColorValue), (float) (areaColor.getGreen() / maxColorValue), (float) (areaColor.getBlue() / maxColorValue), .2f));<NEW_LINE>g.fill(polygon);<NEW_LINE>g.draw(polygon);<NEW_LINE>} | ), map.getZoom()); |
1,096,824 | private static boolean createTable(ShardingService shardingService, String schema, String table) {<NEW_LINE>SchemaUtil.SchemaInfo schemaInfo = SchemaUtil.getSchemaInfoWithoutCheck(schema, table);<NEW_LINE>BaseTableConfig tbConfig = schemaInfo.getSchemaConfig().getTables().get(table);<NEW_LINE>String showShardingNode = null;<NEW_LINE>List<String> shardingNodes;<NEW_LINE>if (tbConfig != null) {<NEW_LINE>shardingNodes = tbConfig.getShardingNodes();<NEW_LINE>} else {<NEW_LINE>shardingNodes = schemaInfo.getSchemaConfig().getDefaultShardingNodes();<NEW_LINE>}<NEW_LINE>for (String shardingNode : shardingNodes) {<NEW_LINE>showShardingNode = shardingNode;<NEW_LINE>String tableLackKey = AlertUtil.getTableLackKey(shardingNode, table);<NEW_LINE>if (ToResolveContainer.TABLE_LACK.contains(tableLackKey)) {<NEW_LINE>AlertUtil.alertSelfResolve(AlarmCode.TABLE_LACK, Alert.AlertLevel.WARN, AlertUtil.genSingleLabel("TABLE", tableLackKey), ToResolveContainer.TABLE_LACK, tableLackKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// end to DDLNotifyTableMetaHandler.handlerTable<NEW_LINE>DDLTraceHelper.log(shardingService, d -> d.info(DDLTraceHelper.Stage.update_table_metadata<MASK><NEW_LINE>DDLNotifyTableMetaHandler handler = new DDLNotifyTableMetaHandler(schema, table, Collections.singletonList(showShardingNode), null, true, shardingService);<NEW_LINE>handler.execute();<NEW_LINE>return handler.isMetaInited();<NEW_LINE>} | , DDLTraceHelper.Status.start)); |
797,587 | private static double mergeNoises(double yNoiseIdx, double biomeNoiseV, double depthNoiseV, double upperInterpolationNoiseV, double lowerInterpolationNoiseV, double interpolationNoiseV, double temperatureV, double rainfallV) {<NEW_LINE>// This took a lot of trial and error to get right...<NEW_LINE>double scaledRainfall = 1.0 - rainfallV * temperatureV;<NEW_LINE>double biomeNoiseValue = biomeNoiseV / 512.0 + 0.5;<NEW_LINE>double biomeFactor = Math.max(0, Math.min(1, biomeNoiseValue * (1 - Math.pow<MASK><NEW_LINE>double upperInter = upperInterpolationNoiseV / 512.0;<NEW_LINE>double lowerInter = lowerInterpolationNoiseV / 512.0;<NEW_LINE>double mainInter = interpolationNoiseV / 20.0 + 0.5;<NEW_LINE>double clampedInterpolated = PerlinNoise.lerp(Math.max(0, Math.min(1, mainInter)), upperInter, lowerInter);<NEW_LINE>// Why are there so many conditionals for depth noise???<NEW_LINE>double depth1 = depthNoiseV / 8000.0;<NEW_LINE>double depth2 = depth1 * (depth1 < 0 ? -0.8999999999999999 : 3.0) - 2.0;<NEW_LINE>double depth3 = depth2 < 0 ? Math.max(-2, depth2) / 5.6 : Math.min(1, depth2) / 8.0;<NEW_LINE>double depthAdjustedBiomeFactor = depth2 < 0 ? 0.5 : biomeFactor + 0.5;<NEW_LINE>double depth4 = (NOISE_HEIGHT_OFFSET + yNoiseIdx - VANILLA_NOISE_HEIGHT * (0.5 + depth3 * 0.25)) * 12.0 / depthAdjustedBiomeFactor;<NEW_LINE>double depth5 = depth4 < 0 ? depth4 * 4.0 : depth4;<NEW_LINE>return clampedInterpolated - depth5;<NEW_LINE>} | (scaledRainfall, 4)))); |
999,924 | private static void buildOpenStackMetaData(JsonObject metaData, String dataType, String fileName, String content) {<NEW_LINE>if (!NetworkModel.METATDATA_DIR.equals(dataType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(content)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// keys are a special case in OpenStack format<NEW_LINE>if (NetworkModel.PUBLIC_KEYS_FILE.equals(fileName)) {<NEW_LINE>String[] keyArray = content.replace("\\n"<MASK><NEW_LINE>String keyName = "key";<NEW_LINE>if (keyArray.length > 3 && StringUtils.isNotEmpty(keyArray[2])) {<NEW_LINE>keyName = keyArray[2];<NEW_LINE>}<NEW_LINE>JsonObject keyLegacy = new JsonObject();<NEW_LINE>keyLegacy.addProperty("type", "ssh");<NEW_LINE>keyLegacy.addProperty("data", content.replace("\\n", ""));<NEW_LINE>keyLegacy.addProperty("name", keyName);<NEW_LINE>metaData.add("keys", arrayOf(keyLegacy));<NEW_LINE>JsonObject key = new JsonObject();<NEW_LINE>key.addProperty(keyName, content);<NEW_LINE>metaData.add("public_keys", key);<NEW_LINE>} else if (NetworkModel.openStackFileMapping.get(fileName) != null) {<NEW_LINE>metaData.addProperty(NetworkModel.openStackFileMapping.get(fileName), content);<NEW_LINE>}<NEW_LINE>} | , "").split(" "); |
391,361 | public int updateHmilyTransactionStatus(final Long transId, final Integer status) throws HmilyRepositoryException {<NEW_LINE>byte[] key = buildHmilyTransactionRealPath(transId).getBytes();<NEW_LINE>try {<NEW_LINE>byte[] data = jedisClient.hget(HMILY_TRANSACTION_GLOBAL.getBytes(), key);<NEW_LINE>if (data == null) {<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>}<NEW_LINE>HmilyTransaction hmilyTransaction = hmilySerializer.deSerialize(data, HmilyTransaction.class);<NEW_LINE>hmilyTransaction.setStatus(status);<NEW_LINE>hmilyTransaction.setVersion(hmilyTransaction.getVersion() + 1);<NEW_LINE>hmilyTransaction.setUpdateTime(new Date());<NEW_LINE>jedisClient.hset(HMILY_TRANSACTION_GLOBAL.getBytes(), key<MASK><NEW_LINE>return HmilyRepository.ROWS;<NEW_LINE>} catch (JedisException e) {<NEW_LINE>LOGGER.error("updateHmilyTransactionStatus occur a exception", e);<NEW_LINE>}<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>} | , hmilySerializer.serialize(hmilyTransaction)); |
636,735 | public static void flushCache(@Nullable Integer finishedFile) {<NEW_LINE>if (finishedFile != null && finishedFile == INVALID_FILE_ID)<NEW_LINE>finishedFile = 0;<NEW_LINE>// todo make better (e.g. FinishedFiles striping, remove integers)<NEW_LINE>while (finishedFile == null || !ourFinishedFiles.offer(finishedFile)) {<NEW_LINE>List<Integer> files = new ArrayList<>(ourFinishedFiles.size());<NEW_LINE>ourFinishedFiles.drainTo(files);<NEW_LINE>if (!files.isEmpty()) {<NEW_LINE>for (Integer file : files) {<NEW_LINE>Lock writeLock = getStripedLock(file).writeLock();<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>Timestamps <MASK><NEW_LINE>if (timestamp == null)<NEW_LINE>continue;<NEW_LINE>if (timestamp.isDirty()) /*&& file.isValid()*/<NEW_LINE>{<NEW_LINE>try (DataOutputStream sink = FSRecords.writeAttribute(file, Timestamps.PERSISTENCE)) {<NEW_LINE>timestamp.writeToStream(sink);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (finishedFile == null)<NEW_LINE>break;<NEW_LINE>// else repeat until ourFinishedFiles.offer() succeeds<NEW_LINE>}<NEW_LINE>} | timestamp = myTimestampsCache.remove(file); |
299,596 | private static Map<AnnotatedInterval, CalledCopyRatioSegment.Call> createTumorSegmentsToGermlineTagMap(final Map<AnnotatedInterval, List<AnnotatedInterval>> nonZeroMergedNormalSegmentsToTumorSegments, int paddingInBp, final String callAnnotation, final double reciprocalThreshold) {<NEW_LINE>final Map<AnnotatedInterval, CalledCopyRatioSegment.Call> result = new HashMap<>();<NEW_LINE>for (final AnnotatedInterval normalSeg : nonZeroMergedNormalSegmentsToTumorSegments.keySet()) {<NEW_LINE>final List<AnnotatedInterval> overlappingTumorSegments = nonZeroMergedNormalSegmentsToTumorSegments.get(normalSeg);<NEW_LINE>final List<AnnotatedInterval> mergedTumorSegments = mergedRegionsByAnnotation(callAnnotation, overlappingTumorSegments);<NEW_LINE>final boolean isReciprocalOverlapSeen = mergedTumorSegments.stream().anyMatch(s -> IntervalUtils.isReciprocalOverlap(s.getInterval(), normalSeg.getInterval(), reciprocalThreshold));<NEW_LINE>final boolean isStartPositionSeen = overlappingTumorSegments.stream().anyMatch(s -> Math.abs(s.getStart() - normalSeg.getStart()) <= paddingInBp);<NEW_LINE>final boolean isEndPositionSeen = overlappingTumorSegments.stream().anyMatch(s -> Math.abs(s.getEnd() - normalSeg.getEnd()) <= paddingInBp);<NEW_LINE>if ((isStartPositionSeen && isEndPositionSeen) || isReciprocalOverlapSeen) {<NEW_LINE>final CalledCopyRatioSegment.Call normalCall = Arrays.stream(CalledCopyRatioSegment.Call.values()).filter(c -> c.getOutputString().equals(normalSeg.getAnnotationValue(callAnnotation))).<MASK><NEW_LINE>if (normalCall == null) {<NEW_LINE>throw new UserException.BadInput("No call exists in normal segment. Does normal input have a call field \"" + callAnnotation + "\"?");<NEW_LINE>}<NEW_LINE>result.putAll(overlappingTumorSegments.stream().filter(s -> ((Math.abs(s.getStart() - normalSeg.getStart()) <= paddingInBp) || (Math.abs(normalSeg.getEnd() - s.getEnd()) <= paddingInBp) || ((normalSeg.getStart() < s.getStart()) && (normalSeg.getEnd() > s.getEnd()))) && (normalSeg.getInterval().intersect(s).size() > (s.getInterval().size() * reciprocalThreshold))).collect(Collectors.toMap(Function.identity(), s -> normalCall)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | findFirst().orElse(null); |
1,330,706 | public static void partialReduceLongMax(long[] inputArray, long[] outputArray, int gidx) {<NEW_LINE>int localIdx = PTXIntrinsics.get_local_id(0);<NEW_LINE>int localGroupSize = PTXIntrinsics.get_local_size(0);<NEW_LINE>int groupID = PTXIntrinsics.get_group_id(0);<NEW_LINE>long[] localArray = (long[]) NewArrayNode.<MASK><NEW_LINE>localArray[localIdx] = inputArray[gidx];<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>PTXIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] = TornadoMath.max(localArray[localIdx], localArray[localIdx + stride]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PTXIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID + 1] = localArray[0];<NEW_LINE>}<NEW_LINE>} | newUninitializedArray(long.class, LOCAL_WORK_GROUP_SIZE); |
1,284,603 | public static Map<String, Object> retrieveItems(String prefix, Map<String, Object> propertieMap) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>if (!prefix.isEmpty()) {<NEW_LINE>prefix += ".";<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Object> entry : propertieMap.entrySet()) {<NEW_LINE>if (entry.getValue() instanceof Map) {<NEW_LINE>result.putAll(retrieveItems(prefix + entry.getKey(), (Map<String, Object>) entry.getValue()));<NEW_LINE>} else {<NEW_LINE>String key = prefix + entry.getKey();<NEW_LINE>if (key.startsWith(CONFIG_CSE_PREFIX)) {<NEW_LINE>String servicecombKey = CONFIG_SERVICECOMB_PREFIX + key.substring(key.indexOf(".") + 1);<NEW_LINE>result.put(servicecombKey, entry.getValue());<NEW_LINE>}<NEW_LINE>result.put(key, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = new LinkedHashMap<>(); |
239,852 | protected void initWhereExpr(Expr whereExpr, Analyzer analyzer) throws UserException {<NEW_LINE>if (whereExpr == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, SlotDescriptor> dstDescMap = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>for (SlotDescriptor slotDescriptor : desc.getSlots()) {<NEW_LINE>dstDescMap.put(slotDescriptor.getColumn().getName(), slotDescriptor);<NEW_LINE>}<NEW_LINE>// substitute SlotRef in filter expression<NEW_LINE>// where expr must be equal first to transfer some predicates(eg: BetweenPredicate to BinaryPredicate)<NEW_LINE>whereExpr = analyzer.getExprRewriter().rewrite(whereExpr, analyzer);<NEW_LINE>List<SlotRef> slots = Lists.newArrayList();<NEW_LINE>whereExpr.collect(SlotRef.class, slots);<NEW_LINE>ExprSubstitutionMap smap = new ExprSubstitutionMap();<NEW_LINE>for (SlotRef slot : slots) {<NEW_LINE>SlotDescriptor slotDesc = dstDescMap.get(slot.getColumnName());<NEW_LINE>if (slotDesc == null) {<NEW_LINE>throw new UserException("unknown column reference in where statement, reference=" + slot.getColumnName());<NEW_LINE>}<NEW_LINE>smap.getLhs().add(slot);<NEW_LINE>smap.getRhs().add(new SlotRef(slotDesc));<NEW_LINE>}<NEW_LINE>whereExpr = whereExpr.clone(smap);<NEW_LINE>whereExpr.analyze(analyzer);<NEW_LINE>if (!whereExpr.getType().isBoolean()) {<NEW_LINE>throw new UserException("where statement is not a valid statement return bool");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | addConjuncts(whereExpr.getConjuncts()); |
1,646,633 | public ListEnvironmentDeploymentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListEnvironmentDeploymentsResult listEnvironmentDeploymentsResult = new ListEnvironmentDeploymentsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listEnvironmentDeploymentsResult;<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("deploymentIds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEnvironmentDeploymentsResult.setDeploymentIds(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEnvironmentDeploymentsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listEnvironmentDeploymentsResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,189,036 | public okhttp3.Call readNamespacedJobCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, String>(); |
1,793,043 | public static GenomicsDBVidMapProto.VidMappingPB updateINFOFieldCombineOperation(final GenomicsDBVidMapProto.VidMappingPB vidMapPB, final Map<String, Integer> fieldNameToIndexInVidFieldsList, final String fieldName, final String newCombineOperation) {<NEW_LINE>final int fieldIdx = fieldNameToIndexInVidFieldsList.containsKey(fieldName) ? fieldNameToIndexInVidFieldsList.get(fieldName) : -1;<NEW_LINE>if (fieldIdx >= 0) {<NEW_LINE>// Would need to rebuild vidMapPB - so get top level builder first<NEW_LINE>final GenomicsDBVidMapProto.VidMappingPB.<MASK><NEW_LINE>// To update the list element corresponding to fieldName, we get the builder for that specific list element<NEW_LINE>final GenomicsDBVidMapProto.GenomicsDBFieldInfo.Builder fieldBuilder = updatedVidMapBuilder.getFieldsBuilder(fieldIdx);<NEW_LINE>// And update its combine operation<NEW_LINE>fieldBuilder.setVCFFieldCombineOperation(newCombineOperation);<NEW_LINE>// Rebuild full vidMap<NEW_LINE>return updatedVidMapBuilder.build();<NEW_LINE>}<NEW_LINE>return vidMapPB;<NEW_LINE>} | Builder updatedVidMapBuilder = vidMapPB.toBuilder(); |
530,223 | private String sendRaw(String topicName, Producer<?, ?> producer, ProducerRecord recordToSend, Boolean isAsync) throws InterruptedException, ExecutionException {<NEW_LINE>ProducerRecord qualifiedRecord = prepareRecordToSend(topicName, recordToSend);<NEW_LINE>RecordMetadata metadata;<NEW_LINE>if (Boolean.TRUE.equals(isAsync)) {<NEW_LINE>LOGGER.info("Asynchronous Producer sending record - {}", qualifiedRecord);<NEW_LINE>metadata = (RecordMetadata) producer.send(qualifiedRecord, new ProducerAsyncCallback()).get();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>metadata = (RecordMetadata) producer.send(qualifiedRecord).get();<NEW_LINE>}<NEW_LINE>LOGGER.info("Record was sent to partition- {}, with offset- {} ", metadata.partition(), metadata.offset());<NEW_LINE>// --------------------------------------------------------------<NEW_LINE>// Logs deliveryDetails, which shd be good enough for the caller<NEW_LINE>// TODO- combine deliveryDetails into a list n return (if needed)<NEW_LINE>// --------------------------------------------------------------<NEW_LINE>String deliveryDetails = gson.toJson(new DeliveryDetails(OK, metadata));<NEW_LINE>LOGGER.info("deliveryDetails- {}", deliveryDetails);<NEW_LINE>return deliveryDetails;<NEW_LINE>} | LOGGER.info("Synchronous Producer sending record - {}", qualifiedRecord); |
147,626 | public Mono<Response<Flux<ByteBuffer>>> updateByIdWithResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceId == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (apiVersion == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); |
266,837 | // ------------------------------------------------------------------------------<NEW_LINE>// Method: NumericMatcher.handlePut<NEW_LINE>// ------------------------------------------------------------------------------<NEW_LINE>void handlePut(SimpleTest test, Conjunction selector, MatchTarget object, InternTable subExpr) throws MatchingException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>tc.entry(this, cclass, "handlePut", new Object[] { test, selector, object, subExpr });<NEW_LINE>Object value = test.getValue();<NEW_LINE>if (value != null)<NEW_LINE>// equality test.<NEW_LINE>handleEqualityPut(new Wrapper(value), selector, object, subExpr);<NEW_LINE>else {<NEW_LINE>// Inequality or range, goes in CheapRangeTable<NEW_LINE>ContentMatcher next = (ContentMatcher) ranges.getExact(test);<NEW_LINE>// Create a new Matcher if called for<NEW_LINE>ContentMatcher newNext = nextMatcher(selector, next);<NEW_LINE>// Record the subscription<NEW_LINE>newNext.<MASK><NEW_LINE>// See if Matcher must be replaced, and, in that case, where.<NEW_LINE>if (newNext != next)<NEW_LINE>if (next == null)<NEW_LINE>ranges.insert(test, newNext);<NEW_LINE>else<NEW_LINE>ranges.replace(test, newNext);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>tc.exit(this, cclass, "handlePut");<NEW_LINE>} | put(selector, object, subExpr); |
1,263,965 | private static ConstraintValueInfo findConstraintValueInfo(ConfiguredTargetKey key, SkyframeIterableResult values) throws InvalidConstraintValueException {<NEW_LINE>try {<NEW_LINE>ConfiguredTargetValue ctv = (ConfiguredTargetValue) values.nextOrThrow(ConfiguredValueCreationException.class, NoSuchThingException.class, ActionConflictException.class);<NEW_LINE>if (ctv == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ConstraintValueInfo constraintValueInfo = PlatformProviderUtils.constraintValue(configuredTarget);<NEW_LINE>if (constraintValueInfo == null) {<NEW_LINE>throw new InvalidConstraintValueException(configuredTarget.getLabel());<NEW_LINE>}<NEW_LINE>return constraintValueInfo;<NEW_LINE>} catch (ConfiguredValueCreationException e) {<NEW_LINE>throw new InvalidConstraintValueException(key.getLabel(), e);<NEW_LINE>} catch (NoSuchThingException e) {<NEW_LINE>throw new InvalidConstraintValueException(key.getLabel(), e);<NEW_LINE>} catch (ActionConflictException e) {<NEW_LINE>throw new InvalidConstraintValueException(key.getLabel(), e);<NEW_LINE>}<NEW_LINE>} | ConfiguredTarget configuredTarget = ctv.getConfiguredTarget(); |
660,909 | public static void main(String[] args) {<NEW_LINE>final Properties options = StringUtils.argsToProperties(args, argOptionDefs());<NEW_LINE>if (args.length < 1 || options.containsKey("help")) {<NEW_LINE>log.info(usage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Pattern posPattern = options.containsKey("searchPos") ? Pattern.compile(options.getProperty("searchPos")) : null;<NEW_LINE>final Pattern wordPattern = options.containsKey("searchWord") ? Pattern.compile(options.getProperty("searchWord")) : null;<NEW_LINE>final boolean plainPrint = PropertiesUtils.getBool(options, "plain", false);<NEW_LINE>final boolean ner = PropertiesUtils.getBool(options, "ner", false);<NEW_LINE>final boolean detailedAnnotations = PropertiesUtils.getBool(options, "detailedAnnotations", false);<NEW_LINE>final boolean expandElisions = PropertiesUtils.getBool(options, "expandElisions", false);<NEW_LINE>final boolean expandConmigo = PropertiesUtils.getBool(options, "expandConmigo", false);<NEW_LINE>String[] remainingArgs = options.getProperty("").split(" ");<NEW_LINE>List<File> fileList = new ArrayList<>();<NEW_LINE>for (String remainingArg : remainingArgs) fileList.add(new File(remainingArg));<NEW_LINE>final SpanishXMLTreeReaderFactory trf = new SpanishXMLTreeReaderFactory(true, true, ner, detailedAnnotations, expandElisions, expandConmigo);<NEW_LINE>ExecutorService pool = Executors.newFixedThreadPool(Runtime.<MASK><NEW_LINE>for (final File file : fileList) {<NEW_LINE>pool.execute(() -> {<NEW_LINE>try {<NEW_LINE>Reader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "ISO-8859-1"));<NEW_LINE>TreeReader tr = trf.newTreeReader(file.getPath(), in);<NEW_LINE>process(file, tr, posPattern, wordPattern, plainPrint);<NEW_LINE>tr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>pool.shutdown();<NEW_LINE>try {<NEW_LINE>pool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeInterruptedException(e);<NEW_LINE>}<NEW_LINE>} | getRuntime().availableProcessors()); |
381,153 | public void marshall(Network network, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (network == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(network.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getFramework(), FRAMEWORK_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getFrameworkVersion(), FRAMEWORKVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getFrameworkAttributes(), FRAMEWORKATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getVpcEndpointServiceName(), VPCENDPOINTSERVICENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getVotingPolicy(), VOTINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(network.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | network.getArn(), ARN_BINDING); |
676,155 | public static ResAttr factory(ResReferenceValue parent, Duo<Integer, ResScalarValue>[] items, ResValueFactory factory, ResPackage pkg) throws AndrolibException {<NEW_LINE>int type = ((ResIntValue) items[0].m2).getValue();<NEW_LINE>int scalarType = type & 0xffff;<NEW_LINE>Integer min = null, max = null;<NEW_LINE>Boolean l10n = null;<NEW_LINE>int i;<NEW_LINE>for (i = 1; i < items.length; i++) {<NEW_LINE>switch(items[i].m1) {<NEW_LINE>case BAG_KEY_ATTR_MIN:<NEW_LINE>min = ((ResIntValue) items[i].m2).getValue();<NEW_LINE>continue;<NEW_LINE>case BAG_KEY_ATTR_MAX:<NEW_LINE>max = ((ResIntValue) items[i].m2).getValue();<NEW_LINE>continue;<NEW_LINE>case BAG_KEY_ATTR_L10N:<NEW_LINE>l10n = ((ResIntValue) items[i].<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (i == items.length) {<NEW_LINE>return new ResAttr(parent, scalarType, min, max, l10n);<NEW_LINE>}<NEW_LINE>Duo<ResReferenceValue, ResIntValue>[] attrItems = new Duo[items.length - i];<NEW_LINE>int j = 0;<NEW_LINE>for (; i < items.length; i++) {<NEW_LINE>int resId = items[i].m1;<NEW_LINE>pkg.addSynthesizedRes(resId);<NEW_LINE>attrItems[j++] = new Duo<>(factory.newReference(resId, null), (ResIntValue) items[i].m2);<NEW_LINE>}<NEW_LINE>switch(type & 0xff0000) {<NEW_LINE>case TYPE_ENUM:<NEW_LINE>return new ResEnumAttr(parent, scalarType, min, max, l10n, attrItems);<NEW_LINE>case TYPE_FLAGS:<NEW_LINE>return new ResFlagsAttr(parent, scalarType, min, max, l10n, attrItems);<NEW_LINE>}<NEW_LINE>throw new AndrolibException("Could not decode attr value");<NEW_LINE>} | m2).getValue() != 0; |
168,084 | public ListDomainConfigurationsResult listDomainConfigurations(ListDomainConfigurationsRequest listDomainConfigurationsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDomainConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDomainConfigurationsRequest> request = null;<NEW_LINE>Response<ListDomainConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListDomainConfigurationsResult, JsonUnmarshallerContext> unmarshaller = new ListDomainConfigurationsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListDomainConfigurationsResult> responseHandler = new JsonResponseHandler<ListDomainConfigurationsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | ListDomainConfigurationsRequestMarshaller().marshall(listDomainConfigurationsRequest); |
423,626 | /* Build call for applicationsApplicationIdPut */<NEW_LINE>private com.squareup.okhttp.Call applicationsApplicationIdPutCall(String applicationId, Application body, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/{applicationId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "applicationId" + "\\}", apiClient.escapeString(applicationId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
924,699 | static ResultList merge(int n, ResultList left, ResultList right, double weight) {<NEW_LINE>Long2IntMap leftRanks = LongUtils.itemRanks(LongUtils.asLongList(left.idList()));<NEW_LINE>Long2IntMap rightRanks = LongUtils.itemRanks(LongUtils.asLongList(right.idList()));<NEW_LINE>int nl = left.size();<NEW_LINE>int nr = right.size();<NEW_LINE>LongSet allItems = new LongOpenHashSet();<NEW_LINE>allItems.addAll(leftRanks.keySet());<NEW_LINE>allItems.addAll(rightRanks.keySet());<NEW_LINE>ResultAccumulator accum = ResultAccumulator.create(n);<NEW_LINE>for (LongIterator iter = allItems.iterator(); iter.hasNext(); ) {<NEW_LINE>long item = iter.nextLong();<NEW_LINE>int <MASK><NEW_LINE>int rr = rightRanks.get(item);<NEW_LINE>double s1 = rankToScore(rl, nl);<NEW_LINE>double s2 = rankToScore(rr, nr);<NEW_LINE>double score = weight * s1 + (1.0 - weight) * s2;<NEW_LINE>accum.add(new RankBlendResult(item, score, rl >= 0 ? left.get(rl) : null, rl, rr >= 0 ? right.get(rr) : null, rl));<NEW_LINE>}<NEW_LINE>return accum.finish();<NEW_LINE>} | rl = leftRanks.get(item); |
69,408 | public EdgeLabel readEdgeLabel(HugeGraph graph, BackendEntry backendEntry) {<NEW_LINE>if (backendEntry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TableBackendEntry entry = this.convertEntry(backendEntry);<NEW_LINE>Number id = schemaColumn(entry, HugeKeys.ID);<NEW_LINE>String name = schemaColumn(entry, HugeKeys.NAME);<NEW_LINE>Frequency frequency = schemaEnum(entry, HugeKeys.FREQUENCY, Frequency.class);<NEW_LINE>Number sourceLabel = schemaColumn(entry, HugeKeys.SOURCE_LABEL);<NEW_LINE>Number targetLabel = schemaColumn(entry, HugeKeys.TARGET_LABEL);<NEW_LINE>Object sortKeys = schemaColumn(entry, HugeKeys.SORT_KEYS);<NEW_LINE>Object nullableKeys = schemaColumn(entry, HugeKeys.NULLABLE_KEYS);<NEW_LINE>Object properties = schemaColumn(entry, HugeKeys.PROPERTIES);<NEW_LINE>Object indexLabels = schemaColumn(entry, HugeKeys.INDEX_LABELS);<NEW_LINE>SchemaStatus status = schemaEnum(entry, HugeKeys.STATUS, SchemaStatus.class);<NEW_LINE>Number ttl = schemaColumn(entry, HugeKeys.TTL);<NEW_LINE>Number ttlStartTime = schemaColumn(entry, HugeKeys.TTL_START_TIME);<NEW_LINE>EdgeLabel edgeLabel = new EdgeLabel(graph, this<MASK><NEW_LINE>edgeLabel.frequency(frequency);<NEW_LINE>edgeLabel.sourceLabel(this.toId(sourceLabel));<NEW_LINE>edgeLabel.targetLabel(this.toId(targetLabel));<NEW_LINE>edgeLabel.properties(this.toIdArray(properties));<NEW_LINE>edgeLabel.sortKeys(this.toIdArray(sortKeys));<NEW_LINE>edgeLabel.nullableKeys(this.toIdArray(nullableKeys));<NEW_LINE>edgeLabel.indexLabels(this.toIdArray(indexLabels));<NEW_LINE>edgeLabel.status(status);<NEW_LINE>edgeLabel.ttl(ttl.longValue());<NEW_LINE>edgeLabel.ttlStartTime(this.toId(ttlStartTime));<NEW_LINE>this.readEnableLabelIndex(edgeLabel, entry);<NEW_LINE>this.readUserdata(edgeLabel, entry);<NEW_LINE>return edgeLabel;<NEW_LINE>} | .toId(id), name); |
1,675,532 | private boolean handleBlockState(String data) {<NEW_LINE>boolean success = true;<NEW_LINE>if (data.equals("*")) {<NEW_LINE>filtered = false;<NEW_LINE>} else {<NEW_LINE>// Split on pairs<NEW_LINE>String[] split = data.split("/");<NEW_LINE>String[] attribs = new String[split.length];<NEW_LINE>String[] vals = new String[split.length];<NEW_LINE>for (int i = 0; i < split.length; i++) {<NEW_LINE>String[] av = split[i].split(":");<NEW_LINE>if (av.length == 2) {<NEW_LINE>attribs[i] = av[0];<NEW_LINE>vals[i] = av[1];<NEW_LINE>} else {<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filtered = true;<NEW_LINE>// Now loop through base states and add matching indexes<NEW_LINE>if (success) {<NEW_LINE>for (DynmapBlockState bs : basestates.keySet()) {<NEW_LINE>int cnt = bs.getStateCount();<NEW_LINE>BitSet bits = basestates.get(bs);<NEW_LINE>for (int idx = 0; idx < cnt; idx++) {<NEW_LINE>DynmapBlockState <MASK><NEW_LINE>boolean match = true;<NEW_LINE>for (int i = 0; match && (i < attribs.length); i++) {<NEW_LINE>if (!s.isStateMatch(attribs[i], vals[i])) {<NEW_LINE>match = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match) {<NEW_LINE>// Set matching state<NEW_LINE>bits.set(idx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>Log.warning(String.format("Bad block state %s for line %s", data, linenum));<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | s = bs.getState(idx); |
1,685,528 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>PoiFilterListItem item = adapter.getItem(<MASK><NEW_LINE>if (item != null) {<NEW_LINE>switch(item.type) {<NEW_LINE>case GROUP_HEADER:<NEW_LINE>if (item.category != null) {<NEW_LINE>if (collapsedCategories.contains(item.category)) {<NEW_LINE>collapsedCategories.remove(item.category);<NEW_LINE>} else {<NEW_LINE>collapsedCategories.add(item.category);<NEW_LINE>}<NEW_LINE>updateListView();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CHECKBOX_ITEM:<NEW_LINE>CheckBox checkBox = (CheckBox) view.findViewById(R.id.checkboxItem);<NEW_LINE>adapter.toggleCheckbox(item, checkBox, !checkBox.isChecked());<NEW_LINE>break;<NEW_LINE>case BUTTON_ITEM:<NEW_LINE>if (item.category != null) {<NEW_LINE>showAllCategories.add(item.category);<NEW_LINE>updateListView();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | position - listView.getHeaderViewsCount()); |
124,727 | final Snapshot executeAuthorizeSnapshotAccess(AuthorizeSnapshotAccessRequest authorizeSnapshotAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(authorizeSnapshotAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AuthorizeSnapshotAccessRequest> request = null;<NEW_LINE>Response<Snapshot> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AuthorizeSnapshotAccessRequestMarshaller().marshall(super.beforeMarshalling(authorizeSnapshotAccessRequest));<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, "Redshift");<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>StaxResponseHandler<Snapshot> responseHandler = new StaxResponseHandler<Snapshot>(new SnapshotStaxUnmarshaller());<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, "AuthorizeSnapshotAccess"); |
729,599 | public Map<String, Object> asMap(boolean full) {<NEW_LINE>Map<String, Object> props = new LinkedHashMap<>();<NEW_LINE>props.put("enabled", isEnabled());<NEW_LINE>props.put("host", host);<NEW_LINE>props.put("owner", owner);<NEW_LINE>props.put("name", name);<NEW_LINE>props.put("username", username);<NEW_LINE>props.put("token", isNotBlank(getResolvedToken()) ? Constants.HIDE : Constants.UNSET);<NEW_LINE>if (releaseSupported) {<NEW_LINE>props.put("uploadAssets", uploadAssets);<NEW_LINE>props.put("artifacts", isArtifacts());<NEW_LINE>props.put("files", isFiles());<NEW_LINE>props.put("checksums", isChecksums());<NEW_LINE>props.put("signatures", isSignatures());<NEW_LINE>props.put("repoUrl", repoUrl);<NEW_LINE>props.put("repoCloneUrl", repoCloneUrl);<NEW_LINE><MASK><NEW_LINE>props.put("srcUrl", srcUrl);<NEW_LINE>props.put("downloadUrl", downloadUrl);<NEW_LINE>props.put("releaseNotesUrl", releaseNotesUrl);<NEW_LINE>props.put("latestReleaseUrl", latestReleaseUrl);<NEW_LINE>props.put("issueTrackerUrl", issueTrackerUrl);<NEW_LINE>}<NEW_LINE>props.put("tagName", tagName);<NEW_LINE>if (releaseSupported) {<NEW_LINE>props.put("releaseName", releaseName);<NEW_LINE>}<NEW_LINE>props.put("branch", branch);<NEW_LINE>props.put("commitAuthor", commitAuthor.asMap(full));<NEW_LINE>props.put("sign", isSign());<NEW_LINE>props.put("skipTag", isSkipTag());<NEW_LINE>props.put("skipRelease", isSkipRelease());<NEW_LINE>props.put("overwrite", isOverwrite());<NEW_LINE>if (releaseSupported) {<NEW_LINE>props.put("update", update.asMap(full));<NEW_LINE>props.put("apiEndpoint", apiEndpoint);<NEW_LINE>props.put("connectTimeout", connectTimeout);<NEW_LINE>props.put("readTimeout", readTimeout);<NEW_LINE>}<NEW_LINE>props.put("changelog", changelog.asMap(full));<NEW_LINE>if (releaseSupported) {<NEW_LINE>props.put("milestone", milestone.asMap(full));<NEW_LINE>}<NEW_LINE>props.put("prerelease", prerelease.asMap(full));<NEW_LINE>return props;<NEW_LINE>} | props.put("commitUrl", commitUrl); |
603,239 | final GetCelebrityRecognitionResult executeGetCelebrityRecognition(GetCelebrityRecognitionRequest getCelebrityRecognitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCelebrityRecognitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCelebrityRecognitionRequest> request = null;<NEW_LINE>Response<GetCelebrityRecognitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCelebrityRecognitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCelebrityRecognitionRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCelebrityRecognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCelebrityRecognitionResult>> 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 GetCelebrityRecognitionResultJsonUnmarshaller()); |
1,424,229 | public void bind(@NonNull TimelineModel timelineModel) {<NEW_LINE><MASK><NEW_LINE>IssueEventType event = issueEventModel.getEvent();<NEW_LINE>if (issueEventModel.getAssignee() != null && issueEventModel.getAssigner() != null) {<NEW_LINE>avatarLayout.setUrl(issueEventModel.getAssigner().getAvatarUrl(), issueEventModel.getAssigner().getLogin(), false, LinkParserHelper.isEnterprise(issueEventModel.getUrl()));<NEW_LINE>} else {<NEW_LINE>if (event != IssueEventType.committed) {<NEW_LINE>avatarLayout.setVisibility(View.VISIBLE);<NEW_LINE>if (issueEventModel.getActor() != null) {<NEW_LINE>avatarLayout.setUrl(issueEventModel.getActor().getAvatarUrl(), issueEventModel.getActor().getLogin(), false, LinkParserHelper.isEnterprise(issueEventModel.getUrl()));<NEW_LINE>} else if (issueEventModel.getAuthor() != null) {<NEW_LINE>avatarLayout.setUrl(issueEventModel.getAuthor().getAvatarUrl(), issueEventModel.getAuthor().getLogin(), false, LinkParserHelper.isEnterprise(issueEventModel.getUrl()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>avatarLayout.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (event != null) {<NEW_LINE>stateImage.setContentDescription(event.name());<NEW_LINE>stateImage.setImageResource(event.getIconResId());<NEW_LINE>}<NEW_LINE>if (event != null) {<NEW_LINE>stateText.setText(TimelineProvider.getStyledEvents(issueEventModel, itemView.getContext(), isMerged));<NEW_LINE>} else {<NEW_LINE>stateText.setText("");<NEW_LINE>stateImage.setImageResource(R.drawable.ic_label);<NEW_LINE>}<NEW_LINE>} | GenericEvent issueEventModel = timelineModel.getGenericEvent(); |
1,276,361 | public void onrequest(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "p", required = false) String p) {<NEW_LINE>Payload payload <MASK><NEW_LINE>payload.setPattern("/afx/dynamic/");<NEW_LINE>if (Objects.nonNull(p)) {<NEW_LINE>if (p.contains("asciidoctor-default.css")) {<NEW_LINE>Optional<String> stylesheetDefault = Optional.ofNullable(locationConfigBean.getStylesheetDefault());<NEW_LINE>processResource(payload, stylesheetDefault);<NEW_LINE>return;<NEW_LINE>} else if (p.contains("asciidoctor-default-overrides.css")) {<NEW_LINE>Optional<String> stylesheetDefault = Optional.ofNullable(locationConfigBean.getStylesheetOverrides());<NEW_LINE>processResource(payload, stylesheetDefault);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (payload.getFinalURI().contains("MathJax.js")) {<NEW_LINE>Optional<String> mathjax = Optional.ofNullable(locationConfigBean.getMathjax());<NEW_LINE>processResource(payload, mathjax);<NEW_LINE>} else {<NEW_LINE>Path path = directoryService.findPathInPublic(payload.getFinalURI());<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>fileService.processFile(payload, path);<NEW_LINE>} else {<NEW_LINE>commonResource.processPayload(payload);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new Payload(request, response); |
1,586,139 | public void onActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>super.<MASK><NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>Uri selectedImageUri = data.getData();<NEW_LINE>try {<NEW_LINE>InputStream imageStream = getActivity().getContentResolver().openInputStream(selectedImageUri);<NEW_LINE>Bitmap bitmap = BitmapFactory.decodeStream(imageStream);<NEW_LINE>String encodedImage = Utils.encodeImage(getActivity(), bitmap, selectedImageUri);<NEW_LINE>ImageData imageData = new ImageData(encodedImage);<NEW_LINE>if (requestCode == LOGO_IMAGE_CHOOSER_REQUEST_CODE) {<NEW_LINE>createEventViewModel.uploadLogo(imageData);<NEW_LINE>binding.logoImage.setImageBitmap(bitmap);<NEW_LINE>} else if (requestCode == ORIGINAL_IMAGE_CHOOSER_REQUEST_CODE) {<NEW_LINE>createEventViewModel.uploadImage(imageData);<NEW_LINE>binding.originalImage.setImageBitmap(bitmap);<NEW_LINE>}<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>Timber.e(e, "File not found");<NEW_LINE>Toast.makeText(getActivity(), "File not found. Please try again.", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | onActivityResult(requestCode, resultCode, data); |
660,936 | public boolean writeTo(IndentingWriter writer) throws IOException {<NEW_LINE>int elementWidth = instruction.getElementWidth();<NEW_LINE>writer.write(".array-data ");<NEW_LINE>writer.printSignedIntAsDec(instruction.getElementWidth());<NEW_LINE>writer.write('\n');<NEW_LINE>writer.indent(4);<NEW_LINE>List<Number> elements = instruction.getArrayElements();<NEW_LINE>String suffix = "";<NEW_LINE>switch(elementWidth) {<NEW_LINE>case 1:<NEW_LINE>suffix = "t";<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>suffix = "s";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (Number number : elements) {<NEW_LINE>org.jf.baksmali.Renderers.LongRenderer.writeSignedIntOrLongTo(<MASK><NEW_LINE>writer.write(suffix);<NEW_LINE>if (elementWidth == 8) {<NEW_LINE>writeCommentIfLikelyDouble(writer, number.longValue());<NEW_LINE>} else if (elementWidth == 4) {<NEW_LINE>int value = number.intValue();<NEW_LINE>boolean isResourceId = writeCommentIfResourceId(writer, value);<NEW_LINE>if (!isResourceId)<NEW_LINE>writeCommentIfLikelyFloat(writer, value);<NEW_LINE>}<NEW_LINE>writer.write("\n");<NEW_LINE>}<NEW_LINE>writer.deindent(4);<NEW_LINE>writer.write(".end array-data");<NEW_LINE>return true;<NEW_LINE>} | writer, number.longValue()); |
58,313 | private static void logAcquireResult(AcquireResult acquireResult) {<NEW_LINE>try {<NEW_LINE>Lock lock = acquireResult.existingLock();<NEW_LINE>DateTime now = acquireResult.transactionTime();<NEW_LINE>switch(acquireResult.lockState()) {<NEW_LINE>case IN_USE:<NEW_LINE>logger.atInfo().log("Existing lock by request %s is still valid now %s (until %s) lock: %s", lock.requestLogId, now, <MASK><NEW_LINE>break;<NEW_LINE>case TIMED_OUT:<NEW_LINE>logger.atInfo().log("Existing lock by request %s is timed out now %s (was valid until %s) lock: %s", lock.requestLogId, now, lock.expirationTime, lock.lockId);<NEW_LINE>break;<NEW_LINE>case OWNER_DIED:<NEW_LINE>logger.atInfo().log("Existing lock is valid now %s (until %s), but owner (%s) isn't running lock: %s", now, lock.expirationTime, lock.requestLogId, lock.lockId);<NEW_LINE>break;<NEW_LINE>case FREE:<NEW_LINE>// There was no existing lock<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Lock newLock = acquireResult.newLock();<NEW_LINE>if (acquireResult.newLock() != null) {<NEW_LINE>logger.atInfo().log("acquire succeeded %s lock: %s", newLock, newLock.lockId);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// We might get here if there is a NullPointerException for example, if AcquireResult wasn't<NEW_LINE>// constructed correctly. Simply log it for debugging but continue as if nothing happened<NEW_LINE>logger.atWarning().withCause(e).log("Error while logging AcquireResult %s. Continuing.", acquireResult);<NEW_LINE>}<NEW_LINE>} | lock.expirationTime, lock.lockId); |
369,215 | private Message<?> enhanceHeadersAndSaveAttributes(Message<?> message, ConsumerRecord<K, V> record) {<NEW_LINE>Message<?> messageToReturn = message;<NEW_LINE>if (message.getHeaders() instanceof KafkaMessageHeaders) {<NEW_LINE>Map<String, Object> rawHeaders = ((KafkaMessageHeaders) message.getHeaders()).getRawHeaders();<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.retryTemplate != null) {<NEW_LINE>AtomicInteger deliveryAttempt = new AtomicInteger(((RetryContext) ATTRIBUTES_HOLDER.get()).getRetryCount() + 1);<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, deliveryAttempt);<NEW_LINE>} else if (KafkaMessageDrivenChannelAdapter.this.containerDeliveryAttemptPresent) {<NEW_LINE>Header header = record.headers().lastHeader(KafkaHeaders.DELIVERY_ATTEMPT);<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, new AtomicInteger(ByteBuffer.wrap(header.value()).getInt()));<NEW_LINE>}<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.bindSourceRecord) {<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.SOURCE_DATA, record);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageBuilder<?> builder = MessageBuilder.fromMessage(message);<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.retryTemplate != null) {<NEW_LINE>AtomicInteger deliveryAttempt = new AtomicInteger(((RetryContext) ATTRIBUTES_HOLDER.get()).getRetryCount() + 1);<NEW_LINE>builder.setHeader(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, deliveryAttempt);<NEW_LINE>} else if (KafkaMessageDrivenChannelAdapter.this.containerDeliveryAttemptPresent) {<NEW_LINE>Header header = record.headers().lastHeader(KafkaHeaders.DELIVERY_ATTEMPT);<NEW_LINE>builder.setHeader(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, new AtomicInteger(ByteBuffer.wrap(header.value()).getInt()));<NEW_LINE>}<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.bindSourceRecord) {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>messageToReturn = builder.build();<NEW_LINE>}<NEW_LINE>setAttributesIfNecessary(record, messageToReturn, false);<NEW_LINE>return messageToReturn;<NEW_LINE>} | setHeader(IntegrationMessageHeaderAccessor.SOURCE_DATA, record); |
395,638 | private boolean networkConnect() {<NEW_LINE>logger.debug("Running connection setup");<NEW_LINE>try {<NEW_LINE>logger.debug("Setting up socket connection to " + this.networkHost + ":" + this.networkPort);<NEW_LINE>this.projectorSocket = new Socket(this.networkHost, this.networkPort);<NEW_LINE>this.projectorSocket.setSoTimeout(SOCKET_TIMEOUT_MS);<NEW_LINE>logger.debug("Setup reader/writer");<NEW_LINE>this.projectorReader = new BufferedReader(new InputStreamReader(this<MASK><NEW_LINE>this.projectorWriter = new PrintWriter(this.projectorSocket.getOutputStream(), true);<NEW_LINE>logger.debug("Network connection setup successfully!");<NEW_LINE>return true;<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>logger.error("Unable to find host: " + this.networkHost);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("IO Exception: " + e.getMessage());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .projectorSocket.getInputStream())); |
1,593,807 | public int LAPACKE_stgsja_work(int arg0, byte arg1, byte arg2, byte arg3, int arg4, int arg5, int arg6, int arg7, int arg8, FloatPointer arg9, int arg10, FloatPointer arg11, int arg12, float arg13, float arg14, FloatPointer arg15, FloatPointer arg16, FloatPointer arg17, int arg18, FloatPointer arg19, int arg20, FloatPointer arg21, int arg22, FloatPointer arg23, IntPointer arg24) {<NEW_LINE>return LAPACKE_stgsja_work(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, <MASK><NEW_LINE>} | arg21, arg22, arg23, arg24); |
1,549,289 | private void adicionarListeners(Component componente) {<NEW_LINE>// evita adicionar o listener mais de uma vez no mesmo componente<NEW_LINE>// System.out.println(componente.getName() + " - " + componentesRegistrados.contains(componente)+ " -|- " + (componente instanceof Container));<NEW_LINE>if (!componentesRegistrados.contains(componente)) {<NEW_LINE>componente.addMouseListener(listenerMouse);<NEW_LINE>LOGGER.log(Level.INFO, "Adicionou listener em {0}", componente.getName());<NEW_LINE>// System.out.println("Adicionou listner em "+componente.getName());<NEW_LINE>componentesRegistrados.add(componente);<NEW_LINE>if (componente instanceof Container) {<NEW_LINE>Container container = (Container) componente;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < filhos; i++) {<NEW_LINE>// System.out.println("Filho de "+container.getName() + " - " + container.getComponent(i).getName());<NEW_LINE>adicionarListeners(container.getComponent(i));<NEW_LINE>}<NEW_LINE>container.addContainerListener(new ContainerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentAdded(ContainerEvent e) {<NEW_LINE>// System.out.println("Component " + e.getChild().getName() + " added to " + e.getContainer().getName());<NEW_LINE>adicionarListeners(e.getChild());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int filhos = container.getComponentCount(); |
1,717,242 | protected RouteLookupConfig doForward(Map<String, ?> json) {<NEW_LINE>ImmutableList<GrpcKeyBuilder> grpcKeybuilders = GrpcKeyBuilderConverter.covertAll(checkNotNull(JsonUtil.getListOfObjects(json, "grpcKeybuilders"), "grpcKeybuilders"));<NEW_LINE>checkArgument(!<MASK><NEW_LINE>Set<Name> names = new HashSet<>();<NEW_LINE>for (GrpcKeyBuilder keyBuilder : grpcKeybuilders) {<NEW_LINE>for (Name name : keyBuilder.names()) {<NEW_LINE>checkArgument(names.add(name), "duplicate names in grpc_keybuilders: " + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String lookupService = JsonUtil.getString(json, "lookupService");<NEW_LINE>checkArgument(!Strings.isNullOrEmpty(lookupService), "lookupService must not be empty");<NEW_LINE>try {<NEW_LINE>URI unused = new URI(lookupService);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalArgumentException("The lookupService field is not valid URI: " + lookupService, e);<NEW_LINE>}<NEW_LINE>long timeout = orDefault(JsonUtil.getStringAsDuration(json, "lookupServiceTimeout"), DEFAULT_LOOKUP_SERVICE_TIMEOUT);<NEW_LINE>checkArgument(timeout > 0, "lookupServiceTimeout should be positive");<NEW_LINE>Long maxAge = JsonUtil.getStringAsDuration(json, "maxAge");<NEW_LINE>Long staleAge = JsonUtil.getStringAsDuration(json, "staleAge");<NEW_LINE>if (maxAge == null) {<NEW_LINE>checkArgument(staleAge == null, "to specify staleAge, must have maxAge");<NEW_LINE>maxAge = MAX_AGE_NANOS;<NEW_LINE>}<NEW_LINE>if (staleAge == null) {<NEW_LINE>staleAge = MAX_AGE_NANOS;<NEW_LINE>}<NEW_LINE>maxAge = Math.min(maxAge, MAX_AGE_NANOS);<NEW_LINE>staleAge = Math.min(staleAge, maxAge);<NEW_LINE>long cacheSize = orDefault(JsonUtil.getNumberAsLong(json, "cacheSizeBytes"), MAX_CACHE_SIZE);<NEW_LINE>checkArgument(cacheSize > 0, "cacheSize must be positive");<NEW_LINE>cacheSize = Math.min(cacheSize, MAX_CACHE_SIZE);<NEW_LINE>String defaultTarget = Strings.emptyToNull(JsonUtil.getString(json, "defaultTarget"));<NEW_LINE>return RouteLookupConfig.builder().grpcKeybuilders(grpcKeybuilders).lookupService(lookupService).lookupServiceTimeoutInNanos(timeout).maxAgeInNanos(maxAge).staleAgeInNanos(staleAge).cacheSizeBytes(cacheSize).defaultTarget(defaultTarget).build();<NEW_LINE>} | grpcKeybuilders.isEmpty(), "must have at least one GrpcKeyBuilder"); |
1,266,405 | final CreateCostCategoryDefinitionResult executeCreateCostCategoryDefinition(CreateCostCategoryDefinitionRequest createCostCategoryDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCostCategoryDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCostCategoryDefinitionRequest> request = null;<NEW_LINE>Response<CreateCostCategoryDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCostCategoryDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCostCategoryDefinitionRequest));<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, "Cost Explorer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCostCategoryDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCostCategoryDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCostCategoryDefinitionResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,468,243 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.tx.jta.ut.util.StateKeeper#loadState()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public int loadState() {<NEW_LINE>new Throwable("com.ibm.tx.jta.ut.util.StateKeeper#loadState()").printStackTrace(System.out);<NEW_LINE>;<NEW_LINE>int resourceCount = 0;<NEW_LINE>_commitSequence.set(0);<NEW_LINE>ObjectInputStream ois = null;<NEW_LINE>int resKey = 0;<NEW_LINE>FileInputStream fos = null;<NEW_LINE>try {<NEW_LINE>fos = new FileInputStream(STATE_FILE);<NEW_LINE>ois = new ObjectInputStream(fos);<NEW_LINE>while (true) {<NEW_LINE>final XAResourceData xares = (XAResourceData) ois.readObject();<NEW_LINE>resKey = xares.key;<NEW_LINE>_resources.put(resKey, xares);<NEW_LINE>if (resKey >= _nextKey.get()) {<NEW_LINE>_nextKey.set(resKey + 1);<NEW_LINE>}<NEW_LINE>resourceCount++;<NEW_LINE>}<NEW_LINE>} catch (EOFException e) {<NEW_LINE>System.out.<MASK><NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>System.out.println("Loaded " + resourceCount + " resources");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (ois != null)<NEW_LINE>ois.close();<NEW_LINE>if (fos != null)<NEW_LINE>fos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resourceCount;<NEW_LINE>} | println("Loaded " + resourceCount + " resources"); |
845,630 | private void runAssertion_A_parenthesisBstar(RegressionEnvironment env, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>String[] fields = "a,b0,b1,b2".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" + " pattern (A (B)*)" + " interval 10 seconds or terminated" + " define" + " A as A.theString like \"A%\"," + " B as B.theString like \"B%\"" + ")";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>// test output by terminated because of misfit event<NEW_LINE>env.sendEventBean(new SupportRecogBean("A1"));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportRecogBean("X1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A1", "B1", null, null });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendTimer(env, 20000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>// test output by timer expiry<NEW_LINE>env.sendEventBean(new SupportRecogBean("A2"));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B2"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, 29999);<NEW_LINE>sendTimer(env, 30000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A2", "B2", null, null });<NEW_LINE>// destroy<NEW_LINE>env.undeployAll();<NEW_LINE>} | (text).addListener("s0"); |
174,187 | protected void estimateCardinality(StatementPatternNode sp, final AST2BOpContext ctx, final IBindingSet exogenousBindings, final int nrExogeneousBindings) {<NEW_LINE>// unless proven otherwise<NEW_LINE>final <MASK><NEW_LINE>final IV<?, ?> s = getIV(sp.s(), exogenousBindings, usesExogeneousBindings);<NEW_LINE>final IV<?, ?> p = getIV(sp.p(), exogenousBindings, usesExogeneousBindings);<NEW_LINE>final IV<?, ?> o = getIV(sp.o(), exogenousBindings, usesExogeneousBindings);<NEW_LINE>final IV<?, ?> c = getIV(sp.c(), exogenousBindings, usesExogeneousBindings);<NEW_LINE>final int exogenousBindingsAdjustmentFactor = usesExogeneousBindings.get() ? Math.max(1, nrExogeneousBindings) : 1;<NEW_LINE>estimateCardinalities(sp, s, p, o, c, ctx, exogenousBindingsAdjustmentFactor);<NEW_LINE>} | AtomicBoolean usesExogeneousBindings = new AtomicBoolean(false); |
1,516,463 | private static Set<Token> collectLabels(final CompilationInfo info, final Document document, final TreePath labeledStatement) {<NEW_LINE>final Set<Token> result = new LinkedHashSet<Token>();<NEW_LINE>if (labeledStatement.getLeaf().getKind() == Kind.LABELED_STATEMENT) {<NEW_LINE>result.add(org.netbeans.modules.java.editor.base.semantic.Utilities.findIdentifierSpan(info, document, labeledStatement));<NEW_LINE>final Name label = ((LabeledStatementTree) labeledStatement.getLeaf()).getLabel();<NEW_LINE>new ErrorAwareTreePathScanner<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitBreak(BreakTree node, Void p) {<NEW_LINE>if (node.getLabel() != null && label.contentEquals(node.getLabel())) {<NEW_LINE>result.add(org.netbeans.modules.java.editor.base.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath()));<NEW_LINE>}<NEW_LINE>return super.visitBreak(node, p);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitContinue(ContinueTree node, Void p) {<NEW_LINE>if (node.getLabel() != null && label.contentEquals(node.getLabel())) {<NEW_LINE>result.add(org.netbeans.modules.java.editor.base.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath()));<NEW_LINE>}<NEW_LINE>return super.visitContinue(node, p);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | }.scan(labeledStatement, null); |
1,124,630 | public void preparedOkResponse(byte[] ok, List<byte[]> fields, List<byte[]> params, MySQLResponseService service) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (buffer == null) {<NEW_LINE>buffer = frontedConnection.allocate();<NEW_LINE>}<NEW_LINE>if (!write2Client) {<NEW_LINE>ok[3] = (byte) rwSplitService.nextPacketId();<NEW_LINE>buffer = frontedConnection.getService().writeToBuffer(ok, buffer);<NEW_LINE>if (params != null) {<NEW_LINE>for (byte[] param : params) {<NEW_LINE>param[3] = (byte) rwSplitService.nextPacketId();<NEW_LINE>buffer = frontedConnection.getService().writeToBuffer(param, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fields != null) {<NEW_LINE>for (byte[] field : fields) {<NEW_LINE>field[3] = (byte) rwSplitService.nextPacketId();<NEW_LINE>buffer = frontedConnection.getService(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>callback.callback(true, ok, rwSplitService);<NEW_LINE>frontedConnection.getService().writeDirectly(buffer, WriteFlags.QUERY_END);<NEW_LINE>write2Client = true;<NEW_LINE>buffer = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).writeToBuffer(field, buffer); |
1,646,965 | public PersistenceResponse remove(PersistencePackage persistencePackage) throws ServiceException {<NEW_LINE>for (PersistenceManagerEventHandler handler : persistenceManagerEventHandlers) {<NEW_LINE>PersistenceManagerEventHandlerResponse response = handler.preRemove(this, persistencePackage);<NEW_LINE>if (PersistenceManagerEventHandlerResponse.PersistenceManagerEventHandlerResponseStatus.HANDLED_BREAK == response.getStatus()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check to see if there is a custom handler registered<NEW_LINE>for (CustomPersistenceHandler handler : getCustomPersistenceHandlers()) {<NEW_LINE>if (handler.canHandleRemove(persistencePackage)) {<NEW_LINE>if (!handler.willHandleSecurity(persistencePackage)) {<NEW_LINE>adminRemoteSecurityService.securityCheck(persistencePackage, EntityOperationType.REMOVE);<NEW_LINE>}<NEW_LINE>handler.remove(persistencePackage, dynamicEntityDao, (RecordHelper) getCompatibleModule(OperationType.BASIC));<NEW_LINE>return executePostRemoveHandlers(persistencePackage, new PersistenceResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>adminRemoteSecurityService.securityCheck(persistencePackage, EntityOperationType.REMOVE);<NEW_LINE>PersistenceModule myModule = getCompatibleModule(persistencePackage.getPersistencePerspective().getOperationTypes().getRemoveType());<NEW_LINE>myModule.remove(persistencePackage);<NEW_LINE>return executePostRemoveHandlers<MASK><NEW_LINE>} | (persistencePackage, new PersistenceResponse()); |
1,688,901 | public <T> long bulkGraphOperation(final SecurityContext securityContext, final Query query, final int commitCount, String description, final BulkGraphOperation<T> operation) {<NEW_LINE>final Predicate<Long> condition = operation.getCondition();<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>final boolean doValidation = operation.doValidation();<NEW_LINE>final boolean doCallbacks = operation.doCallbacks();<NEW_LINE>final boolean doNotifications = operation.doNotifications();<NEW_LINE>long objectCount = 0L;<NEW_LINE>boolean active = true;<NEW_LINE>int page = 1;<NEW_LINE>if (query == null) {<NEW_LINE>info("{}: {} objects processed", description, 0);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// set page size to commit count<NEW_LINE>query.<MASK><NEW_LINE>query.pageSize(commitCount);<NEW_LINE>while (active) {<NEW_LINE>active = false;<NEW_LINE>try (final Tx tx = app.tx(doValidation, doCallbacks, doNotifications)) {<NEW_LINE>query.page(page++);<NEW_LINE>final Iterable<T> iterable = query.getResultStream();<NEW_LINE>final Iterator<T> iterator = iterable.iterator();<NEW_LINE>while (iterator.hasNext() && (condition == null || condition.accept(objectCount))) {<NEW_LINE>T node = iterator.next();<NEW_LINE>active = true;<NEW_LINE>try {<NEW_LINE>boolean success = operation.handleGraphObject(securityContext, node);<NEW_LINE>if (success) {<NEW_LINE>objectCount++;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>operation.handleThrowable(securityContext, t, node);<NEW_LINE>}<NEW_LINE>// commit transaction after commitCount<NEW_LINE>if ((objectCount % commitCount) == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// bulk transaction failed, what to do?<NEW_LINE>operation.handleTransactionFailure(securityContext, t);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>info("{}: {} objects processed", description, objectCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objectCount;<NEW_LINE>} | getQueryContext().overrideFetchSize(commitCount); |
912,870 | protected void writeArrayIdTo(Output output, Class<?> componentType) throws IOException {<NEW_LINE>// shouldn't happen<NEW_LINE>assert !componentType.isArray();<NEW_LINE>final RegisteredDelegate<<MASK><NEW_LINE>if (rd != null) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, (rd.id << 5) | CID_DELEGATE, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RuntimeFieldFactory<?> inline = RuntimeFieldFactory.getInline(componentType);<NEW_LINE>if (inline != null) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, getPrimitiveOrScalarId(componentType, inline.id), false);<NEW_LINE>} else if (componentType.isEnum()) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, getEnumId(componentType), false);<NEW_LINE>} else if (Object.class == componentType) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, CID_OBJECT, false);<NEW_LINE>} else if (Class.class == componentType) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, CID_CLASS, false);<NEW_LINE>} else if (!componentType.isInterface() && !Modifier.isAbstract(componentType.getModifiers())) {<NEW_LINE>output.writeUInt32(RuntimeFieldFactory.ID_ARRAY, getId(componentType), false);<NEW_LINE>} else {<NEW_LINE>// too many possible interfaces and abstract types that it would be costly<NEW_LINE>// to index it at runtime (Not all subclasses allow dynamic indexing)<NEW_LINE>output.writeString(RuntimeFieldFactory.ID_ARRAY_MAPPED, componentType.getName(), false);<NEW_LINE>}<NEW_LINE>} | ?> rd = getRegisteredDelegate(componentType); |
142,399 | public final TypeArgumentsContext typeArguments() throws RecognitionException {<NEW_LINE>TypeArgumentsContext _localctx = new TypeArgumentsContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 84, RULE_typeArguments);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(696);<NEW_LINE>match(LT);<NEW_LINE>setState(697);<NEW_LINE>nls();<NEW_LINE>setState(698);<NEW_LINE>typeArgument();<NEW_LINE>setState(705);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().<MASK><NEW_LINE>while (_alt != 2 && _alt != groovyjarjarantlr4.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(699);<NEW_LINE>match(COMMA);<NEW_LINE>setState(700);<NEW_LINE>nls();<NEW_LINE>setState(701);<NEW_LINE>typeArgument();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(707);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 58, _ctx);<NEW_LINE>}<NEW_LINE>setState(708);<NEW_LINE>nls();<NEW_LINE>setState(709);<NEW_LINE>match(GT);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | adaptivePredict(_input, 58, _ctx); |
107,759 | public static void main(String[] args) throws Exception {<NEW_LINE>ReferenceConfig<GenericService> reference = new ReferenceConfig<>();<NEW_LINE>ApplicationConfig applicationConfig = new ApplicationConfig("protobuf-demo-consumer");<NEW_LINE>applicationConfig.setQosEnable(false);<NEW_LINE>reference.setApplication(applicationConfig);<NEW_LINE>reference.setInterface("org.apache.dubbo.sample.protobuf.GoogleProtobufService");<NEW_LINE>reference.setGeneric(CommonConstants.GENERIC_SERIALIZATION_PROTOBUF);<NEW_LINE>reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));<NEW_LINE><MASK><NEW_LINE>printServiceData();<NEW_LINE>Map<String, Object> request = new HashMap<>();<NEW_LINE>request.put("string", "message from client");<NEW_LINE>String requestString = new Gson().toJson(request);<NEW_LINE>Object result = genericService.$invoke("callGoogleProtobuf", new String[] { "org.apache.dubbo.sample.protobuf.GoogleProtobufBasic$GooglePBRequestType" }, new Object[] { requestString });<NEW_LINE>System.out.println(new Gson().toJson(result));<NEW_LINE>} | GenericService genericService = reference.get(); |
1,360,618 | private static byte[] fetchChunk(final FilerClient filerClient, FilerProto.FileChunk chunk) throws IOException {<NEW_LINE>String vid = "" + chunk.getFid().getVolumeId();<NEW_LINE>FilerProto.Locations locations = <MASK><NEW_LINE>if (locations == null) {<NEW_LINE>FilerProto.LookupVolumeRequest.Builder lookupRequest = FilerProto.LookupVolumeRequest.newBuilder();<NEW_LINE>lookupRequest.addVolumeIds(vid);<NEW_LINE>FilerProto.LookupVolumeResponse lookupResponse = filerClient.getBlockingStub().lookupVolume(lookupRequest.build());<NEW_LINE>locations = lookupResponse.getLocationsMapMap().get(vid);<NEW_LINE>filerClient.vidLocations.put(vid, locations);<NEW_LINE>LOG.debug("fetchChunk vid:{} locations:{}", vid, locations);<NEW_LINE>}<NEW_LINE>SeaweedRead.ChunkView chunkView = new // avoid deprecated chunk.getFileId()<NEW_LINE>SeaweedRead.ChunkView(FilerClient.toFileId(chunk.getFid()), 0, -1, 0, true, chunk.getCipherKey().toByteArray(), chunk.getIsCompressed());<NEW_LINE>byte[] chunkData = SeaweedRead.chunkCache.getChunk(chunkView.fileId);<NEW_LINE>if (chunkData == null) {<NEW_LINE>LOG.debug("doFetchFullChunkData:{}", chunkView);<NEW_LINE>chunkData = SeaweedRead.doFetchFullChunkData(filerClient, chunkView, locations);<NEW_LINE>}<NEW_LINE>if (chunk.getIsChunkManifest()) {<NEW_LINE>LOG.debug("chunk {} size {}", chunkView.fileId, chunkData.length);<NEW_LINE>SeaweedRead.chunkCache.setChunk(chunkView.fileId, chunkData);<NEW_LINE>}<NEW_LINE>return chunkData;<NEW_LINE>} | filerClient.vidLocations.get(vid); |
746,137 | public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>String propertyName = evt.getPropertyName();<NEW_LINE>if (Debugger.PROP_CURRENT_FRAME.equals(propertyName)) {<NEW_LINE>CallFrame cf = (CallFrame) evt.getNewValue();<NEW_LINE>if (cf != null) {<NEW_LINE>Script script = cf.getScript();<NEW_LINE>if (script != null) {<NEW_LINE>Project project = pc != null ? pc.getProject() : null;<NEW_LINE>Debugger d = (Debugger) evt.getSource();<NEW_LINE>Line line = MiscEditorUtil.getLine(d, project, script, cf.getLineNumber(<MASK><NEW_LINE>MiscEditorUtil.showLine(line, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DebuggerManager.PROP_CURRENT_ENGINE.equals(propertyName)) {<NEW_LINE>DebuggerEngine engine = (DebuggerEngine) evt.getNewValue();<NEW_LINE>if (engine != null) {<NEW_LINE>Debugger d = engine.lookupFirst("", Debugger.class);<NEW_LINE>if (d != null) {<NEW_LINE>pc = engine.lookupFirst(null, ProjectContext.class);<NEW_LINE>List<CallFrame> stackTrace;<NEW_LINE>if (d.isSuspended()) {<NEW_LINE>stackTrace = d.getCurrentCallStack();<NEW_LINE>} else {<NEW_LINE>stackTrace = Collections.emptyList();<NEW_LINE>}<NEW_LINE>updateAnnotations(d, stackTrace);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), cf.getColumnNumber()); |
905,029 | private Component components() {<NEW_LINE>VerticalLayout layout = VerticalLayout.create();<NEW_LINE>FileChooserTextBoxBuilder builder = FileChooserTextBoxBuilder.create(null);<NEW_LINE>layout.add(builder.build());<NEW_LINE>ToggleSwitch toggleSwitch = ToggleSwitch.create(true);<NEW_LINE>toggleSwitch.addValueListener(event -> Alerts.okInfo(LocalizeValue.of("toggle")).showAsync());<NEW_LINE>CheckBox checkBox = CheckBox.create(LocalizeValue.of("Check box"));<NEW_LINE>checkBox.addValueListener(event -> Alerts.okInfo(LocalizeValue.of("checkBox")).showAsync());<NEW_LINE>layout.add(AdvancedLabel.create().updatePresentation(presentation -> {<NEW_LINE>presentation.append(LocalizeValue.of("Advanced "), TextAttribute.REGULAR_BOLD);<NEW_LINE>presentation.append(LocalizeValue.of("Label"), new TextAttribute(Font.STYLE_PLAIN, StandardColors.RED, StandardColors.BLACK));<NEW_LINE>}));<NEW_LINE>layout.add(HorizontalLayout.create().add(Label.create(LocalizeValue.of("Toggle Switch"))).add(<MASK><NEW_LINE>layout.add(HorizontalLayout.create().add(Label.create(LocalizeValue.of("Password"))).add(PasswordBox.create()));<NEW_LINE>IntSlider intSlider = IntSlider.create(3);<NEW_LINE>intSlider.addValueListener(event -> Alerts.okInfo(LocalizeValue.of("intSlider " + event.getValue())).showAsync());<NEW_LINE>layout.add(HorizontalLayout.create().add(Label.create(LocalizeValue.of("IntSlider"))).add(intSlider));<NEW_LINE>layout.add(Hyperlink.create("Some Link", (e) -> Alerts.okInfo(LocalizeValue.of("Clicked!!!")).showAsync()));<NEW_LINE>HtmlView component = HtmlView.create();<NEW_LINE>component.withValue("<html><body><b>Some Bold Text</b> Test</body></html>");<NEW_LINE>layout.add(component);<NEW_LINE>return layout;<NEW_LINE>} | toggleSwitch).add(checkBox)); |
1,499,188 | public TimeRange unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TimeRange timeRange = new TimeRange();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("FromInclusive", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timeRange.setFromInclusive(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ToExclusive", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timeRange.setToExclusive(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 timeRange;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
741,967 | final BatchCreateChannelMembershipResult executeBatchCreateChannelMembership(BatchCreateChannelMembershipRequest batchCreateChannelMembershipRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchCreateChannelMembershipRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchCreateChannelMembershipRequest> request = null;<NEW_LINE>Response<BatchCreateChannelMembershipResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchCreateChannelMembershipRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchCreateChannelMembershipRequest));<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, "Chime SDK Messaging");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchCreateChannelMembership");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchCreateChannelMembershipResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchCreateChannelMembershipResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,763,682 | private static void createMergeAction(@Nonnull final BalloonLayoutData layoutData, @Nonnull JPanel panel) {<NEW_LINE>StringBuilder title = new StringBuilder().append(layoutData.mergeData.count).append(" more");<NEW_LINE>String shortTitle = NotificationParentGroup.getShortTitle(layoutData.groupId);<NEW_LINE>if (shortTitle != null) {<NEW_LINE>title.append(" from ").append(shortTitle);<NEW_LINE>}<NEW_LINE>LinkLabel<BalloonLayoutData> action = new LinkLabel<BalloonLayoutData>(title.toString(), null, new LinkListener<BalloonLayoutData>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void linkSelected(LinkLabel aSource, BalloonLayoutData layoutData) {<NEW_LINE>EventLog.showNotification(layoutData.project, layoutData.<MASK><NEW_LINE>}<NEW_LINE>}, layoutData) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean isInClickableArea(Point pt) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Color getTextColor() {<NEW_LINE>return new JBColor(0x666666, 0x8C8C8C);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>action.setFont(FontUtil.minusOne(action.getFont()));<NEW_LINE>action.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>action.setPaintUnderline(false);<NEW_LINE>AbstractLayoutManager layout = new AbstractLayoutManager() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension preferredLayoutSize(Container parent) {<NEW_LINE>return new Dimension(parent.getWidth(), JBUI.scale(20) + 2);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void layoutContainer(Container parent) {<NEW_LINE>parent.getComponent(0).setBounds(2, 1, parent.getWidth() - 4, JBUI.scale(20));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JPanel mergePanel = new NonOpaquePanel(layout) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>g.setColor(new JBColor(0xE3E3E3, 0x3A3C3D));<NEW_LINE>((Graphics2D) g).fill(new Rectangle2D.Double(1.5, 1, getWidth() - 2.5, getHeight() - 2));<NEW_LINE>g.setColor(new JBColor(0xDBDBDB, 0x353738));<NEW_LINE>if (SystemInfo.isMac) {<NEW_LINE>((Graphics2D) g).draw(new Rectangle2D.Double(2, 0, getWidth() - 3.5, 0.5));<NEW_LINE>} else if (SystemInfo.isWindows) {<NEW_LINE>((Graphics2D) g).draw(new Rectangle2D.Double(1.5, 0, getWidth() - 3, 0.5));<NEW_LINE>} else {<NEW_LINE>((Graphics2D) g).draw(new Rectangle2D.Double(1.5, 0, getWidth() - 2.5, 0.5));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>mergePanel.add(action);<NEW_LINE>panel.add(BorderLayout.SOUTH, mergePanel);<NEW_LINE>} | groupId, layoutData.getMergeIds()); |
1,024,296 | private Image loadImage(String img, int color) {<NEW_LINE>ImageDescriptor desc = ImageDescriptor.createFromURL(Resources.getResource("icons/" + img));<NEW_LINE>int zoom = DPIUtil.getDeviceZoom();<NEW_LINE>ImageData <MASK><NEW_LINE>if (data == null && zoom != 100) {<NEW_LINE>zoom = 100;<NEW_LINE>data = desc.getImageData(100);<NEW_LINE>}<NEW_LINE>for (int y = 0, o = 0; y < data.height; y++, o += data.bytesPerLine) {<NEW_LINE>for (int x = 0, i = o; x < data.width; x++) {<NEW_LINE>data.data[i++] = (byte) ((color >> 16) & 0xFF);<NEW_LINE>data.data[i++] = (byte) ((color >> 8) & 0xFF);<NEW_LINE>data.data[i++] = (byte) (color & 0xFF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Image(display, new DPIUtil.AutoScaleImageDataProvider(display, data, zoom));<NEW_LINE>} | data = desc.getImageData(zoom); |
993,158 | protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) throws NoSuchColorException {<NEW_LINE>lines = lines.trim();<NEW_LINE>final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());<NEW_LINE>final String codeRaw = line0.getLazzy("CODE", 0);<NEW_LINE>final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw);<NEW_LINE>final Ident ident = diagram.buildLeafIdent(idShort);<NEW_LINE>final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);<NEW_LINE>final String icon = line0.getLazzy("STEREOTYPE", 0);<NEW_LINE>final IEntity entity = diagram.getOrCreateLeaf(ident, code, <MASK><NEW_LINE>lines = lines.subExtract(1, 1);<NEW_LINE>Display display = lines.toDisplay();<NEW_LINE>entity.setDisplay(display);<NEW_LINE>entity.setUSymbol(USymbols.RECTANGLE);<NEW_LINE>if (icon != null) {<NEW_LINE>entity.setStereotype(Stereotype.build("<<$archimate/" + icon + ">>", diagram.getSkinParam().getCircledCharacterRadius(), diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));<NEW_LINE>}<NEW_LINE>final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0, diagram.getSkinParam().getIHtmlColorSet());<NEW_LINE>entity.setColors(colors);<NEW_LINE>return CommandExecutionResult.ok();<NEW_LINE>} | LeafType.DESCRIPTION, USymbols.RECTANGLE); |
818,663 | private static PsiFile createOrMergeInjectedFile(@Nonnull PsiFile hostPsiFile, @Nonnull PsiDocumentManagerBase documentManager, @Nonnull Place place, @Nonnull DocumentWindowImpl documentWindow, @Nonnull PsiFile psiFile, @Nonnull InjectedFileViewProvider viewProvider) {<NEW_LINE>cacheEverything(place, documentWindow, viewProvider, psiFile);<NEW_LINE>final VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(documentWindow);<NEW_LINE>PsiFile cachedPsiFile = ((PsiManagerEx) psiFile.getManager()).getFileManager().findCachedViewProvider(virtualFile).<MASK><NEW_LINE>assert cachedPsiFile == psiFile : "Cached psi :" + cachedPsiFile + " instead of " + psiFile;<NEW_LINE>assert place.isValid();<NEW_LINE>assert viewProvider.isValid();<NEW_LINE>List<InjectedLanguageUtil.TokenInfo> newTokens = InjectedLanguageUtil.getHighlightTokens(psiFile);<NEW_LINE>PsiFile newFile = registerDocument(documentWindow, psiFile, place, hostPsiFile, documentManager);<NEW_LINE>boolean mergeHappened = newFile != psiFile;<NEW_LINE>Place mergedPlace = place;<NEW_LINE>if (mergeHappened) {<NEW_LINE>InjectedLanguageUtil.clearCaches(psiFile, documentWindow);<NEW_LINE>psiFile = newFile;<NEW_LINE>viewProvider = (InjectedFileViewProvider) psiFile.getViewProvider();<NEW_LINE>documentWindow = (DocumentWindowImpl) viewProvider.getDocument();<NEW_LINE>boolean shredsReused = !cacheEverything(place, documentWindow, viewProvider, psiFile);<NEW_LINE>if (shredsReused) {<NEW_LINE>place.dispose();<NEW_LINE>mergedPlace = documentWindow.getShreds();<NEW_LINE>}<NEW_LINE>InjectedLanguageUtil.setHighlightTokens(psiFile, newTokens);<NEW_LINE>}<NEW_LINE>assert psiFile.isValid();<NEW_LINE>assert mergedPlace.isValid();<NEW_LINE>assert viewProvider.isValid();<NEW_LINE>return psiFile;<NEW_LINE>} | getPsi(psiFile.getLanguage()); |
474,291 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String accountName, NotebookWorkspaceName notebookWorkspaceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (notebookWorkspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,698,245 | boolean isDefiniteDeclaration(AbstractCompiler compiler) {<NEW_LINE>Node parent = getLhs().getParent();<NEW_LINE>switch(parent.getToken()) {<NEW_LINE>case DEFAULT_VALUE:<NEW_LINE>if (!parent.getParent().isStringKey()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// fall through<NEW_LINE>case COMPUTED_PROP:<NEW_LINE>case STRING_KEY:<NEW_LINE>if (NodeUtil.isLhsByDestructuring(getLhs())) {<NEW_LINE>Node rootTarget = NodeUtil.getRootTarget(getLhs());<NEW_LINE>checkState(rootTarget.getParent().isDestructuringLhs());<NEW_LINE>if (NodeUtil.isNameDeclaration(rootTarget.getGrandparent())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>case VAR:<NEW_LINE>case LET:<NEW_LINE>case CONST:<NEW_LINE>case CLASS:<NEW_LINE>case FUNCTION:<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE>return isExportLhs(getLhs()) || (getJsDoc() != null && getJsDoc().containsDeclaration()) || (getRhs() != null && PotentialDeclaration<MASK><NEW_LINE>}<NEW_LINE>} | .isTypedRhs(getRhs())); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.