You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by shils <gi...@git.apache.org> on 2015/07/29 18:15:43 UTC
[GitHub] incubator-groovy pull request: GROOVY-7509 removed import static a...
GitHub user shils opened a pull request:
https://github.com/apache/incubator-groovy/pull/76
GROOVY-7509 removed import static alias statements from stubs, replac…
…ed usages with fqn
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shils/incubator-groovy GROOVY-7509
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-groovy/pull/76.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #76
----
commit c682210cf2f117690a865fae46d456367d4a245b
Author: Shil Sinha <sh...@gmail.com>
Date: 2015-07-29T15:58:36Z
GROOVY-7509 removed import static alias statements from stubs, replaced usages with fqn
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35987069
--- Diff: src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java ---
@@ -925,7 +931,8 @@ private void printImports(PrintWriter out, ClassNode classNode) {
imports.addAll(Arrays.asList(ResolveVisitor.DEFAULT_IMPORTS));
for (Map.Entry<String, ImportNode> entry : moduleNode.getStaticImports().entrySet()) {
- imports.add("static "+entry.getValue().getType().getName()+"."+entry.getKey());
+ if (entry.getKey().equals(entry.getValue().getFieldName()))
--- End diff --
I'm rethinking my comment now. I thought it'd be better to include the non-aliased name, but that could cause a problem if it was aliased to work around a name conflict. I'm thinking now what you did is the right thing.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35913738
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
I'm just testing for successful compilation here - this test is a variant of the one in Groovy7366Bug.groovy.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r36213864
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
You're right. I'm not sure what test report I was reading. Maybe I had tested without your annotation or something. Sorry for the false alarm.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r36015780
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
OK. If it does, let me know. Maybe something's goofed up in my environment.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35874858
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
I think you forgot to add your assertions.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r36202258
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
I just ran the test on Master and it failed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35878035
--- Diff: src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java ---
@@ -925,7 +931,8 @@ private void printImports(PrintWriter out, ClassNode classNode) {
imports.addAll(Arrays.asList(ResolveVisitor.DEFAULT_IMPORTS));
for (Map.Entry<String, ImportNode> entry : moduleNode.getStaticImports().entrySet()) {
- imports.add("static "+entry.getValue().getType().getName()+"."+entry.getKey());
+ if (entry.getKey().equals(entry.getValue().getFieldName()))
--- End diff --
Could this just be
```java
imports.add("static " + entry.getValue().getType().getName() + "." + entry.getValue().getFieldName());
```
without the conditional?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35987130
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
I know you just copied what was done previously, but I think we can do better. If we exclude aliased static imports (which I'm now thinking is right to do), then I'd like us to use the assertions I made in Jira comment, but negate them. As the test is now, it passes both with and without your changes. That's not very useful.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35997632
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
+ package test;
+ public @interface MyAnnotation {
+ String value();
+ }
+ ''',
+
+ 'Test.groovy': '''
+ package test
+ import static test.Constants.C1 as C2
+ @MyAnnotation(C2)
+ class Test {
+ def test
+ Test(test) {
+ this.test = test
+ }
+ }
+ ''',
+
+ 'SomeJavaClass.java': '''
+ package test;
+ public class SomeJavaClass {
+ Test test;
+ }
+ '''
+ ]
+ }
+
+ void verifyStubs() {
+
--- End diff --
If I remember correctly, the test shouldn't pass without my changes. I can't verify right now (don't have access to a computer at the moment), but that's something I specifically tested for. In any case, making those assertions explicit might clear things up so I'll make those changes when I can.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35913731
--- Diff: src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java ---
@@ -925,7 +931,8 @@ private void printImports(PrintWriter out, ClassNode classNode) {
imports.addAll(Arrays.asList(ResolveVisitor.DEFAULT_IMPORTS));
for (Map.Entry<String, ImportNode> entry : moduleNode.getStaticImports().entrySet()) {
- imports.add("static "+entry.getValue().getType().getName()+"."+entry.getKey());
+ if (entry.getKey().equals(entry.getValue().getFieldName()))
--- End diff --
I'm using a strategy similar to the one used for regular imports - excluding aliased static imports, and replacing their occurrences with their fully qualified names.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by keeganwitt <gi...@git.apache.org>.
Github user keeganwitt commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r35873566
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
--- End diff --
Could we simplify the test a little and just refer to the constant directly rather than through an annotation?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-groovy/pull/76
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-groovy pull request: GROOVY-7509 Problem With Stub Gener...
Posted by shils <gi...@git.apache.org>.
Github user shils commented on a diff in the pull request:
https://github.com/apache/incubator-groovy/pull/76#discussion_r37591308
--- Diff: src/test/org/codehaus/groovy/tools/stubgenerator/ImportStaticAliasTest.groovy ---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.tools.stubgenerator
+
+class ImportStaticAliasTest extends StringSourcesStubTestCase {
+
+ Map<String, String> provideSources() {
+ [
+ 'Constants.java': '''
+ package test;
+ public class Constants {
+ public static final String C1 = "c1";
+ }
+ ''',
+
+ 'MyAnnotation.java': '''
--- End diff --
Never addressed this - the constant is referred to through an annotation so that its usage appears in stubs.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---