GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(ast): array expressions by diegomarquezp · Pull Request #1080 · googleapis/sdk-platform-java

This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Conversation

@diegomarquezp

@diegomarquezp diegomarquezp commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

Copy of #1070 but to be merged in main

Added ArrayExpr to allow anonymous arrays (e.g. {"value1", "value2"}). Same type validation is enforced (e.g. {"string1", 1.2f} is not allowed).
AnnotationNode now allows an ArrayExpr as a single description. For multiple descriptions, a wrapping AssignmentExpr is still needed.

This PR is to help generate annotations with an anonymous array like this @EnableConfigurationProperties({LanguageProperties.class, SharedProperties.class})

It also enables assignments to arrays in the form String[] arr = {"str1", "str2"} - both arr and the anon array should be of type TypeNode.arrayOf(TypeNode.STRING) for this example (arrayOf() was also introduced in this PR)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
diegomarquezp added 8 commits November 2, 2022 18:18
@diegomarquezp
feat(ast): anonymous arrays for annotations
f7b2696
@diegomarquezp
feat(ast): add convenience methods in anon array
9c7790a
@diegomarquezp
feat(annotation): allow adding anon arrays
e216d4b
@diegomarquezp
fix: fixed comments, test util class
94834e5
@diegomarquezp
feat(ast): arrays to allow VarExp and ValueExpr
c7b94a4
@diegomarquezp
fix(ast): add description only for assignments
6a8733e
@diegomarquezp
fix(ast): comment correction, test array assignmnt
f905175
@diegomarquezp
feat(test): test anon array assignment
1871714
@diegomarquezp
diegomarquezp requested review from a team and blakeli0 November 2, 2022 18:24
@diegomarquezp
fix(license): add licenses
546258f
blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 reviewed Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/TypeNode.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp
diegomarquezp commented Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp
diegomarquezp commented Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp
diegomarquezp commented Nov 3, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 2 commits November 3, 2022 20:43
@diegomarquezp
fix(ast): various fixes
ecbc526
* Perform validation in build()
* Ensure type() to be explicitly set
* Expose add Expr, but validate that they are either ValueExpr or
  VariableExpr
@diegomarquezp
fix(ast): ArrayExpr ImportWriterVisitor fix & test
14bf374
@diegomarquezp
diegomarquezp requested a review from blakeli0 November 3, 2022 21:06
blakeli0
blakeli0 reviewed Nov 7, 2022
View reviewed changes
Comment thread src/main/java/com/google/api/generator/engine/ast/ArrayExpr.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@diegomarquezp
fix: remove unecessary comment
25a52b4
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

88.0% 88.0% Coverage
0.0% 0.0% Duplication

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

blakeli0
blakeli0 approved these changes Nov 7, 2022
View reviewed changes
@diegomarquezp
diegomarquezp merged commit bd9532c into main Nov 7, 2022
@diegomarquezp
diegomarquezp deleted the autoconfig-gen-draft2-array-annotation branch November 7, 2022 21:33
@release-please release-please Bot mentioned this pull request Nov 7, 2022
chore(main): release 2.11.0 #1081
Merged
suztomo pushed a commit that referenced this pull request Dec 16, 2022
@diegomarquezp
feat(ast): array expressions (#1080)
802199e
* feat(ast): anonymous arrays for annotations

* feat(ast): add convenience methods in anon array

* feat(annotation): allow adding anon arrays

* fix: fixed comments, test util class

* feat(ast): arrays to allow VarExp and ValueExpr

* fix(ast): add description only for assignments

* fix(ast): comment correction, test array assignmnt

* feat(test): test anon array assignment

* fix(license): add licenses

* fix(ast): various fixes

* Perform validation in build()
* Ensure type() to be explicitly set
* Expose add Expr, but validate that they are either ValueExpr or
  VariableExpr

* fix(ast): ArrayExpr ImportWriterVisitor fix & test

* fix: remove unecessary comment
suztomo pushed a commit that referenced this pull request Mar 21, 2023
@gcf-owl-bot @alicejli
fix(java): skip fixing poms for special modules (#1744) (#1080)
2644959
fix(java): handle empty modules

Fixes googleapis/synthtool#1743
Source-Link: googleapis/synthtool@482d649
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bd5071596a47614d1fe15eb766c4255bae330f823b606e1196a3b0c8d2e96fd1

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Alice <[email protected]>
suztomo pushed a commit that referenced this pull request Mar 21, 2023
@release-please
chore(main): release 2.9.4 (#1088)
7c23f7f
🤖 I have created a release *beep* *boop*
---


## [2.9.4](https://togithub.com/googleapis/java-core/compare/v2.9.3...v2.9.4) (2023-01-20)


### Bug Fixes

* **java:** Skip fixing poms for special modules ([#1744](https://togithub.com/googleapis/java-core/issues/1744)) ([#1080](https://togithub.com/googleapis/java-core/issues/1080)) ([2644959](https://togithub.com/googleapis/java-core/commit/264495978c2e8608ee555a0422a2f68aa5dc1757))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@blakeli0 blakeli0 blakeli0 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@diegomarquezp @blakeli0
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.