idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,586,438 | protected void onDraw(Canvas canvas) {<NEW_LINE>super.onDraw(canvas);<NEW_LINE>float padding = getHeight() * 0.07f;<NEW_LINE>paintBackground.setStrokeWidth(getHeight() * 0.02f);<NEW_LINE>paintProgress.setStrokeWidth(padding);<NEW_LINE>bounds.set(padding, padding, getWidth() - <MASK><NEW_LINE>canvas.drawArc(bounds, 0, 360, false, paintBackground);<NEW_LINE>if (MINIMUM_PERCENTAGE <= percentage && percentage <= MAXIMUM_PERCENTAGE) {<NEW_LINE>canvas.drawArc(bounds, -90, percentage * 360, false, paintProgress);<NEW_LINE>}<NEW_LINE>if (Math.abs(percentage - targetPercentage) > MINIMUM_PERCENTAGE) {<NEW_LINE>float speed = 0.02f;<NEW_LINE>if (Math.abs(targetPercentage - percentage) < 0.1 && targetPercentage > percentage) {<NEW_LINE>speed = 0.006f;<NEW_LINE>}<NEW_LINE>float delta = Math.min(speed, Math.abs(targetPercentage - percentage));<NEW_LINE>float direction = ((targetPercentage - percentage) > 0 ? 1f : -1f);<NEW_LINE>percentage += delta * direction;<NEW_LINE>invalidate();<NEW_LINE>}<NEW_LINE>} | padding, getHeight() - padding); |
158,719 | private List<ArgType> searchCastTypes(MethodNode parentMth, IMethodDetails mthDetails, List<IMethodDetails> overloadedMethods, List<ArgType> compilerVarTypes) {<NEW_LINE>// try compile types<NEW_LINE>if (isOverloadResolved(mthDetails, overloadedMethods, compilerVarTypes)) {<NEW_LINE>return compilerVarTypes;<NEW_LINE>}<NEW_LINE>int argsCount = compilerVarTypes.size();<NEW_LINE>List<ArgType> castTypes <MASK><NEW_LINE>// replace unknown types<NEW_LINE>boolean changed = replaceUnknownTypes(castTypes, mthDetails.getArgTypes());<NEW_LINE>if (changed && isOverloadResolved(mthDetails, overloadedMethods, castTypes)) {<NEW_LINE>return castTypes;<NEW_LINE>}<NEW_LINE>// replace generic types<NEW_LINE>changed = false;<NEW_LINE>for (int i = 0; i < argsCount; i++) {<NEW_LINE>ArgType castType = castTypes.get(i);<NEW_LINE>ArgType mthType = mthDetails.getArgTypes().get(i);<NEW_LINE>if (!castType.isGeneric() && mthType.isGeneric()) {<NEW_LINE>castTypes.set(i, mthType);<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed && isOverloadResolved(mthDetails, overloadedMethods, castTypes)) {<NEW_LINE>return castTypes;<NEW_LINE>}<NEW_LINE>// if just one arg => cast will resolve<NEW_LINE>if (argsCount == 1) {<NEW_LINE>return mthDetails.getArgTypes();<NEW_LINE>}<NEW_LINE>if (Consts.DEBUG_OVERLOADED_CASTS) {<NEW_LINE>// TODO: try to minimize casts count<NEW_LINE>parentMth.addDebugComment("Failed to find minimal casts for resolve overloaded methods, cast all args instead" + ICodeWriter.NL + " method: " + mthDetails + ICodeWriter.NL + " arg types: " + compilerVarTypes + ICodeWriter.NL + " candidates:" + ICodeWriter.NL + " " + Utils.listToString(overloadedMethods, ICodeWriter.NL + " "));<NEW_LINE>}<NEW_LINE>// not resolved -> cast all args<NEW_LINE>return mthDetails.getArgTypes();<NEW_LINE>} | = new ArrayList<>(compilerVarTypes); |
1,264,430 | final GetObjectResult executeGetObject(GetObjectRequest getObjectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getObjectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetObjectRequest> request = null;<NEW_LINE>Response<GetObjectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetObjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getObjectRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaStore Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetObject");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetObjectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(true), new GetObjectResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.HAS_STREAMING_OUTPUT, Boolean.TRUE); |
1,407,598 | public void onStartup(Set<Class<?>> classes, ServletContext ctx) {<NEW_LINE>Instance<ExecutorService> instance = CDI.current().select(ExecutorService.class);<NEW_LINE><MASK><NEW_LINE>Future<Integer> future = executor.submit(new Callable<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer call() {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (// TODO this causes deadlock with com/ibm/ws/webcontainer/webapp/WebApp$1<NEW_LINE>false)<NEW_LINE>try {<NEW_LINE>future.get();<NEW_LINE>} catch (Exception x) {<NEW_LINE>throw new RuntimeException(x);<NEW_LINE>}<NEW_LINE>Instance<ConcurrentCDI2AppScopedBean> bean = CDI.current().select(ConcurrentCDI2AppScopedBean.class);<NEW_LINE>bean.get().setServletContainerInitFuture(future);<NEW_LINE>System.out.println("ServletContainerInitializer.onStartup invoked, using " + executor);<NEW_LINE>} | ExecutorService executor = instance.get(); |
1,536,758 | final CreatePermissionGroupResult executeCreatePermissionGroup(CreatePermissionGroupRequest createPermissionGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPermissionGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePermissionGroupRequest> request = null;<NEW_LINE>Response<CreatePermissionGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePermissionGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPermissionGroupRequest));<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, "finspace data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePermissionGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePermissionGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePermissionGroupResultJsonUnmarshaller());<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,585,922 | public void open(NodeInputSplit split) throws IOException {<NEW_LINE>ResourcesUtils.parseGpuInfo(getRuntimeContext(), mlConfig);<NEW_LINE>mlContext = new MLContext(mode, mlConfig, role.name(), split.getSplitNumber(), mlConfig.getEnvPath(), ColumnInfos.dummy().getNameToTypeMap());<NEW_LINE>if (role.getClass().equals(AMRole.class)) {<NEW_LINE>serverFuture = new FutureTask<>(new AppMasterServer(mlContext), null);<NEW_LINE>} else {<NEW_LINE>PythonFileUtil.preparePythonFilesForExec(getRuntimeContext(), mlContext);<NEW_LINE>serverFuture = new FutureTask<>(new NodeServer(mlContext, role.name()), null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread t = new Thread(serverFuture);<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.setName("NodeServer_" + mlContext.getIdentity());<NEW_LINE>t.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Fail to start node service.", e);<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>LOG.info("start: {}", mlContext.getIdentity());<NEW_LINE>// we have no data to write<NEW_LINE>mlContext.getOutputQueue().markFinished();<NEW_LINE>// exec hook open func<NEW_LINE>try {<NEW_LINE>List<String> hookList = mlContext.getHookClassNames();<NEW_LINE>hookManager = new FlinkOpHookManager(hookList);<NEW_LINE>hookManager.open();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>this.dataExchange <MASK><NEW_LINE>} | = new DataExchange<>(mlContext); |
202,576 | public int compareTo(TSummaryRequest other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTableId(), other.isSetTableId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTableId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetBounds(), other.isSetBounds());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetBounds()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bounds, other.bounds);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSummarizers(), other.isSetSummarizers());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSummarizers()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summarizers, other.summarizers);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSummarizerPattern(), other.isSetSummarizerPattern());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSummarizerPattern()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summarizerPattern, other.summarizerPattern);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.tableId, other.tableId); |
1,645,089 | public IStatus download(String[] URLs, IProgressMonitor progressMonitor) {<NEW_LINE>if (URLs.length == 0) {<NEW_LINE>String err = Messages.InstallerConfigurationProcessor_missingDownloadTargets;<NEW_LINE>applyErrorAttributes(err);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>PortalUIPlugin.getDefault(), // $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>return new Status(IStatus.ERROR, PortalUIPlugin.PLUGIN_ID, err);<NEW_LINE>}<NEW_LINE>downloadedPaths = null;<NEW_LINE>DownloadManager downloadManager = new DownloadManager();<NEW_LINE>List<URI> urlsList = new ArrayList<URI>(URLs.length);<NEW_LINE>for (int i = 0; i < URLs.length; i++) {<NEW_LINE>try {<NEW_LINE>urlsList.add(new URI(urls[i]));<NEW_LINE>} catch (URISyntaxException mue) {<NEW_LINE>IdeLog.logError(PortalUIPlugin.getDefault(), mue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>downloadManager.addURIs(urlsList);<NEW_LINE>IStatus status = downloadManager.start(progressMonitor);<NEW_LINE>if (status.isOK()) {<NEW_LINE>downloadedPaths = downloadManager.getContentsLocations();<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(PortalUIPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>} | "We expected an array of URLs, but got an empty array.", new Exception(err)); |
1,375,121 | private boolean save(Path targetPath, SaveDatabaseMode mode) {<NEW_LINE>if (mode == SaveDatabaseMode.NORMAL) {<NEW_LINE>dialogService.notify(String.format("%s...", Localization.lang("Saving library")));<NEW_LINE>}<NEW_LINE>libraryTab.setSaving(true);<NEW_LINE>try {<NEW_LINE>Charset encoding = libraryTab.getBibDatabaseContext().getMetaData().getEncoding().orElse(StandardCharsets.UTF_8);<NEW_LINE>// Make sure to remember which encoding we used.<NEW_LINE>libraryTab.getBibDatabaseContext().getMetaData().setEncoding(encoding, ChangePropagation.DO_NOT_POST_EVENT);<NEW_LINE>// Save the database<NEW_LINE>boolean success = saveDatabase(targetPath, false, <MASK><NEW_LINE>if (success) {<NEW_LINE>libraryTab.getUndoManager().markUnchanged();<NEW_LINE>libraryTab.resetChangedProperties();<NEW_LINE>}<NEW_LINE>dialogService.notify(Localization.lang("Library saved"));<NEW_LINE>return success;<NEW_LINE>} catch (SaveException ex) {<NEW_LINE>LOGGER.error(String.format("A problem occurred when trying to save the file %s", targetPath), ex);<NEW_LINE>dialogService.showErrorDialogAndWait(Localization.lang("Save library"), Localization.lang("Could not save file."), ex);<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>// release panel from save status<NEW_LINE>libraryTab.setSaving(false);<NEW_LINE>}<NEW_LINE>} | encoding, SavePreferences.DatabaseSaveType.ALL); |
183,638 | private boolean completeJavadocTagInModuleInfo(CompilationUnitDeclaration parsedUnit) {<NEW_LINE>boolean contextAccepted = false;<NEW_LINE>if (this.parser.assistNodeParent instanceof CompletionJavadoc && parsedUnit.isModuleInfo()) {<NEW_LINE>try {<NEW_LINE>this.lookupEnvironment.buildTypeBindings(parsedUnit, null);<NEW_LINE>if (this.parser.assistNode instanceof CompletionOnJavadocTag) {<NEW_LINE>((CompletionOnJavadocTag) this.parser.assistNode<MASK><NEW_LINE>}<NEW_LINE>throw new CompletionNodeFound(this.parser.assistNode, null, parsedUnit.scope);<NEW_LINE>} catch (CompletionNodeFound e) {<NEW_LINE>if (e.astNode != null) {<NEW_LINE>// if null then we found a problem in the completion node<NEW_LINE>if (DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print("COMPLETION - Completion node : ");<NEW_LINE>System.out.println(e.astNode.toString());<NEW_LINE>if (this.parser.assistNodeParent != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print("COMPLETION - Parent Node : ");<NEW_LINE>System.out.println(this.parser.assistNodeParent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// better resilient to further error reporting<NEW_LINE>this.lookupEnvironment.unitBeingCompleted = parsedUnit;<NEW_LINE>contextAccepted = complete(e.astNode, this.parser.assistNodeParent, this.parser.enclosingNode, parsedUnit, e.qualifiedBinding, e.scope, e.insideTypeAnnotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return contextAccepted;<NEW_LINE>} | ).filterPossibleTags(parsedUnit.scope); |
747,001 | public static XContentBuilder convert(PhotonDoc doc, String[] languages, String[] extraTags) throws IOException {<NEW_LINE>final AddressType atype = doc.getAddressType();<NEW_LINE>XContentBuilder builder = XContentFactory.jsonBuilder().startObject().field(Constants.OSM_ID, doc.getOsmId()).field(Constants.OSM_TYPE, doc.getOsmType()).field(Constants.OSM_KEY, doc.getTagKey()).field(Constants.OSM_VALUE, doc.getTagValue()).field(Constants.OBJECT_TYPE, atype == null ? "locality" : atype.getName()).field(Constants.IMPORTANCE, doc.getImportance());<NEW_LINE>String classification = buildClassificationString(doc.getTagKey(<MASK><NEW_LINE>if (classification != null) {<NEW_LINE>builder.field(Constants.CLASSIFICATION, classification);<NEW_LINE>}<NEW_LINE>if (doc.getCentroid() != null) {<NEW_LINE>builder.startObject("coordinate").field("lat", doc.getCentroid().getY()).field("lon", doc.getCentroid().getX()).endObject();<NEW_LINE>}<NEW_LINE>if (doc.getHouseNumber() != null) {<NEW_LINE>builder.field("housenumber", doc.getHouseNumber());<NEW_LINE>}<NEW_LINE>if (doc.getPostcode() != null) {<NEW_LINE>builder.field("postcode", doc.getPostcode());<NEW_LINE>}<NEW_LINE>writeName(builder, doc.getName(), languages);<NEW_LINE>for (Map.Entry<AddressType, Map<String, String>> entry : doc.getAddressParts().entrySet()) {<NEW_LINE>writeIntlNames(builder, entry.getValue(), entry.getKey().getName(), languages);<NEW_LINE>}<NEW_LINE>String countryCode = doc.getCountryCode();<NEW_LINE>if (countryCode != null)<NEW_LINE>builder.field(Constants.COUNTRYCODE, countryCode);<NEW_LINE>writeContext(builder, doc.getContext(), languages);<NEW_LINE>writeExtraTags(builder, doc.getExtratags(), extraTags);<NEW_LINE>writeExtent(builder, doc.getBbox());<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | ), doc.getTagValue()); |
1,216,572 | protected void initNaming() {<NEW_LINE>// Setting additional variables<NEW_LINE>if (!useNaming) {<NEW_LINE>// START SJSAS 5031700<NEW_LINE>// log.info( "Catalina naming disabled");<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.log(Level.FINE, "Catalina naming disabled");<NEW_LINE>}<NEW_LINE>// END SJSAS 5031700<NEW_LINE>System.setProperty("catalina.useNaming", "false");<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>String value = "org.apache.naming";<NEW_LINE>String oldValue = System.getProperty(javax.naming.Context.URL_PKG_PREFIXES);<NEW_LINE>if (oldValue != null) {<NEW_LINE>value = value + ":" + oldValue;<NEW_LINE>}<NEW_LINE>System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, value);<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.log(Level.FINE, "Setting naming prefix={0}", value);<NEW_LINE>}<NEW_LINE>value = System.getProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY);<NEW_LINE>if (value == null) {<NEW_LINE>System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");<NEW_LINE>} else {<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.log(Level.FINE, "INITIAL_CONTEXT_FACTORY alread set {0}", value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.setProperty("catalina.useNaming", "true"); |
1,436,932 | protected boolean parseAttributes(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {<NEW_LINE>NamedNodeMap atts = element.getAttributes();<NEW_LINE>boolean setBus = false;<NEW_LINE>for (int i = 0; i < atts.getLength(); i++) {<NEW_LINE>Attr node = (<MASK><NEW_LINE>String val = node.getValue();<NEW_LINE>String pre = node.getPrefix();<NEW_LINE>String name = node.getLocalName();<NEW_LINE>String prefix = node.getPrefix();<NEW_LINE>// Don't process namespaces<NEW_LINE>if (isNamespace(name, prefix)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if ("createdFromAPI".equals(name)) {<NEW_LINE>bean.setAbstract(true);<NEW_LINE>} else if ("abstract".equals(name)) {<NEW_LINE>bean.setAbstract(true);<NEW_LINE>} else if ("depends-on".equals(name)) {<NEW_LINE>bean.addDependsOn(val);<NEW_LINE>} else if ("name".equals(name)) {<NEW_LINE>processNameAttribute(element, ctx, bean, val);<NEW_LINE>} else if ("bus".equals(name)) {<NEW_LINE>setBus = processBusAttribute(element, ctx, bean, val);<NEW_LINE>} else if (!"id".equals(name) && isAttribute(pre, name)) {<NEW_LINE>mapAttribute(bean, element, name, val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return setBus;<NEW_LINE>} | Attr) atts.item(i); |
1,326,133 | public void launchImageLibrary(final ReadableMap options, final Callback callback) {<NEW_LINE>final Activity currentActivity = getCurrentActivity();<NEW_LINE>if (currentActivity == null) {<NEW_LINE>callback.invoke(getErrorMap(errOthers, "Activity error"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.callback = callback;<NEW_LINE>this.options = new Options(options);<NEW_LINE>int requestCode;<NEW_LINE>Intent libraryIntent;<NEW_LINE>requestCode = REQUEST_LAUNCH_LIBRARY;<NEW_LINE>boolean isSingleSelect <MASK><NEW_LINE>boolean isPhoto = this.options.mediaType.equals(mediaTypePhoto);<NEW_LINE>boolean isVideo = this.options.mediaType.equals(mediaTypeVideo);<NEW_LINE>if (isSingleSelect && (isPhoto || isVideo)) {<NEW_LINE>libraryIntent = new Intent(Intent.ACTION_PICK);<NEW_LINE>} else {<NEW_LINE>libraryIntent = new Intent(Intent.ACTION_GET_CONTENT);<NEW_LINE>libraryIntent.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>}<NEW_LINE>if (!isSingleSelect) {<NEW_LINE>libraryIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);<NEW_LINE>}<NEW_LINE>if (isPhoto) {<NEW_LINE>libraryIntent.setType("image/*");<NEW_LINE>} else if (isVideo) {<NEW_LINE>libraryIntent.setType("video/*");<NEW_LINE>} else {<NEW_LINE>libraryIntent.setType("*/*");<NEW_LINE>libraryIntent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] { "image/*", "video/*" });<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>currentActivity.startActivityForResult(libraryIntent, requestCode);<NEW_LINE>} catch (ActivityNotFoundException e) {<NEW_LINE>callback.invoke(getErrorMap(errOthers, e.getMessage()));<NEW_LINE>this.callback = null;<NEW_LINE>}<NEW_LINE>} | = this.options.selectionLimit == 1; |
266,728 | public ValidationError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ValidationError validationError = new ValidationError();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>validationError.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("errors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>validationError.setErrors(new ListUnmarshaller<String>(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 validationError;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,223,688 | public Regressor transformToOutput(List<OnnxValue> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) {<NEW_LINE>float[][] predictions = getBatchPredictions(tensor);<NEW_LINE>if (predictions.length != 1) {<NEW_LINE>throw new <MASK><NEW_LINE>} else if (predictions[0].length != outputIDInfo.size()) {<NEW_LINE>throw new IllegalArgumentException("Supplied tensor has an incorrect number of dimensions, predictions[0].length = " + predictions[0].length + ", expected " + outputIDInfo.size());<NEW_LINE>}<NEW_LINE>// Note this inserts in an ordering which is not necessarily the natural one,<NEW_LINE>// but the Regressor constructor sorts it to maintain the natural ordering.<NEW_LINE>// The names and the values still line up, so this code is valid.<NEW_LINE>String[] names = new String[outputIDInfo.size()];<NEW_LINE>double[] values = new double[outputIDInfo.size()];<NEW_LINE>for (Pair<Integer, Regressor> p : outputIDInfo) {<NEW_LINE>int id = p.getA();<NEW_LINE>names[id] = p.getB().getNames()[0];<NEW_LINE>values[id] = predictions[0][id];<NEW_LINE>}<NEW_LINE>return new Regressor(names, values);<NEW_LINE>} | IllegalArgumentException("Supplied tensor has too many results, predictions.length = " + predictions.length); |
412,007 | public void renderModel(ItemStack itemStack, Mode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int lightmap, int overlay, FabricBakedModel model, VanillaQuadHandler vanillaHandler) {<NEW_LINE>this.lightmap = lightmap;<NEW_LINE>this.overlay = overlay;<NEW_LINE>this.itemStack = itemStack;<NEW_LINE>this.vertexConsumerProvider = vertexConsumerProvider;<NEW_LINE>this.matrixStack = matrixStack;<NEW_LINE>this.transformMode = transformMode;<NEW_LINE>this.vanillaHandler = vanillaHandler;<NEW_LINE>quadBlendMode = BlendMode.DEFAULT;<NEW_LINE>modelVertexConsumer = selectVertexConsumer(RenderLayers.getItemLayer(itemStack, transformMode != ModelTransformation.Mode.GROUND));<NEW_LINE>matrixStack.push();<NEW_LINE>((BakedModel) model).getTransformation().getTransformation(transformMode).apply(invert, matrixStack);<NEW_LINE>matrixStack.translate(-<MASK><NEW_LINE>matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>normalMatrix = matrixStack.peek().getNormalMatrix();<NEW_LINE>model.emitItemQuads(itemStack, randomSupplier, this);<NEW_LINE>matrixStack.pop();<NEW_LINE>this.matrixStack = null;<NEW_LINE>this.itemStack = null;<NEW_LINE>this.vanillaHandler = null;<NEW_LINE>modelVertexConsumer = null;<NEW_LINE>} | 0.5D, -0.5D, -0.5D); |
900,651 | public static String normalizeTagViewId(String tagViewId) {<NEW_LINE>if (tagViewId == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Split off the base/QS...<NEW_LINE>tagViewId = tagViewId.trim();<NEW_LINE>int <MASK><NEW_LINE>String baseName = (idx == -1) ? tagViewId : tagViewId.substring(0, idx);<NEW_LINE>String queryString = (idx == -1) ? "" : tagViewId.substring(idx + 1);<NEW_LINE>// Get rid of leading and extra '/' characters...<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(baseName, "/");<NEW_LINE>StringBuilder builder = new StringBuilder(tokenizer.nextToken());<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>builder.append('/');<NEW_LINE>builder.append(tokenizer.nextToken());<NEW_LINE>}<NEW_LINE>baseName = builder.toString();<NEW_LINE>// Normalize Extension...<NEW_LINE>if (!baseName.endsWith(".jsf")) {<NEW_LINE>idx = baseName.lastIndexOf('.');<NEW_LINE>if (idx != -1) {<NEW_LINE>// Replace existing extension with .jsf...<NEW_LINE>baseName = baseName.substring(0, idx) + ".jsf";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Split & sort the NVPs...<NEW_LINE>if (queryString.length() > 0) {<NEW_LINE>tokenizer = new StringTokenizer(queryString, "&");<NEW_LINE>List<String> nvps = new ArrayList<String>();<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>nvps.add(tokenizer.nextToken());<NEW_LINE>}<NEW_LINE>// Sort them...<NEW_LINE>Collections.sort(nvps);<NEW_LINE>// Rebuild the QS, now ordered...<NEW_LINE>builder = new StringBuilder(nvps.remove(0));<NEW_LINE>for (String nvp : nvps) {<NEW_LINE>// Add the rest...<NEW_LINE>builder.append('&');<NEW_LINE>builder.append(nvp);<NEW_LINE>}<NEW_LINE>queryString = builder.toString();<NEW_LINE>}<NEW_LINE>// Reassemble the String...<NEW_LINE>tagViewId = baseName + ((queryString.length() > 0) ? ("?" + queryString) : "");<NEW_LINE>return tagViewId;<NEW_LINE>} | idx = tagViewId.indexOf('?'); |
816,468 | public static DescribeRegionsResponse unmarshall(DescribeRegionsResponse describeRegionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRegionsResponse.setRequestId<MASK><NEW_LINE>List<KVStoreRegion> regionIds = new ArrayList<KVStoreRegion>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRegionsResponse.RegionIds.Length"); i++) {<NEW_LINE>KVStoreRegion kVStoreRegion = new KVStoreRegion();<NEW_LINE>kVStoreRegion.setRegionEndpoint(_ctx.stringValue("DescribeRegionsResponse.RegionIds[" + i + "].RegionEndpoint"));<NEW_LINE>kVStoreRegion.setLocalName(_ctx.stringValue("DescribeRegionsResponse.RegionIds[" + i + "].LocalName"));<NEW_LINE>kVStoreRegion.setRegionId(_ctx.stringValue("DescribeRegionsResponse.RegionIds[" + i + "].RegionId"));<NEW_LINE>kVStoreRegion.setZoneIds(_ctx.stringValue("DescribeRegionsResponse.RegionIds[" + i + "].ZoneIds"));<NEW_LINE>List<String> zoneIdList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRegionsResponse.RegionIds[" + i + "].ZoneIdList.Length"); j++) {<NEW_LINE>zoneIdList.add(_ctx.stringValue("DescribeRegionsResponse.RegionIds[" + i + "].ZoneIdList[" + j + "]"));<NEW_LINE>}<NEW_LINE>kVStoreRegion.setZoneIdList(zoneIdList);<NEW_LINE>regionIds.add(kVStoreRegion);<NEW_LINE>}<NEW_LINE>describeRegionsResponse.setRegionIds(regionIds);<NEW_LINE>return describeRegionsResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeRegionsResponse.RequestId")); |
231,482 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {<NEW_LINE>Query post = RemoteAccess.evaluate(request);<NEW_LINE>// Get the json data to visualize as a key value pair of data=<NEW_LINE>if (post.isDoS_blackout()) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the data json string passed as stream parameter<NEW_LINE>String data = post.get("data", "");<NEW_LINE>String legendBitString = post.get("legend", "");<NEW_LINE>String tooltipBitString = post.get("tooltip", "");<NEW_LINE>String widthString = post.get("width", "");<NEW_LINE>String heightString = post.get("height", "");<NEW_LINE>boolean legendBit = true;<NEW_LINE>boolean tooltipBit = false;<NEW_LINE>int width = 500;<NEW_LINE>int height = 500;<NEW_LINE>if ("".equals(legendBitString) || "false".equals(legendBitString)) {<NEW_LINE>legendBit = true;<NEW_LINE>} else {<NEW_LINE>legendBit = false;<NEW_LINE>}<NEW_LINE>if ("".equals(tooltipBitString) || !"true".equals(tooltipBitString)) {<NEW_LINE>tooltipBit = false;<NEW_LINE>} else {<NEW_LINE>tooltipBit = true;<NEW_LINE>}<NEW_LINE>if (!"".equals(widthString)) {<NEW_LINE>width = Integer.parseInt(widthString);<NEW_LINE>}<NEW_LINE>if (!"".equals(heightString)) {<NEW_LINE>height = Integer.parseInt(heightString);<NEW_LINE>}<NEW_LINE>JSONObject json = new JSONObject(data);<NEW_LINE>response.setContentType("image/png");<NEW_LINE>OutputStream outputStream = response.getOutputStream();<NEW_LINE>JFreeChart chart = getChart(json, legendBit, tooltipBit);<NEW_LINE>ChartUtilities.writeChartAsPNG(outputStream, chart, width, height);<NEW_LINE>} | response.sendError(503, "Your request frequency is too high"); |
1,227,752 | public Vector ifilter(double threshold) {<NEW_LINE>if (storage.isDense()) {<NEW_LINE>int[] values = ((<MASK><NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>if (Math.abs(values[i]) <= threshold) {<NEW_LINE>values[i] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (storage.isSparse()) {<NEW_LINE>ObjectIterator<Long2IntMap.Entry> iter = ((LongIntVectorStorage) storage).entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2IntMap.Entry entry = iter.next();<NEW_LINE>int value = entry.getIntValue();<NEW_LINE>if (Math.abs(value) <= threshold) {<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long[] indices = ((LongIntVectorStorage) storage).getIndices();<NEW_LINE>int[] values = ((LongIntVectorStorage) storage).getValues();<NEW_LINE>long size = ((LongIntVectorStorage) storage).size();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>if (Math.abs(values[k]) <= threshold) {<NEW_LINE>values = ArrayUtils.remove(values, k);<NEW_LINE>indices = ArrayUtils.remove(indices, k);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LongIntVector(matrixId, rowId, clock, getDim(), (LongIntVectorStorage) storage);<NEW_LINE>} | LongIntVectorStorage) storage).getValues(); |
1,214,789 | public void process(Object[] args) throws HiveException {<NEW_LINE>String start = null;<NEW_LINE>String end = null;<NEW_LINE>int incr = 1;<NEW_LINE>DurationFieldType durationType = DurationFieldType.days();<NEW_LINE>DateTimeFormatter dateFormatter = org.joda.time.format.DateTimeFormat.forPattern("YYYYMMdd");<NEW_LINE>if (args.length >= 2) {<NEW_LINE>start = this.startInspector.getPrimitiveJavaObject(args[0]);<NEW_LINE>end = this.endInspector.getPrimitiveJavaObject(args[1]);<NEW_LINE>}<NEW_LINE>if (args.length >= 3) {<NEW_LINE>incr = this.incrInspector.get(args[2]);<NEW_LINE>}<NEW_LINE>if (args.length >= 4) {<NEW_LINE>String value = this.durationTypeInspector.getPrimitiveJavaObject(args[3]);<NEW_LINE>if ((value != null) && durationTypes.containsKey(value.toLowerCase())) {<NEW_LINE>durationType = durationTypes.get(value.toLowerCase());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (args.length >= 5) {<NEW_LINE>dateFormatter = org.joda.time.format.DateTimeFormat.forPattern(this.dateFormatInspector.getPrimitiveJavaObject(args[4]));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DateTime startDt = dateFormatter.parseDateTime(start);<NEW_LINE>DateTime endDt = dateFormatter.parseDateTime(end);<NEW_LINE>int i = 0;<NEW_LINE>for (DateTime dt = startDt; dt.isBefore(endDt) || dt.isEqual(endDt); dt = dt.withFieldAdded(durationType, incr), i++) {<NEW_LINE>this.forwardListObj[0] = dateFormatter.print(dt);<NEW_LINE>this.forwardListObj[1] = new Integer(i);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException badFormat) {<NEW_LINE>throw new HiveException("Unable to parse dates; start = " + start + " ; end = " + end);<NEW_LINE>}<NEW_LINE>} | this.forward(this.forwardListObj); |
788,656 | boolean asyn_predict() {<NEW_LINE>HashMap<String, String> feed_data = new HashMap<String, String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("words", "i am very sad | 0");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>System.out.println(feed_data);<NEW_LINE>List<String> fetch = Arrays.asList("prediction");<NEW_LINE>System.out.println(fetch);<NEW_LINE>if (StaticPipelineClient.succ != true) {<NEW_LINE>if (!StaticPipelineClient.initClient("127.0.0.1", "18070")) {<NEW_LINE>System.out.println("connect failed.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PipelineFuture future = StaticPipelineClient.client.asyn_predict(feed_data, fetch, false, 0);<NEW_LINE>HashMap<String, String> result = future.get();<NEW_LINE>if (result == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>} | System.out.println(result); |
1,151,321 | private byte[] sign(byte[] key, byte[] data) {<NEW_LINE>byte[] sign = null;<NEW_LINE>try {<NEW_LINE>// Because Mac.getInstance(String) calls a synchronized method,<NEW_LINE>// it could block on invoked concurrently.<NEW_LINE>// SO use prototype pattern to improve perf.<NEW_LINE>if (macInstance == null) {<NEW_LINE>synchronized (LOCK) {<NEW_LINE>if (macInstance == null) {<NEW_LINE>macInstance = Mac.getInstance(getAlgorithm());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Mac mac;<NEW_LINE>try {<NEW_LINE>mac = (Mac) macInstance.clone();<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>// If it is not clonable, create a new one.<NEW_LINE>mac = Mac.getInstance(getAlgorithm());<NEW_LINE>}<NEW_LINE>mac.init(new SecretKeySpec<MASK><NEW_LINE>sign = mac.doFinal(data);<NEW_LINE>} catch (NoSuchAlgorithmException ex) {<NEW_LINE>throw new RuntimeException("Unsupported algorithm: " + ALGORITHM);<NEW_LINE>} catch (InvalidKeyException ex) {<NEW_LINE>throw new RuntimeException("key must not be null");<NEW_LINE>}<NEW_LINE>return sign;<NEW_LINE>} | (key, getAlgorithm())); |
703,971 | private UpdateOperations<JobPo> buildUpdateOperations(JobQueueReq request) {<NEW_LINE>UpdateOperations<JobPo> operations = template.createUpdateOperations(JobPo.class);<NEW_LINE>addUpdateField(operations, "cronExpression", request.getCronExpression());<NEW_LINE>addUpdateField(operations, "needFeedback", request.getNeedFeedback());<NEW_LINE>addUpdateField(operations, "extParams", request.getExtParams());<NEW_LINE>addUpdateField(operations, "triggerTime", request.getTriggerTime() == null ? null : request.getTriggerTime().getTime());<NEW_LINE>addUpdateField(operations, "priority", request.getPriority());<NEW_LINE>addUpdateField(operations, "maxRetryTimes", request.getMaxRetryTimes());<NEW_LINE>addUpdateField(operations, "relyOnPrevCycle", request.getRelyOnPrevCycle() == null ? true : request.getRelyOnPrevCycle());<NEW_LINE>addUpdateField(operations, <MASK><NEW_LINE>addUpdateField(operations, "taskTrackerNodeGroup", request.getTaskTrackerNodeGroup());<NEW_LINE>addUpdateField(operations, "repeatCount", request.getRepeatCount());<NEW_LINE>addUpdateField(operations, "repeatInterval", request.getRepeatInterval());<NEW_LINE>addUpdateField(operations, "gmtModified", SystemClock.now());<NEW_LINE>return operations;<NEW_LINE>} | "submitNodeGroup", request.getSubmitNodeGroup()); |
710,660 | private Map<String, ShapeModel> addEmptyOutputShapes(Map<String, OperationModel> currentOperations) {<NEW_LINE>final Map<String, Operation> operations = serviceModel.getOperations();<NEW_LINE>final Map<String, ShapeModel> emptyOutputShapes = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Operation> entry : operations.entrySet()) {<NEW_LINE>String operationName = entry.getKey();<NEW_LINE>Operation operation = entry.getValue();<NEW_LINE>Output output = operation.getOutput();<NEW_LINE>if (output == null) {<NEW_LINE>final String outputShape = namingStrategy.getResponseClassName(operationName);<NEW_LINE>final OperationModel operationModel = currentOperations.get(operationName);<NEW_LINE>operationModel.setReturnType(new ReturnTypeModel(outputShape));<NEW_LINE>ShapeModel shape = new ShapeModel(outputShape).withType(ShapeType.Response.getValue());<NEW_LINE>shape.setShapeName(outputShape);<NEW_LINE>final VariableModel outputVariable = new VariableModel(namingStrategy.getVariableName(outputShape), outputShape);<NEW_LINE>shape.setVariable(outputVariable);<NEW_LINE>shape<MASK><NEW_LINE>emptyOutputShapes.put(outputShape, shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return emptyOutputShapes;<NEW_LINE>} | .setUnmarshaller(new ShapeUnmarshaller()); |
1,334,761 | public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {<NEW_LINE>if (allocation.shouldIgnoreShardForNode(shardRouting.shardId(), node.nodeId())) {<NEW_LINE>return Decision.NO;<NEW_LINE>}<NEW_LINE>Decision.Multi <MASK><NEW_LINE>for (AllocationDecider allocationDecider : allocations) {<NEW_LINE>Decision decision = allocationDecider.canAllocate(shardRouting, node, allocation);<NEW_LINE>// short track if a NO is returned.<NEW_LINE>if (decision == Decision.NO) {<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("Can not allocate [{}] on node [{}] due to [{}]", shardRouting, node.node(), allocationDecider.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>// short circuit only if debugging is not enabled<NEW_LINE>if (!allocation.debugDecision()) {<NEW_LINE>return decision;<NEW_LINE>} else {<NEW_LINE>ret.add(decision);<NEW_LINE>}<NEW_LINE>} else if (decision != Decision.ALWAYS && (allocation.getDebugMode() != EXCLUDE_YES_DECISIONS || decision.type() != Decision.Type.YES)) {<NEW_LINE>// the assumption is that a decider that returns the static instance Decision#ALWAYS<NEW_LINE>// does not really implements canAllocate<NEW_LINE>ret.add(decision);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ret = new Decision.Multi(); |
152,940 | // convertAttrValue converts attribute value v of type to t an AttributeValue message.<NEW_LINE>private static AttributeValue convertAttrValue(Type<?> t, Object v) {<NEW_LINE>AttributeValue.Builder b = AttributeValue.newBuilder();<NEW_LINE>if (v instanceof Map) {<NEW_LINE>Type.DictType<?, ?> dictType = (Type.DictType<?, ?>) t;<NEW_LINE>for (Map.Entry<?, ?> entry : ((Map<?, ?>) v).entrySet()) {<NEW_LINE>b.addDictBuilder().setKey(entry.getKey().toString()).setValue(convertAttrValue(dictType.getValueType()<MASK><NEW_LINE>}<NEW_LINE>} else if (v instanceof List) {<NEW_LINE>for (Object elem : (List<?>) v) {<NEW_LINE>b.addList(convertAttrValue(t.getListElementType(), elem));<NEW_LINE>}<NEW_LINE>} else if (t == BuildType.LICENSE) {<NEW_LINE>// TODO(adonovan): need dual function of parseLicense.<NEW_LINE>// Treat as empty list for now.<NEW_LINE>} else if (t == BuildType.DISTRIBUTIONS) {<NEW_LINE>// TODO(adonovan): need dual function of parseDistributions.<NEW_LINE>// Treat as empty list for now.<NEW_LINE>} else if (t == Type.STRING) {<NEW_LINE>b.setString((String) v);<NEW_LINE>} else if (t == Type.INTEGER) {<NEW_LINE>b.setInt(((StarlarkInt) v).toIntUnchecked());<NEW_LINE>} else if (t == Type.BOOLEAN) {<NEW_LINE>b.setBool((Boolean) v);<NEW_LINE>} else if (t == BuildType.TRISTATE) {<NEW_LINE>b.setInt(((TriState) v).toInt());<NEW_LINE>} else if (BuildType.isLabelType(t)) {<NEW_LINE>// case order matters!<NEW_LINE>b.setString(v.toString());<NEW_LINE>} else {<NEW_LINE>// No native rule attribute of this type (FilesetEntry?) has a default value.<NEW_LINE>throw new IllegalStateException("unexpected type of attribute default value: " + t);<NEW_LINE>}<NEW_LINE>return b.build();<NEW_LINE>} | , entry.getValue())); |
1,089,998 | private void visitSwitchNode(ASTNode node) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.buffer.append("switch (");<NEW_LINE>if (node instanceof SwitchExpression) {<NEW_LINE>((SwitchExpression) node).getExpression().accept(this);<NEW_LINE>} else if (node instanceof SwitchStatement) {<NEW_LINE>((SwitchStatement) node).getExpression().accept(this);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.buffer.append(") ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.buffer.append("{\n");<NEW_LINE>this.indent++;<NEW_LINE>if (node instanceof SwitchExpression) {<NEW_LINE>for (Iterator it = ((SwitchExpression) node).statements().iterator(); it.hasNext(); ) {<NEW_LINE>Statement s = (Statement) it.next();<NEW_LINE>s.accept(this);<NEW_LINE>// incremented in visit(SwitchCase)<NEW_LINE>this.indent--;<NEW_LINE>}<NEW_LINE>} else if (node instanceof SwitchStatement) {<NEW_LINE>for (Iterator it = ((SwitchStatement) node).statements().iterator(); it.hasNext(); ) {<NEW_LINE>Statement s = (Statement) it.next();<NEW_LINE>s.accept(this);<NEW_LINE>// incremented in visit(SwitchCase)<NEW_LINE>this.indent--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.indent--;<NEW_LINE>printIndent();<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>} | this.buffer.append("}\n"); |
967,675 | private static void initThreadFields() {<NEW_LINE>if (threadNameField == null) {<NEW_LINE>SystemDictionary sysDict = VM.getVM().getSystemDictionary();<NEW_LINE>InstanceKlass k = sysDict.getThreadKlass();<NEW_LINE>threadNameField = (OopField) k.findField("name", "Ljava/lang/String;");<NEW_LINE>threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");<NEW_LINE>threadEETopField = (LongField) k.findField("eetop", "J");<NEW_LINE>threadTIDField = (LongField) k.findField("tid", "J");<NEW_LINE>threadStatusField = (IntField) <MASK><NEW_LINE>threadParkBlockerField = (OopField) k.findField("parkBlocker", "Ljava/lang/Object;");<NEW_LINE>TypeDataBase db = VM.getVM().getTypeDataBase();<NEW_LINE>THREAD_STATUS_NEW = db.lookupIntConstant("java_lang_Thread::NEW").intValue();<NEW_LINE>if (Assert.ASSERTS_ENABLED) {<NEW_LINE>// it is okay to miss threadStatusField, because this was<NEW_LINE>// introduced only in 1.5 JDK.<NEW_LINE>Assert.that(threadNameField != null && threadGroupField != null && threadEETopField != null, "must find all java.lang.Thread fields");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | k.findField("threadStatus", "I"); |
1,174,963 | public List<CatchStatement> visitCatchClause(final CatchClauseContext ctx) {<NEW_LINE>List<ClassNode> catchTypes = this.visitCatchType(ctx.catchType());<NEW_LINE>if (catchTypes.size() > 1) {<NEW_LINE>return catchTypes.stream().map(e -> {<NEW_LINE>Parameter catchParameter = configureAST(new Parameter(e, this.visitIdentifier(ctx.identifier())), ctx.identifier());<NEW_LINE>catchParameter.setNameStart(catchParameter.getStart());<NEW_LINE>catchParameter.setNameEnd(catchParameter.getEnd() - 1);<NEW_LINE>CatchStatement catchStatement = new CatchStatement(catchParameter, this.visitBlock(ctx.block()));<NEW_LINE>catchStatement.putNodeMetaData("catch.types", catchTypes);<NEW_LINE>return catchStatement;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>Parameter catchParameter = new Parameter(catchTypes.get(0), this.visitIdentifier(ctx.identifier()));<NEW_LINE>ASTNode nameNode = configureAST(new ConstantExpression(catchParameter.getName()), ctx.identifier());<NEW_LINE>configureAST(catchParameter, ctx.variableModifiersOpt(), nameNode);<NEW_LINE>catchParameter.setNameStart(nameNode.getStart());<NEW_LINE>catchParameter.setNameEnd(nameNode.getEnd() - 1);<NEW_LINE>CatchStatement catchStatement = new CatchStatement(catchParameter, this.visitBlock<MASK><NEW_LINE>return Collections.singletonList(configureAST(catchStatement, ctx));<NEW_LINE>}<NEW_LINE>// GRECLIPSE end<NEW_LINE>} | (ctx.block())); |
1,463,428 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String accountName, String poolName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (poolName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, poolName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); |
649,143 | public void marshall(ScalingPolicy scalingPolicy, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (scalingPolicy == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getPolicyARN(), POLICYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getServiceNamespace(), SERVICENAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getResourceId(), RESOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getScalableDimension(), SCALABLEDIMENSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getPolicyType(), POLICYTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getStepScalingPolicyConfiguration(), STEPSCALINGPOLICYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getTargetTrackingScalingPolicyConfiguration(), TARGETTRACKINGSCALINGPOLICYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getAlarms(), ALARMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingPolicy.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | scalingPolicy.getPolicyName(), POLICYNAME_BINDING); |
196,985 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Player damagedPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));<NEW_LINE>if (controller == null || damagedPlayer == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card card = damagedPlayer.getLibrary().getFromTop(game);<NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// move card to exile<NEW_LINE>controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));<NEW_LINE>// add the effects to the exiled card directly<NEW_LINE>// don't worry about land<NEW_LINE>if (card.getSpellAbility() != null) {<NEW_LINE>// the exiled card is independent and requires a new ability in case the Robber leaves the battlefield<NEW_LINE>// the exiled card can be cast throughout the entire game as long as the controller attacked with a rogue that turn<NEW_LINE>Ability copiedAbility = source.copy();<NEW_LINE>copiedAbility.newId();<NEW_LINE>copiedAbility.setSourceId(card.getId());<NEW_LINE>copiedAbility.setControllerId(source.getControllerId());<NEW_LINE>PlayFromNotOwnHandZoneTargetEffect playFromExile = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.EndOfGame);<NEW_LINE>YouMaySpendManaAsAnyColorToCastTargetEffect spendAnyMana = new YouMaySpendManaAsAnyColorToCastTargetEffect(Duration.EndOfGame);<NEW_LINE>ConditionalAsThoughEffect castOnlyIfARogueAttackedThisTurn = new ConditionalAsThoughEffect(playFromExile, new RogueAttackedThisTurnCondition(copiedAbility));<NEW_LINE>playFromExile.setTargetPointer(new FixedTarget(card, game));<NEW_LINE>spendAnyMana.setTargetPointer(new FixedTarget(card, game));<NEW_LINE>castOnlyIfARogueAttackedThisTurn.setTargetPointer(<MASK><NEW_LINE>game.addEffect(castOnlyIfARogueAttackedThisTurn, copiedAbility);<NEW_LINE>game.addEffect(spendAnyMana, copiedAbility);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | new FixedTarget(card, game)); |
526,113 | private String whereClauseFromFilter(SCIMFilter filter, Map<String, Object> values, AttributeNameMapper mapper, String paramPrefix) {<NEW_LINE>switch(filter.getFilterType()) {<NEW_LINE>case AND:<NEW_LINE>return "(" + whereClauseFromFilter(filter.getFilterComponents().get(0), values, mapper, paramPrefix) + " AND " + whereClauseFromFilter(filter.getFilterComponents().get(1), values, mapper, paramPrefix) + ")";<NEW_LINE>case OR:<NEW_LINE>return "(" + whereClauseFromFilter(filter.getFilterComponents().get(0), values, mapper, paramPrefix) + " OR " + whereClauseFromFilter(filter.getFilterComponents().get(1), values, mapper, paramPrefix) + ")";<NEW_LINE>case EQUALITY:<NEW_LINE>return comparisonClause(filter, "=", values, "", "", paramPrefix);<NEW_LINE>case CONTAINS:<NEW_LINE>return comparisonClause(filter, "LIKE", <MASK><NEW_LINE>case STARTS_WITH:<NEW_LINE>return comparisonClause(filter, "LIKE", values, "", "%", paramPrefix);<NEW_LINE>case PRESENCE:<NEW_LINE>return getAttributeName(filter, mapper) + " IS NOT NULL";<NEW_LINE>case GREATER_THAN:<NEW_LINE>return comparisonClause(filter, ">", values, "", "", paramPrefix);<NEW_LINE>case GREATER_OR_EQUAL:<NEW_LINE>return comparisonClause(filter, ">=", values, "", "", paramPrefix);<NEW_LINE>case LESS_THAN:<NEW_LINE>return comparisonClause(filter, "<", values, "", "", paramPrefix);<NEW_LINE>case LESS_OR_EQUAL:<NEW_LINE>return comparisonClause(filter, "<=", values, "", "", paramPrefix);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | values, "%", "%", paramPrefix); |
858,079 | protected void callSearchModules(SearchRequest searchRequest, List<IndexerSearchCacheEntry> indexersToSearch, SearchCacheEntry searchCacheEntry) {<NEW_LINE>Map<Indexer, List<IndexerSearchResult>> <MASK><NEW_LINE>for (IndexerSearchCacheEntry entry : indexersToSearch) {<NEW_LINE>indexerSearchResults.put(entry.getIndexer(), entry.getIndexerSearchResults());<NEW_LINE>}<NEW_LINE>ExecutorService executor = MdcThreadPoolExecutor.newWithInheritedMdc(indexersToSearch.size());<NEW_LINE>executors.add(executor);<NEW_LINE>List<Callable<IndexerSearchResult>> callables = getCallables(searchRequest, indexersToSearch);<NEW_LINE>try {<NEW_LINE>List<Future<IndexerSearchResult>> futures = executor.invokeAll(callables);<NEW_LINE>for (Future<IndexerSearchResult> future : futures) {<NEW_LINE>try {<NEW_LINE>IndexerSearchResult indexerSearchResult = future.get();<NEW_LINE>searchCacheEntry.getIndexerCacheEntries().get(indexerSearchResult.getIndexer()).addIndexerSearchResult(indexerSearchResult);<NEW_LINE>indexerSearchResults.put(indexerSearchResult.getIndexer(), searchCacheEntry.getIndexerCacheEntries().get(indexerSearchResult.getIndexer()).getIndexerSearchResults());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>logger.error("Unexpected error while searching", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("Unexpected error while searching", e);<NEW_LINE>} finally {<NEW_LINE>// Need to explicitly shutdown executor for threads to be closed<NEW_LINE>executor.shutdownNow();<NEW_LINE>executors.remove(executor);<NEW_LINE>}<NEW_LINE>handleIndexersWithFailedFutureExecutions(indexersToSearch, indexerSearchResults);<NEW_LINE>} | indexerSearchResults = new HashMap<>(); |
241,739 | private void patchConfigmapTrait(JSONArray traits, AppInstance appInstance, AppComponentInstance appComponentInstance) {<NEW_LINE>JSONArray targets = new JSONArray();<NEW_LINE>JSONObject configmaps = new JSONObject();<NEW_LINE>traits.add(JsonUtil.map("name", "configmap.trait.abm.io", "runtime", "pre", "spec", JsonUtil.map("targets", targets, "configmaps", configmaps)));<NEW_LINE><MASK><NEW_LINE>List<Config> configs = appComponentInstanceDetail.configs();<NEW_LINE>for (Config config : configs) {<NEW_LINE>String name = UuidUtil.shortUuid();<NEW_LINE>targets.add(JsonUtil.map("type", "volumeMount", "container", appComponentInstance.getName(), "mountPath", config.getParentPath(), "configmap", name));<NEW_LINE>configmaps.put(name, JsonUtil.map(config.getName(), config.getContent()));<NEW_LINE>}<NEW_LINE>List<Long> clusterResourceIdList = appInstance.detail().clusterResourceIdList();<NEW_LINE>if (CollectionUtils.isEmpty(clusterResourceIdList)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Long clusterResourceId : clusterResourceIdList) {<NEW_LINE>ClusterResource clusterResource = clusterResourceRepository.findFirstById(clusterResourceId);<NEW_LINE>JSONObject usageDetail = clusterResource.usageDetail();<NEW_LINE>String name = UuidUtil.shortUuid();<NEW_LINE>targets.add(JsonUtil.map("type", "env", "container", appComponentInstance.getName(), "configmap", name));<NEW_LINE>JSONObject configmap = new JSONObject();<NEW_LINE>configmaps.put(name, configmap);<NEW_LINE>for (String key : usageDetail.keySet()) {<NEW_LINE>Object value = usageDetail.get(key);<NEW_LINE>configmap.put(clusterResource.getName() + "_" + key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | AppComponentInstanceDetail appComponentInstanceDetail = appComponentInstance.detail(); |
173,000 | public void update(@Nonnull AnActionEvent e) {<NEW_LINE>Presentation presentation = e.getPresentation();<NEW_LINE>PluginDescriptor[] selection = getPluginTable().getSelectedObjects();<NEW_LINE>boolean enabled = (selection != null);<NEW_LINE>if (enabled) {<NEW_LINE>for (PluginDescriptor descr : selection) {<NEW_LINE>presentation.setTextValue(IdeLocalize.actionDownloadAndInstallPlugin());<NEW_LINE>presentation.setDescriptionValue(IdeLocalize.actionDownloadAndInstallPlugin());<NEW_LINE>enabled &= !ourInstallingNodes.contains(descr);<NEW_LINE>if (descr instanceof PluginNode) {<NEW_LINE>enabled &= !PluginManagerColumnInfo.isDownloaded(descr);<NEW_LINE>if (((PluginNode) descr).getStatus() == PluginNode.STATUS_INSTALLED) {<NEW_LINE>presentation.setTextValue(IdeLocalize.actionUpdatePlugin());<NEW_LINE>presentation.setDescriptionValue(IdeLocalize.actionUpdatePlugin());<NEW_LINE>enabled &= InstalledPluginsTableModel.<MASK><NEW_LINE>}<NEW_LINE>} else if (descr.isLoaded()) {<NEW_LINE>presentation.setTextValue(IdeLocalize.actionUpdatePlugin());<NEW_LINE>presentation.setDescriptionValue(IdeLocalize.actionUpdatePlugin());<NEW_LINE>PluginId id = descr.getPluginId();<NEW_LINE>enabled = enabled && InstalledPluginsTableModel.hasNewerVersion(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>presentation.setEnabled(enabled);<NEW_LINE>} | hasNewerVersion(descr.getPluginId()); |
580,183 | public SqlCall createCall(SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) {<NEW_LINE>switch(operands.length) {<NEW_LINE>case 1:<NEW_LINE>// This variant occurs when someone writes TRIM(string)<NEW_LINE>// as opposed to the sugared syntax TRIM(string FROM string).<NEW_LINE>operands = new SqlNode[] { SqlTrimFunction.Flag.BOTH.symbol(SqlParserPos.ZERO), SqlLiteral.createCharString(" ", <MASK><NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>assert operands[0] instanceof SqlLiteral && ((SqlLiteral) operands[0]).getValue() instanceof SqlTrimFunction.Flag;<NEW_LINE>if (operands[1] == null) {<NEW_LINE>operands[1] = SqlLiteral.createCharString(" ", pos);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("invalid operand count " + Arrays.toString(operands));<NEW_LINE>}<NEW_LINE>return super.createCall(functionQualifier, pos, operands);<NEW_LINE>} | pos), operands[0] }; |
1,006,354 | protected void configure() {<NEW_LINE>bind(ZookeeperCounterStorage.class).to(CounterStorage.class).in(Singleton.class);<NEW_LINE>bindFactory(ClockFactory.class).in(Singleton.class).to(Clock.class);<NEW_LINE>bind(InetAddressInstanceIdResolver.class).in(Singleton.class).to(InstanceIdResolver.class);<NEW_LINE>bindSingletonFactory(SchemaRepositoryClientFactory.class);<NEW_LINE>bindSingletonFactory(SchemaRepositoryInstanceResolverFactory.class);<NEW_LINE>bindSingletonFactory(RawSchemaClientFactory.class);<NEW_LINE>bindSingletonFactory(SchemaVersionsRepositoryFactory.class);<NEW_LINE>bindFactory(AvroCompiledSchemaRepositoryFactory.class).in(Singleton.class).to(new TypeLiteral<CompiledSchemaRepository<Schema>>() {<NEW_LINE>});<NEW_LINE>bindSingletonFactory(SchemaRepositoryFactory.class);<NEW_LINE>bindSingleton(CuratorClientFactory.class);<NEW_LINE>bindSingleton(HermesMetrics.class);<NEW_LINE>bindSingletonFactory(ConfigFactoryCreator.class);<NEW_LINE>bindSingleton(MessageContentWrapper.class);<NEW_LINE>bindSingleton(DeserializationMetrics.class);<NEW_LINE>bindSingleton(JsonMessageContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageAnySchemaVersionContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageSchemaIdAwareContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageHeaderSchemaVersionContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageHeaderSchemaIdContentWrapper.class);<NEW_LINE>bindSingleton(AvroMessageSchemaVersionTruncationContentWrapper.class);<NEW_LINE>bind(SchemaOnlineChecksWaitingRateLimiter.class).in(Singleton.class).to(SchemaOnlineChecksRateLimiter.class);<NEW_LINE>bindSingletonFactory(HermesCuratorClientFactory.class).named(CuratorType.HERMES);<NEW_LINE>bindSingletonFactory(GraphiteWebTargetFactory.class);<NEW_LINE>bindSingletonFactory(ObjectMapperFactory.class);<NEW_LINE>bindSingletonFactory(SharedCounterFactory.class);<NEW_LINE>bindSingletonFactory(MetricRegistryFactory.class);<NEW_LINE>bindSingletonFactory(ZookeeperPathsFactory.class);<NEW_LINE>bindSingletonFactory(GroupRepositoryFactory.class);<NEW_LINE>bindSingletonFactory(TopicRepositoryFactory.class);<NEW_LINE>bindSingletonFactory(SubscriptionRepositoryFactory.class);<NEW_LINE>bindSingletonFactory(SubscriptionOffsetChangeIndicatorFactory.class);<NEW_LINE>bindSingletonFactory(PathsCompilerFactory.class);<NEW_LINE>bindSingletonFactory(KafkaNamesMapperFactory.class);<NEW_LINE>bindSingletonFactory(MessagePreviewRepositoryFactory.class);<NEW_LINE>bindFactory(WorkloadConstraintsRepositoryFactory.class).in(Singleton.class).to(WorkloadConstraintsRepository.class);<NEW_LINE>bind(ZookeeperInternalNotificationBus.class<MASK><NEW_LINE>bindSingletonFactory(ModelAwareZookeeperNotifyingCacheFactory.class);<NEW_LINE>bindSingletonFactory(OAuthProviderRepositoryFactory.class);<NEW_LINE>} | ).to(InternalNotificationsBus.class); |
1,699,207 | /*<NEW_LINE>* Starts a new process tracing span and attaches the returned context to the EventData object for users.<NEW_LINE>*/<NEW_LINE>private Context startProcessTracingSpan(EventData eventData, String eventHubName, String fullyQualifiedNamespace) {<NEW_LINE>Object diagnosticId = eventData.getProperties().get(DIAGNOSTIC_ID_KEY);<NEW_LINE>if (tracerProvider == null || !tracerProvider.isEnabled()) {<NEW_LINE>return Context.NONE;<NEW_LINE>}<NEW_LINE>Context spanContext = Objects.isNull(diagnosticId) ? Context.NONE : tracerProvider.extractContext(diagnosticId.<MASK><NEW_LINE>spanContext = spanContext.addData(ENTITY_PATH_KEY, eventHubName).addData(HOST_NAME_KEY, fullyQualifiedNamespace).addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE);<NEW_LINE>spanContext = eventData.getEnqueuedTime() == null ? spanContext : spanContext.addData(MESSAGE_ENQUEUED_TIME, eventData.getEnqueuedTime().getEpochSecond());<NEW_LINE>return tracerProvider.startSpan(AZ_TRACING_SERVICE_NAME, spanContext, ProcessKind.PROCESS);<NEW_LINE>} | toString(), Context.NONE); |
1,436,600 | public void createMainThread(Meta meta) {<NEW_LINE>StaticObject systemThreadGroup = meta.java_lang_ThreadGroup.allocateInstance();<NEW_LINE>// private<NEW_LINE>// ThreadGroup()<NEW_LINE>meta.java_lang_ThreadGroup.lookupDeclaredMethod(Symbol.Name._init_, Symbol.Signature._void).invokeDirect(systemThreadGroup);<NEW_LINE>Thread hostThread = Thread.currentThread();<NEW_LINE>StaticObject mainThread = meta.java_lang_Thread.allocateInstance();<NEW_LINE>// Allow guest Thread.currentThread() to work.<NEW_LINE>meta.java_lang_Thread_priority.setInt(mainThread, Thread.NORM_PRIORITY);<NEW_LINE>meta.<MASK><NEW_LINE>mainThreadGroup = meta.java_lang_ThreadGroup.allocateInstance();<NEW_LINE>registerMainThread(hostThread, mainThread);<NEW_LINE>// Guest Thread.currentThread() must work as this point.<NEW_LINE>// public ThreadGroup(ThreadGroup parent, String name)<NEW_LINE>//<NEW_LINE>meta.java_lang_ThreadGroup.//<NEW_LINE>lookupDeclaredMethod(//<NEW_LINE>Symbol.Name._init_, Symbol.Signature._void_ThreadGroup_String).invokeDirect(mainThreadGroup, /* parent */<NEW_LINE>systemThreadGroup, /* name */<NEW_LINE>meta.toGuestString("main"));<NEW_LINE>// public Thread(ThreadGroup group, String name)<NEW_LINE>//<NEW_LINE>meta.java_lang_Thread.//<NEW_LINE>lookupDeclaredMethod(//<NEW_LINE>Symbol.Name._init_, Symbol.Signature._void_ThreadGroup_String).invokeDirect(mainThread, /* group */<NEW_LINE>mainThreadGroup, /* name */<NEW_LINE>meta.toGuestString("main"));<NEW_LINE>meta.java_lang_Thread_threadStatus.setInt(mainThread, State.RUNNABLE.value);<NEW_LINE>// Notify native backend about main thread.<NEW_LINE>getNativeAccess().prepareThread();<NEW_LINE>mainThreadCreated = true;<NEW_LINE>logger.fine(() -> {<NEW_LINE>String guestName = getThreadAccess().getThreadName(mainThread);<NEW_LINE>long guestId = getThreadAccess().getThreadId(mainThread);<NEW_LINE>return String.format("createMainThread: [HOST:%s, %d], [GUEST:%s, %d]", hostThread.getName(), hostThread.getId(), guestName, guestId);<NEW_LINE>});<NEW_LINE>} | HIDDEN_HOST_THREAD.setHiddenObject(mainThread, hostThread); |
518,829 | protected static String parseDataBytes(byte[] data, String typeStr, int index) {<NEW_LINE>try {<NEW_LINE>byte[] startBytes = subBytes(data, index * DATAWORD_UNIT_SIZE, DATAWORD_UNIT_SIZE);<NEW_LINE>Type type = basicType(typeStr);<NEW_LINE>if (type == Type.INT_NUMBER) {<NEW_LINE>return new BigInteger(startBytes).toString();<NEW_LINE>} else if (type == Type.BOOL) {<NEW_LINE>return String.valueOf(<MASK><NEW_LINE>} else if (type == Type.FIXED_BYTES) {<NEW_LINE>return Hex.toHexString(startBytes);<NEW_LINE>} else if (type == Type.ADDRESS) {<NEW_LINE>byte[] last20Bytes = Arrays.copyOfRange(startBytes, 12, startBytes.length);<NEW_LINE>return StringUtil.encode58Check(TransactionTrace.convertToTronAddress(last20Bytes));<NEW_LINE>} else if (type == Type.STRING || type == Type.BYTES) {<NEW_LINE>int start = intValueExact(startBytes);<NEW_LINE>byte[] lengthBytes = subBytes(data, start, DATAWORD_UNIT_SIZE);<NEW_LINE>// this length is byte count. no need X 32<NEW_LINE>int length = intValueExact(lengthBytes);<NEW_LINE>byte[] realBytes = length > 0 ? subBytes(data, start + DATAWORD_UNIT_SIZE, length) : new byte[0];<NEW_LINE>return type == Type.STRING ? new String(realBytes) : Hex.toHexString(realBytes);<NEW_LINE>}<NEW_LINE>} catch (OutputLengthException | ArithmeticException e) {<NEW_LINE>logger.debug("parseDataBytes ", e);<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("unsupported type:" + typeStr);<NEW_LINE>} | !DataWord.isZero(startBytes)); |
222,165 | final DescribeCertificatesResult executeDescribeCertificates(DescribeCertificatesRequest describeCertificatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCertificatesRequest> request = null;<NEW_LINE>Response<DescribeCertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCertificatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCertificatesRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCertificates");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCertificatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCertificatesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,001,598 | protected void doOnMatch(RelOptRuleCall call, DrillLimitRel limitRel, DrillScanRel scanRel, DrillProjectRel projectRel) {<NEW_LINE>try {<NEW_LINE>final int rowCountRequested = (int) limitRel.estimateRowCount(limitRel.getCluster().getMetadataQuery());<NEW_LINE>final GroupScan newGroupScan = scanRel.<MASK><NEW_LINE>if (newGroupScan == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DrillScanRel newScanRel = new DrillScanRel(scanRel.getCluster(), scanRel.getTraitSet(), scanRel.getTable(), newGroupScan, scanRel.getRowType(), scanRel.getColumns(), scanRel.partitionFilterPushdown());<NEW_LINE>final RelNode newLimit;<NEW_LINE>if (projectRel != null) {<NEW_LINE>final RelNode newProject = projectRel.copy(projectRel.getTraitSet(), ImmutableList.of(newScanRel));<NEW_LINE>newLimit = limitRel.copy(limitRel.getTraitSet(), ImmutableList.of(newProject));<NEW_LINE>} else {<NEW_LINE>newLimit = limitRel.copy(limitRel.getTraitSet(), ImmutableList.of(newScanRel));<NEW_LINE>}<NEW_LINE>call.transformTo(newLimit);<NEW_LINE>logger.debug("Converted to a new DrillScanRel" + newScanRel.getGroupScan());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Exception while using the pruned partitions.", e);<NEW_LINE>}<NEW_LINE>} | getGroupScan().applyLimit(rowCountRequested); |
1,370,309 | private static Pair<String, @NullableType List<byte[]>> parseFourCcPrivate(ParsableByteArray buffer) throws ParserException {<NEW_LINE>try {<NEW_LINE>// size(4), width(4), height(4), planes(2), bitcount(2).<NEW_LINE>buffer.skipBytes(16);<NEW_LINE>long compression = buffer.readLittleEndianUnsignedInt();<NEW_LINE>if (compression == FOURCC_COMPRESSION_DIVX) {<NEW_LINE>return new Pair<>(MimeTypes.VIDEO_DIVX, null);<NEW_LINE>} else if (compression == FOURCC_COMPRESSION_H263) {<NEW_LINE>return new Pair<>(MimeTypes.VIDEO_H263, null);<NEW_LINE>} else if (compression == FOURCC_COMPRESSION_VC1) {<NEW_LINE>// Search for the initialization data from the end of the BITMAPINFOHEADER. The last 20<NEW_LINE>// bytes of which are: sizeImage(4), xPel/m (4), yPel/m (4), clrUsed(4), clrImportant(4).<NEW_LINE>int startOffset = buffer.getPosition() + 20;<NEW_LINE>byte[] bufferData = buffer.getData();<NEW_LINE>for (int offset = startOffset; offset < bufferData.length - 4; offset++) {<NEW_LINE>if (bufferData[offset] == 0x00 && bufferData[offset + 1] == 0x00 && bufferData[offset + 2] == 0x01 && bufferData[offset + 3] == 0x0F) {<NEW_LINE>// We've found the initialization data.<NEW_LINE>byte[] initializationData = Arrays.copyOfRange(bufferData, offset, bufferData.length);<NEW_LINE>return new Pair<>(MimeTypes.VIDEO_VC1, Collections.singletonList(initializationData));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ParserException.createForMalformedContainer("Failed to find FourCC VC1 initialization data", /* cause= */<NEW_LINE>null);<NEW_LINE>}<NEW_LINE>} catch (ArrayIndexOutOfBoundsException e) {<NEW_LINE>throw ParserException.createForMalformedContainer("Error parsing FourCC private data", /* cause= */<NEW_LINE>null);<NEW_LINE>}<NEW_LINE>Log.w(TAG, "Unknown FourCC. Setting mimeType to " + MimeTypes.VIDEO_UNKNOWN);<NEW_LINE>return new Pair<<MASK><NEW_LINE>} | >(MimeTypes.VIDEO_UNKNOWN, null); |
229,544 | public INDArray[] exec(CustomOp op, OpContext context) {<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>long st = profilingConfigurableHookIn(op, context);<NEW_LINE>val ctx = AtomicAllocator.getInstance().getDeviceContext();<NEW_LINE>val status = nativeOps.execCustomOp2(null, op.opHash(), context.contextPointer());<NEW_LINE>if (nativeOps.lastErrorCode() != 0)<NEW_LINE>throw new RuntimeException(nativeOps.lastErrorMessage());<NEW_LINE>if (status != 0)<NEW_LINE>throw new RuntimeException("Op [" + op.opName() + "] execution failed");<NEW_LINE>// check if input && output needs update<NEW_LINE>for (val in : op.inputArguments()) {<NEW_LINE>if (!in.isEmpty())<NEW_LINE>((BaseCudaDataBuffer) in.data()).actualizePointerAndIndexer();<NEW_LINE>}<NEW_LINE>for (val out : op.outputArguments()) {<NEW_LINE>if (!out.isEmpty()) {<NEW_LINE>((BaseCudaDataBuffer) out.data()).actualizePointerAndIndexer();<NEW_LINE>}<NEW_LINE>AtomicAllocator.getInstance().tickDeviceWrite(out);<NEW_LINE>}<NEW_LINE>profilingConfigurableHookOut(op, context, st);<NEW_LINE>if (context.getOutputArrays().isEmpty())<NEW_LINE>return new INDArray[0];<NEW_LINE>else<NEW_LINE>return context.getOutputArrays().toArray(new INDArray[context.getOutputArrays<MASK><NEW_LINE>} | ().size()]); |
1,343,232 | // LongFloatVector<NEW_LINE>private static void serializeLongIntVector(DataOutputStream out, LongIntVector vector) throws IOException {<NEW_LINE>LongIntVectorStorage storage = vector.getStorage();<NEW_LINE>if (storage.isSparse()) {<NEW_LINE>serializeInt(out, SPARSE_STORAGE_TYPE);<NEW_LINE>serializeInt(<MASK><NEW_LINE>ObjectIterator<Long2IntMap.Entry> iter = storage.entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2IntMap.Entry e = iter.next();<NEW_LINE>serializeLong(out, e.getLongKey());<NEW_LINE>serializeFloat(out, e.getIntValue());<NEW_LINE>}<NEW_LINE>} else if (storage.isSorted()) {<NEW_LINE>serializeInt(out, SORTED_STORAGE_TYPE);<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>int[] values = vector.getStorage().getValues();<NEW_LINE>serializeLongs(out, indices);<NEW_LINE>serializeInts(out, values);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Unsupport storage type " + vector.getStorage().getClass());<NEW_LINE>}<NEW_LINE>} | out, storage.size()); |
873,714 | private void deleteVolume(final CascadeAction action, final Completion completion) {<NEW_LINE>final List<VolumeDeletionStruct> volumes = volumesFromAction(action);<NEW_LINE>if (volumes == null || volumes.isEmpty()) {<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<VolumeDeletionMsg> msgs <MASK><NEW_LINE>for (VolumeDeletionStruct vol : volumes) {<NEW_LINE>VolumeDeletionMsg msg = new VolumeDeletionMsg();<NEW_LINE>msg.setDetachBeforeDeleting(vol.isDetachBeforeDeleting());<NEW_LINE>msg.setForceDelete(action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE));<NEW_LINE>msg.setVolumeUuid(vol.getInventory().getUuid());<NEW_LINE>msg.setDeletionPolicy(vol.getDeletionPolicy());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, VolumeConstant.SERVICE_ID, vol.getInventory().getUuid());<NEW_LINE>msgs.add(msg);<NEW_LINE>}<NEW_LINE>bus.send(msgs, 10, new CloudBusListCallBack(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(List<MessageReply> replies) {<NEW_LINE>if (!action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE)) {<NEW_LINE>for (MessageReply r : replies) {<NEW_LINE>if (!r.isSuccess()) {<NEW_LINE>completion.fail(r.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = new ArrayList<VolumeDeletionMsg>(); |
209,175 | public void visit(OWLSubClassOfAxiom axiom) {<NEW_LINE>if (axiom.getSubClass().isAnonymous()) {<NEW_LINE>// Not in our results because we only want to return class names<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Example:<NEW_LINE>// If searching for subs of B, candidates are:<NEW_LINE>// SubClassOf(A B)<NEW_LINE>// SubClassOf(A And(B ...))<NEW_LINE>if (checker.containsConjunct(currentParentClass, axiom.getSuperClass())) {<NEW_LINE>results.add(axiom.getSubClass().asOWLClass());<NEW_LINE>} else if (!relationships.isEmpty()) {<NEW_LINE>// SubClassOf(A ObjectSomeValuesFrom(p B))<NEW_LINE>axiom.getSuperClass().asConjunctSet().stream().filter(ce -> ce instanceof OWLObjectSomeValuesFrom).map(ce -> ((OWLObjectSomeValuesFrom) ce)).filter(svf -> !svf.getProperty().isAnonymous()).filter(svf -> svf.getFiller().equals(currentParentClass)).filter(svf -> relationships.contains(svf.getProperty().asOWLObjectProperty())).findFirst().ifPresent(c -> {<NEW_LINE>OWLClass child = axiom<MASK><NEW_LINE>results.add(child);<NEW_LINE>child2RelationshipMap.put(child, c.getProperty());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | .getSubClass().asOWLClass(); |
1,053,705 | private static EnumElement toEnum(EnumDescriptorProto ed) {<NEW_LINE>String name = ed.getName();<NEW_LINE>log.trace("*** enum name: {}", name);<NEW_LINE>ImmutableList.Builder<EnumConstantElement> constants = ImmutableList.builder();<NEW_LINE>for (EnumValueDescriptorProto ev : ed.getValueList()) {<NEW_LINE>ImmutableList.Builder<OptionElement<MASK><NEW_LINE>if (ev.getOptions().hasDeprecated()) {<NEW_LINE>OptionElement option = new OptionElement(DEPRECATED, Kind.BOOLEAN, ev.getOptions().getDeprecated(), false);<NEW_LINE>options.add(option);<NEW_LINE>}<NEW_LINE>if (ev.getOptions().hasExtension(MetaProto.enumValueMeta)) {<NEW_LINE>Meta meta = ev.getOptions().getExtension(MetaProto.enumValueMeta);<NEW_LINE>OptionElement option = toOption(CONFLUENT_ENUM_VALUE_META, meta);<NEW_LINE>if (option != null) {<NEW_LINE>options.add(option);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>constants.add(new EnumConstantElement(DEFAULT_LOCATION, ev.getName(), ev.getNumber(), "", options.build()));<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<OptionElement> options = ImmutableList.builder();<NEW_LINE>if (ed.getOptions().hasAllowAlias()) {<NEW_LINE>OptionElement option = new OptionElement(ALLOW_ALIAS, Kind.BOOLEAN, ed.getOptions().getAllowAlias(), false);<NEW_LINE>options.add(option);<NEW_LINE>}<NEW_LINE>if (ed.getOptions().hasDeprecated()) {<NEW_LINE>OptionElement option = new OptionElement(DEPRECATED, Kind.BOOLEAN, ed.getOptions().getDeprecated(), false);<NEW_LINE>options.add(option);<NEW_LINE>}<NEW_LINE>if (ed.getOptions().hasExtension(MetaProto.enumMeta)) {<NEW_LINE>Meta meta = ed.getOptions().getExtension(MetaProto.enumMeta);<NEW_LINE>OptionElement option = toOption(CONFLUENT_ENUM_META, meta);<NEW_LINE>if (option != null) {<NEW_LINE>options.add(option);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new EnumElement(DEFAULT_LOCATION, name, "", options.build(), constants.build());<NEW_LINE>} | > options = ImmutableList.builder(); |
1,658,535 | public Status update(String table, String key, Map<String, ByteIterator> values) {<NEW_LINE>try {<NEW_LINE>Set<String> fields = values.keySet();<NEW_LINE>PreparedStatement stmt = updateStmts.get(fields);<NEW_LINE>// Prepare statement on demand<NEW_LINE>if (stmt == null) {<NEW_LINE>Update updateStmt = QueryBuilder.update(table);<NEW_LINE>// Add fields<NEW_LINE>for (String field : fields) {<NEW_LINE>updateStmt.with(QueryBuilder.set(field, QueryBuilder.bindMarker()));<NEW_LINE>}<NEW_LINE>// Add key<NEW_LINE>updateStmt.where(QueryBuilder.eq(YCSB_KEY, QueryBuilder.bindMarker()));<NEW_LINE>stmt = session.prepare(updateStmt);<NEW_LINE>stmt.setConsistencyLevel(writeConsistencyLevel);<NEW_LINE>if (trace) {<NEW_LINE>stmt.enableTracing();<NEW_LINE>}<NEW_LINE>PreparedStatement prevStmt = updateStmts.putIfAbsent(new HashSet(fields), stmt);<NEW_LINE>if (prevStmt != null) {<NEW_LINE>stmt = prevStmt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug(stmt.getQueryString());<NEW_LINE>logger.debug("key = {}", key);<NEW_LINE>for (Map.Entry<String, ByteIterator> entry : values.entrySet()) {<NEW_LINE>logger.debug("{} = {}", entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add fields<NEW_LINE><MASK><NEW_LINE>BoundStatement boundStmt = stmt.bind();<NEW_LINE>for (int i = 0; i < vars.size() - 1; i++) {<NEW_LINE>boundStmt.setString(i, values.get(vars.getName(i)).toString());<NEW_LINE>}<NEW_LINE>// Add key<NEW_LINE>boundStmt.setString(vars.size() - 1, key);<NEW_LINE>session.execute(boundStmt);<NEW_LINE>return Status.OK;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(MessageFormatter.format("Error updating key: {}", key).getMessage(), e);<NEW_LINE>}<NEW_LINE>return Status.ERROR;<NEW_LINE>} | ColumnDefinitions vars = stmt.getVariables(); |
1,549,134 | @Blocking<NEW_LINE>@Produces(MediaType.TEXT_HTML)<NEW_LINE>@ApiOperation(value = "Fortunes postgres endpoint", httpMethod = "GET")<NEW_LINE>public void fortunesPostgres(HttpServerExchange exchange) throws Exception {<NEW_LINE>List<Fortune> fortunes = new ArrayList<>();<NEW_LINE>try (final Connection connection = postgresService.getConnection()) {<NEW_LINE>try (PreparedStatement statement = connection.prepareStatement("SELECT * FROM Fortune")) {<NEW_LINE>try (ResultSet resultSet = statement.executeQuery()) {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>int id = resultSet.getInt("id");<NEW_LINE>String <MASK><NEW_LINE>fortunes.add(new Fortune(id, msg));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fortunes.add(new Fortune(0, "Additional fortune added at request time."));<NEW_LINE>fortunes.sort(null);<NEW_LINE>final String render = views.Fortunes.template(fortunes).render(StringBuilderOutput.FACTORY).toString();<NEW_LINE>exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, HTML_UTF8_TYPE);<NEW_LINE>exchange.getResponseSender().send(render);<NEW_LINE>} | msg = resultSet.getString("message"); |
557,372 | private void cmd_report() {<NEW_LINE>log.info("");<NEW_LINE>if (!MRole.getDefault().isCanReport(currentTab.getAD_Table_ID())) {<NEW_LINE>ADialog.error(m_curWindowNo, this, "AccessCannotReport");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cmd_save(false);<NEW_LINE>// Query<NEW_LINE>MQuery query = new MQuery(currentTab.getTableName());<NEW_LINE>// Link for detail records<NEW_LINE>String queryColumn = currentTab.getLinkColumnName();<NEW_LINE>// Current row otherwise<NEW_LINE>if (queryColumn.length() == 0)<NEW_LINE>queryColumn = currentTab.getKeyColumnName();<NEW_LINE>// Find display<NEW_LINE>String infoName = null;<NEW_LINE>String infoDisplay = null;<NEW_LINE>for (int i = 0; i < currentTab.getFieldCount(); i++) {<NEW_LINE>GridField <MASK><NEW_LINE>if (field.isKey())<NEW_LINE>infoName = field.getHeader();<NEW_LINE>if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo")) && field.getValue() != null)<NEW_LINE>infoDisplay = field.getValue().toString();<NEW_LINE>if (infoName != null && infoDisplay != null)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (queryColumn.length() != 0) {<NEW_LINE>if (queryColumn.endsWith("_ID"))<NEW_LINE>query.addRestriction(queryColumn, MQuery.EQUAL, new Integer(Env.getContextAsInt(ctx, m_curWindowNo, queryColumn)), infoName, infoDisplay);<NEW_LINE>else<NEW_LINE>query.addRestriction(queryColumn, MQuery.EQUAL, Env.getContext(ctx, m_curWindowNo, queryColumn), infoName, infoDisplay);<NEW_LINE>}<NEW_LINE>new AReport(currentTab.getAD_Table_ID(), aReport.getButton(), query, this, m_curWindowNo, currentTab.getWhereExtended());<NEW_LINE>} | field = currentTab.getField(i); |
198,579 | public static void validateRelationship(Relationship relationship) throws SubjectAreaFVTCheckedException {<NEW_LINE>if (relationship == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected relationship to exist, ");<NEW_LINE>}<NEW_LINE>if (relationship.getName() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected relationship to have a name, ");<NEW_LINE>}<NEW_LINE>// Unknown<NEW_LINE>if (relationship.getName().equals("Unknown")) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected relationship to have a known name, ");<NEW_LINE>}<NEW_LINE>if (relationship.getSystemAttributes() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + "'s system attributes to exist, ");<NEW_LINE>}<NEW_LINE>if (relationship.getSystemAttributes().getGUID() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + "'s userId to exist, ");<NEW_LINE>}<NEW_LINE>if (relationship.isReadOnly()) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " not to be readonly");<NEW_LINE>}<NEW_LINE>if (relationship.getEnd1() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " end1 to have a value");<NEW_LINE>}<NEW_LINE>if (relationship.getEnd1().getNodeQualifiedName() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " end1 qualified name to have a value");<NEW_LINE>}<NEW_LINE>if (relationship.getEnd1().getNodeGuid() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " end1 guid to have a value");<NEW_LINE>}<NEW_LINE>if (relationship.getEnd2() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " end2 to have a value");<NEW_LINE>}<NEW_LINE>if (relationship.getEnd2().getNodeQualifiedName() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + <MASK><NEW_LINE>}<NEW_LINE>if (relationship.getEnd2().getNodeGuid() == null) {<NEW_LINE>// error<NEW_LINE>throw new SubjectAreaFVTCheckedException("ERROR: Expected " + relationship.getName() + " end2 guid to have a value");<NEW_LINE>}<NEW_LINE>} | relationship.getName() + " end2 qualified name to have a value"); |
1,317,348 | public void subtractTo(GradPair gp, int index) {<NEW_LINE>if (numClass == 2 || multiClassMultiTree) {<NEW_LINE>((BinaryGradPair) gp).subtractBy(gradients[index], hessians[index]);<NEW_LINE>} else if (!fullHessian) {<NEW_LINE>MultiGradPair multi = (MultiGradPair) gp;<NEW_LINE>double[] grad = multi.getGrad();<NEW_LINE>double[] hess = multi.getHess();<NEW_LINE>int offset = index * numClass;<NEW_LINE>for (int i = 0; i < numClass; i++) {<NEW_LINE>grad[i<MASK><NEW_LINE>hess[i] -= hessians[offset + i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MultiGradPair multi = (MultiGradPair) gp;<NEW_LINE>double[] grad = multi.getGrad();<NEW_LINE>double[] hess = multi.getHess();<NEW_LINE>int gradOffset = index * grad.length;<NEW_LINE>int hessOffset = index * hess.length;<NEW_LINE>for (int i = 0; i < grad.length; i++) {<NEW_LINE>grad[i] -= gradients[gradOffset + i];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < hess.length; i++) {<NEW_LINE>hess[i] -= hessians[hessOffset + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] -= gradients[offset + i]; |
331,744 | void startRetryTask() {<NEW_LINE>if (retryScheduledFuture == null) {<NEW_LINE>synchronized (retryCounter) {<NEW_LINE>if (retryScheduledFuture == null) {<NEW_LINE>retryScheduledFuture = retryExecutor.scheduleWithFixedDelay(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// Check and connect to the metadata<NEW_LINE>try {<NEW_LINE>int times = retryCounter.incrementAndGet();<NEW_LINE>logger.info("start to retry task for metadata report. retry times:" + times);<NEW_LINE>if (retry() && times > retryTimesIfNonFail) {<NEW_LINE>cancelRetryTask();<NEW_LINE>}<NEW_LINE>if (times > retryLimit) {<NEW_LINE>cancelRetryTask();<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// Defensive fault tolerance<NEW_LINE>logger.error("Unexpected error occur at failed retry, cause: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 500, retryPeriod, TimeUnit.MILLISECONDS); |
358,904 | public static void main(String[] args) {<NEW_LINE>FlowNetwork flowNetwork = new FlowNetwork(7);<NEW_LINE>// Path 1 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge(0, 1, 5));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(1, 4, 4));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(4, 6, 3));<NEW_LINE>// Path 2 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge(0, 2, 8));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(2, 5, 10));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(5, 6, 7));<NEW_LINE>// Path 3 from source to target<NEW_LINE>flowNetwork.addEdge(new FlowEdge(0, 3, 2));<NEW_LINE>flowNetwork.addEdge(new FlowEdge(3, 6, 2));<NEW_LINE>int source = 0;<NEW_LINE>int target = 6;<NEW_LINE>double maxflow = new Exercise37().getMaxFlow(flowNetwork, source, target);<NEW_LINE><MASK><NEW_LINE>StdOut.println("Expected: 12.0");<NEW_LINE>} | StdOut.println("Max flow: " + maxflow); |
9,087 | public void execute(Arguments arguments, ClassLoader classLoader) {<NEW_LINE>List<String> oldModels = arguments.repeatedParameter("--old");<NEW_LINE>LOGGER.info(String.format("Setting 'old' Smithy models: %s", String.join(" ", oldModels)));<NEW_LINE>List<String> newModels = arguments.repeatedParameter("--new");<NEW_LINE>LOGGER.info(String.format("Setting 'new' Smithy models: %s", String.join(" ", newModels)));<NEW_LINE>ModelAssembler assembler = CommandUtils.createModelAssembler(classLoader);<NEW_LINE>Model oldModel = loadModel("old", assembler, oldModels);<NEW_LINE>assembler.reset();<NEW_LINE>Model newModel = loadModel("new", assembler, newModels);<NEW_LINE>List<ValidationEvent> events = ModelDiff.compare(classLoader, oldModel, newModel);<NEW_LINE>boolean hasError = events.stream().anyMatch(event -> event.getSeverity() == Severity.ERROR);<NEW_LINE>boolean hasDanger = events.stream().anyMatch(event -> event.getSeverity() == Severity.DANGER);<NEW_LINE>boolean hasWarning = events.stream().anyMatch(event -> event.getSeverity() == Severity.DANGER);<NEW_LINE>String result = events.stream().map(ValidationEvent::toString).collect<MASK><NEW_LINE>if (hasError) {<NEW_LINE>throw new CliError(String.format("Model diff detected errors: %n%s", result));<NEW_LINE>}<NEW_LINE>if (!result.isEmpty()) {<NEW_LINE>Cli.stdout(result);<NEW_LINE>}<NEW_LINE>if (hasDanger) {<NEW_LINE>Colors.BRIGHT_BOLD_RED.out("Smithy diff detected danger");<NEW_LINE>} else if (hasWarning) {<NEW_LINE>Colors.BRIGHT_BOLD_YELLOW.out("Smithy diff complete with warnings");<NEW_LINE>} else {<NEW_LINE>Colors.BRIGHT_BOLD_GREEN.out("Smithy diff complete");<NEW_LINE>}<NEW_LINE>} | (Collectors.joining("\n")); |
1,124,675 | public PercentPair unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PercentPair percentPair = new PercentPair();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("percent", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>percentPair.setPercent(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>percentPair.setValue(context.getUnmarshaller(Double.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 percentPair;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
923,010 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>View view = emc.find(id, View.class);<NEW_LINE>if (null == view) {<NEW_LINE>throw new ExceptionViewNotExist(id);<NEW_LINE>}<NEW_LINE>Query query = emc.find(view.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionQueryNotExist(view.getQuery());<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getDistinguishedName(), query.getName());<NEW_LINE>}<NEW_LINE>switch(StringUtils.trimToEmpty(wi.getType())) {<NEW_LINE>case View.TYPE_CMS:<NEW_LINE>// view.setData(gson.toJson(gson.fromJson(view.getData(), CmsPlan.class)));<NEW_LINE>break;<NEW_LINE>case View.TYPE_PROCESSPLATFORM:<NEW_LINE>// view.setData(gson.toJson(gson.fromJson(view.getData(), ProcessPlatformPlan.class)));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ExceptionTypeValue(wi.getType());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(View.class);<NEW_LINE>Wi.copier.copy(wi, view);<NEW_LINE>view.setQuery(query.getId());<NEW_LINE>if (StringUtils.isNotEmpty(view.getName()) && (!this.idleName(business, view))) {<NEW_LINE>throw new ExceptionNameExist(view.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(view.getAlias()) && (!this.idleAlias(business, view))) {<NEW_LINE>throw new ExceptionAliasExist(view.getName());<NEW_LINE>}<NEW_LINE>emc.<MASK><NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(View.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(view.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | check(view, CheckPersistType.all); |
667,450 | static boolean isCodePointCJK(int codePoint) {<NEW_LINE>Character.UnicodeBlock unicodeBlock = <MASK><NEW_LINE>return // The magic number here is the separating index between full-width and half-width<NEW_LINE>(codePoint == 0x00b1 || unicodeBlock == Character.UnicodeBlock.HIRAGANA) || (unicodeBlock == Character.UnicodeBlock.KATAKANA) || (unicodeBlock == Character.UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS) || (unicodeBlock == Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO) || (unicodeBlock == Character.UnicodeBlock.HANGUL_JAMO) || (unicodeBlock == Character.UnicodeBlock.HANGUL_SYLLABLES) || (unicodeBlock == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS) || (unicodeBlock == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A) || (unicodeBlock == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B) || (unicodeBlock == Character.UnicodeBlock.CJK_COMPATIBILITY_FORMS) || (unicodeBlock == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS) || (unicodeBlock == Character.UnicodeBlock.CJK_RADICALS_SUPPLEMENT) || (unicodeBlock == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION) || (unicodeBlock == Character.UnicodeBlock.ENCLOSED_CJK_LETTERS_AND_MONTHS) || (unicodeBlock == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS && codePoint < 0xFF61);<NEW_LINE>} | Character.UnicodeBlock.of(codePoint); |
1,479,476 | private static void tryAssertion18(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 100L, 25d }, { "MSFT", 5000L, 9d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 100L, 75d }, { "MSFT", 5000L, 9d }, { "IBM", 150L, 75d }, { "YAH", 10000L, 1d }, { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsert(3200, 0, new Object[][] { { "IBM", 100L, 75d }, { "MSFT", 5000L, 9d }, { "IBM", 150L, 75d }, { "YAH", 10000L, 1d }, { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "IBM", 100L, 75d }, { "MSFT", 5000L, 9d }, { "IBM", 150L, 75d }, { "YAH", 10000L, 3d }, { "IBM", 155L, 75d }, { "YAH", 11000L, 3d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 100L, 97d }, { "MSFT", 5000L, 9d }, { "IBM", 150L, 97d }, { "YAH", 10000L, 6d }, { "IBM", 155L, 97d }, { "YAH", 11000L, 6d }, { "IBM", 150L, 97d }, { "YAH", 11500L, 6d } });<NEW_LINE>expected.addResultInsert(6200, 0, new Object[][] { { "MSFT", 5000L, 9d }, { "IBM", 150L, 72d }, { "YAH", 10000L, 7d }, { "IBM", 155L, 72d }, { "YAH", 11000L, 7d }, { "IBM", 150L, 72d }, { "YAH", 11500L, 7d }, { "YAH", 10500L, 7d } });<NEW_LINE>expected.addResultInsert(7200, 0, new Object[][] { { "IBM", 155L, 48d }, { "YAH", 11000L, 6d }, { "IBM", 150L, 48d }, { "YAH", 11500L, 6d }, { "YAH", 10500L, 6d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE><MASK><NEW_LINE>} | execution.execute(false, milestone); |
1,780,281 | public ListStreamsResult listStreams(ListStreamsRequest listStreamsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listStreamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListStreamsRequest> request = null;<NEW_LINE>Response<ListStreamsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListStreamsRequestMarshaller().marshall(listStreamsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListStreamsResult, JsonUnmarshallerContext> unmarshaller = new ListStreamsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListStreamsResult> responseHandler = new JsonResponseHandler<ListStreamsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
1,287,115 | private void drawText(Canvas canvas) {<NEW_LINE>if (this.text.length() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.mode == Mode.TEXT) {<NEW_LINE>this.textX = this.startX;<NEW_LINE>this.textY = this.startY;<NEW_LINE>this.textPaint = this.createPaint();<NEW_LINE>}<NEW_LINE>float textX = this.textX;<NEW_LINE>float textY = this.textY;<NEW_LINE>Paint paintForMeasureText = new Paint();<NEW_LINE>// Line break automatically<NEW_LINE>float textLength = paintForMeasureText.measureText(this.text);<NEW_LINE>float lengthOfChar = textLength / (float) this.text.length();<NEW_LINE>// text-align : right<NEW_LINE>float restWidth = this.canvas.getWidth() - textX;<NEW_LINE>// The number of characters at 1 line<NEW_LINE>int numChars = (lengthOfChar <= 0) ? 1 : (int) Math.floor(restWidth / lengthOfChar);<NEW_LINE>int modNumChars = Math.max(numChars, 1);<NEW_LINE>float y = textY;<NEW_LINE>for (int i = 0, len = this.text.length(); i < len; i += modNumChars) {<NEW_LINE>String substring = "";<NEW_LINE>if ((i + modNumChars) < len) {<NEW_LINE>substring = this.text.substring(<MASK><NEW_LINE>} else {<NEW_LINE>substring = this.text.substring(i, len);<NEW_LINE>}<NEW_LINE>y += this.fontSize;<NEW_LINE>canvas.drawText(substring, textX, y, this.textPaint);<NEW_LINE>}<NEW_LINE>} | i, (i + modNumChars)); |
545,350 | protected void configure() {<NEW_LINE>bind(ExtensionBootstrap.class).to(ExtensionBootstrapImpl.class);<NEW_LINE>bind(ExtensionStaticInitializer.class).to(ExtensionStaticInitializerImpl.class);<NEW_LINE>bind(HiveMQExtensionFactory.class).to(HiveMQExtensionFactoryImpl.class);<NEW_LINE>bind(ExtensionLoader.class).to(ExtensionLoaderImpl.class);<NEW_LINE>bind(ExtensionServicesDependencies.class).to(ExtensionServicesDependenciesImpl.class);<NEW_LINE>bind(ExtensionLifecycleHandler.class).to(ExtensionLifecycleHandlerImpl.class);<NEW_LINE>bind(Authenticators.class).to(AuthenticatorsImpl.class);<NEW_LINE>bind(Authorizers.class<MASK><NEW_LINE>bind(SecurityRegistry.class).to(SecurityRegistryImpl.class);<NEW_LINE>bind(ExecutorService.class).annotatedWith(PluginStartStop.class).toProvider(ExtensionStartStopExecutorProvider.class).in(LazySingleton.class);<NEW_LINE>bind(PluginTaskExecutorService.class).to(PluginTaskExecutorServiceImpl.class);<NEW_LINE>bind(PluginOutPutAsyncer.class).to(PluginOutputAsyncerImpl.class);<NEW_LINE>bind(InitializerRegistry.class).to(InitializerRegistryImpl.class);<NEW_LINE>bind(Initializers.class).to(InitializersImpl.class).in(LazySingleton.class);<NEW_LINE>bind(ServerInformation.class).to(ServerInformationImpl.class).in(LazySingleton.class);<NEW_LINE>bind(AtomicLong.class).annotatedWith(PluginTaskQueue.class).toInstance(new AtomicLong(0));<NEW_LINE>bind(RetainedMessageStore.class).to(RetainedMessageStoreImpl.class).in(LazySingleton.class);<NEW_LINE>bind(ClientService.class).to(ClientServiceImpl.class).in(LazySingleton.class);<NEW_LINE>bind(RetainedPublishBuilder.class).to(RetainedPublishBuilderImpl.class);<NEW_LINE>bind(SubscriptionStore.class).to(SubscriptionStoreImpl.class).in(LazySingleton.class);<NEW_LINE>bind(TopicSubscriptionBuilder.class).to(TopicSubscriptionBuilderImpl.class);<NEW_LINE>bind(TopicPermissionBuilder.class).to(TopicPermissionBuilderImpl.class);<NEW_LINE>bind(ExtensionBuilderDependencies.class).to(ExtensionBuilderDependenciesImpl.class);<NEW_LINE>bind(PublishService.class).to(PublishServiceImpl.class).in(LazySingleton.class);<NEW_LINE>bind(PublishBuilder.class).to(PublishBuilderImpl.class);<NEW_LINE>bind(WillPublishBuilder.class).to(WillPublishBuilderImpl.class);<NEW_LINE>bind(EventRegistry.class).to(EventRegistryImpl.class).in(Singleton.class);<NEW_LINE>bind(LifecycleEventListeners.class).to(LifecycleEventListenersImpl.class).in(LazySingleton.class);<NEW_LINE>bind(ClusterService.class).to(ClusterServiceNoopImpl.class).in(LazySingleton.class);<NEW_LINE>bind(PluginAuthorizerService.class).to(PluginAuthorizerServiceImpl.class);<NEW_LINE>bind(PluginAuthenticatorService.class).to(PluginAuthenticatorServiceImpl.class);<NEW_LINE>bind(GlobalInterceptorRegistry.class).to(GlobalInterceptorRegistryImpl.class).in(LazySingleton.class);<NEW_LINE>bind(Interceptors.class).to(InterceptorsImpl.class).in(LazySingleton.class);<NEW_LINE>bind(AdminService.class).to(AdminServiceImpl.class).in(LazySingleton.class);<NEW_LINE>} | ).to(AuthorizersImpl.class); |
1,160,658 | public static DescribeSuspEventsResponse unmarshall(DescribeSuspEventsResponse describeSuspEventsResponse, UnmarshallerContext context) {<NEW_LINE>describeSuspEventsResponse.setRequestId(context.stringValue("DescribeSuspEventsResponse.RequestId"));<NEW_LINE>describeSuspEventsResponse.setCount(context.integerValue("DescribeSuspEventsResponse.Count"));<NEW_LINE>describeSuspEventsResponse.setPageSize(context.integerValue("DescribeSuspEventsResponse.PageSize"));<NEW_LINE>describeSuspEventsResponse.setTotalCount(context.integerValue("DescribeSuspEventsResponse.TotalCount"));<NEW_LINE>describeSuspEventsResponse.setCurrentPage(context.integerValue("DescribeSuspEventsResponse.CurrentPage"));<NEW_LINE>List<WarningSummary> suspEvents <MASK><NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeSuspEventsResponse.SuspEvents.Length"); i++) {<NEW_LINE>WarningSummary warningSummary = new WarningSummary();<NEW_LINE>warningSummary.setLastTime(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].LastTime"));<NEW_LINE>warningSummary.setOccurrenceTime(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].OccurrenceTime"));<NEW_LINE>warningSummary.setId(context.longValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].Id"));<NEW_LINE>warningSummary.setInstanceName(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].InstanceName"));<NEW_LINE>warningSummary.setInternetIp(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].InternetIp"));<NEW_LINE>warningSummary.setIntranetIp(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].IntranetIp"));<NEW_LINE>warningSummary.setUuid(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].Uuid"));<NEW_LINE>warningSummary.setName(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].Name"));<NEW_LINE>warningSummary.setEventSubType(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].EventSubType"));<NEW_LINE>warningSummary.setLevel(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].Level"));<NEW_LINE>warningSummary.setEventStatus(context.integerValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].EventStatus"));<NEW_LINE>warningSummary.setDesc(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].Desc"));<NEW_LINE>warningSummary.setOperateMsg(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].OperateMsg"));<NEW_LINE>warningSummary.setDataSource(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].DataSource"));<NEW_LINE>warningSummary.setCanBeDealOnLine(context.booleanValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].CanBeDealOnLine"));<NEW_LINE>warningSummary.setSaleVersion(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].SaleVersion"));<NEW_LINE>warningSummary.setAlarmEventType(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].AlarmEventType"));<NEW_LINE>warningSummary.setAlarmEventName(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].AlarmEventName"));<NEW_LINE>warningSummary.setAlarmUniqueInfo(context.stringValue("DescribeSuspEventsResponse.SuspEvents[" + i + "].AlarmUniqueInfo"));<NEW_LINE>suspEvents.add(warningSummary);<NEW_LINE>}<NEW_LINE>describeSuspEventsResponse.setSuspEvents(suspEvents);<NEW_LINE>return describeSuspEventsResponse;<NEW_LINE>} | = new ArrayList<WarningSummary>(); |
1,131,784 | public ControlSet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ControlSet controlSet = new ControlSet();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>controlSet.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>controlSet.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("controls", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>controlSet.setControls(new ListUnmarshaller<Control>(ControlJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return controlSet;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
927,734 | public static QueryDomainByInstanceIdResponse unmarshall(QueryDomainByInstanceIdResponse queryDomainByInstanceIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryDomainByInstanceIdResponse.setRequestId(_ctx.stringValue("QueryDomainByInstanceIdResponse.RequestId"));<NEW_LINE>queryDomainByInstanceIdResponse.setUserId(_ctx.stringValue("QueryDomainByInstanceIdResponse.UserId"));<NEW_LINE>queryDomainByInstanceIdResponse.setDomainName(_ctx.stringValue("QueryDomainByInstanceIdResponse.DomainName"));<NEW_LINE>queryDomainByInstanceIdResponse.setInstanceId(_ctx.stringValue("QueryDomainByInstanceIdResponse.InstanceId"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrationDate(_ctx.stringValue("QueryDomainByInstanceIdResponse.RegistrationDate"));<NEW_LINE>queryDomainByInstanceIdResponse.setExpirationDate(_ctx.stringValue("QueryDomainByInstanceIdResponse.ExpirationDate"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrantOrganization(_ctx.stringValue("QueryDomainByInstanceIdResponse.RegistrantOrganization"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrantName(_ctx.stringValue("QueryDomainByInstanceIdResponse.RegistrantName"));<NEW_LINE>queryDomainByInstanceIdResponse.setEmail(_ctx.stringValue("QueryDomainByInstanceIdResponse.Email"));<NEW_LINE>queryDomainByInstanceIdResponse.setUpdateProhibitionLock<MASK><NEW_LINE>queryDomainByInstanceIdResponse.setTransferProhibitionLock(_ctx.stringValue("QueryDomainByInstanceIdResponse.TransferProhibitionLock"));<NEW_LINE>queryDomainByInstanceIdResponse.setDomainNameProxyService(_ctx.booleanValue("QueryDomainByInstanceIdResponse.DomainNameProxyService"));<NEW_LINE>queryDomainByInstanceIdResponse.setPremium(_ctx.booleanValue("QueryDomainByInstanceIdResponse.Premium"));<NEW_LINE>queryDomainByInstanceIdResponse.setEmailVerificationStatus(_ctx.integerValue("QueryDomainByInstanceIdResponse.EmailVerificationStatus"));<NEW_LINE>queryDomainByInstanceIdResponse.setEmailVerificationClientHold(_ctx.booleanValue("QueryDomainByInstanceIdResponse.EmailVerificationClientHold"));<NEW_LINE>queryDomainByInstanceIdResponse.setRealNameStatus(_ctx.stringValue("QueryDomainByInstanceIdResponse.RealNameStatus"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrantUpdatingStatus(_ctx.stringValue("QueryDomainByInstanceIdResponse.RegistrantUpdatingStatus"));<NEW_LINE>queryDomainByInstanceIdResponse.setTransferOutStatus(_ctx.stringValue("QueryDomainByInstanceIdResponse.TransferOutStatus"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrantType(_ctx.stringValue("QueryDomainByInstanceIdResponse.RegistrantType"));<NEW_LINE>queryDomainByInstanceIdResponse.setDomainNameVerificationStatus(_ctx.stringValue("QueryDomainByInstanceIdResponse.DomainNameVerificationStatus"));<NEW_LINE>queryDomainByInstanceIdResponse.setZhRegistrantOrganization(_ctx.stringValue("QueryDomainByInstanceIdResponse.ZhRegistrantOrganization"));<NEW_LINE>queryDomainByInstanceIdResponse.setZhRegistrantName(_ctx.stringValue("QueryDomainByInstanceIdResponse.ZhRegistrantName"));<NEW_LINE>queryDomainByInstanceIdResponse.setRegistrationDateLong(_ctx.longValue("QueryDomainByInstanceIdResponse.RegistrationDateLong"));<NEW_LINE>queryDomainByInstanceIdResponse.setExpirationDateLong(_ctx.longValue("QueryDomainByInstanceIdResponse.ExpirationDateLong"));<NEW_LINE>List<String> dnsList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryDomainByInstanceIdResponse.DnsList.Length"); i++) {<NEW_LINE>dnsList.add(_ctx.stringValue("QueryDomainByInstanceIdResponse.DnsList[" + i + "]"));<NEW_LINE>}<NEW_LINE>queryDomainByInstanceIdResponse.setDnsList(dnsList);<NEW_LINE>return queryDomainByInstanceIdResponse;<NEW_LINE>} | (_ctx.stringValue("QueryDomainByInstanceIdResponse.UpdateProhibitionLock")); |
874,858 | private Optional<AwsCredentialsProvider> credentialsProvider(Set<String> children) {<NEW_LINE>if (properties.containsKey(ProfileProperty.ROLE_ARN) && properties.containsKey(ProfileProperty.WEB_IDENTITY_TOKEN_FILE)) {<NEW_LINE>return Optional.ofNullable(roleAndWebIdentityTokenProfileCredentialsProvider());<NEW_LINE>}<NEW_LINE>if (properties.containsKey(ProfileProperty.SSO_ROLE_NAME) || properties.containsKey(ProfileProperty.SSO_ACCOUNT_ID) || properties.containsKey(ProfileProperty.SSO_REGION) || properties.containsKey(ProfileProperty.SSO_START_URL)) {<NEW_LINE>return Optional.ofNullable(ssoProfileCredentialsProvider());<NEW_LINE>}<NEW_LINE>if (properties.containsKey(ProfileProperty.ROLE_ARN)) {<NEW_LINE>boolean hasSourceProfile = properties.containsKey(ProfileProperty.SOURCE_PROFILE);<NEW_LINE>boolean hasCredentialSource = properties.containsKey(ProfileProperty.CREDENTIAL_SOURCE);<NEW_LINE>Validate.validState(!(hasSourceProfile && hasCredentialSource), "Invalid profile file: profile has both %s and %s.", ProfileProperty.SOURCE_PROFILE, ProfileProperty.CREDENTIAL_SOURCE);<NEW_LINE>if (hasSourceProfile) {<NEW_LINE>return Optional.ofNullable(roleAndSourceProfileBasedProfileCredentialsProvider(children));<NEW_LINE>}<NEW_LINE>if (hasCredentialSource) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (properties.containsKey(ProfileProperty.CREDENTIAL_PROCESS)) {<NEW_LINE>return Optional.ofNullable(credentialProcessCredentialsProvider());<NEW_LINE>}<NEW_LINE>if (properties.containsKey(ProfileProperty.AWS_SESSION_TOKEN)) {<NEW_LINE>return Optional.of(sessionProfileCredentialsProvider());<NEW_LINE>}<NEW_LINE>if (properties.containsKey(ProfileProperty.AWS_ACCESS_KEY_ID)) {<NEW_LINE>return Optional.of(basicProfileCredentialsProvider());<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | Optional.ofNullable(roleAndCredentialSourceBasedProfileCredentialsProvider()); |
1,440,773 | public void jimplify2(Body b) {<NEW_LINE>b.setLine(this);<NEW_LINE>b.add(b.newEnterMonitorStmt(monitor(b), this));<NEW_LINE>b.addLabel(label_begin());<NEW_LINE>exceptionRanges().add(label_begin());<NEW_LINE>getBlock().jimplify2(b);<NEW_LINE>if (getBlock().canCompleteNormally()) {<NEW_LINE>emitFinallyCode(b);<NEW_LINE>b.add(b.newGotoStmt(label_end(), this));<NEW_LINE>}<NEW_LINE>b.addLabel(label_exception_handler());<NEW_LINE>// emitExceptionHandler<NEW_LINE>Local l = b.newTemp(typeThrowable().getSootType());<NEW_LINE>b.add(b.newIdentityStmt(l, b.newCaughtExceptionRef(this), this));<NEW_LINE>emitFinallyCode(b);<NEW_LINE>b.addLabel(label_end());<NEW_LINE>soot.jimple.Stmt throwStmt = b.newThrowStmt(l, this);<NEW_LINE>throwStmt.addTag(new soot.tagkit.ThrowCreatedByCompilerTag());<NEW_LINE>b.add(throwStmt);<NEW_LINE>// createExceptionTable<NEW_LINE>for (Iterator iter = exceptionRanges().iterator(); iter.hasNext(); ) {<NEW_LINE>soot.jimple.Stmt stmtBegin = (soot.jimple<MASK><NEW_LINE>soot.jimple.Stmt stmtEnd;<NEW_LINE>if (iter.hasNext())<NEW_LINE>stmtEnd = (soot.jimple.Stmt) iter.next();<NEW_LINE>else<NEW_LINE>stmtEnd = label_end();<NEW_LINE>if (stmtBegin != stmtEnd)<NEW_LINE>b.addTrap(typeThrowable(), stmtBegin, stmtEnd, label_exception_handler());<NEW_LINE>}<NEW_LINE>} | .Stmt) iter.next(); |
438,258 | public VAdminProto.GetROStorageFileListResponse handleGetROStorageFileList(VAdminProto.GetROStorageFileListRequest request) {<NEW_LINE>String storeName = request.getStoreName();<NEW_LINE>VAdminProto.GetROStorageFileListResponse.Builder response = VAdminProto.GetROStorageFileListResponse.newBuilder();<NEW_LINE>try {<NEW_LINE>ReadOnlyStorageEngine store = getReadOnlyStorageEngine(metadataStore, storeRepository, storeName);<NEW_LINE>ChunkedFileSet chunkedFileSet = store.getChunkedFileSet();<NEW_LINE>response.addAllFileName(chunkedFileSet.getFileNames());<NEW_LINE>response.<MASK><NEW_LINE>response.addAllDataFileSize(chunkedFileSet.getDataFileSizes());<NEW_LINE>} catch (VoldemortException e) {<NEW_LINE>response.setError(ProtoUtils.encodeError(errorCodeMapper, e));<NEW_LINE>logger.error("handleGetROStorageFileList failed for request(" + request.toString() + ")", e);<NEW_LINE>}<NEW_LINE>return response.build();<NEW_LINE>} | addAllIndexFileSize(chunkedFileSet.getIndexFileSizes()); |
995,146 | private synchronized void fireTreeChange(TreeModelEvent e, int type) {<NEW_LINE>// Event may be null for offscreen info, etc.<NEW_LINE>if (e == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assert (e.getSource() == getModel());<NEW_LINE>TreeModelListener[] listeners;<NEW_LINE>synchronized (this) {<NEW_LINE>listeners = new <MASK><NEW_LINE>listeners = treeListeners.toArray(listeners);<NEW_LINE>}<NEW_LINE>log("fireTreeChange-" + types[type], e);<NEW_LINE>// Now refire it to any listeners<NEW_LINE>for (int i = 0; i < listeners.length; i++) {<NEW_LINE>switch(type) {<NEW_LINE>case NODES_CHANGED:<NEW_LINE>listeners[i].treeNodesChanged(e);<NEW_LINE>break;<NEW_LINE>case NODES_INSERTED:<NEW_LINE>listeners[i].treeNodesInserted(e);<NEW_LINE>break;<NEW_LINE>case NODES_REMOVED:<NEW_LINE>listeners[i].treeNodesRemoved(e);<NEW_LINE>break;<NEW_LINE>case STRUCTURE_CHANGED:<NEW_LINE>listeners[i].treeStructureChanged(e);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | TreeModelListener[treeListeners.size()]; |
64,424 | public IToken nextToken() {<NEW_LINE>try {<NEW_LINE>Symbol symbol;<NEW_LINE>if (fLastWasWhitespace) {<NEW_LINE>symbol = fLastSymbol;<NEW_LINE>fLastWasWhitespace = false;<NEW_LINE>} else {<NEW_LINE>symbol = fLookAheadQueue.poll();<NEW_LINE>if (symbol == null) {<NEW_LINE>symbol = fScanner.nextToken();<NEW_LINE>}<NEW_LINE>// Emulate whitespace token creation.<NEW_LINE>if (symbol.getStart() > fLastSymbol.getEnd() + 1) {<NEW_LINE>fTokenOffset = fLastSymbol.getEnd() + 1;<NEW_LINE>fTokenLen = symbol.getStart() <MASK><NEW_LINE>fLastSymbol = symbol;<NEW_LINE>fLastWasWhitespace = true;<NEW_LINE>return getWhitespace();<NEW_LINE>} else {<NEW_LINE>fLastWasWhitespace = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Note: the mapToken may update the fTokenLen, fTokenOffset internally, so, set<NEW_LINE>// the defaults now.<NEW_LINE>fTokenOffset = symbol.getStart();<NEW_LINE>fTokenLen = symbol.getEnd() - symbol.getStart() + 1;<NEW_LINE>IToken ret = mapToken(symbol);<NEW_LINE>// Only set the last symbol after mapping the token as the last symbol could be used during the mapping.<NEW_LINE>fLastSymbol = symbol;<NEW_LINE>return ret;<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(CommonEditorPlugin.getDefault(), e);<NEW_LINE>return getUndefinedToken();<NEW_LINE>}<NEW_LINE>} | - fLastSymbol.getEnd() - 1; |
465,977 | public static TypedRecordProcessor<ProcessInstanceRecord> addProcessProcessors(final MutableZeebeState zeebeState, final ExpressionProcessor expressionProcessor, final TypedRecordProcessors typedRecordProcessors, final SubscriptionCommandSender subscriptionCommandSender, final CatchEventBehavior catchEventBehavior, final DueDateTimerChecker timerChecker, final EventTriggerBehavior eventTriggerBehavior, final Writers writers, final JobMetrics jobMetrics) {<NEW_LINE>final MutableProcessMessageSubscriptionState subscriptionState = zeebeState.getProcessMessageSubscriptionState();<NEW_LINE>final VariableBehavior variableBehavior = new VariableBehavior(zeebeState.getVariableState(), writers.state(), zeebeState.getKeyGenerator());<NEW_LINE>addProcessInstanceCommandProcessor(typedRecordProcessors, zeebeState.getElementInstanceState());<NEW_LINE>final var bpmnStreamProcessor = new BpmnStreamProcessor(expressionProcessor, catchEventBehavior, variableBehavior, eventTriggerBehavior, zeebeState, writers, jobMetrics);<NEW_LINE>addBpmnStepProcessor(typedRecordProcessors, bpmnStreamProcessor);<NEW_LINE>addMessageStreamProcessors(typedRecordProcessors, subscriptionState, <MASK><NEW_LINE>addTimerStreamProcessors(typedRecordProcessors, timerChecker, zeebeState, catchEventBehavior, eventTriggerBehavior, expressionProcessor, writers);<NEW_LINE>addVariableDocumentStreamProcessors(typedRecordProcessors, variableBehavior, zeebeState.getElementInstanceState(), zeebeState.getKeyGenerator(), writers.state());<NEW_LINE>addProcessInstanceCreationStreamProcessors(typedRecordProcessors, zeebeState, writers, variableBehavior);<NEW_LINE>return bpmnStreamProcessor;<NEW_LINE>} | subscriptionCommandSender, eventTriggerBehavior, zeebeState, writers); |
4,976 | private Object parseValue(GridField field, Object in) {<NEW_LINE>if (in == null)<NEW_LINE>return null;<NEW_LINE>int dt = field.getDisplayType();<NEW_LINE>try {<NEW_LINE>// Return Integer<NEW_LINE>if (dt == DisplayType.Integer || (DisplayType.isID(dt) && field.getColumnName().endsWith("_ID"))) {<NEW_LINE>if (in instanceof Integer)<NEW_LINE>return in;<NEW_LINE>int i = Integer.parseInt(in.toString());<NEW_LINE>return new Integer(i);<NEW_LINE>} else // Return BigDecimal<NEW_LINE>if (DisplayType.isNumeric(dt)) {<NEW_LINE>if (in instanceof BigDecimal)<NEW_LINE>return in;<NEW_LINE>return DisplayType.getNumberFormat(dt).parse(in.toString());<NEW_LINE>} else // Return Timestamp<NEW_LINE>if (DisplayType.isDate(dt)) {<NEW_LINE>if (in instanceof Timestamp)<NEW_LINE>return in;<NEW_LINE>long time = 0;<NEW_LINE>try {<NEW_LINE>time = DisplayType.getDateFormat_JDBC().parse(in.toString()).getTime();<NEW_LINE>return new Timestamp(time);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, in + "(" + in.getClass() + ")" + e);<NEW_LINE>time = DisplayType.getDateFormat(dt).parse(in.toString()).getTime();<NEW_LINE>}<NEW_LINE>return new Timestamp(time);<NEW_LINE>} else // Return Y/N for Boolean<NEW_LINE>if (in instanceof Boolean)<NEW_LINE>return ((Boolean) in).booleanValue() ? "Y" : "N";<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.log(Level.SEVERE, "Object=" + in, ex);<NEW_LINE>String error = ex.getLocalizedMessage();<NEW_LINE>if (error == null || error.length() == 0)<NEW_LINE>error = ex.toString();<NEW_LINE>StringBuffer errMsg = new StringBuffer();<NEW_LINE>errMsg.append(field.getColumnName()).append(" = ").append(in).append(" - ").append(error);<NEW_LINE>//<NEW_LINE>ADialog.error(0, this, <MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return in;<NEW_LINE>} | "ValidationError", errMsg.toString()); |
1,753,251 | public synchronized boolean recordPacket(AVPacket pkt) throws Exception {<NEW_LINE>if (ifmt_ctx == null) {<NEW_LINE>throw new Exception("No input format context (Has start(AVFormatContext) been called?)");<NEW_LINE>}<NEW_LINE>if (!started) {<NEW_LINE>throw new Exception("start() was not called successfully!");<NEW_LINE>}<NEW_LINE>if (pkt == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AVStream in_stream = ifmt_ctx.streams(pkt.stream_index());<NEW_LINE>// pkt.dts(AV_NOPTS_VALUE);<NEW_LINE>// pkt.pts(AV_NOPTS_VALUE);<NEW_LINE>pkt.pos(-1);<NEW_LINE>if (in_stream.codecpar().codec_type() == AVMEDIA_TYPE_VIDEO && video_st != null) {<NEW_LINE>pkt.stream_index(video_st.index());<NEW_LINE>pkt.duration((int) av_rescale_q(pkt.duration(), in_stream.time_base()<MASK><NEW_LINE>// Increase pts calculation<NEW_LINE>pkt.pts(av_rescale_q_rnd(pkt.pts(), in_stream.time_base(), video_st.time_base(), (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)));<NEW_LINE>// Increase dts calculation<NEW_LINE>pkt.dts(av_rescale_q_rnd(pkt.dts(), in_stream.time_base(), video_st.time_base(), (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)));<NEW_LINE>writePacket(AVMEDIA_TYPE_VIDEO, pkt);<NEW_LINE>} else if (in_stream.codecpar().codec_type() == AVMEDIA_TYPE_AUDIO && audio_st != null && (audioChannels > 0)) {<NEW_LINE>pkt.stream_index(audio_st.index());<NEW_LINE>pkt.duration((int) av_rescale_q(pkt.duration(), in_stream.time_base(), audio_st.time_base()));<NEW_LINE>// Increase pts calculation<NEW_LINE>pkt.pts(av_rescale_q_rnd(pkt.pts(), in_stream.time_base(), audio_st.time_base(), (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)));<NEW_LINE>// Increase dts calculation<NEW_LINE>pkt.dts(av_rescale_q_rnd(pkt.dts(), in_stream.time_base(), audio_st.time_base(), (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)));<NEW_LINE>writePacket(AVMEDIA_TYPE_AUDIO, pkt);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | , video_st.time_base())); |
1,476,864 | public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {<NEW_LINE>Log.d("KP2AK", "clicked item: " + items.get(item).key);<NEW_LINE>if (items.get(item).value.startsWith("KP2ASPECIAL")) {<NEW_LINE>// change entry<NEW_LINE>Log.d("KP2AK", "clicked item: " + items.get(item).value);<NEW_LINE>String packageName = getApplicationContext().getPackageName();<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><MASK><NEW_LINE>}<NEW_LINE>Kp2aDialog.this.finish();<NEW_LINE>} | KP2AKeyboard.CurrentlyRunningService.commitStringForTyping(theItem); |
255,697 | public AuthenticatedUser execute(CommandContext ctxt) throws CommandException {<NEW_LINE>if (!(getUser() instanceof AuthenticatedUser) || !getUser().isSuperuser()) {<NEW_LINE>throw new PermissionException(<MASK><NEW_LINE>}<NEW_LINE>if (userToDeactivate == null) {<NEW_LINE>throw new CommandException("Cannot deactivate user. User not found.", this);<NEW_LINE>}<NEW_LINE>ctxt.engine().submit(new RevokeAllRolesCommand(userToDeactivate, request));<NEW_LINE>ctxt.authentication().removeAuthentictedUserItems(userToDeactivate);<NEW_LINE>ctxt.notifications().findByUser(userToDeactivate.getId()).forEach(ctxt.notifications()::delete);<NEW_LINE>userToDeactivate.setDeactivated(true);<NEW_LINE>userToDeactivate.setDeactivatedTime(new Timestamp(new Date().getTime()));<NEW_LINE>AuthenticatedUser deactivatedUser = ctxt.authentication().save(userToDeactivate);<NEW_LINE>return deactivatedUser;<NEW_LINE>} | "Deactivate user command can only be called by superusers.", this, null, null); |
213,132 | public void loadFrom(Preferences preferences) {<NEW_LINE>assert !EventQueue.isDispatchThread();<NEW_LINE>final OutputOptions diskData = new OutputOptions(false);<NEW_LINE>String fontFamily = preferences.get(PREFIX + PROP_FONT_FAMILY, getDefaultFont().getFamily());<NEW_LINE>int fontSize = preferences.getInt(PREFIX + PROP_FONT_SIZE, getDefaultFont().getSize());<NEW_LINE>int fontStyle = preferences.getInt(PREFIX + PROP_FONT_STYLE, getDefaultFont().getStyle());<NEW_LINE>diskData.setFont(new Font(fontFamily, fontStyle, fontSize));<NEW_LINE>int fontSizeWrapped = preferences.getInt(PREFIX + PROP_FONT_SIZE_WRAP, getDefaultFont().getSize());<NEW_LINE>diskData.setFontForWrappedMode(getDefaultFont().deriveFont((float) fontSizeWrapped));<NEW_LINE>loadColors(preferences, diskData);<NEW_LINE>String linkStyleStr = // NOI18N<NEW_LINE>preferences.// NOI18N<NEW_LINE>get(// NOI18N<NEW_LINE>PREFIX + PROP_STYLE_LINK, "UNDERLINE");<NEW_LINE>try {<NEW_LINE>diskData.setLinkStyle(LinkStyle.valueOf(linkStyleStr));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.INFO, "Invalid link style {0}", linkStyleStr);<NEW_LINE>}<NEW_LINE>EventQueue.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>assign(diskData);<NEW_LINE>synchronized (OutputOptions.this) {<NEW_LINE>initialized = true;<NEW_LINE>}<NEW_LINE>pcs.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | firePropertyChange(PROP_INITIALIZED, false, true); |
730,431 | private void createTranslationInfo(Composite composite) {<NEW_LINE>Composite translation = new Composite(composite, SWT.NONE);<NEW_LINE>GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(translation);<NEW_LINE>GridLayoutFactory.fillDefaults().margins(5, 5).numColumns(1).applyTo(translation);<NEW_LINE>addSectionLabel(translation, Messages.IntroLabelTranslation);<NEW_LINE>StyledLabel text = new StyledLabel(translation, SWT.WRAP);<NEW_LINE><MASK><NEW_LINE>GridDataFactory.fillDefaults().indent(3, 0).hint(400, SWT.DEFAULT).applyTo(text);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(translation, "action:opensettings", Messages.IntroChangeLanguageInPreferences, null);<NEW_LINE>addSectionLabel(translation, Messages.PrefTitleDivvyDiary);<NEW_LINE>text = new StyledLabel(translation, SWT.WRAP);<NEW_LINE>text.setText(Messages.PrefDescriptionDivvyDiary);<NEW_LINE>GridDataFactory.fillDefaults().indent(3, 0).hint(400, SWT.DEFAULT).applyTo(text);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>addLink(translation, "action:opensettings", Messages.LabelSettings + "...", null);<NEW_LINE>} | text.setText(Messages.IntroLabelTranslationInfo); |
828,320 | final DisassociateCustomerGatewayResult executeDisassociateCustomerGateway(DisassociateCustomerGatewayRequest disassociateCustomerGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateCustomerGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DisassociateCustomerGatewayRequest> request = null;<NEW_LINE>Response<DisassociateCustomerGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateCustomerGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateCustomerGatewayRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateCustomerGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateCustomerGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateCustomerGatewayResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
474,457 | public Long bitOp(BitOperation op, byte[] destination, byte[]... keys) {<NEW_LINE>Assert.notNull(op, "BitOperation must not be null!");<NEW_LINE><MASK><NEW_LINE>if (op == BitOperation.NOT && keys.length > 1) {<NEW_LINE>throw new UnsupportedOperationException("Bitop NOT should only be performed against one key");<NEW_LINE>}<NEW_LINE>return connection.invoke().just(it -> {<NEW_LINE>switch(op) {<NEW_LINE>case AND:<NEW_LINE>return it.bitopAnd(destination, keys);<NEW_LINE>case OR:<NEW_LINE>return it.bitopOr(destination, keys);<NEW_LINE>case XOR:<NEW_LINE>return it.bitopXor(destination, keys);<NEW_LINE>case NOT:<NEW_LINE>if (keys.length != 1) {<NEW_LINE>throw new UnsupportedOperationException("Bitop NOT should only be performed against one key");<NEW_LINE>}<NEW_LINE>return it.bitopNot(destination, keys[0]);<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Bit operation " + op + " is not supported");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Assert.notNull(destination, "Destination key must not be null!"); |
1,530,269 | public BytesRef next() throws IOException {<NEW_LINE>if (++ord >= entry.termsDictSize) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if ((ord & blockMask) == 0L) {<NEW_LINE>if (this.entry.compressed) {<NEW_LINE>decompressBlock();<NEW_LINE>} else {<NEW_LINE>term.length = bytes.readVInt();<NEW_LINE>bytes.readBytes(term.bytes, 0, term.length);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>DataInput input = this.entry.compressed ? blockInput : bytes;<NEW_LINE>final int token = Byte.toUnsignedInt(input.readByte());<NEW_LINE>int prefixLength = token & 0x0F;<NEW_LINE>int suffixLength = 1 + (token >>> 4);<NEW_LINE>if (prefixLength == 15) {<NEW_LINE>prefixLength += input.readVInt();<NEW_LINE>}<NEW_LINE>if (suffixLength == 16) {<NEW_LINE>suffixLength += input.readVInt();<NEW_LINE>}<NEW_LINE>term.length = prefixLength + suffixLength;<NEW_LINE>input.readBytes(<MASK><NEW_LINE>}<NEW_LINE>return term;<NEW_LINE>} | term.bytes, prefixLength, suffixLength); |
1,624,420 | private void add(Point point) throws IllegalStateException {<NEW_LINE>checkState(!_done, "Computation of spherical excess is complete");<NEW_LINE>double phi = toRadians(point.getY());<NEW_LINE>double tan = Math.tan(phi / 2);<NEW_LINE>double longitude = toRadians(point.getX());<NEW_LINE>// We need to check for that specifically<NEW_LINE>// Otherwise calculating the bearing is not deterministic<NEW_LINE>if (longitude == _previousLongitude && phi == _previousPhi) {<NEW_LINE>throw new RuntimeException("Polygon is not valid: it has two identical consecutive vertices");<NEW_LINE>}<NEW_LINE>double deltaLongitude = longitude - _previousLongitude;<NEW_LINE>_sphericalExcess += 2 * Math.atan2(Math.tan(deltaLongitude / 2) * (_previousTan + tan), 1 + _previousTan * tan);<NEW_LINE>double cos = Math.cos(phi);<NEW_LINE>double sin = Math.sin(phi);<NEW_LINE>double sinOfDeltaLongitude = Math.sin(deltaLongitude);<NEW_LINE>double cosOfDeltaLongitude = Math.cos(deltaLongitude);<NEW_LINE>// Initial bearing from previous to current<NEW_LINE>double y = sinOfDeltaLongitude * cos;<NEW_LINE>double x = _previousCos <MASK><NEW_LINE>double initialBearing = (Math.atan2(y, x) + TWO_PI) % TWO_PI;<NEW_LINE>// Final bearing from previous to current = opposite of bearing from current to previous<NEW_LINE>double finalY = -sinOfDeltaLongitude * _previousCos;<NEW_LINE>double finalX = _previousSin * cos - _previousCos * sin * cosOfDeltaLongitude;<NEW_LINE>double finalBearing = (Math.atan2(finalY, finalX) + PI) % TWO_PI;<NEW_LINE>// When processing our first point we don't yet have a _previousFinalBearing<NEW_LINE>if (_firstPoint) {<NEW_LINE>// So keep our initial bearing around, and we'll use it at the end<NEW_LINE>// with the last final bearing<NEW_LINE>_firstInitialBearing = initialBearing;<NEW_LINE>_firstPoint = false;<NEW_LINE>} else {<NEW_LINE>_courseDelta += (initialBearing - _previousFinalBearing + THREE_PI) % TWO_PI - PI;<NEW_LINE>}<NEW_LINE>_courseDelta += (finalBearing - initialBearing + THREE_PI) % TWO_PI - PI;<NEW_LINE>_previousFinalBearing = finalBearing;<NEW_LINE>_previousCos = cos;<NEW_LINE>_previousSin = sin;<NEW_LINE>_previousPhi = phi;<NEW_LINE>_previousTan = tan;<NEW_LINE>_previousLongitude = longitude;<NEW_LINE>} | * sin - _previousSin * cos * cosOfDeltaLongitude; |
1,536,294 | public void check() throws SQLException {<NEW_LINE>super.check();<NEW_LINE>select.setWhereClause(null);<NEW_LINE>String originalQueryString = OceanBaseVisitor.asString(select);<NEW_LINE>List<String> resultSet = ComparatorHelper.getResultSetFirstColumnAsString(originalQueryString, errors, state);<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setOrderByExpressions(gen.generateOrderBys());<NEW_LINE>}<NEW_LINE>select.setOrderByExpressions(Collections.emptyList());<NEW_LINE>select.setWhereClause(predicate);<NEW_LINE>String <MASK><NEW_LINE>select.setWhereClause(negatedPredicate);<NEW_LINE>String secondQueryString = OceanBaseVisitor.asString(select);<NEW_LINE>select.setWhereClause(isNullPredicate);<NEW_LINE>String thirdQueryString = OceanBaseVisitor.asString(select);<NEW_LINE>List<String> combinedString = new ArrayList<>();<NEW_LINE>List<String> secondResultSet = ComparatorHelper.getCombinedResultSet(firstQueryString, secondQueryString, thirdQueryString, combinedString, Randomly.getBoolean(), state, errors);<NEW_LINE>ComparatorHelper.assumeResultSetsAreEqual(resultSet, secondResultSet, originalQueryString, combinedString, state);<NEW_LINE>} | firstQueryString = OceanBaseVisitor.asString(select); |
374,734 | public static DescibeImportsFromDatabaseResponse unmarshall(DescibeImportsFromDatabaseResponse descibeImportsFromDatabaseResponse, UnmarshallerContext _ctx) {<NEW_LINE>descibeImportsFromDatabaseResponse.setRequestId(_ctx.stringValue("DescibeImportsFromDatabaseResponse.RequestId"));<NEW_LINE>descibeImportsFromDatabaseResponse.setTotalRecordCount(_ctx.integerValue("DescibeImportsFromDatabaseResponse.TotalRecordCount"));<NEW_LINE>descibeImportsFromDatabaseResponse.setPageNumber<MASK><NEW_LINE>descibeImportsFromDatabaseResponse.setPageRecordCount(_ctx.integerValue("DescibeImportsFromDatabaseResponse.PageRecordCount"));<NEW_LINE>List<ImportResultFromDB> items = new ArrayList<ImportResultFromDB>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescibeImportsFromDatabaseResponse.Items.Length"); i++) {<NEW_LINE>ImportResultFromDB importResultFromDB = new ImportResultFromDB();<NEW_LINE>importResultFromDB.setImportId(_ctx.integerValue("DescibeImportsFromDatabaseResponse.Items[" + i + "].ImportId"));<NEW_LINE>importResultFromDB.setImportDataType(_ctx.stringValue("DescibeImportsFromDatabaseResponse.Items[" + i + "].ImportDataType"));<NEW_LINE>importResultFromDB.setImportDataStatus(_ctx.stringValue("DescibeImportsFromDatabaseResponse.Items[" + i + "].ImportDataStatus"));<NEW_LINE>importResultFromDB.setImportDataStatusDescription(_ctx.stringValue("DescibeImportsFromDatabaseResponse.Items[" + i + "].ImportDataStatusDescription"));<NEW_LINE>importResultFromDB.setIncrementalImportingTime(_ctx.stringValue("DescibeImportsFromDatabaseResponse.Items[" + i + "].IncrementalImportingTime"));<NEW_LINE>items.add(importResultFromDB);<NEW_LINE>}<NEW_LINE>descibeImportsFromDatabaseResponse.setItems(items);<NEW_LINE>return descibeImportsFromDatabaseResponse;<NEW_LINE>} | (_ctx.integerValue("DescibeImportsFromDatabaseResponse.PageNumber")); |
1,091,147 | public void execute() throws BuildException {<NEW_LINE>if (classes == null) {<NEW_LINE>throw new BuildException("root of classes must be specified!");<NEW_LINE>}<NEW_LINE>File master = new File(new File(classes, "META-INF"), "net.java.html.js.classes");<NEW_LINE>if (!master.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LinkedList<URL> arr = new LinkedList<>();<NEW_LINE>boolean foundAsm = false;<NEW_LINE>for (String s : cp.list()) {<NEW_LINE>final File f = FileUtils.getFileUtils().resolveFile(getProject().getBaseDir(), s);<NEW_LINE>if (f != null) {<NEW_LINE>if (f.getName().contains("asm")) {<NEW_LINE>foundAsm = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>arr.add(f.<MASK><NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundAsm) {<NEW_LINE>URL loc;<NEW_LINE>if (asm == null || !asm.exists()) {<NEW_LINE>throw new BuildException("Cannot find asm!");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>loc = asm.toURI().toURL();<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>throw new BuildException(ex);<NEW_LINE>}<NEW_LINE>arr.addFirst(loc);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>arr.addFirst(classes.toURI().toURL());<NEW_LINE>URLClassLoader l = new URLClassLoader(arr.toArray(new URL[arr.size()]));<NEW_LINE>processClasses(l, master, classes);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new BuildException("Problem converting JavaScriptXXX annotations", ex);<NEW_LINE>}<NEW_LINE>} | toURI().toURL()); |
758,431 | public Object decodeFrame(ByteBuf frame) {<NEW_LINE>byte b0 = frame.readByte();<NEW_LINE>byte b1 = frame.readByte();<NEW_LINE>if (ProtocolConstants.MAGIC_CODE_BYTES[0] != b0 || ProtocolConstants.MAGIC_CODE_BYTES[1] != b1) {<NEW_LINE>throw new IllegalArgumentException("Unknown magic code: " + b0 + ", " + b1);<NEW_LINE>}<NEW_LINE>byte version = frame.readByte();<NEW_LINE>// TODO check version compatible here<NEW_LINE>int fullLength = frame.readInt();<NEW_LINE>short headLength = frame.readShort();<NEW_LINE>byte messageType = frame.readByte();<NEW_LINE>byte codecType = frame.readByte();<NEW_LINE><MASK><NEW_LINE>int requestId = frame.readInt();<NEW_LINE>RpcMessage rpcMessage = new RpcMessage();<NEW_LINE>rpcMessage.setCodec(codecType);<NEW_LINE>rpcMessage.setId(requestId);<NEW_LINE>rpcMessage.setCompressor(compressorType);<NEW_LINE>rpcMessage.setMessageType(messageType);<NEW_LINE>// direct read head with zero-copy<NEW_LINE>int headMapLength = headLength - ProtocolConstants.V1_HEAD_LENGTH;<NEW_LINE>if (headMapLength > 0) {<NEW_LINE>Map<String, String> map = HeadMapSerializer.getInstance().decode(frame, headMapLength);<NEW_LINE>rpcMessage.getHeadMap().putAll(map);<NEW_LINE>}<NEW_LINE>// read body<NEW_LINE>if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_REQUEST) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PING);<NEW_LINE>} else if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_RESPONSE) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PONG);<NEW_LINE>} else {<NEW_LINE>int bodyLength = fullLength - headLength;<NEW_LINE>if (bodyLength > 0) {<NEW_LINE>byte[] bs = new byte[bodyLength];<NEW_LINE>frame.readBytes(bs);<NEW_LINE>Compressor compressor = CompressorFactory.getCompressor(compressorType);<NEW_LINE>bs = compressor.decompress(bs);<NEW_LINE>Serializer serializer = SerializerServiceLoader.load(SerializerType.getByCode(rpcMessage.getCodec()));<NEW_LINE>rpcMessage.setBody(serializer.deserialize(bs));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rpcMessage;<NEW_LINE>} | byte compressorType = frame.readByte(); |
1,600,975 | private static void drawStaticNewRevision(final AbstractSunburstGUI pGUI, final PGraphics pGraphic) {<NEW_LINE>assert pGraphic != null;<NEW_LINE>if (pGUI.mDepthMax > pGUI.mOldDepthMax + 1) {<NEW_LINE>pGraphic.pushMatrix();<NEW_LINE>pGraphic.textAlign(PConstants.LEFT, PConstants.CENTER);<NEW_LINE>float <MASK><NEW_LINE>if (pGUI.mParent.recorder != null) {<NEW_LINE>drawRevision(pGUI, pGUI.mParent.recorder, arcRadius);<NEW_LINE>}<NEW_LINE>drawRevision(pGUI, pGraphic, arcRadius);<NEW_LINE>final String text = new StringBuilder("changed nodes in revision ").append(pGUI.mSelectedRev).append(" from revision ").append(pGUI.mOldSelectedRev).toString();<NEW_LINE>arcRadius = pGUI.calcEqualAreaRadius(pGUI.mDepthMax - 1, pGUI.mDepthMax);<NEW_LINE>arcRadius += (pGUI.calcEqualAreaRadius(pGUI.mDepthMax, pGUI.mDepthMax) - arcRadius) / 2;<NEW_LINE>pGraphic.stroke(0f);<NEW_LINE>pGraphic.fill(400f);<NEW_LINE>final float arc = draw(pGraphic, text, arcRadius, 0, EDisplay.NO, EReverseDirection.NO);<NEW_LINE>final float theta = PConstants.PI + 0.5f * PConstants.PI - 0.5f * arc;<NEW_LINE>if (pGUI.mParent.recorder != null) {<NEW_LINE>draw(pGUI.mParent.recorder, text, arcRadius, theta, EDisplay.YES, EReverseDirection.NO);<NEW_LINE>}<NEW_LINE>draw(pGraphic, text, arcRadius, theta, EDisplay.YES, EReverseDirection.NO);<NEW_LINE>pGraphic.popMatrix();<NEW_LINE>}<NEW_LINE>} | arcRadius = calculateNewRadius(pGUI, pGraphic); |
317,116 | public static void bookmarkRun(P p, R r, String name, int id) {<NEW_LINE>// Find the index<NEW_LINE>int index = p.getContent().indexOf(r);<NEW_LINE>if (index < 0) {<NEW_LINE>System.out.println("P does not contain R!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ObjectFactory factory = Context.getWmlObjectFactory();<NEW_LINE>BigInteger ID = BigInteger.valueOf(id);<NEW_LINE>// Add bookmark end first<NEW_LINE><MASK><NEW_LINE>mr.setId(ID);<NEW_LINE>JAXBElement<CTMarkupRange> bmEnd = factory.createBodyBookmarkEnd(mr);<NEW_LINE>p.getContent().add(index + 1, bmEnd);<NEW_LINE>// Next, bookmark start<NEW_LINE>CTBookmark bm = factory.createCTBookmark();<NEW_LINE>bm.setId(ID);<NEW_LINE>bm.setName(name);<NEW_LINE>JAXBElement<CTBookmark> bmStart = factory.createBodyBookmarkStart(bm);<NEW_LINE>p.getContent().add(index, bmStart);<NEW_LINE>} | CTMarkupRange mr = factory.createCTMarkupRange(); |
472,347 | private synchronized void disconnect(Channel channel, boolean awaitCompletion, boolean cancelPendingRequests, Throwable cause) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("disconnecting channel: " + channel);<NEW_LINE>}<NEW_LINE>Channel channelToClose = null;<NEW_LINE>Map<Integer, Callback<List<MASK><NEW_LINE>ChannelFuture channelFutureToCancel = null;<NEW_LINE>synchronized (channelFutureLock) {<NEW_LINE>if (stopping && channelFuture != null) {<NEW_LINE>channelFutureToCancel = channelFuture;<NEW_LINE>channelFuture = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (channelFutureToCancel != null) {<NEW_LINE>channelFutureToCancel.cancel(true);<NEW_LINE>}<NEW_LINE>if (channel != null) {<NEW_LINE>if (cause != null) {<NEW_LINE>LOG.debug("Disconnect {} due to {}", channel, cause.getClass().getName() + cause.getMessage());<NEW_LINE>} else {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Disconnect {}", this.channel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>channelToClose = channel;<NEW_LINE>this.channel = null;<NEW_LINE>if (cancelPendingRequests) {<NEW_LINE>// Remove all pending requests (will be canceled after relinquishing<NEW_LINE>// write lock).<NEW_LINE>requestsToCancel = new ConcurrentHashMap<Integer, Callback<List<ByteBuffer>>>(requests);<NEW_LINE>requests.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Cancel any pending requests by sending errors to the callbacks:<NEW_LINE>if ((requestsToCancel != null) && !requestsToCancel.isEmpty()) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Removing " + requestsToCancel.size() + " pending request(s).");<NEW_LINE>}<NEW_LINE>for (Callback<List<ByteBuffer>> request : requestsToCancel.values()) {<NEW_LINE>request.handleError(cause != null ? cause : new IOException(getClass().getSimpleName() + " closed"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Close the channel:<NEW_LINE>if (channelToClose != null) {<NEW_LINE>ChannelFuture closeFuture = channelToClose.close();<NEW_LINE>if (awaitCompletion && (closeFuture != null)) {<NEW_LINE>closeFuture.awaitUninterruptibly(connectTimeoutMillis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | <ByteBuffer>>> requestsToCancel = null; |
1,446,506 | public void marshall(FileSystem fileSystem, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (fileSystem == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(fileSystem.getOwnerId(), OWNERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getFileSystemId(), FILESYSTEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getFileSystemType(), FILESYSTEMTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getLifecycle(), LIFECYCLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getFailureDetails(), FAILUREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getStorageCapacity(), STORAGECAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getStorageType(), STORAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getVpcId(), VPCID_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getSubnetIds(), SUBNETIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getNetworkInterfaceIds(), NETWORKINTERFACEIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getDNSName(), DNSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getKmsKeyId(), KMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getResourceARN(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(fileSystem.getLustreConfiguration(), LUSTRECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getAdministrativeActions(), ADMINISTRATIVEACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getOntapConfiguration(), ONTAPCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getFileSystemTypeVersion(), FILESYSTEMTYPEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(fileSystem.getOpenZFSConfiguration(), OPENZFSCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | fileSystem.getWindowsConfiguration(), WINDOWSCONFIGURATION_BINDING); |
75,622 | private void checkKerberosEnv() {<NEW_LINE>String krb5File = PropertyUtils.getString(JAVA_SECURITY_KRB5_CONF_PATH);<NEW_LINE>Boolean kerberosStartupState = PropertyUtils.getBoolean(HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE, false);<NEW_LINE>if (kerberosStartupState && StringUtils.isNotBlank(krb5File)) {<NEW_LINE>System.setProperty(JAVA_SECURITY_KRB5_CONF, krb5File);<NEW_LINE>try {<NEW_LINE>Config.refresh();<NEW_LINE>Class<?> kerberosName = Class.forName("org.apache.hadoop.security.authentication.util.KerberosName");<NEW_LINE>Field field = kerberosName.getDeclaredField("defaultRealm");<NEW_LINE>field.setAccessible(true);<NEW_LINE>field.set(null, Config.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Update Kerberos environment failed.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getInstance().getDefaultRealm()); |
676,948 | public static void dump(OutputStream w, ObjectFile objFile) {<NEW_LINE>// Better to hack the indexes?<NEW_LINE>Iterator<Pair<NodeId, Node>> iter = all(objFile);<NEW_LINE>long count = 0;<NEW_LINE>try (IndentedWriter iw = new IndentedWriter(w)) {<NEW_LINE>if (!iter.hasNext()) {<NEW_LINE>iw.println("No nodes in the .dat file");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (; iter.hasNext(); ) {<NEW_LINE>Pair<NodeId, Node> pair = iter.next();<NEW_LINE>iw.print(pair.<MASK><NEW_LINE>iw.print(" : ");<NEW_LINE>// iw.print(pair.cdr()) ;<NEW_LINE>Node n = pair.cdr();<NEW_LINE>String $ = stringForNode(n);<NEW_LINE>iw.print($);<NEW_LINE>iw.println();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>iw.println();<NEW_LINE>iw.printf("Total: " + count);<NEW_LINE>iw.println();<NEW_LINE>iw.flush();<NEW_LINE>}<NEW_LINE>} | car().toString()); |
251,095 | public DataxTaskExecutionContext generateExtendedContext(ResourceParametersHelper parametersHelper) {<NEW_LINE>DataxTaskExecutionContext dataxTaskExecutionContext = new DataxTaskExecutionContext();<NEW_LINE>if (customConfig == Flag.YES.ordinal()) {<NEW_LINE>return dataxTaskExecutionContext;<NEW_LINE>}<NEW_LINE>DataSourceParameters dbSource = (DataSourceParameters) parametersHelper.getResourceParameters(ResourceType.DATASOURCE, dataSource);<NEW_LINE>DataSourceParameters dbTarget = (DataSourceParameters) parametersHelper.<MASK><NEW_LINE>if (Objects.nonNull(dbSource)) {<NEW_LINE>dataxTaskExecutionContext.setDataSourceId(dataSource);<NEW_LINE>dataxTaskExecutionContext.setSourcetype(dbSource.getType());<NEW_LINE>dataxTaskExecutionContext.setSourceConnectionParams(dbSource.getConnectionParams());<NEW_LINE>}<NEW_LINE>if (Objects.nonNull(dbTarget)) {<NEW_LINE>dataxTaskExecutionContext.setDataTargetId(dataTarget);<NEW_LINE>dataxTaskExecutionContext.setTargetType(dbTarget.getType());<NEW_LINE>dataxTaskExecutionContext.setTargetConnectionParams(dbTarget.getConnectionParams());<NEW_LINE>}<NEW_LINE>return dataxTaskExecutionContext;<NEW_LINE>} | getResourceParameters(ResourceType.DATASOURCE, dataTarget); |
1,144,477 | protected void doApply(ApiRequest request, IPolicyContext context, IPListConfig config, IPolicyChain<ApiRequest> chain) {<NEW_LINE>String remoteAddr = getRemoteAddr(request, config);<NEW_LINE>if (isMatch(config, remoteAddr)) {<NEW_LINE>super.doApply(request, context, config, chain);<NEW_LINE>} else {<NEW_LINE>IPolicyFailureFactoryComponent ffactory = context.getComponent(IPolicyFailureFactoryComponent.class);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String msg = Messages.i18n.format("IPWhitelistPolicy.NotWhitelisted", remoteAddr);<NEW_LINE>PolicyFailure failure = ffactory.createFailure(PolicyFailureType.Other, PolicyFailureCodes.IP_NOT_WHITELISTED, msg);<NEW_LINE>failure.setResponseCode(config.getResponseCode());<NEW_LINE>if (config.getResponseCode() == 404) {<NEW_LINE>failure.setType(PolicyFailureType.NotFound);<NEW_LINE>} else if (config.getResponseCode() == 403) {<NEW_LINE><MASK><NEW_LINE>} else if (config.getResponseCode() == 0) {<NEW_LINE>failure.setResponseCode(500);<NEW_LINE>}<NEW_LINE>chain.doFailure(failure);<NEW_LINE>}<NEW_LINE>} | failure.setType(PolicyFailureType.Authorization); |
1,352,659 | public void watch(final Path file) {<NEW_LINE>// Make a config for the dir above it and<NEW_LINE>// include a match only for the given path<NEW_LINE>// using all defaults for the configuration<NEW_LINE>Path abs = file;<NEW_LINE>if (!abs.isAbsolute()) {<NEW_LINE>abs = file.toAbsolutePath();<NEW_LINE>}<NEW_LINE>// Check we don't already have a config for the parent directory.<NEW_LINE>// If we do, add in this filename.<NEW_LINE>Config config = null;<NEW_LINE><MASK><NEW_LINE>for (Config c : configs) {<NEW_LINE>if (c.getPath().equals(parent)) {<NEW_LINE>config = c;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make a new config<NEW_LINE>if (config == null) {<NEW_LINE>config = new Config(abs.getParent());<NEW_LINE>// the include for the directory itself<NEW_LINE>config.addIncludeGlobRelative("");<NEW_LINE>// add the include for the file<NEW_LINE>config.addIncludeGlobRelative(file.getFileName().toString());<NEW_LINE>watch(config);<NEW_LINE>} else<NEW_LINE>// add the include for the file<NEW_LINE>config.addIncludeGlobRelative(file.getFileName().toString());<NEW_LINE>} | Path parent = abs.getParent(); |
1,221,438 | final DescribeContainerInstancesResult executeDescribeContainerInstances(DescribeContainerInstancesRequest describeContainerInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeContainerInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeContainerInstancesRequest> request = null;<NEW_LINE>Response<DescribeContainerInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeContainerInstancesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeContainerInstancesRequest));<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, "ECS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeContainerInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeContainerInstancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeContainerInstancesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
976,143 | // implement RelOptRule<NEW_LINE>public void onMatch(RelOptRuleCall call) {<NEW_LINE>LogicalCalc calc = call.rel(0);<NEW_LINE>// Expand decimals in every expression in this program. If no<NEW_LINE>// expression changes, don't apply the rule.<NEW_LINE>final RexProgram program = calc.getProgram();<NEW_LINE>if (!RexUtil.requiresDecimalExpansion(program, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RexBuilder rexBuilder = calc.getCluster().getRexBuilder();<NEW_LINE>final RexShuttle shuttle = new DecimalShuttle(rexBuilder);<NEW_LINE>RexProgramBuilder programBuilder = RexProgramBuilder.create(rexBuilder, calc.getInput().getRowType(), program.getExprList(), program.getProjectList(), program.getCondition(), program.<MASK><NEW_LINE>final RexProgram newProgram = programBuilder.getProgram();<NEW_LINE>LogicalCalc newCalc = LogicalCalc.create(calc.getInput(), newProgram);<NEW_LINE>call.transformTo(newCalc);<NEW_LINE>} | getOutputRowType(), shuttle, true); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.