idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,761,307 | SmartLifecycle functionArchiveUnDeployer(FunctionDeployerProperties functionProperties, FunctionRegistry functionRegistry, ApplicationArguments arguments, @Nullable MavenProperties mavenProperties, ApplicationContext applicationContext) {<NEW_LINE>ApplicationArguments updatedArguments = this.updateArguments(arguments);<NEW_LINE>Archive archive = null;<NEW_LINE>try {<NEW_LINE>File file;<NEW_LINE>String location = functionProperties.getLocation();<NEW_LINE>Assert.hasText(location, "`spring.cloud.function.location` property must be defined.");<NEW_LINE>if (location.startsWith("maven://")) {<NEW_LINE>MavenResourceLoader resourceLoader = new MavenResourceLoader(mavenProperties);<NEW_LINE>file = resourceLoader.getResource(location).getFile();<NEW_LINE>} else {<NEW_LINE>file = new File(location);<NEW_LINE>}<NEW_LINE>if (!file.exists()) {<NEW_LINE>throw new IllegalStateException("Failed to create archive: " + functionProperties.getLocation() + " does not exist");<NEW_LINE>} else if (file.isDirectory()) {<NEW_LINE>archive = new ExplodedArchive(file);<NEW_LINE>} else {<NEW_LINE>archive = new JarFileArchive(file);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to create archive: " + functionProperties.getLocation(), e);<NEW_LINE>}<NEW_LINE>FunctionArchiveDeployer deployer = new FunctionArchiveDeployer(archive);<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info(<MASK><NEW_LINE>}<NEW_LINE>deployer.deploy(functionRegistry, functionProperties, updatedArguments.getSourceArgs(), applicationContext);<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Successfully deployed archive: " + functionProperties.getLocation());<NEW_LINE>}<NEW_LINE>return new SmartLifecycle() {<NEW_LINE><NEW_LINE>private boolean running = true;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Undeploying archive: " + functionProperties.getLocation());<NEW_LINE>}<NEW_LINE>deployer.undeploy();<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Successfully undeployed archive: " + functionProperties.getLocation());<NEW_LINE>}<NEW_LINE>this.running = false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void start() {<NEW_LINE>// no op<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isRunning() {<NEW_LINE>return this.running;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getPhase() {<NEW_LINE>return Integer.MAX_VALUE - 1000;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | "Deploying archive: " + functionProperties.getLocation()); |
514,230 | private Mono<PagedResponse<DetectorDefinitionInner>> listSiteDetectorsSlotNextSinglePageAsync(String nextLink) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<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>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listSiteDetectorsSlotNext(nextLink, this.client.getEndpoint(), accept, context)).<PagedResponse<DetectorDefinitionInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
242,722 | final DeleteConnectionResult executeDeleteConnection(DeleteConnectionRequest deleteConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConnectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConnectionRequest> request = null;<NEW_LINE>Response<DeleteConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConnectionRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConnection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConnectionResultJsonUnmarshaller());<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); |
349,017 | private ClassInformationType scanTargetArchive() throws ClassScannerException {<NEW_LINE>final HashSet<ClassInfoType> citSet = new HashSet<ClassInfoType>();<NEW_LINE>final String urlProtocol = targetArchive.getProtocol();<NEW_LINE>if ("file".equalsIgnoreCase(urlProtocol)) {<NEW_LINE>// Protocol is "file", which either addresses a jar file or an exploded jar file<NEW_LINE>try {<NEW_LINE>Path taPath = Paths.get(targetArchive.toURI());<NEW_LINE>if (Files.isDirectory(taPath)) {<NEW_LINE>// Exploded Archive<NEW_LINE>citSet.addAll(processExplodedJarFormat(taPath));<NEW_LINE>} else {<NEW_LINE>// Unexploded Archive<NEW_LINE>citSet.addAll(processUnexplodedFile(taPath));<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>FFDCFilter.processException(e, EntityMappingsScanner.class.getName() + ".scanTargetArchive", "85");<NEW_LINE>throw new ClassScannerException(e);<NEW_LINE>}<NEW_LINE>} else if (targetArchive.toString().startsWith("jar:file")) {<NEW_LINE>citSet.addAll(processJarFileURL(targetArchive));<NEW_LINE>} else {<NEW_LINE>// InputStream will be in jar format.<NEW_LINE>citSet<MASK><NEW_LINE>}<NEW_LINE>// Find Inner Classes, merge them into their encapsulating class, and remove them as a standalone ClassInfoType.<NEW_LINE>processInnerClasses(citSet);<NEW_LINE>ClassInformationType cit = new ClassInformationType();<NEW_LINE>List<ClassInfoType> citList = cit.getClassInfo();<NEW_LINE>citList.addAll(citSet);<NEW_LINE>ioResolver.resolve(citList);<NEW_LINE>return cit;<NEW_LINE>} | .addAll(processJarFormatInputStreamURL(targetArchive)); |
709,059 | protected void configure() {<NEW_LINE>bind(Project.class).toInstance(project);<NEW_LINE>bind(ServiceRegistry.class).toInstance(serviceRegistry);<NEW_LINE>bind(NotationParser.class).to(DefaultNotationParser.class);<NEW_LINE>bind(BuildManager.class).to(DefaultBuildManager.class);<NEW_LINE>bind(GoBinaryManager.class<MASK><NEW_LINE>bind(MapNotationParser.class).to(DefaultMapNotationParser.class);<NEW_LINE>bind(GlobalCacheManager.class).to(DefaultGlobalCacheManager.class);<NEW_LINE>bind(NotationConverter.class).to(DefaultNotationConverter.class);<NEW_LINE>bind(BuildConstraintManager.class).to(DefaultBuildConstraintManager.class);<NEW_LINE>bind(DependencyVisitor.class).to(DefaultDependencyVisitor.class);<NEW_LINE>bind(LockedDependencyManager.class).to(DefaultLockedDependencyManager.class);<NEW_LINE>bind(GoTestResultExtractor.class).to(DefaultGoTestResultExtractor.class);<NEW_LINE>bind(MapNotationParser.class).annotatedWith(Git.class).to(GitMercurialMapNotationParser.class);<NEW_LINE>bind(NotationConverter.class).annotatedWith(Git.class).to(GitMercurialNotationConverter.class);<NEW_LINE>bind(VcsAccessor.class).annotatedWith(Git.class).to(GitClientAccessor.class);<NEW_LINE>bind(DependencyManager.class).annotatedWith(Git.class).to(GitDependencyManager.class);<NEW_LINE>bind(MapNotationParser.class).annotatedWith(Mercurial.class).to(GitMercurialMapNotationParser.class);<NEW_LINE>bind(NotationConverter.class).annotatedWith(Mercurial.class).to(GitMercurialNotationConverter.class);<NEW_LINE>bind(VcsAccessor.class).annotatedWith(Mercurial.class).to(HgClientAccessor.class);<NEW_LINE>bind(DependencyManager.class).annotatedWith(Mercurial.class).to(MercurialDependencyManager.class);<NEW_LINE>bind(MapNotationParser.class).annotatedWith(Svn.class).to(SvnMapNotationParser.class);<NEW_LINE>bind(NotationConverter.class).annotatedWith(Svn.class).to(SvnNotationConverter.class);<NEW_LINE>bind(VcsAccessor.class).annotatedWith(Svn.class).to(SvnAccessor.class);<NEW_LINE>bind(MapNotationParser.class).annotatedWith(Bazaar.class).to(BazaarMapNotationParser.class);<NEW_LINE>bind(NotationConverter.class).annotatedWith(Bazaar.class).to(BazaarNotationConverter.class);<NEW_LINE>bind(VcsAccessor.class).annotatedWith(Bazaar.class).to(BazaarAccessor.class);<NEW_LINE>bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean matches(Method method) {<NEW_LINE>return method.isAnnotationPresent(DebugLog.class) && !method.isSynthetic();<NEW_LINE>}<NEW_LINE>}, new DebugLogMethodInterceptor());<NEW_LINE>} | ).to(DefaultGoBinaryManager.class); |
797,045 | public void publish(LogRecord rec) {<NEW_LINE>String message = rec.getMessage();<NEW_LINE>if (rec.getResourceBundle() != null) {<NEW_LINE>try {<NEW_LINE>message = rec.getResourceBundle().getString(rec.getMessage());<NEW_LINE>if (rec.getParameters() != null) {<NEW_LINE>message = MessageFormat.format(message, rec.getParameters());<NEW_LINE>}<NEW_LINE>} catch (MissingResourceException ex) {<NEW_LINE>Logger.getAnonymousLogger().log(Level.INFO, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object[] args = rec.getParameters();<NEW_LINE>if (args == null || args[0] == null)<NEW_LINE>return;<NEW_LINE>if (args.length == 1) {<NEW_LINE>// simplified instance logging<NEW_LINE>TimesCollectorPeer.getDefault().reportReference(INSTANCES, rec.getMessage()<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (args.length < 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object key = args[0];<NEW_LINE>if (args[1] instanceof Number) {<NEW_LINE>// time<NEW_LINE>TimesCollectorPeer.getDefault().reportTime(key, rec.getMessage(), message, ((Number) args[1]).longValue());<NEW_LINE>} else if (args[1] instanceof Boolean) {<NEW_LINE>// start/stop logic<NEW_LINE>// XXX - start/stop support<NEW_LINE>} else {<NEW_LINE>String txt = message.startsWith("[M]") ? message : "[M] " + message;<NEW_LINE>TimesCollectorPeer.getDefault().reportReference(key, rec.getMessage(), txt, args[1]);<NEW_LINE>}<NEW_LINE>} | , message, args[0]); |
952,142 | public void after(Object target, Object[] args, Object result, Throwable throwable) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.afterInterceptor(target, args, result, throwable);<NEW_LINE>}<NEW_LINE>final Trace trace = traceContext.currentTraceObject();<NEW_LINE>if (trace == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>recorder.recordServiceType(FastjsonConstants.SERVICE_TYPE);<NEW_LINE>recorder.recordApi(descriptor);<NEW_LINE>recorder.recordException(throwable);<NEW_LINE>Object arg = ArrayUtils.get(args, 0);<NEW_LINE>if (arg != null) {<NEW_LINE>if (arg instanceof String) {<NEW_LINE>recorder.recordAttribute(FastjsonConstants.ANNOTATION_KEY_JSON_LENGTH, ((String) arg).length());<NEW_LINE>} else if (arg instanceof byte[]) {<NEW_LINE>recorder.recordAttribute(FastjsonConstants.ANNOTATION_KEY_JSON_LENGTH, ((byte[]) arg).length);<NEW_LINE>} else if (arg instanceof char[]) {<NEW_LINE>recorder.recordAttribute(FastjsonConstants.ANNOTATION_KEY_JSON_LENGTH, ((char[]) arg).length);<NEW_LINE>} else if (arg instanceof InputStream) {<NEW_LINE>recorder.recordAttribute(FastjsonConstants.ANNOTATION_KEY_JSON_LENGTH, ((InputStream) arg).available());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ignore) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>trace.traceBlockEnd();<NEW_LINE>}<NEW_LINE>} | SpanEventRecorder recorder = trace.currentSpanEventRecorder(); |
1,638,478 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>JtdsConfig config = new JtdsConfig(instrumentor.getProfilerConfig());<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>target.addField(DatabaseInfoAccessor.class);<NEW_LINE>target.addField(ParsingResultAccessor.class);<NEW_LINE>target.addField(BindValueAccessor.class);<NEW_LINE>int maxBindValueSize = config.getMaxSqlBindValueSize();<NEW_LINE>final Class<? <MASK><NEW_LINE>InstrumentUtils.findMethod(target, "execute").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), JTDS_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeQuery").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), JTDS_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), JTDS_SCOPE);<NEW_LINE>if (config.isTraceSqlBindValue()) {<NEW_LINE>MethodFilter filter = new PreparedStatementBindingMethodFilter();<NEW_LINE>List<InstrumentMethod> declaredMethods = target.getDeclaredMethods(filter);<NEW_LINE>for (InstrumentMethod method : declaredMethods) {<NEW_LINE>method.addScopedInterceptor(PreparedStatementBindVariableInterceptor.class, JTDS_SCOPE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | extends Interceptor> preparedStatementInterceptor = PreparedStatementExecuteQueryInterceptor.class; |
1,552,939 | private void printStats(CombinedStatistics combinedStatistics) {<NEW_LINE>MutationStatistics stats = combinedStatistics.getMutationStatistics();<NEW_LINE>final PrintStream ps = System.out;<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>ps.println("- Mutators");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>for (final Score each : stats.getScores()) {<NEW_LINE>each.report(ps);<NEW_LINE>ps.println(StringUtil.separatorLine());<NEW_LINE>}<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>ps.println("- Timings");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>this.timings.report(ps);<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>ps.println("- Statistics");<NEW_LINE>ps.println(StringUtil.separatorLine('='));<NEW_LINE>final CoverageSummary coverage = combinedStatistics.getCoverageSummary();<NEW_LINE>if (coverage != null) {<NEW_LINE>ps.println(String.format(">> Line Coverage: %d/%d (%d%%)", coverage.getNumberOfCoveredLines(), coverage.getNumberOfLines()<MASK><NEW_LINE>}<NEW_LINE>stats.report(ps);<NEW_LINE>} | , coverage.getCoverage())); |
1,775,370 | public DeclarationSubject declares(String name) {<NEW_LINE>AbstractVar<?, ?> var = getVar(name);<NEW_LINE>if (var == null) {<NEW_LINE>ImmutableList<AbstractVar<?, ?>> declared = ImmutableList.copyOf(actual.getAllAccessibleVariables());<NEW_LINE>ImmutableList<String> names = declared.stream().map(AbstractVar::getName).collect(toImmutableList());<NEW_LINE>if (names.size() > 10) {<NEW_LINE>names = ImmutableList.<String>builder().addAll(names.subList(0, 9)).add("and " + (names.size() - 9) + " others").build();<NEW_LINE>}<NEW_LINE>failWithoutActual(fact("expected to declare", name), simpleFact("but did not"), fact("did declare", Joiner.on(", ").join(names)), fact("scope was", actual));<NEW_LINE>}<NEW_LINE>assertThat(actual.getTopmostScopeOfEventualDeclaration(name)).<MASK><NEW_LINE>return new DeclarationSubject(var);<NEW_LINE>} | isEqualTo(var.getScope()); |
189,198 | private void handleNeo4jError(Status status, Throwable cause) {<NEW_LINE>if (cause instanceof FabricException) {<NEW_LINE>// unwrap FabricException where possible.<NEW_LINE>var rootCause = ((FabricException) cause).status();<NEW_LINE>if (cause.getCause() != null && cause.getCause().getMessage().equals("A query with 'PERIODIC COMMIT' can only be executed in an implicit transaction, " + "but tried to execute in an explicit transaction.")) {<NEW_LINE>neo4jError = new Neo4jError(<MASK><NEW_LINE>} else if (rootCause.equals(Status.Statement.AccessMode) && cause.getMessage() != null && cause.getMessage().startsWith(WRITING_IN_READ_NOT_ALLOWED_MSG)) {<NEW_LINE>neo4jError = new Neo4jError(Status.Request.Invalid, "Routing WRITE queries is not supported in clusters " + "where Server-Side Routing is disabled.");<NEW_LINE>} else {<NEW_LINE>neo4jError = new Neo4jError(rootCause, cause.getCause() != null ? cause.getCause() : cause);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>neo4jError = new Neo4jError(status, cause);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>outputEventStream.writeFailure(neo4jError.status(), neo4jError.getMessage());<NEW_LINE>} catch (ConnectionException | OutputFormatException e) {<NEW_LINE>handleOutputError(e);<NEW_LINE>}<NEW_LINE>} | Status.Request.Invalid, "Routing of PERIODIC COMMIT is not currently supported. Please retry your request against the cluster leader"); |
1,634,131 | // ///////////////////////////////////////////////////<NEW_LINE>// ///////////////// API Implementation //////////////<NEW_LINE>// ///////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>public void execute() {<NEW_LINE>ProjectRole projectRole = projRoleService.findProjectRole(getProjectRoleId(), getProjectId());<NEW_LINE>boolean result = false;<NEW_LINE>if (projectRole == null) {<NEW_LINE>throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided");<NEW_LINE>}<NEW_LINE>if (getProjectRulePermissionOrder() != null) {<NEW_LINE>if (getProjectRuleId() != null || getProjectRolePermission() != null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>CallContext.current().setEventDetails("Reordering permissions for role id: " + projectRole.getId());<NEW_LINE>result = updateProjectRolePermissionOrder(projectRole);<NEW_LINE>} else if (getProjectRuleId() != null || getProjectRolePermission() != null) {<NEW_LINE>if (getProjectRulePermissionOrder() != null) {<NEW_LINE>throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");<NEW_LINE>}<NEW_LINE>ProjectRolePermission rolePermission = getValidProjectRolePermission();<NEW_LINE>CallContext.current().setEventDetails("Updating project role permission for rule id: " + getProjectRuleId() + " to: " + getProjectRolePermission().toString());<NEW_LINE>result = projRoleService.updateProjectRolePermission(projectId, projectRole, rolePermission, getProjectRolePermission());<NEW_LINE>}<NEW_LINE>SuccessResponse response = new SuccessResponse(getCommandName());<NEW_LINE>response.setSuccess(result);<NEW_LINE>setResponseObject(response);<NEW_LINE>} | ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder"); |
234,707 | public void afterExecute(final Runnable runnable, final Throwable throwable) {<NEW_LINE>super.afterExecute(runnable, throwable);<NEW_LINE>if (throwable != null) {<NEW_LINE>// Wrap the throwable in an ExecutionException (execute() does not do this)<NEW_LINE>interruptionChecker.setExecutionException(new ExecutionException("Uncaught exception", throwable));<NEW_LINE>// execute() was called and an uncaught exception or error was thrown<NEW_LINE>interruptionChecker.interrupt();<NEW_LINE>} else if (/* throwable == null && */<NEW_LINE>runnable instanceof Future<?>) {<NEW_LINE>// submit() was called, so throwable is not set<NEW_LINE>try {<NEW_LINE>// This call will not block, since execution has finished<NEW_LINE>((Future<?<MASK><NEW_LINE>} catch (CancellationException | InterruptedException e) {<NEW_LINE>// If this thread was cancelled or interrupted, interrupt other threads<NEW_LINE>interruptionChecker.interrupt();<NEW_LINE>} catch (final ExecutionException e) {<NEW_LINE>// Record the exception that was thrown by the thread<NEW_LINE>interruptionChecker.setExecutionException(e);<NEW_LINE>// Interrupt other threads<NEW_LINE>interruptionChecker.interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | >) runnable).get(); |
31,562 | private void updateQuota(long quota) {<NEW_LINE>long storedQuota = getDBLong("quotaPoints", 0L);<NEW_LINE>String storedDate = getDBString("quotaDate", "01-01-2000");<NEW_LINE><MASK><NEW_LINE>datefmt.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));<NEW_LINE>String currentDate = datefmt.format(new Date());<NEW_LINE>if (!currentDate.equals(storedDate)) {<NEW_LINE>com.gmt2001.Console.debug.println("Date Change Detected: " + storedDate + " -> " + currentDate);<NEW_LINE>com.gmt2001.Console.debug.println("Resetting Quota. New Quota: " + quota);<NEW_LINE>updateDBString("quotaDate", currentDate);<NEW_LINE>updateDBLong("quotaPoints", quota);<NEW_LINE>} else {<NEW_LINE>com.gmt2001.Console.debug.println("Updating Quota. New Quota: " + (quota + storedQuota));<NEW_LINE>updateDBLong("quotaPoints", quota + storedQuota);<NEW_LINE>}<NEW_LINE>} | SimpleDateFormat datefmt = new SimpleDateFormat("dd-MM-yyyy"); |
1,741,856 | public Pair<List<QuotaSummaryResponse>, Integer> createQuotaSummaryResponse(Boolean listAll, final String keyword, final Long startIndex, final Long pageSize) {<NEW_LINE>List<QuotaSummaryResponse> result <MASK><NEW_LINE>Integer count = 0;<NEW_LINE>if (listAll) {<NEW_LINE>Filter filter = new Filter(AccountVO.class, "accountName", true, startIndex, pageSize);<NEW_LINE>Pair<List<AccountVO>, Integer> data = _accountDao.findAccountsLike(keyword, filter);<NEW_LINE>count = data.second();<NEW_LINE>for (final AccountVO account : data.first()) {<NEW_LINE>QuotaSummaryResponse qr = getQuotaSummaryResponse(account);<NEW_LINE>result.add(qr);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Pair<List<QuotaAccountVO>, Integer> data = _quotaAccountDao.listAllQuotaAccount(startIndex, pageSize);<NEW_LINE>count = data.second();<NEW_LINE>for (final QuotaAccountVO quotaAccount : data.first()) {<NEW_LINE>AccountVO account = _accountDao.findById(quotaAccount.getId());<NEW_LINE>if (account == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>QuotaSummaryResponse qr = getQuotaSummaryResponse(account);<NEW_LINE>result.add(qr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(result, count);<NEW_LINE>} | = new ArrayList<QuotaSummaryResponse>(); |
86,335 | public static void main(String[] args) {<NEW_LINE>// snippet-start:[ec2.java1.running_instances.main]<NEW_LINE>AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();<NEW_LINE>try {<NEW_LINE>// Create the Filter to use to find running instances<NEW_LINE>Filter filter = new Filter("instance-state-name");<NEW_LINE>filter.withValues("running");<NEW_LINE>// Create a DescribeInstancesRequest<NEW_LINE>DescribeInstancesRequest request = new DescribeInstancesRequest();<NEW_LINE>request.withFilters(filter);<NEW_LINE>// Find the running instances<NEW_LINE>DescribeInstancesResult response = ec2.describeInstances(request);<NEW_LINE>for (Reservation reservation : response.getReservations()) {<NEW_LINE>for (Instance instance : reservation.getInstances()) {<NEW_LINE>// Print out the results<NEW_LINE>System.out.printf("Found reservation with id %s, " + "AMI %s, " + "type %s, " + "state %s " + "and monitoring state %s", instance.getInstanceId(), instance.getImageId(), instance.getInstanceType(), instance.getState().getName(), instance.getMonitoring().getState());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (SdkClientException e) {<NEW_LINE>e.getStackTrace();<NEW_LINE>}<NEW_LINE>// snippet-end:[ec2.java1.running_instances.main]<NEW_LINE>} | System.out.print("Done"); |
369,530 | public MethodInvocation parseAndApplyInvocation(JsonArray rpcCall, ApplicationConnection connection) {<NEW_LINE>ConnectorMap connectorMap = ConnectorMap.get(connection);<NEW_LINE>String connectorId = rpcCall.getString(0);<NEW_LINE>String interfaceName = rpcCall.getString(1);<NEW_LINE>String methodName = rpcCall.getString(2);<NEW_LINE>JsonArray parametersJson = rpcCall.getArray(3);<NEW_LINE>ServerConnector connector = connectorMap.getConnector(connectorId);<NEW_LINE>MethodInvocation invocation = new MethodInvocation(connectorId, interfaceName, methodName);<NEW_LINE>if (connector instanceof HasJavaScriptConnectorHelper) {<NEW_LINE>((HasJavaScriptConnectorHelper) connector).getJavascriptConnectorHelper().invokeJsRpc(invocation, parametersJson);<NEW_LINE>} else {<NEW_LINE>if (connector == null) {<NEW_LINE>throw new IllegalStateException("Target connector (" + connector + ") not found for RCC to " + getSignature(invocation));<NEW_LINE>}<NEW_LINE>parseMethodParameters(invocation, parametersJson, connection);<NEW_LINE>getLogger(<MASK><NEW_LINE>applyInvocation(invocation, connector);<NEW_LINE>}<NEW_LINE>return invocation;<NEW_LINE>} | ).info("Server to client RPC call: " + invocation); |
44,561 | private ImmutableMap<String, BuildOptions> handleFatApkCpus(BuildOptionsView buildOptions, AndroidConfiguration.Options androidOptions) {<NEW_LINE>ImmutableMap.Builder<String, BuildOptions> result = ImmutableMap.builder();<NEW_LINE>for (String cpu : ImmutableSortedSet.copyOf(androidOptions.fatApkCpus)) {<NEW_LINE>BuildOptionsView splitOptions = buildOptions.clone();<NEW_LINE>// Disable fat APKs for the child configurations.<NEW_LINE>splitOptions.get(AndroidConfiguration.Options.class).fatApkCpus = ImmutableList.of();<NEW_LINE>splitOptions.get(AndroidConfiguration.Options.class).androidPlatforms = ImmutableList.of();<NEW_LINE>// Set the cpu & android_cpu.<NEW_LINE>// TODO(bazel-team): --android_cpu doesn't follow --cpu right now; it should.<NEW_LINE>splitOptions.get(AndroidConfiguration.Options.class).cpu = cpu;<NEW_LINE>splitOptions.get(CoreOptions.class).cpu = cpu;<NEW_LINE>setCcFlagsFromAndroid(androidOptions, splitOptions);<NEW_LINE>// Ensure platforms aren't set so that platform mapping can take place.<NEW_LINE>splitOptions.get(PlatformOptions.class)<MASK><NEW_LINE>result.put(cpu, splitOptions.underlying());<NEW_LINE>addNonCpuSplits(result, cpu, splitOptions);<NEW_LINE>}<NEW_LINE>return result.buildOrThrow();<NEW_LINE>} | .platforms = ImmutableList.of(); |
677,626 | protected MetadataFieldRest put(Context context, HttpServletRequest request, String apiCategory, String model, Integer id, JsonNode jsonNode) throws SQLException, AuthorizeException {<NEW_LINE>MetadataFieldRest metadataFieldRest = new Gson().fromJson(jsonNode.toString(), MetadataFieldRest.class);<NEW_LINE>if (isBlank(metadataFieldRest.getElement())) {<NEW_LINE>throw new UnprocessableEntityException("metadata element (in request body) cannot be blank");<NEW_LINE>}<NEW_LINE>if (!Objects.equals(id, metadataFieldRest.getId())) {<NEW_LINE>throw new UnprocessableEntityException("ID in request body doesn't match path ID");<NEW_LINE>}<NEW_LINE>MetadataField metadataField = metadataFieldService.find(context, id);<NEW_LINE>if (metadataField == null) {<NEW_LINE>throw new ResourceNotFoundException("metadata field with id: " + id + " not found");<NEW_LINE>}<NEW_LINE>metadataField.setElement(metadataFieldRest.getElement());<NEW_LINE>metadataField.setQualifier(metadataFieldRest.getQualifier());<NEW_LINE>metadataField.setScopeNote(metadataFieldRest.getScopeNote());<NEW_LINE>try {<NEW_LINE>metadataFieldService.update(context, metadataField);<NEW_LINE>context.commit();<NEW_LINE>} catch (NonUniqueMetadataException e) {<NEW_LINE>throw new UnprocessableEntityException("metadata field " + metadataField.getMetadataSchema().getName() + "." + metadataFieldRest.getElement() + (metadataFieldRest.getQualifier() != null ? "." + metadataFieldRest.getQualifier<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return converter.toRest(metadataField, utils.obtainProjection());<NEW_LINE>} | () : "") + " already exists"); |
550,131 | public void onClick(DialogInterface dialog, int item) {<NEW_LINE>if (items.get(item).value.startsWith("KP2ASPECIAL")) {<NEW_LINE>// change entry<NEW_LINE>String packageName <MASK><NEW_LINE>Intent startKp2aIntent = getPackageManager().getLaunchIntentForPackage(packageName);<NEW_LINE>if (startKp2aIntent != null) {<NEW_LINE>startKp2aIntent.addCategory(Intent.CATEGORY_LAUNCHER);<NEW_LINE>startKp2aIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);<NEW_LINE>String value = items.get(item).value;<NEW_LINE>String taskName = value.substring("KP2ASPECIAL_".length());<NEW_LINE>startKp2aIntent.putExtra("KP2A_APPTASK", taskName);<NEW_LINE>if (taskName.equals("SearchUrlTask")) {<NEW_LINE>startKp2aIntent.putExtra("UrlToSearch", "androidapp://" + clientPackageName);<NEW_LINE>}<NEW_LINE>startActivity(startKp2aIntent);<NEW_LINE>} else<NEW_LINE>Log.w("KP2AK", "didn't find intent for " + packageName);<NEW_LINE>} else {<NEW_LINE>StringForTyping theItem = items.get(item);<NEW_LINE>commitStringForTyping(theItem);<NEW_LINE>}<NEW_LINE>} | = getApplicationContext().getPackageName(); |
399,241 | protected BiMap<TableReference, TableReference> readTableMap() {<NEW_LINE>// TODO (jkong) Remove after PDS-117310 is resolved.<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Attempting to read the table mapping from the namespace table.", new SafeRuntimeException("I exist to show you the stack trace"));<NEW_LINE>}<NEW_LINE>BiMap<TableReference, TableReference> ret = HashBiMap.create();<NEW_LINE>try (ClosableIterator<RowResult<Value>> range = rangeScanNamespaceTable()) {<NEW_LINE>while (range.hasNext()) {<NEW_LINE>RowResult<Value> row = range.next();<NEW_LINE>String shortName = PtBytes.toString(row.getColumns().get(AtlasDbConstants.NAMESPACE_SHORT_COLUMN_BYTES).getContents());<NEW_LINE>TableReference ref = <MASK><NEW_LINE>ret.put(ref, TableReference.createWithEmptyNamespace(shortName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO (jkong) Remove after PDS-117310 is resolved.<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Successfully read {} entries from the namespace table, to refresh the table map.", SafeArg.of("entriesRead", ret.size()), new SafeRuntimeException("I exist to show you the stack trace"));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | getTableRefFromBytes(row.getRowName()); |
1,606,811 | void paint() {<NEW_LINE>// loadContentIcon may return a null image<NEW_LINE>if (image != null) {<NEW_LINE>image.paintIcon(comp, graphics, 0, 0);<NEW_LINE>}<NEW_LINE>// turn anti-aliasing on for the splash text<NEW_LINE>graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);<NEW_LINE>if (versionBox != null) {<NEW_LINE>String buildNumber = System.getProperty("netbeans.buildnumber");<NEW_LINE>versionBox.layout(NbBundle.getMessage(TopLogging.class, "currentVersion", buildNumber), graphics);<NEW_LINE>}<NEW_LINE>if (text != null) {<NEW_LINE>statusBox.layout(text, graphics);<NEW_LINE>}<NEW_LINE>// Draw progress bar if applicable<NEW_LINE>if (!noBar && maxSteps > 0) /* && barLength > 0*/<NEW_LINE>{<NEW_LINE>graphics.setColor(color_bar);<NEW_LINE>graphics.fillRect(bar.x, bar.y, barStart + barLength, bar.height);<NEW_LINE>if (!color_bar.equals(color_corner)) {<NEW_LINE>graphics.setColor(color_corner);<NEW_LINE>graphics.drawLine(bar.x, bar.y, bar.x, <MASK><NEW_LINE>graphics.drawLine(bar.x + barStart + barLength, bar.y, bar.x + barStart + barLength, bar.y + bar.height);<NEW_LINE>}<NEW_LINE>if (!color_bar.equals(color_edge)) {<NEW_LINE>graphics.setColor(color_edge);<NEW_LINE>graphics.drawLine(bar.x, bar.y + bar.height / 2, bar.x, bar.y + bar.height / 2);<NEW_LINE>graphics.drawLine(bar.x + barStart + barLength, bar.y + bar.height / 2, bar.x + barStart + barLength, bar.y + bar.height / 2);<NEW_LINE>}<NEW_LINE>barStart += barLength;<NEW_LINE>barLength = 0;<NEW_LINE>}<NEW_LINE>} | bar.y + bar.height); |
1,477,076 | private File createSiteArchive() throws ClientException {<NEW_LINE>File siteArchiveFile;<NEW_LINE>try {<NEW_LINE>siteArchiveFile = File.createTempFile("drill-site-", ".tar.gz");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ClientException("Failed to create site archive temp file", e);<NEW_LINE>}<NEW_LINE>String[] cmd = new String[] { "tar", "-C", localSiteDir.getAbsolutePath(), "-czf", siteArchiveFile.getAbsolutePath(), "." };<NEW_LINE>List<String> cmdList = Arrays.asList(cmd);<NEW_LINE>String cmdLine = DoYUtil.join(" ", cmdList);<NEW_LINE>if (dryRun) {<NEW_LINE>System.out.print("Site archive command: ");<NEW_LINE>System.out.println(cmdLine);<NEW_LINE>return siteArchiveFile;<NEW_LINE>}<NEW_LINE>ProcessBuilder builder = new ProcessBuilder(cmdList);<NEW_LINE>builder.redirectErrorStream(true);<NEW_LINE>Process proc;<NEW_LINE>try {<NEW_LINE>proc = builder.start();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ClientException("Failed to launch tar process: " + cmdLine, e);<NEW_LINE>}<NEW_LINE>// Should not be much output. But, we have to read it anyway to avoid<NEW_LINE>// blocking. We'll use the output if we encounter an error.<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>try {<NEW_LINE>String line;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>buf.append(line);<NEW_LINE>buf.append("\n");<NEW_LINE>}<NEW_LINE>br.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ClientException("Failed to read output from tar command", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>proc.waitFor();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// Won't occur.<NEW_LINE>}<NEW_LINE>if (proc.exitValue() != 0) {<NEW_LINE>String msg = buf.toString().trim();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return siteArchiveFile;<NEW_LINE>} | throw new ClientException("Tar of site directory failed: " + msg); |
4,605 | private static void solve() {<NEW_LINE>Solver solver = new Solver("Map");<NEW_LINE>//<NEW_LINE>// data<NEW_LINE>//<NEW_LINE>int Belgium = 0;<NEW_LINE>int Denmark = 1;<NEW_LINE>int France = 2;<NEW_LINE>int Germany = 3;<NEW_LINE>int Netherlands = 4;<NEW_LINE>int Luxembourg = 5;<NEW_LINE>int n = 6;<NEW_LINE>int max_num_colors = 4;<NEW_LINE>//<NEW_LINE>// Variables<NEW_LINE>//<NEW_LINE>IntVar[] color = solver.makeIntVarArray(n, 1, max_num_colors, "x");<NEW_LINE>//<NEW_LINE>// Constraints<NEW_LINE>//<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[France], color[Belgium]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[France], color[Luxembourg]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[France], color[Germany]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Luxembourg], color[Germany]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Luxembourg], color[Belgium]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Belgium<MASK><NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Belgium], color[Germany]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Germany], color[Netherlands]));<NEW_LINE>solver.addConstraint(solver.makeNonEquality(color[Germany], color[Denmark]));<NEW_LINE>// Symmetry breaking<NEW_LINE>solver.addConstraint(solver.makeEquality(color[Belgium], 1));<NEW_LINE>//<NEW_LINE>// Search<NEW_LINE>//<NEW_LINE>DecisionBuilder db = solver.makePhase(color, solver.CHOOSE_FIRST_UNBOUND, solver.ASSIGN_MIN_VALUE);<NEW_LINE>solver.newSearch(db);<NEW_LINE>while (solver.nextSolution()) {<NEW_LINE>System.out.print("Colors: ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>System.out.print(color[i].value() + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>solver.endSearch();<NEW_LINE>// Statistics<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Solutions: " + solver.solutions());<NEW_LINE>System.out.println("Failures: " + solver.failures());<NEW_LINE>System.out.println("Branches: " + solver.branches());<NEW_LINE>System.out.println("Wall time: " + solver.wallTime() + "ms");<NEW_LINE>} | ], color[Netherlands])); |
1,487,243 | private static void blitBitmap(Graphics g, Icon icon, int x, int y, int w, int h) {<NEW_LINE>// Store the current clip to reset it after<NEW_LINE>Shape clip = g.getClip();<NEW_LINE>if (clip == null) {<NEW_LINE>// Limit it to the space we're requested to paint<NEW_LINE>g.setClip(x, y, w, h);<NEW_LINE>} else {<NEW_LINE>// If there is an existing clip, get the intersection with the<NEW_LINE>// rectangle we want to paint and set that<NEW_LINE>scratch.setBounds(x, y, w, h);<NEW_LINE><MASK><NEW_LINE>area.intersect(new Area(scratch));<NEW_LINE>g.setClip(area);<NEW_LINE>}<NEW_LINE>int iwidth = icon.getIconWidth();<NEW_LINE>int widthPainted = 0;<NEW_LINE>while (widthPainted < w) {<NEW_LINE>// Loop until we've covered the entire area<NEW_LINE>icon.paintIcon(null, g, x + widthPainted, y);<NEW_LINE>widthPainted += iwidth;<NEW_LINE>}<NEW_LINE>// restore the clip<NEW_LINE>g.setClip(clip);<NEW_LINE>} | Area area = new Area(clip); |
1,646,543 | public static void vertical11(Kernel1D_F32 kernel, GrayF32 input, GrayF32 output, int skip) {<NEW_LINE>final float[] dataSrc = input.data;<NEW_LINE>final float[] dataDst = output.data;<NEW_LINE>final float k1 = kernel.data[0];<NEW_LINE>final float <MASK><NEW_LINE>final float k3 = kernel.data[2];<NEW_LINE>final float k4 = kernel.data[3];<NEW_LINE>final float k5 = kernel.data[4];<NEW_LINE>final float k6 = kernel.data[5];<NEW_LINE>final float k7 = kernel.data[6];<NEW_LINE>final float k8 = kernel.data[7];<NEW_LINE>final float k9 = kernel.data[8];<NEW_LINE>final float k10 = kernel.data[9];<NEW_LINE>final float k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (y - radius) * input.stride;<NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>float total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k7;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k8;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k9;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k10;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k11;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | k2 = kernel.data[1]; |
1,456,840 | protected QuicSession createSession(SocketAddress remoteAddress, ByteBuffer cipherBuffer) throws IOException {<NEW_LINE>ByteBufferPool byteBufferPool = getByteBufferPool();<NEW_LINE>// TODO make the token validator configurable<NEW_LINE>QuicheConnection quicheConnection = QuicheConnection.tryAccept(connector.newQuicheConfig(), new SimpleTokenValidator((InetSocketAddress) remoteAddress), cipherBuffer, remoteAddress);<NEW_LINE>if (quicheConnection == null) {<NEW_LINE>ByteBuffer negotiationBuffer = byteBufferPool.acquire(getOutputBufferSize(), true);<NEW_LINE>int pos = BufferUtil.flipToFill(negotiationBuffer);<NEW_LINE>// TODO make the token minter configurable<NEW_LINE>if (!QuicheConnection.negotiate(new SimpleTokenMinter((InetSocketAddress) remoteAddress), cipherBuffer, negotiationBuffer)) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("QUIC connection negotiation failed, dropping packet");<NEW_LINE>byteBufferPool.release(negotiationBuffer);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>write(Callback.from(() -> byteBufferPool.release(negotiationBuffer)), remoteAddress, negotiationBuffer);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("QUIC connection negotiation packet sent");<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>QuicSession session = new ServerQuicSession(getExecutor(), getScheduler(), byteBufferPool, quicheConnection, this, remoteAddress, connector);<NEW_LINE>// Send the response packet(s) that tryAccept() generated.<NEW_LINE>session.flush();<NEW_LINE>return session;<NEW_LINE>}<NEW_LINE>} | BufferUtil.flipToFlush(negotiationBuffer, pos); |
1,199,569 | protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {<NEW_LINE>_Fields setField = _Fields.findByThriftId(field.id);<NEW_LINE>if (setField != null) {<NEW_LINE>switch(setField) {<NEW_LINE>case PREFIX_DECL:<NEW_LINE>if (field.type == PREFIX_DECL_FIELD_DESC.type) {<NEW_LINE>RDF_PrefixDecl prefixDecl;<NEW_LINE>prefixDecl = new RDF_PrefixDecl();<NEW_LINE>prefixDecl.read(iprot);<NEW_LINE>return prefixDecl;<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>case TRIPLE:<NEW_LINE>if (field.type == TRIPLE_FIELD_DESC.type) {<NEW_LINE>RDF_Triple triple;<NEW_LINE>triple = new RDF_Triple();<NEW_LINE>triple.read(iprot);<NEW_LINE>return triple;<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>case QUAD:<NEW_LINE>if (field.type == QUAD_FIELD_DESC.type) {<NEW_LINE>RDF_Quad quad;<NEW_LINE>quad = new RDF_Quad();<NEW_LINE>quad.read(iprot);<NEW_LINE>return quad;<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); |
506,811 | protected void run() {<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>ArrayList<Integer>[] spaceTmp = new ArrayList[layers.length];<NEW_LINE>space = spaceTmp;<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>ArrayList<LayoutNode>[] downProcessingOrderTmp <MASK><NEW_LINE>downProcessingOrder = downProcessingOrderTmp;<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>ArrayList<LayoutNode>[] upProcessingOrderTmp = new ArrayList[layers.length];<NEW_LINE>upProcessingOrder = upProcessingOrderTmp;<NEW_LINE>for (int i = 0; i < layers.length; i++) {<NEW_LINE>space[i] = new ArrayList<Integer>();<NEW_LINE>downProcessingOrder[i] = new ArrayList<LayoutNode>();<NEW_LINE>upProcessingOrder[i] = new ArrayList<LayoutNode>();<NEW_LINE>int curX = 0;<NEW_LINE>for (LayoutNode n : layers[i]) {<NEW_LINE>space[i].add(curX);<NEW_LINE>curX += n.width + xOffset;<NEW_LINE>downProcessingOrder[i].add(n);<NEW_LINE>upProcessingOrder[i].add(n);<NEW_LINE>}<NEW_LINE>Collections.sort(downProcessingOrder[i], nodeProcessingDownComparator);<NEW_LINE>Collections.sort(upProcessingOrder[i], nodeProcessingUpComparator);<NEW_LINE>}<NEW_LINE>initialPositions();<NEW_LINE>for (int i = 0; i < SWEEP_ITERATIONS; i++) {<NEW_LINE>sweepDown();<NEW_LINE>sweepUp();<NEW_LINE>}<NEW_LINE>sweepDown();<NEW_LINE>sweepUp();<NEW_LINE>} | = new ArrayList[layers.length]; |
3,454 | public static void logVersion(List<String> extraLines) {<NEW_LINE>String[] lines = { "For more information: " + URL, COPYRIGHT + " - " + LICENSE };<NEW_LINE>String version = getVersion();<NEW_LINE>int width = version.length();<NEW_LINE>for (String line : lines) {<NEW_LINE>width = Math.max(width, line.length());<NEW_LINE>}<NEW_LINE>for (String line : extraLines) {<NEW_LINE>width = Math.max(width, line.length());<NEW_LINE>}<NEW_LINE>String padding = padding('-', width);<NEW_LINE>LOG.info("");<NEW_LINE>LOG.info("/-{}-\\", padding);<NEW_LINE>logLine(version, width);<NEW_LINE><MASK><NEW_LINE>for (String line : lines) {<NEW_LINE>logLine(line, width);<NEW_LINE>}<NEW_LINE>if (!extraLines.isEmpty()) {<NEW_LINE>LOG.info("+-{}-+", padding);<NEW_LINE>for (String line : extraLines) {<NEW_LINE>logLine(line, width);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("\\-{}-/", padding);<NEW_LINE>LOG.info("");<NEW_LINE>} | LOG.info("+-{}-+", padding); |
1,769,809 | protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String fullUrl = removeAssetPrefix(request.getRequestURI());<NEW_LINE>// Static Assets don't typically go through the Spring Security pipeline but they may need access<NEW_LINE>// to the site<NEW_LINE>BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();<NEW_LINE>context.setNonPersistentSite(siteResolver.resolveSite(new ServletWebRequest(request, response)));<NEW_LINE>try {<NEW_LINE>Map<String, String> model = staticAssetStorageService.getCacheFileModel(fullUrl, convertParameterMap(request.getParameterMap()));<NEW_LINE>View assetView = appCtx.getBean(viewResolverName, View.class);<NEW_LINE>return new ModelAndView(assetView, model);<NEW_LINE>} catch (AssetNotFoundException e) {<NEW_LINE>response.setStatus(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>return null;<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE><MASK><NEW_LINE>LOG.error("Could not retrieve asset request " + fullUrl + " from the StaticAssetStorage. The underlying file path checked was " + e.getMessage());<NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Unable to retrieve static asset", e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>ThreadLocalManager.remove();<NEW_LINE>}<NEW_LINE>} | response.setStatus(HttpServletResponse.SC_NOT_FOUND); |
472,463 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uid_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, apiVersion_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceVersion_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 7, fieldPath_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeString(output, 2, namespace_); |
880,920 | void writeUserOrgChartDetailToCsv(final CSVPrinter csvPrinter, final UserIdentity userIdentity, final int depth) {<NEW_LINE>final <MASK><NEW_LINE>LOGGER.trace(pwmRequest, () -> "beginning csv export starting with user " + userIdentity.toDisplayString() + " and depth of " + depth);<NEW_LINE>final ThreadPoolExecutor executor = pwmRequest.getPwmDomain().getPeopleSearchService().getJobExecutor();<NEW_LINE>final AtomicInteger rowCounter = new AtomicInteger(0);<NEW_LINE>final OrgChartExportState orgChartExportState = new OrgChartExportState(executor, csvPrinter, rowCounter, Collections.singleton(OrgChartExportState.IncludeData.displayForm));<NEW_LINE>final OrgChartCsvRowOutputJob job = new OrgChartCsvRowOutputJob(orgChartExportState, userIdentity, depth, null);<NEW_LINE>executor.execute(job);<NEW_LINE>final TimeDuration maxDuration = peopleSearchConfiguration.getExportCsvMaxDuration();<NEW_LINE>maxDuration.pause(() -> executor.getQueue().size() + executor.getActiveCount() <= 0);<NEW_LINE>final TimeDuration timeDuration = TimeDuration.fromCurrent(startTime);<NEW_LINE>LOGGER.trace(pwmRequest, () -> "completed csv export of " + rowCounter.get() + " records in " + timeDuration.asCompactString());<NEW_LINE>} | Instant startTime = Instant.now(); |
233,745 | public ReserveContactResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ReserveContactResult reserveContactResult = new ReserveContactResult();<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 reserveContactResult;<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("contactId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>reserveContactResult.setContactId(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 reserveContactResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,189,701 | void handleMouseEvent(int eventType, int modifierFlags, int buttonNumber, int clickCount, int x, int y, int absX, int absY) {<NEW_LINE>final SunToolkit tk = (SunToolkit) Toolkit.getDefaultToolkit();<NEW_LINE>if ((buttonNumber > 2 && !tk.areExtraMouseButtonsEnabled()) || buttonNumber > tk.getNumberOfButtons() - 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int jeventType = isNpapiCallback ? NSEvent.npToJavaEventType(eventType) : NSEvent.nsToJavaEventType(eventType);<NEW_LINE><MASK><NEW_LINE>if (// ignore dragged event that does not change any location<NEW_LINE>dragged && lastDraggedAbsoluteX == absX && lastDraggedRelativeX == x && lastDraggedAbsoluteY == absY && lastDraggedRelativeY == y)<NEW_LINE>return;<NEW_LINE>if (dragged || jeventType == MouseEvent.MOUSE_PRESSED) {<NEW_LINE>lastDraggedAbsoluteX = absX;<NEW_LINE>lastDraggedAbsoluteY = absY;<NEW_LINE>lastDraggedRelativeX = x;<NEW_LINE>lastDraggedRelativeY = y;<NEW_LINE>}<NEW_LINE>int jbuttonNumber = MouseEvent.NOBUTTON;<NEW_LINE>int jclickCount = 0;<NEW_LINE>if (jeventType != MouseEvent.MOUSE_MOVED && jeventType != MouseEvent.MOUSE_ENTERED && jeventType != MouseEvent.MOUSE_EXITED) {<NEW_LINE>jbuttonNumber = NSEvent.nsToJavaButton(buttonNumber);<NEW_LINE>jclickCount = clickCount;<NEW_LINE>}<NEW_LINE>int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);<NEW_LINE>boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers);<NEW_LINE>eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, x, y, absX, absY, jmodifiers, jclickCount, jpopupTrigger, null);<NEW_LINE>} | boolean dragged = jeventType == MouseEvent.MOUSE_DRAGGED; |
1,384,883 | public okhttp3.Call readPodSecurityPolicyCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/policy/v1beta1/podsecuritypolicies/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams <MASK><NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final 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>} | = new ArrayList<Pair>(); |
1,760,515 | @SuppressWarnings("unchecked")<NEW_LINE>void build(SmallRyeHealthRecorder recorder, BuildProducer<FeatureBuildItem> feature, BuildProducer<AdditionalBeanBuildItem> additionalBean, BuildProducer<BeanDefiningAnnotationBuildItem> beanDefiningAnnotation) throws IOException, ClassNotFoundException {<NEW_LINE>feature.produce(new FeatureBuildItem(Feature.SMALLRYE_HEALTH));<NEW_LINE>// Discover the beans annotated with @Health, @Liveness, @Readiness, @Startup, @HealthGroup,<NEW_LINE>// @HealthGroups and @Wellness even if no scope is defined<NEW_LINE>beanDefiningAnnotation.<MASK><NEW_LINE>beanDefiningAnnotation.produce(new BeanDefiningAnnotationBuildItem(READINESS));<NEW_LINE>beanDefiningAnnotation.produce(new BeanDefiningAnnotationBuildItem(STARTUP));<NEW_LINE>beanDefiningAnnotation.produce(new BeanDefiningAnnotationBuildItem(HEALTH_GROUP));<NEW_LINE>beanDefiningAnnotation.produce(new BeanDefiningAnnotationBuildItem(HEALTH_GROUPS));<NEW_LINE>beanDefiningAnnotation.produce(new BeanDefiningAnnotationBuildItem(WELLNESS));<NEW_LINE>// Add additional beans<NEW_LINE>additionalBean.produce(new AdditionalBeanBuildItem(QuarkusAsyncHealthCheckFactory.class));<NEW_LINE>additionalBean.produce(new AdditionalBeanBuildItem(SmallRyeHealthReporter.class));<NEW_LINE>// Make ArC discover @HealthGroup as a qualifier<NEW_LINE>additionalBean.produce(new AdditionalBeanBuildItem(HealthGroup.class));<NEW_LINE>// Discover and register the HealthCheckResponseProvider<NEW_LINE>Set<String> providers = ServiceUtil.classNamesNamedIn(getClass().getClassLoader(), "META-INF/services/" + HealthCheckResponseProvider.class.getName());<NEW_LINE>if (providers.isEmpty()) {<NEW_LINE>throw new IllegalStateException("No HealthCheckResponseProvider implementation found.");<NEW_LINE>} else if (providers.size() > 1) {<NEW_LINE>throw new IllegalStateException(String.format("Multiple HealthCheckResponseProvider implementations found: %s", providers));<NEW_LINE>}<NEW_LINE>final String provider = providers.iterator().next();<NEW_LINE>final Class<? extends HealthCheckResponseProvider> responseProvider = (Class<? extends HealthCheckResponseProvider>) Class.forName(provider, true, Thread.currentThread().getContextClassLoader());<NEW_LINE>recorder.registerHealthCheckResponseProvider(responseProvider);<NEW_LINE>} | produce(new BeanDefiningAnnotationBuildItem(LIVENESS)); |
915,742 | private void writeGloballyTrustedKeys(DependencyVerificationConfiguration configuration) throws IOException {<NEW_LINE>final List<DependencyVerificationConfiguration.TrustedKey<MASK><NEW_LINE>if (keys.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writer.startElement(TRUSTED_KEYS);<NEW_LINE>Map<String, List<DependencyVerificationConfiguration.TrustedKey>> groupedByKeyId = keys.stream().collect(Collectors.groupingBy(DependencyVerificationConfiguration.TrustedKey::getKeyId, TreeMap::new, Collectors.toList()));<NEW_LINE>for (Map.Entry<String, List<DependencyVerificationConfiguration.TrustedKey>> e : groupedByKeyId.entrySet()) {<NEW_LINE>String key = e.getKey();<NEW_LINE>List<DependencyVerificationConfiguration.TrustedKey> trustedKeys = e.getValue();<NEW_LINE>if (trustedKeys.size() == 1) {<NEW_LINE>writeTrustedKey(trustedKeys.get(0));<NEW_LINE>} else {<NEW_LINE>writeGroupedTrustedKey(key, trustedKeys);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement();<NEW_LINE>} | > keys = configuration.getTrustedKeys(); |
14,412 | public static P<Object> parsePredicate(String predicate) {<NEW_LINE>Pattern pattern = Pattern.compile("^P\\.([a-z]+)\\(([\\S ]*)\\)$");<NEW_LINE>Matcher matcher = pattern.matcher(predicate);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>throw new HugeException("Invalid predicate: %s", predicate);<NEW_LINE>}<NEW_LINE>String method = matcher.group(1);<NEW_LINE>String value = matcher.group(2);<NEW_LINE>switch(method) {<NEW_LINE>case "eq":<NEW_LINE>return P<MASK><NEW_LINE>case "neq":<NEW_LINE>return P.neq(predicateNumber(value));<NEW_LINE>case "lt":<NEW_LINE>return P.lt(predicateNumber(value));<NEW_LINE>case "lte":<NEW_LINE>return P.lte(predicateNumber(value));<NEW_LINE>case "gt":<NEW_LINE>return P.gt(predicateNumber(value));<NEW_LINE>case "gte":<NEW_LINE>return P.gte(predicateNumber(value));<NEW_LINE>case "between":<NEW_LINE>Number[] params = predicateNumbers(value, 2);<NEW_LINE>return P.between(params[0], params[1]);<NEW_LINE>case "inside":<NEW_LINE>params = predicateNumbers(value, 2);<NEW_LINE>return P.inside(params[0], params[1]);<NEW_LINE>case "outside":<NEW_LINE>params = predicateNumbers(value, 2);<NEW_LINE>return P.outside(params[0], params[1]);<NEW_LINE>case "within":<NEW_LINE>return P.within(predicateArgs(value));<NEW_LINE>case "textcontains":<NEW_LINE>return ConditionP.textContains(predicateArg(value));<NEW_LINE>case "contains":<NEW_LINE>// Just for inner use case like auth filter<NEW_LINE>return ConditionP.contains(predicateArg(value));<NEW_LINE>default:<NEW_LINE>throw new NotSupportException("predicate '%s'", method);<NEW_LINE>}<NEW_LINE>} | .eq(predicateNumber(value)); |
172,073 | final UpdateContactAttributesResult executeUpdateContactAttributes(UpdateContactAttributesRequest updateContactAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateContactAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateContactAttributesRequest> request = null;<NEW_LINE>Response<UpdateContactAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateContactAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateContactAttributesRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateContactAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateContactAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateContactAttributesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,055,896 | public static DescribeBackupPolicyResponse unmarshall(DescribeBackupPolicyResponse describeBackupPolicyResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupPolicyResponse.setRequestId<MASK><NEW_LINE>describeBackupPolicyResponse.setMessage(_ctx.stringValue("DescribeBackupPolicyResponse.Message"));<NEW_LINE>describeBackupPolicyResponse.setSuccess(_ctx.booleanValue("DescribeBackupPolicyResponse.Success"));<NEW_LINE>List<Account> data = new ArrayList<Account>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupPolicyResponse.Data.Length"); i++) {<NEW_LINE>Account account = new Account();<NEW_LINE>account.setDBInstanceName(_ctx.stringValue("DescribeBackupPolicyResponse.Data[" + i + "].DBInstanceName"));<NEW_LINE>account.setBackupType(_ctx.stringValue("DescribeBackupPolicyResponse.Data[" + i + "].BackupType"));<NEW_LINE>account.setBackupPeriod(_ctx.stringValue("DescribeBackupPolicyResponse.Data[" + i + "].BackupPeriod"));<NEW_LINE>account.setBackupPlanBegin(_ctx.stringValue("DescribeBackupPolicyResponse.Data[" + i + "].BackupPlanBegin"));<NEW_LINE>account.setBackupSetRetention(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].BackupSetRetention"));<NEW_LINE>account.setIsEnabled(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].IsEnabled"));<NEW_LINE>account.setBackupWay(_ctx.stringValue("DescribeBackupPolicyResponse.Data[" + i + "].BackupWay"));<NEW_LINE>account.setRemoveLogRetention(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].RemoveLogRetention"));<NEW_LINE>account.setLocalLogRetention(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].LocalLogRetention"));<NEW_LINE>account.setLogLocalRetentionSpace(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].LogLocalRetentionSpace"));<NEW_LINE>account.setForceCleanOnHighSpaceUsage(_ctx.integerValue("DescribeBackupPolicyResponse.Data[" + i + "].ForceCleanOnHighSpaceUsage"));<NEW_LINE>data.add(account);<NEW_LINE>}<NEW_LINE>describeBackupPolicyResponse.setData(data);<NEW_LINE>return describeBackupPolicyResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeBackupPolicyResponse.RequestId")); |
329,632 | private DetectionReport buildDetectionReport(TargetInfo targetInfo, NetworkService vulnerableNetworkService) {<NEW_LINE>TextData details = TextData.newBuilder().setText(String.format("The Kubernetes API endpoint at %s is exposed.", NetworkServiceUtils.buildWebApplicationRootUrl(vulnerableNetworkService) <MASK><NEW_LINE>return DetectionReport.newBuilder().setTargetInfo(targetInfo).setNetworkService(vulnerableNetworkService).setDetectionTimestamp(Timestamps.fromMillis(Instant.now(utcClock).toEpochMilli())).setDetectionStatus(DetectionStatus.VULNERABILITY_VERIFIED).setVulnerability(Vulnerability.newBuilder().setMainId(VulnerabilityId.newBuilder().setPublisher("GOOGLE").setValue("KUBERNETES_API_EXPOSED")).setSeverity(Severity.CRITICAL).setTitle("Kubernetes API Exposed").setDescription("Kubernetes API endpoint is exposed.").addAdditionalDetails(AdditionalDetail.newBuilder().setTextData(details))).build();<NEW_LINE>} | + "api/v1/pods")).build(); |
949,146 | void genInvokeStatic(JavaMethod target) {<NEW_LINE>if (callTargetIsResolved(target)) {<NEW_LINE>ResolvedJavaMethod resolvedTarget = (ResolvedJavaMethod) target;<NEW_LINE>ResolvedJavaType holder = resolvedTarget.getDeclaringClass();<NEW_LINE>if (!holder.isInitialized() && ResolveClassBeforeStaticInvoke.getValue(options)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ValueNode classInit = null;<NEW_LINE>ClassInitializationPlugin classInitializationPlugin = graphBuilderConfig.getPlugins().getClassInitializationPlugin();<NEW_LINE>if (classInitializationPlugin != null && classInitializationPlugin.shouldApply(this, resolvedTarget.getDeclaringClass())) {<NEW_LINE>FrameState stateBefore = frameState.create(bci(), getNonIntrinsicAncestor(), false, null, null);<NEW_LINE>classInit = classInitializationPlugin.apply(this, resolvedTarget.getDeclaringClass(), stateBefore);<NEW_LINE>}<NEW_LINE>ValueNode[] args = frameState.popArguments(resolvedTarget.getSignature().getParameterCount(false));<NEW_LINE>Invoke invoke = appendInvoke(InvokeKind.Static, resolvedTarget, args);<NEW_LINE>if (invoke != null) {<NEW_LINE>invoke.setClassInit(classInit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleUnresolvedInvoke(target, InvokeKind.Static);<NEW_LINE>}<NEW_LINE>} | handleUnresolvedInvoke(target, InvokeKind.Static); |
1,035,218 | public void updateUI() {<NEW_LINE>Clipboard clipboard = new Clipboard(Display.getDefault());<NEW_LINE>String sClipText = (String) clipboard.<MASK><NEW_LINE>if (sClipText != null) {<NEW_LINE>if (lastCopiedFromClip != null && sClipText.equals(lastCopiedFromClip)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean bTorrentInClipboard = addTorrentsFromTextList(sClipText, true) > 0;<NEW_LINE>if (btnPasteOrClear != null && !btnPasteOrClear.isDisposed()) {<NEW_LINE>btnPasteOrClear.setVisible(bTorrentInClipboard);<NEW_LINE>if (!btnPasteOrClearIsPaste) {<NEW_LINE>Messages.setLanguageText(btnPasteOrClear, "OpenTorrentWindow.addFiles.Clipboard");<NEW_LINE>Utils.makeButtonsEqualWidth(Arrays.asList(btnBrowseTorrent, btnBrowseFolder, btnPasteOrClear));<NEW_LINE>btnPasteOrClear.getParent().layout(true);<NEW_LINE>btnPasteOrClearIsPaste = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bTorrentInClipboard) {<NEW_LINE>Utils.setTT(btnPasteOrClear, sClipText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clipboard.dispose();<NEW_LINE>} | getContents(TextTransfer.getInstance()); |
1,283,404 | public void verifySignature(PublicKey serverPublicKey, Random clientRandom, Random serverRandom) throws HandshakeException {<NEW_LINE>if (signatureEncoded == null) {<NEW_LINE>String message = "The server's ECDHE key exchange message has no signature.";<NEW_LINE>AlertMessage alert = new AlertMessage(<MASK><NEW_LINE>throw new HandshakeException(message, alert);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ThreadLocalSignature localSignature = signatureAndHashAlgorithm.getThreadLocalSignature();<NEW_LINE>Signature signature = localSignature.currentWithCause();<NEW_LINE>signature.initVerify(serverPublicKey);<NEW_LINE>updateSignature(signature, clientRandom, serverRandom);<NEW_LINE>if (signature.verify(signatureEncoded)) {<NEW_LINE>if (JceProviderUtil.isEcdsaVulnerable() && signatureAndHashAlgorithm.getSignature() == SignatureAlgorithm.ECDSA) {<NEW_LINE>Asn1DerDecoder.checkEcDsaSignature(signatureEncoded, serverPublicKey);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>LOGGER.error("Could not verify the server's signature.", e);<NEW_LINE>}<NEW_LINE>String message = "The server's ECDHE key exchange message's signature could not be verified.";<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.DECRYPT_ERROR);<NEW_LINE>throw new HandshakeException(message, alert);<NEW_LINE>} | AlertLevel.FATAL, AlertDescription.DECRYPT_ERROR); |
1,794,944 | private List<PluginHandleVO> buildPluginHandleVO(final List<PluginHandleDO> pluginHandleDOList) {<NEW_LINE>List<String> fieldList = pluginHandleDOList.stream().filter(pluginHandleDO -> pluginHandleDO.getDataType() == SELECT_BOX_DATA_TYPE).map(PluginHandleDO::getField).distinct().collect(Collectors.toList());<NEW_LINE>Map<String, List<ShenyuDictVO>> shenyuDictMap = CollectionUtils.isNotEmpty(fieldList) ? Optional.ofNullable(shenyuDictMapper.findByTypeBatch(fieldList)).orElseGet(ArrayList::new).stream().map(ShenyuDictVO::buildShenyuDictVO).collect(Collectors.groupingBy(ShenyuDictVO::getType)) : new HashMap<>(0);<NEW_LINE>return pluginHandleDOList.stream().map(pluginHandleDO -> {<NEW_LINE>List<ShenyuDictVO> dictOptions = shenyuDictMap.get(pluginHandleDO.getField());<NEW_LINE>return <MASK><NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} | PluginHandleVO.buildPluginHandleVO(pluginHandleDO, dictOptions); |
224,050 | private void applyDexHeader(Program program, OatDexFile oatDexFileHeader, Symbol oatDataSymbol, int index) throws Exception {<NEW_LINE>Address address = oatDataSymbol.getAddress().add(oatDexFileHeader.getDexFileOffset());<NEW_LINE>DexHeader dexHeader = oatDexFileHeader.getDexHeader();<NEW_LINE>if (dexHeader == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (oatDexFileHeader.isDexHeaderExternal()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataType dexHeaderDataType = dexHeader.toDataType();<NEW_LINE>try {<NEW_LINE>dexHeaderDataType.setName(dexHeaderDataType.getName() + "_" + index);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>createData(program, address, dexHeaderDataType);<NEW_LINE>address = address.add(dexHeaderDataType.getLength());<NEW_LINE>int dexRemainder = dexHeader.getFileSize() - dexHeaderDataType.getLength();<NEW_LINE>if (dexRemainder > 0) {<NEW_LINE>DataType paddingDataType = new ArrayDataType(StructConverter.BYTE, dexRemainder, StructConverter.BYTE.getLength());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | createData(program, address, paddingDataType); |
953,218 | private String extractText(@NonNull final JavaVMOption<?> option, final int column) {<NEW_LINE>final OptionValue<?> ov = option.getValue();<NEW_LINE>if (option instanceof UserPropertyNode) {<NEW_LINE>Map.Entry<String, String> entry = (ov != null ? ((OptionValue.StringPair) ov).getValue() : null);<NEW_LINE>if (entry == null) {<NEW_LINE>return column == 0 ? DEFAULT_USER_PROPERTY_TEXT : EMPTY_TEXT;<NEW_LINE>}<NEW_LINE>switch(column) {<NEW_LINE>case 0:<NEW_LINE>{<NEW_LINE>final String s = entry.getKey();<NEW_LINE>return (s != null ? s : DEFAULT_USER_PROPERTY_TEXT);<NEW_LINE>}<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>final String s = entry.getValue();<NEW_LINE>return s != null ? s : EMPTY_TEXT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(column) {<NEW_LINE>case 0:<NEW_LINE>{<NEW_LINE>final <MASK><NEW_LINE>// NOI18N<NEW_LINE>final String key = "ValueCellEditor." + rawName + ".text." + option.getClass().getSimpleName();<NEW_LINE>if (BUNDLE.containsKey(key)) {<NEW_LINE>return BUNDLE.getString(key);<NEW_LINE>}<NEW_LINE>return rawName;<NEW_LINE>}<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>final Object o = ov.getValue();<NEW_LINE>return o != null ? o.toString() : EMPTY_TEXT;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>return EMPTY_TEXT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return EMPTY_TEXT;<NEW_LINE>} | String rawName = option.getName(); |
1,589,687 | private void addFunction(QueryColumn qc, QueryModel validatingModel, QueryModel translatingModel, QueryModel innerModel, QueryModel analyticModel, QueryModel groupByModel, QueryModel outerModel, QueryModel distinctModel) throws SqlException {<NEW_LINE>// there were no aggregation functions emitted therefore<NEW_LINE>// this is just a function that goes into virtual model<NEW_LINE>innerModel.addBottomUpColumn(qc);<NEW_LINE>// we also create column that references this inner layer from outer layer,<NEW_LINE>// for example when we have:<NEW_LINE>// select a, b+c ...<NEW_LINE>// it should translate to:<NEW_LINE>// select a, x from (select a, b+c x from (select a,b,c ...))<NEW_LINE>final QueryColumn innerColumn = <MASK><NEW_LINE>// pull literals only into translating model<NEW_LINE>emitLiterals(qc.getAst(), translatingModel, null, validatingModel, false);<NEW_LINE>groupByModel.addBottomUpColumn(innerColumn);<NEW_LINE>analyticModel.addBottomUpColumn(innerColumn);<NEW_LINE>outerModel.addBottomUpColumn(innerColumn);<NEW_LINE>distinctModel.addBottomUpColumn(innerColumn);<NEW_LINE>} | nextColumn(qc.getAlias()); |
1,068,193 | private void createObjectsTable(Composite parent) {<NEW_LINE>Composite placeholder = UIUtils.createComposite(parent, 1);<NEW_LINE>placeholder.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Group tableGroup = UIUtils.createControlGroup(placeholder, UINavigatorMessages.confirm_deleting_multiple_objects_table_group_name, 1, GridData.FILL_BOTH, 0);<NEW_LINE>tableGroup.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Table objectsTable = new Table(tableGroup, SWT.BORDER | SWT.FULL_SELECTION);<NEW_LINE>objectsTable.setHeaderVisible(false);<NEW_LINE>objectsTable.setLinesVisible(true);<NEW_LINE>GridData gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>int fontHeight = UIUtils.getFontHeight(objectsTable);<NEW_LINE>int rowCount = selectedObjects.size();<NEW_LINE>gd.widthHint = fontHeight * 7;<NEW_LINE>gd.heightHint = rowCount < 6 ? fontHeight * 2 * rowCount : fontHeight * 10;<NEW_LINE>objectsTable.setLayoutData(gd);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_name);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, "Type");<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_description);<NEW_LINE>for (Object obj : selectedObjects) {<NEW_LINE>if (!(obj instanceof DBNNode)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DBNNode node = (DBNNode) obj;<NEW_LINE>TableItem item = new <MASK><NEW_LINE>item.setImage(DBeaverIcons.getImage(node.getNodeIcon()));<NEW_LINE>if (node instanceof DBNResource && ((DBNResource) node).getResource() != null) {<NEW_LINE>item.setText(0, node.getName());<NEW_LINE>IResource resource = ((DBNResource) node).getResource();<NEW_LINE>IPath resLocation = resource == null ? null : resource.getLocation();<NEW_LINE>item.setText(1, "File");<NEW_LINE>item.setText(2, resLocation == null ? "" : resLocation.toFile().getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>item.setText(0, node.getNodeFullName());<NEW_LINE>item.setText(1, node.getNodeType());<NEW_LINE>item.setText(2, CommonUtils.toString(node.getNodeDescription()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UIUtils.asyncExec(() -> UIUtils.packColumns(objectsTable, true));<NEW_LINE>} | TableItem(objectsTable, SWT.NONE); |
1,636,072 | public void createEntries() {<NEW_LINE>calendar.setStyle(Calendar.Style.getStyle(style++));<NEW_LINE>calendar.clear();<NEW_LINE>LocalTime dailyStartTime = LocalTime.of(8, 0);<NEW_LINE>LocalTime dailyEndTime = LocalTime.of(20, 0);<NEW_LINE>LocalDate entryDate = LocalDate.now();<NEW_LINE>LocalTime entryTime = dailyStartTime;<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int count = comboBox.getValue();<NEW_LINE>calendar.startBatchUpdates();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>Entry<String> entry = new Entry<>("Entry " + i);<NEW_LINE>entry.setInterval(new Interval(entryDate, entryTime, entryDate, entryTime.plusMinutes(30)));<NEW_LINE>entryTime = entryTime.plusHours(1);<NEW_LINE>if (entryTime.isAfter(dailyEndTime)) {<NEW_LINE><MASK><NEW_LINE>entryTime = dailyStartTime;<NEW_LINE>}<NEW_LINE>entry.setCalendar(calendar);<NEW_LINE>}<NEW_LINE>calendar.stopBatchUpdates();<NEW_LINE>label.setText("Time: " + (System.currentTimeMillis() - startTime));<NEW_LINE>} | entryDate = entryDate.plusDays(1); |
1,435,361 | private String generatePageTab() {<NEW_LINE>Collections.sort(playerData);<NEW_LINE>StringBuilder tabBuilder = new StringBuilder();<NEW_LINE>for (ExtensionData datum : playerData) {<NEW_LINE>ExtensionInformation extensionInformation = datum.getExtensionInformation();<NEW_LINE>boolean onlyGeneric = datum.hasOnlyGenericTab();<NEW_LINE>String tabsElement;<NEW_LINE>if (onlyGeneric) {<NEW_LINE>ExtensionTabData genericTabData = datum.<MASK><NEW_LINE>tabsElement = buildContentHtml(genericTabData);<NEW_LINE>} else {<NEW_LINE>tabsElement = new TabsElement(datum.getPluginID(), datum.getTabs().stream().map(this::wrapToTabElementTab).toArray(TabsElement.Tab[]::new)).toHtmlFull();<NEW_LINE>}<NEW_LINE>tabBuilder.append(wrapInContainer(extensionInformation, tabsElement));<NEW_LINE>}<NEW_LINE>return wrapInCardColumnsTab(serverName, tabBuilder.toString());<NEW_LINE>} | getTabs().get(0); |
70,947 | private void convertIdentifier(Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns, SqlNode indexNode, SqlNode partitions) {<NEW_LINE>final SqlValidatorNamespace fromNamespace = validator.getNamespace(id).resolve();<NEW_LINE>if (fromNamespace.getNode() != null) {<NEW_LINE>convertFrom(bb, fromNamespace.getNode());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String datasetName = datasetStack.isEmpty() ? null : datasetStack.peek();<NEW_LINE>final boolean[] usedDataset = { false };<NEW_LINE>RelOptTable table = SqlValidatorUtil.getRelOptTable(fromNamespace, catalogReader, datasetName, usedDataset);<NEW_LINE>if (extendedColumns != null && extendedColumns.size() > 0) {<NEW_LINE>assert table != null;<NEW_LINE>final SqlValidatorTable validatorTable = table.unwrap(SqlValidatorTable.class);<NEW_LINE>final List<RelDataTypeField> extendedFields = SqlValidatorUtil.getExtendedColumns(validator.getTypeFactory(), validatorTable, extendedColumns);<NEW_LINE>table = table.extend(extendedFields);<NEW_LINE>}<NEW_LINE>final RelNode tableRel;<NEW_LINE>boolean isViewTable = false;<NEW_LINE>if (table instanceof RelOptTableImpl && ((RelOptTableImpl) table).getImplTable() instanceof ViewTable) {<NEW_LINE>isViewTable = true;<NEW_LINE>}<NEW_LINE>if (config.isConvertTableAccess() || isViewTable) {<NEW_LINE>tableRel = toRel(table);<NEW_LINE>} else {<NEW_LINE>SqlNodeList hint = this.hintBlackboard.currentHints(Util.last(table.getQualifiedName()));<NEW_LINE>tableRel = LogicalTableScan.create(cluster, table, hint, indexNode, partitions);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (usedDataset[0]) {<NEW_LINE>bb.setDataset(datasetName);<NEW_LINE>}<NEW_LINE>} | bb.setRoot(tableRel, true); |
13,466 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.grpc.service.DeviceManagementGrpc.DeviceManagementImplBase#<NEW_LINE>* createCustomerType(com.sitewhere.grpc.service.GCreateCustomerTypeRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void createCustomerType(GCreateCustomerTypeRequest request, StreamObserver<GCreateCustomerTypeResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getCreateCustomerTypeMethod());<NEW_LINE>ICustomerTypeCreateRequest apiRequest = DeviceModelConverter.asApiCustomerTypeCreateRequest(request.getRequest());<NEW_LINE>ICustomerType apiResult = getDeviceManagement().createCustomerType(apiRequest);<NEW_LINE>GCreateCustomerTypeResponse.Builder response = GCreateCustomerTypeResponse.newBuilder();<NEW_LINE>response.setCustomerType(DeviceModelConverter.asGrpcCustomerType(apiResult));<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getCreateCustomerTypeMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.<MASK><NEW_LINE>}<NEW_LINE>} | handleServerMethodExit(DeviceManagementGrpc.getCreateCustomerTypeMethod()); |
1,106,073 | // rb_econv_prepare_options<NEW_LINE>public static int econvPrepareOptions(ThreadContext context, IRubyObject opthash, IRubyObject[] opts, int ecflags) {<NEW_LINE>IRubyObject newhash = context.nil;<NEW_LINE>IRubyObject v;<NEW_LINE>if (opthash.isNil()) {<NEW_LINE>opts[0] = context.nil;<NEW_LINE>return ecflags;<NEW_LINE>}<NEW_LINE>RubyHash optHash2 = (RubyHash) opthash;<NEW_LINE>ecflags = <MASK><NEW_LINE>v = optHash2.op_aref(context, context.runtime.newSymbol("replace"));<NEW_LINE>if (!v.isNil()) {<NEW_LINE>RubyString v_str = v.convertToString();<NEW_LINE>if (v_str.scanForCodeRange() == StringSupport.CR_BROKEN) {<NEW_LINE>throw context.runtime.newArgumentError("replacement string is broken: " + v_str);<NEW_LINE>}<NEW_LINE>v = v_str.freeze(context);<NEW_LINE>newhash = RubyHash.newHash(context.runtime);<NEW_LINE>((RubyHash) newhash).op_aset(context, context.runtime.newSymbol("replace"), v);<NEW_LINE>}<NEW_LINE>v = optHash2.op_aref(context, context.runtime.newSymbol("fallback"));<NEW_LINE>if (!v.isNil()) {<NEW_LINE>IRubyObject h = TypeConverter.checkHashType(context.runtime, v);<NEW_LINE>boolean condition;<NEW_LINE>if (h.isNil()) {<NEW_LINE>condition = (v instanceof RubyProc || v instanceof RubyMethod || v.respondsTo("[]"));<NEW_LINE>} else {<NEW_LINE>v = h;<NEW_LINE>condition = true;<NEW_LINE>}<NEW_LINE>if (condition) {<NEW_LINE>if (newhash.isNil()) {<NEW_LINE>newhash = RubyHash.newHash(context.runtime);<NEW_LINE>}<NEW_LINE>((RubyHash) newhash).op_aset(context, context.runtime.newSymbol("fallback"), v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!newhash.isNil()) {<NEW_LINE>newhash.setFrozen(true);<NEW_LINE>}<NEW_LINE>opts[0] = newhash;<NEW_LINE>return ecflags;<NEW_LINE>} | econvOpts(context, opthash, ecflags); |
738,304 | public static IRubyObject filter_map(ThreadContext context, IRubyObject self, Block block) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>if (block.isGiven()) {<NEW_LINE>RubyArray result = runtime.newArray();<NEW_LINE>eachSite(context).call(context, self, self, CallBlock19.newCallClosure(self, runtime.getEnumerable(), block.getSignature(), new BlockCallback() {<NEW_LINE><NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {<NEW_LINE>final IRubyObject larg;<NEW_LINE>boolean ary = false;<NEW_LINE>switch(largs.length) {<NEW_LINE>case 0:<NEW_LINE>larg = ctx.nil;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>larg = largs[0];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>larg = RubyArray.<MASK><NEW_LINE>ary = true;<NEW_LINE>}<NEW_LINE>IRubyObject val = ary ? block.yieldArray(ctx, larg, null) : block.yield(ctx, larg);<NEW_LINE>if (val.isTrue()) {<NEW_LINE>synchronized (result) {<NEW_LINE>result.append(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject larg, Block blk) {<NEW_LINE>IRubyObject val = block.yield(ctx, larg);<NEW_LINE>if (val.isTrue()) {<NEW_LINE>synchronized (result) {<NEW_LINE>result.append(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE>}, context));<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return enumeratorizeWithSize(context, self, "filter_map", (SizeFn) RubyEnumerable::size);<NEW_LINE>}<NEW_LINE>} | newArrayMayCopy(ctx.runtime, largs); |
1,671,850 | public long next(long instant, int standardOffset, int saveMillis, GregorianCalendar calendar) {<NEW_LINE>int offset;<NEW_LINE>if (iMode == 'w') {<NEW_LINE>offset = standardOffset + saveMillis;<NEW_LINE>} else if (iMode == 's') {<NEW_LINE>offset = standardOffset;<NEW_LINE>} else {<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>// Convert from UTC to local time.<NEW_LINE>instant += offset;<NEW_LINE>calendar.setTimeInMillis(instant);<NEW_LINE>calendar.set(Calendar.MONTH, iMonthOfYear - 1);<NEW_LINE>calendar.set(Calendar.DATE, 1);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>calendar.set(Calendar.MINUTE, 0);<NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>calendar.add(Calendar.MILLISECOND, iMillisOfDay);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>if (iDayOfWeek == 0) {<NEW_LINE>if (calendar.getTimeInMillis() <= instant) {<NEW_LINE>calendar.add(Calendar.YEAR, 1);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setDayOfWeek(calendar);<NEW_LINE>if (calendar.getTimeInMillis() <= instant) {<NEW_LINE>calendar.<MASK><NEW_LINE>calendar.set(Calendar.MONTH, iMonthOfYear - 1);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>setDayOfWeek(calendar);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Convert from local time to UTC.<NEW_LINE>return calendar.getTimeInMillis() - offset;<NEW_LINE>} | add(Calendar.YEAR, 1); |
1,117,264 | public int compare(ProgramLocation loc1, ProgramLocation loc2) {<NEW_LINE>int result;<NEW_LINE>// Try to make a sensible comparison of programs before just using identity hashes<NEW_LINE><MASK><NEW_LINE>Program program2 = loc2.getProgram();<NEW_LINE>result = program1.getName().compareTo(program2.getName());<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>result = Integer.compare(program1.hashCode(), program2.hashCode());<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>result = loc1.getAddress().compareTo(loc2.getAddress());<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Class<?> class1 = loc1.getClass();<NEW_LINE>Class<?> class2 = loc2.getClass();<NEW_LINE>if (class1 == class2) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Integer ordinal1 = priorityMap.get(class1);<NEW_LINE>Integer ordinal2 = priorityMap.get(class2);<NEW_LINE>if (ordinal1 == null && ordinal2 == null) {<NEW_LINE>return class1.getName().compareTo(class2.getName());<NEW_LINE>}<NEW_LINE>if (ordinal1 == null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (ordinal2 == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>result = Integer.compare(ordinal1.intValue(), ordinal2.intValue());<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | Program program1 = loc1.getProgram(); |
1,562,611 | public void processRequiredCreateParams(Map<String, String> params, ApiErrors errors) {<NEW_LINE>// Do we have a checksum? If not, complain.<NEW_LINE>if (StringUtils.isEmpty(params.get(ApiParams.CHECKSUM))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Do we have a meeting id? If not, complain.<NEW_LINE>if (!StringUtils.isEmpty(params.get(ApiParams.MEETING_ID))) {<NEW_LINE>String meetingId = StringUtils.strip(params.get(ApiParams.MEETING_ID));<NEW_LINE>if (StringUtils.isEmpty(meetingId)) {<NEW_LINE>errors.missingParamError(ApiParams.MEETING_ID);<NEW_LINE>} else {<NEW_LINE>if (!ParamsUtil.isValidMeetingId(meetingId)) {<NEW_LINE>errors.addError(new String[] { "invalidFormat", "Meeting id contains invalid characters." });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>errors.missingParamError(ApiParams.MEETING_ID);<NEW_LINE>}<NEW_LINE>} | errors.missingParamError(ApiParams.CHECKSUM); |
1,224,853 | public UploadResult call() throws Exception {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (isMultipartUpload()) {<NEW_LINE>publishProgress(listener, ProgressEventType.TRANSFER_STARTED_EVENT);<NEW_LINE>return uploadInParts();<NEW_LINE>} else {<NEW_LINE>return uploadInOneChunk();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// Make sure that the parts futures is always initialized as part of the call().<NEW_LINE>// Note: If an exception is thrown, we still use a successful future with an empty list,<NEW_LINE>// because the parts future communicates the status of the *parts*, not the overall upload.<NEW_LINE>partsFuture.setDelegateIfUnset(new CompletedFuture<List<PartETag>>(Collections.<PartETag>emptyList()));<NEW_LINE>// Fail-safe: Make sure that the multipart upload ID future is always initialized as part of the call().<NEW_LINE>multipartUploadId.complete(null);<NEW_LINE>}<NEW_LINE>} | upload.setState(TransferState.InProgress); |
363,731 | static private String buildQuery(List<DataSource> dataSources, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp) {<NEW_LINE>String mostRecentQuery = "";<NEW_LINE>if (!showAll && cntDaysFromRecent > 0) {<NEW_LINE>// MOST_RECENT_TIME<NEW_LINE>// SELECT MAX(value_int64) - (%d * 86400)<NEW_LINE>// FROM blackboard_attributes<NEW_LINE>// WHERE attribute_type_id IN(%s)<NEW_LINE>// AND artifact_id<NEW_LINE>// IN ( %s )<NEW_LINE>//<NEW_LINE>// NON-NLS<NEW_LINE>mostRecentQuery = // NON-NLS<NEW_LINE>String.// NON-NLS<NEW_LINE>format("AND value_int64 > (%s)", String.format(MOST_RECENT_TIME, cntDaysFromRecent, TIME_TYPE_IDS, getWaypointListQuery(dataSources)));<NEW_LINE>}<NEW_LINE>// GEO_ARTIFACT_QUERY<NEW_LINE>// SELECT artifact_id, artifact_type_id<NEW_LINE>// FROM blackboard_attributes<NEW_LINE>// WHERE attribute_type_id IN (%s)<NEW_LINE>String query = String.format(GEO_ARTIFACT_QUERY, TIME_TYPE_IDS);<NEW_LINE>// That are in the list of artifacts for the given data Sources<NEW_LINE>// NON-NLS<NEW_LINE>query += String.format("AND artifact_id IN(%s)", getWaypointListQuery(dataSources));<NEW_LINE>query += mostRecentQuery;<NEW_LINE>if (showAll || noTimeStamp) {<NEW_LINE>// NON-NLS<NEW_LINE>query = String.format("%s UNION %s"<MASK><NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>} | , buildQueryForWaypointsWOTimeStamps(dataSources), query); |
263,699 | private GTable createAlignmentTable(List<Long> startingAddresses, int numFuncs) {<NEW_LINE>List<ModulusInfo> data = LazyList.lazyList(new ArrayList<>(), () -> new ModulusInfo());<NEW_LINE>if (startingAddresses != null) {<NEW_LINE>for (int i = 0; i < modulus; i++) {<NEW_LINE>data.get(0).modulus = Long.toString(i);<NEW_LINE>}<NEW_LINE>long[] countsAsLongs = new long[modulus];<NEW_LINE>for (Long currentAddress : startingAddresses) {<NEW_LINE>countsAsLongs[(int) (Long.remainderUnsigned(currentAddress, modulus))] = countsAsLongs[(int) (Long.remainderUnsigned(currentAddress, modulus))] + 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < modulus; i++) {<NEW_LINE>double percent = (100.0 * countsAsLongs[i]) / numFuncs;<NEW_LINE>data.get(i).counts = Long.toString(countsAsLongs[i]);<NEW_LINE>data.get(i).percent = Double.toString<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>AlignmentTableModel model = new AlignmentTableModel(data);<NEW_LINE>GTable table = new GTable(model);<NEW_LINE>return table;<NEW_LINE>} | (Math.round(percent)); |
541,586 | private static Object resolve(final String key, final ResourceBundle resource, final Map<String, String> map) {<NEW_LINE>Object result = resource.getObject(key);<NEW_LINE>if (result instanceof String) {<NEW_LINE>final String value = (String) result;<NEW_LINE>final Matcher matcher = VARIABLE.matcher(value);<NEW_LINE>int startIndex = 0;<NEW_LINE>final StringBuilder buffer = new StringBuilder(64);<NEW_LINE>while (matcher.find(startIndex)) {<NEW_LINE>buffer.append(value, <MASK><NEW_LINE>try {<NEW_LINE>buffer.append(ResolveVariableResourceBundle.resolve(matcher.group(1), resource, map));<NEW_LINE>} catch (MissingResourceException e) {<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("The key '{}' is missing", key);<NEW_LINE>}<NEW_LINE>buffer.append(value, matcher.start(), matcher.end());<NEW_LINE>}<NEW_LINE>startIndex = matcher.end();<NEW_LINE>}<NEW_LINE>if (buffer.length() > 0) {<NEW_LINE>buffer.append(value.substring(startIndex));<NEW_LINE>result = buffer.toString();<NEW_LINE>map.put(key, (String) result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | startIndex, matcher.start()); |
980,605 | public Void exec() throws NotFoundException {<NEW_LINE>if (StringUtils.isNotEmpty(this.hostResource)) {<NEW_LINE>// User set host resource and not directly a stream<NEW_LINE>if (this.tarInputStream != null) {<NEW_LINE>throw new DockerClientException("Only one of host resource or tar input stream should be defined to perform the copy, not both");<NEW_LINE>}<NEW_LINE>// create TAR package for the given path so docker can consume it<NEW_LINE>Path toUpload = null;<NEW_LINE>try {<NEW_LINE>toUpload = Files.createTempFile("docker-java", ".tar.gz");<NEW_LINE>CompressArchiveUtil.tar(Paths.get(hostResource), toUpload, true, dirChildrenOnly);<NEW_LINE>} catch (IOException createFileIOException) {<NEW_LINE>if (toUpload != null) {<NEW_LINE>// remove tmp docker-javaxxx.tar.gz<NEW_LINE>toUpload.toFile().delete();<NEW_LINE>}<NEW_LINE>throw new DockerClientException(<MASK><NEW_LINE>}<NEW_LINE>// send the tar stream, call exec so that the stream is consumed and then closed by try-with-resources<NEW_LINE>try (InputStream uploadStream = Files.newInputStream(toUpload)) {<NEW_LINE>this.tarInputStream = uploadStream;<NEW_LINE>return super.exec();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DockerClientException("Unable to read temp file " + toUpload.toFile().getAbsolutePath(), e);<NEW_LINE>} finally {<NEW_LINE>this.tarInputStream = null;<NEW_LINE>// remove tmp docker-javaxxx.tar.gz<NEW_LINE>toUpload.toFile().delete();<NEW_LINE>}<NEW_LINE>} else if (this.tarInputStream == null) {<NEW_LINE>throw new DockerClientException("One of host resource or tar input stream must be defined to perform the copy");<NEW_LINE>}<NEW_LINE>// User set a stream, so we will just consume it and let the user close it by him self<NEW_LINE>return super.exec();<NEW_LINE>} | "Unable to perform tar on host resource " + this.hostResource, createFileIOException); |
1,345,726 | protected void runAsynchronously(ManagedBeanOperation operation, Object[] paramValues, Long timeout) {<NEW_LINE>BackgroundTask<Long, Object> task = new BackgroundTask<Long, Object>(timeout, TimeUnit.MILLISECONDS, this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object run(TaskLifeCycle<Long> taskLifeCycle) {<NEW_LINE>return jmxControlAPI.invokeOperation(operation, paramValues);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void done(Object result) {<NEW_LINE>Window w = openWindow("jmxConsoleOperationResult", OpenType.DIALOG, ParamsMap.of("result", result, "beanName", operation.getMbean().getClassName(), "methodName", operation.getName()));<NEW_LINE>w.addCloseListener(actionId -> reloadAttributes());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean handleException(Exception ex) {<NEW_LINE>log.error("Error occurs while performing JMX operation {}", <MASK><NEW_LINE>Window w = openWindow("jmxConsoleOperationResult", OpenType.DIALOG, ParamsMap.of("exception", ex, "beanName", operation.getMbean().getClassName(), "methodName", operation.getName()));<NEW_LINE>w.addCloseListener(actionId -> reloadAttributes());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>BackgroundWorkWindow.show(task, true);<NEW_LINE>} | operation.getName(), ex); |
1,678,618 | private void handleRow(final Cdcpb.Event.Row row) {<NEW_LINE>if (!TableKeyRangeUtils.isRecordKey(row.getKey().toByteArray())) {<NEW_LINE>// Don't handle index key for now<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.debug("binlog record, type: {}, data: {}", row.getType(), row);<NEW_LINE>switch(row.getType()) {<NEW_LINE>case COMMITTED:<NEW_LINE>prewrites.put(RowKeyWithTs.ofStart(row), row);<NEW_LINE>commits.put(RowKeyWithTs.ofCommit(row), row);<NEW_LINE>break;<NEW_LINE>case COMMIT:<NEW_LINE>commits.put(RowKeyWithTs.ofCommit(row), row);<NEW_LINE>break;<NEW_LINE>case PREWRITE:<NEW_LINE>prewrites.put(RowKeyWithTs.ofStart(row), row);<NEW_LINE>break;<NEW_LINE>case ROLLBACK:<NEW_LINE>prewrites.remove(RowKeyWithTs.ofStart(row));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOG.warn(<MASK><NEW_LINE>}<NEW_LINE>} | "Unsupported row type:" + row.getType()); |
1,010,784 | final CreateGameSessionQueueResult executeCreateGameSessionQueue(CreateGameSessionQueueRequest createGameSessionQueueRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createGameSessionQueueRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateGameSessionQueueRequest> request = null;<NEW_LINE>Response<CreateGameSessionQueueResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateGameSessionQueueRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createGameSessionQueueRequest));<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, "GameLift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateGameSessionQueue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateGameSessionQueueResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateGameSessionQueueResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,597,635 | public static GetDBTopologyResponse unmarshall(GetDBTopologyResponse getDBTopologyResponse, UnmarshallerContext _ctx) {<NEW_LINE>getDBTopologyResponse.setRequestId(_ctx.stringValue("GetDBTopologyResponse.RequestId"));<NEW_LINE>getDBTopologyResponse.setSuccess(_ctx.booleanValue("GetDBTopologyResponse.Success"));<NEW_LINE>getDBTopologyResponse.setErrorMessage(_ctx.stringValue("GetDBTopologyResponse.ErrorMessage"));<NEW_LINE>getDBTopologyResponse.setErrorCode(_ctx.stringValue("GetDBTopologyResponse.ErrorCode"));<NEW_LINE>DBTopology dBTopology = new DBTopology();<NEW_LINE>dBTopology.setLogicDbId(_ctx.longValue("GetDBTopologyResponse.DBTopology.LogicDbId"));<NEW_LINE>dBTopology.setLogicDbName(_ctx.stringValue("GetDBTopologyResponse.DBTopology.LogicDbName"));<NEW_LINE>dBTopology.setSearchName(_ctx.stringValue("GetDBTopologyResponse.DBTopology.SearchName"));<NEW_LINE>dBTopology.setAlias(_ctx.stringValue("GetDBTopologyResponse.DBTopology.Alias"));<NEW_LINE>dBTopology.setDbType(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DbType"));<NEW_LINE>dBTopology.setEnvType(_ctx.stringValue("GetDBTopologyResponse.DBTopology.EnvType"));<NEW_LINE>List<DBTopologyInfo> dBTopologyInfoList = new ArrayList<DBTopologyInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList.Length"); i++) {<NEW_LINE>DBTopologyInfo dBTopologyInfo = new DBTopologyInfo();<NEW_LINE>dBTopologyInfo.setDbId(_ctx.longValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].DbId"));<NEW_LINE>dBTopologyInfo.setSchemaName(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].SchemaName"));<NEW_LINE>dBTopologyInfo.setCatalogName(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].CatalogName"));<NEW_LINE>dBTopologyInfo.setSearchName(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].SearchName"));<NEW_LINE>dBTopologyInfo.setDbType(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].DbType"));<NEW_LINE>dBTopologyInfo.setEnvType(_ctx.stringValue<MASK><NEW_LINE>dBTopologyInfo.setInstanceId(_ctx.longValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].InstanceId"));<NEW_LINE>dBTopologyInfo.setRegionId(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].RegionId"));<NEW_LINE>dBTopologyInfo.setInstanceResourceId(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].InstanceResourceId"));<NEW_LINE>dBTopologyInfo.setInstanceSource(_ctx.stringValue("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].InstanceSource"));<NEW_LINE>dBTopologyInfoList.add(dBTopologyInfo);<NEW_LINE>}<NEW_LINE>dBTopology.setDBTopologyInfoList(dBTopologyInfoList);<NEW_LINE>getDBTopologyResponse.setDBTopology(dBTopology);<NEW_LINE>return getDBTopologyResponse;<NEW_LINE>} | ("GetDBTopologyResponse.DBTopology.DBTopologyInfoList[" + i + "].EnvType")); |
386,013 | protected void drawFilter() {<NEW_LINE>GLES20.glUseProgram(program);<NEW_LINE>squareVertex.position(SQUARE_VERTEX_DATA_POS_OFFSET);<NEW_LINE>GLES20.glVertexAttribPointer(aPositionHandle, 3, GLES20.GL_FLOAT, false, SQUARE_VERTEX_DATA_STRIDE_BYTES, squareVertex);<NEW_LINE>GLES20.glEnableVertexAttribArray(aPositionHandle);<NEW_LINE>squareVertex.position(SQUARE_VERTEX_DATA_UV_OFFSET);<NEW_LINE>GLES20.glVertexAttribPointer(aTextureHandle, 2, GLES20.GL_FLOAT, false, SQUARE_VERTEX_DATA_STRIDE_BYTES, squareVertex);<NEW_LINE>GLES20.glEnableVertexAttribArray(aTextureHandle);<NEW_LINE>GLES20.glUniformMatrix4fv(uMVPMatrixHandle, 1, false, MVPMatrix, 0);<NEW_LINE>GLES20.glUniformMatrix4fv(uSTMatrixHandle, <MASK><NEW_LINE>float time = ((float) (System.currentTimeMillis() - START_TIME)) / 1000.0f;<NEW_LINE>GLES20.glUniform1f(uTimeHandle, time);<NEW_LINE>GLES20.glUniform1i(uSamplerHandle, 4);<NEW_LINE>GLES20.glActiveTexture(GLES20.GL_TEXTURE4);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, previousTexId);<NEW_LINE>} | 1, false, STMatrix, 0); |
374,346 | private void buildUI() {<NEW_LINE><MASK><NEW_LINE>splitPane.setLeftComponent(buildConditionList());<NEW_LINE>splitPane.setRightComponent(buildExpressionArea());<NEW_LINE>splitPane.setResizeWeight(0.1);<NEW_LINE>splitPane.setDividerLocation(120);<NEW_LINE>inspectorPanel = JInspectorPanelFactory.build(splitPane);<NEW_LINE>inspectorPanel.addInspector(new JComponentInspector<JComponent>(buildLog(), "Log", "A log of evaluated conditions", true));<NEW_LINE>add(inspectorPanel.getComponent(), BorderLayout.CENTER);<NEW_LINE>setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));<NEW_LINE>setPreferredSize(new Dimension(550, 300));<NEW_LINE>if (listModel.getSize() > 0) {<NEW_LINE>conditionList.setSelectedIndex(0);<NEW_LINE>}<NEW_LINE>componentEnabler.add(conditionList);<NEW_LINE>componentEnabler.add(expressionArea);<NEW_LINE>componentEnabler.add(testStepsCombo);<NEW_LINE>componentEnabler.add(testConditionButton);<NEW_LINE>componentEnabler.add(copyButton);<NEW_LINE>componentEnabler.add(declareButton);<NEW_LINE>componentEnabler.add(deleteButton);<NEW_LINE>componentEnabler.add(addButton);<NEW_LINE>componentEnabler.add(runButton);<NEW_LINE>componentEnabler.add(renameButton);<NEW_LINE>} | JSplitPane splitPane = UISupport.createHorizontalSplit(); |
512,781 | protected void interpolateFlowScale(GrayF32 prev, GrayF32 curr) {<NEW_LINE>interp.setImage(prev);<NEW_LINE>float scaleX = (float) prev.width / (float) curr.width;<NEW_LINE>float scaleY = (float) prev.<MASK><NEW_LINE>float scale = (float) prev.width / (float) curr.width;<NEW_LINE>int indexCurr = 0;<NEW_LINE>for (int y = 0; y < curr.height; y++) {<NEW_LINE>float yy = y * scaleY;<NEW_LINE>for (int x = 0; x < curr.width; x++) {<NEW_LINE>float xx = x * scaleX;<NEW_LINE>if (interp.isInFastBounds(xx, yy)) {<NEW_LINE>curr.data[indexCurr++] = interp.get_fast(x * scaleX, y * scaleY) / scale;<NEW_LINE>} else {<NEW_LINE>curr.data[indexCurr++] = interp.get(x * scaleX, y * scaleY) / scale;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | height / (float) curr.height; |
944,372 | static ArgGroupSpec extractArgGroupSpec(IAnnotatedElement member, IFactory factory, CommandSpec commandSpec, boolean annotationsAreMandatory) throws Exception {<NEW_LINE>Object instance = null;<NEW_LINE>try {<NEW_LINE>instance = member.getter().get();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>Class<?> cls = instance == null ? member.getTypeInfo().getType() : instance.getClass();<NEW_LINE>if (member.isMultiValue()) {<NEW_LINE>cls = member.getTypeInfo().getAuxiliaryTypes()[0];<NEW_LINE>}<NEW_LINE>IScope scope = new ObjectScope(instance);<NEW_LINE>ArgGroupSpec.Builder builder = ArgGroupSpec.builder(member);<NEW_LINE>builder.updateArgGroupAttributes(member.getAnnotation(ArgGroup.class));<NEW_LINE>if (member.isOption() || member.isParameter()) {<NEW_LINE>if (member instanceof TypedMember) {<NEW_LINE>validateArgSpecMember((TypedMember) member);<NEW_LINE>}<NEW_LINE>builder.addArg(buildArgForMember(member, factory));<NEW_LINE>}<NEW_LINE>Stack<Class<?>> hierarchy = new Stack<Class<?>>();<NEW_LINE>while (cls != null) {<NEW_LINE>hierarchy.add(cls);<NEW_LINE>cls = cls.getSuperclass();<NEW_LINE>}<NEW_LINE>boolean hasArgAnnotation = false;<NEW_LINE>while (!hierarchy.isEmpty()) {<NEW_LINE>cls = hierarchy.pop();<NEW_LINE>hasArgAnnotation |= initFromAnnotatedMembers(scope, cls, <MASK><NEW_LINE>}<NEW_LINE>ArgGroupSpec result = builder.build();<NEW_LINE>if (annotationsAreMandatory) {<NEW_LINE>validateArgGroupSpec(result, hasArgAnnotation, cls.getName());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | commandSpec, builder, factory, null); |
1,206,738 | public static ListDataSourcesResponse unmarshall(ListDataSourcesResponse listDataSourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDataSourcesResponse.setRequestId(_ctx.stringValue("ListDataSourcesResponse.RequestId"));<NEW_LINE>listDataSourcesResponse.setSuccess(_ctx.booleanValue("ListDataSourcesResponse.Success"));<NEW_LINE>listDataSourcesResponse.setTotalCount(_ctx.integerValue("ListDataSourcesResponse.TotalCount"));<NEW_LINE>List<DataSource> dataSources = new ArrayList<DataSource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDataSourcesResponse.DataSources.Length"); i++) {<NEW_LINE>DataSource dataSource = new DataSource();<NEW_LINE>dataSource.setConnectionInfo(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].ConnectionInfo"));<NEW_LINE>dataSource.setDataSourceId(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].DataSourceId"));<NEW_LINE>dataSource.setDataSourceType(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].DataSourceType"));<NEW_LINE>dataSource.setGmtCreate(_ctx.stringValue<MASK><NEW_LINE>dataSource.setGmtModified(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].GmtModified"));<NEW_LINE>dataSource.setName(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].Name"));<NEW_LINE>dataSources.add(dataSource);<NEW_LINE>}<NEW_LINE>listDataSourcesResponse.setDataSources(dataSources);<NEW_LINE>return listDataSourcesResponse;<NEW_LINE>} | ("ListDataSourcesResponse.DataSources[" + i + "].GmtCreate")); |
961,990 | protected void executeImpl() throws MojoExecutionException, MojoFailureException {<NEW_LINE>String iconPath = properties.getProperty("codename1.icon");<NEW_LINE>File iconFile = new File(iconPath);<NEW_LINE>if (!iconFile.isAbsolute()) {<NEW_LINE>iconFile = new File(getCN1ProjectDir(), iconFile.getPath());<NEW_LINE>}<NEW_LINE>if (!iconFile.exists()) {<NEW_LINE>getLog().warn("Icon file " + iconFile + " not found. Skipping desktop appp icon generation.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File outputDir = new File(project.getBuild().getOutputDirectory());<NEW_LINE>if (!outputDir.exists()) {<NEW_LINE>outputDir.mkdirs();<NEW_LINE>}<NEW_LINE>try (FileInputStream fis = new FileInputStream(iconFile)) {<NEW_LINE>getLog().debug("Creating Application Icons");<NEW_LINE>BufferedImage iconImage = ImageIO.read(fis);<NEW_LINE>createIconFile(new File(outputDir, "applicationIconImage_16x16.png"), iconImage, 16, 16);<NEW_LINE>createIconFile(new File(outputDir, "applicationIconImage_20x20.png"), iconImage, 20, 20);<NEW_LINE>createIconFile(new File(outputDir, "applicationIconImage_32x32.png"), iconImage, 32, 32);<NEW_LINE>createIconFile(new File(outputDir, "applicationIconImage_40x40.png"), iconImage, 40, 40);<NEW_LINE>createIconFile(new File(outputDir, "applicationIconImage_64x64.png"), iconImage, 64, 64);<NEW_LINE>} catch (IOException ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Now get the wrapper<NEW_LINE>File wrapperSources = new File(project.getBasedir(), path("src", "desktop", "java"));<NEW_LINE>if (wrapperSources.exists()) {<NEW_LINE>project.addCompileSourceRoot(wrapperSources.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} | throw new MojoExecutionException("Failed to generate icons", ex); |
619,070 | public List<ReplicaTokenInfo> deserializeTokens(InputStream inputStream) throws IOException, ReplicationException {<NEW_LINE>CrcInputStream crcStream = new CrcInputStream(inputStream);<NEW_LINE>DataInputStream stream = new DataInputStream(crcStream);<NEW_LINE>List<ReplicaTokenInfo> tokenInfoList = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>short version = stream.readShort();<NEW_LINE>if (version < VERSION_0 || version > VERSION_1) {<NEW_LINE>throw new ReplicationException("Invalid version found during replica token deserialization: " + version);<NEW_LINE>}<NEW_LINE>while (stream.available() > Crc_Size) {<NEW_LINE>// read partition id<NEW_LINE>PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream);<NEW_LINE>// read remote node host name<NEW_LINE>String hostname = Utils.readIntString(stream);<NEW_LINE>// read remote replica path<NEW_LINE>String replicaPath = Utils.readIntString(stream);<NEW_LINE>// read remote port<NEW_LINE>int port = stream.readInt();<NEW_LINE>// read total bytes read from local store<NEW_LINE>long totalBytesReadFromLocalStore = stream.readLong();<NEW_LINE>// read replica type; prior to VERSION_1 all the replicas were DISK_BACKED only<NEW_LINE>ReplicaType replicaType = ReplicaType.DISK_BACKED;<NEW_LINE>if (version > VERSION_0) {<NEW_LINE>replicaType = ReplicaType.values()[stream.readShort()];<NEW_LINE>}<NEW_LINE>// read replica token<NEW_LINE>FindTokenFactory findTokenFactory = tokenHelper.getFindTokenFactoryFromReplicaType(replicaType);<NEW_LINE>FindToken <MASK><NEW_LINE>tokenInfoList.add(new ReplicaTokenInfo(partitionId, hostname, replicaPath, port, totalBytesReadFromLocalStore, token));<NEW_LINE>}<NEW_LINE>long computedCrc = crcStream.getValue();<NEW_LINE>long readCrc = stream.readLong();<NEW_LINE>if (computedCrc != readCrc) {<NEW_LINE>throw new ReplicationException("Crc mismatch during replica token deserialization, computed " + computedCrc + ", read " + readCrc);<NEW_LINE>}<NEW_LINE>return tokenInfoList;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ReplicationException("IO error deserializing replica tokens", e);<NEW_LINE>} finally {<NEW_LINE>stream.close();<NEW_LINE>}<NEW_LINE>} | token = findTokenFactory.getFindToken(stream); |
1,201,004 | private static void reflectiveMethodInvokeHook(Method method) {<NEW_LINE>serialClientOperationsLock.beginTrans(true);<NEW_LINE>try {<NEW_LINE>if (reflectMethods.containsKey(method)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProfilerRuntimeCPU.suspendCurrentThreadTimer();<NEW_LINE>reflectMethods.put(method, null);<NEW_LINE>Class<?> clazz = method.getDeclaringClass();<NEW_LINE>String className = clazz.getName();<NEW_LINE><MASK><NEW_LINE>Class[] paramTypes = method.getParameterTypes();<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append('(');<NEW_LINE>for (int i = 0; i < paramTypes.length; i++) {<NEW_LINE>appendTypeName(sb, paramTypes[i]);<NEW_LINE>}<NEW_LINE>sb.append(')');<NEW_LINE>appendTypeName(sb, method.getReturnType());<NEW_LINE>String methodSignature = sb.toString();<NEW_LINE>clientInstrStartTime = Timers.getCurrentTimeInCounts();<NEW_LINE>MethodLoadedCommand cmd = new MethodLoadedCommand(className, ClassLoaderManager.registerLoader(clazz), methodName, methodSignature);<NEW_LINE>profilerServer.sendComplexCmdToClient(cmd);<NEW_LINE>if (!getAndInstrumentClasses(false)) {<NEW_LINE>disableProfilerHooks();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProfilerRuntimeCPU.resumeCurrentThreadTimer();<NEW_LINE>} finally {<NEW_LINE>serialClientOperationsLock.endTrans();<NEW_LINE>}<NEW_LINE>} | String methodName = method.getName(); |
931,167 | public void triggerListeners(final int eventType, final Object params) {<NEW_LINE>if (SWTSkin.DEBUG_VISIBILITIES) {<NEW_LINE>if (eventType == SWTSkinObjectListener.EVENT_SHOW) {<NEW_LINE>System.out.println(this + " Show " + this + " via " + Debug.getCompressedStackTrace());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// delay show and hide events while not initialized<NEW_LINE>if (eventType == SWTSkinObjectListener.EVENT_SHOW || eventType == SWTSkinObjectListener.EVENT_HIDE) {<NEW_LINE>if (!initialized) {<NEW_LINE>// System.out.println("NOT INITIALIZED! " + SWTSkinObjectBasic.this + ";;;" + Debug.getCompressedStackTrace());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (eventType == SWTSkinObjectListener.EVENT_SHOW && !isVisible()) {<NEW_LINE>if (SWTSkin.DEBUG_VISIBILITIES) {<NEW_LINE>System.out.println(this + " Warning: Show Event when not visible " + this + " via " + Debug.getCompressedStackTrace());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else if (eventType == SWTSkinObjectListener.EVENT_HIDE && isVisible()) {<NEW_LINE>if (SWTSkin.DEBUG_VISIBILITIES) {<NEW_LINE>System.out.println(this + " Warning: Hide Event when visible " + this + " via " + Debug.getCompressedStackTrace());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (eventType == SWTSkinObjectListener.EVENT_CREATED) {<NEW_LINE>// System.out.println("INITIALIZED! " + SWTSkinObjectBasic.this + ";;;" + Debug.getCompressedStackTrace());<NEW_LINE>initialized = true;<NEW_LINE>} else if (eventType == SWTSkinObjectListener.EVENT_DATASOURCE_CHANGED) {<NEW_LINE>datasource = params;<NEW_LINE>} else if (eventType == SWTSkinObjectListener.EVENT_DESTROY && isVisible == 1) {<NEW_LINE>triggerListenersRaw(SWTSkinObjectListener.EVENT_HIDE, null);<NEW_LINE>}<NEW_LINE>triggerListenersRaw(eventType, params);<NEW_LINE>if (eventType == SWTSkinObjectListener.EVENT_CREATED && isVisible >= 0) {<NEW_LINE>triggerListeners(isVisible() ? SWTSkinObjectListener.EVENT_SHOW : SWTSkinObjectListener.EVENT_HIDE);<NEW_LINE>}<NEW_LINE>if (eventType == SWTSkinObjectListener.EVENT_SHOW && skinView == null) {<NEW_LINE>String initClass = properties.getStringValue(sConfigID + ".onshow.skinviewclass");<NEW_LINE>if (initClass != null) {<NEW_LINE>try {<NEW_LINE>String[] initClassItems = RegExUtil.PAT_SPLIT_COMMA.split(initClass);<NEW_LINE>ClassLoader claLoader = this.getClass().getClassLoader();<NEW_LINE>if (initClassItems.length > 1) {<NEW_LINE>try {<NEW_LINE>PluginInterface pi = PluginInitializer.getDefaultInterface().getPluginManager().getPluginInterfaceByID(initClassItems[1]);<NEW_LINE>if (pi != null) {<NEW_LINE>claLoader = pi.getPluginClassLoader();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class<SkinView> cla = (Class<SkinView>) Class.forName(initClassItems[0], true, claLoader);<NEW_LINE><MASK><NEW_LINE>skinView.setMainSkinObject(this);<NEW_LINE>// this will fire created and show for us<NEW_LINE>addListener(skinView);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setSkinView(cla.newInstance()); |
1,070,815 | public void initialize(boolean parsingCompilationUnit) {<NEW_LINE>// positioning the parser for a new compilation unit<NEW_LINE>// avoiding stack reallocation and all that....<NEW_LINE>this.javadoc = null;<NEW_LINE>this.astPtr = -1;<NEW_LINE>this.astLengthPtr = -1;<NEW_LINE>this.patternPtr = -1;<NEW_LINE>this.patternLengthPtr = -1;<NEW_LINE>this.expressionPtr = -1;<NEW_LINE>this.expressionLengthPtr = -1;<NEW_LINE>this.typeAnnotationLengthPtr = -1;<NEW_LINE>this.typeAnnotationPtr = -1;<NEW_LINE>this.identifierPtr = -1;<NEW_LINE>this.identifierLengthPtr = -1;<NEW_LINE>this.intPtr = -1;<NEW_LINE>// need to reset for further reuse<NEW_LINE>this.nestedMethod[this.nestedType = 0] = 0;<NEW_LINE>this.switchNestingLevel = 0;<NEW_LINE>this.switchWithTry = false;<NEW_LINE>this.<MASK><NEW_LINE>this.dimensions = 0;<NEW_LINE>this.realBlockPtr = -1;<NEW_LINE>this.compilationUnit = null;<NEW_LINE>this.referenceContext = null;<NEW_LINE>this.endStatementPosition = 0;<NEW_LINE>this.valueLambdaNestDepth = -1;<NEW_LINE>// remove objects from stack too, while the same parser/compiler couple is<NEW_LINE>// re-used between two compilations ....<NEW_LINE>int astLength = this.astStack.length;<NEW_LINE>if (this.noAstNodes.length < astLength) {<NEW_LINE>this.noAstNodes = new ASTNode[astLength];<NEW_LINE>// System.out.println("Resized AST stacks : "+ astLength);<NEW_LINE>}<NEW_LINE>System.arraycopy(this.noAstNodes, 0, this.astStack, 0, astLength);<NEW_LINE>int expressionLength = this.expressionStack.length;<NEW_LINE>if (this.noExpressions.length < expressionLength) {<NEW_LINE>this.noExpressions = new Expression[expressionLength];<NEW_LINE>// System.out.println("Resized EXPR stacks : "+ expressionLength);<NEW_LINE>}<NEW_LINE>System.arraycopy(this.noExpressions, 0, this.expressionStack, 0, expressionLength);<NEW_LINE>// reset this.scanner state<NEW_LINE>this.scanner.commentPtr = -1;<NEW_LINE>this.scanner.foundTaskCount = 0;<NEW_LINE>this.scanner.eofPosition = Integer.MAX_VALUE;<NEW_LINE>this.recordStringLiterals = true;<NEW_LINE>final boolean checkNLS = this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore;<NEW_LINE>this.checkExternalizeStrings = checkNLS;<NEW_LINE>this.scanner.checkNonExternalizedStringLiterals = parsingCompilationUnit && checkNLS;<NEW_LINE>this.scanner.checkUninternedIdentityComparison = parsingCompilationUnit && this.options.complainOnUninternedIdentityComparison;<NEW_LINE>this.scanner.lastPosition = -1;<NEW_LINE>resetModifiers();<NEW_LINE>// recovery<NEW_LINE>this.lastCheckPoint = -1;<NEW_LINE>this.currentElement = null;<NEW_LINE>this.restartRecovery = false;<NEW_LINE>this.hasReportedError = false;<NEW_LINE>this.recoveredStaticInitializerStart = 0;<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>this.lastErrorEndPosition = -1;<NEW_LINE>this.lastErrorEndPositionBeforeRecovery = -1;<NEW_LINE>this.lastJavadocEnd = -1;<NEW_LINE>this.listLength = 0;<NEW_LINE>this.listTypeParameterLength = 0;<NEW_LINE>this.lastPosistion = -1;<NEW_LINE>this.rBraceStart = 0;<NEW_LINE>this.rBraceEnd = 0;<NEW_LINE>this.rBraceSuccessorStart = 0;<NEW_LINE>this.rBracketPosition = 0;<NEW_LINE>this.genericsIdentifiersLengthPtr = -1;<NEW_LINE>this.genericsLengthPtr = -1;<NEW_LINE>this.genericsPtr = -1;<NEW_LINE>} | variablesCounter[this.nestedType] = 0; |
398,312 | public boolean mouseDragged(Point pt) {<NEW_LINE>if (dragState == DragState.NONE)<NEW_LINE>return false;<NEW_LINE><MASK><NEW_LINE>double y = pt.getY();<NEW_LINE>double dx = x - px;<NEW_LINE>double dy = y - py;<NEW_LINE>// The delta value is multiplied by 2 to create the float effect of moving<NEW_LINE>// the top left corner down and the bottom left corner up (in the case of<NEW_LINE>// the top left handle).<NEW_LINE>if (dx == 0 && dy == 0)<NEW_LINE>return false;<NEW_LINE>startCombiningEdits("Set Value");<NEW_LINE>switch(dragState) {<NEW_LINE>case TOP_LEFT:<NEW_LINE>silentSet(widthName, owidth - dx * 2);<NEW_LINE>silentSet(heightName, oheight - dy * 2);<NEW_LINE>break;<NEW_LINE>case TOP_RIGHT:<NEW_LINE>silentSet(heightName, oheight - dy * 2);<NEW_LINE>silentSet(widthName, owidth + dx * 2);<NEW_LINE>break;<NEW_LINE>case BOTTOM_LEFT:<NEW_LINE>silentSet(widthName, owidth - dx * 2);<NEW_LINE>silentSet(heightName, oheight + dy * 2);<NEW_LINE>break;<NEW_LINE>case BOTTOM_RIGHT:<NEW_LINE>silentSet(widthName, owidth + dx * 2);<NEW_LINE>silentSet(heightName, oheight + dy * 2);<NEW_LINE>break;<NEW_LINE>case CENTER:<NEW_LINE>silentSet(positionName, new Point(ocx + dx, ocy + dy));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | double x = pt.getX(); |
1,137,625 | public void afterPropertiesSet() throws Exception {<NEW_LINE>// Check the signing and verification keys match<NEW_LINE>if (signer instanceof RsaSigner) {<NEW_LINE>RsaVerifier verifier;<NEW_LINE>try {<NEW_LINE>verifier = new RsaVerifier(verifierKey);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Unable to create an RSA verifier from verifierKey");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] test = "test".getBytes();<NEW_LINE>try {<NEW_LINE>verifier.verify(test, signer.sign(test));<NEW_LINE>logger.info("Signing and verification RSA keys match");<NEW_LINE>} catch (InvalidSignatureException e) {<NEW_LINE>logger.error("Signing and verification RSA keys do not match");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Avoid a race condition where setters are called in the wrong order. Use of ==<NEW_LINE>// is intentional.<NEW_LINE>Assert.state(this.signingKey == this.verifierKey, "For MAC signing you do not need to specify the verifier key separately, and if you do it must match the signing key");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>verifier = new RsaVerifier(verifierKey);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Unable to create an RSA verifier from verifierKey");<NEW_LINE>}<NEW_LINE>this.verifier = verifier;<NEW_LINE>} | SignatureVerifier verifier = new MacSigner(verifierKey); |
569,039 | public int exactDivide(Frequency other) {<NEW_LINE>ArgChecker.notNull(other, "other");<NEW_LINE>if (isMonthBased() && other.isMonthBased()) {<NEW_LINE>long paymentMonths = getPeriod().toTotalMonths();<NEW_LINE>long accrualMonths = other.getPeriod().toTotalMonths();<NEW_LINE>if ((paymentMonths % accrualMonths) == 0) {<NEW_LINE>return Math.toIntExact(paymentMonths / accrualMonths);<NEW_LINE>}<NEW_LINE>} else if (period.toTotalMonths() == 0 && other.period.toTotalMonths() == 0) {<NEW_LINE>long paymentDays = getPeriod().getDays();<NEW_LINE>long accrualDays = other<MASK><NEW_LINE>if ((paymentDays % accrualDays) == 0) {<NEW_LINE>return Math.toIntExact(paymentDays / accrualDays);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(Messages.format("Frequency '{}' is not a multiple of '{}'", this, other));<NEW_LINE>} | .getPeriod().getDays(); |
979,150 | public File runFilter(final File file, final Map<String, String[]> parameters) {<NEW_LINE>final int qualityParam = parameters.get(getPrefix() + "q") != null ? Integer.parseInt(parameters.get(getPrefix() + "q")[0]) : 85;<NEW_LINE>Float quality = new Float(qualityParam);<NEW_LINE>quality = quality / 100;<NEW_LINE>final File resultFile = getResultsFile(file, parameters, "webp");<NEW_LINE>if (!overwrite(resultFile, parameters)) {<NEW_LINE>return resultFile;<NEW_LINE>}<NEW_LINE>resultFile.delete();<NEW_LINE>try {<NEW_LINE>final ImageWriter writer = ImageIO.getImageWritersByMIMEType("image/webp").next();<NEW_LINE>final WebPWriteParam writeParam = new WebPWriteParam(writer.getLocale());<NEW_LINE>if (quality == 1) {<NEW_LINE><MASK><NEW_LINE>writeParam.setCompressionType("Lossless");<NEW_LINE>} else {<NEW_LINE>writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);<NEW_LINE>writeParam.setCompressionType("Lossy");<NEW_LINE>writeParam.setCompressionQuality(quality);<NEW_LINE>}<NEW_LINE>final File tempResultFile = new File(resultFile.getAbsoluteFile() + "_" + System.currentTimeMillis() + ".tmp");<NEW_LINE>writer.setOutput(new FileImageOutputStream(tempResultFile));<NEW_LINE>writer.write(null, new IIOImage(ImageIO.read(file), null, null), writeParam);<NEW_LINE>writer.dispose();<NEW_LINE>tempResultFile.renameTo(resultFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException("unable to convert file:" + file + " : " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return resultFile;<NEW_LINE>} | writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); |
1,360,631 | public static InstanceExchangeFilterFunction rewriteEndpointUrl() {<NEW_LINE>return (instance, request, next) -> {<NEW_LINE>if (request.url().isAbsolute()) {<NEW_LINE>log.trace("Absolute URL '{}' for instance {} not rewritten", request.url(<MASK><NEW_LINE>if (request.url().toString().equals(instance.getRegistration().getManagementUrl())) {<NEW_LINE>request = ClientRequest.from(request).attribute(ATTRIBUTE_ENDPOINT, Endpoint.ACTUATOR_INDEX).build();<NEW_LINE>}<NEW_LINE>return next.exchange(request);<NEW_LINE>}<NEW_LINE>UriComponents requestUrl = UriComponentsBuilder.fromUri(request.url()).build();<NEW_LINE>if (requestUrl.getPathSegments().isEmpty()) {<NEW_LINE>return Mono.error(new ResolveEndpointException("No endpoint specified"));<NEW_LINE>}<NEW_LINE>String endpointId = requestUrl.getPathSegments().get(0);<NEW_LINE>Optional<Endpoint> endpoint = instance.getEndpoints().get(endpointId);<NEW_LINE>if (!endpoint.isPresent()) {<NEW_LINE>return Mono.error(new ResolveEndpointException("Endpoint '" + endpointId + "' not found"));<NEW_LINE>}<NEW_LINE>URI rewrittenUrl = rewriteUrl(requestUrl, endpoint.get().getUrl());<NEW_LINE>log.trace("URL '{}' for Endpoint {} of instance {} rewritten to {}", requestUrl, endpoint.get().getId(), instance.getId(), rewrittenUrl);<NEW_LINE>request = ClientRequest.from(request).attribute(ATTRIBUTE_ENDPOINT, endpoint.get().getId()).url(rewrittenUrl).build();<NEW_LINE>return next.exchange(request);<NEW_LINE>};<NEW_LINE>} | ), instance.getId()); |
1,785,981 | public okhttp3.Call readNamespacedHorizontalPodAutoscalerCall(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/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{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 HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String <MASK><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>} | localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
192,492 | public void onClick(View v) {<NEW_LINE>handler.removeCallbacks(ask2);<NEW_LINE>synchronized (AppState.get().tabsOrder7) {<NEW_LINE>AppState.get().tabsOrder7 = "";<NEW_LINE>for (int i = 0; i < dragLinearLayout.getChildCount(); i++) {<NEW_LINE>View child = dragLinearLayout.getChildAt(i);<NEW_LINE>boolean isVisible = ((CheckBox) child.findViewById(R.id.isVisible)).isChecked();<NEW_LINE>AppState.get().tabsOrder7 += child.getTag() + "#" + (isVisible ? "1" : "0") + ",";<NEW_LINE>}<NEW_LINE>AppState.get().tabsOrder7 = TxtUtils.replaceLast(AppState.get().tabsOrder7, ",", "");<NEW_LINE>LOG.d("tabsApply", <MASK><NEW_LINE>}<NEW_LINE>if (UITab.isShowCloudsPreferences()) {<NEW_LINE>Clouds.get().init(getActivity());<NEW_LINE>}<NEW_LINE>onTheme();<NEW_LINE>} | AppState.get().tabsOrder7); |
1,623,999 | int runCmd(CommandLine cmdLine) throws Exception {<NEW_LINE>UpdateBookieInLedgerCommand cmd = new UpdateBookieInLedgerCommand();<NEW_LINE>UpdateBookieInLedgerCommand.UpdateBookieInLedgerFlags flags = new UpdateBookieInLedgerCommand.UpdateBookieInLedgerFlags();<NEW_LINE>final String srcBookie = cmdLine.getOptionValue("srcBookie");<NEW_LINE>final String destBookie = cmdLine.getOptionValue("destBookie");<NEW_LINE>if (StringUtils.isBlank(srcBookie) || StringUtils.isBlank(destBookie)) {<NEW_LINE>LOG.error("Invalid argument list (srcBookie and destBookie must be provided)!");<NEW_LINE>this.printUsage();<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (StringUtils.equals(srcBookie, destBookie)) {<NEW_LINE>LOG.error("srcBookie and destBookie can't be the same.");<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>final int rate = getOptionIntValue(cmdLine, "updatespersec", 5);<NEW_LINE>final int maxOutstandingReads = getOptionIntValue(cmdLine, "maxOutstandingReads", (rate * 5));<NEW_LINE>final int limit = getOptionIntValue(<MASK><NEW_LINE>final boolean verbose = getOptionBooleanValue(cmdLine, "verbose", false);<NEW_LINE>final long printprogress;<NEW_LINE>if (!verbose) {<NEW_LINE>if (cmdLine.hasOption("printprogress")) {<NEW_LINE>LOG.warn("Ignoring option 'printprogress', this is applicable when 'verbose' is true");<NEW_LINE>}<NEW_LINE>printprogress = Integer.MIN_VALUE;<NEW_LINE>} else {<NEW_LINE>// defaulting to 10 seconds<NEW_LINE>printprogress = getOptionLongValue(cmdLine, "printprogress", 10);<NEW_LINE>}<NEW_LINE>flags.srcBookie(srcBookie);<NEW_LINE>flags.destBookie(destBookie);<NEW_LINE>flags.printProgress(printprogress);<NEW_LINE>flags.limit(limit);<NEW_LINE>flags.updatePerSec(rate);<NEW_LINE>flags.maxOutstandingReads(maxOutstandingReads);<NEW_LINE>flags.verbose(verbose);<NEW_LINE>boolean result = cmd.apply(bkConf, flags);<NEW_LINE>return (result) ? 0 : -1;<NEW_LINE>} | cmdLine, "limit", Integer.MIN_VALUE); |
634,341 | public final void printHelp(final PrintStream out) {<NEW_LINE>final <MASK><NEW_LINE>final String commandName = "RolloutMigrate";<NEW_LINE>final String header = "Util to apply metasfresh migration scripts to a POstgresSQL database. The database settings are read from a settings (properties) file.\n" + "The tool will by default only run if its own version (as set in in the " + RolloutVersionLoader.PROP_VERSION + " property of its " + RolloutVersionLoader.BUILD_INFO_FILENAME + ")" + " is higher than the version selected from the DB (AD_System.DBVersion).";<NEW_LINE>final String footer = "\nHints: " + "* For each individual migration file the tool checks against the Table AD_MigrationScript if the migration file was already been applied" + "* The migration files are ordered by their filenames \"globally\", no matter in thich directory they are";<NEW_LINE>final HelpFormatter formatter = new HelpFormatter();<NEW_LINE>// output<NEW_LINE>formatter.// output<NEW_LINE>printHelp(// width,<NEW_LINE>writer, // cmdLineSyntax<NEW_LINE>200, // header,<NEW_LINE>stripQuotes(commandName), // options<NEW_LINE>stripQuotes(header), // leftPad,<NEW_LINE>options, // descPad,<NEW_LINE>4, // footer,<NEW_LINE>4, // autoUsage<NEW_LINE>stripQuotes(footer), true);<NEW_LINE>writer.flush();<NEW_LINE>} | PrintWriter writer = new PrintWriter(out); |
1,333,575 | public void process(@Nonnull DiffFragment fragment, @Nonnull FragmentsCollector collector) throws FilesTooBigForDiffException {<NEW_LINE>DiffString text1 = fragment.getText1();<NEW_LINE>DiffString text2 = fragment.getText2();<NEW_LINE>if (!fragment.isEqual()) {<NEW_LINE>if (myComparisonPolicy.isEqual(fragment))<NEW_LINE>fragment = myComparisonPolicy.createFragment(text1, text2);<NEW_LINE>collector.add(fragment);<NEW_LINE>} else {<NEW_LINE>assert text1 != null;<NEW_LINE>assert text2 != null;<NEW_LINE>DiffString[<MASK><NEW_LINE>DiffString[] lines2 = text2.tokenize();<NEW_LINE>LOG.assertTrue(lines1.length == lines2.length);<NEW_LINE>for (int i = 0; i < lines1.length; i++) collector.addAll(myDiffPolicy.buildFragments(lines1[i], lines2[i]));<NEW_LINE>}<NEW_LINE>} | ] lines1 = text1.tokenize(); |
1,682,140 | public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {<NEW_LINE>Register byteArrayLength = asRegister(temp1);<NEW_LINE>try (ScratchRegister sc1 = masm.getScratchRegister();<NEW_LINE>ScratchRegister sc2 = masm.getScratchRegister()) {<NEW_LINE>Label breakLabel = new Label();<NEW_LINE>Label scalarCompare = new Label();<NEW_LINE>Register hasMismatch = sc1.getRegister();<NEW_LINE><MASK><NEW_LINE>// Get array length in bytes and store as a 64-bit value.<NEW_LINE>int shiftAmt = NumUtil.log2Ceil(arrayIndexScale);<NEW_LINE>masm.mov(32, byteArrayLength, asRegister(lengthValue));<NEW_LINE>masm.lsl(64, byteArrayLength, byteArrayLength, shiftAmt);<NEW_LINE>masm.compare(32, asRegister(lengthValue), 32 / arrayIndexScale);<NEW_LINE>masm.branchConditionally(ConditionFlag.LE, scalarCompare);<NEW_LINE>emitSIMDCompare(masm, byteArrayLength, hasMismatch, scratch, breakLabel);<NEW_LINE>masm.bind(scalarCompare);<NEW_LINE>emitScalarCompare(masm, byteArrayLength, hasMismatch, scratch, breakLabel);<NEW_LINE>// Return: hasMismatch is non-zero iff the arrays differ<NEW_LINE>masm.bind(breakLabel);<NEW_LINE>masm.cmp(64, hasMismatch, zr);<NEW_LINE>masm.cset(32, asRegister(resultValue), ConditionFlag.EQ);<NEW_LINE>}<NEW_LINE>} | Register scratch = sc2.getRegister(); |
328,747 | private okhttp3.Call replaceNamespacedIngressStatusValidateBeforeCall(String name, String namespace, V1Ingress body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {<NEW_LINE>// verify the required parameter 'name' is set<NEW_LINE>if (name == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'name' when calling replaceNamespacedIngressStatus(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'namespace' is set<NEW_LINE>if (namespace == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'namespace' when calling replaceNamespacedIngressStatus(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'body' when calling replaceNamespacedIngressStatus(Async)");<NEW_LINE>}<NEW_LINE>okhttp3.Call localVarCall = replaceNamespacedIngressStatusCall(name, namespace, body, pretty, <MASK><NEW_LINE>return localVarCall;<NEW_LINE>} | dryRun, fieldManager, fieldValidation, _callback); |
1,842,801 | public void playTTSN() {<NEW_LINE>if (contentList.size() < 1) {<NEW_LINE>RxBus.get().post(RxBusTag.ALOUD_STATE, Status.NEXT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ttsInitSuccess && !speak && requestFocus()) {<NEW_LINE>speak = !speak;<NEW_LINE>RxBus.get().post(RxBusTag.ALOUD_STATE, Status.PLAY);<NEW_LINE>updateNotification();<NEW_LINE>initSpeechRate();<NEW_LINE>HashMap<String, String> map = new HashMap<>();<NEW_LINE>map.put(<MASK><NEW_LINE>for (int i = nowSpeak; i < contentList.size(); i++) {<NEW_LINE>if (i == 0) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>textToSpeech.speak(contentList.get(i), TextToSpeech.QUEUE_FLUSH, null, "content");<NEW_LINE>} else {<NEW_LINE>textToSpeech.speak(contentList.get(i), TextToSpeech.QUEUE_FLUSH, map);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>textToSpeech.speak(contentList.get(i), TextToSpeech.QUEUE_ADD, null, "content");<NEW_LINE>} else {<NEW_LINE>textToSpeech.speak(contentList.get(i), TextToSpeech.QUEUE_ADD, map);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "content"); |
1,848,869 | private void verifySelection() {<NEW_LINE>logger.debug("--- Verifying selection ---");<NEW_LINE>OWLSelectionModel selectionModel = getOWLSelectionModel();<NEW_LINE>OWLClass lastSelectedClass = selectionModel.getLastSelectedClass();<NEW_LINE><MASK><NEW_LINE>OWLObjectProperty lastSelectedObjectProperty = selectionModel.getLastSelectedObjectProperty();<NEW_LINE>logger.debug("Last selected object property: {}", lastSelectedObjectProperty);<NEW_LINE>OWLDataProperty lastSelectedDataProperty = selectionModel.getLastSelectedDataProperty();<NEW_LINE>logger.debug("Last selected data property: {}", lastSelectedDataProperty);<NEW_LINE>OWLAnnotationProperty lastSelectedAnnotationProperty = selectionModel.getLastSelectedAnnotationProperty();<NEW_LINE>logger.debug("Last selected annotation property: " + lastSelectedAnnotationProperty);<NEW_LINE>OWLNamedIndividual lastSelectedIndividual = selectionModel.getLastSelectedIndividual();<NEW_LINE>logger.debug("Last selected individual: {}", lastSelectedIndividual);<NEW_LINE>OWLDatatype lastSelectedDatatype = selectionModel.getLastSelectedDatatype();<NEW_LINE>logger.debug("Last selected datatype: {}", lastSelectedDatatype);<NEW_LINE>OWLEntity selectedEntity = selectionModel.getSelectedEntity();<NEW_LINE>logger.debug("Last selected entity: {}", selectedEntity);<NEW_LINE>verifySelection(CollectionFactory.createSet(lastSelectedClass, lastSelectedDataProperty, lastSelectedObjectProperty, lastSelectedAnnotationProperty, lastSelectedIndividual, lastSelectedDatatype, selectedEntity));<NEW_LINE>logger.debug("---------------------------");<NEW_LINE>} | logger.debug("Last selected class: {}", lastSelectedClass); |
96,702 | final CreatePartnerEventSourceResult executeCreatePartnerEventSource(CreatePartnerEventSourceRequest createPartnerEventSourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPartnerEventSourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePartnerEventSourceRequest> request = null;<NEW_LINE>Response<CreatePartnerEventSourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePartnerEventSourceRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePartnerEventSource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePartnerEventSourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePartnerEventSourceResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(createPartnerEventSourceRequest)); |
199,429 | private HttpPipeline createHttpPipeline() {<NEW_LINE>Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;<NEW_LINE>if (httpLogOptions == null) {<NEW_LINE>httpLogOptions = new HttpLogOptions();<NEW_LINE>}<NEW_LINE>if (clientOptions == null) {<NEW_LINE>clientOptions = new ClientOptions();<NEW_LINE>}<NEW_LINE>List<HttpPipelinePolicy> policies = new ArrayList<>();<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");<NEW_LINE>String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions);<NEW_LINE>policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue()));<NEW_LINE>if (headers.getSize() > 0) {<NEW_LINE>policies.<MASK><NEW_LINE>}<NEW_LINE>HttpPolicyProviders.addBeforeRetryPolicies(policies);<NEW_LINE>policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);<NEW_LINE>policies.add(new CookiePolicy());<NEW_LINE>policies.addAll(this.pipelinePolicies);<NEW_LINE>HttpPolicyProviders.addAfterRetryPolicies(policies);<NEW_LINE>policies.add(new HttpLoggingPolicy(httpLogOptions));<NEW_LINE>HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])).httpClient(httpClient).build();<NEW_LINE>return httpPipeline;<NEW_LINE>} | add(new AddHeadersPolicy(headers)); |
559,590 | private ResponseSpec testJsonFormDataRequestCreation(String param, String param2) throws WebClientResponseException {<NEW_LINE>Object postBody = null;<NEW_LINE>// verify the required parameter 'param' is set<NEW_LINE>if (param == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// verify the required parameter 'param2' is set<NEW_LINE>if (param2 == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new HashMap<String, Object>();<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>if (param != null)<NEW_LINE>formParams.add("param", param);<NEW_LINE>if (param2 != null)<NEW_LINE>formParams.add("param2", param2);<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/x-www-form-urlencoded" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, <MASK><NEW_LINE>} | localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); |
935,818 | private ITranslatableString buildInstanceAttributeDescription(@NonNull final I_M_AttributeInstance ai) {<NEW_LINE>final AttributeId attributeId = AttributeId.ofRepoId(ai.getM_Attribute_ID());<NEW_LINE>final I_M_Attribute attribute = attributesRepo.getAttributeById(attributeId);<NEW_LINE>final IStringExpression descriptionPattern = extractDescriptionPattern(attribute);<NEW_LINE>if (descriptionPattern == null) {<NEW_LINE>return getInstanceAttributeValueAsString(ai);<NEW_LINE>} else {<NEW_LINE>final Object value = getInstanceAttributeValue(ai);<NEW_LINE>final AttributeValueId attributeValueId = AttributeValueId.ofRepoIdOrNull(ai.getM_AttributeValue_ID());<NEW_LINE>final AttributeDescriptionPatternEvalCtx ctx = AttributeDescriptionPatternEvalCtx.builder().attributesRepo(attributesRepo).attributesBL(attributesBL).uomsRepo(uomsRepo).attribute(attribute).attributeValue(value).attributeValueId(attributeValueId).adLanguage(adLanguage).verboseDescription(verboseDescription).build();<NEW_LINE>final String description = descriptionPattern.<MASK><NEW_LINE>return TranslatableStrings.anyLanguage(description);<NEW_LINE>}<NEW_LINE>} | evaluate(ctx, OnVariableNotFound.Preserve); |
1,787,843 | public void addToMap(RCTMGLMapView mapView) {<NEW_LINE>mMapView = mapView;<NEW_LINE>mMap = mapView.getMapboxMap();<NEW_LINE>T existingSource = mMap.<T>getSourceAs(mID);<NEW_LINE>if (existingSource != null) {<NEW_LINE>mSource = existingSource;<NEW_LINE>} else {<NEW_LINE>mSource = makeSource();<NEW_LINE>mMap.addSource(mSource);<NEW_LINE>}<NEW_LINE>if (mQueuedLayers != null && mQueuedLayers.size() > 0) {<NEW_LINE>// first load<NEW_LINE>for (int i = 0; i < mQueuedLayers.size(); i++) {<NEW_LINE>addLayerToMap(mQueuedLayers<MASK><NEW_LINE>}<NEW_LINE>mQueuedLayers = null;<NEW_LINE>} else if (mLayers.size() > 0) {<NEW_LINE>// handles the case of switching style url, but keeping layers on map<NEW_LINE>for (int i = 0; i < mLayers.size(); i++) {<NEW_LINE>addLayerToMap(mLayers.get(i), i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .get(i), i); |
623,904 | BarEntry createEntry(ReadableArray values, int index) {<NEW_LINE>BarEntry entry;<NEW_LINE>float x = index;<NEW_LINE>if (ReadableType.Map.equals(values.getType(index))) {<NEW_LINE>ReadableMap map = values.getMap(index);<NEW_LINE>if (map.hasKey("x")) {<NEW_LINE>x = (float) map.getDouble("x");<NEW_LINE>}<NEW_LINE>if (ReadableType.Array.equals(map.getType("y"))) {<NEW_LINE>entry = new BarEntry(x, BridgeUtils.convertToFloatArray(map.getArray("y")));<NEW_LINE>} else if (ReadableType.Number.equals(map.getType("y"))) {<NEW_LINE>entry = new BarEntry(x, (float) map.getDouble("y"));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected entry type: " + values.getType(index));<NEW_LINE>}<NEW_LINE>entry.setData(ConversionUtil.toMap(map));<NEW_LINE>} else if (ReadableType.Array.equals(values.getType(index))) {<NEW_LINE>entry = new BarEntry(x, BridgeUtils.convertToFloatArray(values.getArray(index)));<NEW_LINE>} else if (ReadableType.Number.equals(values.getType(index))) {<NEW_LINE>entry = new BarEntry(x, (float) values.getDouble(index));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected entry type: " <MASK><NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>} | + values.getType(index)); |
653,016 | public void run() {<NEW_LINE>// set current threads classloader to the webapp classloader<NEW_LINE>Thread.currentThread().setContextClassLoader(webClassLoader);<NEW_LINE>// create a spring web application context<NEW_LINE>XmlWebApplicationContext appctx = new XmlWebApplicationContext();<NEW_LINE>appctx.setClassLoader(webClassLoader);<NEW_LINE>appctx.setConfigLocations(new String[] { contextConfigLocation });<NEW_LINE>// check for red5 context bean<NEW_LINE>ApplicationContext parentAppCtx = null;<NEW_LINE>if (applicationContext.containsBean(defaultParentContextKey)) {<NEW_LINE>parentAppCtx = (ApplicationContext) applicationContext.getBean(defaultParentContextKey);<NEW_LINE>appctx.setParent(parentAppCtx);<NEW_LINE>} else {<NEW_LINE>log.warn("{} bean was not found in context: {}", defaultParentContextKey, applicationContext.getDisplayName());<NEW_LINE>// lookup context loader and attempt to get what we need from it<NEW_LINE>if (applicationContext.containsBean("context.loader")) {<NEW_LINE>ContextLoader contextLoader = (ContextLoader) applicationContext.getBean("context.loader");<NEW_LINE><MASK><NEW_LINE>appctx.setParent(parentAppCtx);<NEW_LINE>} else {<NEW_LINE>log.debug("Context loader was not found, trying JMX");<NEW_LINE>MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();<NEW_LINE>// get the ContextLoader from jmx<NEW_LINE>ContextLoaderMXBean proxy = null;<NEW_LINE>ObjectName oName = null;<NEW_LINE>try {<NEW_LINE>oName = new ObjectName("org.red5.server:name=contextLoader,type=ContextLoader");<NEW_LINE>if (mbs.isRegistered(oName)) {<NEW_LINE>proxy = JMX.newMXBeanProxy(mbs, oName, ContextLoaderMXBean.class, true);<NEW_LINE>log.debug("Context loader was found");<NEW_LINE>proxy.setParentContext(defaultParentContextKey, appctx.getId());<NEW_LINE>} else {<NEW_LINE>log.warn("Context loader was not found");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Exception looking up ContextLoader", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add the servlet context<NEW_LINE>appctx.setServletContext(servletContext);<NEW_LINE>// set the root webapp ctx attr on the each servlet context so spring can find it later<NEW_LINE>servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, appctx);<NEW_LINE>appctx.refresh();<NEW_LINE>} | parentAppCtx = contextLoader.getContext(defaultParentContextKey); |
117,506 | private void executeScript(DBRProgressMonitor monitor, Connection connection, Reader ddlStream, boolean logQueries) throws SQLException, IOException, DBException {<NEW_LINE>// Read DDL script<NEW_LINE>String ddlText = IOUtils.readToString(ddlStream);<NEW_LINE>// Translate script to target dialect<NEW_LINE>DBPPreferenceStore prefStore = new SimplePreferenceStore() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void save() throws IOException {<NEW_LINE>}<NEW_LINE>};<NEW_LINE>prefStore.setValue(SQLModelPreferences.SQL_FORMAT_FORMATTER, "default");<NEW_LINE>BasicSQLDialect sourceDialect = new BasicSQLDialect() {<NEW_LINE>};<NEW_LINE>ddlText = SQLQueryTranslator.translateScript(sourceDialect, targetDatabaseDialect, prefStore, ddlText);<NEW_LINE>String[] <MASK><NEW_LINE>for (String line : ddl) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (logQueries) {<NEW_LINE>log.debug("Process [" + line + "]");<NEW_LINE>}<NEW_LINE>try (Statement dbStat = connection.createStatement()) {<NEW_LINE>dbStat.execute(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ddl = ddlText.split(";"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.