commit | 43d124c212b9fb9e1b5403704ce0803587ed3335 | [log] [tgz] |
---|---|---|
author | Helin Shiah <helin.shiah@gmail.com> | Fri Feb 04 21:43:59 2022 +0000 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 04 21:43:59 2022 +0000 |
tree | b22c2e9ad7614a3e1ed4227c9a7f7ba3d250aeb1 | |
parent | 07a5def205f80caaab3aac4c422e71fb217523b8 [diff] |
Fix Java code generation for lookup URI methods The java generation for type `(string|Null)[]` was creating `@return one of <code>List<String></code> or <code>ElementList<Null></code>` see example: ``` @SuppressWarnings({"WeakerAccess", "unused"}) public class UriList extends Response { public UriList(JsonObject json) { super(json); } /** * A list of URIs. * * @return one of <code>List<String></code> or <code>ElementList<Null></code> */ public Object getUris() { final JsonObject elem = (JsonObject)json.get("uris"); if (elem == null) return null; if (elem.get("type").getAsString().equals("String")) return new String(elem); if (elem.get("type").getAsString().equals("Null")) return new Null(elem); return null; } ``` My change is the simplest thing I could think of, just making the return type `List<String>` instead and allowing some of the elements to be null. But I'm happy to implement something else if someone has a suggestion for a better type (along with how to get the generate code to produce it) Closes https://github.com/dart-lang/sdk/pull/48309 https://github.com/dart-lang/sdk/pull/48309 TEST=N/A GitOrigin-RevId: fa9dddad68219e697998c4a011a82d6860f44bfb Change-Id: I79cf2aedf0672354a2fd28c8962740f6fcea4f4c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231740 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.