profile
viewpoint

square/javapoet 8509

A Java API for generating .java source files.

square/dagger 7235

A fast dependency injector for Android and Java.

tbroyer/gradle-errorprone-plugin-v0.0.x 351

Gradle plugin to use the error-prone compiler for Java

tbroyer/gradle-apt-plugin 296

[OBSOLETE] Gradle plugin making it easier/safer to use Java annotation processors

tbroyer/gradle-errorprone-plugin 190

Gradle plugin to use the error-prone compiler for Java (as a javac plugin)

tbroyer/bullet 75

Provides Dagger1-like ObjectGraph API around Dagger2 Components

jcgregorio/rst2rfc 3

Utility to convert ReST markup to XML for xml2rfc

issue commentgoogle/google-java-format

Before commit reformatting option in IntelliJ does invoke plugin

Also observing the same issue. The workaround with the codestyle.xml is nice, but the formatting can be wildly different. Especially regarding annotations (on single line, annotation indentation, ...) so the workaround is in the end not really sufficient as you still have to always apply the style either manually or via a maven plugin.

mqzry

comment created time in an hour

issue commentgoogle/error-prone

RemoveUnusedImports is not working

Thanks @cushon this option worked for me. The only challenge is it is taking 2 passes

  1. In the first pass it removed my stale flag but imports are not imported.
  2. In the second pass it removed the unused imports.
cnarsimharaju

comment created time in 7 hours

issue closedgoogle/compile-testing

[feature request] support assert generate multi source file.

My annotation processor generate multi file for a annotationed class. If I use com.google.testing.compile.CompilationSubject#generatedSourceFile to test it. It said:

expected to generate file: /io/github/vipcxj/beanknife/tests/otherbeans/TestBean1Meta.java
in location              : SOURCE_OUTPUT
it generated:
  /SOURCE_OUTPUT/io/github/vipcxj/beanKnfie/tests/otherbeans/TestBean1Meta.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanknife/tests/beans/TestBean1Meta.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanKnfie/tests/otherbeans/ViewOfTestBean1.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanknife/tests/beans/ViewOfTestBean1.java

	at io.github.vipcxj.beanknife.tests.ViewMetaProcessorTest.testViewMetaCase(ViewMetaProcessorTest.java:50)
	at io.github.vipcxj.beanknife.tests.ViewMetaProcessorTest.testBean1(ViewMetaProcessorTest.java:18)

And I can't find a method to support this use case.

closed time in a day

vipcxj

issue commentgoogle/compile-testing

[feature request] support assert generate multi source file.

My fault, beanKnfie is not equal to beanknife

vipcxj

comment created time in a day

issue openedgoogle/compile-testing

[feature request] support assert generate multi source file.

My annotation processor generate multi file for a annotationed class. If I use com.google.testing.compile.CompilationSubject#generatedSourceFile to test it. It said:

expected to generate file: /io/github/vipcxj/beanknife/tests/otherbeans/TestBean1Meta.java
in location              : SOURCE_OUTPUT
it generated:
  /SOURCE_OUTPUT/io/github/vipcxj/beanKnfie/tests/otherbeans/TestBean1Meta.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanknife/tests/beans/TestBean1Meta.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanKnfie/tests/otherbeans/ViewOfTestBean1.java
  /SOURCE_OUTPUT/io/github/vipcxj/beanknife/tests/beans/ViewOfTestBean1.java

	at io.github.vipcxj.beanknife.tests.ViewMetaProcessorTest.testViewMetaCase(ViewMetaProcessorTest.java:50)
	at io.github.vipcxj.beanknife.tests.ViewMetaProcessorTest.testBean1(ViewMetaProcessorTest.java:18)

And I can't find a method to support this use case.

created time in a day

push eventgoogle/error-prone

travis-ci

commit sha 272e6c690e772bce545241be5335ebb73a6d7c32

Latest docs on successful travis build 2817 auto-pushed to gh-pages

view details

push time in a day

delete branch google/error-prone

delete branch : test_343657126

delete time in a day

PR merged google/error-prone

Add a new bug checker to suggest using immutable collection when the collection is not mutated. cla: yes

Add a new bug checker to suggest using immutable collection when the collection is not mutated.

For now only tacking list and limiting to cases where mutable generic type is initialized with an immutable type.

+216 -0

0 comment

3 changed files

copybara-service[bot]

pr closed time in a day

push eventgoogle/error-prone

Ashish Kedia

commit sha aeafd79184b5ef0f8f8bd43980f2c21369449845

Add a new bug checker to suggest using immutable collection when the collection is not mutated. For now only tacking list and limiting to cases where mutable generic type is initialized with an immutable type. PiperOrigin-RevId: 344389214

view details

push time in a day

push eventgoogle/error-prone

Ashish Kedia

commit sha aeafd79184b5ef0f8f8bd43980f2c21369449845

Add a new bug checker to suggest using immutable collection when the collection is not mutated. For now only tacking list and limiting to cases where mutable generic type is initialized with an immutable type. PiperOrigin-RevId: 344389214

view details

push time in a day

create barnchgoogle/error-prone

branch : test_343657126

created branch time in a day

PR opened google/error-prone

Add a new bug checker to suggest using immutable collection when the collection is not mutated.

Add a new bug checker to suggest using immutable collection when the collection is not mutated.

For now only tacking list and limiting to cases where mutable generic type is initialized with an immutable type.

+216 -0

0 comment

3 changed files

pr created time in a day

Pull request review commentgoogle/google-java-format

Check build with JDK 16-ea

 jobs:         shell: bash         run: mvn test -B +  early_access:+    name: 'JDK Early-Access'+    continue-on-error: true

Ah, thanks for clarifying. I'll go ahead and merge this.

sormuras

comment created time in 2 days

issue commentgoogle/google-java-format

Publish snapshot artifacts to Sonatype fails

I'll take care of it, thanks for confirming!

sormuras

comment created time in 2 days

issue commentgoogle/google-java-format

Publish snapshot artifacts to Sonatype fails

... there's a separate step that sets the env variable to the 'secret': ...

Aye. That env section is missing. Do you want to add those two lines directly or should I create a PR?

      - name: 'Publish'
        env:
          CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
          CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
        run: mvn source:jar deploy -B -DskipTests=true -Dinvoker.skip=true -Dmaven.javadoc.skip=true
sormuras

comment created time in 2 days

Pull request review commentgoogle/google-java-format

Check build with JDK 16-ea

 jobs:         shell: bash         run: mvn test -B +  early_access:+    name: 'JDK Early-Access'+    continue-on-error: true

It did work as expected on the branch of my forked repository. See https://github.com/google/google-java-format/issues/538#issuecomment-733933661

Just this PR was marked as failed -- perhaps it would work after merging to master.

sormuras

comment created time in 2 days

startedtbroyer/gradle-errorprone-plugin

started time in 2 days

Pull request review commentgoogle/google-java-format

Check build with JDK 16-ea

 jobs:         shell: bash         run: mvn test -B +  early_access:+    name: 'JDK Early-Access'+    continue-on-error: true

Hmm. Is continue-on-error definitely supported for the entire job, or does it need to be on the affected steps? I saw a few examples of the latter looking at other github actions configs. Although, from https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/ it definitely sounds like it's supposed to work on the job.

sormuras

comment created time in 2 days

issue commentgoogle/google-java-format

Publish snapshot artifacts to Sonatype fails

Looking at the example in those docs, MAVEN_USERNAME is commented as being an env variable, and there's a separate step that sets the env variable to the 'secret':

      env:
        MAVEN_USERNAME: maven_username123
        MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

Maybe we need to add a similar env: section, or else use e.g. ${{ secrets. CI_DEPLOY_USERNAME }} directly?

sormuras

comment created time in 2 days

push eventgoogle/j2cl

Roberto Lublinerman

commit sha eabe1fc095c4c58232bc0a666e60e77fca0401a7

Add a workaround for jscompiler bug involving nested labels. PiperOrigin-RevId: 344317275

view details

push time in 2 days

Pull request review commentgoogle/google-java-format

Check build with JDK 16-ea

 jobs:         shell: bash         run: mvn test -B +  early_access:+    name: 'JDK Early-Access'+    continue-on-error: true

According to continue-on-error's documentation, it should work... 🤔

sormuras

comment created time in 2 days

Pull request review commentgoogle/google-java-format

Check build with JDK 16-ea

 jobs:         shell: bash         run: mvn test -B +  early_access:+    name: 'JDK Early-Access'+    continue-on-error: true

This doesn't prevent the workflow from being marked as a failed. See https://github.com/actions/toolkit/issues/399 for details

sormuras

comment created time in 2 days

PR opened google/google-java-format

Check build with JDK 16-ea

Addresses https://github.com/google/google-java-format/issues/538#issuecomment-733522202

+25 -0

0 comment

1 changed file

pr created time in 2 days

issue commentgoogle/google-java-format

Running on Java 16 fails

Preparing a PR here: https://github.com/sormuras/google-java-format/runs/1455621338 -- the JDK Early-Access job fails as expected with the error message shown in the issue description.

The overall workflow is marked as successful. image

Although the JDK Early-Access job failed. image

sormuras

comment created time in 2 days

issue commentgoogle/dagger

Compiler errors on java 11

Update

So, in a successful build we would have:

  • Processing round 1
    • ModuleProcessingStep: Defers processing ApplicationModule (It references DataBindingComponent, which is not yet valid).
  • Processing round 2
    • ModuleProcessingStep: Processes ApplicationModule (DataBindingComponent is now valid -- generated in round 1)

However, in Java 11 with kapt something is going wrong.

In processing round 2, DataBindingComponent is not a valid type (even though DataBindingComponent appears to be generated at some point). This means that calling TypeMirror#getKind() on the type returns an ERROR kind rather than a DECLARED kind. Weirdly though, SuperficialValidation thinks the DataBindingComponent type is valid because rather than checking its TypeMirror#getKind(), it uses a TypeVisitor, which is incorrectly visiting #visitDeclared() even though the corresponding type is an ErrorType. I can't find specific documentation, but this definitely seems like another related bug, since I would expect it to visit #visitError() in this case.

So what does this mean for Dagger?

From Dagger's perspective, we initially think DataBindingComponent is valid in round 2 because of the bug in the visitor, so we go ahead and process ApplicationModule. Then, we realize the provides method is actually returning an ErrorType and we fail with the error message in https://github.com/google/dagger/issues/2144#issuecomment-712436284.

Again, I don't think there's much Dagger can really do in this case. We're relying on the underlying type system, so if the type is invalid we can't really make it valid. This appears to be a deeper issue between kapt and java 11.

You can try filing a bug with kapt, although I'm not sure if the project is still actively fixing issues.

You might also want to file a bug with the androidx.databinding library. For example, this doesn't seem to be a in issue with other generated types like AutoValue. For example:

@Module
class ApplicationModule {
  @AutoValue static abstract class Foo {}

  // This type is valid with kapt and java 11
  @Provides
  AutoValue_ApplicationModule_Foo provideFooAutoValue() {
      return new AutoValue_ApplicationModule_Foo();
  }

  // This type is invalid with kapt and java 11
  @Provides
  DataBindingComponent provideDataBindingComponent() {
      return new DataBindingComponent() {...};
  }
}

Possible Workarounds

  1. Avoid binding DataBindingComponent directly, and either extend or wrap it Instead (see https://github.com/google/dagger/issues/2144#issuecomment-731908754). However, note that this is really just a hack that relies on the fact that Dagger currently doesn't inspect the super types directly, but the underlying bug is still there and may cause issues later if Dagger starts relying on it.
  2. Avoid using kapt in this situation -- it works with annotationProcessor
  3. Avoid using java 11 in this situation -- it works with java 8.
auras

comment created time in 2 days

issue openedgoogle/google-java-format

Publish snapshot artifacts to Sonatype fails

The deployment of snapshot artifacts failed due to a 401 Unauthorized error: https://github.com/google/google-java-format/runs/1455239922

Note: a run on a fork reports "green", as the publish step is skipped: https://github.com/sormuras/google-java-format/actions/runs/383909185

These are the lines in question that trigger the upload:

https://github.com/google/google-java-format/blob/c1dd08d349b098f4bceb5b71aa1d6c2251de4f6d/.github/workflows/ci.yml#L50-L58

Reading https://github.com/actions/setup-java#publishing-using-apache-maven again, I think that all required credentials are given, passed, and written to correct configuration files. It should, if it worked, render the util/settings.xml superseded.

created time in 2 days

push eventgoogle/j2cl

Roberto Lublinerman

commit sha b08a53f3a041bb2dd8bc581f6cc362cb2dbf1233

Add integration test fora a labeled statement that is not a looping construct. PiperOrigin-RevId: 344284637

view details

push time in 2 days

push eventgoogle/google-java-format

Christian Stein

commit sha c1dd08d349b098f4bceb5b71aa1d6c2251de4f6d

Introduce GitHub Actions based CI workflow This PR introduces a CI workflow using GitHub Actions and removes the Travis CI configuration file. Find new workflow runs for this PR here: https://github.com/sormuras/google-java-format/actions #### TODO - [x] Email [Notifications](https://docs.github.com/en/free-pro-team@latest/github/managing-subscriptions-and-notifications-on-github/configuring-notifications) -- register `google-java-format-dev+ci@google.com` as a watcher or let each interested use register themself? - [ ] Test publish snapshot job on `google:master` -- after storing credential [secrets](https://github.com/google/google-java-format/settings/secrets/actions). - [ ] Remove AppVeyor [integration](https://github.com/google/google-java-format/settings/installations) and delete `appveyor.yml` configuration file. Closes #543 Fixes #544 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/google-java-format/pull/544 from sormuras:github-action a689f6234aed2e32bd7aca093b92e391ac6c8170 PiperOrigin-RevId: 344280060

view details

push time in 2 days

PR closed google/google-java-format

Introduce GitHub Actions based CI workflow cla: yes

This PR introduces a CI workflow using GitHub Actions and removes the Travis CI configuration file.

Find new workflow runs for this PR here: https://github.com/sormuras/google-java-format/actions

TODO

  • [x] Email Notifications -- register google-java-format-dev+ci@google.com as a watcher or let each interested use register themself?
  • [ ] Test publish snapshot job on google:master -- after storing credential secrets.
  • [ ] Remove AppVeyor integration and delete appveyor.yml configuration file.

Closes #543

+58 -42

4 comments

2 changed files

sormuras

pr closed time in 2 days

issue closedgoogle/google-java-format

Introduce GitHub Actions based CI workflow

...and drop Travis CI support. See also https://travis-ci.community/t/download-of-jdk-11-and-jdk-14-times-out-intermittently/10647 and linked issues.

Happy to provide a PR.

closed time in 2 days

sormuras
more